:root {
  color-scheme: light;
  --te-paper: #f7f8f9;
  --te-surface: #ffffff;
  --te-surface-soft: #f0f3f5;
  --te-ink: #172027;
  --te-muted: #5e6971;
  --te-line: #d8dde1;
  --te-line-strong: #b9c1c7;
  --te-accent: #086f83;
  --te-accent-dark: #075565;
  --te-success: #167548;
  --te-success-bg: #e7f5ed;
  --te-warn: #936716;
  --te-warn-bg: #fff4d8;
  --te-danger: #a33b43;
  --te-danger-bg: #fbeaec;
  --te-shadow: 0 12px 32px rgba(23, 32, 39, .12);
  --te-sans: "Switzer", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --te-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--te-paper); color: var(--te-ink); font: 14px/1.5 var(--te-sans); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }

.te-shell { min-height: 100vh; }
.te-topbar { min-height: 58px; padding: 0 28px; gap: 16px; display: flex; align-items: center; background: var(--te-ink); color: #fff; }
.te-brand { color: #fff; font-size: 15px; font-weight: 760; text-decoration: none; }
.te-context { color: #c4cdd1; font-size: 13px; }
.te-signout { margin-left: auto; border: 0; background: transparent; color: #e3e9eb; font-weight: 650; padding: 8px 0; }
.te-signout:hover { color: #fff; }
.te-main { width: min(1320px, 100%); margin: 0 auto; padding: 30px 28px 48px; }
.te-heading { display: flex; align-items: flex-start; gap: 20px; margin: 0 0 20px; }
.te-heading-copy { max-width: 820px; }
.te-eyebrow { color: var(--te-accent); font-size: 11px; font-weight: 780; letter-spacing: .08em; text-transform: uppercase; }
.te-heading h1 { margin: 5px 0 7px; font-size: clamp(27px, 4vw, 42px); line-height: 1.12; letter-spacing: -.025em; }
.te-heading p { margin: 0; max-width: 720px; color: var(--te-muted); font-size: 15px; }
.te-days { margin-left: auto; min-width: 128px; padding: 13px 15px; border: 1px solid var(--te-line); border-radius: 7px; background: var(--te-surface); text-align: right; }
.te-days small { display: block; color: var(--te-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.te-days strong { display: block; margin-top: 1px; font-size: 27px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.te-days span { color: var(--te-muted); font-size: 12px; }
.te-notice { display: flex; align-items: flex-start; gap: 11px; margin: 0 0 18px; padding: 13px 15px; border: 1px solid #d8e8eb; border-radius: 7px; background: #edf8fa; color: #28535d; }
.te-notice strong { color: #164e5b; }
.te-notice p { margin: 2px 0 0; line-height: 1.45; }
.te-layout { display: grid; grid-template-columns: 235px minmax(0, 1fr); gap: 20px; align-items: start; }
.te-nav { position: sticky; top: 18px; border: 1px solid var(--te-line); border-radius: 7px; background: var(--te-surface); overflow: hidden; }
.te-nav h2 { margin: 0; padding: 13px 14px 10px; color: var(--te-muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.te-nav-list { display: grid; padding: 0 7px 7px; gap: 2px; }
.te-nav-link { min-height: 37px; padding: 8px 9px; border-radius: 5px; color: var(--te-muted); font-weight: 660; text-decoration: none; }
.te-nav-link:hover { background: var(--te-surface-soft); color: var(--te-ink); }
.te-nav-link[aria-current="page"] { background: #e8f4f6; color: var(--te-accent-dark); }
.te-nav-boundary { margin: 4px 14px 15px; color: var(--te-muted); font-size: 12px; line-height: 1.45; }
.te-board { display: grid; gap: 16px; min-width: 0; }
.te-card { border: 1px solid var(--te-line); border-radius: 7px; background: var(--te-surface); }
.te-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 19px 15px; border-bottom: 1px solid var(--te-line); }
.te-card-head h2 { margin: 0; font-size: 18px; letter-spacing: -.012em; }
.te-card-head p { margin: 4px 0 0; color: var(--te-muted); }
.te-status { display: inline-flex; align-items: center; min-height: 25px; border-radius: 999px; padding: 4px 9px; background: var(--te-surface-soft); color: var(--te-muted); font-size: 11px; font-weight: 760; line-height: 1; white-space: nowrap; }
.te-status.success { background: var(--te-success-bg); color: var(--te-success); }
.te-status.warning { background: var(--te-warn-bg); color: var(--te-warn); }
.te-status.danger { background: var(--te-danger-bg); color: var(--te-danger); }
.te-progress { padding: 19px; }
.te-progress-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.te-progress-summary strong { font-size: 17px; }
.te-progress-summary span { color: var(--te-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.te-meter { height: 7px; margin: 12px 0 14px; border-radius: 999px; overflow: hidden; background: var(--te-surface-soft); }
.te-meter > span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--te-accent); transition: width .2s ease; }
.te-milestones { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--te-line); }
.te-milestone { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--te-line); }
.te-milestone:last-child { border-bottom: 0; padding-bottom: 0; }
.te-milestone-mark { width: 19px; height: 19px; flex: 0 0 auto; border: 1px solid var(--te-line-strong); border-radius: 50%; background: var(--te-surface); }
.te-milestone.complete .te-milestone-mark { border-color: var(--te-success); background: var(--te-success); box-shadow: inset 0 0 0 4px var(--te-surface); }
.te-milestone p { margin: 0; color: var(--te-muted); font-size: 13px; }
.te-milestone strong { color: var(--te-ink); }
.te-next { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 16px 19px; background: var(--te-surface-soft); border-top: 1px solid var(--te-line); }
.te-next small { display: block; margin-bottom: 3px; color: var(--te-muted); font-size: 11px; font-weight: 760; letter-spacing: .05em; text-transform: uppercase; }
.te-next strong { display: block; font-size: 15px; }
.te-next p { margin: 3px 0 0; color: var(--te-muted); font-size: 13px; }
.te-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 13px; border: 1px solid var(--te-accent); border-radius: 5px; background: var(--te-accent); color: #fff; font-weight: 720; line-height: 1.2; text-align: center; text-decoration: none; }
.te-button:hover { background: var(--te-accent-dark); border-color: var(--te-accent-dark); }
.te-button.secondary { border-color: var(--te-line-strong); background: var(--te-surface); color: var(--te-ink); }
.te-button.secondary:hover { border-color: var(--te-accent); background: var(--te-surface); color: var(--te-accent); }
.te-meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--te-line); }
.te-meta { min-width: 0; padding: 15px 17px; background: var(--te-surface); }
.te-meta small { display: block; color: var(--te-muted); font-size: 11px; font-weight: 730; letter-spacing: .04em; text-transform: uppercase; }
.te-meta strong { display: block; margin-top: 4px; overflow-wrap: anywhere; font-size: 14px; }
.te-meta span { display: block; margin-top: 3px; color: var(--te-muted); font-size: 12px; }
.te-support { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 19px; }
.te-support h2 { margin: 0; font-size: 16px; }
.te-support p { margin: 3px 0 0; color: var(--te-muted); font-size: 13px; }
.te-support-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.te-support-state { width: 100%; max-width: 390px; margin: 0 !important; color: var(--te-success) !important; font-size: 12px !important; text-align: right; }
.te-recovery { display: grid; gap: 13px; padding: 17px 19px; }
.te-recovery h2 { margin: 0; font-size: 16px; }
.te-recovery p { margin: 3px 0 0; color: var(--te-muted); font-size: 13px; }
.te-recovery > .te-button { justify-self: start; }
.te-recovery ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.te-recovery-item { padding: 11px 12px; border: 1px solid var(--te-line); border-radius: 5px; background: var(--te-surface-soft); }
.te-recovery-item strong { font-size: 13px; }
.te-recovery-item p { margin-bottom: 0; }
.te-gate { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(247, 248, 249, .96); }
.te-gate-panel { width: min(425px, 100%); padding: 27px; border: 1px solid var(--te-line); border-radius: 7px; background: var(--te-surface); text-align: center; box-shadow: var(--te-shadow); }
.te-gate-panel h2 { margin: 0 0 8px; font-size: 20px; }
.te-gate-panel p { margin: 0; color: var(--te-muted); }
.te-spinner { width: 24px; height: 24px; margin: 0 auto 16px; border: 2px solid var(--te-line); border-top-color: var(--te-accent); border-radius: 50%; animation: te-spin .8s linear infinite; }
.trial-ready .te-gate, .trial-admin-ready .te-gate { display: none; }
.trial-locked .te-shell, .trial-admin-locked .te-shell { filter: blur(2px); pointer-events: none; user-select: none; }
@keyframes te-spin { to { transform: rotate(360deg); } }

.tm-main { width: min(1440px, 100%); margin: 0 auto; padding: 28px 28px 48px; }
.tm-heading { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 20px; }
.tm-heading h1 { margin: 4px 0 6px; font-size: clamp(27px, 4vw, 38px); line-height: 1.12; letter-spacing: -.025em; }
.tm-heading p { max-width: 780px; margin: 0; color: var(--te-muted); }
.tm-back { margin-left: auto; color: #e6ecee; font-weight: 650; text-decoration: none; }
.tm-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 16px; overflow: hidden; border: 1px solid var(--te-line); border-radius: 7px; background: var(--te-surface); }
.tm-stat { padding: 14px 17px; border-right: 1px solid var(--te-line); }
.tm-stat:last-child { border: 0; }
.tm-stat small { display: block; color: var(--te-muted); font-size: 11px; font-weight: 760; letter-spacing: .05em; text-transform: uppercase; }
.tm-stat strong { display: block; margin-top: 3px; font-size: 24px; font-variant-numeric: tabular-nums; }
.tm-stat span { display: block; margin-top: 1px; color: var(--te-muted); font-size: 12px; }
.tm-boundary { margin: 0 0 16px; padding: 12px 14px; border-left: 3px solid var(--te-accent); background: #edf8fa; color: #28535d; line-height: 1.45; }
.tm-boundary strong { color: #164e5b; }
.tm-onboarding { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 16px; }
.tm-panel { padding: 18px; border: 1px solid var(--te-line); border-radius: 7px; background: var(--te-surface); }
.tm-panel h2 { margin: 3px 0 5px; font-size: 19px; }
.tm-panel h3 { margin: 14px 0 8px; font-size: 14px; }
.tm-panel p { margin: 0 0 14px; color: var(--te-muted); font-size: 13px; }
.tm-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; }
.tm-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.tm-staff-panel { margin: 0 0 16px; }
.tm-supervision { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin: 0 0 14px; padding: 12px; background: var(--te-surface-soft); border: 1px solid var(--te-line); border-radius: 5px; }
.tm-staff-list { display: grid; gap: 7px; }
.tm-staff-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--te-line); border-radius: 5px; }
.tm-toolbar { display: grid; grid-template-columns: 180px 180px minmax(220px, 1fr); gap: 10px; align-items: end; margin: 0 0 12px; }
.tm-field label { display: block; margin: 0 0 5px; color: var(--te-muted); font-size: 12px; font-weight: 700; }
.tm-field select, .tm-field input, .tm-field textarea { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--te-line-strong); border-radius: 5px; background: var(--te-surface); color: var(--te-ink); outline: none; }
.tm-field textarea { min-height: 92px; resize: vertical; }
.tm-field select:focus, .tm-field input:focus, .tm-field textarea:focus { border-color: var(--te-accent); box-shadow: 0 0 0 2px rgba(8, 111, 131, .14); }
.tm-table-wrap { overflow: auto; border: 1px solid var(--te-line); border-radius: 7px; background: var(--te-surface); }
.tm-table { width: 100%; min-width: 1280px; border-collapse: collapse; table-layout: fixed; }
.tm-table th { position: sticky; top: 0; z-index: 1; padding: 10px 11px; background: var(--te-surface-soft); border-bottom: 1px solid var(--te-line); color: var(--te-muted); font-size: 10px; font-weight: 770; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
.tm-table td { padding: 12px 11px; border-bottom: 1px solid #e8ebed; vertical-align: top; line-height: 1.35; }
.tm-table tr:last-child td { border-bottom: 0; }
.tm-table tbody tr:hover { background: #fafcfc; }
.tm-primary { font-weight: 720; overflow-wrap: anywhere; }
.tm-secondary { display: block; margin-top: 3px; color: var(--te-muted); font-size: 12px; overflow-wrap: anywhere; }
.tm-counts { display: grid; gap: 3px; color: var(--te-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.tm-counts span { white-space: nowrap; }
.tm-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-actions .te-button { min-height: 30px; padding: 5px 8px; font-size: 11px; }
.tm-empty { padding: 52px 24px; color: var(--te-muted); text-align: center; }
.tm-empty strong { display: block; margin-bottom: 5px; color: var(--te-ink); font-size: 15px; }
.tm-dialog { width: min(560px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--te-line-strong); border-radius: 7px; background: var(--te-surface); color: var(--te-ink); box-shadow: var(--te-shadow); }
.tm-dialog::backdrop { background: rgba(23, 32, 39, .48); }
.tm-dialog-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 21px 15px; border-bottom: 1px solid var(--te-line); }
.tm-dialog-head h2 { margin: 0; font-size: 19px; }
.tm-dialog-head p { margin: 4px 0 0; color: var(--te-muted); font-size: 13px; }
.tm-dialog-body { display: grid; gap: 14px; padding: 20px 21px; }
.tm-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 21px; border-top: 1px solid var(--te-line); background: var(--te-surface-soft); }
.tm-dialog-note { margin: 0; padding: 10px 12px; border-left: 3px solid var(--te-warn); background: var(--te-warn-bg); color: #6f4d0d; line-height: 1.45; }
.tm-toast { position: fixed; z-index: 120; right: 22px; bottom: 22px; max-width: 380px; padding: 12px 15px; border-radius: 6px; background: var(--te-ink); color: #fff; box-shadow: var(--te-shadow); opacity: 0; pointer-events: none; transform: translateY(8px); transition: .15s ease; }
.tm-toast.is-visible { opacity: 1; transform: translateY(0); }
.tm-toast.is-error { background: var(--te-danger); }

@media (max-width: 900px) {
  .te-topbar { padding: 0 18px; }
  .te-main, .tm-main { padding: 22px 18px 36px; }
  .te-layout { grid-template-columns: 1fr; }
  .te-nav { position: static; }
  .te-nav-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .te-nav-link { min-height: 50px; display: flex; align-items: center; }
  .tm-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-stat:nth-child(2) { border-right: 0; }
  .tm-stat:nth-child(-n + 2) { border-bottom: 1px solid var(--te-line); }
}

@media (max-width: 760px) {
  .te-heading { display: grid; grid-template-columns: 1fr auto; }
  .te-heading-copy { grid-column: 1 / -1; }
  .te-days { grid-column: 2; grid-row: 1; }
  .te-card-head, .te-next, .te-support { align-items: flex-start; flex-direction: column; }
  .te-next .te-button, .te-support .te-button { width: 100%; }
  .te-support-actions { width: 100%; }
  .te-support-state { max-width: none; text-align: left; }
  .te-meta-grid { grid-template-columns: 1fr; }
  .te-nav-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-toolbar { grid-template-columns: 1fr 1fr; }
  .tm-onboarding { grid-template-columns: 1fr; }
  .tm-supervision { grid-template-columns: 1fr 1fr; }
  .tm-supervision .te-button { grid-column: 1 / -1; }
  .tm-toolbar .tm-field:last-child { grid-column: 1 / -1; }
  .tm-table-wrap { overflow: visible; border: 0; background: transparent; }
  .tm-table { display: block; min-width: 0; }
  .tm-table thead { display: none; }
  .tm-table tbody { display: grid; gap: 12px; }
  .tm-table tr { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid var(--te-line); border-radius: 7px; background: var(--te-surface); }
  .tm-table td { display: block; min-width: 0; padding: 12px; border: 0; border-bottom: 1px solid var(--te-line); }
  .tm-table td:nth-child(odd) { border-right: 1px solid var(--te-line); }
  .tm-table td::before { content: attr(data-label); display: block; margin-bottom: 5px; color: var(--te-muted); font-size: 10px; font-weight: 760; letter-spacing: .04em; text-transform: uppercase; }
  .tm-table td:last-child, .tm-table td:nth-last-child(2) { border-bottom: 0; }
}

@media (max-width: 520px) {
  .te-topbar { min-height: 54px; padding: 0 14px; }
  .te-context { display: none; }
  .te-main, .tm-main { padding: 18px 12px 30px; }
  .te-heading { display: block; }
  .te-days { width: 100%; margin-top: 12px; text-align: left; }
  .te-heading h1, .tm-heading h1 { font-size: 26px; }
  .te-nav-list, .tm-toolbar, .tm-summary { grid-template-columns: 1fr; }
  .tm-stat, .tm-stat:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--te-line); }
  .tm-stat:last-child { border-bottom: 0; }
  .tm-heading { display: block; }
  .tm-form-grid, .tm-supervision { grid-template-columns: 1fr; }
  .tm-supervision .te-button { grid-column: auto; }
  .tm-staff-card { align-items: flex-start; flex-direction: column; }
  .tm-back { display: inline-block; margin: 13px 0 0; color: var(--te-accent); }
  .tm-table tr { grid-template-columns: 1fr; }
  .tm-table td:nth-child(odd) { border-right: 0; }
  .tm-table td:nth-last-child(2) { border-bottom: 1px solid var(--te-line); }
  .tm-dialog-head, .tm-dialog-body { padding-left: 16px; padding-right: 16px; }
  .tm-dialog-actions { padding: 12px 16px; }
  .tm-dialog-actions .te-button { flex: 1; }
  .tm-toast { right: 12px; bottom: 12px; left: 12px; }
}
