:root {
  color-scheme: dark;
  --canvas: #10132b;
  --surface: #191d3d;
  --surface-raised: #24294f;
  --line: #3b4275;
  --text: #f0f2ff;
  --muted: #b2b8dc;
  --mint: #aebcff;
  --mint-ink: #17183a;
  --orange: #d6b6ff;
  --danger: #ff9abb;
  --header-bg: #10132bd9;
  --input: #11152f;
  --card-start: #202650;
  --card-end: #171b3c;
  --meta: #1b2044;
  --preview: #11152f;
  --orb-blue: #214d95;
  --orb-purple: #56327f;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --canvas: #f6f7ff;
  --surface: #ffffff;
  --surface-raised: #edf0ff;
  --line: #cbd1ee;
  --text: #1b2044;
  --muted: #60698e;
  --mint: #5144c9;
  --mint-ink: #ffffff;
  --orange: #8044c7;
  --danger: #be2f63;
  --header-bg: #f6f7ffde;
  --input: #ffffff;
  --card-start: #ffffff;
  --card-end: #f2f4ff;
  --meta: #f7f8ff;
  --preview: #ffffff;
  --orb-blue: #d8e6ff;
  --orb-purple: #eadcff;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--text); }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(circle at 3% 0%, var(--orb-blue) 0, transparent 31rem), radial-gradient(circle at 97% 15%, var(--orb-purple) 0, transparent 27rem), linear-gradient(135deg, transparent 49.7%, #ffffff08 50%, transparent 50.3%); background-size: auto, auto, 32px 32px; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.site-header { border-bottom: 1px solid var(--line); background: var(--header-bg); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 5; }
.site-header .shell { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -.04em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid color-mix(in srgb, var(--mint) 60%, transparent); border-radius: 9px; color: var(--mint); font-family: Georgia, serif; font-size: 20px; }
.back-link { color: var(--muted); text-decoration: none; font-size: .9rem; }
.back-link:hover { color: var(--mint); }
.theme-toggle { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; background: var(--surface); color: var(--text); font-size: .8rem; font-weight: bold; }
.theme-toggle:hover { border-color: var(--mint); color: var(--mint); }
.tool-page { padding: 58px 0 70px; }
.eyebrow { color: var(--mint); font-family: Consolas, monospace; font-size: .74rem; font-weight: bold; letter-spacing: .12em; text-transform: uppercase; }
.tool-intro { max-width: 680px; margin-bottom: 30px; }
.tool-intro h1 { margin: 8px 0 10px; font-size: clamp(2rem, 5vw, 3.6rem); letter-spacing: -.065em; line-height: .98; }
.tool-intro p { max-width: 600px; margin: 0; color: var(--muted); font-size: 1.05rem; line-height: 1.55; }
.tool-card { padding: clamp(20px, 4vw, 34px); border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, var(--card-start), var(--card-end)); box-shadow: 12px 14px 0 color-mix(in srgb, var(--text) 8%, transparent); }
.field-label { display: block; margin: 0 0 9px; color: var(--text); font-size: .83rem; font-weight: bold; }
textarea, input[type="text"], input[type="search"] { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; outline: none; color: var(--text); background: var(--input); }
textarea { min-height: 180px; resize: vertical; font-family: Consolas, monospace; line-height: 1.5; }
textarea:focus, input[type="text"]:focus, input[type="search"]:focus { border-color: var(--mint); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 16%, transparent); }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.button { padding: 10px 14px; border: 1px solid var(--mint); border-radius: 9px; background: var(--mint); color: var(--mint-ink); font-size: .9rem; font-weight: bold; }
.button:hover { filter: brightness(1.08); }
.button-secondary { border-color: var(--line); background: transparent; color: var(--text); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.status { min-height: 1.25em; margin: 14px 0 0; color: var(--muted); font-size: .88rem; }
.split-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.drop-zone { display: grid; min-height: 200px; place-items: center; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; transition: background .2s, border-color .2s; }
.drop-zone.is-dragging, .drop-zone:hover { border-color: var(--mint); background: color-mix(in srgb, var(--mint) 8%, transparent); }
.preview { display: grid; min-height: 120px; place-items: center; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--preview); color: var(--muted); }
.preview canvas { display: block; max-width: 100%; max-height: 520px; }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.meta-item { padding: 11px 13px; background: var(--meta); color: var(--muted); font-size: .84rem; }
.meta-item strong { display: block; margin-top: 3px; color: var(--text); font-family: Consolas, monospace; font-size: .9rem; font-weight: normal; }
.option-row { display: flex; flex-wrap: wrap; gap: 16px; margin: 14px 0 18px; color: var(--muted); font-size: .88rem; }
.option-row label { display: flex; align-items: center; gap: 7px; }
table { width: 100%; border-collapse: collapse; color: var(--text); font-size: .9rem; }
th, td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; }
th { background: var(--surface-raised); }
@media (max-width: 680px) { .shell { width: min(100% - 24px, 1120px); } .site-header .shell { min-height: 58px; } .header-actions { gap: 10px; } .tool-page { padding-top: 38px; } .split-grid { grid-template-columns: 1fr; } .tool-card { border-radius: 14px; } }
