/* Alaka Stok — follows DESIGN.md: ink / paper / orange only, Inter Tight, square, flat, no greys. */
:root {
  --ink: #111111;
  --paper: #ffffff;
  --orange: #ff5b14;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.4 'Inter Tight', Arial, sans-serif;
}
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 480px; margin: 64px auto; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
code { font: 500 14px/1.4 ui-monospace, Menlo, Consolas, monospace; }
ul.checks { list-style: none; padding: 0; margin: 0 0 24px; }
ul.checks li { padding: 4px 0; border-bottom: 1px solid var(--ink); }

h1 { font-size: 32px; line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 24px; }
h2 { font-size: 20px; line-height: 1.2; font-weight: 800; margin: 48px 0 16px; }
p { margin: 0 0 16px; max-width: 70ch; }
.meta { font-size: 14px; font-weight: 500; }
.eyebrow {
  display: flex; align-items: center; gap: 12px; margin: 48px 0 0;
  font-size: 13px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
}
.eyebrow::before { content: ''; width: 16px; height: 16px; border-radius: 50%; background: var(--orange); flex: none; }

/* header */
.top { border-bottom: 4px solid var(--ink); background: var(--paper); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; padding-top: 12px; padding-bottom: 12px; }
.logo img { display: block; width: 120px; height: auto; }
/* phone: slim top bar + fixed bottom tab bar */
.top-in { flex-wrap: nowrap; justify-content: space-between; align-items: center; gap: 24px; padding-top: 20px; padding-bottom: 20px; }
.logo { display: block; padding: 4px 0; }
.logo img { width: auto; height: auto; max-width: 150px; max-height: 56px; }
.acct { position: relative; flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 50%; color: var(--ink); text-decoration: none; }
.acct:hover, .acct:focus-visible { background: var(--ink); color: var(--paper); }
.acct.on { background: var(--orange); border-color: var(--ink); color: var(--ink); }
.acct .nm { position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); padding: 6px 10px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 700; white-space: nowrap; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; opacity: 0; pointer-events: none; }
.acct:hover .nm, .acct:focus-visible .nm { opacity: 1; }
.logo-prev { margin: 16px 0; padding: 24px; border: 1px solid var(--ink); display: inline-block; }
.logo-prev img { display: block; max-width: 240px; max-height: 80px; }
nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--paper); padding-bottom: env(safe-area-inset-bottom); }
nav a { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 4px; font-size: 14px; font-weight: 700; text-decoration: none; text-align: center; border-top: 4px solid var(--ink); }
nav a.on { border-top-color: var(--orange); }
nav a.x { display: none; }
button.link { background: none; border: 0; padding: 12px 8px; min-height: 44px; font: 700 14px 'Inter Tight', Arial, sans-serif; color: var(--ink); text-decoration: underline; cursor: pointer; }
.back { display: inline-block; margin-top: 24px; padding: 8px 0; font-weight: 700; text-decoration: none; }
.back:hover { text-decoration: underline; }
.back + .eyebrow { margin-top: 8px; }
.actions.dash .btn:first-child { flex: 1 1 100%; }
.actions.dash .btn { flex: 1 1 calc(50% - 6px); }
input[type=file] { height: auto; padding: 12px; font: 400 16px 'Inter Tight', Arial, sans-serif; }
input[type=file]::file-selector-button { margin-right: 12px; padding: 10px 16px; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); font: 700 14px 'Inter Tight', Arial, sans-serif; cursor: pointer; }
.foot a { color: var(--ink); }
main { padding-bottom: 120px; min-height: 60vh; }
.foot { padding-top: 32px; padding-bottom: 32px; border-top: 1px solid var(--ink); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  border: 2px solid var(--orange); background: var(--orange); color: var(--ink);
  font: 700 16px 'Inter Tight', Arial, sans-serif; text-decoration: none; cursor: pointer; border-radius: 0;
  transition: transform 150ms var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn.sec { background: var(--paper); border-color: var(--ink); }
.btn:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; align-items: center; }
.actions form { margin: 0; }
form.inline { display: inline; margin-left: 16px; }

/* forms */
label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 16px; }
label > input, label > select { margin-top: 4px; font-weight: 400; }
input, select, textarea {
  display: block; width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--ink); border-radius: 0;
  background: var(--paper); color: var(--ink); font: 400 16px 'Inter Tight', Arial, sans-serif;
}
input:focus, select:focus { border: 2px solid var(--orange); padding: 0 11px; outline: 3px solid var(--ink); outline-offset: 2px; }
.chk { display: flex; gap: 12px; align-items: center; font-weight: 400; font-size: 16px; }
.chk input { width: 24px; min-height: 24px; height: 24px; flex: none; accent-color: var(--ink); }
.two { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
.stack { display: block; }
.form { max-width: 640px; }
.card { border-top: 4px solid var(--ink); padding-top: 16px; margin-top: 32px; }
input.qty { width: 112px; text-align: right; margin-left: auto; }
.bar { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.bar input { flex: 1; min-width: 200px; }

/* messages */
.flash { margin: 24px 0; padding: 12px 16px; border: 1px solid var(--ink); font-weight: 500; }
.flash.err { border: 0; border-left: 8px solid var(--orange); background: var(--paper); box-shadow: none; outline: 1px solid var(--ink); font-weight: 700; }

/* stats */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 16px; margin: 24px 0; }
.stat { border-top: 4px solid var(--ink); padding-top: 16px; }
.stat.hot { border-top-color: var(--orange); }
.stat b { display: block; white-space: nowrap; font-size: 28px; line-height: 1; font-weight: 800; letter-spacing: -0.03em; }
.stat span { display: block; margin-top: 8px; font-size: 14px; font-weight: 500; }

/* tables */
.scroll { overflow-x: auto; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th { background: var(--ink); color: var(--paper); text-align: left; font-weight: 700; padding: 12px; white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--ink); vertical-align: middle; }
th.n, td.n { text-align: right; }
tr.grp td { font-weight: 800; border-bottom: 4px solid var(--ink); padding-top: 24px; background: var(--paper); }
tfoot td { font-weight: 800; border-top: 2px solid var(--ink); }
tr.hide { display: none; }

/* recipe form */
fieldset { border: 0; border-top: 4px solid var(--ink); padding: 16px 0 0; margin: 24px 0; min-width: 0; }
legend { font-weight: 800; font-size: 20px; padding-right: 12px; }
.irow { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.irow select { grid-column: 1 / -1; }
.qtywrap { display: flex; align-items: center; gap: 8px; }
.qtywrap input { min-width: 0; }
.u { min-width: 28px; font-size: 14px; font-weight: 700; }
.rc { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.irow .btn { min-height: 48px; padding: 0 16px; }

/* cost analysis */
ul.finds { list-style: none; padding: 0; margin: 0; border-top: 4px solid var(--ink); }
ul.finds li { padding: 16px 0; border-bottom: 1px solid var(--ink); max-width: 80ch; }
ul.finds .pill { margin-right: 8px; }
.meter { height: 8px; margin-top: 4px; border: 1px solid var(--ink); min-width: 80px; }
.meter i { display: block; height: 100%; background: var(--ink); }
.meter .w0 { width: 0%; }
.meter .w2 { width: 2%; }
.meter .w5 { width: 5%; }
.meter .w10 { width: 10%; }
.meter .w15 { width: 15%; }
.meter .w20 { width: 20%; }
.meter .w25 { width: 25%; }
.meter .w30 { width: 30%; }
.meter .w35 { width: 35%; }
.meter .w40 { width: 40%; }
.meter .w45 { width: 45%; }
.meter .w50 { width: 50%; }
.meter .w55 { width: 55%; }
.meter .w60 { width: 60%; }
.meter .w65 { width: 65%; }
.meter .w70 { width: 70%; }
.meter .w75 { width: 75%; }
.meter .w80 { width: 80%; }
.meter .w85 { width: 85%; }
.meter .w90 { width: 90%; }
.meter .w95 { width: 95%; }
.meter .w100 { width: 100%; }

/* pills + rows */
.pill { display: inline-block; padding: 2px 12px; border: 2px solid var(--ink); border-radius: 999px; font-size: 13px; font-weight: 700; vertical-align: middle; }
.pill.hot { background: var(--orange); border-color: var(--orange); }
.pill.done { background: var(--paper); }
.rows { margin: 24px 0; border-top: 4px solid var(--ink); }
.row { display: grid; gap: 4px; padding: 24px 0; border-bottom: 1px solid var(--ink); text-decoration: none; }
.row b { font-size: 20px; font-weight: 800; }
.row:hover b { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--orange); }

@media (min-width: 720px) {
  .wrap { padding: 0 32px; }
  .two { grid-template-columns: 1fr 1fr; }
  .irow { grid-template-columns: 1fr 180px 120px 96px; }
  .irow select { grid-column: auto; }
  .top-in { gap: 24px 48px; padding-top: 24px; padding-bottom: 24px; }
  .logo img { max-width: 180px; max-height: 64px; }
  .actions.dash .btn, .actions.dash .btn:first-child { flex: 0 0 auto; }
  main { padding-bottom: 96px; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 24px 32px; }
  h1 { font-size: 44px; }
  .stat b { font-size: 40px; }
  .row { grid-template-columns: 320px 1fr; align-items: baseline; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  .top, .foot, .actions, .bar { display: none; }
}

/* language switch: ID | EN */
form.lang { display: flex; align-items: center; gap: 4px; margin: 0; }
form.lang button.link { text-decoration: none; padding: 8px 6px; min-width: 32px; font-weight: 500; }
form.lang button.link.on { font-weight: 900; text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.langs { text-align: right; }
.top-in > form.lang { margin-left: auto; }
.who + form.lang { margin-left: 0; }
td.n { white-space: nowrap; }

/* schedule grid */
table.grid th, table.grid td { text-align: center; padding: 8px 4px; }
table.grid td:first-child, table.grid th:first-child { text-align: left; white-space: nowrap; padding-left: 0; }
table.grid select { min-width: 92px; padding: 0 4px; }
.weeknav { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
.weeknav a { padding: 8px 0; font-weight: 700; }

/* kiosk */
.kiosk { max-width: 560px; margin: 0 auto; }
.kiosk .names { display: grid; gap: 12px; margin-top: 24px; }
.kiosk .names .btn, .btn.big { width: 100%; min-height: 72px; font-size: 22px; }
.clock { font-size: 56px; font-weight: 900; letter-spacing: -0.03em; margin: 0; }
.pin { font-size: 36px; text-align: center; letter-spacing: 0.4em; height: 72px; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.pad .btn { min-height: 72px; font-size: 28px; padding: 0; }
.plain { list-style: none; padding: 0; margin: 8px 0; }
.plain li { padding: 8px 0; border-bottom: 1px solid var(--ink); }
details summary { list-style: none; cursor: pointer; text-align: center; }
details[open] summary { margin-bottom: 16px; }

/* payslip */
.payslip { max-width: 560px; }
.payslip table { margin: 16px 0; }
@media print {
  .top, nav, .foot, .no-print, .back { display: none !important; }
  main { padding: 0; }
}

/* multi-branch: schedule clash, extra branch fields */
table.grid td.clash { outline: 3px solid var(--orange); outline-offset: -3px; }
.clashtag { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
table.grid .other { display: block; font-size: 11px; line-height: 1.25; margin-top: 2px; }
fieldset.branches { border: 0; border-top: 3px solid var(--ink); padding: 12px 0 0; margin: 8px 0; }
fieldset.branches legend { font-weight: 800; padding: 0 8px 0 0; }
.xrow { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; align-items: center; margin: 8px 0; }
@media (max-width: 560px) { .xrow { grid-template-columns: 1fr; } }

/* dashboard widgets, camera, thumbnails */
.widgets { display: grid; gap: 24px 16px; grid-template-columns: 1fr; margin: 24px 0; }
@media (min-width: 720px) { .widgets { grid-template-columns: 1fr 1fr; } .wcard.wide { grid-column: 1 / -1; } }
.wcard { border-top: 4px solid var(--ink); padding-top: 12px; }
.wcard .eyebrow { margin: 0 0 8px; }
.wcard p { margin: 4px 0; }
.wcard .big { font-size: 40px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.wcard .plain li { padding: 6px 0; }
.times { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.times li { border: 1px solid var(--ink); padding: 8px; display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.times li.on { background: var(--ink); color: var(--paper); }
@media (min-width: 720px) { .times { grid-template-columns: repeat(6, 1fr); } .times li { display: block; } .times li b { display: block; font-size: 18px; } }
.cam { margin: 0 0 16px; }
.cam video { width: 100%; max-height: 240px; background: var(--ink); object-fit: cover; transform: scaleX(-1); display: block; }
.cam.off video { display: none; }
.thumb { display: inline-block; width: 40px; height: 40px; object-fit: cover; border: 1px solid var(--ink); vertical-align: middle; }

/* v0.4 spacing: roomier rows and footer */
td { padding: 16px 14px; line-height: 1.4; }
th { padding: 14px; }
.scroll { margin: 20px 0 32px; }
h2 { margin-top: 40px; margin-bottom: 8px; }
.wcard .plain li { padding: 10px 0; }
.plain li { padding: 12px 0; }
.board h2 { margin-top: 48px; }
.foot { padding-top: 40px; padding-bottom: 56px; margin-top: 48px; line-height: 1.8; }
.foot .meta { display: block; max-width: 760px; }
main { padding-bottom: 96px; }
.top-in > form.lang { margin-left: auto; margin-right: 4px; }
textarea { width: 100%; min-height: 120px; padding: 12px; font: 400 16px/1.5 'Inter Tight', Arial, sans-serif; }
@media (max-width: 719px) { .foot { padding-bottom: 96px; } }

/* v0.5 tables: one pattern everywhere. Header ink, first column names the row, numbers right, last column holds actions. */
.scroll { border-top: 0; }
table:not(.grid):not(.kv) { border-bottom: 2px solid var(--ink); }
table:not(.grid):not(.kv) td:first-child { font-weight: 700; }
table:not(.grid):not(.kv) th:first-child, table:not(.grid):not(.kv) td:first-child { padding-left: 16px; }
table:not(.grid):not(.kv) th:last-child, table:not(.grid):not(.kv) td:last-child { padding-right: 16px; }
table:not(.grid):not(.kv) tbody tr:last-child td { border-bottom: 0; }
table:not(.grid):not(.kv) tbody tr:hover td:first-child { border-left: 4px solid var(--orange); padding-left: 12px; }
td:last-child:has(> a:only-child), td:last-child:has(> form:only-child) { text-align: right; white-space: nowrap; width: 1%; }
th:last-child:empty { width: 1%; }
td form { margin: 0; }
td .meta { font-weight: 400; }
td .pill { white-space: nowrap; }
td.empty, p.empty { padding: 24px 16px; border-top: 4px solid var(--ink); border-bottom: 1px solid var(--ink); font-weight: 500; max-width: none; margin: 16px 0; }
table.kv { max-width: 640px; }
table.kv td { padding: 10px 14px 10px 0; }
table.kv td:nth-child(odd) { font-weight: 700; width: 22%; }
td input[type=checkbox] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--ink); }

/* v0.5 dashboard widgets: more air inside and between cards */
.widgets { gap: 48px 40px; margin: 40px 0; }
.wcard { padding-top: 24px; }
.wcard .eyebrow { margin-bottom: 20px; }
.wcard p { margin: 8px 0; }
.wcard .big { margin: 0 0 12px; }
.wcard > p.meta + p.meta { margin-top: 12px; }
.times { gap: 12px; margin-top: 24px; }
.times li { padding: 14px 12px; }
.wcard .plain { margin: 12px 0 0; }
.wcard .plain li { padding: 14px 0; line-height: 1.5; }
.wcard .plain li:last-child { border-bottom: 0; }
.wcard .pill { margin-right: 8px; }

/* tabs (letter kinds, SOP categories) */
.tabs { display: flex; flex-wrap: wrap; gap: 0 8px; margin: 28px 0 32px; border-bottom: 4px solid var(--ink); }
.tabs a { padding: 12px 14px; font-weight: 700; font-size: 14px; text-decoration: none; border-bottom: 4px solid transparent; margin-bottom: -4px; }
.tabs a:hover { border-bottom-color: var(--ink); }
.tabs a.on { border-bottom-color: var(--orange); }

/* side-by-side editor + paper preview */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 8px; }
.split .form { max-width: none; }
@media (min-width: 1000px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; }
  .split .paperwrap { position: sticky; top: 16px; }
}
.paperwrap .eyebrow { margin: 0 0 16px; }
.paper { border: 1px solid var(--ink); background: var(--paper); padding: 40px 44px 36px; font-size: 11px; line-height: 1.6; min-height: 560px; }
.paper p { margin: 0; max-width: none; text-align: justify; }
.pv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.pv-head img { display: block; max-height: 38px; max-width: 150px; width: auto; }
.pv-co { text-align: right; font-size: 9px; line-height: 1.45; }
.pv-co b { display: block; font-size: 13px; }
.pv-rule { height: 5px; margin: 12px 0 22px; border-top: 3px solid var(--orange); border-bottom: 1px solid var(--ink); }
.pv-place { text-align: right !important; margin-bottom: 14px !important; }
.pv-meta { display: grid; grid-template-columns: 72px 1fr; margin: 0 0 18px; }
.pv-meta dt, .pv-meta dd { margin: 0; }
.pv-meta dt { position: relative; }
.pv-meta dt::after { content: ':'; position: absolute; right: 10px; }
.pv-to { margin-bottom: 20px !important; text-align: left !important; }
.pv-title { text-align: center; font-size: 14px; margin: 8px 0 2px; letter-spacing: 0.02em; }
.pv-title.ul span { border-bottom: 1px solid var(--ink); padding-bottom: 1px; }
.pv-no { text-align: center !important; font-size: 10px; margin-bottom: 22px !important; }
.pv-gapline { height: 8px; }
.pv-item { display: grid; grid-template-columns: 24px 1fr; padding-left: 4px; text-align: justify; }
.pv-kv { display: grid; grid-template-columns: 118px 1fr; padding-left: 4px; }
.pv-pasal { font-weight: 800; }
.pv-sign { margin-top: 26px; }
.pv-sigs { display: flex; justify-content: space-between; gap: 24px; margin-top: 8px; }
.pv-sigs > div { flex: 1; text-align: center; }
.pv-sigs span, .pv-sigs b, .pv-sigs small { display: block; }
.pv-sigs i { display: block; height: 54px; margin: 6px 14px 6px; border-bottom: 1px solid var(--ink); }
.pv-sigs i.pv-stamp { width: 56px; height: 54px; margin: 6px auto; border: 1px solid var(--ink); font-size: 8px; font-style: normal; display: flex; align-items: center; justify-content: center; }
.pv-sigs small { font-size: 10px; }
dl.ph { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 16px 0; font-size: 14px; }
dl.ph dt, dl.ph dd { margin: 0; }

/* SOP reading view */
.sop-steps h3 { margin: 32px 0 8px; padding: 10px 0 10px 12px; border-left: 4px solid var(--orange); border-bottom: 1px solid var(--ink); font-size: 16px; text-transform: uppercase; letter-spacing: 0.02em; }
.sop-step { display: grid; grid-template-columns: 40px 1fr; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--ink); }
.sop-step span { font-weight: 800; }
.sop-step p { margin: 0; }

/* v0.5.1 filter bar: toggle and button on one line, button at the right end */
.filterbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 8px 0 16px; }
.filterbar .chk { margin: 0; }
.filterbar .btn { min-height: 44px; }

/* v0.5.1 filter bar: select, include-inactive toggle and show button on one tidy row */
.bar { align-items: center; gap: 12px 24px; margin: 24px 0; }
.bar select { flex: 0 1 240px; width: auto; min-width: 180px; }
.bar label { margin: 0; }
.bar .chk { flex: none; min-height: 48px; }
.bar input[type=checkbox] { flex: none; min-width: 0; width: 24px; height: 24px; min-height: 24px; }
.bar .btn { flex: none; margin-left: 0; }
.bar input[type=search] { flex: 1 1 240px; }
@media (max-width: 560px) { .bar select { flex: 1 1 100%; } }

/* ---- v0.5/v0.6: welcome screen, weather chip, page transition, motion ---- */
html { scroll-behavior: smooth; }
@view-transition { navigation: auto; }
.top { view-transition-name: topbar; }
nav { view-transition-name: tabbar; }
::view-transition-old(root) { animation: .28s ease both vtOut; }
::view-transition-new(root) { animation: .42s ease both vtIn; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
main > * { animation: rise .6s cubic-bezier(.25, .6, .25, 1) both; }
main > *:nth-child(2) { animation-delay: .05s; } main > *:nth-child(3) { animation-delay: .1s; } main > *:nth-child(4) { animation-delay: .15s; }
main > *:nth-child(n+5) { animation-delay: .2s; }
.stats .stat, .rows .row, .widgets > * { animation: rise .7s cubic-bezier(.25, .6, .25, 1) both; }
.stats .stat:nth-child(2), .rows .row:nth-child(2) { animation-delay: .08s; } .stats .stat:nth-child(3), .rows .row:nth-child(3) { animation-delay: .16s; }
.stats .stat:nth-child(4), .rows .row:nth-child(4) { animation-delay: .24s; } .rows .row:nth-child(n+5) { animation-delay: .3s; }
.flash { animation: slideIn .5s ease both; transition: opacity .6s, transform .6s; }
.flash.gone { opacity: 0; transform: translateY(-6px); }
:focus-visible { outline-color: var(--orange); }

/* hover + press */
.btn, nav a, .acct, .stat, .row b, button.link, .pill { transition: transform .28s ease, background-color .28s ease, color .28s ease, border-color .28s ease; }
.btn:active { transform: translateY(1px); }
.btn.busy { pointer-events: none; opacity: .55; }
.btn.busy::after { content: ''; display: inline-block; width: 12px; height: 12px; margin-left: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -2px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
tbody tr { transition: background-color .3s ease; }
td a { text-decoration-color: var(--orange); text-decoration-thickness: 2px; }
.logo img { transition: transform .4s ease; }

/* weather chip */
.wx { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 15px; font-weight: 800; white-space: nowrap; cursor: default; color: var(--ink); }
.wx svg { transition: transform .4s ease; }

/* welcome screen: pure CSS, 3 s bar then fade out */
#intro { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: var(--ink); animation: introOut .7s ease 3s forwards; }
.intro-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: introZoom 4s ease-out both; }
#intro::before { content: ''; position: absolute; inset: 0; background: var(--ink); opacity: .45; z-index: 1; }
.intro-bar i { display: block; height: 100%; width: 0; background: var(--orange); animation: introFill 3s cubic-bezier(.4, 0, .3, 1) forwards; }
@keyframes introFill { to { width: 100%; } }
@keyframes introOut { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@keyframes introZoom { from { transform: scale(1.08); } to { transform: scale(1); } }
#intro.skip { animation: introOut .25s ease forwards; }
.intro-prev { margin: 16px 0; border: 1px solid var(--ink); max-width: 480px; }
.intro-prev img { display: block; width: 100%; height: auto; }
@media print { #intro, .wx { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  #intro { animation: introOut .01ms 3s forwards !important; }
  .intro-bar i { animation: introFill 3s linear forwards !important; }
}


/* v0.5.1/v0.6.1: bare welcome screen (picture + bar only), steadier page changes, weather in widgets */
.intro-bar { position: relative; z-index: 2; width: min(360px, 70vw); height: 6px; background: rgba(255, 255, 255, .35); animation: rise .5s ease .1s both; }
.intro-bar i { box-shadow: none; }
.wxbig svg { width: 40px; height: 40px; vertical-align: -7px; margin-right: 4px; }
.wxstat b svg { width: 30px; height: 30px; vertical-align: -5px; margin-right: 2px; }
.wxstat b { white-space: nowrap; }
.wx { display: none; }
/* header and tab bar stay put while the page content changes */
::view-transition-group(topbar), ::view-transition-group(tabbar) { animation-duration: 0s; }
::view-transition-old(topbar), ::view-transition-old(tabbar) { display: none; }
::view-transition-new(topbar), ::view-transition-new(tabbar) { animation: none; }
@supports (view-transition-name: none) { main > * { animation: none; } }

/* tablets use the phone layout (bottom tab bar) until the top menu fits */
@media (min-width: 720px) and (max-width: 1099px) { main { padding-bottom: 128px; } }
@media (min-width: 1100px) {
  nav { position: static; flex: 1; display: flex; gap: 4px; border: 0; padding: 0; background: none; }
  nav a { display: block; min-height: 0; padding: 12px 12px 8px; margin: 0; border-top: 0; border-bottom: 4px solid transparent; white-space: nowrap; }
  nav a:hover { border-bottom-color: var(--ink); }
  nav a.on { border-bottom-color: var(--orange); }
  nav a.x { display: block; }
  nav a.m { display: none; }
  nav { min-width: 0; }
}

@media (hover: hover) {
  .btn:hover { transform: translateY(-1px); text-decoration: none; }
  .btn:not(.sec):hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
  .btn.sec:hover { background: var(--ink); color: var(--paper); }
  nav a:hover { color: var(--ink); }
  .stat:hover { border-top-color: var(--orange); }
  .row:hover b { transform: translateX(4px); }
  .row:hover { background: none; }
  tbody tr:not(.grp):hover td:first-child { box-shadow: inset 4px 0 0 var(--orange); }
  tbody tr:not(.grp):hover { background: #FFF1EA; }
  td a:hover { text-decoration-thickness: 3px; }
  .logo:hover img { transform: scale(1.02); }
  .acct:hover { transform: scale(1.03); }
  .wx:hover svg { transform: rotate(-12deg) scale(1.12); color: var(--orange); }
}
.btn:active { transform: translateY(1px); }

a, button { -webkit-tap-highlight-color: transparent; }

/* ---- header v2 (HR 0.7 / Stok 0.6): sticky, thin rule, sliding marker, menu button below 1100px ---- */
.top { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--ink); }
.top-in { flex-wrap: nowrap; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.logo img { max-width: 132px; max-height: 44px; }
html { scroll-padding-top: 96px; }
main { padding-bottom: 64px; }
.foot { padding-bottom: 48px; }
nav { view-transition-name: none; }
nav a, nav a.on { border: 0; }
.mk { display: none; }
.menu-btn { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer; }
.menu-btn path { transition: transform .35s ease, opacity .25s ease; transform-origin: 12px 12px; }
.top.open .menu-btn path.l1 { transform: translateY(5px) rotate(45deg); }
.top.open .menu-btn path.l2 { opacity: 0; }
.top.open .menu-btn path.l3 { transform: translateY(-5px) rotate(-45deg); }
.acct { width: 40px; height: 40px; border-width: 1px; }
@media (max-width: 1099px) {
  .top-in > form.lang { margin-left: auto; margin-right: 0; }
  nav { position: absolute; top: 100%; left: 0; right: 0; bottom: auto; z-index: 49; display: block; padding: 8px 0 16px; background: var(--paper); border-bottom: 1px solid var(--ink);
        max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); overflow-y: auto; visibility: hidden; opacity: 0; transform: translateY(-4px);
        transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s; }
  .top.open nav { visibility: visible; opacity: 1; transform: none; transition: opacity .3s ease, transform .3s ease; }
  nav a, nav a.x { display: block; min-height: 0; padding: 14px 16px; border-left: 3px solid transparent; font-size: 17px; text-align: left; }
  nav a.on { border-left: 3px solid var(--orange); }
  nav a.m { display: none; }
}
@media (min-width: 720px) and (max-width: 1099px) { nav a, nav a.x { padding-left: 32px; padding-right: 32px; } }
@media (min-width: 1100px) {
  .menu-btn { display: none; }
  .top-in { gap: 24px; padding-top: 16px; padding-bottom: 16px; }
  .logo img { max-width: 150px; max-height: 52px; }
  nav { position: static; flex: 1; display: flex; gap: 0; padding: 0; background: none; border: 0; visibility: visible; opacity: 1; transform: none; }
  nav a, nav a.x { position: relative; display: block; padding: 10px 12px; border: 0; white-space: nowrap; }
  nav a.m { display: none; }
  nav a::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 1px; background: var(--ink); transform: scaleX(0); transition: transform .35s ease; }
  nav a.on::after { display: none; }
  .mk { display: block; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; background: var(--orange); view-transition-name: navmark; }
  .top-in > form.lang { margin-left: 0; }
}
@media (min-width: 1100px) and (hover: hover) { nav a:hover::after { transform: scaleX(1); } }
::view-transition-group(navmark) { animation-duration: .5s; animation-timing-function: cubic-bezier(.35, 0, .2, 1); }
@media print { .menu-btn { display: none; } }

main { min-height: calc(100vh - 240px); }

/* ---- in-place navigation (no header reload): sliding marker, content fade, loading line ---- */
main > * { animation: rise .6s cubic-bezier(.25, .6, .25, 1) both; }
main { transition: opacity .3s ease; }
main.out { opacity: 0; transition: opacity .16s ease; }
html.loading .top::after { content: ''; position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--orange); transform-origin: left; animation: loadline 1.2s cubic-bezier(.3, .6, .3, 1) both; }
@keyframes loadline { from { transform: scaleX(0); } to { transform: scaleX(.85); } }
html.loading, html.loading a, html.loading button { cursor: progress; }
nav .ind { display: none; }
h1:focus { outline: none; }
@media (min-width: 1100px) {
  nav { position: relative; }
  nav.js .mk { display: none; }
  nav .ind { display: block; position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--orange); opacity: 0; pointer-events: none;
             transition: transform .55s cubic-bezier(.35, 0, .2, 1), width .55s cubic-bezier(.35, 0, .2, 1), opacity .3s ease; }
  nav .ind.no-anim { transition: none; }
}
@media (prefers-reduced-motion: reduce) { main.out { opacity: 1; } html.loading .top::after { animation: none; transform: scaleX(.85); } }
/* dim the page behind the phone/tablet menu */
.top.open nav { box-shadow: 0 0 0 100vmax rgba(17, 17, 17, .28); clip-path: inset(0 0 -100vmax 0); }
/* UI pass: schedule grid first column breathes, week nav on one row on phones */
table.grid td:first-child, table.grid th:first-child { padding-left: 16px; padding-right: 12px; }
@media (max-width: 719px) {
  .weeknav { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; text-align: center; }
  .weeknav b { font-size: 14px; }
}
/* UI pass: footer rule lines up with the content column */
.foot { border-top: 0; padding-top: 48px; }
.foot > .meta { display: block; padding-top: 28px; border-top: 1px solid var(--ink); }

[hidden]{display:none!important}
.pwa{display:grid;gap:8px}.pwa p{margin:0}
.linkbox input[readonly]{font-family:ui-monospace,Menlo,monospace;font-size:14px;background:#f7f7f7;cursor:copy}
