/* Office layout (KG3 buero-layout, 08.11.2026): one grid for every office page on a 27" monitor, tablet and phone.
   Linked LAST on each office page so it wins over the page styles. Findings: docs of the 27-inch test (M3, M4, M5, N7, N8, N9).
   - Width: the content uses up to --office-shell-max and stays centred; reading text keeps --office-measure.
   - Stability: nothing below the shared header / task navigation is painted until they are in place, so late
     navigation never pushes visible content (layout shift). A pure-CSS timeout releases it if a script never runs.
   - Targets: every checkbox and radio is a 44 px target, text is never below 12 px.
   Colours come only from the --ui-* tokens (theme.css), so dark mode follows automatically. */
:root {
  --office-shell-max: 136rem;
  --office-measure: 80ch;
  --office-min-target: 2.75rem;
}

/* ---------- Width and reading measure ---------- */
.ui .shell.shell {
  width: min(100% - clamp(2rem, 6vw, 8rem), var(--office-shell-max));
  margin-inline: auto;
}
@media (max-width: 47.99rem) { .ui .shell.shell { width: calc(100% - 2rem); } }
.ui .shell.shell :is(p, dd, .hint-text) { max-width: min(100%, var(--office-measure)); }
.ui .shell.shell :is(ul, ol):not([class]) > li,
.ui .shell.shell :is(.setup-steps li, li.id-meta) { max-width: min(100%, var(--office-measure)); }
/* Lists of cards use the width as columns instead of one endless row per entry. */
@media (min-width: 62rem) {
  .ui .shell.shell :is(.id-list, .hall-list, .setup-list, .absence-list) {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
    align-items: start;
  }
}

/* ---------- Stable first paint ---------- */
body main.shell:not([data-header-ready]) > :not(.module-head),
body[data-ot-task] main.shell:not([data-ot-ready]) > :not(.module-head) {
  visibility: hidden;
  animation: office-reveal 0s linear 2.4s forwards;
}
@keyframes office-reveal { to { visibility: visible; } }

/* ---------- Targets and type size ---------- */
.ui input[type="checkbox"],
.ui input[type="radio"] {
  width: var(--office-min-target); height: var(--office-min-target); min-height: var(--office-min-target);
  flex: none; accent-color: var(--ui-primary);
}
.ui .back, .ui a.back { display: inline-flex; align-items: center; min-height: var(--office-min-target); }
.ui .cc-tablet-bar, .ui .cc-tag, .ui .cc-kicker, .ui .cc-step { font-size: max(.8rem, 12px); }

/* ---------- Counter cash and member view on a wide screen (fits 1920 x 1080 without scrolling) ---------- */
@media (min-width: 68.75rem) {
  .ui .shell.mv { --mv-target: 3.25rem; }
  .ui .mv .module-head { margin-bottom: .5rem; }
  #mv-family-view {
    display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1.5rem; align-items: end;
  }
  #mv-family-view > .mv-back { grid-column: 1; grid-row: 1 / span 2; margin: 0; align-self: center; }
  #mv-family-view > .mv-eyebrow { grid-column: 2; grid-row: 1; }
  #mv-family-view > h1 { grid-column: 2; grid-row: 2; font-size: clamp(1.8rem, 2.4vw, 2.6rem); }
  #mv-family-view > .mv-strip { grid-column: 1 / -1; grid-row: 3; margin: .6rem 0 .7rem !important; padding: .45rem 1rem; }
  #mv-family-view > .mv-family-layout { grid-column: 1 / -1; grid-row: 4; gap: 1.5rem; }
  .mv-main { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 2rem; row-gap: .8rem; align-items: end; }
  .mv-main > .mv-person-head { grid-column: 1; margin-bottom: 0; }
  .mv-main > .mv-tabs { grid-column: 2; margin-bottom: 0; }
  .mv-main > :not(.mv-person-head):not(.mv-tabs) { grid-column: 1 / -1; }
  .mv-person-head h2 { font-size: 1.7rem; }
  .mv-photo-slot-head { width: 4rem; height: 4rem; }
  .mv-panel .mv-actions { margin-top: 0; }
  .cc-workspace { max-width: none; }
  .cc-workspace-head { padding: .6rem 1.1rem; }
  .cc-grid { min-height: 0; }
  .cc-column { padding: .7rem 1.1rem .9rem; }
  .cc-column h3 { margin: .1rem 0 .5rem; font-size: 1.15rem; }
  .cc-photo { width: 4.2rem; }
  .cc-person { margin-bottom: .5rem; }
  .cc-tablet-preview { min-height: 5rem; padding: .4rem; }
  .cc-total { margin: .4rem 0; font-size: clamp(2.2rem, 3vw, 3.2rem); }
  .cc-help { margin-bottom: .5rem; }
  .cc-warning { margin: .5rem 0; padding: .5rem .7rem; }
  .ui .mv .cc-workspace button:not(.cc-link) { min-height: 3rem; }
  .ui .mv .cc-workspace .cc-link { min-height: var(--office-min-target); margin-top: .2rem; }
  .cc-month { min-height: 3.25rem; padding: .35rem .6rem; }
}

/* ---------- Setup page: cards use the width as columns ---------- */
@media (min-width: 90rem) {
  .setup-shell .setup-grid { grid-template-columns: repeat(auto-fit, minmax(28rem, 1fr)); }
}

/* ---------- Counter cash: device hint and "choose a child" ---------- */
.cc-device-hint { margin: .1rem 0 0; font-size: max(.85rem, 12px); }
.cc-children { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: .6rem; }
.ui .mv .cc-workspace button.cc-child { display: grid; justify-items: start; gap: .1rem; height: auto; padding: .6rem .9rem; text-align: left; }
.cc-child small { color: var(--ui-muted); font-size: max(.85rem, 12px); }
.cc-choose { grid-column: 1 / -1; }

/* ---------- Trainer page: full width, trainer list as compact rows in columns (M5) ---------- */
.ui.tv2 .tv-shell { max-width: none; }
@media (min-width: 62rem) {
  .ui.tv2 .tv-management-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); gap: .5rem; }
}
.ui.tv2 .tv-management-item { padding: .5rem .8rem; gap: .1rem .8rem; }
.ui.tv2 .tv-management-item p { margin: 0; }
.ui.tv2 .tv-management-item .tv-btn { min-height: var(--office-min-target); padding-block: .35rem; }

/* ---------- Payment overview: the 80rem cap of its own stylesheet gave a 50 % wide page on 2560 px ---------- */
.pv-body .pv-shell.shell { max-width: none; }

/* ---------- Breadcrumb links are 44 px targets, too ---------- */
.ui .sp-back a { display: inline-flex; align-items: center; min-height: var(--office-min-target); min-width: var(--office-min-target); }

/* ---------- Admission header title was 11.2 px on a phone (N8) ---------- */
.ad-body.ui .ad-shell .av-top-title { font-size: max(.75rem, 12px); }
