/* Navigation shell only. Tool interfaces must own their styles and behavior. */
/* Shared ownership: standalone-page base, shell and site footer.
   Tool styles must never supply these rules. No tool-body scope is used. */
@font-face {
  font-family: Inter;
  src: url("fonts/InterVariable-4.1.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}
/* One UI stack for every generated route; keep existing system fallbacks. */
:root { --ui-font: Inter, Arial, Helvetica, sans-serif; }
.shell-page { margin:0; background:var(--paper); color:var(--navy); font-family:var(--ui-font); }
body button, body input, body select, body textarea { font-family:inherit; }
/* Keep tool-local weights intact: their controls inherit Inter without a global weight override. */
.shell-page * { box-sizing:border-box; }
.shell-page a { color:inherit; }
.shell-page .site-header { display:flex; align-items:center; justify-content:space-between; }
.shell-page .brand { display:inline-flex; text-decoration:none; }
.shell-page .brand img { height:auto; }
.shell-page .sidebar-links { font-size:15px; font-weight:500; }

.shell-page .page-content { padding-top:36px; padding-bottom:24px; }
/* Keep the shared footer clear of growing tool results, including the resizer's in-main footer. */
.shell-page .site-footer { margin-top:clamp(48px, 6vw, 72px); }
.site-footer { border-top:1px solid var(--line); padding-block:42px 52px; display:grid; grid-template-columns:minmax(180px,1fr) repeat(3,minmax(130px,.7fr)); gap:32px; }
.site-footer .copyright { grid-column:1 / -1; margin:0; color:var(--muted); font-size:13px; }
.site-footer .footer-brand img { width:180px; height:auto; }
.site-footer .footer-group h2 { margin:0 0 14px; font-size:14px; }
.site-footer .footer-group p { margin:9px 0; color:var(--muted); font-size:14px; }
.site-footer .coming-soon { display:inline-block; color:var(--deep-teal); font-size:13px; font-weight:700; }
.site-footer a:focus-visible { outline:3px solid var(--teal); outline-offset:5px; }
.shell-page :is(a,button,input):focus-visible { outline:3px solid var(--teal); outline-offset:4px; }
:root { --header-height: 80px; --sidebar-width: 224px; --header-surface: rgb(255 255 255 / .92); }
html[data-theme="dark"] { --header-surface: rgb(16 38 56 / .92); }
html { scroll-padding-top: calc(var(--header-height) + 24px); }
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 20;
  height: var(--header-height); min-height: 0;
  padding: 0 28px; gap: 24px;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
/* Opaque fallback keeps controls readable without backdrop-filter support. */
@supports ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  .site-header {
    background: var(--header-surface);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (forced-colors: active) {
  .site-header { background: Canvas; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.site-header .brand { width: calc(var(--sidebar-width) - 28px); flex-shrink: 0; }
.site-header .brand img { width: 174px; }
.page-title { flex: 1; font-size: 20px; font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.menu-toggle {
  display: none;
  min-height: 44px; padding: 9px 12px; border: 1px solid var(--control-border);
  border-radius: 7px; font: inherit; color: var(--navy); background: var(--paper); cursor: pointer;
}
.menu-toggle[hidden] { display: none; }
.sidebar-close { display: none; }
.site-sidebar {
  position: fixed; top: var(--header-height); left: 0; bottom: 0; z-index: 15;
  width: var(--sidebar-width); padding: 28px 20px; overflow-y: auto;
  background: var(--paper); border-right: 1px solid var(--line);
}
.search-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 10px; }
#navigation-search {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--control-border);
  border-radius: 7px; background: var(--paper); color: var(--navy); font: inherit; font-size: 14px;
}
#navigation-search::placeholder { color: var(--muted); opacity: 1; }
.sidebar-links { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-top: 24px; }
.sidebar-links a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 10px 12px; border-radius: 7px; text-decoration: none; }
.sidebar-links a span { width: 20px; text-align: center; font-size: 22px; font-weight: 400; }
.sidebar-links .navigation-icon { display: block; width: 20px; height: 20px; }
.sidebar-links .category-icon { display: block; width: 20px; height: 20px; }
.sidebar-links a:hover, .sidebar-links a[aria-current] { color: var(--navy); background: var(--control-hover); }
.sidebar-links a[data-destination="top"] { --tab-accent: #087F87; --tab-tint: #EDF8F7; }
.sidebar-links a[data-destination="images"] { --tab-accent: #245EB5; --tab-tint: #EEF4FD; }
.sidebar-links a[data-destination="pdf"] { --tab-accent: #AB3655; --tab-tint: #FCEFF3; }
.sidebar-links a[data-destination="utilities"] { --tab-accent: #7543AF; --tab-tint: #F5EFFC; }
.sidebar-links a[data-destination="video-audio"], .sidebar-links a[data-destination="text-writing"], .sidebar-links a[data-destination="developer"] { --tab-accent: var(--teal); --tab-tint: var(--control-hover); }
html[data-theme="dark"] .sidebar-links a[data-destination="top"] { --tab-accent: #5DD5D1; --tab-tint: #173C43; }
html[data-theme="dark"] .sidebar-links a[data-destination="images"] { --tab-accent: #90B9FF; --tab-tint: #203450; }
html[data-theme="dark"] .sidebar-links a[data-destination="pdf"] { --tab-accent: #FFA3BA; --tab-tint: #432C40; }
html[data-theme="dark"] .sidebar-links a[data-destination="utilities"] { --tab-accent: #C7A7F5; --tab-tint: #332E4C; }
.sidebar-links a span { color: var(--tab-accent); }
.sidebar-links a:hover, .sidebar-links a[aria-current] { background: var(--tab-tint); }
.sidebar-links a[aria-current] { box-shadow: inset 3px 0 var(--tab-accent); }
.sidebar-links a[hidden] { display: none; }
.sidebar-links a[data-destination="tools"] { --tab-accent: var(--teal); --tab-tint: var(--control-hover); }
.sidebar-links .tool-count { margin-left: auto; min-width: 24px; padding: 3px 6px; border-radius: 5px; background: var(--control-hover); color: var(--navy); text-align: center; font-size: 12px; font-weight: 600; }
.sidebar-heading { margin: 22px 12px 6px; color: var(--muted); font-size: 14px; font-weight: 600; }
.discovery-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px; }
.discovery-actions .cta { flex-shrink: 0; }
.tool-search { position: relative; flex: 1 1 240px; max-width: 360px; min-width: 0; }
.tool-search .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.tool-search label { display: block; margin-bottom: 8px; color: var(--navy); font-size: 14px; font-weight: 600; }
.tool-search-controls { display: flex; min-height: 54px; border: 1px solid var(--control-border); border-radius: 7px; background: var(--paper); }
.tool-search input { width: 100%; min-width: 0; padding: 12px; border: 0; border-radius: 7px; color: var(--navy); background: transparent; font: inherit; }
.tool-search input::placeholder { color: var(--muted); opacity: 1; }
.tool-search button { min-height: 52px; padding: 10px 12px; border: 0; border-left: 1px solid var(--control-border); border-radius: 0 6px 6px 0; background: var(--control-hover); color: var(--navy); font: inherit; cursor: pointer; }
.tool-search input:focus-visible, .tool-search button:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.tool-suggestions:not([hidden]) { position: absolute; z-index: 10; top: 100%; left: 0; right: 0; margin-top: 5px; padding: 8px; border: 1px solid var(--control-border); border-radius: 7px; background: var(--paper); box-shadow: 0 10px 24px rgb(0 0 0 / .14); max-height: min(360px, 60vh); overflow-y: auto; }
.tool-suggestions-count { margin: 4px 8px 8px; color: var(--muted); font-size: 14px; }
.tool-suggestions-list a { display: block; min-height: 44px; padding: 10px 8px; border-radius: 5px; text-decoration: none; font-weight: 500; }
.tool-suggestions-list a:hover, .tool-suggestions-list a:focus-visible { background: var(--control-hover); }
.tool-suggestions-list p { margin: 8px; line-height: 1.5; }
.tool-search .tool-suggestions-list a:focus-visible { outline: 3px solid var(--teal); outline-offset: -2px; }
.tool-suggestions .tool-suggestions-all:not([hidden]) { display: block; width: 100%; min-height: 44px; margin-top: 4px; padding: 8px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--deep-teal); text-align: left; font: inherit; font-weight: 600; cursor: pointer; }
.tool-suggestions .tool-suggestions-all:hover, .tool-suggestions .tool-suggestions-all:focus-visible { background: var(--control-hover); }
.tool-search .tool-suggestions .tool-suggestions-all:focus-visible { outline: 3px solid var(--teal); outline-offset: -2px; }
.tool-results a[hidden] { display: none; }
.tools .catalog-status { margin-top: 20px; color: var(--muted); line-height: 1.6; }
#tools:focus { outline: none; }
.search-status { color: var(--muted); font-size: 14px; line-height: 1.5; }
.page-content { margin: var(--header-height) 0 0 var(--sidebar-width); max-width: none; padding-inline: clamp(24px, 4vw, 64px); }
.page-content .hero { gap: 24px; }
.page-content h1 { font-size: clamp(44px, 4.7vw, 70px); }

.category-section { padding-top: 32px; }
.category-section h3 { margin: 0 0 12px; font-size: 24px; }
.category-section > p { color: var(--muted); line-height: 1.6; }
.category-section .tool-card { margin-top: 0; }
.tool-card h4 { margin: 0 0 8px; font-size: 19px; }

.skip-link { position: fixed; top: -100px; left: 20px; z-index: 40; padding: 14px; background: var(--paper); color: var(--navy); }
.skip-link:focus { top: 12px; }
.menu-toggle:focus-visible, #navigation-search:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
#top:focus, .category-section:focus { outline: none; }
@media (max-width: 1100px) {
  .page-content .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 48px; }
  .page-content .visual { max-width: 650px; }
  .site-footer { grid-template-columns:1fr 1fr; gap:28px 20px; }
  .site-footer .footer-brand { grid-column:1 / -1; }
}
@media (max-width: 760px) {
  :root { --header-height: 112px; }
  .site-header { flex-wrap: wrap; align-content: center; padding: 10px 20px; gap: 6px 12px; }
  .site-header .brand { width: auto; margin-right: auto; }
  .site-header .brand img { width: 136px; }
  .page-title { order: 3; flex-basis: 100%; font-size: 17px; line-height: 24px; }
  .header-actions { gap: 8px; }
  .menu-toggle:not([hidden]) { display: inline-flex; align-items: center; }
  .sidebar-close:not([hidden]) { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; margin-bottom: 18px; padding: 9px 12px; border: 1px solid var(--control-border); border-radius: 7px; background: var(--control-hover); color: var(--navy); font: inherit; font-weight: 700; cursor: pointer; }
  .sidebar-close span { font-size: 22px; line-height: 1; }
  .sidebar-close:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
  #navigation-search { font-size: 16px; }
  .site-sidebar { display: none; width: min(320px,100%); box-shadow: 8px 0 24px rgb(0 0 0 / .12); }
  .site-sidebar[data-open] { display: block; }
  /* With JS unavailable, show ordinary in-flow navigation instead. */
  html:not([data-navigation-ready]) .site-sidebar { display: block; position: static; width: auto; margin-top: var(--header-height); }
  html:not([data-navigation-ready]) .page-content { margin-top: 0; }
  .page-content { margin-left: 0; padding-inline: 22px; }
  .page-content .hero { padding-top: 44px; }
  .page-content h1 { font-size: clamp(44px, 10vw, 62px); }
  .theme-toggle-label { display: none; }
}
