:root {
  color-scheme: light;
  --color-background: #ffffff;
  --color-canvas: #ffffff;
  --color-surface: #f2f0eb;
  --color-surface-low: #faf9f6;
  --color-surface-mid: #d9d9d9;
  --color-surface-strong: #bcbcbc;
  --color-ink: #141413;
  --color-muted: #707070;
  --color-border: #d9d9d9;
  --color-primary: #027e6f;
  --color-primary-hover: #016a5e;
  --color-on-primary: #ffffff;
  --color-flow: #ffbf47;
  --color-flow-soft: #ffe6c9;
  --color-flow-ink: #7a3500;
  --color-data: #027e6f;
  --font-sans: Inter, "Segoe UI Variable", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --text-caption: 0.75rem;
  --text-label: 0.875rem;
  --text-body: 1rem;
  --text-lead: 1.125rem;
  --text-section: clamp(1.625rem, 2vw, 2rem);
  --text-page: clamp(2rem, 3vw, 2.75rem);
  --text-display: clamp(2.75rem, 4.4vw, 4.5rem);
  --space-1: 4px;
  --space-xs: 8px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --radius-md: 8px;
  --radius-control: 6px;
  --radius-card: 8px;
  --radius-pill: 9999px;
  font-family: var(--font-sans);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--color-background); }
body { margin: 0; color: var(--color-ink); background: var(--color-background); font-size: var(--text-body); font-weight: 400; line-height: 1.6; text-rendering: optimizeLegibility; animation: page-in 140ms ease-out both; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, p { margin-top: 0; }
h1, h2 { color: var(--color-ink); font-feature-settings: "lnum" 1, "locl" 1; }
h1 { margin-bottom: var(--space-3); font-size: var(--text-display); font-weight: 600; line-height: 1.08; letter-spacing: -0.035em; }
h2 { margin-bottom: var(--space-2); font-size: var(--text-section); font-weight: 600; line-height: 1.25; letter-spacing: -0.025em; }

:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }
[hidden] { display: none !important; }
::selection { color: var(--color-ink); background: var(--color-flow); }
.mono, output, .brand__mark { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted, .fine-print, .field-hint, .refresh-note { color: var(--color-muted); }
.eyebrow { margin-bottom: var(--space-2); color: var(--color-data); font-family: var(--font-mono); font-size: var(--text-caption); font-weight: 600; line-height: 1.4; letter-spacing: 0.08em; text-transform: uppercase; }

.brand { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--color-ink); font-weight: 600; letter-spacing: -0.01em; text-decoration: none; }
.brand--light { color: var(--color-ink); }
.brand__mark { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--color-primary); border-radius: var(--radius-md); color: var(--color-primary); background: var(--color-background); font-size: var(--text-caption); font-weight: 600; letter-spacing: 0.08em; }
.brand__wordmark { white-space: nowrap; }

.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border: 1px solid var(--color-primary); border-radius: var(--radius-pill); padding: 10px 20px; cursor: pointer; font-size: var(--text-label); font-weight: 500; line-height: 1.4; text-decoration: none; transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, transform 100ms ease; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; border-color: var(--color-surface-strong); color: var(--color-muted); background: var(--color-surface-mid); opacity: 0.72; }
.button--primary { color: var(--color-on-primary); background: var(--color-primary); }
.button--quiet { border-color: var(--color-border); color: var(--color-ink); background: var(--color-background); }
.button--wide { width: 100%; }

@media (hover: hover) {
  .button--primary:hover:not(:disabled) { background: var(--color-primary-hover); }
  .button--quiet:hover:not(:disabled) { border-color: var(--color-ink); background: var(--color-surface-low); }
  .text-link:hover, .site-footer a:hover { color: var(--color-data); }
}

.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1.12fr) minmax(390px, 0.88fr); }
.login-story { position: relative; display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; overflow: hidden; padding: clamp(32px, 5vw, 72px); color: var(--color-ink); background: var(--color-surface); }
.login-story::before { position: absolute; top: 0; right: clamp(84px, 14vw, 220px); width: 1px; height: 100%; background: var(--color-surface-strong); content: ""; }
.login-story::after { position: absolute; right: clamp(80px, 13.8vw, 216px); bottom: clamp(56px, 11vh, 128px); width: 9px; height: clamp(80px, 11vh, 116px); background: var(--color-flow); content: ""; }
.login-story h1 { max-width: 900px; color: var(--color-ink); }
.story-meta { position: absolute; top: clamp(34px, 5vw, 74px); right: clamp(32px, 5vw, 72px); display: grid; gap: var(--space-1); color: var(--color-muted); font-size: var(--text-caption); line-height: 1.5; letter-spacing: 0.08em; text-align: right; }
.story-copy { position: relative; z-index: 1; max-width: 920px; margin: auto 0; padding: var(--space-8) 0; }
.story-copy .eyebrow { color: var(--color-data); }
.story-lede { max-width: 660px; margin: var(--space-5) 0 0; color: #474543; font-size: var(--text-lead); line-height: 1.7; }
.auth-panel { display: grid; place-items: center; padding: clamp(24px, 5vw, 72px); background: var(--color-background); }
.auth-card { width: min(100%, 440px); border: 1px solid var(--color-border); border-top: 4px solid var(--color-flow); border-radius: var(--radius-card); padding: clamp(32px, 4vw, 48px); background: var(--color-background); box-shadow: 0 12px 24px -5px rgba(20, 20, 19, 0.06), 0 5px 10px -6px rgba(20, 20, 19, 0.06); }
.auth-card__meta { display: flex; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-7); padding-bottom: var(--space-3); border-bottom: 1px solid var(--color-border); color: var(--color-muted); font-size: var(--text-caption); line-height: 1.4; letter-spacing: 0.08em; }
.auth-card__heading { max-width: 340px; }
.auth-card form { display: grid; gap: var(--space-2); margin-top: var(--space-6); }
.auth-card form .button { margin-top: var(--space-3); }
.fine-print { margin: var(--space-5) 0 0; font-size: var(--text-caption); line-height: 1.6; }

label, legend { font-size: var(--text-label); font-weight: 500; line-height: 1.4; }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid var(--color-surface-strong); border-radius: var(--radius-control); padding: 10px var(--space-4); color: var(--color-ink); background: var(--color-background); line-height: 1.5; transition: border-color 140ms ease, background-color 140ms ease; }
input::placeholder, textarea::placeholder { color: var(--color-muted); }
input:hover, select:hover, textarea:hover { border-color: var(--color-muted); }
input:focus, select:focus, textarea:focus { border-color: var(--color-primary); outline: 3px solid var(--color-flow); outline-offset: 1px; }
input:disabled, select:disabled, textarea:disabled { color: var(--color-muted); background: var(--color-surface-low); cursor: not-allowed; }
textarea { resize: vertical; }
input[type="file"] { padding: 6px; font-size: var(--text-label); }
input[type="file"]::file-selector-button { min-height: 30px; margin-right: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-pill); padding: 5px 12px; color: var(--color-ink); background: var(--color-surface-low); font-weight: 500; cursor: pointer; }

.mission-track { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; padding: 0; list-style: none; counter-reset: mission; }
.mission-track li { position: relative; min-width: 0; padding: var(--space-4) var(--space-3) 0 0; border-top: 1px solid var(--color-surface-strong); color: #545454; font-size: var(--text-caption); line-height: 1.5; counter-increment: mission; }
.mission-track li::before { display: block; margin-bottom: var(--space-1); color: var(--color-ink); font-family: var(--font-mono); font-weight: 500; content: "0" counter(mission); }
.mission-track li::after { position: absolute; top: -4px; left: 0; width: 7px; height: 7px; border: 1px solid currentColor; background: var(--color-background); content: ""; }
.mission-track--compact { margin: var(--space-5) 0 var(--space-6); }
.mission-track--compact li { border-color: var(--color-border); color: var(--color-muted); }
.mission-track--compact li::before { color: var(--color-ink); }
.mission-track--compact li::after { background: var(--color-background); }
.mission-track--compact li.is-current { border-color: var(--color-flow-ink); color: var(--color-ink); font-weight: 500; }
.mission-track--compact li.is-current::before { color: var(--color-flow-ink); }
.mission-track--compact li.is-current::after { width: 9px; height: 9px; top: -5px; border-color: var(--color-flow-ink); background: var(--color-flow); }

.site-header { position: sticky; top: 0; z-index: 10; display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: var(--space-5); padding: var(--space-3) clamp(20px, 4vw, 56px); border-bottom: 1px solid var(--color-border); background: rgba(255, 255, 255, 0.96); box-shadow: 0 4px 4px rgba(20, 20, 19, 0.03); }
.header-actions, .report-header-actions { display: flex; align-items: center; gap: var(--space-3); }
.header-context, .report-mode { color: var(--color-muted); font-size: var(--text-caption); line-height: 1.4; letter-spacing: 0.08em; }
.header-context { padding-right: var(--space-3); border-right: 1px solid var(--color-border); }
.user-label { max-width: 260px; overflow: hidden; color: var(--color-muted); font-size: var(--text-label); text-overflow: ellipsis; white-space: nowrap; }
.site-footer { display: flex; justify-content: space-between; gap: var(--space-5); padding: var(--space-5) clamp(20px, 4vw, 56px); border-top: 1px solid var(--color-border); color: var(--color-muted); background: var(--color-background); font-size: var(--text-caption); line-height: 1.5; }
.site-footer a { text-underline-offset: 3px; }

.tool-shell { display: grid; width: min(1280px, calc(100% - 48px)); min-height: calc(100vh - 68px); margin: 0 auto; padding: var(--space-7) 0 var(--space-8); gap: var(--space-7); }
.task-submit-card { border: 1px solid var(--color-border); border-top: 4px solid var(--color-flow); border-radius: var(--radius-card); padding: var(--space-6); background: var(--color-background); box-shadow: 0 12px 24px -5px rgba(20, 20, 19, 0.06), 0 5px 10px -6px rgba(20, 20, 19, 0.06); }
.task-submit-card__heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--space-7); margin-bottom: var(--space-5); padding-bottom: var(--space-5); border-bottom: 1px solid var(--color-border); }
.task-submit-card__heading h1 { margin-bottom: var(--space-2); font-size: var(--text-page); line-height: 1.08; letter-spacing: -0.035em; }
.task-submit-card__heading p:last-child { margin-bottom: 0; color: var(--color-muted); }
.contract-strip { display: grid; min-width: 318px; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; border: 1px solid var(--color-border); border-radius: var(--radius-md); list-style: none; background: var(--color-surface); }
.contract-strip li { display: grid; gap: 2px; padding: 10px var(--space-3); border-left: 1px solid var(--color-border); }
.contract-strip li:first-child { border-left: 0; }
.contract-strip strong { color: var(--color-ink); font-family: var(--font-mono); font-size: var(--text-label); font-weight: 600; }
.contract-strip span { color: var(--color-muted); font-size: var(--text-caption); line-height: 1.4; }
.task-input-stack { display: grid; gap: var(--space-5); }
.task-mode-field { min-width: 0; margin: 0; border: 0; padding: 0; }
.task-mode-field legend { margin-bottom: var(--space-2); font-weight: 600; }
.task-mode-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.task-mode-option { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); align-items: start; min-height: 76px; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-3); background: var(--color-background); cursor: pointer; }
.task-mode-option:has(input:checked) { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); background: var(--color-surface-low); }
.task-mode-option input[type="radio"] { width: 18px; min-height: 18px; height: 18px; margin: 4px 0 0; border: 0; padding: 0; accent-color: var(--color-primary); }
.task-mode-option strong, .task-mode-option small { display: block; }
.task-mode-option small { margin-top: 3px; color: var(--color-muted); line-height: 1.45; }
.asin-list-field { min-width: 0; margin: 0; border: 0; padding: 0; }
.asin-list-heading { display: flex; justify-content: space-between; gap: var(--space-4); align-items: end; margin-bottom: var(--space-3); }
.asin-list-title { display: block; font-size: var(--text-label); font-weight: 600; }
.asin-list-actions { display: flex; gap: var(--space-2); align-items: center; }
.asin-add-button { flex: 0 0 auto; }
.asin-list { display: grid; gap: var(--space-2); }
.competitor-list { display: grid; gap: var(--space-2); }
[data-comparison-only][hidden] { display: none !important; }
.asin-entry { display: grid; grid-template-columns: 74px minmax(180px, 1fr) auto; gap: var(--space-3); align-items: center; min-height: 58px; border: 1px solid var(--color-border); border-left: 4px solid var(--color-data); border-radius: var(--radius-md); padding: 7px 9px; background: var(--color-background); }
.asin-entry--own { border-left-color: var(--color-primary); background: var(--color-surface-low); }
.asin-role { display: inline-flex; min-height: 30px; align-items: center; justify-content: center; border-radius: var(--radius-pill); padding: 4px 10px; color: var(--color-data); background: #e7f6f1; font-family: var(--font-mono); font-size: var(--text-caption); font-weight: 600; }
.asin-role--self { color: var(--color-on-primary); background: var(--color-primary); }
.asin-entry-note { padding-right: var(--space-2); color: var(--color-muted); font-size: var(--text-caption); white-space: nowrap; }
.competitor-progress { border-radius: var(--radius-pill); padding: 5px 9px; color: #8a570b; background: #fff1df; font-size: var(--text-caption); font-weight: 600; white-space: nowrap; }
.competitor-progress.is-ready { color: var(--color-data); background: #e7f6f1; }
.asin-remove-button { min-height: 36px; border: 0; padding: 4px 9px; color: var(--color-muted); background: transparent; font-size: var(--text-caption); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.asin-remove-button:hover { color: var(--color-ink); }
.asin-remove-button:disabled { color: var(--color-surface-strong); cursor: not-allowed; text-decoration: none; }
.optional-label { margin-left: 4px; color: var(--color-muted); font-size: var(--text-caption); font-weight: 400; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.task-primary-grid { display: grid; grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.7fr) auto; align-items: start; gap: var(--space-4); }
.task-primary-action { min-width: 120px; margin-top: 27px; }
.task-board { min-width: 0; overflow: hidden; }
.field { display: grid; align-content: start; gap: 6px; }
.field-hint { font-size: var(--text-caption); line-height: 1.5; }
.notice { margin-top: var(--space-4); border: 1px solid var(--color-border); border-left: 4px solid var(--color-data); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); color: var(--color-ink); background: var(--color-surface-low); font-size: var(--text-label); line-height: 1.55; white-space: pre-wrap; }
.notice[data-tone="success"] { border-left-color: var(--color-data); }
.notice[data-tone="warning"], .notice[data-tone="error"] { border-left-color: var(--color-flow-ink); background: var(--color-flow-soft); }

.board-topline { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-5); }
.board-topline h2 { margin: 0; }
.task-board > .mission-track { margin: var(--space-5) 0; }
.task-table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: var(--color-background); box-shadow: 0 5px 10px -6px rgba(20, 20, 19, 0.06); }
.task-table { width: 100%; min-width: 880px; border-collapse: collapse; font-size: var(--text-label); line-height: 1.5; }
.task-table th { position: sticky; top: 0; padding: var(--space-3) var(--space-4); color: var(--color-muted); background: var(--color-surface-low); font-family: var(--font-mono); font-size: var(--text-caption); font-weight: 500; line-height: 1.4; letter-spacing: 0.025em; text-align: left; white-space: nowrap; }
.task-table td { max-width: 260px; padding: var(--space-4); border-top: 1px solid var(--color-border); vertical-align: top; }
.task-table th:nth-child(1) { width: 170px; }
.task-table th:nth-child(2) { width: 190px; }
.task-table th:nth-child(3) { width: 110px; }
.task-table th:nth-child(5) { width: 130px; }
.empty-cell { padding: var(--space-7) var(--space-5) !important; color: var(--color-muted); text-align: center; }
.task-identity, .task-metadata { display: block; }
.task-identity { color: var(--color-ink); font-size: var(--text-label); }
.task-metadata { margin-top: var(--space-1); color: var(--color-muted); font-size: var(--text-caption); }
.status { display: inline-flex; min-height: 26px; align-items: center; border: 1px solid transparent; border-radius: var(--radius-pill); padding: var(--space-1) 10px; font-size: var(--text-caption); font-weight: 500; white-space: nowrap; }
.status--success { border-color: var(--color-data); color: var(--color-data); background: var(--color-background); }
.status--error, .status--active { border-color: var(--color-flow-ink); color: var(--color-flow-ink); background: var(--color-flow-soft); }
.status--pending { border-color: var(--color-border); color: var(--color-muted); background: var(--color-surface-low); }
.failure-details summary { color: var(--color-flow-ink); cursor: pointer; font-weight: 500; }
.failure-details p { max-width: 420px; margin: var(--space-2) 0 0; color: var(--color-muted); font-size: var(--text-caption); line-height: 1.5; }
.task-report-link { min-height: 36px; padding: 7px var(--space-3); white-space: nowrap; }
.text-link { color: var(--color-data); font-weight: 500; text-underline-offset: 3px; }
.refresh-note { margin: var(--space-3) 0 0; font-size: var(--text-caption); line-height: 1.5; text-align: right; }

@media (hover: hover) {
  .task-table tbody tr:hover { background: var(--color-surface); }
}

body[data-page="report"] { min-height: 100vh; overflow-x: hidden; }
body[data-page="report"] .site-header { min-height: 60px; padding-block: var(--space-2); }
.site-header--report { border-bottom-color: var(--color-border); }
.report-shell { width: min(1920px, calc(100% - 24px)); min-height: calc(100vh - 60px); margin: 0 auto; padding: var(--space-2) 0 var(--space-4); }
.report-frame-wrap { position: relative; height: max(760px, calc(100vh - 84px)); overflow: hidden; border: 1px solid var(--color-border); border-top-color: var(--color-primary); border-radius: var(--radius-card); background: var(--color-background); box-shadow: 0 12px 24px -5px rgba(20, 20, 19, 0.06); }
.report-frame-wrap::before { position: absolute; z-index: 1; top: 0; left: 0; width: 64px; height: 3px; background: var(--color-flow); content: ""; pointer-events: none; }
#report-frame { width: 100%; height: 100%; border: 0; }

@media (max-width: 1120px) {
  .tool-shell { width: min(100% - 40px, 1280px); }
  .task-primary-grid { grid-template-columns: minmax(200px, 0.8fr) minmax(320px, 1.5fr) auto; }
}

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-story { min-height: 56vh; }
  .auth-panel { min-height: 44vh; }
  .task-primary-grid { grid-template-columns: 1fr 1.45fr; }
  .task-primary-action { grid-column: 1 / -1; width: 100%; margin-top: 0; }
}

@media (max-width: 820px) {
  .header-context { display: none; }
  .task-submit-card__heading { grid-template-columns: 1fr; gap: var(--space-4); }
  .contract-strip { width: 100%; min-width: 0; }
}

@media (max-width: 640px) {
  h1 { letter-spacing: -0.035em; }
  .site-header { min-height: 64px; padding: 10px var(--space-4); }
  .brand__wordmark, .user-label, .report-mode { display: none; }
  .header-actions, .report-header-actions { gap: var(--space-2); }
  .button { min-height: 44px; }
  .login-story { min-height: 60vh; padding: var(--space-5); }
  .login-story::before { right: 52px; }
  .login-story::after { right: 48px; bottom: var(--space-7); height: 72px; }
  .story-meta { top: var(--space-6); right: var(--space-5); }
  .story-copy { padding: var(--space-7) 0; }
  .auth-panel { padding: var(--space-5) var(--space-4) var(--space-7); }
  .auth-card { padding: var(--space-5) var(--space-4); }
  .auth-card__meta { margin-bottom: var(--space-6); }
  .mission-track { grid-template-columns: repeat(5, minmax(0, 1fr)); padding-top: var(--space-1); }
  .mission-track li { padding-right: var(--space-1); }
  .tool-shell { width: calc(100% - 32px); padding: var(--space-6) 0 var(--space-7); gap: var(--space-6); }
  .task-submit-card { padding: var(--space-4); }
  .task-mode-options { grid-template-columns: 1fr; }
  .asin-list-heading { align-items: stretch; flex-direction: column; }
  .asin-list-actions { align-items: stretch; flex-direction: column; }
  .asin-add-button { width: 100%; }
  .asin-entry { grid-template-columns: 64px minmax(0, 1fr); gap: var(--space-2); }
  .asin-entry-note, .asin-remove-button { grid-column: 2; justify-self: start; }
  .task-primary-grid { grid-template-columns: 1fr; }
  .task-primary-action { grid-column: auto; }
  .board-topline { align-items: center; }
  .report-shell { width: calc(100% - 20px); padding: var(--space-2) 0 var(--space-4); }
  .report-frame-wrap { height: max(700px, calc(100vh - 92px)); border-radius: var(--radius-md); }
  .site-footer { align-items: flex-start; flex-direction: column; gap: var(--space-2); padding: var(--space-5) var(--space-4); }
}

@media (max-width: 400px) {
  .tool-shell { width: calc(100% - 24px); }
  .auth-panel { padding-inline: var(--space-3); }
  .auth-card { padding-inline: var(--space-4); }
  .report-shell { width: calc(100% - 16px); }
}

@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

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

/* Login-only visual refresh based on the supplied warm flight-control reference. */
body[data-page="login"] {
  background: #f4f1e8;
}

body[data-page="login"] .login-shell {
  position: relative;
  min-height: calc(100vh - 66px);
  grid-template-columns: minmax(0, 1.18fr) minmax(390px, 0.82fr);
  align-items: center;
  gap: clamp(40px, 6vw, 104px);
  overflow: hidden;
  padding: 104px 5vw 56px;
  background: #f4f1e8;
}

body[data-page="login"] .login-shell::before,
body[data-page="login"] .login-shell::after {
  position: absolute;
  right: 5vw;
  left: 5vw;
  height: 1px;
  background: #d9d8d1;
  content: "";
  pointer-events: none;
}

body[data-page="login"] .login-shell::before { top: 24%; }
body[data-page="login"] .login-shell::after { bottom: 18%; }

body[data-page="login"] .login-story {
  position: relative;
  z-index: 1;
  min-height: 760px;
  overflow: visible;
  padding: 0;
  color: #141a17;
  background: transparent;
}

body[data-page="login"] .login-story::before {
  top: -24px;
  right: -3vw;
  bottom: -24px;
  width: 1px;
  height: auto;
  background: #d9d8d1;
}

body[data-page="login"] .login-story::after { display: none; }

body[data-page="login"] .brand--light {
  position: absolute;
  top: -70px;
  left: 0;
  z-index: 2;
  color: #141a17;
  font-weight: 700;
}

body[data-page="login"] .brand__mark {
  width: 38px;
  height: 38px;
  border-color: #141a17;
  border-radius: 11px;
  color: #141a17;
  background: #fcfbf7;
  font-size: 0.6875rem;
  font-weight: 700;
}

body[data-page="login"] .story-meta {
  top: -64px;
  right: 0;
  color: #59625d;
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.1em;
}

body[data-page="login"] .flight-visual {
  position: absolute;
  z-index: 1;
  top: -18px;
  left: 50%;
  width: min(54%, 460px);
  aspect-ratio: 1;
  margin: 0;
  transform: translateX(-50%);
  pointer-events: none;
}

body[data-page="login"] .balloon-wrap {
  --balloon-scale: 1;
  position: absolute;
  z-index: 2;
  top: 45%;
  left: 50%;
  display: block;
  width: 250px;
  height: 390px;
  filter: drop-shadow(0 24px 28px rgba(22, 49, 41, 0.1));
  animation: login-balloon-float 5.2s ease-in-out infinite;
}

body[data-page="login"] .balloon {
  position: absolute;
  top: 0;
  left: 25px;
  width: 200px;
  height: 240px;
  overflow: hidden;
  border: 2px solid #141a17;
  border-radius: 52% 52% 45% 45%;
  background: linear-gradient(90deg, #0b8f7b 0 29%, #e7f4f0 29% 45%, #ffb62f 45% 61%, #e7f4f0 61% 77%, #0b8f7b 77% 100%);
}

body[data-page="login"] .balloon::before {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.45), transparent 25%);
  content: "";
}

body[data-page="login"] .balloon::after {
  position: absolute;
  bottom: -18px;
  left: 50%;
  width: 76px;
  height: 38px;
  background: #141a17;
  clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
  content: "";
  transform: translateX(-50%);
}

body[data-page="login"] .balloon-rope {
  position: absolute;
  top: 223px;
  width: 2px;
  height: 91px;
  background: #141a17;
  transform-origin: top;
}

body[data-page="login"] .balloon-rope--left { left: 77px; transform: rotate(7deg); }
body[data-page="login"] .balloon-rope--right { right: 77px; transform: rotate(-7deg); }

body[data-page="login"] .balloon-basket {
  position: absolute;
  top: 301px;
  left: 82px;
  width: 86px;
  height: 68px;
  border: 2px solid #141a17;
  border-radius: 10px 10px 20px 20px;
  background: #b88955;
}

body[data-page="login"] .balloon-basket::before {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(20, 26, 23, 0.35);
  border-radius: 7px 7px 12px 12px;
  content: "";
}

body[data-page="login"] .balloon-pilot {
  position: absolute;
  top: 266px;
  left: 99px;
  z-index: 1;
  width: 54px;
  height: 64px;
}

body[data-page="login"] .balloon-pilot__head {
  position: absolute;
  top: 0;
  left: 7px;
  width: 40px;
  height: 40px;
  border: 2px solid #141a17;
  border-radius: 48%;
  background: #f0cfb0;
}

body[data-page="login"] .balloon-pilot__head::before {
  position: absolute;
  top: 17px;
  left: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #141a17;
  box-shadow: 17px 0 0 #141a17;
  content: "";
}

body[data-page="login"] .balloon-pilot__head::after {
  position: absolute;
  top: 27px;
  left: 13px;
  width: 12px;
  height: 6px;
  border-bottom: 2px solid #141a17;
  border-radius: 50%;
  content: "";
}

body[data-page="login"] .balloon-pilot__cap {
  position: absolute;
  top: -3px;
  left: 5px;
  width: 43px;
  height: 19px;
  border: 2px solid #141a17;
  border-radius: 30px 30px 8px 8px;
  background: #0b8f7b;
}

body[data-page="login"] .balloon-pilot__body {
  position: absolute;
  top: 36px;
  left: 11px;
  width: 34px;
  height: 28px;
  border: 2px solid #141a17;
  border-radius: 10px 10px 6px 6px;
  background: #f7f4ea;
}

body[data-page="login"] .flight-tag,
body[data-page="login"] .flight-good-word,
body[data-page="login"] .flight-sandbag {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #b8c3bd;
  border-radius: var(--radius-pill);
  padding: 8px 11px;
  color: #2b342f;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(17, 22, 20, 0.06);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.025em;
  white-space: nowrap;
  animation: login-signal-float 4s ease-in-out infinite;
}

body[data-page="login"] .flight-tag--main { top: 12%; left: -2%; }
body[data-page="login"] .flight-tag--rank { top: 20%; right: -4%; animation-delay: -1.2s; }
body[data-page="login"] .flight-tag--cvr { top: 48%; left: -4%; animation-delay: -2.2s; }
body[data-page="login"] .flight-tag--tail { right: -3%; bottom: 14%; animation-delay: -3s; }

body[data-page="login"] .flight-good-word {
  top: 17%;
  left: 54%;
  border-color: #a9d8cb;
  color: #086b5c;
  background: #eefbf7;
  animation: login-good-word-rise 4.8s ease-in-out infinite;
}

body[data-page="login"] .flight-sandbag {
  z-index: 1;
  border-color: #b9a786;
  border-radius: 10px;
  color: #463d30;
  background: #e6d4ae;
  font-size: 0.625rem;
  animation: login-sandbag-drop 5.5s ease-in infinite;
}

body[data-page="login"] .flight-sandbag--acos { bottom: 11%; left: 12%; }
body[data-page="login"] .flight-sandbag--cvr { right: 10%; bottom: 9%; animation-delay: -2.7s; }

@keyframes login-balloon-float {
  0%, 100% { transform: translate(-50%, -50%) scale(var(--balloon-scale)) translateY(0) rotate(-1deg); }
  50% { transform: translate(-50%, -50%) scale(var(--balloon-scale)) translateY(-18px) rotate(1.2deg); }
}

@keyframes login-signal-float {
  50% { transform: translateY(-9px); }
}

@keyframes login-good-word-rise {
  0% { opacity: 0; transform: translateY(34px); }
  22%, 74% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-58px); }
}

@keyframes login-sandbag-drop {
  0%, 8% { opacity: 0; transform: translateY(0) rotate(0); }
  18%, 72% { opacity: 1; }
  100% { opacity: 0; transform: translateY(92px) rotate(6deg); }
}

body[data-page="login"] .story-copy {
  z-index: 2;
  max-width: 780px;
  margin: auto 0 0;
  padding: 0 0 28px;
}

body[data-page="login"] .story-copy .eyebrow {
  margin-bottom: 16px;
  color: #0b8f7b;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

body[data-page="login"] .login-story h1 {
  max-width: 760px;
  margin-bottom: 0;
  color: #141a17;
  font-size: clamp(3rem, 4.2vw, 4.25rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

body[data-page="login"] .story-lede {
  max-width: 640px;
  margin-top: 26px;
  color: #5f6963;
  font-size: 1rem;
  line-height: 1.8;
}

body[data-page="login"] .flight-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-top: 26px;
  color: #65706a;
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.07em;
}

body[data-page="login"] .flight-signals span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body[data-page="login"] .flight-signals span::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffb62f;
  content: "";
}

body[data-page="login"] .mission-track--hero {
  align-self: end;
  width: 100%;
}

body[data-page="login"] .mission-track--hero li {
  border-top-color: #b8c3bd;
  color: #59625d;
  font-size: 0.75rem;
  line-height: 1.55;
}

body[data-page="login"] .mission-track--hero li::before { color: #141a17; }
body[data-page="login"] .mission-track--hero li::after { border-color: #0b8f7b; background: #f4f1e8; }

body[data-page="login"] .auth-panel {
  position: relative;
  z-index: 2;
  justify-items: end;
  padding: 0;
  background: transparent;
}

body[data-page="login"] .auth-card {
  width: min(100%, 430px);
  border: 1px solid rgba(20, 26, 23, 0.09);
  border-top: 3px solid #0b8f7b;
  border-radius: 26px;
  padding: 34px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 80px rgba(20, 26, 23, 0.13);
}

body[data-page="login"] .auth-card__meta {
  margin-bottom: 30px;
  padding-bottom: 0;
  border-bottom: 0;
  color: #748078;
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.11em;
}

body[data-page="login"] .auth-card__heading { max-width: 350px; }

body[data-page="login"] .auth-card__heading .eyebrow {
  margin-bottom: 10px;
  color: #0b8f7b;
}

body[data-page="login"] .auth-card h2 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 2.4vw, 2.125rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

body[data-page="login"] .auth-card form {
  gap: 8px;
  margin-top: 28px;
}

body[data-page="login"] .auth-card label {
  margin-top: 8px;
  color: #2b342f;
  font-size: 0.875rem;
  font-weight: 600;
}

body[data-page="login"] .auth-card input {
  min-height: 50px;
  border-color: #cdd2ce;
  border-radius: 11px;
  background: #ffffff;
}

body[data-page="login"] .auth-card input:focus {
  border-color: #0b8f7b;
  outline: 4px solid rgba(11, 143, 123, 0.09);
  outline-offset: 0;
}

body[data-page="login"] .auth-card form .button {
  min-height: 52px;
  margin-top: 20px;
  border-color: #0b8f7b;
  background: #0b8f7b;
  font-weight: 600;
}

body[data-page="login"] .flight-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 24px;
}

body[data-page="login"] .flight-stat {
  min-width: 0;
  border: 1px solid #e0e1dc;
  border-radius: 14px;
  padding: 12px 10px;
  background: #fafaf7;
}

body[data-page="login"] .flight-stat span {
  display: block;
  overflow: hidden;
  color: #747d78;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="login"] .flight-stat strong {
  display: block;
  margin-top: 5px;
  color: #141a17;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
}

body[data-page="login"] .flight-stat--good strong { color: #0b8f7b; }
body[data-page="login"] .flight-stat--warn strong { color: #a96500; }

body[data-page="login"] .fine-print {
  margin-top: 18px;
  color: #6f7872;
  font-size: 0.75rem;
  line-height: 1.7;
}

body[data-page="login"] + .site-footer,
body[data-page="login"] .site-footer {
  border-top-color: #d9d8d1;
  background: #f4f1e8;
}

@media (hover: hover) {
  body[data-page="login"] .auth-card form .button:hover:not(:disabled) {
    border-color: #087a69;
    background: #087a69;
    box-shadow: 0 14px 28px rgba(11, 143, 123, 0.2);
    transform: translateY(-1px);
  }
}

@media (max-width: 980px) {
  body[data-page="login"] .login-shell {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 100px 24px 54px;
  }

  body[data-page="login"] .login-story {
    min-height: 820px;
  }

  body[data-page="login"] .login-story::before { display: none; }
  body[data-page="login"] .flight-visual { top: 0; width: min(62vw, 450px); }
  body[data-page="login"] .story-copy { padding: 490px 0 36px; }
  body[data-page="login"] .login-story h1 { font-size: clamp(3rem, 7vw, 4rem); }
  body[data-page="login"] .auth-panel { justify-items: center; }
  body[data-page="login"] .auth-card { width: min(100%, 560px); }
}

@media (max-width: 640px) {
  body[data-page="login"] .login-shell {
    padding: 88px 16px 40px;
  }

  body[data-page="login"] .login-shell::before,
  body[data-page="login"] .login-shell::after { right: 16px; left: 16px; }

  body[data-page="login"] .login-story {
    min-height: 740px;
  }

  body[data-page="login"] .brand--light { top: -64px; }
  body[data-page="login"] .story-meta { top: -59px; }
  body[data-page="login"] .flight-visual { top: -8px; width: min(94vw, 390px); }
  body[data-page="login"] .balloon-wrap { --balloon-scale: 0.86; }
  body[data-page="login"] .flight-tag,
  body[data-page="login"] .flight-good-word,
  body[data-page="login"] .flight-sandbag {
    padding: 7px 9px;
    font-size: 0.625rem;
  }
  body[data-page="login"] .flight-tag--main { left: 0; }
  body[data-page="login"] .flight-tag--rank { right: 0; }
  body[data-page="login"] .flight-tag--cvr { left: 0; }
  body[data-page="login"] .flight-tag--tail { right: 0; }
  body[data-page="login"] .story-copy { padding: 390px 0 28px; }

  body[data-page="login"] .login-story h1 {
    font-size: clamp(2.75rem, 13vw, 3.5rem);
    line-height: 1;
  }

  body[data-page="login"] .story-lede {
    margin-top: 22px;
    line-height: 1.7;
  }

  body[data-page="login"] .mission-track--hero li {
    padding-right: 4px;
    font-size: 0.6875rem;
  }

  body[data-page="login"] .auth-card {
    border-radius: 20px;
    padding: 28px 22px;
  }

  body[data-page="login"] .auth-card__meta { margin-bottom: 24px; }
}
