/* AF CDT · layout only. Every colour, radius and size comes from the kit roles. */

html, body { margin: 0; min-height: 100%; }
body.lv { min-height: 100vh; }

/* ── shell ─────────────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.app-side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--sp-16);
  padding: 0 var(--sp-12) var(--sp-16); background: var(--surface-chrome); border-right: 1px solid var(--border-subtle);
}
.app-brand {
  display: flex; align-items: center; gap: var(--sp-10); height: var(--ctl-bar); padding: 0 var(--sp-8);
  font-size: var(--fs-titleM); line-height: var(--lh-titleM); color: var(--text-secondary);
}
.app-brand b { font-weight: 600; color: var(--text-primary); }
.app-nav { display: flex; flex-direction: column; gap: var(--sp-2); }
.app-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--sp-2); }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-main > .lv-bar { position: sticky; top: 0; z-index: 20; }
.app-bar-acts { display: flex; align-items: center; gap: var(--sp-8); padding: 0 var(--sp-20); }
.app-view { padding: var(--sp-32) var(--sp-32) var(--sp-64); max-width: 1320px; width: 100%; }

/* ── who am I · notifications ──────────────────────────────────────────── */
.app-me .lv-avatar { margin-left: -2px; }
.app-bell { position: relative; }
.app-bell-btn { position: relative; }
.app-bell-btn .lv-dot--badge { right: var(--sp-6); top: var(--sp-6); }
.app-bell-pop { width: 360px; max-width: calc(100vw - var(--sp-32)); padding: var(--sp-4); }
.app-bell-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-8); padding-right: var(--sp-10); }
.app-bell-list { max-height: 360px; }
.app-notif { align-items: flex-start; white-space: normal; }
.app-notif .lv-dot, .app-notif-pad { margin-top: var(--sp-6); width: 6px; flex: 0 0 auto; }
.app-notif-b { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.app-notif-b .t { color: var(--text-secondary); }
.app-notif.is-new .t { color: var(--text-primary); font-weight: 500; }
.app-notif-b .m { font-size: var(--fs-labelS); line-height: var(--lh-labelS); color: var(--text-muted); }

/* ── page header ───────────────────────────────────────────────────────── */
.app-head { margin-bottom: var(--sp-24); }
.app-head .lv-page-title { font-size: var(--fs-displayS); line-height: var(--lh-displayS); }
.app-head .lv-page-lead { margin-top: var(--sp-8); font-size: var(--fs-bodyM); line-height: var(--lh-bodyM); }

/* ── toolbar: tabs, filters, search ───────────────────────────────────── */
.app-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); margin-bottom: var(--sp-16); }
.app-toolbar > .lv-search { width: 240px; }
.app-toolbar .lv-ctl, .app-toolbar > select { width: 180px; }
.app-toolbar > .grow { flex: 1 1 auto; }
.app-toolbar .lv-chips { margin-bottom: 0; }
.app-tabs { margin-bottom: var(--sp-20); }

/* ── cards and sections ────────────────────────────────────────────────── */
.app-card { background: var(--surface-default); border-radius: var(--r-2xl); box-shadow: var(--shadow-card); }
.app-card--pad { padding: var(--sp-20) var(--sp-24); }
.app-stack { display: flex; flex-direction: column; gap: var(--sp-24); }
.app-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-24); }
.app-grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-24); align-items: start; }

/* ── KPI row ───────────────────────────────────────────────────────────── */
.app-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--sp-16); }
.app-kpis .lv-kpi { background: var(--surface-default); border-radius: var(--r-2xl); box-shadow: var(--shadow-card); }
/* ── big stats (kit .lv-stat, laid out for the dashboard) ──────────────── */
.app-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-32) var(--sp-24); padding: var(--sp-8) 0 var(--sp-4); }
.app-stat { border-top: 0; padding-top: 0; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.app-stat-n { color: var(--text-tertiary); font-weight: 600; height: var(--fs-cDisplayL); align-items: center; }
.app-stat-l { margin-top: var(--sp-12); font-family: var(--font-canvas); font-size: var(--fs-cTitleM); line-height: var(--lh-cTitleM); font-weight: 600; color: var(--text-primary); }
.app-stat-s { margin-top: var(--sp-2); }
.app-stat-l { display: inline-flex; align-items: center; gap: var(--sp-4); }
.app-stat-edit { color: var(--text-muted); }
.app-stat-s:not([class*="lv-tone--"]) { color: var(--text-muted); }
.app-ring { position: relative; width: var(--fs-cDisplayL); height: var(--fs-cDisplayL); display: inline-flex; align-items: center; justify-content: center; }
.app-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.app-ring circle { fill: none; stroke-width: 13; }
.app-ring .track { stroke: var(--text-tertiary); }
.app-ring .arc { stroke: var(--brand-primary); stroke-linecap: round; }
.app-ring b { font-size: var(--fs-labelM); font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* ── categories · the brand beam, as the kit colours its typologies ─────
   Used only as dot (.lv-tipo-dot), bar and stripe: never on text or blocks. */
.cat-nd, .cat-tf_review, .cat-project { --tipo: var(--beam-4); }
.cat-remodel, .cat-tf_dev, .cat-testfit { --tipo: var(--beam-6); }
.cat-relocation, .cat-process_street, .cat-sourcing { --tipo: var(--beam-7); }
.cat-rebrand, .cat-const_review, .cat-manual { --tipo: var(--beam-3); }
.cat-ode { --tipo: var(--beam-2); }
.cat-other, .cat-general { --tipo: var(--tipo-analisis); }
.cat-pending { --tipo: var(--brand-primary); }

/* ── table (list rows on a grid) ───────────────────────────────────────── */
.app-table { display: flex; flex-direction: column; }
.app-table .lv-thead--caps, .app-table .lv-listrow--table { display: grid; grid-template-columns: var(--cols); column-gap: var(--sp-20); }
.app-table .lv-listrow--table { cursor: pointer; padding-top: var(--sp-6); padding-bottom: var(--sp-6); }
.app-table .lv-listrow--table > * { min-width: 0; }
.app-table .cell-main { display: flex; flex-direction: column; min-width: 0; }
.app-table .cell-main .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-table .cell-main .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-table .cell-acts { display: flex; justify-content: flex-end; gap: var(--sp-2); }
.app-code { font-family: var(--font-mono); font-size: var(--fs-labelM); color: var(--text-tertiary); }
.app-muted { color: var(--text-muted); }
.app-small { font-size: var(--fs-labelM); line-height: var(--lh-labelM); }
.app-ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── project detail ────────────────────────────────────────────────────── */
.app-back { margin-bottom: var(--sp-16); }
.app-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-24); margin-bottom: var(--sp-24); }
.app-detail-head .lv-page-title--doc { margin: var(--sp-4) 0 0; }
.app-detail-head .act { display: flex; gap: var(--sp-8); flex: 0 0 auto; }
.app-props { display: grid; grid-template-columns: 130px minmax(0, 1fr); row-gap: var(--sp-10); column-gap: var(--sp-16); margin: 0; }
.app-props dt { color: var(--text-muted); font-size: var(--fs-labelM); line-height: var(--lh-bodyM); }
.app-props dd { margin: 0; color: var(--text-primary); min-width: 0; overflow-wrap: anywhere; }
.app-props a { color: var(--text-accent); display: inline-flex; align-items: center; gap: var(--sp-4); }
.app-props a:hover { text-decoration: underline; }
.app-props a svg { width: 14px; height: 14px; }

.app-procs { display: flex; flex-direction: column; gap: var(--sp-8); }
.app-proc {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-12);
  padding: var(--sp-12) var(--sp-16); border-radius: var(--r-xl); background: var(--bg-default);
}
.app-proc.is-off { opacity: .45; }
.app-proc.is-off .app-proc-acts .lv-btn { display: none; }
.app-proc-t { font-weight: 500; color: var(--text-primary); }
.app-proc-m { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); margin-top: var(--sp-4); font-size: var(--fs-labelM); line-height: var(--lh-labelM); color: var(--text-muted); }
.app-proc-acts { display: flex; align-items: center; gap: var(--sp-6); flex-wrap: wrap; justify-content: flex-end; }

.app-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-10); max-height: 420px; overflow: auto; }
.app-log li { display: flex; flex-direction: column; gap: 1px; padding-left: var(--sp-12); border-left: 2px solid var(--border-subtle); }
.app-log li:first-child { border-left-color: var(--brand-primary); }
.app-log .t { color: var(--text-secondary); }
.app-log .m { font-size: var(--fs-labelS); line-height: var(--lh-labelS); color: var(--text-muted); }

/* ── switch (compose with kit roles) ───────────────────────────────────── */

/* ── tasks ─────────────────────────────────────────────────────────────── */
.app-tasks { display: flex; flex-direction: column; gap: var(--sp-6); }
.app-task {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-12);
  padding: var(--sp-10) var(--sp-12) var(--sp-10) var(--sp-16); border-radius: var(--r-xl); background: var(--surface-default);
  box-shadow: var(--shadow-card); position: relative;
}
.app-task::before { content: ""; position: absolute; left: 0; top: var(--sp-10); bottom: var(--sp-10); width: 3px; border-radius: var(--r-full); background: var(--tipo, var(--border-strong)); }
.app-task.is-done { opacity: .55; }
/* Sortable rows: a grip column, shown on hover. */
.app-task.is-sortable { grid-template-columns: 14px 22px minmax(0, 1fr) auto; padding-left: var(--sp-8); cursor: grab; }
.app-grip { display: inline-flex; color: var(--text-muted); opacity: 0; transition: opacity .15s; }
.app-grip svg { width: 14px; height: 14px; }
.app-task.is-sortable:hover .app-grip { opacity: 1; }
.app-task.is-dragging { opacity: .5; box-shadow: 0 0 0 1px var(--brand-primary); }
/* Urgent: flag always visible, tag before the title. */
.app-urgent-btn.is-on { color: var(--status-error); }
.app-task.is-urgent { box-shadow: var(--shadow-card), inset 0 0 0 1px color-mix(in srgb, var(--status-error) 45%, transparent); }
.app-urgent-tag { display: inline-block; margin-right: var(--sp-6); padding: 0 var(--sp-6); border-radius: var(--r-full); font-size: var(--fs-labelS); line-height: 18px; font-weight: 600; color: var(--status-error-text, var(--status-error)); background: var(--status-error-bg, transparent); vertical-align: 1px; }
.app-task.is-done .app-task-t { text-decoration: line-through; }
.app-task-t { font-weight: 500; color: var(--text-primary); }
.app-task-m { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-6) var(--sp-10); margin-top: var(--sp-2); font-size: var(--fs-labelM); line-height: var(--lh-labelM); color: var(--text-muted); }
.app-task-m a { color: var(--text-accent); }
.app-task-m a:hover { text-decoration: underline; }
.app-task-r { display: flex; align-items: center; gap: var(--sp-8); }
.app-task-due { font-size: var(--fs-labelM); color: var(--text-muted); white-space: nowrap; }
.app-task .lv-listrow-acts { opacity: 0; }
.app-task:hover .lv-listrow-acts, .app-task:focus-within .lv-listrow-acts { opacity: 1; }
button.lv-check { cursor: pointer; padding: 0; }
button.lv-check:not(.is-on) svg { visibility: hidden; }
.app-group-h { display: flex; align-items: center; gap: var(--sp-8); margin: var(--sp-16) 0 var(--sp-8); font-size: var(--fs-labelM); font-weight: 500; color: var(--text-muted); }
.app-group-h:first-child { margin-top: 0; }
.app-legend { display: flex; flex-wrap: wrap; gap: var(--sp-16); font-size: var(--fs-labelM); color: var(--text-muted); }
.app-legend span { display: inline-flex; align-items: center; gap: var(--sp-6); }

/* ── project: comments, links ──────────────────────────────────────────── */
.app-comment-form { display: flex; flex-direction: column; gap: var(--sp-8); margin-bottom: var(--sp-12); }
.app-comment-form .lv-ctl { width: 160px; }
.app-comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-8); }
.app-comments p { margin: 0; white-space: pre-wrap; }
.app-comments .m { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-8); margin-top: var(--sp-4); font-size: var(--fs-labelS); color: var(--text-muted); }
.app-linkbtn { color: var(--text-accent); font-size: var(--fs-labelM); }
.app-linkbtn:hover { text-decoration: underline; }
.app-detail-head .act { flex-wrap: wrap; justify-content: flex-end; }

/* ── photos ────────────────────────────────────────────────────────────── */
.app-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-12); }
.app-photo { display: flex; flex-direction: column; min-width: 0; border-radius: var(--r-xl); overflow: hidden; background: var(--bg-default); text-align: left; }
.app-photo-img { display: block; width: 100%; aspect-ratio: 4 / 3; background: color-mix(in srgb, var(--text-primary) 6%, transparent); cursor: zoom-in; padding: 0; }
.app-photo-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.app-photo.is-missing .app-photo-img::after { content: "File not in this browser"; display: flex; align-items: center; justify-content: center; height: 100%; font-size: var(--fs-labelS); color: var(--text-muted); }
.app-photo-f { display: flex; flex-direction: column; gap: var(--sp-6); padding: var(--sp-8); }
.app-photo-f .lv-ctl { width: 100%; }
.app-photo-f .app-row { flex-wrap: nowrap; gap: var(--sp-4); }
.app-photo-f .app-row .lv-ctl { flex: 1 1 auto; }
.app-photo-t { font-weight: 500; color: var(--text-primary); }
.app-drop { max-width: none; cursor: pointer; padding: var(--sp-32) var(--sp-24); }
[data-photos].is-over { box-shadow: var(--shadow-card), inset 0 0 0 2px var(--border-focus); }
.app-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-16); }
.app-photo--lib { background: var(--surface-default); box-shadow: var(--shadow-card); cursor: pointer; transition: box-shadow var(--motion-fast); }
.app-photo--lib:hover { box-shadow: var(--shadow-lift); }
.app-photo--lib .app-photo-f { gap: var(--sp-2); padding: var(--sp-10) var(--sp-12) var(--sp-12); }
.app-viewer .lv-dialog-body img { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--r-lg); background: var(--bg-base); }

/* ── CAPs ──────────────────────────────────────────────────────────────── */
.app-country { margin-bottom: var(--sp-16); }
.app-country > .lv-sechead { margin-bottom: var(--sp-8); }

/* ── dashboard ─────────────────────────────────────────────────────────── */
.app-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-8); align-items: end; height: 180px; }
.app-bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; height: 100%; gap: var(--sp-6); }
.app-bar .stack { display: flex; flex-direction: column-reverse; border-radius: var(--r-sm); overflow: hidden; min-height: 2px; background: color-mix(in srgb, var(--text-primary) 6%, transparent); }
.app-bar .stack i { display: block; }
.app-bar .stack i { background: var(--tipo); }
.app-bar .lbl { text-align: center; font-size: var(--fs-labelS); color: var(--text-muted); }
.app-bar .num { text-align: center; font-size: var(--fs-labelS); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.app-bar.is-on .lbl { color: var(--text-accent); }

.app-attn .lv-listrow .t { white-space: normal; }

/* ── settings ──────────────────────────────────────────────────────────── */
.app-team { display: flex; flex-wrap: wrap; gap: var(--sp-6); margin-bottom: var(--sp-12); }
.app-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); }

/* ── dialogs taller than the window scroll with the veil instead of being cut off ── */
#layer .lv-scrim { align-items: flex-start; }
#layer .lv-dialog { margin: auto; }
.lv-listrow--check { cursor: pointer; }

/* ── toast host ────────────────────────────────────────────────────────── */
.app-toast-host { position: fixed; left: 0; right: 0; bottom: var(--sp-24); height: 0; z-index: 900; }

/* Anything toggled with the hidden attribute stays hidden, whatever its display. */
[hidden] { display: none !important; }

/* ── dashboard headline: delivered (big, brand) · in process · registered ── */
.app-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: var(--sp-32); padding: var(--sp-32) var(--sp-32); }
.app-hero-main { display: flex; flex-direction: column; min-width: 0; }
.app-hero-main .n { font-size: calc(var(--fs-cDisplayXL) * 1.5); line-height: .9; font-weight: 600; letter-spacing: -.04em; color: var(--brand-primary); font-variant-numeric: tabular-nums; }
.app-hero-main .l { margin-top: var(--sp-12); font-size: var(--fs-titleL); line-height: var(--lh-titleL); font-weight: 600; color: var(--text-primary); }
.app-hero-main .s { margin-top: var(--sp-2); font-size: var(--fs-labelM); color: var(--text-muted); }
.app-hero-targets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-16); padding-left: var(--sp-32); border-left: 1px solid var(--border-subtle); }
.app-hero-targets .app-stat-l { font-size: var(--fs-labelL); line-height: var(--lh-labelL, 1.3); }
.app-hero-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-24); }
.app-hero-fig { display: flex; flex-direction: column; min-width: 0; }
.app-hero-fig .n { font-size: var(--fs-cDisplayM); line-height: 1; font-weight: 600; letter-spacing: -.02em; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.app-hero-fig .l { margin-top: var(--sp-8); font-size: var(--fs-labelL); font-weight: 600; color: var(--text-primary); }
.app-hero-fig .s { margin-top: var(--sp-2); font-size: var(--fs-labelM); color: var(--text-muted); }

/* ── daily tasks: Projects (by process) and Others ────────────────────── */
.app-task-sec + .app-task-sec { margin-top: var(--sp-32); }
.app-group-h--lg { font-size: var(--fs-titleM); line-height: var(--lh-titleM); font-weight: 600; color: var(--text-primary); }
.app-subgroup-h { display: flex; align-items: center; gap: var(--sp-8); margin: var(--sp-16) 0 var(--sp-8); font-size: var(--fs-labelM); font-weight: 500; color: var(--text-secondary); }
.app-subgroup-h > span:last-child:not(.lv-count) { color: var(--text-muted); font-weight: 400; }
.app-group-h > span:last-child:not(.lv-count) { font-weight: 400; }
.app-none { padding: var(--sp-4) 0 var(--sp-4) var(--sp-16); }

/* ── pending items dialog ──────────────────────────────────────────────── */
.app-pend-head, .app-pend-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-8); }
.app-pend-head { font-size: var(--fs-labelS); font-weight: 500; color: var(--text-muted); }
.app-pend-rows { display: flex; flex-direction: column; gap: var(--sp-8); margin: var(--sp-6) 0 var(--sp-8); }
.app-pend-row .is-error { border-color: var(--status-error, var(--border-strong)); }

/* ── task attachments ──────────────────────────────────────────────────── */
.app-file { display: inline-flex; align-items: center; gap: var(--sp-4); max-width: 240px; padding: 0; border: 0; background: none; font: inherit; color: var(--text-accent); cursor: pointer; }
.app-file:hover span { text-decoration: underline; }
.app-file svg, .app-files-row svg { width: 14px; height: 14px; flex: 0 0 auto; }
.app-files { display: flex; flex-direction: column; gap: var(--sp-4); }
.app-files:empty { display: none; }
.app-files-row { display: flex; align-items: center; gap: var(--sp-8); min-width: 0; padding: var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-10); border-radius: var(--r-md); background: var(--surface-sunken, var(--bg-base)); }
.app-files-row .app-ell { flex: 1 1 auto; min-width: 0; }
.app-files-add { align-self: flex-start; margin-top: var(--sp-6); }

/* ── monthly report ────────────────────────────────────────────────────── */
.app-report-layer { position: fixed; inset: 0; z-index: 800; overflow: auto; background: var(--bg-base); padding: 0 var(--sp-16) var(--sp-48); }
.app-report-bar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: var(--sp-8); max-width: 900px; margin: 0 auto; padding: var(--sp-12) 0; background: var(--bg-base); }
.app-report-bar .t { display: inline-flex; align-items: center; gap: var(--sp-8); font-weight: 600; color: var(--text-primary); }
.app-report-bar .t svg { width: 18px; height: 18px; }
.app-report-bar .grow { flex: 1 1 auto; }
.app-report { max-width: 900px; margin: 0 auto; padding: var(--sp-40) var(--sp-48); background: var(--surface-default); color: var(--text-primary); border-radius: var(--r-2xl); box-shadow: var(--shadow-card); }
.app-report section { margin-top: var(--sp-32); }
.rp-figs, .rp-cols section, .rp-table tr, .app-report h2 { break-inside: avoid; }
.app-report h2 { break-after: avoid; }
.app-report h2 { display: flex; align-items: baseline; gap: var(--sp-8); margin: 0 0 var(--sp-12); padding-bottom: var(--sp-6); border-bottom: 1px solid var(--border-subtle); font-size: var(--fs-titleM); line-height: var(--lh-titleM); font-weight: 600; }
.app-report h2 span { color: var(--text-muted); font-weight: 500; }
.rp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--sp-24); }
.rp-eyebrow { font-size: var(--fs-labelS); letter-spacing: .08em; text-transform: uppercase; color: var(--text-accent); font-weight: 600; }
.rp-head h1 { margin: var(--sp-6) 0 0; font-family: var(--font-canvas); font-size: var(--fs-cDisplayS); line-height: 1.1; font-weight: 600; }
.rp-logo { display: block; height: 44px; width: auto; flex: 0 0 auto; }
.rp-table td:not(:first-child), .rp-table th:not(:first-child) { text-align: right; }
.rp-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: var(--sp-24); align-items: center; padding: var(--sp-24); border-radius: var(--r-xl); background: var(--bg-base); break-inside: avoid; }
.rp-hero-main { display: flex; flex-direction: column; min-width: 0; }
.rp-hero-main b { font-family: var(--font-canvas); font-size: calc(var(--fs-cDisplayXL) * 1.4); line-height: .9; font-weight: 600; letter-spacing: -.04em; color: var(--brand-primary); font-variant-numeric: tabular-nums; }
.rp-hero-main span { margin-top: var(--sp-10); font-size: var(--fs-titleL); line-height: var(--lh-titleL); font-weight: 600; }
.rp-hero-main i { margin-top: var(--sp-2); font-style: normal; font-size: var(--fs-labelM); color: var(--text-muted); }
.rp-hero-year { padding-left: var(--sp-24); border-left: 1px solid var(--border-subtle); min-width: 0; }
.rp-hero-k { display: block; margin-bottom: var(--sp-12); font-size: var(--fs-labelS); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--text-muted); }
.rp-hero-rings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-16); }
.rp-yr { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.rp-ring { position: relative; width: 64px; height: 64px; display: inline-flex; align-items: center; justify-content: center; }
.rp-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.rp-ring circle { fill: none; stroke-width: 12; }
.rp-ring .track { stroke: var(--border-subtle); }
.rp-ring .arc { stroke: var(--brand-primary); stroke-linecap: round; }
.rp-ring b { font-size: var(--fs-labelM); font-weight: 600; font-variant-numeric: tabular-nums; }
.rp-ring--n b { font-family: var(--font-canvas); font-size: var(--fs-cDisplayS); line-height: 1; }
.rp-yr .v { margin-top: var(--sp-8); font-weight: 600; font-size: var(--fs-labelL); font-variant-numeric: tabular-nums; }
.rp-yr .l { margin-top: var(--sp-2); font-size: var(--fs-labelS); color: var(--text-muted); }
.rp-figs--small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rp-figs--small .rp-fig { padding: var(--sp-12); }
.rp-figs--small .rp-fig b { font-size: var(--fs-titleL); line-height: var(--lh-titleL); }
.rp-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--sp-16); }
.rp-fig { display: flex; flex-direction: column; padding: var(--sp-16); border-radius: var(--r-lg); background: var(--bg-base); }
.rp-fig b { font-family: var(--font-canvas); font-size: var(--fs-cDisplayS); line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.rp-fig span { margin-top: var(--sp-8); font-weight: 600; font-size: var(--fs-labelL); }
.rp-fig i { margin-top: var(--sp-2); font-style: normal; font-size: var(--fs-labelS); color: var(--text-muted); }
.rp-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-24); }
.rp-table { width: 100%; border-collapse: collapse; font-size: var(--fs-labelL); }
.rp-table th { text-align: left; font-weight: 600; font-size: var(--fs-labelS); text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: var(--sp-6) var(--sp-8) var(--sp-6) 0; border-bottom: 1px solid var(--border-subtle); }
.rp-table td { padding: var(--sp-6) var(--sp-8) var(--sp-6) 0; border-bottom: 1px solid var(--border-subtle); vertical-align: top; font-variant-numeric: tabular-nums; }
.rp-code { font-family: var(--font-mono, 'JetBrains Mono', monospace); font-size: var(--fs-labelS); }
.rp-empty { margin: 0; color: var(--text-muted); font-size: var(--fs-labelL); }
.rp-foot { margin-top: var(--sp-40); padding-top: var(--sp-12); border-top: 1px solid var(--border-subtle); font-size: var(--fs-labelS); color: var(--text-muted); }

@media print {
  html, body.has-report { background: #fff !important; }
  body.has-report > *:not(.app-report-layer) { display: none !important; }
  body.has-report .app-report-layer { position: static; overflow: visible; padding: 0; background: #fff; }
  body.has-report .app-report-bar { display: none; }
  body.has-report .app-report { max-width: none; padding: 14mm; -webkit-box-decoration-break: clone; box-decoration-break: clone; border-radius: 0; box-shadow: none; background: #fff; }
  @page { size: A4 portrait; margin: 0; }
}

/* ── responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .app-grid-main, .app-grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .app-hero { grid-template-columns: minmax(0, 1fr); gap: var(--sp-20); padding: var(--sp-24) var(--sp-20); }
  .app-hero-side, .app-hero-targets { padding-left: 0; border-left: 0; padding-top: var(--sp-20); border-top: 1px solid var(--border-subtle); }
  .rp-cols, .rp-hero { grid-template-columns: minmax(0, 1fr); }
  .rp-hero-year { padding-left: 0; border-left: 0; padding-top: var(--sp-16); border-top: 1px solid var(--border-subtle); }
  .app-report { padding: var(--sp-24) var(--sp-16); }
  .app { grid-template-columns: minmax(0, 1fr); }
  .app-side { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 0 var(--sp-12); border-right: 0; border-bottom: 1px solid var(--border-subtle); }
  .app-nav, .app-side-foot { flex-direction: row; margin-top: 0; }
  .app-nav .lv-navrow span, .app-side-foot .lv-navrow span { display: none; }
  .app-view { padding: var(--sp-20) var(--sp-16) var(--sp-48); }
  .app-table .lv-thead--caps { display: none; }
  .app-table .lv-listrow--table { grid-template-columns: minmax(0, 1fr) auto !important; }
  .app-table .lv-listrow--table > .hide-sm { display: none; }
  .app-toolbar > .lv-search, .app-toolbar .lv-ctl { width: 100%; }
}

/* ── sign-in gate ──────────────────────────────────────────────────────── */
body.is-gated .app { display: none; }
.app-gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--sp-24) max(16px, env(safe-area-inset-right, 0px)) var(--sp-24) max(16px, env(safe-area-inset-left, 0px)); background: var(--bg-base); }
.app-gate-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-12); padding: var(--sp-32); border-radius: var(--r-2xl); background: var(--surface-default); box-shadow: var(--shadow-card); }
.app-gate-card .app-brand { margin-bottom: var(--sp-8); }
.app-gate-card h1 { margin: 0; font-size: var(--fs-displayS); line-height: var(--lh-displayS); font-weight: 500; color: var(--text-primary); }
.app-gate-card p { margin: 0 0 var(--sp-8); color: var(--text-secondary); line-height: 1.5; }
.app-gate-card code { font-family: var(--font-mono); font-size: .9em; }

/* ── signed-in person in the sidebar ───────────────────────────────────── */
.app-me { cursor: default; }
.app-me-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.app-me-t i { font-style: normal; font-size: var(--fs-labelS); color: var(--text-muted); }

/* ── viewers: everything visible, nothing editable ─────────────────────── */
body.is-viewer [data-new], body.is-viewer button[data-edit], body.is-viewer a[data-edit], body.is-viewer [data-del],
body.is-viewer .lv-btn[data-act], body.is-viewer [data-dates], body.is-viewer [data-addtask], body.is-viewer [data-addpending],
body.is-viewer [data-target-edit], body.is-viewer [data-task-edit], body.is-viewer [data-task-del],
body.is-viewer [data-task-urgent]:not(.is-on), body.is-viewer [data-pend-edit], body.is-viewer [data-pend-del],
body.is-viewer form[data-comment], body.is-viewer [data-uncomment], body.is-viewer [data-unphoto],
body.is-viewer label:has(> [data-photo-input]), body.is-viewer [data-more] { display: none !important; }
body.is-viewer .lv-check, body.is-viewer .lv-switch, body.is-viewer [data-cycle], body.is-viewer [data-task-urgent],
body.is-viewer .lv-listrow[data-edit], body.is-viewer select[data-zone], body.is-viewer select[data-tier] { pointer-events: none; }
body.is-viewer .app-photo-f .lv-ctl, body.is-viewer .app-photo-f select { pointer-events: none; }

/* ── working year picker (sidebar) ─────────────────────────────────────── */
.app-year { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-8); margin: 0 0 var(--sp-12); padding: 0 var(--sp-12); font-size: var(--fs-labelS); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--text-muted); }
.app-year select, .app-year .lv-ctl { width: 110px; }
@media (max-width: 760px) { .app-year span { display: none; } .app-year { margin: 0; padding: 0; } }
