:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--text);background:var(--canvas);font-size:14px;--text:#183c40;--canvas:#f5f8f8;--surface:white;--teal:#008d87;--line:#dfe9e9}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,input,select,textarea{outline-offset:3px}button{cursor:pointer;border:1px solid var(--line);border-radius:7px;background:var(--surface);padding:10px 14px;color:inherit;font-weight:600}button:hover{background:#edf7f6;border-color:#73bbb6}button.primary{background:var(--teal);border-color:var(--teal);color:white}button.danger{color:#ac3935}button.small{padding:6px 9px;font-size:12px}a{color:#007f79}input,select,textarea{padding:10px;border:1px solid #cddcdd;border-radius:6px;background:var(--surface);color:var(--text);max-width:100%}textarea{min-height:90px;resize:vertical}label{display:grid;gap:6px;font-weight:600;font-size:12px}label.check{display:flex;align-items:center;font-size:13px}label.check input{width:auto}h1{font-size:29px;letter-spacing:-1px;margin:0 0 8px}h2{font-size:20px;letter-spacing:-.4px}h3{font-size:15px;margin:0 0 9px}p{line-height:1.6}small,.muted{color:#698084}.shell{display:grid;grid-template-columns:214px minmax(0,1fr);min-height:100vh}.sidebar{background:var(--surface);border-right:1px solid var(--line);padding:32px 18px;display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0;width:214px}.brand{font-size:19px;font-weight:850;letter-spacing:1px;margin:0 8px 9px;display:flex;align-items:center;gap:8px}.mark{background:var(--teal);color:white;display:inline-grid;place-items:center;width:28px;height:28px;border-radius:5px;font-weight:800}.subbrand{font-size:10px;letter-spacing:1.4px;color:#779090;margin-left:8px;margin-bottom:42px}.nav{display:grid;gap:8px}.nav button{text-align:left;border:0;background:transparent;padding:13px 12px;font-weight:500}.nav button.active{background:#e6f5f3;color:#007e78;font-weight:700}.nav b{margin-right:10px;font-size:17px}.sidefoot{margin-top:auto;padding-top:30px}.avatar{width:34px;height:34px;border-radius:50%;background:#dcf0ed;color:#007a73;display:inline-grid;place-items:center;font-weight:700}.userline{display:flex;align-items:center;gap:10px;margin-bottom:12px}.main{grid-column:2;padding:0 32px 40px;min-width:0}.topbar{height:72px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);margin-bottom:30px;color:#6c8587;font-size:12px}.topbar .badge{color:#557376}.titlebar{display:flex;align-items:center;justify-content:space-between;gap:16px}.eyebrow{font-size:10px;letter-spacing:1.5px;color:var(--teal);font-weight:750;margin:0 0 8px}.actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:25px 0}.stat{padding:20px;background:var(--surface);border:1px solid var(--line);border-radius:9px}.stat strong{display:block;font-size:27px;margin-top:10px;letter-spacing:-1px}.stat span{font-size:12px;color:#6e8386}.toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin:20px 0 14px}.search{width:250px}.filters{display:flex;gap:8px;flex-wrap:wrap}.filters select{font-size:12px;max-width:170px}.panel{border:1px solid var(--line);background:var(--surface);border-radius:9px;padding:20px;margin:16px 0}.notice{background:#edf7f6;color:#47716e;border:1px solid #cfe6e2;border-radius:7px;padding:11px 14px;font-size:12px;line-height:1.6}.warning{background:#fff5e7;color:#97631e;border-color:#f0d5ad}.badge{font-size:10px;display:inline-block;border-radius:4px;padding:4px 7px;background:#edf2f2;color:#60797c;font-weight:600;white-space:nowrap}.badge.teal{background:#e0f3ef;color:#00786d}.badge.red{background:#ffeded;color:#b04c43}.badge.amber{background:#fff2da;color:#9c6e1f}.urgentbox{margin:20px 0 14px;border:1px solid #ecdacc;border-radius:8px;background:#fffaf4;padding:14px 18px;color:#805e3c}summary{cursor:pointer;font-weight:600}.urgentrow{display:flex;justify-content:space-between;align-items:center;padding-top:14px}.boardwrap{overflow:auto;background:var(--surface);border:1px solid var(--line);border-radius:10px}.board{border-collapse:collapse;table-layout:fixed;width:100%;min-width:850px}.board th{font-size:11px;font-weight:550;color:#7a9092;background:#fbfdfd;height:66px;text-align:center;border-bottom:1px solid var(--line)}.board th:first-child{width:120px;text-align:left;padding-left:18px}.board th strong{display:block;color:#385559;font-size:16px;margin-top:6px}.board td{border-right:1px solid #e9eeee;border-bottom:1px solid var(--line);vertical-align:top;padding:9px;min-height:140px;height:145px}.board tr:last-child td{border-bottom:0}.board .team{background:#fbfdfd;padding:18px 14px}.team strong{font-size:12px}.team small{font-size:10px;display:block;margin:8px 0}.team .circle{width:25px;height:25px;border-radius:7px;background:#e9f0f0;display:inline-grid;place-items:center;margin-bottom:10px;font-size:10px}.cellhead{display:flex;justify-content:space-between;gap:3px;margin-bottom:6px;align-items:center;min-height:19px}.cellhead small{font-size:9px;line-height:1.4}.cellhead button{padding:1px 4px;border:0;background:transparent;font-size:12px}.job{border:1px solid #c9e6e2;border-left:3px solid #42a99d;background:#f0faf7;border-radius:5px;padding:10px;margin-bottom:7px;cursor:pointer;text-align:left;display:block;width:100%;font-weight:400}.job.progress{background:#edf5ff;border-color:#d5e4fa;border-left-color:#699bd4}.job.finished{background:#f1f3f4;border-color:#dfe4e5;border-left-color:#a2b2b5}.job.urgent{background:#fff2ef;border-color:#f2d6ce;border-left-color:#d77561}.job time{font-size:10px;font-weight:700;color:#527673}.job strong{font-size:12px;display:block;margin:6px 0;line-height:1.4}.job small{font-size:10px;display:block;line-height:1.5}.job .badge{font-size:9px;margin-top:8px}.today{background:#f0faf9!important}.legend{display:flex;gap:18px;flex-wrap:wrap;font-size:11px;color:#73898b;margin-top:16px}.dot{display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:5px;background:#42a99d}.dot.blue{background:#699bd4}.dot.gray{background:#a2b2b5}.dot.red{background:#d77561}.empty{text-align:center;color:#7e9395;padding:38px 20px;line-height:1.6}.projectgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:15px;margin-top:22px}.projectcard{background:var(--surface);border:1px solid var(--line);border-radius:9px;padding:22px}.projectcard h3{font-size:17px}.tabs{display:flex;gap:20px;border-bottom:1px solid var(--line);overflow:auto;margin-top:30px}.tabs button{border:0;background:none;padding:14px 0;border-radius:0;color:#74888a;white-space:nowrap}.tabs button.active{color:var(--teal);border-bottom:3px solid var(--teal)}.split{display:grid;grid-template-columns:1.4fr 1fr;gap:20px}.details{display:grid;grid-template-columns:130px 1fr;gap:15px;margin:20px 0}.details dt{color:#7c8f91;font-size:12px}.details dd{margin:0}.entry{padding:16px 0;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:14px;align-items:center}.entry:last-child{border-bottom:0}.entry p{margin:0}.photos{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:15px}.photos img{width:100%;height:180px;object-fit:cover;border-radius:6px}.daycards{display:grid;gap:16px;max-width:800px;margin:22px auto}.workcard{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:24px}.workcard h2{margin-top:10px}.login{max-width:440px;margin:9vh auto;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:38px}.login .brand{margin:0 0 35px}.login h1{font-size:25px}.login form{display:grid;gap:18px}.login p{color:#789092;font-size:13px}.error{color:#b34238;font-size:13px;white-space:pre-wrap}dialog{border:1px solid var(--line);border-radius:12px;box-shadow:0 25px 100px #173c4040;width:min(610px,95vw);padding:26px;max-height:90vh}dialog::backdrop{background:#12383c66}dialog form{display:grid;gap:15px}.formgrid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.modalhead{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.modalhead h2{margin:0}.modalhead button{padding:5px 10px}.formfoot{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.checks{display:grid;grid-template-columns:1fr 1fr;gap:9px;padding:12px;border:1px solid var(--line);border-radius:6px}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#153f40;color:white;border-radius:8px;padding:13px 22px;z-index:9;display:none;max-width:90vw;white-space:pre-wrap}.loading{padding:50px;text-align:center}.login footer{font-size:11px;color:#8c9c9e;margin-top:28px}table.list{border-collapse:collapse;width:100%}.list td,.list th{text-align:left;padding:14px;border-bottom:1px solid var(--line);font-size:12px}.list th{color:#7b9194;font-weight:500}.back{margin-bottom:20px}.sr{position:absolute;left:-9999px}@media(min-width:1600px){.main{padding-left:50px;padding-right:50px}.board td{height:170px}}@media(max-width:900px){.shell{grid-template-columns:1fr}.sidebar{position:static;width:auto;padding:15px;display:block;border-right:0;border-bottom:1px solid var(--line)}.brand{display:inline-flex;margin-bottom:6px}.subbrand{display:none}.nav{display:flex;overflow:auto;margin-top:10px;gap:4px}.nav button{white-space:nowrap;padding:10px}.sidefoot{padding:0;position:absolute;right:15px;top:18px}.sidefoot .userline{display:none}.sidefoot button{padding:7px;font-size:11px}.main{grid-column:1;padding:0 16px 30px}.topbar{height:45px;margin-bottom:22px}.stats{grid-template-columns:1fr 1fr;gap:10px}.stat{padding:15px}.titlebar{align-items:flex-start;flex-wrap:wrap}h1{font-size:25px}.split{grid-template-columns:1fr}.filters{width:100%}.search{width:100%}.login{margin:5vh 15px;padding:28px}.formgrid{grid-template-columns:1fr}.tabs{gap:18px}.checks{grid-template-columns:1fr}.topbar .muted{display:none}}


.euro-field{position:relative;display:block}.euro-field input{width:100%;padding-right:40px}.euro-field>span{position:absolute;right:13px;top:50%;transform:translateY(-50%);color:#47716e;pointer-events:none}.euro-field input::-webkit-inner-spin-button{appearance:none;margin:0}.euro-field input{appearance:textfield}

.economy-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.economy-stats .stat{text-align:left}@media(max-width:600px){.economy-stats{grid-template-columns:1fr}}

.economy-total{grid-column:1/-1}.economy-total strong,.worker-count{color:#187647}.economy-total strong{margin-bottom:4px}

.economy-expense strong,.expense-amount{color:#b42318}

.workforce-stats { grid-auto-rows: 1fr; }
.workforce-stats > .stat {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  font-weight: 400;
}
.workforce-stats > .stat strong { font-weight: 700; }

.workforce-stats>.workforce-projects{grid-column:2;grid-row:1}

.workforce-stats>.workforce-completed{grid-column:2;grid-row:2}


.workforce-stats>.contractor-stat{grid-column:1;grid-row:3}

.workforce-stats>.contractor-total{grid-column:2;grid-row:3}

.month-header {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}
.month-header button { min-height: 48px; padding: 0; font-size: 24px; }
.month-header h2 { margin: 0; text-align: center; font-size: clamp(18px, 3vw, 28px); }
.month-header h2::first-letter, .personal-agenda h3::first-letter { text-transform: uppercase; }
.month-hint { margin: 10px 0 0; text-align: center; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.month-weekday { padding-block: 6px; text-align: center; color: #698084; font-size: 12px; }
.month-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 52px;
  padding: 3px 0;
}
.month-weekend, .month-outside { background: var(--canvas); }
.month-outside { color: #637e81; }
.month-date { display: grid; place-items: center; width: 22px; height: 22px; }
.month-today .month-date { border-radius: 50%; background: #007e78; color: white; }
.month-day[aria-pressed="true"] { background: #e6f5f3; border-color: #008d87; }
.month-count {
  min-width: 16px;
  padding: 1px 3px;
  border-radius: 10px;
  background: #d6eeea;
  color: #165e58;
  font-size: 10px;
  text-align: center;
}
.personal-agenda { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.personal-agenda h3 { margin: 0; font-size: 17px; }
.personal-agenda-heading { display: grid; justify-items: start; gap: 10px; }
.personal-agenda-heading button { min-height: 44px; }
.personal-agenda-list { list-style: none; display: grid; gap: 8px; margin: 12px 0 0; padding: 0; }
.personal-agenda-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.personal-agenda-list p { min-width: 0; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.personal-agenda-list button { margin-left: auto; flex: none; min-height: 36px; }
@media (max-width: 480px) {
  .personal-calendar { padding: 12px; }
  .month-grid { gap: 4px; }
  .month-day { min-height: 48px; }
}

.workforce-stats>.absence-stat{grid-row:2}

.worker-job-actions>a{margin-inline-start:auto}

.worker-section-header{text-align:center}
.worker-section-header h2{margin:0 0 4px}
.worker-section-header p{font-size:.85rem;margin:0}
.worker-section-add{display:flex;justify-content:center;margin-top:12px}
.worker-section-add .worker-plus{width:44px;height:44px;padding:0;font-size:1.5rem}

.daycards #scheduled-reminders { margin: 0; }
.worker-today-assignments:not([hidden]) { display: grid; gap: inherit; }
.work-reveal-reset { justify-self: center; min-height: 44px; }
.work-reveal {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 104px;
  padding: 16px;
  border: 1px solid #08776b;
  border-radius: 12px;
  background: #08776b;
  color: white;
  text-align: left;
}
.work-reveal:hover { background: #08685e; border-color: #08685e; }
.work-reveal svg {
  width: 42px;
  height: 42px;
  padding: 9px;
  border-radius: 10px;
  background: rgb(255 255 255 / 15%);
}
.work-reveal strong { display: block; font-size: 1.1rem; }
.work-reveal small { color: #e0f5ee; font-weight: 400; }
.work-reveal-arrow { font-size: 1.3rem; }
@media (prefers-reduced-motion: no-preference) {
  .work-just-revealed { animation: work-reveal-in 280ms ease-out both; }
  @keyframes work-reveal-in {
    from { opacity: 0; transform: translateY(8px) scale(.985); }
    to { opacity: 1; transform: none; }
  }
}
.work-reminders { padding: 12px 16px; }
.work-reminders-title { margin: 0 0 8px; text-align: center; }
.work-reminders ul { margin: 0; padding-inline-start: 18px; }
.work-reminders li + li { margin-top: 4px; }
.worker-day-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.worker-day-navigation time { min-width: 140px; text-align: center; font-weight: 700; }
.worker-day-navigation button { width: 44px; min-height: 44px; font-size: 20px; }

.company-calendar-controls {
  display: grid;
  gap: 10px;
  width: min(250px, 100%);
  margin: 20px 0 14px;
}
.company-week-range { text-align: center; }
.company-week-navigation {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 8px;
}
.company-week-navigation button { min-height: 44px; padding-inline: 0; }
@media (max-width: 900px) {
  .company-calendar-controls { width: 100%; }
}

.clock-controls{display:grid;gap:12px;margin-top:16px}.clock-controls button{min-height:54px;font-size:1.1rem}.clock-controls .clock-start{min-height:104px;font-size:clamp(1.5rem,5vw,2.4rem)}.clock-controls button:disabled{opacity:.5;cursor:default}

.clock-timers{display:grid;grid-template-columns:repeat(auto-fit,minmax(135px,1fr));gap:12px;text-align:center;padding:16px;background:#edf7f6;border-radius:8px}.clock-timers span{display:block;color:#45696a;font-size:.9rem}.clock-timers strong{display:block;font-variant-numeric:tabular-nums;font-size:clamp(1.4rem,5vw,2.5rem);color:#006f65}

.clock-reminder{text-align:center}

.quick-clock-heading{text-align:center;margin-bottom:12px}
.sidebar .nav .clock-shortcut {
  display: grid;
  place-items: center;
  justify-self: center;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  padding: 0;
  border-radius: 50%;
  background: #008d87;
  color: white;
}
.sidebar .nav .clock-shortcut:hover,
.sidebar .nav .clock-shortcut.active { background: #00786f; }
.clock-shortcut, .clock-shortcut svg {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.clock-shortcut[aria-controls="voice-shortcut"] { touch-action: none; }
.voice-shortcut {
  position: fixed;
  z-index: 6;
  transform: translate(-50%, calc(-100% - 36px));
  visibility: hidden;
}
.voice-shortcut.is-visible { visibility: visible; }
.voice-shortcut button {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 50%;
  border-color: var(--teal);
  background: var(--surface);
  color: var(--teal);
}
.voice-shortcut-arrow {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  color: var(--teal);
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .voice-shortcut { transition: visibility 0s 300ms; }
  .voice-shortcut.is-visible { transition-delay: 0s; }
  .voice-shortcut-content {
    opacity: 0;
    transform: translateY(calc(50% + 36px + var(--voice-clock-radius, 25px)));
    transition: transform 300ms cubic-bezier(.2, .65, .3, 1), opacity 240ms ease-out;
  }
  .voice-shortcut.is-visible .voice-shortcut-content {
    opacity: 1;
    transform: translateY(0);
  }
}
#modal:has(.secretary-avatar) {
  width: min(610px, calc(100% - 24px));
  background: var(--canvas);
}
#modal:has(.secretary-avatar) .modalhead h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}
.secretary-avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--teal);
  background: var(--teal-tint, #e6f5f3);
}
.secretary-status, .secretary-intro p { margin: 0; }
.voice-transcript {
  min-height: 4.5em;
  margin: 0;
  padding: 12px;
  overflow-wrap: anywhere;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.voice-wave {
  --voice-level: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 64px;
}
.voice-wave span {
  height: calc(5px + var(--voice-level) * var(--voice-peak, 56px));
  width: 5px;
  border-radius: 5px;
  background: var(--teal);
}
.voice-wave span:nth-child(2n) { --voice-peak: 33px; }
.voice-wave span:is(:first-child,:last-child) { --voice-peak: 18px; }
@media (prefers-reduced-motion: no-preference) {
  .voice-wave span { transition: height 90ms ease-out; }
}
.team-clock-entry .badge { margin-top: 4px; }
.team-clock-time { text-align: right; }
.team-clock-time strong { display: block; font-variant-numeric: tabular-nums; }

.works-client-group + .works-client-group { margin-top: 24px; }
.works-client-group h2 { margin: 0; font-size: 16px; }
.works-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 185px), 1fr));
  gap: 10px;
  margin-top: 16px;
}
.works-grid .projectcard {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  overflow-wrap: anywhere;
}
.works-grid .work-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.works-grid h3 { margin: 0; font-size: 15px; line-height: 1.3; }
.works-grid p { margin: 0; font-size: 12px; line-height: 1.4; }
.works-grid .projectcard button { margin-top: auto; min-height: 36px; }
@media (max-width: 600px) {
  .works-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
}

.notification-count:not([hidden]){display:inline-grid;place-items:center;min-width:19px;height:19px;padding:0 4px;margin-inline-start:6px;border-radius:999px;background:#b42318;color:white;font-size:.72rem;font-weight:700;vertical-align:middle}


.board th.holiday{background:#fff3e1}.holiday-label{display:block;color:#8a521b;font-size:11px;margin:4px 5px}

.recovery-link{margin-top:12px}

@media (max-width: 900px) {
  .shell { display: flex; flex-direction: column; }
  .sidebar { flex: none; min-width: 0; position: relative; }
  .main { flex: 1; }
  .nav, .boardwrap, .tabs { max-width: 100%; overflow-x: auto; }
  body:has(.sidebar .nav) { --bottom-nav-height: 64px; }
  .sidebar .nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    min-height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    margin: 0;
    padding: 6px max(12px, env(safe-area-inset-right, 0px))
             calc(6px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--line);
    background: var(--surface);
  }
  .sidebar .nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
  }
  .sidebar .installer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar .nav b { margin: 0; }
  .sidebar .nav [data-view="today"] { white-space: normal; text-align: center; }
  .shell:has(.sidebar .nav) .main {
    padding-bottom: calc(24px + var(--bottom-nav-height));
  }
  body:has(.sidebar .nav) #toast {
    bottom: calc(12px + var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  }
  .main, .panel, .workcard, .projectcard { overflow-wrap: anywhere; }
  .list th, .list td { overflow-wrap: anywhere; }
}

@media (pointer: coarse) {
  /* iOS zooms when focusing text controls whose font is smaller than 16px. */
  input, select, textarea { font-size: max(16px, 1rem); }
}

/* Keep the app inside the usable screen area in the iOS WebView. */
body {
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
           env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.shell {
  min-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}

@media (max-width: 900px) {
  body:has(.shell) {
    background: linear-gradient(var(--surface) env(safe-area-inset-top, 0px), transparent env(safe-area-inset-top, 0px));
  }
}

.employee-label { display: none; }
.employee-access { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

@media (max-width: 600px) {
  .employees-panel { padding: 0; border: 0; background: transparent; }
  .employees-list, .employees-list tbody { display: block; }
  .employees-list thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .employees-list tbody { display: grid; gap: 12px; }
  .employees-list tr {
    display: grid;
    gap: 12px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
  }
  .employees-list td {
    display: grid;
    grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    padding: 0;
    border: 0;
    font-size: 0.95rem;
  }
  .employees-list .employee-name { grid-template-columns: minmax(0, 1fr); }
  .employee-name button { justify-self: start; text-align: left; font-size: 1rem; }
  .employee-label { display: block; color: #557376; }
}

.sidebar-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
}
.sidebar-heading .brand { grid-column: 1 / -1; justify-self: center; margin: 0; }
.sidebar-heading .mark { flex: none; }
.header-role { grid-column: 1; justify-self: start; }
.header-controls { display: flex; align-items: center; justify-self: end; }
.header-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
}
.header-icon svg { width: 21px; height: 21px; }
.header-icon.active, .header-icon:hover, .notification-bell[aria-expanded="true"] { background: #e6f5f3; color: #007e78; }
.main { padding-top: 20px; }
.settings-sections { display: grid; gap: 14px; max-width: 650px; }
.settings-sections .panel { margin: 0; }
.account-details { grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 0; }
.account-details dd + dt { margin-top: 8px; }
.settings-toggle { display: flex; align-items: center; gap: 8px; }
.settings-toggle input { width: 18px; height: 18px; flex: none; accent-color: var(--teal); }
.notification-bell .notification-count {
  position: absolute;
  top: 0;
  right: -3px;
  margin: 0;
  padding-inline: 4px;
  color: white;
}
.calendar-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.calendar-tabs button { min-height: 44px; border: 0; background: transparent; }
.calendar-tabs button.active { background: #e6f5f3; color: #007e78; font-weight: 700; }

html { -webkit-tap-highlight-color: transparent; }

:root.dark-theme {
  color-scheme: dark;
  --canvas: #212121;
  --surface: #2f2f2f;
  --text: #f2f2f2;
  --muted-dark: #b9b9b9;
  --line: #454545;
  --teal: #71d6c9;
  --teal-tint: #253e3b;
  --on-teal: #102c29;
  --warm-tint: #3e3024;
  --warm-text: #f6cf9b;
  --danger-tint: #482d2e;
  --danger-text: #ffaaa2;
}
.dark-theme :is(small, .muted, .subbrand, .stat span, .empty, .details dt, .employee-label,
  .list th, .login p, .login footer, .topbar, .topbar .badge, .legend, .month-weekday, .month-outside,
  .tabs button) { color: var(--muted-dark); }
.dark-theme :is(a, .tabs button.active, .calendar-plus) { color: var(--teal); }
.dark-theme :is(input, select, textarea, button:hover, .calendar-plus) { border-color: #5d5d5d; }
.dark-theme :is(input, textarea)::placeholder { color: var(--muted-dark); opacity: 1; }
.dark-theme button:hover { background: #3a3a3a; }
.dark-theme :is(button.primary, .mark, .month-today .month-date),
.dark-theme .sidebar .nav .clock-shortcut {
  background: var(--teal);
  color: var(--on-teal);
}
.dark-theme :is(button.primary:hover, .sidebar .nav .clock-shortcut:hover, .sidebar .nav .clock-shortcut.active) {
  background: #9ce8df;
}
.dark-theme :is(.nav button.active, .header-icon.active, .header-icon:hover, .notification-bell[aria-expanded="true"],
  .calendar-tabs button.active, .drawer-link[aria-current="page"], .month-day[aria-pressed="true"],
  .picker-option:has(input:checked), .avatar, .badge.teal, .month-count) {
  background: var(--teal-tint);
  color: var(--teal);
}
.dark-theme :focus-visible { outline-color: var(--teal); }
.dark-theme :is(dialog, .board th, .board .team) { background: var(--surface); color: var(--text); }
.dark-theme :is(#settings-drawer, #notifications-dialog) { background: var(--canvas); }
.dark-theme dialog::backdrop { background: rgb(0 0 0 / 58%); }
.dark-theme #settings-drawer::backdrop { background: rgb(0 0 0 / 48%); }
.dark-theme .board th strong { color: var(--text); }
.dark-theme .board td { border-right-color: var(--line); }
.dark-theme .team .circle, .dark-theme .badge { background: #414141; color: var(--text); }
.dark-theme .today { background: var(--teal-tint) !important; }
.dark-theme :is(.notice, .clock-timers, .job) { background: var(--teal-tint); border-color: #4a655f; color: var(--text); }
.dark-theme :is(.clock-timers span, .clock-timers strong, .job time) { color: var(--teal); }
.dark-theme .job.progress { background: #293b50; border-color: #52769e; }
.dark-theme .job.finished { background: #393939; border-color: #626262; }
.dark-theme .job.urgent { background: var(--danger-tint); border-color: #a76963; }
.dark-theme :is(.warning, .urgentbox, .badge.amber, .board th.holiday) {
  background: var(--warm-tint);
  border-color: #755842;
  color: var(--warm-text);
}
.dark-theme .holiday-label { color: var(--warm-text); }
.dark-theme .badge.red { background: var(--danger-tint); color: var(--danger-text); }
.dark-theme :is(.error, button.danger, .settings-signout-button, .expense-amount, .economy-expense strong) {
  color: var(--danger-text);
}
.dark-theme :is(.worker-count, .economy-total strong) { color: #8ee1ab; }

.view-motion { display: contents; }
.project-tabs { position: relative; }
.project-tabs + #project-tab-content {
  display: flow-root;
  overflow-anchor: none;
  min-height: var(--project-tab-scroll-space, 0px);
}
@media (max-width: 900px) {
  /* Keep the tabs in reach before the first switch, even with an empty panel. */
  .project-tabs + #project-tab-content {
    min-height: max(var(--project-tab-scroll-space, 0px), calc(100vh - var(--bottom-nav-height, 0px)));
  }
}
@media (prefers-reduced-motion: no-preference) {
  :where(button, a[href], summary, input[type="button"], input[type="submit"], input[type="reset"], input[type="image"], [role="button"]):not(:disabled, [aria-disabled="true"]) {
    transition: scale 180ms ease-out;
  }
  :where(button, a[href], summary, input[type="button"], input[type="submit"], input[type="reset"], input[type="image"], [role="button"]):not(:disabled, [aria-disabled="true"]):active {
    scale: .96;
    transition-duration: 55ms;
  }
}

@media (max-width: 900px) and (prefers-reduced-motion: no-preference) {
  .view-motion {
    display: block;
    animation: view-slide-in 420ms cubic-bezier(.4, 0, .2, 1);
  }
  .view-motion--right { --slide-x: 12px; }
  .view-motion--left { --slide-x: -12px; }
  .view-motion--clock { --slide-y: 32px; }
  .view-motion .calendar-tabs-enter { animation: none; }
  @keyframes view-slide-in {
    from { transform: translate(var(--slide-x, 0px), var(--slide-y, 0px)); opacity: .9; }
    to { transform: translate(0, 0); opacity: 1; }
  }
}

@media (prefers-reduced-motion: no-preference) {
  .calendar-tabs-enter { animation: calendar-tabs-reveal 300ms cubic-bezier(.4, 0, .2, 1); }
  @keyframes calendar-tabs-reveal {
    from { opacity: 0; transform: translateY(-5px); clip-path: inset(0 0 60% 0); }
    to { opacity: 1; transform: translateY(0); clip-path: inset(0); }
  }
}

@media (max-width: 900px) {
  .sidebar-heading { grid-template-columns: minmax(88px, 1fr) auto minmax(88px, 1fr); gap: 6px; }
  .sidebar-heading .brand {
    grid-area: 1 / 2;
    font-size: clamp(12px, 3.7vw, 19px);
    letter-spacing: .4px;
    gap: 5px;
  }
  .header-role { grid-row: 1; }
  .header-controls { grid-area: 1 / 3; }
  .header-icon { width: 44px; height: 44px; }
  .main { padding-top: 12px; }
}

@media (max-width: 360px) {
  .sidebar-heading .brand { font-size: 11px; letter-spacing: .2px; gap: 4px; }
  .sidebar-heading .mark { width: 20px; height: 20px; }
}

body:has(#settings-drawer[open], #notifications-dialog[open], #photo-viewer[open]) { overflow: hidden; }
.photo-folder { padding-block: 12px; border-bottom: 1px solid var(--line); }
.project-contact-list { margin: 0; padding-inline-start: 18px; overflow-wrap: anywhere; }
.task-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.task-entry { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.task-entry > button { justify-self: start; min-height: 44px; white-space: nowrap; }
.project-contact-list li + li { margin-top: 6px; }
.project-contacts #project-contact-fields:not(:empty) { display: grid; gap: 8px; margin-bottom: 10px; }
.project-contact-fields { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 8px; }
.project-contact-fields button { margin-top: 8px; }
.photo-folder .photos {
  grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr));
  gap: 12px;
  margin-top: 12px;
}
.photo-folder figure { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.photo-thumbnail { display: block; width: 100%; padding: 0; overflow: hidden; }
.photo-thumbnail img { display: block; height: auto; aspect-ratio: 4 / 3; }
#photo-viewer {
  position: fixed;
  width: max-content;
  min-width: 104px;
  max-width: calc(100% - 24px);
  max-height: calc(100dvh - max(12px, env(safe-area-inset-top)) - max(12px, env(safe-area-inset-bottom)));
  padding: 10px;
}
#photo-viewer .modalhead { contain: inline-size; gap: 8px; margin-bottom: 6px; }
#photo-viewer .modalhead h2 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#photo-viewer .header-icon { flex: none; width: 44px; height: 44px; font-size: 24px; }
.photo-viewer-frame {
  width: fit-content;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.photo-viewer-frame img {
  display: block;
  max-width: min(1000px, calc(100vw - 46px));
  max-height: calc(100dvh - max(12px, env(safe-area-inset-top)) - max(12px, env(safe-area-inset-bottom)) - 72px);
  transform-origin: top left;
  -webkit-touch-callout: none;
}
#notifications-dialog {
  position: fixed;
  width: min(680px, calc(100% - 24px));
  height: min(760px, calc(100dvh - 32px));
  max-height: none;
  padding: 16px 16px 0;
  background: var(--canvas);
  color: inherit;
  overflow: hidden;
}
#notifications-dialog[open] {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}
#notifications-dialog[open]:not(:has(.calendar-tabs)) {
  grid-template-rows: auto minmax(0, 1fr);
}
.notifications-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.notifications-heading h2 { margin: 0; }
.notifications-close { font-size: 24px; line-height: 1; }
#notifications-dialog .calendar-tabs { margin-bottom: 0; animation: none; }
.notifications-body {
  margin-inline: -16px;
  padding: 0 16px 16px;
  overflow: hidden auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  #notifications-dialog {
    inset: max(8px, env(safe-area-inset-top)) 0 max(8px, env(safe-area-inset-bottom));
    margin: 0 auto;
    height: auto;
  }
}
#settings-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(420px, calc(100% - 24px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 12px 0 0 12px;
  background: var(--canvas);
  color: inherit;
  overflow: auto;
  overscroll-behavior: contain;
}
#settings-drawer::backdrop { background: rgb(18 56 60 / 35%); }
.settings-drawer-content {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: max(16px, env(safe-area-inset-top, 0px))
           max(16px, env(safe-area-inset-right, 0px))
           max(20px, env(safe-area-inset-bottom, 0px))
           16px;
  overflow-wrap: anywhere;
}
.settings-drawer-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.settings-drawer-heading h2 { flex: 1; margin: 0; font-size: 22px; }
.settings-drawer-heading button { width: 44px; height: 44px; font-size: 24px; }
.settings-sections h3 { margin: 0 0 10px; }
.settings-sections p:last-child { margin-bottom: 0; }
.drawer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
}
.drawer-link svg { flex: none; }
.drawer-link[aria-current="page"] { background: #e6f5f3; color: #007e78; }
.settings-signout-button { color: #a53430; margin-top: auto; }
.settings-drawer-menu .settings-sections { margin-bottom: 20px; }
.vehicle-report-date { margin-top: 2px; }
.vehicle-report-date time { font-weight: 650; }
.vehicle-report-description {
  margin-top: 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  #settings-drawer { height: 100%; }
  #settings-drawer.settings-drawer-menu { width: clamp(160px, 52%, 420px); }
  .settings-drawer-menu .drawer-link { padding-inline: 12px; }
}

.calendar-job { position: relative; }
.board { --calendar-plus-height: 36px; }
.calendar-job > .calendar-job-edit {
  position: absolute;
  right: 3px;
  bottom: 3px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
}
.calendar-job:has(.calendar-job-edit) .job { padding-inline-end: 35px; }
.calendar-jobs-compact {
  --job-gap: 4px;
  --job-space: calc(4 * var(--calendar-plus-height) + 3 * var(--job-gap));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: var(--calendar-plus-height);
  gap: var(--job-gap);
  max-height: var(--job-space);
  margin-bottom: var(--job-gap);
  overflow-y: auto;
}
.calendar-jobs-compact .job {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  height: var(--calendar-plus-height);
  margin-bottom: 0;
  padding: 0 27px 0 7px;
}
.calendar-jobs-compact .calendar-job:has([data-action="edit-assignment"]) .job {
  padding-inline-end: 51px;
}
.calendar-job-label { min-width: 0; }
.calendar-jobs-compact .calendar-job .job .calendar-job-label > :is(strong, time) {
  display: block;
  min-height: 0;
  margin: 0;
  padding: 0;
  line-height: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calendar-job-label strong { font-size: 11px; }
.calendar-job-label time { font-variant-numeric: tabular-nums; }
.calendar-jobs-compact .calendar-job > .calendar-job-remove,
.calendar-jobs-compact [data-action="edit-assignment"] {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 23px;
  height: calc(var(--calendar-plus-height) - 4px);
  padding: 0;
  border: 0;
  background: transparent;
}
.calendar-jobs-compact .calendar-job-edit { right: 25px; bottom: auto; }
.calendar-job:has(.calendar-job-remove) .job time {
  display: block;
  min-height: 22px;
  padding-inline-end: 29px;
}
.calendar-job-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  font-size: 14px;
  line-height: 1;
}
#modal:has(.calendar-removal-details) { width: min(360px, calc(100vw - 32px)); }
.calendar-removal-details { margin: 0; }
#modal:has(.calendar-removal-details) .formfoot button { min-width: 64px; }

.calendar-plus {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: var(--calendar-plus-height, 36px);
  padding: 0;
  border: 1px dashed #9bc9c5;
  color: #007e78;
  font-size: 20px;
}
.assignment-picker { display: grid; gap: 8px; min-width: 0; }
.assignment-picker input[type="search"] { width: 100%; }
.picker-options { max-height: min(24vh, 220px); overflow: auto; }
.picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  overflow-wrap: anywhere;
}
.picker-option[hidden] { display: none; }
.picker-option:has(input:checked) { background: #e6f5f3; }
.picker-option input { flex: none; margin: 0; }
.picker-option small { display: block; }
.assignment-picker p { margin: 0; }

.assignment-hours {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.assignment-hours > label { min-width: 0; }
.assignment-hours input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding-inline: 8px;
  text-align: center;
}
.assignment-hours input[type="time"]::-webkit-date-and-time-value {
  min-width: 0;
  margin: 0;
  text-align: center;
}

@media (max-width: 480px) {
  #modal:has(.assignment-hours) {
    width: calc(100% - 32px);
    padding-inline: 16px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  :is(#modal, #notifications-dialog, #photo-viewer)[open] { animation: modal-expand 320ms cubic-bezier(.4, 0, .2, 1); }
  :is(#modal, #notifications-dialog, #photo-viewer)[open]::backdrop { animation: modal-backdrop-in 320ms ease-out; }
  @keyframes modal-expand {
    from { transform: scale(.94); opacity: .65; }
    to { transform: scale(1); opacity: 1; }
  }
  @keyframes modal-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  #settings-drawer[open] { animation: settings-drawer-enter 380ms cubic-bezier(.4, 0, .2, 1); }
  #settings-drawer[open]::backdrop { animation: modal-backdrop-in 380ms ease-out; }
  :is(#modal, #notifications-dialog, #settings-drawer, #photo-viewer)[open].is-closing {
    animation: dialog-exit var(--dialog-exit-duration, 320ms) cubic-bezier(.4, 0, .6, 1) both;
  }
  :is(#modal, #notifications-dialog, #settings-drawer, #photo-viewer)[open].is-closing::backdrop {
    animation: backdrop-exit var(--dialog-exit-duration, 320ms) ease-in-out both;
  }
  #settings-drawer.is-closing {
    --dialog-exit-duration: 380ms;
    --dialog-exit-transform: translateX(100%);
    --dialog-exit-opacity: 1;
  }
  @keyframes dialog-exit {
    from { transform: var(--dialog-close-from, none); opacity: var(--dialog-close-opacity, 1); }
    to { transform: var(--dialog-exit-transform, scale(.94)); opacity: var(--dialog-exit-opacity, 0); }
  }
  @keyframes backdrop-exit {
    from { opacity: var(--backdrop-close-opacity, 1); }
    to { opacity: 0; }
  }
  .notifications-fade { animation: notifications-fade-in 320ms ease-out; }
  @keyframes notifications-fade-in {
    from { opacity: .65; }
    to { opacity: 1; }
  }
  @keyframes settings-drawer-enter {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
  }
}

.access-request {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  overflow-wrap: anywhere;
}
.access-request > div:first-child { min-width: 0; }
#access-installer-fields input[type="checkbox"] { width: auto; }
