@import url("/ui-foundation.css?v=shared-actions");

:root {
  --paper: #f4f2eb;
  --surface: #ffffff;
  --surface-soft: #eceae3;
  --ink: #0c1827;
  --ink-soft: #4d5764;
  --ink-faint: #747c85;
  --line: #d3d0c7;
  --line-strong: #a7a49b;
  --navy: #112a49;
  --signal: #d9ff2f;
  --signal-dark: #b5da0d;
  --warning: #9c3d21;
  --warning-soft: #fff0e7;
  --success: #176442;
  --success-soft: #e5f4ec;
  --focus: #1757c2;
  --shadow: 0 18px 60px rgba(15, 26, 39, 0.08);
  --content: 1240px;
  --narrow: 920px;
  --font: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  min-width: 0;
  color: var(--ink);
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

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

button,
a { -webkit-tap-highlight-color: transparent; }

button { color: inherit; }

a { color: inherit; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px max(24px, calc((100vw - var(--content)) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(244, 242, 235, 0.96);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  background: var(--ink);
}

.brand-mark i {
  width: 12px;
  height: 12px;
  border: 3px solid var(--signal);
}

.brand strong,
.brand small { display: block; }

.brand strong {
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.brand small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.15em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.environment-badge {
  color: var(--ink-faint);
  font-size: 13px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 20px;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-weight: 760;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.button:hover:not(:disabled):not(.is-disabled) { transform: translateY(-1px); }
.button:active:not(:disabled):not(.is-disabled) { transform: translateY(0); }

.button-primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.button-primary:hover:not(:disabled):not(.is-disabled) {
  border-color: var(--navy);
  background: var(--navy);
}

.button-dark {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.button-secondary { background: #fff; }
.button-secondary:hover:not(:disabled) { background: var(--surface-soft); }

.button-compact {
  min-height: 40px;
  padding: 9px 14px;
  font-size: 14px;
}

.button:disabled,
.button.is-disabled {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink-faint);
  cursor: not-allowed;
  pointer-events: none;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-soft);
  font-weight: 720;
  cursor: pointer;
}

.text-button:hover { border-color: var(--ink); color: var(--ink); }
.text-button-danger { color: var(--warning); }
.return-mark { display: inline-block; font-size: 1.06em; font-weight: inherit; line-height: 1; }

.page-shell {
  width: min(calc(100% - 48px), var(--content));
  margin: 0 auto;
  padding: 72px 0 100px;
}

.create-shell {
  width: min(calc(100% - 48px), var(--narrow));
  margin: 0 auto;
  padding: 48px 0 100px;
}

.global-message {
  position: sticky;
  top: 76px;
  z-index: 25;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--warning-soft);
  color: var(--warning);
  text-align: center;
  font-size: 14px;
  font-weight: 650;
}

.global-message.is-info {
  background: #eaf1fb;
  color: var(--navy);
}

.page-heading {
  margin-bottom: 48px;
}

.page-heading-split {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 48px;
}

.eyebrow,
.kicker {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow { color: var(--navy); }
.kicker { color: var(--ink-faint); }

h1,
h2,
h3,
p { margin-top: 0; }

h1 {
  max-width: 900px;
  margin-bottom: 14px;
  font-size: clamp(44px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.13;
  letter-spacing: -0.035em;
}

h3 {
  margin-bottom: 7px;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.heading-copy {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 18px;
}

.next-run {
  min-width: 260px;
  padding: 20px 22px;
  border-top: 3px solid var(--ink);
  background: var(--surface);
}

.next-run span,
.next-run strong { display: block; }
.next-run span { color: var(--ink-faint); font-size: 13px; }
.next-run strong { margin-top: 3px; font-size: 18px; }

.attention-panel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  margin: 0 0 30px;
  padding: 24px;
  border: 1px solid #e3b7a4;
  border-left: 5px solid var(--warning);
  background: var(--warning-soft);
}

.attention-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--warning);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.attention-copy h2 { margin-bottom: 4px; font-size: 22px; }
.attention-copy p { margin-bottom: 0; color: #69331f; }

.project-list-section {
  min-height: 430px;
  border-top: 4px solid var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 24px 26px;
  border-bottom: 1px solid var(--line);
}

.section-toolbar h2 { margin-bottom: 2px; font-size: 25px; }
.section-toolbar p { margin-bottom: 0; color: var(--ink-faint); font-size: 14px; }

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-field,
.select-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field svg {
  position: absolute;
  left: 14px;
  width: 18px;
  fill: none;
  stroke: var(--ink-faint);
  stroke-linecap: round;
  stroke-width: 1.7;
}

.search-field input,
.select-field select {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
}

.search-field input { width: 260px; padding: 10px 14px 10px 42px; }

.select-field select {
  min-width: 140px;
  padding: 10px 36px 10px 13px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

.project-loading {
  display: flex;
  min-height: 300px;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.project-loading span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink);
  animation: loadingPulse 1.2s ease-in-out infinite;
}

.project-loading span:nth-child(2) { animation-delay: 120ms; }
.project-loading span:nth-child(3) { animation-delay: 240ms; }

@keyframes loadingPulse {
  0%, 100% { opacity: .25; transform: scale(.75); }
  50% { opacity: 1; transform: scale(1); }
}

.empty-state {
  display: flex;
  min-height: 420px;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  max-width: 650px;
  margin: 0 auto;
  padding: 60px 24px;
  text-align: left;
}

.empty-symbol {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 28px;
  place-items: center;
  border: 2px solid var(--ink);
}

.empty-symbol span { width: 18px; height: 18px; background: var(--signal); }
.empty-state h2 { font-size: clamp(30px, 4vw, 48px); }
.empty-state > p:not(.eyebrow) { max-width: 560px; color: var(--ink-soft); font-size: 18px; }
.empty-state .button { margin: 14px 0 18px; }
.empty-state small { color: var(--ink-faint); }

.table-wrap { overflow-x: auto; }

.project-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.project-table th {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.project-table td {
  padding: 20px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.project-table tbody tr { transition: background-color 150ms ease; }
.project-table tbody tr:hover { background: #f7f7f3; }
.project-table tbody tr.is-attention { background: #fff8f3; }
.project-table tbody tr:last-child td { border-bottom: 0; }

.project-name-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.project-name-button strong,
.project-name-button small { display: block; }
.project-name-button strong { margin-bottom: 3px; font-size: 17px; }
.project-name-button small { color: var(--ink-faint); font-size: 13px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.status-pill::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-active { border-color: #b5ddc8; background: var(--success-soft); color: var(--success); }
.status-attention { border-color: #e3b7a4; background: var(--warning-soft); color: var(--warning); }
.status-paused { color: var(--ink-faint); }
.status-pending { border-color: #ccd6e4; background: #edf2f8; color: var(--navy); }

.project-schedule-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.project-schedule-status .status-paused { color: #745420; background: #faf0da; border-color: #e7d4aa; }
.project-schedule-switch {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.project-schedule-switch span {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 12px;
  background: #68766c;
  transition: background-color 150ms ease;
}
.project-schedule-switch span::after {
  position: absolute;
  inset: 3px auto auto 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform 150ms ease;
}
.project-schedule-switch[aria-checked="true"] span { background: var(--success); }
.project-schedule-switch[aria-checked="true"] span::after { transform: translateX(16px); }
.project-schedule-switch:hover[aria-disabled="false"] span { filter: brightness(.86); }
.project-schedule-switch[aria-disabled="true"] { opacity: .55; cursor: wait; }
.project-schedule-switch:focus-visible { outline: 2px solid #477889; outline-offset: 1px; }

.row-action {
  display: inline-flex;
  min-width: 92px;
  min-height: 44px;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 760;
  cursor: pointer;
}

.row-action:hover { border-color: var(--ink); background: var(--ink); color: #fff; }

.back-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-bottom: 36px;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 760;
}
.back-button:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.create-heading { margin-bottom: 38px; }
.create-heading h1 { font-size: clamp(40px, 6vw, 64px); }

.stepper {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  margin-bottom: 26px;
}

.stepper-item {
  display: grid;
  grid-template-columns: 34px auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.stepper-item > span {
  grid-row: 1 / span 2;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 800;
}

.stepper-item strong { font-size: 14px; line-height: 1.3; }
.stepper-item small { color: var(--ink-faint); font-size: 12px; line-height: 1.3; }
.stepper-item.is-active > span { border-color: var(--ink); background: var(--ink); color: #fff; }
.stepper-item.is-complete > span { border-color: var(--signal-dark); background: var(--signal); color: var(--ink); }
.stepper-item:disabled { opacity: .55; }
.step-line { height: 1px; margin: 0 16px; background: var(--line); }

.form-panel {
  border-top: 5px solid var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-panel-main,
.form-panel { padding: clamp(28px, 5vw, 54px); }

.question-block {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 20px;
  margin-bottom: 34px;
}

.question-number {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}

.question-block h2 { margin: 0 0 5px; }
.question-block p { margin-bottom: 0; color: var(--ink-soft); }

.intent-field { display: block; }

.intent-field textarea {
  display: block;
  width: 100%;
  min-height: 190px;
  resize: vertical;
  padding: 22px 22px 58px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.65;
}

.intent-field { position: relative; }

.field-footer {
  position: absolute;
  right: 2px;
  bottom: 2px;
  left: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  background: #f7f7f3;
  font-size: 12px;
}

.field-footer small { color: var(--ink-faint); }

.field-error {
  margin: 9px 0 0;
  color: var(--warning);
  font-size: 14px;
  font-weight: 680;
}

.prompt-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 18px 0 34px;
}

.prompt-examples > span { margin-right: 4px; color: var(--ink-faint); font-size: 13px; }

.prompt-examples button {
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
}

.prompt-examples button:hover { border-color: var(--ink); color: var(--ink); }

.optional-details,
.monitoring-details,
.configuration-panel {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.optional-details summary,
.monitoring-details summary,
.configuration-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  list-style: none;
  cursor: pointer;
}

summary::-webkit-details-marker { display: none; }

.optional-details summary span,
.monitoring-details summary span,
.configuration-panel summary span { display: flex; flex-direction: column; }

.optional-details summary small,
.monitoring-details summary small,
.configuration-panel summary small { color: var(--ink-faint); font-weight: 400; }

.optional-details summary i,
.monitoring-details summary i,
.configuration-panel summary i {
  position: relative;
  width: 18px;
  height: 18px;
}

.optional-details summary i::before,
.optional-details summary i::after,
.monitoring-details summary i::before,
.monitoring-details summary i::after,
.configuration-panel summary i::before,
.configuration-panel summary i::after {
  position: absolute;
  top: 8px;
  left: 2px;
  width: 14px;
  height: 2px;
  background: var(--ink);
  content: "";
}

.optional-details summary i::after,
.monitoring-details summary i::after,
.configuration-panel summary i::after { transform: rotate(90deg); transition: transform 150ms ease; }

.optional-details[open] summary i::after,
.monitoring-details[open] summary i::after,
.configuration-panel[open] summary i::after { transform: rotate(0); }

.optional-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding: 10px 0 30px;
}

.optional-grid label,
.competitor-dialog label,
.timezone-field { display: flex; flex-direction: column; gap: 7px; }

.optional-grid label > span,
.competitor-dialog label > span,
.timezone-field > span { font-size: 14px; font-weight: 730; }

.optional-grid small,
.competitor-dialog small { color: var(--ink-faint); font-weight: 400; }
.full-span { grid-column: 1 / -1; }
.competitor-pairs-block { display: grid; gap: 12px; }
.field-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.field-group-heading > span { font-size: 14px; font-weight: 730; }
.known-competitor-pair { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.25fr) auto; gap: 12px; align-items: end; padding: 16px; border: 1px solid var(--line); background: var(--surface-soft); }
.known-competitor-pair .icon-button { width: 44px; height: 44px; border: 1px solid var(--line-strong); background: #fff; font-size: 22px; cursor: pointer; }

input,
textarea,
select {
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
}

.optional-grid input,
.optional-grid textarea,
.competitor-dialog input,
.competitor-dialog textarea,
.timezone-field select { width: 100%; padding: 12px 13px; }

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  margin-top: 22px;
}

.form-actions > span { margin-right: auto; color: var(--ink-faint); font-size: 13px; }
.form-actions-between { justify-content: space-between; }

.scope-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-bottom: 42px;
  border: 1px solid var(--line);
  background: var(--line);
}

.scope-item {
  min-height: 118px;
  padding: 20px;
  background: #fff;
}

.scope-item dt {
  margin-bottom: 7px;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.scope-item dd { margin: 0; font-weight: 720; }
.scope-item small { display: block; margin-top: 6px; color: var(--ink-faint); font-weight: 400; }

.candidate-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.candidate-heading h3 { margin-bottom: 2px; }
.candidate-heading p { margin-bottom: 0; color: var(--ink-faint); font-size: 14px; }

.candidate-list { display: grid; gap: 10px; }

.candidate-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.candidate-card input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--ink); }
.candidate-card h4 { margin: 0 0 3px; font-size: 17px; }
.candidate-card p { margin: 0 0 4px; color: var(--ink-soft); }
.candidate-card small { color: var(--ink-faint); }

.candidate-card button {
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
}

.candidate-card button:hover { color: var(--warning); }

.connection-note {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  background: #edf2f8;
  color: var(--navy);
}

.connection-note > span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 800;
}

.connection-note p { margin: 0; font-size: 14px; }
.connection-note strong { display: block; }

.monitoring-details { margin-top: 34px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 8px 0 28px; }

.choice-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px;
  padding: 16px;
  border: 1px solid var(--line);
  cursor: pointer;
}

.choice-card:has(input:checked) { border-color: var(--ink); background: #f7f7f3; }
.choice-card input { width: 18px; height: 18px; accent-color: var(--ink); }
.choice-card span { display: flex; flex-direction: column; }
.choice-card small { margin-top: 3px; color: var(--ink-faint); }

.automation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.automation-card {
  position: relative;
  min-height: 210px;
  padding: 22px;
  border: 1px solid var(--line);
}

.automation-card header { display: flex; align-items: center; gap: 12px; padding-right: 88px; }
.automation-card h3 { margin: 0; }
.automation-card header p { margin: 0; color: var(--ink-faint); font-size: 13px; }
.automation-card > p { margin: 28px 0 0; color: var(--ink-soft); }
.automation-card .status-pill { position: absolute; top: 22px; right: 22px; }

.source-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  background: var(--ink);
  color: var(--signal);
  font-weight: 850;
}

.schedule-card {
  display: grid;
  grid-template-columns: 1fr 280px;
  align-items: center;
  gap: 30px;
  margin-top: 14px;
  padding: 24px;
  background: var(--ink);
  color: #fff;
}

.schedule-card .kicker { color: var(--signal); }
.schedule-card h3 { font-size: 30px; }
.schedule-card p { margin-bottom: 0; color: #c8d0da; }
.timezone-field select { border-color: #7d8a99; background-color: #fff; color: var(--ink); }

.safety-contract { margin-top: 14px; padding: 22px 24px; border: 1px solid var(--line); }
.safety-contract ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.safety-contract li { display: flex; gap: 10px; color: var(--ink-soft); }
.safety-contract li span { color: var(--success); font-weight: 850; }

.project-shell { padding-top: 48px; }

.project-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin: 30px 0 46px;
}

.project-hero h1 { margin-bottom: 10px; font-size: clamp(42px, 6vw, 70px); }
.project-hero p:last-child { max-width: 780px; margin-bottom: 0; color: var(--ink-soft); font-size: 18px; }

.project-state-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--navy);
  background: #edf2f8;
}

.project-state-banner.is-active { border-left-color: var(--success); background: var(--success-soft); }
.project-state-banner.is-attention { border-left-color: var(--warning); background: var(--warning-soft); }
.project-state-banner.is-paused { border-left-color: var(--line-strong); background: var(--surface-soft); }

.state-symbol {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-weight: 850;
}

.project-state-banner h2 { margin-bottom: 3px; font-size: 24px; }
.project-state-banner p { margin-bottom: 0; color: var(--ink-soft); }

.project-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(310px, .9fr);
  gap: 20px;
}

.project-main-column,
.project-side-column { display: grid; align-content: start; gap: 20px; }

.detail-section {
  border-top: 4px solid var(--ink);
  background: var(--surface);
  box-shadow: 0 9px 30px rgba(15, 26, 39, .05);
}

.detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.detail-heading .eyebrow { margin-bottom: 3px; }
.detail-heading h2 { margin: 0; font-size: 22px; }
.detail-heading > span { color: var(--ink-faint); font-size: 13px; }

.source-list { display: grid; }

.source-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.source-row:last-child { border-bottom: 0; }
.source-row h3 { margin: 0 0 2px; font-size: 17px; }
.source-row p { margin: 0; color: var(--ink-faint); font-size: 13px; }

.metric-list { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }

.metric-list > div {
  min-height: 100px;
  padding: 18px 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metric-list > div:nth-child(even) { border-right: 0; }
.metric-list dt { margin-bottom: 6px; color: var(--ink-faint); font-size: 13px; }
.metric-list dd { margin: 0; font-weight: 750; }

.history-list { display: grid; }

.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
}

.history-item:last-child { border-bottom: 0; }
.history-item strong { display: block; font-size: 15px; }
.history-item small { color: var(--ink-faint); }
.history-open {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  align-self: center;
  padding: 8px 15px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}
.history-open:hover { background: var(--navy); }

.history-pagination { display: flex; justify-content: center; gap: 9px; padding: 14px 18px 18px; }
.history-pagination button { width: 10px; height: 10px; padding: 0; border: 1px solid var(--ink); border-radius: 50%; background: transparent; cursor: pointer; }
.history-pagination button.is-current { background: var(--ink); }

.history-empty { padding: 28px 22px; color: var(--ink-faint); }
.history-empty p { margin: 0; }

.configuration-panel,
.quality-panel {
  margin-top: 20px;
  border: 1px solid var(--line);
  background: #fff;
}

.configuration-panel summary,
.quality-panel summary { padding: 0 22px; }

.quality-panel summary {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}
.quality-panel summary::-webkit-details-marker { display: none; }
.quality-panel summary span { display: flex; flex-direction: column; }
.quality-panel summary small { color: var(--ink-faint); font-weight: 400; }
.quality-panel summary i { position: relative; width: 22px; height: 22px; }
.quality-panel summary i::before,
.quality-panel summary i::after { position: absolute; left: 4px; top: 10px; width: 14px; height: 2px; background: var(--ink); content: ""; }
.quality-panel summary i::after { transform: rotate(90deg); transition: transform 150ms ease; }
.quality-panel[open] summary i::after { transform: rotate(0); }

.quality-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.quality-item { padding: 20px 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quality-item:nth-child(even) { border-right: 0; }
.quality-item p { margin: 6px 0 0; color: var(--ink-soft); font-size: 14px; }

.configuration-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  padding: 1px 0 0;
  background: var(--line);
}

.configuration-item { min-height: 120px; padding: 20px 22px; background: #fff; }
.configuration-item span { display: block; margin-bottom: 5px; color: var(--ink-faint); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.configuration-item strong { display: block; }
.configuration-item small { color: var(--ink-faint); }

.project-footer-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}

.pause-control {
  min-height: 48px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.pause-control.is-running { background: #16835f; }
.pause-control.is-paused { background: #b42318; }
.pause-control:hover:not(:disabled) { border-color: var(--ink); background: #fff; color: var(--ink); }
.pause-control:disabled { opacity: .55; cursor: wait; }

.competitor-dialog {
  width: min(calc(100% - 32px), 560px);
  padding: 0;
  border: 0;
  border-top: 5px solid var(--ink);
  background: #fff;
  box-shadow: 0 28px 90px rgba(12, 24, 39, .28);
}

.competitor-dialog::backdrop { background: rgba(12, 24, 39, .65); }
.competitor-dialog form { display: grid; gap: 18px; padding: 28px; }

.dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.dialog-heading h2 { margin: 0; }

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.icon-button span { font-size: 24px; line-height: 1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; }

@media (max-width: 920px) {
  .page-heading-split,
  .project-hero { align-items: flex-start; flex-direction: column; }
  .next-run { min-width: 0; width: 100%; }
  .section-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-controls { width: 100%; }
  .search-field { flex: 1; }
  .search-field input { width: 100%; }
  .project-content-grid { grid-template-columns: 1fr; }
  .project-side-column { grid-template-columns: 1fr 1fr; }
  .configuration-body { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .known-competitor-pair { grid-template-columns: 1fr; }
  .known-competitor-pair .icon-button { justify-self: end; }
  .app-header { min-height: 66px; padding: 10px 16px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand small,
  .environment-badge { display: none; }
  .header-actions .button { min-height: 40px; padding: 9px 12px; }
  .page-shell,
  .create-shell { width: min(calc(100% - 28px), var(--content)); padding-top: 40px; }
  .global-message { top: 66px; }
  h1 { font-size: clamp(40px, 13vw, 58px); }
  .heading-copy { font-size: 16px; }
  .page-heading { margin-bottom: 34px; }
  .attention-panel { grid-template-columns: auto 1fr; padding: 18px; }
  .attention-panel .button { grid-column: 1 / -1; width: 100%; }
  .section-toolbar { padding: 20px 18px; }
  .toolbar-controls { align-items: stretch; flex-direction: column; }
  .select-field select { width: 100%; }
  .project-table thead { display: none; }
  .project-table,
  .project-table tbody,
  .project-table tr,
  .project-table td { display: block; width: 100%; }
  .project-table tr { padding: 18px; border-bottom: 1px solid var(--line); }
  .project-table td { padding: 4px 0; border: 0; }
  .project-table td:nth-child(2),
  .project-table td:nth-child(3),
  .project-table td:nth-child(4) { display: inline-flex; margin-right: 12px; }
  .project-table td:nth-child(3)::before { content: "最近发布 "; margin-right: 5px; color: var(--ink-faint); }
  .project-table td:nth-child(4)::before { content: "下次 "; margin-right: 5px; color: var(--ink-faint); }
  .project-table td:has(.row-action) { display: flex; justify-content: flex-end; }
  .project-name-button strong { font-size: 18px; }
  .status-pill { margin: 4px 0; }
  .stepper { grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .step-line { display: none; }
  .stepper-item { grid-template-columns: 30px 1fr; }
  .stepper-item > span { width: 30px; height: 30px; }
  .stepper-item small { display: none; }
  .form-panel { padding: 24px 18px; }
  .question-block { grid-template-columns: 36px 1fr; gap: 12px; }
  .question-number { width: 34px; height: 34px; }
  .intent-field textarea { min-height: 210px; padding: 16px 16px 54px; font-size: 17px; }
  .prompt-examples { align-items: stretch; flex-direction: column; }
  .prompt-examples button { text-align: left; }
  .optional-grid,
  .scope-summary,
  .choice-grid,
  .automation-grid,
  .schedule-card,
  .project-side-column,
  .configuration-body { grid-template-columns: 1fr; }
  .full-span { grid-column: auto; }
  .candidate-heading { align-items: flex-start; flex-direction: column; }
  .candidate-card { grid-template-columns: auto 1fr; }
  .candidate-card > button { grid-column: 2; justify-self: start; }
  .schedule-card { gap: 20px; }
  .form-actions { position: sticky; bottom: 0; z-index: 10; margin: 0 -14px; padding: 12px 14px; border-top: 1px solid var(--line); background: rgba(244, 242, 235, .97); }
  .form-actions > span { display: none; }
  .form-actions .button { margin-left: auto; }
  .form-actions-between .button { margin-left: 0; }
  .project-hero .button { width: 100%; }
  .project-state-banner { grid-template-columns: auto 1fr; padding: 18px; }
  .project-state-banner .button { grid-column: 1 / -1; width: 100%; }
  .metric-list { grid-template-columns: 1fr; }
  .metric-list > div { min-height: 82px; border-right: 0; }
  .project-footer-actions { align-items: flex-start; flex-direction: column; gap: 20px; }
}

@media (max-width: 440px) {
  .app-header { gap: 8px; padding-inline: 12px; }
  .brand { gap: 8px; min-width: 0; }
  .brand-mark { width: 28px; height: 28px; flex: 0 0 28px; }
  .brand strong { max-width: 84px; font-size: 14px; line-height: 1.1; }
  .header-actions { gap: 6px; }
  .header-actions .button { min-height: 36px; padding: 8px 9px; font-size: 12px; white-space: nowrap; }
  .page-shell,
  .create-shell { width: min(calc(100% - 24px), var(--content)); }
  h1 { letter-spacing: -0.05em; }
  .stepper-item strong { font-size: 12px; }
  .project-table td:nth-child(3),
  .project-table td:nth-child(4) { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
html:not([data-access-ready="true"]) body:not(.login-page) { visibility: hidden; }

.access-dialog {
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  scroll-padding-top: 88px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 20px 64px rgb(13 27 44 / 22%);
}
.access-dialog::backdrop { background: rgb(6 19 33 / 50%); }
.access-dialog-head {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.access-dialog-head h2 { margin: 0; font-size: clamp(22px, 3vw, 28px); }
.access-dialog-head .icon-button { width: 40px; height: 40px; border-radius: 10px; }
#access-dialog-title:focus, #access-credential-title:focus { outline: 0; }
.access-dialog-body { display: grid; gap: 16px; padding: 20px 24px 28px; }
.access-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.access-section-heading h3 { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 19px; }
.access-section-heading small, .access-group-head small { color: var(--ink-soft); font-weight: 500; white-space: nowrap; }
#access-add { border-color: #cadba4; background: #e4efcf; color: #24321b; white-space: nowrap; }
#access-add:hover:not(:disabled) { background: #d9e8bd; }
#access-add:active:not(:disabled) { background: #cbdca9; }
.access-message:empty { display: none; }
.access-message { color: var(--ink-soft); font-size: .9rem; }
.access-message[data-tone="success"] { color: var(--success); }
.access-message[data-tone="error"] { color: #9a2d23; }
.access-invite, .access-credential-panel, .access-group {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.access-invite { display: grid; gap: 14px; padding: 16px; }
.access-invite h3, .access-credential-panel h3 { margin: 0; font-size: 17px; }
.access-invite-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.access-invite label { display: grid; gap: 6px; min-width: 0; font-weight: 650; }
.access-invite-fields input, .access-invite-fields select {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}
.access-role-summary { margin: 0; color: var(--ink-soft); font-size: .88rem; }
.access-invite fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.access-invite legend { margin-bottom: 8px; font-weight: 650; }
.access-projects { display: flex; flex-wrap: wrap; gap: 8px; }
.access-invite .access-project-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 500;
}
.access-project-option span { overflow-wrap: anywhere; }
.access-project-option input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--success); }
.access-project-option:has(:checked) { border-color: #90ad83; background: #f1f6e9; }
.access-form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.access-dialog-body:has(.access-project-editor) > :is(.access-section-heading, .access-list, .access-credential-panel) { display: none; }
.access-project-editor { gap: 20px; }
.access-project-role-list { display: grid; max-height: min(50vh, 420px); overflow: auto; padding: 4px; }
.access-project-editor .access-project-role-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 32%);
  align-items: center;
  gap: 16px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.access-project-role-row select { min-width: 0; }
.access-project-editor .access-form-actions { gap: 12px; flex-wrap: wrap; }
@media (max-width: 520px) {
  .access-project-editor .access-project-role-row { grid-template-columns: 1fr; gap: 8px; }
}
.access-list { display: grid; gap: 12px; }
.access-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 9px;
  padding: 10px 14px;
  border-radius: 12px 12px 0 0;
  background: #f8f8f3;
}
.access-group-head p { flex-basis: 100%; margin: 0; color: var(--ink-soft); font-size: .86rem; }
.access-group-label { margin: 0; padding: 3px 8px; border-radius: 6px; background: #eeeee8; font-size: .86rem; }
.access-group-label[data-role="workspace_supervisor"] { background: #ece9f3; color: #483a60; }
.access-group-label[data-role="project_operator"] { background: #e4efe2; color: #2f5237; }
.access-group-label[data-role="client_viewer"] { background: #e8edf2; color: #374e61; }
.access-member {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}
.access-member:has(details[open]) { position: relative; z-index: 1; }
.access-row-copy { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.access-row-copy span, .access-row-copy small { color: var(--ink-soft); }
.access-row-copy span, .access-status { font-size: .85rem; }
.access-row-copy .access-scope { color: var(--ink); }
.access-status { color: var(--ink-soft); white-space: nowrap; }
.access-status.is-active { color: var(--success); }
.access-member-menu { position: relative; }
.access-member-menu summary {
  display: grid;
  place-items: center;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .86rem;
  list-style: none;
  cursor: pointer;
}
.access-member-menu summary::-webkit-details-marker { display: none; }
.access-member-menu summary:hover, .access-member-menu[open] summary { background: var(--surface-soft); }
.access-member-actions {
  position: absolute;
  inset-inline-end: 0;
  inset-block-end: calc(100% + 5px);
  display: grid;
  min-width: max-content;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 20px rgb(13 27 44 / 13%);
}
.access-member-actions button {
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--ink);
  text-align: start;
  cursor: pointer;
}
.access-member-actions button:hover:not(:disabled) { background: var(--surface-soft); }
.access-member-actions .access-disable { color: #9a2d23; }
.access-member-actions button:disabled { color: var(--ink-faint); opacity: .7; cursor: default; }
.access-credential-panel { padding: 14px 16px; }
.access-credential-panel .access-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.access-credential-panel p { margin: 10px 0 0; color: var(--ink-soft); font-size: .85rem; }

@media (max-width: 560px) {
  .access-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .access-dialog-head, .access-dialog-body { padding-inline: 14px; }
  .access-invite-fields { grid-template-columns: minmax(0, 1fr); }
  .access-member { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .access-member > :first-child { grid-column: 1 / -1; }
  .access-member > .access-status { grid-column: 1; grid-row: 3; }
  .access-member-menu { grid-column: 2; grid-row: 2 / span 2; }
}

.login-page { min-height: 100vh; margin: 0; background: #f1eee7; color: #171714; overflow-x: hidden; }
.login-shell { width: 100%; min-height: 100vh; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(420px, .82fr); grid-template-rows: auto 1fr auto; padding: clamp(26px, 3vw, 48px); gap: 32px 7vw; position: relative; overflow: hidden; }
.login-shell::before { content: ""; position: absolute; width: min(54vw, 820px); aspect-ratio: 1; left: -18vw; bottom: -30vw; border: 1px solid rgb(23 23 20 / 12%); border-radius: 50%; box-shadow: 0 0 0 8vw rgb(23 23 20 / 2.5%), 0 0 0 16vw rgb(23 23 20 / 2%); pointer-events: none; }
.login-header { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding-bottom: 22px; border-bottom: 1px solid rgb(23 23 20 / 22%); z-index: 1; }
.login-wordmark { display: inline-flex; align-items: center; gap: 13px; color: inherit; font-size: 16px; font-weight: 850; text-decoration: none; letter-spacing: .04em; }
.login-monogram { width: 34px; height: 34px; display: grid; place-items: center; background: #d9ff35; border-radius: 50%; font: 900 17px/1 Arial, sans-serif; }
.login-edition, .login-footer, .login-card-index, .login-kicker { font-size: 11px; font-weight: 850; letter-spacing: .22em; }
.login-intro { align-self: center; padding: 7vh 0 9vh clamp(10px, 3vw, 52px); z-index: 1; }
.login-kicker { margin: 0 0 28px; color: #58584f; }
.login-intro h1 { max-width: 820px; margin: 0; font-size: clamp(60px, 7.2vw, 116px); line-height: .92; letter-spacing: -.065em; font-weight: 900; }
.login-intro-note { margin: 34px 0 0; color: #58584f; font-size: clamp(16px, 1.6vw, 22px); letter-spacing: .02em; }
.login-card { align-self: center; width: min(100%, 520px); box-sizing: border-box; padding: clamp(34px, 4.5vw, 62px); background: #fbfaf6; border: 1px solid rgb(23 23 20 / 18%); box-shadow: 18px 18px 0 #d9ff35; z-index: 1; }
.login-card-index { margin: 0 0 24px; color: #6f7067; }
.login-card h2 { margin: 0 0 14px; font-size: clamp(34px, 3.5vw, 52px); line-height: 1.04; letter-spacing: -.045em; }
.login-card p:not(.login-card-index):not(.login-message):not(.session-note) { color: #5f6058; line-height: 1.65; }
.login-card form { display: grid; gap: 18px; margin-top: 34px; }
.login-card label { display: grid; gap: 10px; font-size: 13px; font-weight: 800; }
.login-card input { width: 100%; min-height: 62px; box-sizing: border-box; border: 1px solid #2e2e29; background: transparent; padding: 0 18px; font: inherit; font-size: 17px; outline: none; transition: border-color .2s, box-shadow .2s; }
.login-card input:focus { border-color: #171714; box-shadow: 0 0 0 3px rgb(217 255 53 / 65%); }
.login-card .button { width: 100%; min-height: 62px; justify-content: center; background: #171714; color: #fff; border-color: #171714; }
.login-card .button:hover { background: #35352f; }
.login-card .text-button { color: #35352f; }
.session-note, .login-message { margin-top: 20px; color: #74766c; font-size: 13px; line-height: 1.55; }
.login-message { color: #a32d22; font-weight: 750; }
.login-footer { grid-column: 1 / -1; display: flex; justify-content: space-between; color: #6f7067; z-index: 1; }

@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; grid-template-rows: auto auto auto auto; padding: 24px; gap: 34px; overflow: visible; }
  .login-header { padding-bottom: 18px; }
  .login-edition { display: none; }
  .login-intro { padding: 34px 4px 8px; }
  .login-intro h1 { font-size: clamp(48px, 15vw, 74px); }
  .login-intro-note { margin-top: 24px; }
  .login-card { width: calc(100% - 10px); margin-bottom: 20px; padding: 30px 24px 34px; box-shadow: 10px 10px 0 #d9ff35; }
  .login-card h2 { font-size: 38px; }
  .login-footer { padding-top: 10px; }
  .login-footer span:last-child { display: none; }
}

@media (max-width: 420px) {
  .login-shell { padding: 20px; gap: 28px; }
  .login-wordmark { font-size: 14px; }
  .login-intro { padding-top: 24px; }
  .login-kicker { margin-bottom: 20px; font-size: 9px; letter-spacing: .18em; }
  .login-intro h1 { max-width: 7em; font-size: clamp(40px, 13vw, 54px); line-height: .96; }
  .login-card { padding: 28px 22px 32px; }
  .login-card h2 { font-size: 34px; }
}

/* Authentication typography and sign-in layout */
.login-page .login-intro h1 {
  font-size: clamp(34px, 4.7vw, 76px);
  line-height: 1.22;
  letter-spacing: .025em;
  font-weight: 750;
}
.login-page .login-card h2 {
  font-size: clamp(26px, 2.5vw, 36px);
  line-height: 1.3;
  letter-spacing: .015em;
}
.sign-in-page .login-shell {
  width: min(100%, 1460px);
  margin-inline: auto;
  grid-template-rows: auto 1fr;
  grid-template-columns: minmax(0, 1fr) minmax(340px, .78fr);
  column-gap: clamp(32px, 7vw, 100px);
}
.sign-in-page .login-intro { padding-block: 24px; }
.sign-in-page .login-intro-note { margin-top: 18px; font-size: 16px; }
.sign-in-page .login-card {
  width: 100%;
  margin: 0;
  border-radius: 22px;
  border-color: #dedfd4;
  padding: clamp(24px, 4vw, 48px);
  box-shadow: 0 16px 48px rgb(33 41 25 / 8%);
}
.sign-in-page .login-card form { margin-top: 24px; gap: 16px; }
.sign-in-page .login-card input {
  min-height: 50px;
  border: 1px solid #b9bdb2;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 450;
}
.sign-in-page .login-card .button { min-height: 50px; }
@media (max-width: 820px) {
  .sign-in-page .login-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; gap: 20px; align-content: start; }
  .sign-in-page .login-intro { padding: 10px 0 0; }
  .sign-in-page .login-intro h1 { max-width: none; font-size: clamp(28px, 6vw, 42px); }
  .sign-in-page .login-intro-note { margin-top: 10px; }
}

.password-page .login-shell {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: start;
  grid-template-rows: auto 1fr;
}
.password-page .login-header { width: 100%; }
.password-page .login-card { width: min(100%, 460px); }
.password-page .login-card h1 { font-size: 32px; line-height: 1.25; letter-spacing: .015em; }
.password-page #password-choice p { margin-bottom: 22px; }
.password-page #password-form p { margin: 0; }
.password-page .login-card .password-secondary {
  margin-top: 8px;
  color: #414b37;
  background: transparent;
  border-color: transparent;
}
.password-page .login-card .password-secondary:hover { background: #edf0e6; }

/* Workspace overview */
body:has(.view-overview.is-active) {
  background: radial-gradient(ellipse at 90% 3%, #e9f0cf 0, transparent 34%), #f6f5f0;
}
.view-overview .page-shell { padding-block: 40px 64px; }
.view-overview .page-heading { margin-bottom: 24px; align-items: center; gap: 16px; }
.view-overview h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.12;
  letter-spacing: var(--ui-title-tracking);
}
.view-overview .next-run {
  padding: 12px 18px;
  border: 1px solid #dde4cf;
  border-radius: 14px;
  background: #f8faef;
}
.view-overview .project-list-section {
  min-height: 0;
  border: 1px solid #e3e4db;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(30, 39, 24, .06);
}
.view-overview .section-toolbar { padding-block: 18px; }
.view-overview .project-table th { background: #f6f7f2; }
.view-overview .project-table tr:last-child td:first-child { border-bottom-left-radius: 20px; }
.view-overview .project-table tr:last-child td:last-child { border-bottom-right-radius: 20px; }
body:has(.view-overview.is-active) .app-header { background: #fafaf5; }
.project-list-heading [data-action="new-project"] {
  color: #182119;
  border-color: #d5e5ad;
  background: #e4efc4;
  flex-shrink: 0;
  white-space: nowrap;
}
.project-list-heading .button-primary[data-action="new-project"]:enabled:hover {
  background: #d8e8ac;
}
.project-list-heading .button-primary[data-action="new-project"]:enabled:active {
  background: #cbdc96;
  border-color: #b8ca81;
}
.workspace-settings { position: relative; flex-shrink: 0; }
body:not(:has(.view-overview.is-active)) .workspace-settings { display: none; }
.workspace-settings summary { list-style: none; gap: 8px; }
.workspace-settings summary::-webkit-details-marker { display: none; }
.workspace-settings summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg);
}
.workspace-settings[open] summary { background: #edf0e6; }
.workspace-settings-panel {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 184px;
  padding: 8px;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 30px rgb(30 39 24 / 12%);
}
.workspace-team-settings:not(:has(button:not([hidden]))) { display: none; }
.workspace-settings-panel p {
  margin: 6px 10px 3px;
  color: var(--ui-muted);
  font-size: .75rem;
}
.workspace-settings-panel :is(a, button) {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  color: var(--ui-ink);
  background: transparent;
  font: 600 .9rem/1.35 var(--ui-font);
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
.workspace-settings-panel :is(a, button):hover { background: #edf0e6; }
#overview-signout { margin-top: 4px; border-top: 1px solid var(--ui-border); }
.workspace-reports-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: #274458;
  font-size: .9rem;
  font-weight: 700;
  text-underline-offset: 4px;
}
.view-overview .section-toolbar { flex-direction: column; align-items: stretch; gap: 14px; }
.project-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.view-overview .toolbar-controls { align-self: stretch; }
@media (max-width: 700px) {
  .view-overview .page-shell { padding-block: 26px 40px; }
  .view-overview .page-heading { align-items: flex-start; }
}

body { font-family: var(--ui-font); letter-spacing: .012em; }
body :is(h1, h2, h3) { line-height: var(--ui-title-leading); letter-spacing: var(--ui-title-tracking); }
.view h1 { font-size: clamp(30px, 4vw, 48px); }
.view h2 { font-size: clamp(21px, 2.8vw, 32px); }
.view :is(.page-shell, .create-shell) { padding-block: var(--ui-section) 52px; }
.view .page-heading { margin-bottom: 24px; }
.view .project-list-section { min-height: 0; border-radius: var(--ui-radius); }
.view .empty-state { min-height: 0; padding-block: 28px; }
.project-naming-field { display: grid; gap: 8px; max-width: 520px; margin-block: 18px; }
.project-naming-field > span { font-weight: 700; }
.project-naming-field input {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: #fff;
  color: var(--ui-ink);
  font: inherit;
}
.project-naming-field small { color: var(--ui-muted); }

.view-create .create-shell { padding-block: clamp(20px, 3vw, 36px) 52px; }
.view-create .create-heading { margin-bottom: 16px; }
.view-create .create-heading h1 { margin-bottom: 0; font-size: clamp(26px, 3.5vw, 38px); }
.view-create .stepper { margin-bottom: 18px; }
.view-create .stepper-item > span { width: 28px; height: 28px; }
.view-create .form-panel {
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: 0 8px 24px rgb(30 39 24 / 6%);
}
.view-create .question-block { margin-bottom: 16px; }
.view-create .question-block-intent { display: block; }
.view-create .question-block h2 { font-size: clamp(20px, 2.5vw, 26px); }
.view-create .intent-field textarea {
  min-height: 132px;
  padding: 14px 14px 44px;
  border: 1px solid #aab7b0;
  border-radius: 12px;
  font-size: 16px;
}
.view-create .field-footer { min-height: 36px; padding-block: 6px; border-radius: 0 0 10px 10px; }
.view-create .form-actions { margin-inline: 0; gap: 10px; flex-wrap: wrap; }
.create-leave-dialog {
  width: min(440px, calc(100% - 32px));
  padding: 24px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  color: var(--ui-ink);
  background: #fff;
}
.create-leave-dialog::backdrop { background: rgb(22 35 29 / 35%); }
.create-leave-dialog h2 { font-size: 21px; margin-bottom: 8px; }
.create-leave-dialog p { color: var(--ui-muted); }
.create-leave-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }

.view-project :is(.detail-section, .configuration-panel, .quality-panel) {
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  overflow: hidden;
}
.project-reports-panel { margin-bottom: 20px; }
.project-reports-panel .history-item { align-items: center; }
.project-reports-panel .history-empty { padding: 16px 22px; color: var(--ui-muted); }
.project-reports-panel .history-empty p { margin: 0; }
.report-period { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.latest-period-tag { padding: 3px 8px; border-radius: 6px; background: #edf3e2; color: #405432; font-size: 12px; }
.project-report-link {
  min-height: 44px;
  padding: 8px 13px;
  font-size: .9rem;
  font-weight: 700;
}
.project-report-link { color: #274458; background: transparent; border-color: transparent; }
.project-report-link:hover { background: #edf0e6; }
.project-report-link.is-latest {
  background: #e4efc4;
  border-color: #cedda8;
  color: #253519;
}
.project-report-link.is-latest:hover { background: #d8e8ac; }
.project-report-link.is-latest:active { background: #cbdc96; }
.schedule-actions { display: flex; justify-content: flex-end; padding: 12px 18px; }
.schedule-actions:has(> [hidden]) { display: none; }
.view-project .project-side-column { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 921px) {
  .view-project .project-side-column { grid-column: 2; grid-row: 1; }
  .view-project .project-main-column { grid-column: 1; grid-row: 1; }
}
@media (max-width: 480px) {
  .app-header:has(#create-overview-back:not([hidden])) .brand small { display: none; }
  .app-header:has(#create-overview-back:not([hidden])) .brand { gap: 6px; }
  .app-header:has(#create-overview-back:not([hidden])) { gap: 6px; }
}
