/* Personal Office — minimal, content-first. Token → komponen → halaman. Tanpa build step. */
:root {
  color-scheme: light dark;
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f1f4f7; --text: #0f172a; --muted: #526071;
  --line: #e2e7ee; --line-strong: #cdd5df;
  --accent: #0f766e; --accent-hover: #115e59; --accent-soft: #e6f4f2; --accent-text: #ffffff;
  --doing: #1d5fd1; --doing-soft: #e8effc; --waiting: #9a5b00; --waiting-soft: #fdf3e1;
  --done: #3f7a4f; --done-soft: #e9f3ec; --danger: #b42318; --danger-soft: #fdecea;
  --radius: 10px; --radius-sm: 7px;
  --shadow: 0 1px 2px rgb(15 23 42 / .06);
  --shadow-pop: 0 10px 30px rgb(15 23 42 / .14), 0 1px 3px rgb(15 23 42 / .08);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sidebar: 15rem; --tabbar: 60px; --measure: 46rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419; --surface: #161c23; --surface-2: #1d252e; --text: #e7ecf2; --muted: #9aa6b4;
    --line: #26303b; --line-strong: #34404d;
    --accent: #2fb5a5; --accent-hover: #4cc7b8; --accent-soft: #113430; --accent-text: #04201d;
    --doing: #6ea3ff; --doing-soft: #16243d; --waiting: #e6b450; --waiting-soft: #33270f;
    --done: #7fbf8f; --done-soft: #15291b; --danger: #ff7b6e; --danger-soft: #3a1714;
    --shadow: 0 1px 2px rgb(0 0 0 / .3);
    --shadow-pop: 0 12px 32px rgb(0 0 0 / .5);
  }
}

/* ---------- Dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 1.45rem; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 1rem; font-weight: 650; margin: 0 0 var(--s3); }
h3 { font-size: .8rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: var(--s4) 0 var(--s2); }
p { margin: 0 0 var(--s3); }
small, .muted { color: var(--muted); }
ul.plain, ol.plain { list-style: none; padding: 0; margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--surface); padding: var(--s2) var(--s3); border-radius: var(--radius-sm); }
.skip:focus { left: 8px; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Kontrol ---------- */
input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=search], input[type=date], input[type=time], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: .55rem .7rem; min-height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 8rem; max-height: 70vh; resize: vertical; line-height: 1.55; field-sizing: content; }
textarea.md-input { font-family: var(--mono); font-size: .88rem; }
.md-toolbar { display: flex; flex-wrap: wrap; gap: 2px; margin: var(--s1) 0; }
.md-toolbar button { min-width: 36px; padding: 0 var(--s2); }
.md-toolbar .md-preview-btn { margin-left: auto; }
.md-toolbar .md-preview-btn[aria-pressed=true] { color: var(--accent); border-color: var(--accent); }
.md-preview { min-height: 8rem; padding: .55rem .7rem; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
button, .btn {
  min-height: 44px; padding: 0 var(--s4); border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s2); font-weight: 550; font-size: .92rem; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
  text-decoration: none;
}
button:hover, .btn:hover { background: var(--surface-2); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); }
button.ghost, .btn.ghost { border-color: transparent; background: transparent; }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-2); }
button.danger, .btn.danger { color: var(--danger); }
button.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
button.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--accent); font-weight: inherit; }
button.sm, .btn.sm { min-height: 36px; padding: 0 var(--s3); font-size: .85rem; }
button.icon-btn, .btn.icon-btn { width: 44px; padding: 0; }
@media (pointer: coarse) { button.sm, .btn.sm { min-height: 44px; } }
label { display: block; font-size: .84rem; font-weight: 550; color: var(--muted); margin: var(--s3) 0 var(--s1); }
label.inline { display: inline-flex; align-items: center; gap: var(--s2); margin: 0; font-weight: 500; color: var(--text); min-height: 44px; }
.htmx-request { opacity: .6; transition: opacity .2s; }
summary { cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary { list-style: none; }

/* ---------- Layout ---------- */
.app { min-height: 100vh; }
.sidebar { display: none; }
.mobilebar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: var(--s2);
  height: 52px; padding: 0 var(--s2) 0 var(--s4); background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 700; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font-size: .8rem; font-weight: 800; }
.mobilebar .brand { margin-right: auto; }
main { padding: var(--s4) var(--s4) calc(var(--tabbar) + var(--s6)); max-width: 72rem; margin: 0 auto; min-width: 0; }
main.narrow { max-width: 56rem; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 15; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar > a, .tabbar summary {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--tabbar); font-size: .7rem; font-weight: 550; color: var(--muted);
}
.tabbar .icon { width: 22px; height: 22px; }
.tabbar > a:hover { text-decoration: none; color: var(--text); }
.tabbar > a[aria-current] { color: var(--accent); }
.tabbar > a[aria-current]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; border-radius: 2px; background: var(--accent); }
.tabbar .count { position: absolute; top: 6px; left: calc(50% + 6px); }
.tabbar .popover-menu { bottom: calc(var(--tabbar) + 6px); right: 6px; top: auto; }

.count:not(:empty) { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; font-style: normal; }

@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .mobilebar, .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: var(--s4); position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: var(--s4) var(--s3); background: var(--surface); border-right: 1px solid var(--line);
  }
  .sidebar .brand { padding: 0 var(--s2); }
  .sidebar .search { position: relative; }
  .sidebar .search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
  .sidebar .search input { padding-left: 34px; min-height: 38px; background: var(--surface-2); border-color: transparent; }
  .sidebar .search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
  .nav-group { display: flex; flex-direction: column; gap: 2px; }
  .nav-label { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 var(--s2); margin-bottom: var(--s1); }
  .nav-group a, .nav-group button.nav-item {
    display: flex; align-items: center; gap: var(--s3); min-height: 38px; padding: 0 var(--s2); border-radius: var(--radius-sm);
    color: var(--text); font-size: .92rem; font-weight: 500; border: 0; background: none; width: 100%; justify-content: flex-start;
  }
  .nav-group a .icon, .nav-group button.nav-item .icon { color: var(--muted); }
  .nav-group a:hover, .nav-group button.nav-item:hover { background: var(--surface-2); text-decoration: none; }
  .nav-group a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
  .nav-group a[aria-current] .icon { color: var(--accent); }
  .nav-group .count { margin-left: auto; background: var(--surface-2); color: var(--muted); }
  .nav-group a[aria-current] .count { background: var(--accent); color: var(--accent-text); }
  .sidebar-foot { margin-top: auto; }
  main { padding: var(--s5) var(--s6) var(--s6); margin: 0 auto; max-width: 76rem; width: 100%; }
}
kbd { font: 600 .7rem var(--mono); padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); background: var(--surface); }

/* ---------- Header halaman ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s5); }
.page-head .eyebrow, .crumbs { font-size: .82rem; color: var(--muted); margin: 0 0 var(--s1); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { opacity: .5; }
.page-head .sub { color: var(--muted); margin: var(--s2) 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-size: .9rem; }
.page-actions { display: flex; gap: var(--s2); align-items: center; flex: none; }
.page-head h1 .sid { font-size: .55em; vertical-align: .25em; }

/* ---------- Popover (details) ---------- */
.popover { position: relative; }
.popover > summary { display: inline-flex; }
.popover-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 13rem; padding: var(--s1);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop);
}
.popover-menu > a, .popover-menu > button, .popover-menu > form > button {
  display: flex; align-items: center; gap: var(--s2); width: 100%; min-height: 40px; padding: 0 var(--s3); border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text); font-weight: 500; font-size: .92rem; justify-content: flex-start; text-align: left;
}
.popover-menu > a:hover, .popover-menu > button:hover, .popover-menu > form > button:hover { background: var(--surface-2); text-decoration: none; }
.popover-menu hr { border: 0; border-top: 1px solid var(--line); margin: var(--s1) 0; }
.popover-menu form:not(:has(> button:only-child)) { padding: var(--s2); display: grid; gap: var(--s2); }

/* ---------- Kartu & bagian ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); margin-bottom: var(--s4); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: var(--s2); }
.card-head h2 .icon { color: var(--muted); }
.card-head .count-chip, .count-chip { font-size: .75rem; font-weight: 650; color: var(--muted); background: var(--surface-2); border-radius: 99px; padding: 1px 8px; }
.card.flush { padding: 0; }
.card.flush > .card-head { padding: var(--s4) var(--s4) 0; }
.card.callout { border-left: 3px solid var(--waiting); background: var(--waiting-soft); box-shadow: none; display: flex; gap: var(--s3); align-items: flex-start; }
.card.callout .icon { color: var(--waiting); margin-top: 2px; }
.card.empty { text-align: center; padding: var(--s6) var(--s4); color: var(--muted); border-style: dashed; box-shadow: none; }
.empty-note { color: var(--muted); font-size: .9rem; padding: var(--s2) 0; margin: 0; }
details.section > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
details.section > summary h2 { margin: 0; display: flex; align-items: center; gap: var(--s2); }
details.section > summary > .icon { transition: transform .15s; color: var(--muted); }
details.section[open] > summary > .icon { transform: rotate(180deg); }
details.section[open] > summary { margin-bottom: var(--s3); }
.more-items > summary { color: var(--accent); font-size: .88rem; font-weight: 600; padding: var(--s2) 0; display: inline-flex; gap: var(--s1); align-items: center; }
.more-items[open] > summary { display: none; }
.row { display: flex; gap: var(--s2); align-items: center; }
.row.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: var(--s2); }
.grow { flex: 1; min-width: 0; }
.split { display: grid; gap: var(--s4); grid-template-columns: minmax(0, 1fr); }
.split > * { min-width: 0; }
@media (min-width: 1024px) { .split { grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; } .split > aside { position: sticky; top: var(--s5); } }
.form-actions { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s3); flex-wrap: wrap; }
.grid-2 { display: grid; gap: 0 var(--s3); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ---------- Badge & meta ---------- */
.sid { font: 600 .72rem var(--mono); color: var(--muted); margin-right: var(--s2); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.status { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 650; padding: 1px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.status.active, .status.doing { background: var(--doing-soft); color: var(--doing); }
.status.waiting, .status.on_hold, .status.draft { background: var(--waiting-soft); color: var(--waiting); }
.status.done, .status.completed { background: var(--done-soft); color: var(--done); }
.status.planning, .status.idea { background: var(--accent-soft); color: var(--accent); }
.status.danger { background: var(--danger-soft); color: var(--danger); }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted); }
.chip .icon { width: 14px; height: 14px; }
.chip.priority { color: var(--waiting); }
.chip.quick { color: var(--doing); }
.meta { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--s3); }
.meta a { color: var(--muted); }
.meta a:hover { color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(4.75rem, 1fr)); gap: var(--s2); max-width: 36rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s2) var(--s3); min-width: 0; }
.stat b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .76rem; color: var(--muted); }

/* ---------- Baris task ---------- */
.task { display: flex; gap: var(--s1); align-items: flex-start; padding: var(--s1) 0; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.task .check { flex: none; width: 40px; min-height: 40px; padding: 0; margin-left: -8px; border: 0; background: none; color: var(--muted); }
.task .check .icon { width: 21px; height: 21px; }
.task .check:hover { color: var(--accent); background: none; }
.task .body { flex: 1; min-width: 0; padding: 9px 0 6px; }
.task .title { color: var(--text); word-break: break-word; font-weight: 500; }
.task .title:hover { color: var(--accent); text-decoration: none; }
.task .meta { margin-top: 2px; }
.task.doing .check { color: var(--doing); }
.task.waiting .check, .task.waiting .why { color: var(--waiting); }
.task.done .title, .task.dropped .title { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.task.done .check { color: var(--done); }
.task .menu > summary { width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); border-radius: var(--radius-sm); }
.task .menu > summary:hover { background: var(--surface-2); color: var(--text); }
.task .popover-menu { width: 15rem; }
.task .aside { flex: none; align-self: center; }
.subtasks { margin-left: var(--s5); border-left: 1px solid var(--line); padding-left: var(--s2) !important; }
.dragging { opacity: .4; }
[draggable=true] { cursor: grab; }

/* ---------- Capture ---------- */
.capture-bar { display: flex; gap: var(--s2); padding: var(--s2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: var(--s5); }
.capture-bar textarea { border: 0; box-shadow: none !important; background: transparent; min-height: 44px; max-height: 40vh; resize: none; }
.capture-bar .icon-btn, .capture-bar kbd { align-self: flex-end; }
.capture-bar kbd { margin-bottom: .7rem; }
.capture-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inbox-card .inbox-title { font-weight: 650; color: var(--text); display: block; margin-bottom: var(--s1); word-break: break-word; }
.inbox-card .inbox-title:hover { color: var(--accent); text-decoration: none; }
.inbox-card .excerpt { position: relative; max-height: 9.5rem; overflow: hidden; color: var(--muted); font-size: .9rem; }
.inbox-card .excerpt.fade::after { content: ""; position: absolute; inset: auto 0 0; height: 2.5rem; background: linear-gradient(transparent, var(--surface)); }
.inbox-card .excerpt .prose { font-size: inherit; color: inherit; }
.inbox-card .card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); }
.triage { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.triage .popover-menu { width: min(22rem, calc(100vw - 2rem)); left: 0; right: auto; padding: var(--s3); }
.triage .popover-menu label:first-of-type { margin-top: 0; }
.capture-line { display: flex; gap: var(--s2); align-items: baseline; padding: var(--s2) 0; border-top: 1px solid var(--line); }
.capture-line:first-child { border-top: 0; }
.capture-line a { color: var(--text); font-weight: 500; }
.capture-line a:hover { color: var(--accent); }

/* ---------- Markdown (prose) ---------- */
.prose { max-width: var(--measure); line-height: 1.65; word-wrap: break-word; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table { margin: 0 0 .85em; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { color: var(--text); text-transform: none; letter-spacing: -.005em; line-height: 1.3; margin: 1.4em 0 .5em; scroll-margin-top: 70px; }
.prose h1 { font-size: 1.35rem; } .prose h2 { font-size: 1.15rem; font-weight: 700; } .prose h3 { font-size: 1.02rem; } .prose h4, .prose h5, .prose h6 { font-size: .95rem; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .2em 0; }
.prose li::marker { color: var(--muted); }
.prose li.task-item { list-style: none; margin-left: -1.4em; display: block; }
.prose li.task-item > input { margin: 0 .5em 0 0; vertical-align: -.2em; }
.prose li.task-item:has(> input:checked) { color: var(--muted); text-decoration: line-through; }
.prose blockquote { margin-left: 0; padding: .4em 1em; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); }
.prose code { font: .86em var(--mono); background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
.prose pre { background: var(--surface-2); padding: var(--s3); border-radius: var(--radius-sm); overflow-x: auto; }
.prose pre code { background: none; padding: 0; font-size: .84rem; }
.prose pre.frontmatter { font-size: .8rem; border: 1px dashed var(--line-strong); background: transparent; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: .9rem; max-width: 100%; }
.prose th, .prose td { border: 1px solid var(--line); padding: .4em .7em; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 650; }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 2px; }
.prose .wikilink { color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0 .3em; font-weight: 550; cursor: help; }
.prose .md-tag { font-size: .85em; color: var(--muted); background: var(--surface-2); border-radius: 99px; padding: .05em .5em; }
.prose.compact { line-height: 1.5; }
.prose.compact h1, .prose.compact h2, .prose.compact h3, .prose.compact h4 { font-size: 1em; margin: .6em 0 .2em; }
.md-empty { color: var(--muted); font-style: italic; }
.toc { font-size: .86rem; }
.toc ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.toc a { display: block; color: var(--muted); padding: 3px var(--s2); border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toc a:hover { color: var(--accent); background: var(--surface-2); text-decoration: none; }
.toc .l3 a { padding-left: var(--s5); } .toc .l4 a, .toc .l5 a, .toc .l6 a { padding-left: 2.25rem; }
.editor > summary { margin-top: var(--s3); }
.editor[open] > summary { display: none; }
.editor form { margin-top: var(--s3); }
.doc-meta { display: flex; flex-wrap: wrap; gap: var(--s3); font-size: .82rem; color: var(--muted); margin-bottom: var(--s4); }

/* ---------- Tabs, navigasi minggu, kalender ---------- */
.tabs { display: flex; gap: var(--s1); margin: 0 0 var(--s4); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: var(--s2) var(--s3); min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current] { color: var(--accent); border-color: var(--accent); }
.pager { display: inline-flex; align-items: center; gap: var(--s1); }
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: var(--s2); font-size: .85rem; }
.days > div { background: var(--surface-2); border-radius: var(--radius-sm); padding: var(--s2) var(--s3); }
.days > div.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.days strong { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: var(--s1); }
.slot { display: flex; gap: var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--line); font-size: .92rem; }
.slot:first-child { border-top: 0; }
.slot time, .slot .when { flex: none; width: 4.5rem; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s1); }
.cal .dow { text-align: center; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: var(--s1) 0; }
.cal a { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 64px; padding: var(--s2); border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); color: var(--text); font-variant-numeric: tabular-nums; font-weight: 550; }
.cal a:hover { border-color: var(--accent); text-decoration: none; }
.cal a.off { color: var(--muted); background: var(--surface-2); font-weight: 400; }
.cal a.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal a.has::after { content: ""; position: absolute; left: var(--s2); bottom: var(--s2); width: 18px; height: 4px; border-radius: 2px; background: var(--accent); }
.legend { display: flex; gap: var(--s4); font-size: .8rem; color: var(--muted); margin-top: var(--s3); align-items: center; }
.legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; background: var(--accent); margin-right: 6px; vertical-align: middle; }

/* ---------- Projects ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-bottom: var(--s4); }
.toolbar select { width: auto; min-width: 12rem; }
.board { display: grid; gap: var(--s4); }
@media (min-width: 900px) { .board { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); align-items: start; } }
.closed-board { margin-top: var(--s3); }
.inline-fields > select, .inline-fields > input { width: auto; flex: 1 1 10rem; }
.column { background: var(--surface-2); border-radius: var(--radius); padding: var(--s3); }
.column-head { display: flex; align-items: center; justify-content: space-between; margin: 0 var(--s1) var(--s3); }
.column-head h2 { margin: 0; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.project-card { display: block; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s3); margin-bottom: var(--s2); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.project-card:hover { border-color: var(--accent); text-decoration: none; }
.project-card strong { display: block; color: var(--text); font-weight: 600; line-height: 1.35; margin: 2px 0 var(--s2); }
.progress { appearance: none; width: 100%; height: 6px; border: 0; background: var(--surface-2); border-radius: 99px; overflow: hidden; min-width: 5rem; }
.progress::-webkit-progress-bar { background: var(--surface-2); }
.progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
.progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.milestone { display: grid; grid-template-columns: minmax(0, 1fr) 7rem; gap: var(--s1) var(--s3); align-items: center; padding: var(--s2) 0; border-top: 1px solid var(--line); }
.milestone:first-child { border-top: 0; }

/* ---------- Settings & list umum ---------- */
.list-row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; padding: var(--s2) 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.day-group + .day-group { margin-top: var(--s3); }
.day-group h3 { margin: 0 0 var(--s1); }
.settings-nav { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.search-hit { display: block; padding: var(--s3) 0; border-top: 1px solid var(--line); }
.search-hit:first-child { border-top: 0; }
.search-hit .snippet { font-size: .88rem; color: var(--muted); margin-top: 2px; }

/* ---------- Dialog, toast, offline ---------- */
dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); max-width: 36rem; width: calc(100% - 2rem); max-height: 85vh; background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); }
dialog::backdrop { background: rgb(15 23 42 / .5); }
.offline { background: var(--waiting); color: #fff; text-align: center; padding: var(--s1); font-size: .85rem; }
#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + var(--s3) + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: var(--s2); z-index: 40; pointer-events: none; padding: 0 var(--s3); }
@media (min-width: 1024px) { #toasts { bottom: var(--s5); left: var(--sidebar); } }
.toast { pointer-events: auto; background: var(--text); color: var(--bg); border-radius: var(--radius); padding: var(--s2) var(--s2) var(--s2) var(--s4); display: flex; gap: var(--s3); align-items: center; max-width: min(32rem, 100%); min-height: 44px; box-shadow: var(--shadow-pop); font-size: .92rem; }
.toast.error { background: var(--danger); color: #fff; }
.toast button { min-height: 32px; background: transparent; border-color: currentColor; color: inherit; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--s4); }
.auth .card { width: 100%; max-width: 22rem; padding: var(--s5); }
.auth h1 { margin-bottom: var(--s1); }
.auth .alert { color: var(--danger); background: var(--danger-soft); padding: var(--s2) var(--s3); border-radius: var(--radius-sm); font-size: .9rem; }
.auth button { width: 100%; margin-top: var(--s4); }
.banner { display: block; margin-bottom: var(--s4); padding: var(--s2) var(--s3); border-radius: var(--radius-sm); background: var(--waiting-soft); color: var(--waiting); font-size: .9rem; text-decoration: none; }

/* Utility (pengganti style="" agar CSP tanpa 'unsafe-inline') */
.m-0 { margin: 0; } .mt-0 { margin-top: 0; } .mt-2 { margin-top: var(--s2); } .mt-3 { margin-top: var(--s3); } .mt-4 { margin-top: var(--s4); }
.mb-2 { margin-bottom: var(--s2); } .mb-4 { margin-bottom: var(--s4); } .pt-xs { padding-top: 6px; }
.between { justify-content: space-between; } .items-start { align-items: flex-start; } .self-center { align-self: center; } .self-end { align-self: end; }
.text-body { color: var(--text); } .nolist { list-style: none; } .tnum { font-variant-numeric: tabular-nums; }
.minw-12 { min-width: 12rem; } .w-5 { width: 5rem; } .w-7 { width: 7rem; }
.divided { padding-top: var(--s3); border-top: 1px solid var(--line); }
.popover-form { width: min(20rem, calc(100vw - 2rem)); padding: var(--s3); }
.secret-line { user-select: all; margin: .35rem 0; }
.brand-inline { display: inline-grid; margin-right: 8px; vertical-align: middle; }

/* Request berjalan (app.js) */
html.busy::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 100; background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: busy-bar 1s linear infinite; }
html.busy { cursor: progress; }
@media (prefers-reduced-motion: reduce) { html.busy::before { animation: none; background: var(--accent); opacity: .6; } }
@keyframes busy-bar { from { background-position: -50% 0; } to { background-position: 150% 0; } }
button.htmx-request, button:disabled { opacity: .55; }
