/* Heedar design system: security-print engraving on mint paper. Pine ink, gold foil, carmine for urgency.
   Shared by the site, dashboard and extension. */
:root {
  --paper: #f3f6f2;
  --paper-2: #e8eee7;
  --card: #fbfdfa;
  --ink: #0b2a22;
  --ink-2: #355248;
  --mute: #4f6b64;
  --hair: rgba(11, 42, 34, 0.12);
  --hair-2: rgba(11, 42, 34, 0.2);
  --pine: #0f4a3b;
  --pine-deep: #0a3329;
  --pine-tint: rgba(15, 74, 59, 0.08);
  --leaf: #2f7d68;
  --foil: #c8962e;
  --foil-light: #e6c06c;
  --foil-tint: rgba(200, 150, 46, 0.14);
  --carmine: #b3173c;
  --carmine-tint: rgba(179, 23, 60, 0.09);
  --trial: #3b4bd8;
  --trial-tint: rgba(59, 75, 216, 0.09);
  --ok: #1a6b42;

  --font-sans: 'Heedar Lira', 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Familjen Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --display-weight: 600;
  --r: 10px;
  --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(11, 42, 34, 0.06), 0 2px 8px -2px rgba(11, 42, 34, 0.08);
  --shadow: 0 1px 2px rgba(11, 42, 34, 0.05), 0 10px 30px -10px rgba(11, 42, 34, 0.22);
  --shadow-lg: 0 2px 4px rgba(11, 42, 34, 0.05), 0 28px 60px -20px rgba(11, 42, 34, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: var(--hair-2) transparent; scrollbar-width: thin; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.6 var(--font-sans); font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; caret-color: var(--pine);
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--hair-2); }
a:hover { text-decoration-color: currentColor; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--pine); color: var(--paper); }
:focus-visible { outline: 2px solid var(--trial); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.icon { flex: none; }

/* ---------- type ---------- */
.display { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: -0.035em; line-height: 1; text-wrap: balance; }
.display em, .h2 em { font-style: italic; font-weight: inherit; }
.display, .h2 { font-variant-numeric: lining-nums; }
.on-dark .chip-gold { background: rgba(230, 192, 108, 0.16); color: var(--foil-light); }
.h2 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: -0.03em; line-height: 1.05; font-size: clamp(32px, 4.4vw, 56px); text-wrap: balance; }
.h3 { font-weight: 650; letter-spacing: -0.012em; line-height: 1.25; font-size: 19px; }
.lede { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; color: var(--ink-2); max-width: 54ch; text-wrap: pretty; }
.num, .amount { font-variant-numeric: lining-nums; letter-spacing: -0.01em; }
.amount { font-weight: 600; }
.fine { font-size: 13.5px; color: var(--mute); line-height: 1.5; }
.accent { color: var(--carmine); }
.eyebrow { font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--mute); }

/* ---------- layout ---------- */
.wrap { width: min(1160px, 100% - 48px); margin-inline: auto; }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: var(--gap, 12px); }
.grow { flex: 1; }
hr, .perf { height: 0; border: 0; border-top: 1px solid var(--hair); margin: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 10px 20px; border-radius: var(--r);
  border: 1px solid var(--hair-2); background: var(--card); color: var(--ink);
  font-weight: 620; font-size: 15px; letter-spacing: -0.005em; line-height: 1; text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: transform .18s var(--ease), box-shadow .18s var(--ease), background-color .18s, border-color .18s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--ink-2); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn-primary { background: var(--pine); border-color: var(--pine); color: #f3f6f2; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), var(--shadow-sm); }
.btn-primary:hover { background: var(--pine-deep); border-color: var(--pine-deep); }
.btn-gold { background: var(--foil-light); border-color: var(--foil-light); color: var(--pine-deep); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 24px -10px rgba(230, 192, 108, 0.7); }
.btn-gold:hover { background: #efd089; border-color: #efd089; }
.btn-accent { background: var(--carmine); border-color: var(--carmine); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), var(--shadow-sm); }
.btn-accent:hover { background: #961233; border-color: #961233; }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--pine-tint); box-shadow: none; }
.btn-quiet { background: transparent; border-color: transparent; box-shadow: none; padding-inline: 12px; }
.btn-quiet:hover { background: var(--pine-tint); box-shadow: none; border-color: transparent; }
.btn-sm { min-height: 34px; padding: 6px 13px; font-size: 13.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-danger { color: var(--carmine); }
.btn-danger:hover { background: var(--carmine-tint); border-color: transparent; }
.on-dark .btn-ghost { color: #f3f6f2; border-color: rgba(243, 246, 242, 0.35); }
.on-dark .btn-ghost:hover { background: rgba(243, 246, 242, 0.1); border-color: rgba(243, 246, 242, 0.6); }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 650; letter-spacing: 0.01em; white-space: nowrap; border: 0;
  background: var(--pine-tint); color: var(--pine);
}
button.chip { cursor: pointer; padding: 6px 13px; font-size: 13px; border: 1px solid var(--hair); background: transparent; color: var(--ink-2); transition: background .15s, color .15s, border-color .15s; }
button.chip:hover { background: var(--pine-tint); }
button.chip[aria-pressed='true'] { background: var(--pine); color: #f3f6f2; border-color: var(--pine); }
button.chip[disabled] { opacity: 0.4; cursor: not-allowed; }
.chip-hot { background: var(--carmine-tint); color: var(--carmine); }
.chip-soon { background: var(--foil-tint); color: #7a5710; }
.chip-trial { background: var(--trial-tint); color: var(--trial); }
.chip-ok { background: var(--pine-tint); color: var(--pine); }
.chip-mute { background: rgba(11, 42, 34, 0.06); color: var(--mute); }
.chip-gold { background: var(--foil-tint); color: #7a5710; }
.chip-lime { background: var(--foil-tint); color: #7a5710; }

/* ---------- avatars (rosette) ---------- */
.av { display: inline-grid; flex: none; line-height: 0; }
.av svg { border-radius: 11px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 7px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 13px; background: #fff; border: 1px solid var(--hair-2); border-radius: var(--r);
  font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 92px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-2); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--pine); box-shadow: 0 0 0 3px rgba(15, 74, 59, 0.16); }
.input::placeholder { color: #9bb0a9; }
.input[aria-invalid='true'] { border-color: var(--carmine); }
.select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b2a22' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.hint { font-size: 13px; color: var(--mute); }
.error-text { font-size: 14px; color: var(--carmine); font-weight: 600; min-height: 1.3em; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: rgba(11, 42, 34, 0.18); transition: background .2s var(--ease); }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--pine); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--trial); outline-offset: 3px; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + span { opacity: 0.4; }

/* ---------- reminder intervals ---------- */
.iv-editor { display: grid; gap: 12px; }
.iv-list { display: grid; gap: 8px; }
.iv-row { display: grid; grid-template-columns: 84px minmax(0, 150px) auto 36px; gap: 8px; align-items: center; }
.iv-row .input, .iv-row .select { min-height: 42px; padding-block: 8px; }
.iv-suffix { color: var(--mute); font-size: 14px; }
.iv-del { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--mute); }
.iv-del:hover { background: var(--carmine-tint); color: var(--carmine); }
.iv-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.iv-note { font-size: 13px; color: var(--mute); }

/* ---------- surfaces ---------- */
.panel { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.panel-head h2 { font-weight: 650; font-size: 17px; letter-spacing: -0.01em; }
.panel-body { padding: 14px 22px 20px; }
.panel-body.flush { padding: 8px 0 0; }

.toasts { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 10px; max-width: min(380px, calc(100vw - 40px)); }
.toast { background: var(--ink); color: var(--paper); border-radius: 12px; padding: 13px 18px; font-weight: 560; font-size: 15px; box-shadow: var(--shadow-lg); animation: rise .3s var(--ease) both; }
.toast.is-error { background: var(--carmine); }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 32px); }
}
