@font-face {
  font-family: SUIT;
  src: url("/fonts/SUIT-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --ink: #17231f;
  --ink-raised: #21312b;
  --ink-line: #385047;
  --ivory: #f7f3e9;
  --paper: #fffdf7;
  --paper-muted: #e8e5da;
  --teal: #19ae91;
  --teal-deep: #08745f;
  --lime: #d5ed52;
  --coral: #ef8c70;
  --muted: #a8b7ae;
  --danger: #c54d39;
  --shadow: 0 24px 50px rgb(12 24 19 / 15%);
  font-family:
    SUIT, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--ink);
  color: var(--ivory);
  overflow-wrap: anywhere;
}

button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.page-shell {
  width: min(100% - 48px, 1180px);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 10;
  inset: 12px auto auto 12px;
  padding: 10px 14px;
  transform: translateY(-150%);
  background: var(--lime);
  color: var(--ink);
  font-weight: 800;
}

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

:where(a, button, input):focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 4px;
}

.site-header {
  border-block-end: 1px solid var(--ink-line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-block-size: 72px;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ivory);
  font-size: 1.1rem;
  font-weight: 850;
  letter-spacing: -0.04em;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  inline-size: 29px;
  block-size: 29px;
  color: var(--teal);
}
.brand-mark svg {
  inline-size: 100%;
  block-size: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}
.header-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}
.header-label span {
  margin-inline-end: 7px;
  color: var(--teal);
}

.hero {
  padding-block: clamp(24px, 2.5vw, 32px) 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(250px, 0.62fr);
  align-items: end;
  gap: 32px;
}
.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1,
h2,
h3,
h4,
p {
  text-wrap: pretty;
}
h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(3.8rem, 6.7vw, 6.4rem);
  font-weight: 870;
  letter-spacing: -0.085em;
  line-height: 0.86;
}
h1 em {
  color: var(--lime);
  font-style: normal;
}
.hero-copy {
  max-width: 350px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.7;
}

.journey {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: clamp(28px, 3vw, 36px) 0 0;
  padding: 0;
  border-block: 1px solid var(--ink-line);
  list-style: none;
}
.journey li {
  display: flex;
  min-block-size: 64px;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-inline-start: 1px solid var(--ink-line);
}
.journey li:first-child {
  border-inline-start: 0;
}
.journey span {
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 800;
}
.journey strong {
  color: var(--ivory);
  font-size: 0.97rem;
}

.workspace {
  margin-block-start: clamp(24px, 2.5vw, 32px);
  margin-block-end: clamp(56px, 10vw, 104px);
  color: var(--ink);
}
.workspace-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.62fr);
  gap: 22px;
  padding: clamp(14px, 1vw, 16px);
  background: var(--lime);
}
.workspace .section-kicker {
  color: var(--teal-deep);
}
h2 {
  margin: 0;
  font-size: clamp(2.05rem, 3vw, 2.45rem);
  font-weight: 860;
  letter-spacing: -0.07em;
  line-height: 0.98;
}
.workspace-intro > p {
  align-self: end;
  max-width: 395px;
  margin: 0;
  color: #294238;
  font-size: 1rem;
  line-height: 1.7;
}

.setup-notice,
.loading-state,
.error-state {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px clamp(20px, 4vw, 34px);
  background: var(--paper-muted);
  border-inline: 1px solid #d9d5c8;
  border-block-end: 1px solid #d9d5c8;
}
.setup-notice strong,
.error-state strong {
  display: block;
  font-size: 1rem;
}
.setup-notice p,
.error-state p {
  margin: 5px 0 0;
  color: #52645b;
  font-size: 0.91rem;
  line-height: 1.55;
}
.notice-mark {
  display: grid;
  flex: 0 0 auto;
  inline-size: 28px;
  block-size: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--lime);
  font-weight: 900;
}
.setup-notice .text-button {
  margin-inline-start: auto;
}
.loading-state {
  color: #52645b;
  font-size: 0.95rem;
}
.loading-line {
  inline-size: 32px;
  block-size: 2px;
  background: linear-gradient(
    90deg,
    var(--teal) 0 35%,
    transparent 35% 48%,
    var(--teal) 48% 100%
  );
  animation: loading-shift 1s linear infinite;
}
.error-state {
  justify-content: space-between;
  border-color: #e9b4a9;
  background: #fff0eb;
}
.error-state strong {
  color: #822f22;
}

.start-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  gap: 24px;
  padding: clamp(20px, 2vw, 24px);
  background: var(--paper);
  border: 1px solid #d9d5c8;
  border-block-start: 0;
  box-shadow: var(--shadow);
}
.start-panel h3,
.run-history h3,
.run-detail h3 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.5rem);
  font-weight: 840;
  letter-spacing: -0.06em;
  line-height: 1.05;
}
.start-panel-copy > p:last-child {
  max-width: 480px;
  margin: 16px 0 0;
  color: #52645b;
  line-height: 1.65;
}
.start-actions {
  display: grid;
  align-content: end;
  gap: 18px;
}
.retry-choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-block-size: 44px;
  padding: 11px 0;
  color: var(--ink);
  cursor: pointer;
}
.retry-choice input {
  flex: 0 0 auto;
  inline-size: 20px;
  block-size: 20px;
  margin: 1px 0 0;
  accent-color: var(--teal-deep);
}
.retry-choice strong,
.retry-choice small {
  display: block;
}
.retry-choice strong {
  font-size: 0.93rem;
  line-height: 1.45;
}
.retry-choice small {
  margin-top: 3px;
  color: #607169;
  font-size: 0.78rem;
  line-height: 1.45;
}

.primary-button,
.secondary-button,
.text-button,
.icon-button {
  border: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}
.primary-button {
  display: inline-flex;
  min-block-size: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 14px 18px 14px 22px;
  background: var(--teal);
  color: var(--ink);
  font-size: 1rem;
}
.primary-button:hover:not(:disabled) {
  background: #2ec7a7;
  transform: translateY(-2px);
}
.secondary-button {
  min-block-size: 46px;
  padding: 11px 15px;
  background: var(--ink);
  color: var(--ivory);
  font-size: 0.9rem;
}
.secondary-button:hover:not(:disabled) {
  background: var(--teal-deep);
}
.text-button {
  min-block-size: 44px;
  padding: 8px 0;
  background: transparent;
  color: inherit;
  font-size: 0.9rem;
  text-align: start;
}
.text-button:hover:not(:disabled) {
  color: var(--teal-deep);
}
.icon-button {
  display: grid;
  min-inline-size: 44px;
  min-block-size: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid #d3d0c5;
  background: transparent;
  color: var(--ink);
  font-size: 1.2rem;
}
.icon-button:hover:not(:disabled) {
  border-color: var(--teal-deep);
  color: var(--teal-deep);
}

.return-notice,
.action-status {
  margin: 0;
}
.return-notice {
  padding: 16px clamp(20px, 4vw, 34px);
  border-inline: 1px solid #d9d5c8;
  border-block-end: 1px solid #d9d5c8;
  background: #e4f5dd;
  color: #175440;
  font-size: 0.92rem;
  font-weight: 700;
}
.action-status {
  min-block-size: 1.5em;
  padding: 15px clamp(20px, 4vw, 34px) 0;
  color: #52645b;
  font-size: 0.88rem;
}
.action-status[data-tone="error"] {
  color: #9d3929;
}

.run-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.44fr) minmax(0, 1fr);
  border: 1px solid #d9d5c8;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.run-history {
  min-block-size: 520px;
  padding: clamp(22px, 3vw, 34px);
  border-inline-end: 1px solid #d9d5c8;
  background: #f0eee6;
}
.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.run-history h3 {
  font-size: 1.45rem;
}
.run-list {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}
.run-card {
  width: 100%;
  padding: 17px 16px;
  border: 1px solid #d8d5ca;
  background: transparent;
  color: var(--ink);
  text-align: start;
}
.run-card:hover {
  border-color: var(--teal-deep);
}
.run-card[aria-current="true"] {
  border-color: var(--teal-deep);
  background: var(--ink);
  color: var(--ivory);
}
.run-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.run-card strong {
  font-size: 0.93rem;
}
.run-card time {
  display: block;
  margin-top: 10px;
  color: #607169;
  font-size: 0.78rem;
}
.run-card[aria-current="true"] time {
  color: #b5c9be;
}
.mini-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid currentColor;
  color: var(--teal-deep);
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.run-card[aria-current="true"] .mini-status {
  color: var(--lime);
}
.empty-list {
  margin: 0;
  color: #607169;
  font-size: 0.91rem;
  line-height: 1.6;
}

.run-detail {
  min-inline-size: 0;
  padding: clamp(24px, 4vw, 50px);
}
.empty-run {
  display: grid;
  align-content: center;
  min-block-size: 420px;
  max-width: 470px;
}
.empty-number {
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 850;
}
.empty-run h3 {
  margin-top: 14px;
}
.empty-run p {
  margin: 16px 0 0;
  color: #607169;
  line-height: 1.65;
}
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.detail-header h3 {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
}
.status-badge,
.callback-badge {
  display: inline-flex;
  align-items: center;
  min-block-size: 29px;
  padding: 5px 9px;
  border: 1px solid currentColor;
  color: var(--teal-deep);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-badge[data-status="error"] {
  color: var(--danger);
}
.status-badge[data-status="confirmed"] {
  color: var(--teal-deep);
  background: #dff6ec;
}
.status-badge[data-status="learning"] {
  color: #736100;
  background: #fff7cc;
}
.status-badge[data-status="callback_received"] {
  color: #1b6574;
  background: #def4f6;
}
.callback-badge {
  color: #607169;
}
.callback-badge[data-state="received"] {
  color: var(--teal-deep);
  background: #dff6ec;
}
.callback-badge[data-state="attention"] {
  color: #855d00;
  background: #fff5c5;
}

.run-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 34px 0 0;
  border-block: 1px solid #ddd9cd;
}
.run-meta div {
  min-inline-size: 0;
  padding: 15px 14px 15px 0;
  border-inline-end: 1px solid #ddd9cd;
}
.run-meta div + div {
  padding-inline-start: 14px;
}
.run-meta div:last-child {
  border-inline-end: 0;
}
.run-meta dt {
  color: #607169;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.run-meta dd {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.45;
  word-break: break-all;
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 24px;
}
.detail-section {
  margin-top: 38px;
  padding-top: 30px;
  border-top: 1px solid #ddd9cd;
}
.detail-section h4 {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 830;
  letter-spacing: -0.04em;
}
.event-list,
.result-content {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}
.empty-events,
.empty-result {
  margin: 0;
  padding: 20px;
  border-inline-start: 3px solid #d8d5ca;
  background: #f3f2ec;
  color: #607169;
  font-size: 0.9rem;
  line-height: 1.6;
}
.event-card {
  border: 1px solid #ddd9cd;
}
.event-card summary {
  display: flex;
  min-block-size: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
}
.event-card summary::-webkit-details-marker {
  display: none;
}
.event-name {
  color: var(--ink);
  font-size: 0.91rem;
  font-weight: 800;
}
.event-meta {
  color: #607169;
  font-size: 0.75rem;
}
.event-disposition {
  flex: 0 0 auto;
  padding: 4px 6px;
  color: var(--teal-deep);
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.event-card pre,
.result-content pre {
  max-inline-size: 100%;
  max-block-size: 330px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border-top: 1px solid #ddd9cd;
  background: #17231f;
  color: #e5efe9;
  font:
    500 0.76rem/1.65 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.result-content pre {
  border-top: 0;
}

.site-footer {
  border-top: 1px solid var(--ink-line);
}
.site-footer > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-block: 24px max(24px, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.78rem;
}

@keyframes loading-shift {
  to {
    background-position: 32px;
  }
}

@media (max-width: 780px) {
  .page-shell {
    width: min(100% - 32px, 1180px);
  }
  .header-inner {
    min-block-size: 64px;
  }
  .hero-grid,
  .workspace-intro,
  .start-panel,
  .run-layout {
    grid-template-columns: 1fr;
  }
  .hero-copy {
    margin-top: 22px;
  }
  .journey {
    grid-template-columns: repeat(2, 1fr);
  }
  .journey li:nth-child(3) {
    border-inline-start: 0;
    border-top: 1px solid var(--ink-line);
  }
  .journey li:nth-child(4) {
    border-top: 1px solid var(--ink-line);
  }
  .workspace-intro {
    gap: 22px;
  }
  .setup-notice {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .setup-notice .text-button {
    margin-inline-start: 46px;
  }
  .start-panel {
    gap: 26px;
  }
  .run-history {
    min-block-size: auto;
    border-block-end: 1px solid #d9d5c8;
    border-inline-end: 0;
  }
  .run-list {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }
  .empty-run {
    min-block-size: 260px;
  }
  .run-meta {
    grid-template-columns: 1fr;
  }
  .run-meta div,
  .run-meta div + div {
    padding: 14px 0;
    border-block-end: 1px solid #ddd9cd;
    border-inline-end: 0;
  }
  .run-meta div:last-child {
    border-block-end: 0;
  }
}

@media (max-width: 430px) {
  .page-shell {
    width: min(100% - 28px, 1180px);
  }
  .header-label {
    font-size: 0.76rem;
  }
  .brand {
    font-size: 1rem;
  }
  h1 {
    font-size: clamp(3.1rem, 17vw, 4.4rem);
  }
  .journey li {
    min-block-size: 76px;
    gap: 9px;
    padding: 13px 10px;
  }
  .journey strong {
    font-size: 0.8rem;
  }
  .journey span {
    font-size: 0.66rem;
  }
  .start-panel,
  .workspace-intro,
  .run-history,
  .run-detail {
    padding: 24px 20px;
  }
  .detail-header {
    align-items: flex-end;
  }
  .status-badge {
    font-size: 0.62rem;
  }
  .site-footer > div {
    display: grid;
  }
}

@media (pointer: coarse) {
  .primary-button {
    min-block-size: 56px;
  }
  .secondary-button,
  .text-button,
  .icon-button {
    min-block-size: 44px;
  }
  .run-card {
    min-block-size: 76px;
  }
}

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

@media (forced-colors: active) {
  .status-badge,
  .callback-badge,
  .mini-status {
    border: 1px solid CanvasText;
  }
}
