/* HC Construction. Pirmiausia telefonui. Šviesi ir tamsi temos iš tų pačių žetonų. */

@font-face {
  font-family: "Raleway";
  src: url("/fonts/Raleway-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #eceff4;
  --amb-1: rgba(42, 79, 168, 0.24);
  --amb-2: rgba(222, 170, 112, 0.30);
  --amb-3: rgba(110, 160, 220, 0.22);
  --surface: rgba(255, 255, 255, 0.62);
  --surface-solid: #ffffff;
  --surface-2: rgba(255, 255, 255, 0.40);
  --line: rgba(17, 26, 46, 0.08);
  --glass-edge: rgba(255, 255, 255, 0.78);
  --glass-hi: rgba(255, 255, 255, 0.55);
  --ink: #111a2e;
  --ink-2: #4a5468;
  --ink-3: #7d8597;
  --brand: #183883;
  --brand-2: #2a4fa8;
  --brand-soft: #e7ecf8;
  --on-brand: #ffffff;
  /* būsenos (dataviz status paletė; visada su ikona ir užrašu) */
  --good: #0ca30c;
  --good-ink: #006300;
  --good-soft: #e3f4e3;
  --warning: #fab219;
  --warning-ink: #7a5200;
  --warning-soft: #fdf1d6;
  --serious: #ec835a;
  --serious-ink: #8f3a16;
  --serious-soft: #fbe7de;
  --critical: #d03b3b;
  --critical-ink: #a32222;
  --critical-soft: #fae3e3;
  --neutral: #9aa1b0;
  --neutral-soft: #eef0f3;
  /* sklypai: tos pačios spalvos kaip laiškų kortelėje */
  --plot-parduota: #d64c5c;
  --plot-rezervuota: #eca834;
  --plot-laisva: #f0ecde;
  --plot-namas: #f7d04a;
  --shadow: 0 1px 1px rgba(17, 26, 46, 0.03), 0 10px 30px rgba(17, 26, 46, 0.07);
  --radius: 20px;
  --tabbar-h: 64px;
  --font-display: "Raleway", -apple-system, system-ui, sans-serif;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  /* namas */
  --h-line: #2a3550;
  --h-found: #9aa1b0;
  --h-wall: #f4efe4;
  --h-roof: #183883;
  --h-door: #8a5a2b;
  --h-win: #cfe0f5;
  --h-glow: #ffd36b;
  --h-tree: #3f9d5a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #080d1b;
    --amb-1: rgba(70, 100, 210, 0.26);
    --amb-2: rgba(150, 90, 170, 0.16);
    --amb-3: rgba(40, 130, 170, 0.16);
    --surface: rgba(32, 41, 70, 0.55);
    --surface-solid: #151c31;
    --surface-2: rgba(255, 255, 255, 0.05);
    --line: rgba(255, 255, 255, 0.08);
    --glass-edge: rgba(255, 255, 255, 0.09);
    --glass-hi: rgba(255, 255, 255, 0.05);
    --ink: #eef1f7;
    --ink-2: #b2bacb;
    --ink-3: #7e889e;
    --brand: #5b7fe0;
    --brand-2: #7c99ea;
    --brand-soft: #1b2850;
    --on-brand: #ffffff;
    --good-ink: #5fd35f;
    --good-soft: #13301b;
    --warning-ink: #fbc75a;
    --warning-soft: #33290f;
    --serious-ink: #f2a587;
    --serious-soft: #3a2218;
    --critical-ink: #f08a8a;
    --critical-soft: #3b1a1d;
    --neutral-soft: #1e2740;
    --plot-laisva: #e8e2cf;
    --shadow: 0 10px 34px rgba(0, 0, 0, 0.30);
    --h-line: #c9d2e6;
    --h-found: #5a6480;
    --h-wall: #e9e3d6;
    --h-roof: #5b7fe0;
    --h-win: #8fb2e8;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080d1b;
    --amb-1: rgba(70, 100, 210, 0.26);
    --amb-2: rgba(150, 90, 170, 0.16);
    --amb-3: rgba(40, 130, 170, 0.16);
  --surface: rgba(32, 41, 70, 0.55);
    --surface-solid: #151c31;
  --surface-2: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.08);
    --glass-edge: rgba(255, 255, 255, 0.09);
    --glass-hi: rgba(255, 255, 255, 0.05);
  --ink: #eef1f7;
  --ink-2: #b2bacb;
  --ink-3: #7e889e;
  --brand: #5b7fe0;
  --brand-2: #7c99ea;
  --brand-soft: #1b2850;
  --good-ink: #5fd35f;
  --good-soft: #13301b;
  --warning-ink: #fbc75a;
  --warning-soft: #33290f;
  --serious-ink: #f2a587;
  --serious-soft: #3a2218;
  --critical-ink: #f08a8a;
  --critical-soft: #3b1a1d;
  --neutral-soft: #1e2740;
  --plot-laisva: #e8e2cf;
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.30);
  --h-line: #c9d2e6;
  --h-found: #5a6480;
  --h-wall: #e9e3d6;
  --h-roof: #5b7fe0;
  --h-win: #8fb2e8;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.noscroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-variant-numeric: lining-nums; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
small { font-size: 0.8em; }
.muted { color: var(--ink-2); }
.hint { color: var(--ink-3); font-size: 13px; }
.late { color: var(--critical-ink) !important; font-weight: 600; }
.missing { color: var(--serious-ink) !important; }
.ic { flex: none; display: block; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Karkasas ---------- */

.shell { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px); }
.view { } /* be animacijos: transform ekrane „pagautų“ fiksuotus mygtukus */
@keyframes fadein { from { transform: translateY(4px); } }
@keyframes dimin { from { opacity: 0; } }
.pad { padding: 4px 16px 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 360px) { .grid2 { grid-template-columns: 1fr; } }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.topbar h1 { flex: 1; font-size: 19px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar.home { justify-content: space-between; padding-left: 16px; }
.topbar-gap { width: 4px; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.avatar-link { display: flex; margin-left: 4px; }

.icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px; color: var(--ink);
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { opacity: 0.4; }
.icon-btn.accent { background: var(--brand); color: var(--on-brand); }
.badge {
  position: absolute; top: 3px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--critical); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center;
  border: 2px solid var(--bg); box-sizing: content-box; transform: translate(35%, -20%);
}

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  max-width: 560px; margin: 0 auto;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); font-size: 11px; font-weight: 600; }
.tabbar a.on { color: var(--brand); }
.tabbar a.on .ic { transform: translateY(-1px); }

.fab {
  position: fixed; z-index: 25;
  right: max(16px, calc(50vw - 280px + 16px));
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  width: 58px; height: 58px; border-radius: 20px;
  display: grid; place-items: center;
  background: var(--brand); color: var(--on-brand);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--brand) 40%, transparent);
  transition: transform 0.15s;
}
.fab:active { transform: scale(0.94); }

/* ---------- Kortelės, sąrašai ---------- */

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.card.list { padding: 4px 0; overflow: hidden; }
.sec-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin: 6px 2px 10px; color: var(--ink); }
.sub-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); margin: 10px 2px 8px; font-family: var(--font); }
.sec-link { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--brand); font-family: var(--font); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--neutral-soft); color: var(--ink-2); font: 700 12px/1 var(--font); }

.row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; min-height: 56px; width: 100%; text-align: left; }
.row + .row { border-top: 1px solid var(--line); }
a.row:active, button.row:active { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-weight: 600; font-size: 15px; line-height: 1.3; display: flex; align-items: center; gap: 4px; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; font-size: 13px; color: var(--ink-2); }
.row-meta > span:not(:first-child)::before { content: "·"; margin: 0 6px; color: var(--ink-3); }
.row-meta > .tag::before, .row-meta > .meta-ic::before { content: none !important; }
.row-meta > .tag, .row-meta > .meta-ic { margin-left: 8px; }
.row-chev { color: var(--ink-3); }
.row-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.urgent-ic { color: var(--critical); }
.tag { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); }
.meta-ic { display: inline-flex; align-items: center; gap: 2px; }

/* tonai: fonas švelnus, tekstas/ikona tamsesnis */
.tone-good { background: var(--good-soft); color: var(--good-ink); }
.tone-warning { background: var(--warning-soft); color: var(--warning-ink); }
.tone-serious { background: var(--serious-soft); color: var(--serious-ink); }
.tone-critical { background: var(--critical-soft); color: var(--critical-ink); }
.tone-brand { background: var(--brand-soft); color: var(--brand); }
.tone-neutral, .tone-muted { background: var(--neutral-soft); color: var(--ink-2); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 12.5px; font-weight: 650; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; text-align: center; color: var(--ink-3); }
.empty strong { color: var(--ink-2); font-size: 15px; }
.empty .ic { color: var(--good); }
.loading { display: flex; justify-content: center; gap: 6px; padding: 28px; }
.loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); animation: dots 1s infinite ease-in-out; }
.loading span:nth-child(2) { animation-delay: 0.15s; }
.loading span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dots { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.errorbox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--critical-soft); color: var(--critical-ink); font-size: 14px; }

.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.callout.serious { background: var(--serious-soft); color: var(--serious-ink); }
.callout.warning { background: var(--warning-soft); color: var(--warning-ink); }
.callout.brand { background: var(--brand-soft); color: var(--brand); }

/* ---------- Mygtukai, laukai ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 0 18px; border-radius: 13px; font-weight: 650; font-size: 15px;
  transition: transform 0.1s, background 0.15s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn.disabled { opacity: 0.5; pointer-events: none; }
.btn.primary { background: var(--brand); color: var(--on-brand); }
.btn.ghost { background: var(--brand-soft); color: var(--brand); }
.btn.subtle { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn.danger-ghost { color: var(--critical-ink); }
.btn.block { width: 100%; }
.btn.lg { min-height: 54px; font-size: 16px; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.grow { flex: 1; }
.row-btns { display: flex; gap: 10px; }
.link { color: var(--brand); font-weight: 600; text-align: left; }
.link.more { font-size: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.field.big > span { font-size: 15px; color: var(--ink); }
.field input, .field textarea, .field select, .comment-form input, .invite input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font-size: 16px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; min-height: 48px; }
.field.big textarea { font-size: 18px; font-weight: 600; font-family: var(--font); }
.field input:focus, .field textarea:focus, .field select:focus, .comment-form input:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.form-err { color: var(--critical-ink); font-size: 14px; font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip.date { padding: 0 10px; max-width: 160px; }

.switch { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.switch span { display: inline-flex; align-items: center; gap: 4px; }
.switch input { width: 20px; height: 20px; accent-color: var(--brand); }

.seg-ctl { display: flex; padding: 3px; gap: 2px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.seg-ctl button { flex: 1; min-height: 38px; border-radius: 10px; font-size: 14px; font-weight: 650; color: var(--ink-2); }
.seg-ctl button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg-ctl.small button { min-height: 32px; font-size: 13px; }

/* ---------- Šiandien ---------- */

.hello { display: flex; flex-direction: column; gap: 10px; padding: 6px 2px 4px; }
.hello h1 { font-size: 26px; font-weight: 700; line-height: 1.15; }
.hello-lvl { display: flex; align-items: center; gap: 12px; }
.hello-lvl .xpbar { flex: 1; }

.lvl-chip {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  padding: 4px 10px 4px 8px; border-radius: 999px;
  background: var(--brand); color: var(--on-brand); font: 700 13px/1 var(--font);
}
.lvl-chip .lvl-name { font-weight: 600; opacity: 0.9; }
.lvl-chip.small { padding: 3px 8px 3px 6px; font-size: 12px; background: var(--brand-soft); color: var(--brand); }

.xpbar-track { height: 8px; border-radius: 4px; background: var(--neutral-soft); overflow: hidden; }
.xpbar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width 0.6s cubic-bezier(.2,.8,.2,1); }
.xpbar-sub { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.project-card { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.pc-head { display: flex; align-items: center; justify-content: space-between; color: var(--ink-3); }
.pc-head h3 { font-size: 19px; font-weight: 700; color: var(--ink); }
.pc-next { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); padding-top: 10px; border-top: 1px solid var(--line); }
.pc-next.late { color: var(--critical-ink); }

.meter-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.meter-label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.meter-val { font: 700 20px/1 var(--font-display); font-variant-numeric: lining-nums tabular-nums; }
.meter-track { height: 10px; border-radius: 5px; background: var(--neutral-soft); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 5px; transition: width 0.6s cubic-bezier(.2,.8,.2,1); }
.meter-fill.tone-brand { background: var(--brand); }
.meter-fill.tone-warning { background: var(--warning); }
.meter-fill.tone-critical { background: var(--critical); }
.meter-sub { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }

.sales-bar { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; }
.sales-bar .seg { height: 100%; }
.sales-bar .seg:first-child { border-radius: 5px 0 0 5px; }
.sales-bar .seg:last-child { border-radius: 0 5px 5px 0; }
.plot-parduota { background: var(--plot-parduota); }
.plot-rezervuota { background: var(--plot-rezervuota); }
.plot-laisva { background: var(--plot-laisva); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent); }
.plot-namas { background: var(--plot-namas); }
.sales-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.sales-legend span, .legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.missing-card { display: flex; align-items: center; gap: 12px; padding: 14px; }
.missing-card > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.missing-card small { color: var(--ink-2); }
.mc-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--warning-soft); color: var(--warning-ink); }

/* ---------- Užduotys ---------- */

.task-head { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.task-title { font-size: 23px; font-weight: 700; line-height: 1.2; }
.task-desc { color: var(--ink-2); white-space: pre-wrap; }
.facts { padding: 4px 14px; }
.fact { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; font-size: 14.5px; }
.fact + .fact { border-top: 1px solid var(--line); }
.fact > span { color: var(--ink-3); flex: none; }
.fact > b { font-weight: 600; text-align: right; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.fact > b a { color: var(--brand); }
.fact.col { flex-direction: column; align-items: flex-start; }
.fact.col p { white-space: pre-wrap; }
.call { color: var(--brand); display: inline-flex; align-items: center; gap: 3px; }
.answer { padding: 14px; }
.answer .label { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.answer p { margin-top: 4px; white-space: pre-wrap; }
.action-card { padding: 14px; display: flex; flex-direction: column; gap: 12px; }

.files { padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.file { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 14px; max-width: 100%; }
.file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file small { color: var(--ink-3); flex: none; }
.thumb { position: relative; width: 92px; height: 92px; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb small { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 6px; font-size: 10.5px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.thumb.add { border: 1.5px dashed var(--line); color: var(--ink-3); display: flex; flex-direction: column; gap: 2px; }
.thumb.add small { position: static; background: none; color: inherit; }
.photos { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }

.timeline { list-style: none; margin: 0; padding: 0 2px; display: flex; flex-direction: column; gap: 12px; }
.ev { display: flex; gap: 10px; font-size: 14px; }
.ev-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; border: 1px solid var(--line); }
.ev small { display: block; color: var(--ink-3); font-size: 12px; }
.ev-text { color: var(--ink-2); white-space: pre-wrap; }
.ev-komentaras .ev-text { color: var(--ink); }
.ev-patvirtinta .ev-ic { background: var(--good-soft); color: var(--good-ink); }
.ev-grazinta .ev-ic { background: var(--serious-soft); color: var(--serious-ink); }
.comment-form { display: flex; gap: 8px; margin-top: 14px; align-items: center; }
.comment-form input { flex: 1; }

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.person-chip {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px;
  border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); text-align: center;
}
.person-chip.on { border-color: var(--brand); background: var(--brand-soft); }
.pc-name { font-weight: 650; font-size: 14px; }
.person-chip small { font-size: 11px; color: var(--ink-3); line-height: 1.2; }
.more-box { padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }

.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: var(--av); color: #fff; font-weight: 700; flex: none; letter-spacing: 0.02em; font-family: var(--font); }

/* ---------- Bottom sheet ---------- */

.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(8, 12, 24, 0.45); display: flex; align-items: flex-end; justify-content: center; animation: dimin 0.15s; }
.sheet {
  width: 100%; max-width: 560px; max-height: 88dvh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom);
  animation: up 0.22s cubic-bezier(.2,.8,.2,1);
}
.sheet.tall { height: 88dvh; }
@keyframes up { from { transform: translateY(40px); opacity: 0.6; } }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 6px 18px; }
.sheet-head h2 { flex: 1; font-size: 18px; font-weight: 700; }
.sheet-body { overflow-y: auto; padding: 6px 16px 22px; -webkit-overflow-scrolling: touch; }

.toast {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 86px);
  padding: 11px 18px; border-radius: 14px; background: var(--ink); color: var(--bg);
  font-weight: 650; font-size: 14.5px; box-shadow: 0 8px 24px rgba(0,0,0,.2);
  animation: toastin 0.25s cubic-bezier(.2,.8,.2,1); max-width: calc(100vw - 32px);
}
.toast.error { background: var(--critical); color: #fff; }
.toast.xp { background: linear-gradient(135deg, var(--brand), #6a4fd6); color: #fff; font-family: var(--font-display); font-size: 17px; font-weight: 750; animation: xpin 0.5s cubic-bezier(.2,1.4,.4,1); }
.toast-spark { margin-right: 8px; display: inline-block; animation: spin 1.6s linear infinite; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 10px); } }
@keyframes xpin { from { opacity: 0; transform: translate(-50%, 16px) scale(0.85); } }

/* ---------- Žemėlapis ---------- */

.summary { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.map-tools { display: flex; align-items: center; gap: 10px; }
.map-tools .seg-ctl { flex: 1; }
.zoom { display: flex; gap: 4px; }
.zoom .icon-btn { background: var(--surface); border: 1px solid var(--line); }
.map-wrap { border-radius: var(--radius); overflow: hidden; background: #10131c; border: 1px solid var(--line); box-shadow: var(--shadow); }
.map-scroll { overflow: auto; -webkit-overflow-scrolling: touch; max-height: 70dvh; }
.map { display: block; height: auto; min-width: 100%; }
.map-wrap.placing .map { cursor: crosshair; }
.plot { stroke-width: 1.4; cursor: pointer; transition: opacity 0.2s; }
.plot.plot-laisva { fill: rgba(255,255,255,.10); stroke: rgba(255,255,255,.65); }
.plot.plot-rezervuota { fill: rgba(236,168,52,.62); stroke: #eca834; }
.plot.plot-parduota { fill: rgba(214,76,92,.62); stroke: #d64c5c; }
.plot.plot-namas { fill: rgba(247,208,74,.5); stroke: #f7d04a; }
.plot.dim { opacity: 0.75; }
.marker { cursor: pointer; }
.marker .m-hit { fill: transparent; }
.marker .m-dot { stroke: #fff; stroke-width: 2.4; filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); transition: r 0.15s; }
.marker text { fill: #fff; font-weight: 800; text-anchor: middle; font-family: var(--font); pointer-events: none; }
.ms-suplanuota .m-dot { fill: #6b7385; }
.ms-vyksta .m-dot { fill: #e09a00; }
.ms-atlikta .m-dot { fill: #0a8a0a; }
.ms-veluoja .m-dot { fill: var(--critical); }
.marker.sel .m-dot { stroke: var(--plot-namas); stroke-width: 3.5; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); padding: 0 2px; }
.mdot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.mdot.ms-suplanuota { background: #6b7385; }
.mdot.ms-vyksta { background: #e09a00; }
.mdot.ms-atlikta { background: #0a8a0a; }
.mdot.ms-veluoja { background: var(--critical); }

.wnum { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; font-weight: 800; font-size: 13px; }
.wnum.ms-suplanuota { background: #6b7385; }
.wnum.ms-vyksta { background: #e09a00; }
.wnum.ms-atlikta { background: #0a8a0a; }
.wnum.ms-veluoja { background: var(--critical); }
.row-pct { font: 700 14px/1 var(--font); font-variant-numeric: tabular-nums; color: var(--ink-2); flex: none; }
.row-pct .ic { color: var(--good-ink); }
.mini-track { height: 4px; border-radius: 2px; background: var(--neutral-soft); margin-top: 4px; overflow: hidden; }
.mini-track span { display: block; height: 100%; background: #e09a00; border-radius: 2px; }

.big-progress input[type="range"] { width: 100%; accent-color: var(--brand); height: 28px; }
.big-progress .chips { margin-top: 4px; margin-bottom: 10px; }

/* ---------- Paštas ---------- */

.intro { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.intro .ic { color: var(--brand); }
.ticks { margin: 4px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.mail-row { align-items: flex-start; }
.mail-row .row-title { font-weight: 450; color: var(--ink-2); font-size: 14px; }
.mail-row.unread .row-title { color: var(--ink); font-weight: 600; }
.mail-top { display: flex; justify-content: space-between; gap: 8px; }
.mail-top b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row.unread .mail-top b { font-weight: 750; }
.mail-top small { color: var(--ink-3); flex: none; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; }
.mail-row.unread .unread-dot { background: var(--brand); }
.mail-head { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.mail-head h2 { font-size: 21px; line-height: 1.25; }
.mail-body { padding: 10px; overflow: hidden; background: #fff; }
.mail-body iframe { width: 100%; border: 0; display: block; }
.mail-text { white-space: pre-wrap; word-wrap: break-word; font: 15px/1.5 var(--font); margin: 0; color: #1d2433; }

/* ---------- Komanda ---------- */

.person-row .row-title { font-size: 16px; }
.week { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.week-row { display: grid; grid-template-columns: 76px 1fr 36px; align-items: center; gap: 10px; font-size: 14px; }
.week-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.week-track { height: 10px; border-radius: 5px; background: var(--neutral-soft); overflow: hidden; }
.week-track span { display: block; height: 100%; border-radius: 5px; background: var(--brand); min-width: 2px; }
.week-row b { text-align: right; font-variant-numeric: tabular-nums; }
.person-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 8px 0 4px; }
.person-hero h2 { font-size: 22px; margin-top: 4px; }
.invite { display: flex; flex-wrap: wrap; gap: 8px; }
.invite input { flex: 1; min-width: 0; font-size: 13px; }

/* ---------- Profilis ir namas ---------- */

.house-card { padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; background: linear-gradient(180deg, var(--brand-soft), var(--surface) 70%); }
.house-card .xpbar { width: 100%; }
.house-lvl { display: flex; align-items: center; gap: 12px; }
.lvl-num { font: 800 44px/1 var(--font-display); color: var(--brand); font-variant-numeric: lining-nums; }
.house-lvl small { color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; }
.house-lvl h2 { font-size: 24px; }
.house { display: block; max-width: 100%; height: auto; overflow: visible; }
.house .h-ground { stroke: var(--h-line); stroke-width: 2; stroke-linecap: round; }
.house .h-line { stroke: var(--h-line); stroke-width: 2; fill: none; stroke-linecap: round; }
.house .h-rope { stroke: var(--h-line); stroke-width: 1.2; stroke-dasharray: 3 3; fill: none; opacity: 0.6; }
.house .h-found { fill: var(--h-found); }
.house .h-wall { fill: var(--h-wall); stroke: var(--h-line); stroke-width: 2; }
.house .h-roof { fill: var(--h-roof); stroke: var(--h-line); stroke-width: 2; stroke-linejoin: round; }
.house .h-door { fill: var(--h-door); }
.house .h-win { fill: var(--h-win); stroke: var(--h-line); stroke-width: 1.5; }
.house .h-trim path { stroke: var(--h-line); stroke-width: 1.5; fill: none; opacity: 0.55; }
.house .h-tree { fill: var(--h-tree); }
.house .h-path { stroke: var(--h-found); stroke-width: 6; fill: none; stroke-linecap: round; opacity: 0.6; }
.house .h-chim { fill: var(--h-door); stroke: var(--h-line); stroke-width: 1.5; }
.house .h-smoke { stroke: var(--ink-3); stroke-width: 1.6; fill: none; stroke-linecap: round; animation: smoke 3s ease-in-out infinite; }
.house .h-glow { fill: var(--h-glow); filter: drop-shadow(0 0 4px var(--h-glow)); }
.house .h-far rect, .house .h-far path { fill: var(--h-found); opacity: 0.45; }
.house .h-sun { fill: var(--h-glow); opacity: 0.85; }
.house .h-horizon { stroke: var(--h-glow); stroke-width: 2; fill: none; opacity: 0.6; }
.house .h-ghost * { fill: none !important; stroke: var(--brand) !important; stroke-dasharray: 4 3; stroke-width: 1.5 !important; opacity: 0.55; filter: none !important; animation: ghost 2.4s ease-in-out infinite; }
@keyframes ghost { 50% { opacity: 0.2; } }
@keyframes smoke { 50% { transform: translateY(-3px); opacity: 0.5; } }

.rules { padding: 6px 14px; }
.rule { display: flex; align-items: center; gap: 12px; padding: 9px 0; font-size: 14.5px; }
.rule + .rule { border-top: 1px solid var(--line); }
.rule b { width: 42px; color: var(--good-ink); font-variant-numeric: tabular-nums; }
.xp-row .xp-amt { width: 42px; color: var(--good-ink); font-variant-numeric: tabular-nums; }
.xp-badge { flex: none; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--good-soft); color: var(--good-ink); }
.levels { padding: 12px 14px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.lv { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 12px; text-align: center; color: var(--ink-3); }
.lv span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--neutral-soft); }
.lv b { font-size: 11.5px; font-weight: 650; line-height: 1.15; }
.lv small { font-size: 10.5px; }
.lv.done span { background: var(--brand-soft); color: var(--brand); }
.lv.done b { color: var(--ink-2); }
.lv.now { background: var(--brand-soft); color: var(--brand); }
.lv.now span { background: var(--brand); color: var(--on-brand); }
.lv.now b { color: var(--ink); }

.setting { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; text-align: left; }
.setting + .setting { border-top: 1px solid var(--line); }
.setting small { color: var(--ink-3); }
.set-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }

.notif.unread { background: color-mix(in srgb, var(--brand-soft) 55%, transparent); }

/* ---------- Prisijungimas ---------- */

.auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 24px 16px; max-width: 440px; margin: 0 auto; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink-2); }
.auth-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h2 { font-size: 22px; }
.logo { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; }
.logo-img { display: block; height: auto; }
.logo-app { font: 600 13px/1 var(--font-display); letter-spacing: 0.32em; text-transform: uppercase; color: var(--brand); padding-left: 0.32em; }
.logo.small { flex-direction: row; gap: 10px; }
.logo.small .logo-app { font-size: 10.5px; letter-spacing: 0.24em; padding: 0 0 0 10px; border-left: 1px solid var(--line); line-height: 26px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-img { filter: brightness(0) invert(1); } }
:root[data-theme="dark"] .logo-img { filter: brightness(0) invert(1); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Pokalbiai ---------- */

.tabbar a { position: relative; }
.tab-badge {
  position: absolute; top: 6px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--critical); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center;
  border: 2px solid var(--surface); box-sizing: content-box;
}
.chat-row { width: 100%; text-align: left; }
.chat-row.group { padding: 14px; }
.group-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--brand); color: var(--on-brand); flex: none; }
.group-ic.sm { width: 32px; height: 32px; border-radius: 10px; }
.chat-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.chat-top b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-top small { color: var(--ink-3); flex: none; }
.chat-prev { font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row.unread .chat-prev { color: var(--ink); font-weight: 600; }
.unread-badge { flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--brand); color: var(--on-brand); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.muted-ic { color: var(--ink-3); }

.chat-view { display: flex; flex-direction: column; height: 100dvh; max-width: 560px; margin: 0 auto; }
.chat-view .topbar { border-bottom: 1px solid var(--line); }
.chat-view .topbar h1 { display: flex; flex-direction: column; line-height: 1.15; font-size: 17px; }
.chat-view .topbar h1 .sub { font: 500 12px var(--font); color: var(--ink-3); }
.chat-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 12px 6px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.chat-scroll .older { align-self: center; margin-bottom: 8px; }
.day-sep { display: flex; justify-content: center; margin: 12px 0 6px; }
.day-sep span { font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--surface-2); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; }
.msg { display: flex; align-items: flex-end; gap: 6px; margin-top: 8px; }
.msg.cont { margin-top: 2px; }
.msg.mine { justify-content: flex-end; }
.msg-av { width: 28px; flex: none; }
.bubble {
  position: relative; max-width: 78%; padding: 8px 12px 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  font-size: 15.5px; line-height: 1.38; cursor: pointer; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 4px;
}
.msg:not(.mine) .bubble { border-bottom-left-radius: 6px; }
.msg.mine .bubble { background: var(--brand); color: var(--on-brand); border-color: var(--brand); border-bottom-right-radius: 6px; }
.msg.cont:not(.mine) .bubble { border-top-left-radius: 6px; }
.msg.cont.mine .bubble { border-top-right-radius: 6px; }
.bubble a { color: inherit; text-decoration: underline; }
.bubble.deleted { background: transparent; color: var(--ink-3); border-style: dashed; }
.msg.mine .bubble.deleted { background: transparent; color: var(--ink-3); border-color: var(--line); }
.bubble.photo { padding: 4px; }
.bubble img { display: block; max-width: 100%; max-height: 320px; border-radius: 14px; object-fit: cover; }
.msg-name { font-size: 12.5px; font-weight: 700; color: var(--brand); }
.msg-text { white-space: pre-wrap; }
.msg-time { align-self: flex-end; font-size: 10.5px; opacity: 0.65; margin-top: -2px; }
.bubble.photo .msg-time { position: absolute; right: 12px; bottom: 9px; color: #fff; opacity: 0.95; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.msg-file { display: flex; align-items: center; gap: 6px; text-decoration: none !important; }
.msg-file span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-file small { opacity: 0.7; flex: none; }
.mentions { display: flex; gap: 6px; padding: 6px 12px 0; overflow-x: auto; }
.mentions .chip { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.chat-input {
  display: flex; align-items: flex-end; gap: 6px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
}
.chat-input textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 20px; padding: 9px 14px; font-size: 16px; line-height: 1.35;
  background: var(--surface-2); outline: none; max-height: 140px; font-family: var(--font); scrollbar-width: none;
}
.chat-input textarea:focus { border-color: var(--brand); }
.chat-input .icon-btn { flex: none; }
.chat-input .icon-btn.accent { border-radius: 50%; }
.sheet-quote { padding: 10px 12px; border-left: 3px solid var(--brand); background: var(--surface); border-radius: 8px; white-space: pre-wrap; max-height: 160px; overflow: auto; color: var(--ink-2); }
.chat-input textarea::-webkit-scrollbar { display: none; }

/* kas matė */
.seen-info { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.seen-row { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.seen-row > span:not(.avatar) { flex: 1; font-weight: 600; }
.seen-row .ok { color: var(--good-ink); font-weight: 600; }
.seen-row .no { color: var(--serious-ink); font-weight: 600; }

/* =========================================================================
   Stiklas: minimalistiškas, jaukus „Mac“ stilius (2026-10-12, Roberto prašymas)
   Fonas yra švelnūs spalvoti šviesos lopai, ant jų permatomos kortelės.
   Tikras suliejimas (backdrop-filter) tik ten, kur stiklas guli ant turinio:
   viršutinė juosta, apatinis meniu, langai, peržiūra. Kortelėms jo nereikia,
   nes po jomis lygus fonas, todėl telefone nelėtėja.
   ========================================================================= */

html { background: var(--bg); }
body { background: var(--bg); }
body::before {
  content: ""; position: fixed; inset: -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 32% at 12% 8%, var(--amb-1), transparent 70%),
    radial-gradient(40% 34% at 92% 22%, var(--amb-3), transparent 70%),
    radial-gradient(55% 40% at 80% 92%, var(--amb-2), transparent 72%),
    radial-gradient(38% 30% at 8% 70%, var(--amb-3), transparent 70%);
}

.card { border: 1px solid var(--glass-edge); box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi); }
.card.list { padding: 2px 0; }
.row + .row { border-top-color: var(--line); }
a.row:active, button.row:active { background: var(--surface-2); }

/* viršutinė juosta */
.topbar {
  background: color-mix(in srgb, var(--bg) 50%, transparent);
  backdrop-filter: blur(22px) saturate(1.7);
  -webkit-backdrop-filter: blur(22px) saturate(1.7);
}
.topbar h1 { font-weight: 600; }
.icon-btn:hover { background: var(--surface-2); }

/* apatinis meniu: plūduriuojantis stiklinis „dock“ */
.tabbar {
  left: 12px; right: 12px; max-width: 536px; margin: 0 auto;
  bottom: calc(10px + env(safe-area-inset-bottom));
  height: var(--tabbar-h); padding: 0 6px;
  border-radius: 26px; border: 1px solid var(--glass-edge); border-top: 1px solid var(--glass-edge);
  background: color-mix(in srgb, var(--surface-solid) 62%, transparent);
  backdrop-filter: blur(26px) saturate(1.8);
  -webkit-backdrop-filter: blur(26px) saturate(1.8);
  box-shadow: 0 12px 40px rgba(17, 26, 46, 0.14), inset 0 1px 0 var(--glass-hi);
}
.tabbar a { isolation: isolate; font-weight: 600; }
.tabbar a.on::before {
  content: ""; position: absolute; inset: 7px 6px; z-index: -1; border-radius: 18px;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}
.shell { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 34px); }
.fab {
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px);
  border-radius: 20px;
  background: linear-gradient(145deg, var(--brand-2), var(--brand));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--brand) 35%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.toast { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 96px); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }

/* mygtukai ir valdikliai */
.btn.primary { background: linear-gradient(145deg, var(--brand-2), var(--brand)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.btn.ghost { background: color-mix(in srgb, var(--brand) 11%, transparent); }
.btn.subtle { background: var(--surface); border-color: var(--glass-edge); }
.seg-ctl { background: var(--surface-2); border-color: var(--glass-edge); }
.seg-ctl button.on { background: var(--surface-solid); box-shadow: 0 2px 8px rgba(17, 26, 46, 0.08); }
.chip { background: var(--surface); border-color: var(--glass-edge); }
.chip.on { background: var(--brand); border-color: var(--brand); }
.field input, .field textarea, .field select, .comment-form input, .invite input { background: var(--surface); border-color: var(--glass-edge); }
.lvl-chip { background: linear-gradient(145deg, var(--brand-2), var(--brand)); }
.count { background: var(--surface-2); }
.zoom .icon-btn { background: var(--surface); border-color: var(--glass-edge); }

/* langai iš apačios */
.sheet-wrap { background: rgba(8, 12, 24, 0.28); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet {
  background: color-mix(in srgb, var(--surface-solid) 76%, transparent);
  backdrop-filter: blur(30px) saturate(1.7);
  -webkit-backdrop-filter: blur(30px) saturate(1.7);
  border: 1px solid var(--glass-edge); border-bottom: 0; border-radius: 28px 28px 0 0;
  box-shadow: 0 -10px 40px rgba(17, 26, 46, 0.12);
}

/* pokalbiai */
.chat-view .topbar { border-bottom: 1px solid var(--line); }
.bubble { background: var(--surface); border-color: var(--glass-edge); box-shadow: 0 1px 2px rgba(17, 26, 46, 0.04); }
.msg.mine .bubble { background: linear-gradient(145deg, var(--brand-2), var(--brand)); border-color: transparent; }
.chat-input {
  background: color-mix(in srgb, var(--surface-solid) 60%, transparent);
  backdrop-filter: blur(24px) saturate(1.7);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
  border-top: 1px solid var(--glass-edge);
}
.chat-input textarea { background: var(--surface); border-color: var(--glass-edge); }
.day-sep span { background: var(--surface); border-color: var(--glass-edge); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.msg-img { display: block; padding: 0; border-radius: 14px; overflow: hidden; }
.group-ic { background: linear-gradient(145deg, var(--brand-2), var(--brand)); }

/* prisijungimas */
.auth-card { backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); }

/* ---------- peržiūra (nuotraukos, PDF) ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  background: rgba(6, 9, 18, calc(0.92 * var(--dim, 1)));
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  animation: dimin 0.18s ease-out; touch-action: none;
  padding: calc(env(safe-area-inset-top) + 64px) 0 calc(env(safe-area-inset-bottom) + 48px);
}
.viewer-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 10px;
}
.viewer-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none;
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.viewer-name { flex: 1; color: rgba(255, 255, 255, 0.85); font-size: 14px; font-weight: 600; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; transition: transform 0.18s ease-out; user-select: none; -webkit-user-drag: none; }
.viewer-pdf { width: 100%; height: 100%; border: 0; background: #fff; }
.viewer-file { display: flex; flex-direction: column; align-items: center; gap: 14px; color: #fff; text-align: center; padding: 24px; }
.viewer-hint { position: absolute; bottom: calc(env(safe-area-inset-bottom) + 14px); left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, 0.55); font-size: 12px; }
button.thumb { padding: 0; }


/* ---------- Pokalbis telefone: be tarpo apačioje, juosta virš klaviatūros ---------- */
.shell.full { padding-bottom: 0; min-height: 0; }
html.chat-open, html.chat-open body { overflow: hidden; height: 100%; overscroll-behavior: none; }
.chat-view {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: 100dvh; max-width: 560px; margin: 0 auto;
  will-change: transform;
}
.chat-view.kb .chat-input { padding-bottom: 8px; }
.chat-scroll .empty { margin: auto 0; }

/* varnelės kaip Telegram */
.msg-time { display: inline-flex; align-items: center; gap: 3px; }
.rd-ticks { flex: none; margin-right: -2px; display: block; }
.msg.mine .rd-ticks { color: rgba(255, 255, 255, 0.7); }
.msg.mine .rd-ticks.t-mate-visi { color: #a9f0ff; }
.bubble.photo .rd-ticks { color: #fff !important; }

.msg.mine .bubble.photo { background: transparent; border-color: transparent; box-shadow: none; padding: 0; }
.bubble.photo .msg-time { right: 10px; bottom: 8px; }
.chat-view.kb .chat-input { padding-bottom: 6px; }

/* ---------- Įžanginis ekranas: logotipas, greita linija, frazė ---------- */
.splash {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  padding: 24px;
  background:
    radial-gradient(42% 32% at 12% 8%, var(--amb-1), transparent 70%),
    radial-gradient(40% 34% at 92% 22%, var(--amb-3), transparent 70%),
    radial-gradient(55% 40% at 80% 92%, var(--amb-2), transparent 72%),
    var(--bg);
  transition: opacity 0.38s ease;
}
.splash.out { opacity: 0; pointer-events: none; }
.splash-logo { width: 210px; height: auto; display: block; }
.splash-line { width: 150px; height: 3px; border-radius: 2px; overflow: hidden; background: color-mix(in srgb, var(--brand) 14%, transparent); }
.splash-line span {
  display: block; width: 100%; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
  transform: scaleX(0); transform-origin: left center;
  animation: splashline 1.1s cubic-bezier(0.3, 0.7, 0.2, 1) forwards;
}
@keyframes splashline { to { transform: scaleX(1); } }
.splash-phrase {
  margin: 0; max-width: 290px; min-height: 22px; text-align: center;
  font: 400 16px/1.4 var(--font-display); letter-spacing: 0.01em; color: var(--ink-2);
  opacity: 0; animation: phrasein 0.45s 0.2s ease-out forwards;
}
@keyframes phrasein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .splash-logo { filter: brightness(0) invert(1); } }
:root[data-theme="dark"] .splash-logo { filter: brightness(0) invert(1); }
@media (prefers-reduced-motion: reduce) { .splash-line span { transform: none; } .splash-phrase { opacity: 1; } }
