:root {
  --font-sans: "Inter", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", "SF Pro Display", "Segoe UI", sans-serif;

  /* Nebula Dark (app default tokens) */
  --bg: #040712;
  --panel: #10172b;
  --card: #141d32;
  --titlebar: #192542;
  --text: #e2e8f4;
  --muted: #92a0c0;
  --key: #7aa2ff;
  --string: #6de0b6;
  --punct: #a0afd6;
  --line: #283352;
  --accent: #5d7ffe;
  --gutter-bg: #111a30;
  --gutter-text: #4d5d87;

  --page-max: 1280px;
  --page-gutter: clamp(18px, 3.5vw, 40px);
  --section-gap: clamp(24px, 4vw, 48px);

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --panel-border: rgba(255, 255, 255, 0.12);
  --panel-overlay: rgba(255, 255, 255, 0.05);
  --panel-highlight: rgba(111, 140, 255, 0.22);
  --shadow-lg: 0 24px 96px rgba(8, 12, 26, 0.45);
  --shadow-card: 0 34px 80px rgba(8, 12, 28, 0.72);
}

/* Theme overrides */
.card-window.theme-synthwave {
  --bg: #0d0221;
  --panel: #180734;
  --card: #2a2139;
  --titlebar: #2f1d55;
  --text: #f5f0ff;
  --muted: #c6b8f2;
  --key: #f92aad;
  --string: #fede5d;
  --punct: #f5f0ff;
  --line: #3b2e5a;
  --accent: #36f9f6;
  --gutter-bg: #1c1334;
  --gutter-text: #9f8cd9;
}
.card-window.theme-synthwaveglow {
  --bg: #110030;
  --panel: #1b0a3b;
  --card: #2f1a4f;
  --titlebar: #3d2374;
  --text: #fcf9ff;
  --muted: #d2c7ff;
  --key: #ff58b8;
  --string: #ffe780;
  --punct: #fcf9ff;
  --line: #4a2d7a;
  --accent: #4ff9ff;
  --gutter-bg: #231046;
  --gutter-text: #b8a0ff;
}
.card-window.theme-onedark {
  --bg: #080f1f;
  --panel: #15223a;
  --card: #0e1320;
  --titlebar: #11182a;
  --text: #cfd6e4;
  --muted: #7d8697;
  --key: #fc9867;
  --string: #ffd866;
  --punct: #b4c0d0;
  --line: #2a3246;
  --accent: #6f8cff;
  --gutter-bg: #0a0f1a;
  --gutter-text: #5f6a81;
}
.card-window.theme-monokai {
  --bg: #050505;
  --panel: #141414;
  --card: #1f1f1f;
  --titlebar: #272727;
  --text: #e8e8e3;
  --muted: #a0a0a0;
  --key: #f92672;
  --string: #e6db74;
  --punct: #bcbcbc;
  --line: #2a2a2a;
  --accent: #66d9ef;
  --gutter-bg: #181818;
  --gutter-text: #8e8e8e;
}
.card-window.theme-solarized {
  --bg: #00141a;
  --panel: #0a2430;
  --card: #002b36;
  --titlebar: #073642;
  --text: #93a1a1;
  --muted: #839496;
  --key: #b58900;
  --string: #2aa198;
  --punct: #93a1a1;
  --line: #0d3642;
  --accent: #268bd2;
  --gutter-bg: #062d36;
  --gutter-text: #657b83;
}
.card-window.theme-dracula {
  --bg: #0d0f14;
  --panel: #151728;
  --card: #282a36;
  --titlebar: #1e2030;
  --text: #f8f8f2;
  --muted: #b9c0d0;
  --key: #ff79c6;
  --string: #f1fa8c;
  --punct: #bdc3c7;
  --line: #2e3142;
  --accent: #8be9fd;
  --gutter-bg: #1d1f2a;
  --gutter-text: #7c86a0;
}
.card-window.theme-nord {
  --bg: #0c121a;
  --panel: #111a23;
  --card: #2e3440;
  --titlebar: #3b4252;
  --text: #eceff4;
  --muted: #d8dee9;
  --key: #88c0d0;
  --string: #a3be8c;
  --punct: #e5e9f0;
  --line: #434c5e;
  --accent: #81a1c1;
  --gutter-bg: #2b303b;
  --gutter-text: #7c8799;
}
.card-window.theme-nightowl {
  --bg: #051520;
  --panel: #0a1f31;
  --card: #011627;
  --titlebar: #0b2942;
  --text: #d6deeb;
  --muted: #a1b5cd;
  --key: #c792ea;
  --string: #ecc48d;
  --punct: #a0b3c5;
  --line: #13344b;
  --accent: #7fdbca;
  --gutter-bg: #0b253a;
  --gutter-text: #5f7e97;
}
.card-window.theme-gruvbox {
  --bg: #161410;
  --panel: #1c1a16;
  --card: #282828;
  --titlebar: #3c3836;
  --text: #ebdbb2;
  --muted: #d5c4a1;
  --key: #fb4934;
  --string: #b8bb26;
  --punct: #d5c4a1;
  --line: #3c3836;
  --accent: #fe8019;
  --gutter-bg: #1d2021;
  --gutter-text: #928374;
}
.card-window.theme-catppuccin {
  --bg: #10111b;
  --panel: #161727;
  --card: #1e1e2e;
  --titlebar: #181825;
  --text: #cdd6f4;
  --muted: #bac2de;
  --key: #f38ba8;
  --string: #a6e3a1;
  --punct: #bac2de;
  --line: #2e2e40;
  --accent: #89b4fa;
  --gutter-bg: #11111b;
  --gutter-text: #6c7086;
}

/* Additional themes */
.card-window.theme-tokyonight { --bg:#0a0e14; --panel:#0e1420; --card:#1a1b26; --titlebar:#16161e; --text:#c0caf5; --muted:#a9b1d6; --key:#7aa2f7; --string:#9ece6a; --punct:#c0caf5; --line:#202330; --accent:#bb9af7; --gutter-bg:#15161e; --gutter-text:#6b7195; }
.card-window.theme-palenight { --bg:#0f1222; --panel:#1a1e30; --card:#292d3e; --titlebar:#23283e; --text:#bfc7d5; --muted:#9aa3b1; --key:#82aaff; --string:#c3e88d; --punct:#bfc7d5; --line:#343a52; --accent:#c792ea; --gutter-bg:#23263a; --gutter-text:#7f89a6; }
.card-window.theme-material { --bg:#0f111a; --panel:#141724; --card:#1f2335; --titlebar:#15182a; --text:#e6e6e6; --muted:#a9b0c2; --key:#ff5370; --string:#f78c6c; --punct:#cbd1dc; --line:#2a2f45; --accent:#82aaff; --gutter-bg:#171a2a; --gutter-text:#7d86a1; }
.card-window.theme-oceanicnext { --bg:#0a1014; --panel:#101922; --card:#1b2b34; --titlebar:#1f2d36; --text:#c0c5ce; --muted:#a7adba; --key:#ec5f67; --string:#99c794; --punct:#c0c5ce; --line:#2b3b44; --accent:#5fb3b3; --gutter-bg:#17242c; --gutter-text:#7f8d97; }
.card-window.theme-ayu { --bg:#0b0f14; --panel:#111821; --card:#0a0e14; --titlebar:#0f141a; --text:#e6e1cf; --muted:#a3a1a1; --key:#e6b450; --string:#b8cc52; --punct:#d9d7ce; --line:#1a1f26; --accent:#39bae6; --gutter-bg:#0f131a; --gutter-text:#6d7178; }
.card-window.theme-horizon { --bg:#0e0b14; --panel:#181424; --card:#1c1e26; --titlebar:#232530; --text:#cbced0; --muted:#a0a3b3; --key:#e95378; --string:#29d398; --punct:#b3b8c3; --line:#2a2d3a; --accent:#26bbd9; --gutter-bg:#20222c; --gutter-text:#7e8394; }
.card-window.theme-tomorrow { --bg:#0b0b0b; --panel:#151515; --card:#1d1f21; --titlebar:#222426; --text:#c5c8c6; --muted:#9ea1a0; --key:#b294bb; --string:#b5bd68; --punct:#c5c8c6; --line:#2a2c2e; --accent:#81a2be; --gutter-bg:#1a1c1e; --gutter-text:#808489; }
.card-window.theme-papercolor { --bg:#0d0d0e; --panel:#151517; --card:#1c1c1e; --titlebar:#212123; --text:#e5e5e5; --muted:#bdbdbd; --key:#ff5f5f; --string:#ffd75f; --punct:#e0e0e0; --line:#2a2a2c; --accent:#5fafff; --gutter-bg:#19191b; --gutter-text:#8e8e93; }
.card-window.theme-cobalt2 { --bg:#0b1020; --panel:#0f1630; --card:#193549; --titlebar:#122b3b; --text:#e1efff; --muted:#9fb7cc; --key:#ff6363; --string:#ffc600; --punct:#b1d0e8; --line:#244a61; --accent:#ff9d00; --gutter-bg:#153345; --gutter-text:#7aa0b9; }
.card-window.theme-everforest { --bg:#0f1311; --panel:#141a17; --card:#2b3339; --titlebar:#323c41; --text:#d3c6aa; --muted:#a7c080; --key:#e67e80; --string:#a7c080; --punct:#d3c6aa; --line:#3a4247; --accent:#7fbbb3; --gutter-bg:#2a3237; --gutter-text:#8c9aa3; }
.card-window.theme-solarizedlight { --bg:#fdf6e3; --panel:#f4ecd2; --card:#fffbe6; --titlebar:#eee8d5; --text:#657b83; --muted:#586e75; --key:#b58900; --string:#2aa198; --punct:#657b83; --line:#e6dfc8; --accent:#268bd2; --gutter-bg:#f0e7cf; --gutter-text:#7a8a8b; }
.card-window.theme-onelight { --bg:#fafafa; --panel:#f1f1f3; --card:#ffffff; --titlebar:#f3f4f7; --text:#2b2b2b; --muted:#5a5e6a; --key:#986801; --string:#50a14f; --punct:#5a5e6a; --line:#e7e9ef; --accent:#4078f2; --gutter-bg:#f2f4f8; --gutter-text:#8a8f9a; }
.card-window.theme-githubdark { --bg:#0d1117; --panel:#0f1420; --card:#0d1117; --titlebar:#161b22; --text:#c9d1d9; --muted:#8b949e; --key:#ff7b72; --string:#7ee787; --punct:#c9d1d9; --line:#21262d; --accent:#58a6ff; --gutter-bg:#0b0f14; --gutter-text:#6e7681; }
.card-window.theme-githublight { --bg:#ffffff; --panel:#f6f8fa; --card:#ffffff; --titlebar:#f6f8fa; --text:#24292f; --muted:#57606a; --key:#cf222e; --string:#116329; --punct:#57606a; --line:#d0d7de; --accent:#0969da; --gutter-bg:#f6f8fa; --gutter-text:#6e7781; }
.card-window.theme-cobalt { --bg:#081020; --panel:#0d162a; --card:#002240; --titlebar:#06244b; --text:#eeeeee; --muted:#a0b3c5; --key:#ff9d00; --string:#3ad900; --punct:#c0d6e4; --line:#0d3a66; --accent:#9a86fd; --gutter-bg:#0b1c34; --gutter-text:#6b86a1; }
.card-window.theme-vscodedark { --bg:#0e1116; --panel:#151923; --card:#1e1e1e; --titlebar:#2a2a2a; --text:#d4d4d4; --muted:#9da1ab; --key:#ce9178; --string:#ce9178; --punct:#c5c5c5; --line:#2e2e2e; --accent:#569cd6; --gutter-bg:#252525; --gutter-text:#858585; }
.card-window.theme-purple { --bg:#120b1b; --panel:#1b1226; --card:#2d1b4e; --titlebar:#241641; --text:#e6dcff; --muted:#c2b6ff; --key:#ff6bd6; --string:#a1ffce; --punct:#d8ccff; --line:#3a2a61; --accent:#9a86fd; --gutter-bg:#241d3a; --gutter-text:#9f96c9; }
.card-window.theme-neonnight { --bg:#06080c; --panel:#0b0f17; --card:#0b132b; --titlebar:#111a3a; --text:#d6f0ff; --muted:#9fb1c9; --key:#ff5f87; --string:#00f7a7; --punct:#c3d6ec; --line:#1c2442; --accent:#7aa2f7; --gutter-bg:#0e1530; --gutter-text:#7082a5; }
.card-window.theme-blueberry { --bg:#061019; --panel:#0e1a28; --card:#0f172a; --titlebar:#10203a; --text:#c7d2fe; --muted:#9aa6d1; --key:#60a5fa; --string:#a7f3d0; --punct:#c7d2fe; --line:#1f2a44; --accent:#93c5fd; --gutter-bg:#131f35; --gutter-text:#8391c4; }
.card-window.theme-forest { --bg:#0a100b; --panel:#0f1712; --card:#111c15; --titlebar:#16241c; --text:#dfe7dd; --muted:#a7b5a6; --key:#8bd17c; --string:#b9e6a1; --punct:#d3ded1; --line:#1d2b22; --accent:#7fb8a4; --gutter-bg:#12231a; --gutter-text:#7e9184; }
.card-window.theme-sunset { --bg:#140d0e; --panel:#1c1416; --card:#241a1c; --titlebar:#2c1f22; --text:#f0dada; --muted:#c9a6a6; --key:#ff7a90; --string:#ffd27e; --punct:#f0dada; --line:#3a2a2e; --accent:#ff9aa2; --gutter-bg:#2a1f22; --gutter-text:#a9878a; }
.card-window.theme-midnight { --bg:#05070b; --panel:#0a0f18; --card:#0b1220; --titlebar:#0f172a; --text:#d1d7e6; --muted:#9aa4ba; --key:#7aa2f7; --string:#94f7c1; --punct:#cdd6e4; --line:#18233a; --accent:#8da2ff; --gutter-bg:#101a2f; --gutter-text:#7b89a8; }
.card-window.theme-lava { --bg:#120a0a; --panel:#1b0f0f; --card:#231010; --titlebar:#2d1414; --text:#f5dada; --muted:#e0aaaa; --key:#ff6b6b; --string:#ffd166; --punct:#f0caca; --line:#3a2020; --accent:#ff9b85; --gutter-bg:#2a1616; --gutter-text:#b78f8f; }
.card-window.theme-mint { --bg:#081312; --panel:#0d1b1a; --card:#0f201e; --titlebar:#12312e; --text:#d7fff1; --muted:#a3d6c9; --key:#5eead4; --string:#bbf7d0; --punct:#c7f0e7; --line:#1a3a36; --accent:#34d399; --gutter-bg:#11322f; --gutter-text:#7fb1a6; }
.card-window.theme-matrix { --bg:#030604; --panel:#06100a; --card:#08150d; --titlebar:#0b1b11; --text:#ccebd4; --muted:#9ad0a8; --key:#2aff55; --string:#98ff98; --punct:#ccebd4; --line:#123222; --accent:#00ff9c; --gutter-bg:#0c2016; --gutter-text:#77a789; }

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='1' d='M0 159.5H160M159.5 0V160'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
  opacity: 0.7;
  z-index: -1;
}

button, input, select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid rgba(111, 140, 255, 0.55);
  outline-offset: 2px;
}

.site-header {
  width: min(var(--page-max), calc(100% - var(--page-gutter) * 2));
  margin: 0 auto;
  padding: clamp(24px, 6vw, 60px) var(--page-gutter) clamp(16px, 4vw, 28px);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 12px clamp(18px, 3vw, 36px);
}
.site-branding {
  display: flex;
  flex-direction: column;
  gap: clamp(0px, 0.1vw, 2px);
  align-items: flex-start;
}
.site-header .eyebrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.05;
  color: var(--text);
  border-radius: 999px;
  background: linear-gradient(125deg, rgba(111, 140, 255, 0.38) 0%, rgba(111, 140, 255, 0.16) 48%, rgba(68, 195, 255, 0.22) 100%);
  border: 1px solid rgba(111, 140, 255, 0.44);
  box-shadow: 0 18px 48px rgba(111, 140, 255, 0.28), inset 0 0 12px rgba(255, 255, 255, 0.08);
  text-shadow: 0 6px 18px rgba(8, 12, 26, 0.45);
  background-size: 220% 220%;
  animation: eyebrowShimmer 9s ease-in-out infinite alternate;
  backdrop-filter: blur(16px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.site-header .eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 4px rgba(111, 140, 255, 0.2), 0 0 12px rgba(111, 140, 255, 0.65), 0 0 24px rgba(111, 140, 255, 0.46);
  animation: eyebrowPulse 2.8s ease-in-out infinite;
}
.site-header .eyebrow::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: radial-gradient(100% 120% at 0% 0%, rgba(255, 255, 255, 0.22), transparent 55%);
  opacity: 0.75;
  pointer-events: none;
}
.site-header .eyebrow:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 60px rgba(111, 140, 255, 0.34);
}
@supports (background: color-mix(in srgb, red 50%, transparent)) {
  .site-header .eyebrow {
    background: linear-gradient(
      120deg,
      color-mix(in srgb, var(--accent) 28%, transparent) 0%,
      color-mix(in srgb, var(--accent) 10%, transparent) 100%
    );
    border-color: color-mix(in srgb, var(--accent) 44%, transparent);
    box-shadow: 0 18px 48px color-mix(in srgb, var(--accent) 24%, transparent), inset 0 0 12px color-mix(in srgb, var(--accent) 16%, transparent);
  }
  .site-header .eyebrow::after {
    background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header .eyebrow {
    animation: none;
    background-position: center;
  }
  .site-header .eyebrow::before {
    animation: none;
  }
}

@keyframes eyebrowShimmer {
  0% { background-position: 0% 40%; }
  45% { background-position: 50% 60%; }
  100% { background-position: 100% 50%; }
}

@keyframes eyebrowPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: 0.78; }
}
.site-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 3.4vw, 32px);
  letter-spacing: -0.01em;
  line-height: 1;
  flex: none;
}
.site-header .tag { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; text-align: right; }
.header-actions { display: inline-flex; gap: 12px; align-items: center; }
.header-attribution {
  font-size: 14px;
  color: var(--muted);
}
.header-attribution a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.header-attribution a:hover {
  text-decoration: underline;
}
.header-actions .link { color: var(--muted); text-decoration: none; font-size: 14px; }
.header-actions .link.about-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease;
}
.header-actions .link.about-link:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
}
.header-actions .link:not(.about-link):hover { text-decoration: underline; }

/* About tooltip */
.about-tooltip { position: relative; display: inline-block; }
.about-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(420px, 72vw);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  z-index: 10;
}
.about-popover h3 { margin: 0 0 6px; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.about-popover p { margin: 8px 0; font-size: 14px; line-height: 1.6; color: var(--text); }
.about-tooltip:hover .about-popover,
.about-tooltip:focus-within .about-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}


.layout {
  display: grid;
  grid-template-columns: minmax(360px, clamp(420px, 45vw, 560px)) minmax(520px, 1fr);
  gap: clamp(28px, 4vw, 60px);
  width: min(var(--page-max), calc(100% - var(--page-gutter) * 2));
  margin: 0 auto;
  padding: clamp(12px, 3vw, 28px) var(--page-gutter) clamp(32px, 7vw, 64px);
  align-items: start;
  grid-auto-rows: auto;
}

.form-panel { min-width: min(420px, 100%); overflow: visible; }
.preview-panel { min-width: min(520px, 100%); }

main.layout { flex: 1 0 auto; min-height: 0; align-content: start; }

.layout { min-height: 0; }

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .preview-panel { order: -1; }
}

@media (max-width: 780px) {
  .site-header {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: clamp(28px, 8vw, 52px) var(--page-gutter) clamp(18px, 6vw, 34px);
    gap: clamp(16px, 5vw, 28px);
  }
  .site-branding { align-items: center; }
  .header-actions {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 18px;
  }
  .header-actions .link.about-link {
    width: 100%;
    max-width: 280px;
  }
  .layout {
    width: min(var(--page-max), calc(100% - var(--page-gutter)));
    padding: clamp(12px, 5vw, 28px) var(--page-gutter) clamp(32px, 9vw, 70px);
    gap: clamp(22px, 6vw, 40px);
  }
  .form-panel,
  .preview-panel {
    min-width: 0;
    width: 100%;
  }
  .about-popover {
    left: 50%;
    right: auto;
    transform: translate(-50%, -6px);
  }
  .about-tooltip:hover .about-popover,
  .about-tooltip:focus-within .about-popover {
    transform: translate(-50%, 0);
  }
}

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 36px);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(26px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--radius-lg) - 1px);
  background: rgba(255, 255, 255, 0.02);
  pointer-events: none;
}
.panel h2 {
  position: relative;
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-panel { 
  display: flex; 
  flex-direction: column; 
  gap: 14px; 
  overflow: visible; 
  min-height: 0;
  height: 100%;
}
.form-panel .form-copy {
  position: relative;
  margin: -10px 0 4px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

#details-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
  height: 100%;
  min-height: 0;
}
.form-panel label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.form-panel input,
.form-panel select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 16, 30, 0.75);
  color: var(--text);
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(14px);
}
.form-panel input:focus,
.form-panel select:focus,
.form-panel input:hover,
.form-panel select:hover {
  border-color: rgba(111, 140, 255, 0.4);
  box-shadow: 0 0 0 4px rgba(111, 140, 255, 0.16);
  background: rgba(12, 20, 36, 0.9);
}

.file-title-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.file-title-field::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: calc(var(--radius-md) + 10px);
  background: rgba(123, 148, 255, 0.12);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.file-title-field:focus-within::before {
  opacity: 1;
}

.lookup-input {
  position: relative;
  z-index: 1;
  padding-left: 46px;
  padding-right: 36px; /* Add padding to prevent text overlap with dropdown arrow */
  border-color: rgba(123, 148, 255, 0.32);
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.5 6.5 0 1 0 14 15.5l.27.28.01.01v.79l4.74 4.74a1 1 0 0 0 1.42-1.42L15.5 14Zm-6 0a4.5 4.5 0 1 1 0-9 4.5 4.5 0 0 1 0 9Z' fill='%23b2befc'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 16px 50%;
  background-size: 18px 18px;
  color: var(--text);
}
.lookup-input::placeholder {
  color: rgba(199, 207, 236, 0.65);
}
.lookup-input::-webkit-calendar-picker-indicator {
  display: none;
}
.lookup-input[list] {
  position: relative;
}
.lookup-input[list]::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 5l7 6 7-6' stroke='%23b2befc' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
  cursor: pointer;
  width: 20px;
  height: 20px;
}
.file-title-field:focus-within .lookup-input {
  border-color: rgba(173, 192, 255, 0.92);
  box-shadow: 0 12px 32px rgba(120, 144, 255, 0.22);
  background-color: rgba(15, 24, 44, 0.95);
}

.file-title-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: rgba(10, 16, 32, 0.94);
  border: 1px solid rgba(123, 148, 255, 0.32);
  box-shadow: 0 26px 72px rgba(9, 14, 28, 0.6);
  backdrop-filter: blur(18px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.file-title-dropdown[hidden] {
  display: none !important;
}
.file-title-dropdown::-webkit-scrollbar {
  width: 8px;
}
.file-title-dropdown::-webkit-scrollbar-thumb {
  background: rgba(140, 160, 255, 0.35);
  border-radius: 999px;
}
.dropdown-option {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: calc(var(--radius-md) - 4px);
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.dropdown-option:hover,
.dropdown-option.is-active {
  background: rgba(129, 152, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(173, 192, 255, 0.4);
  transform: translateY(-1px);
}
.dropdown-option:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(173, 192, 255, 0.6);
}

.input-hint {
  position: relative;
  z-index: 1;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: rgba(193, 204, 233, 0.58);
  transition: color 0.2s ease, opacity 0.2s ease;
}
.file-title-field:focus-within .input-hint {
  color: rgba(205, 215, 247, 0.95);
}

.form-panel .buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: auto;
}
.form-panel button {
  position: relative;
  border-radius: var(--radius-md);
  padding: 11px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 16, 28, 0.7);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease, border 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
}
.form-panel button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.24);
}
.form-panel button.secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
}
.form-panel button.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}
.form-panel button.primary {
  color: #f6f8ff;
  background: var(--accent);
  border-color: rgba(150, 173, 255, 0.55);
  box-shadow: 0 10px 24px rgba(111, 140, 255, 0.3);
}
.form-panel button.primary:hover {
  transform: translateY(-2px);
  border-color: rgba(198, 210, 255, 0.9);
  box-shadow: 0 20px 36px rgba(111, 140, 255, 0.45);
}
.form-panel button.primary:active {
  transform: translateY(0);
  box-shadow: 0 10px 20px rgba(111, 140, 255, 0.32);
}
.form-panel button:active { transform: translateY(0); }

.form-panel button.link {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.form-panel button.link:hover,
.form-panel button.link:focus {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.fields-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}
.fields-title {
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.fields-header h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.fields-header .small {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.fields {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
  padding-right: 2px;
  overflow-y: auto;
  flex: 1;
}
.fields::-webkit-scrollbar { width: 6px; }
.fields::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}
/* Responsive max-height based on viewport */
@media (min-height: 800px) {
  .fields {
    max-height: 300px;
  }
}

@media (max-height: 700px) {
  .fields {
    max-height: 200px;
  }
}

.field-row {
  display: grid;
  grid-template-columns: 24px minmax(110px, 0.75fr) minmax(0, 3.25fr) 36px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: grab;
  transition: background 0.2s ease, border 0.2s ease, transform 0.2s ease;
}
.field-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.16);
}
.field-row.dragging {
  opacity: 0.6;
  transform: scale(0.99);
}
.field-row .handle {
  color: var(--muted);
  user-select: none;
  text-align: center;
  font-size: 16px;
  line-height: 1;
}
.field-row input {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(10, 16, 26, 0.7);
  color: var(--text);
  transition: border 0.2s ease, background 0.2s ease;
  min-width: 0;
}
.field-row input:focus,
.field-row input:hover {
  border-color: rgba(111, 140, 255, 0.4);
  background: rgba(12, 20, 34, 0.9);
}
.field-row .remove {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: border 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.field-row .remove:hover,
.field-row .remove:focus {
  color: #ff8484;
  border-color: rgba(255, 132, 132, 0.6);
  background: rgba(255, 132, 132, 0.15);
  transform: translateY(-1px);
}
.field-row .remove:focus { outline: none; }
.field-row .remove:active { transform: translateY(0); }

.preview-panel { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.preview-panel h2 { margin: 0; }

.card-window {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: min(60vh, 520px);
  border-radius: calc(var(--radius-lg) + 4px);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.card-window::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.04);
  opacity: 0.25;
}

.card-titlebar {
  position: relative;
  display: grid;
  grid-template-columns: 120px 1fr 80px;
  align-items: center;
  height: 64px;
  padding: 0 24px;
  background: var(--titlebar);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.traffic { display: flex; gap: 10px; align-items: center; }
.light { width: 14px; height: 14px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.45); }
.light.red { background: #ff5f56; }
.light.yellow { background: #ffbd2e; }
.light.green { background: #27c93f; }
.card-titlebar .title {
  text-align: center;
  color: #ffffff;
  font-size: 18px;
  letter-spacing: 0.02em;
}

.card-body {
  position: relative;
  display: grid;
  grid-template-columns: 70px 1fr;
  height: calc(100% - 64px);
  background: var(--card);
}
.gutter {
  padding: 18px 12px;
  color: var(--gutter-text);
  background: var(--gutter-bg);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
  line-height: 1.9;
  font-size: 14px;
}
.gutter span { display: block; text-align: right; opacity: 0.8; }

.code {
  margin: 0;
  padding: 18px 24px;
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
  color: var(--text);
  font-size: 15px;
  line-height: 2;
  overflow: auto;
  white-space: pre;
}
.code .key { color: var(--key); }
.code .string { color: var(--string); }
.code .punct { color: var(--punct); }

/* SynthWave '84 Glow effect styling */
.card-window.theme-synthwaveglow {
  box-shadow: 0 26px 72px rgba(19, 4, 44, 0.7), 0 0 38px rgba(255, 88, 184, 0.38), 0 0 48px rgba(79, 249, 255, 0.35);
}
.card-window.theme-synthwaveglow::after {
  background: radial-gradient(circle at 20% 20%, rgba(255, 88, 184, 0.26), transparent 45%),
    radial-gradient(circle at 80% 30%, rgba(79, 249, 255, 0.22), transparent 50%),
    rgba(255, 255, 255, 0.08);
  opacity: 0.28;
  mix-blend-mode: screen;
}
.card-window.theme-synthwaveglow .card-titlebar {
  background: linear-gradient(100deg, rgba(61, 35, 116, 0.82) 0%, rgba(255, 88, 184, 0.66) 65%, rgba(255, 126, 203, 0.6) 100%);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.1), 0 0 18px rgba(255, 88, 184, 0.32);
}
.card-window.theme-synthwaveglow .card-titlebar .title {
  text-shadow: 0 0 10px rgba(255, 88, 184, 0.5), 0 0 20px rgba(255, 126, 203, 0.4);
}
.card-window.theme-synthwaveglow .card-body {
  background: linear-gradient(140deg, rgba(17, 0, 48, 0.82) 0%, rgba(47, 26, 79, 0.86) 55%, rgba(35, 11, 70, 0.88) 100%);
}
.card-window.theme-synthwaveglow .gutter {
  background: linear-gradient(180deg, rgba(35, 16, 70, 0.82) 0%, rgba(23, 6, 56, 0.82) 100%);
  border-right-color: rgba(255, 255, 255, 0.14);
  box-shadow: inset -1px 0 0 rgba(79, 249, 255, 0.16);
}
.card-window.theme-synthwaveglow .gutter span {
  text-shadow: 0 0 6px rgba(79, 249, 255, 0.32);
}
.card-window.theme-synthwaveglow .code {
  color: var(--text);
  text-shadow: 0 0 6px rgba(79, 249, 255, 0.24);
}
.card-window.theme-synthwaveglow .code .key {
  text-shadow: 0 0 10px rgba(249, 42, 173, 0.6), 0 0 18px rgba(255, 88, 184, 0.48);
}
.card-window.theme-synthwaveglow .code .string {
  text-shadow: 0 0 10px rgba(254, 222, 93, 0.58), 0 0 18px rgba(255, 218, 122, 0.48);
}
.card-window.theme-synthwaveglow .code .punct {
  text-shadow: 0 0 8px rgba(79, 249, 255, 0.36), 0 0 16px rgba(79, 249, 255, 0.28);
}
.card-window.theme-synthwaveglow .code::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 88, 184, 0.72), rgba(79, 249, 255, 0.6));
}
.card-window.theme-synthwaveglow .code::-webkit-scrollbar-track {
  background: rgba(17, 0, 48, 0.32);
}

.hidden { display: none; }

.site-footer {
  padding: 8px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.site-footer a { color: inherit; }

.attribution {
  text-align: center;
  padding: 20px 0 0;
  font-size: 18px;
  color: var(--muted);
  margin-top: 16px;
  grid-column: 1 / -1;
}

.attribution a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.attribution a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .site-header { padding: 30px 18px 24px; }
  .layout {
    padding: 0 clamp(16px, 5vw, 22px) clamp(42px, 12vw, 68px);
    gap: clamp(20px, 7vw, 32px);
  }
  .panel {
    padding: 22px;
    border-radius: var(--radius-md);
  }
  .form-panel {
    gap: 18px;
  }
  #details-form { gap: 16px; }
  .card-window {
    border-radius: calc(var(--radius-md) + 3px);
  }
  .card-titlebar {
    grid-template-columns: auto 1fr;
    padding: 0 18px;
    height: 58px;
  }
  .card-titlebar .title {
    font-size: 17px;
    text-align: left;
  }
  .card-body {
    grid-template-columns: 52px 1fr;
  }
  .gutter {
    padding: 16px 10px;
    font-size: 13px;
  }
  .code {
    padding: 16px 18px;
    font-size: 14px;
  }
  .field-row {
    grid-template-columns: 24px 1fr;
    grid-template-areas:
      "handle key"
      "handle value"
      "handle remove";
    gap: 10px 14px;
    padding: 10px 12px;
    align-items: start;
  }
  .field-row .handle {
    grid-area: handle;
    align-self: start;
    padding-top: 6px;
  }
  .field-row .field-key { grid-area: key; }
  .field-row .field-value { grid-area: value; }
  .field-row .remove {
    grid-area: remove;
    justify-self: start;
    align-self: start;
    margin-top: 2px;
  }
  .form-panel .buttons { grid-template-columns: 1fr; }
}
