:root {
  color-scheme: light;
  --paper: #f6f4ee;
  --surface: #fffefa;
  --green: #21473b;
  --green-hover: #17392f;
  --ink: #212620;
  --muted: #76766e;
  --line: #e2ded4;
  --soft-green: #e9eee7;
  --error: #923e31;
  --error-bg: #faeee8;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: wait; opacity: .58; }
button, input, select { touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
input { min-width: 0; color: var(--ink); }
input::placeholder { color: #94938a; opacity: 1; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1 { font-family: "Songti SC", "Noto Serif CJK SC", "STSong", "SimSun", serif; font-weight: 600; font-size: clamp(36px, 9vw, 46px); letter-spacing: -.035em; line-height: 1.25; }
h2 { font-size: 21px; font-weight: 650; line-height: 1.4; letter-spacing: -.02em; }
h3 { font-size: 18px; font-weight: 650; line-height: 1.45; }

.site-shell { max-width: 620px; margin: 0 auto; padding: 0 24px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 83px; border-bottom: 1px solid var(--line); }
.brand-line { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.brand { font-size: 15px; letter-spacing: .02em; color: #686a60; }
.edition { padding: 2px 7px; border: 1px solid var(--line); border-radius: 5px; font-size: 10px; line-height: 1.5; color: var(--muted); white-space: nowrap; }
.today { font-size: 12px; color: var(--muted); white-space: nowrap; }
.view { padding-top: 38px; min-height: 52vh; }
.loading-view { min-height: 65vh; }
.page-intro { margin-bottom: 34px; }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 600; letter-spacing: .08em; margin-bottom: 13px; }
.lede { color: var(--muted); font-size: 15px; line-height: 1.8; margin-top: 14px; max-width: 32em; }
.loading-view .lede { margin-top: 14px; }
.auth-view { max-width: 510px; margin: 0 auto; }
.field { margin-top: 21px; }
.field > label, .role-field > legend { display: block; font-weight: 550; font-size: 15px; margin-bottom: 9px; }
.field input, .field select, .search-input { display: block; width: 100%; height: 55px; padding: 14px 16px; border: 1px solid #dcd8ce; border-radius: var(--radius); background: rgba(255, 254, 250, .74); box-shadow: none; transition: border-color .15s, background-color .15s; }
.field input:hover, .field select:hover, .search-input:hover { border-color: #bbbeb0; }
.field input:focus, .field select:focus, .search-input:focus { outline: none; border-color: var(--green); background: var(--surface); box-shadow: 0 0 0 2px #21473b0c; }
.field input[aria-invalid="true"] { border-color: var(--error); }
.field-help { margin-top: 14px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 51px; border: 1px solid transparent; padding: 12px 20px; border-radius: var(--radius); font-weight: 600; line-height: 1.5; transition: background-color .15s; }
.button-primary { background: var(--green); color: #fffefa; }
.button-primary:hover:enabled { background: var(--green-hover); }
.button-block { width: 100%; margin-top: 27px; }
.button-small { min-height: 43px; padding: 9px 15px; font-size: 14px; border-radius: 10px; white-space: nowrap; }
.button-text { background: transparent; border: 0; padding: 9px 0; min-height: 43px; color: var(--green); font-size: 13px; font-weight: 550; white-space: nowrap; }
.button-text:hover:enabled { color: #0c2e21; text-decoration: underline; text-underline-offset: 4px; }
.button-text.caution { color: #9a593e; }
.footnote { margin: 25px 0 0; text-align: center; color: #87877d; font-size: 12px; line-height: 1.9; }
.subtle-note { padding: 13px 15px; border-radius: 9px; background: #eeece3; color: #62675d; font-size: 12px; line-height: 1.8; margin: 21px 0; }
.message { border-radius: 9px; padding: 12px 14px; background: var(--soft-green); color: var(--green); font-size: 13px; line-height: 1.8; margin: 20px 0; white-space: pre-line; overflow-wrap: anywhere; }
.message-error { color: var(--error); background: var(--error-bg); }
.message + .button-block { margin-top: 5px; }
.site-footer { color: #9a998f; text-align: center; font-size: 10px; margin: 45px 0 23px; letter-spacing: .04em; }
.workspace-intro { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.workspace-intro .eyebrow { margin-bottom: 10px; }
.workspace-intro .button-text { align-self: flex-start; margin-top: -8px; }
.signed-in-as { color: var(--muted); margin-top: 15px; font-size: 13px; }
.page-tabs { display: flex; gap: 23px; border-bottom: 1px solid var(--line); margin-top: 28px; }
.tab { position: relative; color: #89897f; font-size: 14px; font-weight: 550; background: none; border: 0; min-height: 49px; padding: 8px 1px 15px; white-space: nowrap; }
.tab.active { color: var(--green); }
.tab.active::after { content: ""; height: 3px; width: 100%; position: absolute; bottom: -1px; left: 0; background: var(--green); border-radius: 2px; }
.workspace-panel { padding-top: 28px; }
.team-summary { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); padding-bottom: 26px; margin-bottom: 28px; }
.team-summary > div { display: flex; flex-direction: column; align-items: flex-start; }
.team-summary > div + div { border-left: 1px solid var(--line); padding-left: 28px; }
.team-summary span { font-size: 13px; color: #666d61; }
.team-summary strong { font-size: 35px; font-weight: 550; color: var(--green); line-height: 1.3; margin-top: 3px; font-variant-numeric: tabular-nums; }
.team-summary small { font-size: 11px; color: #919084; margin-top: 2px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-heading .small { margin-top: 5px; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.search-input { font-size: 14px; height: 49px; border-radius: 10px; }
.filter-row { display: flex; align-items: center; gap: 6px; margin: 15px 0 19px; }
.filter { border: 0; background: transparent; color: #7b7e72; border-radius: 7px; padding: 8px 11px; font-size: 12px; min-height: 38px; }
.filter.active { color: var(--green); background: var(--soft-green); font-weight: 600; }
.refresh-button { margin-left: auto; font-size: 12px; }
.staff-list { display: flex; flex-direction: column; gap: 12px; }
.staff-card { background: var(--surface); padding: 17px 18px 8px; border-radius: var(--radius); }
.staff-card.is-inactive { background: #eeece5; }
.staff-card-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.staff-person { min-width: 0; }
.staff-person h3 { overflow-wrap: anywhere; }
.staff-meta { font-size: 12px; color: var(--muted); margin-top: 5px; display: flex; flex-wrap: wrap; gap: 3px 12px; font-variant-numeric: tabular-nums; }
.role-label { font-size: 11px; line-height: 1.7; padding: 3px 8px; border: 1px solid #dce3d7; color: #556950; border-radius: 6px; white-space: nowrap; }
.staff-actions { margin-top: 14px; border-top: 1px solid #eeece4; padding-top: 3px; display: flex; align-items: center; gap: 20px; }
.staff-actions .button-text { font-size: 12px; }
.staff-card.is-inactive .staff-actions { flex-wrap: wrap; row-gap: 0; }
.staff-card.is-inactive .account-state { white-space: nowrap; }
.staff-fix-delete { background: #8d3f35; border-color: #8d3f35; }
.staff-fix-delete:hover:enabled { background: #733027; border-color: #733027; }
.account-state { font-size: 11px; color: #6a8064; margin-right: auto; }
.account-state.inactive { color: #8b8176; }
.empty-state { padding: 32px 21px; border: 1px dashed #d9d6ca; border-radius: var(--radius); text-align: center; }
.empty-state h3 { font-size: 16px; font-weight: 550; }
.empty-state p { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.section-footnote { color: #919086; font-size: 11px; line-height: 1.9; margin-top: 22px; }
.profile-sheet { padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.profile-details { margin: 18px 0 0; }
.profile-details > div { display: flex; gap: 16px; justify-content: space-between; padding: 10px 0; font-size: 14px; }
.profile-details dt { color: var(--muted); flex-shrink: 0; }
.profile-details dd { text-align: right; margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.password-section { padding-top: 28px; }
.password-section > .small { margin-top: 7px; }
.password-section .field:first-child { margin-top: 23px; }
.audit-list { display: flex; flex-direction: column; }
.audit-entry { padding: 18px 0; border-bottom: 1px solid var(--line); }
.audit-entry:first-child { padding-top: 3px; }
.audit-entry h3 { font-size: 15px; font-weight: 550; }
.audit-entry p { font-size: 12px; color: var(--muted); line-height: 1.9; margin-top: 6px; overflow-wrap: anywhere; }
.audit-entry time { font-size: 11px; color: #959487; display: block; margin-top: 6px; }
.loading-state { padding: 25px 0; color: var(--muted); font-size: 13px; }
.sheet-dialog { border: 1px solid var(--line); border-radius: 20px; padding: 25px 24px 28px; color: var(--ink); background: var(--paper); width: min(100% - 28px, 500px); max-height: calc(100dvh - 34px); overflow: auto; overscroll-behavior: contain; box-shadow: 0 18px 90px #18271b24; }
.sheet-dialog::backdrop { background: #1b2b258c; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.dialog-heading h2 { font-family: "Songti SC", "Noto Serif CJK SC", "STSong", "SimSun", serif; font-size: 28px; font-weight: 600; }
.dialog-heading .eyebrow { margin-bottom: 7px; }
.dialog-description { margin-top: 19px; font-size: 15px; overflow-wrap: anywhere; }
.dialog-description + .muted { margin-top: 12px; font-size: 13px; line-height: 1.9; }
.role-field { margin: 21px 0 0; padding: 0; border: 0; }
.role-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-options label { min-height: 50px; padding: 12px; display: flex; align-items: center; gap: 8px; border: 1px solid #dcd8ce; border-radius: 10px; cursor: pointer; background: #fffefa88; font-size: 14px; }
.role-options label:has(input:checked) { background: var(--soft-green); border-color: #a7b7a7; color: var(--green); }
.role-options input { accent-color: var(--green); width: 17px; height: 17px; margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.noscript-message { padding: 25px; color: var(--error); }

/* The same authenticated account uses a narrow phone layout or a wider
   desktop workspace. Authentication forms remain compact on both. */
.site-shell, .view, .workspace-panel, .workspace-intro > div { min-width: 0; }
.workspace-intro > .button-text { flex: 0 0 auto; }
.workspace-intro h1, .signed-in-as { overflow-wrap: anywhere; }
.field input, .search-input { max-width: 100%; }
.usage-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 0; color: var(--green); font-size: 13px; text-underline-offset: 4px; }
.usage-link:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.entry-guide { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.entry-guide > h2 { font-size: 16px; line-height: 1.6; }
.entry-guide > p { margin-top: 7px; font-size: 12px; color: var(--muted); line-height: 1.8; }
.entry-guide-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 15px; }
.entry-guide-card { min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 13px 14px; background: #fffefa80; }
.entry-guide-card h3 { color: var(--green); font-size: 14px; }
.entry-guide-card p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.handoff-page { max-width: 1180px; margin: 0 auto; padding: 28px 24px 45px; min-width: 0; }
.site-shell.handoff-page { max-width: 1180px; padding: 28px 24px 45px; }
.handoff-page .lede { max-width: 46em; }
.handoff-page h1 { margin: 13px 0; }
.handoff-page h2 { font-size: 23px; margin-top: 28px; }
.handoff-page p, .handoff-page li { overflow-wrap: anywhere; }
.handoff-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 15px; margin-top: 20px; }
.handoff-card { min-width: 0; padding: 21px; border: 1px solid var(--line); border-radius: 12px; background: #fffefa9e; }
.handoff-card h2, .handoff-card h3 { margin-top: 0; color: var(--green); font-size: 19px; }
.handoff-card p, .handoff-card li { color: #646c60; font-size: 14px; line-height: 1.9; }
.handoff-card p { margin-top: 10px; }
.handoff-card ol, .handoff-card ul { margin: 12px 0 0; padding-left: 22px; }
.handoff-card li + li { margin-top: 7px; }
.handoff-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 22px 0; }
.handoff-actions a { min-height: 44px; overflow-wrap: anywhere; }

@media (min-width: 560px) {
  .entry-guide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  body[data-role] .site-shell { max-width: 960px; }
  .handoff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .handoff-page { padding-left: 32px; padding-right: 32px; }
  .site-shell.handoff-page { padding-left: 32px; padding-right: 32px; }
}

@media (min-width: 1024px) {
  body[data-role] .site-shell { max-width: 1180px; }
  body[data-role] .view { padding-top: 34px; }
  body[data-role] .workspace-intro h1 { font-size: 42px; }
  .staff-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
  #profile-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 48px; align-items: start; }
  #profile-panel > .profile-sheet { grid-column: 1; }
  #profile-panel > .password-section { grid-column: 2; grid-row: 1 / span 2; padding-top: 0; }
  #profile-panel > .subtle-note { grid-column: 1; }
  .staff-card { min-width: 0; }
  .handoff-page { padding-top: 42px; }
  .site-shell.handoff-page { padding-top: 42px; }
}

@media (max-width: 767px) {
  .field input, .field select, .search-input { font-size: 16px; }
  .staff-actions .button-text, .filter, .refresh-button { min-height: 44px; }
  .filter-row { flex-wrap: wrap; }
  .sheet-dialog { padding: 21px 18px 25px; }
  .handoff-actions { align-items: stretch; }
  .handoff-actions .button { flex: 1 1 100%; }
}

@media (max-width: 375px) {
  .handoff-page { padding-left: 17px; padding-right: 17px; }
  .site-shell.handoff-page { padding-left: 17px; padding-right: 17px; }
  .handoff-card { padding: 17px; }
}

@media (min-width: 720px) {
  .site-shell { padding: 0 32px; }
  .site-header { min-height: 95px; }
  .view { padding-top: 47px; }
  .auth-view { padding-top: 58px; }
  .page-intro { margin-bottom: 37px; }
}

@media (max-width: 375px) {
  .site-shell { padding: 0 19px; }
  .site-header { min-height: 77px; }
  .brand-line { gap: 6px; }
  .brand { font-size: 14px; }
  .today { font-size: 11px; }
  .edition { font-size: 9px; padding: 2px 5px; }
  .page-tabs { gap: 22px; }
  .team-summary > div + div { padding-left: 21px; }
  .staff-card { padding-left: 14px; padding-right: 14px; }
  .staff-actions { gap: 15px; }
  .filter { padding-left: 8px; padding-right: 8px; }
}

/* Keep workspace navigation easy to spot and use at phone widths. */
.workspace-actions {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.workspace-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid #d5d8cd;
  border-radius: 10px;
  background: var(--surface);
  color: var(--green);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
  transition: background-color .15s, border-color .15s;
}
.workspace-action-home {
  background: var(--soft-green);
  border-color: #b1c0b1;
}
.workspace-action:hover {
  background: #dce7dc;
  border-color: #a0b3a1;
}
.workspace-action:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
.workspace-action svg, .account-create-action svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#admin-nav.account-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin-top: 23px;
  padding: 4px;
  border: 1px solid #dedbd0;
  border-radius: 12px;
  background: #eeece4;
}
#admin-nav.account-tabs .tab {
  min-width: 0;
  min-height: 44px;
  padding: 8px clamp(8px, 3vw, 23px);
  border: 1px solid transparent;
  border-radius: 8px;
  color: #555f55;
  font-size: 14px;
  line-height: 1.4;
  transition: background-color .15s, color .15s;
}
#admin-nav.account-tabs .tab:not(.active):hover { background: var(--surface); color: var(--green); }
#admin-nav.account-tabs .tab.active {
  border-color: var(--green);
  background: var(--green);
  color: var(--surface);
  font-weight: 650;
}
#admin-nav.account-tabs .tab.active::after { content: none; }
#admin-nav.account-tabs .tab:focus-visible { outline-offset: 1px; }
.account-create-action.button-small { gap: 7px; min-height: 44px; }

@media (max-width: 479px) {
  .workspace-action { flex: 1 1 125px; }
  #admin-nav.account-tabs { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
