:root {
  color-scheme: dark;
  --bg: #0a1313;
  --top: #0c1816;
  --panel: #111e1c;
  --panel-alt: #162722;
  --border: #30443c;
  --text: #edf6f0;
  --muted: #adc1b7;
  --quiet: #899f94;
  --accent: #87e5b2;
  --accent-dark: #102b21;
  --danger: #ffb6aa;
  --warn: #f6cb88;
  --surface: 15px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font);
  font-synthesis: none;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; min-height: 100vh; font-size: 16px; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 5.9vw, 3rem); font-weight: 700; line-height: 1.06; letter-spacing: -.054em; }
h2 { font-size: 1.125rem; font-weight: 660; letter-spacing: -.022em; line-height: 1.25; }
h3 { font-size: 1rem; font-weight: 645; letter-spacing: -.015em; }
p { line-height: 1.48; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ico { display: inline-block; flex: none; width: 20px; height: 20px; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.skip-link { position: fixed; top: .65rem; left: .65rem; z-index: 20; transform: translateY(-180%); padding: .55rem .8rem; background: var(--accent); color: var(--accent-dark); border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }

.topbar { position: sticky; top: 0; z-index: 4; min-height: 62px; padding: max(9px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 9px max(14px, env(safe-area-inset-left)); background: #0d1816f5; border-bottom: 1px solid #283d35; backdrop-filter: blur(12px); }
.topbar-inner { margin-inline: auto; width: min(100%, 1140px); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px; }
.brand-icon { width: 42px; height: 42px; display: block; object-fit: contain; border-radius: 11px; border: 1px solid #54826889; }
.brand-label { display: grid; font-size: .75rem; font-weight: 650; letter-spacing: .16em; line-height: 1.25; text-transform: uppercase; }
.brand-label strong { font-size: .96rem; letter-spacing: .055em; }
.brand-label span { color: var(--accent); }
.desktop-nav { display: none; }
.profile { display: flex; gap: 8px; align-items: center; min-width: 0; }
.profile-name { font-size: .83rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 17ch; }
.profile-button, .icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border); border-radius: 11px; color: var(--muted); background: #182721; flex: none; }
.profile-button:hover, .icon-button:hover { background: #243b30; color: var(--text); }
.profile-button { font-size: .76rem; font-weight: 700; text-transform: uppercase; color: #9aefbd; }

.mobile-nav { z-index: 5; position: fixed; inset: auto 0 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #0e1b18fa; border-top: 1px solid #345043; padding: 5px max(4px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left)); backdrop-filter: blur(14px); }
.mobile-nav a { min-width: 0; min-height: 49px; display: grid; place-content: center; place-items: center; gap: 3px; padding: 3px; border-radius: 10px; color: var(--muted); font-size: .75rem; text-align: center; line-height: 1.15; }
.mobile-nav .ico { width: 19px; height: 19px; }
.mobile-nav a.active { color: #a4f3c6; background: #1f3b2f; }
.nav-indicator { position: relative; }
.nav-count { position: absolute; right: -9px; top: -3px; border-radius: 99px; min-width: 15px; padding: 1px 3px; display: grid; place-items: center; background: #a4f3c6; color: #0b241a; font-size: .63rem; font-variant-numeric: tabular-nums; }

.content { width: min(100%, 1140px); margin-inline: auto; padding: 23px 14px calc(82px + env(safe-area-inset-bottom)); }
.content.seller { max-width: 820px; }
.content:focus { outline: none; }
.page-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 15px; margin-bottom: 14px; }
.page-heading p { margin-top: 6px; color: var(--muted); font-size: .91rem; }
.page-heading .button { align-self: end; }
.status-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.status-line > small { color: var(--muted); font-size: .9rem; }
.status { display: inline-flex; align-items: center; gap: 6px; min-height: 27px; padding: 4px 9px; border-radius: 99px; color: #a6f0c8; background: #1f3e31; border: 1px solid #3b6754; font-size: .79rem; font-weight: 650; line-height: 1.1; width: fit-content; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.status.warn { color: #f9d9a8; background: #3c3020; border-color: #745d37; }
.status.subtle { color: #c0d0ca; background: #25342e; border-color: #43584e; }
.status.danger { color: #ffbfb5; background: #462e28; border-color: #875347; }

.hero { position: relative; isolation: isolate; display: grid; align-content: start; gap: 10px; padding: 16px; min-width: 0; overflow: hidden; border: 1px solid #3d6754; border-radius: 18px; background: radial-gradient(ellipse at 96% -5%, #2d6048, transparent 70%), #173126; }
.hero::after { content: ""; position: absolute; z-index: -1; right: -35px; top: -48px; width: 236px; height: 236px; background: url("/static/icon.svg") no-repeat center / contain; opacity: .14; transform: rotate(-10deg); mask-image: radial-gradient(ellipse, #000 45%, transparent 76%); pointer-events: none; }
.hero + * { margin-top: 13px; }
.hero h1 { overflow-wrap: anywhere; }
.hero .meta { color: #c2dccc; font-size: .91rem; }
.hero .status-line { margin-top: 2px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--surface); min-width: 0; padding: 14px; }
.panel + .panel { margin-top: 12px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-header h2 { min-width: 0; }
.panel-header p { margin-top: 4px; font-size: .88rem; color: var(--muted); }
.panel-title { display: flex; align-items: center; gap: 8px; }
.panel-title .ico { color: var(--accent); width: 18px; height: 18px; }
.panel-actions, .action-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.action-row { margin-top: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #405b4f; border-radius: 10px; min-height: 44px; padding: 9px 12px; background: #1d2f28; color: var(--text); font-size: .89rem; font-weight: 650; line-height: 1.22; text-align: center; }
.button:not(:disabled):hover { background: #2a4136; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #102b21; }
.button.primary:not(:disabled):hover { background: #a4efc6; border-color: #a4efc6; }
.button.danger { color: var(--danger); border-color: #86574b; background: #432d27; }
.button.danger:not(:disabled):hover { background: #593930; }
.button .ico { width: 17px; height: 17px; }
.button.flex { flex: 1; min-width: 115px; }
.button.block { width: 100%; }
.link { color: var(--accent); text-decoration: underline; text-underline-offset: .18em; font-weight: 630; }
.pill-button { border: 0; background: transparent; color: var(--accent); padding: 8px 1px; min-height: 40px; font-weight: 650; font-size: .88rem; }
.pill-button:hover:not(:disabled) { text-decoration: underline; }

.field { display: grid; gap: 5px; font-size: .9rem; font-weight: 600; color: var(--muted); min-width: 0; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 44px; padding: 8px 9px; border: 1px solid #466053; border-radius: 9px; background: #0b1714; color: var(--text); font-size: 16px; font-weight: 525; }
.field input::placeholder, .field textarea::placeholder { color: #84978c; opacity: .92; }
.field textarea { resize: vertical; min-height: 80px; }
.field small { font-size: .8rem; color: var(--quiet); font-weight: 480; }
.field-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.field-grid .span { grid-column: 1 / -1; }
.form-list { display: grid; gap: 10px; }
.form-error { color: var(--danger); font-size: .86rem; font-weight: 560; margin-top: 6px; }
.form-error:empty { display: none; }
.notice { display: flex; gap: 8px; align-items: start; padding: 11px; border-radius: 10px; border: 1px solid #355347; background: #192c24; color: #bed7c9; font-size: .88rem; }
.notice.warn { border-color: #6c5639; background: #382e20; color: #f3d7ae; }
.notice.danger { border-color: #875347; background: #422b25; color: #ffd1c8; }
.notice .ico { margin-top: 1px; width: 17px; height: 17px; }
.notice + * { margin-top: 11px; }
.toast { position: fixed; z-index: 22; right: 11px; bottom: calc(68px + env(safe-area-inset-bottom)); max-width: min(460px, calc(100vw - 22px)); padding: 11px 13px; background: #214233; border: 1px solid #548268; border-radius: 10px; color: var(--text); opacity: 0; transform: translateY(5px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; overflow-wrap: anywhere; }
.toast.visible { opacity: 1; transform: none; }
.toast.error { border-color: #875347; background: #462d26; color: #ffcfca; }

.auth-page { display: grid; align-content: center; justify-items: center; gap: 9px; min-height: 100vh; min-height: 100dvh; padding: max(17px, env(safe-area-inset-top)) 15px max(17px, env(safe-area-inset-bottom)); background: radial-gradient(ellipse at 68% 22%, #204332, transparent 65%), #0a1412; }
.auth-card { width: min(100%, 440px); display: grid; gap: 14px; padding: 18px; border: 1px solid #406150; border-radius: 18px; background: #111f1af7; box-shadow: 0 25px 80px #02070685; }
.auth-card h1 { font-size: clamp(1.65rem, 6.2vw, 2.15rem); }
.auth-card > p { margin-top: -6px; font-size: .9rem; color: var(--muted); }
.auth-card .brand { width: fit-content; }
.auth-card .body-copy { margin: 0; }

.shift-top { display: flex; justify-content: space-between; align-items: start; gap: 9px; margin-bottom: 11px; }
.choice-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 11px 0 12px; }
.choice { position: relative; display: grid; align-content: start; gap: 4px; padding: 10px; min-height: 76px; min-width: 0; border: 1px solid #426051; border-radius: 11px; background: #192a23; cursor: pointer; }
.choice input { margin: 1px 0 1px 1px; accent-color: var(--accent); width: 16px; height: 16px; }
.choice strong { font-size: .88rem; }
.choice span { font-size: .77rem; color: var(--muted); line-height: 1.3; }
.choice:has(input:checked) { border-color: #77b79a; background: #224332; }
.weights { display: grid; gap: 9px; }
.weight-group { margin: 0; padding: 9px; min-width: 0; border: 1px solid #34473e; border-radius: 11px; background: #13241d; }
.weight-group legend { color: var(--text); padding: 0 5px; font-size: .9rem; font-weight: 670; }
.weight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.weight-grid .field { padding: 0; font-size: .83rem; }
.weight-grid input { font-variant-numeric: tabular-nums; }
.weight-group .total { display: block; padding-top: 8px; color: #bce9d0; text-align: right; font-size: .85rem; font-variant-numeric: tabular-nums; }
.verify-summary { display: grid; gap: 9px; margin: 11px 0; }
.verify-card { display: grid; gap: 7px; padding: 10px; border: 1px solid #354a3e; background: #14261e; border-radius: 10px; }
.number { font-variant-numeric: tabular-nums; white-space: nowrap; }
.verify-card strong { font-size: 1rem; color: var(--accent); }
.verify-card .line-items { color: var(--muted); font-size: .84rem; }
.verify-card .line-items span + span::before { content: " · "; color: var(--quiet); }

.owner-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.stat { min-width: 0; display: grid; gap: 5px; align-content: space-between; min-height: 76px; padding: 10px; border: 1px solid #32463d; border-radius: 12px; background: linear-gradient(145deg, #1a3026, #101e18 75%); }
.stat > span { color: var(--muted); font-size: .86rem; font-weight: 550; line-height: 1.25; }
.stat > strong { font-size: 1.58rem; letter-spacing: -.04em; color: var(--text); font-variant-numeric: tabular-nums; }
.stat > strong.accent { color: var(--accent); }
.rows, .inbox-list { list-style: none; margin: 0; padding: 0; }
.rows li, .inbox-list li { padding: 10px 0; }
.rows li + li, .inbox-list li + li { border-top: 1px solid #30453a; }
.rows li:last-child, .inbox-list li:last-child { padding-bottom: 0; }
.rows li:first-child, .inbox-list li:first-child { padding-top: 0; }
.row-content { min-width: 0; display: flex; align-items: start; justify-content: space-between; gap: 7px 12px; flex-wrap: wrap; }
.row-title { min-width: 0; }
.row-title strong { display: block; font-size: .96rem; overflow-wrap: anywhere; }
.row-title small, .inbox-list time, .row-description { color: var(--muted); font-size: .84rem; }
.row-description { margin-top: 5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.row-actions { margin-top: 8px; display: flex; gap: 7px; flex-wrap: wrap; }
.inbox-title { display: flex; align-items: start; justify-content: space-between; gap: 9px; }
.inbox-title > div { min-width: 0; }
.inbox-title h2, .inbox-title h3 { overflow-wrap: anywhere; }
.inbox-list time { display: inline-block; margin-top: 4px; }
.inbox-list form { display: grid; gap: 7px; margin-top: 10px; }
.owner-grid, .settings-grid { display: grid; gap: 12px; }
.owner-grid > .panel + .panel, .settings-grid > .panel + .panel { margin-top: 0; }
.invite-output { margin-top: 11px; padding: 10px; border: 1px solid #4a725e; border-radius: 10px; color: #c6e4d3; background: #1a3528; }
.invite-output input { margin-top: 6px; }

.smena-dialog { width: min(calc(100% - 24px), 470px); max-height: calc(100dvh - 35px); border: 1px solid #4a6959; border-radius: 15px; padding: 14px; background: #14231d; color: var(--text); }
.smena-dialog::backdrop { background: #040907aa; backdrop-filter: blur(3px); }
.smena-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.smena-dialog header .icon-button { height: 40px; width: 40px; }
.smena-dialog .action-row { justify-content: end; }
.code-note { font-variant-numeric: tabular-nums; word-break: break-word; }

@media (min-width: 550px) {
  .content { padding: 29px 22px calc(84px + env(safe-area-inset-bottom)); }
  .hero, .panel { padding: 19px; }
  .hero { padding-block: 21px; }
  .hero::after { width: 285px; height: 285px; right: -24px; top: -67px; }
  .topbar { padding-inline: max(22px, env(safe-area-inset-left)); }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weights, .verify-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .owner-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .auth-card { padding: 24px; }
}
@media (min-width: 760px) {
  .mobile-nav { display: none; }
  .desktop-nav { display: flex; align-items: center; gap: 4px; }
  .desktop-nav a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 9px; border-radius: 8px; color: var(--muted); font-size: .9rem; white-space: nowrap; }
  .desktop-nav a .ico { width: 17px; height: 17px; }
  .desktop-nav a:hover, .desktop-nav a.active { background: #234130; color: var(--accent); }
  .content { padding-bottom: 28px; }
  .toast { bottom: 16px; }
  .owner-grid, .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .owner-grid .wide, .settings-grid .wide { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
