/* ========================================
   CSS VARIABLES & THEME TOKENS
   ======================================== */
:root {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
  --transition-base: 0.3s ease;
}

* {
  box-sizing: border-box;
}

/* Dark Theme (Default) */
body {
  --bg-base: #040d21;
  --bg-card: rgba(12, 19, 35, 0.9);
  --bg-card-solid: rgba(16, 26, 51, 0.92);
  --glass-strong: linear-gradient(135deg, rgba(15, 23, 42, 0.78), rgba(15, 23, 42, 0.55));
  --glass-soft: rgba(12, 19, 35, 0.85);
  --field-bg: rgba(15, 23, 42, 0.6);
  --field-border: rgba(148, 163, 184, 0.3);
  --field-border-focus: rgba(56, 189, 248, 0.7);
  --ghost-border: rgba(148, 163, 184, 0.35);
  --ghost-hover: rgba(56, 189, 248, 0.5);
  --text-main: #f8fafc;
  --text-muted: #cbd5f5;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --border: rgba(56, 189, 248, 0.22);
  --shadow: 0 24px 60px rgba(8, 15, 32, 0.55);
  --glow-1: rgba(14, 165, 233, 0.4);
  --glow-2: rgba(56, 189, 248, 0.35);
  --glow-3: rgba(16, 185, 129, 0.28);
  --log-bg: rgba(11, 21, 40, 0.85);
  --log-text: #e2e8f0;
  --cost-chart-base: rgba(4, 12, 24, 0.8);
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 24px 80px;
  background: radial-gradient(circle at 20% -10%, var(--glow-1), transparent 45%),
              radial-gradient(circle at 80% -20%, var(--glow-2), transparent 50%),
              radial-gradient(circle at 50% 120%, var(--glow-3), transparent 55%),
              var(--bg-base);
  color: var(--text-main);
  transition: background 0.7s ease, color 0.4s ease;
}

/* Light Theme */
body[data-theme="light"] {
  color-scheme: light;
  --bg-base: linear-gradient(180deg, #eff6ff 0%, #f8fafc 65%);
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-solid: rgba(255, 255, 255, 0.96);
  --glass-strong: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(224, 242, 254, 0.9));
  --glass-soft: rgba(255, 255, 255, 0.92);
  --field-bg: rgba(255, 255, 255, 0.95);
  --field-border: rgba(148, 163, 184, 0.45);
  --field-border-focus: rgba(37, 99, 235, 0.6);
  --ghost-border: rgba(148, 163, 184, 0.5);
  --ghost-hover: rgba(37, 99, 235, 0.55);
  --text-main: #0f172a;
  --text-muted: #475569;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --border: rgba(148, 163, 184, 0.35);
  --shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
  --glow-1: rgba(59, 130, 246, 0.35);
  --glow-2: rgba(16, 185, 129, 0.24);
  --glow-3: rgba(14, 116, 144, 0.24);
  --log-bg: rgba(255, 255, 255, 0.96);
  --log-text: #1e293b;
  --cost-chart-base: rgba(255, 255, 255, 0.92);
}

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

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.background-glow {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 10% 20%, var(--glow-1), transparent 62%),
              radial-gradient(circle at 90% 10%, var(--glow-2), transparent 58%),
              radial-gradient(circle at 50% 120%, var(--glow-3), transparent 60%);
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.4s ease, filter 0.4s ease;
}

body.app-busy .background-glow {
  opacity: 0.7;
  filter: blur(95px);
}

body.modal-open .background-glow {
  opacity: 0.65;
  filter: blur(110px);
}

/* ========================================
   LAYOUT
   ======================================== */
.app-shell {
  position: relative;
  z-index: 1;
  width: min(1200px, 100%);
  display: flex;
  flex-direction: column;
  gap: 32px;
  transition: transform 0.3s ease, filter 0.35s ease;
  filter: none;
}

body.app-busy .app-shell {
  transform: translateY(-2px);
}

body.modal-open .app-shell {
  filter: blur(6px);
  transform: translateY(6px) scale(0.992);
}

body.modal-open .app-top-bar__actions > * {
  pointer-events: none;
  opacity: 0.75;
  transform: scale(0.96);
}

.main-grid {
  display: grid;
  gap: 28px;
  max-width: 100%;
  min-width: 0;
}

/* ========================================
   TOP BAR
   ======================================== */
.app-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 26px;
  border-radius: 28px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: linear-gradient(140deg, rgba(12, 20, 38, 0.92), rgba(10, 16, 32, 0.68));
  box-shadow: 0 26px 60px rgba(5, 12, 28, 0.45);
  backdrop-filter: blur(14px);
  flex-wrap: wrap;
}

body[data-theme="light"] .app-top-bar {
  border-color: rgba(148, 163, 184, 0.32);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.86), rgba(241, 245, 249, 0.78));
  box-shadow: 0 26px 58px rgba(15, 23, 42, 0.18);
}

.app-top-bar__cluster {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.app-top-bar__logo {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.3), rgba(14, 116, 144, 0.5));
  border: 1px solid rgba(56, 189, 248, 0.45);
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

body[data-theme="light"] .app-top-bar__logo {
  border-color: rgba(148, 163, 184, 0.4);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(14, 165, 233, 0.35));
}

.app-top-bar__spark {
  position: absolute;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle at 30% 30%, rgba(129, 230, 217, 0.65), transparent 55%);
  filter: blur(6px);
  opacity: 0.85;
  transform: rotate(18deg);
}

body[data-theme="light"] .app-top-bar__spark {
  background: radial-gradient(circle at 30% 30%, rgba(59, 130, 246, 0.55), transparent 55%);
}

.app-top-bar__spark--secondary {
  background: radial-gradient(circle at 70% 70%, rgba(56, 189, 248, 0.75), transparent 60%);
  opacity: 0.7;
  transform: rotate(-28deg);
}

body[data-theme="light"] .app-top-bar__spark--secondary {
  background: radial-gradient(circle at 70% 70%, rgba(14, 165, 233, 0.6), transparent 60%);
}

.app-top-bar__copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.app-top-bar__title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-main);
}

.app-top-bar__subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  max-width: 460px;
  line-height: 1.4;
  text-transform: none;
}

body[data-theme="light"] .app-top-bar__subtitle {
  color: rgba(71, 85, 105, 0.9);
}

.app-top-bar__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-top-bar__settings {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: linear-gradient(135deg, rgba(12, 22, 44, 0.85), rgba(15, 27, 52, 0.7));
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  box-shadow: 0 22px 46px rgba(6, 12, 28, 0.44);
  backdrop-filter: blur(14px);
}

body[data-theme="light"] .app-top-bar__settings {
  border-color: rgba(148, 163, 184, 0.45);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(226, 232, 240, 0.82));
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.16);
}

.app-top-bar__settings:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 64px rgba(6, 12, 28, 0.52);
  border-color: rgba(94, 234, 212, 0.6);
  background: linear-gradient(135deg, rgba(14, 28, 52, 0.92), rgba(18, 32, 58, 0.82));
}

body[data-theme="light"] .app-top-bar__settings:hover {
  border-color: rgba(148, 163, 184, 0.6);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(226, 232, 240, 0.9));
}

.app-top-bar__settings:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.32), 0 22px 44px rgba(6, 12, 28, 0.48);
}

.app-top-bar__settings-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
}

.app-top-bar__settings-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.app-top-bar__settings-text {
  white-space: nowrap;
}

/* ========================================
   THEME TOGGLE
   ======================================== */
.theme-toggle {
  position: relative;
  width: 74px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(135deg, rgba(12, 19, 35, 0.85), rgba(24, 32, 48, 0.78));
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  box-shadow: 0 18px 40px rgba(6, 12, 28, 0.45);
}

body[data-theme="light"] .theme-toggle {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.94), rgba(226, 232, 240, 0.92));
  border-color: rgba(148, 163, 184, 0.45);
  box-shadow: 0 18px 36px rgba(148, 163, 184, 0.28);
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 20px 46px rgba(6, 12, 28, 0.5);
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35), 0 18px 40px rgba(6, 12, 28, 0.48);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

/* Dark mode - moon (first) highlighted */
.theme-toggle svg:first-of-type {
  opacity: 1;
}

.theme-toggle svg:last-of-type {
  opacity: 0.35;
}

/* Light mode - sun (last) highlighted */
body[data-theme="light"] .theme-toggle svg:first-of-type {
  opacity: 0.35;
}

body[data-theme="light"] .theme-toggle svg:last-of-type {
  opacity: 1;
}

.theme-toggle__thumb {
  position: absolute;
  inset: 4px;
  width: 32px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.25);
  transition: transform 0.3s ease, background 0.3s ease;
  transform: translateX(0);
}

body[data-theme="light"] .theme-toggle__thumb {
  background: rgba(37, 99, 235, 0.35);
  transform: translateX(34px);
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 4vw, 36px);
  width: 100%;
}

.hero--jumbo {
  margin-top: 8px;
}

.hero__text {
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: clamp(28px, 4vw, 46px);
  box-shadow: var(--shadow);
  display: grid;
  gap: clamp(18px, 2.8vw, 26px);
  transition: background 0.5s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.hero__eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.hero__text h1 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-main), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__text > p {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text-muted);
  max-width: 680px;
}

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

.hero__domain label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.hero__domain-input {
  position: relative;
}

.hero__domain-input input {
  width: 100%;
  padding: 18px 22px;
  border-radius: 16px;
  border: 2px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text-main);
  font-size: 1.02rem;
  font-family: inherit;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  outline: none;
}

.hero__domain-input input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.hero__domain-input input:focus {
  border-color: var(--field-border-focus);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
  background: var(--bg-card);
}

.hero__domain-input input.input--error {
  border-color: #f87171;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.2);
}

.field {
  display: grid;
  gap: 14px;
}

.field__label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tooltip {
  background: none;
  border: none;
  cursor: help;
  font-size: 1rem;
  padding: 0;
  margin: 0;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.tooltip:hover {
  opacity: 1;
}

.mode-slider {
  display: grid;
  gap: 16px;
}

.mode-slider input[type="range"] {
  width: 100%;
  height: 24px;
  background: transparent;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* Webkit track */
.mode-slider input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
}

/* Firefox track */
.mode-slider input[type="range"]::-moz-range-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
}

/* Webkit thumb */
.mode-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: -8px; /* Center thumb on track */
}

/* Firefox thumb */
.mode-slider input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Thumb hover states */
.mode-slider input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.5);
}

.mode-slider input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.5);
}

.mode-slider__labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.mode-slider__labels span {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.25s ease, font-weight 0.25s ease;
  cursor: pointer;
}

.mode-slider__labels span.active {
  color: var(--accent);
  font-weight: 600;
}

.hero__execute {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.hero__execute-button {
  padding: 16px 36px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease;
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.35);
}

.hero__execute-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(56, 189, 248, 0.45);
}

.hero__execute-button:active:not(:disabled) {
  transform: translateY(0);
}

.hero__execute-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ========================================
   CARDS & RESULTS
   ======================================== */
.card {
  background: var(--glass-soft);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 0;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: all 0.4s ease;
  max-width: 100%;
  overflow: hidden;
}

.card--busy {
  opacity: 0.75;
  pointer-events: none;
}

.card__header {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card__header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
}

.log-actions {
  display: flex;
  gap: 12px;
}

.action-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid var(--ghost-border);
  background: var(--field-bg);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.action-chip:hover {
  border-color: var(--ghost-hover);
  background: var(--bg-card);
  transform: translateY(-1px);
}

.action-chip--ghost {
  background: transparent;
}

.action-chip--icon {
  padding: 8px 10px;
}

.action-chip--success {
  border-color: rgba(34, 197, 94, 0.5);
  color: #22c55e;
}

.action-chip--error {
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
}

.action-chip__icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
}

.response-output {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 100%;
  overflow: hidden;
}

.response-cards {
  display: grid;
  gap: 20px;
  max-width: 100%;
  min-width: 0;
}

.response-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
}

.result-card:hover {
  border-color: var(--ghost-hover);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.15);
}

.result-card__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.result-card__subtitle {
  margin: -8px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  word-break: break-word;
  overflow-wrap: break-word;
}

.result-card__muted {
  color: var(--text-muted);
  opacity: 0.7;
}

.result-card__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.result-field {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.result-field p {
  margin: 0;
  line-height: 1.6;
  flex: 1;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  min-width: 0;
}

.result-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-chip {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
}

/* LinkedIn Section */
.linkedin-section {
  margin-bottom: 20px;
}

.linkedin-section__header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(10, 102, 194, 0.08) 0%, rgba(10, 102, 194, 0.03) 100%);
  border: 1px solid rgba(10, 102, 194, 0.2);
}

.linkedin-section__logo {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.linkedin-section__logo svg {
  width: 32px;
  height: 32px;
}

.linkedin-section__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.linkedin-section__label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0A66C2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.linkedin-section__url {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linkedin-section__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.result-metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  max-width: 100%;
}

.result-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  min-width: 0;
  max-width: 100%;
}

.result-metric__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.result-metric__text strong {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  word-break: break-word;
}

.result-metric__text span {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-word;
  overflow-wrap: break-word;
}

.result-copy-button {
  flex-shrink: 0;
}

.result-copy-button--success .action-chip__icon {
  color: #22c55e;
}

.result-copy-button--error .action-chip__icon {
  color: #ef4444;
}

/* Cost Summary */
.cost-summary {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  max-width: 100%;
  min-width: 0;
}

@media (min-width: 768px) {
  .cost-summary {
    grid-template-columns: 2fr 1fr;
  }
}

.cost-summary__details {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.cost-summary__totals {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.cost-summary__rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.cost-summary__row {
  padding: 16px;
  border-radius: 12px;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  max-width: 100%;
  overflow: hidden;
}

.cost-summary__row-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  min-width: 0;
}

.cost-summary__row-header strong {
  font-size: 0.95rem;
  color: var(--text-main);
  word-break: break-word;
  overflow-wrap: break-word;
}

.cost-summary__model {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  word-break: break-word;
  overflow-wrap: break-word;
}

.cost-summary__stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.cost-summary__stat {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: break-word;
}

.cost-chart {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.cost-chart__ring {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--cost-chart-gradient);
  display: grid;
  place-items: center;
}

.cost-chart__center {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--cost-chart-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.cost-chart__center-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
}

.cost-chart__center-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cost-chart__legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.cost-chart__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.cost-chart__swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--segment-color);
}

.cost-chart__label {
  font-size: 0.88rem;
  color: var(--text-main);
  font-weight: 500;
}

.cost-chart__value {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Debug Timeline */
.debug-timeline__rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.debug-timeline__row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.debug-timeline__row-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.debug-timeline__index {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.debug-timeline__label {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
}

.debug-timeline__meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.debug-timeline__bar-wrapper {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--field-bg);
  overflow: hidden;
}

.debug-timeline__bar {
  height: 100%;
  background: var(--bar-color);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.debug-timeline__details {
  margin-top: 8px;
  padding-left: 36px;
}

/* Debug Details */
.debug-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--field-bg);
  border-radius: 8px;
  font-size: 0.85rem;
}

.debug-details__item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.debug-details__label {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 140px;
  flex-shrink: 0;
}

.debug-details__value {
  color: var(--text-main);
  word-break: break-word;
}

.debug-details__value--null {
  color: var(--text-muted);
  font-style: italic;
}

.debug-details__value--true {
  color: #10b981;
  font-weight: 600;
}

.debug-details__value--false {
  color: #ef4444;
  font-weight: 600;
}

.debug-details__nested {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.debug-details__nested-item {
  display: flex;
  gap: 8px;
  font-size: 0.82rem;
}

.debug-details__nested-label {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 120px;
  flex-shrink: 0;
}

.debug-details__nested-value {
  color: var(--text-main);
  word-break: break-word;
}

/* Raw JSON Accordion */
.response-raw {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.response-raw__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.response-raw__title h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.raw-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.raw-accordion__item {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.raw-accordion__item--open {
  border-color: var(--ghost-hover);
}

.raw-accordion__item:not(.raw-accordion__item--open) .raw-accordion__pre {
  display: none;
}

.raw-accordion__header {
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  text-align: left;
}

.raw-accordion__header:hover {
  background: var(--field-bg);
}

.raw-accordion__info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.raw-accordion__timestamp {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.raw-accordion__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.raw-accordion__chip {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.raw-accordion__chip--ok {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.raw-accordion__chip--warn {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

.raw-accordion__chip--error {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.raw-accordion__chip--pending {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

.raw-accordion__chip--time {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent);
}

.raw-accordion__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.raw-accordion__toggle-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

.raw-accordion__chevron {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.3s ease;
}

.raw-accordion__item--open .raw-accordion__chevron {
  transform: rotate(-135deg);
}

.raw-accordion__pre {
  padding: 20px;
  margin: 0;
  background: var(--log-bg);
  border-top: 1px solid var(--border);
  color: var(--log-text);
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
}

/* JSON Syntax Highlighting - Dark Theme */
.json-key { color: #60a5fa; font-weight: 600; }
.json-string { color: #22c55e; }
.json-number { color: #f59e0b; }
.json-boolean { color: #ec4899; }
.json-null { color: #94a3b8; opacity: 0.8; }

/* JSON Syntax Highlighting - Light Theme */
body[data-theme="light"] .json-key { color: #2563eb; font-weight: 600; }
body[data-theme="light"] .json-string { color: #059669; }
body[data-theme="light"] .json-number { color: #d97706; }
body[data-theme="light"] .json-boolean { color: #db2777; }
body[data-theme="light"] .json-null { color: #64748b; opacity: 0.9; }

/* ========================================
   MODALS
   ======================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal--active {
  display: flex;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

.modal__content {
  position: relative;
  z-index: 1;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.4s ease;
}

.modal__content--celebrate {
  animation: celebrate 0.6s ease;
}

.modal__content--error {
  animation: shake 0.4s ease;
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.modal__title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal__title-group h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-main);
}

.modal__close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.modal__close:hover {
  background: var(--field-bg);
  color: var(--text-main);
}

.modal__lead {
  margin: 0 0 24px;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.modal__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.modal__body label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
}

.modal__body input[type="text"],
.modal__body input[type="password"] {
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal__body input:focus {
  outline: none;
  border-color: var(--field-border-focus);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

.modal__body input.input--error {
  border-color: #f87171;
}

.modal__footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal__feedback {
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
}

.modal__feedback--error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.modal__actions {
  display: flex;
  gap: 12px;
}

.modal__primary,
.modal__secondary,
.modal__danger {
  flex: 1;
  padding: 14px 24px;
  border-radius: 12px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.modal__primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.3);
}

.modal__primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.4);
}

.modal__secondary {
  background: var(--field-bg);
  color: var(--text-main);
  border: 1px solid var(--field-border);
}

.modal__secondary:hover {
  background: var(--bg-card);
  border-color: var(--ghost-hover);
}

.modal__danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

.modal__danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(239, 68, 68, 0.4);
}

/* Padlock Icon */
.modal__padlock {
  position: relative;
  width: 28px;
  height: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.modal__padlock-shackle {
  position: absolute;
  top: 0;
  width: 16px;
  height: 14px;
  border: 3px solid var(--accent);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  transition: transform 0.4s ease;
}

.modal__padlock--open .modal__padlock-shackle {
  transform: translateX(8px) rotate(-15deg);
}

.modal__padlock-body {
  width: 24px;
  height: 18px;
  background: var(--accent);
  border-radius: 4px;
  position: relative;
  display: grid;
  place-items: center;
}

.modal__padlock-keyhole {
  width: 6px;
  height: 8px;
  background: var(--bg-base);
  border-radius: 50% 50% 0 0;
}

/* Confirm Modal */
.modal__content--confirm {
  max-width: 420px;
  text-align: center;
  padding: 40px 32px 32px;
}

.modal__confirm-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.modal__confirm-title {
  margin: 0 0 12px;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-main);
}

.modal__confirm-text {
  margin: 0 0 28px;
  color: var(--text-muted);
  line-height: 1.6;
}

.modal__confirm-actions {
  display: flex;
  gap: 12px;
}

/* Request Modal */
.modal--request .modal__content {
  max-width: 360px;
  text-align: center;
  padding: 48px 32px 40px;
}

.request-loader {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
}

.request-loader__ring {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}

.request-loader__ring--accent {
  border-top-color: var(--accent-strong);
  animation-duration: 0.8s;
  animation-direction: reverse;
  inset: 10px;
}

.request-loader__text {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.request-loader__timer {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 24px;
  font-variant-numeric: tabular-nums;
}

.request-loader__cancel {
  padding: 12px 28px;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.request-loader__cancel:hover {
  border-color: var(--ghost-hover);
  background: var(--bg-card);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  margin-top: 48px;
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}

.footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer__status {
  display: flex;
  justify-content: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  transition: all 0.3s ease;
}

.status-pill__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
  transition: background 0.3s ease;
}

.status-pill--ok .status-pill__dot {
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.status-pill--error .status-pill__dot {
  background: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.status-pill--loading .status-pill__dot {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
  animation: pulse 1.5s ease-in-out infinite;
}

.status {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.status--ok {
  color: #22c55e;
}

.status--error {
  color: #ef4444;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes celebrate {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ========================================
   ICON STYLES
   ======================================== */
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--ghost-border);
  background: rgba(8, 15, 32, 0.7);
  color: var(--text-main);
  font-size: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 18px 36px rgba(4, 10, 30, 0.35);
  backdrop-filter: blur(12px);
}

body[data-theme="light"] .icon-button {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.42);
  box-shadow: 0 16px 34px rgba(91, 112, 149, 0.22);
}

.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 40px rgba(4, 10, 30, 0.4);
  background: rgba(14, 23, 45, 0.82);
  border-color: rgba(56, 189, 248, 0.45);
}

body[data-theme="light"] .icon-button:hover {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(148, 163, 184, 0.55);
}

.icon-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35), 0 18px 36px rgba(4, 10, 30, 0.32);
}

.icon-button__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
}

.icon-button__icon path,
.icon-button__icon rect {
  stroke: currentColor;
  fill: none;
}

.icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
}

.icon path,
.icon circle,
.icon rect {
  stroke: currentColor;
  fill: none;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
  body {
    padding: 20px 16px 60px;
  }

  .app-top-bar {
    padding: 14px 18px;
    gap: 16px;
  }

  .app-top-bar__logo {
    width: 42px;
    height: 42px;
  }

  .app-top-bar__title {
    font-size: 0.9rem;
    letter-spacing: 0.12em;
  }

  .app-top-bar__subtitle {
    font-size: 0.78rem;
    display: none; /* Hide on very small screens */
  }

  .app-top-bar__settings-text {
    display: none; /* Show only icon on mobile */
  }

  .app-top-bar__settings {
    padding: 10px 14px;
  }

  /* LinkedIn section responsive */
  .linkedin-section__header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
  }

  .linkedin-section__logo {
    width: 40px;
    height: 40px;
  }

  .linkedin-section__logo svg {
    width: 28px;
    height: 28px;
  }

  .linkedin-section__actions {
    width: 100%;
    justify-content: stretch;
  }

  .linkedin-section__actions > * {
    flex: 1;
  }

  .linkedin-section__url {
    font-size: 0.88rem;
  }

  .hero__text {
    padding: 24px 20px;
    gap: 20px;
  }

  .hero__text h1 {
    font-size: 1.6rem;
  }

  .hero__text > p {
    font-size: 0.95rem;
  }

  .hero__domain-input input {
    padding: 14px 16px;
    font-size: 0.95rem;
  }

  .hero__execute-button {
    width: 100%;
    padding: 14px 28px;
  }

  .card__header {
    padding: 20px 18px 16px;
    flex-wrap: wrap;
  }

  .response-output {
    padding: 18px;
  }

  .result-card {
    padding: 18px;
  }

  .result-metrics {
    grid-template-columns: 1fr;
  }

  .cost-summary {
    grid-template-columns: 1fr;
  }

  .cost-summary__stats {
    font-size: 0.82rem;
  }

  .modal__content {
    padding: 24px;
    margin: 16px;
  }

  .modal__content--confirm {
    padding: 32px 24px 24px;
  }

  .footer {
    padding: 20px 18px;
    margin-top: 32px;
  }

  /* Fix long text overflow */
  .result-card__title,
  .result-card__subtitle,
  .raw-accordion__timestamp,
  .cost-summary__model {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Ensure tables and pre blocks scroll */
  .raw-accordion__pre {
    font-size: 0.78rem;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Fix action chips wrapping */
  .log-actions {
    flex-wrap: wrap;
  }

  .action-chip {
    font-size: 0.82rem;
    padding: 8px 14px;
  }

  /* Fix mode slider on mobile */
  .mode-slider__labels span {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .app-top-bar {
    padding: 12px 14px;
  }

  .app-top-bar__cluster {
    gap: 12px;
  }

  .app-top-bar__logo {
    width: 38px;
    height: 38px;
  }

  .app-top-bar__title {
    font-size: 0.85rem;
  }

  .theme-toggle {
    width: 64px;
    height: 32px;
  }

  .theme-toggle svg {
    width: 16px;
    height: 16px;
  }

  .theme-toggle__thumb {
    width: 26px;
  }

  body[data-theme="light"] .theme-toggle__thumb {
    transform: translateX(30px);
  }

  .hero__text h1 {
    font-size: 1.4rem;
  }

  .hero__eyebrow {
    font-size: 0.72rem;
  }

  .modal__content {
    padding: 20px;
  }

  .modal__title-group h2 {
    font-size: 1.2rem;
  }

  .result-field {
    flex-direction: column;
    align-items: stretch;
  }

  .result-copy-button {
    align-self: flex-start;
  }

  .cost-summary__row {
    padding: 12px;
  }

  .debug-timeline__meta {
    font-size: 0.75rem;
  }
}

/* Landscape tablets and small desktops */
@media (min-width: 769px) and (max-width: 1024px) {
  .app-shell {
    width: min(900px, 100%);
  }

  .cost-summary {
    grid-template-columns: 1fr;
  }
}

/* Ensure no horizontal scroll on any device */
.app-shell,
.card,
.result-card,
.response-output,
.response-cards,
.main-grid,
input,
textarea,
select,
button {
  max-width: 100%;
}

/* Allow specific elements to overflow with scroll */
.raw-accordion__pre,
pre,
code {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Fix long URLs and text - apply ellipsis only to specific elements */
.status-pill {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
