/* Designed for everyone: large text, big buttons, strong contrast.
   Sizes use rem so the Text size setting scales the whole app. */
:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --line: #d9dee5;
  --soft: #eef1f5;
  --brand: #1f3a5f;
  --brand-ink: #ffffff;
  --accent: #1f7a4d;
  --accent-ink: #ffffff;
  --accent-soft: #e2f3ea;
  --warn: #b42318;
  --warn-soft: #fdecea;
  --ft: #5b3fa0;
  --ft-soft: #eee8fa;
  --radius: 16px;
  --nav-h: 3.5rem;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1319;
    --card: #18212b;
    --text: #f2f5f8;
    --muted: #b3bfcc;
    --line: #2d3946;
    --soft: #202a35;
    --brand: #9cc0ec;
    --brand-ink: #0e1319;
    --accent: #4cc38a;
    --accent-ink: #0e1319;
    --accent-soft: #163327;
    --warn: #ff8a75;
    --warn-soft: #3b1d18;
    --ft: #c2a8f5;
    --ft-soft: #2a2140;
    --shadow: none;
    color-scheme: dark;
  }
}

html { font-size: 18px; }
html.text-large { font-size: 20px; }
html.text-xlarge { font-size: 23px; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }
button, input, textarea, select { font-family: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---------- header ---------- */
header.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  padding: calc(env(safe-area-inset-top) + .8rem) 1rem .6rem;
  display: flex; align-items: center; gap: .5rem;
  border-bottom: 1px solid transparent;
}
header.top .titles { flex: 1; min-width: 0; }
header.top .brand { display: flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
header.top .brand img { width: 1.2rem; height: 1.2rem; border-radius: .3rem; }
header.top h1 { font-size: 1.6rem; line-height: 1.2; margin: 0; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header.top .back {
  display: inline-flex; align-items: center; gap: .2rem; min-height: 2.8rem; padding: 0 .6rem 0 .2rem;
  font-size: 1rem; font-weight: 700; text-decoration: none; color: var(--brand);
}
header.top .back span { font-size: 1.6rem; line-height: 1; }
.subtitle { color: var(--muted); margin: 0 0 1rem; font-size: .95rem; }

main { padding: .2rem 1rem calc(var(--nav-h) + env(safe-area-inset-bottom) + 6rem); }

/* ---------- bottom tabs ---------- */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 10px rgba(16, 24, 40, .05);
}
nav.tabs .inner { max-width: 560px; margin: 0 auto; display: flex; height: var(--nav-h); }
nav.tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 700; position: relative; gap: .1rem;
}
nav.tabs a svg { width: 1.35rem; height: 1.35rem; }
nav.tabs a.on { color: var(--brand); }
nav.tabs a.on::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.dot { position: absolute; top: .55rem; left: calc(50% + .55rem); width: .7rem; height: .7rem; border-radius: 50%; background: var(--warn); border: 2px solid var(--card); }

/* ---------- cards and lists ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; margin: 0 0 .9rem; box-shadow: var(--shadow);
}
.card > b:first-child { font-size: 1.05rem; }
h2.section { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.6rem .2rem .6rem; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; font-size: 1.05rem; }
.empty .big { font-size: 2.6rem; display: block; margin-bottom: .4rem; }
.hint { color: var(--muted); font-size: .92rem; }
.error { color: var(--warn); font-size: .95rem; font-weight: 600; margin: 0 0 .8rem; }
.error:empty { display: none; }

.list .item { display: flex; align-items: center; gap: .8rem; padding: .8rem 0; border-bottom: 1px solid var(--line); min-height: 3.6rem; }
.list .item:last-child { border-bottom: 0; }
.list .item .grow { flex: 1; min-width: 0; }
.list .item .sub { color: var(--muted); font-size: .88rem; }
a.item, .item-link { color: inherit; text-decoration: none; }
.item-link { display: flex; align-items: center; gap: .8rem; flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--muted); font-size: 1.4rem; }

.avatar {
  width: 2.6rem; height: 2.6rem; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .95rem;
  background: var(--soft); color: var(--text);
}

/* ---------- shift cards ---------- */
.shift { display: flex; flex-wrap: wrap; gap: .9rem; padding: 1rem; }
.shift .full { flex-basis: 100%; min-width: 0; }
.shift .full > :first-child { margin-top: 0; }
.shift .datebox {
  flex: none; width: 4.2rem; border-radius: 12px; text-align: center; padding: .45rem 0;
  background: var(--soft); align-self: flex-start;
}
.shift .datebox .dow { font-size: .75rem; font-weight: 800; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.shift .datebox .day { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.shift .datebox .mon { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.shift .datebox.today { background: var(--brand); color: var(--brand-ink); }
.shift .datebox.today .dow, .shift .datebox.today .mon { color: inherit; opacity: .85; }
.shift .body { flex: 1; min-width: 0; }
.shift .when { font-weight: 800; font-size: 1.15rem; }
.shift .event { font-size: 1.05rem; margin-top: .1rem; }
.shift .where { color: var(--muted); font-size: .95rem; }
.shift .notes { font-size: .95rem; margin-top: .5rem; white-space: pre-wrap; background: var(--soft); border-radius: 10px; padding: .5rem .7rem; }
.shift .meta { color: var(--muted); font-size: .85rem; margin-top: .5rem; }
.shift .pills { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.shift .actions { display: flex; flex-direction: column; gap: .5rem; margin-top: .8rem; }

.pill { display: inline-flex; align-items: center; gap: .25rem; font-size: .8rem; font-weight: 800; padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; }
.pill.open { background: var(--accent-soft); color: var(--accent); }
.pill.taken { background: var(--soft); color: var(--muted); }
.pill.mine { background: var(--brand); color: var(--brand-ink); }
.pill.ft { background: var(--ft-soft); color: var(--ft); }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 0; border-radius: 14px; padding: .8rem 1.1rem; min-height: 3.1rem;
  font: inherit; font-size: 1.02rem; font-weight: 800; cursor: pointer; text-align: center; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--brand); color: var(--brand-ink);
}
.btn:active { transform: translateY(1px); filter: brightness(.95); }
.btn.green { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: var(--card); color: var(--brand); border: 2px solid var(--line); }
.btn.danger { background: var(--warn-soft); color: var(--warn); }
.btn.small { padding: .45rem .8rem; min-height: 2.6rem; font-size: .9rem; border-radius: 11px; }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; }

.fab {
  position: fixed; z-index: 9; right: max(1rem, calc(50% - 264px)); left: max(1rem, calc(50% - 264px));
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + .9rem);
  border-radius: 16px; min-height: 3.5rem; font-size: 1.1rem; box-shadow: 0 6px 20px rgba(16, 24, 40, .22);
}

.seg { display: flex; background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: .25rem; margin: 0 0 1rem; }
.seg button {
  flex: 1; border: 0; background: transparent; min-height: 2.8rem; border-radius: 11px;
  font: inherit; font-size: .98rem; font-weight: 700; color: var(--muted); cursor: pointer;
}
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg .count { display: inline-block; min-width: 1.4rem; padding: 0 .35rem; margin-left: .3rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .78rem; line-height: 1.4rem; }

/* ---------- forms ---------- */
label.field { display: block; margin: 0 0 1rem; font-size: .95rem; font-weight: 700; color: var(--text); }
label.field input, label.field textarea, label.field select {
  display: block; width: 100%; margin-top: .35rem; font: inherit; font-size: 1.05rem; color: var(--text);
  padding: .75rem .85rem; min-height: 3.1rem; border-radius: 12px; border: 2px solid var(--line); background: var(--card);
}
label.field input:focus, label.field textarea:focus { border-color: var(--brand); outline: none; }
label.field .hint { font-weight: 400; }
.two { display: flex; gap: .7rem; }
.two > * { flex: 1; min-width: 0; }

.choice { display: flex; flex-direction: column; gap: .6rem; margin: .4rem 0 1rem; }
.choice label {
  display: block; border: 2px solid var(--line); border-radius: 14px; padding: .8rem .9rem; cursor: pointer;
  color: var(--text); background: var(--card); position: relative; padding-left: 2.8rem;
}
.choice label::before { content: ""; position: absolute; left: .9rem; top: 1rem; width: 1.2rem; height: 1.2rem; border-radius: 50%; border: 2px solid var(--muted); }
.choice label b { display: block; font-size: 1.02rem; }
.choice label span { color: var(--muted); font-size: .9rem; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label:has(input:checked) { border-color: var(--brand); background: var(--soft); }
.choice label:has(input:checked)::before { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 3px var(--card); }

.toggle { display: flex; align-items: center; gap: .8rem; padding: .85rem 0; border-bottom: 1px solid var(--line); cursor: pointer; min-height: 3.4rem; }
.toggle:last-child { border-bottom: 0; }
.toggle .grow { flex: 1; font-weight: 600; }
.toggle .sub { color: var(--muted); font-size: .88rem; font-weight: 400; }
.toggle input { appearance: none; width: 3.3rem; height: 2rem; border-radius: 999px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: .2rem; left: .2rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(1.3rem); }

/* ---------- welcome / help ---------- */
.welcome { background: var(--brand); color: var(--brand-ink); border: 0; }
.welcome h3 { margin: 0 0 .3rem; font-size: 1.15rem; }
.welcome p { margin: 0 0 .8rem; opacity: .92; }
.welcome .btn { background: var(--brand-ink); color: var(--brand); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1rem 3rem; min-height: 2.4rem; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.steps li b { display: block; }
.sizes { display: flex; gap: .5rem; }
.sizes button { flex: 1; border: 2px solid var(--line); background: var(--card); color: var(--text); border-radius: 12px; min-height: 3.2rem; font-weight: 800; cursor: pointer; }
.sizes button.on { border-color: var(--brand); background: var(--soft); }
.sizes button:nth-child(1) { font-size: 16px; }
.sizes button:nth-child(2) { font-size: 19px; }
.sizes button:nth-child(3) { font-size: 23px; }

/* ---------- chat list ---------- */
.mover { display: flex; flex-direction: column; gap: .2rem; }
.mover button { border: 0; background: var(--soft); color: var(--muted); border-radius: 8px; width: 2.2rem; height: 1.7rem; font-size: .7rem; cursor: pointer; }
.icon-btn { border: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-size: 1.15rem; min-width: 2.8rem; min-height: 2.8rem; cursor: pointer; color: var(--text); }
.emoji-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 1rem; }
.emoji-row label { cursor: pointer; }
.emoji-row input { position: absolute; opacity: 0; pointer-events: none; }
.emoji-row span { display: flex; width: 2.8rem; height: 2.8rem; align-items: center; justify-content: center; font-size: 1.4rem; border-radius: 12px; border: 2px solid var(--line); background: var(--card); }
.emoji-row input:checked + span { border-color: var(--brand); background: var(--soft); }

/* ---------- chat ---------- */
.chat-wrap { display: flex; flex-direction: column; }
.msgs { flex: 1; padding-bottom: .5rem; }
.msg { margin: 0 0 .8rem; max-width: 88%; }
.msg .who { font-size: .82rem; color: var(--muted); margin: 0 0 .2rem .3rem; }
.msg .who b { color: var(--text); }
.msg .bubble { background: var(--card); border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; padding: .6rem .85rem; word-wrap: break-word; cursor: pointer; box-shadow: var(--shadow); }
.msg .bubble .text { white-space: pre-wrap; font-size: 1.02rem; }
.msg.me { margin-left: auto; }
.msg.me .who { text-align: right; margin-right: .3rem; }
.msg.me .bubble { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); border-radius: 18px 18px 6px 18px; }
.msg img { display: block; max-width: 100%; border-radius: 12px; margin: .1rem 0 .3rem; cursor: zoom-in; }
.bubble a { color: inherit; text-decoration: underline; }
.mention { font-weight: 800; color: var(--ft); }
.msg.me .mention { color: inherit; text-decoration: underline; }
.quote { border-left: 4px solid var(--ft); padding: .2rem .6rem; margin: 0 0 .4rem; font-size: .88rem; border-radius: 4px; background: rgba(127,127,127,.13); cursor: pointer; }
.quote b { display: block; font-size: .8rem; }
.msg.me .quote { border-left-color: currentColor; }
.reacts { display: flex; flex-wrap: wrap; gap: .3rem; margin: .3rem .2rem 0; }
.msg.me .reacts { justify-content: flex-end; }
.react { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: .15rem .6rem; min-height: 2rem; font: inherit; font-size: .9rem; cursor: pointer; }
.react.mine { border-color: var(--brand); background: var(--ft-soft); }
.msg.flash .bubble { animation: flash 1.2s; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 4px var(--ft); } 100% { box-shadow: none; } }
.tap-hint { text-align: center; color: var(--muted); font-size: .82rem; margin: 0 0 .8rem; }
.searchbar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 0 .8rem; font-size: .95rem; color: var(--muted); }
.pinned { background: var(--ft-soft); border-radius: var(--radius); padding: .7rem .9rem; margin: 0 0 .9rem; font-size: .95rem; }
.pinned b { color: var(--ft); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.pinned div + div { margin-top: .35rem; }
.pinned div[data-jump] { cursor: pointer; }

.poll { min-width: 13rem; }
.poll-q { font-weight: 800; font-size: 1.05rem; margin: 0 0 .1rem; }
.poll-meta { font-size: .82rem; opacity: .8; margin: .1rem 0 .4rem; }
.poll-opt { position: relative; display: flex; width: 100%; justify-content: space-between; gap: .5rem; text-align: left; margin: .35rem 0; padding: .7rem .8rem; min-height: 3rem; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 1rem; cursor: pointer; overflow: hidden; }
.poll-opt.mine { border-color: var(--accent); }
.poll-opt:disabled { cursor: default; }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); z-index: 0; }
.poll-text, .poll-pct { position: relative; z-index: 1; }
.poll-pct { font-weight: 800; }
.poll-names { font-size: .82rem; opacity: .8; margin: -.15rem .2rem .3rem; }

.composer {
  /* Pinned just above the bottom tabs, even when a chat has no messages yet. */
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 9;
  max-width: 560px; margin: 0 auto; background: var(--bg);
  display: flex; gap: .45rem; align-items: flex-end; padding: .5rem 1rem .7rem;
}
main:has(.composer) { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 6.5rem); }
.composer textarea {
  flex: 1; font: inherit; font-size: 1.02rem; padding: .7rem 1rem; min-height: 3rem; border-radius: 22px; border: 2px solid var(--line);
  background: var(--card); color: var(--text); resize: none; max-height: 8rem;
}
.composer .icon { width: 3rem; height: 3rem; border-radius: 50%; border: 0; background: var(--soft); color: var(--text); font-size: 1.25rem; cursor: pointer; flex: none; display: flex; align-items: center; justify-content: center; }
.composer .send { background: var(--brand); color: var(--brand-ink); }
.preview { position: relative; display: inline-block; margin: 0 0 .4rem; }
.preview img { max-height: 7rem; border-radius: 12px; display: block; }
.preview button { position: absolute; top: -.5rem; right: -.5rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 0; background: var(--warn); color: #fff; cursor: pointer; }
.mention-pick { display: flex; flex-wrap: wrap; gap: .4rem; }
.mention-pick:not(:empty) { margin: 0 0 .4rem; }
.mention-pick button { border: 2px solid var(--line); background: var(--card); color: var(--ft); border-radius: 999px; padding: .4rem .8rem; min-height: 2.6rem; font: inherit; font-size: .95rem; font-weight: 700; cursor: pointer; }
.replying { display: flex; align-items: center; gap: .5rem; background: var(--card); border-left: 4px solid var(--ft); border-radius: 10px; padding: .45rem .6rem; margin: 0 0 .4rem; font-size: .88rem; }
.replying div { flex: 1; min-width: 0; }
.replying b { display: block; color: var(--ft); }
.replying span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.replying button { border: 0; background: none; font-size: 1.4rem; color: var(--muted); cursor: pointer; min-width: 2.4rem; min-height: 2.4rem; }

/* ---------- sheets and overlays ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(10, 15, 25, .5); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--bg); width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto;
  border-radius: 22px 22px 0 0; padding: 1.1rem 1rem calc(env(safe-area-inset-bottom) + 1.1rem);
}
.sheet h3 { margin: 0 0 .9rem; font-size: 1.3rem; }
.sheet { padding-top: 1.6rem; }
.sheet h3 { padding-right: 7.5rem; min-height: 2.6rem; display: flex; align-items: center; }
/* Close button stays in the top corner while the panel scrolls. */
.sheet .sheet-top { position: sticky; top: -1rem; z-index: 2; height: 0; }
.sheet .bar { position: absolute; left: 50%; top: -1.1rem; transform: translateX(-50%); width: 2.6rem; height: .32rem; border-radius: 3px; background: var(--line); }
.sheet .sheet-x { position: absolute; right: 0; top: 0; border: 0; background: var(--soft); color: var(--text); font: inherit; font-weight: 700; font-size: .95rem; border-radius: 999px; padding: .5rem .9rem; min-height: 2.6rem; box-shadow: 0 0 0 4px var(--bg); }
.sheet .close-row { margin-top: .7rem; }
.viewer { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 30; display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 100%; max-height: 100%; }
.viewer .x { position: absolute; top: calc(env(safe-area-inset-top) + .8rem); right: .8rem; background: rgba(255,255,255,.18); color: #fff; border: 0; border-radius: 999px; padding: .6rem 1rem; font-weight: 800; font-size: 1rem; }
.linkbox { font-size: .85rem; word-break: break-all; background: var(--card); border: 2px dashed var(--line); padding: .7rem; border-radius: 12px; margin: .7rem 0; user-select: all; }
.react-pick { display: flex; justify-content: space-around; background: var(--card); border-radius: 18px; padding: .5rem; margin: 0 0 .8rem; }
.react-pick button { border: 0; background: none; font-size: 1.8rem; padding: .3rem .4rem; cursor: pointer; border-radius: 12px; min-width: 3rem; min-height: 3rem; }
.react-pick button:active { background: var(--soft); }
.actions-list { background: var(--card); border-radius: 16px; overflow: hidden; }
.actions-list button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font: inherit; font-size: 1.08rem; font-weight: 600; padding: 1rem 1.1rem; min-height: 3.4rem; cursor: pointer; }
.actions-list button:last-child { border-bottom: 0; }
.actions-list .danger-text { color: var(--warn); }
.opts input { display: block; width: 100%; margin: 0 0 .5rem; font: inherit; font-size: 1.02rem; padding: .7rem .85rem; min-height: 3rem; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--text); }

.swatches { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .4rem 0 1rem; }
.swatches button { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatches button.on { border-color: var(--text); }
.swatches input[type=color] { width: 2.6rem; height: 2.4rem; border: 0; background: none; padding: 0; }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 5.2rem); z-index: 40;
  background: var(--text); color: var(--bg); padding: .8rem 1.1rem; border-radius: 14px; font-size: 1rem; font-weight: 700;
  transition: all .2s; pointer-events: none; max-width: 90vw; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- sign in ---------- */
.auth { padding: calc(env(safe-area-inset-top) + 2.6rem) 1.2rem 2.4rem; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: .9rem; margin: .4rem 0 1.4rem; }
.auth .auth-icon { width: 5.2rem; height: 5.2rem; border-radius: 1.3rem; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.auth .wordmark { display: block; width: min(13rem, 62%); height: auto; box-sizing: content-box; padding: .7rem 1rem; background: #101820; border-radius: 1rem; margin: 0; }
.auth .auth-lead { text-align: center; margin: 0 0 1.4rem; }
@media (prefers-color-scheme: dark) { .auth .wordmark { background: none; padding: 0; } }
html[data-tone=dark] .auth .wordmark { background: none; padding: 0; }
.auth .logo { width: 4.2rem; height: 4.2rem; border-radius: 1.1rem; display: block; margin: 0 0 1.1rem; box-shadow: var(--shadow); }
.auth h1 { margin: 0 0 .4rem; font-size: 1.9rem; line-height: 1.2; }
.auth p { color: var(--muted); margin: 0 0 1.5rem; font-size: 1.02rem; }
.auth .help { margin-top: 1.4rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; color: var(--muted); font-size: .95rem; }
.show-pw { display: flex; align-items: center; gap: .5rem; margin: -.4rem 0 1rem; font-size: .95rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.show-pw input { width: 1.3rem; height: 1.3rem; }

/* shift pick-up flow */
.pill.ask { background: #fff4d6; color: #7a4b00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.ask { background: #3a2c0d; color: #f5c96b; } }
.shift .note { margin-top: .7rem; padding: .6rem .8rem; border-radius: 12px; background: var(--soft); font-size: .95rem; }
.shift .confirm { margin-top: .7rem; padding: .8rem .9rem; border-radius: 12px; background: var(--accent-soft); border: 2px solid var(--accent); font-size: .95rem; display: grid; gap: .4rem; }
.shift .confirm > b:first-child { color: var(--accent); font-size: 1.05rem; }
.shift .confirm .btn { margin-top: .3rem; }
.shift .askers { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.shift .asker { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.shift .asker:last-child { border-bottom: 0; }
.shift .asker .num { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--soft); font-weight: 800; font-size: .85rem; margin-right: .2rem; }
.shift .asker .btn.small { white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: -.4rem 0 1rem; }
.chip { border: 1.5px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: .5rem .9rem; font: inherit; font-size: .95rem; font-weight: 600; min-height: 2.6rem; }
.chip:active { background: var(--soft); }
.shift .asker .grow { flex: 1; min-width: 0; }
.star { font-size: 1.4rem; min-width: 2.8rem; min-height: 2.8rem; border: 0; background: none; filter: grayscale(1) opacity(.35); }
.star.on { filter: none; }

/* invite QR code: always black on white so cameras can read it, even in dark mode */
.qr { background: #fff; border-radius: 16px; padding: .6rem; width: min(72vw, 300px); margin: .4rem auto .6rem; box-shadow: var(--shadow); }
.qr svg { display: block; width: 100%; height: auto; }
.hint.center { text-align: center; }

/* taking back a shift request */
.warnbox { background: var(--warn-soft); color: var(--text); border: 2px solid var(--warn); border-radius: 12px; padding: .75rem .9rem; margin-bottom: 1rem; display: grid; gap: .3rem; }
.warnbox > b:first-child { color: var(--warn); }
.check { display: flex; gap: .7rem; align-items: flex-start; font-weight: 600; margin: .2rem 0 1rem; }
.check input { width: 1.6rem; height: 1.6rem; flex: none; margin-top: .1rem; accent-color: var(--brand); }

/* ---------- styles the owner can pick (see themes.js) ---------- */
h2.section { color: var(--gold, var(--muted)); }

/* fonts: iPhones have these built in; other phones use the closest match */
html[data-font=serif] body { font-family: "Iowan Old Style", Georgia, "Times New Roman", serif; }
html[data-font=rounded] body { font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", -apple-system, system-ui, sans-serif; }
html[data-font=avenir] body { font-family: "Avenir Next", Avenir, "Segoe UI", Roboto, sans-serif; }
html[data-font=optima] body { font-family: Optima, Candara, "Noto Sans", "Segoe UI", sans-serif; }
html[data-font=didot] body { font-family: Georgia, "Times New Roman", serif; }
html[data-font=didot] h1, html[data-font=didot] h3, html[data-font=didot] .shift .day { font-family: Didot, "Bodoni 72", "Bodoni MT", Georgia, serif; letter-spacing: .01em; }
html[data-font=serif] h1, html[data-font=serif] h3 { letter-spacing: 0; }

/* colored bar at the top */
html[data-header=band] header.top {
  background: var(--brand); color: var(--brand-ink); padding-bottom: 1rem; margin-bottom: .9rem;
  border-radius: 0 0 calc(var(--radius) + 6px) calc(var(--radius) + 6px);
}
html[data-header=band] header.top .brand, html[data-header=band] header.top .back { color: var(--brand-ink); opacity: .9; }
html[data-header=band] header.top .icon-btn { background: rgba(255, 255, 255, .16); border-color: transparent; color: var(--brand-ink); }

/* card looks */
html[data-cards=shadow] .card { border-color: transparent; box-shadow: 0 1px 3px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .08); }
html[data-cards=lifted] .card { border: 0; box-shadow: 0 5px 0 rgba(16, 24, 40, .07), 0 12px 30px rgba(16, 24, 40, .09); margin-bottom: 1.2rem; }
html[data-cards=bold] .card { border: 2px solid var(--line); box-shadow: none; }
html[data-cards=flat] .card:not(.welcome) { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; padding-left: 0; padding-right: 0; }
html[data-cards=flat] .card.list { border-bottom: 0; }

/* date box */
html[data-date=filled] .shift .datebox { background: var(--brand); color: var(--brand-ink); }
html[data-date=filled] .shift .datebox .dow, html[data-date=filled] .shift .datebox .mon { color: var(--brand-ink); opacity: .85; }
html[data-date=outline] .shift .datebox { background: transparent; border: 2px solid var(--brand); color: var(--brand); }
html[data-date=outline] .shift .datebox .dow, html[data-date=outline] .shift .datebox .mon { color: var(--brand); }

/* shapes follow the style's roundness */
.shift .datebox { border-radius: min(12px, var(--radius)); }
.btn, .seg, .field input, .field textarea, .field select, .choice label { border-radius: min(14px, var(--radius)); }
.seg button { border-radius: min(11px, var(--radius)); }

/* floating bottom menu */
html[data-nav=float] nav.tabs {
  left: .7rem; right: .7rem; bottom: calc(env(safe-area-inset-bottom) + .5rem); padding-bottom: 0;
  max-width: 540px; margin: 0 auto; border-radius: 19px; border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(16, 24, 40, .14);
}
html[data-nav=float] nav.tabs a.on::before { display: none; }
html[data-nav=float] nav.tabs a.on svg { background: var(--soft); border-radius: 12px; padding: .15rem .7rem; width: 3rem; box-sizing: content-box; height: 1.45rem; }
html[data-nav=float] .composer { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + .6rem); }
html[data-nav=float] .fab { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 1.4rem); }

/* style picker */
.styles { display: grid; gap: .55rem; margin-bottom: .6rem; }
.style-pick { display: flex; align-items: center; gap: .8rem; text-align: left; width: 100%; padding: .7rem .8rem; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
.style-pick.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; }
.style-pick .sw { flex: none; width: 3.6rem; height: 2.6rem; border-radius: 10px; border: 1px solid; display: flex; align-items: center; justify-content: center; gap: .2rem; }
.style-pick .sw i { width: .8rem; height: .8rem; border-radius: 50%; display: block; }
.style-pick .nm { display: flex; flex-direction: column; min-width: 0; }
.style-pick .nm small { color: var(--muted); font-size: .85rem; }

/* chat list (Telegram-like rows) */
.list-tools { display: flex; justify-content: flex-end; margin: -.4rem 0 .5rem; }
.chats .avatar.chat-av { width: 3.2rem; height: 3.2rem; font-size: 1.45rem; background: var(--ft-soft); }
.chats .row1, .chats .row2 { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.chats .row1 b { flex: 1; min-width: 0; font-size: 1.05rem; }
.chats .row2 .sub { flex: 1; min-width: 0; }
.when-sm { color: var(--muted); font-size: .82rem; flex: none; }
.badge { flex: none; background: var(--brand); color: var(--brand-ink); font-size: .75rem; font-weight: 800; border-radius: 999px; padding: .1rem .55rem; }

/* centered small title, like Telegram */
html[data-header=center] header.top { justify-content: center; min-height: 3.6rem; padding-bottom: .5rem; }
html[data-header=center] header.top .titles { text-align: center; flex: 1; }
html[data-header=center] header.top .brand { display: none; }
html[data-header=center] header.top h1 { font-size: 1.15rem; font-weight: 700; }
html[data-header=center] header.top .back { position: absolute; left: .6rem; bottom: .45rem; background: var(--soft); border-radius: 999px; padding: 0 .9rem 0 .6rem; }
html[data-header=center] header.top .icon-btn { border-radius: 999px; background: var(--soft); border-color: transparent; }

/* colorful round icons, like Telegram */
html[data-avatars=color] .avatar { color: #fff; font-weight: 800; }
html[data-avatars=color] .list:not(.members) .item:nth-child(7n+1) .avatar { background: linear-gradient(180deg, #ff885e, #ff516a); }
html[data-avatars=color] .list:not(.members) .item:nth-child(7n+2) .avatar { background: linear-gradient(180deg, #ffcd6a, #ffa85c); }
html[data-avatars=color] .list:not(.members) .item:nth-child(7n+3) .avatar { background: linear-gradient(180deg, #82b1ff, #665fff); }
html[data-avatars=color] .list:not(.members) .item:nth-child(7n+4) .avatar { background: linear-gradient(180deg, #a0de7e, #54cb68); }
html[data-avatars=color] .list:not(.members) .item:nth-child(7n+5) .avatar { background: linear-gradient(180deg, #53edd6, #28c9b7); }
html[data-avatars=color] .list:not(.members) .item:nth-child(7n+6) .avatar { background: linear-gradient(180deg, #72d5fd, #2a9ef1); }
html[data-avatars=color] .list:not(.members) .item:nth-child(7n+7) .avatar { background: linear-gradient(180deg, #e0a2f3, #d669ed); }
html[data-avatars=color] .chats .item { border-bottom: 0; position: relative; }
html[data-avatars=color] .chats .item + .item::before { content: ""; position: absolute; top: 0; left: 4rem; right: 0; border-top: 1px solid var(--line); }

/* floating menu: the open tab sits in a rounded bubble */
html[data-nav=float] nav.tabs { background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
html[data-nav=float] nav.tabs .inner { padding: .25rem; }
html[data-nav=float] nav.tabs a.on { background: var(--soft); border-radius: 15px; }
html[data-nav=float] nav.tabs a.on svg { background: none; padding: 0; width: 1.35rem; height: 1.35rem; }
html[data-nav=float][data-avatars=color] nav.tabs a.on { background: color-mix(in srgb, var(--text) 10%, transparent); }

/* ---------- Telegram-style menus (Settings) and group page (Team) ---------- */
.profile { text-align: center; margin: .2rem 0 1.2rem; }
.avatar.big { width: 6rem; height: 6rem; font-size: 2.2rem; margin: 0 auto .6rem; background: var(--brand); color: var(--brand-ink); }
.avatar.big.logo { background: var(--card); overflow: hidden; padding: 0; }
.avatar.big.logo img { width: 100%; height: 100%; object-fit: cover; }
.profile .pname { font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.page-settings header.top h1 { visibility: hidden; }
.page-settings header.top:has(.back) h1 { visibility: visible; }
.qr-btn { position: absolute; left: .8rem; bottom: .5rem; display: flex; align-items: center; justify-content: center; border-radius: 999px !important; }
.menu { background: var(--card); border-radius: var(--radius); margin: 0 0 1rem; overflow: hidden; border: 1px solid var(--line); }
html[data-cards=flat] .menu, html[data-chat=tg] .menu { border: 0; }
.mrow { display: flex; align-items: center; gap: .85rem; width: 100%; min-height: 3.4rem; padding: .55rem 1rem; color: var(--text); text-decoration: none; background: none; border: 0; font: inherit; font-size: 1.05rem; text-align: left; cursor: pointer; position: relative; }
.mrow + .mrow::before { content: ""; position: absolute; top: 0; left: 3.9rem; right: 0; border-top: 1px solid var(--line); }
.mic { flex: none; width: 2rem; height: 2rem; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.05rem; font-weight: 800; }
.mlabel { flex: 1; min-width: 0; }
.mlabel small { display: block; color: var(--muted); font-size: .88rem; margin-top: .1rem; }
.mval { color: var(--muted); font-size: 1rem; }
.mrow .chev { font-size: 1.5rem; line-height: 1; }
.mrow.static { cursor: default; }
.mrow.danger .mlabel { color: var(--warn, #e5484d); font-weight: 600; }
.mrow:active { background: var(--soft); }

.seg { display: flex; gap: .2rem; padding: .25rem; margin: 0 auto 1rem; background: var(--soft); border-radius: 999px; max-width: 100%; }
.seg button { flex: 1; border: 0; background: none; color: var(--text); font: inherit; font-weight: 700; font-size: .95rem; padding: .55rem .4rem; min-height: 2.6rem; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.members .item { padding-left: 0; }
.members .item[data-manage] { cursor: pointer; }
.members .item b { display: block; font-size: 1.05rem; }
.addrow { width: 100%; border: 0; background: none; font: inherit; font-size: 1.1rem; font-weight: 600; color: var(--brand); text-align: left; cursor: pointer; }
.addic { width: 2.6rem; display: flex; justify-content: center; color: var(--brand); flex: none; }
.rtag { flex: none; font-size: .82rem; font-weight: 700; padding: .15rem .55rem; border-radius: 8px; }
.rtag.admin { color: var(--accent); background: var(--accent-soft); }
.rtag.owner { color: #8b5cf6; background: color-mix(in srgb, #8b5cf6 16%, transparent); }
.avatar.c0, .mav.c0 { background: linear-gradient(180deg, #ff885e, #ff516a); color: #fff; }
.avatar.c1, .mav.c1 { background: linear-gradient(180deg, #ffcd6a, #ffa85c); color: #fff; }
.avatar.c2, .mav.c2 { background: linear-gradient(180deg, #82b1ff, #665fff); color: #fff; }
.avatar.c3, .mav.c3 { background: linear-gradient(180deg, #a0de7e, #54cb68); color: #fff; }
.avatar.c4, .mav.c4 { background: linear-gradient(180deg, #53edd6, #28c9b7); color: #fff; }
.avatar.c5, .mav.c5 { background: linear-gradient(180deg, #72d5fd, #2a9ef1); color: #fff; }
.avatar.c6, .mav.c6 { background: linear-gradient(180deg, #e0a2f3, #d669ed); color: #fff; }

/* chat list: sender name on its own line, like Telegram */
.chats .sender { font-size: .95rem; font-weight: 600; color: var(--text); margin-top: .05rem; }
.chats .row2 .sub { font-size: .92rem; }
html[data-chat=tg] .chats .avatar.chat-av { width: 3.6rem; height: 3.6rem; font-size: 1.6rem; }
html[data-chat=tg] .chats .item + .item::before { left: 4.4rem; }

/* inside a chat: date pills, time inside the bubble */
header.top .hsub { color: var(--muted); font-size: .85rem; font-weight: 500; }
.daysep { text-align: center; margin: .6rem 0 .9rem; position: sticky; top: 4.8rem; z-index: 2; }
.daysep span { display: inline-block; font-size: .85rem; font-weight: 700; padding: .25rem .8rem; border-radius: 999px; background: var(--soft); color: var(--text); }
.mav, .bname, .mtime { display: none; }
.msg.me .poll-opt { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .35); color: inherit; }
.msg.me .poll-bar { background: rgba(255, 255, 255, .22); }

/* Telegram chat screen */
html[data-wall=doodle] body:has(#app.in-chat) {
  background-color: #d5e6c3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' fill='none' stroke='%2366905a' stroke-opacity='.35' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M30 20l4 9 10 1-7 7 2 10-9-5-9 5 2-10-7-7 10-1z'/%3E%3Cpath d='M120 40c0-6 8-9 12-4 4-5 12-2 12 4 0 8-12 14-12 14s-12-6-12-14z'/%3E%3Ccircle cx='70' cy='90' r='12'/%3E%3Cpath d='M64 88h.1M76 88h.1M64 95c3 3 9 3 12 0'/%3E%3Cpath d='M140 110c10 0 14 14 4 18-8 3-14-6-8-11'/%3E%3Cpath d='M20 130l12-14 12 14M26 130v12h12v-12'/%3E%3Cpath d='M100 150c4-8 14-8 18 0M98 162h22'/%3E%3Ccircle cx='160' cy='165' r='3'/%3E%3Ccircle cx='95' cy='25' r='3'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  html[data-wall=doodle] body:has(#app.in-chat) {
    background-color: #0b0a12;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' fill='none' stroke='%237a62d6' stroke-opacity='.32' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M30 20l4 9 10 1-7 7 2 10-9-5-9 5 2-10-7-7 10-1z'/%3E%3Cpath d='M120 40c0-6 8-9 12-4 4-5 12-2 12 4 0 8-12 14-12 14s-12-6-12-14z'/%3E%3Ccircle cx='70' cy='90' r='12'/%3E%3Cpath d='M64 88h.1M76 88h.1M64 95c3 3 9 3 12 0'/%3E%3Cpath d='M140 110c10 0 14 14 4 18-8 3-14-6-8-11'/%3E%3Cpath d='M20 130l12-14 12 14M26 130v12h12v-12'/%3E%3Cpath d='M100 150c4-8 14-8 18 0M98 162h22'/%3E%3Ccircle cx='160' cy='165' r='3'/%3E%3Ccircle cx='95' cy='25' r='3'/%3E%3C/svg%3E");
  }
}
html[data-chat=tg] .in-chat header.top { background: transparent; }
html[data-chat=tg] .in-chat header.top .titles { flex: 0 1 auto; max-width: 64%; margin: 0 auto; padding: .35rem 1.2rem; border-radius: 999px; background: color-mix(in srgb, var(--card) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
html[data-chat=tg] .in-chat header.top h1 { font-size: 1.1rem; }
html[data-chat=tg] .in-chat header.top .back, html[data-chat=tg] .in-chat header.top .icon-btn { background: color-mix(in srgb, var(--card) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--text); }
html[data-chat=tg] .in-chat header.top .back { width: 2.9rem; height: 2.9rem; padding: 0; justify-content: center; font-size: 0; }
html[data-chat=tg] .in-chat header.top .back span { font-size: 2rem; margin-top: -.15rem; }
html[data-chat=tg] .in-chat header.top .icon-btn { position: absolute; right: .6rem; bottom: .45rem; }
html[data-chat=tg] .in-chat header.top .icon-btn + .icon-btn { right: 3.9rem; }
html[data-chat=tg] .in-chat header.top:has(#editchat) .titles { max-width: 52%; }
html[data-chat=tg] .in-chat .tap-hint, html[data-chat=tg] .in-chat .pinned { background: color-mix(in srgb, var(--card) 85%, transparent); border-radius: 12px; padding: .4rem .8rem; }
html[data-chat=tg] .in-chat .tap-hint { display: table; margin: 0 auto .8rem; }
html[data-chat=tg] .daysep span { background: color-mix(in srgb, #000 28%, transparent); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
html[data-chat=tg] .msg { position: relative; margin: 0 0 .2rem; max-width: 82%; }
html[data-chat=tg] .msg.last { margin-bottom: .7rem; }
html[data-chat=tg] .msg:not(.me) { margin-left: 2.6rem; }
html[data-chat=tg] .msg .who { display: none; }
html[data-chat=tg] .mav { display: flex; position: absolute; left: -2.6rem; bottom: 0; width: 2.2rem; height: 2.2rem; border-radius: 50%; align-items: center; justify-content: center; font-size: .78rem; font-weight: 800; }
html[data-chat=tg] .bname { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .1rem; background: none !important; }
html[data-chat=tg] .bname.c0 { color: #ff5f6d; } html[data-chat=tg] .bname.c1 { color: #f5a623; } html[data-chat=tg] .bname.c2 { color: #7b72ff; }
html[data-chat=tg] .bname.c3 { color: #4cb85c; } html[data-chat=tg] .bname.c4 { color: #1fb5a3; } html[data-chat=tg] .bname.c5 { color: #2a9ef1; } html[data-chat=tg] .bname.c6 { color: #c35cdd; }
html[data-chat=tg] .msg .bubble { border: 0; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); border-radius: 18px; padding: .45rem .75rem .35rem; }
html[data-chat=tg] .msg:not(.me).last .bubble { border-bottom-left-radius: 6px; }
html[data-chat=tg] .msg.me.last .bubble { border-bottom-right-radius: 6px; }
html[data-chat=tg] .mtime { display: block; float: right; font-size: .72rem; opacity: .65; margin: .35rem 0 -.1rem .7rem; white-space: nowrap; }
html[data-chat=tg] .msg .bubble .text { font-size: 1.05rem; }
html[data-chat=tg] .bubble.photo-only { padding: 3px; position: relative; overflow: hidden; }
html[data-chat=tg] .bubble.photo-only img { margin: 0; border-radius: 15px; }
html[data-chat=tg] .bubble.photo-only .bname { position: absolute; top: .5rem; left: .6rem; padding: .1rem .5rem; border-radius: 999px; background: rgba(0, 0, 0, .45) !important; color: #fff !important; font-size: .8rem; z-index: 1; }
html[data-chat=tg] .bubble.photo-only .mtime { position: absolute; right: .6rem; bottom: .55rem; margin: 0; float: none; opacity: 1; color: #fff; background: rgba(0, 0, 0, .45); padding: .1rem .5rem; border-radius: 999px; }
html[data-chat=tg] .reacts { margin-top: .25rem; }
html[data-chat=tg] .in-chat .composer { background: transparent; padding-top: .35rem; }
html[data-chat=tg] .in-chat .composer .icon { background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--muted); }
html[data-chat=tg] .in-chat .composer .send { background: var(--brand); color: var(--brand-ink); }
html[data-chat=tg] .in-chat .composer textarea { border: 0; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
html[data-chat=tg] .in-chat .empty { background: color-mix(in srgb, var(--card) 85%, transparent); border-radius: 16px; }
html[data-chat=tg] .brow { position: relative; }
html[data-chat=tg] .msg .bubble::after { content: ""; display: block; clear: both; }
html[data-chat=tg] .bubble.photo-only::after { display: none; }
.seg button.on { background: color-mix(in srgb, var(--text) 14%, var(--card)); }
.page-team header.top h1 { visibility: hidden; }
html[data-chat=tg] .card.list.members { background: var(--card); border: 0; border-radius: 20px; padding: 0 1rem; }

/* ---------- line icons ---------- */
.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.btn .ic { margin-right: .15em; }
.pill .ic { width: 1em; height: 1em; vertical-align: -0.15em; }
.where .ic { color: var(--muted); margin-right: .15em; }
.empty .big .ic { width: 2.6rem; height: 2.6rem; color: var(--muted); stroke-width: 1.6; }
.lockline .ic { width: 1em; height: 1em; }
.mic .ic { width: 1.2rem; height: 1.2rem; color: #fff; }
.composer .icon .ic { width: 1.35rem; height: 1.35rem; }
.icon-btn .ic { width: 1.3rem; height: 1.3rem; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; }
.confirm b .ic { color: var(--accent); }
.warnbox b .ic { color: var(--warn); }
.gostar .ic, .star.on .ic { color: #e0a800; fill: #e0a800; }
.star .ic { width: 1.4rem; height: 1.4rem; }
.avatar.tile { background: var(--tile) !important; color: #fff; }
.avatar.tile .ic { width: 42%; height: 42%; stroke-width: 2.2; }
.emoji-row span { background: var(--tile); color: #fff; border-color: transparent; }
.emoji-row span .ic { width: 1.35rem; height: 1.35rem; }
.emoji-row input:checked + span { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--brand); background: var(--tile); }
.sheet .mic, .sheet button .ic { flex: none; }

/* rounded-square tiles (Graphite) */
html[data-avatars=tile] .avatar.tile { border-radius: 24%; }
html[data-avatars=tile] .chats .avatar.chat-av { width: 3.3rem; height: 3.3rem; }
html[data-avatars=tile] .chats .item + .item::before { left: 4.2rem; }
html[data-avatars=tile] .chats .item { border-bottom: 0; position: relative; }
html[data-avatars=tile] .chats .item + .item::before { content: ""; position: absolute; top: 0; right: 0; border-top: 1px solid var(--line); }
html[data-avatars=tile] .avatar { color: #fff; }
html[data-avatars=tile] .avatar.c0 { background: #e5484d; } html[data-avatars=tile] .avatar.c1 { background: #f08c00; } html[data-avatars=tile] .avatar.c2 { background: #6e56cf; }
html[data-avatars=tile] .avatar.c3 { background: #30a46c; } html[data-avatars=tile] .avatar.c4 { background: #12a594; } html[data-avatars=tile] .avatar.c5 { background: #2f80ed; } html[data-avatars=tile] .avatar.c6 { background: #d6409f; }
html[data-avatars=tile] .mav.c0 { background: #e5484d; } html[data-avatars=tile] .mav.c1 { background: #f08c00; } html[data-avatars=tile] .mav.c2 { background: #6e56cf; }
html[data-avatars=tile] .mav.c3 { background: #30a46c; } html[data-avatars=tile] .mav.c4 { background: #12a594; } html[data-avatars=tile] .mav.c5 { background: #2f80ed; } html[data-avatars=tile] .mav.c6 { background: #d6409f; }
html[data-avatars=tile] .avatar.big { background: var(--brand); }
html[data-avatars=tile] .avatar.big.logo { background: var(--card); }
html[data-wall=none] .daysep span { background: var(--card); color: var(--muted); backdrop-filter: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.show-pw + .show-pw { margin-top: -.5rem; }
.auth .two { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }

/* Profile pictures */
.avatar.has-pic, .mav.has-pic { padding: 0; overflow: hidden; background: var(--soft); }
.avatar.has-pic img, .mav.has-pic img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.avatar-btn { position: relative; border: 0; background: none; padding: 0; margin: 0 auto .6rem; display: block; cursor: pointer; border-radius: 50%; }
.avatar-btn .avatar.big { margin: 0; }
.avatar-btn .pic-cam { position: absolute; right: -2px; bottom: -2px; width: 2rem; height: 2rem; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; border: 3px solid var(--bg); }
.avatar-btn .pic-cam .ic { width: 1rem; height: 1rem; }

/* Calls */
header.top .hact { margin-left: auto; align-self: center; }
html[data-header=center] header.top .hact { position: absolute; right: .6rem; bottom: .45rem; }
.icon.hcall, .icon.rowcall { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; background: var(--soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.icon.hcall .ic, .icon.rowcall .ic { width: 1.25rem; height: 1.25rem; }
.call-screen { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  padding: calc(env(safe-area-inset-top) + 4rem) 1.5rem calc(env(safe-area-inset-bottom) + 3rem);
  background: radial-gradient(120% 80% at 50% 0%, #1d3557 0%, #0e0f11 70%); color: #fff; text-align: center; }
.call-top { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.call-screen .avatar.call-face { width: 8rem; height: 8rem; font-size: 2.8rem; border-radius: 50%; margin-bottom: .8rem; box-shadow: 0 0 0 8px rgba(255,255,255,.06); }
.call-name { font-size: 1.9rem; font-weight: 700; }
.call-state { font-size: 1.1rem; color: rgba(255,255,255,.75); font-variant-numeric: tabular-nums; }
.call-note { margin-top: .6rem; font-size: .85rem; color: rgba(255,255,255,.55); }
.call-btns { display: flex; gap: 3.2rem; justify-content: center; }
.cbtn { border: 0; background: none; color: #fff; display: flex; flex-direction: column; align-items: center; gap: .55rem; font: inherit; font-size: .95rem; }
.cbtn .ic { width: 4.6rem; height: 4.6rem; padding: 1.3rem; border-radius: 50%; box-sizing: border-box; background: rgba(255,255,255,.16); }
.cbtn.answer .ic { background: #30b158; }
.cbtn.decline .ic { background: #e5484d; transform: rotate(135deg); }
.cbtn.mute.on .ic { background: #fff; color: #111; }

/* Owner tools */
.facts { background: var(--soft); border-radius: var(--radius); padding: .4rem .9rem; margin: .2rem 0 1rem; }
.facts div { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.facts div:last-child { border-bottom: 0; }
.facts span { color: var(--muted); }
.facts b { text-align: right; }
.paused-tag { color: #ff9f0a; }
.item.paused .avatar { opacity: .5; }
.card.log { padding: .3rem 1rem; }
.log-day { font-weight: 700; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: .9rem 0 .3rem; }
.log-row { display: flex; gap: .8rem; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .95rem; line-height: 1.35; }
.log-row:last-child { border-bottom: 0; }
.log-time { color: var(--muted); flex: none; width: 4.3rem; font-variant-numeric: tabular-nums; }

/* Getting started */
.welcome-steps .lead { font-size: 1.15rem; margin: .2rem 0 1rem; }
.card.step { display: flex; gap: .9rem; align-items: flex-start; }
.step-n { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--brand); color: var(--brand-ink, #fff); display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; }
.card.step h3 { margin: .15rem 0 .5rem; font-size: 1.15rem; }
.card.step p { margin: 0 0 .6rem; }
.howto { margin: 0 0 .4rem; padding-left: 1.2rem; line-height: 1.5; }
.howto li { margin-bottom: .35rem; }
.howto .ic { width: 1.1rem; height: 1.1rem; vertical-align: -.2rem; color: var(--brand); }
.step-done { display: inline-flex; align-items: center; gap: .35rem; color: #30b158; font-weight: 700; }
.step-done .ic { width: 1.2rem; height: 1.2rem; }
.btn.big { padding: 1.05rem; font-size: 1.15rem; margin-top: .4rem; }
.hint.center { text-align: center; }
