:root {
  color-scheme: light;
  --ink: #17221d;
  --muted: #68736d;
  --paper: #f4f1e8;
  --panel: #fffdf7;
  --line: #dcd8cc;
  --green: #176b4d;
  --green-dark: #0f513b;
  --green-soft: #dcebe3;
  --amber-soft: #f4e8c5;
  --red: #9b3f3f;
  --red-soft: #f5e3df;
  --shadow: 0 22px 60px rgba(29, 42, 35, 0.09);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(rgba(23, 107, 77, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 107, 77, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 52px 0 28px;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 36px;
}

.brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--green);
  border-radius: 18px;
  background: var(--green);
  color: white;
  font-family: Georgia, serif;
  font-size: 31px;
  box-shadow: 0 8px 24px rgba(23, 107, 77, 0.18);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

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

h1 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.45rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 20px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: var(--shadow);
  padding: 28px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

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

.affordance-copy {
  margin: -5px 0 20px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.terminal-state {
  display: grid;
  min-height: 176px;
  place-items: center;
  border: 1px dashed #c9c5ba;
  border-radius: 16px;
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.terminal-state p {
  max-width: 34ch;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
}

.field {
  margin-bottom: 17px;
}

.field label {
  display: block;
  margin: 0 0 8px;
  color: #414c46;
  font-size: 0.81rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  transition: border-color 130ms ease, box-shadow 130ms ease;
}

.field textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
  line-height: 1.45;
  transition: border-color 130ms ease, box-shadow 130ms ease;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 107, 77, 0.12);
}

.money-input {
  display: flex;
  align-items: center;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color 130ms ease, box-shadow 130ms ease;
}

.money-input:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 107, 77, 0.12);
}

.money-input span {
  padding-left: 14px;
  color: var(--muted);
}

.money-input input,
.money-input input:focus {
  height: 46px;
  border: 0;
  box-shadow: none;
  padding-left: 6px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 7px;
}

.actions .button {
  flex: 1;
}

.button {
  min-height: 45px;
  border-radius: 12px;
  padding: 0 18px;
  font-size: 0.88rem;
  font-weight: 750;
  transition: transform 130ms ease, background 130ms ease;
}

.button:not(:disabled):active {
  transform: translateY(1px);
}

.button.primary {
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
}

.button.primary:hover:not(:disabled) {
  background: var(--green-dark);
}

.button.secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.button.secondary:hover:not(:disabled) {
  border-color: #aaa69b;
  background: #f5f2ea;
}

.button.danger {
  border: 1px solid #d9b9b3;
  background: transparent;
  color: var(--red);
}

.button.danger:hover:not(:disabled) {
  background: var(--red-soft);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 8px 0;
  font-size: 0.83rem;
  font-weight: 800;
}

.status {
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.72rem;
  font-weight: 800;
}

.status.idle {
  background: var(--green-soft);
  color: var(--green-dark);
}

.status.working {
  background: var(--amber-soft);
  color: #735c20;
}

.notice {
  margin: 18px 0 0;
  border-radius: 11px;
  padding: 12px 14px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.notice.info {
  background: #eeeae0;
  color: #59635d;
}

.notice.success {
  background: var(--green-soft);
  color: var(--green-dark);
}

.notice.error {
  background: var(--red-soft);
  color: #7f3434;
}

.empty-state {
  display: grid;
  min-height: 216px;
  place-items: center;
  align-content: center;
  border: 1px dashed #c9c5ba;
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.empty-state p {
  margin: 8px 0 4px;
  color: var(--ink);
  font-weight: 750;
}

.empty-state span:last-child {
  font-size: 0.8rem;
}

.empty-icon {
  color: var(--green);
  font-size: 2rem;
}

.state-card {
  min-height: 216px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 20px;
}

.state-title {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 22px;
}

.state-title p {
  margin: 0 0 2px;
  font-weight: 800;
}

.state-title span:not(.state-dot) {
  color: var(--muted);
  font-size: 0.74rem;
}

.state-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.state-dot.cancelled {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft);
}

.details {
  display: grid;
  gap: 12px;
}

.detail {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  align-items: baseline;
}

.detail > span {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
}

.detail p {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.divider {
  height: 1px;
  margin: 24px 0;
  background: var(--line);
}

.process-card {
  margin-top: 2px;
}

.process-grid {
  display: grid;
  gap: 9px;
}

.model-caption {
  margin: 17px 0 10px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.transition-list {
  display: grid;
  gap: 7px;
}

.transition-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 11px;
}

.transition-row span {
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.transition-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.ai-adviser {
  margin-top: 2px;
}

.ai-copy {
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.ai-button {
  width: 100%;
}

.ai-progress {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.ai-result {
  margin-top: 16px;
  border: 1px solid #bfd7ca;
  border-radius: 14px;
  background: var(--green-soft);
  padding: 15px;
}

.ai-result p {
  margin-bottom: 9px;
  font-size: 0.82rem;
  line-height: 1.48;
}

.ai-result-label {
  color: var(--green-dark);
  font-weight: 800;
}

.ai-result .confidence {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.ai-result .suggested-argument {
  border-left: 2px solid var(--green);
  padding-left: 10px;
}

.ai-result .stale-warning {
  color: var(--red);
  font-weight: 750;
}

.use-suggestion {
  width: 100%;
  margin-top: 13px;
  background: #fff;
}

footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 28px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
}

.footer-separator {
  color: var(--green);
}

@media (max-width: 780px) {
  .shell {
    width: min(100% - 24px, 620px);
    padding-top: 28px;
  }

  .site-header {
    align-items: flex-start;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 26px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 22px;
  }
}

@media (max-width: 480px) {
  .field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
