/* Self-hosted fonts (Inter variable, IBM Plex Mono) — no request to Google Fonts */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-cyrillic-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-greek-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+1F00-1FFF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-greek-wght-normal.woff2) format('woff2');
  unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-vietnamese-wght-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: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,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: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-latin-wght-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+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/fonts/ibm-plex-mono-latin-ext-500-normal.woff2) format('woff2');
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,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: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/fonts/ibm-plex-mono-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+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(/fonts/ibm-plex-mono-latin-ext-600-normal.woff2) format('woff2');
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,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: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(/fonts/ibm-plex-mono-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+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --bg: #F3EFE6;
  --surface: #FFFFFF;
  --surface-2: #EAE4D6;
  --ink: #1B1F24;
  --ink-soft: #666052;
  --ink-faint: #6B6556;
  --accent: #9C6E13;
  --accent-ink: #FFFFFF;
  --border: #DCD4BF;
  --danger: #A5402F;
  --good: #3F6E4A;
  --star: #C9971F;
  --sidebar-w: 240px;
  --topbar-h: 62px;
  box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171C;
    --surface: #1B2027;
    --surface-2: #21262E;
    --ink: #ECE9E1;
    --ink-soft: #A6A093;
    --ink-faint: #8F8A7D;
    --accent: #E8B23D;
    --accent-ink: #14171C;
    --border: #2B303A;
    --danger: #E08772;
    --good: #7FC490;
    --star: #E8B23D;
  }
}
:root[data-theme="dark"] {
  --bg: #14171C;
  --surface: #1B2027;
  --surface-2: #21262E;
  --ink: #ECE9E1;
  --ink-soft: #A6A093;
  --ink-faint: #8F8A7D;
  --accent: #E8B23D;
  --accent-ink: #14171C;
  --border: #2B303A;
  --danger: #E08772;
  --good: #7FC490;
  --star: #E8B23D;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
}
body {
  background: transparent;
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  padding: 0 20px;
  padding-top: env(safe-area-inset-top, 0px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 6px;
}
.hamburger svg { width: 22px; height: 22px; }
.logo {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  cursor: pointer;
}
.theme-toggle svg { width: 17px; height: 17px; }
.btn-ghost, .btn-solid {
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--ink);
}
.btn-solid {
  background: var(--accent);
  border: none;
  color: var(--accent-ink);
}

/* ---------- Body shell / sidebar ---------- */
.body-shell {
  display: flex;
  min-height: calc(100vh - var(--topbar-h));
}
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 18px 12px;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
}
.side-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.side-link.active {
  background: var(--surface-2);
  color: var(--ink);
}
.side-link.soon { opacity: 0.55; cursor: default; }
.soon-tag {
  margin-left: auto;
  font-style: normal;
  font-size: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 7px;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 45;
}

.main-content {
  flex: 1;
  min-width: 0;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* ---------- Hero / panel (existing) ---------- */
.hero { padding: 32px 0 12px; }
.hero h1 {
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  max-width: 15ch;
}
.hero p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0;
}

.panel {
  margin-top: 32px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
}
.dropzone {
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  transition: background 120ms ease;
}
.dropzone.drag { background: var(--surface-2); }
.dropzone svg { width: 34px; height: 34px; color: var(--ink-faint); margin-bottom: 14px; }
.dropzone .dz-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.dropzone .dz-sub { font-size: 14px; color: var(--ink-faint); }
input[type="file"] { display: none; }

.filebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.filebar .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filebar button.reset {
  background: none; border: none; color: var(--ink-faint); font-size: 13px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0;
}

.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 20px; }
.level {
  border: 1px solid var(--border); background: var(--surface); border-radius: 10px;
  padding: 14px 12px; cursor: pointer; text-align: left;
}
.level.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.level .lv-name { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.level .lv-desc { font-size: 12px; color: var(--ink-faint); line-height: 1.4; }

.action-row { padding: 4px 20px 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 18px; border-radius: 9px; border: none;
  background: var(--accent); color: var(--accent-ink); font-size: 15px;
  font-weight: 600; font-family: inherit; cursor: pointer;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--border); }

.progress-wrap { padding: 0 20px 20px; }
.progress-track { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width 160ms ease; }
.progress-label { font-size: 13px; color: var(--ink-faint); margin-top: 8px; }

.result { padding: 22px 20px 24px; border-top: 1px solid var(--border); }
.size-compare { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.size-box .size-label { font-size: 12px; color: var(--ink-faint); margin-bottom: 4px; }
.size-box .size-val { font-size: 22px; font-weight: 600; }
.size-box.before .size-val { color: var(--ink-faint); text-decoration: line-through; }
.size-box.after .size-val { color: var(--good); }
.arrow { color: var(--ink-faint); font-size: 18px; }
.savings-pill {
  display: inline-block; background: var(--surface-2); color: var(--good);
  font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; margin-left: auto;
}

.error-box {
  margin-top: 16px; padding: 14px 16px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--danger); color: var(--danger); font-size: 14px; line-height: 1.5;
}

.privacy-note {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 28px; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: 12px; font-size: 13px; color: var(--ink-soft); line-height: 1.55;
}
.privacy-note svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--good); }

.how { margin-top: 44px; display: grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 620px) { .how { grid-template-columns: repeat(3, 1fr); } }
.how h3 { font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.how p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin: 0; }

/* ---------- Reviews summary ---------- */
.reviews-summary {
  margin-top: 48px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.rs-score { font-size: 30px; font-weight: 600; }
.rs-stars { display: flex; gap: 2px; }
.rs-stars svg { width: 18px; height: 18px; }
.rs-count { font-size: 13px; color: var(--ink-faint); }

/* ---------- Comments ---------- */
.comments-section { margin-top: 30px; }
.comments-section h2 { font-size: 19px; margin: 0 0 16px; }
.comments-list { display: flex; flex-direction: column; gap: 16px; }
.comment {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 16px 18px;
}
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--accent);
  font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.comment-name { font-weight: 600; font-size: 14px; }
.comment-time { font-size: 12px; color: var(--ink-faint); }
.comment-text {
  font-size: 14px; line-height: 1.55; color: var(--ink-soft);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.comment-text.expanded { -webkit-line-clamp: unset; }
.comment-readmore {
  background: none; border: none; color: var(--accent); font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 4px 0 0; text-align: left;
}
.comment-actions { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.comment-like, .comment-reply-btn {
  display: flex; align-items: center; gap: 6px; background: none; border: none;
  color: var(--ink-faint); font-size: 13px; cursor: pointer; padding: 0;
}
.comment-like svg { width: 16px; height: 16px; transition: transform 150ms ease; }
.comment-like.liked { color: var(--danger); }
.comment-like.liked svg { transform: scale(1.25); fill: var(--danger); }
.comment-reply-input {
  display: none; margin-top: 10px; gap: 8px;
}
.comment-reply-input.open { display: flex; }
.comment-reply-input input {
  flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  background: var(--bg); color: var(--ink); font-size: 13px; font-family: inherit;
}
.comment-reply-input button {
  background: var(--accent); color: var(--accent-ink); border: none; border-radius: 8px;
  padding: 0 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.comment-replies { margin-top: 12px; padding-left: 42px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- FAQ ---------- */
.faq { margin-top: 48px; }
.faq h2 { font-size: 19px; margin: 0 0 16px; }
.faq-item { border-top: 1px solid var(--border); padding: 16px 0; }
.faq-item h3 { font-size: 14.5px; font-weight: 600; margin: 0 0 6px; }
.faq-item p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin: 0; }

/* ---------- Newsletter ---------- */
.newsletter {
  margin-top: 48px;
  padding: 26px 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.newsletter h3 { font-size: 16px; margin: 0 0 4px; }
.newsletter p { font-size: 13.5px; color: var(--ink-faint); margin: 0; }
.newsletter-form { display: flex; gap: 8px; flex-wrap: wrap; }
.newsletter-form input {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  background: var(--bg); color: var(--ink); font-size: 14px; font-family: inherit; min-width: 200px;
}
.newsletter-form .btn { width: auto; padding: 10px 18px; }

/* ---------- Footer ---------- */
.site-footer { background: #10131A; color: #B9BDC6; margin-top: 60px; }
.footer-inner {
  max-width: 1080px; margin: 0 auto; padding: 48px 24px 28px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px;
}
.site-footer .logo { color: #F2F0E9; }
.site-footer .logo span { color: var(--star); }
.footer-col p { font-size: 13px; line-height: 1.6; color: #8E93A0; margin-top: 10px; }
.footer-col h4 { font-size: 13px; color: #F2F0E9; margin: 0 0 12px; font-weight: 600; }
.footer-col a { display: block; font-size: 13.5px; color: #B9BDC6; padding: 5px 0; }
.footer-bottom {
  border-top: 1px solid #262A34; text-align: center; padding: 18px 24px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  font-size: 12.5px; color: #6C7080;
}
@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: 480px; margin: 0 auto; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; display: none; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 13px; color: var(--ink-soft); box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.cookie-banner.show { display: flex; }
.cookie-banner .btn-solid { flex-shrink: 0; padding: 7px 14px; font-size: 13px; }

/* ---------- Responsive: sidebar becomes drawer ---------- */
@media (max-width: 900px) {
  .hamburger { display: flex; }
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    padding-top: 18px;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
}

@media (max-width: 480px) {
  .levels { grid-template-columns: 1fr; }
  .size-compare { gap: 10px; }
  .newsletter { flex-direction: column; align-items: flex-start; }
}

/* ---------- Comment form ---------- */
.comment-form {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
}
.comment-form .comment-avatar { margin-top: 2px; }
.comment-form-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.comment-form-fields input,
.comment-form-fields textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--bg);
  color: var(--ink);
  font-size: 13.5px;
  font-family: inherit;
  resize: vertical;
}
.comment-form-fields input { max-width: 220px; }

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  opacity: 0;
  transition: opacity 160ms ease;
}
.modal-overlay.show { display: flex; opacity: 1; }
.modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 48px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 26px;
  text-align: center;
  transform: scale(0.92) translateY(8px);
  transition: transform 180ms ease;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.modal-overlay.show .modal { transform: scale(1) translateY(0); }
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 4px;
}
.modal-close svg { width: 18px; height: 18px; }
.modal-icon { font-size: 32px; margin-bottom: 10px; }
.modal h2 { font-size: 19px; margin: 0 0 8px; }
.modal p { font-size: 14px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 16px; }
.benefit-list {
  text-align: left;
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.benefit-list li {
  font-size: 13.5px;
  color: var(--ink-soft);
  padding-left: 22px;
  position: relative;
}
.benefit-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--good);
  font-weight: 700;
}
.modal .btn { margin-top: 8px; }
.modal .btn.secondary { margin-top: 10px; }

.view-all-btn {
  display: block;
  text-align: center;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
.view-all-btn:hover { background: var(--surface-2); }


.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 28px 0 10px;
}
.back-link svg { width: 17px; height: 17px; }

.page-title { font-size: 26px; margin: 6px 0 24px; }

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 30px 0 20px;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.file-list-wrap { padding: 16px 20px 4px; }
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: grab;
}
.file-row.dragging { opacity: 0.4; }
.drag-handle { width: 16px; height: 16px; color: var(--ink-faint); flex-shrink: 0; }
.file-row-info { flex: 1; min-width: 0; }
.file-row-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row-size { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.file-row-remove {
  background: none; border: none; color: var(--ink-faint); cursor: pointer; padding: 4px; flex-shrink: 0;
}
.file-row-remove svg { width: 16px; height: 16px; }

.range-row { padding: 18px 20px 4px; }
.range-info { font-size: 13px; color: var(--ink-faint); margin-bottom: 12px; }
.range-fields { display: flex; gap: 16px; }
.range-fields label {
  flex: 1;
  font-size: 12px;
  color: var(--ink-faint);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.range-fields input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-family: 'IBM Plex Mono', monospace;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  padding: 20px;
}
.image-cell {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.image-cell img { width: 100%; display: block; border-bottom: 1px solid var(--border); }
.image-cell-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--ink-faint);
}
.image-download { color: var(--accent); display: flex; }
.image-download svg { width: 15px; height: 15px; }

.preview-wrap {
  padding: 0 20px 16px;
}
.preview-wrap img {
  max-width: 100%;
  max-height: 260px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
  margin: 0 auto;
}

.qr-input-area {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.qr-input-area textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
.qr-result {
  padding: 0 20px 24px;
  text-align: center;
}
.qr-canvas-wrap {
  display: inline-block;
  padding: 16px;
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.qr-result .btn { max-width: 240px; margin: 0 auto; }


.full-width { max-width: 720px; }
.legal-updated { font-size: 13px; color: var(--ink-faint); margin: -12px 0 30px; }
.legal-body h2 { font-size: 17px; margin: 30px 0 10px; }
.legal-body p { font-size: 14.5px; line-height: 1.7; color: var(--ink-soft); margin: 0 0 14px; }
.legal-body a { color: var(--accent); text-decoration: underline; }


.contact-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0 32px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.contact-row { display: flex; align-items: center; gap: 14px; }
.contact-row svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
.contact-label { font-size: 12px; color: var(--ink-faint); margin-bottom: 2px; }
.contact-row a { color: var(--ink); font-weight: 600; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 50px;
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-faint);
}
.contact-form input,
.contact-form textarea {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 13px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
.contact-form .btn { width: auto; align-self: flex-start; padding: 12px 24px; margin-top: 4px; }

.auth-modal { text-align: left; max-width: 380px; }
.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 10px;
}
.auth-tab {
  flex: 1;
  padding: 9px;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
}
.auth-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-faint);
  text-align: left;
}
.auth-form input {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 13px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
}
.auth-error {
  font-size: 13px;
  color: var(--danger);
  background: var(--surface-2);
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 10px 12px;
}
.auth-form .btn { margin-top: 2px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  background: var(--surface);
}
.user-chip-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.user-chip-name { font-size: 13.5px; font-weight: 600; }


/* Auth page (dedicated login/signup page) */
.auth-page-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--topbar-h) - 200px);
  padding-top: 50px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px;
  padding: 30px 26px;
}

.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.avatar-preview {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--ink-faint);
  overflow: hidden;
  flex-shrink: 0;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload-btn { padding: 7px 14px; font-size: 13px; }
.avatar-upload-hint { font-size: 11.5px; color: var(--ink-faint); margin-top: 4px; }

/* Topbar user avatar + dropdown */
.user-menu-wrap { position: relative; }
.user-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.user-avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
  padding: 8px;
  display: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 50;
}
.user-dropdown.show { display: block; opacity: 1; transform: translateY(0); }
.user-dropdown-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.user-dropdown-head .avatar-preview { width: 38px; height: 38px; font-size: 15px; }
.user-dropdown-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown-email { font-size: 11.5px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 8px;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.user-dropdown-item:hover { background: var(--surface-2); }
.user-dropdown-item svg { width: 16px; height: 16px; color: var(--ink-faint); flex-shrink: 0; }
.user-dropdown-item.danger { color: var(--danger); }
.user-dropdown-item.danger svg { color: var(--danger); }

.calc-panel { padding: 24px 20px; }
.calc-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.calc-field label { font-size: 13px; color: var(--ink-faint); font-weight: 600; }
.calc-field input {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 13px;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
}
.calc-panel .btn { width: auto; padding: 12px 24px; }

.calc-result { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border); }
.calc-result-main {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.6;
}
.calc-num { color: var(--accent); font-size: 26px; margin-right: 4px; }
.calc-extra-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.calc-extra-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
}
.calc-extra-num { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.calc-extra-label { font-size: 11px; color: var(--ink-faint); }

@media (max-width: 480px) {
  .calc-extra-grid { grid-template-columns: 1fr; }
}

.unit-toggle {
  display: flex;
  gap: 6px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.unit-btn {
  flex: 1;
  padding: 9px;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
}
.unit-btn.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.calc-field-row { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.calc-field-row .calc-field { flex: 1; min-width: 100px; }

.bmi-category { font-size: 16px; font-weight: 600; color: var(--ink-soft); margin-left: 8px; }
.bmi-scale { margin-top: 20px; }
.bmi-scale-bar {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(to right, #6CA8E0 0%, #6CA8E0 25%, var(--good) 25%, var(--good) 50%, var(--star) 50%, var(--star) 75%, var(--danger) 75%, var(--danger) 100%);
  position: relative;
  margin-bottom: 8px;
}
.bmi-scale-marker {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 18px;
  background: var(--ink);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 200ms ease;
}
.bmi-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--ink-faint);
}


.calc-field select {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 13px;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
}


.convert-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.convert-row .calc-field { flex: 1; }
.convert-row .calc-field select { margin-top: 8px; width: 100%; }
.swap-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 10px;
}
.swap-btn svg { width: 17px; height: 17px; }


.rate-note { font-size: 12px; color: var(--ink-faint); margin-top: 14px; text-align: center; }


.pw-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.pw-text { font-size: 16px; word-break: break-all; }
.pw-copy-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pw-copy-btn svg { width: 16px; height: 16px; }
.pw-strength { font-size: 13px; font-weight: 600; margin-top: 8px; }

.calc-field input[type="range"] { width: 100%; margin-top: 6px; accent-color: var(--accent); }

.pw-options { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.pw-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
}
.pw-checkbox input { accent-color: var(--accent); width: 16px; height: 16px; }


.calc-panel textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px 14px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  margin-top: 8px;
}
.case-btn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.case-btn-grid .btn { font-size: 12.5px; padding: 10px 6px; }
.word-count { font-size: 12px; color: var(--ink-faint); margin-top: 14px; text-align: right; }

@media (max-width: 480px) {
  .case-btn-grid { grid-template-columns: repeat(2, 1fr); }
}

.wc-grid { grid-template-columns: repeat(3, 1fr); margin-top: 18px; }
@media (max-width: 480px) {
  .wc-grid { grid-template-columns: repeat(2, 1fr); }
}


.lorem-output-wrap { margin-top: 18px; }
.lorem-output-wrap textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px 14px;
  background: var(--bg);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.6;
  font-family: inherit;
  resize: vertical;
}

.diff-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.diff-input-grid textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px 14px;
  background: var(--bg);
  color: var(--ink);
  font-size: 13.5px;
  font-family: inherit;
  resize: vertical;
  margin-top: 8px;
}
@media (max-width: 620px) {
  .diff-input-grid { grid-template-columns: 1fr; }
}

.diff-output-wrap { margin-top: 20px; }
.diff-legend {
  display: flex;
  gap: 18px;
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-bottom: 12px;
}
.diff-legend span { display: flex; align-items: center; gap: 6px; }
.diff-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.diff-swatch.diff-add { background: var(--good); opacity: 0.5; }
.diff-swatch.diff-remove { background: var(--danger); opacity: 0.5; }

.diff-output {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}
.diff-output .diff-add { background: rgba(63, 110, 74, 0.25); color: var(--good); border-radius: 3px; padding: 1px 2px; }
.diff-output .diff-remove { background: rgba(165, 64, 47, 0.2); color: var(--danger); text-decoration: line-through; border-radius: 3px; padding: 1px 2px; }
.diff-none { color: var(--ink-faint); font-style: italic; }

.calc-panel input[type="text"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 13px;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
  margin-top: 8px;
}
.font-results { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.font-empty { font-size: 13.5px; color: var(--ink-faint); text-align: center; padding: 20px; }
.font-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
}
.font-row:hover { background: var(--surface-2); }
.font-row-text { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.font-row-label { font-size: 11.5px; color: var(--ink-faint); flex-shrink: 0; }

.font-cat-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin: 20px 0 8px;
}
.font-cat-header:first-child { margin-top: 0; }


.hash-results { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.hash-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
}
.hash-row:hover { background: var(--surface-2); }
.hash-label { font-size: 11.5px; font-weight: 700; color: var(--accent); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.03em; }
.hash-value { font-size: 13px; word-break: break-all; color: var(--ink-soft); }


.color-picker-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.color-picker-row input[type="color"] {
  width: 90px;
  height: 90px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  padding: 0;
  background: none;
  flex-shrink: 0;
}
.color-values { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 10px; }
.color-value-row { display: flex; align-items: center; gap: 10px; }
.calc-field-inline-label { font-size: 12px; color: var(--ink-faint); width: 34px; flex-shrink: 0; font-weight: 600; }
.color-value-row input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--bg);
  color: var(--ink);
  font-size: 13.5px;
  cursor: pointer;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 24px;
}
.palette-swatch { cursor: pointer; text-align: center; }
.palette-color { width: 100%; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--border); }
.palette-hex { font-size: 11.5px; margin-top: 6px; }
.palette-label { font-size: 10.5px; color: var(--ink-faint); }

@media (max-width: 480px) {
  .palette-grid { grid-template-columns: repeat(3, 1fr); }
}

.gradient-preview {
  height: 140px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 18px;
}
.gradient-colors { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 10px; }
.gradient-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
}
.gradient-color-row input[type="color"] { width: 36px; height: 36px; border: none; border-radius: 8px; padding: 0; cursor: pointer; flex-shrink: 0; }
.gradient-color-row span { flex: 1; font-size: 13px; color: var(--ink-soft); }
.gradient-remove {
  background: none; border: none; color: var(--danger); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px;
}


.name-results {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  font-size: 13.5px;
}
.name-row:hover { background: var(--surface-2); }
.name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--good);
  background: var(--surface-2);
  padding: 3px 7px;
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
}
.name-badge-muted { color: var(--ink-faint); }

@media (max-width: 480px) {
  .name-results { grid-template-columns: 1fr; }
}


.barcode-result { text-align: center; margin-top: 20px; }
.barcode-result svg {
  max-width: 100%;
  background: #FFFFFF;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px;
}

.game-panel { padding: 22px 20px; }
.game-2048-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.game-score-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 16px;
  text-align: center;
}
.game-score-label { font-size: 10px; color: var(--ink-faint); text-transform: uppercase; }
.game-score-val { font-size: 18px; font-weight: 700; }
.game-2048-header .btn { width: auto; margin-left: auto; padding: 9px 16px; }

.game-2048-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 8px;
  touch-action: none;
  max-width: 420px;
  margin: 0 auto;
}
.g2048-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(16px, 5vw, 26px);
  font-weight: 700;
  color: var(--ink);
  transition: background 100ms ease;
}
.g2048-v2 { background: #EEE4DA; color: #776E65; }
.g2048-v4 { background: #EDE0C8; color: #776E65; }
.g2048-v8 { background: #F2B179; color: #fff; }
.g2048-v16 { background: #F59563; color: #fff; }
.g2048-v32 { background: #F67C5F; color: #fff; }
.g2048-v64 { background: #F65E3B; color: #fff; }
.g2048-v128 { background: #EDCF72; color: #fff; font-size: clamp(14px, 4.4vw, 22px); }
.g2048-v256 { background: #EDCC61; color: #fff; font-size: clamp(14px, 4.4vw, 22px); }
.g2048-v512 { background: #EDC850; color: #fff; font-size: clamp(14px, 4.4vw, 22px); }
.g2048-v1024 { background: #EDC53F; color: #fff; font-size: clamp(12px, 4vw, 18px); }
.g2048-v2048 { background: #EDC22E; color: #fff; font-size: clamp(12px, 4vw, 18px); }

.game-2048-msg {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14px;
  text-align: center;
  color: var(--ink-soft);
}


.snake-canvas-wrap { position: relative; max-width: 400px; margin: 0 auto; }
#snakeCanvas { width: 100%; height: auto; border-radius: 12px; display: block; }
.snake-overlay {
  position: absolute; inset: 0;
  background: rgba(20,23,28,0.72);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 20px;
}
.snake-overlay-inner { color: #fff; font-size: 14px; }

.snake-touch-controls { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 18px; }
.snake-dir-row { display: flex; gap: 6px; }
.snake-dir {
  width: 52px; height: 52px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 18px;
  cursor: pointer;
}
@media (min-width: 700px) {
  .snake-touch-controls { display: none; }
}


.ttt-status { text-align: center; font-size: 15px; font-weight: 600; margin: 16px 0; }
.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 320px;
  margin: 0 auto;
}
.ttt-cell {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 40px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}
.ttt-cell.ttt-x { color: var(--accent); }
.ttt-cell.ttt-o { color: var(--good); }
.ttt-cell.ttt-win { background: var(--surface-2); border-color: var(--accent); }


.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}
.memory-card {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--accent-ink);
}
.memory-card.flipped { background: var(--surface); }
.memory-card.matched { background: var(--surface-2); opacity: 0.6; cursor: default; }


.mole-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 380px;
  margin: 0 auto;
}
.mole-hole {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.mole-face {
  font-size: 30px;
  transform: translateY(100%);
  transition: transform 120ms ease;
}
.mole-hole.up .mole-face { transform: translateY(0); }


.typing-passage {
  font-size: 17px;
  line-height: 1.8;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  margin: 18px 0 12px;
  color: var(--ink-faint);
  font-family: 'IBM Plex Mono', monospace;
}
.typing-passage .char-correct { color: var(--good); }
.typing-passage .char-wrong { color: var(--danger); background: rgba(165,64,47,0.15); border-radius: 2px; }
.typing-passage .char-current { background: var(--accent); color: var(--accent-ink); border-radius: 2px; }

.typing-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}


.rps-vs { display: flex; align-items: center; justify-content: center; gap: 30px; margin: 24px 0 12px; }
.rps-side { text-align: center; }
.rps-emoji { font-size: 56px; line-height: 1; margin-bottom: 8px; }
.rps-label { font-size: 12px; color: var(--ink-faint); font-weight: 600; }
.rps-vs-text { font-size: 14px; font-weight: 700; color: var(--ink-faint); }
.rps-result { text-align: center; font-size: 14.5px; font-weight: 600; margin-bottom: 22px; min-height: 20px; }
.rps-choices { display: flex; justify-content: center; gap: 12px; }
.rps-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 30px;
  cursor: pointer;
}
.rps-choice span { font-size: 12px; color: var(--ink-faint); font-weight: 600; }
.rps-choice:hover { background: var(--surface-2); }


.mine-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 2px;
  max-width: 380px;
  margin: 0 auto;
  background: var(--border);
  padding: 2px;
  border-radius: 8px;
}
.mine-cell {
  aspect-ratio: 1;
  border: none;
  background: var(--surface-2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
.mine-cell.revealed { background: var(--surface); cursor: default; }
.mine-cell.mine { background: var(--danger); }
.mine-cell.num-1 { color: #4A90D9; }
.mine-cell.num-2 { color: var(--good); }
.mine-cell.num-3 { color: var(--danger); }
.mine-cell.num-4 { color: #7B5FBF; }
.mine-cell.num-5 { color: #B8860B; }


.sudoku-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  max-width: 400px;
  margin: 0 auto;
  border: 2px solid var(--ink);
  border-radius: 6px;
  overflow: hidden;
}
.sudoku-cell {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: clamp(12px, 3.5vw, 18px);
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.sudoku-cell.given { color: var(--ink); background: var(--surface-2); cursor: default; }
.sudoku-cell.selected { background: rgba(156,110,19,0.15); }
.sudoku-cell.conflict { color: var(--danger); background: rgba(165,64,47,0.15); }
.sudoku-cell.border-left { border-left: 2px solid var(--ink); }
.sudoku-cell.border-top { border-top: 2px solid var(--ink); }
.sudoku-cell.border-right { border-right: 2px solid var(--ink); }
.sudoku-cell.border-bottom { border-bottom: 2px solid var(--ink); }

.sudoku-numpad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  max-width: 400px;
  margin: 16px auto 0;
}
.sudoku-num-btn {
  padding: 12px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}
.sudoku-num-btn:hover { background: var(--surface-2); }


.hangman-svg { width: 160px; height: 160px; display: block; margin: 0 auto; color: var(--ink); }
.hangman-word { text-align: center; font-size: 26px; letter-spacing: 6px; margin: 14px 0 6px; font-weight: 700; }
.hangman-hint { text-align: center; font-size: 13px; color: var(--ink-faint); margin-bottom: 20px; }

.hangman-keyboard {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  max-width: 420px;
  margin: 0 auto;
}
.hangman-key {
  padding: 10px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}
.hangman-key:hover:not(:disabled) { background: var(--surface-2); }
.hangman-key.correct { background: var(--good); color: #fff; border-color: var(--good); }
.hangman-key.wrong { background: var(--danger); color: #fff; border-color: var(--danger); opacity: 0.6; }
.hangman-key:disabled { cursor: default; }

@media (max-width: 480px) {
  .hangman-keyboard { grid-template-columns: repeat(6, 1fr); }
}


.side-cat { margin-bottom: 2px; }
.side-cat-header {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.side-cat-header svg:first-child { width: 18px; height: 18px; flex-shrink: 0; }
.side-cat-header span { flex: 1; }
.side-cat-arrow { width: 14px !important; height: 14px !important; flex-shrink: 0; transition: transform 150ms ease; }
.side-cat.open .side-cat-arrow { transform: rotate(180deg); }
.side-cat-header:hover { background: var(--surface-2); }

.side-cat-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 200ms ease;
  padding-left: 12px;
}
.side-cat.open .side-cat-list { max-height: 600px; }

.side-sublink {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink-faint);
  border-left: 2px solid var(--border);
  margin-left: 6px;
}
.side-sublink:hover { color: var(--ink); }
.side-sublink.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }


/* ---------- Home page ---------- */
.home-hero {
  padding: 40px 0 30px;
  text-align: center;
  position: relative;
}
.home-hero-badge {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.home-hero h1 {
  font-size: clamp(32px, 6vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.home-hero p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 540px;
  margin: 0 auto;
}

.home-hero-visual {
  position: relative;
  height: 140px;
  margin-top: 36px;
  pointer-events: none;
}
.hero-glow {
  position: absolute;
  top: 50%; left: 50%;
  width: 280px; height: 280px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.12;
  border-radius: 50%;
  z-index: 0;
}
.hero-float {
  position: absolute;
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  animation: heroFloat 4s ease-in-out infinite;
}
.hero-float svg { width: 22px; height: 22px; }
.hero-float-1 { top: 10px; left: 30%; animation-delay: 0s; }
.hero-float-2 { top: 50px; left: 55%; animation-delay: 0.6s; }
.hero-float-3 { top: 20px; left: 68%; animation-delay: 1.2s; }
.hero-float-4 { top: 55px; left: 42%; animation-delay: 1.8s; }
@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-float { animation: none; }
}

.home-most-used { margin-top: 50px; }
.home-most-used h2 { font-size: 20px; margin: 0 0 18px; }

.home-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.tool-card {
  display: block;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
  border-color: var(--accent);
}
.tool-card-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.tool-card-icon svg { width: 19px; height: 19px; }
.tool-card-name { font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.tool-card-desc { font-size: 12.5px; color: var(--ink-faint); line-height: 1.5; }

.home-categories { margin-top: 54px; }
.home-category-block { margin-bottom: 46px; }
.home-category-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.home-category-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.home-category-icon svg { width: 17px; height: 17px; }
.home-category-head h2 { font-size: 18px; margin: 0; flex-shrink: 0; }
.home-category-count {
  font-size: 12px;
  color: var(--ink-faint);
  border-top: 1px solid var(--border);
  flex: 1;
  padding-top: 1px;
  margin-left: 6px;
}

.home-strip {
  margin: 60px 0 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
.home-strip-item { display: flex; gap: 14px; }
.home-strip-icon { font-size: 26px; flex-shrink: 0; }
.home-strip-item h3 { font-size: 15px; margin: 0 0 6px; }
.home-strip-item p { font-size: 13px; color: var(--ink-faint); line-height: 1.55; margin: 0; }

@media (max-width: 760px) {
  .home-card-grid { grid-template-columns: repeat(2, 1fr); }
  .home-strip { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 460px) {
  .home-card-grid { grid-template-columns: 1fr; }
}

.social-soon { display: flex !important; align-items: center; justify-content: space-between; opacity: 0.55; cursor: default; pointer-events: none; }
.social-soon span { font-size: 10px; border: 1px solid var(--border); border-radius: 999px; padding: 2px 7px; }



.star-picker { display: flex; gap: 6px; margin-bottom: 4px; }
.star-picker button {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--border);
  cursor: pointer;
  padding: 0;
}
.star-picker button.filled { color: var(--star); }


/* ---------- Animated category backgrounds ---------- */
.page-bg {
  position: fixed;
  top: var(--topbar-h, 62px);
  left: var(--sidebar-w, 240px);
  right: 0;
  bottom: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
@media (max-width: 900px) {
  .page-bg { left: 0; }
}
.page-shape {
  position: absolute;
  opacity: 0.85;
  will-change: transform;
}
.page-shape.shape-circle { border-radius: 50%; }
.page-shape.shape-square { border-radius: 6px; }
.page-shape.shape-rect { border-radius: 6px; }
.page-shape.shape-triangle {
  width: 0 !important; height: 0 !important;
  background: transparent !important;
  border-style: solid;
}
.page-shape.shape-pentagon { clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%); border-radius: 0; }
.page-shape.shape-hexagon { clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); border-radius: 0; }

/* Glass-effect panels so background shows through subtly */
.panel, .calc-panel, .game-panel {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(6px);
}


.bgr-result { padding: 0 20px 24px; }
.bgr-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.bgr-col { text-align: center; }
.bgr-label { font-size: 12px; color: var(--ink-faint); margin-bottom: 8px; }
.bgr-col img { max-width: 100%; border-radius: 10px; max-height: 260px; object-fit: contain; }
.bgr-checkerboard {
  background-image: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  border-radius: 10px;
  padding: 4px;
}
@media (max-width: 500px) {
  .bgr-compare { grid-template-columns: 1fr; }
}


.eraser-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--ink-soft);
}
.eraser-toolbar input[type="range"] { width: 140px; accent-color: var(--accent); }
.eraser-canvas-wrap {
  position: relative;
  max-width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  line-height: 0;
}
.eraser-canvas-wrap canvas { max-width: 100%; height: auto; display: block; }
#maskCanvas { position: absolute; top: 0; left: 0; cursor: crosshair; touch-action: none; }


.cropper-stage {
  position: relative;
  max-width: 100%;
  height: 360px;
  margin: 16px 0;
  background: var(--surface-2);
  border-radius: 10px;
  overflow: hidden;
}
.cropper-stage img { width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.crop-box {
  position: absolute;
  border: 2px solid var(--accent);
  background: rgba(232, 178, 61, 0.1);
  cursor: move;
  touch-action: none;
}
.crop-handle {
  position: absolute;
  width: 16px; height: 16px;
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 50%;
}
.crop-handle[data-handle="nw"] { top: -8px; left: -8px; cursor: nwse-resize; }
.crop-handle[data-handle="ne"] { top: -8px; right: -8px; cursor: nesw-resize; }
.crop-handle[data-handle="sw"] { bottom: -8px; left: -8px; cursor: nesw-resize; }
.crop-handle[data-handle="se"] { bottom: -8px; right: -8px; cursor: nwse-resize; }



.rotate-controls { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }
.rotate-controls .btn.secondary { width: auto; padding: 12px 16px; }
.rotate-controls .btn.secondary svg { width: 18px; height: 18px; }


.meme-canvas {
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 18px;
  display: block;
}



.sig-canvas {
  width: 100%;
  height: 160px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
  display: block;
}
.sig-position-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.sig-position-grid button {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
}
.sig-position-grid button.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }


.action-row-flex { display: flex; gap: 10px; flex-wrap: wrap; padding: 4px 20px 0; }
.action-row-flex .btn { width: auto; padding: 11px 18px; }
.json-status {
  margin: 16px 20px 20px;
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 13.5px;
}
.json-status.json-success { background: var(--surface-2); color: var(--good); border: 1px solid var(--good); }
.json-status.json-error { background: var(--surface-2); color: var(--danger); border: 1px solid var(--danger); }



.md-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.md-preview {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px 16px;
  background: var(--bg);
  min-height: 230px;
  max-height: 340px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  margin-top: 8px;
}
.md-preview h1, .md-preview h2, .md-preview h3 { margin: 12px 0 8px; }
.md-preview h1 { font-size: 22px; }
.md-preview h2 { font-size: 18px; }
.md-preview p { margin: 8px 0; }
.md-preview a { color: var(--accent); text-decoration: underline; }
.md-preview code { font-family: 'IBM Plex Mono', monospace; background: var(--surface-2); padding: 2px 5px; border-radius: 4px; font-size: 13px; }
.md-preview ul, .md-preview ol { padding-left: 22px; }
@media (max-width: 700px) { .md-grid { grid-template-columns: 1fr; } }


.meta-count { float: right; font-size: 11px; color: var(--ink-faint); font-family: 'IBM Plex Mono', monospace; }
.meta-count-over { color: var(--danger); }




/* Preslo.net responsive banner placement */
.preslo-ad-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0 auto 24px;
    padding: 0 12px;
    overflow: hidden;
}

.preslo-ad-slot {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 728px;
    min-width: 0;
    margin: 0 auto;
    box-sizing: border-box;
}

.preslo-ad-slot iframe,
.preslo-ad-slot img {
    max-width: 100%;
    box-sizing: border-box;
}

/* Tablet and mobile screens */
@media (max-width: 767px) {
    .preslo-ad-banner {
        padding: 0 8px;
        margin-bottom: 18px;
    }

    .preslo-ad-slot {
        width: 100%;
        max-width: 100%;
    }
}

/* Prevent page-level horizontal overflow */
html,
body {
    max-width: 100%;
    overflow-x: clip;
}



/* =====================================================
   PRESLO: SEO CONTENT + ACCESSIBILITY ADDITIONS
   Paste this at the VERY END of style.css
   ===================================================== */

/* ---------- SEO content block (below every tool) ---------- */
.seo-content { margin-top: 56px; }
.seo-content h2 {
  font-size: 19px;
  letter-spacing: -0.01em;
  margin: 36px 0 12px;
}
.seo-content > h2:first-child { margin-top: 0; }
.seo-content p,
.seo-content li {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.seo-content p { margin: 0 0 14px; }
.seo-content ol,
.seo-content ul { padding-left: 22px; margin: 0 0 14px; }
.seo-content li { margin: 6px 0; }
.seo-content strong { color: var(--ink); font-weight: 600; }
.seo-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.seo-content .faq { margin-top: 36px; }

/* ---------- Related tools chips ---------- */
.related-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.related-tools a {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  transition: border-color 120ms ease, color 120ms ease;
}
.related-tools a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Keyboard focus (accessibility) ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone:focus-visible { outline-offset: -4px; border-radius: 14px; }

/* ---------- Mobile browsers: correct viewport height ---------- */
@supports (height: 100dvh) {
  .body-shell { min-height: calc(100dvh - var(--topbar-h)); }
}

/* ---------- Performance on phones / reduced motion ---------- */
@media (max-width: 600px) {
  .panel, .calc-panel, .game-panel { backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .modal, .modal-overlay { transition: none; }
}



/* ---- Favorites ---- */
.tool-card { position: relative; }
.fav-btn {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px;
  border: 0; border-radius: 8px; background: transparent; color: inherit;
  font-size: 18px; line-height: 1; cursor: pointer; opacity: .55;
  display: flex; align-items: center; justify-content: center;
}
.fav-btn:hover { opacity: 1; background: var(--surface-2); }
.fav-btn.on { opacity: 1; color: #f59e0b; }
.fav-hero {
  margin-left: 10px; border: 1px solid var(--border); border-radius: 10px;
  background: transparent; color: inherit; font-size: .5em; padding: 4px 12px;
  cursor: pointer; vertical-align: middle; font-family: inherit; font-weight: 500;
}
.fav-hero.on { color: #f59e0b; border-color: #f59e0b; }




/* =====================================================
   SIDEBAR: "you are here" indicator
   ===================================================== */
.side-sublink {
  position: relative;
  border-radius: 0 8px 8px 0;
  transition: background 120ms ease, color 120ms ease;
}
.side-sublink:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.side-sublink.active,
.side-sublink[aria-current="page"] {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--ink);
  font-weight: 600;
  border-left: 3px solid var(--accent);
  padding-left: 11px;
  padding-right: 28px;
}
.side-sublink.active::after,
.side-sublink[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.side-link.active,
.side-link[aria-current="page"] {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.side-link.active svg { color: var(--accent); }

/* Category that contains the current tool */
.side-cat.has-current > .side-cat-header {
  color: var(--ink);
  font-weight: 600;
}
.side-cat.has-current > .side-cat-header svg:first-child { color: var(--accent); }
.side-cat.has-current:not(.open) > .side-cat-header span::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}

/* Long sidebar: scroll inside it instead of getting cut off */
.sidebar {
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (min-width: 901px) {
  .sidebar {
    position: sticky;
    top: var(--topbar-h);
    align-self: flex-start;
    height: calc(100vh - var(--topbar-h));
  }
}



/* Reserve space for ad slots so the page does not jump when ads.js builds them */
.pl-ad-slot {
  min-height: calc(20px + min(90px, (100vw - 48px) * 0.1236));
}
@media (min-width: 901px) {
  .pl-ad-slot { min-height: 110px; }
}


/* Fallback font sized to match Inter, so text does not reflow when Inter loads */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  size-adjust: 107.4%;
  ascent-override: 90.2%;
  descent-override: 22.48%;
  line-gap-override: 0%;
}
body {
  font-family: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.pl-ad-slot { margin: 28px auto; }
/* =====================================================================
   PRESLO REDESIGN 2026 — professional / trust layer
   Everything below overrides the original styles above.
   To undo the redesign, delete from this comment to the end of the file.
   ===================================================================== */
:root {
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --surface-2: #F1F3F7;
  --ink: #0F172A;
  --ink-soft: #475569;
  --ink-faint: #5B6676;
  --accent: #2456E8;
  --accent-hover: #1C46C4;
  --accent-soft: #EAF0FE;
  --accent-ink: #FFFFFF;
  --border: #E3E7EE;
  --danger: #C2362B;
  --good: #15803D;
  --star: #F2A600;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow-md: 0 4px 16px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.05);
  --radius: 14px;
  --sidebar-w: 256px;
  --topbar-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1120; --surface: #111A2E; --surface-2: #17223A;
    --ink: #E8EDF5; --ink-soft: #A3B0C5; --ink-faint: #8593AA;
    --accent: #6D95FF; --accent-hover: #8AABFF; --accent-soft: #1A2A4D; --accent-ink: #0B1120;
    --border: #22304A; --danger: #F08A80; --good: #5FD08A; --star: #F7C548;
    --shadow-sm: none; --shadow-md: 0 4px 16px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --bg: #0B1120; --surface: #111A2E; --surface-2: #17223A;
  --ink: #E8EDF5; --ink-soft: #A3B0C5; --ink-faint: #8593AA;
  --accent: #6D95FF; --accent-hover: #8AABFF; --accent-soft: #1A2A4D; --accent-ink: #0B1120;
  --border: #22304A; --danger: #F08A80; --good: #5FD08A; --star: #F7C548;
  --shadow-sm: none; --shadow-md: 0 4px 16px rgba(0,0,0,.35);
}

/* Base typography */
html { background: var(--bg); scroll-behavior: smooth; }
body { font-size: 16px; line-height: 1.6; text-rendering: optimizeLegibility; }
h1, h2, h3, h4 { color: var(--ink); letter-spacing: -0.015em; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Remove the floating coloured shapes — they overlap text and look unprofessional */
.page-bg, .page-shape, .hero-float, .hero-glow { display: none !important; }

/* Top bar */
.topbar {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.logo { font-size: 21px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); }
.logo span { color: var(--accent); }
.btn-solid, .btn-ghost, .theme-toggle { border-radius: 10px !important; font-weight: 600; transition: background .15s, border-color .15s, color .15s; }
.btn-solid { background: var(--accent) !important; color: var(--accent-ink) !important; border-color: var(--accent) !important; }
.btn-solid:hover { background: var(--accent-hover) !important; }
.btn-ghost:hover, .theme-toggle:hover { background: var(--surface-2); }

/* Sidebar */
.sidebar { background: var(--surface); border-right: 1px solid var(--border); }
.side-link, .side-cat-header { border-radius: 10px; font-size: 14.5px; font-weight: 500; color: var(--ink-soft); }
.side-link:hover, .side-cat-header:hover { background: var(--surface-2); color: var(--ink); }
.side-sublink { font-size: 14px; color: var(--ink-soft); border-radius: 0 8px 8px 0; }
.side-sublink:hover { color: var(--ink); background: var(--surface-2); }
.side-sublink.active { color: var(--accent) !important; background: var(--accent-soft) !important; border-left-color: var(--accent) !important; font-weight: 600; }

/* Main column */
.main-content { max-width: 820px; padding: 0 28px 72px; }

/* Tool page hero */
.hero { padding: 40px 0 8px; }
.hero h1 { font-size: clamp(30px, 4.4vw, 40px); font-weight: 750; max-width: none; line-height: 1.15; margin-bottom: 12px; }
.hero p { font-size: 17.5px; max-width: 62ch; color: var(--ink-soft); }
/* The "Save" favourite button: small pill instead of a huge button */
.fav-hero {
  display: inline-flex; align-items: center; gap: 4px; margin: 0 0 0 12px;
  font-size: 13px !important; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft);
  vertical-align: middle; position: relative; top: -4px;
}
.fav-hero:hover { border-color: var(--accent); color: var(--accent); }
.fav-hero.on { color: var(--star); border-color: var(--star); }

/* Tool panel & drop zone */
.panel { margin-top: 28px; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.dropzone {
  margin: 14px; width: calc(100% - 28px); padding: 52px 24px; border-radius: 12px;
  border: 2px dashed color-mix(in srgb, var(--accent) 35%, var(--border)); background: var(--accent-soft);
  transition: border-color .15s, background .15s, transform .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); }
.dropzone svg { color: var(--accent); width: 40px; height: 40px; }
.dropzone .dz-title { font-size: 17px; color: var(--ink); }
.btn { border-radius: 10px; padding: 14px 20px; font-size: 15.5px; background: var(--accent); box-shadow: 0 1px 2px rgba(36,86,232,.25); transition: background .15s, transform .05s; }
.btn:hover:not(:disabled) { background: var(--accent-hover); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.secondary { box-shadow: none; }
.btn.secondary:hover:not(:disabled) { background: var(--surface-2); }
.level { border-radius: 12px; transition: border-color .15s; }
.level:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.level.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.progress-track { height: 8px; }
.error-box { border-radius: 10px; }

/* Privacy note becomes a clear trust badge */
.privacy-note {
  border-radius: 12px; border: 1px solid color-mix(in srgb, var(--good) 30%, var(--border));
  background: color-mix(in srgb, var(--good) 7%, var(--surface)); color: var(--ink-soft);
}
.privacy-note svg { color: var(--good); }

/* "How it works" cards */
.how { gap: 14px; margin-top: 36px; }
.how > div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; box-shadow: var(--shadow-sm); }
.how h3 { font-size: 15.5px; margin-top: 0; }

/* Long-form SEO text & FAQ: comfortable reading */
.seo-content { margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--border); }
.seo-content h2 { font-size: 24px; margin-top: 36px; }
.seo-content p, .seo-content li { font-size: 16.5px; line-height: 1.75; color: var(--ink-soft); max-width: 70ch; }
.faq-item, details { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 4px 18px; margin-bottom: 10px; }
.faq-item summary, details summary { font-weight: 600; cursor: pointer; padding: 12px 0; }

/* Home page */
.home-hero { padding: 64px 0 24px; }
.home-hero-badge { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.home-hero h1 { font-size: clamp(34px, 5.6vw, 54px); font-weight: 800; letter-spacing: -0.035em; }
.home-hero p { font-size: 18.5px; max-width: 600px; }
.home-hero-visual { display: none; }
.tool-card { border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.tool-card-icon { background: var(--accent-soft); color: var(--accent); border-radius: 10px; }
.tool-card-name { font-weight: 650; }

/* Ads: clearly separated from tools (good for AdSense policy & trust) */
.pl-ad-slot { margin: 32px auto; padding-top: 8px; border-top: 1px solid var(--border); }

/* Cookie banner: slim bar at the bottom instead of a box covering the tool */
.cookie-banner {
  left: 0; right: 0; bottom: 0; max-width: none; border-radius: 0; border-width: 1px 0 0;
  padding: 12px max(20px, env(safe-area-inset-left)) calc(12px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -6px 24px rgba(15,23,42,.08); justify-content: center; gap: 20px;
}
.cookie-banner > span:first-child { max-width: 760px; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 48px; }
.footer-col h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); }
.footer-col a { color: var(--ink-soft); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { color: var(--ink-faint); font-size: 13px; }

/* Modals */
.modal { border-radius: 16px; box-shadow: 0 24px 64px rgba(15,23,42,.25); }

@media (max-width: 600px) {
  .main-content { padding: 0 16px 56px; }
  .hero { padding-top: 24px; }
  .hero h1 { font-size: 28px; }
  .dropzone { padding: 40px 16px; }
  .cookie-banner { flex-direction: column; align-items: stretch; text-align: left; gap: 10px; }
  .fav-hero { display: flex; width: fit-content; margin: 10px 0 0; top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

.pl-ad-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; text-align: center; }
/* Accessible status/alert helpers used by the tools */
.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; }

/* Footer: clear logo and bold section headings (all screens, light + dark) */
.site-footer .logo { color: var(--ink); font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.site-footer .logo span { color: var(--accent); }
.footer-col h4 { font-size: 13px; font-weight: 800; color: var(--ink); letter-spacing: .08em; text-transform: uppercase; margin: 0 0 12px; }
.footer-col p { color: var(--ink-soft); }
.footer-bottom { border-top: 1px solid var(--border) !important; }

/* ---------- Blog / Guides ---------- */
.article-page { max-width: 760px; }
.breadcrumb { font-size: 13.5px; color: var(--ink-faint); padding-top: 28px; }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--accent); }
.article-head h1 { font-size: clamp(28px, 4.2vw, 40px); line-height: 1.18; letter-spacing: -0.025em; margin: 12px 0 10px; }
.article-meta { color: var(--ink-faint); font-size: 14px; margin: 0 0 8px; }
.article-meta a { color: var(--ink-soft); font-weight: 600; }
.article-body { font-size: 17.5px; line-height: 1.8; color: var(--ink); }
.article-body p, .article-body li { color: var(--ink-soft); }
.article-body h2 { font-size: 26px; margin: 44px 0 12px; line-height: 1.25; }
.article-body h3 { font-size: 20px; margin: 30px 0 8px; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body strong { color: var(--ink); }
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body li { margin: 6px 0; }
.article-body blockquote { margin: 24px 0; padding: 14px 18px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; color: var(--ink); }
.article-body blockquote p { color: var(--ink); margin: 0; }
.article-body code { font-family: 'IBM Plex Mono', monospace; font-size: .9em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.article-body table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 15.5px; display: block; overflow-x: auto; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; vertical-align: top; }
.article-body th { background: var(--surface-2); color: var(--ink); font-weight: 650; }
.article-body td { color: var(--ink-soft); }
.article-cta { margin: 40px 0; padding: 20px 22px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); background: var(--accent-soft); display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.article-cta .btn-solid { display: inline-flex; padding: 10px 18px; border: 1px solid var(--accent); }
.article-faq { margin-top: 40px; }
.article-faq h2, .article-related h2 { font-size: 22px; }
.article-related { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }
.article-related a { color: var(--accent); }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 28px; }
.guide-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; }
.guide-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.guide-card h2 { font-size: 18px; line-height: 1.35; margin: 0; color: var(--ink); }
.guide-card p { font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); margin: 0; }
.guide-tag { align-self: flex-start; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; }
.guide-meta { font-size: 13px; color: var(--ink-faint); margin-top: auto; }
@media (max-width: 600px) { .article-body { font-size: 16.5px; } .article-body h2 { font-size: 22px; } }

/* ---------- Images: tool screenshots, guide covers, logo ---------- */
.tool-shot { margin: 48px 0 8px; }
.tool-shot img, .article-cover img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); background: var(--surface); }
.tool-shot figcaption { font-size: 13.5px; color: var(--ink-faint); text-align: center; margin-top: 10px; }
.article-cover { margin: 18px 0 28px; }
.guide-thumb { display: block; width: calc(100% + 40px); max-width: none; height: auto; margin: -20px -20px 6px; border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--border); }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.footer-brand img { width: 44px; height: 44px; border-radius: 10px; }
.about-logo { margin: 0 0 18px; }
.about-logo img { width: 112px; height: 112px; border-radius: 22px; box-shadow: var(--shadow-md); }

/* Older-style drop zones (Rotate PDF, Delete PDF Pages, Rotate Image) match the main tools */
.panel .nt-drop { margin: 14px; padding: 52px 24px; border-radius: 12px; border: 2px dashed color-mix(in srgb, var(--accent) 35%, var(--border)); background: var(--accent-soft); color: var(--ink-faint); font-size: 14px; line-height: 1.6; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.panel .nt-drop::before { content: ""; display: block; width: 40px; height: 40px; margin: 0 auto 14px; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12m0 0l-4-4m4 4l4-4M4 17v2a2 2 0 002 2h12a2 2 0 002-2v-2'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12m0 0l-4-4m4 4l4-4M4 17v2a2 2 0 002 2h12a2 2 0 002-2v-2'/%3E%3C/svg%3E") center / contain no-repeat; }
.panel .nt-drop strong { display: inline-block; font-size: 17px; color: var(--ink); margin-bottom: 2px; }
.panel .nt-drop:hover, .panel .nt-drop.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); }
@media (max-width: 600px) { .panel .nt-drop { padding: 40px 16px; } }

.guide-callout { margin: 0 0 28px; padding: 14px 18px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); border-radius: 12px; background: var(--accent-soft); font-size: 15.5px; line-height: 1.6; color: var(--ink-soft); }
.guide-callout a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.guide-callout-tag { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); background: var(--accent); padding: 2px 9px; border-radius: 999px; margin-right: 6px; vertical-align: 1px; }

/* Comfortable tap targets on touch screens */
.breadcrumb a, .back-link, .article-related li a, .article-related p a { display: inline-block; padding: 8px 0; }
.article-related li { margin: 2px 0; }
input[type="checkbox"], input[type="radio"] { width: 20px !important; height: 20px !important; min-width: 20px; accent-color: var(--accent); vertical-align: middle; }
.contact-row a { display: inline-block; padding: 6px 0; }

.footer-social { display: flex; gap: 10px; margin-top: 14px; }
.footer-social a { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--border); color: var(--ink-soft); background: var(--surface); transition: color .15s, border-color .15s; }
.footer-social a:hover { color: var(--accent); border-color: var(--accent); }
.footer-social svg { width: 20px; height: 20px; }

/* Small phones: keep the top bar on one line */
.topbar .btn-ghost, .topbar .btn-solid { white-space: nowrap; }
@media (max-width: 420px) {
  .topbar { padding-left: 12px; padding-right: 12px; }
  .topbar-left, .topbar-right { gap: 6px; }
  .topbar .logo { font-size: 19px; }
  .topbar .btn-ghost, .topbar .btn-solid { padding: 8px 11px; font-size: 14px; }
  .topbar .theme-toggle { width: 34px; height: 34px; }
}
@media (max-width: 340px) { .topbar .theme-toggle { display: none; } }

.author-box { display: flex; gap: 16px; align-items: flex-start; margin: 36px 0 8px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.author-avatar { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center; letter-spacing: .02em; }
.author-box p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.65; }
.author-box .author-name { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.author-box a { color: var(--accent); }

/* Collapsed sidebar categories: hide their links from keyboard/screen readers too */
.side-cat-list { visibility: hidden; transition: max-height .25s ease, visibility 0s linear .25s; }
.side-cat.open .side-cat-list { visibility: visible; transition: max-height .25s ease, visibility 0s linear 0s; }
/* ===== end of PRESLO REDESIGN 2026 ===== */
