:root,
[data-theme="gece"] {
  --paper: #020617;
  --paper-2: rgba(15, 23, 42, 0.72);
  --card: rgba(15, 23, 42, 0.55);
  --ink: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, 0.08);
  --pine: #3b82f6;
  --pine-2: #60a5fa;
  --copper: #60a5fa;
  --moss: #34d399;
  --good: #34d399;
  --wait: #fbbf24;
  --info: #60a5fa;
  --warn: #fbbf24;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.37);
  --dock: calc(68px + env(safe-area-inset-bottom));
  --serif: "Segoe UI", system-ui, sans-serif;
  --sans: "Segoe UI", system-ui, sans-serif;
  --side: rgba(15, 23, 42, 0.45);
  --side-ink: #e2e8f0;
  --side-muted: #64748b;
  --input: rgba(2, 6, 23, 0.6);
  --primary-ink: #fff;
  --chip: rgba(255, 255, 255, 0.06);
  --chip-bad: rgba(244, 63, 94, 0.16);
  --bad: #fb7185;
  --chip-ok: rgba(52, 211, 153, 0.16);
  --note: rgba(59, 130, 246, 0.12);
  --dock-bg: rgba(2, 6, 23, 0.88);
  --nav-active: rgba(37, 99, 235, 0.12);
  --glow-a: rgba(37, 99, 235, 0.22);
  --glow-b: rgba(124, 58, 237, 0.2);
  --story: #020617;
  --story-ink: #f8fafc;
  --brand: linear-gradient(90deg, #fff, #93c5fd);
  --btn: linear-gradient(90deg, #2563eb, #4f46e5);
  --card-blur: blur(18px);
}

[data-theme="gunduz"] {
  --paper: #f1f5f9;
  --paper-2: #e2e8f0;
  --card: rgba(255, 255, 255, 0.86);
  --ink: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.1);
  --pine: #1d4ed8;
  --pine-2: #2563eb;
  --copper: #1d4ed8;
  --moss: #047857;
  --good: #047857;
  --wait: #b45309;
  --info: #1d4ed8;
  --warn: #b45309;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
  --serif: "Segoe UI", system-ui, sans-serif;
  --sans: "Segoe UI", system-ui, sans-serif;
  --side: rgba(255, 255, 255, 0.8);
  --side-ink: #0f172a;
  --side-muted: #64748b;
  --input: #fff;
  --primary-ink: #fff;
  --chip: #e2e8f0;
  --chip-bad: #fee2e2;
  --bad: #b91c1c;
  --chip-ok: #d1fae5;
  --note: #eff6ff;
  --dock-bg: rgba(255, 255, 255, 0.92);
  --nav-active: rgba(37, 99, 235, 0.1);
  --glow-a: rgba(37, 99, 235, 0.12);
  --glow-b: rgba(147, 51, 234, 0.08);
  --story: #0f172a;
  --story-ink: #f8fafc;
  --brand: linear-gradient(90deg, #0f172a, #2563eb);
  --btn: linear-gradient(90deg, #1d4ed8, #3b82f6);
  --card-blur: blur(12px);
}

[data-theme="cinar"] {
  --paper: #f4f7f5;
  --paper-2: #e7eeea;
  --card: rgba(255, 255, 255, 0.86);
  --ink: #10211c;
  --muted: #5d6b66;
  --line: rgba(16, 33, 28, 0.1);
  --pine: #1e3a34;
  --pine-2: #2f6f5e;
  --copper: #2f6f5e;
  --moss: #2d6a45;
  --good: #2d6a45;
  --wait: #8a5a12;
  --info: #2f6f5e;
  --warn: #8a5a12;
  --shadow: 0 16px 40px rgba(16, 33, 28, 0.06);
  --serif: "Segoe UI", system-ui, sans-serif;
  --sans: "Segoe UI", system-ui, sans-serif;
  --side: rgba(30, 58, 52, 0.96);
  --side-ink: #f4f7f5;
  --side-muted: #b7c9c2;
  --input: #fff;
  --primary-ink: #f4f7f5;
  --chip: #e7eeea;
  --chip-bad: #fde8e4;
  --bad: #b42318;
  --chip-ok: #e3f0e6;
  --note: #e7f3ee;
  --dock-bg: rgba(255, 255, 255, 0.94);
  --nav-active: rgba(255, 255, 255, 0.1);
  --glow-a: rgba(47, 111, 94, 0.16);
  --glow-b: rgba(162, 75, 50, 0.08);
  --story: #1e3a34;
  --story-ink: #f4f7f5;
  --brand: linear-gradient(90deg, #f4f7f5, #b7c9c2);
  --btn: linear-gradient(90deg, #1e3a34, #2f6f5e);
  --card-blur: blur(12px);
}

[data-theme="bakir"] {
  --paper: #140e0b;
  --paper-2: rgba(42, 28, 22, 0.8);
  --card: rgba(42, 28, 22, 0.72);
  --ink: #f6efe8;
  --muted: #c4b2a4;
  --line: rgba(232, 160, 122, 0.18);
  --pine: #c4623a;
  --pine-2: #e8a07a;
  --copper: #e8a07a;
  --moss: #86efac;
  --good: #86efac;
  --wait: #fbbf24;
  --info: #e8a07a;
  --warn: #fbbf24;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  --serif: Palatino, Georgia, serif;
  --sans: "Segoe UI", system-ui, sans-serif;
  --side: rgba(28, 18, 14, 0.78);
  --side-ink: #f6efe8;
  --side-muted: #c4a48e;
  --input: rgba(20, 14, 11, 0.7);
  --primary-ink: #fff8f3;
  --chip: rgba(232, 160, 122, 0.12);
  --chip-bad: rgba(248, 113, 113, 0.16);
  --bad: #fca5a5;
  --chip-ok: rgba(134, 239, 172, 0.14);
  --note: rgba(196, 98, 58, 0.16);
  --dock-bg: rgba(20, 14, 11, 0.92);
  --nav-active: rgba(196, 98, 58, 0.22);
  --glow-a: rgba(196, 98, 58, 0.22);
  --glow-b: rgba(120, 53, 15, 0.2);
  --story: #1c120e;
  --story-ink: #f6efe8;
  --brand: linear-gradient(90deg, #fff7f0, #e8a07a);
  --btn: linear-gradient(90deg, #9a3412, #e8a07a);
  --card-blur: blur(16px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { overflow-x: clip; scroll-padding-bottom: 24px; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, var(--glow-a), transparent 55%),
    radial-gradient(800px 420px at 100% 0%, var(--glow-b), transparent 50%),
    var(--paper);
  display: grid;
  grid-template-columns: 268px 1fr;
}
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: 16px; }
button { cursor: pointer; touch-action: manipulation; }
a { color: var(--pine-2); }
:focus-visible { outline: 2px solid var(--pine-2); outline-offset: 2px; }

.workspace { min-width: 0; padding: 22px 28px 32px; container-type: inline-size; container-name: work; }
.topbar { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.topbar h1 { font-weight: 800; font-size: 34px; margin: 0; letter-spacing: -0.05em; text-transform: uppercase; overflow-wrap: anywhere; }
.eyebrow { margin: 0 0 4px; color: var(--copper); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; }
.who { color: var(--muted); display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; font-size: 14px; min-width: 0; }
.who span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who a { color: inherit; font-weight: 700; text-decoration: none; }
#side a.side-user { display: none; margin: 8px 8px 0; color: var(--side-muted); font-weight: 650; }
.side-theme { padding: 4px 8px 12px; }
.side-theme .theme-switch { width: 100%; min-width: 0; flex: none; }
.menu-btn { display: none; }

#side {
  background: var(--side);
  color: var(--side-ink);
  border-right: 1px solid var(--line);
  backdrop-filter: var(--card-blur);
  padding: 22px 14px calc(22px + env(safe-area-inset-bottom));
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: auto;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 8px 12px 22px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.mark {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: var(--btn); color: var(--primary-ink); font-weight: 800; font-size: 20px;
  box-shadow: 0 10px 24px var(--glow-a); border: 1px solid rgba(255, 255, 255, 0.2); flex: none;
}
.brand strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand span { color: var(--side-muted); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 800; }
.nav-fold { margin: 8px 8px 0; border-bottom: 1px solid var(--line); }
.nav-fold > summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; }
.nav-fold > summary::after { content: ""; width: 7px; height: 7px; margin-left: auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.nav-fold[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.nav-fold > summary::-webkit-details-marker { display: none; }
.nav-group { margin: 0; padding: 0 8px; color: var(--side-muted); font-size: 9px; font-weight: 800; letter-spacing: 0.25em; text-transform: uppercase; }
#side a, .dock a, #side button, .dock button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: inherit;
  text-decoration: none;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 650;
}
#side a.active, #side button.active {
  background: var(--nav-active);
  color: var(--pine-2);
  border: 1px solid var(--line);
  box-shadow: 0 0 20px var(--glow-a);
}
#side a:hover, #side button:hover { background: var(--nav-active); color: var(--side-ink); }
#side a, #side button { min-height: 44px; display: flex; align-items: center; }
.dock { display: none; }

.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.two { grid-template-columns: 1.4fr 0.8fr; }
.pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pair > * { min-width: 0; }
.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: var(--card-blur);
}
.card { padding: 22px; }
.card .k { color: var(--muted); font-size: 10px; margin: 0; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 800; }
.card .v { font-size: 30px; margin: 10px 0 0; letter-spacing: -0.05em; font-weight: 800; }
.card .s { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.stat { position: relative; overflow: hidden; }
.stat .v { color: var(--tone, inherit); font-weight: 750; }
.stat::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--tone, var(--pine-2)); }
.tone-in { --tone: var(--good); }
.tone-out { --tone: var(--bad); }
.tone-due { --tone: var(--wait); }
.tone-cash { --tone: var(--info); }
.tone-late { --tone: var(--bad); }
.tone-kart { --tone: #c084fc; }
.money { font-variant-numeric: tabular-nums; font-weight: 750; }
.money.in { color: var(--good); }
.money.out, .money.late { color: var(--bad); }
.money.due { color: var(--wait); }
.money.cash { color: var(--info); }
.money.kart { color: #c084fc; }
.money.zero { color: var(--muted); font-weight: 600; }
.meter { height: 6px; margin-top: 12px; border-radius: 99px; background: var(--chip); overflow: hidden; }
.meter span { display: block; height: 100%; width: var(--pct); background: var(--good); border-radius: inherit; }
.chip.wait { background: color-mix(in srgb, var(--wait) 18%, transparent); color: var(--wait); }
.panel { padding: 16px 18px 18px; }
.panel h2 { font-size: 13px; margin: 0 0 14px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 800; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
label, .theme-switch { display: grid; gap: 6px; font-size: 12px; color: var(--muted); min-width: 140px; flex: 1; letter-spacing: 0.04em; }
.theme-switch { min-width: 128px; flex: 0 0 140px; }
input, select, textarea {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  min-height: 46px;
}
textarea { min-height: 90px; resize: vertical; }
input[type="checkbox"] { width: auto; min-height: 0; }
button.primary, .btn {
  background: var(--btn);
  color: var(--primary-ink);
  border: 0;
  border-radius: 16px;
  padding: 12px 18px;
  min-height: 48px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 44px; color: inherit; }
.danger { color: var(--copper); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 700; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 8px; background: var(--chip); font-size: 12px; }
.chip.bad { background: var(--chip-bad); color: var(--bad); }
.chip.ok { background: var(--chip-ok); color: var(--moss); }
.muted { color: var(--muted); }
.note { background: var(--note); border-left: 3px solid var(--pine-2); padding: 12px 14px; border-radius: 12px; }
.split { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.split a { min-height: 44px; display: inline-flex; align-items: center; }
.more-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.link-row a, .link-row button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; background: transparent; }
fieldset { border: 1px solid var(--line); border-radius: 14px; margin: 0; padding: 10px 12px; }
legend { color: var(--muted); padding: 0 6px; }
body.auth { display: block; background: var(--paper); }
body.auth #side, body.auth .workspace, body.auth .dock { display: none !important; }
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 0.95fr; }
.login-story {
  background:
    radial-gradient(500px 280px at 20% 20%, var(--glow-a), transparent 60%),
    radial-gradient(420px 260px at 80% 80%, var(--glow-b), transparent 55%),
    var(--story);
  color: var(--story-ink);
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.login-story h1 { font-size: clamp(28px, 4vw, 56px); line-height: 0.92; margin: 0 0 16px; font-weight: 800; letter-spacing: -0.05em; text-transform: uppercase; overflow-wrap: anywhere; }
@media (min-width: 900px) {
  .login { height: 100vh; height: 100dvh; overflow: hidden; }
  .login-story, .login-form { min-height: 0; overflow: auto; }
  .login-story { justify-content: center; }
}
.login-form { padding: 40px 32px; display: flex; flex-direction: column; justify-content: center; }
.login-title { font-family: var(--serif); font-size: 32px; margin: 14px 0 8px; }
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: var(--card-blur);
  container-type: inline-size;
}
.accounts { display: grid; gap: 8px; margin-top: 18px; grid-template-columns: 1fr; }
@container (min-width: 440px) { .accounts { grid-template-columns: 1fr 1fr; } }
summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.accounts button { text-align: left; }
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock) + 8px);
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--paper);
  padding: 12px 16px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  max-width: min(520px, calc(100% - 24px));
  z-index: 40;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { padding: 28px 8px; color: var(--muted); }

#shade { display: none; position: fixed; inset: 0; z-index: 19; border: 0; padding: 0; background: rgba(2, 6, 23, 0.55); }
body.keyboard .dock { display: none; }
body.keyboard .workspace { padding-bottom: 16px; }

@media (max-width: 899px) {
  html { scroll-padding-bottom: calc(var(--dock) + 16px); }
  body { grid-template-columns: 1fr; }
  #side { display: none; position: fixed; z-index: 20; width: min(320px, 88vw); height: 100vh; height: 100dvh; }
  #side.open { display: block; }
  #side.open ~ #shade { display: block; }
  #side.open ~ .workspace .topbar { visibility: hidden; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  #side a.side-user { display: flex; }
  .topbar { align-items: center; flex-wrap: wrap; gap: 10px; }
  .who { flex: 0 1 auto; justify-content: flex-end; max-width: 100%; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .tabs a { flex: none; min-height: 44px; display: inline-flex; align-items: center; }
  .two, .pair, .login { grid-template-columns: 1fr; }
  .login-form { order: -1; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
  .login-card { display: flex; flex-direction: column; padding: 18px 16px; }
  .login-card .note { order: 3; }
  .login-card .theme-switch { order: 5; }
  .login-card h2 { order: 0; }
  .login-card > .muted { order: 1; }
  .login-card form { order: 2; }
  .login-card .accounts,
  .login-card details { order: 6; }
  .login-story { order: 1; min-height: 0; padding: 22px 22px 28px; }
  .login-story h1 { font-size: 32px; }
  .workspace { padding: 16px 16px calc(var(--dock) + 16px); }
  .topbar h1 { font-size: 28px; }
  .dock {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    position: fixed;
    z-index: 15;
    left: 0; right: 0; bottom: 0;
    background: var(--dock-bg);
    border-top: 1px solid var(--line);
    backdrop-filter: var(--card-blur);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .dock a, .dock button { display: grid; place-items: center; min-height: 48px; text-align: center; font-size: 12px; line-height: 1.15; padding: 6px 4px; color: var(--muted); white-space: normal; }
  .dock a.active, .dock button.active { color: var(--pine-2); font-weight: 750; box-shadow: none; }
  table.responsive thead { display: block; margin-bottom: 8px; }
  table.responsive thead tr { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; background: transparent; }
  table.responsive th { display: inline-flex; align-items: center; min-height: 40px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; }
  table.responsive tr { display: block; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; padding: 6px; background: var(--card); }
  table.responsive td { display: flex; justify-content: space-between; gap: 12px; border: 0; min-width: 0; overflow-wrap: anywhere; }
  table.responsive td::before { content: attr(data-label); color: var(--muted); flex: none; }
  table.responsive tr:has(td:only-child) td::before { content: none; }
  table.responsive tr:has(td:only-child) td { display: block; text-align: center; color: var(--muted); }
  table.responsive td:has(.actions) { flex-direction: column; align-items: stretch; }
  .view-tools { flex-wrap: wrap; }
  .view-tools .table-filter { flex-basis: 100%; }
  .month-line a { min-height: 44px; display: inline-flex; align-items: center; }
  .desk-only { display: none; }
}

@media (max-width: 720px) {
  .row { flex-direction: column; align-items: stretch; }
  .row > button, .row > .ghost, .row > a { width: 100%; }
  label, .theme-switch { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.kind-ico { width: 28px; height: 28px; border-radius: 9px; display: inline-grid; place-items: center; flex: none; color: var(--pine-2); background: color-mix(in srgb, var(--pine-2) 16%, transparent); }
.kind-ico svg { width: 16px; height: 16px; display: block; }
.kind-pill { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: inherit; background: var(--chip); border-radius: 999px; padding: 4px 12px 4px 4px; font-size: 13px; }
a.kind-pill { min-height: 44px; }
.kind-pill strong { font-variant-numeric: tabular-nums; }
.kind-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.block-card .block-head { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.block-card .mark { width: 52px; height: 52px; font-size: 22px; }
.view-tools { display: flex; gap: 8px; align-items: center; margin: 8px 0 10px; }
.view-tools .table-filter { margin: 0; flex: 1; width: auto; }
.view-sort { width: auto; flex: 0 0 150px; }
.view-switch { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--input); }
.view-switch button { border: 0; background: transparent; color: var(--muted); border-radius: 999px; min-height: 34px; padding: 4px 12px; font-weight: 750; }
.view-switch button.active { background: var(--btn); color: var(--primary-ink); }
.card-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.row-card { background: var(--input); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.row-card h3 { margin: 0 0 10px; font-size: 16px; }
.row-card dl { display: grid; gap: 6px; margin: 0; }
.row-card dl > div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.row-card dt { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.row-card dd { margin: 0; text-align: right; }
#view:not(.view-card) .view-sort { display: none; }
table[hidden], .card-grid[hidden] { display: none !important; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.tabs a { text-decoration: none; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; background: var(--card); font-size: 13px; font-weight: 750; }
.tabs a.active { color: var(--primary-ink); background: var(--btn); border-color: transparent; }
.slide-nav { display: flex; gap: 8px; margin-top: 18px; }
.slide-nav button { width: 44px; height: 44px; min-height: 44px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: inherit; }
.login-story.has-photo { background-size: cover; background-position: center; }
.split-due { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; }
.ad-slot { display: flex; gap: 12px; align-items: flex-start; margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.ad-slot img, .ad-slot video { width: 140px; max-height: 88px; object-fit: cover; border-radius: 10px; background: #000; }
.ad-copy { min-width: 0; flex: 1; }
.ad-copy p { margin: 4px 0 0; color: var(--muted); }
.ad-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.ad-actions .ghost, .ad-actions a { min-height: 44px; display: inline-flex; align-items: center; }
@container work (max-width: 760px) {
  .topbar { flex-wrap: wrap; align-items: center; }
  .who { justify-content: flex-start; }
  .two, .pair { grid-template-columns: 1fr; }
  .row { flex-direction: column; align-items: stretch; }
  .row > button, .row > .ghost, .row > a { width: 100%; }
  .ad-slot { flex-direction: column; }
  .ad-slot img, .ad-slot video { width: 100%; max-height: 180px; }
  .ad-actions { flex-direction: row; align-items: center; }
}
@container work (max-width: 520px) {
  .topbar { flex-wrap: nowrap; align-items: center; }
  .topbar > div:not(.who) { flex: 1 1 auto; min-width: 0; }
  .topbar h1 { font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .who { flex: 0 0 auto; flex-wrap: nowrap; }
  .who span { display: none; }
  .link-row a, .link-row button, .more-row .ghost { flex: 1 1 100%; width: 100%; }
}
.ad-overlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(2, 6, 23, 0.72); }
.ad-overlay .ad-slot { width: min(440px, 100%); margin: 0; }
.table-filter { width: 100%; margin: 8px 0 10px; }
th.sortable { cursor: pointer; }
th.sorted { color: var(--ink); }
.sheet { overflow: auto; max-height: 72vh; }
.phone-board { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions .ghost, .actions a.ghost { text-decoration: none; text-align: center; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.matrix td, .matrix th { white-space: nowrap; font-size: 12px; }
.matrix .sticky { position: sticky; left: 0; background: var(--card); z-index: 1; min-width: 150px; }
.cell.odendi { background: color-mix(in srgb, var(--good) 18%, transparent); }
.cell.kismi { background: color-mix(in srgb, var(--wait) 24%, transparent); }
.cell.acik { background: color-mix(in srgb, var(--bad) 16%, transparent); }
.cell.tahmin { background: color-mix(in srgb, var(--info) 18%, transparent); }
.cell.buay { box-shadow: inset 0 -2px 0 var(--info); }
.month-board { display: grid; gap: 8px; margin-top: 12px; }
.month-line { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); }
.month-line strong { font-size: 14px; }
.month-line .lines { color: var(--muted); font-size: 12px; margin-top: 2px; }
.month-line.odendi { background: color-mix(in srgb, var(--good) 18%, transparent); }
.month-line.kismi { background: color-mix(in srgb, var(--wait) 24%, transparent); }
.month-line.acik { background: color-mix(in srgb, var(--bad) 16%, transparent); }
.month-line.tahmin { background: color-mix(in srgb, var(--info) 18%, transparent); }
tr.pay-ok td:first-child { box-shadow: inset 3px 0 var(--good); }
tr.pay-wait td:first-child { box-shadow: inset 3px 0 var(--wait); }
tr.pay-bad td:first-child { box-shadow: inset 3px 0 var(--bad); }
.pick-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 10px; }
.month-line label.pick { display: flex; gap: 6px; align-items: center; font-size: 13px; }
@media (max-width: 899px) {
  .desk-sheet { display: none; }
  .phone-board { display: grid; gap: 10px; }
  .phone-board .month-line { grid-template-columns: 64px minmax(0, 1fr); }
  .phone-board .month-line .actions { grid-column: 1 / -1; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .ghost, .actions a.ghost, .actions input, .actions select, .actions form { width: 100%; }
}
@media (max-width: 720px) {
  .month-line { grid-template-columns: 64px minmax(0, 1fr); }
  .month-line > :nth-child(3) { grid-column: 1 / -1; }
  .pick-bar { flex-direction: column; align-items: stretch; }
}
button.tiny { padding: 4px 8px; min-height: 0; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: inherit; margin-left: 6px; }
@media (max-width: 899px) { button.tiny { min-height: 44px; padding: 8px 12px; margin-left: 0; } }
@media (max-height: 640px) {
  .login-form { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); justify-content: flex-start; }
  .login-card { padding: 14px 16px; }
  .login-title { margin: 2px 0 4px; font-size: 26px; }
  .login-story { padding: 18px 20px; }
  .login-story h1 { font-size: 28px; }
  .accounts { margin-top: 10px; }
  .workspace { padding: 12px 16px 16px; }
  .topbar { margin-bottom: 10px; }
  .topbar h1 { font-size: 26px; }
  #side { padding-top: 12px; }
}
.tiny-link { margin-left: 6px; font-size: 11px; }
.check { display: flex; justify-content: space-between; gap: 10px; align-items: center; min-height: 48px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check input[type="checkbox"] { width: 22px; height: 22px; min-height: 22px; margin: 0; flex: none; }
#periods { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span { grid-column: 1 / -1; }
@media (max-width: 899px) { #periods { grid-template-columns: 1fr; } }

@media print {
  .desk-only, .desk-sheet { display: block !important; }
  .phone-board { display: none !important; }
  #side, .dock, .topbar, .no-print { display: none !important; }
  body { display: block; background: #fff; color: #111; }
  .workspace { padding: 0; }
  .card, .panel { box-shadow: none; background: #fff; }
}

.login-links { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-block: 16px 0; order: 4; }
.login-links a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
#login-notices { border-top: 1px solid currentColor; padding-top: 14px; margin-top: 14px; }
#login-notices h2 { font-size: 1.2rem; margin: .3rem 0; white-space: pre-line; }
