/* Approver inbox. Look after the Valio Aimo webshop (colour grading, type feel, line icons), no logo or images.
   Square corners everywhere; heavy condensed uppercase on buttons; a clean grotesk for reading. */

:root {
  --petrol: #005670;
  --petrol-press: #00435A;
  --petrol-ink-2: #CFE2E8;
  --text: #23282D;
  --text-2: #555759;
  --lime: #C0E021;
  --lime-light: #ECF5C5;
  --tint: #F2F6F8;
  --tint-2: #F5F1F9;
  --white: #FFFFFF;
  --line: #D4DDE2;
  --line-strong: #9FB3BC;
  --stop: #A4271C;
  --stop-tint: #FBECEA;
  --f-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --f-text: 'Figtree', system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --col: 760px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--white);
  color: var(--text);
  font: 400 16px/1.5 var(--f-text);
  font-variant-numeric: tabular-nums;
  caret-color: var(--petrol);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--lime); color: var(--petrol); }
h1, h2, h3, h4, h5, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--petrol); text-underline-offset: 3px; text-decoration-thickness: 1px; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code, .mono { font-family: var(--f-mono); font-size: 0.88em; }
:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* ------------------------------------------------------------------ header */
.top { background: var(--petrol); color: var(--white); }
.top :focus-visible { outline-color: var(--white); }
.top-in, .sub-in, .page, .foot p { width: 100%; max-width: calc(var(--col) + 32px); margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.top-in { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.brand-name { font: 800 23px/1 var(--f-display); letter-spacing: 0.01em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-tag {
  flex: none; padding: 4px 6px 3px; background: var(--lime); color: var(--petrol);
  font: 700 12px/1 var(--f-display); letter-spacing: 0.08em; text-transform: uppercase;
}
.live { display: flex; align-items: center; gap: 7px; flex: none; font: 700 13px/1 var(--f-display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--petrol-ink-2); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; }
.live[data-state='on'] { color: var(--white); }
.live[data-state='on'] .live-dot { background: var(--lime); box-shadow: none; }
.live[data-state='retry'] .live-dot { background: #F4A99F; box-shadow: none; }

.sub { background: var(--tint); border-bottom: 1px solid var(--line); }
.sub-in { display: flex; justify-content: space-between; gap: 12px; min-height: 44px; align-items: center; }
.sub a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14.5px; text-decoration: none; padding: 10px 0; }
.sub a .ic { width: 17px; height: 17px; stroke-width: 1.8; transition: transform 200ms var(--ease-out); }
.sub a:hover { text-decoration: underline; }
@media (hover: hover) and (pointer: fine) {
  .sub a:first-child:hover .ic { transform: translateX(-3px); }
  .sub a:last-child:hover .ic { transform: translateX(3px); }
}

/* ------------------------------------------------------------------ page */
.page { flex: 1 0 auto; padding-top: 28px; padding-bottom: 48px; }
.head { margin-bottom: 20px; }
.head h1 { font: 800 clamp(32px, 6vw, 42px)/1 var(--f-display); letter-spacing: 0.002em; color: var(--text); text-wrap: balance; }
.head-sub { margin-top: 10px; color: var(--text-2); max-width: 62ch; text-wrap: pretty; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0;
  font: 800 18px/1 var(--f-display); letter-spacing: 0.06em; text-transform: uppercase;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 120ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn .ic { width: 20px; height: 20px; stroke-width: 2; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { cursor: default; opacity: 0.55; }
.btn-cta { background: var(--lime); color: var(--petrol); }
.btn-primary { background: var(--petrol); color: var(--white); }
.btn-outline { background: var(--white); color: var(--petrol); box-shadow: inset 0 0 0 2px var(--petrol); }
@media (hover: hover) and (pointer: fine) {
  .btn-cta:hover:not(:disabled) { box-shadow: inset 0 0 0 2px var(--petrol); }
  .btn-primary:hover:not(:disabled) { background: var(--petrol-press); }
  .btn-outline:hover:not(:disabled) { background: var(--tint); }
}
.btn[data-busy] { pointer-events: none; }
.btn-link { background: none; border: 0; padding: 6px 0; color: var(--petrol); font-weight: 600; font-size: 14.5px; text-decoration: underline; text-underline-offset: 3px; }
.text-link { font-weight: 600; }

/* messages */
.msg { padding: 10px 12px; font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; }
.msg--error { background: var(--stop-tint); color: var(--stop); box-shadow: inset 0 0 0 1px #E9B8B2; }
.msg--block { margin-bottom: 20px; }
.msg--ok { background: var(--lime-light); color: var(--petrol); box-shadow: inset 0 0 0 1px #D3E39A; font-weight: 600; }
.msg strong { font-weight: 700; }

/* ------------------------------------------------------------------ key box */
.keybox { margin-bottom: 24px; }
.key-form { background: var(--tint); padding: 18px 16px 16px; border: 1px solid var(--line); }
.key-label { display: flex; align-items: center; gap: 8px; font: 800 17px/1 var(--f-display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--petrol); margin-bottom: 10px; }
.key-row { display: flex; gap: 8px; }
.key-row input {
  flex: 1 1 auto; min-width: 0; height: 48px; padding: 0 12px;
  background: var(--white); border: 1px solid var(--line-strong);
  font-size: 16px;
}
.key-row input::placeholder { color: #6B6E70; }
.key-row input:focus-visible { outline-offset: -2px; border-color: var(--petrol); }
.key-help { margin-top: 10px; font-size: 14px; color: var(--text-2); }
.key-help code { color: var(--text); background: var(--white); padding: 1px 4px; box-shadow: inset 0 0 0 1px var(--line); }
.key-form .msg { margin-top: 10px; }
.key-set { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px 8px 14px; background: var(--tint); border: 1px solid var(--line); }
.key-set-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; color: var(--text); }
.key-set-label .ic { color: var(--petrol); width: 18px; height: 18px; }
.key-dots { color: var(--text-2); letter-spacing: 0.08em; }

/* ------------------------------------------------------------------ approval card */
.list { display: grid; gap: 20px; }
.card {
  background: var(--white); border: 1px solid var(--line);
  border-top: 4px solid var(--petrol);
  transition: opacity 240ms ease, transform 240ms var(--ease-out);
}
.card.is-leaving { opacity: 0; transform: translateY(-6px); }
.card.is-new { animation: arrive 420ms var(--ease-out) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } }
.card-in { padding: 16px 16px 18px; }
.card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 7px 3px; font: 700 13px/1 var(--f-display); letter-spacing: 0.07em; text-transform: uppercase;
}
.badge .ic { width: 14px; height: 14px; stroke-width: 2; }
.badge--wait { background: var(--lime-light); color: var(--petrol); }
.badge--ok { background: var(--lime-light); color: var(--petrol); }
.badge--stop { background: var(--stop-tint); color: var(--stop); }
.badge--quiet { background: var(--tint); color: var(--text-2); }
.hold { display: inline-flex; align-items: flex-start; gap: 6px; font-size: 14px; line-height: 1.35; color: var(--text-2); }
.hold .ic { width: 17px; height: 17px; margin-top: 1px; color: var(--petrol); }
.hold strong { color: var(--text); font-weight: 600; }
.hold[data-urgent] strong { color: var(--stop); }
.card-id { margin-left: auto; font: 400 12.5px/1 var(--f-mono); color: var(--text-2); }

.what { display: grid; gap: 10px; }
.what-line h3 { font: 700 19px/1.3 var(--f-text); letter-spacing: -0.005em; text-wrap: pretty; }
.what-line h3 .qty { color: var(--petrol); white-space: nowrap; }
.what-sub { margin-top: 3px; font-size: 14px; color: var(--text-2); }
.what-sub .mono { color: var(--text); }

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fact { padding: 11px 12px 12px 0; min-width: 0; }
.fact + .fact { padding-left: 12px; border-left: 1px solid var(--line); }
.fact dt { display: flex; align-items: center; gap: 5px; font: 700 13px/1.1 var(--f-display); letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-2); }
.fact dt .ic { width: 15px; height: 15px; color: var(--petrol); }
.fact dd { margin: 5px 0 0; font-weight: 600; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.fact dd small { display: block; font-weight: 400; font-size: 13px; color: var(--text-2); }
.fact--total dd { font: 800 27px/1 var(--f-display); letter-spacing: 0.005em; color: var(--text); }

.why { margin-top: 16px; padding: 12px 14px 13px; background: var(--tint-2); }
.why h4, .adv-h { display: flex; align-items: center; gap: 7px; margin: 0; font: 800 16px/1.1 var(--f-display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); }
.why h4 .ic { width: 18px; height: 18px; color: var(--petrol); }
.why ul { margin-top: 8px; display: grid; gap: 6px; }
.why li { font-weight: 600; font-size: 15px; line-height: 1.45; padding-left: 25px; position: relative; text-wrap: pretty; }
.why li::before { content: ''; position: absolute; left: 6px; top: 0.62em; width: 7px; height: 7px; background: var(--petrol); }
.checks { margin-top: 10px; }
.checks summary { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--petrol); list-style: none; }
.checks summary::-webkit-details-marker { display: none; }
.checks summary .ic { width: 16px; height: 16px; transition: transform 200ms var(--ease-out); }
.checks[open] summary .ic { transform: rotate(180deg); }
.checks ol { margin-top: 8px; display: grid; gap: 5px; }
.checks li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 7px; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.checks li .ic { width: 16px; height: 16px; margin-top: 2px; stroke-width: 2; }
.checks li[data-r='pass'] .ic { color: #3C7A12; }
.checks li[data-r='approval'] { color: var(--text); font-weight: 600; }
.checks li[data-r='approval'] .ic { color: var(--petrol); }
.checks li[data-r='reject'] .ic { color: var(--stop); }

/* advisor */
.adv { margin-top: 12px; padding: 13px 14px 12px; background: var(--tint); border: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.adv-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.adv-h .ic { width: 18px; height: 18px; color: var(--petrol); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px 4px; font: 800 15px/1 var(--f-display); letter-spacing: 0.04em; text-transform: uppercase; }
.chip .ic { width: 16px; height: 16px; stroke-width: 2.2; }
.chip--approve { background: var(--lime); color: var(--petrol); }
.chip--reject { background: var(--stop-tint); color: var(--stop); box-shadow: inset 0 0 0 1px #E9B8B2; }
.chip--info { background: var(--white); color: var(--petrol); box-shadow: inset 0 0 0 1px var(--line-strong); }
.adv-model { margin-left: auto; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.adv-model b { font-weight: 600; color: var(--text); }
.adv-sum { margin-top: 10px; font-weight: 500; font-size: 15.5px; line-height: 1.45; text-wrap: pretty; }
.adv-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin-top: 10px; }
.adv-cols h5 { margin: 0 0 4px; font: 700 13px/1.1 var(--f-display); letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-2); }
.adv-cols li { position: relative; padding-left: 16px; font-size: 14px; line-height: 1.45; }
.adv-cols li + li { margin-top: 4px; }
.adv-cols li::before { content: ''; position: absolute; left: 2px; top: 0.66em; width: 6px; height: 1.5px; background: var(--text-2); }
.alts { margin-top: 12px; }
.alts h5 { margin: 0 0 4px; font: 700 13px/1.1 var(--f-display); letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-2); }
.alts li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.alts li:first-of-type { border-top: 0; }
.alts .alt-name { font-weight: 600; }
.alts .alt-price { font-weight: 600; white-space: nowrap; }
.alts .alt-note { grid-column: 1 / -1; color: var(--text-2); font-size: 13.5px; }
.adv-note { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.adv--wait { display: grid; gap: 8px; }
.adv-wait-text { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--text-2); }
.adv-wait-text .ic { color: var(--petrol); width: 18px; height: 18px; }
.adv-bar { position: relative; height: 2px; background: var(--line); overflow: hidden; }
.adv-bar::after { content: ''; position: absolute; top: 0; bottom: 0; width: 34%; background: var(--petrol); animation: scan 1.6s var(--ease-out) infinite; }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* decision */
.decide { margin-top: 16px; }
.decide label { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.decide label span { font-weight: 400; color: var(--text-2); }
.decide textarea {
  display: block; width: 100%; min-height: 68px; max-height: 160px; resize: vertical;
  padding: 11px 12px; background: var(--white); border: 1px solid var(--line-strong);
  font-size: 16px; line-height: 1.4;
}
.decide textarea::placeholder { color: #6B6E70; }
.decide textarea:focus-visible { outline-offset: -2px; border-color: var(--petrol); }
.decide-btns { display: grid; grid-template-columns: 1.5fr 1fr; gap: 10px; margin-top: 12px; }
.decide .msg { margin-top: 10px; }
.decide-help { margin-top: 8px; font-size: 13px; color: var(--text-2); }

/* empty */
.empty { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; padding: 22px 18px; background: var(--tint); border: 1px solid var(--line); }
.empty-ic { display: grid; place-items: center; width: 44px; height: 44px; background: var(--lime); color: var(--petrol); }
.empty-ic .ic { width: 26px; height: 26px; stroke-width: 2.2; }
.empty h2 { font: 800 26px/1.05 var(--f-display); letter-spacing: 0.005em; }
.empty p { margin-top: 6px; color: var(--text-2); }
.empty .text-link { display: inline-block; margin-top: 10px; }

/* mandate */
.mandate { margin-top: 24px; border: 1px solid var(--line); background: var(--white); }
.mandate summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 14px; cursor: pointer; list-style: none;
  font: 800 17px/1.1 var(--f-display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--petrol);
}
.mandate summary::-webkit-details-marker { display: none; }
.mandate summary .ic { transition: transform 220ms var(--ease-out); }
.mandate[open] summary .ic { transform: rotate(180deg); }
.mandate summary:hover { background: var(--tint); }
.mandate-body { padding: 0 14px 16px; }
.mandate-who { font-size: 14.5px; color: var(--text-2); margin-bottom: 10px; }
.mandate-list { display: grid; gap: 7px; counter-reset: rule; }
.mandate-list li { position: relative; padding-left: 28px; font-size: 15px; line-height: 1.45; max-width: 68ch; }
.mandate-list li::before { counter-increment: rule; content: counter(rule); position: absolute; left: 0; top: 1px; width: 20px; font: 500 12.5px/1.6 var(--f-mono); color: var(--text-2); }
.mandate-note { margin-top: 12px; font-size: 13.5px; color: var(--text-2); }

/* recently decided */
.decided { margin-top: 36px; }
.decided h2 { font: 800 26px/1.05 var(--f-display); letter-spacing: 0.005em; margin-bottom: 10px; }
.decided-list li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 4px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.decided-list li:last-child { border-bottom: 1px solid var(--line); }
.decided-list .badge { justify-self: start; align-self: start; }
.d-what { font-weight: 600; font-size: 15px; line-height: 1.35; text-wrap: pretty; }
.d-meta { margin-top: 3px; font-size: 13.5px; color: var(--text-2); }
.d-comment { margin-top: 4px; font-size: 14px; color: var(--text); }
.d-comment::before { content: '“'; }
.d-comment::after { content: '”'; }

/* footer */
.foot { border-top: 1px solid var(--line); background: var(--tint); }
.foot p { padding-top: 16px; padding-bottom: 20px; font-size: 13.5px; color: var(--text-2); }

/* toast-like status under the header */
.flash { margin-bottom: 16px; }

/* ------------------------------------------------------------------ phone */
@media (max-width: 640px) {
  .brand-name { font-size: 21px; }
  .page { padding-top: 22px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:nth-child(3) { padding-left: 0; border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
  .adv-cols { grid-template-columns: minmax(0, 1fr); }
  .adv-model { margin-left: 0; width: 100%; white-space: normal; }
  .card-id { margin-left: 0; }
  .decided-list li { grid-template-columns: minmax(0, 1fr); }
  .key-row { flex-direction: column; }
  .key-row .btn { width: 100%; }
}
@media (max-width: 380px) {
  .live #liveText { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
  .card, .btn, .sub a .ic, .checks summary .ic, .mandate summary .ic { transition: none; }
  .card.is-new { animation: none; }
  .adv-bar::after { animation: none; width: 100%; opacity: 0.35; }
}
