/* Heirson app prototype: shared styles (tokens match docs/BRAND.md) */
:root {
  --ink: #10231A; --ink-2: #2A3B32; --ink-3: #1B3328; --ink-4: #2E4A3D;
  --signal: #12A150; --signal-deep: #0B7A3B; --lime: #C9F24B; --lime-soft: #EEF9CF;
  --grad: linear-gradient(135deg, #C9F24B 0%, #12A150 100%);
  --paper: #F7F7F2; --white: #FFFFFF; --line: #E3E5DE; --line-2: #CDD2CA; --muted: #56605A;
  --danger: #B42318; --danger-soft: #FDECEA; --warn-soft: #FFF6D6;
  --head: "Schibsted Grotesk", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  --shadow: 0 1px 0 rgba(16,35,26,.04), 0 24px 60px -30px rgba(16,35,26,.35);
  --ease: cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--signal-deep); }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; margin: 0; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ph { border-bottom: 1.5px dashed #B9A24A; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.proto { background: var(--ink); color: #C3CEC7; font-size: 12px; text-align: center; padding: 6px 12px; }
.proto b { color: var(--lime); font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: 600 15px/1 var(--body); text-decoration: none; padding: 14px 20px; border-radius: 11px; border: 1.5px solid transparent; cursor: pointer; transition: transform .15s, background .15s, border-color .15s, opacity .15s; background: none; color: var(--ink); }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--signal-deep); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #096733; }
.btn-ghost { border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-link { padding: 0; border: 0; color: var(--signal-deep); font-weight: 600; }
.btn-lime { background: var(--lime); color: var(--ink); }

/* Fields */
.field { margin-bottom: 18px; }
.field label, .field .lab { display: block; font: 600 14px/1.3 var(--body); margin-bottom: 8px; color: var(--ink-2); }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.input, select.input, textarea.input { width: 100%; font: 500 16px/1.3 var(--body); color: var(--ink); padding: 13px 14px; border: 1.5px solid var(--line-2); border-radius: 11px; background: var(--white); transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(201,242,75,.6); }
.input.err { border-color: var(--danger); }
.err-msg { color: var(--danger); font-size: 13px; margin-top: 6px; display: none; }
.field.has-err .err-msg { display: block; }
.field.has-err .input { border-color: var(--danger); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.select { position: relative; }
.select::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select select { appearance: none; padding-right: 40px; cursor: pointer; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 15px; }
.check input { appearance: none; width: 22px; height: 22px; border: 2px solid var(--ink); flex: none; margin: 1px 0 0; cursor: pointer; display: grid; place-items: center; background: #fff; }
.check input:checked { background: var(--grad); border-color: transparent; }
.check input:checked::after { content: ""; width: 10px; height: 6px; border-left: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: rotate(-45deg) translate(1px, -1px); }

.choice { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; font: inherit; color: var(--ink); background: var(--white); border: 1.5px solid var(--line); border-radius: 14px; padding: 16px 18px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.choice:hover { border-color: #AEB6AC; }
.choice[aria-checked="true"], .choice[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice .fi { width: 34px; height: 25px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); background-size: cover; flex: none; }
.choice b { display: block; font: 600 16px/1.25 var(--head); }
.choice small { color: var(--muted); font-size: 13px; }
.choice .tag { margin-left: auto; font: 600 12px/1 var(--body); padding: 5px 8px; border-radius: 6px; background: var(--lime-soft); color: var(--signal-deep); white-space: nowrap; }

.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.note::before { content: ""; width: 10px; height: 10px; background: var(--signal); flex: none; margin-top: 6px; }
.note.warn { background: var(--warn-soft); border-color: #F0DFA0; }
.note.warn::before { background: #C9A227; }

.status { display: inline-flex; align-items: center; gap: 8px; font: 600 12px/1 var(--body); padding: 6px 9px; border-radius: 6px; letter-spacing: .02em; }
.status::before { content: ""; width: 7px; height: 7px; background: currentColor; }
.status.ok { background: var(--lime-soft); color: var(--signal-deep); }
.status.run { background: #EAF2FF; color: #1D4E89; }
.status.run::before { animation: blink 1.2s steps(2) infinite; }
.status.wait { background: #F1F2EE; color: var(--muted); }
.status.ext { background: var(--warn-soft); color: #7A5D00; }
@keyframes blink { 50% { opacity: .2; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.dark { border-color: rgba(16,35,26,.15); border-top-color: var(--ink); }

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