/* LocalScriptBox — shared styles */
:root {
  --ground: #15162A;
  --ground-deep: #10111F;
  --card: #1F2140;
  --card-line: #34376A;
  --ink: #12131C;
  --shadow: #0B0C18;
  --text: #F4F4FA;
  --muted: #B9BCD9;
  --muted-2: #9DA0C4;
  --yellow: #FFD23F;
  --blue: #5EC8FF;
  --green: #57E389;
  --coral: #FF7A6B;
  --display: Fredoka, Nunito, system-ui, sans-serif;
  --body: Nunito, system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
}
a { color: var(--yellow); }
a:hover { color: #FFE58A; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; }

/* Header */
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 20px; padding-bottom: 20px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.logo:hover { color: var(--text); }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: -0.5px; }
.wordmark .s { color: var(--blue); }
.wordmark .b { color: var(--yellow); }
.site-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.navlink {
  color: var(--text); text-decoration: none; font-weight: 800;
  padding: 12px 16px; border-radius: 12px;
}
.navlink:hover { background: #2A2D55; color: var(--text); }

.btn {
  display: inline-block; text-decoration: none; font-weight: 800;
  padding: 12px 18px; border-radius: 12px; border: 3px solid var(--ink);
  font-family: var(--body); font-size: 16px; cursor: pointer;
}
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-yellow:hover { color: var(--ink); background: #FFDC66; }
.btn-dark { background: var(--ink); color: var(--text); }
.btn-dark:hover { color: var(--text); background: #23253A; }

/* Hero */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px; padding-top: 48px; padding-bottom: 32px; }
.hero h1 { font-size: clamp(40px, 7vw, 64px); letter-spacing: -1px; line-height: 1.05; }
.hero h1 .done { color: var(--green); }
.hero p { margin: 0; max-width: 640px; font-size: 20px; color: var(--muted); }

.search { width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.search label { font-weight: 800; font-size: 15px; color: var(--muted); }
.search-box {
  display: flex; align-items: center; gap: 12px; background: var(--text);
  border: 3px solid var(--ink); border-radius: 18px; padding: 6px 8px 6px 18px;
  box-shadow: 0 6px 0 var(--shadow);
}
.search-box input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-family: var(--body); font-size: 20px; font-weight: 700; color: var(--ink); padding: 12px 0;
}
.search-box input::placeholder { color: #6B6E8F; }
.search-box:focus-within { outline: 3px solid var(--blue); outline-offset: 3px; }

.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.pill { font-weight: 800; font-size: 14px; padding: 8px 14px; border-radius: 999px; background: var(--card); border: 2px solid var(--card-line); }

/* Sections */
.section { padding-top: 32px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 20px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
.section h2 { font-size: 34px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }

.tile {
  display: flex; flex-direction: column; gap: 10px; min-height: 150px;
  text-decoration: none; color: var(--ink); border: 3px solid var(--ink);
  border-radius: 20px; padding: 20px; box-shadow: 0 6px 0 var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.tile:hover { color: var(--ink); transform: translateY(-4px) rotate(-0.6deg); box-shadow: 0 10px 0 var(--shadow); }
.tile .cat { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; }
.tile .name { font-family: var(--display); font-weight: 600; font-size: 23px; line-height: 1.15; }
.tile .desc { font-size: 15px; font-weight: 600; line-height: 1.4; }

.cat-bar { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--body); font-weight: 800; font-size: 15px; color: var(--text);
  background: var(--card); border: 2px solid var(--card-line); border-radius: 999px; padding: 9px 16px;
}
.chip:hover { border-color: var(--muted-2); }
.chip .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); }
.chip .n { color: var(--muted-2); font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--ink); border-color: var(--ink); }
.chip[aria-pressed="true"] .n { color: #4A4D6A; }
/* Category blurb on hover / keyboard focus */
.cat-bar .chip { position: relative; }
.cat-bar .chip[data-tip]:hover::after, .cat-bar .chip[data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: 0; bottom: calc(100% + 10px);
  width: max-content; max-width: 260px; white-space: normal; text-align: left; z-index: 10;
  background: var(--text); color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.4;
  padding: 8px 11px; border-radius: 10px; border: 2px solid var(--ink); box-shadow: 0 4px 0 var(--shadow); pointer-events: none;
}
.cat-bar .chip[data-tip]:hover::before, .cat-bar .chip[data-tip]:focus-visible::before {
  content: ''; position: absolute; left: 18px; bottom: calc(100% + 3px);
  border: 7px solid transparent; border-top-color: var(--ink); border-bottom: 0; z-index: 10; pointer-events: none;
}
/* Chips on the right half of the screen open their blurb leftwards so it stays on screen. */
.cat-bar .chip[data-tip-side="right"]:hover::after, .cat-bar .chip[data-tip-side="right"]:focus-visible::after { left: auto; right: 0; }
.cat-bar .chip[data-tip-side="right"]:hover::before, .cat-bar .chip[data-tip-side="right"]:focus-visible::before { left: auto; right: 18px; }

.empty {
  border: 2px dashed #4A4D80; border-radius: 20px; padding: 32px;
  text-align: center; color: var(--muted); font-weight: 700;
}
.empty strong { display: block; font-family: var(--display); font-size: 24px; color: var(--text); margin-bottom: 6px; }

/* Callout */
.callout {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
  background: var(--yellow); color: var(--ink); border: 3px solid var(--ink);
  border-radius: 24px; padding: 32px; box-shadow: 0 8px 0 var(--shadow);
}
.callout > div { flex: 1 1 360px; display: flex; flex-direction: column; gap: 8px; }
.callout h2 { font-size: 32px; }
.callout p { margin: 0; font-size: 17px; font-weight: 600; }

/* Footer */
.site-footer { border-top: 3px solid var(--ink); background: var(--ground-deep); margin-top: 48px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; padding-top: 36px; padding-bottom: 36px; }
.site-footer p { margin: 8px 0 0; font-size: 15px; color: var(--muted); max-width: 420px; }
.site-footer nav { display: flex; flex-direction: column; gap: 10px; font-weight: 700; font-size: 15px; }
.site-footer .copy { font-size: 14px; color: var(--muted-2); }

/* Prose pages (about, privacy, tool write-ups) */
.prose { padding-top: 40px; padding-bottom: 24px; }
.prose h1 { font-size: clamp(36px, 6vw, 52px); margin-bottom: 16px; }
.prose h2 { font-size: 28px; margin: 40px 0 12px; }
.prose h3 { font-size: 21px; margin: 24px 0 8px; }
.prose p, .prose li { color: #DADCF0; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin-bottom: 6px; }
.prose .lead { font-size: 20px; color: var(--muted); }
.prose code {
  background: var(--card); border: 1px solid var(--card-line); border-radius: 6px;
  padding: 1px 6px; font-size: 0.92em;
}
.updated { font-size: 14px; color: var(--muted-2); }

/* Tool page */
.breadcrumb { font-size: 14px; font-weight: 700; color: var(--muted-2); padding-top: 24px; }
.breadcrumb a { color: var(--muted); }
.tool-head { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
.tool-head h1 { font-size: clamp(36px, 6vw, 56px); }
.tool-head .cat-badge {
  align-self: flex-start; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--ink); background: var(--blue); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 12px;
}
.tool-head p { margin: 0; font-size: 20px; color: var(--muted); max-width: 720px; }

.tool-app {
  margin-top: 28px; background: var(--card); border: 3px solid var(--ink);
  border-radius: 24px; padding: 28px; box-shadow: 0 8px 0 var(--shadow);
}
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 200px; border: 3px dashed #4A4D80; border-radius: 18px; padding: 24px;
  text-align: center; color: var(--muted); font-weight: 700; cursor: pointer;
}
.dropzone:hover, .dropzone.over { border-color: var(--yellow); color: var(--text); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.privacy-note { margin: 14px 0 0; font-size: 14px; color: var(--muted-2); text-align: center; }

.example { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: start; }
.example .arrow { font-family: var(--display); font-size: 28px; color: var(--yellow); padding-top: 34px; }
.example figure { margin: 0; }
.example figcaption { font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin-bottom: 8px; }
@media (max-width: 640px) {
  .example { grid-template-columns: 1fr; }
  .example .arrow { padding-top: 0; transform: rotate(90deg); justify-self: center; }
}

.table-box { overflow-x: auto; border: 2px solid var(--card-line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--card-line); white-space: nowrap; }
th { background: var(--card); font-weight: 800; color: var(--text); }
td { color: #DADCF0; }
tr:last-child td { border-bottom: none; }

details.faq { border: 2px solid var(--card-line); border-radius: 14px; padding: 14px 18px; margin-bottom: 12px; background: var(--card); }
details.faq summary { font-weight: 800; cursor: pointer; }
details.faq p { margin: 10px 0 0; }

.placeholder-note {
  background: #2A1F10; border: 2px dashed var(--yellow); color: #FFE58A;
  border-radius: 12px; padding: 10px 14px; font-size: 14px; font-weight: 700;
}

/* Tool controls */
/* Base look for any input inside a tool (tables, grids); the .controls rules below refine it. */
.tool-app input:is([type="text"], [type="number"], [type="search"], [type="date"], [type="time"], [type="email"], [type="url"]), .tool-app select {
  font: inherit; padding: 8px 10px; border-radius: 10px; max-width: 100%;
  border: 2px solid var(--card-line); background: var(--ground); color: var(--text);
}
.tool-app input[type="checkbox"] { accent-color: var(--yellow); }
.tool-app input[type="range"] { accent-color: var(--yellow); }
.controls { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; margin-top: 20px; }
.controls .field { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.controls input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--yellow); }
.controls input[type="range"] { width: 220px; accent-color: var(--yellow); }
.controls input[type="number"] {
  width: 84px; font: inherit; font-weight: 800; padding: 8px 10px; border-radius: 10px;
  border: 2px solid var(--card-line); background: var(--ground); color: var(--text);
}
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn-small { padding: 8px 14px; font-size: 14px; border-width: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.out-list { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.out-item {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  background: var(--ground); border: 2px solid var(--card-line); border-radius: 14px; padding: 12px 14px;
}
.out-item .main { flex: 1 1 260px; min-width: 0; }
.out-item .title { font-weight: 800; overflow-wrap: anywhere; }
.out-item .meta { font-size: 14px; color: var(--muted); margin-top: 2px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 18px; overflow-wrap: anywhere; }
.tag { display: inline-block; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; border: 2px solid var(--ink); color: var(--ink); }
.tag-bad { background: var(--coral); }
.tag-good { background: var(--green); }
.tag-info { background: var(--blue); }
textarea.text-in {
  width: 100%; min-height: 220px; resize: vertical; font: inherit; font-size: 16px; line-height: 1.5;
  padding: 14px 16px; border-radius: 14px; border: 2px solid var(--card-line);
  background: var(--ground); color: var(--text);
}
textarea.text-in.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; }
textarea.text-in:focus { outline: 3px solid var(--blue); outline-offset: 2px; }
.controls select {
  font: inherit; font-weight: 800; padding: 8px 10px; border-radius: 10px;
  border: 2px solid var(--card-line); background: var(--ground); color: var(--text);
}
.controls input[type="text"] {
  flex: 1 1 280px; font: inherit; padding: 10px 12px; border-radius: 10px;
  border: 2px solid var(--card-line); background: var(--ground); color: var(--text);
}
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 20px; }
.stat { background: var(--ground); border: 2px solid var(--card-line); border-radius: 14px; padding: 12px 14px; }
.stat b { display: block; font-family: var(--display); font-size: 30px; line-height: 1.1; color: var(--text); }
.stat span { font-size: 14px; font-weight: 700; color: var(--muted); }
.status { margin-top: 16px; font-weight: 700; color: var(--muted); }
.status.error { color: var(--coral); }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* Homepage "Keep tools for offline use" switch */
.offline-box { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 2px solid var(--card-line); border-radius: 16px; padding: 18px 20px; cursor: pointer; color: var(--muted); }
.offline-box b { display: block; color: var(--text, #fff); font-size: 17px; margin-bottom: 4px; }
.offline-box input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: #57E389; }
.offline-status { color: var(--muted); font-weight: 700; margin-top: 10px; min-height: 1.4em; }
