/* v576: consistent staff workspace, accessible state symbols, touch-sized controls. */
.attendance-hero{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:24px;border-radius:22px;background:linear-gradient(120deg,#103e4d,#126b79);color:white;margin:0 0 20px;box-shadow:0 8px 24px #103e4d18}
.attendance-hero h2{margin:6px 0;font-size:25px}.attendance-hero p{color:#d3e9eb;margin:6px 0}.attendance-hero .secondary-button{background:#fff;color:#154d59;min-height:48px}.eyebrow{font-size:11px;letter-spacing:2px;color:#b6dcdf}
.attendance-employee{display:flex;justify-content:space-between;align-items:center;gap:12px;border-top:1px solid #e5ebee;padding:14px 0}.attendance-employee>div{display:flex;gap:8px}
.record-card{border-radius:18px;box-shadow:0 4px 16px #17374508}.status-pill{display:inline-flex;align-items:center;gap:5px;white-space:normal}.status-pill::before{content:'●';font-size:.75em}.status-pill.success::before{content:'✓'}.status-pill.warning::before,.status-pill.danger::before{content:'!';font-weight:800}.status-pill.info::before{content:'◷'}
button:focus-visible,a:focus-visible{outline:3px solid #15a6b9;outline-offset:3px}.page-head h1{letter-spacing:-.6px}.record-actions{gap:8px}.record-actions button{min-height:42px}#attendance-error{color:#b42318;white-space:pre-wrap}
@media(max-width:600px){.attendance-hero{align-items:stretch;flex-direction:column;gap:12px;padding:20px}.attendance-hero .record-actions{display:grid;grid-template-columns:1fr 1fr}.attendance-employee{align-items:flex-start;flex-direction:column}.attendance-hero h2{font-size:23px}.record-card{border-radius:16px}}

.page-head>button{flex-shrink:0;white-space:nowrap}.attendance-hero .record-actions{background:transparent;padding:0;border:0}.attendance-hero~.record-list .status-pill::before{content:none}.company-switch{position:fixed;top:15px;right:14px;z-index:40;color:#fff;background:#173d4c;border-radius:20px;padding:7px 12px;font-size:12px;text-decoration:none}.company-entry{width:min(520px,calc(100vw - 40px));box-sizing:border-box;padding:30px;border:0;border-radius:24px;color:#163c49;box-shadow:0 20px 70px #001c3a33}.company-entry::backdrop{background:#0c293be8}.company-entry p{line-height:1.7}.company-entry .eyebrow{color:#387b89}.company-options{display:grid;gap:14px;margin-top:24px}.company-options a,.company-options button{font:inherit;font-weight:600;text-align:left;display:flex;justify-content:space-between;gap:10px;padding:22px 16px;background:#edf5f5;color:#123c4c;border:1px solid #cddfe2;border-radius:14px;text-decoration:none}.company-options span{white-space:nowrap;color:#347b87;font-size:12px}

@media(max-width:360px){.attendance-hero .secondary-button{font-size:12px;padding:10px 6px;white-space:nowrap}}
.attendance-month-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;margin:18px 0}.attendance-month-grid>strong{text-align:center;font-size:12px;color:#526f78}.attendance-day{min-width:0;min-height:100px;text-align:left;padding:8px;border:1px solid #d8e5e8;border-radius:10px;background:#f8fbfc;color:#173f4b}.attendance-day.selected{border:2px solid #147888;background:#e4f4f5}.attendance-day small{float:right;font-size:10px}.calendar-day-preview{display:block;font-size:10px;line-height:1.6;margin-top:6px;overflow-wrap:anywhere}.calendar-legend{display:flex;flex-wrap:wrap;gap:14px;font-size:12px;color:#526f78}.calendar-agenda{display:grid;gap:8px}.calendar-event{display:flex;flex-wrap:wrap;gap:8px;padding:12px;border-left:4px solid #8aa9b2;background:#f1f6f7;border-radius:8px}.calendar-event.plan{border-color:#d89a32;background:#fff8eb}.calendar-event.actual{border-color:#148473;background:#edf9f4}.calendar-event small{width:100%;color:#526f78}.attendance-calendar .muted{font-size:12px;color:#526f78}@media(max-width:600px){.attendance-day{min-height:56px;padding:5px}.calendar-day-preview{display:none}.attendance-month-grid{gap:3px}.attendance-calendar{padding:12px}.attendance-calendar .record-card-top{align-items:flex-start;flex-direction:column}.attendance-day small{display:block;float:none}}

.calendar-navigation{align-items:center;flex-wrap:wrap;margin:16px 0}.calendar-navigation label{display:flex;gap:8px;align-items:center}.calendar-navigation input{max-width:165px;padding:9px;border:1px solid #cbd5e1;border-radius:8px}.attendance-day.is-today{box-shadow:inset 0 0 0 2px #087f8c}.attendance-day em{display:block;font-size:10px;font-style:normal;color:#087f8c}

/* Warm workspace: cream surfaces, walnut / sage brands, comfortable type. */
:root,:root[data-platform="tokugawa"],:root[data-platform="guoxin"]{--text:#403a34;--muted:#786b5e;--background:#f8f5ef;--surface:#fffdfa;--line:#e7ded2;--soft:#f2ece3;--shadow:0 8px 24px #6e50380b;font-family:"PingFang SC","Microsoft YaHei","Noto Sans CJK SC",system-ui,sans-serif}
:root,:root[data-platform="tokugawa"]{--navy:#574a42;--navy-2:#726056;--teal:#8a6548;--teal-dark:#705039}
:root[data-platform="guoxin"]{--navy:#46584b;--navy-2:#5e7867;--teal:#496553;--teal-dark:#364e40}
body{line-height:1.65}button,input,select,textarea{font-family:inherit}h1,h2,h3{letter-spacing:.2px;font-weight:600}.page-head h1{letter-spacing:.2px}.primary-button,.secondary-button{border-radius:12px}.record-card{background:var(--surface);border-color:var(--line);box-shadow:var(--shadow)}
.attendance-hero{background:linear-gradient(120deg,#f1e4d4,#f8efe3);color:var(--text);box-shadow:var(--shadow);border:1px solid #e7d9c8}.attendance-hero p,.attendance-hero .eyebrow{color:#78604b}.attendance-hero .secondary-button{color:#705039;background:#fffdfa}.attendance-hero h2{font-weight:600}:root[data-platform="guoxin"] .attendance-hero{background:linear-gradient(120deg,#e8eee1,#f3f4e9)}
.attendance-day{background:#fffdfa;color:#403a34;border-color:#e7ded2;border-radius:12px;padding:10px}.attendance-day.selected{background:#f3e8dc;border-color:#8a6548}.attendance-day.is-today{box-shadow:inset 0 0 0 2px #8a6548}.attendance-day em{color:#795438}.attendance-month-grid>strong,.calendar-legend,.attendance-calendar .muted,.calendar-event small{color:#786b5e}.calendar-day-preview{font-size:12px;line-height:1.7}.calendar-event{background:#f5efe6;border-color:#b29b82}.calendar-event.plan{background:#faf0df;border-color:#b58a50}.calendar-event.actual{background:#edf2e8;border-color:#6e8865}.calendar-navigation input{background:#fffdfa;border-color:#e7ded2;color:#403a34}.company-switch{background:#574a42}.company-entry{background:#fffdfa;color:#403a34}.company-entry::backdrop{background:#40372edb}.company-options a,.company-options button{background:#f3ece2;color:#574a42;border-color:#e7ded2}.company-options span{color:#78604b}button:focus-visible,a:focus-visible{outline-color:#8a6548}
@media(max-width:600px){.attendance-day{padding:5px;border-radius:9px}.attendance-hero h2{font-size:24px}.record-card p{font-size:14px}}

/* Native date controls must shrink within narrow Safari sheets. */
#attendance-form,#attendance-form label{min-width:0;max-width:100%}
#attendance-form input,#attendance-form select{width:100%;min-width:0;max-width:100%;box-sizing:border-box}
#attendance-form input::-webkit-date-and-time-value{min-width:0;text-align:left}

/* Shared semantic palette: brand navigation, blue information, jade success,
   amber attention and rose danger. No positional or random card colours. */
:root {
  --green: #176b57;
  --amber: #895810;
  --red: #ad3549;
  --blue: #28658f;
  --success-soft: #e0f2e9;
  --warning-soft: #fff0d2;
  --danger-soft: #fbe5ea;
  --info-soft: #e4eff9;
  --brand-soft: #f2e3ce;
  --brand-border: #d8c4aa;
}
:root[data-platform="guoxin"] { --brand-soft: #e3efe5; --brand-border: #bdd5c3; }
.login-view { background: var(--background); }
.login-panel, .record-card { border-color: var(--brand-border); }
.bottom-nav { background: var(--surface); border-color: var(--brand-border); }
.bottom-nav button { color: var(--muted); }
.bottom-nav button:hover, .secondary-button:hover { background: var(--info-soft); color: var(--blue); }
.bottom-nav button.active { background: var(--brand-soft); color: var(--teal-dark); box-shadow: inset 0 3px var(--teal); }
.secondary-button { background: var(--info-soft); color: var(--blue); }
.danger-button { background: var(--danger-soft); color: var(--red); }
.metric-card { background: var(--info-soft); border-color: var(--blue); border-top-width: 3px; }
.metric-card strong { color: var(--blue); }
.metric-card.success { background: var(--success-soft); border-color: var(--green); }
.metric-card.success strong { color: var(--green); }
.metric-card.warning { background: var(--warning-soft); border-color: var(--amber); }
.metric-card.warning strong { color: var(--amber); }
.metric-card.danger { background: var(--danger-soft); border-color: var(--red); }
.metric-card.danger strong { color: var(--red); }
.metric-card .metric-label, .metric-card small { color: var(--text); }
.status-pill.success, .status-pill.active, .status-pill.normal, .status-pill.available { background: var(--success-soft); color: var(--green); }
.status-pill.warning, .status-pill.reserved, .status-pill.due-soon, .status-pill.mileage-due { background: var(--warning-soft); color: var(--amber); }
.status-pill.danger, .status-pill.overdue, .status-pill.legal-overdue, .status-pill.six-overdue { background: var(--danger-soft); color: var(--red); }
.status-pill.info, .status-pill.needs-setup { background: var(--info-soft); color: var(--blue); }
.status-pill.completed, .status-pill.inactive { background: var(--soft); color: var(--muted); }
.company-switch { background: var(--navy); }
.company-options a, .company-options button { background: var(--brand-soft); border-color: var(--brand-border); color: var(--teal-dark); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* Shared rounded workspace: consistent surfaces, controls and status chips. */
:root { --radius-panel: 22px; --radius-control: 13px; }
.record-card, .metric-card, .login-panel, .attendance-calendar,
.contract-action-panel, .charge-panel, .result-panel, .account-panel, .capture-card {
  border-radius: var(--radius-panel);
  box-shadow: 0 5px 20px #574a4209;
}
button, .primary-button, .secondary-button, .danger-button,
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  border-radius: var(--radius-control);
}
.status-pill { border-radius: 999px; padding: 4px 10px; }
dialog { border-radius: 24px; border: 1px solid var(--line); box-shadow: 0 20px 64px #403a3426; }
dialog::backdrop { background: #29262266; backdrop-filter: blur(3px); }
.attendance-hero { border-radius: 22px; }
.calendar-event { border-radius: 14px; }
.sheet { border-radius: 24px 24px 0 0; }
.sheet-backdrop { backdrop-filter: blur(3px); }
.ops-filter, .filter-bar { border-radius: 18px; }
@media(min-width:720px) { .sheet { border-radius: 24px; } }
.bottom-nav button { border-radius: 14px; }
.bottom-nav button.active { box-shadow: none; }
@media(max-width:600px) {
  .record-card, .metric-card, .attendance-calendar { border-radius: 18px; }
  dialog { border-radius: 24px 24px 16px 16px; }
}
/* v591: phone-first readable controls and actual attendance. */
.import-report-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:18px 0}
.import-report-metrics>div{display:grid;gap:6px;padding:16px 8px;border-radius:14px;background:#f0f5f3;text-align:center}
.import-report-metrics strong{font-size:28px;line-height:1.2}.import-report-metrics span{font-size:12px;color:#53645c}
.import-report article{border-bottom:1px solid var(--line);padding:14px 0;overflow-wrap:anywhere}
.import-report summary{padding:12px 0;cursor:pointer}.import-report .full-button{margin-top:16px}
.remember-account{display:flex!important;align-items:center;gap:10px;font-size:14px;min-height:44px}
.remember-account input{width:20px!important;height:20px;flex:0 0 20px}
.password-row{display:grid;grid-template-columns:minmax(0,1fr) 48px;gap:8px}
.password-row .icon-button{position:static;width:48px;min-height:46px}
.break-presets{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 16px}
.attendance-month-grid{grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.attendance-day{height:112px;min-width:0;overflow:hidden;padding:8px!important;text-align:left}
.calendar-day-preview span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.calendar-agenda summary{cursor:pointer;line-height:1.7;padding:8px 0;overflow-wrap:anywhere}
.calendar-event{display:grid;gap:8px;padding:16px;margin-top:12px;background:var(--surface);border:1px solid var(--line)}
.calendar-event strong{font-size:17px}.calendar-event p{margin:0;line-height:1.65;overflow-wrap:anywhere}
.calendar-navigation{display:flex;flex-wrap:wrap;align-items:end;gap:8px}
.calendar-navigation label{flex:1 1 150px;min-width:0}.calendar-navigation input{width:100%;min-width:0}
@media(max-width:600px){
 .record-actions.calendar-navigation{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
 .calendar-navigation label{display:grid;grid-column:1/-1;order:-1;gap:6px}
 .calendar-navigation input{max-width:100%}
 .calendar-navigation button{font-size:13px;padding:10px 4px!important}
 .calendar-agenda>.calendar-empty-day{display:none}
 .calendar-agenda>.record-card{margin:0}
 .calendar-agenda summary{padding:4px 0;font-size:13px}
 .calendar-agenda summary strong{display:inline!important;font-size:14px!important}
 .billing-filter{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .billing-filter>*{min-width:0;max-width:100%}
 .billing-filter input{box-sizing:border-box!important;min-width:0!important;max-width:100%!important}
 .billing-filter input[type=date]{font-size:14px!important;padding-left:6px;padding-right:4px}
 .billing-filter button{min-height:44px;padding:10px 4px!important}
 .billing-mobile-dates,.billing-mobile-fees,.billing-mobile-etc{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .billing-mobile-card{font-size:14px!important;border-radius:18px!important}
 .billing-mobile-dates strong{font-size:12px}.billing-mobile-fees small{font-size:12px!important}
 .billing-mobile-actions .billing-action{min-height:44px;font-size:14px}
 .main-content{padding:calc(90px + env(safe-area-inset-top)) 14px calc(100px + env(safe-area-inset-bottom))}
 .billing-mobile-card.billing-completed{opacity:1;background:#f4f5f5!important;color:#52616b}
 .page-head,.record-card-top,.attendance-hero{align-items:stretch;gap:14px;flex-direction:column}
 .page-head>*,.record-card-top>*,.attendance-hero>*,.attendance-employee>*{min-width:0;max-width:100%}
 h1{font-size:25px;line-height:1.3}h2{font-size:20px;line-height:1.4}
 p,.record-card small{line-height:1.65;overflow-wrap:anywhere}
 .record-card{padding:16px}.record-actions,.billing-toolbar{display:flex;flex-wrap:wrap;gap:8px}
 .record-actions button,.billing-toolbar button{flex:1 1 120px;white-space:normal;line-height:1.4;height:auto;min-height:44px;padding:10px 12px}
 input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px;min-width:0;max-width:100%;box-sizing:border-box}
 .ops-filter,.filter-bar{display:flex;flex-wrap:wrap;gap:12px;padding:14px}.ops-filter>*,.filter-bar>*{min-width:0;flex:1 1 140px;max-width:100%}
 .attendance-calendar{padding:12px}.attendance-month-grid{gap:4px}.attendance-month-grid>strong{font-size:11px;text-align:center}
 .attendance-day{height:64px!important;min-height:64px!important;padding:6px 3px!important;border-radius:11px}
 .attendance-day b{font-size:15px;display:block}.attendance-day small{font-size:10px;white-space:nowrap}.attendance-day em{display:none}
 .calendar-day-preview{display:none!important}.attendance-day.is-today b{color:var(--teal-dark);text-decoration:underline;text-underline-offset:4px}
 .calendar-agenda>.record-card{padding:12px;border-radius:14px}.calendar-agenda summary strong{display:block;font-size:15px}
 .attendance-employee{display:flex;flex-direction:column;align-items:stretch;gap:12px;padding:14px 0}.attendance-employee>div{display:flex;gap:8px}
 .sheet{width:100%;max-width:100%;max-height:92dvh}.sheet-body{padding:16px 16px calc(24px + env(safe-area-inset-bottom));overflow-x:hidden}
 .billing-form-grid,.form-grid{grid-template-columns:minmax(0,1fr)}
 .settings-row{gap:12px;align-items:flex-start;white-space:normal}.settings-row>span{min-width:0;overflow-wrap:anywhere}.settings-row>span:last-child{font-size:12px;text-align:right;max-width:45%}
 .bottom-nav button{min-width:0;padding:8px 2px;font-size:11px}.bottom-nav{padding-bottom:env(safe-area-inset-bottom)}
}
