/* Extracted from workspace.html. */
:root {
  --ink: #16201d;
  --muted: #61706b;
  --soft: #eef3f1;
  --paper: #fbfcfb;
  --line: #d5dedb;
  --panel: #ffffff;
  --accent: #1f6b5b;
  --accent-strong: #144d43;
  --accent-soft: #dbeee9;
  --dark: #111a18;
  --teal: #3ecfad;
  --teal-dim: rgba(62, 207, 173, 0.18);
  --shadow: 0 4px 20px rgba(25, 38, 34, 0.08);
  --radius: 8px;
  --sidebar-w: 272px;
  font-family: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--soft); line-height: 1.6; font-weight: 400; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; overflow-wrap: anywhere; }

.skip-link { position: absolute; top: 12px; left: 12px; z-index: 20; padding: 8px 12px; border-radius: var(--radius); background: var(--ink); color: #fff; opacity: 0; transform: translateY(-10px); transition: opacity 160ms ease, transform 160ms ease; }
.skip-link:focus { opacity: 1; transform: translateY(0); }

.site-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px clamp(18px, 4vw, 44px); border-bottom: 1px solid rgba(213, 222, 219, 0.5); background: rgba(17, 26, 24, 0.92); backdrop-filter: blur(18px); }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; color: #fff; }
.brand-mark { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; background: var(--accent-strong); flex-shrink: 0; }
.brand-name { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; color: #fff; margin: 0; }
.brand-subtitle { color: rgba(255,255,255,0.45); font-size: 0.75rem; margin: 0; }
.header-right { display: flex; align-items: center; gap: 20px; }
.top-nav { display: flex; flex-wrap: wrap; gap: 20px; font-size: 0.88rem; font-weight: 500; }
.top-nav a { color: rgba(255,255,255,0.6); border-bottom: 2px solid transparent; padding-bottom: 2px; transition: color 120ms; }
.top-nav a:hover, .top-nav a[aria-current="page"] { color: var(--teal); border-bottom-color: var(--teal); }
.btn-login { display: inline-flex; align-items: center; padding: 7px 16px; border-radius: var(--radius); border: 1.5px solid rgba(255,255,255,0.2); background: transparent; color: rgba(255,255,255,0.8); font-family: inherit; font-size: 0.85rem; font-weight: 500; cursor: pointer; white-space: nowrap; transition: border-color 120ms, color 120ms; text-decoration: none; }
.btn-login[hidden] { display: none; }
.btn-login:hover { border-color: var(--teal); color: var(--teal); }

.ws-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; gap: 0; min-height: calc(100vh - 62px); align-items: start; }

.ws-sidebar { position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.sidebar-section { padding: 20px; border-bottom: 1px solid var(--line); }
.sidebar-section:last-child { border-bottom: none; flex: 1; }
.sidebar-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--teal); margin-bottom: 12px; }

.auth-strip h3 { font-size: 0.9rem; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.auth-strip p { font-family: 'Lora', Georgia, serif; font-size: 0.78rem; color: var(--muted); line-height: 1.55; margin-bottom: 12px; }
.auth-strip label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.auth-strip label span { font-size: 0.72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.auth-strip input[type="email"] { width: 100%; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: var(--radius); font-family: inherit; font-size: 0.85rem; color: var(--ink); background: var(--soft); transition: border-color 120ms; outline: none; }
.auth-strip input[type="email"]:focus { border-color: var(--teal); background: var(--paper); }
.auth-actions { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.auth-btn-primary { width: 100%; padding: 9px 14px; border: none; border-radius: var(--radius); background: var(--accent-strong); color: #fff; font-family: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: background 120ms; }
.auth-btn-primary:hover { background: var(--accent); }
.auth-btn-secondary { width: 100%; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--muted); font-family: inherit; font-size: 0.82rem; font-weight: 500; cursor: pointer; transition: border-color 120ms, color 120ms; }
.auth-btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.auth-status-text { font-size: 0.78rem; color: var(--muted); line-height: 1.5; min-height: 1.5em; }
.entitlement-strip { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: var(--radius); background: var(--soft); border: 1px solid var(--line); margin-top: 10px; }
.entitlement-strip span { font-size: 0.75rem; color: var(--muted); }
.entitlement-strip strong { font-size: 0.78rem; color: var(--ink); }
.entitlement-summary-detail { display: grid; gap: 8px; font-size: 0.75rem; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.credit-summary-card { padding: 10px 11px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.credit-summary-card strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 0.82rem; line-height: 1.25; }
.credit-summary-card p { margin: 0; color: var(--muted); font-family: inherit; font-size: 0.75rem; line-height: 1.45; }
.credit-summary-card small { display: block; margin-top: 6px; color: var(--muted); font-size: 0.72rem; line-height: 1.4; }
.credit-purchase-panel { display: grid; gap: 5px; margin-top: 8px; }
.credit-purchase-button { width: 100%; min-height: 34px; border: 1px solid var(--accent); border-radius: var(--radius); background: #fff; color: var(--accent-strong); font-family: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.credit-purchase-button:hover, .credit-purchase-button:focus { background: var(--accent-soft); }
.credit-purchase-button:disabled { cursor: not-allowed; border-color: var(--line); color: var(--muted); background: var(--soft); }
.credit-purchase-panel small { color: var(--muted); font-size: 0.72rem; line-height: 1.35; }

.criteria-form { display: flex; flex-direction: column; gap: 10px; }
.criteria-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 14px; }
.criteria-form label { display: flex; flex-direction: column; gap: 4px; }
.criteria-form label span { font-size: 0.72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.criteria-form select { width: 100%; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: var(--radius); font-family: inherit; font-size: 0.85rem; color: var(--ink); background: var(--soft); appearance: auto; transition: border-color 120ms; outline: none; }
.criteria-form select:focus { border-color: var(--teal); background: var(--paper); }
.criteria-form select:disabled { opacity: 0.5; cursor: not-allowed; }
.criteria-form input[type="file"] { width: 100%; padding: 8px 10px; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--soft); color: var(--muted); font-family: inherit; font-size: 0.78rem; }
.criteria-form small { color: var(--muted); font-size: 0.72rem; line-height: 1.35; }
.run-history-panel { margin-top: 12px; }
.boundary-note { font-family: 'Lora', Georgia, serif; font-size: 0.78rem; color: var(--muted); line-height: 1.65; padding: 14px 16px; border-radius: var(--radius); background: var(--soft); border-left: 3px solid var(--teal-dim); }

.ws-main { padding: 24px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.ws-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.ws-card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.ws-card-title { font-size: 0.95rem; font-weight: 600; color: var(--ink); margin: 0; }
.ws-card-eyebrow { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--teal); margin-bottom: 3px; }
.ws-card-body { padding: 20px 24px; }
.results-card-body { padding-top: 12px; }

.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.upload-card { display: grid; grid-template-rows: 1fr auto; min-width: 0; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--soft); transition: border-color 160ms, background 160ms; overflow: hidden; }
.upload-card:hover { border-color: var(--teal); background: #f0faf7; }
.upload-card.valid { border-style: solid; border-color: rgba(31, 107, 91, 0.58); background: #f2faf7; }
.upload-card.invalid { border-color: rgba(156, 53, 45, 0.7); background: #fff7f5; }
.upload-target { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 20px 12px 14px; border: 0; border-radius: 0; background: transparent; cursor: pointer; text-align: center; transition: background 160ms; min-height: 100px; }
.upload-target:hover { border-color: var(--teal); background: #f0faf7; }
.upload-target input[type="file"] { display: none; }
.upload-kicker { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); }
.upload-target strong { font-size: 0.82rem; font-weight: 600; color: var(--ink); line-height: 1.35; }
.upload-meta { font-size: 0.72rem; color: var(--muted); line-height: 1.4; }
.upload-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border-top: 1px solid var(--line); background: var(--line); }
.upload-action { justify-content: center; min-height: 34px; padding: 7px 6px; border: 0; border-radius: 0; background: var(--panel); font-size: 0.75rem; }
.upload-action:disabled { cursor: not-allowed; opacity: 0.45; }

.preflight-summary { font-size: 0.82rem; color: var(--muted); min-height: 1.4em; line-height: 1.5; margin-bottom: 4px; }
.preflight-details { font-size: 0.82rem; color: var(--ink); line-height: 1.55; margin-bottom: 12px; }
.upload-requirements-link { margin: 6px 0 4px; font-size: 0.8rem; line-height: 1.5; }
.upload-requirements-link a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.upload-requirements-link a:hover { color: var(--accent); }

.action-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.action-row.compact-actions { gap: 6px; }
.primary-action { padding: 9px 20px; border: none; border-radius: var(--radius); background: var(--accent-strong); color: #fff; font-family: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: background 120ms; }
.primary-action:hover { background: var(--accent); }
.secondary-action { padding: 8px 16px; border: 1.5px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--muted); font-family: inherit; font-size: 0.82rem; font-weight: 500; cursor: pointer; transition: border-color 120ms, color 120ms; text-decoration: none; display: inline-flex; align-items: center; }
.secondary-action:hover { border-color: var(--accent); color: var(--accent); }
.secondary-action.disabled, .secondary-action[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.upload-actions .upload-action { justify-content: center; min-height: 34px; padding: 7px 6px; border: 0; border-radius: 0; font-size: 0.75rem; }
.upload-actions .secondary-action.upload-action { background: var(--panel); }
.upload-actions .primary-action.upload-action { border-radius: 0; }
.upload-actions .primary-action.upload-action:disabled { background: var(--panel); color: var(--muted); }

.summary-strip { font-size: 0.82rem; color: var(--muted); min-height: 1.4em; line-height: 1.5; padding: 12px 24px 0; }
.result-mode { display: flex; border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--soft); }
.mode-tab { padding: 7px 16px; border: none; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-family: inherit; font-size: 0.82rem; font-weight: 500; cursor: pointer; transition: background 120ms, color 120ms; white-space: nowrap; }
.mode-tab:last-child { border-right: none; }
.mode-tab:hover { background: var(--panel); color: var(--ink); }
.mode-tab.active, .mode-tab[aria-selected="true"] { background: var(--panel); color: var(--accent-strong); font-weight: 600; box-shadow: inset 0 -2px 0 var(--teal); }
.result-view { display: none; }
.result-view.active { display: block; }

.export-panel { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--soft); flex-wrap: wrap; }
.export-copy strong { display: block; font-size: 0.88rem; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.export-copy p { font-family: 'Lora', Georgia, serif; font-size: 0.78rem; color: var(--muted); line-height: 1.5; max-width: 360px; }
.export-metrics { font-size: 0.78rem; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.export-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex-shrink: 0; }
.run-audit-panel { padding: 16px 24px; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--muted); }

@media (max-width: 900px) {
  .ws-shell { grid-template-columns: 1fr; }
  .ws-sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .upload-grid { grid-template-columns: 1fr; }
}
