/* Everyday tools hub. Site type: mono text, serif display headings. Shell tokens, so both themes follow. */
#tool {
  --soft: color-mix(in srgb, var(--ink) 6%, transparent);
  --edge: color-mix(in srgb, var(--ink) 13%, transparent);
  --edge-hi: color-mix(in srgb, var(--ink) 36%, transparent);
  --card-r: 12px;
}
#tool :is(a, summary, button):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.zt-hub-intro h1 { font-size: clamp(2.5rem, 1.5rem + 3.4vw, 4.4rem); }
#tool .zt-hub-intro .zt-sub { margin: 14px 0 0; max-width: 60ch; color: var(--dim); font: 0.92rem/1.6 var(--font-ui); }
.zt-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 18px 0 0; padding: 0; list-style: none; font-size: 0.78rem; }
.zt-facts li { display: flex; align-items: center; gap: 8px; }
.zt-facts li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--go-text); }
.zt-hub-body { margin-top: 28px; }
.zt-hub-main { min-height: 70vh; }

/* Search */
.zt-searchbox {
  display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px;
  border: 1px solid var(--edge-hi); border-radius: var(--card-r); background: var(--panel); color: var(--ink);
  cursor: text; transition: border-color var(--t-fast);
}
.zt-searchbox:hover { border-color: var(--ink); }
.zt-searchbox:focus-within { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 2px; }
.zt-searchbox .zt-icon, .zt-searchbox kbd { flex: none; color: var(--dim); }
.zt-searchbox input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: inherit; font: 0.92rem var(--font-ui); text-overflow: ellipsis; }
.zt-searchbox input::placeholder { color: var(--dim); opacity: 1; }
#search-results { margin-bottom: 32px; }
#search-results p { margin-bottom: 14px; }
.zt-keys { display: none; }

/* Categories: sticky chip bar in the gutter (fades, snap); a side rail from 1100px. */
.zt-hub-bar {
  position: sticky; top: 0; z-index: 6; margin: 0 calc(-1 * var(--gutter)) 20px; padding: 8px var(--gutter) 0;
  background: var(--bg); border-bottom: 1px solid transparent;
}
.zt-hub-bar.is-stuck { border-bottom-color: var(--line); }
.zt-chips {
  display: flex; gap: 6px; margin: 8px -3px 0; padding: 3px 3px 10px;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  scroll-snap-type: x proximity; scroll-padding-inline: 3px;
  --fade-l: 0px; --fade-r: 36px;
  mask-image: linear-gradient(90deg, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
}
.zt-chips::-webkit-scrollbar { display: none; }
.zt-chips[data-scroll='middle'] { --fade-l: 36px; }
.zt-chips[data-scroll='end'] { --fade-l: 36px; --fade-r: 0px; }
.zt-chips[data-scroll='none'] { --fade-r: 0px; }
.zt-chips a {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; scroll-snap-align: start;
  border: 1px solid var(--edge); border-radius: 999px; color: var(--dim); font-size: 0.8rem;
  text-decoration: none; white-space: nowrap; transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}
.zt-chips b { font-weight: 500; font-size: 0.7rem; opacity: 0.75; }
.zt-chips a:hover { color: var(--ink); border-color: var(--edge-hi); }
.zt-chips a[aria-current='true'] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.zt-chips a[data-here] { border-color: var(--edge-hi); }
#tool section[id] { scroll-margin-top: 128px; }
@media (min-width: 1100px) {
  .zt-hub-body { display: grid; grid-template-columns: 216px minmax(0, 1fr); column-gap: 48px; }
  .zt-hub-bar { display: contents; }
  .zt-searchbox { grid-column: 1 / -1; margin-bottom: 10px; }
  .zt-keys { grid-column: 1 / -1; display: flex; gap: 20px; margin: 0 2px 28px; color: var(--dim); font-size: 0.72rem; }
  .zt-keys span { display: flex; align-items: center; gap: 6px; }
  .zt-keys kbd { margin: 0; }
  .zt-chips {
    grid-column: 1; position: sticky; top: 20px; align-self: start; flex-direction: column; gap: 2px;
    max-height: calc(100vh - 40px); margin: 0 -3px; padding: 3px; overflow: hidden auto; scrollbar-width: thin;
    mask-image: none;
  }
  .zt-chips::before {
    content: 'Categories'; padding: 0 12px 12px; color: var(--dim); font: 600 0.74rem/1.5 var(--font-ui); letter-spacing: 0.12em; text-transform: uppercase;
  }
  .zt-chips a { justify-content: space-between; flex: none; min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; white-space: normal; line-height: 1.3; }
  .zt-chips a:hover { background: var(--soft); }
  .zt-chips a[aria-current='true'] { background: var(--soft); color: var(--ink); }
  .zt-chips a[data-here] { color: var(--ink); box-shadow: inset 2px 0 0 var(--go-text); }
  .zt-hub-main { grid-column: 2; min-width: 0; }
  #tool section[id] { scroll-margin-top: 20px; }
  .zt-hub-intro { display: grid; grid-template-columns: minmax(0, 1fr) 320px; column-gap: 48px; align-items: end; }
  .zt-hub-intro > * { grid-column: 1; }
  .zt-hero-art { display: block; grid-column: 2; grid-row: 1 / span 3; width: 320px; height: 190px; color: var(--dim); }
}

/* Sections of the main column */
#tool .zt-hub-main > section { margin: 0 0 44px; }
#tool .zt-hub-section > h2, #recent h2 { margin: 0 0 14px; color: var(--dim); font: 600 0.74rem/1.5 var(--font-ui); letter-spacing: 0.12em; }
#tool .zt-count { margin-left: 0.8em; font-weight: 400; letter-spacing: 0.04em; }
#tool .zt-hub-main strong { font: 600 0.86rem/1.35 var(--font-ui); text-decoration: none; overflow-wrap: anywhere; }
.zt-cats small, .zt-index-row small {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  color: var(--dim); font: 0.74rem/1.5 var(--font-ui);
}

/* Shared card surface and glyph chips */
.zt-cats > a, .zt-index-row, #popular .zt-card {
  border: 1px solid var(--edge); border-radius: var(--card-r); background: var(--panel); color: var(--ink);
  transition: border-color var(--t-fast);
}
.zt-cats > a:hover, .zt-index-row:hover, #popular .zt-card:hover { border-color: var(--edge-hi); background: var(--panel); }
.zt-index-row > a > .zt-icon, #popular .zt-card > .zt-icon {
  width: 36px; height: 36px; margin: 0; padding: 8px; border-radius: 9px; background: var(--soft); color: var(--ink);
  transition: background-color var(--t-fast), color var(--t-fast);
}
.zt-index-row > a:hover > .zt-icon, #popular .zt-card:hover > .zt-icon { background: var(--go-tint); color: var(--go-text); }

/* Newest batch: one full-width strip above the tiles. */
#browse .zt-newnav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: 0 0 32px; padding: 12px 16px; border: 1px solid var(--edge); border-radius: var(--card-r); }
#browse .zt-newnav-head { flex: 1 1 260px; justify-content: start; align-items: baseline; gap: 2px 16px; margin: 0; }
#browse .zt-newnav h2 { display: block; color: var(--ink); font: 500 0.78rem/1.5 var(--font-ui); letter-spacing: 0; text-transform: none; }
#browse .zt-newnav-dot { display: inline-block; margin-right: 8px; vertical-align: 1px; box-shadow: none; }
#browse .zt-newnav ul { display: flex; flex-wrap: wrap; gap: 6px; }
#browse .zt-newnav li a { min-height: 34px; padding: 0 12px; border-color: var(--edge); border-radius: 99px; font-size: 0.74rem; }
#browse .zt-newnav li a:hover { border-color: var(--edge-hi); }

/* Category tiles: outline cards, open line art; subgrid levels names and examples across a row. */
.zt-cats, #popular .zt-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.zt-cats > a {
  display: grid; grid-row: span 3; grid-template-rows: subgrid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: start; gap: 8px 10px; padding: 14px 16px 16px; text-decoration: none;
}
.zt-cats > a > .zt-art { grid-column: 1 / -1; width: 84px; height: 49px; margin: -2px 0 2px -8px; color: var(--dim); transition: color var(--t-fast); }
.zt-cats > a:hover > .zt-art { color: var(--ink); }
.zt-cats > a:hover strong { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.zt-cats small { grid-column: 1 / -1; }
.zt-cats b, .zt-index .zt-category-count {
  padding: 1px 8px; border-radius: 99px; background: var(--soft); color: var(--dim); font: 500 0.7rem/1.5 var(--font-ui);
}
.zt-art { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.af { fill: var(--soft); }
.ab { fill: var(--bg); }
.ag { stroke: var(--go-text); }
.ap { fill: currentColor; stroke: none; }
.zt-hero-art { display: none; }

/* Popular */
#popular .zt-card {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; align-content: center; gap: 1px 12px;
  min-height: 64px; padding: 12px 14px;
}
#popular .zt-card > .zt-icon { grid-row: span 2; }
#popular .zt-card small { display: none; }
#popular .zt-tag { margin: 0; color: var(--dim); font-size: 0.64rem; }

/* Category sections and tool cards */
.zt-index { display: grid; grid-template-columns: minmax(0, 1fr); gap: 52px; }
.zt-index > section { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; align-items: center; }
.zt-index > section > .zt-icon {
  width: 44px; height: 44px; padding: 10px; border-radius: 11px; background: var(--go-tint); color: var(--go-text);
}
.zt-index > section > h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0; font-size: clamp(1.7rem, 1.4rem + 1vw, 2.2rem); }
.zt-index h2 a { text-decoration: none; }
.zt-index h2 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.zt-index > section > p { grid-column: 2; margin: 4px 0 0; color: var(--dim); font: 0.78rem/1.5 var(--font-ui); }
.zt-index-grid, .zt-more { grid-column: 1 / -1; }
.zt-index-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.zt-more > .zt-index-grid { margin-top: 10px; }
.zt-index-row { position: relative; display: flex; flex-direction: column; min-width: 0; }
.zt-index-row > a {
  flex: 1; display: grid; grid-template-columns: 36px minmax(0, 1fr); align-content: start; gap: 4px 12px;
  min-height: 84px; padding: 14px 40px 14px 14px; border-radius: inherit; text-decoration: none;
}
.zt-index-row > a > .zt-icon { grid-row: span 2; }
.zt-index-row small { grid-column: 2; }
.zt-twins { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 14px 14px 62px; }
.zt-twins-lab { margin-right: 4px; color: var(--dim); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }
.zt-twins a {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border: 1px solid var(--edge);
  border-radius: 99px; color: var(--dim); font-size: 0.74rem; text-decoration: none;
}
.zt-twins a:hover { border-color: var(--edge-hi); color: var(--ink); }
/* "All N tools": a full-width control with the hidden count and a chevron. */
.zt-more summary {
  display: flex; align-items: center; gap: 10px; min-height: 48px; margin-top: 10px; padding: 0 16px;
  border: 1px solid var(--edge-hi); border-radius: var(--card-r); background: var(--soft); font-size: 0.8rem; font-weight: 600; cursor: pointer; list-style: none;
}
.zt-more summary::-webkit-details-marker { display: none; }
.zt-more summary span { flex: 1; }
.zt-more summary b { padding: 1px 8px; border-radius: 99px; background: var(--panel); color: var(--dim); font-weight: 500; font-size: 0.7rem; }
.zt-more summary::after {
  content: ''; width: 7px; height: 7px; margin: -4px 2px 0 4px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.zt-more[open] summary::after { margin-top: 3px; transform: rotate(-135deg); }
.zt-more[open] summary b { display: none; }
.zt-more summary:hover { border-color: var(--ink); }
@media (min-width: 621px) {
  .zt-more[open] > summary { display: none; }
}
@media (min-width: 900px) {
  /* Many sibling pages (the timers): full row, card left, siblings right. */
  .zt-index-row:has(.zt-twins a:nth-of-type(4)) { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .zt-index-row:has(.zt-twins a:nth-of-type(4)) > a { flex: 0 0 calc((100% - 20px) / 3); }
  .zt-index-row:has(.zt-twins a:nth-of-type(4)) .zt-twins { padding: 12px 14px; }
}

/* Pins, recent, pinned and the file finder; lists reserve their height. */
.zt-pin {
  position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent;
  color: var(--dim); font-size: 0.95rem; line-height: 1; cursor: pointer; opacity: 0; transition: opacity var(--t-fast), color var(--t-fast);
}
.zt-index-row:hover .zt-pin, .zt-pin:focus-visible, .zt-pin[aria-pressed='true'] { opacity: 1; }
.zt-pin:hover { background: var(--soft); color: var(--ink); }
.zt-pin[aria-pressed='true'] { color: var(--go-text); }
@media (hover: none) {
  .zt-pin { opacity: 0.55; }
}
#recent, #pinned { min-height: 72px; }
.zt-recent { display: flex; flex-wrap: wrap; gap: 6px; }
.zt-recent a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--edge);
  border-radius: 99px; font-size: 0.8rem; text-decoration: none;
}
.zt-recent a:hover { border-color: var(--edge-hi); }
#tool #hub-file {
  min-height: 56px; margin: 0 0 32px; padding: 6px 16px; border: 1px dashed var(--edge-hi); border-radius: var(--card-r);
  display: grid; align-content: center; font-size: 0.8rem;
}
#tool #hub-file[hidden] { display: none; }
#tool .zt-hub-main:not(.is-live) > #hub-file[hidden] { display: grid; visibility: hidden; }
#hub-file strong { font-weight: 500; }

@media (max-width: 1099px) {
  .zt-searchbox { height: 52px; }
  .zt-cats, #popular .zt-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .zt-index-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .zt-hub-intro h1 { max-width: 12ch; }
  #tool .zt-hub-intro .zt-sub { font-size: 0.84rem; }
  .zt-facts { gap: 4px 16px; font-size: 0.72rem; }
  .zt-hub-body { margin-top: 18px; }
  .zt-searchbox { height: 48px; padding: 0 14px; }
  .zt-searchbox kbd { display: none; }
  .zt-searchbox input { font-size: 1rem; }
  .zt-hub-bar { margin-bottom: 14px; }
  #tool .zt-hub-main > section { margin-bottom: 34px; }
  #browse .zt-newnav { gap: 6px 16px; margin-bottom: 24px; padding: 10px 12px; }
  #browse .zt-newnav-head { flex-basis: 100%; }
  #browse .zt-newnav h2 { font-size: 0.74rem; }
  #browse .zt-newnav ul { display: none; }
  .zt-cats, #popular .zt-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .zt-cats > a { gap: 6px 8px; padding: 12px; }
  .zt-cats > a > .zt-art { width: 66px; height: 39px; margin-left: -6px; }
  .zt-cats small { font-size: 0.7rem; }
  #tool .zt-cats strong { font-size: 0.8rem; }
  #popular .zt-card { grid-template-columns: 30px minmax(0, 1fr); min-height: 56px; padding: 10px; gap: 0 10px; }
  #popular .zt-card > .zt-icon { width: 30px; height: 30px; padding: 6px; border-radius: 8px; }
  #tool #popular .zt-card strong { font-size: 0.78rem; }
  #popular .zt-tag { display: none; }
  .zt-index { gap: 40px; }
  .zt-index > section { grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; }
  .zt-index > section > .zt-icon { width: 40px; height: 40px; padding: 9px; }
  .zt-index > section > p { font-size: 0.74rem; }
  .zt-index-grid { grid-template-columns: minmax(0, 1fr); gap: 6px; margin-top: 14px; }
  .zt-more > .zt-index-grid { margin-top: 6px; }
  .zt-index-row > a { min-height: 60px; padding: 11px 40px 11px 12px; align-content: center; gap: 2px 12px; }
  .zt-index-row small { -webkit-line-clamp: 1; }
  .zt-twins { padding: 0 12px 12px 60px; }
}
@media (prefers-reduced-motion: reduce) {
  #tool * { transition: none; }
}
