/* ==========================================================================
   UtilityHub — Design System v3 ("crafted")
   --------------------------------------------------------------------------
   Loaded by every page: portfolio, tool hub, category hubs, tool pages, blog
   hub, blog articles, static pages. Markup is Tailwind-utility based and the
   Tailwind Play CDN injects after this file, so anything that must beat a
   utility class needs higher specificity (hence element+attribute selectors).

   Design intent — deliberately restrained so it reads as engineered rather
   than templated: one ink colour for emphasis, one blue for links/active,
   hairline borders instead of stacked shadows, no decorative gradients,
   honest type scale, 8px spacing rhythm, tap targets >= 40px.

   Functional hooks that must keep working: .dragover, .has-file, .btn-copy,
   #toast-container, .toast*, #search-modal (+ .hidden), .open-search-trigger,
   .table-scroll, summary markers, .nav-blur, .converter-box, .tool-card.
   ========================================================================== */

/* 1. Tokens -------------------------------------------------------------- */
:root {
  /* ink ramp — all AA on white */
  --ink: #0f172a;      /* headings, primary buttons */
  --ink-2: #1e293b;    /* strong body */
  --ink-3: #334155;    /* body copy */
  --ink-4: #64748b;    /* secondary text (4.8:1) */
  --ink-5: #94a3b8;    /* decorative / disabled only */

  /* surfaces */
  --paper: #ffffff;
  --canvas: #f8fafc;
  --canvas-2: #f1f5f9;

  /* lines */
  --line: #e2e8f0;
  --line-2: #cbd5e1;

  /* brand */
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;

  /* legacy aliases kept for any inline reference */
  --primary: var(--brand);
  --primary-hover: var(--brand-dark);
  --secondary: var(--ink);
  --accent: #6366f1;
  --surface: var(--paper);
  --surface-alt: var(--canvas);
  --border: var(--line);
  --text-main: var(--ink);
  --text-muted: var(--ink-4);

  /* elevation — used only for overlays */
  --shadow-pop: 0 12px 32px -12px rgba(15, 23, 42, 0.22), 0 2px 6px -2px rgba(15, 23, 42, 0.10);
  --shadow-toast: 0 10px 24px -10px rgba(15, 23, 42, 0.35);
  --shadow-ring: 0 0 0 3px rgba(37, 99, 235, 0.16);

  /* radii — tighter than a template default */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  --measure: 68ch;
  --tap: 40px;

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --speed: 140ms;
}

/* 2. Base ---------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--ink-3);
  background-color: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02' 1, 'cv03' 1, 'cv04' 1, 'cv11' 1;
  font-variant-numeric: tabular-nums;
}

::selection { background: #dbeafe; color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

body input:focus, body select:focus, body textarea:focus, body button:focus { outline: none; }

/* keyboard users: jump straight past the nav */
.skip-link {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--r-md);
  transition: top var(--speed) var(--ease);
}

.skip-link:focus { top: 12px; }

/* 3. Typography ---------------------------------------------------------- */
body h1, body h2, body h3, body h4, body h5, body h6 {
  color: var(--ink);
  letter-spacing: -0.021em;
  text-wrap: balance;
}

body h1 { letter-spacing: -0.03em; line-height: 1.12; }
body h2 { letter-spacing: -0.024em; line-height: 1.2; }
body h3 { letter-spacing: -0.016em; line-height: 1.3; }

body p, body li { text-wrap: pretty; }

body a {
  color: var(--brand);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--speed) var(--ease);
}

body a:hover { color: var(--brand-dark); }

/* 4. Navigation ---------------------------------------------------------- */
/* crisp bar, hairline bottom border, no glass */
.nav-blur {
  background: var(--paper);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--line);
}

.nav-blur a { color: var(--ink-3); }
.nav-blur a:hover { color: var(--brand); }
.nav-blur a span span { color: var(--brand); }

body .nav-blur a:not(.open-search-trigger) {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}

/* brand tile: solid ink, white bolt */
.brand-mark {
  background: var(--ink) !important;
  color: #fff !important;
  border-radius: var(--r-md) !important;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark i { color: #fff; }

.open-search-trigger {
  background: var(--canvas) !important;
  border: 1px solid var(--line-2) !important;
  color: var(--ink-4) !important;
  border-radius: var(--r-md) !important;
  min-height: var(--tap);
  transition: border-color var(--speed) var(--ease), background-color var(--speed) var(--ease),
    color var(--speed) var(--ease);
}

.open-search-trigger:hover {
  background: var(--paper) !important;
  border-color: var(--ink-5) !important;
  color: var(--ink-2) !important;
}

.open-search-trigger kbd {
  background: var(--paper);
  border-color: var(--line-2);
  color: var(--ink-4);
  font-weight: 600;
}

/* 5. Cards & surfaces ---------------------------------------------------- */
body .tool-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: none;
  transition: border-color var(--speed) var(--ease), transform var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease);
}

body .tool-card:hover {
  transform: translateY(-2px);
  border-color: #bfdbfe;
  box-shadow: 0 8px 20px -14px rgba(15, 23, 42, 0.35);
}

body .converter-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: none;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

body .converter-box:focus-within {
  border-color: #bfdbfe;
  box-shadow: 0 10px 24px -18px rgba(15, 23, 42, 0.4);
}

body .bg-white.rounded-2xl:not(.converter-box):not(.tool-card) {
  border-color: var(--line);
  box-shadow: none;
}

body .bg-white.rounded-xl:not(.converter-box):not(.tool-card) {
  border-color: var(--line);
}

/* 6. Forms --------------------------------------------------------------- */
body input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='color']):not([type='range']):not([type='submit']),
body select,
body textarea {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 0.6rem 0.8rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

body textarea { line-height: 1.65; min-height: 7rem; }

body select {
  cursor: pointer;
  padding-right: 2.1rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2364748b' stroke-width='1.6'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1.05em 1.05em;
}

body input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='color']):not([type='range']):not([type='submit'])::placeholder,
body textarea::placeholder { color: var(--ink-5); opacity: 1; }

body input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='color']):not([type='range']):not([type='submit']):hover,
body select:hover,
body textarea:hover { border-color: var(--ink-5); }

body input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='color']):not([type='range']):not([type='submit']):focus,
body select:focus,
body textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--shadow-ring);
}

body input:disabled, body select:disabled, body textarea:disabled {
  background: var(--canvas-2);
  color: var(--ink-5);
  cursor: not-allowed;
}

body input[type='checkbox'], body input[type='radio'], body input[type='range'] { accent-color: var(--brand); }

body input[type='file'] {
  width: 100%;
  font-size: 0.8125rem;
  color: var(--ink-4);
  background: var(--canvas);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  transition: border-color var(--speed) var(--ease), background-color var(--speed) var(--ease);
}

body input[type='file']:hover { border-color: var(--ink-5); background: var(--paper); }

body input[type='file']::file-selector-button {
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 0.4rem 0.75rem;
  margin-right: 0.7rem;
  cursor: pointer;
}

body input[type='file']::file-selector-button:hover { border-color: var(--ink-5); }

body label { color: var(--ink-2); letter-spacing: -0.005em; }

/* 7. Buttons ------------------------------------------------------------- */
body button,
body button[type],
body button:not([type]) {
  cursor: pointer;
  font-family: inherit;
  min-height: 32px;
  transition: background-color var(--speed) var(--ease), border-color var(--speed) var(--ease),
    color var(--speed) var(--ease), transform var(--speed) var(--ease);
  -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
}

body button:disabled { cursor: not-allowed; opacity: 0.55; }
body .btn-copy { border-radius: var(--r-sm) !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--tap);
  padding: 0.6rem 1rem;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  border: 1px solid transparent;
  transition: background-color var(--speed) var(--ease), border-color var(--speed) var(--ease),
    color var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); color: #fff; }

.btn-secondary {
  background: var(--paper);
  color: var(--ink-2);
  border-color: var(--line-2);
}

.btn-secondary:hover { border-color: var(--ink-5); color: var(--ink); }

.btn-ghost { background: transparent; color: var(--ink-4); }
.btn-ghost:hover { background: var(--canvas-2); color: var(--ink); }
.btn-sm { min-height: 32px; padding: 0.35rem 0.7rem; font-size: 0.8125rem; border-radius: var(--r-sm); }

/* 8. Tables -------------------------------------------------------------- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: -ms-autohiding-scrollbar;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.table-scroll table {
  min-width: 640px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.table-scroll thead th {
  background: var(--canvas-2);
  color: var(--ink-2);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table-scroll tbody td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #eef2f7;
  color: var(--ink-3);
  vertical-align: top;
}

.table-scroll tbody tr:last-child td { border-bottom: 0; }
.table-scroll tbody tr:hover td { background: #fbfcfe; }

/* 9. Blog prose ---------------------------------------------------------- */
.blog-prose {
  color: var(--ink-3);
  max-width: var(--measure);
  font-size: 1.0625rem;
  line-height: 1.75;
}

.blog-prose > * + * { margin-top: 1.1em; }

.blog-prose h2 {
  font-size: 1.4375rem;
  font-weight: 700;
  letter-spacing: -0.022em;
  margin-top: 2em;
  color: var(--ink);
  scroll-margin-top: 6rem;
}

.blog-prose h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-top: 1.6em;
  color: var(--ink);
}

.blog-prose h4 { font-size: 1.0625rem; font-weight: 700; margin-top: 1.4em; color: var(--ink); }

.blog-prose ul, .blog-prose ol { padding-left: 1.3em; }
.blog-prose ul { list-style: disc; }
.blog-prose ol { list-style: decimal; }
.blog-prose li { margin-top: 0.35em; }
.blog-prose li::marker { color: var(--ink-5); }
.blog-prose strong { color: var(--ink); font-weight: 650; }

.blog-prose a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-color: #bfdbfe;
}

.blog-prose a:hover { text-decoration-color: var(--brand); }

.blog-prose blockquote {
  border-left: 2px solid var(--line-2);
  background: var(--canvas);
  padding: 0.85rem 1.1rem;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--ink-2);
  font-size: 0.9875rem;
}

.blog-prose blockquote p { margin: 0; }

.blog-prose code {
  background: var(--canvas-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.1em 0.34em;
  font-size: 0.855em;
  color: var(--ink);
  word-break: break-word;
}

.blog-prose pre {
  background: var(--ink);
  color: #e2e8f0;
  border-radius: var(--r-md);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.65;
}

.blog-prose pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.blog-prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.blog-prose thead th {
  background: var(--canvas-2);
  padding: 0.6rem 0.8rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}

.blog-prose td { padding: 0.6rem 0.8rem; border-bottom: 1px solid #eef2f7; }
.blog-prose tbody tr:last-child td { border-bottom: 0; }
.blog-prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.blog-prose img { border-radius: var(--r-md); }
.blog-prose > :first-child { margin-top: 0; }

/* 10. Search modal ------------------------------------------------------- */
.search-modal-backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

#search-modal .shadow-2xl {
  border-radius: var(--r-lg);
  border-color: var(--line);
  box-shadow: var(--shadow-pop);
}

#search-modal #search-input { font-family: var(--font-sans); }

#search-results a {
  border-radius: var(--r-md);
  transition: background-color var(--speed) var(--ease);
}

#search-results a:hover { background: var(--canvas-2); }

/* 11. Toasts ------------------------------------------------------------- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 11px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-toast);
  animation: slideIn 0.24s var(--ease);
}

.toast-success { background: #047857; color: #fff; }
.toast-error { background: #b91c1c; color: #fff; }
.toast-info { background: var(--ink); color: #fff; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 12. Dropzone ----------------------------------------------------------- */
.dropzone {
  border: 2px dashed var(--line-2);
  background: var(--canvas);
  border-radius: var(--r-lg);
  transition: border-color var(--speed) var(--ease), background-color var(--speed) var(--ease);
  cursor: pointer;
}

.dropzone:hover, .dropzone.dragover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone.has-file { border-color: #059669; background: #ecfdf5; }

/* 13. Labels, chips, small parts ---------------------------------------- */
.micro-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-4);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 30px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease),
    border-color var(--speed) var(--ease);
}

.chip:hover { background: var(--paper); color: var(--brand); border-color: var(--line-2); }

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
}

.section-title {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.026em;
  color: var(--ink);
}

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
}

/* 13a. Utility-text contrast sweep ----------------------------------------
   Tailwind's gray-400/slate-400 (2.6-2.9:1 on white) is below AA for body
   text, and emerald-400 is worse. Lift them site-wide so no tool ships
   unreadable helper text; dark surfaces are restored below. */
body .text-gray-400,
body .text-slate-400 { color: var(--ink-4) !important; }

body .text-emerald-400 { color: #047857 !important; }

/* keep muted text legible on dark backgrounds */
.pf-footer .text-gray-400,
.pf-footer .text-slate-400,
.pf-footer .text-emerald-400,
.bg-slate-900 .text-gray-400,
.bg-slate-900 .text-slate-400,
.bg-gray-900 .text-gray-400,
.bg-gray-800 .text-gray-400,
.bg-blue-600 .text-white\/90 { color: #cbd5e1 !important; }

/* 13b. Micro-label contrast sweep -----------------------------------------
   Tool UIs mark small uppercase labels with gray-400 (2.6:1 on white, below
   AA). Target only that idiom so every tool inherits a readable label without
   each UI being edited. */
body span[class*='uppercase'][class*='tracking-wider'].text-gray-400,
body span[class*='uppercase'][class*='tracking-wider'].text-gray-500 {
  color: var(--ink-4) !important;
}

/* 14. Bands & headers ---------------------------------------------------- */
/* full-width band, hairline rules, no decorative gradient */
.page-hero {
  position: relative;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

/* plain header card, consistent with the rest of the surfaces */
.hub-header {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 2rem 1.5rem;
}

/* gradient-text kept for markup compatibility, rendered as solid brand ink */
.gradient-text { color: var(--brand); }

.site-footer {
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.site-footer h4 { letter-spacing: 0.11em; color: var(--ink); }
.site-footer a { color: var(--ink-3); display: inline-flex; align-items: center; min-height: 30px; }
.site-footer a:hover { color: var(--brand); }
.site-footer .text-gray-400, .site-footer .text-gray-500 { color: var(--ink-4) !important; }

/* 15. Portfolio ---------------------------------------------------------- */
.pf-nav {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.pf-nav .nav-link { position: relative; min-height: 36px; display: inline-flex; align-items: center; }

.pf-nav .nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: 8px;
  left: 0;
  background: var(--brand);
  transition: width 200ms var(--ease);
}

.pf-nav .nav-link:hover::after { width: 100%; }

.pf-hero { position: relative; }

.pf-section { padding: 5rem 0; }
.pf-section-head { text-align: center; margin-bottom: 3rem; }

.pf-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  transition: transform 200ms var(--ease), border-color 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.pf-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  box-shadow: 0 12px 28px -20px rgba(15, 23, 42, 0.45);
}

.pf-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--canvas-2);
  color: var(--ink-2);
  margin-bottom: 1rem;
}

.pf-timeline { border-left: 1px solid var(--line-2); padding-left: 1.5rem; position: relative; }

.pf-timeline::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
}

.pf-footer { background: var(--ink); color: #cbd5e1; }
.pf-footer h2 { color: #fff; }

.pf-social {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-3);
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease),
    border-color var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.pf-social:hover { background: var(--ink); border-color: var(--ink); color: #fff; transform: translateY(-1px); }

.pf-avatar {
  border-radius: 999px;
  border: 3px solid var(--paper);
  box-shadow: 0 24px 48px -28px rgba(15, 23, 42, 0.45);
}

/* 16. Utilities ---------------------------------------------------------- */
.container-x {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 640px) { .container-x { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .container-x { padding-inline: 2rem; } }

.prose-narrow { max-width: 68ch; }

details[open] summary svg { transform: rotate(180deg); }
summary::-webkit-details-marker { display: none; }

img { max-width: 100%; height: auto; display: block; }

body kbd {
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  padding: 0.1rem 0.4rem;
  font-size: 0.75rem;
  color: var(--ink-4);
}

body hr { border-color: var(--line); }

body ::-webkit-scrollbar { width: 11px; height: 11px; }
body ::-webkit-scrollbar-track { background: transparent; }
body ::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
body ::-webkit-scrollbar-thumb:hover { background: var(--ink-5); background-clip: content-box; }

/* 17. Motion, print, small screens -------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .nav-blur, .pf-nav, #toast-container, #search-modal, .skip-link, footer { display: none !important; }
  body { background: #fff; }
  .tool-card, .converter-box, body .bg-white.rounded-2xl { box-shadow: none; }
}

@media (max-width: 640px) {
  .btn { width: 100%; }
  .pf-section { padding: 3.25rem 0; }
  .pf-card { padding: 1.35rem; }
  .blog-prose { font-size: 1rem; line-height: 1.72; }
  .blog-prose h2 { font-size: 1.25rem; }
  .blog-prose h3 { font-size: 1.0625rem; }
  #toast-container { left: 16px; right: 16px; bottom: 16px; }
  .toast { width: 100%; }
  .blog-prose pre { padding: 0.8rem; font-size: 0.8rem; }
}