:root{--bg:#f7f6f9;--paper:#fff;--ink:#24212e;--muted:#635e70;--line:#e2dfe7;--soft:#f0edf7;--brand:#403674;--action:#514584;--accent-text:#504280;--green:#403674;--green2:#584a8a;--gold:#da803f;--ok:#22684a;--touch:44px}
@media(prefers-color-scheme:dark){:root{--bg:#17151d;--paper:#24212d;--ink:#f4f0f8;--muted:#c6bed0;--line:#413c4c;--soft:#302b40;--brand:#362e57;--action:#544786;--accent-text:#d6c9fc;--green:#d1c3ee;--green2:#bfaee1;--gold:#eda774;--ok:#94deb4}}
.work-home,.project-area,.panel,.order-line{overflow-wrap:anywhere}
.work-hero{background:var(--brand);border-bottom:2px solid var(--gold)}.work-hero span,.work-hero small{color:#e8e2f2}
.work-actions .work-primary{background:#fff;color:#403674}.field-home .field-actions button{min-height:54px}
.project-symbol,.v2-initial{background:var(--soft);color:var(--accent-text)}
.order-line>button:first-child{min-width:0}.order-line strong,.work-name strong{overflow-wrap:anywhere}
.project-entry,.project-record,.order-line,.panel{box-shadow:none}
.order-next{border-inline-start:3px solid var(--gold);background:var(--soft);color:var(--ink);padding:.75rem 1rem}
.purchase-track{margin-block:1rem;background:var(--paper);color:var(--ink);border-radius:var(--radius);padding:clamp(.85rem,2vw,1.4rem)}
.purchase-track header{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem;flex-wrap:wrap;margin-bottom:.55rem}
.purchase-track header span,.track-stage small,.track-evidence time{font-size:.82rem;color:var(--muted)}
.track-stage{position:relative}.track-stage:not(:last-child):before{position:absolute;content:'';inset-inline-start:14px;top:30px;bottom:-8px;width:1px;background:var(--line)}
.track-stage summary{list-style:none;display:flex;align-items:center;gap:.8rem;min-height:48px;cursor:pointer}
.track-stage summary::-webkit-details-marker{display:none}.track-stage summary:after{content:'⌄';margin-inline-start:auto;color:var(--muted)}.track-stage[open] summary:after{transform:rotate(180deg)}
.track-stage summary:focus-visible{outline:2px solid var(--accent-text);outline-offset:2px}
.track-stage summary small,.track-stage summary strong{display:block}.track-stage summary strong{font-size:.93rem}
.track-marker{display:grid;place-items:center;z-index:1;width:29px;height:29px;flex:none;border-radius:50%;background:var(--bg);border:1px solid var(--line);color:var(--muted)}
.finished .track-marker{color:var(--ok);border-color:var(--ok);background:var(--paper)}
.present .track-marker{background:var(--action);color:white;border:0}.present summary strong{color:var(--accent-text)}
.track-evidence{margin-inline-start:2.7rem;padding:.4rem .75rem;background:var(--bg);border-radius:.6rem}.track-evidence ul{padding-inline-start:1rem}.track-evidence li{margin-block:.45rem}
.field-home>section:has(#field-tasks){margin-block:1rem}.field-home .field-prefs{margin-block-start:1rem}
.field-actions>.work-primary,.field-task button:first-of-type{background:var(--action);border-color:var(--action);color:white}
.field-secondary summary{min-height:48px;align-content:center;cursor:pointer;color:var(--accent-text);font-weight:600}
.field-task{border-color:var(--line)}.field-prefs button{color:var(--muted)}
html body .shell>aside{background:#29243e;color:#f3effa}
html body .shell>aside .active{background:#463e61;border-inline-start-color:var(--gold)}
.work-hero .work-secondary{background:transparent;color:white;border-color:#c3bbd6}
#toast{background:#302941;color:#fff}

/* Keep the visible mark compact while the entire caption remains tappable. */
#loginform > label:has(> input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  margin: 0;
  font-size: .9375rem;
  line-height: 1.5;
  cursor: pointer;
}
#loginform > label > input[type="checkbox"] {
  appearance: auto;
  box-sizing: border-box;
  width: 17px;
  height: 17px;
  min-width: 0;
  min-height: 0;
  flex: 0 0 17px;
  padding: 0;
  margin: 0;
  accent-color: var(--action);
}
.loginbox .btn .icon {
  width: 18px;
  height: 18px;
}
.loginbox details > summary {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
}
.loginbox summary::-webkit-details-marker { display: none; }
.loginbox details > summary::before {
  content: "";
  box-sizing: border-box;
  width: 8px;
  height: 8px;
  margin-inline: 4.5px;
  flex: none;
  border-inline-end: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg);
}
[dir="rtl"] .loginbox details > summary::before { transform: rotate(45deg); }
.loginbox details[open] > summary::before { transform: rotate(45deg); }
[dir="rtl"] .loginbox details[open] > summary::before { transform: rotate(-45deg); }

.startup-error { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.startup-error .loginbox { text-align: center; justify-items: center; }
.startup-error img { width: 48px; height: auto; }
.startup-error h1 { font-size: 1.4rem; margin: 0; }
.startup-error p { color: var(--muted); line-height: 1.6; }
.startup-error .btn { width: auto; min-width: 9rem; }

/* Give each department shortcut enough space for the icon and a full label. */
.actionbar.work-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: .5rem;
}
.work-shortcuts .btn {
  justify-content: flex-start;
  min-width: 0;
  min-height: 46px;
  padding: .55rem .75rem;
  gap: .5rem;
  font-size: .9375rem;
  line-height: 1.45;
  text-align: start;
  white-space: normal;
  overflow-wrap: normal;
}
.work-shortcuts .icon {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
}
