:root {
  --ff-brand: #334f60;
  --ff-brand-deep: #234558;
  --ff-accent: #98ae55;
  --ff-bg: #f3f3f3;
  --ff-surface: #ffffff;
  --ff-border: #e1e1e1;
  --ff-text: #030303;
  --ff-text-muted: #556a77;
  --ff-success-bg: #ecfdf5;
  --ff-success-border: #6ee7b7;
  --ff-radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  margin: 0;
  padding: 24px 16px 40px;
  background: var(--ff-bg);
  color: var(--ff-text);
  line-height: 1.5;
}

main {
  max-width: 920px;
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--ff-brand);
  color: #fff;
  z-index: 1000;
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
  color: var(--ff-brand);
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--ff-brand-deep);
}

h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

p {
  margin-top: 0;
}

.concept-preview-banner {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  border-radius: var(--ff-radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.guide-box {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: var(--ff-radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.55;
  color: #134e4a;
}

.guide-box h2 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #0f766e;
}

.guide-box ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.guide-box li {
  margin-bottom: 6px;
}

.field-hint {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--ff-text-muted);
  max-width: 320px;
  line-height: 1.4;
  margin-top: 4px;
}

label {
  display: inline-flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  gap: 4px;
  align-self: flex-start;
}

.tz-custom-row {
  display: none;
  flex-basis: 100%;
  margin-top: 4px;
}

.tz-custom-row.visible {
  display: flex;
}

.quick-hint {
  font-size: 13px;
  color: var(--ff-text-muted);
  margin: 0 0 12px;
  line-height: 1.45;
}

.custom-time-temp-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ff-border);
}

.custom-time-temp-hero img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--ff-border);
  background: #f9fafb;
  flex-shrink: 0;
}

.custom-time-temp-hero h2 {
  margin: 0;
  font-size: 18px;
}

.card {
  background: var(--ff-surface);
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(3, 3, 3, 0.04);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  align-items: flex-end;
}

input,
select {
  font: inherit;
  padding: 9px 10px;
  border: 1px solid #c5ccd3;
  border-radius: 8px;
  min-width: 200px;
  background: #fff;
}

input:focus,
select:focus,
button:focus,
a.query-link:focus {
  outline: 2px solid #7fafd0;
  outline-offset: 2px;
}

a.query-link,
button {
  display: inline-block;
  text-decoration: none;
  border: 1px solid var(--ff-brand);
  background: var(--ff-brand);
  color: #ffffff;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}

a.query-link.secondary,
button.secondary-btn {
  background: #ffffff;
  color: var(--ff-brand);
}

a.query-link.disabled,
button:disabled {
  opacity: 0.45;
  pointer-events: none;
}

pre {
  margin: 0;
  background: #111827;
  color: #f3f4f6;
  border-radius: 10px;
  padding: 14px;
  overflow-x: auto;
  min-height: 120px;
  font-size: 12px;
  line-height: 1.45;
}

.meta {
  font-size: 13px;
  color: var(--ff-text-muted);
  margin-bottom: 8px;
}

.hidden {
  display: none;
}

/* Protected workflow — partner demo surface */
.protected-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--ff-border);
}

.protected-topbar-logo {
  height: 28px;
  width: auto;
}

.protected-topbar-brand {
  font-size: 13px;
  font-weight: 600;
  color: var(--ff-brand);
  letter-spacing: 0.02em;
}

.protected-topbar-divider {
  color: #c5ccd3;
  font-weight: 400;
}

.protected-topbar-lane {
  font-size: 13px;
  color: var(--ff-text-muted);
}

.protected-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.protected-steps li {
  background: #f8fafc;
  border: 1px solid var(--ff-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--ff-text-muted);
}

.protected-steps li strong {
  display: block;
  font-size: 13px;
  color: var(--ff-brand-deep);
  margin-bottom: 2px;
}

.tts-hero {
  display: grid;
  grid-template-columns: minmax(240px, 1.1fr) 1fr;
  gap: 16px;
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 55%, #f3f7f4 100%);
  padding: 14px;
  margin-bottom: 18px;
}

.tts-hero-image-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--ff-border);
  background: #0f172a;
  min-height: 160px;
}

.tts-hero-image-wrap img {
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
  display: block;
}

.tts-hero-kicker {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ff-brand);
  margin: 2px 0 6px;
  font-weight: 700;
}

.tts-brand-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.tts-logo-badge {
  height: 36px;
  width: auto;
  max-width: 128px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--ff-border);
  background: #ffffff;
  padding: 4px 6px;
}

.tts-primary-line {
  margin: 0 0 6px;
  color: var(--ff-text);
  font-size: 22px;
  line-height: 1.25;
}

.tts-secondary-line {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--ff-text-muted);
}

.tts-line-list {
  margin: 0;
  padding-left: 18px;
  color: #475569;
  font-size: 12px;
}

.tts-line-list li {
  margin-bottom: 3px;
}

.tts-footnote {
  margin-top: 8px;
  font-size: 11px;
  color: #94a3b8;
}

#protected-context {
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--ff-text-muted);
}

#protected-context code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
}

.pill {
  display: inline-block;
  font-size: 11px;
  border-radius: 999px;
  padding: 3px 10px;
  margin-right: 6px;
  background: var(--ff-success-bg);
  color: #065f46;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill.neutral {
  background: #eef2f6;
  color: var(--ff-text-muted);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}

.protected-run-panel {
  background: #fafbfc;
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  padding: 16px 18px;
}

.protected-run-panel h2 {
  margin-bottom: 6px;
}

.protected-lead {
  font-size: 14px;
  color: var(--ff-text-muted);
  margin: 0 0 16px;
  max-width: 62ch;
}

.protected-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
  margin-bottom: 16px;
}

.protected-form-grid label {
  width: 100%;
}

.protected-form-grid select {
  width: 100%;
  min-width: 0;
}

.protected-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-top: 4px;
}

.protected-actions .query-link.primary-action {
  background: var(--ff-brand);
  border-color: var(--ff-brand);
}

.protected-actions .query-link.return-action {
  background: var(--ff-accent);
  border-color: #7a8f45;
  color: #1a2e05;
}

.template-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.template-catalog .catalog-card {
  border: 1px solid var(--ff-border);
  border-radius: 10px;
  background: #f9fafb;
  padding: 10px;
}

.template-catalog h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.template-catalog ul {
  margin: 0;
  padding-left: 18px;
}

.template-catalog li {
  font-size: 12px;
  color: #374151;
  margin-bottom: 4px;
}

#result-panel h2 {
  font-size: 16px;
  margin-bottom: 8px;
}

.sdk-helper-intro {
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
  margin: 0 0 12px;
}

.sdk-helper-intro a {
  color: var(--ff-brand-deep);
}

.sdk-api-links {
  font-size: 13px;
  margin: 12px 0 0;
  padding-left: 18px;
}

#sdk-inspector {
  min-height: 120px;
  font-size: 12px;
}

/* Protected mode — demo presentation */
html.protected-console-mode body {
  background: #eef1f4;
}

html.protected-console-mode #concept-preview-banner,
html.protected-console-mode #testing-guide-card,
html.protected-console-mode #quick-links-card,
html.protected-console-mode #custom-time-temp-card,
html.protected-console-mode #protected-lane-guide,
html.protected-console-mode .template-catalog,
html.protected-console-mode #resolve-protected-result {
  display: none !important;
}

html.protected-console-mode #protected-workflow {
  display: block !important;
}

html.protected-console-mode #protected-workflow.card {
  padding: 0;
  overflow: hidden;
  border-color: #d5dbe1;
  box-shadow: 0 8px 24px rgba(51, 79, 96, 0.08);
}

html.protected-console-mode #protected-workflow .protected-shell-body {
  padding: 20px 22px 22px;
}

html.protected-console-mode #protected-workflow .protected-topbar {
  padding: 16px 22px;
  margin: 0;
  background: var(--ff-brand);
  border-bottom: none;
}

html.protected-console-mode .protected-topbar-brand,
html.protected-console-mode .protected-topbar-lane {
  color: rgba(255, 255, 255, 0.92);
}

html.protected-console-mode .protected-topbar-divider {
  color: rgba(255, 255, 255, 0.45);
}

html.protected-console-mode h1 {
  font-size: 24px;
  margin-bottom: 4px;
}

html.protected-console-mode #mode-summary {
  font-size: 15px;
  color: var(--ff-text-muted);
  margin-bottom: 18px;
  max-width: 62ch;
}

html.protected-console-mode #result-panel {
  border-top: 3px solid var(--ff-brand);
}

@media (max-width: 720px) {
  .protected-steps {
    grid-template-columns: 1fr;
  }

  .tts-hero {
    grid-template-columns: 1fr;
  }

  .protected-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .protected-actions a.query-link,
  .protected-actions button {
    text-align: center;
  }
}
