/* Broank Tools: the one look every page on tools.broank.com shares (tools-site/README.md → "The look").
   Colours are Broank's own (modern/src/styles/app.css), so a tool feels like the app. A tool's own CSS may lay out its
   page, but takes every colour, radius, shadow and font from here, and never sets its own accent. */

:root {
  color-scheme: light dark;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --page-top: oklch(.965 .005 205);
  --page-bottom: oklch(.915 .013 208);
  --background: oklch(.945 .007 205);
  --foreground: oklch(.27 .025 222);
  --card: oklch(.985 .004 205);
  --raised: oklch(1 0 0);
  --primary: oklch(.5 .08 218);
  --primary-hover: oklch(.44 .08 218);
  --primary-foreground: oklch(.985 .004 205);
  --secondary: oklch(.9 .016 208);
  --muted: oklch(.93 .009 206);
  --muted-foreground: oklch(.5 .022 218);
  --border: oklch(.86 .013 208);
  --input: oklch(.8 .016 208);
  --ring: oklch(.7 .1 212);
  --success: oklch(.45 .1 150);
  --success-soft: oklch(.93 .04 150);
  --warning: oklch(.47 .09 70);
  --warning-soft: oklch(.94 .045 80);
  --destructive: oklch(.52 .19 27);
  --destructive-soft: oklch(.94 .03 27);
  --check-a: oklch(.94 .006 205);
  --check-b: oklch(.89 .008 205);
  --shadow: 0 1px 2px oklch(.27 .025 222 / .06), 0 8px 24px oklch(.27 .025 222 / .07);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page-top: oklch(.245 .005 60);
    --page-bottom: oklch(.195 .004 60);
    --background: oklch(.22 .004 60);
    --foreground: oklch(.95 .003 70);
    --card: oklch(.27 .005 60);
    --raised: oklch(.32 .006 60);
    --primary: oklch(.9 .006 70);
    --primary-hover: oklch(.97 .004 70);
    --primary-foreground: oklch(.2 .004 60);
    --secondary: oklch(.33 .006 60);
    --muted: oklch(.3 .005 60);
    --muted-foreground: oklch(.73 .006 70);
    --border: oklch(1 0 0 / 10%);
    --input: oklch(1 0 0 / 18%);
    --ring: oklch(.65 .01 70);
    --success: oklch(.8 .12 150);
    --success-soft: oklch(.32 .05 150);
    --warning: oklch(.85 .1 80);
    --warning-soft: oklch(.34 .05 70);
    --destructive: oklch(.75 .15 25);
    --destructive-soft: oklch(.33 .06 25);
    --check-a: oklch(.3 .005 60);
    --check-b: oklch(.26 .005 60);
    --shadow: 0 1px 2px oklch(0 0 0 / .3), 0 8px 24px oklch(0 0 0 / .25);
  }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 17px/1.5 var(--font);
  color: var(--foreground);
  background: var(--page-bottom) linear-gradient(180deg, var(--page-top), var(--page-bottom) 70vh) no-repeat;
  -webkit-font-smoothing: antialiased;
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
h1, h2, h3, p { margin: 0; }
a { color: var(--primary); text-underline-offset: 3px; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

/* The shell: the same bar, page width, heading and footer on every page */
.t-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1200px;
  margin: auto;
  padding: max(14px, env(safe-area-inset-top)) 16px 14px;
}
.t-crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .95rem; }
.t-home { display: inline-flex; align-items: center; gap: 8px; color: var(--foreground); text-decoration: none; font-weight: 650; white-space: nowrap; }
.t-mark {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 15px; font-weight: 750; letter-spacing: -.02em;
}
.t-sep { color: var(--muted-foreground); }
.t-here { color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-private {
  flex: none;
  font-size: .8rem; font-weight: 600;
  color: var(--muted-foreground);
  background: var(--muted);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
}
.t-page { max-width: 1200px; margin: auto; padding: 12px 16px 32px; }
.t-page.t-narrow { max-width: 720px; }
.t-head { margin: 8px 0 24px; }
.t-title { font-size: clamp(1.9rem, 6vw, 2.6rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 750; }
.t-lede { color: var(--muted-foreground); font-size: 1.05rem; margin-top: 8px; max-width: 62ch; }
.t-foot {
  max-width: 1200px; margin: auto;
  padding: 8px 16px 32px;
  font-size: .85rem;
  color: var(--muted-foreground);
}
.t-foot a { color: inherit; font-weight: 600; }

/* Surfaces */
.t-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.t-heading { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.t-muted { color: var(--muted-foreground); }
.t-small { font-size: .88rem; }

/* Buttons */
.t-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--input);
  background: var(--raised);
  color: var(--foreground);
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.t-btn:hover:not(:disabled) { border-color: var(--primary); }
.t-btn:active:not(:disabled) { transform: scale(.98); }
.t-btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.t-btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.t-btn-big { min-height: 56px; font-size: 1.1rem; border-radius: 12px; }
.t-link { border: 0; background: none; padding: 8px 0; color: var(--primary); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
.t-link:hover:not(:disabled) { color: var(--primary-hover); }

/* Fields */
.t-select, select {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius-sm);
  background: var(--raised);
  color: var(--foreground);
}
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 18px; height: 18px; margin: 0; }
.t-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
input[type=range] {
  --fill: 50%;
  width: 100%; height: 6px; margin: 14px 0 8px;
  appearance: none; -webkit-appearance: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(to right, var(--primary) var(--fill), var(--secondary) var(--fill));
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--raised); border: 1px solid var(--input);
  box-shadow: 0 2px 6px oklch(0 0 0 / .2);
}
input[type=range]::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--raised); border: 1px solid var(--input);
  box-shadow: 0 2px 6px oklch(0 0 0 / .2);
}

/* Picking files */
.t-drop {
  width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 22px 12px;
  text-align: center;
  border: 2px dashed var(--input);
  border-radius: var(--radius);
  background: var(--muted);
  color: var(--foreground);
}
.t-drop:hover:not(:disabled), .t-drop.drag, .dragging .t-drop { border-color: var(--primary); }

/* Two-way and more switches */
.t-segment { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--muted); }
.t-segment button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 600; color: var(--muted-foreground); }
.t-segment button[aria-pressed=true] { background: var(--raised); color: var(--foreground); box-shadow: 0 1px 3px oklch(0 0 0 / .12); }

/* Messages and labels */
.t-status { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--muted); font-weight: 600; }
.t-status.done { background: var(--success-soft); color: var(--success); }
.t-status.error { background: var(--destructive-soft); color: var(--destructive); }
.t-error { color: var(--destructive); }
.t-badge { display: inline-block; padding: 2px 9px; border-radius: var(--radius-pill); font-size: .78rem; font-weight: 650; background: var(--warning-soft); color: var(--warning); }
.t-badge.good, .t-badge[data-exact="true"] { background: var(--success-soft); color: var(--success); }
.t-count { display: inline-block; padding: 1px 9px; border-radius: var(--radius-pill); font-size: .85rem; font-weight: 600; background: var(--muted); color: var(--muted-foreground); }

/* See-through areas */
.t-checker { background: repeating-conic-gradient(var(--check-a) 0 25%, var(--check-b) 0 50%) 50% / 20px 20px; }

@media (max-width: 400px) { .t-private { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
