:root {
  --bg: #F5F5F2;
  --surface: #FFFFFF;
  --surface-2: #EEEEE8;
  --line: #E2E2DC;
  --line-strong: #D5D5CE;
  --ink: #14161A;
  --ink-2: #3A3F47;
  --muted: #5A5F68;
  --accent: #2F5BFF;
  --accent-ink: #1C3FD1;
  --accent-soft: #EEF2FF;
  --brand: #367EF9;
  --yellow: #FFD23F;
  --yellow-soft: #FFF4CC;
  --yellow-ink: #6B5000;
  --green: #0B6B49;
  --green-soft: #E3F4EC;
  --red: #C42B30;
  --red-soft: #FDECEC;
  --dark: #1A1714;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 8px 24px rgba(20, 22, 26, .06);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.1rem; font-weight: 800; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; text-decoration: none; font-weight: 700; }
.skip-link:focus { top: 12px; color: #fff; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.home-grid { display: flex; flex-direction: column; gap: 22px; }
.home-grid > :empty { display: none; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mono { font-family: var(--mono); }
.only-desk { display: none !important; }

.app { min-height: 100vh; min-height: 100dvh; }
.main { padding: 4px 20px calc(var(--tabbar-h) + var(--safe-b) + 28px); max-width: 680px; margin: 0 auto; outline: none; }
.main--wide { max-width: 680px; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 64px; padding: 10px 20px; background: var(--bg); }
.topbar.is-scrolled { box-shadow: 0 1px 0 var(--line); }
.topbar__start { display: flex; align-items: center; gap: 6px; min-width: 0; }
.topbar__title { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__sub { font-size: .82rem; font-weight: 700; color: var(--muted); }
.topbar__actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.topbar--sub { padding-left: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.brand:hover { color: var(--ink); }
.brand img { width: 38px; height: 38px; }
.icon-btn { width: 44px; height: 44px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; padding: 0; }
.icon-btn:hover { color: var(--ink); background: #FAFAF7; }
.icon-btn--plain { border: 0; background: transparent; }
.icon-btn--plain:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; height: calc(var(--tabbar-h) + var(--safe-b)); padding: 6px 6px calc(10px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; min-height: 48px; padding: 4px 0; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 600; }
.tab svg { width: 24px; height: 24px; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--accent); font-weight: 800; }
.tab--fab { color: var(--ink); font-weight: 800; }
.tab--fab span.fab { width: 56px; height: 56px; margin-top: -30px; border-radius: 19px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; border: 4px solid var(--bg); box-shadow: 0 6px 16px rgba(47, 91, 255, .35); }
.tab--fab svg { width: 26px; height: 26px; }
.tab--fab[aria-current="page"] { color: var(--accent); }
.sidebar { display: none; }

.card { background: var(--surface); border-radius: var(--radius); padding: 18px; }
.card--outline { border: 1px solid var(--line); }
.card--dark { background: var(--dark); color: #fff; }
.card--dark .muted { color: #C9CCD2; }
.card--warn { border: 2px solid var(--yellow); }
.section { display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-head a { font-size: .9rem; font-weight: 700; text-decoration: none; padding: 8px 0; }
.kicker { font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill--yellow { background: var(--yellow); color: var(--ink); }
.pill--accent { background: var(--accent-soft); color: var(--accent-ink); }
.pill--green { background: var(--green-soft); color: var(--green); }
.pill--red { background: var(--red-soft); color: var(--red); }
.pill--dark { background: var(--ink); color: #fff; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 15px; border: 0; background: var(--surface); color: var(--ink); font-weight: 700; font-size: .95rem; text-decoration: none; white-space: nowrap; transition: transform .08s ease, background .15s; }
.btn:active { transform: scale(.98); }
.btn:hover { color: inherit; }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn--primary { background: var(--accent); color: #fff; font-weight: 800; }
.btn--primary:hover { background: var(--accent-ink); color: #fff; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #000; color: #fff; }
.btn--light { background: #fff; color: var(--ink); }
.btn--ghost { background: transparent; border: 1px solid var(--line-strong); }
.btn--ghost:hover { background: var(--surface); }
.btn--danger { background: var(--red-soft); color: var(--red); }
.btn--block { width: 100%; }
.btn--lg { min-height: 56px; font-size: 1rem; border-radius: 16px; }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: .88rem; border-radius: 12px; }
.btn[disabled], .btn[aria-disabled="true"] { background: #C9CCD2; color: #fff; cursor: not-allowed; transform: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.spinner { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 20px 4px; margin: 0 -20px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { height: 40px; padding: 0 15px; flex-shrink: 0; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .9rem; }
.chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }
.chip--mono { font-family: var(--mono); font-size: .85rem; }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 92px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .9rem; font-weight: 700; line-height: 1.25; }
.tile:hover { color: var(--ink); border-color: var(--line-strong); }
.tile svg { width: 24px; height: 24px; color: var(--accent); }
.tile .count { position: absolute; top: 12px; right: 12px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; gap: 12px; align-items: center; padding: 13px 14px; border-radius: 16px; background: var(--surface); text-decoration: none; color: var(--ink); min-height: 56px; }
.item:hover { color: var(--ink); background: #FCFCFA; }
.item__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item__title { font-weight: 700; font-size: .97rem; line-height: 1.3; }
.item__meta { font-size: .8rem; color: var(--muted); }
.item__end { font-size: .78rem; color: var(--muted); flex-shrink: 0; }
.item__cat { font-size: .72rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.dot { width: 9px; height: 9px; flex-shrink: 0; border-radius: 999px; background: var(--accent); align-self: flex-start; margin-top: 7px; }
.dot--read { background: transparent; border: 1.5px solid #B8BBC2; }
.chev { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.cat-notice { color: var(--accent-ink); }
.cat-communication { color: var(--ink-2); }
.cat-statement { color: #6B21A8; }
.cat-assembly { color: var(--green); }
.cat-resolved { color: var(--muted); }

.next { display: flex; flex-direction: column; gap: 12px; }
.next__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.next__when { font-size: .85rem; color: #C9CCD2; }
.next h2 { font-size: 1.3rem; }
.next__actions { display: flex; gap: 8px; }
.next__actions .btn--light { flex: 1; }
.btn-icon-dark { width: 50px; min-height: 48px; display: flex; align-items: center; justify-content: center; border: 1px solid #3A3E46; border-radius: 15px; background: transparent; color: #fff; }
.btn-icon-dark svg { width: 20px; height: 20px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.label { font-size: .82rem; font-weight: 700; color: var(--muted); }
.input, .textarea, .select { width: 100%; min-height: 52px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); padding: 12px 14px; font-size: 16px; color: var(--ink); }
.textarea { resize: vertical; min-height: 130px; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 91, 255, .18); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--red); }
.input--code { font-family: var(--mono); font-size: 1.15rem; letter-spacing: .08em; text-transform: uppercase; text-align: center; }
.hint { font-size: .78rem; color: var(--muted); }
.counter { align-self: flex-end; font-size: .75rem; color: var(--muted); }
.counter.is-over { color: var(--red); }
.field-error { font-size: .82rem; font-weight: 600; color: var(--red); }
.form-error { padding: 12px 14px; border-radius: 14px; background: var(--red-soft); color: var(--red); font-weight: 600; font-size: .9rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; }

.choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice__opt { position: relative; }
.choice__opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice__opt span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 84px; padding: 12px 6px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); font-size: .9rem; font-weight: 600; text-align: center; }
.choice__opt span svg { width: 24px; height: 24px; color: var(--muted); }
.choice__opt input:checked + span { border-color: var(--accent); font-weight: 800; }
.choice__opt input:checked + span svg { color: var(--accent); }
.choice__opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.choice--compact span { min-height: 52px; flex-direction: row; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface); cursor: pointer; }
.switch-row__text { display: flex; flex-direction: column; gap: 2px; }
.switch-row__text strong { font-size: .97rem; }
.switch-row__text span { font-size: .82rem; color: var(--muted); }
.switch { position: relative; width: 52px; height: 32px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #C9CCD2; transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; color: var(--ink-2); }
.check input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; accent-color: var(--accent); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.steps li { display: flex; flex-direction: column; gap: 6px; font-size: .7rem; font-weight: 600; color: var(--muted); }
.steps li::before { content: ''; height: 6px; border-radius: 999px; background: var(--line); }
.steps li.is-done::before { background: var(--accent); }
.steps li[aria-current="step"] { color: var(--ink); font-weight: 800; }
.reply { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 16px; background: var(--accent-soft); }
.reply time { font-size: .75rem; font-weight: 700; color: var(--accent-ink); }
.reply p { white-space: pre-line; overflow-wrap: anywhere; }
.summary { border-top: 1px solid var(--surface-2); padding-top: 12px; }
.summary summary { cursor: pointer; font-weight: 700; font-size: .92rem; min-height: 36px; display: flex; align-items: center; list-style: none; }
.summary summary::-webkit-details-marker { display: none; }
.summary summary::after { content: ''; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
.summary[open] summary::after { transform: rotate(-135deg); }
.summary dl { margin: 10px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: .85rem; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; }
.summary__msg { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--bg); font-size: .9rem; color: var(--ink-2); white-space: pre-line; overflow-wrap: anywhere; }
.code-box { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px; border-radius: var(--radius); background: var(--surface); text-align: center; }
.code-box__code { font-family: var(--mono); font-size: 2rem; font-weight: 700; letter-spacing: .12em; }
.success-ico { width: 64px; height: 64px; border-radius: 22px; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; }
.success-ico svg { width: 32px; height: 32px; }

.week { display: grid; grid-template-columns: 32px repeat(7, minmax(0, 1fr)) 32px; gap: 4px; align-items: center; }
.day { position: relative; height: 62px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0; color: var(--ink); }
.day small { font-size: .62rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.day strong { font-size: 1.05rem; }
.day.is-today { border-color: var(--ink); }
.day.has-ev::after { content: ''; position: absolute; bottom: 7px; width: 5px; height: 5px; border-radius: 999px; background: var(--accent); }
.day[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.day[aria-pressed="true"] small { color: #fff; }
.day[aria-pressed="true"].has-ev::after { background: var(--yellow); }
.week__nav { width: 32px; height: 44px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; color: var(--muted); padding: 0; }
.week__nav svg { width: 20px; height: 20px; }
.event { display: flex; flex-direction: column; gap: 12px; }
.event__head { display: flex; gap: 12px; align-items: flex-start; }
.date-chip { width: 50px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 12px; background: var(--bg); }
.date-chip strong { font-size: 1.2rem; line-height: 1.1; }
.date-chip span { font-size: .65rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.event__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.event__desc { font-size: .9rem; color: var(--ink-2); }
.event.is-focus { box-shadow: 0 0 0 3px var(--accent); }
.groups { display: flex; flex-direction: column; gap: 8px; }
.groups__title { font-size: .82rem; font-weight: 700; color: var(--muted); }
.group { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 14px; background: var(--bg); }
.group__ico { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; }
.group__ico svg { width: 20px; height: 20px; }
.group strong { flex: 1; min-width: 0; font-size: .95rem; }
.group__in { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: .88rem; font-weight: 700; text-decoration: none; }
.group__in svg { width: 16px; height: 16px; }

.search { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.search svg { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; height: 100%; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 91, 255, .18); }

.book { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 18px; background: var(--surface); text-decoration: none; color: var(--ink); }
.book:hover { color: var(--ink); }
.book__cover { width: 58px; height: 74px; flex-shrink: 0; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-ink); }
.book__cover img { width: 100%; height: 100%; object-fit: cover; }
.book__cover svg { width: 22px; height: 22px; }
.book__price { font-size: 1.05rem; font-weight: 800; flex-shrink: 0; }
.book.is-sold .book__cover { opacity: .55; }
.book.is-sold .book__price { color: var(--muted); text-decoration: line-through; }
.cover-1 { background: var(--accent-soft); color: var(--accent-ink); }
.cover-2 { background: var(--yellow-soft); color: var(--yellow-ink); }
.cover-3 { background: var(--green-soft); color: var(--green); }
.cover-4 { background: #F3E8FF; color: #6B21A8; }
.cover-5 { background: #FFE8DE; color: #9A3412; }
.gallery { position: relative; margin: 0 -20px; height: 300px; background: var(--accent-soft); }
.gallery__track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; background: var(--surface); }
.gallery__empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--accent-ink); font-weight: 700; font-size: .9rem; }
.gallery__empty svg { width: 44px; height: 44px; }
.gallery__dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.gallery__dots span { width: 6px; height: 6px; border-radius: 999px; background: rgba(28, 63, 209, .35); transition: width .2s; }
.gallery__dots span.is-on { width: 18px; background: var(--accent-ink); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--surface); font-size: .82rem; font-weight: 700; }
.tag--green { background: var(--green-soft); color: var(--green); }
.seller { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface); }
.avatar { width: 42px; height: 42px; flex-shrink: 0; border-radius: 999px; background: var(--surface-2); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.avatar svg { width: 20px; height: 20px; }
.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; display: flex; align-items: center; gap: 14px; padding: 12px 20px calc(14px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); }
.buybar__price { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.buybar .btn { flex: 1; }
.has-buybar .tabbar { display: none; }
.has-buybar .main { padding-bottom: calc(110px + var(--safe-b)); }
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo-slot { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--surface); border: 2px dashed var(--line-strong); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-slot svg { width: 26px; height: 26px; }
.photo-slot__rm { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 999px; border: 0; background: rgba(20, 22, 26, .75); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; }
.photo-slot__rm svg { width: 16px; height: 16px; }

.poll-opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 12px 16px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); font-size: 1rem; font-weight: 700; text-align: left; cursor: pointer; }
.poll-opt input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; accent-color: var(--accent); }
.poll-opt:has(input:checked) { border-color: var(--accent); }
.poll-opt:has(input:disabled:not(:checked)) { opacity: .55; }
.poll-opt img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.result { position: relative; min-height: 56px; border-radius: 16px; background: var(--surface); overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; }
.result__bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--surface-2); transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.result.is-mine .result__bar { background: #DCE4FF; }
.result span { position: relative; }
.result__label { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.result__label svg { width: 16px; height: 16px; color: var(--accent); }
.result__pct { font-weight: 800; }

.reps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rep { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.rep__photo { aspect-ratio: 4 / 5; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; color: var(--accent-ink); font-size: 2rem; font-weight: 800; }
.rep__photo img { width: 100%; height: 100%; object-fit: cover; }
.rep__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 2px; }
.rep__name { font-weight: 800; font-size: .97rem; line-height: 1.25; }
.rep__meta { font-size: .8rem; color: var(--muted); }
.rep__bio { font-size: .85rem; color: var(--ink-2); margin-top: 6px; }

.prose { font-size: 1rem; line-height: 1.65; color: var(--ink-2); overflow-wrap: anywhere; }
.prose > * + * { margin-top: .9em; }
.prose h2, .prose h3 { color: var(--ink); margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0; }
.prose li + li { margin-top: .35em; }
.prose img { border-radius: 14px; height: auto; }
.prose blockquote { margin: 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--line-strong); color: var(--muted); }
.prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
.placeholder { background: var(--yellow-soft); color: var(--yellow-ink); border-radius: 4px; padding: 0 3px; }
.cover { margin: 0 -20px; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.attachments { display: flex; flex-direction: column; gap: 8px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 20px; border-radius: var(--radius); background: var(--surface); text-align: center; }
.empty__ico { width: 52px; height: 52px; border-radius: 18px; background: var(--bg); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.empty__ico svg { width: 24px; height: 24px; }
.empty__title { font-weight: 800; }
.empty p:not(.empty__title) { color: var(--muted); font-size: .9rem; }
.skeleton { min-height: 64px; border-radius: 16px; background: linear-gradient(90deg, #ECECE6 0%, #F7F7F3 50%, #ECECE6 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton--tall { min-height: 180px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.toast-region { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { padding: 13px 16px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 600; font-size: .92rem; box-shadow: var(--shadow); animation: toast-in .2s ease; }
.toast--error { background: var(--red); }
.toast.is-leaving { opacity: 0; transition: opacity .25s; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.install { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.install img { width: 42px; height: 42px; border-radius: 11px; }
.install__text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); }
.install__text strong { color: var(--ink); font-size: .95rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; padding: 8px 0; font-size: .8rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.footer-note { text-align: center; font-size: .75rem; color: var(--muted); }
.turnstile-box { min-height: 65px; }
.modal { border: 0; border-radius: 22px; padding: 0; width: min(92vw, 460px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(20, 22, 26, .45); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 0 20px; }
.modal__body { padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.notfound { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.notfound strong { font-size: 4rem; line-height: 1; color: var(--accent); letter-spacing: -0.04em; }

@media (min-width: 560px) {
  .reps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
  .tabbar { display: none; }
  .sidebar { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; padding: 22px 16px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
  .sidebar .brand { padding: 0 8px 18px; }
  .sidebar__cta { margin-bottom: 14px; }
  .side-link { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
  .side-link svg { width: 20px; height: 20px; color: var(--muted); }
  .side-link:hover { background: var(--bg); color: var(--ink); }
  .side-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; }
  .side-link[aria-current="page"] svg { color: var(--accent-ink); }
  .sidebar__foot { margin-top: auto; padding: 16px 8px 0; display: flex; flex-direction: column; gap: 6px; font-size: .78rem; }
  .sidebar__foot a { color: var(--muted); text-decoration: none; }
  .sidebar__foot a:hover { color: var(--ink); text-decoration: underline; }
  .topbar { padding: 22px 40px 12px; min-height: 76px; }
  .only-mobile { display: none !important; }
  .only-desk { display: revert !important; }
  .main { max-width: 1120px; margin: 0; padding: 8px 40px 56px; }
  .main--narrow { max-width: 760px; }
  .toast-region { bottom: 24px; }
  .chips { margin: 0; padding: 2px 0 4px; flex-wrap: wrap; overflow: visible; }
  .home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "install install install" "next next poll" "tiles tiles tiles" "news news news"; gap: 20px; align-items: start; }
  .area-install { grid-area: install; }
  .area-next { grid-area: next; }
  .area-poll { grid-area: poll; }
  .area-tiles { grid-area: tiles; }
  .area-news { grid-area: news; }
  .area-foot { display: none; }
  .area-poll .item { flex-direction: column; align-items: flex-start; padding: 18px; min-height: 100%; }
  .tiles--home { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .gallery, .cover { margin: 0; border-radius: var(--radius); overflow: hidden; }
  .gallery { height: 460px; }
  .buybar { position: static; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); margin-top: 8px; }
  .has-buybar .main { padding-bottom: 56px; }
  .list--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .reps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .footer-links, .footer-note { display: none; }
}

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

.topbar__page { display: contents; }
.bell { position: relative; }
.bell-dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 999px; background: var(--red); border: 2px solid var(--surface); }
.notice-box { padding: 12px 14px; border-radius: 14px; background: var(--yellow-soft); color: var(--yellow-ink); font-size: .88rem; font-weight: 600; }
.sheet { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 560px; max-height: 88vh; margin: 0 auto; padding: 10px 16px calc(16px + var(--safe-b)); border: 0; border-radius: 24px 24px 0 0; background: var(--surface); color: var(--ink); display: flex; flex-direction: column; gap: 14px; overflow-y: auto; animation: sheet-in .22s cubic-bezier(.2, .8, .2, 1); }
.sheet:not([open]) { display: none; }
.sheet::backdrop { background: rgba(20, 22, 26, .45); }
.sheet__grip { width: 40px; height: 5px; border-radius: 999px; background: var(--line-strong); margin: 0 auto 2px; }
.sheet__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sheet__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 92px; padding: 10px 6px; border-radius: 18px; background: var(--bg); color: var(--ink); text-decoration: none; font-size: .82rem; font-weight: 700; text-align: center; line-height: 1.2; }
.sheet__item:hover { color: var(--ink); background: var(--surface-2); }
.sheet__ico { width: 44px; height: 44px; border-radius: 14px; background: var(--surface); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sheet__ico--sm { width: 38px; height: 38px; border-radius: 12px; background: var(--bg); color: var(--ink-2); }
.sheet__list { display: flex; flex-direction: column; gap: 2px; }
.sheet__list .item { background: transparent; border: 0; width: 100%; text-align: left; padding: 8px 4px; font: inherit; cursor: pointer; }
.sheet__list .item:hover { background: var(--bg); }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
.contact-row { display: flex; gap: 8px; flex-wrap: wrap; }
.contact-row .btn { flex: 1 1 140px; }
.buybar .contact-row { flex: 1; }
