:root {
  color-scheme: light;
  --bg: #f0f6ed;
  --panel: rgba(255, 255, 255, 0.9);
  --paper: #f8fbf6;
  --ink: #1e2a22;
  --muted: #667263;
  --soft: #7f8b79;
  --line: #d7e3d2;
  --line-soft: #e6eee2;
  --accent: #537f5c;
  --accent-strong: #365d3f;
  --accent-soft: #e6f1e2;
  --teal: #5b8d64;
  --teal-soft: #e3f1df;
  --cyan: #88ad82;
  --amber: #b58a42;
  --amber-soft: #fff5dd;
  --red: #b42318;
  --red-soft: #fff1f0;
  --charcoal: #253427;
  --shadow: 0 18px 44px rgba(52, 82, 48, 0.12);
  font-family: "Inter", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(240, 246, 237, 0.5) 38%, rgba(222, 235, 217, 0.92)),
    var(--bg);
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.app-shell {
  min-height: 100vh;
  min-width: 0;
}

.product-header {
  min-height: 68px;
  padding: 0 max(22px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(83, 127, 92, 0.16);
  background: rgba(249, 252, 247, 0.9);
  backdrop-filter: blur(10px);
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--charcoal);
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(19, 32, 50, 0.18);
}

.brand h1 {
  font-size: 19px;
  line-height: 1.12;
  letter-spacing: 0;
}

.brand p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.header-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.user-badge {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid rgba(83, 127, 92, 0.16);
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 800;
}

.auth-view,
.subscription-view {
  width: min(920px, calc(100vw - 32px));
  min-height: calc(100vh - 68px);
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  place-items: center;
}

body[data-view="auth"] {
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #07090d;
  background-size: 34px 34px;
  color: #eef8f5;
}

body[data-view="auth"] .product-header {
  border-bottom-color: rgba(74, 255, 213, 0.18);
  background: rgba(7, 9, 13, 0.86);
}

body[data-view="auth"] .brand-mark {
  color: #07100e;
  background: #4affd5;
  box-shadow: 0 0 28px rgba(74, 255, 213, 0.24);
}

body[data-view="auth"] .brand h1 {
  color: #f4fffc;
}

body[data-view="auth"] .brand p {
  color: #82a7a0;
}

.auth-card {
  width: min(100%, 980px);
  min-height: 580px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.92fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(74, 255, 213, 0.22);
  border-radius: 8px;
  background: rgba(10, 14, 18, 0.94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.subscription-card {
  width: min(100%, 720px);
  border: 1px solid rgba(83, 127, 92, 0.18);
  border-radius: 8px;
  padding: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-visual {
  position: relative;
  min-width: 0;
  padding: 18px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 12px;
  border-right: 1px solid rgba(74, 255, 213, 0.16);
  background:
    linear-gradient(rgba(74, 255, 213, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 255, 213, 0.08) 1px, transparent 1px),
    #0c1116;
  background-size: 28px 28px;
}

.auth-visual::before,
.auth-visual::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74, 255, 213, 0.7), transparent);
}

.auth-visual::before {
  top: 78px;
}

.auth-visual::after {
  bottom: 92px;
}

.auth-visual-media {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #11181d;
}

.auth-visual-media img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.05);
}

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

.auth-signal-grid span,
.auth-flow span {
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(74, 255, 213, 0.2);
  border-radius: 6px;
  color: #bdfef1;
  background: rgba(8, 16, 18, 0.78);
  font-size: 12px;
  font-weight: 900;
}

.auth-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr) 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.auth-flow i {
  height: 1px;
  background: #a6ff4a;
}

.auth-console {
  min-width: 0;
  padding: 34px;
  display: grid;
  align-content: center;
}

.auth-kicker {
  color: #a6ff4a;
  font-size: 12px;
  font-weight: 900;
}

.auth-copy h2,
.subscription-card h2 {
  margin-top: 10px;
  font-size: 30px;
  line-height: 1.15;
}

.auth-copy h2 {
  color: #f3fffb;
  font-size: 34px;
}

.auth-copy p,
.subscription-card p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.65;
}

.auth-copy p {
  color: #91aaa4;
}

.auth-tabs {
  margin-top: 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-tabs button {
  min-height: 40px;
  border: 1px solid rgba(74, 255, 213, 0.18);
  border-radius: 6px;
  color: #87a49d;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 900;
}

.auth-tabs button.active {
  color: #07100e;
  background: #4affd5;
}

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

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

.auth-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-methods button,
.code-field button {
  min-height: 38px;
  border: 1px solid rgba(74, 255, 213, 0.18);
  border-radius: 6px;
  color: #87a49d;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 900;
}

.auth-methods button.active {
  color: #07100e;
  background: #a6ff4a;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: #b7cac4;
  font-size: 13px;
  font-weight: 800;
}

.auth-form input {
  min-height: 46px;
  border: 1px solid rgba(74, 255, 213, 0.18);
  border-radius: 6px;
  padding: 0 12px;
  color: #f6fffd;
  background: rgba(2, 6, 8, 0.72);
  outline: none;
}

.auth-form input:focus {
  border-color: #4affd5;
  background: rgba(2, 6, 8, 0.92);
  box-shadow: 0 0 0 3px rgba(74, 255, 213, 0.12);
}

.code-field {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 8px;
}

.code-field button {
  color: #bdfef1;
  white-space: nowrap;
}

.code-field button:disabled {
  opacity: 0.5;
}

.auth-form .primary {
  height: 46px;
  border-radius: 6px;
  color: #07100e;
  background: #4affd5;
  box-shadow: 0 0 28px rgba(74, 255, 213, 0.22);
}

.auth-console .message {
  min-height: 20px;
  margin-top: 14px;
  color: #91aaa4;
}

.subscription-pass {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.64);
}

.subscription-pass span,
.payment-qr-shell span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.subscription-pass strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
  line-height: 1;
}

.payment-qr-shell {
  margin-top: 18px;
  display: grid;
  justify-items: center;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.payment-qr-shell img {
  width: 260px;
  height: 260px;
  border-radius: 8px;
  background: #fff;
}

.payment-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 26px;
  display: grid;
  gap: 16px;
}

.hero-stage {
  min-width: 0;
  display: block;
}

.statement-card,
.authoring-panel,
.result-panel {
  border: 1px solid rgba(83, 127, 92, 0.18);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.statement-card {
  min-height: 268px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.small-label,
.step-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.statement-card h2 {
  max-width: 760px;
  margin-top: 12px;
  font-size: 34px;
  line-height: 1.14;
  letter-spacing: 0;
}

.statement-card p {
  max-width: 780px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.72;
}

.hero-detail-grid {
  width: min(100%, 980px);
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hero-detail-grid div {
  min-height: 78px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.62);
}

.hero-detail-grid b,
.hero-detail-grid span {
  display: block;
}

.hero-detail-grid b {
  color: var(--ink);
  font-size: 14px;
}

.hero-detail-grid span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.deliverable-line {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.deliverable-line span,
.tag-cloud span {
  border: 1px solid rgba(83, 127, 92, 0.2);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  font-weight: 800;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.clean-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.clean-list li {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  line-height: 1.35;
}

.workbench {
  min-width: 0;
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(430px, 0.84fr) minmax(620px, 1.16fr);
  gap: 14px;
}

.authoring-panel,
.result-panel {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-head {
  min-height: 78px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(83, 127, 92, 0.14);
}

.panel-head h3 {
  margin-top: 4px;
  font-size: 19px;
  line-height: 1.2;
}

.panel-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 8px;
}

.upload-row span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.upload-button,
.actions button,
.ghost-button {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(83, 127, 92, 0.18);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.ghost-button {
  color: var(--muted);
}

.upload-button:hover,
.actions button:not(:disabled):hover,
.ghost-button:hover {
  border-color: rgba(83, 127, 92, 0.36);
  background: #fff;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.file-list {
  max-height: 62px;
  overflow: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 18px 8px;
}

.file-list:empty {
  display: none;
}

.file-pill {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 12px;
}

.file-pill.warn {
  color: var(--amber);
  background: var(--amber-soft);
}

.drop-zone {
  min-height: 270px;
  flex: 1;
  padding: 0 18px 12px;
}

.drop-zone.dragging {
  background: rgba(230, 241, 226, 0.75);
}

textarea {
  width: 100%;
  height: 100%;
  min-height: 270px;
  resize: none;
  border: 1px solid rgba(83, 127, 92, 0.18);
  border-radius: 10px;
  padding: 15px;
  color: var(--ink);
  background: rgba(248, 251, 252, 0.84);
  outline: none;
  line-height: 1.65;
}

textarea:focus {
  border-color: var(--accent);
  background: #fff;
}

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 18px 16px;
}

.message {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.message.error {
  color: var(--red);
}

.generation-controls {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-shrink: 0;
}

.generation-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

select {
  height: 38px;
  min-width: 96px;
  border: 1px solid rgba(83, 127, 92, 0.18);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
  outline: none;
}

.primary {
  height: 38px;
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  background: var(--accent);
  font-weight: 900;
  white-space: nowrap;
}

.primary:hover {
  background: var(--accent-strong);
}

.result-head {
  align-items: center;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.empty-state {
  flex: 1;
  min-height: 0;
  padding: 18px;
  display: grid;
  place-items: center;
}

.empty-document {
  width: min(100%, 690px);
  border: 1px solid rgba(83, 127, 92, 0.16);
  border-radius: 10px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.empty-doc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line-soft);
}

.empty-doc-head span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.empty-doc-head strong {
  font-size: 18px;
}

.empty-doc-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.empty-doc-grid div {
  min-height: 78px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 12px;
  background: rgba(248, 251, 252, 0.82);
}

.empty-doc-grid b,
.empty-doc-grid span {
  display: block;
}

.empty-doc-grid b {
  color: var(--ink);
  font-size: 14px;
}

.empty-doc-grid span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.hidden {
  display: none;
}

.result-view {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px 16px;
}

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

.metric {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px;
  background: rgba(248, 251, 252, 0.82);
}

.metric span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
  word-break: break-word;
}

.quality-review {
  border: 1px solid rgba(15, 127, 121, 0.22);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 12px;
  background: linear-gradient(180deg, #f7fffc 0%, rgba(255, 255, 255, 0.82) 100%);
}

.quality-score {
  min-height: 120px;
  border-radius: 10px;
  padding: 14px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: var(--teal);
  background: var(--teal-soft);
  text-align: center;
}

.quality-score span,
.quality-score em {
  display: block;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.quality-score strong {
  display: block;
  color: var(--charcoal);
  font-size: 34px;
  line-height: 1;
}

.quality-items {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quality-item {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 9px 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.82);
}

.quality-item strong,
.quality-item span {
  display: block;
}

.quality-item strong {
  font-size: 13px;
  line-height: 1.3;
}

.quality-item span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.quality-item b {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 12px;
  line-height: 1;
}

.quality-item.watch b {
  color: var(--amber);
  background: var(--amber-soft);
}

.quality-item.missing b {
  color: var(--red);
  background: var(--red-soft);
}

.quality-notes {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quality-notes section {
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}

.quality-notes h4 {
  margin-bottom: 7px;
  font-size: 13px;
}

.quality-notes li {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.deliverable-section {
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
  margin-top: 12px;
}

.section-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.scope-text {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.65;
}

.coverage-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.coverage-tags span {
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 700;
}

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

.scenario-item {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 8px;
  background: rgba(248, 251, 252, 0.82);
}

.scenario-item strong {
  font-size: 14px;
}

.scenario-item p,
.scenario-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.case-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.case-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.9);
}

.case-table th,
.case-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.case-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #f5fbfc;
  font-size: 12px;
  font-weight: 800;
}

.case-table td {
  font-size: 12px;
  line-height: 1.52;
}

.case-table strong,
.case-table small {
  display: block;
}

.case-table small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.5;
}

ol,
ul {
  margin: 0;
  padding-left: 17px;
}

li + li {
  margin-top: 4px;
}

.priority {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  border-radius: 999px;
  padding: 5px 8px;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.priority.p0 {
  background: var(--red);
}

.priority.p2 {
  background: var(--amber);
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.note-block {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 11px;
  background: rgba(248, 251, 252, 0.82);
}

.note-block h4 {
  margin-bottom: 8px;
  font-size: 13px;
}

.note-block li {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 1120px) {
  .workspace {
    width: min(100vw - 24px, 860px);
  }

  .auth-card {
    width: min(100%, 900px);
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  }

  .hero-stage,
  .workbench {
    grid-template-columns: 1fr;
  }

  .authoring-panel,
  .result-panel {
    min-height: 480px;
  }
}

@media (max-width: 720px) {
  .product-header {
    padding: 12px;
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    justify-content: stretch;
  }

  .header-actions button,
  .user-badge {
    flex: 1 1 auto;
  }

  .workspace {
    width: calc(100vw - 20px);
    padding-top: 12px;
  }

  .auth-view,
  .subscription-view {
    width: calc(100vw - 20px);
    min-height: auto;
    padding: 14px 0;
  }

  .auth-card {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: 300px;
    grid-template-rows: minmax(210px, 1fr) auto;
    border-right: 0;
    border-bottom: 1px solid rgba(74, 255, 213, 0.16);
  }

  .auth-visual::before,
  .auth-visual::after,
  .auth-flow {
    display: none;
  }

  .auth-visual-media img {
    min-height: 220px;
  }

  .auth-console {
    padding: 22px;
  }

  .auth-copy h2 {
    font-size: 28px;
  }

  .subscription-card {
    padding: 18px;
  }

  .subscription-pass,
  .payment-actions,
  .code-field {
    grid-template-columns: 1fr;
    align-items: stretch;
    flex-direction: column;
  }

  .statement-card {
    min-height: auto;
    padding: 20px;
  }

  .statement-card h2 {
    font-size: 28px;
  }

  .hero-detail-grid,
  .summary-grid,
  .scenario-list,
  .notes-grid,
  .quality-review,
  .quality-items,
  .quality-notes,
  .empty-doc-grid {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .input-footer,
  .upload-row,
  .generation-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    justify-content: flex-start;
  }

  .actions button,
  .upload-button,
  .ghost-button,
  .primary,
  select {
    width: 100%;
  }
}
