:root {
  --bg: #0d1620;
  --bg-accent: #15273d;
  --panel: rgba(11, 18, 29, 0.84);
  --text: #edf3f8;
  --muted: #9fb0c0;
  --line: rgba(173, 196, 215, 0.18);
  --good: #4ecf95;
  --bad: #ff8669;
  --action: #ff9b54;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "SF Pro Display", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 155, 84, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(78, 207, 149, 0.16), transparent 22%),
    linear-gradient(160deg, var(--bg) 0%, #091018 100%);
  color: var(--text);
}

.layout {
  width: min(1180px, calc(100vw - 32px));
  margin: 24px auto 48px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.tab-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.inner-tab-bar {
  margin-top: 4px;
}

.tab-button {
  width: auto;
  min-width: 140px;
  margin-top: 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border: 1px solid var(--line);
}

.tab-button.active {
  background: linear-gradient(135deg, var(--action), #ffbf73);
  color: #15100c;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.provider-panel {
  display: none;
}

.provider-panel.active {
  display: block;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

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

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--action);
  font-size: 0.78rem;
}

h1, h2 {
  margin: 0 0 12px;
}

.lede, .status-card, .flash {
  color: var(--muted);
}

.flash-success {
  border-color: rgba(78, 207, 149, 0.38);
  color: #d4ffe9;
}

.flash-error {
  border-color: rgba(255, 134, 105, 0.38);
  color: #ffd8cf;
}

.form-card label {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
}

input, textarea, select, button {
  width: 100%;
  margin-top: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}

textarea {
  resize: vertical;
}

button {
  background: linear-gradient(135deg, var(--action), #ffbf73);
  color: #15100c;
  border: 0;
  font-weight: 700;
  cursor: pointer;
}

.button-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.button-link {
  width: 100%;
  margin-top: 6px;
  border-radius: 12px;
  border: 0;
  padding: 12px 14px;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.button-link-clear {
  background: linear-gradient(135deg, #2d8cff, #59b3ff);
  color: #eff7ff;
}

.button-link-inline {
  width: auto;
  margin-top: 0;
  min-width: 140px;
}

.form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.form-head h2 {
  margin-bottom: 0;
}

.results {
  margin-top: 16px;
}

.copy-button {
  width: 100%;
  margin-top: 16px;
  padding: 10px 16px;
}

.secondary-copy-button {
  margin-top: 10px;
}

.copy-cell {
  width: 110px;
}

.history-copy-button {
  width: 100%;
  margin-top: 0;
  padding: 8px 12px;
  font-size: 0.95rem;
}

.delete-cell {
  width: 110px;
}

.history-delete-button {
  width: 100%;
  margin-top: 0;
  padding: 8px 12px;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #cc4b4b, #f06a6a);
  color: #fff3f0;
}

.result-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.result-grid span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.plan-steps {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.plan-steps li + li {
  margin-top: 8px;
}

.muted {
  color: var(--muted);
}

.history {
  margin-top: 16px;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.history-search {
  width: min(280px, 100%);
  margin-top: 0;
}

.settings-panel {
  max-width: 900px;
}

.settings-summary {
  max-width: 900px;
  margin-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 760px) {
  .layout {
    width: min(100vw - 20px, 1180px);
  }

  .hero {
    flex-direction: column;
    align-items: start;
  }

  .tab-bar {
    flex-direction: column;
  }

  .history-head {
    flex-direction: column;
    align-items: stretch;
  }

  .form-head {
    flex-direction: column;
    align-items: stretch;
  }
}
