@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --bg: #f3ede2;
  --bg-alt: #efe4d2;
  --surface: rgba(255, 250, 240, 0.82);
  --surface-strong: #fffaf0;
  --ink: #1d1a16;
  --muted: #61574a;
  --line: rgba(29, 26, 22, 0.14);
  --brand: #9d3c24;
  --brand-strong: #7d2613;
  --accent: #194b45;
  --danger: #8d1f22;
  --shadow: 0 24px 80px rgba(48, 35, 20, 0.12);
  --shadow-strong: 0 30px 120px rgba(40, 29, 18, 0.18);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(157, 60, 36, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(25, 75, 69, 0.2), transparent 28%),
    linear-gradient(180deg, var(--bg), var(--bg-alt));
}

body.login-page {
  background:
    radial-gradient(circle at 18% 12%, rgba(248, 174, 125, 0.82), transparent 24%),
    radial-gradient(circle at 82% 14%, rgba(75, 97, 189, 0.72), transparent 28%),
    radial-gradient(circle at 58% 34%, rgba(205, 129, 191, 0.5), transparent 26%),
    linear-gradient(180deg, #203545, #181522 58%, #111118);
}

body.dashboard-page {
  background:
    radial-gradient(circle at 14% 10%, rgba(248, 174, 125, 0.5), transparent 22%),
    radial-gradient(circle at 86% 12%, rgba(80, 99, 196, 0.46), transparent 26%),
    radial-gradient(circle at 52% 30%, rgba(196, 117, 180, 0.28), transparent 24%),
    linear-gradient(180deg, #243949 0%, #181620 56%, #111117 100%);
}

a {
  color: inherit;
}

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

.app-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: rgba(255, 245, 235, 0.68);
}

.app-footer nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.app-footer a {
  text-decoration: none;
}

.auth-shell,
.dashboard-shell {
  display: grid;
  gap: 20px;
}

body.dashboard-page .panel,
body.dashboard-page .hero-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(24, 22, 36, 0.66);
  box-shadow: 0 28px 80px rgba(11, 11, 18, 0.46);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.dashboard-page .muted,
body.dashboard-page p,
body.dashboard-page label span {
  color: rgba(255, 245, 235, 0.78);
}

body.dashboard-page h2,
body.dashboard-page h3,
body.dashboard-page strong {
  color: #fff7ee;
}

body.dashboard-page .summary-tile,
body.dashboard-page .list-row,
body.dashboard-page .legal-card,
body.dashboard-page .notice {
  background: rgba(13, 15, 25, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dashboard-hero {
  padding: 28px;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
}

.compact-lockup {
  margin-bottom: 0;
}

.compact-title {
  font-size: 1.8rem;
}

.dashboard-route-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-route-link {
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 245, 235, 0.82);
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.dashboard-route-button {
  font: inherit;
  cursor: pointer;
}

.status-good {
  color: #69d08c;
}

.status-warn {
  color: #ffcf70;
}

.summary-copy {
  margin-top: 10px;
}

.dashboard-route-link:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.workspace-section-nav {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-section-nav {
  margin-bottom: 18px;
}

.workspace-usage {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

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

.usage-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(8, 12, 20, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 12px;
}

.usage-card-head,
.usage-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.usage-card-meta {
  color: rgba(255, 245, 235, 0.72);
  font-size: 0.92rem;
}

.usage-card-meta-technical {
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  color: rgba(255, 245, 235, 0.6);
}

.usage-scale {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  color: rgba(255, 245, 235, 0.48);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.usage-scale span:nth-child(2) {
  text-align: center;
}

.usage-scale span:last-child {
  text-align: right;
}

.usage-meter {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.usage-meter-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(248, 174, 125, 0.96), rgba(80, 99, 196, 0.92));
  box-shadow: 0 0 24px rgba(248, 174, 125, 0.28);
}

.usage-meter-threshold {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: rgba(255, 255, 255, 0.35);
}

.usage-meter-threshold-mid {
  left: 50%;
}

.usage-meter-threshold-limit {
  left: calc(100% - 1px);
}

.workspace-accordion {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 12, 21, 0.26);
  overflow: hidden;
}

.workspace-accordion + .workspace-accordion {
  margin-top: 16px;
}

.workspace-accordion-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.workspace-accordion-summary::after {
  content: '▾';
  color: rgba(255, 245, 235, 0.76);
  font-size: 0.9rem;
  transition: transform 0.16s ease;
}

.workspace-accordion:not([open]) > .workspace-accordion-summary::after {
  transform: rotate(-90deg);
}

.workspace-accordion-summary::-webkit-details-marker {
  display: none;
}

.workspace-accordion-summary span:first-child {
  font-size: 1.02rem;
  font-weight: 600;
  color: #fff7ee;
}

.workspace-accordion-meta {
  color: rgba(255, 245, 235, 0.68);
  font-size: 0.92rem;
  text-align: right;
}

.workspace-accordion-body {
  padding: 0 20px 20px;
  display: grid;
  gap: 16px;
}

.nested-accordion {
  margin-top: 18px;
}

body[data-page='dashboard'] .dashboard-route-link[data-nav='dashboard'],
body[data-page='templates'] .dashboard-route-link[data-nav='templates'],
body[data-page='settings'] .dashboard-route-link[data-nav='settings'] {
  background: linear-gradient(135deg, rgba(248, 174, 125, 0.38), rgba(80, 99, 196, 0.28));
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff7ee;
}

body[data-page='dashboard'] #templates-section,
body[data-page='dashboard'] #account-section,
body[data-page='templates'] #get-started-section,
body[data-page='templates'] #workspace-console,
body[data-page='templates'] #account-section,
body[data-page='settings'] #get-started-section,
body[data-page='settings'] #workspace-console,
body[data-page='settings'] #templates-section {
  display: none !important;
}

.auth-shell {
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  align-items: start;
}

.auth-shell-centered {
  min-height: 100vh;
  grid-template-columns: minmax(320px, 520px);
  justify-content: center;
  align-content: center;
  padding-top: 24px;
  padding-bottom: 24px;
}

.hero-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.hero-card-auth {
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(169, 71, 40, 0.12), transparent 28%),
    radial-gradient(circle at bottom left, rgba(29, 26, 22, 0.08), transparent 30%),
    var(--surface);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-orbit {
  position: absolute;
  right: -12px;
  bottom: -28px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  border: 1px solid rgba(169, 71, 40, 0.16);
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent 68%);
}

.orbit-panel {
  width: 155px;
  height: 155px;
  border-radius: 50%;
  border: 1px dashed rgba(29, 26, 22, 0.16);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(-10deg);
}

.orbit-panel span {
  display: block;
}

.panel {
  padding: 24px;
}

.auth-panel-modern {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(24, 22, 36, 0.66);
  box-shadow: 0 28px 80px rgba(11, 11, 18, 0.46);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-panel-single {
  padding: 28px;
}

.auth-brand {
  margin-bottom: 20px;
}

.auth-section {
  display: grid;
  gap: 14px;
}

.section-copy h3 {
  color: #fff7ee;
  font-size: 1.15rem;
}

.section-rule {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 20px 0;
}

.auth-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.auth-brand-mark {
  width: 72px;
  height: 72px;
  display: block;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.22));
}

.auth-brand-title {
  color: #fff7ee;
  font-size: clamp(2.6rem, 6vw, 4rem);
}

.auth-brand .eyebrow {
  color: rgba(255, 245, 235, 0.7);
  margin-bottom: 6px;
}

.auth-lede {
  color: rgba(255, 245, 235, 0.86);
  max-width: 36ch;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: 'Fraunces', serif;
  line-height: 1.04;
}

h1 {
  font-size: clamp(2.3rem, 5vw, 4.2rem);
  max-width: 11ch;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.1rem;
}

.lede,
.muted,
label span,
p {
  line-height: 1.6;
}

.lede {
  max-width: 64ch;
  color: var(--muted);
  margin: 16px 0 0;
}

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

.status-chip {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 8px 12px;
  color: rgba(255, 245, 235, 0.72);
}

.plan-select.is-selected {
  outline: 2px solid rgba(169, 71, 40, 0.6);
  outline-offset: 2px;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 20px;
}

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

.stack.compact {
  gap: 10px;
}

.form-card {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(13, 15, 25, 0.3);
}

.oauth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  color: #191919;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.oauth-button:hover {
  background: #ffffff;
}

.oauth-mark {
  display: inline-flex;
  width: 22px;
  height: 22px;
}

.oauth-mark svg {
  width: 22px;
  height: 22px;
  display: block;
}

.inline-actions {
  display: flex;
  justify-content: flex-end;
}

.text-action {
  border: 0;
  background: transparent;
  color: rgba(255, 245, 235, 0.74);
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.text-action:hover {
  color: #fff7ee;
}

label {
  display: grid;
  gap: 6px;
}

input,
select,
button,
.button-link {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(15, 18, 29, 0.72);
  padding: 13px 14px;
  color: #fffaf2;
}

input:focus,
select:focus {
  outline: 2px solid rgba(255, 112, 101, 0.2);
  border-color: rgba(255, 112, 101, 0.62);
}

button,
.button-link {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms ease, opacity 120ms ease, background-color 120ms ease;
}

button:hover,
.button-link:hover {
  transform: translateY(-1px);
}

.primary {
  background: linear-gradient(180deg, #ff7368, #f24d56);
  color: #fff8f4;
  box-shadow: 0 12px 28px rgba(242, 77, 86, 0.28);
}

.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff8f4;
}

.ghost {
  background: transparent;
  color: rgba(255, 245, 235, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.destructive {
  color: var(--danger);
  border-color: rgba(141, 31, 34, 0.24);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.key-handoff-actions {
  align-items: center;
}

.compact-toggle {
  align-self: center;
}

.key-copy-button {
  min-width: 54px;
  font-size: 1.1rem;
  line-height: 1;
}

button:disabled,
.button-link[aria-disabled='true'] {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

button:disabled:hover,
.button-link[aria-disabled='true']:hover {
  transform: none;
}

.divider {
  display: grid;
  align-items: center;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  color: rgba(255, 245, 235, 0.5);
  margin: 10px 0;
}

.divider::before,
.divider::after {
  content: '';
  height: 1px;
  background: var(--line);
}

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

.summary-tile,
.plan-card,
.list-row,
.notice,
.legal-card {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  padding: 16px;
}

.summary-tile strong,
.plan-card strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.plan-card {
  display: grid;
  gap: 10px;
}

.plan-card .price {
  font-size: 2rem;
  font-family: 'Fraunces', serif;
}

.list-row {
  display: grid;
  gap: 10px;
}

.list-row header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.mono {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.94rem;
  letter-spacing: 0.02em;
}

.notice {
  background: rgba(25, 75, 69, 0.1);
}

.legal-card {
  background: rgba(157, 60, 36, 0.06);
}

.hidden {
  display: none;
}

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

  .shell {
    width: min(100% - 20px, 1120px);
    padding-top: 20px;
  }

  .hero-card,
  .panel {
    padding: 20px;
    border-radius: 22px;
  }

  .panel-head,
  .list-row header {
    display: grid;
  }

  .hero-orbit {
    position: static;
    margin-top: 20px;
    width: 180px;
    height: 180px;
  }

  .orbit-panel {
    width: 120px;
    height: 120px;
  }

  .auth-shell-centered {
    min-height: auto;
    align-content: start;
  }
}

.dashboard-page .summary-tile,
.dashboard-page .list-row,
.dashboard-page .legal-card,
.dashboard-page .notice,
.dashboard-page .project-create-panel,
.dashboard-page .project-detail-panel {
  background: rgba(13, 15, 25, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
}

.dashboard-page .summary-tile,
.dashboard-page .list-row,
.dashboard-page .legal-card,
.dashboard-page .notice,
.dashboard-page .project-create-panel,
.dashboard-page .project-detail-panel {
  padding: 18px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.project-card {
  min-height: 140px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff7ee;
  padding: 18px;
  text-align: left;
  display: grid;
  align-content: space-between;
}

.project-card.is-active {
  border-color: rgba(255, 112, 101, 0.6);
  box-shadow: 0 0 0 1px rgba(255, 112, 101, 0.25);
}

.project-card-add {
  place-items: center;
  justify-items: center;
  text-align: center;
}

.project-card.is-disabled {
  opacity: 0.58;
}

.project-add-symbol {
  font-size: 2.5rem;
  line-height: 1;
}

.project-create-panel,
.project-detail-panel {
  margin-top: 18px;
}

.flow-head {
  margin-top: 22px;
}

.flow-card,
.flow-step-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 16px;
}

.toggle-row {
  margin-top: 12px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: #fff7ee;
}

.account-subsection {
  margin: 18px 0 22px;
}

.inline-form {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}

.inline-form-full {
  grid-column: 1 / -1;
}

.compact-head {
  margin-bottom: 14px;
}

.compact-actions {
  gap: 10px;
}

.dashboard-nav-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-tab {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 245, 235, 0.76);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.dashboard-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff7ee;
}

.dashboard-tab.is-active {
  background: linear-gradient(135deg, rgba(248, 174, 125, 0.22), rgba(116, 168, 255, 0.18));
  border-color: rgba(248, 174, 125, 0.34);
  color: #fff7ee;
}

.doc-card {
  padding: 18px;
}

.doc-card h3 {
  margin-bottom: 8px;
}

.doc-code {
  margin: 12px 0 0;
  padding: 16px;
  overflow-x: auto;
  white-space: pre-wrap;
  border-radius: 16px;
  background: rgba(10, 12, 20, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f9f4ee;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, monospace;
  font-size: 0.88rem;
  line-height: 1.55;
}

.doc-tabs {
  display: grid;
  gap: 12px;
}

.doc-tab-list {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.doc-tab,
.doc-copy {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 245, 235, 0.8);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.doc-tab.is-active {
  background: linear-gradient(135deg, rgba(248, 174, 125, 0.22), rgba(116, 168, 255, 0.18));
  border-color: rgba(248, 174, 125, 0.34);
  color: #fff7ee;
}

.doc-copy {
  margin-left: auto;
}

.doc-pane {
  display: none;
}

.doc-pane.is-active {
  display: block;
}

.template-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.38fr) minmax(0, 0.62fr);
  gap: 18px;
}

.template-sidebar,
.template-main {
  display: grid;
  gap: 16px;
}

.template-editor-shell {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 12, 22, 0.28);
  padding: 16px;
}

.template-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.template-tool {
  min-width: 88px;
}

.template-tool.is-active {
  background: linear-gradient(135deg, rgba(248, 174, 125, 0.28), rgba(116, 168, 255, 0.22));
  border-color: rgba(248, 174, 125, 0.36);
  color: #fff7ee;
}

.template-select,
.template-color {
  appearance: none;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 245, 235, 0.86);
  min-height: 42px;
  padding: 0 14px;
}

.template-select {
  min-width: 96px;
}

.template-range-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.template-range {
  width: 132px;
}

.template-range-value {
  min-width: 24px;
  text-align: right;
  color: rgba(255, 245, 235, 0.86);
  font-size: 0.9rem;
}

.template-color {
  width: 54px;
  padding: 4px;
}

.template-editor-label {
  display: grid;
  gap: 10px;
}

.template-editor,
.template-editor.ql-container {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #fff7ee;
  outline: none;
  overflow: auto;
}

.template-editor .ql-editor {
  min-height: 320px;
  padding: 18px;
  color: #fff7ee;
  line-height: 1.7;
}

.template-editor:focus,
.template-editor.ql-container.ql-snow:focus-within {
  border-color: rgba(248, 174, 125, 0.5);
  box-shadow: 0 0 0 3px rgba(248, 174, 125, 0.14);
}

.template-editor.ql-container.ql-snow {
  border-width: 1px;
}

.template-editor.ql-container.ql-snow .ql-editor a {
  color: #ffd5b8;
}

.template-editor img,
.template-editor .ql-editor img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
}

.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;
}

.template-editor p,
.template-editor h1,
.template-editor h2,
.template-editor h3,
.template-editor .ql-editor p,
.template-editor .ql-editor h1,
.template-editor .ql-editor h2,
.template-editor .ql-editor h3 {
  margin-top: 0;
}

.template-card,
.template-category-card {
  background: rgba(13, 15, 25, 0.3);
}

.sender-domain-actions {
  align-items: end;
}

.flow-step-notes {
  width: 100%;
  min-height: 104px;
  resize: vertical;
}

@media (max-width: 920px) {
  .dashboard-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

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

.toast-region {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  transform: translateY(-8px);
  opacity: 0;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 14, 23, 0.94);
  color: #fff7ee;
  padding: 14px 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  border-color: rgba(79, 208, 154, 0.38);
}

.toast-error {
  border-color: rgba(255, 112, 101, 0.42);
}

.toast-info {
  border-color: rgba(116, 168, 255, 0.34);
}

.mono {
  font-family: 'IBM Plex Sans', monospace;
  font-size: 0.85rem;
  color: rgba(255, 245, 235, 0.62);
}

@media (max-width: 720px) {
  .app-footer,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .toast-region {
    left: 16px;
    right: 16px;
    width: auto;
  }
}


.template-source-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 6, 14, 0.72);
  backdrop-filter: blur(18px);
  z-index: 1200;
}

.template-source-card {
  width: min(880px, 100%);
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(18, 23, 39, 0.96), rgba(10, 14, 25, 0.96));
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.36);
}

.template-source-textarea {
  min-height: 360px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #fff7ee;
  padding: 18px;
  font: 0.95rem/1.65 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  resize: vertical;
}

.template-source-textarea:focus {
  outline: none;
  border-color: rgba(248, 174, 125, 0.5);
  box-shadow: 0 0 0 3px rgba(248, 174, 125, 0.14);
}

.template-source-modal.hidden {
  display: none;
}
