@import url("/ui-tokens.css");
:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.62);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.16);
  --accent: #0071e3;
  --accent-dark: #005bbd;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --success: #248a3d;
  --warning: #b46a00;
  --danger: #d70015;
  --code-bg: #fbfbfd;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.08);
  --glow: 0 0 0 1px rgba(0, 113, 227, 0.12), 0 16px 36px rgba(0, 113, 227, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1120px;
  color: var(--text);
  background:
    radial-gradient(circle at 18% -8%, rgba(255, 255, 255, 0.95), transparent 30%),
    radial-gradient(circle at 86% 4%, rgba(0, 113, 227, 0.12), transparent 24%),
    linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 36%, #eef1f5 100%);
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.62), transparent 42%),
    radial-gradient(circle at 70% 18%, rgba(0, 113, 227, 0.08), transparent 32%);
  background-size: auto;
  mask-image: none;
  z-index: -1;
}

.auth-body,
.scan-body {
  min-width: 0;
  min-height: 100dvh;
  display: block;
  padding: 16px;
}

.auth-shell,
.scan-shell {
  width: min(420px, 100%);
  margin: 0 auto;
}

.auth-shell {
  display: grid;
  gap: 14px;
}

.auth-card,
.scan-card {
  padding: 22px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.auth-body {
  display: grid;
  place-items: center;
}

.scan-body {
  color: #effaf8;
  background:
    linear-gradient(180deg, rgba(24, 211, 189, 0.16), transparent 32%),
    radial-gradient(circle at 90% 0%, rgba(255, 184, 77, 0.18), transparent 30%),
    #071011;
}

.scan-shell {
  display: grid;
  gap: 12px;
  padding-bottom: 26px;
}

.scan-hero-card {
  position: relative;
  overflow: hidden;
  min-height: 168px;
  display: grid;
  align-content: space-between;
  padding: 22px;
  border: 1px solid rgba(24, 211, 189, 0.3);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(24, 211, 189, 0.18), rgba(255, 184, 77, 0.08)),
    rgba(12, 27, 31, 0.94);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.scan-hero-card::after {
  content: "";
  position: absolute;
  right: -26px;
  top: -28px;
  width: 118px;
  height: 118px;
  border: 1px solid rgba(24, 211, 189, 0.24);
  border-radius: 50%;
}

.scan-card-stack {
  display: grid;
  gap: 12px;
}

.scan-card {
  padding: 16px;
  border-radius: 14px;
  background: rgba(14, 26, 29, 0.92);
}

.scan-submit-card {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 12px 0 0;
  background: linear-gradient(to top, #071011 72%, transparent);
}

.scan-submit-card .primary-button {
  width: 100%;
  min-height: 50px;
  font-size: 16px;
}

.scan-after-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.scan-after-actions.hidden {
  display: none;
}

.scan-progress-pill {
  width: fit-content;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  margin-top: 10px;
  padding: 0 13px;
  border: 1px solid rgba(24, 211, 189, 0.36);
  border-radius: 999px;
  color: #bff8ee;
  background: rgba(24, 211, 189, 0.1);
  font-size: 15px;
  font-weight: 600;
}

.scan-progress-pill.hidden,
.scan-edit-button.hidden,
.scan-previous-button.hidden,
.scan-push-button.hidden,
.scan-next-button.hidden {
  display: none;
}

.scan-progress-pill.complete {
  border-color: rgba(255, 184, 77, 0.62);
  color: #071011;
  background: var(--warning);
}

.scan-edit-button,
.scan-previous-button,
.scan-next-button,
.scan-push-button {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  color: #effaf8;
  font-weight: 600;
}

.scan-edit-button,
.scan-previous-button,
.scan-next-button {
  background: rgba(255, 255, 255, 0.07);
}

.scan-push-button {
  color: #071011;
  background: var(--warning);
}

.scan-push-button:disabled,
.scan-edit-button:disabled,
.scan-previous-button:disabled,
.scan-next-button:disabled {
  cursor: not-allowed;
  opacity: 0.66;
}

.scan-start-card {
  padding: 2px 0;
}

.scan-start-button {
  width: 100%;
  min-height: 142px;
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 20px;
  border: 1px solid rgba(24, 211, 189, 0.45);
  border-radius: 18px;
  color: #effaf8;
  background:
    linear-gradient(135deg, rgba(24, 211, 189, 0.2), rgba(24, 211, 189, 0.06)),
    rgba(14, 26, 29, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.scan-start-button strong {
  font-size: 22px;
}

.scan-start-button span:last-child {
  color: #a9c3bf;
  font-size: 13px;
}

.scan-start-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #071011;
  background: var(--accent);
  box-shadow: 0 14px 28px rgba(24, 211, 189, 0.26);
}

.scan-start-icon svg {
  width: 40px;
  height: 40px;
}

.scan-start-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scan-camera-sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.68);
}

.scan-camera-sheet.hidden {
  display: none;
}

.scan-camera-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(24, 211, 189, 0.28);
  border-radius: 18px;
  background: #101c1f;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.46);
}

.scan-close-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #effaf8;
  background: rgba(255, 255, 255, 0.06);
}

.scan-camera-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 16px;
  background: #020707;
}

.scan-camera-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-camera-corners {
  position: absolute;
  inset: 13%;
  border: 2px solid rgba(24, 211, 189, 0.78);
  border-radius: 14px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.18);
}

.scan-camera-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.scan-card-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.scan-card-title strong {
  font-size: 15px;
}

.scan-card-title span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.auth-brand {
  margin-bottom: 22px;
}

.auth-brand .brand-mark {
  width: 132px;
  height: 58px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 22px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.auth-section-title strong {
  color: #1d1d1f;
  font-size: 17px;
  font-weight: 600;
}

.auth-section-title span {
  color: #6e6e73;
  font-size: 12px;
  white-space: nowrap;
}

.problem-record-card {
  border-color: rgba(255, 149, 0, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 250, 242, 0.86));
}

.work-sync-card {
  border-color: rgba(52, 199, 89, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 255, 248, 0.86));
}

.handover-card {
  border-color: rgba(88, 86, 214, 0.2);
  background: rgba(255, 255, 255, 0.88);
}

.handover-route-card {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(88, 86, 214, 0.14);
  border-radius: 14px;
  background: rgba(88, 86, 214, 0.06);
}

.handover-route-card span,
.handover-route-card small {
  color: #6e6e73;
  font-size: 11px;
}

.handover-route-card strong {
  color: #3f3c9c;
  font-size: 14px;
  line-height: 1.35;
}

.problem-record-card textarea {
  min-height: 108px;
  resize: vertical;
}

.problem-record-account {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(0, 122, 255, 0.14);
  border-radius: 12px;
  color: #0066d6;
  background: rgba(0, 122, 255, 0.08);
  font-size: 13px;
  font-weight: 600;
}

.scan-participant-picker {
  display: grid;
  gap: 0;
  padding: 6px 8px;
  border: 1px solid rgba(0, 122, 255, 0.12);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
}

.scan-participant-title {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.scan-participant-title strong {
  color: #1d1d1f;
  font-size: 14px;
}

.scan-participant-title span {
  color: #6e6e73;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.scan-participant-options {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0 2px;
}

.scan-participant-picker.expanded .scan-participant-options {
  display: flex;
}

.scan-participant-option {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  color: #1d1d1f;
  background: #ffffff;
  font-size: 12px;
  font-weight: 600;
}

.scan-participant-option:has(input:checked) {
  border-color: rgba(0, 113, 227, 0.32);
  color: #0057b7;
  background: rgba(0, 113, 227, 0.09);
}

.scan-participant-option.locked {
  opacity: 0.82;
}

.scan-participant-option input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.problem-record-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  color: #ffffff;
  background: #ff9500;
  box-shadow: 0 14px 30px rgba(255, 149, 0, 0.2);
  font-weight: 600;
  cursor: pointer;
}

.problem-record-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.scan-head {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
}

.scan-head span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.scan-head h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.12;
}

.scan-head p {
  margin: 0;
  color: var(--muted);
}

.scan-status-chip {
  position: relative;
  z-index: 1;
  width: fit-content;
  padding: 7px 10px;
  border: 1px solid rgba(24, 211, 189, 0.28);
  border-radius: 999px;
  color: #bff8ee;
  background: rgba(24, 211, 189, 0.1);
  font-size: 12px;
}

.scan-hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scan-link-button {
  min-height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #effaf8;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.scan-status-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.scan-choice {
  display: grid;
  gap: 6px;
  min-height: 104px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.scan-choice.active {
  border-color: rgba(24, 211, 189, 0.72);
  background: rgba(24, 211, 189, 0.14);
  box-shadow: inset 0 0 0 1px rgba(24, 211, 189, 0.2);
}

.scan-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.scan-choice strong {
  font-size: 18px;
}

.scan-choice span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.scan-guide-card {
  margin-bottom: 12px;
}

.scan-guide-steps {
  display: grid;
  gap: 10px;
}

.scan-guide-steps div {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.scan-guide-steps strong {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #071011;
  background: var(--accent);
}

.scan-guide-steps span {
  color: #dbe9e7;
  font-size: 13px;
}

.scan-progress-overview-card {
  margin-bottom: 12px;
}

.scan-progress-list {
  display: grid;
  gap: 8px;
}

.scan-progress-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.scan-progress-item-info {
  display: grid;
  gap: 4px;
}

.scan-progress-item-name {
  color: #effaf8;
  font-size: 14px;
  font-weight: 600;
}

.scan-progress-item-status {
  color: #8ea19f;
  font-size: 12px;
}

.scan-progress-item-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.scan-progress-item-badge.complete {
  background: rgba(69, 209, 138, 0.16);
  color: #45d18a;
  border: 1px solid rgba(69, 209, 138, 0.3);
}

.scan-progress-item-badge.in-progress {
  background: rgba(255, 184, 77, 0.16);
  color: #ffb84d;
  border: 1px solid rgba(255, 184, 77, 0.3);
}

.scan-progress-item-badge.not-started {
  background: rgba(255, 255, 255, 0.06);
  color: #8ea19f;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.scan-session-card {
  display: grid;
  gap: 12px;
}

.scan-step-list {
  display: grid;
  gap: 8px;
}

.scan-step-item {
  position: relative;
  min-height: 44px;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.scan-step-item strong {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #8ea19f;
  background: rgba(255, 255, 255, 0.07);
  font-size: 13px;
}

.scan-step-item span {
  min-width: 0;
  color: #effaf8;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.scan-step-item small {
  display: block;
  margin-top: 2px;
  color: #8ea19f;
  font-size: 11px;
  font-weight: 600;
}

.scan-step-item em {
  color: #8ea19f;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.scan-step-item.current {
  border-color: rgba(24, 211, 189, 0.55);
  background: rgba(24, 211, 189, 0.1);
}

.scan-step-item.current::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.scan-step-item.current strong {
  color: #071011;
  background: var(--accent);
}

.scan-step-item.done strong {
  color: #071011;
  background: #45d18a;
}

.scan-step-item.abnormal {
  border-color: rgba(255, 112, 112, 0.46);
  background: rgba(255, 112, 112, 0.1);
}

.scan-step-item.abnormal strong {
  color: #071011;
  background: #ff7070;
}

.scan-step-item.skipped {
  border-color: rgba(255, 184, 77, 0.4);
  background: rgba(255, 184, 77, 0.1);
}

.scan-step-item.skipped strong {
  color: #071011;
  background: #ffb84d;
}

.scan-body .field span {
  color: #b7c9c6;
}

.scan-body input,
.scan-body select,
.scan-body textarea {
  min-height: 44px;
  border-radius: 10px;
  font-size: 16px;
}

.scan-body textarea {
  min-height: 96px;
}

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

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(7, 16, 17, 0.86);
  border-bottom: 1px solid rgba(24, 211, 189, 0.18);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 118px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark img,
.scan-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
}

h2 {
  font-size: 17px;
  line-height: 1.3;
  font-weight: 600;
}

h3 {
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
}

.brand p,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.app-footer {
  padding: 18px 24px 24px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.scan-footer {
  padding: 4px 8px 10px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(69, 209, 138, 0.12), 0 0 18px rgba(69, 209, 138, 0.55);
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(9, 20, 22, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
}

.tab-button {
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #a5b8b6;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 160ms ease;
}

.tab-button.active {
  color: #04110f;
  border-color: rgba(24, 211, 189, 0.55);
  background: linear-gradient(135deg, var(--accent), #c9fff2);
  box-shadow: var(--glow);
}

.tab-button:hover:not(.active) {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.065);
}

.workspace {
  padding: 18px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(24, 36, 40, 0.94), rgba(12, 21, 23, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(24, 211, 189, 0.75), rgba(255, 184, 77, 0.5), transparent);
  opacity: 0.75;
}

.panel-title,
.subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.subhead {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.subhead.compact {
  margin: 0;
  padding: 0;
  border: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 390px;
  gap: 16px;
}

.mobile-duty-board {
  display: none;
}

@media (max-width: 700px) {
  body:not(.scan-body):not(.auth-body) {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    background: #091012;
  }

  body:not(.scan-body):not(.auth-body) .topbar {
    min-height: 58px;
    padding: 8px 14px;
    border-bottom-color: rgba(255, 255, 255, 0.07);
  }

  body:not(.scan-body):not(.auth-body) .brand {
    gap: 10px;
  }

  body:not(.scan-body):not(.auth-body) .brand-mark {
    width: 76px;
    height: 34px;
  }

  body:not(.scan-body):not(.auth-body) .brand h1 {
    font-size: 17px;
  }

  body:not(.scan-body):not(.auth-body) .brand p {
    display: none;
  }

  body:not(.scan-body):not(.auth-body) .tabs {
    position: sticky;
    top: 0;
    z-index: 5;
    gap: 4px;
    padding: 8px 10px;
    background: rgba(9, 16, 18, 0.94);
  }

  body:not(.scan-body):not(.auth-body) .tab-button {
    min-width: auto;
    height: 34px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 12px;
  }

  body:not(.scan-body):not(.auth-body) .workspace {
    padding: 10px;
  }

  #dashboardView .dashboard-grid {
    display: none;
  }

  .mobile-duty-board {
    display: grid;
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    min-width: 0;
    overflow: hidden;
    max-width: 560px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #f2f7f6;
    background: #111a1d;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
  }

  .mobile-duty-head {
    min-height: 106px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #0c1416;
    text-align: center;
  }

  .mobile-duty-head > div,
  .mobile-session-hero > div,
  .mobile-shift-row > *,
  .mobile-person-list,
  .mobile-inspection-row > div {
    min-width: 0;
  }

  .mobile-duty-head span,
  .mobile-duty-head time,
  .mobile-section-title span,
  .mobile-start-time span {
    display: block;
    color: #819391;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
  }

  .mobile-duty-head h2 {
    margin: 4px 0 3px;
    color: #ffffff;
    font-size: 23px;
    line-height: 1.2;
  }

  .mobile-date-step {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #d7e4e1;
    background: rgba(255, 255, 255, 0.04);
    font-size: 28px;
    line-height: 1;
  }

  .mobile-date-step:active,
  .mobile-section-title button:active {
    transform: translateY(1px);
  }

  .mobile-session-hero {
    min-height: 104px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(24, 211, 189, 0.07);
  }

  .mobile-session-hero > div:first-child > span {
    display: inline-block;
    margin-bottom: 7px;
    color: #51d9bd;
    font-size: 12px;
    font-weight: 600;
  }

  .mobile-session-hero h3 {
    color: #f8fffd;
    font-size: 18px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .mobile-start-time {
    min-width: 76px;
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
  }

  .mobile-start-time strong {
    display: block;
    margin-top: 5px;
    color: #ffffff;
    font-size: 26px;
    font-variant-numeric: tabular-nums;
  }

  .mobile-duty-section {
    padding: 17px 16px 19px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .mobile-duty-section:last-child {
    border-bottom: 0;
  }

  .mobile-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }

  .mobile-section-title h3 {
    margin-top: 3px;
    color: #f6fbfa;
    font-size: 17px;
  }

  .mobile-section-title button {
    min-height: 30px;
    padding: 0 9px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: #9fb1ae;
    background: rgba(255, 255, 255, 0.04);
    font-size: 12px;
  }

  .mobile-shift-list,
  .mobile-inspection-list {
    display: grid;
    gap: 11px;
  }

  .mobile-shift-row {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .mobile-shift-label {
    padding-top: 7px;
  }

  .mobile-shift-label strong,
  .mobile-shift-label span {
    display: block;
  }

  .mobile-shift-label strong {
    color: #dce7e5;
    font-size: 14px;
  }

  .mobile-shift-label span {
    margin-top: 2px;
    color: #728481;
    font-size: 11px;
  }

  .mobile-person-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .mobile-person-list span {
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid rgba(24, 211, 189, 0.22);
    border-radius: 5px;
    color: #a8f0df;
    background: rgba(24, 211, 189, 0.08);
    font-size: 13px;
    font-weight: 600;
    overflow-wrap: anywhere;
  }

  .mobile-handover-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-handover-item {
    min-height: 72px;
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 11px 12px;
    border-left: 3px solid #efb24d;
    border-radius: 4px;
    background: rgba(239, 178, 77, 0.08);
  }

  .mobile-handover-item time {
    color: #ffd48b;
    font-size: 22px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }

  .mobile-handover-item span {
    color: #a99b82;
    font-size: 11px;
  }

  .mobile-inspection-summary {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin-bottom: 14px;
  }

  .mobile-inspection-summary > strong {
    color: #ffffff;
    font-size:var(--ui-font-title);
    font-variant-numeric: tabular-nums;
  }

  .mobile-inspection-summary > span {
    margin-right: auto;
    color: #839491;
    font-size:var(--ui-font-meta);
  }

  .mobile-inspection-summary em {
    padding: 5px 7px;
    border-radius:var(--ui-radius-control);
    color: #79d7a0;
    background: rgba(69, 209, 138, 0.1);
    font-size:var(--ui-font-meta);
    font-style: normal;
  }

  .mobile-inspection-summary em.bad {
    color: #ff8c86;
    background: rgba(255, 92, 87, 0.1);
  }

  .mobile-inspection-summary em.skip {
    color: #ffd083;
    background: rgba(239, 178, 77, 0.1);
  }

  .mobile-inspection-row {
    min-height: 52px;
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .mobile-inspection-row:first-child {
    border-top: 0;
  }

  .mobile-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #45d18a;
  }

  .mobile-inspection-row.bad .mobile-status-dot {
    background: #ff5c57;
  }

  .mobile-inspection-row.skip .mobile-status-dot {
    background: #efb24d;
  }

  .mobile-inspection-row strong,
  .mobile-inspection-row span {
    display: block;
    overflow-wrap: anywhere;
  }

  .mobile-inspection-row strong {
    color: #eaf2f0;
    font-size:var(--ui-font-body);
  }

  .mobile-inspection-row div span {
    margin-top: 3px;
    color: #758784;
    font-size: 11px;
  }

  .mobile-inspection-row em {
    color: #879995;
    font-size: 11px;
    font-style: normal;
  }

  .mobile-empty {
    margin: 0;
    padding: 12px 0;
    color: #70817f;
    font-size: 13px;
  }
}

/* 2026-09 管理端信息架构与排班时间轴 */
body.admin-body {
  min-width: 1040px;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  grid-template-rows: 72px minmax(calc(100dvh - 72px), auto) auto;
  color: #172033;
  background: #f4f6f9;
  font-family: "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.admin-body::before {
  display: none;
}

.admin-body .topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  grid-column: 1 / -1;
  grid-row: 1;
  min-height: 72px;
  padding: 0 24px;
  border: 0;
  border-bottom: 1px solid #e7eaf0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.admin-body .brand {
  gap: 12px;
}

.admin-body .brand-mark {
  width: 106px;
  height: 44px;
}

.admin-body .brand h1 {
  color: #111827;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.admin-body .brand p {
  margin-top: 2px;
  color: #7c8493;
  font-size: 11px;
}

.admin-body .top-actions {
  font-size: 13px;
}

.admin-body .workbench-scan-link,
.admin-body .tab-link-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #c9dcfb;
  border-radius: 9px;
  color: #075fca;
  background: #eef5ff;
  box-shadow: none;
  font-size: 13px;
}

.admin-body .workbench-scan-link:hover,
.admin-body .tab-link-button:hover {
  color: #ffffff;
  background: #0b6ee8;
  box-shadow: 0 8px 20px rgba(11, 110, 232, 0.16);
}

.admin-body .tabs {
  position: sticky;
  top: 72px;
  z-index: 8;
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  min-height: calc(100dvh - 72px);
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 22px 14px;
  overflow: visible;
  border: 0;
  border-right: 1px solid #e7eaf0;
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
}

.admin-body .tabs::before {
  content: "工作模块";
  padding: 0 12px 8px;
  color: #9aa1ae;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.admin-body .tab-button,
.admin-body .tab-link-button {
  width: 100%;
  height: 42px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  color: #626b7b;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.admin-body .tab-button.active {
  color: #075fca;
  background: #edf4ff;
  box-shadow: inset 3px 0 #0b6ee8;
}

.admin-body .tab-button:hover:not(.active),
.admin-body .tab-link-button:hover {
  color: #172033;
  background: #f4f6f9;
  transform: none;
}

.admin-body .tab-link-button {
  margin-top: 8px;
  color: #075fca;
  background: #f3f7fe;
  text-decoration: none;
}

.admin-body .workspace {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 32px 48px;
}

.admin-body .app-footer {
  grid-column: 2;
  grid-row: 3;
  padding: 18px 32px 24px;
  color: #949ba7;
  text-align: left;
}

.admin-body .view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.admin-body .view-heading span,
.admin-body .section-kicker {
  display: block;
  margin-bottom: 5px;
  color: #0b6ee8;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.admin-body .view-heading h2 {
  color: #111827;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.admin-body .view-heading p {
  max-width: 520px;
  color: #7c8493;
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
}

.admin-body .panel {
  overflow: visible;
  padding: 20px;
  border: 1px solid #e5e8ee;
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 8px 26px rgba(39, 51, 73, 0.055);
  backdrop-filter: none;
}

.admin-body .panel::before {
  display: none;
}

.admin-body .panel-title,
.admin-body .subhead {
  margin-bottom: 16px;
}

.admin-body .panel-title h2,
.admin-body .subhead h3 {
  color: #172033;
}

.admin-body .panel-title h2 {
  font-size: 17px;
  font-weight: 600;
}

.admin-body .panel-title .muted,
.admin-body .subhead span,
.admin-body .muted {
  color: #7c8493;
  line-height: 1.55;
}

.admin-body .nested-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.admin-body .nested-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.admin-body .nested-main > .nested-child {
  order: -1;
}

.admin-body .nested-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.admin-body .nested-child {
  border-left: 1px solid #e5e8ee;
}

.admin-body .session-list {
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  margin-bottom: 18px;
}

.admin-body .session-card,
.admin-body .summary-card,
.admin-body .shift-card,
.admin-body .saved-record-card,
.admin-body .shift-picker,
.admin-body .segment-editor {
  border: 1px solid #e7eaf0;
  border-radius: 10px;
  background: #fafbfc;
  box-shadow: none;
}

.admin-body .session-card {
  min-height: 68px;
  padding: 12px 14px;
}

.admin-body .session-card strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.admin-body .session-card span {
  color: #7c8493;
  font-size: 12px;
}

.admin-body .session-editor-inline {
  margin-top: 0;
  padding: 20px 0 0;
  border-top: 1px solid #edf0f4;
}

.admin-body .session-editor-inline > .subhead {
  margin-bottom: 12px;
}

.admin-body .session-editor-inline > .subhead h3 {
  font-size: 16px;
}

.admin-body .session-editor-details > summary {
  display: none;
}

.admin-body .session-editor-details[open] > summary {
  margin-bottom: 0;
}

.admin-body .form-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0 12px;
}

.admin-body .field {
  gap: 7px;
  margin-bottom: 14px;
}

.admin-body .field > span {
  color: #4d5768;
  font-size: 12px;
  font-weight: 600;
}

.admin-body .field small {
  color: #969daa;
  font-size: 10px;
}

.admin-body .field-helper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-body .field-helper-row > span {
  color: #969daa;
}

.admin-body .field-helper-row button {
  padding: 0;
  border: 0;
  color: #075fca;
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.admin-body input,
.admin-body select,
.admin-body textarea {
  min-height: 40px;
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  color: #172033;
  background: #ffffff;
  box-shadow: none;
  cursor: text;
}

.admin-body input:focus,
.admin-body select:focus,
.admin-body textarea:focus {
  border-color: #6fa9ee;
  outline: 3px solid rgba(11, 110, 232, 0.11);
  box-shadow: none;
}

.admin-body button:focus-visible,
.admin-body a:focus-visible,
.admin-body summary:focus-visible {
  outline: 3px solid rgba(11, 110, 232, 0.2);
  outline-offset: 2px;
}

.admin-body .primary-button {
  min-height: 43px;
  height: 43px;
  border: 1px solid #0b6ee8;
  border-radius: 9px;
  color: #ffffff;
  background: #0b6ee8;
  box-shadow: 0 8px 18px rgba(11, 110, 232, 0.17);
  font-size: 14px;
}

.admin-body .primary-button:hover {
  background: #075fca;
  transform: translateY(-1px);
}

.admin-body .ghost-button,
.admin-body .icon-button {
  border-color: #dfe4ec;
  color: #4d5768;
  background: #ffffff;
  box-shadow: none;
}

.admin-body .ghost-button:hover {
  border-color: #b9d3f6;
  color: #075fca;
  background: #f2f7ff;
}

.admin-body .handover-box {
  margin: 8px 0 18px;
  padding: 20px;
  border: 1px solid #dfe4ec;
  border-radius: 12px;
  background: #fbfcfe;
}

.admin-body .handover-box-head {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.admin-body .handover-box-head h3 {
  font-size: 18px;
  font-weight: 600;
}

.admin-body .balance-status {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 7px;
  color: #626b7b;
  background: #eef1f5;
  font-size: 11px;
  font-weight: 600;
}

.admin-body .balance-status.success {
  color: #18733a;
  background: #ebf8ef;
}

.admin-body .balance-status.adjusted {
  color: #8a5a00;
  background: #fff7e7;
}

.admin-body .handover-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-body .handover-toolbar p {
  color: #7c8493;
  font-size: 12px;
}

.admin-body .segmented-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #dfe4ec;
  border-radius: 9px;
  background: #f1f3f6;
}

.admin-body .segmented-control button {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  color: #697282;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.admin-body .segmented-control button.active {
  color: #075fca;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(39, 51, 73, 0.08);
}

.admin-body .handover-timeline {
  margin: 30px 8px 20px;
}

.admin-body .timeline-axis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-bottom: 10px;
  color: #7c8493;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.admin-body .timeline-axis span:not(:first-child):not(:last-child) {
  text-align: center;
}

.admin-body .timeline-axis span:last-child {
  text-align: right;
}

.admin-body .timeline-track {
  position: relative;
  min-height: 116px;
  display: flex;
  align-items: stretch;
  border: 1px solid #cfdcf0;
  border-radius: 10px;
  background: #ffffff;
}

.admin-body .timeline-shift {
  flex: 0 0 var(--shift-width);
  min-width: 0;
  display: grid;
  place-content: center;
  gap: 3px;
  padding: 18px 12px;
  text-align: center;
}

.admin-body .timeline-shift + .timeline-shift {
  border-left: 1px solid rgba(11, 110, 232, 0.16);
}

.admin-body .shift-tone-1 {
  background: #edf5ff;
}

.admin-body .shift-tone-2 {
  background: #f4f8ff;
}

.admin-body .shift-tone-3 {
  background: #f7f8fc;
}

.admin-body .timeline-shift strong {
  color: #075fca;
  font-size: 15px;
  font-weight: 600;
}

.admin-body .timeline-shift span {
  color: #364155;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.admin-body .timeline-shift small {
  overflow: hidden;
  color: #7c8493;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-body .timeline-node {
  position: absolute;
  top: -23px;
  left: var(--node-offset);
  z-index: 2;
  width: 1px;
  height: calc(100% + 46px);
  padding: 0;
  border: 0;
  border-left: 1px dashed #76a8e6;
  background: transparent;
  cursor: pointer;
}

.admin-body .timeline-node span {
  position: absolute;
  top: -2px;
  left: 50%;
  min-width: 50px;
  padding: 4px 7px;
  border-radius: 6px;
  color: #ffffff;
  background: #0b6ee8;
  font-size: 10px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  transform: translate(-50%, -100%);
}

.admin-body .timeline-node i {
  position: absolute;
  top: 20px;
  left: 50%;
  width: 15px;
  height: 15px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #0b6ee8;
  box-shadow: 0 0 0 1px #0b6ee8;
  transform: translate(-50%, -50%);
}

.admin-body .timeline-node.active span {
  background: #075fca;
  box-shadow: 0 5px 12px rgba(11, 110, 232, 0.2);
}

.admin-body .timeline-node.active i {
  width: 18px;
  height: 18px;
  background: #075fca;
}

.admin-body .live-start-marker {
  position: absolute;
  inset: 0 auto 0 var(--live-start-offset);
  z-index: 1;
  border-left: 1px solid #e09a2d;
  pointer-events: none;
}

.admin-body .live-start-marker span {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 3px 5px;
  border-radius: 5px;
  color: #895400;
  background: rgba(255, 247, 228, 0.92);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.admin-body .handover-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.admin-body .handover-field-grid:has(.handover-field:only-child) {
  grid-template-columns: minmax(0, 1fr);
}

.admin-body .handover-field {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(200px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e2e6ed;
  border-radius: 9px;
  background: #ffffff;
}

.admin-body .handover-field.active {
  border-color: #9bc2f3;
  box-shadow: 0 0 0 3px rgba(11, 110, 232, 0.07);
}

.admin-body .handover-field > button {
  display: grid;
  gap: 3px;
  padding: 0;
  border: 0;
  color: #626b7b;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.admin-body .handover-field > button span {
  font-size: 10px;
}

.admin-body .handover-field > button strong {
  color: #172033;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.admin-body .handover-input {
  min-height: 36px;
  font-size: 11px;
}

.admin-body .handover-lock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #626b7b;
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
}

.admin-body .handover-lock input {
  width: 15px;
  min-height: 15px;
  height: 15px;
  accent-color: #0b6ee8;
}

.admin-body .handover-adjustments {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e7eaf0;
  border-radius: 9px;
  background: #ffffff;
}

.admin-body .handover-adjustments > button,
.admin-body .rounding-control button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #dfe4ec;
  border-radius: 7px;
  color: #4d5768;
  background: #ffffff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.admin-body .handover-adjustments > button:hover,
.admin-body .rounding-control button:hover,
.admin-body .rounding-control button.active {
  border-color: #a9c9f1;
  color: #075fca;
  background: #eef5ff;
}

.admin-body .rounding-control {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.admin-body .rounding-control > span {
  color: #7c8493;
  font-size: 10px;
}

.admin-body .handover-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, auto)) minmax(260px, 1fr);
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #dce7f6;
  border-radius: 9px;
  background: #f3f7fd;
}

.admin-body .handover-summary > div {
  display: grid;
  gap: 2px;
}

.admin-body .handover-summary span {
  color: #7c8493;
  font-size: 9px;
}

.admin-body .handover-summary strong {
  color: #075fca;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.admin-body .handover-summary p {
  color: #626b7b;
  font-size: 10px;
  line-height: 1.5;
  text-align: right;
}

@media (min-width: 1270px) {
  .admin-body #handoverPlanner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 172px;
    gap: 0 18px;
  }

  .admin-body .handover-toolbar,
  .admin-body .handover-timeline,
  .admin-body .handover-field-grid,
  .admin-body .handover-adjustments {
    grid-column: 1;
  }

  .admin-body .handover-summary {
    grid-column: 2;
    grid-row: 1 / span 4;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 14px;
    margin: 0;
    padding: 16px;
  }

  .admin-body .handover-summary > div {
    padding-bottom: 13px;
    border-bottom: 1px solid #dce7f6;
  }

  .admin-body .handover-summary span {
    font-size: 10px;
  }

  .admin-body .handover-summary strong {
    font-size: 15px;
  }

  .admin-body .handover-summary p {
    text-align: left;
  }
}

.admin-body .special-box {
  margin-top: 18px;
  margin-bottom: 16px;
}

.admin-body .special-box > .subhead {
  margin: 0 0 12px;
  padding: 16px 0 0;
  border-top: 1px solid #edf0f4;
}

.admin-body .segment-editor {
  grid-template-columns: 170px minmax(150px, 0.8fr) minmax(220px, 1.2fr) minmax(220px, 1.2fr) auto 34px;
  gap: 10px;
  padding: 12px;
}

.admin-body .shift-form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-body .people-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-body .dashboard-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 370px;
  gap: 18px;
}

.admin-body .week-calendar {
  gap: 5px;
}

.admin-body .calendar-day {
  padding-inline: 4px;
  text-align: center;
}

.admin-body .calendar-day span,
.admin-body .calendar-day em {
  font-size: 10px;
}

@media (max-width: 1260px) {
  body.admin-body {
    grid-template-columns: 196px minmax(0, 1fr);
  }

  .admin-body .workspace {
    padding-inline: 24px;
  }

  .admin-body .form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-body .handover-field {
    grid-template-columns: minmax(105px, 0.6fr) minmax(175px, 1fr);
  }

  .admin-body .handover-lock {
    grid-column: 1 / -1;
  }

  .admin-body .handover-summary {
    grid-template-columns: repeat(3, 1fr);
  }

  .admin-body .handover-summary p {
    grid-column: 1 / -1;
    text-align: left;
  }

  .admin-body .shift-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body.admin-body {
    min-width: 0;
    display: block;
  }

  .admin-body .topbar {
    position: relative;
    min-height: 68px;
    padding: 10px 16px;
  }

  .admin-body .brand p {
    display: none;
  }

  .admin-body .tabs {
    position: sticky;
    top: 0;
    min-height: 0;
    display: flex;
    flex-direction: row;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #e7eaf0;
  }

  .admin-body .tabs::before {
    display: none;
  }

  .admin-body .tab-button,
  .admin-body .tab-link-button {
    width: auto;
    min-width: max-content;
    height: 36px;
    min-height: 36px;
    padding: 0 12px;
  }

  .admin-body .tab-button.active {
    box-shadow: inset 0 -2px #0b6ee8;
  }

  .admin-body .tab-link-button {
    margin: 0;
  }

  .admin-body .workspace {
    padding: 20px 14px 36px;
  }

  .admin-body .view-heading {
    display: grid;
    gap: 6px;
  }

  .admin-body .view-heading h2 {
    font-size: 23px;
  }

  .admin-body .view-heading p {
    text-align: left;
  }

  .admin-body .nested-aside,
  .admin-body .handover-field-grid,
  .admin-body .form-grid,
  .admin-body .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-body .handover-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-body .timeline-shift {
    padding-inline: 6px;
  }

  .admin-body .timeline-shift small {
    display: none;
  }

  .admin-body .handover-field {
    grid-template-columns: minmax(110px, 0.55fr) minmax(0, 1fr) auto;
  }

  .admin-body .handover-lock {
    grid-column: auto;
  }

  .admin-body .rounding-control {
    width: 100%;
    margin: 2px 0 0;
  }

  .admin-body .handover-summary {
    grid-template-columns: repeat(3, 1fr);
  }

  .admin-body .handover-summary p {
    grid-column: 1 / -1;
    text-align: left;
  }

  .admin-body .segment-editor {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .admin-body .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Personnel ledger: a compact operational registry, not a disposable name list. */
.personnel-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  min-height: 230px;
  margin-bottom: 16px;
  padding: 34px;
  border: 1px solid rgba(24, 211, 189, 0.22);
  border-radius:var(--ui-radius-card);
  color: #eaf8f5;
  background:
    linear-gradient(115deg, rgba(7, 23, 25, 0.96), rgba(13, 42, 40, 0.9)),
    #071719;
  box-shadow: 0 24px 70px rgba(3, 14, 16, 0.3);
}

.personnel-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(134, 255, 228, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(134, 255, 228, 0.12) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(90deg, transparent, #000 44%, #000);
}

.personnel-hero::after {
  content: "";
  position: absolute;
  right: -86px;
  top: -126px;
  width: 380px;
  height: 380px;
  border: 1px solid rgba(79, 255, 215, 0.2);
  border-radius: 50%;
  box-shadow:
    0 0 0 42px rgba(79, 255, 215, 0.035),
    0 0 0 92px rgba(79, 255, 215, 0.02);
}

.personnel-hero-copy,
.personnel-hero-actions {
  position: relative;
  z-index: 1;
}

.personnel-kicker {
  display: block;
  margin-bottom: 22px;
  color: #6ce9ca;
  font-family: "SFMono-Regular", "Roboto Mono", monospace;
  font-size:var(--ui-font-meta);
  font-weight: 600;
  letter-spacing: 0.16em;
}

.personnel-hero h2 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.personnel-hero p {
  max-width: 760px;
  margin: 18px 0 0;
  color: rgba(224, 244, 239, 0.68);
  font-size:var(--ui-font-body);
  line-height: 1.75;
}

.personnel-hero-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
  min-width: 220px;
}

.personnel-hero-actions .primary-button {
  min-width: 220px;
  min-height: 46px;
}

#personnelSyncStatus {
  color: rgba(224, 244, 239, 0.58);
  font-family: "SFMono-Regular", "Roboto Mono", monospace;
  font-size:var(--ui-font-meta);
}

.personnel-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.personnel-metric-card {
  position: relative;
  min-height: 142px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius:var(--ui-radius-card);
  background: var(--surface-strong);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.05);
}

.personnel-metric-card > span {
  position: absolute;
  right: 16px;
  top: 16px;
  color: var(--muted);
  font-family: "SFMono-Regular", "Roboto Mono", monospace;
  font-size:var(--ui-font-meta);
}

.personnel-metric-card strong {
  display: block;
  color: var(--accent);
  font-size:var(--ui-font-title);
  line-height: 1;
  letter-spacing: -0.05em;
}

.personnel-metric-card h3 {
  margin: 14px 0 4px;
  font-size:var(--ui-font-body);
}

.personnel-metric-card p {
  margin: 0;
  color: var(--muted);
  font-size:var(--ui-font-meta);
}

.personnel-layout {
  display: grid;
  grid-template-columns: minmax(700px, 1fr) 360px;
  align-items: start;
  gap: 16px;
}

.personnel-side-stack {
  display: grid;
  gap: 16px;
}

.personnel-roster-panel,
.personnel-change-panel,
.personnel-change-log-panel {
  overflow: visible;
}

.personnel-filter {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius:var(--ui-radius-control);
  background: var(--surface-soft);
}

.personnel-filter-button {
  height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius:var(--ui-radius-control);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.personnel-filter-button.active {
  color: #fff;
  background: #172a2a;
}

.personnel-add-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 160px auto;
  align-items: end;
  gap: 10px;
  margin: 8px 0 18px;
  padding: 14px;
  border: 1px dashed rgba(24, 211, 189, 0.3);
  border-radius:var(--ui-radius-card);
  background: rgba(24, 211, 189, 0.045);
}

.personnel-add-strip .field {
  margin: 0;
}

.personnel-add-strip .primary-button {
  min-height: 42px;
}

.personnel-roster {
  display: grid;
  gap: 10px;
}

.personnel-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius:var(--ui-radius-card);
  background: var(--surface-soft);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.personnel-card:hover {
  border-color: rgba(24, 211, 189, 0.36);
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.06);
}

.personnel-card.inactive {
  opacity: 0.7;
  filter: saturate(0.65);
}

.personnel-card-index {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(24, 211, 189, 0.3);
  border-radius: 50%;
  color: #bff8e9;
  background: #102b29;
  font-size:var(--ui-font-heading);
  font-weight: 600;
}

.personnel-card-head,
.personnel-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.personnel-card-head h3 {
  margin: 0 0 3px;
  font-size:var(--ui-font-heading);
}

.personnel-id {
  color: var(--muted);
  font-family: "SFMono-Regular", "Roboto Mono", monospace;
  font-size:var(--ui-font-meta);
}

.personnel-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.personnel-badge {
  padding: 4px 7px;
  border-radius:var(--ui-radius-pill);
  font-size:var(--ui-font-meta);
  font-weight: 600;
}

.personnel-badge.active,
.personnel-badge.wecom {
  color: #08775f;
  background: rgba(31, 203, 157, 0.13);
}

.personnel-badge.inactive {
  color: var(--muted);
  background: rgba(128, 128, 128, 0.13);
}

.personnel-badge.scheduled {
  color: #a76200;
  background: rgba(245, 166, 35, 0.14);
}

.personnel-badge.warning {
  color: #a76200;
  background: rgba(245, 166, 35, 0.14);
}

.personnel-card-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px 150px;
  gap: 8px;
  margin-top: 12px;
}

.personnel-card-fields .field {
  margin: 0;
}

.personnel-account-row {
  display: grid;
  grid-template-columns: 34px minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(24, 211, 189, 0.16);
  border-radius:var(--ui-radius-card);
  background: linear-gradient(105deg, rgba(24, 211, 189, 0.055), rgba(255, 255, 255, 0.55));
}

.personnel-account-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius:var(--ui-radius-control);
  color: #aef5e2;
  background: #122826;
  font-family: "SFMono-Regular", "Roboto Mono", monospace;
  font-size:var(--ui-font-meta);
  font-weight: 600;
}

.personnel-account-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.personnel-account-copy > span,
.personnel-account-copy small {
  color: var(--muted);
  font-size:var(--ui-font-meta);
}

.personnel-account-copy strong {
  font-family: "SFMono-Regular", "Roboto Mono", monospace;
  font-size:var(--ui-font-body);
}

.account-username-field input {
  max-width: 280px;
  height: 34px;
  background: rgba(255, 255, 255, 0.8);
}

.personnel-account-actions {
  justify-content: flex-end;
}

.account-auto-note {
  max-width: 120px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.account-credential-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(245, 166, 35, 0.32);
  border-radius: 10px;
  background: linear-gradient(115deg, rgba(255, 244, 211, 0.96), rgba(255, 255, 255, 0.94));
  box-shadow: 0 12px 30px rgba(167, 98, 0, 0.08);
}

.account-credential-notice > div:first-child {
  display: grid;
  gap: 4px;
}

.account-credential-notice span {
  color: #8a5700;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-credential-notice code {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 6px;
  color: #fff;
  background: #1d2424;
  font-size: 13px;
}

.personnel-card-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.personnel-card-foot > span,
.personnel-change-note {
  color: var(--muted);
  font-size:var(--ui-font-meta);
  line-height: 1.6;
}

.danger-button {
  color: var(--danger);
  border-color: rgba(215, 0, 21, 0.24);
}

.personnel-panel-number {
  display: block;
  margin-bottom: 18px;
  color: var(--accent);
  font-family: "SFMono-Regular", "Roboto Mono", monospace;
  font-size:var(--ui-font-meta);
  letter-spacing: 0.14em;
}

.personnel-change-panel .primary-button {
  width: 100%;
  margin-top: 4px;
}

.personnel-change-note {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.personnel-change-log {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
}

.personnel-log-item {
  padding-left: 12px;
  border-left: 2px solid rgba(24, 211, 189, 0.32);
}

.personnel-log-item span {
  display: block;
  color: var(--muted);
  font-family: "SFMono-Regular", "Roboto Mono", monospace;
  font-size:var(--ui-font-meta);
}

.personnel-log-item strong {
  display: block;
  margin: 4px 0 2px;
  font-size:var(--ui-font-meta);
}

.personnel-log-item p {
  margin: 0;
  color: var(--muted);
  font-size:var(--ui-font-meta);
  line-height: 1.55;
}

.person-quick-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}

.person-quick-row:last-child {
  border-bottom: 0;
}

.person-quick-row small {
  color: var(--muted);
  font-size: 10px;
}

.person-quick-signal {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(36, 138, 61, 0.1);
}

.person-quick-signal.missing {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(180, 106, 0, 0.1);
}

@media (max-width: 1399px) {
  .personnel-layout {
    grid-template-columns: 1fr;
  }

  .personnel-side-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .personnel-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 24px 18px;
  }

  .personnel-hero h2 {
    font-size:var(--ui-font-title);
  }

  .personnel-hero-actions {
    justify-items: stretch;
  }

  .personnel-hero-actions .primary-button {
    width: 100%;
  }

  .personnel-metrics,
  .personnel-side-stack {
    grid-template-columns: 1fr 1fr;
  }

  .personnel-layout {
    display: block;
  }

  .personnel-side-stack {
    display: grid;
    margin-top: 12px;
  }

  .personnel-add-strip,
  .personnel-card-fields {
    grid-template-columns: 1fr;
  }

  .personnel-account-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .personnel-account-row > .personnel-badge,
  .personnel-account-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .account-credential-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .personnel-card {
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 12px;
  }

  .personnel-card-index {
    width: 38px;
    height: 38px;
  }

  .personnel-card-head,
  .personnel-card-foot {
    align-items: flex-start;
    flex-direction: column;
  }
}

.password-change-card {
  position: relative;
  overflow: hidden;
}

.password-change-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #18d3bd, #ffd27d);
}

.password-change-seal {
  position: absolute;
  top: 18px;
  right: 20px;
  color: rgba(0, 0, 0, 0.1);
  font-family: "SFMono-Regular", "Roboto Mono", monospace;
  font-size: 30px;
  font-weight: 600;
}

.account-identity-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0;
  padding: 11px 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  background: rgba(24, 211, 189, 0.07);
}

.account-identity-strip span,
.password-rule {
  color: #6e7776;
  font-size: 12px;
}

.account-identity-strip strong {
  font-family: "SFMono-Regular", "Roboto Mono", monospace;
  font-size: 12px;
}

.password-rule {
  margin: -2px 0 6px;
  line-height: 1.6;
}

.span-2 {
  grid-column: span 2;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-card,
.shift-card,
.saved-record-card,
.session-card,
.log-item,
.segment-editor,
.reminder-item,
.compact-reminder {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.028));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.summary-card {
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(24, 211, 189, 0.13), rgba(255, 255, 255, 0.035)),
    var(--surface-soft);
}

.summary-card span,
.shift-card span,
.session-card span,
.reminder-item strong,
.reminder-item em {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  color: #f7fffb;
  font-size: 30px;
  line-height: 1.1;
  text-shadow: 0 0 18px rgba(24, 211, 189, 0.18);
}

.week-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.week-calendar.compact {
  margin-bottom: 14px;
}

.calendar-day {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 8px 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}

.calendar-day span,
.calendar-day em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-day strong {
  color: #f6fffb;
  font-size: 18px;
  line-height: 1.1;
}

.calendar-day.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(24, 211, 189, 0.2), rgba(255, 184, 77, 0.08));
  box-shadow: var(--glow);
}

.calendar-day.rest em {
  color: var(--warning);
  font-weight: 600;
}

.calendar-day:hover {
  transform: translateY(-1px);
  border-color: rgba(24, 211, 189, 0.42);
  background: rgba(24, 211, 189, 0.095);
}

.saved-record-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.saved-record-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.saved-record-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}

.saved-record-card span,
.saved-record-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.saved-record-card strong {
  color: var(--text);
  font-size: 15px;
}

.saved-record-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--glow);
}

.saved-record-card:hover {
  border-color: rgba(24, 211, 189, 0.38);
  background: rgba(255, 255, 255, 0.065);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(560px, 1.08fr);
  gap: 16px;
}

.nested-grid {
  display: grid;
  grid-template-columns: minmax(680px, 1fr) 390px;
  align-items: start;
  gap: 16px;
}

.nested-main,
.nested-aside {
  display: grid;
  align-content: start;
  gap: 16px;
}

.nested-child {
  border-left: 4px solid rgba(24, 211, 189, 0.42);
}

.session-editor-inline {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.session-editor-inline > .subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 0;
}

.reminder-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1.08fr) minmax(420px, 0.92fr);
  align-items: start;
  gap: 16px;
}

.webhook-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) minmax(520px, 1.15fr);
  align-items: start;
  gap: 16px;
}

.inspection-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1.1fr) minmax(430px, 0.9fr);
  align-items: start;
  gap: 16px;
}

.inspection-side {
  display: grid;
  align-content: start;
  gap: 16px;
}

.side-stack {
  display: grid;
  grid-template-rows: 310px minmax(360px, 1fr);
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field span {
  color: #b7c8c6;
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(4, 11, 12, 0.74);
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

input,
select {
  height: 40px;
  padding: 0 12px;
}

.secret-input:not(:placeholder-shown) {
  -webkit-text-security: disc;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(24, 211, 189, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.button-row {
  display: flex;
  gap: 8px;
}

.primary-button,
.ghost-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: 150ms ease;
}

.primary-button {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), #d7fff4);
  color: #041210;
  font-weight: 600;
  font-size: 16px;
  box-shadow: 0 12px 32px rgba(24, 211, 189, 0.18);
}

.primary-button:hover {
  background: linear-gradient(135deg, #61f2df, #fff4c9);
  transform: translateY(-1px);
}

.primary-button:active,
.ghost-button:active,
.icon-button:active,
.tab-button:active,
.calendar-day:active,
.saved-record-card:active,
.reminder-item:active,
.compact-reminder:active,
.scan-start-button:active,
.scan-choice:active {
  transform: scale(0.98);
}

.primary-button:disabled {
  cursor: progress;
  background: #8abeb9;
}

.ghost-button {
  height: 34px;
  padding: 0 11px;
  color: #d5e4e1;
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.11);
  font-size: 13px;
  white-space: nowrap;
}

.ghost-button:hover {
  color: #041210;
  border-color: rgba(24, 211, 189, 0.62);
  background: var(--accent);
  transform: translateY(-1px);
}

.icon-button {
  width: 32px;
  height: 32px;
  color: var(--danger);
  background: rgba(255, 107, 95, 0.12);
  border-color: rgba(255, 107, 95, 0.3);
  font-size: 20px;
  line-height: 1;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.people-grid.compact {
  grid-template-columns: 1fr;
}

.person-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 0;
}

.people-grid.compact .person-row {
  grid-template-columns: 1fr;
}

.person-row .field {
  margin-bottom: 0;
}

.shift-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.shift-picker {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.shift-picker-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
}

.shift-picker-head span {
  color: var(--muted);
}

.person-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-pill,
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #c2d1cf;
  font-size: 13px;
}

.check-pill {
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  transition: 140ms ease;
}

.check-pill:has(input:checked) {
  color: #041210;
  border-color: rgba(24, 211, 189, 0.68);
  background: linear-gradient(135deg, var(--accent), #e2fff6);
  box-shadow: 0 10px 24px rgba(24, 211, 189, 0.14);
}

.check-pill input,
.inline-check input {
  width: auto;
}

.shift-overview,
.session-list,
.compact-reminders,
.reminder-list,
.log-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.shift-overview.compact {
  gap: 8px;
}

.shift-card {
  padding: 12px 14px;
}

.shift-card strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 15px;
}

.shift-card.empty strong {
  color: var(--muted);
}

.session-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
}

.session-card strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

.segment-list {
  display: grid;
  gap: 10px;
}

.segment-editor {
  display: grid;
  grid-template-columns: 180px minmax(180px, 0.8fr) minmax(220px, 1fr) minmax(220px, 1.2fr) auto 34px;
  align-items: end;
  gap: 10px;
  padding: 12px;
}

.segment-editor .field {
  margin-bottom: 0;
}

.segment-people-field .person-options {
  max-height: 86px;
  overflow: auto;
}

.admin-body .segment-editor input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  flex: 0 0 16px;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

.admin-body .segment-recipients > label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  cursor: pointer;
}

.admin-body .segment-people-field .person-options {
  max-height: none;
  overflow: visible;
  gap: 6px 10px;
}

.inspection-point-form {
  margin-bottom: 12px;
}

.inspection-point-list,
.inspection-record-list {
  display: grid;
  gap: 12px;
}

.inspection-point-card {
  display: grid;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.qr-box {
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  border: 1px solid rgba(24, 211, 189, 0.28);
  border-radius: 8px;
  background: #f8fffc;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.qr-box img {
  width: 96px;
  height: 96px;
}

.qr-box.small {
  width: 72px;
  height: 72px;
}

.qr-box.small img {
  width: 62px;
  height: 62px;
}

.inspection-point-info {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 7px;
}

.inspection-point-info strong {
  font-size: 16px;
}

.inspection-static-title {
  display: block;
  margin-bottom: 5px;
  color: #1d1d1f;
  font-size: 17px;
  font-weight: 600;
}

.issue-record-qr-card {
  border-color: rgba(0, 113, 227, 0.18);
  background: linear-gradient(180deg, rgba(0, 113, 227, 0.08), rgba(255, 255, 255, 0.86));
}

.inspection-name-input {
  height: 38px;
  font-weight: 600;
}

.inspection-point-info span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspection-item-editor {
  display: grid;
  gap: 7px;
  margin: 4px 0;
}

.inspection-edit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.inspection-edit-row.with-qr {
  grid-template-columns: 76px minmax(160px, 1fr) auto auto auto;
  align-items: center;
}

.inspection-session-qr-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.inspection-session-qr {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.inspection-session-qr strong {
  color: var(--text);
  font-size:var(--ui-font-body);
}

.scan-panel textarea {
  min-height: 112px;
  font-family: inherit;
}

.inspection-check-items {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.inspection-check-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.inspection-check-row strong {
  display: block;
  margin-bottom: 8px;
}

.inspection-status-toggle {
  display: flex;
  gap: 12px;
  color: #c2d1cf;
  font-size:var(--ui-font-body);
}

.inspection-status-toggle input {
  width: auto;
}

.inspection-item-note {
  align-self: center;
}

.status-ok {
  background: var(--success);
}

.status-bad {
  background: var(--danger);
}

.inspection-submit-result {
  margin-top: 12px;
  min-height: 20px;
  color: var(--muted);
  font-size:var(--ui-font-body);
}

.scan-submit-card .inspection-submit-result:empty {
  min-height: 0;
  margin-top: 0;
}

.inspection-record {
  display: grid;
  justify-content: space-between;
  gap:12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left-width: 4px;
  border-radius:var(--ui-radius-control);grid-template-columns:minmax(0,1fr) max-content;}

.inspection-record.ok {
  border-left-color: var(--success);
}

.inspection-record.bad {
  border-left-color: var(--danger);
}

.inspection-record.skip {
  border-left-color: var(--warning);
}

.inspection-record.issue {
  border-left-color: #ff9500;
  background: rgba(255, 149, 0, 0.08);
}

.inspection-record.work-sync {
  border-left-color: #34c759;
  background: rgba(52, 199, 89, 0.08);
}

.inspection-record.handover {
  border-left-color: #5856d6;
  background: rgba(88, 86, 214, 0.08);
}

.inspection-record strong,
.inspection-record span,
.inspection-record p {
  display: block;color:var(--text);font-size:var(--ui-font-body);}

.inspection-record span,
.inspection-record em {
  color: var(--muted);
  font-size:var(--ui-font-body);
  font-style: normal;
}

.inspection-record p {
  margin-top: 6px;
  color:var(--text);
  font-size:var(--ui-font-body);
}

.reminder-list {
  max-height: calc(100vh - 190px);
  overflow: auto;
}

.reminder-plan-card {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
}

.reminder-plan-list {
  display: grid;
  gap: 10px;
  max-height: 62vh;
  overflow: auto;
}

.reminder-plan-item {
  width: 100%;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
  cursor: pointer;
  transition: 150ms ease;
}

.reminder-plan-item:hover {
  border-color: rgba(0, 113, 227, 0.24);
  background: rgba(255, 255, 255, 0.94);
  transform: translateY(-1px);
}

.reminder-plan-item.active {
  border-color: rgba(0, 113, 227, 0.38);
  background: rgba(240, 248, 255, 0.96);
  box-shadow: 0 12px 28px rgba(0, 113, 227, 0.1);
}

.reminder-plan-item time {
  color: #0071e3;
  font-size: 17px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.reminder-plan-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.reminder-plan-title {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.reminder-plan-item strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reminder-plan-item span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reminder-plan-item small {
  color: #51606c;
  font-size: 12px;
  line-height: 1.45;
}

.reminder-plan-item em,
.status-pill {
  min-width: 58px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.reminder-plan-item em.pending,
.status-pill.pending {
  color: #0066d6;
  background: rgba(0, 113, 227, 0.1);
}

.reminder-plan-item em.due,
.status-pill.due {
  color: #8a4b00;
  background: rgba(255, 149, 0, 0.14);
}

.reminder-plan-item em.sent,
.status-pill.sent {
  color: #1f7a3a;
  background: rgba(52, 199, 89, 0.12);
}

.reminder-plan-item em.missing,
.status-pill.missing {
  color: var(--muted);
  background: rgba(0, 0, 0, 0.06);
}

.schedule-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.schedule-controls .field {
  margin-bottom: 0;
}

.auto-status {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px solid rgba(24, 211, 189, 0.24);
  border-radius: 8px;
  background: rgba(24, 211, 189, 0.08);
  color: #c4dbd8;
  font-size: 13px;
}

.mention-help {
  margin: -4px 0 12px;
  padding: 9px 11px;
  border: 1px solid rgba(24, 211, 189, 0.22);
  border-radius: 8px;
  background: rgba(24, 211, 189, 0.075);
  color: #c4dbd8;
  font-size: 13px;
  line-height: 1.5;
}

.template-editor-shell {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.54);
}

.reminder-config-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.56);
}

.reminder-config-group summary {
  list-style: none;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 600;
}

.reminder-config-group summary::-webkit-details-marker {
  display: none;
}

.reminder-rule-list {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.reminder-rule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
}

.reminder-rule-row strong,
.reminder-rule-row span {
  display: block;
}

.reminder-rule-row strong {
  font-size: 14px;
}

.reminder-rule-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.rule-inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.compact-field {
  margin-bottom: 0;
}

.reminder-template-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding: 0 12px 12px;
}

.reminder-template-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
}

.reminder-template-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reminder-template-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.template-message {
  min-height: 120px;
}

.reminder-template-card summary {
  list-style: none;
  cursor: pointer;
}

.reminder-template-card summary::-webkit-details-marker {
  display: none;
}

.reminder-template-card[open] {
  background: rgba(255, 255, 255, 0.88);
}

.reminder-template-body {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 160;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.toast-message {
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  color: #1d1d1f;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  font-size: 13px;
  line-height: 1.5;
}

.toast-message.success {
  border-color: rgba(52, 199, 89, 0.26);
  background: rgba(239, 255, 244, 0.94);
}

.toast-message.error {
  border-color: rgba(215, 0, 21, 0.22);
  background: rgba(255, 241, 242, 0.94);
}

.confirm-dialog-copy {
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.danger-button {
  width: auto;
  min-width: 112px;
  height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--danger);
  font-weight: 600;
  cursor: pointer;
}

.mention-help.warning {
  border-color: rgba(255, 184, 77, 0.42);
  background: rgba(255, 184, 77, 0.11);
  color: #ffd899;
}

.reminder-item {
  display: grid;
  width: 100%;
  gap: 4px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.reminder-item span {
  font-weight: 600;
}

.reminder-item em {
  margin-top: 2px;
  font-style: normal;
}

.reminder-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--glow);
}

.compact-reminder {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.compact-reminder strong {
  color: #0071e3;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.compact-reminder span {
  font-size: 13px;
  font-weight: 600;
}

.reminder-preview pre,
.payload-panel textarea,
pre {
  margin: 0;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #dbe9e6;
  background: var(--code-bg);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.reminder-preview-card {
  display: grid;
  gap: 14px;
}

.reminder-preview-head {
  display: grid;
  gap: 8px;
}

.reminder-preview-head h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.reminder-preview-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.reminder-preview-meta div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
}

.reminder-preview-meta span,
.reminder-preview-meta strong {
  display: block;
}

.reminder-preview-meta span {
  color: var(--muted);
  font-size: 12px;
}

.reminder-preview-meta strong {
  overflow-wrap: anywhere;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
}

.reminder-preview-issue {
  padding: 10px 12px;
  border: 1px solid rgba(255, 149, 0, 0.24);
  border-radius: 10px;
  background: rgba(255, 149, 0, 0.12);
  color: #8a4b00;
  font-size: 13px;
  line-height: 1.5;
}

.payload-panel {
  display: grid;
  grid-template-rows: auto minmax(560px, 1fr) auto;
}

.request-preview-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.preview-form {
  display: grid;
  align-content: start;
}

.preview-message-field textarea {
  min-height: 260px;
  font-family: inherit;
  line-height: 1.55;
}

textarea {
  min-height: 560px;
  resize: none;
  tab-size: 2;
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.editor-footer .invalid {
  color: var(--danger);
  font-weight: 600;
}

.result-state,
.log-list {
  height: calc(100% - 46px);
}

.empty-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-size: 14px;
}

.empty-state.small {
  min-height: 42px;
  padding: 10px;
}

.result-card {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
}

.status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border-radius: 8px;
  border: 1px solid;
  font-weight: 600;
}

.status-banner.success {
  color: var(--success);
  background: rgba(69, 209, 138, 0.12);
  border-color: rgba(69, 209, 138, 0.32);
}

.status-banner.fail {
  color: var(--danger);
  background: rgba(255, 107, 95, 0.12);
  border-color: rgba(255, 107, 95, 0.32);
}

.result-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.result-meta strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  margin-top: 3px;
}

.log-list {
  overflow: auto;
}

.log-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.log-title {
  font-weight: 600;
}

.log-time,
.log-detail {
  color: var(--muted);
}

.log-detail {
  overflow-wrap: anywhere;
}

.badge {
  align-self: start;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge.success {
  color: var(--success);
  background: rgba(69, 209, 138, 0.12);
}

.badge.fail {
  color: var(--danger);
  background: rgba(255, 107, 95, 0.12);
}

/* Apple-inspired DESIGN.md refresh: premium white space, SF-style system type, soft glass surfaces. */
:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.62);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.16);
  --accent: #0071e3;
  --accent-dark: #005bbd;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --success: #248a3d;
  --warning: #b46a00;
  --danger: #d70015;
  --code-bg: #fbfbfd;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.08);
  --glow: 0 0 0 1px rgba(0, 113, 227, 0.12), 0 16px 36px rgba(0, 113, 227, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 18% -8%, rgba(255, 255, 255, 0.95), transparent 30%),
    radial-gradient(circle at 86% 4%, rgba(0, 113, 227, 0.12), transparent 24%),
    linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 36%, #eef1f5 100%);
}

body::before {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.62), transparent 42%),
    radial-gradient(circle at 70% 18%, rgba(0, 113, 227, 0.08), transparent 32%);
  background-size: auto;
  mask-image: none;
}

.topbar,
.tabs {
  background: rgba(251, 251, 253, 0.78);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.88), 0 14px 40px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(24px) saturate(180%);
}

.brand-mark {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

h1 {
  font-weight: 600;
}

h2,
h3 {
  font-weight: 600;
}

.status-dot {
  background: #30d158;
  box-shadow: 0 0 0 5px rgba(48, 209, 88, 0.12);
}

.tab-button {
  color: #5f6368;
  background: rgba(255, 255, 255, 0.58);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.tab-button.active {
  color: #ffffff;
  border-color: rgba(0, 113, 227, 0.16);
  background: linear-gradient(180deg, #0a84ff, #0071e3);
  box-shadow: 0 8px 22px rgba(0, 113, 227, 0.2);
}

.tab-button:hover:not(.active) {
  color: var(--text);
  border-color: rgba(0, 113, 227, 0.16);
  background: rgba(255, 255, 255, 0.88);
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.72));
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(160%);
}

.panel::before {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.96), transparent);
  opacity: 1;
}

.summary-card,
.shift-card,
.saved-record-card,
.session-card,
.log-item,
.segment-editor,
.reminder-item,
.compact-reminder,
.inspection-point-card,
.inspection-record,
.shift-picker,
.inspection-check-row {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 10px 24px rgba(0, 0, 0, 0.035);
}

.summary-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 252, 0.86));
}

.summary-card strong,
.calendar-day strong,
.saved-record-card strong,
.shift-card strong,
.session-card strong {
  color: var(--text);
  text-shadow: none;
}

.calendar-day {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.calendar-day.active,
.saved-record-card.active,
.reminder-item.active {
  border-color: rgba(0, 113, 227, 0.28);
  background: linear-gradient(180deg, rgba(230, 242, 255, 0.98), rgba(242, 247, 255, 0.86));
  box-shadow: var(--glow);
}

.calendar-day:hover,
.saved-record-card:hover {
  border-color: rgba(0, 113, 227, 0.2);
  background: rgba(255, 255, 255, 0.92);
}

.nested-child {
  border-left-color: rgba(0, 113, 227, 0.28);
}

.field span,
.check-pill,
.inline-check,
.inspection-status-toggle {
  color: #4b5563;
}

input,
select,
textarea {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(0, 113, 227, 0.7);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.primary-button {
  color: #ffffff;
  background: linear-gradient(180deg, #0a84ff, #0071e3);
  box-shadow: 0 12px 30px rgba(0, 113, 227, 0.18);
}

.primary-button:hover {
  background: linear-gradient(180deg, #2997ff, #0077ed);
}

.primary-button:disabled {
  background: #a7c7ea;
}

.ghost-button {
  color: #1d1d1f;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(0, 0, 0, 0.12);
}

.ghost-button:hover {
  color: #ffffff;
  border-color: rgba(0, 113, 227, 0.22);
  background: #0071e3;
}

.ghost-button.danger-outline {
  color: var(--danger);
  border-color: rgba(215, 0, 21, 0.35);
}

.ghost-button.danger-outline:hover {
  color: #ffffff;
  border-color: var(--danger);
  background: var(--danger);
}

.icon-button {
  color: var(--danger);
  background: rgba(255, 69, 58, 0.08);
  border-color: rgba(215, 0, 21, 0.18);
}

.check-pill {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.68);
}

.check-pill:has(input:checked) {
  color: #ffffff;
  border-color: rgba(0, 113, 227, 0.22);
  background: linear-gradient(180deg, #0a84ff, #0071e3);
  box-shadow: 0 10px 22px rgba(0, 113, 227, 0.18);
}

.qr-box {
  border-color: rgba(0, 0, 0, 0.1);
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.auto-status,
.mention-help {
  color: #3f4b5b;
  border-color: rgba(0, 113, 227, 0.16);
  background: rgba(232, 244, 255, 0.72);
}

.mention-help.warning {
  color: #7a4b00;
  border-color: rgba(255, 149, 0, 0.22);
  background: rgba(255, 244, 224, 0.82);
}

.reminder-preview pre,
.payload-panel textarea,
pre {
  color: #1d1d1f;
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(0, 0, 0, 0.1);
}

.empty-state {
  background: rgba(255, 255, 255, 0.46);
  border-color: rgba(0, 0, 0, 0.12);
}

.status-banner.success,
.badge.success {
  color: #1f7a3a;
  background: rgba(52, 199, 89, 0.12);
  border-color: rgba(52, 199, 89, 0.22);
}

.status-banner.fail,
.badge.fail {
  color: var(--danger);
  background: rgba(255, 59, 48, 0.1);
  border-color: rgba(255, 59, 48, 0.2);
}

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(245, 245, 247, 0.62);
  backdrop-filter: blur(18px) saturate(160%);
}

.modal-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.18);
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inspection-modal-progress {
  width: fit-content;
  margin: 18px 0 12px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(180deg, #0a84ff, #0071e3);
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(0, 113, 227, 0.18);
}

.wecom-auth-link {
  width: fit-content;
  margin: 8px 0 12px;
}

.wecom-auth-url {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

#inspectionModalSummary {
  max-height: 320px;
  margin-bottom: 16px;
}

.modal-send-button {
  width: auto;
  min-width: 132px;
  padding: 0 18px;
}

@media (max-width: 1180px) {
  body {
    min-width: 0;
  }

  .topbar {
    height: auto;
    align-items: flex-start;
    padding: 14px 16px;
    gap: 12px;
    flex-direction: column;
  }

  .tabs {
    overflow: auto;
  }

  .tab-button {
    min-width: 88px;
    flex: 0 0 auto;
  }

  .dashboard-grid,
  .two-column,
  .nested-grid,
  .reminder-layout,
  .inspection-grid,
  .webhook-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .summary-grid,
  .week-calendar,
  .shift-form-grid,
  .form-grid,
  .people-grid {
    grid-template-columns: 1fr;
  }

  .schedule-controls {
    grid-template-columns: 1fr;
  }

  .reminder-plan-item {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .reminder-rule-row,
  .reminder-preview-meta {
    grid-template-columns: 1fr;
  }

  .segment-editor {
    grid-template-columns: 1fr;
  }

  .person-row {
    grid-template-columns: 1fr;
  }

  .side-stack {
    grid-template-rows: auto auto;
  }
}

/* Product Design refresh: Apple-style mobile scanning flow */
body.scan-body {
  color-scheme: light;
  min-width: 0;
  overflow-x: hidden;
  color: #1d1d1f;
  background:
    linear-gradient(180deg, #f9fafc 0%, #f2f4f8 48%, #ffffff 100%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.scan-body::before {
  display: none;
}

.scan-shell {
  width: min(430px, 100%);
  gap: 14px;
  padding: 8px 0 28px;
}

.scan-card-stack {
  padding-bottom: 168px;
}

#scanForm > .scan-card:nth-last-child(2) {
  margin-bottom: 82px;
}

.scan-summary-mode [data-scan-step-card] {
  display: none;
}

.scan-summary-mode #scanSkipButton,
.scan-summary-mode #scanSubmitButton {
  display: none;
}

.scan-hero-card,
.scan-card,
.scan-camera-panel {
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.scan-hero-card {
  min-height: 148px;
  padding: 22px;
  border-radius: 26px;
}

.scan-logo {
  position: relative;
  z-index: 1;
  width: 128px;
  height: 56px;
  margin-bottom: 10px;
}

.scan-hero-card::after {
  display: none;
}

.scan-card {
  padding: 16px;
  border-radius: 22px;
}

.scan-head span {
  color: #007aff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.scan-head h1 {
  color: #111827;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.08;
}

.scan-head p,
.scan-card-title span,
.scan-choice span,
.scan-guide-steps span,
.scan-camera-panel p,
.inspection-submit-result,
.scan-progress-item-status,
.scan-step-item em {
  color: #6e6e73;
}

.scan-status-chip,
.scan-link-button {
  border: 1px solid rgba(0, 122, 255, 0.14);
  color: #0066d6;
  background: rgba(0, 122, 255, 0.08);
}

.scan-link-button {
  min-height: 34px;
  border-radius: 999px;
}

.scan-card-title {
  align-items: start;
  margin-bottom: 12px;
}

.scan-card-title strong {
  color: #1d1d1f;
  font-size: 15px;
  font-weight: 600;
}

.scan-progress-pill {
  min-height: 36px;
  margin-top: 0;
  border: 0;
  color: #ffffff;
  background: #007aff;
  box-shadow: 0 10px 24px rgba(0, 122, 255, 0.18);
}

.scan-progress-pill.complete {
  color: #ffffff;
  background: #34c759;
  box-shadow: 0 10px 24px rgba(52, 199, 89, 0.18);
}

.scan-submit-card {
  position: fixed;
  right: auto;
  left: 50%;
  bottom: 0;
  width: min(430px, calc(100% - 20px));
  transform: translateX(-50%);
  padding: 14px 0 0;
  background: linear-gradient(to top, rgba(249, 250, 252, 0.98) 76%, rgba(249, 250, 252, 0));
}

.scan-submit-card .primary-button,
.scan-start-button,
.scan-push-button {
  border: 0;
  color: #ffffff;
  background: #007aff;
  box-shadow: 0 14px 30px rgba(0, 122, 255, 0.22);
}

.scan-submit-card .primary-button {
  min-height: 54px;
  border-radius: 17px;
}

.scan-edit-button,
.scan-previous-button,
.scan-next-button {
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #007aff;
  background: rgba(255, 255, 255, 0.92);
}

.scan-push-button {
  color: #ffffff;
  background: #34c759;
  box-shadow: 0 14px 30px rgba(52, 199, 89, 0.2);
}

.scan-start-card {
  padding: 0;
}

.scan-start-button {
  min-height: 118px;
  border-radius: 24px;
}

.scan-start-button span:last-child {
  color: rgba(255, 255, 255, 0.82);
}

.scan-start-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  color: #007aff;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.14);
}

.scan-status-cards {
  gap: 12px;
}

.scan-choice {
  min-height: 112px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.scan-choice.active {
  border-color: rgba(0, 122, 255, 0.42);
  background: rgba(0, 122, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.16), 0 12px 28px rgba(0, 122, 255, 0.1);
}

.scan-choice strong,
.scan-progress-item-name,
.scan-step-item span {
  color: #1d1d1f;
}

.scan-step-item small {
  color: #6e6e73;
}

.scan-body .field span {
  color: #6e6e73;
}

.scan-body input,
.scan-body select,
.scan-body textarea {
  min-height: 48px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  color: #1d1d1f;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.scan-body input:focus,
.scan-body select:focus,
.scan-body textarea:focus {
  border-color: rgba(0, 122, 255, 0.58);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.scan-guide-steps div,
.scan-progress-item,
.scan-step-item {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
}

.scan-guide-steps strong,
.scan-step-item.current strong {
  color: #ffffff;
  background: #007aff;
}

.scan-step-item strong {
  color: #6e6e73;
  background: #f2f2f7;
}

.scan-step-item.current {
  border-color: rgba(0, 122, 255, 0.34);
  background: rgba(0, 122, 255, 0.08);
}

.scan-step-item.done strong {
  color: #ffffff;
  background: #34c759;
}

.scan-step-item.abnormal {
  border-color: rgba(255, 59, 48, 0.28);
  background: rgba(255, 59, 48, 0.08);
}

.scan-step-item.abnormal strong {
  color: #ffffff;
  background: #ff3b30;
}

.scan-progress-item-badge.complete {
  color: #0f7a33;
  background: rgba(52, 199, 89, 0.12);
  border-color: rgba(52, 199, 89, 0.24);
}

.scan-progress-item-badge.in-progress {
  color: #a15c00;
  background: rgba(255, 149, 0, 0.12);
  border-color: rgba(255, 149, 0, 0.22);
}

.scan-progress-item-badge.not-started {
  color: #6e6e73;
  background: #f2f2f7;
  border-color: transparent;
}

.scan-camera-sheet {
  background: rgba(248, 248, 248, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.scan-camera-panel {
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
}

.scan-close-button {
  border: 0;
  color: #007aff;
  background: #f2f2f7;
}

.scan-camera-frame {
  border-radius: 24px;
  background: #111827;
}

.scan-camera-corners {
  border-color: rgba(0, 122, 255, 0.86);
  box-shadow: 0 0 0 999px rgba(255, 255, 255, 0.18);
}

.inspection-session-qr {
  border-color: rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.inspection-session-qr strong {
  color: #1d1d1f;
}

.qr-box {
  border-color: rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

@media (max-width: 480px) {
  .scan-body {
    padding: 10px;
  }

  .scan-head h1 {
    font-size: 30px;
  }

  .scan-hero-card {
    border-radius: 24px;
  }

  .scan-card {
    border-radius: 20px;
  }
}

.scan-inspector-line {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
}

.scan-inspector-line span,
.scan-inspector-line em {
  color: #6e6e73;
  font-size: 12px;
  font-style: normal;
}

.scan-inspector-line strong {
  min-width: 0;
  color: #1d1d1f;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.scan-inspector-line em {
  grid-column: 2;
  margin-top: -4px;
}

.scan-step-item.current {
  border-color: rgba(0, 122, 255, 0.34);
  background: rgba(0, 122, 255, 0.08);
}

.scan-step-item.current::before {
  background: #007aff;
}

.scan-step-item.done {
  border-color: rgba(52, 199, 89, 0.22);
  background: rgba(52, 199, 89, 0.08);
}

.scan-step-item.skipped {
  border-color: rgba(255, 149, 0, 0.26);
  background: rgba(255, 149, 0, 0.1);
}

.scan-step-item.skipped strong {
  color: #ffffff;
  background: #ff9500;
}

.scan-step-item.clickable {
  cursor: pointer;
}

.scan-step-item.clickable:focus-visible {
  outline: 3px solid rgba(0, 122, 255, 0.24);
  outline-offset: 2px;
}

.scan-progress-item {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.scan-progress-item:active {
  transform: translateY(1px);
}

.scan-progress-item-status.has-abnormal {
  color: #ff3b30;
  font-weight: 600;
}

.scan-pill-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scan-pill-row .scan-progress-pill {
  margin-top: 0;
}

.problem-record-card .scan-pill-row .scan-progress-pill,
.work-sync-card .scan-pill-row .scan-progress-pill,
.handover-card .scan-pill-row .scan-progress-pill {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
  box-shadow: none;
}

.scan-abnormal-badge {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 13px;
  border: 1px solid rgba(255, 59, 48, 0.3);
  border-radius: 999px;
  color: #ff3b30;
  background: rgba(255, 59, 48, 0.1);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.scan-skip-button {
  width: 100%;
  min-height: 46px;
  margin-top: 8px;
  border: 1px solid rgba(255, 149, 0, 0.4);
  border-radius: 15px;
  color: #b46a00;
  background: rgba(255, 149, 0, 0.1);
  font-weight: 600;
  cursor: pointer;
}

.scan-previous-button {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  border-radius: 14px;
  cursor: pointer;
}

.scan-skip-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.scan-skip-button.hidden {
  display: none;
}

.scan-summary-card {
  border-color: rgba(0, 122, 255, 0.22);
}

.scan-summary-body {
  display: grid;
  gap: 12px;
}

.scan-summary-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.scan-summary-count {
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 12px 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.scan-summary-count strong {
  font-size: 22px;
  font-weight: 600;
  color: #1d1d1f;
}

.scan-summary-count span {
  font-size: 12px;
  color: #6e6e73;
}

.scan-summary-count.ok strong {
  color: #34c759;
}

.scan-summary-count.bad strong {
  color: #ff3b30;
}

.scan-summary-count.skip strong {
  color: #ff9500;
}

.scan-summary-abnormal-list {
  display: grid;
  gap: 8px;
}

.scan-summary-abnormal-item {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 59, 48, 0.22);
  border-radius: 14px;
  background: rgba(255, 59, 48, 0.06);
}

.scan-summary-abnormal-item.rechecked {
  border-color: rgba(0, 122, 255, 0.24);
  background: rgba(0, 122, 255, 0.07);
}

.scan-summary-abnormal-item strong {
  color: #1d1d1f;
  font-size: 14px;
  font-weight: 600;
}

.scan-summary-abnormal-item span {
  color: #6e6e73;
  font-size: 13px;
  line-height: 1.45;
}

.scan-summary-allok {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(52, 199, 89, 0.24);
  border-radius: 14px;
  color: #248a3d;
  background: rgba(52, 199, 89, 0.08);
  font-size: 14px;
  font-weight: 600;
}

.scan-progress-tip {
  margin: 8px 0 0;
  color: #6e6e73;
  font-size: 12px;
}

/* 班次必查规则：扫码端软提示 */
.scan-required-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border: 1px solid rgba(0, 122, 255, 0.3);
  border-radius: 999px;
  color: #007aff;
  background: rgba(0, 122, 255, 0.08);
  font-size: 11px;
  font-weight: 600;
  vertical-align: 1px;
  white-space: nowrap;
}

.scan-progress-item.required {
  border-color: rgba(0, 122, 255, 0.26);
}

.scan-progress-item.optional {
  opacity: 0.62;
}

/* 管理端：班次必查规则配置 */
.shift-rule-list {
  display: grid;
  gap: 10px;
}

.shift-rule-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}

.shift-rule-row > strong {
  padding-top: 3px;
  font-size:var(--ui-font-body);
}

.shift-rule-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.shift-rule-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--ui-font-body);
  cursor: pointer;
}

.shift-rule-option input {
  accent-color: var(--accent);
}

/* 检查模式：检查项横向滑动大卡轨道，当前项放大居中 */
.scan-step-list.carousel {
  display: flex;
  gap: 10px;
  margin: 4px -16px 0;
  padding: 10px 16px 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.scan-step-list.carousel::-webkit-scrollbar {
  display: none;
}

.scan-step-list.carousel .scan-step-item {
  flex: 0 0 72%;
  min-height: 116px;
  display: grid;
  grid-template-columns: none;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  justify-items: start;
  gap: 6px;
  padding: 14px;
  border-radius: 20px;
  scroll-snap-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  opacity: 0.62;
}

.scan-step-list.carousel .scan-step-item strong {
  width: 34px;
  height: 34px;
  font-size: 15px;
}

.scan-step-list.carousel .scan-step-item span {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
}

.scan-step-list.carousel .scan-step-item small {
  font-size: 12px;
}

.scan-step-list.carousel .scan-step-item em {
  font-size: 13px;
  font-weight: 600;
}

.scan-step-list.carousel .scan-step-item.current {
  opacity: 1;
  transform: scale(1.03);
  box-shadow: 0 16px 36px rgba(0, 122, 255, 0.18);
}

.scan-step-list.carousel .scan-step-item.current::before {
  display: none;
}

.scan-step-list.carousel .scan-step-item.current em {
  color: #007aff;
}

.scan-context-bar {
  margin-bottom: 0;
  align-items: center;
}

.scan-context-bar span {
  font-size: 13px;
  color: #1d1d1f;
  font-weight: 600;
}

.scan-context-setup-card {
  display: grid;
  gap: 12px;
}

.scan-context-setup-copy {
  margin: -4px 0 2px;
  color: #6e6e73;
  font-size: 13px;
  line-height: 1.45;
}

.scan-bind-button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  color: #ffffff;
  background: #007aff;
  box-shadow: 0 14px 30px rgba(0, 122, 255, 0.22);
  font-weight: 600;
}

.reminder-plan-item em.skipped,
.status-pill.skipped {
  color: var(--muted);
  background: rgba(0, 0, 0, 0.06);
  text-decoration: line-through;
}

.reminder-webhook-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 149, 0, 0.4);
  border-radius: 8px;
  background: rgba(255, 149, 0, 0.12);
  color: #8a4b00;
  font-size: 13px;
  font-weight: 600;
}

.reminder-webhook-warning[hidden] {
  display: none;
}

.reminder-rest-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(180, 106, 0, 0.26);
  border-radius: 8px;
  color: var(--warning);
  background: rgba(180, 106, 0, 0.08);
  font-size: 13px;
  font-weight: 600;
}

.reminder-rest-notice span {
  color: var(--muted);
}

.reminder-rest-notice[hidden] {
  display: none;
}

.reminder-preview-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.catchup-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  margin: 12px 0;
}

.catchup-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.catchup-item input {
  margin-top: 3px;
}

.catchup-item span {
  display: grid;
  gap: 2px;
}

.catchup-item small {
  color: var(--muted);
  font-size: 12px;
}

.compact-reminder em {
  justify-self: start;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
}

.compact-reminder em.pending {
  color: #0066d6;
  background: rgba(0, 113, 227, 0.1);
}

.compact-reminder em.due {
  color: #8a4b00;
  background: rgba(255, 149, 0, 0.14);
}

.compact-reminder em.sent {
  color: #1f7a3a;
  background: rgba(52, 199, 89, 0.12);
}

.compact-reminder em.missing,
.compact-reminder em.skipped {
  color: var(--muted);
  background: rgba(0, 0, 0, 0.06);
}

.compact-more {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

/* 场次编辑器默认折叠 */
.session-editor-details > summary {
  cursor: pointer;
  padding: 10px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
}

.session-editor-details > summary:hover {
  color: var(--accent);
  border-color: rgba(0, 113, 227, 0.4);
}

.session-editor-details[open] > summary {
  margin-bottom: 12px;
}

.reminder-plan-item em.expired,
.status-pill.expired,
.compact-reminder em.expired {
  color: var(--muted);
  background: rgba(0, 0, 0, 0.06);
}

.catchup-item input[type="checkbox"] {
  flex: none;
  width: 16px;
  height: 16px;
}

.catchup-item span {
  flex: 1;
  text-align: left;
}

/* 巡查页手动补录默认折叠 */
.manual-inspection-details > summary {
  list-style: none;
  cursor: pointer;
}

.manual-inspection-details > summary::-webkit-details-marker {
  display: none;
}

.manual-inspection-details > summary .panel-title {
  margin-bottom: 0;
}

.manual-inspection-details > summary:hover h2 {
  color: var(--accent);
}

.manual-inspection-details[open] > summary {
  margin-bottom: 14px;
}

.template-switch {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 8px;
  margin-left: auto;
  cursor: pointer;
  user-select: none;
}

.template-switch input {
  display: none;
}

.template-switch i {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  transition: background 0.15s ease;
}

.template-switch i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: left 0.15s ease;
}

.template-switch input:checked + i {
  background: #34c759;
}

.template-switch input:checked + i::after {
  left: 18px;
}

.template-state {
  min-width: 40px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.template-switch input:checked ~ .template-state {
  color: #1f7a3a;
}

.reminder-template-card.disabled {
  border-style: dashed;
  background: rgba(0, 0, 0, 0.03);
}

.reminder-template-card.disabled .reminder-template-head > span:first-child,
.reminder-template-card.disabled .reminder-template-head em,
.reminder-template-card.disabled .reminder-template-body {
  opacity: 0.55;
}

/* Mobile duty board: unified Apple-style dark palette */
@media (max-width: 700px) {
  body:not(.scan-body):not(.auth-body) {
    color: #f5f5f7;
    background: #0b0b0c;
  }

  body:not(.scan-body):not(.auth-body)::before {
    display: none;
  }

  body:not(.scan-body):not(.auth-body) .topbar {
    color: #f5f5f7;
    background: rgba(11, 11, 12, 0.96);
    border-bottom-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
  }

  body:not(.scan-body):not(.auth-body) .brand-mark img {
    filter: grayscale(1) invert(1);
  }

  body:not(.scan-body):not(.auth-body) .tabs {
    background: rgba(11, 11, 12, 0.94);
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  body:not(.scan-body):not(.auth-body) .tab-button {
    color: #86868b;
    background: transparent;
  }

  body:not(.scan-body):not(.auth-body) .tab-button.active {
    color: #ffffff;
    border-color: #2997ff;
    background: #0071e3;
    box-shadow: none;
  }

  .mobile-duty-board {
    color: #f5f5f7;
    border-color: rgba(255, 255, 255, 0.14);
    background: #1c1c1e;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32);
  }

  .mobile-duty-head {
    background: #161617;
  }

  .mobile-duty-head span,
  .mobile-duty-head time,
  .mobile-section-title span,
  .mobile-start-time span,
  .mobile-shift-label span,
  .mobile-inspection-row div span {
    color: #86868b;
  }

  .mobile-date-step,
  .mobile-section-title button {
    color: #2997ff;
    border-color: rgba(41, 151, 255, 0.28);
    background: rgba(41, 151, 255, 0.08);
  }

  .mobile-session-hero {
    background: #202022;
  }

  .mobile-session-hero > div:first-child > span {
    color: #2997ff;
  }

  .mobile-person-list span {
    color: #e8e8ed;
    border-color: rgba(255, 255, 255, 0.12);
    background: #2c2c2e;
  }

  .mobile-handover-item {
    border-left-color: #2997ff;
    background: rgba(41, 151, 255, 0.08);
  }

  .mobile-handover-item time {
    color: #f5f5f7;
  }

  .mobile-handover-item span {
    color: #86868b;
  }

  .mobile-inspection-summary em {
    color: #30d158;
    background: rgba(48, 209, 88, 0.1);
  }

  .mobile-inspection-summary em.bad {
    color: #ff453a;
    background: rgba(255, 69, 58, 0.1);
  }

  .mobile-inspection-summary em.skip {
    color: #ffd60a;
    background: rgba(255, 214, 10, 0.1);
  }

  .mobile-status-dot {
    background: #30d158;
  }

  .mobile-inspection-row.bad .mobile-status-dot {
    background: #ff453a;
  }

  .mobile-inspection-row.skip .mobile-status-dot {
    background: #ffd60a;
  }

  body:not(.scan-body):not(.auth-body) .tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    overflow: visible;
  }

  body:not(.scan-body):not(.auth-body) .tab-button {
    width: 100%;
    min-width: 0;
    padding: 0 4px;
    font-size: 11px;
    white-space: nowrap;
  }

  body:not(.scan-body):not(.auth-body) .panel,
  body:not(.scan-body):not(.auth-body) .session-editor-inline,
  body:not(.scan-body):not(.auth-body) .reminder-preview-card,
  body:not(.scan-body):not(.auth-body) .reminder-template-card,
  body:not(.scan-body):not(.auth-body) .reminder-rule-card,
  body:not(.scan-body):not(.auth-body) .inspection-point-editor {
    color: #f5f5f7;
    border-color: rgba(255, 255, 255, 0.12);
    background: #1c1c1e;
    box-shadow: none;
  }

  body:not(.scan-body):not(.auth-body) .panel::before {
    display: none;
  }

  body:not(.scan-body):not(.auth-body) h2,
  body:not(.scan-body):not(.auth-body) h3,
  body:not(.scan-body):not(.auth-body) strong,
  body:not(.scan-body):not(.auth-body) label,
  body:not(.scan-body):not(.auth-body) .field > span {
    color: #f5f5f7;
  }

  body:not(.scan-body):not(.auth-body) .muted,
  body:not(.scan-body):not(.auth-body) small,
  body:not(.scan-body):not(.auth-body) .field small {
    color: #86868b;
  }

  body:not(.scan-body):not(.auth-body) input,
  body:not(.scan-body):not(.auth-body) select,
  body:not(.scan-body):not(.auth-body) textarea {
    color: #f5f5f7;
    border-color: rgba(255, 255, 255, 0.14);
    background: #2c2c2e;
    box-shadow: none;
  }

  body:not(.scan-body):not(.auth-body) input::placeholder,
  body:not(.scan-body):not(.auth-body) textarea::placeholder {
    color: #6e6e73;
  }

  body:not(.scan-body):not(.auth-body) input:focus,
  body:not(.scan-body):not(.auth-body) select:focus,
  body:not(.scan-body):not(.auth-body) textarea:focus {
    border-color: #2997ff;
    outline: 2px solid rgba(41, 151, 255, 0.22);
  }

  body:not(.scan-body):not(.auth-body) .primary-button {
    color: #ffffff;
    border-color: #0071e3;
    background: #0071e3;
    box-shadow: none;
  }

  body:not(.scan-body):not(.auth-body) .ghost-button,
  body:not(.scan-body):not(.auth-body) .icon-button {
    color: #2997ff;
    border-color: rgba(41, 151, 255, 0.28);
    background: rgba(41, 151, 255, 0.08);
  }

  body:not(.scan-body):not(.auth-body) .summary-card,
  body:not(.scan-body):not(.auth-body) .shift-card,
  body:not(.scan-body):not(.auth-body) .session-card,
  body:not(.scan-body):not(.auth-body) .saved-record-card,
  body:not(.scan-body):not(.auth-body) .compact-reminder,
  body:not(.scan-body):not(.auth-body) .inspection-record,
  body:not(.scan-body):not(.auth-body) .shift-picker,
  body:not(.scan-body):not(.auth-body) .segment-editor {
    color: #f5f5f7;
    border-color: rgba(255, 255, 255, 0.1);
    background: #242426;
    box-shadow: none;
  }

  body:not(.scan-body):not(.auth-body) .nested-grid,
  body:not(.scan-body):not(.auth-body) .two-column,
  body:not(.scan-body):not(.auth-body) .inspection-grid,
  body:not(.scan-body):not(.auth-body) .reminder-layout,
  body:not(.scan-body):not(.auth-body) .webhook-grid {
    gap: 10px;
  }

  body:not(.scan-body):not(.auth-body) .panel {
    padding: 15px;
    border-radius: 8px;
  }
}

/* Apple-style navigation pass for mobile扫码 */
.scan-body {
  padding: 0 12px 12px;
  background:
    radial-gradient(circle at 50% -120px, rgba(255, 255, 255, 0.95), transparent 300px),
    linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 54%, #ffffff 100%);
}

.scan-shell {
  width: min(430px, 100%);
  gap: 12px;
  padding-top: 8px;
}

.scan-top-nav {
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(64px, 1fr) auto minmax(64px, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0 -12px;
  padding: 6px 12px;
  color: #1d1d1f;
  background: rgba(251, 251, 253, 0.82);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
}

.scan-top-nav strong {
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.scan-nav-button,
.scan-nav-state {
  min-height: 36px;
  display: inline-grid;
  align-items: center;
  justify-self: start;
  padding: 0 9px;
  border-radius: 999px;
  color: #0071e3;
  background: rgba(0, 113, 227, 0.08);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.scan-top-nav > :last-child {
  justify-self: end;
}

.scan-nav-state {
  max-width: 96px;
  overflow: hidden;
  color: #6e6e73;
  background: rgba(0, 0, 0, 0.04);
  text-overflow: ellipsis;
}

.scan-hero-card.scan-home-hero,
.scan-hero-card.scan-check-hero {
  min-height: auto;
  padding: 12px 2px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.scan-home-hero .scan-head,
.scan-check-hero .scan-head {
  gap: 4px;
}

.scan-home-hero .scan-head h1,
.scan-check-hero .scan-head h1 {
  color: #1d1d1f;
  font-size: clamp(27px, 7.6vw, 33px);
  font-weight: 600;
  line-height: 1.06;
  text-wrap: balance;
}

.scan-home-hero .scan-head p,
.scan-check-hero .scan-head p {
  max-width: 28em;
  color: #6e6e73;
  font-size: 13px;
  line-height: 1.4;
}

.scan-card-stack {
  gap: 8px;
  padding-bottom: 104px;
}

.scan-card,
.scan-camera-panel {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(31, 42, 61, 0.06);
}

.scan-context-compact {
  padding: 14px;
}

.scan-context-fields {
  display: grid;
  grid-template-columns: 1fr 0.74fr;
  gap: 10px;
}

.scan-context-fields .field {
  gap: 6px;
}

.scan-context-fields input,
.scan-context-fields select {
  min-height: 42px;
}

.scan-inspector-line {
  grid-template-columns: auto 1fr auto;
  margin-top: 10px;
}

.scan-inspector-line em {
  grid-column: auto;
  margin-top: 0;
}

.scan-start-card {
  padding: 0;
}

.scan-start-button {
  min-height: 104px;
  grid-template-columns: 58px 1fr;
  justify-items: start;
  text-align: left;
  padding: 18px;
  border-radius: 22px;
}

.scan-start-button .scan-start-icon {
  grid-row: span 2;
}

.scan-start-button strong {
  align-self: end;
  font-size: 23px;
  line-height: 1.1;
}

.scan-start-button span:last-child {
  align-self: start;
  font-size: 13px;
}

.scan-segmented-nav {
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 12px;
  background: rgba(245, 245, 247, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.scan-segmented-nav button {
  min-width: 0;
  min-height: 34px;
  padding: 0 2px;
  border: 0;
  border-radius: 9px;
  color: #6e6e73;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.scan-segmented-nav button:focus,
.scan-bottom-nav button:focus {
  outline: none;
}

.scan-segmented-nav button:focus-visible,
.scan-bottom-nav button:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.28);
  outline-offset: 2px;
}

.scan-segmented-nav button.active {
  color: #1d1d1f;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.scan-panel-hidden {
  display: none !important;
}

.scan-bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 12;
  width: min(420px, calc(100% - 16px));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 30px rgba(31, 42, 61, 0.12);
  transform: translateX(-50%);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.scan-bottom-nav button {
  min-width: 0;
  min-height: 44px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 0;
  border-radius: 14px;
  color: #86868b;
  background: transparent;
  font: inherit;
}

.scan-bottom-nav strong {
  color: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.scan-bottom-nav span {
  color: inherit;
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}

.scan-bottom-nav button.active {
  color: #0071e3;
  background: rgba(0, 113, 227, 0.1);
}

.scan-home-body .scan-footer {
  display: none;
}

.scan-progress-list {
  max-height: min(56dvh, 520px);
  overflow: auto;
  padding-right: 2px;
}

.scan-progress-item {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.scan-progress-item-badge {
  width: fit-content;
}

.scan-progress-empty p {
  margin: 0;
  color: #6e6e73;
  font-size: 14px;
  line-height: 1.5;
}

.problem-record-card {
  border-color: rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.86);
}

.problem-record-card,
.work-sync-card,
.handover-card {
  padding: 14px;
}

.problem-record-card .scan-card-title,
.work-sync-card .scan-card-title,
.handover-card .scan-card-title {
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.problem-record-card .scan-card-title strong,
.work-sync-card .scan-card-title strong,
.handover-card .scan-card-title strong {
  font-size: 15px;
  line-height: 1.2;
}

.problem-record-card .scan-card-title span,
.work-sync-card .scan-card-title span,
.handover-card .scan-card-title span {
  max-width: 58%;
  font-size: 11px;
  line-height: 1.3;
}

.problem-record-account {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  color: #0057b7;
  background: #eef5ff;
  font-size: 12px;
}

.scan-participant-picker {
  padding: 3px 8px;
  border-color: rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  background: #f7f8fa;
}

.scan-participant-title {
  min-height: 38px;
  align-items: center;
}

.scan-participant-title strong {
  font-size: 13px;
}

.scan-participant-title span {
  max-width: 68%;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
}

.problem-record-card .scan-pill-row,
.work-sync-card .scan-pill-row,
.handover-card .scan-pill-row {
  display: none;
}

.problem-step-list {
  margin-top: 6px;
}

.problem-active-field {
  margin-top: 10px;
}

.problem-active-field textarea {
  width: 100%;
  min-height: 112px;
  padding: 10px 11px;
  font-size: 14px;
  line-height: 1.45;
  resize: vertical;
}

.problem-active-field > span {
  font-size: 12px;
  font-weight: 600;
}

.problem-record-actions {
  display: grid;
  grid-template-columns: 0.72fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.problem-record-actions.single {
  grid-template-columns: 1fr;
}

.problem-record-actions .problem-record-button,
.problem-record-actions .scan-skip-button {
  width: 100%;
  min-height: 44px;
  margin-top: 0;
}

.problem-record-button {
  border-radius: 13px;
  background: #0071e3;
  box-shadow: 0 14px 30px rgba(0, 113, 227, 0.2);
}

.scan-guide-card {
  margin-bottom: 0;
}

.scan-guide-steps {
  gap: 8px;
}

.scan-guide-steps div {
  grid-template-columns: 28px 1fr;
  padding: 8px;
}

.scan-guide-steps strong {
  width: 26px;
  height: 26px;
}

.scan-guide-steps span {
  color: #3a3a3c;
}

.scan-check-hero .scan-hero-actions {
  margin-top: 12px;
}

.scan-session-card {
  gap: 8px;
}

.scan-step-list.carousel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 2px 0;
  overflow: visible;
  scroll-snap-type: none;
}

.scan-step-list.carousel .scan-step-item {
  min-width: 0;
  min-height: 60px;
  grid-template-rows: auto 1fr auto;
  gap: 2px;
  padding: 7px;
  border-radius: 12px;
  opacity: 0.74;
}

.scan-step-list.carousel .scan-step-item span {
  font-size: 12px;
  line-height: 1.18;
}

.scan-step-list.carousel .scan-step-item strong {
  width: 22px;
  height: 22px;
  font-size: 11px;
}

.scan-step-list.carousel .scan-step-item em {
  font-size: 9px;
}

.scan-step-list.carousel .scan-step-item.current {
  transform: none;
  box-shadow: 0 5px 14px rgba(0, 122, 255, 0.1);
}

.handover-route-card {
  gap: 2px;
  padding: 8px 10px;
  border-radius: 11px;
}

.handover-route-card span,
.handover-route-card small {
  font-size: 10px;
}

.handover-route-card strong {
  font-size: 13px;
}

.handover-card .problem-step-list {
  display: grid;
}

.scan-status-cards {
  grid-template-columns: 1fr 1fr;
}

.scan-choice {
  min-height: 92px;
  border-radius: 18px;
}

.scan-submit-card {
  width: min(430px, calc(100% - 24px));
  padding: 12px 0 max(10px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(251, 251, 253, 0.98) 78%, rgba(251, 251, 253, 0));
}

.scan-submit-card .primary-button {
  min-height: 52px;
  border-radius: 16px;
}

.scan-skip-button {
  min-height: 42px;
  border-radius: 14px;
}

.scan-after-actions {
  grid-template-columns: 1fr 1fr;
}

.scan-context-setup-card {
  margin-bottom: 96px;
}

@media (max-width: 380px) {
  .scan-context-fields,
  .scan-status-cards,
  .scan-after-actions {
    grid-template-columns: 1fr;
  }

  .scan-top-nav {
    grid-template-columns: auto 1fr auto;
  }

  .scan-nav-state {
    max-width: 88px;
  }

  .problem-record-actions {
    grid-template-columns: 1fr;
  }
}

/* Workbench entry for the mobile scanning flow */
.workbench-scan-link,
.tab-link-button {
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0 16px;
  border: 1px solid rgba(0, 113, 227, 0.16);
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(180deg, #0a84ff, #0071e3);
  box-shadow: 0 8px 22px rgba(0, 113, 227, 0.2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.workbench-scan-link:hover,
.tab-link-button:hover {
  background: linear-gradient(180deg, #2997ff, #0077ed);
  box-shadow: 0 10px 26px rgba(0, 113, 227, 0.24);
}

.workbench-scan-link:active,
.tab-link-button:active {
  transform: translateY(1px);
}

.tab-link-button {
  height: 40px;
}

@media (max-width: 700px) {
  body:not(.scan-body):not(.auth-body) .top-actions {
    width: 100%;
  }

  body:not(.scan-body):not(.auth-body) .workbench-scan-link {
    width: 100%;
    min-height: 42px;
    border-radius: 12px;
  }

  body:not(.scan-body):not(.auth-body) .tab-link-button {
    min-width: 88px;
    height: 34px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 12px;
  }
}
/* First-use checks stay inside the existing task, with the same controls and type. */
.first-use-panel:empty,
#attendanceSyncStatus:empty,
.workbench-save-status[hidden],
#attendanceSyncStatus[hidden] { display: none; }
.first-use-panel {
  margin-bottom: 20px;
  padding: 20px;
  background: #fff;
  border: 1px solid #dce4f0;
  border-radius: 14px;
  overflow-wrap: anywhere;
}
.first-use-panel h2 { margin: 0 0 8px; font-size: 20px; }
.first-use-panel p { margin: 8px 0; line-height: 1.65; }
.first-use-panel li { margin: 8px 0; line-height: 1.6; }
.first-use-panel button { margin: 4px 8px 4px 0; }
.workbench-save-status,
#attendanceSyncStatus {
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid #dce4f0;
  border-radius: 10px;
  background: #f3f7fd;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.workbench-save-status button,
#attendanceSyncStatus button { margin: 4px 0 4px 12px; }
.first-use-panel button:focus-visible,
.workbench-save-status button:focus-visible { outline: 3px solid #386ad1; outline-offset: 3px; }
.first-use-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.first-use-checklist { margin: 12px 0; padding-left: 22px; }
.first-use-checklist li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.first-use-checklist li p { margin: 2px 0; }
.first-use-checklist li button { flex-shrink: 0; }
.first-use-checklist .ready { color: #317447; }
.workbench-save-status[data-status="error"] { border-color: #d59a74; background: #fff5ed; }
@media (min-width: 1040px) and (max-width: 1399px) {
  .admin-body .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 901px) and (max-width: 1039px) {
  body.admin-body { min-width: 0; }
  .admin-body .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-body .view-heading { flex-wrap: wrap; }
  .admin-body .segment-editor { grid-template-columns: minmax(0, 1fr); }
  .admin-body .nested-aside { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .admin-body .topbar {
    flex-direction: row;
    align-items: center;
  }
}

@media (min-width: 901px) and (max-width: 1399px) {
  .admin-body .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-body .dashboard-grid > .span-2 {
    grid-column: 1 / -1;
  }

  .admin-body .dashboard-grid .summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-body .dashboard-grid .week-calendar {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
  }

  .admin-body .personnel-hero h2 {
    font-size:var(--ui-font-title);
    line-height: 1.15;
    text-wrap: balance;
  }
}

@media (max-width: 700px) {
  body.admin-body .topbar .brand h1 {
    color: #f5f5f7;
  }

  body.admin-body .first-use-panel,
  body.admin-body .workbench-save-status,
  body.admin-body #attendanceSyncStatus {
    --feedback-surface: #1c1c1e;
    --feedback-text: #f5f5f7;
    --feedback-muted: #b1b1b8;
    --feedback-border: #48484d;
    color: var(--feedback-text);
    background: var(--feedback-surface);
    border-color: var(--feedback-border);
  }

  body.admin-body .first-use-panel .muted,
  body.admin-body .workbench-save-status .muted,
  body.admin-body #attendanceSyncStatus .muted {
    color: var(--feedback-muted);
  }

  body.admin-body .first-use-panel .ghost-button,
  body.admin-body .workbench-save-status .ghost-button,
  body.admin-body #attendanceSyncStatus .ghost-button {
    color: #9ac6ff;
  }

  body.admin-body .first-use-checklist .ready,
  body.admin-body .first-use-checklist .ready strong {
    color: #75d68e;
  }

  body.admin-body .workbench-save-status[data-status="error"],
  body.admin-body .workbench-save-status[data-status="read-error"],
  body.admin-body .workbench-save-status[data-status="conflict"] {
    --feedback-surface: #35271f;
    --feedback-border: #b9845f;
  }
}

@media (max-width: 700px) {
  .admin-body #remindersView {
    --reminder-surface: #242426;
    --reminder-text: #f5f5f7;
    --reminder-muted: #b1b1b8;
    --reminder-border: #48484d;
  }

  .admin-body #remindersView :is(.reminder-plan-card, .template-editor-shell) {
    color: var(--reminder-text);
    background: #171718;
    border-color: var(--reminder-border);
  }

  .admin-body #remindersView :is(.reminder-plan-item, .reminder-config-group, .reminder-rule-row, .reminder-template-card, .reminder-preview-meta > div, .reminder-preview pre) {
    color: var(--reminder-text);
    background: var(--reminder-surface);
    border-color: var(--reminder-border);
    box-shadow: none;
  }

  .admin-body #remindersView .reminder-plan-item:hover {
    background: #343438;
    border-color: #7ab8ff;
  }

  .admin-body #remindersView .reminder-plan-item.active {
    background: #19344f;
    border-color: #7ab8ff;
  }

  .admin-body #remindersView .reminder-plan-item time {
    color: #7ab8ff;
  }

  .admin-body #remindersView :is(.reminder-config-group summary, .reminder-plan-item strong, .reminder-rule-row strong, .reminder-preview-meta strong) {
    color: var(--reminder-text);
  }

  .admin-body #remindersView :is(.reminder-plan-item span, .reminder-plan-item small, .subhead span, .reminder-rule-row span, .reminder-template-head em, .reminder-preview-meta span, .template-state, .muted) {
    color: var(--reminder-muted);
  }

  .admin-body #remindersView :is(.reminder-plan-item em, .status-pill) {
    color: #d1d1d6;
    background: #3a3a3f;
  }

  .admin-body #remindersView :is(.reminder-plan-item em.pending, .status-pill.pending) {
    color: #7ab8ff;
    background: #18334f;
  }

  .admin-body #remindersView :is(.reminder-plan-item em.due, .status-pill.due, .reminder-preview-issue, .reminder-webhook-warning, .reminder-rest-notice) {
    color: #f2c47d;
    background: #3e3021;
    border-color: #8c7047;
  }

  .admin-body #remindersView :is(.reminder-plan-item em.sent, .status-pill.sent) {
    color: #8dde9f;
    background: #1e3b29;
  }

  .admin-body #remindersView .template-switch input:checked ~ .template-state {
    color: #8dde9f;
  }

  .admin-body #remindersView .reminder-template-card.disabled :is(.reminder-template-head > span:first-child, .reminder-template-head em, .reminder-template-body) {
    opacity: 1;
    color: var(--reminder-muted);
  }
}

/* Personnel management: the ledger stays primary; sensitive actions expand. */
#peopleView .personnel-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
#peopleView .personnel-summary-count { margin: 0; color: var(--shell-muted, var(--muted)); font-size:var(--ui-font-body); }
#peopleView .personnel-toolbar-actions { flex-wrap: wrap; align-items: center; gap: 8px; }
#peopleView #personnelSyncStatus { color: var(--shell-muted, var(--muted)); font-family: inherit; }
#peopleView .personnel-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
#peopleView .personnel-roster-panel { padding:var(--ui-space-4); min-width: 0; }
#peopleView .panel-title { flex-wrap: wrap; gap: 12px; }
#peopleView .personnel-filter { flex-wrap: wrap; max-width: 100%; }
#peopleView .personnel-filter-button { min-height: 36px; height: auto; }
#peopleView .personnel-add-details { margin: 0 0 16px; }
#peopleView .personnel-side-stack details > summary { cursor: pointer; font-size:var(--ui-font-body); font-weight: 600; padding: 8px 0; }
#peopleView .personnel-add-details > summary { color:#fff;background:var(--ui-action);padding:12px 16px;border-radius:var(--ui-radius-control);width:fit-content;list-style:none;min-height:44px;font-size:var(--ui-font-body);font-weight:600;cursor:pointer;}
#peopleView .personnel-add-strip { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(140px, .8fr) auto; margin: 8px 0 0; }
#peopleView .personnel-roster { gap: 0; }
#peopleView :is(.personnel-list-heading, .personnel-summary-row) { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(100px, .8fr) minmax(150px, 1.3fr) 136px; align-items: center; gap: 14px; }
/* Normal-only lists use three columns; exceptional states retain their own column. */
#peopleView .personnel-roster-panel:not(:has(.personnel-summary-row .personnel-badge)) :is(.personnel-list-heading, .personnel-summary-row) { grid-template-columns:minmax(110px,1fr) minmax(150px,1.3fr) 144px; }
#peopleView .personnel-roster-panel:not(:has(.personnel-summary-row .personnel-badge)) :is(.personnel-list-heading, .personnel-summary-row) > :nth-child(2) { display:none; }
#peopleView .personnel-list-heading { padding: 9px 12px; color: var(--shell-muted, var(--muted)); background: var(--shell-soft, var(--surface-soft)); border-radius:var(--ui-radius-control) 6px 0 0; font-size:var(--ui-font-meta); }
#peopleView .personnel-compact-card { display: block; padding: 12px; border: 0; border-bottom: 1px solid var(--shell-line, var(--border)); border-radius: 0; background: var(--shell-surface, var(--surface)); transform: none; box-shadow: none; }
#peopleView .personnel-compact-card.inactive { opacity: 1; filter: none; }
#peopleView .personnel-summary-row > * { min-width: 0; }
#peopleView .personnel-summary-row h3 { margin: 0; font-size:var(--ui-font-body); overflow-wrap: anywhere; }
#peopleView .personnel-login-summary { display: grid; gap: 3px; overflow-wrap: anywhere; }
#peopleView .personnel-login-summary strong { font-size:var(--ui-font-meta); font-weight: 600; }
#peopleView .personnel-login-summary small { color: var(--shell-muted, var(--muted)); font-size:var(--ui-font-meta); }
#peopleView .personnel-summary-actions { gap:8px; flex-wrap: nowrap; }
#peopleView .personnel-summary-actions button { min-width: 60px; min-height:40px; padding:8px 12px; }
#peopleView .danger-button { color:var(--ui-danger);border-color:var(--ui-line);border:1px solid var(--ui-line);background:var(--ui-surface);}
#peopleView .personnel-detail-content { margin-top: 12px; padding:var(--ui-space-4); border-radius:var(--ui-radius-control); background: var(--shell-soft, var(--surface-soft)); }
#peopleView .personnel-detail-content[hidden] { display: none; }
#peopleView .personnel-detail-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--shell-muted, var(--muted)); font-size:var(--ui-font-meta); overflow-wrap: anywhere; }
#peopleView .personnel-card-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#peopleView :is(input, select) { min-width: 0; max-width: 100%; }
#peopleView .personnel-account-row { grid-template-columns: 32px minmax(0, 1fr) auto auto; }
#peopleView .personnel-account-actions { flex-wrap: wrap; }
#peopleView .personnel-pending-note { margin: 10px 0 0; padding: 8px 10px; border-radius:var(--ui-radius-control); color: #8a5700; background: #fff7e5; font-size:var(--ui-font-meta); line-height: 1.6; }
#peopleView .personnel-side-stack { grid-template-columns: minmax(0, 1fr); gap: 8px; }
#peopleView .personnel-side-stack .panel { padding: 8px 18px; }
#peopleView .personnel-side-stack summary span { margin-left: 12px; color: var(--shell-muted, var(--muted)); font-size:var(--ui-font-meta); font-weight: 600; }
#peopleView .personnel-extra-content { margin-top: 12px; padding-bottom: 10px; }
#peopleView .personnel-extra-content .panel-title { display: none; }
#peopleView .personnel-change-panel .field { max-width: 480px; }
#peopleView .personnel-change-panel .primary-button { width: auto; }
#peopleView .personnel-change-log { max-height: 420px; overflow: auto; }
@media (max-width: 760px) {
  #peopleView .personnel-roster-panel { padding:var(--ui-space-4); }
  #peopleView .personnel-list-heading { display: none; }
  #peopleView .personnel-summary-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  #peopleView .personnel-summary-row > div:nth-child(2) { text-align: right; }
  #peopleView .personnel-summary-actions { justify-content: flex-end;gap:8px;}
  #peopleView :is(.personnel-add-strip, .personnel-card-fields) { grid-template-columns: minmax(0, 1fr); }
  #peopleView .personnel-detail-content { padding:var(--ui-space-4); }
  #peopleView .personnel-account-row { grid-template-columns: minmax(0, 1fr); }
  #peopleView .personnel-account-mark { display: none; }
  #peopleView .personnel-account-row > :is(.personnel-badge, .personnel-account-actions) { grid-column: auto; justify-self: start; }
  #peopleView .personnel-card-foot { align-items: flex-start; flex-direction: column; }
  #peopleView .personnel-side-stack summary span { display: block; margin: 6px 0 0; }
  #peopleView .personnel-filter-button { min-height: 40px; padding: 0 9px; }
  #peopleView .personnel-summary-actions button { min-height:40px;padding:8px 12px;}
}
@media (prefers-color-scheme: dark) {
  #peopleView .personnel-pending-note { color: #f2c47d; background: #3e3021; }
}

@media(max-width:760px) { #peopleView .personnel-roster-panel:not(:has(.personnel-summary-row .personnel-badge)) .personnel-summary-row { grid-template-columns:minmax(0,1fr) auto; } #peopleView .personnel-roster-panel:not(:has(.personnel-summary-row .personnel-badge)) .personnel-summary-row h3 { grid-column:1 / -1; } }
