:root {
  --teal: #0D5747;
  --ink: #10231E;
  --night: #16181D;
  --silver: #C5CED3;
  --gold: #C4A15A;
  --paper: #F4F2EC;
  --line: #E2DFD6;
  --muted: #5F6B6E;
  --good: #1B3A4B;
  --bad: #B3261E;
  --warn: #9A6B00;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: "Schibsted Grotesk", system-ui, sans-serif; color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.5; }
a { color: var(--ink); }
h1 { font-size: 26px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.right { text-align: right; }
.credit { color: var(--good); }
.debit { color: var(--ink); }

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--menu, var(--night)); color: var(--menu-text, #fff); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
:root { --logo-tile: var(--action, #0D5747); }
.brand-mark { display: block; flex: none; }
.logo { display: inline-flex; align-items: center; gap: 12px; }
.logo-word { display: flex; flex-direction: column; line-height: 1; }
.logo-name { font-size: 21px; font-weight: 700; letter-spacing: -.025em; }
.logo-tag { margin-top: 5px; font-size: 9.5px; font-weight: 700; letter-spacing: .34em; color: var(--muted); }
.lockup { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
a.lockup { color: inherit; text-decoration: none; }
.lockup-text { display: flex; flex-direction: column; min-width: 0; }
.lockup-name { font-weight: 700; line-height: 1.15; }
.lockup-tag { font-size: 12px; line-height: 1.3; color: var(--muted); margin-top: 2px; }
.side .lockup { margin-bottom: 18px; }
.side .lockup-tag, .side .who, .nav-group { color: var(--menu-muted, #C5CED3); }
.mark { width: 36px; height: 36px; border-radius: 10px; background: var(--gold); display: grid; place-items: center; color: var(--ink); font-weight: 800; flex: none; }
.ico { width: 18px; height: 18px; flex: none; }
.nav-label { display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--menu-text, #fff); cursor: pointer; }
.menu-toggle .ico:last-child { display: none; }
.side.open .menu-toggle .ico:first-child { display: none; }
.side.open .menu-toggle .ico:last-child { display: block; }
.nav-group { margin: 14px 12px 4px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.side nav a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 8px; color: var(--menu-text, #F4F2EC); text-decoration: none; font-size: 14px; transition: background .15s ease; }
.side nav a:hover { background: var(--menu-on, rgba(255,255,255,.06)); }
.side nav a.on { background: var(--menu-on, rgba(255,255,255,.08)); color: var(--menu-text, #fff); box-shadow: inset 3px 0 0 var(--gold); }
.badge { background: var(--gold); color: var(--ink); border-radius: 10px; padding: 0 7px; font-size: 12px; font-weight: 700; }
.side form { margin-top: 18px; }
.side .who { font-size: 13px; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.banner { background: var(--gold); color: var(--ink); padding: 10px 16px; font-size: 14px; font-weight: 600; text-align: center; }
.bank-details .detail { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bank-details .detail:last-child { border-bottom: 0; }
.bank-details .detail > span { color: var(--muted); font-size: 13px; flex: none; }
.detail-value { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.detail-value strong { font-weight: 600; }
.btn.sm { min-height: 0; padding: 6px 12px; }

.main { padding: 28px 32px; max-width: 1200px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.card.hero { background: var(--action, var(--night)); color: var(--action-text, #fff); border-color: var(--action, var(--night)); }
.card.hero .muted { color: var(--silver); }
.stat .num { font-size: 26px; font-weight: 700; }
.big { font-size: 34px; font-weight: 700; letter-spacing: -.5px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

.chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; background: #EEF1F2; color: var(--muted); white-space: nowrap; }
.chip.completed, .chip.active, .chip.answered { background: #E7E4DC; color: var(--ink); }
.chip.pending, .chip.open, .chip.on_hold, .chip.shipped { background: #FBF0D9; color: var(--warn); }
.chip.declined, .chip.reversed, .chip.locked, .chip.closed, .chip.lost, .chip.frozen { background: #FBE4E2; color: var(--bad); }

form.stack { display: grid; gap: 12px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
input, select, textarea { width: 100%; padding: 9px 10px; border: 1px solid #CFCBC0; border-radius: 6px; font: inherit; background: #fff; }
textarea { min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input, .inline select { width: auto; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; border: 0; background: var(--action, var(--night)); color: var(--action-text, #fff); padding: 10px 16px; border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .15s ease, background .15s ease; min-height: 42px; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn.gold { background: var(--gold); color: var(--ink); }
.btn.bad { background: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.side .btn { width: auto; background: transparent; border: 1px solid var(--menu-muted, rgba(255,255,255,.25)); color: var(--menu-text, #fff); margin-top: 10px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; background: #F7F4EC; color: var(--ink); border: 1px solid #E4D7B8; }
.errors { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; background: #FBE4E2; color: var(--bad); border: 1px solid #F2C3BF; }
.errors ul { margin: 0; padding-left: 18px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 5px 12px; border-radius: 16px; text-decoration: none; border: 1px solid var(--line); background: #fff; font-size: 13px; }
.tabs a.on { background: var(--action, var(--night)); color: var(--action-text, #fff); border-color: var(--action, var(--night)); }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
details summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.bubble { max-width: 78%; padding: 12px 14px; border-radius: 12px; background: #F7F6F2; }
.bubble.mine { margin-left: auto; background: var(--action, var(--night)); color: var(--action-text, #fff); }
.bubble.mine .who { color: var(--silver); }
.bubble .who { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.bubble p { margin: 0; white-space: pre-line; }
.unread { font-weight: 700; }
nav.pager { margin-top: 12px; }
nav.pager svg { width: 16px; }

.guest { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.guest .card { width: 100%; max-width: 440px; }
.guest .card.wide { max-width: 640px; }

.entry { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); min-height: 100vh; }
.entry-form { display: flex; flex-direction: column; padding: 28px 56px 24px; background: var(--paper); }
.entry-card { width: min(440px, 100%); margin: auto 0; padding: 40px 0; }
.entry-card.wide { width: min(620px, 100%); }
.entry-card h1 { font-size: 40px; font-weight: 500; letter-spacing: -.025em; line-height: 1.05; margin: 0 0 10px; }
.entry-card > p.muted { margin: 0 0 24px; }
.entry-card form.stack { gap: 14px; }
.entry-card input:not([type=checkbox]), .entry-card select { min-height: 48px; padding: 10px 14px; border-radius: 12px; border-color: #D9D6CE; }
.entry-card form.stack > .btn { min-height: 50px; border-radius: 999px; margin-top: 4px; }
.entry-foot { margin: 0; }
.entry-photo { position: sticky; top: 0; height: 100vh; background: var(--menu, var(--night)) center 30% / cover no-repeat; }
.entry-photo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--paper) 0%, rgba(244,242,236,.3) 12%, rgba(244,242,236,0) 34%); }
.entry-chip { position: absolute; left: 32px; bottom: 36px; right: 32px; max-width: 380px; display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.95); border: 1px solid rgba(226,224,216,.9); border-radius: 16px; padding: 14px 16px; box-shadow: 0 16px 36px -20px rgba(7,34,39,.5); }
.entry-chip b { display: block; font-size: 14px; }
.entry-chip small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.entry-chip-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: #F6F0E2; color: #8C7344; flex: none; }
.pin-input { letter-spacing: 10px; font-size: 22px; text-align: center; }
.photo-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 0; overflow: hidden; }
.photo-card .photo-copy { padding: 22px 24px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; }
.photo-card .photo-copy p { margin: 0 0 8px; }
.photo-card .photo-img { min-height: 190px; background: center 35% / cover no-repeat; }

@media (prefers-reduced-motion: no-preference) {
  .main { animation: rise .35s ease; }
  .side.open .side-panel { animation: drawer .2s ease; }
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes drawer { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.sk { display: block; height: 12px; border-radius: 8px; background: linear-gradient(90deg, #E6ECE9 0%, #F4F7F5 45%, #E6ECE9 90%) 0 0 / 220% 100%; animation: sk-shine 1.4s ease-in-out infinite; }
.sk-inline { display: inline-block; vertical-align: middle; height: 14px; }
.sk-text { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
button.is-busy, .btn.is-busy { position: relative; pointer-events: none; opacity: .78; }
button.is-busy::after, .btn.is-busy::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .28) 50%, transparent 100%) 0 0 / 220% 100%; animation: sk-shine 1.1s linear infinite; }
@keyframes sk-shine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) {
  .sk, button.is-busy::after, .btn.is-busy::after { animation: none; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .main { min-width: 0; }
  .side { position: sticky; top: 0; z-index: 30; height: auto; padding: 0; }
  .side-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; min-height: 56px; padding-top: max(8px, env(safe-area-inset-top)); }
  .side-bar .lockup { margin: 0; min-width: 0; }
  .side-bar .lockup-name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-bar .lockup-tag { font-size: 11px; }
  .side-panel { display: none; }
  .side.open .side-panel { display: flex; flex-direction: column; position: fixed; left: 0; right: 0; top: calc(56px + env(safe-area-inset-top)); bottom: 0; overflow: auto; background: var(--menu, var(--night)); padding: 8px 12px calc(24px + env(safe-area-inset-bottom)); }
  .menu-toggle { display: inline-flex; flex: none; }
  body { overflow-x: hidden; }
  .main { padding: 16px 16px calc(28px + env(safe-area-inset-bottom)); max-width: 100%; }
  .bank-details .detail { flex-direction: column; align-items: flex-start; gap: 4px; }
  .detail-value { width: 100%; justify-content: space-between; }
  .detail-value strong { overflow-wrap: anywhere; }
  .head { flex-direction: column; align-items: stretch; gap: 14px; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .actions .btn:first-child { grid-column: 1 / -1; }
  .g2, .g3, .g4, .row, .kv { grid-template-columns: minmax(0, 1fr); }
  .actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  h1 { font-size: 22px; }
  .big { font-size: 30px; }
  .card { padding: 16px; border-radius: 14px; }
  input, select, textarea { font-size: 16px; padding: 12px 14px; border-radius: 12px; }
  .side nav a { padding: 13px 12px; border-radius: 12px; }
  .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 520px; }
  .bubble { max-width: 90%; }
  .entry { grid-template-columns: minmax(0, 1fr); }
  .entry-photo { position: relative; height: 190px; order: -1; }
  .entry-photo::before { background: linear-gradient(0deg, var(--paper) 0%, rgba(244,242,236,0) 60%); }
  .entry-chip { display: none; }
  .entry-form { padding: 0 18px calc(24px + env(safe-area-inset-bottom)); margin-top: -28px; position: relative; background: transparent; }
  .entry-card { padding: 22px 0 28px; }
  .entry-card h1 { font-size: 30px; }
  .card.photo-card { grid-template-columns: minmax(0, 1fr); padding: 0; }
  .photo-card .photo-img { order: -1; min-height: 160px; }
  .photo-card .photo-copy { padding: 18px 16px 20px; }
  .guest { min-height: 100vh; padding: 24px 16px 36px; place-items: start center; }
  .guest .card { border-radius: 18px; padding: 22px 18px; }
  .guest .lockup { margin-bottom: 20px; }
  form.stack .btn { width: 100%; }
  .inline { align-items: stretch; }
  .inline > input, .inline > select { flex: 1 1 100%; width: auto; min-width: 0; }
  .check input { flex: none; width: auto; }
}
.dl-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink) !important; text-decoration: none !important; transition: border-color .15s ease, color .15s ease; }
.dl-btn:hover, .dl-btn:focus-visible { border-color: currentColor; color: var(--brand, #0D5747) !important; }
.dl-btn .ico { width: 16px; height: 16px; }
.dl-wide { display: inline-flex; align-items: center; gap: 8px; text-decoration: none !important; }
.tx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 18px; }
.tx-table td.tx-dl { width: 1%; padding-left: 4px; }
.intl-sub { margin: 10px 0 -2px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 600; }
.intl-fee { display: grid; gap: 8px; padding: 14px 16px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); }
.intl-fee > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.intl-fee > div + div { padding-top: 8px; border-top: 1px solid var(--line); }
.intl-fee strong { text-align: right; }
.tool-note.ok { color: #0D5747; }
.tool-note.bad { color: #A3341F; }
@media (max-width: 640px) {
  table.tx-table { min-width: 0; display: block; }
  .tx-table thead { display: none; }
  .tx-table tbody { display: block; }
  .tx-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .tx-table tr:last-child { border-bottom: 0; }
  .tx-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .tx-table td:nth-child(1) { grid-area: 2 / 1; font-size: 12.5px; color: var(--muted); }
  .tx-table td:nth-child(1) br { display: none; }
  .tx-table td:nth-child(1) .muted::before { content: " · "; }
  .tx-table td:nth-child(2) { grid-area: 1 / 1; overflow-wrap: anywhere; }
  .tx-table td:nth-child(2) br, .tx-table td:nth-child(2) .small, .tx-table td:nth-child(3) { display: none; }
  .tx-table td:nth-child(4) { grid-area: 2 / 2; justify-self: end; }
  .tx-table td:nth-child(5) { grid-area: 1 / 2; text-align: right; font-weight: 600; white-space: nowrap; }
  .tx-table td.tx-dl { grid-column: 3; grid-row: 1 / span 2; width: auto; padding: 0; }
  .tx-actions .btn { width: 100%; justify-content: center; }
}
