/* HumCommerce brand palette
   Primary green   #003642
   Charcoal        #2E2E2E
   Accent yellow   #FAC608
   Off-white       #ECF4F9  (used instead of pure white)
   Theme is driven by [data-theme="light|dark"] on <html>, set by the toggle. */

:root, :root[data-theme="light"] {
  --bg: #ECF4F9;
  --surface: #ffffff;
  --surface-2: #f5f9fc;
  --ink: #003642;
  --ink-soft: #40626b;
  --ink-faint: #7d959c;
  --line: #d5e3ea;
  --line-strong: #b9cfd8;
  --accent: #003642;
  --accent-soft: #dceaf0;
  --highlight: #FAC608;
  --highlight-soft: #fdf3d0;
  --done: #003642;
  --done-soft: #d7ecdf;
  --danger: #a3402d;
  --danger-soft: #f6ece9;
  --logo: url('/assets/logo.png');
}

:root[data-theme="dark"] {
  --bg: #2E2E2E;
  --surface: #383838;
  --surface-2: #333333;
  --ink: #ECF4F9;
  --ink-soft: #b3c2c8;
  --ink-faint: #8a9599;
  --line: #454545;
  --line-strong: #565656;
  --accent: #6fb9ca;
  --accent-soft: #223b40;
  --highlight: #FAC608;
  --highlight-soft: #3b3618;
  --done: #7fc59a;
  --done-soft: #24352b;
  --danger: #e0917d;
  --danger-soft: #3a2620;
  --logo: url('/assets/logo-light.png');
}

* { box-sizing: border-box; }

html { color-scheme: light dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

.wrap { max-width: 760px; margin: 0 auto; padding: 40px 24px 80px; }

/* Header with logo + theme toggle */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo {
  width: 40px; height: 40px;
  background: var(--logo) center/contain no-repeat;
  flex-shrink: 0;
}
.brand .name {
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink);
  line-height: 1.2;
}
.brand .name small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-faint); letter-spacing: 0; }

.toggle {
  appearance: none; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-soft); width: 38px; height: 38px; border-radius: 9px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.toggle:hover { border-color: var(--highlight); color: var(--highlight); }
.toggle svg { width: 18px; height: 18px; }
.toggle .sun { display: none; }
:root[data-theme="dark"] .toggle .sun { display: block; }
:root[data-theme="dark"] .toggle .moon { display: none; }

.eyebrow {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 10px;
}
:root[data-theme="light"] .eyebrow {
  color: var(--ink); border-left: 3px solid var(--highlight); padding-left: 9px;
}
:root[data-theme="dark"] .eyebrow {
  color: var(--ink-soft); border-left: 3px solid var(--highlight); padding-left: 9px;
}

h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 8px; color: var(--ink); }
.lede { font-size: 15px; color: var(--ink-soft); margin: 0 0 28px; max-width: 60ch; }

.tabs { display: flex; gap: 6px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.tab {
  appearance: none; border: none; background: none;
  font-family: inherit; font-size: 14px; color: var(--ink-faint);
  padding: 10px 4px; margin-right: 18px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--ink); border-bottom-color: var(--highlight); font-weight: 600; }

.meta { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--ink-faint); margin: 0 0 8px; }
.progress { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--ink-soft); }

/* Progress bar */
.pbar { height: 4px; background: var(--line); border-radius: 4px; margin: 8px 0 20px; overflow: hidden; }
.pbar > span { display: block; height: 100%; background: var(--highlight); width: 0; transition: width 0.3s; }

.item { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: 10px; overflow: hidden; }
.item-head { display: flex; align-items: flex-start; gap: 14px; padding: 15px 16px; cursor: pointer; }
.check {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid var(--line-strong); background: transparent;
  display: flex; align-items: center; justify-content: center; margin-top: 1px; cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.check.on { border-color: var(--done); background: var(--done-soft); }
.check svg { width: 14px; height: 14px; display: none; color: var(--done); }
.check.on svg { display: block; }
.title { flex: 1; font-size: 15px; line-height: 1.45; color: var(--ink); }
.item.done .title { text-decoration: line-through; color: var(--ink-faint); }
.chev { flex-shrink: 0; width: 18px; height: 18px; color: var(--ink-faint); margin-top: 3px; transition: transform 0.15s; }
.item.open .chev { transform: rotate(180deg); }
.item-body { display: none; padding: 0 16px 16px 52px; font-size: 14px; color: var(--ink-soft); line-height: 1.6; }
.item.open .item-body { display: block; }

.foot {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; color: var(--ink-faint);
}
.foot a { color: var(--ink-faint); text-decoration: none; border-bottom: 1px dotted var(--line-strong); }
.foot a:hover { color: var(--accent); }

.btn {
  appearance: none; font-family: inherit; font-size: 14px; padding: 9px 16px;
  border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
:root[data-theme="light"] .btn.primary { color: #ECF4F9; }
.btn.ghost { border-color: var(--line); color: var(--ink-soft); }
.btn.danger { color: var(--danger); border-color: var(--line); }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); }

.notice { font-size: 13px; padding: 12px 14px; border-radius: 10px; margin-bottom: 20px; }
.notice.err { background: var(--danger-soft); color: var(--danger); }
.notice.ok { background: var(--done-soft); color: var(--done); }

input.field, textarea.field {
  width: 100%; font-family: inherit; font-size: 14px; padding: 9px 11px;
  border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); resize: vertical;
}
input.field:focus, textarea.field:focus { outline: 2px solid var(--highlight-soft); border-color: var(--highlight); }

.editor-item { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 14px; margin-bottom: 12px; }
.editor-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.editor-row .label { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--ink-faint); width: 70px; flex-shrink: 0; text-transform: uppercase; }
.editor-actions { display: flex; gap: 6px; margin-top: 4px; }
.icon-btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); width: 32px; height: 32px; border-radius: 7px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 15px; height: 15px; }

.spin { opacity: 0.5; pointer-events: none; }
