/* Halcyon: a pretend invoicing app for testing Recklip suggestions.
   Kingfisher palette on cool mist. One loud thing: the invoice paper. Everything else stays quiet. */
:root {
  --mist: #eef2f1;
  --desk: #fbfcfc;
  --ink: #12302f;
  --ink-2: #4f6664;
  --ink-3: #8a9c9a;
  --line: #d9e2e0;
  --king: #0c6fb0;
  --king-soft: #e3eff8;
  --rust: #d4622a;
  --rust-soft: #fbeae0;
  --sea: #24846f;
  --sea-soft: #e0f1ec;
  --paper: #fffdf9;
  --ui: "Schibsted Grotesk", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--mist); color: var(--ink); font: 15px/1.5 var(--ui); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--king); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; margin: 0; }
h2 { font-size: 15px; font-weight: 600; margin: 0; }
.sub { color: var(--ink-2); margin: 4px 0 0; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; text-decoration: none; }
.logo svg { width: 24px; height: 24px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: #fff;
  font-weight: 600; font-size: 14px; white-space: nowrap; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .08s; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn:hover { border-color: #bccac8; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--king); border-color: var(--king); color: #fff; }
.btn.primary:hover { background: #0a5f97; }
.btn.ghost { border-color: transparent; background: none; color: var(--ink-2); }
.btn.wide { width: 100%; justify-content: center; height: 44px; font-size: 15px; }
.btn.busy { color: var(--ink-3); }
.btn.busy svg { animation: spin .9s linear infinite; }
.btn.shake { animation: shake .35s; border-color: var(--rust); }
@keyframes shake { 25%, 75% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- fields ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%234f6664' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; padding-right: 34px; }
input:focus, select:focus, textarea:focus { border-color: var(--king); box-shadow: 0 0 0 3px var(--king-soft); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
.pair { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--king); margin: 0; }
.err { color: var(--rust); font-size: 13px; margin: -6px 0 12px; }

/* ---------- sign in ---------- */
.screen { display: none; }
.screen.on { display: grid; }
.signin { min-height: 100vh; grid-template-columns: minmax(360px, 1fr) 1.1fr; }
.signin-form { padding: 40px clamp(24px, 6vw, 88px); display: flex; flex-direction: column; justify-content: center; max-width: 560px; }
.signin-form .logo { position: absolute; top: 32px; }
.signin-form h1 { font-size: 34px; }
.signin-form form { margin-top: 28px; }
.signin-form .field:has(+ .pw-wrap) { margin-bottom: 6px; }
.pw-wrap { position: relative; margin-bottom: 20px; }
.pw-wrap input { padding-right: 44px; }
.eye { position: absolute; right: 4px; top: 4px; width: 34px; height: 34px; border: 0; background: none; border-radius: 7px; cursor: pointer; display: grid; place-items: center; color: var(--ink-3); }
.eye svg { width: 18px; height: 18px; fill: currentColor; }
.eye:hover, .eye[aria-pressed=true] { color: var(--king); background: var(--king-soft); }
.fine { color: var(--ink-3); font-size: 13px; margin-top: 18px; }
.signin-art { background: var(--king); position: relative; overflow: hidden; display: grid; place-items: center; align-content: center; gap: 36px; padding: 40px; }
.signin-art::before { content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 80% 10%, rgba(255, 255, 255, .16), transparent 70%), radial-gradient(50% 60% at 10% 100%, rgba(0, 30, 60, .35), transparent 70%); }
.art-quote { position: relative; color: #e6f1fa; font-size: 19px; line-height: 1.4; max-width: 30ch; text-align: center; margin: 0; font-style: italic; font-weight: 500; }

/* ---------- paper (the one loud thing) ---------- */
.paper { position: relative; background: var(--paper); border-radius: 4px; padding: 28px 30px 24px; width: 100%; max-width: 380px;
  box-shadow: 0 1px 0 rgba(18, 48, 47, .04), 0 24px 48px -20px rgba(4, 30, 50, .45); font-size: 13px; }
.paper.tilt { transform: rotate(-3deg); }
.p-top { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.p-top b { font-size: 15px; }
.p-top span { color: var(--ink-2); }
.p-meta { display: flex; justify-content: space-between; }
.p-to { margin: 16px 0 18px; color: var(--ink-2); font-size: 12px; }
.p-to b { color: var(--ink); font-size: 14px; }
.p-to.right { text-align: right; }
.p-line { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.p-line span:first-child { overflow-wrap: anywhere; }
.p-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; }
.p-total b { font-size: 26px; letter-spacing: -.02em; }
.p-notes { color: var(--ink-2); white-space: pre-wrap; min-height: 0; margin: 14px 0 0; font-size: 12.5px; }
.p-notes:empty { display: none; }
.p-foot { color: var(--ink-3); font-size: 11.5px; margin: 18px 0 0; }
.stamp { position: absolute; left: 50%; top: 46%; margin: -22px 0 0 -52px; mix-blend-mode: multiply; padding: 4px 14px; border: 3px solid var(--sea); color: var(--sea); border-radius: 8px; font-weight: 800; font-size: 22px;
  letter-spacing: .04em; transform: rotate(-12deg) scale(1.8); opacity: 0; pointer-events: none; }
.stamp.on { opacity: .9; transform: rotate(-12deg) scale(1); }
.stamp.thud { animation: thud .45s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes thud { from { opacity: 0; transform: rotate(-12deg) scale(1.8); } to { opacity: .9; transform: rotate(-12deg) scale(1); } }
.signin-art .stamp { color: var(--sea); border-color: var(--sea); }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { padding: 22px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
.side .logo { padding: 0 10px 22px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.nav svg { width: 18px; height: 18px; fill: currentColor; opacity: .8; }
.nav:hover { background: rgba(18, 48, 47, .05); color: var(--ink); }
.nav.on { background: #fff; color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.nav.on svg { color: var(--king); opacity: 1; }
.side-foot { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 10px; font-size: 13px; color: var(--ink-2); line-height: 1.3; }
.side-foot b { color: var(--ink); font-weight: 600; }
.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.teal { background: var(--sea); }

.desk { margin: 10px 10px 10px 0; background: var(--desk); border-radius: 14px; box-shadow: 0 0 0 1px var(--line); padding: 36px clamp(20px, 4vw, 52px) 60px; min-width: 0; }
.view { display: none; max-width: 1040px; }
.view.on { display: block; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 30px; }

/* loading */
.loading { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--ink-2); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--king-soft); border-top-color: var(--king); animation: spin .8s linear infinite; }

/* ---------- overview ---------- */
.owed { display: grid; grid-template-columns: auto 1fr; gap: 48px; align-items: end; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.owed-figure p { margin: 0; color: var(--ink-2); }
.money { display: block; font-size: 60px; line-height: 1; letter-spacing: -.035em; font-weight: 700; margin: 10px 0 12px; }
.money small { font-size: 28px; color: var(--ink-3); letter-spacing: 0; }
.owed-meta { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot.rust { background: var(--rust); }
.dot.sea { background: var(--sea); }
.dot.king { background: var(--king); }
.months { margin: 0; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.bars span { flex: 1; background: var(--king-soft); border-radius: 4px 4px 1px 1px; position: relative; transform-origin: bottom; animation: grow .7s cubic-bezier(.2, .8, .2, 1) backwards; }
.bars span.now { background: var(--king); }
.bars span em { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-style: normal; font-size: 11px; color: var(--ink-3); }
@keyframes grow { from { transform: scaleY(0); } }
.months figcaption { margin-top: 28px; font-size: 12px; color: var(--ink-3); }

.split { display: grid; grid-template-columns: 1.55fr 1fr; gap: 40px; padding-top: 28px; }
.inbox-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--mist); border-radius: 9px; }
.tabs button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.tabs button[aria-selected=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(18, 48, 47, .12); }
.tabs.under { background: none; padding: 0; gap: 22px; border-bottom: 1px solid var(--line); border-radius: 0; display: flex; margin-bottom: 26px; }
.tabs.under button { padding: 10px 0; border-radius: 0; box-shadow: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs.under button[aria-selected=true] { border-color: var(--king); color: var(--ink); }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows .who b { font-weight: 600; display: block; }
.rows .who span { color: var(--ink-3); font-size: 13px; }
.rows .amt { font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 2px 9px 2px 8px; border-radius: 99px; background: var(--mist); color: var(--ink-2); white-space: nowrap; }
.pill.overdue { background: var(--rust-soft); color: #a8461a; }
.pill.paid { background: var(--sea-soft); color: #1a6b59; }
.pill.sent { background: var(--king-soft); color: #0a5a90; }
.pill .dot { width: 6px; height: 6px; }
.pill.overdue .dot { background: var(--rust); }
.pill.paid .dot { background: var(--sea); }
.pill.sent .dot { background: var(--king); }

.note { border-left: 1px solid var(--line); padding-left: 32px; }
.note-from { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; margin: 12px 0 16px; }
.player { display: flex; align-items: center; gap: 14px; }
.play { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: var(--ink); color: #fff; cursor: pointer; display: grid; place-items: center; }
.play svg { width: 18px; height: 18px; fill: currentColor; }
.play .i-pause, .play.on .i-play { display: none; }
.play.on .i-pause { display: block; }
.wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 40px; }
.wave i { flex: 1; background: var(--line); border-radius: 2px; transition: background .1s; }
.wave i.done { background: var(--king); }
.transcript { margin: 18px 0 0; font-size: 14px; color: var(--ink-2); line-height: 1.55; }

/* ---------- invoices ---------- */
.toolbar { display: flex; gap: 20px; margin-bottom: 8px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--line); }
.table .num { text-align: right; }
.table td.num { font-weight: 600; }
.table td.id { color: var(--ink-2); }
.table tr.fresh td { animation: fresh 2.4s ease-out; }
@keyframes fresh { from { background: var(--king-soft); } }
.more { width: 30px; height: 30px; border: 0; background: none; border-radius: 7px; cursor: pointer; color: var(--ink-2); display: grid; place-items: center; }
.more:hover, .more[aria-expanded=true] { background: var(--mist); color: var(--ink); }
.more svg { width: 16px; height: 16px; fill: currentColor; }
.menu { position: fixed; z-index: 20; background: #fff; border-radius: 10px; padding: 5px; min-width: 170px; box-shadow: 0 0 0 1px var(--line), 0 12px 30px -10px rgba(18, 48, 47, .35);
  animation: pop .14s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: var(--mist); outline: none; }

/* ---------- new invoice ---------- */
.back { color: var(--ink-2); font-size: 13px; text-decoration: none; display: inline-block; margin-bottom: 6px; }
.back::before { content: "‹ "; }
.compose { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 48px; align-items: start; }
.compose-form .check { margin: 0 0 18px; }
.paper.live { position: sticky; top: 24px; max-width: none; box-shadow: 0 0 0 1px var(--line), 0 18px 40px -24px rgba(18, 48, 47, .35); transition: transform .3s; }
.paper.live .p-line span:last-child, .paper.live .p-total b { transition: color .3s; }
.paper.live.sent { transform: translateY(-4px); }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.switch-row span { font-weight: 600; font-size: 14px; }
.switch-row small { display: block; font-weight: 400; color: var(--ink-3); font-size: 13px; }
.switch { width: 40px; height: 24px; border-radius: 99px; border: 0; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch[aria-checked=true] { background: var(--king); }
.switch[aria-checked=true] i { transform: translateX(16px); }
.actions { display: flex; gap: 8px; }

/* ---------- settings ---------- */
.set-lede { color: var(--ink-2); margin: 0 0 22px; max-width: 60ch; }
.narrow { max-width: 520px; }
.pair.even { grid-template-columns: 1fr 1fr; }
#payout-form .pair { grid-template-columns: 1fr 1fr; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 12px 20px; margin: 0; max-width: 520px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s; display: flex; align-items: center; gap: 10px; z-index: 30; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast .dot { background: #6fd3b8; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .signin { grid-template-columns: 1fr; }
  .signin-art { display: none; }
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; }
  .side .logo { padding: 0 12px 0 0; }
  .side-foot { display: none; }
  .desk { margin: 0 8px 8px; padding: 24px 16px 48px; }
  .owed, .split, .compose { grid-template-columns: 1fr; }
  .note { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 24px; }
  .money { font-size: 46px; }
  .table th:nth-child(3), .table td:nth-child(3) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
