:root {
  --ink: #17292b;
  --ink-soft: #395052;
  --paper: #f2eee3;
  --paper-deep: #e6dece;
  --card: #fffdf6;
  --orange: #f26430;
  --orange-dark: #c8421d;
  --yellow: #f5bd31;
  --green: #267057;
  --red: #b74732;
  --line: rgba(23, 41, 43, 0.16);
  --shadow: 0 18px 50px rgba(34, 42, 38, 0.1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 41, 43, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 41, 43, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }

.grain {
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.11'/%3E%3C/svg%3E");
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  padding: 0 clamp(20px, 5vw, 76px);
  color: #fbf7ec;
  background: rgba(23, 41, 43, 0.97);
  border-bottom: 3px solid var(--orange);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: flex;
  align-items: end;
  gap: 3px;
  width: 34px;
  height: 34px;
  padding: 7px 6px;
  background: var(--orange);
  transform: skew(-6deg);
}

.brand-mark i { display: block; width: 5px; background: var(--ink); }
.brand-mark i:nth-child(1) { height: 9px; }
.brand-mark i:nth-child(2) { height: 19px; }
.brand-mark i:nth-child(3) { height: 14px; }

.brand strong { display: block; font-family: "Noto Serif TC", serif; font-size: 19px; letter-spacing: 0.12em; }
.brand small { display: block; margin-top: 1px; color: #aebdba; font: 600 8px/1.2 "Bahnschrift", sans-serif; letter-spacing: 0.24em; }

.topbar-actions, .role-switch, .account-menu { display: flex; align-items: center; }
.topbar-actions { gap: 20px; }

.poc-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #ced9d5;
}

.poc-chip span, .last-sync i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5fd29f;
  box-shadow: 0 0 0 5px rgba(95, 210, 159, 0.12);
}

.role-switch {
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 3px;
  background: rgba(255,255,255,.05);
}

.role-button {
  min-width: 76px;
  padding: 8px 13px;
  border: 0;
  border-radius: 2px;
  color: #b6c4c0;
  background: transparent;
  cursor: pointer;
  transition: .18s ease;
}

.role-button:hover { color: white; }
.role-button.is-active { color: var(--ink); background: var(--yellow); font-weight: 800; }

.account-menu { gap: 12px; }
.account-menu > div { text-align: right; }
.account-menu strong, .account-menu small { display: block; }
.account-menu strong { color: white; font-size: 12px; }
.account-menu small { margin-top: 2px; color: #9fb0ac; font-size: 9px; }
.account-menu button { padding: 7px 10px; color: #f5d7c9; background: transparent; border: 1px solid rgba(255,255,255,.2); cursor: pointer; font-size: 10px; }
.account-menu button:hover { color: white; border-color: var(--orange); }

.login-shell {
  min-height: calc(100vh - 78px);
  display: grid;
  place-items: center;
  padding: 44px clamp(20px, 5vw, 76px);
}

.login-panel {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  width: min(980px, 100%);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 30px 90px rgba(23,41,43,.16);
}

.login-copy {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  padding: clamp(38px, 6vw, 72px);
  color: white;
  background:
    linear-gradient(135deg, rgba(23,41,43,.97), rgba(23,41,43,.87)),
    repeating-linear-gradient(-45deg, transparent 0 18px, rgba(245,189,49,.08) 18px 20px);
}

.login-copy::after {
  content: "150M";
  position: absolute;
  right: -18px;
  bottom: -35px;
  color: rgba(255,255,255,.045);
  font: 900 135px/1 "Bahnschrift", sans-serif;
  transform: rotate(-7deg);
}

.login-copy .mini-label { color: var(--yellow); }
.login-copy h1 { margin: 24px 0; font-family: "Noto Serif TC", serif; font-size: clamp(43px, 5vw, 68px); line-height: 1.15; letter-spacing: -.06em; }
.login-copy h1 em { color: var(--orange); font-style: normal; }
.login-copy > p { max-width: 430px; color: #bdc9c5; font-size: 13px; line-height: 1.9; }
.login-proof { position: absolute; z-index: 1; left: clamp(38px, 6vw, 72px); bottom: 52px; display: flex; align-items: center; gap: 10px; color: #d9e2df; font-size: 11px; }
.login-proof span { display: grid; place-items: center; width: 25px; height: 25px; color: var(--ink); background: var(--yellow); border-radius: 50%; font-weight: 900; }

.login-form { display: flex; flex-direction: column; justify-content: center; padding: clamp(32px, 5vw, 60px); }
.login-form h2 { margin: 0 0 25px; font-family: "Noto Serif TC", serif; font-size: 25px; }
.login-form label { display: block; margin: 10px 0; font-size: 10px; font-weight: 800; }
.login-form input { width: 100%; margin-top: 7px; padding: 13px 14px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); outline: none; }
.login-form input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242,100,48,.1); }
.login-form .primary-button { width: 100%; margin-top: 12px; }
.login-form > small { margin-top: 17px; color: #84908d; font-size: 9px; line-height: 1.6; text-align: center; }
.form-error { min-height: 18px; margin: 3px 0; color: var(--red); font-size: 10px; }
.primary-button:disabled, .demo-controls button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

main { width: min(1440px, 100%); margin: 0 auto; padding: 50px clamp(20px, 5vw, 76px) 80px; }
.view { display: none; }
.view.is-active { display: block; }

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.eyebrow, .mini-label, .site-index {
  margin: 0 0 7px;
  color: var(--orange-dark);
  font: 800 10px/1.3 "Bahnschrift", "Noto Sans TC", sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.page-heading h1 {
  margin: 0;
  font-family: "Noto Serif TC", serif;
  font-size: clamp(29px, 3vw, 46px);
  line-height: 1.18;
  letter-spacing: -.04em;
}

.page-heading > div > p:last-child { margin: 10px 0 0; color: #647472; font-size: 14px; }

.worker-badge {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 180px;
  padding: 9px 13px 9px 9px;
  background: rgba(255,255,255,.45);
  border: 1px solid var(--line);
}

.worker-badge > span {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  color: white;
  background: var(--green);
  font-family: "Noto Serif TC", serif;
  font-size: 17px;
}

.worker-badge strong, .worker-badge small { display: block; }
.worker-badge strong { font-size: 13px; }
.worker-badge small { margin-top: 3px; color: #74817e; font-size: 10px; }

.worker-layout, .manager-layout { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(285px, .78fr); gap: 22px; }

.site-card, .shift-card, .week-card, .dashboard-panel, .review-panel, .attendance-panel {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.site-card { overflow: hidden; }
.site-card-head { display: flex; justify-content: space-between; gap: 22px; padding: 26px 28px 19px; border-top: 5px solid var(--ink); }
.site-card-head h2 { margin: 0; font-family: "Noto Serif TC", serif; font-size: 25px; letter-spacing: -.03em; }
.site-card-head p { margin: 7px 0 0; color: #687774; font-size: 13px; }

.trade-tag {
  align-self: start;
  padding: 7px 12px;
  color: white;
  background: var(--orange);
  font-size: 12px;
  font-weight: 800;
  transform: rotate(1deg);
}

.site-details { display: grid; grid-template-columns: 1fr 1.2fr 1.25fr; border-block: 1px solid var(--line); }
.site-details > div { padding: 15px 20px; border-right: 1px solid var(--line); }
.site-details > div:last-child { border-right: 0; }
.site-details small, .site-details strong { display: block; }
.site-details small { margin-bottom: 5px; color: #788581; font-size: 10px; letter-spacing: .08em; }
.site-details strong { font-size: 12px; }

.location-console { display: grid; grid-template-columns: minmax(300px, 1.1fr) minmax(280px, .9fr); min-height: 390px; background: #e9e4d7; }

.radar-wrap {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 360px;
  background: radial-gradient(circle, rgba(255,255,255,.7), transparent 68%);
  border-right: 1px solid var(--line);
}

.radar { position: relative; width: 286px; aspect-ratio: 1; border-radius: 50%; background: rgba(38,112,87,.06); }
.ring { position: absolute; inset: 50%; border: 1px solid rgba(38,112,87,.25); border-radius: 50%; transform: translate(-50%, -50%); }
.ring-one { width: 34%; height: 34%; }
.ring-two { width: 67%; height: 67%; }
.ring-three { width: 100%; height: 100%; border: 2px dashed rgba(38,112,87,.42); }
.radar::before, .radar::after { content: ""; position: absolute; background: rgba(38,112,87,.18); }
.radar::before { top: 50%; left: 0; width: 100%; height: 1px; }
.radar::after { left: 50%; top: 0; width: 1px; height: 100%; }

.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 10deg, transparent 0 76%, rgba(38,112,87,.16) 92%, rgba(38,112,87,.5));
  animation: sweep 4s linear infinite;
}

@keyframes sweep { to { transform: rotate(360deg); } }

.site-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--ink);
  font-size: 9px;
  font-weight: 800;
  transform: translate(-50%, -50%);
}

.site-pin b { width: 14px; height: 14px; border: 4px solid var(--card); border-radius: 50%; background: var(--orange); box-shadow: 0 2px 9px rgba(0,0,0,.25); }

.worker-dot {
  position: absolute;
  left: 76%;
  top: 29%;
  width: 17px;
  height: 17px;
  border: 4px solid white;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
  transition: 1s cubic-bezier(.2,.8,.2,1);
}

.worker-dot i { position: absolute; inset: -9px; border: 1px solid var(--ink); border-radius: 50%; animation: ping 1.8s ease-out infinite; }
@keyframes ping { 0% { opacity: .75; transform: scale(.55); } 100% { opacity: 0; transform: scale(1.5); } }
.worker-dot.is-inside { left: 61%; top: 42%; background: var(--green); }
.worker-dot.is-outside { left: 94%; top: 12%; background: var(--red); }

.radius-caption { position: absolute; bottom: 20px; display: flex; align-items: baseline; gap: 7px; color: #657571; font-size: 10px; letter-spacing: .08em; }
.radius-caption b { color: var(--green); font: 800 17px "Bahnschrift", sans-serif; }

.location-readout { display: flex; flex-direction: column; justify-content: center; padding: 30px; }
.status-line { display: flex; align-items: center; gap: 15px; }
.status-line small, .status-line strong { display: block; }
.status-line small { margin-bottom: 3px; color: #76827f; font-size: 10px; letter-spacing: .08em; }
.status-line strong { font: 800 25px "Bahnschrift", "Noto Sans TC", sans-serif; }
.signal-icon { display: flex; align-items: end; gap: 3px; width: 35px; height: 35px; padding: 7px; background: var(--ink); }
.signal-icon i { width: 4px; background: #82908d; }
.signal-icon i:nth-child(1) { height: 6px; }
.signal-icon i:nth-child(2) { height: 12px; }
.signal-icon i:nth-child(3) { height: 18px; }
.signal-icon.is-live i { background: #66d5a5; }
.location-readout > p { min-height: 40px; margin: 18px 0; color: #63716f; font-size: 12px; line-height: 1.7; }

.location-meta { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 20px; padding-block: 12px; border-block: 1px solid var(--line); }
.location-meta div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.location-meta dt { margin-bottom: 4px; color: #798581; font-size: 9px; }
.location-meta dd { margin: 0; font-size: 12px; font-weight: 700; }

.primary-button, .outline-button, .quiet-button, .review-action, .demo-controls button {
  border: 0;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, color .16s ease;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 18px;
  color: white;
  background: var(--orange);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 800;
}

.primary-button:hover { background: var(--orange-dark); transform: translate(-1px, -1px); }
.primary-button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.crosshair { width: 15px; height: 15px; border: 2px solid white; border-radius: 50%; box-shadow: inset 0 0 0 3px var(--orange); }

.demo-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 17px; }
.demo-controls > span { flex-basis: 100%; color: #8b5b40; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.demo-controls button { padding: 7px 9px; color: var(--ink); background: transparent; border: 1px solid rgba(23,41,43,.22); font-size: 10px; }
.demo-controls button:hover { color: white; background: var(--ink); }

.browser-note { display: flex; gap: 15px; align-items: start; padding: 14px 22px; color: #f8e4c9; background: var(--ink); }
.browser-note span { flex: 0 0 auto; padding: 3px 7px; color: var(--ink); background: var(--yellow); font-size: 9px; font-weight: 800; }
.browser-note p { margin: 0; font-size: 10px; line-height: 1.7; }

.worker-sidebar { display: flex; flex-direction: column; gap: 22px; }
.shift-card, .week-card { padding: 24px; }
.section-title-row, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.section-title-row h2, .panel-heading h2 { margin: 0; font-family: "Noto Serif TC", serif; font-size: 20px; }
.shift-state { padding: 5px 9px; color: #6d7875; background: #e8e4da; font-size: 9px; font-weight: 800; }
.shift-state.is-working { color: white; background: var(--green); }

.timeline { position: relative; min-height: 126px; margin: 23px 0; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.timeline-empty { display: grid; place-items: center; min-height: 110px; color: #89938f; font-size: 12px; border: 1px dashed var(--line); }
.timeline-item { position: relative; display: flex; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.timeline-item::before { content: ""; position: absolute; left: -28px; top: 4px; width: 9px; height: 9px; border: 3px solid var(--card); border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.timeline-item.checkout::before { background: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.timeline-item strong, .timeline-item small { display: block; }
.timeline-item strong { font-size: 12px; }
.timeline-item small { margin-top: 4px; color: #818d89; font-size: 9px; }
.timeline-item time { font: 800 17px "Bahnschrift", sans-serif; }

.outline-button { width: 100%; min-height: 43px; color: var(--ink); background: transparent; border: 1px solid var(--ink); font-size: 11px; font-weight: 800; }
.outline-button:hover { color: white; background: var(--ink); }

.week-card .section-title-row > strong { color: var(--green); font: 800 21px "Bahnschrift", sans-serif; }
.week-card .section-title-row > strong small { font: 700 9px "Noto Sans TC", sans-serif; }
.week-bars { display: grid; grid-template-columns: repeat(6, 1fr); align-items: end; gap: 7px; height: 118px; margin-top: 18px; }
.week-bars div { display: flex; flex-direction: column; align-items: center; justify-content: end; height: 100%; gap: 7px; }
.week-bars i { display: block; width: 100%; height: var(--height); min-height: 2px; background: #c8cec7; }
.week-bars .today i { background: var(--orange); }
.week-bars span { color: #7b8783; font-size: 9px; }

.manager-actions { display: flex; align-items: center; gap: 18px; }
.quiet-button { padding: 9px 12px; color: #52625f; background: transparent; border: 1px solid var(--line); font-size: 10px; }
.quiet-button:hover { border-color: var(--ink); }
.last-sync { display: flex; align-items: center; gap: 9px; color: #667773; font-size: 10px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card { position: relative; overflow: hidden; min-height: 130px; padding: 20px; color: var(--ink); background: var(--card); border: 1px solid var(--line); }
.stat-card::after { content: attr(data-index); position: absolute; right: -4px; bottom: -20px; color: rgba(23,41,43,.05); font: 900 78px "Bahnschrift", sans-serif; }
.stat-card.accent { color: white; background: var(--ink); }
.stat-card.accent::after { color: rgba(255,255,255,.05); }
.stat-card small, .stat-card strong, .stat-card span { display: block; position: relative; z-index: 1; }
.stat-card small { color: #73817e; font-size: 10px; letter-spacing: .08em; }
.stat-card.accent small { color: #aebbb7; }
.stat-card strong { margin: 13px 0 3px; font: 800 32px "Bahnschrift", sans-serif; }
.stat-card span { color: #798581; font-size: 9px; }
.stat-card.accent strong { color: var(--yellow); }
.stat-card.accent span { color: #bfc9c6; }

.dashboard-panel, .review-panel, .attendance-panel { padding: 24px; }
.manager-layout { align-items: start; }
.panel-heading { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.legend { display: flex; align-items: center; gap: 7px; color: #7b8783; font-size: 9px; }
.legend span { width: 7px; height: 7px; border-radius: 50%; }
.legend .present { background: var(--green); }
.legend .waiting { margin-left: 6px; background: var(--yellow); }

.site-row { display: grid; grid-template-columns: 46px minmax(150px,1fr) minmax(160px,1.5fr) auto; align-items: center; gap: 15px; padding: 18px 2px; border-bottom: 1px solid var(--line); }
.site-row:last-child { border-bottom: 0; padding-bottom: 0; }
.site-code { display: grid; place-items: center; width: 40px; height: 40px; color: white; background: var(--ink); font: 800 11px "Bahnschrift", sans-serif; }
.site-info strong, .site-info small { display: block; }
.site-info strong { font-size: 12px; }
.site-info small { margin-top: 4px; color: #808b88; font-size: 9px; }
.crew-track { display: flex; align-items: center; gap: 10px; }
.crew-faces { display: flex; padding-left: 7px; }
.crew-face { display: grid; place-items: center; width: 29px; height: 29px; margin-left: -7px; border: 2px solid var(--card); border-radius: 50%; color: white; background: var(--green); font-size: 9px; font-weight: 800; }
.crew-face.waiting { color: var(--ink); background: var(--yellow); }
.crew-track small { color: #74817e; font-size: 9px; }
.site-status { min-width: 65px; text-align: right; }
.site-status strong { display: block; color: var(--green); font: 800 17px "Bahnschrift", sans-serif; }
.site-status small { color: #808b88; font-size: 8px; }

.count-badge { display: grid; place-items: center; width: 25px; height: 25px; color: white; background: var(--orange); font: 800 11px "Bahnschrift", sans-serif; }
.review-card { margin-top: 16px; padding: 16px; background: #f0eadc; border-left: 4px solid var(--yellow); }
.review-person { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.review-person strong { font-size: 12px; }
.review-person span { padding: 3px 6px; color: #7e5417; background: rgba(245,189,49,.28); font-size: 8px; font-weight: 800; }
.review-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin: 14px 0; }
.review-card dt { color: #7a8783; font-size: 8px; }
.review-card dd { margin: 3px 0 0; font-size: 10px; font-weight: 700; }
.review-reason { margin: 0 0 15px; color: #5d6b68; font-size: 10px; line-height: 1.6; }
.review-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 7px; }
.review-action { padding: 9px; font-size: 9px; font-weight: 800; }
.review-action.reject { color: var(--red); background: transparent; border: 1px solid rgba(183,71,50,.35); }
.review-action.approve { color: white; background: var(--green); }
.empty-review { display: grid; place-items: center; min-height: 180px; color: #83908c; font-size: 11px; text-align: center; }
.empty-review b { display: block; margin-bottom: 5px; color: var(--green); font-size: 27px; }

.attendance-panel { margin-top: 22px; }
.table-note { color: #7c8884; font-size: 9px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 13px 12px; color: #788581; border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 700; text-align: left; white-space: nowrap; }
td { padding: 15px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.person-cell strong, .person-cell small { display: block; }
.person-cell small { margin-top: 4px; color: #7a8784; font-size: 8px; }
.source-pill, .status-pill { padding: 4px 7px; font-size: 8px; font-weight: 800; }
.source-pill { color: var(--green); background: rgba(38,112,87,.1); }
.source-pill.manual { color: #845813; background: rgba(245,189,49,.22); }
.status-pill { color: #687672; border: 1px solid var(--line); }
.status-pill.working { color: white; background: var(--green); border-color: var(--green); }

dialog { width: min(460px, calc(100vw - 30px)); padding: 0; color: var(--ink); background: var(--card); border: 0; box-shadow: 0 30px 100px rgba(9,18,19,.35); }
dialog::backdrop { background: rgba(15,26,27,.72); backdrop-filter: blur(4px); }
dialog form { padding: 27px; border-top: 6px solid var(--orange); }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; }
.dialog-heading h2 { margin: 0; font-family: "Noto Serif TC", serif; }
.dialog-close { border: 0; color: #64716e; background: transparent; font-size: 28px; line-height: 1; cursor: pointer; }
.dialog-intro { margin: 18px 0; color: #697673; font-size: 11px; line-height: 1.7; }
dialog label { display: block; margin: 13px 0; font-size: 10px; font-weight: 800; }
dialog input, dialog select, dialog textarea { display: block; width: 100%; margin-top: 7px; padding: 11px 12px; color: var(--ink); background: #f1ede3; border: 1px solid var(--line); border-radius: 0; outline: none; }
dialog textarea { resize: vertical; }
dialog input:focus, dialog select:focus, dialog textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(242,100,48,.12); }
dialog .primary-button { width: 100%; margin-top: 20px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; align-items: center; gap: 11px; max-width: 350px; padding: 14px 18px; color: white; background: var(--ink); box-shadow: 0 15px 50px rgba(0,0,0,.25); transform: translateY(100px); opacity: 0; transition: .28s ease; }
.toast.is-visible { transform: translateY(0); opacity: 1; }
.toast span { display: grid; place-items: center; width: 22px; height: 22px; color: var(--ink); background: var(--yellow); border-radius: 50%; font-weight: 900; }
.toast p { margin: 0; font-size: 11px; line-height: 1.5; }
.toast.is-error span { color: white; background: var(--red); }

.reveal { animation: reveal .55s both cubic-bezier(.2,.7,.2,1); }
.delay-1 { animation-delay: .08s; }
.delay-2 { animation-delay: .16s; }
.delay-3 { animation-delay: .24s; }
@keyframes reveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (max-width: 1040px) {
  .worker-layout, .manager-layout { grid-template-columns: 1fr; }
  .worker-sidebar { display: grid; grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .topbar { height: auto; min-height: 72px; padding-block: 11px; }
  .poc-chip { display: none; }
  .role-button { min-width: 62px; padding-inline: 9px; font-size: 11px; }
  main { padding-top: 30px; }
  .page-heading { display: block; }
  .worker-badge, .manager-actions { margin-top: 18px; }
  .site-card-head { padding: 22px 20px 16px; }
  .site-details { grid-template-columns: 1fr; }
  .site-details > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .site-details > div:last-child { border-bottom: 0; }
  .location-console { grid-template-columns: 1fr; }
  .radar-wrap { min-height: 350px; border-right: 0; border-bottom: 1px solid var(--line); }
  .location-readout { padding: 24px 20px; }
  .worker-sidebar { display: flex; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 116px; padding: 16px; }
  .site-row { grid-template-columns: 42px 1fr auto; }
  .crew-track { grid-column: 2 / 4; }
  .manager-heading .manager-actions { justify-content: space-between; }
  .browser-note { display: block; }
  .browser-note p { margin-top: 8px; }
  .login-shell { min-height: calc(100vh - 72px); padding: 22px 15px; }
  .login-panel { grid-template-columns: 1fr; }
  .login-copy { min-height: 285px; padding: 32px 28px 82px; }
  .login-copy h1 { margin: 14px 0; font-size: 42px; }
  .login-proof { left: 28px; bottom: 28px; }
  .login-form { padding: 32px 28px 38px; }
}

@media (max-width: 420px) {
  .brand strong { font-size: 16px; }
  .brand small { display: none; }
  .brand-mark { width: 30px; height: 30px; }
  .account-menu > div { display: none; }
  .page-heading h1 { font-size: 29px; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 105px; }
  .radar { width: 250px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
