body { background: var(--page); color: var(--text); }
.skip-link {
  position: fixed;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  z-index: 100;
  translate: 0 -160%;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--text);
  color: white;
}
.skip-link:focus { translate: 0; }

.tool-hero {
  width: min(1440px, calc(100% - 32px));
  margin: auto;
  padding-block: clamp(54px, 7vw, 96px) clamp(36px, 5vw, 62px);
  display: grid;
  grid-template-columns: minmax(0,1.25fr) minmax(280px,.75fr);
  gap: clamp(36px, 8vw, 130px);
  align-items: end;
}
.eyebrow, .step-label {
  margin: 0;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.tool-hero h1 {
  margin: 14px 0 22px;
  font-family: var(--font-serif);
  font-size: clamp(44px, 6vw, 86px);
  font-weight: 650;
  letter-spacing: -.055em;
  line-height: 1.05;
}
.tool-hero h1 em { color: var(--primary); font-style: normal; }
.hero-copy {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(14px, 1.5vw, 17px);
  line-height: 1.9;
}
.privacy-card {
  display: flex;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}
.privacy-dot {
  width: 10px;
  height: 10px;
  flex: none;
  margin-block-start: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 14%, transparent);
}
.privacy-card strong { font-size: 13px; }
.privacy-card p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }

.workspace {
  width: min(1500px, calc(100% - 24px));
  margin: auto;
  display: grid;
  grid-template-columns: 340px minmax(0,1fr);
  gap: 14px;
  align-items: start;
}
.control-panel,
.source-card,
.summary-card,
.content-section {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.control-panel {
  position: sticky;
  inset-block-start: 12px;
  padding: 26px;
}
.panel-heading h2,
.card-header h2,
.summary-card h2 {
  margin: 7px 0 0;
  font-family: var(--font-serif);
}
.panel-heading h2 { font-size: 26px; }

.drop-zone {
  min-height: 170px;
  margin-block: 22px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px dashed color-mix(in srgb, var(--primary) 45%, var(--line));
  border-radius: 16px;
  background: var(--surface-soft);
  cursor: pointer;
  text-align: center;
  transition: .18s ease;
}
.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--surface-soft) 74%, white);
  translate: 0 -1px;
}
.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.upload-mark {
  display: grid;
  width: 38px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 24px;
}
.drop-zone strong { font-size: 13px; }
.drop-zone small { color: var(--muted); font-size: 10px; }

.document-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-block: 12px 18px;
}
.document-summary span {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
}
.document-summary strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.angle-group,
.scope-group {
  margin: 22px 0 0;
  padding: 18px 0 0;
  border: 0;
  border-block-start: 1px solid var(--line);
}
.angle-group legend,
.scope-group legend {
  padding-inline-end: 8px;
  font-size: 12px;
  font-weight: 750;
}
.angle-group legend span,
.scope-group legend span {
  margin-inline-end: 8px;
  color: var(--accent);
  font-size: 10px;
}

.angle-buttons {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 8px;
  margin-block-start: 12px;
}
.angle-buttons button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
}
.angle-buttons button[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.scope-option {
  display: flex;
  gap: 10px;
  align-items: start;
  margin-block-start: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  cursor: pointer;
}
.scope-option input {
  margin-block-start: 3px;
  accent-color: var(--primary);
}
.scope-option strong,
.scope-option small { display: block; }
.scope-option small { margin-block-start: 3px; color: var(--muted); font-size: 9px; }

.range-field {
  display: grid;
  gap: 7px;
  margin-block-start: 14px;
  color: var(--muted);
  font-size: 10px;
}
.range-field input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--text);
  padding-inline: 12px;
}

.quiet-button,
.primary-action,
.download-button {
  min-height: 46px;
  border-radius: 11px;
  font-weight: 750;
}
.quiet-button {
  width: 100%;
  margin-block-start: 16px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.quiet-button:hover:not(:disabled) { color: var(--text); border-color: var(--primary); }
.quiet-button:disabled { opacity: .4; cursor: not-allowed; }

.primary-action {
  width: 100%;
  margin-block-start: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-inline: 18px;
  border: 0;
  background: var(--primary);
  color: white;
  cursor: pointer;
}
.primary-action:hover:not(:disabled) { background: var(--primary-hover); }
.primary-action:disabled { opacity: .42; cursor: not-allowed; }

.progress-wrap { margin-block-start: 16px; }
.progress-copy { display: flex; justify-content: space-between; margin-block-end: 7px; color: var(--muted); font-size: 10px; }
progress { width: 100%; height: 6px; border: 0; border-radius: 99px; overflow: hidden; background: var(--line); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }

.app-status { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.app-status[data-status="error"] { color: var(--danger); }
.app-status[data-status="success"] { color: var(--accent); }

.workbench {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0,1.4fr) minmax(290px,.6fr);
  gap: 14px;
}
.source-card,
.summary-card { padding: clamp(20px, 3vw, 30px); }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.card-header h2 { font-size: clamp(24px, 3vw, 32px); }
.card-header output { color: var(--muted); font-size: 10px; }

.source-file-list { min-height: 480px; margin-block-start: 18px; }
.empty-state {
  min-height: 440px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}
.empty-state span {
  display: grid;
  width: 64px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary);
  font-weight: 900;
}
.empty-state strong { color: var(--text); }
.empty-state small { font-size: 10px; }

.summary-card { align-self: start; }
.summary-card dl { display: grid; margin: 24px 0 0; }
.summary-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-block-start: 1px solid var(--line);
}
.summary-card dt { color: var(--muted); font-size: 11px; }
.summary-card dd { margin: 0; font-weight: 700; text-align: end; }

.result-panel {
  margin-block-start: 22px;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 15px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.result-mark {
  display: grid;
  width: 34px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 900;
}
.result-panel strong { display: block; margin-block-start: 12px; }
.result-panel p { color: var(--muted); font-size: 11px; line-height: 1.7; }

.download-button {
  display: grid;
  place-items: center;
  background: var(--primary);
  color: white;
}
.download-button:hover { background: var(--primary-hover); }

.content-section {
  width: min(1180px, calc(100% - 32px));
  margin: 30px auto 0;
  padding: clamp(22px, 4vw, 34px);
}
.content-section h2 { margin: 0 0 18px; font-family: var(--font-serif); }
.steps,
.related-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.steps article,
.related-grid a {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}
.steps p,
.related-grid span {
  display: block;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.related-grid { grid-template-columns: repeat(3,1fr); }

@media (max-width: 1080px) {
  .workspace { grid-template-columns: 1fr; }
  .control-panel { position: static; }
}
@media (max-width: 820px) {
  .tool-hero { grid-template-columns: 1fr; }
  .workbench { grid-template-columns: 1fr; }
  .steps,
  .related-grid { grid-template-columns: 1fr; }
}
