/* ============================================
   Lean Obsidian Studio — Style Sheet
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: #151d2e;
  --bg-input: #0d1220;
  --border: #1e2d44;
  --border-accent: #25D0F7;
  --border-dashed: #283a54;
  --text-primary: #cbd5e1;
  --text-secondary: #8994a7;
  --text-heading: #e2e8f0;
  --accent: #25D0F7;
  --accent-dim: rgba(37, 208, 247, 0.1);
  --accent-hover: #25D0F7;
  --btn-bg: #0f1d30;
  --btn-hover: #162742;
  --success: #18BC9C;
  --danger: #FC3634;
  --radius: 8px;
  --radius-lg: 12px;
  --font-body: 'JetBrains Mono', 'Consolas', monospace;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

html.scroll-locked,
html.scroll-locked body {
  overflow: hidden;
  height: 100%;
}

/* --- Header --- */
.header {
  text-align: center;
  padding: 3rem 1rem 1rem;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.header__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header__title {
  font-family: var(--font-mono);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.header__subtitle {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* --- Auth Bar --- */
.auth-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.auth-bar__sign-in {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--btn-bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.auth-bar__sign-in:hover {
  background: var(--btn-hover);
  box-shadow: 0 0 12px rgba(37, 208, 247, 0.15);
}

.auth-bar__user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-bar__email {
  font-size: 0.75rem;
  color: var(--text-secondary);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-bar__count {
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.15rem 0.5rem;
}

.auth-bar__menu-wrapper {
  position: relative;
}

.auth-bar__menu-btn {
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.2s;
}

.auth-bar__menu-btn:hover {
  color: var(--accent);
}

.auth-bar__menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
}

.auth-bar__menu--open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.auth-bar__menu-item {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-primary);
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.auth-bar__menu-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.auth-bar__menu-item--danger:hover {
  background: rgba(252, 54, 52, 0.1);
  color: var(--danger);
}

/* --- Tier Badge --- */
.tier-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.tier-badge--free {
  background: rgba(24, 188, 156, 0.12);
  color: #18BC9C;
  border-color: #18BC9C;
}

.tier-badge--pro {
  background: rgba(255, 215, 0, 0.12);
  color: #FFD700;
  border-color: #FFD700;
}

.tier-badge--power {
  background: rgba(252, 54, 52, 0.12);
  color: #FC3634;
  border-color: #FC3634;
}

/* --- Auth Gate --- */
.auth-gate {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-gate__card {
  text-align: center;
  max-width: 380px;
  padding: 2rem 1.5rem;
}
.auth-gate__logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 1.5rem;
}
.auth-gate__msg {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}
.auth-gate__desc {
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}
.auth-gate__link {
  color: var(--accent);
  text-decoration: none;
}
.auth-gate__link:hover { text-decoration: underline; }
.auth-gate__btn {
  width: 100%;
  padding: 0.7rem 1.5rem;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.auth-gate__btn:hover { opacity: 0.85; }

/* --- Auth Modal --- */
.auth-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.auth-modal--open {
  display: flex;
}

.auth-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
}

.auth-modal__dialog {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: min(400px, 90vw);
  z-index: 1;
}

.auth-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  transition: color 0.2s;
}

.auth-modal__close:hover {
  color: var(--accent);
}

.auth-modal__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.auth-modal__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.auth-modal__input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 1rem;
}

.auth-modal__input:focus {
  border-color: var(--accent);
}

.auth-modal__btn {
  width: 100%;
  padding: 0.7rem;
  background: var(--btn-bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  margin-top: 0.5rem;
}

.auth-modal__btn:hover {
  background: var(--btn-hover);
  box-shadow: 0 0 18px rgba(37, 208, 247, 0.15);
}

.auth-modal__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-modal__toggle {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  cursor: pointer;
}

.auth-modal__toggle strong {
  color: var(--accent);
}

.auth-modal__error {
  background: rgba(252, 54, 52, 0.1);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  color: var(--danger);
}
.auth-modal__pw-rules {
  margin: -0.25rem 0 0.75rem;
  font-size: 0.75rem;
  line-height: 1.6;
}
.auth-modal__pw-rule {
  color: var(--danger);
}
.auth-modal__pw-rule--met {
  color: var(--success);
}
.auth-modal__forgot {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: right;
  text-decoration: none;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}
.auth-modal__forgot:hover { color: var(--accent); }
.auth-modal__back { text-align: center; margin-top: 0.5rem; }

/* --- Tagline --- */
.tagline {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  line-height: 1.7;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* --- Module Navigation --- */
.module-nav {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
  padding: 0 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.module-nav::-webkit-scrollbar {
  display: none;
}

.module-nav__tab {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 0.4rem 1.25rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.module-nav__tab:hover {
  color: var(--text-primary);
  background: var(--accent-dim);
}

.module-nav__tab--active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: var(--accent);
}

/* --- Main --- */
.main {
  width: 100%;
  max-width: 960px;
  padding: 0 1.25rem 2rem;
  margin: 0 auto;
}

/* --- Template Cards --- */
.templates__heading {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.templates__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.card {
  font-family: var(--font-body);
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 0 16px rgba(37, 208, 247, 0.08);
  transform: translateY(-2px);
}

.card--selected {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(37, 208, 247, 0.15);
}

.card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.35rem;
}

.card__desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* --- Blueprint --- */
.blueprint {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.blueprint__input {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.blueprint__title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.blueprint__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  font-style: italic;
}

.blueprint__title-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.blueprint__reset,
.blueprint__template-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
}

.blueprint__reset:hover,
.blueprint__template-btn:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

/* --- Info Icon Tooltip --- */
.blueprint__info-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--text-secondary);
  cursor: help;
}

.blueprint__info-icon::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}

.blueprint__info-icon:hover::after {
  opacity: 1;
}

/* --- Flyout Help Panel --- */
.blueprint__flyout {
  position: absolute;
  top: 0;
  right: calc(100% + 1rem);
  width: 320px;
  max-height: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  overflow-y: auto;
  opacity: 0;
  transform: translateX(12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 20;
}

.blueprint__flyout--open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}

.blueprint__flyout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.blueprint__flyout-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  font-style: italic;
}

.blueprint__flyout-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.15rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s, background 0.2s;
}

.blueprint__flyout-close:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.blueprint__flyout-body {
  font-size: 0.73rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.blueprint__flyout-body h4 {
  color: var(--text-heading);
  font-size: 0.73rem;
  font-weight: 600;
  margin-top: 0.7rem;
  margin-bottom: 0.2rem;
}

.blueprint__flyout-body h4:first-child {
  margin-top: 0;
}

.blueprint__help-opt {
  color: var(--text-secondary);
  font-weight: 400;
  font-style: italic;
}

.blueprint__flyout-body ul {
  padding-left: 1.1rem;
  margin-bottom: 0.1rem;
}

.blueprint__flyout-body li {
  margin-bottom: 0.1rem;
}

.blueprint__flyout-body ul ul {
  margin-top: 0.1rem;
}

.blueprint__textarea {
  flex: 1;
  min-height: 180px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-primary);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.blueprint__textarea::placeholder {
  color: var(--text-secondary);
}

.blueprint__textarea:focus {
  border-color: var(--accent);
}

.blueprint__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.7rem 1.75rem;
  background: var(--btn-bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.12s, color 0.2s;
  align-self: flex-end;
}

.blueprint__btn:hover {
  background: var(--btn-hover);
  box-shadow: 0 0 18px rgba(37, 208, 247, 0.15);
  transform: translateY(-1px);
}

.blueprint__btn:active {
  transform: translateY(0);
}

.blueprint__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.blueprint__btn:disabled:hover {
  background: var(--btn-bg);
  box-shadow: none;
  transform: none;
}

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

.blueprint__btn--loading {
  animation: pulse 1.5s ease-in-out infinite;
}

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

.blueprint__loader {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

.blueprint__btn-icon {
  width: 18px;
  height: 18px;
}

/* --- Output Panel --- */
.blueprint__output {
  background: var(--bg-secondary);
  border: 2px dashed var(--border-dashed);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  transition: border-color 0.3s, border-style 0.3s;
}

.blueprint__output--filled {
  border-style: solid;
  border-color: var(--border);
}

.blueprint__placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.blueprint__result {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blueprint__result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.blueprint__result-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
  font-style: italic;
}

.blueprint__actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.blueprint__action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.75rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.blueprint__action-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.blueprint__action-btn--success {
  color: var(--success);
  border-color: var(--success);
}

/* --- Explainer --- */
.blueprint__explainer {
  margin-bottom: 0.75rem;
}

.blueprint__explainer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem 0;
  transition: color 0.2s;
}

.blueprint__explainer-toggle:hover {
  color: var(--accent);
}

.blueprint__explainer-chevron {
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.blueprint__explainer--open .blueprint__explainer-chevron {
  transform: rotate(180deg);
}

.blueprint__explainer-body {
  padding: 0.6rem 0.75rem;
  margin-top: 0.4rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.blueprint__code {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
}

/* --- Footer --- */
.footer {
  width: 100%;
  max-width: 960px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.25rem 2rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0 auto;
}

.footer__version {
  font-style: italic;
}

.footer__copy a {
  color: inherit;
  text-decoration: none;
}
.footer__copy a:hover {
  color: var(--accent);
}
.footer__feedback {
  background: transparent;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 0.35rem 1rem;
  color: var(--danger);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.footer__feedback:hover {
  background: rgba(252, 54, 52, 0.1);
}


/* --- Feedback Panel (slide-in from right) --- */
.feedback-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.35);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.feedback-panel--open {
  transform: translateX(0);
}

.feedback-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.feedback-panel__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}

.feedback-panel__close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  transition: color 0.2s;
}

.feedback-panel__close:hover {
  color: var(--accent);
}

.feedback-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.feedback-panel__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.feedback-panel__input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 1rem;
}

.feedback-panel__input:focus {
  border-color: var(--accent);
}

.feedback-panel__select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 1rem;
  cursor: pointer;
  appearance: auto;
}

.feedback-panel__select:focus {
  border-color: var(--accent);
}

.feedback-panel__textarea {
  width: 100%;
  height: calc(100vh - 420px);
  min-height: 150px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 0.25rem;
  resize: vertical;
}

.feedback-panel__textarea:focus {
  border-color: var(--accent);
}

.feedback-panel__char-count {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: right;
  margin-bottom: 1rem;
}

.feedback-panel__btn {
  width: 100%;
  padding: 0.7rem;
  background: var(--btn-bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  margin-top: 0.5rem;
}

.feedback-panel__btn:hover {
  background: var(--btn-hover);
  box-shadow: 0 0 18px rgba(37, 208, 247, 0.15);
}

.feedback-panel__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.feedback-panel__error {
  background: rgba(252, 54, 52, 0.1);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  color: var(--danger);
}

.feedback-panel__success {
  text-align: center;
  padding: 2rem 0;
}

.feedback-panel__success p {
  margin-top: 0.75rem;
  font-size: 1rem;
  color: var(--success);
  font-weight: 600;
}

/* --- Validation Badge --- */
.validation-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: default;
  transition: background 0.2s;
}

.validation-badge--valid {
  background: rgba(24, 188, 156, 0.12);
  color: var(--success);
}

.validation-badge--warning {
  background: rgba(245, 166, 35, 0.12);
  color: #f5a623;
  cursor: pointer;
}

.validation-badge--warning:hover {
  background: rgba(245, 166, 35, 0.2);
}

.validation-badge--error {
  background: rgba(252, 54, 52, 0.12);
  color: var(--danger);
  cursor: pointer;
}

.validation-badge--error:hover {
  background: rgba(252, 54, 52, 0.2);
}

.validation-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.validation-badge--valid .validation-dot { background: var(--success); }
.validation-badge--warning .validation-dot { background: #f5a623; }
.validation-badge--error .validation-dot { background: var(--danger); }

.validation-issues {
  max-height: 140px;
  overflow-y: auto;
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.73rem;
  line-height: 1.55;
}

.validation-issue {
  padding: 0.2rem 0;
  color: var(--text-primary);
}

.validation-issue::before {
  margin-right: 0.4rem;
  font-weight: 700;
}

.validation-issue--error::before {
  content: "\2716";
  color: var(--danger);
}

.validation-issue--warning::before {
  content: "\26A0";
  color: #f5a623;
}

/* --- Chat Container --- */
#chatContainer,
#cssChatContainer,
#tplChatContainer {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* --- Wizard Toggle --- */
.wizard-toggle {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
  margin-bottom: 1rem;
  align-self: flex-start;
}

.wizard-toggle__btn {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 16px;
  padding: 0.3rem 1rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.wizard-toggle__btn:hover {
  color: var(--text-primary);
}

.wizard-toggle__btn--active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* --- Wizard --- */
.wizard {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.wizard__progress {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.wizard__progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 20%;
  transition: width 0.35s ease;
}

.wizard__steps {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.wizard__step-label {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.wizard__step-label--active {
  color: var(--accent);
  background: var(--accent-dim);
}

.wizard__step-label--completed {
  color: var(--text-secondary);
}

.wizard__step-label--completed::before {
  content: "\2713 ";
  color: var(--success);
}

.wizard__content {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.wizard__question {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 1rem;
}

.wizard__hint {
  font-size: 0.73rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-style: italic;
}

/* Wizard text inputs */
.wizard__input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 0.75rem;
}

.wizard__input::placeholder {
  color: var(--text-secondary);
}

.wizard__input:focus {
  border-color: var(--accent);
}

.wizard__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Option cards (smaller variant) */
.wizard__options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.wizard__option {
  font-family: var(--font-body);
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  min-height: 4.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.wizard__option:hover {
  border-color: var(--border-accent);
  box-shadow: 0 0 12px rgba(37, 208, 247, 0.08);
  transform: translateY(-1px);
}

.wizard__option--selected {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(37, 208, 247, 0.15);
  color: var(--accent);
}

.wizard__option-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 0.25rem;
}

/* Chip input */
.wizard__chip-input {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.65rem;
  min-height: 38px;
  cursor: text;
  transition: border-color 0.2s;
  margin-bottom: 0.75rem;
  align-items: center;
}

.wizard__chip-input:focus-within {
  border-color: var(--accent);
}

.wizard__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  color: var(--accent);
  white-space: nowrap;
}

.wizard__chip-remove {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.wizard__chip-remove:hover {
  color: var(--danger);
}

.wizard__chip-input-field {
  flex: 1;
  min-width: 80px;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-primary);
  outline: none;
}

.wizard__chip-input-field::placeholder {
  color: var(--text-secondary);
}

/* Suggestion chips */
.wizard__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.wizard__suggestion {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.15rem 0.55rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.wizard__suggestion:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* Inline row for dropdowns/selects */
.wizard__row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  align-items: flex-end;
}

.wizard__row > * {
  flex: 1;
}

.wizard__select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.wizard__select:focus {
  border-color: var(--accent);
}

/* Tag match toggle */
.wizard__match-toggle {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

.wizard__match-label {
  font-size: 0.73rem;
  color: var(--text-secondary);
  margin-right: 0.25rem;
}

.wizard__match-btn {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.2rem 0.65rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.wizard__match-btn--active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* Formula pair */
.wizard__formula-pair {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.wizard__formula-pair .wizard__input {
  margin-bottom: 0;
}

.wizard__formula-remove {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.3rem;
  transition: color 0.2s;
  flex-shrink: 0;
}

.wizard__formula-remove:hover {
  color: var(--danger);
}

/* Icon Picker */
.icon-picker {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.icon-picker .wizard__input {
  flex: 1;
}

.icon-picker__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.icon-picker__preview:empty {
  display: none;
}

.icon-picker__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 0.5rem;
  margin-top: 0.25rem;
  min-width: 280px;
}

.icon-picker__search {
  width: 100%;
  box-sizing: border-box;
  padding: 0.4rem 0.6rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.icon-picker__search:focus {
  outline: none;
  border-color: var(--accent);
}

.icon-picker__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.25rem;
  max-height: 180px;
  overflow-y: auto;
}

.icon-picker__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.15rem;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-secondary);
  transition: border-color 0.15s, color 0.15s;
}

.icon-picker__item:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-picker__item-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.icon-picker__item-name {
  font-size: 0.55rem;
  line-height: 1.1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.icon-picker__empty {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 1rem 0;
}

/* --- Callout Card --- */
.callout-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
}

.callout-card__row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.callout-card__color {
  width: 36px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-input);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.callout-card__hex {
  width: 90px !important;
  min-width: 90px;
  max-width: 90px;
  flex: none !important;
  margin-bottom: 0 !important;
}

.callout-card__icon-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.callout-card__icon-trigger:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.callout-card__icon-trigger--open {
  border-color: var(--accent);
}

.callout-card__icon-trigger--open .callout-card__icon-chevron {
  transform: rotate(180deg);
}

.callout-card__icon-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.callout-card__icon-preview:empty {
  width: 18px;
  height: 18px;
}

.callout-card__icon-label {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.callout-card__icon-chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: transform 0.2s;
}

.callout-card__dropdown {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 0.5rem;
  margin-top: 0.35rem;
}

.callout-card__grid {
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)) !important;
}

.wizard__add-btn {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--accent);
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 0.75rem;
}

.wizard__add-btn:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* AI enhance checkbox */
.wizard__checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-primary);
}

.wizard__checkbox-row input[type="checkbox"] {
  accent-color: var(--accent);
}

.wizard__ai-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--text-secondary);
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 600;
  cursor: help;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}

.wizard__ai-help:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.wizard__ai-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  padding: 0.6rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 10;
  pointer-events: none;
}

.wizard__ai-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border);
}

.wizard__ai-help:hover .wizard__ai-tooltip {
  display: block;
}

/* Wizard navigation */
.wizard__nav {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.wizard__nav-btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius);
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.12s, color 0.2s, border-color 0.2s;
}

.wizard__nav-btn--next {
  background: var(--btn-bg);
  border: 1px solid var(--accent);
  color: var(--accent);
}

.wizard__nav-btn--next:hover {
  background: var(--btn-hover);
  box-shadow: 0 0 18px rgba(37, 208, 247, 0.15);
  transform: translateY(-1px);
}

.wizard__nav-btn--back {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.wizard__nav-btn--back:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.wizard__nav-btn--skip {
  background: transparent;
  border: none;
  color: var(--text-secondary);
}

.wizard__nav-btn--skip:hover {
  color: var(--accent);
}

/* --- Plugin Toggle (Templates module) --- */
.tpl-plugin-toggle {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
  align-self: center;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.tpl-plugin-toggle__btn {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 16px;
  padding: 0.4rem 1.25rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.tpl-plugin-toggle__btn:hover {
  color: var(--text-primary);
}

.tpl-plugin-toggle__btn--active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* --- Card Badge --- */
.card__badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.card__badge--core {
  background: rgba(24, 188, 156, 0.12);
  color: #18BC9C;
}

.card__badge--templater {
  background: rgba(255, 215, 0, 0.12);
  color: #FFD700;
}

/* --- Pricing Modal --- */
.pricing-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.pricing-modal--open {
  display: flex;
}

.pricing-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
}

.pricing-modal__dialog {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: min(800px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
}

.pricing-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  transition: color 0.2s;
}

.pricing-modal__close:hover {
  color: var(--accent);
}

.pricing-modal__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  margin-bottom: 0.25rem;
}

.pricing-modal__subtitle {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Billing toggle */
.billing-toggle {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
  width: fit-content;
  margin: 0 auto 1.5rem;
}

.billing-toggle__btn {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 16px;
  padding: 0.3rem 1rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.billing-toggle__btn:hover {
  color: var(--text-primary);
}

.billing-toggle__btn--active {
  background: var(--accent-dim);
  color: var(--accent);
}

.billing-toggle__save {
  font-size: 0.65rem;
  color: var(--success);
  font-weight: 600;
}

/* Grid */
.pricing-modal__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.pricing-modal__card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pricing-modal__card--current {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(37, 208, 247, 0.1);
}

.pricing-modal__card--recommended {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(37, 208, 247, 0.15);
}

.pricing-modal__badge {
  position: absolute;
  top: -10px;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.75rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pricing-modal__card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
  margin-top: 0.5rem;
}

.pricing-modal__price {
  margin-bottom: 1rem;
}

.pricing-modal__amount {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.pricing-modal__period {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pricing-modal__features {
  list-style: none;
  padding: 0;
  margin-bottom: 1.25rem;
  flex: 1;
}

.pricing-modal__features li {
  font-size: 0.78rem;
  color: var(--text-primary);
  padding: 0.25rem 0;
}

.pricing-modal__features li::before {
  content: "\2713 ";
  color: var(--success);
  font-weight: 700;
  margin-right: 0.25rem;
}

.pricing-modal__btn {
  width: 100%;
  padding: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.pricing-modal__btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.pricing-modal__btn--primary {
  background: var(--btn-bg);
  border: 1px solid var(--accent);
  color: var(--accent);
}

.pricing-modal__btn--primary:hover:not(:disabled) {
  background: var(--btn-hover);
  box-shadow: 0 0 18px rgba(37, 208, 247, 0.15);
}

.pricing-modal__btn--downgrade {
  background: transparent;
  border: 1px solid #fc3634;
  color: #fc3634;
}

.pricing-modal__btn--downgrade:hover:not(:disabled) {
  background: rgba(252, 54, 52, 0.1);
  border-color: #fc3634;
  color: #fc3634;
}

.pricing-modal__btn--upgrade {
  background: transparent;
  border: 1px solid #18bc9c;
  color: #18bc9c;
}

.pricing-modal__btn--upgrade:hover:not(:disabled) {
  background: rgba(24, 188, 156, 0.1);
  border-color: #18bc9c;
  color: #18bc9c;
}

.pricing-modal__btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* --- Upgrade Hint --- */
.upgrade-hint {
  font-size: 0.72rem;
  color: #f5a623;
  cursor: pointer;
  align-self: flex-end;
  margin-top: 0.35rem;
  transition: color 0.2s;
}

.upgrade-hint:hover {
  color: var(--accent);
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.blueprint__result {
  animation: fadeIn 0.35s ease-out;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .header {
    padding: 1.5rem 1rem 0.75rem;
  }

  .header__top {
    flex-direction: column;
    gap: 0.5rem;
  }

  .header__title {
    font-size: 1.75rem;
  }

  .header__subtitle {
    font-size: 0.85rem;
  }

  .auth-bar__email {
    display: none;
  }

  .tagline {
    padding: 1rem 1rem 1.5rem;
    font-size: 0.85rem;
  }

  .main {
    padding: 0 1rem 2rem;
  }

  .templates__grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .wizard__options {
    grid-template-columns: repeat(2, 1fr);
  }

  .wizard__row {
    flex-direction: column;
    gap: 0;
  }

  .wizard__chip-input {
    width: 100%;
  }

  .blueprint__flyout {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%) scale(0.95);
    width: min(90vw, 360px);
    max-height: 80vh;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  }

  .blueprint__flyout--open {
    transform: translate(-50%, -50%) scale(1);
  }

  .pricing-modal__grid {
    grid-template-columns: 1fr;
    max-width: 320px;
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .header__title {
    font-size: 1.45rem;
  }

  .main {
    padding: 0 0.75rem 2rem;
  }

  .card {
    padding: 0.85rem 1rem;
  }

  .module-nav__tab {
    font-size: 0.78rem;
    padding: 0.35rem 0.9rem;
  }

  /* Auth modal: bottom sheet */
  .auth-modal {
    align-items: flex-end;
  }

  .auth-modal__dialog {
    width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.5rem 1.25rem 2.5rem;
  }

  /* Pricing modal: bottom sheet */
  .pricing-modal {
    align-items: flex-end;
  }

  .pricing-modal__dialog {
    width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.5rem 1.25rem 2.5rem;
  }

  .pricing-modal__grid {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .templates__grid {
    grid-template-columns: 1fr;
  }
}
