/* ==========================================================================
   Design tokens v2.1 (semua hijau diselaraskan ke hue #123C32, oklch h≈174.5; tema gelap ikut memakai #123C32 sebagai primer), Islamic Notebook brand (design/brand-islamic-notebook): primary #123C32, soft #DDECE4,
   gold accent #C49A45 (decorative only), warm white #FAF8F2. Font Manrope, served from /fonts.
   ========================================================================== */
@font-face { font-family: 'Manrope'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/manrope-400.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/manrope-600.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/manrope-700.woff2') format('woff2'); }
:root {
  --g50:  #F0F6F4;
  --g100: #DBECE7;
  --g200: #C2DDD5;
  --g300: #90BBAE;
  --g400: #579A88;
  --g500: #123C32;   /* brand primary */
  --g600: #0E3028;
  --g700: #0A2A22;
  --g800: #1D4A3F;
  --g900: #081E18;

  --bg: #FAF8F2;
  --surface: #FFFFFF;
  --surface-2: #F1EFE8;
  --text: #1F2926;
  --text-2: #3E4D48;
  --muted: #566661;
  --line: #E4E1D6;
  --grid: #EAE7DC;
  --accent: #C49A45;

  --primary: var(--g500);
  --primary-strong: var(--g700);
  --primary-soft: var(--g100);
  --primary-hover: var(--g600);
  --primary-mark: var(--primary);   /* garis, titik, cincin fokus, meter */
  --on-primary: #FFFFFF;
  --focus: #007B64;

  /* chart marks (validated for colour-blind separation: see README) */
  --series-income: #00876F;
  --series-expense: #D9892B;
  --series-muted: #C8D3CF;

  /* status */
  --ok: #00876F;
  --warn: #9A5B00;
  --warn-fill: #D9892B;
  --warn-bg: #FFF4E0;
  --danger: #A53232;
  --danger-fill: #A53232;
  --danger-bg: #FCEBE8;
  /* time ranges on the day view (work hours, meetings) */
  --lane-0: #D9892B;
  --lane-1: #3F7CC4;
  --lane-2: #8A5CC7;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(18, 36, 31, .06), 0 4px 16px rgba(18, 36, 31, .05);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1513;
    --surface: #17211E;
    --surface-2: #1E2B27;
    --text: #E5EDEA;
    --text-2: #B4C4BF;
    --muted: #8C9D98;
    --line: #2A3733;
    --grid: #24312D;
    --primary: #123C32;
    --primary-strong: #78CCB5;
    --primary-soft: #182F29;
    --primary-hover: #1A493E;
    --primary-mark: #3FA48C;
    --focus: #78CCB5;
    --series-income: #29A389;
    --series-expense: #C97A1E;
    --series-muted: #394642;
    --ok: #5BC1A7;
    --warn: #F0B35A;
    --warn-fill: #C97A1E;
    --warn-bg: #33270F;
    --danger: #FF9C8F;
    --danger-fill: #D65A48;
    --danger-bg: #3A1D19;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --lane-0: #D08A3A;
    --lane-1: #6E9FDA;
    --lane-2: #A98BE0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1513;
  --surface: #17211E;
  --surface-2: #1E2B27;
  --text: #E5EDEA;
  --text-2: #B4C4BF;
  --muted: #8C9D98;
  --line: #2A3733;
  --grid: #24312D;
  --primary: #123C32;
  --primary-strong: #78CCB5;
  --primary-soft: #182F29;
  --primary-hover: #1A493E;
  --primary-mark: #3FA48C;
  --focus: #78CCB5;
  --series-income: #29A389;
  --series-expense: #C97A1E;
  --series-muted: #394642;
  --ok: #5BC1A7;
  --warn: #F0B35A;
  --warn-fill: #C97A1E;
  --warn-bg: #33270F;
  --danger: #FF9C8F;
  --danger-fill: #D65A48;
  --danger-bg: #3A1D19;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --lane-0: #D08A3A;
  --lane-1: #6E9FDA;
  --lane-2: #A98BE0;
  color-scheme: dark;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
a { color: var(--primary-strong); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.boot { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; color: var(--muted); }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ==========================================================================
   App shell: top bar + bottom nav (mobile), sidebar (desktop)
   ========================================================================== */
.shell { min-height: 100vh; min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar h1 { font-size: 19px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--primary-strong); letter-spacing: .01em; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.brand-tag { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .02em; margin-top: 1px; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--danger-fill); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--g100); color: var(--g800); font-weight: 700; font-size: 14px; border: 0; cursor: pointer; text-decoration: none; flex: none;
}
:root[data-theme="dark"] .avatar { background: var(--g800); color: var(--g100); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { background: var(--g800); color: var(--g100); } }

main.page { padding: 4px 16px calc(96px + var(--safe-bottom)); max-width: 640px; margin: 0 auto; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  padding: 6px 6px calc(6px + var(--safe-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: 10px;
}
.bottomnav a.active { color: var(--primary-strong); }
.bottomnav a .icon { width: 22px; height: 22px; }
.bottomnav .fab {
  justify-self: center; width: 54px; height: 54px; margin-top: -22px; border-radius: 18px;
  background: var(--primary); color: var(--on-primary); display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(30, 89, 75, .35); padding: 0;
}
.bottomnav .fab .icon { width: 26px; height: 26px; stroke-width: 2.2; }

.sidenav { display: none; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 240px 1fr; }
  .bottomnav { display: none; }
  .sidenav {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh;
    padding: 20px 14px; border-right: 1px solid var(--line); background: var(--surface);
  }
  .sidenav .brand { padding: 4px 10px 18px; font-size: 17px; }
  .sidenav a {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
    color: var(--text-2); text-decoration: none; font-weight: 600;
  }
  .sidenav a:hover { background: var(--surface-2); }
  .sidenav a.active { background: var(--primary-soft); color: var(--primary-strong); }
  .sidenav .add-btn { margin: 8px 0 14px; justify-content: center; }
  .sidenav .section-label { margin: 18px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .sidenav .soon { margin-left: auto; font-size: 10.5px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 1px 6px; }
  main.page { max-width: 1080px; padding: 8px 32px 48px; }
  .topbar { padding-left: 32px; padding-right: 32px; }
  .topbar .brand { display: none; }
}

/* ==========================================================================
   Building blocks
   ========================================================================== */
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card, .stack > * + * { margin-top: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head h2 { font-size: 15.5px; font-weight: 700; }
.card-head .sub { font-size: 12.5px; color: var(--muted); }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .02em; margin: 22px 2px 8px; }

.grid-2 { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.grid-2 > * { min-width: 0; }
.grid-2 > .card + .card { margin-top: 0; }
@media (min-width: 960px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .span-2 { grid-column: 1 / -1; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 650; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--surface-2); color: var(--text);
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
:root[data-theme="dark"] .btn-primary { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-mark) 45%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-mark) 45%, transparent); } }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--primary-strong); }
.btn-outline { background: transparent; border-color: var(--line); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary-strong); font-weight: 600; cursor: pointer; font-size: inherit; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); font-size: 16px;   /* 16px stops iOS zoom-on-focus */
}
/* iOS Safari gives native date/time inputs a fixed intrinsic width and extra height, so in a two-column
   row they overflow into the neighbouring field. Dropping the native appearance lets them size like other inputs. */
input.input[type="date"], input.input[type="time"], input.input[type="month"] {
  -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; height: 46px; text-align: left;
}
.input::-webkit-date-and-time-value { text-align: left; margin: 0; min-width: 0; }
/* iOS draws selects and search boxes its own way (shorter, own arrows and rounding), so they didn't line up with
   the other fields. Drop the native look and draw one chevron, the same in every browser. */
select.input {
  -webkit-appearance: none; appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23889890' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
input.input[type="search"] { -webkit-appearance: none; appearance: none; }
input.input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
.input:focus { outline: none; border-color: var(--primary-mark); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-mark) 22%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input-group { position: relative; }
.input-group .input { padding-right: 48px; }
.input-group .reveal { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--primary-mark); flex: none; }

.alert { padding: 11px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert .icon { margin-top: 1px; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-info { background: var(--primary-soft); color: var(--primary-strong); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 13.5px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip .icon { width: 16px; height: 16px; }
.chip[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary-mark); color: var(--primary-strong); }
/* Weekday picker: seven equal chips on one row, even on a phone. */
.days-pick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days-pick .chip { padding: 0; justify-content: center; font-size: 13px; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); padding: 4px; border-radius: 12px; gap: 4px; }
.segmented button { min-height: 38px; border: 0; background: transparent; border-radius: 9px; font-weight: 650; color: var(--text-2); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.empty { text-align: center; padding: 28px 12px; color: var(--muted); font-size: 14px; }
.empty > .icon, .empty > p > .icon { width: 36px; height: 36px; margin: 0 auto 8px; display: block; color: var(--g300); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 8px; font-size: 12px; font-weight: 650; }
.pill-ok { background: var(--primary-soft); color: var(--primary-strong); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill .icon { width: 13px; height: 13px; stroke-width: 2.4; }

/* month switcher */
.monthbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 12px; }
.monthbar .label { font-weight: 700; font-size: 15px; }

/* ==========================================================================
   Overview
   ========================================================================== */
.hero { background: linear-gradient(150deg, var(--g700), var(--g900)); color: #fff; border-radius: 18px; padding: 18px 18px 16px; box-shadow: var(--shadow); }
.hero .label { font-size: 13px; opacity: .85; font-weight: 600; }
.hero .value { font-size: clamp(30px, 9vw, 44px); font-weight: 750; letter-spacing: -.02em; margin: 2px 0 12px; line-height: 1.1; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-stat { background: rgba(255, 255, 255, .1); border-radius: 12px; padding: 10px 12px; }
.hero-stat .k { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 6px; }
.hero-stat .v { font-weight: 700; font-size: 16px; margin-top: 2px; }
.hero-stat .sw { width: 8px; height: 8px; border-radius: 50%; }
.sw-income { background: #6DD1B7; }
.sw-expense { background: #F2B061; }
.hero .net { margin-top: 10px; font-size: 13px; opacity: .9; }

.meter { height: 10px; border-radius: 6px; background: var(--g100); overflow: hidden; }
:root[data-theme="dark"] .meter { background: var(--g800); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .meter { background: var(--g800); } }
.meter > i { display: block; height: 100%; border-radius: 6px; background: var(--primary-mark); }
.meter.warn { background: var(--warn-bg); }
.meter.warn > i { background: var(--warn-fill); }
.meter.over { background: var(--danger-bg); }
.meter.over > i { background: var(--danger-fill); }

.kv { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; color: var(--text-2); margin-top: 8px; }
.kv b { color: var(--text); font-weight: 650; }

.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .amt { font-weight: 700; text-align: right; white-space: nowrap; }
.list-item.tap { cursor: pointer; border-radius: 10px; }
.list-item.tap:hover { background: var(--surface-2); }
.amt-income { color: var(--primary-strong); }
.list-item .amt-fee { font-size: 12px; font-weight: 500; color: var(--muted); }
.cat-ico {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--surface-2); color: var(--text-2);
}
.cat-ico.income { background: var(--primary-soft); color: var(--primary-strong); }

/* ==========================================================================
   Charts
   ========================================================================== */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text, .chart .lbl { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .lbl-strong { fill: var(--text); font-size: 11.5px; font-weight: 650; font-family: var(--font); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart .bar-income { fill: var(--series-income); }
.chart .bar-expense { fill: var(--series-expense); }
.chart .bar-muted { fill: var(--series-muted); }
.chart .avg { stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .hover-band { fill: var(--text); opacity: 0; }
.chart .hit:hover + .hover-band, .chart .hit.on + .hover-band { opacity: .05; }
.chart .hit { fill: transparent; cursor: pointer; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.l-income { background: var(--series-income); }
.l-expense { background: var(--series-expense); }
.legend .l-avg { width: 14px; height: 0; border-top: 1.5px dashed var(--text-2); border-radius: 0; }
.tooltip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 120px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font-size: 12.5px; box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
}
.tooltip .t { font-weight: 700; margin-bottom: 4px; }
.tooltip .r { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.tooltip .r span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.tooltip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.table-view { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-view th, .table-view td { text-align: left; padding: 6px 4px; border-top: 1px solid var(--line); }
.table-view td.r, .table-view th.r { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { max-height: 280px; overflow: auto; }

.hbar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 6px 0; }
.hbar-row .name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-row .val { font-size: 13px; font-weight: 650; }
.hbar-row .track { grid-column: 1 / -1; height: 8px; }
.hbar-row .track > i { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--series-expense); min-width: 2px; }

/* ==========================================================================
   Entry form (add transaction)
   ========================================================================== */
.amount-box { text-align: center; padding: 18px 0 8px; }
.amount-box label { font-size: 13px; color: var(--muted); font-weight: 600; }
.amount-input {
  width: 100%; border: 0; background: transparent; text-align: center; outline: none;
  font-size: 40px; font-weight: 750; letter-spacing: -.02em; padding: 4px 0; color: var(--text);
}
.amount-input::placeholder { color: var(--line); }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (min-width: 520px) { .cat-grid { grid-template-columns: repeat(5, 1fr); } }
.cat-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; min-height: 76px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  font-size: 11.5px; font-weight: 600; color: var(--text-2); text-align: center; line-height: 1.2;
}
.cat-opt[aria-pressed="true"] { border-color: var(--primary-mark); background: var(--primary-soft); color: var(--primary-strong); }

/* ==========================================================================
   Checklist
   ========================================================================== */
.todo { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.todo:first-child { border-top: 0; }
.todo .box {
  width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--g300); background: transparent; flex: none;
  display: grid; place-items: center; cursor: pointer; color: #fff; padding: 0;
}
.todo .box .icon { width: 16px; height: 16px; stroke-width: 3; opacity: 0; }
.todo.done .box { background: var(--primary); border-color: var(--primary-mark); }
.todo.done .box .icon { opacity: 1; }
.todo.done .title { color: var(--muted); text-decoration: line-through; }
.todo .grow { flex: 1; min-width: 0; cursor: pointer; }
.todo .title { font-weight: 600; }
.todo .meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.icon.small-ico { width: 13px; height: 13px; vertical-align: -2px; }
.todo .amt { font-weight: 650; white-space: nowrap; font-size: 14px; }

/* ==========================================================================
   Budget
   ========================================================================== */
.alloc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.alloc > div { background: var(--surface-2); border-radius: 12px; padding: 10px; }
.alloc .k { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.alloc .v { font-weight: 700; font-size: 14.5px; margin-top: 2px; overflow-wrap: anywhere; }
.budget-row { padding: 12px 0; border-top: 1px solid var(--line); }
.budget-row:first-child { border-top: 0; }
.budget-row .top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.budget-row .top .grow { flex: 1; min-width: 0; }
.budget-row .name { font-weight: 600; }
.budget-row .nums { font-size: 12.5px; color: var(--muted); }
.budget-row .right { text-align: right; font-size: 13px; }
.budget-edit { display: grid; grid-template-columns: 1fr 150px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.budget-edit .row-name { font-size: 14px; }
.hbar-row .track > i.guide { background: var(--primary-mark); }
.budget-edit .input { min-height: 40px; text-align: right; }

/* ==========================================================================
   Sheet (bottom drawer on mobile, dialog on desktop), toast, banner
   ========================================================================== */
/* --vv-top / --vv-height follow the visible area (above the keyboard); set in ui.js. */
.sheet-backdrop { position: fixed; inset: 0; top: var(--vv-top, 0px); bottom: auto; height: var(--vv-height, 100%); background: rgba(9, 18, 15, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet {
  width: 100%; max-width: 560px; max-height: calc(var(--vv-height, 100dvh) - max(var(--safe-top), 40px) - 8px); background: var(--surface);
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 20px 20px 0 0; padding-top: 8px; animation: up .2s ease;
}
/* Fixed height for sheets whose content changes (e.g. transaction tabs), so the sheet doesn't jump. */
.sheet.tall { height: calc(var(--vv-height, 100dvh) - max(var(--safe-top), 40px) - 8px); }
/* Grabber and title bar can be pulled down to close (see dragToClose in ui.js). */
.sheet .grabber { flex: none; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 12px; touch-action: none; }
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; margin-bottom: 12px; touch-action: none; }
.sheet-head h2 { font-size: 18px; }
/* Only the body scrolls; the footer (main button) stays at the bottom, above the home indicator. */
.sheet-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 18px calc(18px + var(--safe-bottom)); }
.sheet-body:has(+ .sheet-foot) { padding-bottom: 12px; }
.sheet-foot { flex: none; padding: 12px 18px calc(12px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
@media (pointer: coarse) { .sheet.typing .sheet-foot { display: none; } }
.sheet-actions { margin-top: 18px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
@media (min-width: 640px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 20px; }
  .sheet.tall { height: min(calc(var(--vv-height, 100dvh) - 48px), 760px); }
  .sheet-body { padding-bottom: 20px; }
  .sheet-foot { padding-bottom: 16px; }
  .sheet .grabber { display: none; }
}
@keyframes up { from { transform: translateY(24px); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-backdrop { animation: none; } }

#toast-root { position: fixed; left: 0; right: 0; bottom: calc(86px + var(--safe-bottom)); display: flex; justify-content: center; z-index: 60; pointer-events: none; padding: 0 16px; }
.toast { background: var(--g900); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); pointer-events: auto; display: flex; gap: 12px; align-items: center; max-width: 520px; }
.toast .link-btn { color: #93E1CB; }
.toast.error { background: #6E1A14; }
@media (min-width: 960px) { #toast-root { bottom: 24px; } }

.page-banners.pad { max-width: 640px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 960px) { .page-banners.pad { max-width: 1080px; padding: 0 32px; } }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--primary-soft); color: var(--primary-strong); font-size: 13.5px; border-radius: 12px; margin: 8px 0 4px; }
.banner .grow { flex: 1; }
/* Alarm nudge (Jadwal, Beranda): how to get alarms while the app is closed */
.nudge { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--primary-soft); }
.nudge .title { font-weight: 650; color: var(--primary-strong); }
.nudge .meta { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.nudge-steps { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.nudge-steps li { margin-top: 2px; }
.nudge-steps .small-ico { vertical-align: -3px; }
[data-alarm-nudge]:empty { display: none; }
/* iPhone: points at Safari's toolbar (below the page), where the Share button is. */
.share-arrow {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-bottom)); z-index: 31; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 12px 4px; border-radius: 12px;
  background: var(--primary); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); color: #fff; font-size: 12px; font-weight: 650;
  white-space: nowrap; pointer-events: none; animation: share-bob 1.2s ease-in-out infinite;
}
.share-arrow .icon { width: 22px; height: 22px; }
@keyframes share-bob { 50% { transform: translate(-50%, 6px); } }
@media (prefers-reduced-motion: reduce) { .share-arrow { animation: none; } }
@media (orientation: landscape), (min-width: 960px) { .share-arrow { display: none; } }
.auth-install { display: flex; justify-content: center; margin-top: 14px; text-align: center; }
.auth-install:empty { display: none; }
.nudge .row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ==========================================================================
   Auth pages
   ========================================================================== */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(120% 60% at 50% 0%, var(--g100), var(--bg) 70%); }
:root[data-theme="dark"] .auth { background: var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth { background: var(--bg); } }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand { justify-content: center; font-size: 20px; margin-bottom: 18px; }
.auth-card .brand img { width: 40px; height: 40px; border-radius: 12px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card .lead { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.forgot-row { display: flex; justify-content: flex-end; margin-top: -4px; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-2); }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.pw-meter i { height: 4px; border-radius: 2px; background: var(--line); }
.pw-meter[data-score="1"] i:nth-child(-n+1) { background: var(--danger-fill); }
.pw-meter[data-score="2"] i:nth-child(-n+2) { background: var(--warn-fill); }
.pw-meter[data-score="3"] i:nth-child(-n+3) { background: var(--g400); }
.pw-meter[data-score="4"] i { background: var(--primary-mark); }

/* settings */
.menu a, .menu button.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 4px; border: 0; background: none;
  border-top: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 550; cursor: pointer; text-align: left;
}
.menu > :first-child, .menu > button.menu-item:first-child { border-top: 0; }
.menu .chev { margin-left: auto; color: var(--muted); display: flex; }
.menu .menu-sub { display: block; font-size: 12.5px; font-weight: 450; color: var(--muted); }
.copyright { text-align: center; font-size: 12px; color: var(--muted); margin-top: 16px; text-wrap: balance; }
.app-foot { margin: 20px 0 8px; text-align: center; font-size: 12.5px; color: var(--muted); }
.app-foot .copyright { margin-top: 4px; }
.legal h2 { font-size: 16px; margin: 20px 0 6px; }
.legal p, .legal li { color: var(--text-2); font-size: 14.5px; }
.legal ul { padding-left: 20px; }
.list-item .meta.wrap { white-space: normal; }
/* Stack the three figures whenever the card itself is narrow (phone, or a half-width card on desktop). */
.card { container-type: inline-size; }
@container (max-width: 460px) {
  .alloc { grid-template-columns: 1fr; gap: 0; background: var(--surface-2); border-radius: 12px; padding: 4px 12px; }
  .alloc > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; background: none; border-radius: 0; padding: 8px 0; }
  .alloc > div + div { border-top: 1px solid var(--line); }
  .alloc .k { font-size: 13px; }
  .alloc .v { margin-top: 0; white-space: nowrap; }
}

/* ==========================================================================
   Finance sub-tabs
   ========================================================================== */
.subnav {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 0 16px 8px; max-width: 640px; margin: 0 auto;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  flex: none; padding: 7px 14px; border-radius: 18px; font-size: 13.5px; font-weight: 650;
  color: var(--text-2); text-decoration: none; background: var(--surface); border: 1px solid var(--line);
}
.subnav a.active { background: var(--primary); border-color: var(--primary-mark); color: var(--on-primary); }
@media (min-width: 960px) {
  .subnav { display: none; }
  .sidenav a[data-sub] { padding-left: 12px; }
}

/* ==========================================================================
   Jadwal: hero clock, prayer strip, timeline, calendar
   ========================================================================== */
.hero-jadwal .label { margin-bottom: 2px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.hero-top .label { margin-bottom: 0; }
.hero-place { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; color: #fff; text-decoration: none; font-size: 12.5px; font-weight: 600; background: rgba(255, 255, 255, .12); border-radius: 999px; padding: 4px 10px 4px 8px; }
.hero-place span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-place:hover { background: rgba(255, 255, 255, .2); }
.hero-place .icon { flex: none; }
.hero-jadwal .clock { font-size: clamp(34px, 11vw, 48px); font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.hero-jadwal .clock small { font-size: 14px; font-weight: 600; opacity: .8; letter-spacing: 0; }
.hero-jadwal .dates { font-size: 14px; opacity: .92; margin-top: 6px; line-height: 1.45; }
.next-prayer {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; padding: 9px 12px;
  background: rgba(255, 255, 255, .12); border-radius: 12px; font-size: 14px;
}
.next-prayer > svg { margin-top: 2px; flex: none; }
.np-text { min-width: 0; display: grid; gap: 1px; }
.np-count { opacity: .85; font-size: 13px; }
.np-note { opacity: .8; font-size: 13px; overflow-wrap: anywhere; }
.datenav { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.datenav .on-dark { color: #fff; background: rgba(255, 255, 255, .12); }
.datenav .on-dark:hover { background: rgba(255, 255, 255, .2); }
.datenav .btn.on-dark { border: 0; }
.btn-light { background: #fff; color: var(--g800); border: 0; }

.prayer-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ps { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 2px; border-radius: 12px; background: var(--surface-2); }
.ps-name { font-size: 12px; font-weight: 600; color: var(--muted); }
.ps-time { font-size: 16px; font-weight: 750; }
.ps.past { opacity: .5; }
.ps.next { background: var(--primary); color: var(--on-primary); }
.ps.next .ps-name { color: inherit; opacity: .85; }
.prayer-strip.compact .ps { padding: 7px 2px; }
.prayer-strip.compact .ps-time { font-size: 14.5px; }

.tl-key { width: 10px; height: 10px; display: inline-block; }
.tl-key.fardhu, .tl-item.fardhu .tl-node { background: var(--primary-strong); border-radius: 50%; }
.tl-key.sunnah, .tl-item.sunnah .tl-node { background: var(--surface); border: 2.5px solid var(--g400); border-radius: 50%; }
.tl-key.personal, .tl-item.personal .tl-node { background: var(--warn-fill); border-radius: 3px; }
.tl-key.ghairu { width: 16px; border: 1px dashed var(--g400); border-radius: 999px; }

.timeline { margin-top: 4px; }
.tl-item { display: grid; grid-template-columns: 46px 18px minmax(0, 1fr) auto; column-gap: 8px; align-items: stretch; }
.tl-time { font-weight: 700; font-size: 14px; padding-top: 10px; text-align: right; }
.tl-rail { position: relative; display: flex; justify-content: center; }
.tl-rail::before { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl-item:first-child .tl-rail::before { top: 16px; }
.tl-item:last-child .tl-rail::before { bottom: calc(100% - 16px); }
.tl-node { position: relative; z-index: 1; width: 12px; height: 12px; margin-top: 12px; flex: none; box-shadow: 0 0 0 3px var(--surface); }
.tl-body { padding: 8px 0 12px; min-width: 0; }
.tl-body.tap { cursor: pointer; border-radius: 10px; }
.tl-body.tap:hover .tl-title { text-decoration: underline; }
.tl-title { font-weight: 650; }
.tl-item.fardhu .tl-title { color: var(--primary-strong); }
.tl-sub { font-size: 12.5px; color: var(--muted); }
/* Qabliyah › Wajib › Ba'diyah under an obligatory prayer, in the order they are prayed */
/* Row 2 of a prayer holds its steps across the text and bell columns; the rail runs through both rows. */
.tl-item > .tl-time { grid-area: 1 / 1; }
.tl-item > .tl-rail { grid-area: 1 / 2 / span 2 / 3; }
.tl-item > .tl-body { grid-area: 1 / 3; }
.tl-item > .bell-btn, .tl-item > .muted { grid-area: 1 / 4; }
.tl-item > .tl-steps { grid-area: 2 / 3 / 3 / 5; }
.tl-item.has-steps .tl-body { padding-bottom: 0; }
.tl-item.has-steps > .tl-steps { margin-top: -6px; }
.tl-steps { list-style: none; margin: 6px 0 12px; padding: 0; display: flex; flex-wrap: wrap; align-items: center; row-gap: 6px; font-size: 12px; line-height: 1.2; }
.timeline.compact .tl-steps { margin-bottom: 8px; }
.tl-steps li { display: inline-flex; align-items: center; }
/* The arrow trails the chip before it, so a wrapped line never starts with one. */
.tl-steps li:not(:last-child)::after { content: "›"; color: var(--muted); font-size: 15px; line-height: 1; margin: 0 4px 2px 5px; }
.tl-steps .step { display: inline-flex; align-items: baseline; gap: 3px; padding: 4px 8px; white-space: nowrap; border-radius: 999px; color: var(--text-2); border: 1px solid var(--g400); }
.tl-steps .step.wajib { background: color-mix(in srgb, var(--primary) 16%, transparent); border-color: transparent; color: var(--primary-strong); font-weight: 650; }
.tl-steps .step.ghairu { border-style: dashed; }
.tl-steps .step b { font-weight: 700; }
.tl-steps .step small { font-size: 11px; opacity: .8; }
/* Phones: "Wajib 4" instead of "Wajib 4 rakaat", so a prayer's steps fit on one line. */
@media (max-width: 480px) {
  .tl-steps .step small { display: none; }
  .tl-steps { font-size: 11px; }
  .tl-steps .step { padding: 3px 6px; }
  .tl-steps li:not(:last-child)::after { margin: 0 2px 2px; }
}
.tl-note { font-size: 13px; color: var(--text-2); margin-top: 4px; background: var(--surface-2); border-radius: 8px; padding: 6px 8px; white-space: pre-line; }
.tl-item.past { opacity: .5; }
.tl-item.next .tl-node { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px color-mix(in srgb, var(--primary-mark) 35%, transparent); }
.tl-item.next .tl-time { color: var(--primary-strong); }
.timeline.compact .tl-body { padding-bottom: 8px; }
.tl-item > .muted { padding-top: 10px; }
/* Time ranges. Each range is a block (.tl-wash, one per range per row) whose left edge is its coloured bar. The row
   that opens a range gets extra top room (.opens) so the title sits 8px inside the block, and the "Selesai" row ends
   the block 8px under its text. A range inside another (a meeting within work hours) is a deeper block drawn on
   top, inset on the right so the outer one shows around it. Text steps right only as deep as the row sits
   (depth-N), so rows outside any range keep their place. Lane l's bar sits at 78px + l × 8px. */
.tl-item { position: relative; }
.tl-item > :not(.tl-lanes):not(.tl-wash) { position: relative; z-index: 1; }
.tl-lanes { position: absolute; top: 0; bottom: 0; left: 78px; display: flex; gap: 5px; pointer-events: none; z-index: 1; }
.tl-lanes i { width: 3px; }
.lane.lane-0 { background: var(--lane-0); } .lane.lane-1 { background: var(--lane-1); } .lane.lane-2 { background: var(--lane-2); }
.lane.start { margin-top: 6px; border-radius: 2px 2px 0 0; }
.lane.end { align-self: flex-start; height: 38px; border-radius: 0 0 2px 2px; }
.tl-item.opens .tl-time { padding-top: 16px; }
.tl-item.opens .tl-body { padding-top: 14px; }
.tl-item.opens .tl-node { margin-top: 18px; }
.tl-item.end .tl-body { padding-bottom: 14px; }
.tl-item.depth-1 .tl-body, .tl-item.depth-1 > .tl-steps { margin-left: 16px; }
.tl-item.depth-2 .tl-body, .tl-item.depth-2 > .tl-steps { margin-left: 24px; }
.tl-item.depth-3 .tl-body, .tl-item.depth-3 > .tl-steps { margin-left: 32px; }
.tl-wash { position: absolute; top: 0; bottom: 0; z-index: 0; pointer-events: none; }
.tl-wash.lane-0 { left: 78px; right: 0; background: color-mix(in srgb, var(--lane-0) 9%, transparent); }
.tl-wash.lane-1 { left: 86px; right: 6px; background: color-mix(in srgb, var(--lane-1) 14%, var(--surface)); }
.tl-wash.lane-2 { left: 94px; right: 12px; background: color-mix(in srgb, var(--lane-2) 16%, var(--surface)); }
.tl-wash.start { top: 6px; border-top-right-radius: 10px; }
.tl-wash.end { bottom: auto; height: 38px; border-bottom-right-radius: 10px; }
.tl-item.end .tl-node { width: 12px; height: 12px; margin-top: 12px; border-radius: 3px; background: var(--surface); border: 2px solid var(--muted); }
.tl-item.end .tl-time, .tl-item.end .tl-title { color: var(--muted); font-weight: 600; }
.tl-item.end .tl-title { font-size: 13px; }
.tl-item.end .tl-body { padding-top: 10px; }
.tl-item.personal .tl-node.lane-0 { background: var(--lane-0); }
.tl-item.personal .tl-node.lane-1 { background: var(--lane-1); }
.tl-item.personal .tl-node.lane-2 { background: var(--lane-2); }
.tl-item.end .tl-node.lane-0 { border-color: var(--lane-0); }
.tl-item.end .tl-node.lane-1 { border-color: var(--lane-1); }
.tl-item.end .tl-node.lane-2 { border-color: var(--lane-2); }
.bell-btn {
  align-self: start; margin-top: 4px; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent;
  color: var(--muted); display: grid; place-items: center; cursor: pointer; opacity: .7;
}
.bell-btn:hover { background: var(--surface-2); opacity: 1; }
.bell-btn.on { color: var(--primary-strong); opacity: 1; }
.bell-btn .icon { width: 19px; height: 19px; }

.desktop-only { display: none; }
@media (min-width: 960px) {
  .desktop-only { display: block; }
  .grid-2.jadwal { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}

.cal-head { display: flex; align-items: center; justify-content: space-between; text-align: center; margin-bottom: 8px; }
.cal-title { font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.cal-dow span { font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-day {
  position: relative; aspect-ratio: 1; min-height: 36px; border: 0; border-radius: 10px; background: transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; color: var(--text);
}
.cal-day:hover { background: var(--surface-2); }
.cal-dow .sun, .cal-day.sun { color: var(--danger); }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--primary-mark); }
.cal-day.selected { background: var(--primary); color: var(--on-primary); }
.cal-day.holiday::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--primary-mark); }
.cal-day.selected.holiday::after { background: #fff; }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary-mark); }
/* Days with an "acara" (one-off, monthly or yearly activity): an amber dot; next to the green holiday dot when both. */
.cal-dot.event { background: var(--lane-0); }
.cal-day.event::before { content: ""; position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--lane-0); }
.cal-day.event.holiday::before { margin-left: -6.5px; }
.cal-day.event.holiday::after { margin-left: 1.5px; }
.cal-day.selected.event::before { background: #fff; }
.sun-key { color: var(--danger); }

/* settings form */
.calib-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.calib-grid label { display: flex; flex-direction: column; gap: 4px; }
.calib-grid .input { padding: 8px 6px; text-align: center; min-height: 42px; }
@media (max-width: 420px) { .calib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sunnah-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.sunnah-row:first-of-type { border-top: 0; }
.sunnah-row .grow { flex: 1; min-width: 0; }
.sunnah-row .offset { display: flex; flex-direction: column; align-items: stretch; gap: 3px; width: 128px; flex: none; }
.sunnah-row .offset > span { text-align: center; white-space: nowrap; }
.sunnah-row .offset .input { min-height: 38px; text-align: center; padding: 6px; }
.sticky-save { position: sticky; bottom: calc(80px + var(--safe-bottom)); z-index: 5; box-shadow: 0 6px 18px rgba(30, 89, 75, .3); }
@media (min-width: 960px) { .sticky-save { bottom: 16px; } }
.preview { background: var(--surface-2); border-radius: 12px; padding: 10px; }
.preview .ps { background: var(--surface); }
.subnav a { flex: 1 0 auto; text-align: center; padding: 7px 8px; font-size: 13px; }
/* Admin: tester feedback list */
.feedback-item { align-items: flex-start; }
.feedback-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.feedback-msg { margin: 6px 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.segmented.compact button { font-size: 13.5px; white-space: nowrap; padding: 0 4px; }
.segmented .count { font-size: 12px; color: var(--muted); font-weight: 600; }
/* Debts (utang) */
.big { font-size: 26px; font-weight: 750; letter-spacing: -.01em; line-height: 1.2; margin: 2px 0 4px; }
.mt-4 { margin-top: 4px; }
.debt-card { display: block; width: 100%; text-align: left; font: inherit; color: inherit; border: 0; cursor: pointer; margin-top: 12px; }
.debt-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.debt-top .title { font-weight: 650; }
.debt-card .meta { font-size: 12.5px; color: var(--muted); }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: ' ›'; }
details[open] > summary::after { content: ' ˅'; }
/* Radio rows (debt "Sisa", checklist "Ulangi sampai") */
.radio-row { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14.5px; color: var(--text); }
.radio-row input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--primary-mark); flex: none; }
.radio-row.disabled { opacity: .5; }
.radio-row .input.count-input { width: 76px; min-height: 38px; height: 38px; margin-left: auto; text-align: center; }
/* "Ulangi sampai": both fields the same width and left edge, with a fixed column for "kali" so they line up. */
.radio-row .grow { flex: 1; }
.radio-row .input.end-input { width: 176px; flex: none; min-height: 40px; height: 40px; padding: 0 12px; text-align: left; font-size: 15px; }

/* Month fields: our own "Oktober 2026" label over the native field (see monthInput in ui.js). */
.month-field { position: relative; display: block; min-width: 0; }
.month-field:has(> input[hidden]) { display: none; }
.month-field > input.input { color: transparent; -webkit-text-fill-color: transparent; }
.month-text {
  position: absolute; inset: 0; display: flex; align-items: center; padding: 0 40px 0 12px;
  pointer-events: none; color: var(--text); font-size: 16px; white-space: nowrap; overflow: hidden;
}
.radio-row .month-field { flex: none; width: 176px; }
/* Catat transaksi: "+ Biaya admin" opens its own field. */
.entry .fee { margin: -6px 0 14px; }
.entry .fee .link-btn { display: inline-flex; align-items: center; gap: 4px; }
.radio-row .month-field > .input.end-input { width: 100%; }
.radio-row .month-text { font-size: 15px; }
.radio-row .suffix { width: 28px; flex: none; font-size: 14px; }
.hint.calc { margin: -4px 0 14px; color: var(--primary-strong); font-weight: 600; }

/* ==========================================================================
   Tugas (to-do)
   ========================================================================== */
.task-check {
  flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--g400); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; color: transparent; cursor: pointer; padding: 0;
}
.task-check .icon { width: 16px; height: 16px; stroke-width: 3; }
.task-check[aria-pressed="true"] { background: var(--primary); border-color: var(--primary-mark); color: var(--on-primary); }
.task-row.done .title { text-decoration: line-through; color: var(--muted); }
.task-row.done .meta { opacity: .7; }
.task-list .list-item { align-items: center; }
/* On Jadwal a timed task's dot is its tick box. */
.tl-key.task { width: 10px; height: 10px; border: 2px solid var(--g400); border-radius: 3px; }
.tl-item.task .tl-node:not(.tl-check) { background: var(--surface); border: 2px solid var(--g400); border-radius: 3px; }
.tl-item.task.done .tl-node:not(.tl-check) { background: var(--primary); border-color: var(--primary-mark); }
.tl-node.tl-check { width: 18px; height: 18px; margin-top: 9px; border-radius: 5px; border: 2px solid var(--g400); background: var(--surface); padding: 0;
  display: flex; align-items: center; justify-content: center; color: transparent; cursor: pointer; }
.tl-node.tl-check .icon { width: 12px; height: 12px; stroke-width: 3.2; }
.tl-node.tl-check[aria-pressed="true"] { background: var(--primary); border-color: var(--primary-mark); color: var(--on-primary); }
.tl-item.task.done .tl-title { text-decoration: line-through; color: var(--muted); }
.done-box > summary { display: flex; align-items: baseline; gap: 8px; cursor: pointer; list-style: none; }
.done-box > summary::-webkit-details-marker { display: none; }
.done-box > summary h2 { margin: 0; font-size: 15.5px; font-weight: 700; }
.done-box > summary::after { content: "›"; margin-left: auto; color: var(--muted); font-size: 18px; transition: transform .15s; }
.done-box[open] > summary::after { transform: rotate(90deg); }

/* Dark mode: thin edge on filled #123C32 areas (same pattern as .btn-primary) */
:root[data-theme="dark"] .bottomnav .fab { box-shadow: 0 6px 18px rgba(0, 0, 0, .45), inset 0 0 0 1px color-mix(in srgb, var(--primary-mark) 45%, transparent); }
:root[data-theme="dark"] .ps.next { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-mark) 45%, transparent); }
:root[data-theme="dark"] .cal-day.selected { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-mark) 45%, transparent); }
:root[data-theme="dark"] .share-arrow { box-shadow: 0 6px 18px rgba(0, 0, 0, .35), inset 0 0 0 1px color-mix(in srgb, var(--primary-mark) 45%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bottomnav .fab { box-shadow: 0 6px 18px rgba(0, 0, 0, .45), inset 0 0 0 1px color-mix(in srgb, var(--primary-mark) 45%, transparent); } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ps.next { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-mark) 45%, transparent); } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cal-day.selected { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-mark) 45%, transparent); } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .share-arrow { box-shadow: 0 6px 18px rgba(0, 0, 0, .35), inset 0 0 0 1px color-mix(in srgb, var(--primary-mark) 45%, transparent); } }
