/* Kamenya Forum: mobile first app styles */
:root {
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #eef2f0;
  --text: #0f1a16;
  --muted: #5f6d68;
  --faint: #8a9792;
  --border: #e2e7e5;
  --primary: #0b7a4b;
  --primary-2: #0a6a41;
  --primary-ink: #ffffff;
  --primary-soft: #e2f2ea;
  --ok: #12804f;
  --ok-soft: #e1f3e9;
  --warn: #a35a00;
  --warn-soft: #fdf1df;
  --danger: #c0352b;
  --danger-soft: #fdeceb;
  --info: #1f5fbf;
  --info-soft: #e7effb;
  --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 4px 16px rgba(16, 24, 20, .06);
  --radius: 16px;
  --radius-sm: 12px;
  --tabbar-h: 64px;
  --topbar-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1110;
    --surface: #141b18;
    --surface-2: #1b2420;
    --text: #e7eeeb;
    --muted: #9aa8a2;
    --faint: #6f7d77;
    --border: #25302b;
    --primary: #20b06e;
    --primary-2: #1b9a60;
    --primary-ink: #04140c;
    --primary-soft: #133024;
    --ok: #3cc985;
    --ok-soft: #13301f;
    --warn: #f0a640;
    --warn-soft: #34260f;
    --danger: #f06b60;
    --danger-soft: #3a1a17;
    --info: #6aa3ff;
    --info-soft: #172640;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.hidden { display: none !important; }

/* App frame */
.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
}
@media (min-width: 600px) {
  body { background: var(--surface-2); }
  .app { box-shadow: 0 0 0 1px var(--border); }
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 4px;
  padding: 0 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.tb-title { flex: 1; min-width: 0; font-weight: 700; font-size: 18px; padding-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-actions { display: flex; gap: 2px; }
#tb-back.hidden + .tb-title { padding-left: 8px; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer;
  display: inline-grid; place-items: center; font-size: 18px; color: var(--text);
  position: relative;
}
.icon-btn:active { background: var(--surface-2); }

.view { padding: 8px 16px calc(var(--tabbar-h) + 24px + var(--safe-b)); }
body.no-tabbar .view { padding-bottom: calc(24px + var(--safe-b)); }
body.bare .topbar, body.bare .tabbar, body.no-tabbar .tabbar { display: none; }
body.bare .view { padding: 0; }

/* Tab bar */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; z-index: 30;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: var(--faint); position: relative;
}
.tab i { font-size: 19px; }
.tab.active { color: var(--primary); }
.tab-center .tab-fab {
  width: 48px; height: 48px; border-radius: 16px; margin-top: -18px;
  display: grid; place-items: center;
  background: var(--primary); color: var(--primary-ink);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 40%, transparent);
}
.tab-center .tab-fab i { font-size: 20px; }
.badge {
  position: absolute; top: 6px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700;
  display: inline-grid; place-items: center; line-height: 1;
}
.badge-inline { position: static; margin-left: auto; }

/* Typography helpers */
.h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.h2 { font-size: 17px; font-weight: 700; margin: 0; }
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin: 22px 4px 8px;
}
.section-title a { text-transform: none; letter-spacing: 0; font-size: 13px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .02em; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.pos { color: var(--ok); } .neg { color: var(--danger); }

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  border: 1px solid var(--border);
}
.card + .card { margin-top: 12px; }
.card-flush { padding: 0; overflow: hidden; }

.hero {
  background: linear-gradient(145deg, var(--primary) 0%, #075c38 100%);
  color: #fff; border: 0; position: relative; overflow: hidden;
}
@media (prefers-color-scheme: dark) { .hero { background: linear-gradient(145deg, #0f7a4b 0%, #0a4a2f 100%); } }
.hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}
.hero .muted { color: rgba(255, 255, 255, .78); }
.hero .big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 2px; }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; position: relative; z-index: 1; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); font-size: 12.5px; font-weight: 600;
}

/* Stats grid */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; display: block; color: inherit;
}
.stat .label { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 20px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat.alert .value { color: var(--warn); }

/* Quick actions */
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.action {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  font-size: 12px; font-weight: 600; color: var(--text); padding: 6px 2px; position: relative;
}
.action .ic {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 20px;
  background: var(--surface); border: 1px solid var(--border); color: var(--primary);
}
.action .badge { top: -2px; left: calc(50% + 14px); }

/* Lists */
.list { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: inherit;
  border-bottom: 1px solid var(--border); cursor: pointer; background: var(--surface);
}
.item:last-child { border-bottom: 0; }
.item:active { background: var(--surface-2); }
.item .title { font-weight: 600; }
.item .sub { font-size: 13px; color: var(--muted); }
.item .chev { color: var(--faint); font-size: 13px; }
.item.static { cursor: default; }
.item.me { background: var(--primary-soft); }
.item-ic {
  width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--surface-2); color: var(--primary); font-size: 16px;
}
.item-ic.danger { color: var(--danger); background: var(--danger-soft); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff;
  background: var(--primary);
}
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }

.no {
  min-width: 34px; font-size: 12px; font-weight: 700; color: var(--faint); font-variant-numeric: tabular-nums;
}

/* Pills */
.pill {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--muted);
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.primary { background: var(--primary-soft); color: var(--primary); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid transparent;
  font-weight: 650; font-size: 15px; cursor: pointer; white-space: nowrap;
  background: var(--surface-2); color: var(--text); transition: transform .08s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-2); }
.btn-outline { background: transparent; border-color: var(--border); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }
.btn .spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.fab {
  position: fixed; z-index: 25;
  right: max(16px, calc(50% - 280px + 16px));
  bottom: calc(var(--tabbar-h) + 16px + var(--safe-b));
  width: 56px; height: 56px; border-radius: 18px; border: 0;
  background: var(--primary); color: var(--primary-ink); font-size: 20px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 35%, transparent); cursor: pointer;
}

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 6px 2px; }
.input, .select, .textarea {
  width: 100%; height: 50px; padding: 0 14px; border-radius: 14px;
  border: 1.5px solid var(--border); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s; font-size: 16px;
}
.textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent);
}
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.input-icon .input { padding-left: 42px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 2px 0; }
.error-text { color: var(--danger); font-size: 13px; margin-top: 6px; }

.search {
  position: relative; margin-bottom: 12px;
}
.search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .input { height: 44px; padding-left: 40px; border-radius: 12px; background: var(--surface); }

/* Segmented control and chips */
.seg {
  display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 3px; margin-bottom: 12px;
}
.seg button {
  flex: 1; height: 36px; border: 0; border-radius: 9px; background: transparent; cursor: pointer;
  font-weight: 600; font-size: 13.5px; color: var(--muted);
}
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 13px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .count { opacity: .7; font-weight: 700; }

/* Skeleton loading */
.sk {
  background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 50%, var(--surface)) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px;
}
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sk-line { height: 12px; margin: 6px 0; }
.sk-title { height: 16px; width: 55%; }
.sk-circle { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.sk-block { height: 140px; border-radius: var(--radius); }
.sk-stat { height: 74px; border-radius: var(--radius-sm); }

/* Empty / info states */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ic {
  width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 14px; display: grid; place-items: center;
  font-size: 26px; background: var(--surface-2); color: var(--faint);
}
.empty .h2 { color: var(--text); margin-bottom: 4px; }
.notice {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13.5px;
  background: var(--info-soft); color: var(--info);
}
.notice i { margin-top: 2px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.danger { background: var(--danger-soft); color: var(--danger); }

/* Key value rows */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; word-break: break-word; }
.raw {
  background: var(--surface-2); border-radius: 12px; padding: 12px; font-size: 13px; color: var(--muted);
  white-space: pre-wrap; word-break: break-word;
}

/* Bottom sheet */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(5, 12, 9, .45);
  opacity: 0; transition: opacity .2s;
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; z-index: 61; left: 50%; bottom: 0; transform: translate(-50%, 100%);
  width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh;
  background: var(--surface); border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column; transition: transform .25s cubic-bezier(.2, .8, .2, 1);
  padding-bottom: var(--safe-b);
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin: 10px auto 2px; flex: none; }
.sheet-head { display: flex; align-items: center; padding: 6px 8px 6px 18px; flex: none; }
.sheet-head .h2 { flex: 1; }
.sheet-body { padding: 4px 18px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 10px 18px 16px; border-top: 1px solid var(--border); flex: none; }
body.sheet-open { overflow: hidden; }

/* Toasts */
.toasts {
  position: fixed; z-index: 100; left: 50%; transform: translateX(-50%);
  top: calc(12px + env(safe-area-inset-top, 0px)); width: calc(100% - 32px); max-width: 520px;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
  background: #16211c; color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2); animation: toastIn .25s ease; pointer-events: auto;
}
.toast i { margin-top: 2px; }
.toast.ok i { color: #4ade80; }
.toast.error i { color: #f87171; }
.toast.out { opacity: 0; transform: translateY(-6px); transition: all .2s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* Auth screens */
.auth {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
}
.auth-top {
  background: linear-gradient(160deg, var(--primary) 0%, #064d2f 100%);
  color: #fff; padding: 48px 24px 64px; text-align: center; position: relative;
}
.auth-top .back {
  position: absolute; left: 10px; top: 10px; color: #fff;
}
.auth-logo {
  width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 14px;
  background: rgba(255, 255, 255, .15); display: grid; place-items: center; font-size: 30px;
}
.auth-top h1 { font-size: 22px; margin: 0; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.auth-top p { margin: 8px 0 0; opacity: .8; font-size: 13.5px; }
.auth-body {
  flex: 1; background: var(--bg); margin-top: -28px; border-radius: 28px 28px 0 0;
  padding: 28px 20px calc(28px + var(--safe-b)); position: relative;
}
.auth-body .h2 { font-size: 20px; }
.step-anim { animation: stepIn .25s ease; }
@keyframes stepIn { from { opacity: 0; transform: translateX(12px); } }

/* PIN pad */
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 22px 0 8px; }
.pin-dots span {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--faint); transition: all .12s;
}
.pin-dots span.on { background: var(--primary); border-color: var(--primary); transform: scale(1.08); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 18px auto 0; }
.key {
  height: 60px; border-radius: 18px; border: 0; background: var(--surface); font-size: 24px; font-weight: 600;
  cursor: pointer; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.key:active { background: var(--surface-2); transform: scale(.97); }
.key.fn { background: transparent; box-shadow: none; border: 0; font-size: 18px; color: var(--muted); }

.otp-input {
  letter-spacing: .5em; text-align: center; font-size: 24px; font-weight: 700; height: 60px;
  font-variant-numeric: tabular-nums;
}
.dev-hint {
  margin-top: 10px; padding: 8px 12px; border-radius: 10px; font-size: 12.5px;
  background: var(--warn-soft); color: var(--warn); text-align: center;
}

/* Choice list (radio cards) */
.choice {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface); margin-bottom: 8px;
}
.choice.active { border-color: var(--primary); background: var(--primary-soft); }
.choice .radio {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--faint); flex: none; position: relative;
}
.choice.active .radio { border-color: var(--primary); }
.choice.active .radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--primary); }

/* Payment rows */
.pay-ic {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; font-size: 16px;
  background: var(--primary-soft); color: var(--primary);
}
.pay-ic.pending { background: var(--warn-soft); color: var(--warn); }
.pay-ic.rejected, .pay-ic.cancelled { background: var(--danger-soft); color: var(--danger); }

.parse-card { border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 14px; margin-top: 12px; }
.parse-card.good { border-style: solid; border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: var(--ok-soft); }
.parse-card.bad { border-style: solid; border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-soft); }
.parse-card .kv { border-bottom-color: color-mix(in srgb, var(--text) 10%, transparent); }

/* Approval cards */
.appr { padding: 14px; }
.appr + .appr { margin-top: 10px; }
.appr .top { display: flex; gap: 12px; align-items: flex-start; }
.appr .amt { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.appr .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.appr .btn-row { margin-top: 12px; }

/* Board */
.period-nav {
  display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px;
}
.period-nav .label { flex: 1; text-align: center; font-weight: 700; font-size: 14.5px; }
.period-nav .label small { display: block; font-weight: 600; font-size: 12px; color: var(--muted); }
.period-nav .icon-btn[disabled] { opacity: .3; }
.board-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.bs {
  border-radius: var(--radius-sm); padding: 10px; text-align: center; cursor: pointer; border: 1.5px solid transparent;
  background: var(--surface);
}
.bs .n { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bs .t { font-size: 12px; font-weight: 600; }
.bs.paid { background: var(--ok-soft); color: var(--ok); }
.bs.partial { background: var(--warn-soft); color: var(--warn); }
.bs.unpaid { background: var(--danger-soft); color: var(--danger); }
.bs.active { border-color: currentColor; }
.progress { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; display: flex; }
.progress span { height: 100%; }
.progress .p-ok { background: var(--ok); }
.progress .p-warn { background: var(--warn); }

/* Chat */
.chat-wrap { display: flex; flex-direction: column; gap: 4px; padding-bottom: 80px; }
.msg { max-width: 82%; display: flex; flex-direction: column; }
.msg .bubble {
  padding: 8px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
  white-space: pre-wrap; word-break: break-word; font-size: 14.5px;
}
.msg .who { font-size: 12px; font-weight: 700; color: var(--primary); margin: 6px 0 2px 10px; }
.msg .who .role { color: var(--faint); font-weight: 600; margin-left: 4px; }
.msg .time { font-size: 11px; color: var(--faint); margin: 2px 10px 0; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.mine .bubble { background: var(--primary); color: var(--primary-ink); border-color: transparent; border-bottom-right-radius: 6px; }
.msg:not(.mine) .bubble { border-bottom-left-radius: 6px; }
.msg.ann { max-width: 100%; align-self: stretch; }
.msg.ann .bubble { background: var(--warn-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.msg.ann .who { color: var(--warn); }
.day-sep { align-self: center; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 3px 10px; border-radius: 999px; margin: 10px 0 4px; }
.composer {
  position: fixed; z-index: 26; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px;
  bottom: calc(var(--tabbar-h) + var(--safe-b));
  display: flex; gap: 8px; align-items: flex-end; padding: 8px 12px;
  background: var(--bg); border-top: 1px solid var(--border);
}
body.no-tabbar .composer { bottom: 0; padding-bottom: calc(8px + var(--safe-b)); }
.composer textarea {
  flex: 1; min-height: 44px; max-height: 120px; height: 44px; resize: none; padding: 11px 14px;
  border-radius: 22px; border: 1.5px solid var(--border); background: var(--surface); outline: none; font-size: 15px;
}
.composer textarea:focus { border-color: var(--primary); }
.composer .send {
  width: 44px; height: 44px; border-radius: 50%; border: 0; flex: none; cursor: pointer;
  background: var(--primary); color: var(--primary-ink); font-size: 16px;
}
.composer .ann-toggle { width: 44px; height: 44px; flex: none; }
.composer .ann-toggle.on { color: var(--warn); background: var(--warn-soft); }

/* Profile */
.profile { text-align: center; padding: 24px 16px; }
.profile .avatar { margin: 0 auto 10px; }

.copy-line {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--primary-soft); color: var(--primary);
}
.copy-line .num { font-weight: 800; font-size: 17px; letter-spacing: .02em; }

.load-more { display: block; margin: 12px auto 0; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
