:root {
  color-scheme: light;
  --ink: #181716;
  --muted: #66635f;
  --line: #dedbd7;
  --line-strong: #bdb8b2;
  --surface: #ffffff;
  --subtle: #f8f7f5;
  --accent: #ef6c00;
  --accent-dark: #c85500;
  --danger: #b42318;
  --focus: #1f67d8;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-size: 15px;
  line-height: 1.5;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 32%, transparent);
  outline-offset: 2px;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  position: relative;
  z-index: 10;
}

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

.brand-name {
  color: var(--accent);
  font-size: 24px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.brand-divider { width: 1px; height: 24px; background: var(--line); }
.product-name { font-size: 15px; font-weight: 650; }

.text-button, .icon-button {
  border: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 650;
}

.text-button { padding: 10px 0 10px 16px; }
.text-button:hover { color: var(--accent-dark); }

.login-layout {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 72px 24px 96px;
  position: relative;
  overflow: hidden;
}

.login-panel {
  width: min(100%, 520px);
  padding: 50px 48px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  position: relative;
  z-index: 2;
}

.login-panel h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.045em;
  text-align: center;
}

.login-copy {
  margin: 16px 0 40px;
  color: var(--muted);
  font-size: 17px;
  text-align: center;
}

label {
  display: block;
  margin: 18px 0 7px;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  padding: 11px 12px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input, select { min-height: 44px; }
textarea { resize: vertical; min-height: 96px; }
input:hover, textarea:hover, select:hover { border-color: #8f8a84; }
input:focus, textarea:focus, select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 14%, transparent);
  outline: 0;
}

.password-field { position: relative; }
.password-field input { padding-right: 68px; }
.icon-button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 7px 8px;
  color: var(--muted);
  font-size: 12px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 19px 0;
  color: #3d3b38;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.primary-button {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 15px;
  font-weight: 740;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.primary-button:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.primary-button:active:not(:disabled) { transform: translateY(1px); }
.primary-button:disabled { cursor: wait; opacity: 0.62; }

.form-error {
  margin: 12px 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.privacy-line {
  position: absolute;
  bottom: 26px;
  left: 24px;
  right: 24px;
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.orbit {
  position: absolute;
  width: 520px;
  height: 520px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: 50%;
  opacity: 0.8;
}

.orbit::before, .orbit::after {
  content: "";
  position: absolute;
  inset: 62px;
  border: 1px solid #ece8e3;
  border-radius: inherit;
}
.orbit::after { inset: 150px; border-style: dashed; }
.orbit-left { left: -360px; bottom: -250px; }
.orbit-right { right: -350px; top: 50px; }

.app-layout {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 376px minmax(0, 1fr);
}

.input-rail {
  border-right: 1px solid var(--line);
  background: #fdfcfb;
  padding: 24px;
  overflow-y: auto;
}

.input-rail h1 {
  margin: 0 0 16px;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.input-rail label { margin-top: 14px; }
.input-rail label span[aria-hidden] { color: var(--danger); }
.input-rail input, .input-rail textarea, .input-rail select { font-size: 13px; }
.input-rail textarea { line-height: 1.4; }

.two-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.v2-check { margin-bottom: 14px; }
.run-button { min-height: 46px; }

.classification-lock {
  display: grid;
  gap: 2px;
  margin: 15px 0 2px;
  padding: 11px 12px;
  border: 1px solid #d9d3cc;
  border-radius: 8px;
  background: #f5f2ee;
  font-size: 12px;
}

.classification-lock span { color: var(--muted); font-size: 11px; }

.quota-summary {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

.quota-summary strong { color: var(--ink); font-weight: 700; }
.rail-note { margin: 7px 0 0; color: var(--muted); font-size: 11px; }

.field-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.place-picker { position: relative; }

.place-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(34, 28, 22, 0.14);
}

.place-option {
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-size: 12px;
  line-height: 1.4;
}

.place-option:hover, .place-option[aria-selected="true"] {
  background: #fff4e9;
}

.rail-card {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.section-heading-row, .api-examples-heading, .curl-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rail-card h2, .api-examples h2 { margin: 0; font-size: 17px; }
.rail-card-copy { margin: 12px 0 14px; color: var(--muted); font-size: 12px; }

.safe-badge {
  padding: 4px 8px;
  border: 1px solid #c8dfca;
  border-radius: 999px;
  color: #25622d;
  background: #f2faf3;
  font-size: 10px;
  font-weight: 750;
}

.prompt-profile-panel {
  margin: 0 0 15px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f5;
}

.prompt-profile-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.prompt-profile-badge {
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 10px;
  letter-spacing: normal;
  text-transform: none;
}

.prompt-profile-badge[data-tone="safe"] {
  border-color: #c8dfca;
  color: #25622d;
  background: #f2faf3;
}

.prompt-profile-badge[data-tone="warning"] {
  border-color: #e8bf86;
  color: #864a00;
  background: #fff7ea;
}

.prompt-profile-panel p {
  margin: 9px 0 5px;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.45;
}

.prompt-profile-panel small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.secondary-button {
  width: 100%;
  min-height: 43px;
  margin-top: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
}

.secondary-button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-dark); }
.secondary-button:disabled, .primary-button:disabled { cursor: not-allowed; opacity: 0.58; }

.sample-copy {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.sample-button {
  margin: 0 0 17px;
  min-height: 38px;
}

.responses {
  min-width: 0;
  padding: 26px 28px 30px;
  background: var(--surface);
}

.responses-heading {
  min-height: 31px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.responses-heading h2 { margin: 0; font-size: 17px; letter-spacing: -0.02em; }
.status-text { color: var(--muted); font-size: 12px; }

.response-grid {
  min-height: calc(100vh - 135px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.api-examples {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.api-note { max-width: 840px; margin: 10px 0 18px; color: var(--muted); font-size: 12px; }
.api-note code, .rail-card code { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.curl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.curl-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--subtle);
}

.curl-card-heading { padding: 13px 15px; border-bottom: 1px solid var(--line); background: var(--surface); }
.curl-card h3 { margin: 0; font-size: 13px; }
.curl-card pre { margin: 0; padding: 16px; overflow-x: auto; color: #f9f7f3; background: #211f1d; font-size: 11px; line-height: 1.55; }
.curl-card code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.copy-button {
  min-width: 58px;
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
}

.copy-button:hover { border-color: var(--accent); color: var(--accent-dark); }

.response-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.response-panel + .response-panel { border-left: 1px solid var(--line); }
.response-panel h3 { margin: 0 0 22px; font-size: 15px; }

.response-copy {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #262421;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.72;
}

.response-meta {
  display: grid;
  grid-template-columns: 1.25fr 0.8fr 0.8fr;
  gap: 18px;
  margin: auto 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.response-meta div { min-width: 0; }
.response-meta dt { color: var(--muted); font-size: 11px; }
.response-meta dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 12px; }

.empty-state {
  min-height: 300px;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
  padding: 30px;
}

.empty-state p { max-width: 400px; margin: 9px auto 0; }
.external-state strong { color: var(--ink); font-size: 16px; }

.clock-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 20px;
  border: 2px dashed var(--accent);
  border-radius: 50%;
  position: relative;
}

.clock-mark::before, .clock-mark::after {
  content: "";
  position: absolute;
  left: 28px;
  top: 15px;
  width: 2px;
  height: 14px;
  background: var(--accent);
  transform-origin: bottom;
}
.clock-mark::after { transform: rotate(125deg); height: 11px; }

.provider-error {
  margin: 0;
  padding: 14px;
  border-left: 3px solid var(--danger);
  color: #76221a;
  background: #fff6f4;
  font-size: 13px;
}

.loading-state { padding: 28px 0; }
.loading-state span {
  display: block;
  height: 12px;
  margin-bottom: 14px;
  border-radius: 4px;
  background: #ebe7e2;
  animation: loading 1.4s ease-in-out infinite;
}
.loading-state span:nth-child(2) { width: 92%; }
.loading-state span:nth-child(3) { width: 96%; }
.loading-state span:nth-child(4) { width: 72%; }

@keyframes loading { 50% { opacity: 0.45; } }

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

@media (max-width: 1100px) {
  .app-layout { grid-template-columns: 340px minmax(0, 1fr); }
  .response-grid { grid-template-columns: 1fr; }
  .response-panel + .response-panel { border-left: 0; border-top: 1px solid var(--line); }
  .response-grid { min-height: auto; }
  .curl-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .topbar { height: 58px; padding: 0 18px; }
  .brand { gap: 10px; }
  .brand-name { font-size: 20px; }
  .brand-divider { height: 18px; }
  .product-name { font-size: 13px; }
  .login-layout { min-height: calc(100vh - 58px); padding: 40px 18px 86px; }
  .login-panel { padding: 34px 24px; }
  .orbit { display: none; }
  .app-layout { display: block; }
  .input-rail { border-right: 0; border-bottom: 1px solid var(--line); padding: 22px 18px 26px; }
  .responses { padding: 22px 18px; }
  .response-panel { padding: 20px; }
  .response-meta { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .product-name, .brand-divider { display: none; }
  .two-fields { grid-template-columns: 1fr; gap: 0; }
  .responses-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
}
