/* Multiple Custom File Generator: "Console" theme.
   Dark and light modes, one lime accent, Spline Sans + Spline Sans Mono. Shared by every page.
   --accent is for text and lines; --accent-fill is for filled buttons. */

:root {
  color-scheme: dark;
  --bg: #0d0f12;
  --bg-band: #111419;
  --surface: #14171c;
  --surface-hover: #1a1e24;
  --field: #0f1216;
  --selected: #2a3039;
  --selected-shadow: none;
  --border: #262b33;
  --border-strong: #343b45;
  --border-field: #2e343d;
  --divider: #1e2228;
  --row-divider: #1a1e24;
  --text: #e9ecef;
  --muted: #9aa2ad;
  --code: #c9d1d9;
  --placeholder: #7d8590;
  --accent: #c4f06c;
  --accent-hover: #d6f79a;
  --accent-soft: rgba(196, 240, 108, 0.14);
  --accent-border: rgba(196, 240, 108, 0.35);
  --accent-fill: #c4f06c;
  --accent-fill-hover: #d6f79a;
  --fill-ring: none;
  --on-accent: #0d0f12;
  --selection: rgba(196, 240, 108, 0.3);
  --warn: #f5c451;
  --warn-soft: rgba(245, 196, 81, 0.1);
  --warn-border: rgba(245, 196, 81, 0.35);
  --warn-text: #f7d98a;
  --danger-text: #ffc2c2;
  --danger-soft: rgba(255, 155, 155, 0.1);
  --danger-border: rgba(255, 155, 155, 0.35);
  --dropzone-hover: #12161b;
  --bar-bg: rgba(13, 15, 18, 0.94);
  --overlay: rgba(13, 15, 18, 0.72);
  --checker-a: #20252c;
  --checker-b: #171a1f;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --gutter: 16px;
  --font: 'Spline Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'Spline Sans Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f7;
  --bg-band: #eceef2;
  --surface: #ffffff;
  --surface-hover: #f3f5f8;
  --field: #f8f9fb;
  --selected: #ffffff;
  --selected-shadow: 0 1px 2px rgba(16, 24, 40, 0.12), 0 0 0 1px #dde1e7;
  --border: #dde1e7;
  --border-strong: #c3cad4;
  --border-field: #cdd3db;
  --divider: #e3e6eb;
  --row-divider: #edf0f3;
  --text: #15181d;
  --muted: #59626e;
  --code: #2d333b;
  --placeholder: #6b7480;
  --accent: #3f6212;
  --accent-hover: #2f4a0d;
  --accent-soft: rgba(101, 163, 13, 0.14);
  --accent-border: rgba(63, 98, 18, 0.35);
  --accent-fill: #c4f06c;
  --accent-fill-hover: #b5e65a;
  --fill-ring: inset 0 0 0 1px rgba(63, 98, 18, 0.3);
  --on-accent: #0d0f12;
  --selection: rgba(132, 204, 22, 0.3);
  --warn: #8a5300;
  --warn-soft: rgba(245, 158, 11, 0.12);
  --warn-border: rgba(217, 119, 6, 0.35);
  --warn-text: #7a4a00;
  --danger-text: #a61b1b;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --danger-border: rgba(220, 38, 38, 0.3);
  --dropzone-hover: #f1f8e6;
  --bar-bg: rgba(244, 245, 247, 0.94);
  --overlay: rgba(244, 245, 247, 0.75);
  --checker-a: #e4e7eb;
  --checker-b: #f6f7f9;
}

@media (min-width: 720px) {
  :root { --gutter: 32px; }
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

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

[hidden] { display: none !important; }

h1, h2, h3, p, figure { margin: 0; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

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

code, pre, kbd { font-family: var(--mono); }

img, canvas { max-width: 100%; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

::selection { background: var(--selection); }

.icon { flex: none; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--accent-fill);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--on-accent); }

.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent-fill); box-shadow: var(--fill-ring); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-fill-hover); color: var(--on-accent); }
.btn-outline { border-color: var(--border-strong); background: transparent; color: var(--text); font-weight: 500; }
.btn-outline:hover:not(:disabled) { border-color: var(--muted); background: var(--surface-hover); color: var(--text); }
.btn-ghost { background: transparent; color: var(--muted); font-weight: 500; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn-lg { min-height: 48px; font-size: 15.5px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }
.icon-btn:disabled { color: var(--border-strong); cursor: not-allowed; }

/* ---------- Header ---------- */

.site-header { border-bottom: 1px solid var(--divider); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding-block: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand-mark { flex: none; width: 28px; height: 28px; color: var(--accent-fill); }
.brand-name {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.header-actions { display: flex; align-items: center; gap: 6px; }

.header-search { position: relative; display: none; width: 280px; }
.header-search .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.header-search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 14px;
}
.header-search input::placeholder { color: var(--placeholder); }
.header-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-tip { min-height: 38px; padding: 0 14px; }

@media (max-width: 559px) {
  .btn-tip { width: 44px; height: 44px; min-height: 44px; padding: 0; border-color: transparent; }
  .btn-tip-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (min-width: 560px) {
  .brand-name { flex-direction: row; gap: 0.28em; font-size: 15px; }
}

@media (min-width: 720px) {
  .header-search { display: block; }
  .header-search-link { display: none; }
}

.page-home .header-search,
.page-home .header-search-link { display: none; }

/* The sun shows in dark mode (switch to light), the moon in light mode. */
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---------- Sponsor band ---------- */

.sponsor-band { border-bottom: 1px solid var(--divider); background: var(--bg-band); }

.sponsor-inner { display: flex; flex-direction: column; gap: 8px; padding-block: 12px; }

.sponsor-title {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sponsor-offers { display: grid; gap: 8px; }

/* Badge above the name, call to action on the right. */
.offer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "badge cta" "name cta";
  align-items: center;
  gap: 3px 12px;
  min-height: 56px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.offer:hover { border-color: var(--border-strong); background: var(--surface-hover); color: var(--text); }
.offer-badge {
  grid-area: badge;
  justify-self: start;
  padding: 1px 7px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--code);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.offer-name { grid-area: name; font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.offer-cta {
  grid-area: cta;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}
.offer-featured { border-color: var(--accent-border); }
.offer-featured .offer-badge { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.offer-featured .offer-cta { border-color: transparent; background: var(--accent-fill); box-shadow: var(--fill-ring); color: var(--on-accent); }

@media (min-width: 720px) {
  .sponsor-offers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* An odd one out takes the whole last row. */
  .sponsor-offers > .offer:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (min-width: 1100px) {
  .sponsor-offers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sponsor-offers > .offer:last-child:nth-child(odd) { grid-column: auto; }
}

/* ---------- Page ---------- */

.page { flex: 1; padding-block: 20px 48px; }

@media (min-width: 720px) {
  .page { padding-block: 28px 64px; }
}

/* ---------- Home ---------- */

.hero { display: flex; flex-direction: column; gap: 14px; padding-block: 8px 4px; }

.eyebrow { color: var(--accent); font-family: var(--mono); font-size: 13px; }

.hero h1 {
  max-width: 820px;
  font-size: clamp(28px, 4.6vw, 44px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lead { max-width: 640px; color: var(--muted); font-size: 16px; text-wrap: pretty; }

.home-search { position: relative; width: 100%; max-width: 520px; margin-top: 6px; }
.home-search .icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.home-search .input { min-height: 48px; padding-left: 42px; border-radius: 12px; font-size: 16px; }

.pills {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.pills::-webkit-scrollbar { display: none; }

.pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.pill:hover { border-color: var(--border-strong); background: var(--surface-hover); color: var(--text); }
.pill-count { color: var(--muted); font-family: var(--mono); font-size: 12px; }

.catalog-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 32px;
  scroll-margin-top: 16px;
}
.group-head { display: flex; align-items: baseline; gap: 10px; }
.group-head h2 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.group-count { color: var(--muted); font-family: var(--mono); font-size: 13px; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 12px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.tool-card:hover { border-color: var(--border-strong); background: var(--surface-hover); color: var(--text); }
.tool-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tool-card-name { font-size: 15.5px; font-weight: 600; }
.tool-card-head .icon { color: var(--muted); transition: transform 0.15s, color 0.15s; }
.tool-card:hover .tool-card-head .icon { color: var(--accent); transform: translateX(2px); }
.tool-card-summary { color: var(--muted); font-size: 14px; }

.chips { display: none; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.chip {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--code);
  font-family: var(--mono);
  font-size: 11px;
}

.no-results { padding: 40px 0 8px; color: var(--muted); }

@media (min-width: 560px) {
  .tool-card { gap: 8px; min-height: 168px; padding: 18px; border-radius: var(--radius-lg); }
  .tool-card-name { font-size: 16px; }
  .chips { display: flex; }
}

@media (min-width: 720px) {
  .hero { padding-block: 20px 8px; }
  .lead { font-size: 17px; }
  .pills { flex-wrap: wrap; overflow: visible; }
  .tool-grid { gap: 14px; }
}

/* ---------- Tool pages ---------- */

.tool-intro { display: flex; flex-direction: column; gap: 8px; padding-bottom: 20px; }

.back-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.back-link:hover { color: var(--text); }

.tool-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.tool-title h1 {
  font-size: clamp(24px, 3.4vw, 30px);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.tool-category { color: var(--muted); font-family: var(--mono); font-size: 13px; }
.tool-lead { max-width: 680px; color: var(--muted); text-wrap: pretty; }

.tool-layout { display: grid; gap: 16px; align-items: start; }
.tool-form,
.tool-output { min-width: 0; }

@media (min-width: 960px) {
  .tool-layout { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; }
  .tool-output { position: sticky; top: 16px; }
}

/* ---------- Panels & form fields ---------- */

.panel { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }

.form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px;
  border-top: 1px solid var(--divider);
}
.form-section:first-child { border-top: 0; }

@media (min-width: 560px) {
  .form-section { padding: 20px 22px; }
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.section-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 14px; font-weight: 500; }
.field-label .muted { font-weight: 400; }
fieldset.field > legend { margin-bottom: 6px; }

.hint { color: var(--muted); font-size: 13.5px; }
.hint code,
.note code,
.alert code { color: var(--code); font-size: 0.93em; }

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 14px;
}

.field-row { display: flex; flex-wrap: wrap; gap: 14px; }
.field-row > .field { flex: 1 1 100px; }
.field-row > .field-wide { flex: 2 1 210px; }

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-field);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--text);
  font-size: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { display: block; min-height: 96px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.input::placeholder,
.textarea::placeholder { color: var(--placeholder); opacity: 1; }
.input:hover,
.select:hover,
.textarea:hover { border-color: var(--border-strong); }
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input:disabled { opacity: 0.5; cursor: not-allowed; }

.select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa2ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  cursor: pointer;
}
.select option { background: var(--surface); color: var(--text); }

@media (min-width: 720px) {
  .input,
  .select,
  .textarea { min-height: 42px; font-size: 14px; }
}

.color-row { display: flex; align-items: center; gap: 12px; }
.color-input {
  width: 52px;
  height: 44px;
  padding: 3px;
  border: 1px solid var(--border-field);
  border-radius: var(--radius);
  background: var(--field);
  cursor: pointer;
}
input[type="range"] { accent-color: var(--accent); }

/* Segmented control built from radio buttons */
.segmented {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-self: flex-start;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border-field);
  border-radius: 12px;
  background: var(--field);
}
.segmented input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.segmented label:hover { color: var(--text); }
.segmented input:checked + label { background: var(--selected); box-shadow: var(--selected-shadow); color: var(--text); }
.segmented input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Checkbox rows and lists */
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.check:hover { background: var(--surface-hover); }
.check input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }

.check-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: 0 8px;
  font-family: var(--mono);
  font-size: 13px;
}

.scroll-box {
  max-height: 340px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--border-field);
  border-radius: var(--radius);
  background: var(--field);
}

.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.list-tools .input { flex: 1 1 200px; width: auto; }
.list-count { color: var(--accent); font-family: var(--mono); font-size: 12.5px; }

/* Live status line and warnings under an input */
.status { display: flex; align-items: center; gap: 8px; color: var(--accent); font-family: var(--mono); font-size: 12.5px; }
.status::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status.is-empty { color: var(--muted); }

.warnings { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.warnings li {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* File drop zone. A transparent file input covers the zone, so click and drop both work natively. */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 160px;
  padding: 24px 16px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--field);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.dropzone:hover,
.dropzone.is-dragover { border-color: var(--accent); background: var(--dropzone-hover); }
.dropzone:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.dropzone-sm { min-height: 116px; padding: 16px; }
.dropzone .icon { color: var(--accent); }
.dropzone-title { font-size: 15.5px; font-weight: 600; }
.dropzone-hint { color: var(--muted); font-size: 13px; }
.dropzone-file { max-width: 100%; color: var(--accent); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }

/* A filename textarea that also takes dropped files or folders; only their names are used. */
.drop-field { position: relative; }
.drop-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1.5px dashed var(--accent);
  border-radius: var(--radius);
  background: var(--dropzone-hover);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}
.drop-field.is-dragover .drop-overlay { display: flex; }
.drop-note { color: var(--muted); font-family: var(--mono); font-size: 12.5px; }

/* ---------- Output panel ---------- */

.output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.output-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.output-title h2 { font-size: 15px; font-weight: 600; }
.output-archive { color: var(--muted); font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }

.count-badge {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.count-badge:empty { display: none; }

.output-empty { padding: 28px 18px; color: var(--muted); font-size: 14px; text-align: center; }

.mapping { max-height: 236px; overflow: auto; padding: 0 18px 10px; }
.mapping-row {
  display: grid;
  grid-template-columns: var(--mapping-columns, minmax(0, 1fr));
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--row-divider);
  color: var(--code);
  font-family: var(--mono);
  font-size: 13px;
}
.mapping-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapping-row > span:first-child { color: var(--accent); }
.mapping-row > span:last-child { color: var(--text); }
.mapping-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-top: 12px;
  border-bottom-color: var(--divider);
  background: var(--surface);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.mapping-head > span:first-child,
.mapping-head > span:last-child,
.mapping-head > span { color: var(--muted); }
.mapping-row.is-flagged > span { color: var(--warn); }
.mapping-more { padding: 8px 0 2px; color: var(--muted); font-size: 12.5px; }

.file-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2px;
  padding: 0 10px;
  border-top: 1px solid var(--border);
}
.file-tab {
  flex: none;
  height: 42px;
  padding: 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  cursor: pointer;
}
.file-tab:hover { color: var(--text); }
.file-tab[aria-pressed="true"] { border-bottom-color: var(--accent); color: var(--text); }

.code {
  margin: 0;
  max-height: clamp(180px, 34vh, 340px);
  overflow: auto;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--field);
  color: var(--code);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre;
  tab-size: 4;
}

.output-files { display: flex; flex-direction: column; margin: 0; padding: 6px 18px; list-style: none; }
.output-files li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--row-divider);
  font-family: var(--mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.output-files li:last-child { border-bottom: 0; }
.output-files .icon { color: var(--muted); }

.note { padding: 14px 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13.5px; }
.note strong { color: var(--text); font-weight: 600; }

.output-actions { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; border-top: 1px solid var(--border); }

/* ---------- Phones: Form/Preview tabs and the bottom action bar ---------- */

.view-tabs,
.action-bar { display: none; }

.action-bar-inner { display: flex; align-items: center; gap: 12px; }
.action-bar .btn { flex: 1; }
.action-summary { display: none; color: var(--muted); font-family: var(--mono); font-size: 13px; }

.action-bar.is-always {
  display: block;
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: 16px calc(var(--gutter) * -1) 0;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--divider);
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

@media (max-width: 719px) {
  .view-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
  }
  .view-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
  }
  .view-tab[aria-pressed="true"] { background: var(--selected); box-shadow: var(--selected-shadow); color: var(--text); }
  .view-tab-count { color: var(--accent); font-family: var(--mono); font-size: 12px; }

  .tool-layout[data-view="form"] > .tool-output.has-preview,
  .tool-layout[data-view="preview"] > .tool-form { display: none; }

  .has-action-bar .tool-output .output-actions { display: none; }

  .action-bar {
    display: block;
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin: 16px calc(var(--gutter) * -1) 0;
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--divider);
    background: var(--bar-bg);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
}

@media (min-width: 720px) {
  .action-bar.is-always { margin-inline: 0; padding-inline: 0; }
  .action-bar.is-always .btn { flex: none; min-width: 260px; }
  .action-bar.is-always .action-summary { display: block; margin-right: auto; }
}

/* ---------- Alerts ---------- */

.alerts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--code);
  font-size: 14px;
}
.alert .icon { margin-top: 2px; }
.alert strong { font-weight: 600; }
.alert-warn { border-color: var(--warn-border); background: var(--warn-soft); color: var(--warn-text); }
.alert-error { border-color: var(--danger-border); background: var(--danger-soft); color: var(--danger-text); }

/* ---------- Tool-specific pieces ---------- */

/* Attendance: 20 daily rewards */
.reward-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 16px 24px;
}
.reward-head,
.reward-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.reward-head {
  padding-bottom: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.reward-row + .reward-row { margin-top: 8px; }
.reward-day { color: var(--muted); font-family: var(--mono); font-size: 13px; }

/* Cash shop item rows */
.cash-head,
.cash-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 0.9fr) 44px;
  gap: 8px;
  align-items: center;
}
.cash-head {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.cash-rows { display: flex; flex-direction: column; gap: 8px; }
.cash-num { display: none; color: var(--muted); font-family: var(--mono); font-size: 13px; text-align: right; }
.add-row { align-self: flex-start; }

@media (min-width: 560px) {
  .cash-head,
  .cash-row { grid-template-columns: 28px minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 0.9fr) 44px; gap: 10px; }
  .cash-num { display: block; }
}

/* Jobstats: job checkboxes grouped by class */
.job-groups { columns: 250px 3; column-gap: 14px; }
.job-group {
  break-inside: avoid;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--field);
}
.job-group legend {
  float: left;
  width: 100%;
  padding: 4px 8px 8px;
  font-size: 14px;
  font-weight: 600;
}
.job-group legend + * { clear: both; }
.job-group .check { min-height: 34px; font-family: var(--mono); font-size: 13px; }
.job-group .check-all { margin-bottom: 2px; color: var(--accent); font-family: var(--font); font-weight: 500; }

/* RO Login Screen: image preview with the 4 × 3 split drawn over it */
.split-area { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }
.split-area .output-empty { padding: 20px 0; }
.split-preview {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--field);
}
.split-preview img { display: block; width: 100%; height: auto; }
.split-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  pointer-events: none;
}
.split-grid span { border-right: 2px dashed rgba(196, 240, 108, 0.8); border-bottom: 2px dashed rgba(196, 240, 108, 0.8); }
.split-grid span:nth-child(4n) { border-right: 0; }
.split-grid span:nth-child(n + 9) { border-bottom: 0; }
.split-meta { color: var(--muted); font-family: var(--mono); font-size: 12.5px; }
.split-meta.is-warning { color: var(--warn); }

/* Palette tools */
.file-list { display: flex; flex-direction: column; max-height: 220px; overflow: auto; margin: 0; padding: 4px 18px; list-style: none; border-top: 1px solid var(--border); }
.file-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--row-divider);
  font-family: var(--mono);
  font-size: 12.5px;
}
.file-list li:last-child { border-bottom: 0; }
.file-list li span:first-child { min-width: 0; overflow-wrap: anywhere; }
.file-list li span:last-child { flex: none; color: var(--muted); }

.progress { display: flex; flex-direction: column; gap: 8px; }
.output-progress { padding: 16px 18px; border-top: 1px solid var(--border); }
.progress-label { display: flex; justify-content: space-between; color: var(--muted); font-family: var(--mono); font-size: 12.5px; }
.progress-track { height: 8px; overflow: hidden; border: 1px solid var(--border); border-radius: 999px; background: var(--field); }
.progress-fill { width: 0; height: 100%; background: var(--accent); transition: width 0.1s linear; }

.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 28px; }
.inline-fields { display: flex; align-items: flex-end; gap: 10px; }
.inline-fields .field { flex: none; width: 96px; }
.inline-fields .btn { flex: none; }

.palette-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 16px;
}
.palette-panel { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.palette-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.palette-head h2 { font-size: 15px; font-weight: 600; }
.palette-head span { color: var(--muted); font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }

.palette-grid {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: 2px;
  padding: 2px;
  border-radius: var(--radius);
  background: var(--border);
}
.pixel {
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
}
.pixel:hover { position: relative; z-index: 1; transform: scale(1.2); box-shadow: 0 0 0 2px var(--bg); }
.pixel.modified { outline: 2px solid var(--accent); outline-offset: -2px; }

.status-line {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--code);
  font-family: var(--mono);
  font-size: 13px;
}
.status-line:empty { display: none; }

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--divider); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 18px;
  color: var(--muted);
  font-size: 13.5px;
}
.footer-inner a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}
.footer-inner a:hover { color: var(--accent); }
.footer-inner .footer-author {
  display: inline;
  min-height: 0;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}
.footer-inner .footer-author:hover { text-decoration-color: currentColor; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
