/* Zui Notebook — gaya tampilan
   Tema: terang (bawaan), gelap, ceria. Ukuran huruf lewat data-fs.
   Kontras tinggi lewat data-contrast="tinggi". */

:root,
:root[data-theme="terang"] {
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --surface-2: #F1EEE7;
  --hover: #E9E5DC;
  --selected: #E3DFD5;
  --ink: #1D1B17;
  --ink-2: #3D3A34;
  --muted: #5E5A52;
  --line: #E2DED5;
  --line-strong: #C9C3B6;
  --accent: #2F5D50;
  --accent-ink: #FFFFFF;
  --accent-soft: #DCE8E2;
  --danger: #A12C1E;
  --danger-ink: #FFFFFF;
  --focus: #1F4FBF;
  --scrim: rgba(29, 27, 23, 0.32);
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --display-weight: 400;
  --radius: 14px;
  --radius-lg: 20px;
  --border-w: 1px;
  color-scheme: light;
}

:root[data-theme="gelap"] {
  --bg: #1E1D1A;
  --surface: #2A2925;
  --surface-2: #252420;
  --hover: #33312C;
  --selected: #3A3833;
  --ink: #EDEAE3;
  --ink-2: #D4D0C7;
  --muted: #A8A398;
  --line: #3A3833;
  --line-strong: #55524B;
  --accent: #8FC1A9;
  --accent-ink: #12201A;
  --accent-soft: #2C3A33;
  --danger: #F2A093;
  --danger-ink: #2A0F0A;
  --focus: #9DBBFF;
  --scrim: rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

:root[data-theme="ceria"] {
  --bg: #FBF1E6;
  --surface: #FFFFFF;
  --surface-2: #FFF8F0;
  --hover: #FBE6D4;
  --selected: #FFE2CC;
  --ink: #2A1F2D;
  --ink-2: #3F3342;
  --muted: #6A5C6E;
  --line: #EBD9C7;
  --line-strong: #D9BFA6;
  --accent: #B8430F;
  --accent-ink: #FFFFFF;
  --accent-soft: #FFE2CC;
  --danger: #A12C1E;
  --danger-ink: #FFFFFF;
  --focus: #5B2FC9;
  --scrim: rgba(42, 31, 45, 0.32);
  --font-display: "Fraunces", Georgia, serif;
  --display-weight: 600;
  --radius: 18px;
  --radius-lg: 24px;
  color-scheme: light;
}

/* Kontras tinggi: teks redup jadi pekat, garis lebih tebal dan tegas */
:root[data-contrast="tinggi"] {
  --muted: var(--ink);
  --ink-2: var(--ink);
  --line: var(--ink);
  --line-strong: var(--ink);
  --border-w: 2px;
}
:root[data-contrast="tinggi"][data-theme="terang"],
:root[data-contrast="tinggi"][data-theme="ceria"] { --bg: #FFFFFF; --surface-2: #FFFFFF; --accent: #1E4237; --focus: #0033CC; }
:root[data-contrast="tinggi"][data-theme="ceria"] { --accent: #8A2F08; }
:root[data-contrast="tinggi"][data-theme="gelap"] { --bg: #000000; --surface: #111111; --surface-2: #0A0A0A; --ink: #FFFFFF; --accent: #A8E0C4; --focus: #FFD84D; }

/* Ukuran huruf: semua ukuran di bawah memakai rem agar ikut membesar */
html { font-size: 17px; }
html[data-fs="kecil"] { font-size: 15px; }
html[data-fs="sedang"] { font-size: 17px; }
html[data-fs="besar"] { font-size: 20px; }
html[data-fs="sangat-besar"] { font-size: 24px; }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
a { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: 12px 16px; border-radius: 10px; }
.skip:focus { left: 8px; }

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

/* ---------- Kerangka ---------- */
#app { min-height: 100%; display: flex; flex-direction: column; }
.boot { margin: auto; color: var(--muted); padding: 40px; }

.shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 10px 6px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
}
.topbar .right { display: flex; gap: 4px; align-items: center; }
.main { flex: 1; display: flex; flex-direction: column; padding: 0 16px 32px; outline: none; }

/* Tombol ikon: label teks tersembunyi secara visual, tetap dibaca pembaca layar.
   Saat "Tampilkan label tombol" aktif, label muncul di bawah ikon. */
.iconbtn {
  min-width: 48px;
  min-height: 48px;
  border: none;
  background: transparent;
  color: var(--ink);
  border-radius: 12px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 6px;
}
.iconbtn:hover { background: var(--hover); }
.iconbtn[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.iconbtn svg { width: 1.45rem; height: 1.45rem; flex: none; }
.iconbtn .lbl {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
:root[data-labels="on"] .iconbtn .lbl {
  position: static; width: auto; height: auto; clip: auto; overflow: visible;
  font-size: 0.72rem; font-weight: 600; line-height: 1.1;
}
:root[data-labels="on"] .iconbtn { min-width: 60px; min-height: 58px; }

.avatar {
  width: 1.85rem; height: 1.85rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Tombol umum ---------- */
.btn {
  min-height: 52px;
  padding: 0 20px;
  border-radius: var(--radius);
  border: var(--border-w) solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none;
}
.btn:hover { background: var(--hover); }
.btn svg { width: 1.25rem; height: 1.25rem; flex: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: var(--danger); color: var(--danger-ink); border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.block { width: 100%; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 0.92rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.linkbtn { background: none; border: none; padding: 10px 4px; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }

/* ---------- Beranda ---------- */
.home {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 14px;
  padding: 0 16px 12vh;
}
.home .mark { color: var(--accent); width: 2.1rem; height: 2.1rem; }
.home h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.home p { margin: 0; color: var(--muted); font-size: 1.06rem; }

/* ---------- Daftar catatan ---------- */
.viewhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 14px; flex-wrap: wrap; }
.viewhead h1 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.6rem; line-height: 1.2; }
.viewhead .count { color: var(--muted); font-size: 0.9rem; }
.viewhead .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.section-label { font-size: 0.82rem; font-weight: 600; color: var(--muted); margin: 14px 2px 8px; letter-spacing: 0.02em; }
.card {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
  color: var(--ink);
}
button.card:hover { border-color: var(--line-strong); }
.card .meta { font-size: 0.82rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card .meta .pin { color: var(--accent); font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.card .meta svg { width: 0.95rem; height: 0.95rem; }
.card h2 { margin: 0; font-size: 1.08rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.card p { margin: 0; color: var(--ink-2); font-size: 0.95rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.card .row-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); padding: 48px 12px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.empty p { margin: 0; }
.tagchip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 14px; background: var(--surface-2); border: var(--border-w) solid var(--line); font-size: 0.8rem; color: var(--ink-2); }

/* ---------- Pencarian ---------- */
.searchbox {
  display: flex; align-items: center; gap: 10px;
  min-height: 56px;
  background: var(--surface);
  border: var(--border-w) solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0 14px;
  margin-bottom: 14px;
}
.searchbox svg { width: 1.25rem; height: 1.25rem; color: var(--muted); flex: none; }
.searchbox input { flex: 1; border: none; background: transparent; outline: none; font-size: 1.06rem; min-height: 52px; min-width: 0; }
.searchbox:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- Editor ---------- */
.editor { display: flex; flex-direction: column; flex: 1; }
.editor .title {
  width: 100%;
  border: none; background: transparent; outline: none;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 1.6rem; line-height: 1.25;
  resize: none; padding: 4px 0 8px; overflow: hidden;
}
.editor .body {
  width: 100%;
  border: none; background: transparent; outline: none;
  font-size: 1.08rem; line-height: 1.6;
  resize: none; min-height: 40vh; padding: 4px 0; overflow: hidden;
}
.editor .title:focus-visible, .editor .body:focus-visible { outline: none; }
.editor .chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 10px; }
.editor .chips .tagchip { min-height: 34px; }
.editor .chips button.tagchip { cursor: pointer; min-height: 44px; }
.tagchip svg { width: 1rem; height: 1rem; flex: none; }
.banner { background: var(--surface-2); border: var(--border-w) solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner p { margin: 0; }
.templates { margin: 4px 0 14px; }
.templates h2 { margin: 0 0 8px; font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.tplgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .tplgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tpl { min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; text-align: left; background: var(--surface); border: var(--border-w) solid var(--line); border-radius: 12px; color: var(--ink); font-size: 0.95rem; font-weight: 500; }
.tpl:hover { border-color: var(--line-strong); background: var(--hover); }
.tpl svg { width: 1.3rem; height: 1.3rem; flex: none; color: var(--accent); }

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.checkrow { display: flex; align-items: center; gap: 6px; min-height: 52px; }
.checkrow label.box { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; flex: none; cursor: pointer; }
.checkrow input[type="checkbox"] { width: 1.6rem; height: 1.6rem; accent-color: var(--accent); cursor: pointer; margin: 0; }
.checkrow input[type="text"] { flex: 1; min-width: 0; border: none; border-bottom: var(--border-w) solid transparent; background: transparent; font-size: 1.08rem; padding: 10px 2px; outline: none; }
.checkrow input[type="text"]:focus { border-bottom-color: var(--line-strong); }
.checkrow.done input[type="text"] { text-decoration: line-through; color: var(--muted); }
.checkrow .iconbtn { color: var(--muted); }
.addrow { align-self: flex-start; margin: 6px 0 0 4px; }
.checkrow .itemmain { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.checkrow .itemmain input[type="text"] { width: 100%; }
.checkrow .duebtn.set { color: var(--accent); }

/* ---------- Tanggal dan pengingat ---------- */
.due { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.82rem; color: var(--muted); padding: 0 2px 8px; }
.due > span { display: inline-flex; align-items: center; gap: 4px; }
.due svg { width: 0.95rem; height: 0.95rem; flex: none; }
.due.late { color: var(--danger); font-weight: 600; }
.checkrow.done .due { text-decoration: line-through; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.quick .btn { flex: 1 1 auto; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }

.agenda { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.agrow { display: flex; align-items: stretch; background: var(--surface); border: var(--border-w) solid var(--line); border-radius: var(--radius); }
.agrow label.box { width: 52px; display: inline-flex; align-items: center; justify-content: center; flex: none; cursor: pointer; }
.agrow input[type="checkbox"] { width: 1.6rem; height: 1.6rem; accent-color: var(--accent); cursor: pointer; margin: 0; }
.agrow .agmain { flex: 1; min-width: 0; min-height: 56px; border: none; background: transparent; text-align: left; padding: 10px 14px 10px 2px; display: flex; flex-direction: column; justify-content: center; gap: 2px; color: var(--ink); border-radius: 0 var(--radius) var(--radius) 0; }
.agrow .agmain:hover { background: var(--hover); }
.agrow .txt { font-size: 1.05rem; font-weight: 600; overflow-wrap: anywhere; }
.agrow .meta { font-size: 0.85rem; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.agrow .meta .bell svg { width: 0.95rem; height: 0.95rem; display: block; }
.agrow.late .meta { color: var(--danger); font-weight: 600; }
.home #home-today { margin-top: 4px; }

.attachments { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 16px 0; }
.attachments figure { margin: 0; border: var(--border-w) solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.attachments img { width: 100%; height: 140px; object-fit: cover; }
.attachments figcaption { display: flex; justify-content: flex-end; padding: 4px; }
.attachments figure { position: relative; }
.attachments .thumb { display: block; width: 100%; padding: 0; border: none; background: var(--surface-2); cursor: zoom-in; }
.attachments figure.pending img { opacity: .7; }
.attachments figure.elsewhere .thumb { height: 140px; cursor: default; }
.attachments .wait { position: absolute; left: 6px; top: 6px; right: 6px; background: var(--ink); color: var(--bg); font-size: 0.78rem; padding: 4px 8px; border-radius: 8px; }
dialog.photo { max-width: min(960px, calc(100vw - 16px)); }
.viewer img { width: 100%; max-height: 75vh; object-fit: contain; border-radius: 10px; background: var(--surface-2); }
.quota-num { margin: 0; font-size: 1.3rem; }
.bar { height: 12px; border-radius: 6px; background: var(--surface-2); border: var(--border-w) solid var(--line-strong); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); min-width: 2px; }
.bar.full span { background: var(--danger); }

/* ---------- Dialog, laci menu, lembar pilihan ---------- */
dialog {
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  max-width: min(440px, calc(100vw - 32px));
  width: 100%;
}
dialog::backdrop { background: var(--scrim); }
.dlg { padding: 22px 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.dlg h2 { margin: 0; font-size: 1.25rem; line-height: 1.3; }
.dlg p { margin: 0; color: var(--ink-2); }
.dlg .buttons { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.dlg .buttons .btn { flex: 1 1 140px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field .hint { color: var(--muted); font-size: 0.85rem; }
.input {
  min-height: 52px; width: 100%;
  border: var(--border-w) solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg);
  padding: 0 14px;
  font-size: 1.04rem;
}
.input:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.menu-list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.menu-item {
  width: 100%;
  min-height: 52px;
  border: none; background: transparent;
  border-radius: 12px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 12px;
  text-align: left; font-size: 1.02rem; color: var(--ink);
  text-decoration: none;
}
.menu-item:hover { background: var(--hover); }
.menu-item[aria-current="page"], .menu-item[aria-checked="true"] { background: var(--selected); font-weight: 600; }
.menu-item svg { width: 1.3rem; height: 1.3rem; flex: none; color: var(--ink-2); }
.menu-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item .n { color: var(--muted); font-size: 0.85rem; }
.menu-item.danger, .menu-item.danger svg { color: var(--danger); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--accent); }

dialog.drawer {
  margin: 0; height: 100%; max-height: 100%;
  width: min(330px, 88vw); max-width: none;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  border-width: 0 var(--border-w) 0 0;
  background: var(--surface-2);
}
dialog.drawer[open] { display: flex; flex-direction: column; }
.drawer .dhead { display: flex; align-items: center; justify-content: space-between; padding: max(10px, env(safe-area-inset-top)) 8px 6px 18px; }
.drawer .dhead .brand { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.3rem; }
.drawer .dscroll { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.drawer .dsearch {
  width: 100%; min-height: 50px; display: flex; align-items: center; gap: 10px;
  border: var(--border-w) solid var(--line); background: var(--surface);
  border-radius: 12px; padding: 0 12px; color: var(--muted); font-size: 1rem; margin-bottom: 8px; text-align: left;
}
.drawer .dsearch svg { width: 1.2rem; height: 1.2rem; }
.drawer .group { font-size: 0.8rem; font-weight: 600; color: var(--muted); padding: 14px 12px 4px; display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.drawer .group .iconbtn { min-height: 40px; min-width: 40px; color: var(--muted); }
.drawer .dfoot { border-top: var(--border-w) solid var(--line); padding: 8px 10px max(12px, env(safe-area-inset-bottom)); }

dialog.sheet { margin-bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-width: 560px; }
@media (min-width: 640px) { dialog.sheet { margin-bottom: auto; border-radius: var(--radius-lg); } }

/* ---------- Pengaturan ---------- */
.settings { display: flex; flex-direction: column; gap: 22px; }
.settings section { background: var(--surface); border: var(--border-w) solid var(--line); border-radius: var(--radius-lg); padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.settings h2 { margin: 0; font-size: 1.1rem; }
.settings .desc { margin: 0; color: var(--muted); font-size: 0.92rem; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border: none; margin: 0; padding: 0; }
@media (min-width: 520px) { .seg.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.seg legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt > span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 60px; padding: 8px; text-align: center;
  border: var(--border-w) solid var(--line-strong); border-radius: 12px; background: var(--bg);
  font-weight: 600; font-size: 0.95rem;
}
.opt input:checked + span { border: 2px solid var(--accent); background: var(--accent-soft); }
.opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.opt .aa { font-family: var(--font-display); line-height: 1; }
.swatch { display: flex; gap: 4px; }
.swatch i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.2); display: block; }
.preview { border: var(--border-w) dashed var(--line-strong); border-radius: 12px; padding: 12px 14px; background: var(--bg); }
.preview strong { display: block; margin-bottom: 4px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; cursor: pointer; }
.switch .txt { display: flex; flex-direction: column; }
.switch .txt small { color: var(--muted); font-size: 0.85rem; }
.switch input { appearance: none; -webkit-appearance: none; width: 56px; height: 32px; border-radius: 16px; background: var(--line-strong); position: relative; flex: none; cursor: pointer; margin: 0; border: 2px solid transparent; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .12s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 26px; background: var(--accent-ink); }
.backups { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.backups li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: var(--border-w) solid var(--line); flex-wrap: wrap; }
.backups li:first-child { border-top: none; }
.backups small { color: var(--muted); display: block; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; }
.btnrow .btn { flex: 1 1 160px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: 0.85rem; font-weight: 600; }

/* ---------- Masuk dan pengenalan ---------- */
.auth, .onb {
  min-height: 100vh; min-height: 100dvh;
  max-width: 460px; width: 100%; margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px;
}
.auth .top, .onb .top { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.auth h1, .onb h1 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight); font-size: 2rem; line-height: 1.2; }
.auth p, .onb p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.auth .stack, .onb .stack { display: flex; flex-direction: column; gap: 10px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.9rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.onb .art { width: 4.2rem; height: 4.2rem; border-radius: 1.2rem; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.onb .art svg { width: 2.2rem; height: 2.2rem; }
.steps { display: flex; gap: 8px; justify-content: center; }
.steps i { width: 10px; height: 10px; border-radius: 5px; background: var(--line-strong); display: block; }
.steps i.on { background: var(--accent); width: 26px; }
.onb .nav { display: flex; gap: 10px; }
.onb .nav .btn { flex: 1; }
.note-small { font-size: 0.9rem; color: var(--muted); }
.err { color: var(--danger); font-weight: 600; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 0; right: 0; bottom: max(20px, env(safe-area-inset-bottom));
  margin: 0 auto; width: fit-content;
  background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 12px;
  max-width: min(520px, calc(100vw - 32px));
  font-size: 0.95rem; z-index: 50;
  display: none; gap: 12px; align-items: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
.toast.show { display: flex; }
.toast button { background: none; border: none; color: inherit; font-weight: 700; text-decoration: underline; min-height: 40px; padding: 0 4px; }

/* ---------- Layar lebar (PC / tablet mendatar) ---------- */
@media (min-width: 900px) {
  .shell { max-width: none; }
  .topbar { padding-left: 24px; padding-right: 24px; }
  .main { padding: 0 32px 40px; }
  .notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
  .notes > li { display: flex; }
  .notes > li > .card { flex: 1; }
  /* Editor tetap selebar teks yang nyaman dibaca, di tengah layar */
  .editor { width: 100%; max-width: 900px; margin: 0 auto; }
}
