/* Palakea shared styles. One file for every page. */
:root {
  --bg: #f4f6f8; --surface: #ffffff; --ink: #12161c; --muted: #59626f; --line: #dde2e8; --tile: #eef1f4;
  --accent: #0a7d62; --accent-ink: #ffffff; --accent-soft: #e1f3ed; --warn: #9a6a00; --focus: #0a7d62;
  --font-display: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1115; --surface: #161a20; --ink: #e9ecf0; --muted: #97a1ae; --line: #2a313a; --tile: #1d232b;
    --accent: #3fcf9f; --accent-ink: #06261c; --accent-soft: #15302a; --warn: #e8c766; --focus: #3fcf9f;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--font-body); -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1160px; margin-inline: auto; padding-inline: 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

/* Header */
.site { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 20px var(--font-display); letter-spacing: -0.02em; }
.cats { background: var(--surface); border-bottom: 1px solid var(--line); }
.cats .wrap { display: flex; gap: 8px; overflow-x: auto; padding-block: 10px; scrollbar-width: none; }
.cats .wrap::-webkit-scrollbar { display: none; }
.pill { flex: none; white-space: nowrap; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.pill[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 15px var(--font-body); cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.field { display: grid; gap: 6px; }
.field > label { font: 600 12px var(--font-body); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.field select, .field input[type="number"] { height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 400 16px var(--font-body); width: 100%; }
.field.check { grid-column: 1 / -1; }
.field.check > label { text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 500; color: var(--ink); justify-content: flex-start; align-items: center; gap: 8px; cursor: pointer; }
.field.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.field input[type="range"] { accent-color: var(--accent); height: 44px; margin: 0; width: 100%; }

/* Ads (rendered only when configured in site.json). Reserved height avoids layout shift. */
.adwrap { min-height: 100px; text-align: center; overflow: hidden; }
.adwrap small { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.adwrap.ad-mid { min-height: 280px; }
.adwrap.ad-side { min-height: 600px; }

/* Layout */
.layout { display: grid; gap: 32px; padding-block: 20px 56px; }
.layout > * { min-width: 0; }
.main { display: grid; gap: 28px; align-content: start; }
.layout.solo .main { max-width: 820px; margin-inline: auto; width: 100%; }
.side { display: none; }
@media (min-width: 1000px) {
  .layout.has-side { grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; }
  .side { display: block; }
  .side-inner { position: sticky; top: 84px; display: grid; gap: 16px; }
}
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--muted); }
h1 { font-weight: 700; font-size: clamp(1.9rem, 5.5vw, 2.8rem); letter-spacing: -0.025em; }
.lede { margin: 10px 0 0; color: var(--muted); font-size: 1.0625rem; max-width: 60ch; }

/* Tool card */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px -12px rgb(0 0 0 / 0.12); }
@media (min-width: 640px) { .tool { padding: 24px; } }
.drop { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 28px 16px; border: 2px dashed var(--line); border-radius: 12px; cursor: pointer; color: var(--muted); transition: border-color 0.15s, background-color 0.15s; }
.drop svg { color: var(--accent); }
.drop strong { color: var(--ink); font: 600 17px var(--font-display); }
.drop small { font-size: 13px; }
.drop.over, .sr:focus-visible + .drop { border-color: var(--accent); background: var(--accent-soft); }
.opts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 16px; }
.files { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.file { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--tile); }
.fname { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; min-width: 0; }
.fname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsub { font: 400 12.5px/1.5 var(--font-mono); color: var(--muted); overflow-wrap: anywhere; }
.fsub .good { color: var(--accent); font-weight: 600; }
.fsub .bad { color: var(--warn); font-weight: 600; }
.facts { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
@media (max-width: 519px) { .facts { grid-column: 1 / -1; justify-content: flex-end; } }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.actions .primary { flex: 1 1 200px; }
.status { margin: 12px 0 0; font-size: 14px; color: var(--muted); min-height: 1.5em; }
.privacy { display: flex; gap: 8px; align-items: center; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.privacy svg { flex: none; color: var(--accent); }

/* Content */
.prose { display: grid; gap: 14px; max-width: 68ch; }
.prose.wide { max-width: none; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.125rem; margin-top: 8px; }
.prose p, .prose ul { margin: 0; }
.prose ul { padding-left: 1.25rem; display: grid; gap: 6px; }
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.steps li::before { content: counter(s); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 600 14px var(--font-mono); }
.steps strong { display: block; }
.steps span { color: var(--muted); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 14px 32px 14px 0; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font: 400 22px var(--font-mono); color: var(--accent); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 14px; color: var(--muted); }

/* Tool cards */
.tgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tcard { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; }
.tcard:hover { border-color: var(--accent); }
.tcard b { display: block; font: 600 15px var(--font-display); }
.tcard small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
.badge { min-width: 64px; display: inline-flex; justify-content: center; gap: 3px; padding: 8px; border-radius: 8px; background: var(--tile); color: var(--ink); font: 600 11px var(--font-mono); white-space: nowrap; }
.badge i { font-style: normal; color: var(--accent); }
.pop { list-style: none; margin: 0; padding: 0; display: grid; }
.pop a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 15px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.panel h3 { font-size: 1rem; margin-bottom: 6px; }

/* Home */
.hero { padding-block: 36px 8px; display: grid; gap: 14px; }
.hero h1 { max-width: 18ch; }
.cat { display: grid; gap: 14px; }
.cat h2 { font-size: 1.25rem; }
.home { display: grid; gap: 36px; padding-block: 16px 56px; }
.points { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.points div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.points b { display: block; font: 600 16px var(--font-display); margin-bottom: 4px; }
.points span { color: var(--muted); font-size: 15px; }

/* Plain pages (about, privacy, terms, contact, 404) */
.page { padding-block: 28px 64px; }
.page .prose { max-width: 72ch; }
.page h1 { margin-bottom: 18px; }
.page .meta { color: var(--muted); font-size: 14px; margin: -8px 0 8px; }

/* Footer */
.foot { background: var(--surface); border-top: 1px solid var(--line); padding-block: 32px; color: var(--muted); font-size: 14px; }
.foot .cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.foot h3 { font: 600 12px var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); margin-bottom: 8px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot p { margin: 0; }
.foot a { color: var(--muted); }
.foot .fine { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
