/* PRiQ – PHP edition. Tokens follow app/globals.css of the Next.js app (opal light / navy+lime dark). */
:root {
  --bg: oklch(0.974 0.008 245);
  --fg: oklch(0.21 0.03 250);
  --card: oklch(1 0 0);
  --muted: oklch(0.96 0.012 235);
  --muted-fg: oklch(0.52 0.03 245);
  --primary: oklch(0.62 0.16 245);
  --primary-fg: oklch(0.99 0.005 230);
  --accent: oklch(0.93 0.035 235);
  --accent-fg: oklch(0.3 0.06 250);
  --border: oklch(0.91 0.015 235);
  --input: oklch(0.91 0.015 235);
  --ring: oklch(0.62 0.16 245);
  --danger: oklch(0.58 0.21 25);
  --pending: oklch(0.68 0.17 55);
  --approved: oklch(0.58 0.14 155);
  --brand: oklch(0.24 0.05 270);
  --brand-soft: oklch(0.45 0.07 265);
  --sidebar: oklch(1 0 0);
  --radius: 1rem;
  --f-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-exo: "Exo 2", "Arial Narrow", system-ui, sans-serif;
  --f-mont: "Montserrat", system-ui, sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
.dark {
  --bg: oklch(0.19 0.025 255);
  --fg: oklch(0.96 0.008 230);
  --card: oklch(0.23 0.03 255);
  --muted: oklch(0.28 0.035 255);
  --muted-fg: oklch(0.7 0.03 240);
  --primary: oklch(0.7 0.14 240);
  --primary-fg: oklch(0.18 0.03 255);
  --accent: oklch(0.34 0.05 250);
  --accent-fg: oklch(0.96 0.008 230);
  --border: oklch(1 0 0 / 12%);
  --input: oklch(1 0 0 / 16%);
  --ring: oklch(0.7 0.14 240);
  --danger: oklch(0.65 0.19 25);
  --pending: oklch(0.75 0.15 60);
  --approved: oklch(0.7 0.14 155);
  --brand: oklch(0.9 0.19 110);
  --brand-soft: oklch(0.96 0.1 110);
  --sidebar: oklch(0.21 0.028 255);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.55 var(--f-sans); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; }
code, .mono { font-family: var(--f-mono); font-size: 0.9em; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
.ico { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted-fg); }
.hint { color: var(--muted-fg); font-size: 13px; }
.stack { display: grid; gap: 18px; }

/* ---------- brand ---------- */
.f5-mark { display: block; height: 34px; aspect-ratio: 167 / 59; background: var(--brand);
  -webkit-mask: url(/assets/brand/f5-creative-horizontal.svg) center / contain no-repeat;
  mask: url(/assets/brand/f5-creative-horizontal.svg) center / contain no-repeat; }
.f5-mark-lg { height: 44px; }
.brand-portal { display: inline-flex; flex-direction: column; gap: 14px; }
.brand-word { display: flex; flex-direction: column; gap: 2px; }
.brand-priq { font: 700 60px/1 var(--f-mont); letter-spacing: -0.02em; }
.brand-sub, .brand-line { font: 300 13px/1 var(--f-exo); text-transform: uppercase; letter-spacing: 0.35em; }
.brand-rule { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-soft), var(--brand)); }
.brand-line { display: flex; align-items: center; gap: 12px; letter-spacing: 0.3em; }

/* ---------- cards, forms, buttons ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card-head { margin-bottom: 20px; display: grid; gap: 6px; }
.card-title { font-size: 24px; font-weight: 700; }
.card-desc { color: var(--muted-fg); text-wrap: pretty; }
.card-foot { margin-top: 22px; text-align: center; color: var(--muted-fg); font-size: 14px; }
.field { display: grid; gap: 7px; }
label { font-size: 14px; font-weight: 600; }
input, select, textarea {
  font: inherit; color: var(--fg); background: transparent; border: 1px solid var(--input);
  border-radius: calc(var(--radius) * 0.6); padding: 10px 12px; width: 100%; min-width: 0;
}
.dark input, .dark select, .dark textarea { background: oklch(1 0 0 / 4%); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 25%, transparent); }
.form-error { color: var(--danger); font-size: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 14px/1 var(--f-sans);
  border-radius: calc(var(--radius) * 0.6); padding: 11px 16px; border: 1px solid transparent; cursor: pointer;
  text-decoration: none; transition: background .15s, border-color .15s, opacity .15s; white-space: nowrap; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { background: color-mix(in oklch, var(--primary) 88%, black); }
.btn-outline { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-outline:hover { background: var(--muted); }
.btn-block { width: 100%; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--fg); cursor: pointer; }
.icon-btn:hover { background: var(--muted); }

/* ---------- auth layout ---------- */
.auth-main { min-height: 100svh; display: grid; place-items: center; padding: 32px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left)); }
.auth-wrap { width: 100%; max-width: 400px; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 32px; }
.auth-card { box-shadow: 0 1px 2px oklch(0 0 0 / 5%); }

/* ---------- app shell ---------- */
.app-body { display: grid; grid-template-columns: 248px 1fr; min-height: 100svh; }
.sidebar { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 8px; padding: 18px 12px;
  background: var(--sidebar); border-right: 1px solid var(--border); }
.sidebar-brand { display: flex; padding: 6px 10px 18px; }
.sidebar-nav { display: grid; gap: 2px; }
.sidebar-foot { margin-top: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--muted-fg);
  text-decoration: none; font-weight: 600; font-size: 14px; }
.nav-item:hover { background: var(--muted); color: var(--fg); }
.nav-item.is-active { background: var(--accent); color: var(--accent-fg); }
.shell { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 60px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: color-mix(in oklch, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar-title { font-weight: 700; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.md-only { display: none; }
.avatar { list-style: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--accent-fg); font: 700 13px/1 var(--f-sans); cursor: pointer; }
.avatar::-webkit-details-marker { display: none; }
.usermenu { position: relative; }
.usermenu-panel { position: absolute; right: 0; top: 46px; min-width: 240px; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px; box-shadow: 0 16px 40px -12px oklch(0 0 0 / 35%); display: grid; }
.usermenu-head { display: grid; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.usermenu-head span { color: var(--muted-fg); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.usermenu-panel a, .usermenu-panel button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--fg); text-decoration: none; background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; text-align: left; width: 100%; }
.usermenu-panel a:hover, .usermenu-panel button:hover { background: var(--muted); }
.usermenu-panel form { margin: 0; }
.page { padding: 28px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left)); max-width: 1280px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.sidebar-scrim { display: none; }

/* ---------- empty state / checks / toasts ---------- */
.empty { max-width: 560px; margin: 8vh auto; text-align: center; display: grid; gap: 14px; justify-items: center; }
.empty h1 { font-size: 24px; }
.empty p { color: var(--muted-fg); }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent); color: var(--accent-fg); }
.empty-icon .ico { width: 26px; height: 26px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; }
.checklist li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.check-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.check-dot .ico { width: 14px; height: 14px; }
.checklist .ok .check-dot { background: color-mix(in oklch, var(--approved) 20%, transparent); color: var(--approved); }
.checklist .bad .check-dot { background: color-mix(in oklch, var(--pending) 22%, transparent); color: var(--pending); }
.check-label { font-weight: 600; }
.check-value { color: var(--muted-fg); font-size: 14px; text-align: right; overflow-wrap: anywhere; }
.toasts { position: fixed; z-index: 50; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.toast { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 10px;
  padding: 12px 16px; box-shadow: 0 10px 30px -10px oklch(0 0 0 / 35%); animation: toast-in .25s ease-out; max-width: 360px; }
.toast-success { border-left-color: var(--approved); }
.toast-error { border-left-color: var(--danger); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 900px) {
  .app-body { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: 264px; transform: translateX(-100%); transition: transform .2s ease;
    padding-top: max(18px, env(safe-area-inset-top)); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 30; background: oklch(0 0 0 / 40%); }
  .md-only { display: grid; }
  .topbar-brand .f5-mark { height: 26px; }
  .topbar-title { display: none; }
  .brand-priq { font-size: 48px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.row-between { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.row-between > div { min-width: 0; flex: 1 1 280px; }

/* ---------- client pages (P1) ---------- */
.page-intro { display: grid; gap: 4px; margin-bottom: 24px; }
.page-intro h1 { font-size: 24px; font-weight: 800; }
.page-intro p { color: var(--muted-fg); font-size: 14px; text-wrap: pretty; }
.vstack { display: grid; gap: 16px; }
.vstack-lg { display: grid; gap: 32px; }
.card-pad-0 { padding: 0; overflow: hidden; }
.card-sm { padding: 16px; }
.empty-card { display: grid; justify-items: center; gap: 12px; padding: 56px 20px; text-align: center; }
.empty-card .round { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--muted); color: var(--muted-fg); }
.empty-card .ico { width: 24px; height: 24px; }
.empty-card strong { display: block; font-weight: 600; }
.empty-card p { color: var(--muted-fg); font-size: 14px; }
.tnum { font-variant-numeric: tabular-nums; }
.xs { font-size: 12px; } .sm { font-size: 14px; }
.light { font-weight: 300; }
.strong { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.text-primary { color: var(--primary); }
.text-right { text-align: right; }
.ok-text { color: var(--approved); }

.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600;
  white-space: nowrap; border: 1px solid transparent; line-height: 1.4; }
.badge .ico { width: 14px; height: 14px; }
.badge-outline { border-color: currentColor; }
.tone-emerald { --tone: oklch(0.6 0.14 160); } .tone-amber { --tone: oklch(0.68 0.16 70); } .tone-sky { --tone: oklch(0.62 0.14 230); }
.tone-violet { --tone: oklch(0.56 0.2 295); } .tone-slate { --tone: oklch(0.55 0.03 255); } .tone-red { --tone: var(--danger); }
.tone-pending { --tone: var(--pending); } .tone-approved { --tone: var(--approved); } .tone-muted { --tone: var(--muted-fg); }
.badge[class*="tone-"] { color: var(--tone); background: color-mix(in oklch, var(--tone) 13%, transparent); }
.badge-outline[class*="tone-"] { border-color: color-mix(in oklch, var(--tone) 40%, transparent); }
.badge-solid-red { background: var(--danger); color: white; }

/* quote cards */
.qcards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.qcard { display: flex; flex-direction: column; height: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; color: inherit; text-decoration: none; box-shadow: 0 1px 2px oklch(0 0 0 / 5%); transition: box-shadow .15s; }
.qcard:hover { box-shadow: 0 8px 24px -10px oklch(0 0 0 / 25%); }
.qcard-bar { height: 4px; background: var(--tone); }
.qcard-body { display: flex; flex-direction: column; gap: 16px; padding: 20px; flex: 1; }
.qcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.qcard-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; color: var(--muted-fg); font-size: 14px; }
.qcard-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-top: 1px solid var(--border); padding-top: 16px; }
.qcard-total { font-size: 18px; font-weight: 700; }
.qcard-open { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); font-weight: 600; font-size: 14px; }
.qcard-open .ico { width: 16px; height: 16px; transition: transform .15s; }
.qcard:hover .qcard-open .ico { transform: translateX(2px); }

/* collapsible "Korábbi döntések" */
details.more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted-fg); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary:hover { color: var(--fg); }
details.more > summary .ico { width: 16px; height: 16px; transition: transform .15s; }
details.more[open] > summary .ico { transform: rotate(180deg); }
details.more > .more-body { padding-top: 16px; }

/* design list / approval */
.design-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 16px; }
.two-col { display: grid; gap: 16px; }
@media (min-width: 1024px) { .two-col { grid-template-columns: 1fr 1fr; } .side-col { grid-template-columns: minmax(0, 1fr) 320px; } }
.side-col { display: grid; gap: 24px; }
.thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.thumbs-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .thumbs-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.thumb { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 10px; border: 1px solid var(--border); background: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; display: block; }
.thumb:hover img { transform: scale(1.05); }
.file-tile { display: flex; flex-direction: column; overflow: hidden; border-radius: 10px; border: 1px solid var(--border); background: var(--card);
  color: inherit; text-decoration: none; text-align: left; padding: 0; font: inherit; cursor: pointer; }
.file-tile:hover { box-shadow: 0 6px 18px -8px oklch(0 0 0 / 25%); }
.file-tile .thumb { border: 0; border-radius: 0; }
.file-tile .thumb-icon { display: grid; place-items: center; height: 100%; color: var(--muted-fg); }
.file-tile .thumb-icon .ico { width: 40px; height: 40px; }
.file-tile-meta { display: grid; gap: 2px; padding: 8px; font-size: 12px; }
.file-row { display: flex; align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; color: inherit; text-decoration: none; font-size: 14px; }
.file-row:hover { background: var(--muted); }
.file-list { display: grid; gap: 8px; }
.no-design { display: grid; justify-items: center; gap: 8px; padding: 40px 12px; border: 1px dashed var(--border); border-radius: 10px; color: var(--muted-fg); font-size: 14px; text-align: center; }
.approval-card { border: 1px solid var(--border); border-radius: 12px; padding: 18px; display: grid; gap: 14px; background: var(--card); }
.approval-card h3 { font-size: 16px; font-weight: 600; }
.grid-2 { display: grid; gap: 14px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.qty-row { display: grid; grid-template-columns: minmax(0, 7rem) 1fr; gap: 12px; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 40px; }
.input-suffix span { position: absolute; inset: 0 12px 0 auto; display: grid; place-items: center; font-size: 12px; color: var(--muted-fg); pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row > .btn-grow { flex: 1 1 200px; height: 44px; }
.btn-approve { background: oklch(0.6 0.14 160); color: white; }
.btn-approve:hover { background: oklch(0.54 0.14 160); }
.btn-reject { background: oklch(0.58 0.21 25); color: white; }
.btn-reject:hover { background: oklch(0.52 0.21 25); }
.btn-ghost { background: transparent; color: var(--muted-fg); border-color: transparent; }
.btn-ghost:hover { background: var(--muted); color: var(--fg); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.note { display: flex; align-items: flex-start; gap: 8px; border-radius: 8px; padding: 10px 12px; font-size: 14px; line-height: 1.5; }
.note .ico { width: 16px; height: 16px; margin-top: 2px; }
.note[class*="tone-"] { color: color-mix(in oklch, var(--tone) 80%, var(--fg)); background: color-mix(in oklch, var(--tone) 11%, transparent);
  border: 1px solid color-mix(in oklch, var(--tone) 30%, transparent); }
.note-dashed { border: 1px dashed var(--border); color: var(--muted-fg); font-size: 12px; }

/* tables */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-fg); font-weight: 600; padding: 8px; text-align: left; border-bottom: 1px solid var(--border); }
.tbl td { padding: 8px; border-bottom: 1px solid color-mix(in oklch, var(--border) 60%, transparent); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .item { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.tbl .item .ico { width: 14px; height: 14px; }
.ico-sky { color: oklch(0.65 0.14 230); }
.tbl tr.selectable { cursor: pointer; }
.tbl tr.selectable:hover td { background: var(--muted); }
.tbl tr.unchecked { color: var(--muted-fg); }
.tbl tr.unchecked .item { text-decoration: line-through; }
.tbl input[type="checkbox"], .terms input { width: 16px; height: 16px; accent-color: oklch(0.6 0.14 160); padding: 0; cursor: pointer; }
dl.sum { display: grid; gap: 6px; margin: 0; font-size: 14px; }
dl.sum > div { display: flex; justify-content: space-between; gap: 16px; }
dl.sum dt { color: var(--muted-fg); } dl.sum dd { margin: 0; font-variant-numeric: tabular-nums; }
dl.sum .strong-row dt { color: var(--fg); font-weight: 600; } dl.sum .strong-row dd { font-weight: 600; }
dl.sum .sep { border-top: 1px solid var(--border); margin: 4px 0; }
dl.sum .total { border-top: 1px solid var(--border); padding-top: 8px; font-size: 16px; font-weight: 700; color: var(--primary); }
dl.sum .total dt { color: var(--primary); }
.terms-box { display: grid; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--card); font-size: 14px; }
@media (min-width: 640px) { .terms-box { grid-template-columns: 1fr 1fr; } }
.terms-box > div { display: flex; gap: 8px; align-items: flex-start; }
.terms-box dt { font-size: 12px; color: var(--muted-fg); } .terms-box dd { margin: 0; font-weight: 600; }
.terms-box .ico { color: var(--muted-fg); width: 16px; height: 16px; margin-top: 2px; }
label.terms { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  background: color-mix(in oklch, var(--muted) 50%, transparent); font-size: 12px; font-weight: 400; line-height: 1.6; color: var(--muted-fg); cursor: pointer; }
label.terms b { color: var(--fg); }
.muted-box { border: 1px solid color-mix(in oklch, var(--border) 70%, transparent); border-radius: 10px; padding: 16px; background: color-mix(in oklch, var(--muted) 30%, transparent); }

/* projects view */
.proj-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.proj-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in oklch, var(--primary) 12%, transparent); color: var(--primary); }
.proj-icon .ico { width: 16px; height: 16px; }
.work-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.work-head h3 { font-size: 16px; font-weight: 600; }
.link-muted { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted-fg); text-decoration: none; }
.link-muted:hover { color: var(--fg); }
.link-muted .ico { width: 16px; height: 16px; }
details.fold { border: 1px solid color-mix(in oklch, var(--border) 70%, transparent); border-radius: 10px; }
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 14px; font-weight: 600; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .ico { width: 16px; height: 16px; color: var(--muted-fg); transition: transform .15s; }
details.fold[open] > summary .ico { transform: rotate(180deg); color: var(--primary); }
details.fold > .fold-body { border-top: 1px solid color-mix(in oklch, var(--border) 70%, transparent); padding: 16px; display: grid; gap: 24px; }

/* expandable rows (settlement, archive) */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--border); }
.rows-head { display: none; gap: 16px; padding: 8px 16px; border-bottom: 1px solid var(--border); background: color-mix(in oklch, var(--muted) 40%, transparent);
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-fg); }
details.row > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 16px; }
details.row > summary::-webkit-details-marker { display: none; }
details.row > summary:hover { background: color-mix(in oklch, var(--muted) 50%, transparent); }
details.row > summary .chev { width: 16px; height: 16px; color: var(--muted-fg); transition: transform .15s; }
details.row[open] > summary .chev { transform: rotate(180deg); color: var(--primary); }
.row-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-title > span { min-width: 0; display: grid; }
.row-body { border-top: 1px solid color-mix(in oklch, var(--border) 70%, transparent); background: color-mix(in oklch, var(--muted) 25%, transparent); padding: 12px 16px; }
.sm-only { display: block; }
.lg-col { display: none; }
@media (min-width: 640px) {
  .settle .rows-head, .settle details.row > summary { display: grid; grid-template-columns: minmax(0, 1fr) 7rem 6rem 8rem; }
  .settle .lg-col { display: flex; justify-content: center; }
  .settle .sm-only { display: none; }
}
@media (min-width: 768px) {
  .archive .rows-head, .archive details.row > summary { display: grid; grid-template-columns: minmax(0, 1fr) 7rem 7rem 8rem 8rem; gap: 12px; }
  .archive .lg-col { display: block; color: var(--muted-fg); font-size: 14px; }
  .archive .sm-only { display: none; }
}
.stats { display: grid; gap: 16px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stat { display: flex; align-items: center; gap: 12px; padding: 16px; }
.stat-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in oklch, var(--primary) 10%, transparent); color: var(--primary); flex: none; }
.stat-ico .ico { width: 20px; height: 20px; }
.stat p { font-size: 12px; color: var(--muted-fg); } .stat strong { font-size: 18px; font-weight: 600; display: block; }
.section-title { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.list-box { border: 1px solid var(--border); border-radius: 14px; background: var(--card); overflow: hidden; }
.list-box ul { list-style: none; margin: 0; padding: 0; }
.list-box li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 16px; font-size: 14px; }
.list-box li + li { border-top: 1px solid var(--border); }
.list-box .list-foot { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--border); background: color-mix(in oklch, var(--muted) 40%, transparent); font-size: 14px; }

/* account */
.info-list { display: grid; gap: 12px; font-size: 14px; }
.info-list > div { display: flex; align-items: center; gap: 8px; color: var(--muted-fg); }
.info-list span { color: var(--fg); }
.narrow { max-width: 32rem; }

/* nav dot for pending decisions */
.nav-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

/* lightbox */
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1100px); max-height: 92svh; }
dialog.lightbox::backdrop { background: oklch(0 0 0 / 70%); }
dialog.lightbox img { display: block; max-width: 100%; max-height: 84svh; border-radius: 10px; margin: auto; }
dialog.lightbox .lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: white; padding: 0 0 8px; font-size: 14px; }
dialog.lightbox .lb-bar a, dialog.lightbox .lb-bar button { color: white; }
.version-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.vnum { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: color-mix(in oklch, var(--primary) 12%, transparent); color: var(--primary); font-size: 11px; font-weight: 700; }
.decision-box { display: grid; gap: 4px; border-radius: 10px; background: color-mix(in oklch, var(--muted) 60%, transparent); padding: 12px; font-size: 14px; margin-top: 14px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-fg); text-decoration: none; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.back-link:hover { color: var(--fg); }
.back-link .ico { width: 16px; height: 16px; }
[hidden] { display: none !important; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; padding: 0; flex: none; margin: 2px 0 0; }
