/* ---------- IzzyIs Tools - shared stylesheet ---------- */

/* ---------- 1. Fonts ---------- */

@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/lexend-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/lexend-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/lexend-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/lexend-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/lexend-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/lexend-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/open-sans-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/open-sans-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Tinos";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/tinos-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Tinos";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/tinos-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* Placeholder Text Generator fonts */
@font-face {
  font-family: "Noto Sans SC";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/noto-sans-sc-400-placeholder.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Sans JP";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/noto-sans-jp-400-placeholder.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Sans KR";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/noto-sans-kr-400-placeholder.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/poppins-400-devanagari.woff2") format("woff2");
  unicode-range: U+0900-097F,U+1CD0-1CF9,U+200C-200D,U+20A8,U+20B9,U+25CC,U+A830-A839,U+A8E0-A8FF;
}
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/readex-pro-400-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC;
}

@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/lexend-vietnamese-400-normal.woff2") format("woff2");
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}
@font-face {
  font-family: "Noto Sans Thai";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/noto-sans-thai-400.woff2") format("woff2");
  unicode-range: U+0E01-0E5B,U+200C-200D,U+25CC;
}
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/rubik-400-cyrillic.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/rubik-400-hebrew.woff2") format("woff2");
  unicode-range: U+0307-0308,U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F;
}

/* ---------- 2. Colors and base ---------- */

:root {
  --bg: #ffffff;
  --ink: #1f1d30;
  --yellow: #fec72e;
  --orange: #ffab2f;
  --line: #d5d4dd;
  --tint: #fff5d6;
  --surface: #f7f7f9;
  --alert: #e34449;
  --alert-tint: #fdeced;
  --ink-hover: #373456;
  --grid-dark: #222737;
  --grid-light: #293142;
  --font: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--yellow);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover, a:active, a:focus-visible { color: var(--orange); }

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

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

.wrap { max-width: 800px; margin-inline: auto; padding-inline: 16px; }

/* ---------- 3. Site shell ---------- */
/* ---------- Header ---------- */
.site-header { position: relative; z-index: 40; background: var(--ink); color: var(--bg); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.logo-link { display: inline-flex; line-height: 0; border-radius: 4px; }
.logo {
  width: 116px;
  height: 48px;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.nav-groups { display: flex; gap: 4px; }
.nav-group { position: relative; }
.nav-group-label { display: none; }
.nav-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--bg);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s;
}
.nav-group-btn svg { width: 10px; height: 10px; flex: none; transition: transform 0.15s; }
.nav-group-btn:hover, .nav-group-btn:focus-visible, .nav-group-btn.is-current, .nav-group-btn[aria-expanded="true"] { color: var(--yellow); }
.nav-group-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 240px;
  padding: 6px;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(31, 29, 48, 0.3);
}
.nav-group:last-child .nav-menu { left: auto; right: 0; }
.nav-group.is-open .nav-menu { display: block; }
.nav-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--bg);
  font-size: 0.9375rem;
  font-weight: 400;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.15s;
}
.nav-menu a:hover, .nav-menu a:focus-visible { color: var(--bg); background: var(--ink-hover); }
.nav-menu a:active { color: var(--orange); }
.nav-menu a[aria-current="page"] { color: var(--yellow); }

.nav-toggle { display: none; }
@media (max-width: 719px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--bg);
    background: none;
    border: 2px solid var(--bg);
    border-radius: 8px;
    cursor: pointer;
  }
  .nav-toggle:hover, .nav-toggle[aria-expanded="true"] { color: var(--yellow); border-color: var(--yellow); }
  .nav-toggle-bars { display: flex; flex-direction: column; gap: 4px; width: 20px; }
  .nav-toggle-bars span { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.2s, opacity 0.2s; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 72px);
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 16px 12px;
    background: var(--ink);
    box-shadow: 0 12px 24px rgba(31, 29, 48, 0.25);
  }
  .site-nav.is-open { display: block; }
  .nav-groups { flex-direction: column; gap: 0; }
  .nav-group { padding-block: 6px; border-top: 1px solid rgba(255, 255, 255, 0.14); }
  .nav-group-btn { display: none; }
  .nav-group-label { display: block; padding: 10px 0 4px; font-size: 1rem; font-weight: 600; }
  .nav-menu { display: block; position: static; min-width: 0; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
  .nav-menu a { padding: 10px 12px; font-size: 1rem; white-space: normal; }
}
@media (hover: none) {
  .nav-menu a:hover { background: none; }
  .nav-group-btn:not(.is-current):not([aria-expanded="true"]):hover { color: var(--bg); }
}

/* ---------- Ad slots ---------- */
.ad-slot {
  margin-block: 16px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ad-slot--placeholder {
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
@media (min-width: 700px) { .ad-slot { min-height: 90px; } }

/* ---------- Intro ---------- */
.intro { text-align: center; padding-block: 16px 4px; }
.intro h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.intro p { margin: 0 auto; max-width: 34em; text-wrap: pretty; }
.intro strong { font-weight: 600; }
@media (min-width: 700px) { .intro h1 { font-size: 2.125rem; } }

/* ---------- Info / FAQ ---------- */
.info { padding-block: 24px 8px; text-align: center; }
.info h2 { margin: 0 0 14px; font-size: 1.25rem; font-weight: 600; }
.faq-list { display: flex; flex-direction: column; gap: 8px; max-width: 640px; margin-inline: auto; text-align: left; }
.faq { border-radius: 10px; background: var(--ink); color: var(--bg); }
.faq summary {
  position: relative;
  list-style: none;
  padding: 14px 48px 14px 16px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute; right: 18px; top: 50%;
  width: 14px; height: 14px;
  transform: translateY(-50%);
  background:
    linear-gradient(currentColor, currentColor) center / 14px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 14px no-repeat;
  transition: background-size 0.2s;
}
.faq[open] summary::after {
  background:
    linear-gradient(currentColor, currentColor) center / 14px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 0 no-repeat;
}
.faq summary:hover { background: var(--ink-hover); }
.faq[open] summary:hover { border-radius: 10px 10px 0 0; }
.faq-body { padding: 0 16px 16px; font-size: 0.9375rem; }
.faq-body p { margin: 0; }
.faq-body p + p { margin-top: 10px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 24px; background: var(--ink); color: var(--bg); text-align: center; font-size: 0.875rem; }
.site-footer .wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-block: 14px 24px; }
.site-footer p { margin: 0; }
.link-btn {
  padding: 0;
  font: inherit;
  color: var(--yellow);
  background: none;
  border: 0;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover, .link-btn:focus-visible { color: var(--orange); }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  max-height: 25vh;
  max-height: 25dvh;
  overflow-y: auto;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  border-top: 2px solid var(--ink);
  box-shadow: 0 -6px 20px rgba(31, 29, 48, 0.08);
}
.cookie-inner {
  max-width: 768px;
  margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 16px;
}
.cookie-text { flex: 1 1 280px; margin: 0; font-size: 0.78rem; line-height: 1.4; text-align: left; }
.cookie-actions { display: flex; gap: 8px; flex: 1 1 100%; }
.cookie-actions .btn { flex: 1; min-height: 34px; padding: 4px 14px; font-size: 0.8125rem; }
@media (min-width: 600px) {
  .cookie-actions { flex: 0 0 auto; }
  .cookie-actions .btn { flex: none; }
}
@media (min-width: 1025px) {
  .cookie-banner { max-height: 10vh; max-height: 10dvh; }
}

/* ---------- 4. Shared controls ---------- */
/* ---------- Tool layout (shared) ---------- */
.tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  padding-block: 16px;
}
.panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-block: 8px;
  text-align: center;
  container-type: inline-size;
}
.panel h2 { margin: 0; font-size: 1.125rem; font-weight: 600; line-height: 1.3; }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-label { font-size: 0.9375rem; font-weight: 500; }
.hint { margin: 0; font-size: 0.8125rem; line-height: 1.5; text-wrap: pretty; }

.input, .select, .textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); outline: none; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible, input[type="color"]:focus-visible { outline: none; }
input[type="color"]:focus { border-color: var(--yellow); }
.input:disabled { color: rgba(31, 29, 48, 0.4); cursor: not-allowed; }
.textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.counter { font-size: 0.75rem; font-variant-numeric: tabular-nums; margin: 0; }
.counter.is-over { color: var(--alert); font-weight: 500; }

.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }

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

/* ---------- Segmented choices ---------- */
.segmented { border: 0; margin: 0; padding: 0; min-width: 0; }
.segmented legend { padding: 0; margin: 0 0 8px; width: 100%; }
.seg-options {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  gap: 6px;
}
.seg-option { position: relative; display: block; cursor: pointer; }
.seg-option input {
  position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0;
}
.seg-option span {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  min-height: 46px;
  height: 100%;
  padding: 8px 4px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  transition: background-color 0.15s;
}
.seg-option span { overflow-wrap: anywhere; }

@container (max-width: 459px) {
  .seg-options[style*="--cols:4"] { --cols: 2 !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.seg-option span small { font-size: 0.75rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.seg-option span svg { width: 22px; height: 22px; }
.seg-option:hover input:not(:checked) + span { background: var(--tint); }
.seg-option input:checked + span { background: var(--yellow); }
.seg-option input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }

/* ---------- Sliders ---------- */
.range-head { display: flex; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.range-value {
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--tint);
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --fill: 50%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(to right, var(--yellow) var(--fill), var(--bg) var(--fill));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  margin-top: -9px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--bg);
}
input[type="range"]::-moz-range-track {
  height: 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--bg);
}
input[type="range"]::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--yellow);
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--bg);
}

/* ---------- Colors ---------- */
.color-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 46px; height: 46px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 4px; }
input[type="color"]::-moz-color-swatch { border: 0; border-radius: 4px; }
.input-hex { text-transform: uppercase; font-variant-numeric: tabular-nums; }

.check {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-align: left;
  font-size: 0.875rem;
  cursor: pointer;
}
.check input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--yellow); cursor: pointer; }

.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.messages:empty { display: none; }
.msg {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.8125rem;
  line-height: 1.45;
}
.msg--error { background: var(--alert-tint); box-shadow: inset 0 0 0 1px var(--alert); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s;
}
.btn:hover { background: var(--tint); }
.btn-primary { background: var(--yellow); }
.btn-primary:hover { background: var(--orange); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--bg); }
.btn-primary:disabled, .btn-primary:disabled:hover { background: var(--yellow); }
.btn-small { min-height: 40px; padding: 6px 12px; flex: none; }
a.btn, a.btn:hover, a.btn:active, a.btn:focus-visible { color: var(--ink); text-decoration: none; }

@media (hover: none) {
  .btn:hover { background: var(--bg); }
  .btn-primary:hover { background: var(--yellow); }
}

/* ---------- QR Code Generator ---------- */
.tool--qr { grid-template-areas: "content" "preview" "custom"; }
.panel-content { grid-area: content; }
.panel-preview { grid-area: preview; }
.panel-custom  { grid-area: custom; }

@media (min-width: 700px) {
  .tool--qr {
    grid-template-columns: minmax(0, 1fr) 280px;
    column-gap: 40px;
    grid-template-areas: "content preview" "custom preview";
    align-items: start;
  }
  .panel-preview { position: sticky; top: calc(16px + env(safe-area-inset-top, 0px)); }
}

/* ---------- Preview ---------- */
.stage {
  position: relative;
  width: 100%;
  max-width: 268px;
  aspect-ratio: 1;
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
}
.stage.is-transparent {
  background-image: conic-gradient(#ebebf0 25%, var(--bg) 0 50%, #ebebf0 0 75%, var(--bg) 0);
  background-size: 16px 16px;
}
#preview { display: block; width: 100%; height: 100%; }
.stage-empty {
  position: absolute; inset: 14px;
  display: grid; place-items: center;
  padding: 16px;
  font-size: 0.875rem;
  background: var(--bg);
}

.save-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@container (min-width: 460px) {
  .save-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .save-grid .btn-primary { grid-column: 1 / -1; }
}
.save-status { margin: 0; font-size: 0.8125rem; }

.save-status:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.formats { text-align: left; padding-top: 4px; }
.formats h3 { margin: 0 0 10px; font-size: 0.875rem; font-weight: 600; text-align: center; }
.formats dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
}
.formats dt { font-weight: 600; }
.formats dd { margin: 0; }

/* ---------- Wheel Spinner ---------- */
.tool--wheel { grid-template-areas: "wheel" "entries" "settings" "history"; }
.panel-wheel    { grid-area: wheel; }
.panel-entries  { grid-area: entries; }
.panel-settings { grid-area: settings; }
.panel-history  { grid-area: history; }

@media (min-width: 700px) {
  .tool--wheel {
    grid-template-columns: minmax(0, 1fr) 260px;
    grid-template-areas: "wheel entries" "settings history";
    column-gap: 40px;
    align-items: start;
  }
}

.tool--wheel.is-focused { grid-template-columns: minmax(0, 1fr); grid-template-areas: "wheel" "history"; }
.tool--wheel.is-focused .panel-entries,
.tool--wheel.is-focused .panel-settings { display: none; }
.tool--wheel.is-focused .panel-history { width: 100%; max-width: 480px; margin-inline: auto; }

/* ---------- Wheel ---------- */
.wheel-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.wheel-wrap {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
  aspect-ratio: 1;
}
.is-focused .wheel-wrap {
  max-width: min(720px, max(300px, calc(100vh - 230px)));
  max-width: min(720px, max(300px, calc(100dvh - 230px)));
}
#wheel {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
}
#wheel.is-spinning { cursor: progress; }
#wheel { filter: drop-shadow(0 6px 16px rgba(31, 29, 48, 0.22)); }
#wheel:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  z-index: 1;
  width: 32px;
  height: 38px;
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(31, 29, 48, 0.3));
}
.is-focused .pointer { width: 40px; height: 48px; top: -12px; }
.wheel-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 56px;
  border-radius: 50%;
  background: var(--surface);
  font-size: 0.9375rem;
}

.spin-row { display: flex; justify-content: center; align-items: stretch; gap: 8px; }
.btn-spin { min-width: 200px; font-size: 1rem; }
.btn-icon { width: 44px; min-height: 44px; padding: 0; flex: none; }
.btn-icon svg { width: 22px; height: 22px; }
.kbd-hint { margin: -8px 0 0; font-size: 0.75rem; }
.round-picks {
  list-style: none;
  margin: -6px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.round-picks li {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--tint);
  font-size: 0.875rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.round-picks .num { font-weight: 400; font-variant-numeric: tabular-nums; margin-right: 4px; }
.hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .hint-mouse { display: none; }
  .hint-touch { display: inline; }
}
kbd {
  font-family: inherit;
  font-size: 0.75rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface);
}

/* ---------- Entries ---------- */
.entries-text { min-height: 220px; }
@media (min-width: 700px) { .entries-text { min-height: 300px; } }
.tool-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tool-row .btn { min-height: 40px; padding: 6px 8px; }
.btn-danger-armed,
.btn-danger-armed:hover { background: var(--alert-tint); border-color: var(--alert); color: var(--alert); }

/* ---------- Settings ---------- */
@container (max-width: 340px) {
  .seg-options[style*="--cols:3"] { --cols: 2 !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.palette-swatches { display: flex; justify-content: center; gap: 3px; }
.palette-swatches i { width: 10px; height: 10px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(31, 29, 48, 0.25); }

.custom-colors { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.swatch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.swatch { position: relative; }
.swatch-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  padding: 0;
  display: grid;
  place-items: center;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1;
  color: var(--bg);
  background: var(--ink);
  border: 2px solid var(--bg);
  border-radius: 50%;
  cursor: pointer;
}
.swatch-remove:hover { background: var(--ink-hover); }
.swatch-remove:disabled { display: none; }
.check-list { display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* ---------- Past winners ---------- */
.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  text-align: left;
}
.history-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.9375rem;
}
.history-list .num { flex: none; min-width: 1.8em; font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.history-list .name { min-width: 0; overflow-wrap: anywhere; }
.history-empty { margin: 0; font-size: 0.875rem; }
.history-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.history-status { margin: -8px 0 0; font-size: 0.8125rem; font-weight: 600; }
.history-status:empty { display: none; }

/* ---------- Winner popup ---------- */
.winner-dialog {
  width: min(92vw, 440px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(31, 29, 48, 0.35);
}
.winner-dialog::backdrop { background: rgba(31, 29, 48, 0.6); }
.winner-head {
  padding: 14px 20px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  border-radius: 14px 14px 0 0;
}
.winner-body { display: flex; flex-direction: column; gap: 20px; padding: 24px 20px 20px; text-align: center; }
.winner-name {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.winner-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  counter-reset: pick;
}
.winner-list li {
  counter-increment: pick;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  overflow-wrap: anywhere;
}
.winner-list li::before {
  content: counter(pick);
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--yellow);
  font-size: 0.875rem;
}
.winner-actions { display: flex; gap: 8px; }
.winner-actions .btn { flex: 1; }
/* ---------- Team Maker ---------- */
.panel-teams { padding-block: 24px 8px; }
.teams-intro { max-width: 34em; margin-inline: auto; margin-top: -8px; }
.team-controls { width: 100%; max-width: 460px; margin-inline: auto; display: flex; flex-direction: column; gap: 20px; }
.team-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  text-align: left;
}
.team-grid:empty { display: none; }
.team-card { min-width: 0; border-radius: 10px; background: var(--surface); overflow: hidden; }
.team-card h3 {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 10px 14px;
  font-size: 0.9375rem;
  font-weight: 600;
}
.team-card h3 small { font-size: 0.75rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.team-card ol { margin: 0; padding: 10px 14px 12px 34px; font-size: 0.9375rem; line-height: 1.5; }
.team-card li { overflow-wrap: anywhere; }
.team-card li::marker { font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.team-grid.is-new .team-card li { animation: team-in 0.35s ease both; animation-delay: calc(var(--i) * 45ms); }
@keyframes team-in { from { opacity: 0; transform: translateY(6px); } }

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* ---------- Word Counter ---------- */
.tool--counter { gap: 20px; }

/* ---------- Toolbar ---------- */
.counter-toolbar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  max-width: 560px;
  width: 100%;
  margin-inline: auto;
}
.tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 62px;
  padding: 8px 4px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s;
}
.tool-btn svg { width: 22px; height: 22px; flex: none; }
.tool-btn span { max-width: 100%; }
.tool-btn:hover { background: var(--tint); }
.tool-btn[aria-expanded="true"],
.tool-btn.is-on { background: var(--yellow); }
@media (hover: none) {
  .tool-btn:hover { background: var(--bg); }
  .tool-btn[aria-expanded="true"]:hover, .tool-btn.is-on:hover { background: var(--yellow); }
}

@media (max-width: 479px) { .counter-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tool-btn { min-height: 58px; } }

.wc-focused .intro,
.wc-focused .stats-sub,
.wc-focused .save-line,
.wc-focused .platforms > h2,
.wc-focused .platforms > .hint,
.wc-focused .info { display: none; }
.wc-focused .tool--counter { padding-top: 24px; }

/* ---------- Options area ---------- */
.counter-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
  container-type: inline-size;
}
.counter-options h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.counter-options .seg-option span { background: var(--bg); }
.counter-options .seg-option input:checked + span { background: var(--yellow); }
.font-option span { font-weight: 400; font-size: 0.9375rem; }

.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 4px 12px 4px 8px;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--yellow); }
.chip:disabled { opacity: 0.4; cursor: not-allowed; }
.chip-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(31, 29, 48, 0.3); }
.chip small { font-weight: 400; font-variant-numeric: tabular-nums; }
@media (hover: hover) { .chip:not(:disabled):not([aria-pressed="true"]):hover { background: var(--tint); } }

.limit-row { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.limit-amount { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.limit-row .input { width: 120px; text-align: center; background: var(--bg); font-variant-numeric: tabular-nums; }

/* ---------- Counts ---------- */
.stats { display: flex; flex-direction: column; gap: 8px; container-type: inline-size; }
.stats-main { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stats-sub { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
@container (max-width: 560px) { .stats-sub { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 10px 6px;
  border-radius: 10px;
  background: var(--surface);
  text-align: center;
}
.stat-num { font-size: 1.125rem; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-label { font-size: 0.75rem; line-height: 1.25; }
.stat--main { padding: 14px 8px; background: var(--ink); color: var(--bg); }
.stat--main .stat-num { font-size: 2.25rem; }
.stat--main .stat-label { font-size: 0.875rem; font-weight: 500; }
.stat-of { font-size: 0.8125rem; color: var(--yellow); font-variant-numeric: tabular-nums; }

/* ---------- Text box ---------- */
.editor {
  width: 100%;
  min-height: 160px;
  padding: 16px;
  font-family: var(--editor-font, var(--font));
  font-size: var(--editor-size, 18px);
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: 12px;
  resize: vertical;
  text-align: left;
}
.editor:focus { border-color: var(--ink); outline: none; }
@media (min-width: 700px) { .editor { min-height: 190px; } }
.editor-field { display: flex; flex-direction: column; gap: 8px; }
.save-line { margin: 0; font-size: 0.75rem; }
.save-line.is-error { color: var(--alert); font-weight: 600; }

/* ---------- Platform limits ---------- */
.platforms { display: flex; flex-direction: column; gap: 12px; text-align: center; padding-top: 12px; }
.platforms h2 { margin: 0; font-size: 1.125rem; font-weight: 600; }
.platforms .hint { margin-top: -6px; }
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
  text-align: left;
}
.pcard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--brand);
  color: var(--on);
}
.pcard-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pcard-name { font-size: 0.9375rem; font-weight: 600; }
.pcard-field { font-size: 0.8125rem; font-weight: 500; text-align: right; }
.pcard-left { margin: 2px 0 0; display: flex; align-items: baseline; gap: 6px; }
.pcard-num { font-size: 1.625rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pcard-unit { font-size: 0.875rem; font-weight: 500; }
.pcard-bar { height: 6px; border-radius: 999px; background: rgba(127, 127, 127, 0.35); background: color-mix(in srgb, var(--on) 28%, transparent); overflow: hidden; }
.pcard-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent, var(--on)); transition: width 0.15s; }
.pcard-used { margin: 0; font-size: 0.8125rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.pcard.is-over .pcard-left { align-self: flex-start; padding: 2px 10px; border-radius: 999px; background: var(--bg); color: var(--ink); }
.platform-empty { margin: 0; font-size: 0.875rem; }

/* ---------- "Text deleted" pop-up at the top ---------- */
.restore-toast {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 70;
  width: min(92vw, 460px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 14px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 12px 32px rgba(31, 29, 48, 0.3);
  overflow: hidden;
}
.restore-toast p { margin: 0; flex: 1; font-size: 0.875rem; line-height: 1.4; }
.restore-toast .btn { flex: none; min-height: 38px; border-color: var(--yellow); }
.restore-timer { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--yellow); transform-origin: left; }
.restore-toast.is-running .restore-timer { animation: restore-countdown 5s linear forwards; }
.restore-toast.is-paused .restore-timer { animation-play-state: paused; }
@keyframes restore-countdown { to { transform: scaleX(0); } }

/* ---------- Landing Page ---------- */
.landing-hero {
  padding-block: 56px 52px;
  text-align: center;
  background-color: var(--grid-dark);
  background-image: conic-gradient(var(--grid-light) 25%, transparent 0 50%, var(--grid-light) 0 75%, transparent 0);
  background-size: 112px 112px;
  background-position: center top;
}
.landing-hero h1 { margin: 0; line-height: 0; }

.landing-logo {
  width: 232px;
  height: 96px;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}
@media (min-width: 330px) { .landing-logo { width: 290px; height: 120px; } }
@media (min-width: 440px) { .landing-logo { width: 406px; height: 168px; } }
@media (min-width: 560px) { .landing-logo { width: 522px; height: 216px; } }
.landing-intro { margin: 20px auto 0; max-width: 30em; color: var(--bg); font-size: 1.125rem; text-wrap: balance; }

.tools-band { padding-block: 40px 56px; background: var(--bg); }
.page-landing .site-footer { margin-top: 0; }
.tools-band h2 { margin: 0 0 16px; font-size: 3rem; font-weight: 600; line-height: 1.1; text-align: center; }
.tool-filter { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 0 auto 24px; }
.tool-filter .select { width: auto; min-width: 210px; }
.tool-grid {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12.5px;
  max-width: 440px;
}
.tool-grid > .tool-card { flex: 1 1 100%; }
@media (min-width: 700px) {
  .tool-grid { max-width: none; }
  .tool-grid > .tool-card { flex: 0 1 calc((100% - 25px) / 3); }
}
.tool-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border-radius: 12px; background: var(--surface); }
.tool-card-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  background-color: var(--grid-dark);
  background-image: conic-gradient(var(--grid-light) 25%, transparent 0 50%, var(--grid-light) 0 75%, transparent 0);
  background-size: 28px 28px;
}
.tool-card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tool-card-placeholder {
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--grid-dark);
  color: var(--yellow);
  font-size: 1.0625rem;
  font-weight: 600;
  text-align: center;
}
.tool-card-body { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 8px; padding: 16px; text-align: center; }
.tool-card h3 { margin: 0; font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
.tool-card p { flex: 1; margin: 0; font-size: 0.875rem; text-wrap: pretty; }
.tool-card .btn { align-self: stretch; margin-top: 8px; text-decoration: none; }

/* ---------- Placeholder Text Generator ---------- */
.tool--placeholder { gap: 20px; }

/* ---------- Settings ---------- */
.ph-settings {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
}
.ph-settings h2 { margin: 0; font-size: 1.125rem; font-weight: 600; }
.ph-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px 28px;
}
.ph-options .input, .ph-options .select { background-color: var(--bg); }
.ph-options .input[type="number"] { text-align: center; font-variant-numeric: tabular-nums; }
.ph-options input[type="range"]:disabled { opacity: 0.4; cursor: not-allowed; }
.ph-checks { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; }
.ph-counts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 480px) { .ph-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
.ph-presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ph-presets .btn { min-width: 96px; }
.ph-presets .btn[aria-pressed="true"] { background: var(--yellow); }
@media (min-width: 700px) {
  .ph-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ph-checks, .ph-wide { grid-column: 1 / -1; }
}

/* ---------- Toolbar ---------- */
.ph-toolbar { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 480px; }
@media (max-width: 479px) { .ph-toolbar { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ph-format { width: 100%; max-width: 480px; margin-inline: auto; text-align: center; }
.ph-format .seg-option span { min-height: 40px; }
.tool-btn--primary { background: var(--yellow); }
.tool-btn--primary:hover { background: var(--orange); }
@media (hover: none) { .tool-btn--primary:hover { background: var(--yellow); } }

/* ---------- Output ---------- */
.ph-output { min-height: 200px; }
@media (min-width: 700px) { .ph-output { min-height: 230px; } }
.editor[dir="rtl"], .textarea[dir="rtl"] { text-align: right; }
.ph-stats { margin: 0; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.ph-output:lang(zh), .ph-custom-text:lang(zh) { --editor-font: "Lexend", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; font-family: var(--editor-font); }
.ph-output:lang(ja), .ph-custom-text:lang(ja) { --editor-font: "Lexend", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif; font-family: var(--editor-font); }
.ph-output:lang(ko), .ph-custom-text:lang(ko) { --editor-font: "Lexend", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; font-family: var(--editor-font); }
.ph-output:lang(hi), .ph-custom-text:lang(hi) { --editor-font: "Lexend", "Poppins", "Nirmala UI", "Kohinoor Devanagari", sans-serif; font-family: var(--editor-font); }
.ph-output:lang(ar), .ph-custom-text:lang(ar) { --editor-font: "Lexend", "Readex Pro", "Segoe UI", "Geeza Pro", sans-serif; font-family: var(--editor-font); }
.ph-output:lang(th), .ph-custom-text:lang(th) { --editor-font: "Lexend", "Noto Sans Thai", "Leelawadee UI", "Thonburi", sans-serif; font-family: var(--editor-font); }
.ph-output:lang(ru), .ph-custom-text:lang(ru), .ph-output:lang(he), .ph-custom-text:lang(he) { --editor-font: "Lexend", "Rubik", "Segoe UI", Arial, sans-serif; font-family: var(--editor-font); }

/* ---------- Custom words ---------- */
.ph-custom { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.ph-custom h3 { margin: 0; font-size: 1.125rem; font-weight: 600; }
.ph-custom .textarea { min-height: 110px; background: var(--bg); }
.ph-custom-count { margin-top: -2px; }
.ph-custom-foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 20px; }
.ph-custom-foot .btn-small { min-height: 36px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
