/* Current product layer. Tool-specific canvases and editors keep their own layout. */
:root {
  --tv-ink: #252635;
  --tv-muted: #666977;
  --tv-accent: #6250cf;
  --tv-line: #e4e4ec;
  --tv-soft: #f4f2fd;
  --tv-control-height: 44px;
  --tv-control-radius: 9px;
  --tv-control-border: #cfc6da;
  --tv-focus-ring: 0 0 0 3px #6250cf22;
  --tv-success-ink: #216747;
  --tv-error-ink: #9b3041;
}
html { scroll-behavior: smooth; scroll-padding-top: 90px; background: #f9fafb; }
body:not(.pdf-tools-page) {
  --primary: #6250cf; --primary-deep: #4e3aac; --primary-bright: #7663de;
  --fg: #252635; --muted: #666977; --border: #e4e4ec; --border-strong: #c7c6d4;
  --shadow-sm: 0 2px 8px #22223806; --shadow: 0 6px 24px #22223808;
  --shadow-lg: 0 12px 40px #22223812;
  background: #f9fafb; color: var(--tv-ink);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
}
[hidden] { display: none !important; }
main:focus { outline: none; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid #8875e9; outline-offset: 3px; }
.tv-icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%); white-space: nowrap; }
.tv-skip { position: fixed; top: -100px; left: 16px; z-index: 10000; background: white; color: #4e3aac; padding: 12px 20px; border-radius: 8px; }
.tv-skip:focus { top: 12px; }
.tv-nav { position: sticky; top: 0; z-index: 100; background: #ffffffed; border-bottom: 1px solid var(--tv-line); backdrop-filter: blur(14px); }
.tv-nav-inner { display: flex; align-items: center; gap: 34px; min-height: 76px; }
.tv-brand { display: inline-flex; align-items: center; gap: 9px; font-family: "Segoe UI", sans-serif; font-size: 23px; font-weight: 750; letter-spacing: -1px; color: var(--tv-ink); text-decoration: none; white-space: nowrap; }
.tv-brand:hover { color: var(--tv-accent); }
.tv-brand-dot { color: var(--tv-accent); margin-left: -8px; }
.tv-brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 33px; height: 33px; border-radius: 10px; background: var(--tv-accent); color: white; font-size: 28px; line-height: 1; font-weight: 700; letter-spacing: -2px; padding: 0 2px 5px 0; }
.tv-brand-mark span { font-size: 18px; margin: -3px 0 0 1px; }
.tv-nav-links { display: flex; gap: 24px; align-items: center; margin-left: auto; }
.tv-nav-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: #302943; font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.tv-nav-links a:hover { color: var(--tv-accent); }
.tv-nav-links .tv-icon { width: 16px; height: 16px; }
.tv-nav-actions { display: flex; align-items: center; gap: 8px; }
.tv-search-trigger { display: flex; align-items: center; gap: 9px; background: #f6f6f9; border: 1px solid var(--tv-line); color: var(--tv-muted); border-radius: 8px; min-height: 38px; padding: 5px 11px; font: inherit; font-size: 12px; }
.tv-search-trigger:hover { border-color: #beb3ed; }
.tv-search-trigger .tv-icon { width: 16px; height: 16px; }
.tv-nav kbd, .search-shortcut, .tv-dialog-hint kbd { color: #80818e; border: 1px solid #dedef0; background: white; border-radius: 4px; padding: 1px 4px; font: 11px ui-monospace, monospace; }
.tv-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: 0 0 auto; padding: 8px; background: transparent; color: #7c7d89; border: 0; border-radius: 8px; cursor: pointer; }
.tv-icon-button:hover { background: #f0edf9; color: var(--tv-accent); }
.tv-menu-toggle { display: none; }
.tv-overline { display: inline-flex; align-items: center; gap: 8px; color: #7a758d; font: 600 10px/1.5 "Segoe UI", sans-serif; letter-spacing: 1.7px; }
.tv-live-dot { width: 6px; height: 6px; background: #7b69d7; border-radius: 50%; box-shadow: 0 0 0 4px #eeebfb; }

/* Home: a quiet workbench with an illustrated paper workflow. */
.directory-page .container { width: min(100% - 64px, 1180px); max-width: 1180px; }
.directory-hero { display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: 40px; min-height: 344px; padding: 45px 0 34px; }
.directory-hero h1 { margin: 20px 0 18px; color: #2a2939; font-size: clamp(36px, 4vw, 50px); font-weight: 750; line-height: 1.26; letter-spacing: -2px; }
.directory-hero h1 em { color: var(--tv-accent); font-style: normal; }
.directory-hero-copy > p { margin: 0; font-size: 14px; color: var(--tv-muted); line-height: 1.85; word-break: keep-all; }
.directory-hero-notes { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 21px; color: #737483; font-size: 11px; }
.toolbox-art { position: relative; width: 100%; max-width: 440px; height: 275px; justify-self: end; border-radius: 24px; background: radial-gradient(#c9c3df 0.65px, transparent 0.7px), #f0eef7; background-size: 14px 14px; overflow: hidden; }
.toolbox-art-label { position: absolute; top: 23px; left: 25px; font: 9px "Segoe UI", sans-serif; color: #8b839d; letter-spacing: 1.4px; }
.toolbox-paper { position: absolute; background: white; border: 1px solid #e4e0f0; border-radius: 11px; padding: 14px; box-shadow: 0 8px 20px #46396210; width: 174px; }
.toolbox-paper > span { display: block; font: 8px "Segoe UI", sans-serif; letter-spacing: 1px; color: #9894a3; margin-bottom: 12px; }
.paper-back { top: 65px; left: 35px; transform: rotate(-7deg); }
.paper-front { top: 49px; right: 28px; transform: rotate(7deg); }
.art-image { border-radius: 5px; background: #edf4f4; overflow: hidden; height: 89px; }
.art-image svg { width: 100%; height: 100%; }
.art-filename { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; color: #777482; font-size: 9px; }
.art-filename > span { font-size: 15px; }
.art-file { width: 65px; height: 89px; margin: 0 auto; background: #f5f1ff; border: 1px solid #e9defc; border-radius: 4px 15px 4px 4px; padding: 14px 10px; }
.art-file span { display: block; margin-bottom: 11px; color: #7861c9; font: 600 14px "Segoe UI", sans-serif; }
.art-file i { display: block; height: 3px; margin-top: 5px; background: #d6c9f0; border-radius: 2px; }
.art-file i:last-child { width: 65%; }
.art-done { color: #4b9075; background: #e7f3eb; border-radius: 50%; width: 21px; text-align: center; }
.toolbox-art-connector { position: absolute; z-index: 2; top: 126px; left: 44%; display: grid; place-items: center; width: 40px; height: 40px; background: #6652d2; color: white; border: 5px solid #f0edf8; border-radius: 50%; font-size: 21px; }
.toolbox-art-caption { position: absolute; bottom: 19px; right: 29px; color: #81788f; font-size: 10px; }
.toolbox-art-caption span { color: #8c79bb; margin-right: 6px; }
.directory-search { display: flex; align-items: center; gap: 14px; padding: 8px 20px; background: white; border: 1px solid #dcd9e9; border-radius: 12px; box-shadow: 0 3px 14px #46396205; min-height: 66px; color: var(--tv-accent); }
.directory-search:focus-within { border-color: #8573d8; box-shadow: 0 0 0 3px #ede8fb; }
body.directory-page #tool-search { flex: 1; min-width: 0; margin: 0; width: auto; border: 0; box-shadow: none; background: transparent; border-radius: 0; padding: 12px 0; font: inherit; font-size: 14px; color: var(--tv-ink); outline: none; }
.directory-search input::placeholder { color: #92919f; }
.directory-search input::-webkit-search-cancel-button { display: none; }
.directory-search #clear-search { font-size: 24px; }
.search-shortcut { padding: 3px 8px; }
.directory-suggestions { display: flex; align-items: center; gap: 19px; padding: 13px 3px 31px; flex-wrap: wrap; font-size: 11px; }
.directory-suggestions > span { color: #97939f; }
.directory-suggestions a { color: #71707d; text-decoration: none; }
.directory-suggestions a:hover { color: var(--tv-accent); }
.directory-recent { border-top: 1px solid var(--tv-line); border-bottom: 1px solid var(--tv-line); padding: 17px 0; margin-bottom: 27px; }
.directory-recent > div { display: flex; gap: 20px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.directory-recent h2 { margin: 0; font-size: 12px; }
.tv-text-button { border: 0; padding: 3px 0; background: transparent; color: var(--tv-accent); cursor: pointer; font: inherit; font-size: 11px; text-underline-offset: 4px; }
.tv-text-button:hover { text-decoration: underline; }
.directory-recent ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.directory-recent a { display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 11px; color: #686477; text-decoration: none; background: white; border: 1px solid var(--tv-line); border-radius: 7px; font-size: 11px; }
.directory-recent a:hover { border-color: #b8a8eb; }
.directory-recent .tv-icon { width: 14px; height: 14px; }
.directory-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin: 7px 0 22px; }
.directory-toolbar .tv-overline { font-size: 9px; }
.directory-toolbar h2 { display: flex; align-items: center; gap: 10px; margin: 7px 0 0; font-size: 20px; letter-spacing: -.7px; font-weight: 700; }
.directory-total { background: #eeebf8; color: var(--tv-accent); padding: 2px 7px; font: 600 11px/1.5 "Segoe UI", sans-serif; border-radius: 6px; letter-spacing: 0; }
.directory-sort { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #85818f; white-space: nowrap; }
.directory-page .directory-sort select { margin: 0; width: 86px; border: 1px solid var(--tv-line); background-color: white; box-shadow: none; padding: 7px; border-radius: 7px; color: #676372; font-size: 11px; }
.directory-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 0 0 16px; border-bottom: 1px solid var(--tv-line); }
.directory-page .filter-chip { display: flex; align-items: center; gap: 6px; padding: 8px 11px; min-height: 40px; background: white; border: 1px solid #ddd8e8; border-radius: 8px; box-shadow: none; color: #494056; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.directory-page .filter-chip .tv-icon { width: 15px; height: 15px; }
.directory-page .filter-chip > span { color: #696174; margin-left: 2px; font-size: 11px; }
.directory-page .filter-chip:hover { background: #f0edf8; transform: none; }
.directory-page .filter-chip.active { color: white; background: #5942be; border-color: #5942be; font-weight: 700; }
.directory-page .filter-chip.active > span { color: #eee9ff; }
.directory-page .favorites-filter { margin-left: auto; }
.directory-result-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; }
.directory-result-line p { margin: 0; color: #8a8594; font-size: 11px; overflow-wrap: anywhere; }
.directory-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.directory-card { --category-ink: #5135a2; --category-soft: #eee7ff; position: relative; min-width: 0; background: white; border: 1px solid #dcd7e7; border-top: 3px solid var(--category-ink); border-radius: 12px; transition: border-color .18s, box-shadow .18s, transform .18s; }
.directory-card[data-category="pdf"] { --category-ink: #a33645; --category-soft: #fce8ec; }
.directory-card[data-category="text"] { --category-ink: #176850; --category-soft: #dff3eb; }
.directory-card[data-category="data"] { --category-ink: #245ba0; --category-soft: #e2edff; }
.directory-card[data-category="encoding"] { --category-ink: #875813; --category-soft: #fff0d3; }
.directory-card[data-category="security"] { --category-ink: #6b3c91; --category-soft: #f1e5fa; }
.directory-card:hover { border-color: var(--category-ink); box-shadow: 0 6px 20px #47336818; transform: translateY(-2px); }
.directory-card:focus-within { border-color: #a998da; }
.directory-card-link { display: block; height: 100%; padding: 21px 19px 15px; text-decoration: none; color: inherit; border-radius: inherit; }
.directory-card-link:hover { color: inherit; }
.directory-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; }
.directory-icon .tv-icon { width: 21px; height: 21px; }
.tone-image { background: #eee7ff; color: #5135a2; }
.tone-pdf { background: #fce8ec; color: #a33645; }
.tone-text { background: #dff3eb; color: #176850; }
.tone-data { background: #e2edff; color: #245ba0; }
.tone-encoding { background: #fff0d3; color: #875813; }
.tone-security { background: #f1e5fa; color: #6b3c91; }
.directory-card h3 { margin: 15px 0 8px; font-size: 17px; font-weight: 750; color: var(--category-ink); letter-spacing: -.45px; line-height: 1.45; }
.directory-card p { margin: 0; min-height: 46px; color: #595263; font-size: 13px; line-height: 1.75; word-break: keep-all; overflow-wrap: anywhere; }
.directory-card-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 19px; color: var(--category-ink); font-size: 11px; font-weight: 600; }
.directory-card-bottom > span { padding: 3px 8px; background: var(--category-soft); border-radius: 5px; }
.directory-card-bottom .tv-icon { width: 18px; height: 18px; color: var(--category-ink); }
.favorite-toggle { position: absolute; top: 15px; right: 12px; width: 36px; height: 36px; color: #aaa2b5; }
.favorite-toggle .tv-icon { width: 17px; height: 17px; }
[data-favorite][aria-pressed="true"] { color: #9d7517; }
[data-favorite][aria-pressed="true"] .tv-icon { fill: #faeab7; }
.directory-empty { text-align: center; border: 1px dashed #d9d3e9; border-radius: 14px; padding: 60px 20px; }
.directory-empty > .tv-icon { width: 32px; height: 32px; color: #9b8ac1; }
.directory-empty h3 { margin: 20px 0 10px; font-size: 20px; }
.directory-empty p { color: var(--tv-muted); font-size: 13px; }
.directory-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 45px; padding: 38px 0; margin-top: 42px; border-top: 1px solid var(--tv-line); border-bottom: 1px solid var(--tv-line); }
.directory-values > div > span { color: #a194bb; font: 11px ui-monospace, monospace; }
.directory-values h2 { font-size: 14px; margin: 12px 0 8px; }
.directory-values p { color: #8a8494; font-size: 12px; margin: 0; line-height: 1.8; word-break: keep-all; }

/* Shared navigation, tool headers and working surfaces. */
.tv-tool-context { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; }
.tv-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: #8b8395; font-size: 11px; }
.tv-breadcrumb a { color: #787180; text-decoration: none; }
.tv-breadcrumb a:hover { color: var(--tv-accent); text-decoration: underline; }
.tv-breadcrumb [aria-current] { color: #5e546c; }
.tv-save-tool { display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; border: 1px solid var(--tv-line); background: white; padding: 7px 12px; border-radius: 7px; color: #867b93; font: inherit; font-size: 11px; }
.tv-save-tool .tv-icon { width: 16px; height: 16px; }
body:not(.pdf-tools-page) .site-header { margin: 14px auto 24px; }
body:not(.pdf-tools-page) .site-header .container { min-height: 132px; padding: 28px 30px; background: #f0edf8; border: 1px solid #e4deef; border-radius: 14px; box-shadow: none; color: #393047; overflow: visible; }
body:not(.pdf-tools-page) .site-header .container::before,
body:not(.pdf-tools-page) .site-header .container::after { display: none; }
body:not(.pdf-tools-page) .site-header h1 { color: #393047; font-size: clamp(23px, 3vw, 32px); font-weight: 700; letter-spacing: -1px; line-height: 1.35; }
body:not(.pdf-tools-page) .site-header p { color: #797081; font-size: 13px; line-height: 1.7; opacity: 1 !important; }
body:not(.pdf-tools-page) .site-header .button.secondary { color: #736186; background: #ffffffa8; border: 1px solid #dfd7e9; box-shadow: none; font-size: 12px; }
body:not(.pdf-tools-page) .site-header .button.secondary:hover { background: white; color: #554068; }
body:not(.pdf-tools-page) .hero-eyebrow, body:not(.pdf-tools-page) .hero-pill { color: #736085; background: #ffffff8c; border-color: #ded6e8; }
body:not(.pdf-tools-page) .panel { border: 1px solid var(--tv-line); border-radius: 12px; box-shadow: none; background: white; padding: 24px; }
body:not(.pdf-tools-page) .panel::before { display: none; }
body:not(.pdf-tools-page) .panel h2 { color: #443c50; font-size: 17px; font-weight: 650; }
body:not(.pdf-tools-page) .panel h3 { color: #51475d; font-weight: 600; }
body:not(.pdf-tools-page) .button { border-radius: 8px; box-shadow: none; font-weight: 600; }
body:not(.pdf-tools-page) .button:not(.secondary) { background: #6250cf; color: white; box-shadow: none; }
body:not(.pdf-tools-page) .button::after { display: none; }
body:not(.pdf-tools-page) .button:hover { transform: none; filter: brightness(.98); }
body:not(.pdf-tools-page) .dnd { border-radius: 10px; border: 1.5px dashed #c9bddb; background: #fcfaff; box-shadow: none; }
body:not(.pdf-tools-page) .form-control, body:not(.pdf-tools-page) .form-select,
body:not(.pdf-tools-page) .code-area { border-radius: 8px; box-shadow: none; }
body:not(.pdf-tools-page) .tool-tabs { border-radius: 10px; background: #f0edf6; box-shadow: none; }
body:not(.pdf-tools-page) .tool-tab { border-radius: 7px; }
body:not(.pdf-tools-page) .tool-tabs:has(.tool-tab) { border-radius: 10px; background: #f0edf6; box-shadow: none; }
body:not(.pdf-tools-page) .panel[data-feature-summary] { border-radius: 12px; background: #fff; }
/* Bootstrap columns already fill the row. Include the panel gap in every
   breakpoint's width calculation so the last panel cannot wrap. */
body:not(.pdf-tools-page) .row:has(> .panel) { --panel-gap: 20px; margin-left: 0; margin-right: 0; column-gap: var(--panel-gap); }
body:not(.pdf-tools-page) .row:has(> .panel:only-child) { --panel-gap: 0px; }
body:not(.pdf-tools-page) .row > .panel { min-width: 0; }
@media (min-width: 768px) {
  body:not(.pdf-tools-page) .row > .panel.col-md-4 { width: calc((100% + var(--panel-gap)) / 3 - var(--panel-gap)); }
  body:not(.pdf-tools-page) .row > .panel.col-md-5 { width: calc((100% + var(--panel-gap)) * 5 / 12 - var(--panel-gap)); }
  body:not(.pdf-tools-page) .row > .panel.col-md-6 { width: calc((100% + var(--panel-gap)) / 2 - var(--panel-gap)); }
  body:not(.pdf-tools-page) .row > .panel.col-md-7 { width: calc((100% + var(--panel-gap)) * 7 / 12 - var(--panel-gap)); }
  body:not(.pdf-tools-page) .row > .panel.col-md-8 { width: calc((100% + var(--panel-gap)) * 2 / 3 - var(--panel-gap)); }
}
@media (min-width: 992px) {
  body:not(.pdf-tools-page) .row > .panel.col-lg-4 { width: calc((100% + var(--panel-gap)) / 3 - var(--panel-gap)); }
  body:not(.pdf-tools-page) .row > .panel.col-lg-8 { width: calc((100% + var(--panel-gap)) * 2 / 3 - var(--panel-gap)); }
}
#panel-formatter .indent-sel { width: 74px; }
#panel-formatter label { white-space: nowrap; }
.tv-guide { display: grid; grid-template-columns: .85fr 1.15fr; gap: 50px; margin: 48px 0 20px; padding: 28px 0; border-top: 1px solid var(--tv-line); font-size: 13px; line-height: 1.8; color: #82788d; }
.tv-guide h2 { margin: 7px 0 14px; font-size: 21px; color: #4a3f55; letter-spacing: -.6px; }
.tv-guide h3 { font-size: 13px; color: #5b4f66; margin: 19px 0 9px; }
.tv-guide p { margin: 0 0 12px; }
.tv-guide ul { margin: 0; padding-left: 18px; }
.tv-guide details { border-bottom: 1px solid var(--tv-line); }
.tv-guide summary { padding: 17px 26px 17px 0; cursor: pointer; font-size: 13px; font-weight: 600; color: #61536f; }
.tv-guide details p { padding: 0 15px 16px 0; font-size: 12px; }
.tv-related { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0 !important; }
.tv-related a { display: block; padding: 6px 10px; background: #f0ecf7; border: 1px solid #e6dfee; border-radius: 6px; color: #78618e; text-decoration: none; font-size: 11px; }
.tv-related a:hover { border-color: #b29dc5; }
.tv-footer { background: #f4f3f7; padding: 32px 0; margin-top: 40px; }
.site-footer.tv-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; padding: 0; border: 0; overflow: visible; }
.tv-footer .tv-brand { font-size: 19px; }
.tv-footer .tv-brand-mark { width: 28px; height: 28px; font-size: 23px; border-radius: 8px; }
.site-footer.tv-footer p { margin: 9px 0 0; color: #978d9f; font-size: 10px; }
.tv-footer .footer-links { display: flex; flex-wrap: wrap; gap: 22px; }
.tv-footer .footer-links a { font-size: 11px; color: #807486; text-decoration: none; }
.tv-footer small { color: #a095a8; font-size: 10px; }
.tv-ad-rail, .tv-ad-inline { display: none; }
.tv-ad-slot { width: 160px; min-height: 600px; background: #f0eff4; outline: 1px solid #e3e0e9; }
.tv-ad-inline .tv-ad-slot { width: 320px; min-height: 100px; }
@media (min-width: 352px) and (max-width: 1199px) {
  .tv-ad-inline.is-requested { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 28px auto; color: #71697e; font-size: 11px; }
}
/* Reserve both gutters before scripts run so ads never cover the work area. */
@media (min-width: 1200px) {
  body { padding-inline: 180px; }
  .container, .app-container, .directory-page .container { width: calc(100% - 40px); max-width: 1180px; }
  .tv-ad-rail.is-requested { display: flex; flex-direction: column; gap: 8px; align-items: center; position: fixed; top: max(84px, calc((100vh - 624px) / 2)); width: 160px; z-index: 20; color: #71697e; font-size: 11px; }
  .tv-ad-left { left: max(10px, calc((100vw - 1540px) / 2)); }
  .tv-ad-right { right: max(10px, calc((100vw - 1540px) / 2)); }
}
@media (min-width: 1200px) and (max-width: 1559px) {
  .tv-nav-inner { gap: 16px; }
  .tv-nav-links { gap: 16px; }
  .tv-search-trigger > span, .tv-search-trigger kbd { display: none; }
  .directory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .directory-hero { gap: 20px; }
  .directory-hero h1 { font-size: 38px; }
  .toolbox-art { max-width: 350px; }
  .paper-back { left: 16px; }
  .paper-front { right: 14px; }
  .toolbox-paper { width: 145px; }
  .directory-page .favorites-filter { margin-left: 0; }
}
@media (min-width: 1200px) and (max-height: 710px) {
  .tv-ad-rail.is-requested { position: absolute; top: 90px; }
}

/* Keyboard-friendly quick search and feedback. */
.tv-dialog-open { overflow: hidden; }
.tv-search-dialog { width: min(600px, calc(100% - 32px)); max-height: min(680px, 85dvh); padding: 22px; border: 1px solid #e1d9eb; border-radius: 16px; color: var(--tv-ink); background: white; box-shadow: 0 25px 80px #24203040; overflow-y: auto; }
.tv-search-dialog::backdrop { background: #26213270; backdrop-filter: blur(3px); }
.tv-dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tv-dialog-top h2 { margin: 0; font-size: 17px; font-weight: 650; }
.tv-dialog-top .tv-icon-button { width: 44px; height: 44px; }
.tv-search-field { display: flex; align-items: center; gap: 12px; padding: 0 14px; border: 1px solid #d8cde8; background: #fcfaff; border-radius: 8px; color: #927daf; }
body .tv-search-field input[type="search"] { min-width: 0; width: 100%; padding: 13px 0; margin: 0; border: 0; background: transparent; font: inherit; font-size: 13px; box-shadow: none; outline: none; }
.tv-search-field:focus-within { outline: 2px solid #b7a2df; outline-offset: 2px; }
.tv-search-status { margin: 16px 0 6px; font-size: 12px; color: #6d607b; }
.tv-quick-results { margin: 0; padding: 0; list-style: none; }
.tv-quick-results a { display: flex; align-items: center; gap: 13px; padding: 10px 7px; border-radius: 8px; text-decoration: none; color: #4b405a; }
.tv-quick-results a:hover, .tv-quick-results a:focus { background: #f6f2fb; }
.tv-quick-results a > span:nth-child(2) { flex: 1; min-width: 0; }
.tv-quick-results strong { display: block; font-size: 15px; font-weight: 700; color: #352746; }
.tv-quick-results small { display: block; color: #695b75; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-quick-results a > .tv-icon { color: #b4a4bf; width: 16px; }
.tv-no-results { color: #6d607b; padding: 35px 0; text-align: center; font-size: 13px; }
.tv-dialog-hint { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; border-top: 1px solid var(--tv-line); margin-top: 14px; padding-top: 13px; color: #766781; font-size: 12px; }
.tv-toast { position: fixed; z-index: 1000; bottom: 26px; left: 50%; transform: translate(-50%, 12px); max-width: calc(100% - 32px); width: max-content; background: #393042; color: white; border-radius: 9px; padding: 13px 20px; font-size: 13px; box-shadow: 0 6px 28px #2d233933; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.tv-toast.visible { opacity: 1; transform: translate(-50%, 0); }
.tool-error-message { padding: 14px 18px; margin: 0 0 18px; color: #963c43; background: #fff1f2; border: 1px solid #f3d5d9; border-radius: 9px; font-size: 13px; }

/* PDF keeps its editing canvas and modal geometry; its page shell shares the palette. */
body.pdf-tools-page { background: #f9fafb; --primary: #6250cf; --primary-deep: #4e3aac; }
body.pdf-tools-page::before { display: none; }
body.pdf-tools-page .site-header { margin: 14px auto 24px; }
body.pdf-tools-page .site-header .pdf-hero-shell { min-height: 0; padding: 28px 30px; background: #f0edf8; border: 1px solid #e4deef; border-radius: 14px; box-shadow: none; }
body.pdf-tools-page .site-header .pdf-hero-shell::before, body.pdf-tools-page .site-header .pdf-hero-shell::after { display: none; }
body.pdf-tools-page .site-header h1 { color: #393047; font-size: clamp(26px, 3vw, 34px); line-height: 1.3; letter-spacing: -1px; }
body.pdf-tools-page .site-header p { color: #797081; font-size: 13px; }
body.pdf-tools-page .pdf-eyebrow { color: #78688c; font-size: 11px; }
body.pdf-tools-page .pdf-trust-chip { color: #80718e; background: #ffffff9e; border-color: #e0d6eb; box-shadow: none; }
body.pdf-tools-page .pdf-hero-actions .button.secondary { color: #736186; background: #ffffffa8; border: 1px solid #dfd7e9; box-shadow: none; }
body.pdf-tools-page .pdf-main > .tool-tabs { border-radius: 12px; background: #f0edf6; box-shadow: none; }
body.pdf-tools-page .pdf-main > .tool-tabs .tab-btn { border-radius: 9px; box-shadow: none; }
body.pdf-tools-page .workspace-panel { background: white; border-radius: 14px; box-shadow: none; }

/* Shared visual rhythm: clear controls, quiet surfaces, and aligned card content. */
.tv-brand-mark { box-shadow: inset 0 1px 0 #ffffff50, 0 3px 9px #5942be25; }
.tv-nav { box-shadow: 0 3px 15px #24203704; }
.tv-search-trigger { color: #51416d; background: #f3effb; border-color: #e3dcef; }
.directory-hero .tv-overline { font-family: inherit; font-size: 12px; font-weight: 650; line-height: 1.5; letter-spacing: .2px; color: #62527e; }
.directory-hero-notes { gap: 8px; }
.directory-hero-notes > span { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; border: 1px solid #e1dceb; border-radius: 6px; background: #ffffffb3; color: #61566f; }
.toolbox-art { border: 1px solid #e3ddef; box-shadow: inset 0 1px 0 #ffffffb3; }
.directory-search-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.directory-search-label label { font-size: 15px; font-weight: 700; color: #3a2e4c; }
.directory-search-label > span { color: #776985; font-size: 11px; }
.directory-search { border: 1.5px solid #cfc2e6; border-radius: 14px; box-shadow: 0 5px 18px #5942be07; }
.directory-search input::placeholder { color: #82758f; }
.directory-suggestions { gap: 8px; padding-top: 12px; padding-bottom: 24px; font-size: 12px; }
.directory-suggestions > span { margin-right: 5px; color: #74657f; }
.directory-suggestions a { display: inline-flex; align-items: center; min-height: 34px; padding: 5px 10px; background: #f1edf7; border: 1px solid #e7e0ef; border-radius: 7px; color: #604c7a; }
.directory-suggestions a:hover { background: #e8e0f5; border-color: #c3b0df; }
.directory-recent { background: #f2f0f6; border: 1px solid #e4dfec; border-radius: 12px; padding: 15px 16px; }
.directory-recent h2 { color: #51425f; font-size: 13px; }
.directory-recent a { color: #594768; border-color: #e1d8e9; }
.directory-toolbar { margin-top: 34px; margin-bottom: 20px; }
.directory-toolbar h2 { font-size: 23px; letter-spacing: -.8px; }
.directory-toolbar .tv-overline { color: #746781; letter-spacing: 1.3px; }
.directory-total { padding: 4px 8px; font-size: 12px; background: #eae3f9; }
.directory-sort { color: #6a5d77; font-size: 12px; }
.directory-page .directory-sort select { min-height: 40px; font-size: 12px; color: #4f405f; border-color: #d8cfe3; }
.directory-filters { padding: 12px; background: #f0edf5; border: 1px solid #e3ddeb; border-radius: 12px; gap: 8px; }
.directory-page .filter-chip { min-height: 42px; border-color: #e0d8e9; }
.directory-page .filter-chip[data-filter="image"] { --filter-ink: #5135a2; }
.directory-page .filter-chip[data-filter="pdf"] { --filter-ink: #a33645; }
.directory-page .filter-chip[data-filter="text"] { --filter-ink: #176850; }
.directory-page .filter-chip[data-filter="data"] { --filter-ink: #245ba0; }
.directory-page .filter-chip[data-filter="encoding"] { --filter-ink: #875813; }
.directory-page .filter-chip[data-filter="security"] { --filter-ink: #6b3c91; }
.directory-page .filter-chip .tv-icon { color: var(--filter-ink, #5942be); }
.directory-page .filter-chip.active { background: var(--filter-ink, #5942be); border-color: var(--filter-ink, #5942be); box-shadow: 0 2px 6px #3e285d18; }
.directory-page .filter-chip.active .tv-icon { color: white; }
.directory-result-line { min-height: 52px; }
.directory-result-line p { color: #6d607b; font-size: 12px; }
.directory-grid { gap: 18px; align-items: stretch; }
.directory-card { border-radius: 15px; box-shadow: 0 2px 5px #30213d04; }
.directory-card-link { display: flex; flex-direction: column; align-items: flex-start; padding: 23px 20px 17px; }
.directory-card .directory-icon { width: 44px; height: 44px; border-radius: 12px; box-shadow: inset 0 0 0 1px #00000005; }
.directory-card h3 { margin-top: 18px; text-wrap: balance; }
.directory-card p { margin-bottom: 18px; }
.directory-card-bottom { width: 100%; margin-top: auto; padding-top: 12px; border-top: 1px solid #eee9f3; }
.directory-card-bottom > .tv-icon { padding: 5px; width: 29px; height: 29px; border-radius: 50%; background: var(--category-soft); transition: transform .18s; }
.directory-card:hover .directory-card-bottom > .tv-icon { transform: translateX(3px); }
.favorite-toggle { background: #faf8fc; border: 1px solid #e9e2ef; color: #857391; border-radius: 50%; }
.favorite-toggle:hover { border-color: #c5afd9; }
.directory-values { gap: 16px; border: 0; padding: 0; }
.directory-values > div { padding: 22px; background: #f0edf5; border: 1px solid #e3ddeb; border-radius: 12px; }
.directory-values > div > span { display: inline-flex; justify-content: center; align-items: center; width: 27px; height: 27px; color: #6a528a; background: white; border-radius: 7px; }
.directory-values h2 { color: #453353; }
.directory-values p { color: #74647f; }
.tv-guide { color: #74647f; }
.tv-guide details { padding-inline: 15px; border: 1px solid #e3ddeb; border-radius: 10px; background: white; margin-bottom: 9px; }
.tv-guide details[open] { border-color: #c5b1df; background: #fcfaff; }
.tv-guide summary { color: #4b355e; }
.tv-footer { border-top: 1px solid #e3ddeb; }
.tv-footer .footer-links a { color: #685674; font-size: 12px; }
body[data-tool-category] { --tool-ink: #5135a2; --tool-wash: #f1ebfb; }
body[data-tool-category="pdf"] { --tool-ink: #943342; --tool-wash: #faedf0; }
body[data-tool-category="text"] { --tool-ink: #176850; --tool-wash: #eaf5f0; }
body[data-tool-category="data"] { --tool-ink: #245ba0; --tool-wash: #edf3fc; }
body[data-tool-category="encoding"] { --tool-ink: #875813; --tool-wash: #faf3e7; }
body[data-tool-category="security"] { --tool-ink: #6b3c91; --tool-wash: #f4edf9; }
body[data-tool-category] .site-header .container { background: var(--tool-wash); border-color: color-mix(in srgb, var(--tool-ink) 18%, white); border-left: 4px solid var(--tool-ink); }
body[data-tool-category] .site-header h1 { color: var(--tool-ink); }
body[data-tool-category] .site-header p { color: #65576f; }
body[data-tool-category] .tv-breadcrumb [aria-current] { color: var(--tool-ink); font-weight: 700; }

/* Common controls use the same size, contrast and interaction states. */
.tv-nav-inner { gap: 18px; }
.tv-nav-links { flex: 1; min-width: 0; gap: 4px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #c9bfdc transparent; }
.tv-nav-links a { padding: 8px 10px; min-height: 40px; font-size: 13px; border-radius: 8px; }
.tv-nav-links a:hover { background: #f3eff9; }
.tv-nav-links a[aria-current] { background: #ebe4fa; color: #503499; box-shadow: inset 0 -2px 0 #6e50be; }
.tv-nav-actions { flex-shrink: 0; }
.tv-breadcrumb { font-size: 12px; line-height: 1.6; color: #72637e; }
.tv-breadcrumb a { color: #665570; }
.tv-save-tool { min-height: 40px; color: #665174; border-color: #d4c8df; font-size: 12px; }
.tv-text-button { font-size: 12px; min-height: 32px; }
.site-footer.tv-footer p, .tv-footer small { color: #766781; font-size: 12px; line-height: 1.7; }
.tv-footer .footer-links a { display: inline-flex; align-items: center; min-height: 40px; }
.tv-related a { font-size: 12px; min-height: 36px; }
body[data-tool-category] main .button,
body[data-tool-category] main :is(.btn-primary, .btn-secondary, .btn-outline-secondary) {
  min-height: var(--tv-control-height); border-radius: var(--tv-control-radius); padding: 10px 16px;
  font-size: 14px; font-weight: 650; line-height: 1.4; letter-spacing: 0;
  box-shadow: none; transition: background-color .15s, border-color .15s, box-shadow .15s;
}
body[data-tool-category] main .button:not(.secondary),
body[data-tool-category] main .btn-primary { background: #5c43be; border: 1px solid #5c43be; color: white; }
body[data-tool-category] main .button.secondary,
body[data-tool-category] main :is(.btn-secondary, .btn-outline-secondary) { background: white; border: 1px solid var(--tv-control-border); color: #58436c; }
body[data-tool-category] main .button:hover:not(:disabled),
body[data-tool-category] main .btn-primary:hover:not(:disabled) { background: #4d35a5; border-color: #4d35a5; color: white; transform: none; filter: none; }
body[data-tool-category] main .button.secondary:hover:not(:disabled),
body[data-tool-category] main :is(.btn-secondary, .btn-outline-secondary):hover:not(:disabled) { background: #f1ecf8; border-color: #a38abf; color: #49305f; }
body[data-tool-category] main :is(.button, .btn):disabled {
  background: #eeebf2; color: #81788d; border: 1px solid #ded7e6; opacity: 1;
  cursor: not-allowed; box-shadow: none; transform: none; filter: none;
}
body[data-tool-category] main .button.danger-action { color: var(--tv-error-ink); border-color: #e6b9c2; background: #fff5f6; }
body[data-tool-category] main .button.danger-action:disabled { color: #81788d; border-color: #ded7e6; background: #eeebf2; }
body[data-tool-category] main :is(input[type="text"], input[type="number"], input[type="url"], input[type="email"], input[type="password"], input[type="search"], input[type="date"], input[type="time"], input[type="datetime-local"], select, textarea) {
  border: 1px solid var(--tv-control-border); border-radius: var(--tv-control-radius);
  background-color: #fff; color: #342b3e; font-size: 14px; line-height: 1.6; padding: 10px 12px; box-shadow: none;
}
body[data-tool-category] main :is(input[type="text"], input[type="number"], input[type="url"], input[type="email"], input[type="password"], input[type="search"], input[type="date"], input[type="time"], input[type="datetime-local"], select) { min-height: var(--tv-control-height); }
body[data-tool-category] main :is(input, textarea)::placeholder { color: #81768d; opacity: 1; }
body[data-tool-category] main input[type="file"] { min-width: 0; max-width: 100%; }
body[data-tool-category] main :is(input, select, textarea):focus-visible { border-color: #7856bd; outline: 2px solid #7856bd; outline-offset: 2px; box-shadow: var(--tv-focus-ring); }
body[data-tool-category] main :is(input, select, textarea):disabled { background-color: #f0edf4; color: #807489; cursor: not-allowed; }
body[data-tool-category] main :is(input, textarea)[readonly] { background-color: #f8f6fb; }
body[data-tool-category] main :is(input, select, textarea)[aria-invalid="true"] { border-color: #b64054; background-color: #fff7f8; }
body[data-tool-category] main :is(input[type="checkbox"], input[type="radio"], input[type="range"]) { accent-color: #6250cf; }
body[data-tool-category] main :is(label, .form-label) { color: #51415f; font-size: 13px; font-weight: 600; line-height: 1.6; }
body[data-tool-category] main :is(small, .form-text) { font-size: 12px; line-height: 1.7; }
body[data-tool-category] main .muted { color: #756880; }
body[data-tool-category] main .dnd { border: 1.5px dashed #b6a3d0; border-radius: 12px; background: #faf7fe; color: #6c577f; line-height: 1.8; }
body[data-tool-category] main .dnd:hover { background: #f2ecfa; border-color: #8360b0; }
body[data-tool-category] main .tool-tab { min-height: 44px; font-size: 13px; color: #695478; }
body[data-tool-category] main .tool-tab.active { background: white; color: #513299; box-shadow: 0 2px 5px #3f265c12; }
body[data-tool-category] main .badge.success { background: #e9f6ed; color: var(--tv-success-ink); border: 1px solid #bdddc7; }
body[data-tool-category] main .badge.error { background: #fff0f2; color: var(--tv-error-ink); border: 1px solid #ebc2ca; }
.tool-error-message { border-left: 4px solid #b64054; font-size: 14px; line-height: 1.65; }
.tv-toast { line-height: 1.6; border: 1px solid #635371; }

@media (max-width: 1100px) {
  .tv-nav-inner { gap: 20px; }
  .tv-nav-links { gap: 3px; }
  .tv-search-trigger > span, .tv-search-trigger kbd { display: none; }
  .directory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .directory-page .favorites-filter { margin-left: 0; }
  .toolbox-art { transform: scale(.93); transform-origin: right center; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 78px; }
  .container, .app-container, .directory-page .container { width: calc(100% - 32px); }
  .tv-nav-inner { min-height: 64px; justify-content: space-between; }
  .tv-nav-links { display: none; position: absolute; top: 63px; left: 0; right: 0; margin: 0; padding: 12px 20px; max-height: calc(100dvh - 80px); overflow-y: auto; background: white; border-bottom: 1px solid var(--tv-line); box-shadow: 0 14px 20px #2c1d3912; }
  .tv-nav-links.is-open { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px 10px; }
  .tv-nav-links a { padding: 10px 12px; border-radius: 8px; min-height: 44px; font-size: 14px; }
  .tv-nav-links a:hover { background: #f1edf7; }
  .tv-menu-toggle { display: inline-flex; }
  .tv-nav-actions .tv-icon-button, .tv-search-trigger { min-width: 44px; min-height: 44px; }
  .directory-recent a { min-height: 44px; font-size: 12px; color: #50445f; }
  .directory-recent ul { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; }
  .directory-recent li { flex: 0 0 auto; }
  .directory-recent a { white-space: nowrap; }
  .tv-brand { font-size: 21px; }
  .directory-hero { grid-template-columns: 1fr; padding: 33px 0 25px; min-height: 0; }
  .directory-hero h1 { font-size: 38px; margin-top: 17px; }
  .directory-hero-copy > p { font-size: 13px; }
  .directory-hero-notes { font-size: 10px; gap: 14px; }
  .directory-hero .tv-overline { font-size: 11px; }
  .directory-hero-notes { gap: 6px; }
  .directory-hero-notes > span { padding: 3px 7px; font-size: 10px; }
  .toolbox-art { display: none; }
  .directory-search { min-height: 58px; padding: 7px 14px; gap: 10px; }
  body.directory-page #tool-search { font-size: 16px; }
  .directory-search input::placeholder { font-size: 12px; }
  .directory-search-label label { font-size: 14px; }
  .directory-search-label > span { display: none; }
  .search-shortcut { display: none; }
  .directory-suggestions { gap: 6px; padding-bottom: 22px; font-size: 11px; }
  .directory-suggestions a { min-height: 36px; padding: 5px 8px; }
  .directory-toolbar h2 { font-size: 18px; }
  .directory-toolbar { align-items: center; flex-wrap: wrap; }
  .directory-sort { margin-left: auto; }
  .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .directory-page .filter-chip { padding: 7px 9px; font-size: 12px; min-height: 40px; }
  .directory-filters { gap: 6px; padding: 9px; }
  .directory-card-link { padding: 17px 14px 13px; }
  .directory-card h3 { font-size: 15px; }
  .directory-card p { font-size: 12px; min-height: 58px; }
  .favorite-toggle { top: 10px; right: 5px; min-width: 40px; min-height: 40px; }
  .directory-icon { width: 34px; height: 34px; }
  .directory-card .directory-icon { width: 38px; height: 38px; }
  .directory-card-bottom { padding-top: 10px; }
  .directory-card-bottom > span { padding: 3px 5px; font-size: 10px; }
  .directory-card-bottom > .tv-icon { width: 24px; height: 24px; padding: 4px; }
  .directory-values { gap: 20px; grid-template-columns: 1fr; padding: 25px 0; margin-top: 30px; }
  .directory-values h2 { display: inline; margin: 0 0 0 12px; }
  .directory-values p { margin-top: 8px; }
  .directory-values > div { padding: 18px; }
  .tv-guide { grid-template-columns: 1fr; gap: 24px; margin-top: 28px; }
  .tv-tool-context { align-items: flex-start; gap: 8px; padding-top: 15px; }
  .tv-breadcrumb { font-size: 12px; gap: 6px; }
  .tv-save-tool { padding: 6px 9px; }
  .tv-save-tool span { display: none; }
  body:not(.pdf-tools-page) .site-header .container { min-height: 0; padding: 22px 20px; border-radius: 12px; gap: 15px; }
  body:not(.pdf-tools-page) .site-header .container.d-flex { align-items: flex-start !important; }
  body:not(.pdf-tools-page) .site-header h1 { font-size: 25px; }
  body:not(.pdf-tools-page) .panel { padding: 18px; }
  body[data-tool-category] main :is(input[type="text"], input[type="number"], input[type="url"], input[type="email"], input[type="password"], input[type="search"], input[type="date"], input[type="time"], input[type="datetime-local"], select, textarea) { font-size: 16px; }
  .tv-footer .footer-links { gap: 15px; }
  .site-footer.tv-footer .container { flex-direction: column; align-items: flex-start; gap: 20px; }
  .tv-ad-rail { display: none; }
  .tv-search-dialog { padding: 16px; max-height: 88dvh; }
  body .tv-search-field input[type="search"] { font-size: 16px; }
  .tv-search-field input::placeholder { font-size: 12px; }
}
@media (max-width: 360px) {
  .directory-grid { grid-template-columns: 1fr; }
  .directory-card p { min-height: 0; }
  .directory-toolbar h2 { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .tv-nav, .tv-tool-context, .tv-footer, .tv-ad-rail, .tv-ad-inline, .tv-search-dialog, .tv-toast, .favorite-toggle { display: none !important; }
  body { background: white !important; padding-inline: 0; }
  .directory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .directory-card, .tv-guide details { break-inside: avoid; }
}
