:root {
  --paper: #f4efe4;
  --paper-strong: #fffaf1;
  --ink: #132018;
  --muted: #5f665d;
  --accent: #0f766e;
  --accent-strong: #0c544f;
  --line: rgba(19, 32, 24, 0.12);
  --shadow: 0 1.1rem 2.2rem rgba(13, 33, 27, 0.12);
  --radius-xl: 1.35rem;
  --radius-lg: 0.95rem;
  --radius-md: 0.75rem;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 25rem),
    radial-gradient(circle at bottom right, rgba(190, 160, 90, 0.14), transparent 22rem),
    linear-gradient(180deg, #efe7d9 0%, #f7f2e8 100%);
  font-family: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(19, 32, 24, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 32, 24, 0.035) 1px, transparent 1px);
  background-size: 1.35rem 1.35rem;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 80%);
}

.page-shell {
  width: min(100%, 96rem);
  margin: 0 auto;
  padding: 0.85rem 0.85rem 1.8rem;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255, 250, 241, 0.95), rgba(246, 239, 226, 0.92));
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: -3rem;
  top: -3rem;
  width: 9rem;
  height: 9rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.18), rgba(15, 118, 110, 0));
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  align-items: start;
}

.hero-main {
  min-width: 0;
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.3rem;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.72rem;
  font-weight: 800;
}

.hero h1 {
  margin: 0;
  max-width: 7ch;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(2rem, 3.1vw, 3.3rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.hero-copy {
  margin: 0.42rem 0 0;
  max-width: 48ch;
  font-size: 0.94rem;
  line-height: 1.46;
  color: var(--muted);
  text-wrap: pretty;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.hero-badges span,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.pill.neutral {
  border-color: rgba(19, 32, 24, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
}

.pill.success {
  border-color: rgba(15, 118, 110, 0.22);
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
}

.hero-side {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}

.hero-note,
.hero-metrics {
  padding: 0.72rem 0.8rem;
  border: 1px solid rgba(19, 32, 24, 0.08);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.5);
}

.hero-note-label,
.hero-metric-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.hero-note-title {
  margin: 0.22rem 0 0;
  font-size: 0.92rem;
  font-weight: 760;
  line-height: 1.34;
  text-wrap: pretty;
}

.hero-metrics {
  display: grid;
  gap: 0.42rem;
}

.hero-metric {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 0.55rem;
  align-items: start;
}

.hero-metric-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.9rem;
  padding: 0 0.42rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(15, 118, 110, 0.04));
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.hero-metric-label {
  line-height: 1.38;
  text-wrap: pretty;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.workflow-shell {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.workflow-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.workflow-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.6rem;
  padding: 0.48rem 0.88rem;
  border: 1px solid rgba(19, 32, 24, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.workflow-tab:hover,
.workflow-tab:focus-visible {
  outline: none;
  border-color: rgba(15, 118, 110, 0.26);
  color: var(--ink);
  transform: translateY(-0.03rem);
}

.workflow-tab.active {
  border-color: rgba(15, 118, 110, 0.24);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.16), rgba(255, 255, 255, 0.88));
  color: var(--accent-strong);
}

.workflow-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45rem;
  min-height: 1.45rem;
  padding: 0 0.36rem;
  border-radius: 999px;
  background: rgba(19, 32, 24, 0.08);
  color: inherit;
  font-size: 0.72rem;
  font-weight: 800;
}

.workflow-status {
  margin-top: 0;
}

.workflow-view {
  display: none;
}

.workflow-view.is-active {
  display: block;
}

.workflow-grid {
  display: grid;
  gap: 0.8rem;
}

.single-column {
  grid-template-columns: minmax(0, 1fr);
}

.workflow-panel {
  min-width: 0;
}

.preview-panel {
  display: grid;
  align-content: start;
}

.request-preview-block {
  display: grid;
  gap: 0.58rem;
}

.research-shell {
  margin-top: 0;
}

.result-panel-static {
  position: static;
  min-height: auto;
  max-height: none;
  overflow: visible;
}

.guide-drawer {
  margin-top: 0.8rem;
  border: 1px solid rgba(19, 32, 24, 0.1);
  border-radius: var(--radius-xl);
  background: rgba(255, 250, 241, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(0.45rem);
  overflow: hidden;
}

.guide-drawer-summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
  gap: 0.9rem;
  align-items: start;
  padding: 0.9rem 1rem;
  cursor: pointer;
  list-style: none;
}

.guide-drawer-summary::-webkit-details-marker {
  display: none;
}

.guide-drawer-summary::after {
  content: "展开说明";
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.9rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
}

.guide-drawer[open] .guide-drawer-summary::after {
  content: "收起说明";
}

.guide-drawer-kicker {
  margin: 0 0 0.2rem;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guide-drawer-summary h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 820;
  letter-spacing: -0.02em;
}

.guide-drawer-copy {
  margin: 0.24rem 0 0;
  max-width: 46rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.guide-drawer-summary-side {
  min-width: 0;
  padding: 0.72rem 0.82rem;
  padding-right: 6rem;
  border: 1px solid rgba(190, 160, 90, 0.28);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(190, 160, 90, 0.14), rgba(255, 250, 241, 0.74));
}

.guide-drawer-body {
  display: grid;
  gap: 0.75rem;
  padding: 0 1rem 1rem;
  border-top: 1px solid rgba(19, 32, 24, 0.08);
}

.panel {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 250, 241, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(0.45rem);
}

.panel-head {
  display: grid;
  gap: 0.12rem;
}

.panel-head h2,
.block-head h3 {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.panel-head h2 {
  font-size: 1.02rem;
}

.personal-config-panel {
  margin-top: 0.65rem;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(244, 250, 247, 0.9), rgba(255, 255, 255, 0.78));
  overflow: hidden;
}

.personal-config-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.8rem 0.82rem;
  cursor: pointer;
  list-style: none;
}

.personal-config-summary::-webkit-details-marker {
  display: none;
}

.personal-config-kicker {
  margin: 0 0 0.18rem;
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.personal-config-summary h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
}

.personal-config-copy {
  margin: 0.22rem 0 0;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.42;
}

.personal-config-status {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(19, 32, 24, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.personal-config-status.ready {
  border-color: rgba(15, 118, 110, 0.24);
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
}

.personal-config-status.partial {
  border-color: rgba(190, 160, 90, 0.32);
  background: rgba(190, 160, 90, 0.14);
  color: #7b5a1e;
}

.personal-config-body {
  display: grid;
  gap: 0.62rem;
  padding: 0 0.82rem 0.82rem;
  border-top: 1px solid rgba(19, 32, 24, 0.08);
}

.personal-config-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.personal-config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
}

.search-form {
  display: grid;
  gap: 0.58rem;
  margin-top: 0.62rem;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.58rem;
}

label {
  display: grid;
  gap: 0.22rem;
}

label span {
  font-size: 0.8rem;
  font-weight: 800;
}

.field-hint {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.38;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 2.55rem;
  padding: 0.62rem 0.82rem;
  border: 1px solid rgba(19, 32, 24, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 0.9rem;
}

.native-select {
  position: absolute;
  width: 0.0625rem;
  height: 0.0625rem;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.select-shell {
  position: relative;
}

.custom-select {
  position: relative;
}

.custom-select-button {
  position: relative;
  width: 100%;
  min-height: 2.62rem;
  padding: 0.58rem 2.7rem 0.58rem 0.82rem;
  border: 1px solid rgba(19, 32, 24, 0.12);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(249, 245, 236, 0.92));
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow:
    inset 0 0.0625rem 0 rgba(255, 255, 255, 0.72),
    0 0.35rem 0.9rem rgba(13, 33, 27, 0.05);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.custom-select-button:hover {
  border-color: rgba(15, 118, 110, 0.34);
  box-shadow:
    inset 0 0.0625rem 0 rgba(255, 255, 255, 0.82),
    0 0.65rem 1.1rem rgba(12, 84, 79, 0.08);
}

.custom-select-button:focus-visible,
.custom-select.open .custom-select-button {
  outline: none;
  border-color: rgba(15, 118, 110, 0.52);
  box-shadow:
    0 0 0 0.16rem rgba(15, 118, 110, 0.15),
    0 0.85rem 1.4rem rgba(12, 84, 79, 0.1);
}

.custom-select-button::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.09), transparent 42%),
    linear-gradient(90deg, transparent 0, transparent 78%, rgba(15, 118, 110, 0.07) 78%, rgba(15, 118, 110, 0.07) 100%);
  pointer-events: none;
}

.custom-select-label,
.custom-select-value {
  position: relative;
  z-index: 1;
}

.custom-select-label {
  display: block;
  margin-bottom: 0.08rem;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.custom-select-value {
  display: block;
  padding-right: 0.45rem;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.2;
}

.custom-select-icon {
  position: absolute;
  top: 50%;
  right: 0.95rem;
  width: 0.9rem;
  height: 0.9rem;
  color: var(--accent-strong);
  transform: translateY(-50%);
  transition: transform 180ms ease;
  z-index: 1;
}

.custom-select.open .custom-select-icon {
  transform: translateY(-50%) rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 20;
  margin: 0;
  padding: 0.38rem;
  list-style: none;
  border: 1px solid rgba(19, 32, 24, 0.12);
  border-radius: 1rem;
  background: rgba(255, 251, 244, 0.97);
  backdrop-filter: blur(0.8rem);
  box-shadow: 0 0.95rem 1.8rem rgba(13, 33, 27, 0.14);
}

.custom-select-option {
  display: grid;
  grid-template-columns: 1rem 1fr;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.62rem 0.72rem;
  border: none;
  border-radius: 0.8rem;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
  outline: none;
  background: rgba(15, 118, 110, 0.1);
  transform: translateX(0.06rem);
}

.custom-select-option.selected {
  background: linear-gradient(135deg, rgba(93, 157, 236, 0.94), rgba(77, 133, 222, 0.96));
  color: #fffdf8;
  box-shadow: inset 0 0.0625rem 0 rgba(255, 255, 255, 0.25);
}

.custom-select-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  font-size: 0.92rem;
  font-weight: 900;
  opacity: 0;
}

.custom-select-option.selected .custom-select-check {
  opacity: 1;
}

.custom-select-meta {
  display: block;
  font-size: 0.67rem;
  color: rgba(19, 32, 24, 0.58);
}

.custom-select-option.selected .custom-select-meta {
  color: rgba(255, 253, 248, 0.82);
}

textarea {
  min-height: 4.2rem;
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: 0.12rem solid rgba(15, 118, 110, 0.35);
  border-color: rgba(15, 118, 110, 0.5);
}

.toggle-row {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.68rem;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-lg);
  background: rgba(15, 118, 110, 0.08);
}

.toggle-row input {
  width: 1.15rem;
  min-height: 1.15rem;
  margin-top: 0.12rem;
}

.task-guide {
  display: grid;
  gap: 0.38rem;
  padding: 0.76rem 0.82rem;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(244, 250, 247, 0.92), rgba(255, 255, 255, 0.82));
}

.task-guide-kicker {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.task-guide h3 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
}

.task-guide-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.81rem;
  line-height: 1.45;
}

.task-guide-points {
  display: grid;
  gap: 0.42rem;
  margin-top: 0.12rem;
}

.task-guide-point {
  margin: 0;
  padding: 0.55rem 0.68rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-size: 0.79rem;
  line-height: 1.45;
}

.task-guide-point strong {
  color: var(--accent-strong);
}

.estimate-label {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7b5a1e;
}

.estimate-copy {
  margin: 0.26rem 0 0;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.4;
}

.usage-note {
  padding: 0.72rem 0.82rem;
  border: 1px dashed rgba(19, 32, 24, 0.16);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.58);
}

.usage-note-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
}

.usage-note-copy {
  margin: 0.22rem 0 0;
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.45;
}

.advanced-panel {
  border: 1px dashed rgba(19, 32, 24, 0.16);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.42);
}

.advanced-panel[open] {
  padding: 0.7rem 0.82rem 0.82rem;
}

.advanced-panel summary {
  padding: 0.72rem 0.82rem;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.advanced-panel summary::-webkit-details-marker {
  display: none;
}

.advanced-panel[open] summary {
  padding: 0 0 0.58rem;
}

.advanced-panel label + label {
  margin-top: 0.52rem;
}

.submit-button {
  min-height: 2.72rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #f4efe4;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.submit-button:hover {
  transform: translateY(-0.05rem);
  box-shadow: 0 0.6rem 1.2rem rgba(12, 84, 79, 0.18);
}

.submit-button:disabled {
  cursor: not-allowed;
  transform: none;
  opacity: 0.62;
  box-shadow: none;
  background: linear-gradient(135deg, rgba(95, 102, 93, 0.9), rgba(95, 102, 93, 0.72));
}

.status-card,
.code-box,
.file-list,
.result-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

.status-card {
  padding: 0.82rem 0.9rem;
  background: rgba(255, 255, 255, 0.72);
}

.status-card.running {
  background: rgba(190, 160, 90, 0.12);
}

.status-card.success {
  background: rgba(15, 118, 110, 0.08);
}

.status-card.error {
  background: rgba(180, 59, 40, 0.1);
}

.status-label {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 800;
}

.status-copy {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.status-progress {
  display: grid;
  gap: 0.58rem;
  margin-top: 0.8rem;
  padding-top: 0.78rem;
  border-top: 1px dashed rgba(19, 32, 24, 0.12);
}

.status-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.status-progress-stage,
.status-progress-percent {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.status-progress-bar {
  position: relative;
  height: 0.56rem;
  border-radius: 999px;
  background: rgba(19, 32, 24, 0.08);
  overflow: hidden;
}

.status-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.78), rgba(15, 118, 110, 0.98));
  transition: width 220ms ease;
}

.status-progress-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.45;
}

.status-step-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.status-step-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(19, 32, 24, 0.1);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.status-step-chip.running {
  border-color: rgba(190, 160, 90, 0.28);
  background: rgba(190, 160, 90, 0.14);
  color: var(--ink);
}

.status-step-chip.completed {
  border-color: rgba(15, 118, 110, 0.2);
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-strong);
}

.status-step-chip.skipped {
  opacity: 0.62;
}

.result-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.8rem;
  overflow: visible;
}

.result-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: visible;
  flex: 0 0 auto;
  padding-bottom: 0.15rem;
  scrollbar-width: thin;
}

.result-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.4rem;
  padding: 0.42rem 0.78rem;
  border: 1px solid rgba(19, 32, 24, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font: inherit;
  font-size: 0.81rem;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.result-tab:hover,
.result-tab:focus-visible {
  outline: none;
  border-color: rgba(15, 118, 110, 0.26);
  color: var(--ink);
  transform: translateY(-0.03rem);
}

.result-tab.active {
  border-color: rgba(15, 118, 110, 0.24);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.16), rgba(255, 255, 255, 0.88));
  color: var(--accent-strong);
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45rem;
  min-height: 1.45rem;
  padding: 0 0.36rem;
  border-radius: 999px;
  background: rgba(19, 32, 24, 0.08);
  color: inherit;
  font-size: 0.72rem;
  font-weight: 800;
}

.result-stage {
  min-height: 0;
  flex: 1 1 auto;
  border: 1px solid rgba(19, 32, 24, 0.08);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.34);
  overflow: auto;
}

.output-panel {
  display: none;
  min-height: 20rem;
  padding: 0.82rem;
  overflow: visible;
}

.output-panel.is-active {
  display: grid;
  align-content: start;
  gap: 0.6rem;
}

.result-block {
  margin-top: 0;
}

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}

.block-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.block-head h3 {
  font-size: 0.96rem;
}

.block-copy {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.code-box {
  margin: 0;
  padding: 0.82rem 0.9rem;
  overflow: auto;
  background: #1b2420;
  color: #ddf3e8;
  font-family: "SFMono-Regular", "Cascadia Code", "Fira Code", monospace;
  font-size: 0.84rem;
  line-height: 1.45;
}

.file-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0.72rem;
  list-style: none;
  background: rgba(255, 255, 255, 0.72);
}

.file-list a {
  color: var(--accent-strong);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.file-item {
  display: grid;
  gap: 0.42rem;
  padding: 0.78rem 0.82rem;
  border: 1px solid rgba(19, 32, 24, 0.08);
  border-radius: 0.88rem;
  background: rgba(255, 255, 255, 0.88);
}

.file-item-head,
.file-item-meta,
.file-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.file-item-head {
  justify-content: space-between;
}

.file-item-link {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
  word-break: break-all;
}

.file-item-link:hover,
.file-item-link:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
  outline: none;
}

.file-item-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 800;
}

.file-item-meta {
  color: var(--muted);
  font-size: 0.76rem;
}

.result-list {
  display: grid;
  gap: 0.72rem;
}

.result-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.55rem;
}

.selection-toolbar {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.7rem;
  padding: 0.72rem 0.82rem;
  border: 1px dashed rgba(15, 118, 110, 0.22);
  border-radius: var(--radius-lg);
  background: rgba(15, 118, 110, 0.06);
}

.selection-copy {
  margin: 0;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.45;
}

.selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.result-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  align-items: center;
}

.pagination-note {
  color: var(--muted);
  font-size: 0.8rem;
  margin-right: 0.3rem;
}

.pagination-button,
.secondary-button {
  min-height: 2rem;
  padding: 0.38rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-strong);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.secondary-button:hover,
.secondary-button:focus-visible,
.pagination-button:hover,
.pagination-button:focus-visible {
  outline: none;
  border-color: rgba(15, 118, 110, 0.3);
  transform: translateY(-0.03rem);
}

.secondary-button.is-copied {
  border-color: rgba(15, 118, 110, 0.24);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.15), rgba(255, 255, 255, 0.9));
  color: var(--accent-strong);
}

.secondary-button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.pagination-button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #f4efe4;
}

.result-card {
  padding: 0.82rem;
  background: rgba(255, 255, 255, 0.72);
}

.result-card-selected {
  border-color: rgba(15, 118, 110, 0.28);
  background:
    linear-gradient(180deg, rgba(240, 250, 247, 0.96), rgba(255, 255, 255, 0.88)),
    rgba(255, 255, 255, 0.84);
  box-shadow: 0 0 0 0.125rem rgba(15, 118, 110, 0.08);
}

.result-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.25rem;
}

.result-select-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  user-select: none;
}

.result-select-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.result-select-indicator {
  position: relative;
  width: 1.3rem;
  height: 1.3rem;
  border: 1px solid rgba(15, 118, 110, 0.26);
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.94);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.result-select-indicator::after {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 0.12rem;
  width: 0.36rem;
  height: 0.72rem;
  border-right: 0.14rem solid transparent;
  border-bottom: 0.14rem solid transparent;
  transform: rotate(45deg);
  transition: border-color 160ms ease;
}

.result-select-checkbox:checked + .result-select-indicator {
  border-color: rgba(15, 118, 110, 0.3);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.86), rgba(12, 84, 79, 0.92));
  transform: translateY(-0.02rem);
}

.result-select-checkbox:checked + .result-select-indicator::after {
  border-color: #f6f1e7;
}

.result-select-checkbox:focus-visible + .result-select-indicator {
  outline: 0.12rem solid rgba(15, 118, 110, 0.22);
  outline-offset: 0.12rem;
}

.result-select-copy {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
}

.result-order-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.22rem 0.58rem;
  border-radius: 999px;
  background: rgba(19, 32, 24, 0.06);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.result-card h4 {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.35;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.result-card p {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.warning-card {
  border-color: rgba(190, 160, 90, 0.35);
  background: linear-gradient(135deg, rgba(190, 160, 90, 0.16), rgba(255, 250, 241, 0.88));
}

.warning-title {
  margin-top: 0;
  color: var(--ink);
  font-weight: 800;
}

.summary-details {
  color: var(--ink);
}

.result-card a {
  color: var(--accent-strong);
  text-decoration: none;
  word-break: break-all;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.result-link {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.summary-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.ai-summary-overview {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 243, 233, 0.92)),
    rgba(255, 255, 255, 0.86);
}

.summary-overview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.summary-overview-kicker {
  margin: 0 0 0.2rem;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-overview-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.summary-overview-copy {
  color: var(--ink);
  font-size: 0.96rem;
}

.summary-point-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.summary-point-item {
  margin: 0;
  padding: 0.7rem 0.8rem;
  border-radius: 0.95rem;
  background: rgba(15, 118, 110, 0.06);
  color: var(--ink);
}

.summary-follow-up {
  margin-top: 0.7rem;
  color: var(--accent-strong);
  font-weight: 700;
}

.summary-entity-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.summary-entity {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(19, 32, 24, 0.08);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
}

.summary-detail-group {
  border: 1px solid rgba(19, 32, 24, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.6);
}

.summary-detail-group summary {
  padding: 0.82rem 0.9rem;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--ink);
  list-style: none;
}

.summary-detail-group summary::-webkit-details-marker {
  display: none;
}

.summary-detail-list {
  display: grid;
  gap: 0.72rem;
  padding: 0 0.82rem 0.82rem;
}

.rewrite-panel {
  padding: 0.82rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
}

.rewrite-panel.empty {
  color: var(--muted);
}

.rewrite-empty,
.rewrite-hint,
.rewrite-error {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.rewrite-error {
  color: #a33a2c;
}

.rewrite-head {
  display: grid;
  gap: 0.6rem;
}

.rewrite-label,
.rewrite-output-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rewrite-head h4,
.rewrite-output h5 {
  margin: 0.18rem 0 0;
  font-size: 0.98rem;
  line-height: 1.4;
}

.rewrite-url {
  margin: 0.24rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  word-break: break-all;
}

.rewrite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rewrite-sources {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.82rem;
}

.rewrite-source-chip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.68rem 0.72rem;
  border: 1px solid rgba(19, 32, 24, 0.08);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.84);
}

.rewrite-source-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
}

.rewrite-source-copy {
  min-width: 0;
}

.rewrite-source-copy strong,
.rewrite-source-copy span {
  display: block;
}

.rewrite-source-copy strong {
  font-size: 0.85rem;
  line-height: 1.4;
}

.rewrite-source-copy span {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.4;
  word-break: break-all;
}

.rewrite-goal-field {
  margin-top: 0.82rem;
}

.rewrite-goal-field textarea {
  min-height: 5.2rem;
  background: rgba(255, 255, 255, 0.84);
}

.rewrite-output {
  margin-top: 0.82rem;
  padding-top: 0.82rem;
  border-top: 1px dashed rgba(19, 32, 24, 0.14);
}

.rewrite-output-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.rewrite-output p {
  margin: 0.52rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.rewrite-summary {
  color: var(--ink);
}

.rewrite-tags {
  color: var(--accent-strong);
  font-weight: 700;
}

@media (min-width: 768px) {
  .page-shell {
    padding: 0.95rem 0.95rem 1.8rem;
  }

  .hero,
  .panel {
    padding: 1rem;
  }

  .grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-layout {
    grid-template-columns: minmax(34rem, 1.55fr) minmax(23rem, 0.95fr);
    gap: 1rem;
  }

  .split-column {
    grid-template-columns: minmax(20rem, 0.92fr) minmax(22rem, 1.08fr);
    align-items: start;
  }
}

@media (min-width: 1280px) {
  .hero h1 {
    max-width: none;
    white-space: nowrap;
  }

  .hero-copy {
    max-width: 52ch;
  }
}

@media (max-width: 767px) {
  .personal-config-summary {
    flex-direction: column;
    align-items: stretch;
  }

  .guide-drawer-summary {
    grid-template-columns: 1fr;
    padding-right: 1rem;
  }

  .guide-drawer-summary::after {
    position: static;
    justify-self: start;
    margin-top: 0.55rem;
  }

  .guide-drawer-summary-side {
    padding-right: 0.82rem;
  }

  .custom-select-menu {
    max-height: min(18rem, 52vh);
    overflow: auto;
  }
}

@media (min-width: 1024px) {
  .workspace {
    grid-template-columns: minmax(19rem, 26rem) minmax(0, 1fr);
    align-items: start;
  }

  .control-panel {
    position: sticky;
    top: 0.8rem;
  }

  .result-panel {
    position: sticky;
    top: 0.8rem;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 1.6rem);
    max-height: calc(100vh - 1.6rem);
    overflow: hidden;
  }

  .workflow-view .control-panel,
  .workflow-view .result-panel,
  .workflow-view .result-panel-static {
    position: static;
    top: auto;
    min-height: auto;
    max-height: none;
    overflow: visible;
  }
}
