:root {
  color-scheme: dark;
  --ink: #f2efe7;
  --muted: #a5aaac;
  --line: rgba(236, 238, 229, 0.14);
  --panel: rgba(25, 31, 34, 0.78);
  --green: #c4fb72;
  --green-ink: #11200b;
  --warm: #ffbd76;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
  /* No "Inter" here on purpose: Inter is not self-hosted, and some machines
     (including the NAS owner's Mac) only have the italic cut installed, which
     rendered the whole UI slanted. Fall back to the upright system sans. */
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  font-synthesis: none;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 15%, rgba(110, 168, 107, 0.15), transparent 29rem),
    radial-gradient(circle at 90% 77%, rgba(166, 115, 70, 0.17), transparent 31rem),
    #101617;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .3;
  background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at center, black, transparent 78%);
}

.shell { width: min(920px, calc(100% - 40px)); margin: 0 auto; padding: 25px 0 56px; }
.masthead { display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 1.04rem; font-weight: 720; letter-spacing: -.025em; }
.brand-mark { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid rgba(196, 251, 114, .6); border-radius: 50%; color: var(--green); font-size: 1.4rem; font-weight: 400; line-height: 1; }
.local-badge { display: inline-flex; align-items: center; gap: 7px; color: #c9d2c0; font-size: .72rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.local-badge span { color: var(--green); font-size: .6rem; }
.hero { max-width: 690px; padding: clamp(66px, 13vw, 118px) 0 45px; }
.eyebrow { margin: 0 0 15px; color: var(--green); font-size: .71rem; font-weight: 750; letter-spacing: .15em; }
h1 { max-width: 640px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.8rem, 7vw, 5.55rem); font-weight: 400; letter-spacing: -.065em; line-height: .94; }
.lede { max-width: 575px; margin: 27px 0 0; color: var(--muted); font-size: 1.02rem; line-height: 1.6; }
code { padding: .12em .36em; border-radius: 4px; background: rgba(255,255,255,.08); color: #e7eadf; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
.workbench { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.mode-switch { display: flex; gap: 7px; padding: 10px; border-bottom: 1px solid var(--line); background: rgba(6, 10, 11, .25); }
.mode-button { appearance: none; border: 0; border-radius: 9px; padding: 10px 13px; color: var(--muted); background: transparent; cursor: pointer; font: inherit; font-size: .84rem; font-weight: 680; transition: .18s ease; }
.mode-button:hover { color: var(--ink); }
.mode-button.active { color: var(--ink); background: rgba(255,255,255,.09); }
.panel { padding: 28px; }
.field-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
label, .choice-label { display: block; color: #ebebe4; font-size: .87rem; font-weight: 700; letter-spacing: -.01em; }
.status { color: var(--muted); font-size: .75rem; }
textarea, input { width: 100%; border: 1px solid rgba(237,239,229,.14); border-radius: 9px; outline: none; color: var(--ink); background: rgba(4, 7, 8, .48); font: inherit; transition: border-color .18s ease, box-shadow .18s ease; }
textarea:focus, input:focus { border-color: rgba(196,251,114,.7); box-shadow: 0 0 0 3px rgba(196,251,114,.1); }
textarea { min-height: 220px; resize: vertical; padding: 16px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .82rem; line-height: 1.55; }
textarea::placeholder, input::placeholder { color: #6c7476; }
.choice-row { display: flex; align-items: center; justify-content: space-between; gap: 26px; padding: 23px 0 19px; border-bottom: 1px solid var(--line); }
.choice-label { margin-bottom: 5px; }
.helper { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.toggle { display: inline-flex; flex: none; align-items: center; gap: 9px; cursor: pointer; color: #dfe5d7; font-size: .8rem; white-space: nowrap; }
.toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle-track { width: 38px; height: 22px; border: 1px solid rgba(255,255,255,.18); border-radius: 14px; background: #465054; transition: .18s ease; }
.toggle-track::after { display: block; width: 16px; height: 16px; margin: 2px; border-radius: 50%; content: ""; background: #ecf0ed; transition: .18s ease; }
.toggle input:checked + .toggle-track { border-color: var(--green); background: var(--green); }
.toggle input:checked + .toggle-track::after { transform: translateX(16px); background: #163015; }
.toggle input:focus-visible + .toggle-track { outline: 3px solid rgba(196,251,114,.25); outline-offset: 2px; }
.password-fields { display: grid; gap: 8px; padding: 19px 0 4px; }
.password-input { position: relative; }
.password-input input { padding: 12px 63px 12px 13px; }
.plain-button { position: absolute; top: 50%; right: 8px; border: 0; color: var(--green); background: transparent; cursor: pointer; font: inherit; font-size: .76rem; font-weight: 700; transform: translateY(-50%); }
.action-row { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding-top: 27px; }
.action-row.compact { align-items: center; }
.filename-field { position: relative; min-width: 190px; max-width: 285px; color: var(--muted); font-size: .7rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.filename-field input { margin-top: 7px; padding: 11px 43px 11px 12px; color: var(--ink); font-size: .87rem; letter-spacing: normal; text-transform: none; }
.filename-field em { position: absolute; right: 12px; bottom: 12px; color: var(--muted); font-size: .78rem; font-style: normal; letter-spacing: normal; text-transform: none; }
.primary-button { flex: none; border: 0; border-radius: 9px; padding: 13px 16px; color: var(--green-ink); background: var(--green); box-shadow: 0 7px 20px rgba(155,218,77,.14); cursor: pointer; font: inherit; font-size: .84rem; font-weight: 800; transition: transform .16s ease, filter .16s ease; }
.primary-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.primary-button:focus-visible, .mode-button:focus-visible { outline: 3px solid rgba(196,251,114,.4); outline-offset: 2px; }
.message { min-height: 20px; margin: 17px 0 0; color: #cfd5ce; font-size: .8rem; line-height: 1.45; }
.message.error { color: var(--warm); }
.reality-check { display: flex; gap: 12px; max-width: 740px; margin: 26px auto 0; color: #bac0b8; font-size: .78rem; line-height: 1.58; }
.reality-check p { margin: 0; }
.reality-check strong { color: #e3e4dc; }
.notice-icon { display: grid; flex: none; width: 20px; height: 20px; place-items: center; border: 1px solid rgba(255,189,118,.7); border-radius: 50%; color: var(--warm); font-family: Georgia, serif; font-weight: 700; }

@media (max-width: 610px) {
  .shell { width: min(100% - 28px, 920px); padding-top: 18px; }
  .hero { padding-top: 63px; }
  .panel { padding: 19px; }
  .choice-row, .action-row { align-items: flex-start; flex-direction: column; }
  .choice-row { gap: 15px; }
  .action-row { gap: 18px; }
  .action-row.compact { align-items: stretch; }
  .filename-field { width: 100%; max-width: none; }
  .primary-button { width: 100%; }
}
