/* vertoKit — tools hub & generic tool page styles (reuses styles.css variables) */

/* Hero for hub */
.hub-hero { padding: 54px 0 34px; background: linear-gradient(180deg, #f5f8fc 0%, #ffffff 100%); border-bottom: 1px solid var(--line); }
.hub-hero .eyebrow { display: inline-block; padding: 5px 13px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); font-size: .78rem; font-weight: 800; letter-spacing: .08em; margin-bottom: 16px; }
.hub-hero h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); line-height: 1.18; margin: 0 0 14px; font-weight: 800; letter-spacing: -.03em; }
.hub-hero h1 em { color: var(--brand); font-style: normal; }
.hub-hero .lede { color: var(--muted); font-size: 1.06rem; max-width: 700px; margin: 0 0 22px; }
.hub-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.hub-stats .stat-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; background: #fff; border: 1px solid var(--line); border-radius: 24px; font-size: .86rem; font-weight: 700; color: var(--muted); box-shadow: var(--shadow); }
.hub-stats .stat-pill b { color: var(--brand); font-size: 1rem; }

/* Search + filters */
.tool-controls { background: #fff; padding: 16px 0; border-bottom: 1px solid var(--line); }
.search-wrap { position: relative; max-width: 560px; margin: 0 auto 10px; }
.search-wrap svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); }
.search-wrap input { width: 100%; padding: 12px 132px 12px 46px; border: 1px solid #d9e2ee; border-radius: 11px; font-size: .98rem; box-shadow: 0 1px 3px rgba(20,22,28,.05); }
.search-wrap input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(42,91,156,.12); }
.search-go { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); padding: 8px 14px; background: var(--brand-soft); color: var(--brand); font-size: .9rem; font-weight: 700; border-radius: 7px; pointer-events: none; user-select: none; }
.search-hint { text-align: center; color: var(--muted); font-size: .82rem; margin: 0 0 4px; }
.search-hint strong { color: var(--text); font-weight: 700; }
@media (max-width: 640px) {
  .search-wrap input { padding-right: 16px; }
  .search-go { display: none; }
}
.cat-filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.cat-chip { padding: 7px 15px; border-radius: 20px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-weight: 700; font-size: .84rem; cursor: pointer; transition: .15s; }

/* Featured tool card — sits below the search box and above the category grid,
   so the featured area is reached on its own rather than mixed into the tool list. */
.featured-card { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; background: linear-gradient(135deg, #f5f8fc 0%, #fff 68%); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 28px; margin: 0 0 34px; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.featured-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(31,45,68,.12); text-decoration: none; }
.featured-card__kicker { display: inline-block; padding: 4px 12px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.featured-card__copy strong { display: block; font-size: 1.24rem; font-weight: 800; letter-spacing: -.01em; margin-bottom: 6px; }
.featured-card__copy p { color: var(--muted); font-size: .93rem; margin: 0 0 14px; max-width: 620px; }
.featured-card__btn { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; font-weight: 700; font-size: .9rem; padding: 9px 18px; border-radius: 22px; }
.featured-card__art { width: 168px; height: 168px; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 6px 16px rgba(31,45,68,.1); }
.cat-chip:hover { border-color: var(--brand); color: var(--brand); }
.cat-chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Category sections + tool cards */
.cat-block { margin: 40px 0; scroll-margin-top: calc(var(--header-h) + 74px); }
.cat-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.cat-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: 0 0 auto; }
.cat-ic svg { width: 24px; height: 24px; }
.cat-head h2 { font-size: 1.4rem; margin: 0; font-weight: 800; letter-spacing: -.02em; }
.cat-head p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tool-card { display: flex; flex-direction: column; gap: 0; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; color: var(--text); text-decoration: none; }
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand); text-decoration: none; color: var(--text); }
.tool-card .tc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.tool-card .tc-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; }
.tool-card .tc-ic svg { width: 21px; height: 21px; }
.tool-card h3 { font-size: 1rem; margin: 0; font-weight: 800; line-height: 1.3; }
.tool-card p { margin: 0; font-size: .85rem; color: var(--muted); line-height: 1.55; }
.tool-card .tc-arrow { margin-top: 12px; color: var(--brand); font-weight: 800; font-size: .82rem; }
.no-results { text-align: center; padding: 60px 20px; color: var(--muted); line-height: 2; }
.no-results b { color: var(--text); }
.suggest-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.suggest-chip { padding: 9px 16px; border: 1px solid var(--line); border-radius: 20px; background: #fff; color: var(--brand); font-weight: 700; font-size: .85rem; cursor: pointer; transition: .15s; }
.suggest-chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.result-body[aria-live] .rplaceholder { min-height: 290px; }

/* Tool detail page */
.breadcrumb { font-size: .84rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.detail-hero { padding: 34px 0 22px; }
.detail-hero .dh-top { display: flex; align-items: flex-start; gap: 18px; }
.detail-hero .dh-ic { width: 66px; height: 66px; border-radius: 18px; display: grid; place-items: center; flex: 0 0 auto; }
.detail-hero .dh-ic svg { width: 33px; height: 33px; }
.detail-hero h1 { font-size: clamp(1.6rem, 3.8vw, 2.3rem); margin: 0 0 6px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.detail-hero .tagline { color: var(--muted); font-size: 1.04rem; margin: 0; max-width: 720px; }
.detail-hero .dh-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.detail-hero .dh-meta span { font-size: .76rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 16px; padding: 4px 12px; }

.workbench { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 22px; align-items: start; padding: 6px 0 10px; }
.wb-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.wb-panel > h3 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 800; }
.wb-panel > .wb-sub { margin: 0 0 18px; color: var(--muted); font-size: .85rem; }
.wb-field { margin-bottom: 16px; }
.wb-field > label { display: block; font-size: .84rem; font-weight: 800; margin-bottom: 6px; color: var(--text); }
.wb-field .hint { font-size: .78rem; color: var(--muted); margin: 5px 0 0; }
.wb-field textarea { min-height: 120px; resize: vertical; }
.wb-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.wb-actions .btn { flex: 1 1 auto; }
.result-panel { min-height: 460px; }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.result-head h3 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.result-body { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 18px; min-height: 330px; overflow: auto; }
.result-body pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; line-height: 1.7; color: var(--text); }
.result-body .rplaceholder { display: grid; place-items: center; min-height: 290px; color: var(--muted); text-align: center; }
.result-empty-ic { width: 58px; height: 58px; color: var(--line); margin-bottom: 10px; }
.result-note { font-size: .84rem; color: var(--ok); font-weight: 700; min-height: 1.2em; margin-top: 10px; }
.result-note.err { color: var(--danger); }
.status-tip { font-size: .8rem; color: var(--muted); margin-top: 12px; padding: 10px 12px; background: var(--surface); border-radius: 10px; border: 1px dashed var(--line); }

/* Result-specific widgets */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.stat-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.stat-box .sb-num { font-size: 1.7rem; font-weight: 800; color: var(--brand); line-height: 1.1; }
.stat-box .sb-label { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.color-swatch-lg { width: 100%; height: 90px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 12px; }
.result-table { width: 100%; border-collapse: collapse; font-size: .86rem; background: #fff; }
.result-table th, .result-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.result-table th { background: var(--surface); font-weight: 800; color: var(--muted); }
.canvas-holder { display: grid; place-items: center; }
.canvas-holder canvas, .canvas-holder img { max-width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.qr-holder { display: grid; place-items: center; padding: 16px; }
.diff-add { background: #e6f6ee; color: #0a6b47; }
.diff-del { background: #fdeaea; color: #a3232f; text-decoration: line-through; }
.progress-line { height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin: 8px 0; }
.progress-line > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--amber)); }

/* Human-centred intro under the detail hero */
.dh-intro { color: var(--muted); font-size: 1.02rem; line-height: 1.75; max-width: 760px; margin: 22px 0 0; padding-left: 16px; border-left: 3px solid var(--brand); }

/* Deep content sections on detail page */
.deep { padding: 20px 0 60px; }
.deep-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 30px; margin-bottom: 20px; box-shadow: var(--shadow); }
.deep-card h2 { font-size: 1.35rem; margin: 0 0 6px; font-weight: 800; letter-spacing: -.01em; }
.deep-card > p.lead { color: var(--muted); margin: 0 0 22px; }
.hows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.how-step { position: relative; }
.how-step .hn { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; margin-bottom: 12px; }
.how-step h3 { font-size: 1rem; margin: 0 0 6px; font-weight: 800; }
.how-step p { margin: 0; font-size: .88rem; color: var(--muted); }
.uses-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.use-item { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: #34303a; }
.use-item svg { width: 20px; height: 20px; color: var(--mint); flex: 0 0 auto; margin-top: 2px; }
.tip-box { background: #eaf6f2; border-left: 3px solid var(--mint); border-radius: 10px; padding: 16px 20px; font-size: .93rem; color: #1c5b4c; }

/* "Where it fits" — honest helps / limits two-column block */
.fit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.fit-col { border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.fit-col.good { background: #f1faf5; border-color: #bfe6d0; }
.fit-col.bad { background: #fff8f4; border-color: #f3d6c4; }
.fit-col h3 { display: flex; align-items: center; gap: 10px; font-size: 1.02rem; margin: 0 0 14px; font-weight: 800; }
.fit-col.good h3 { color: #1c6b4a; }
.fit-col.bad h3 { color: #9a4a20; }
.fit-mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 1rem; font-weight: 800; flex: 0 0 auto; }
.fit-col.good .fit-mark { background: #d5f0e0; color: #1c6b4a; }
.fit-col.bad .fit-mark { background: #fbe2d2; color: #9a4a20; }
.fit-col ul { list-style: none; margin: 0; padding: 0; }
.fit-col li { position: relative; padding: 8px 0 8px 22px; font-size: .9rem; line-height: 1.6; color: #3a363f; border-top: 1px solid rgba(0,0,0,.05); }
.fit-col li:first-child { border-top: 0; }
.fit-col.good li:before { content: "✓"; position: absolute; left: 0; color: #2f9e6b; font-weight: 800; }
.fit-col.bad li:before { content: "×"; position: absolute; left: 0; color: #d4763c; font-weight: 800; font-size: 1.05rem; }
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.rel-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); transition: .15s; }
.rel-card:hover { border-color: var(--brand); box-shadow: var(--shadow); text-decoration: none; color: var(--text); }
.rel-card .rc-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.rel-card .rc-ic svg { width: 19px; height: 19px; }
.rel-card b { font-size: .9rem; }
.rel-card span { display: block; font-size: .76rem; color: var(--muted); }

/* --- Photo generator + manual designer on one page ---------------------- */

/* Grid children must be allowed to shrink: wide tables and sliders then
   scroll inside their own box instead of pushing the page sideways. */
.studio-grid > * { min-width: 0; }
#paneManual .designer-layout > * { min-width: 0; }

/* Mode switch: one page, two ways to build a chart. */
.mode-switch { display: inline-flex; gap: 4px; padding: 5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; margin: 0 0 20px; }
.mode-switch button { padding: 9px 22px; border: 0; border-radius: 999px; background: transparent; font-family: inherit; font-weight: 700; font-size: .9rem; color: var(--muted); cursor: pointer; transition: .15s; }
.mode-switch button:hover { color: var(--brand); }
.mode-switch button.on { background: #fff; color: var(--brand); box-shadow: var(--shadow); }

/* Panes must really disappear: .studio-grid / .designer-layout set display,
   which would otherwise beat the default [hidden] rule. */
.pane[hidden] { display: none !important; }

/* Left control column: stays put below the sticky header and scrolls on its
   own, so the preview never scrolls away while tuning settings. */
.work-side {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}
.work-side::-webkit-scrollbar { width: 8px; }
.work-side::-webkit-scrollbar-thumb { background: #d8d2c9; border-radius: 8px; }
.work-side::-webkit-scrollbar-thumb:hover { background: var(--brand); }

/* Slider + exact number on one row. */
.range-row { display: grid; grid-template-columns: minmax(0, 1fr) 74px; gap: 10px; align-items: center; }
.range-row input[type="number"] { padding: 8px 8px; text-align: center; font-size: .9rem; }

/* The chart preview shows the whole pattern: no inner scrollbar. */
.preview-panel .chart-scroll { overflow: visible; max-height: none; }

/* Manual pane reuses the designer three-column layout inside the page flow. */
#paneManual .designer-layout { margin-bottom: 8px; }
#paneManual .ds-canvas-wrap { overflow: visible; max-height: none; }

@media (max-width: 900px) {
  .work-side { position: static; max-height: none; overflow-y: visible; padding-right: 0; }
  .mode-switch { display: flex; width: 100%; }
  .mode-switch button { flex: 1 1 0; padding: 9px 10px; }
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .hows { grid-template-columns: minmax(0, 1fr); }
  .uses-list { grid-template-columns: minmax(0, 1fr); }
  .tool-controls { padding: 12px 0; }
}
@media (max-width: 560px) {
  .tool-grid { grid-template-columns: 1fr; }
  .detail-hero .dh-top { gap: 12px; }
  .detail-hero .dh-ic { width: 52px; height: 52px; }
  .detail-hero .dh-ic svg { width: 26px; height: 26px; }
  .deep-card { padding: 20px 18px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .fit-grid { grid-template-columns: 1fr; }
  .dh-intro { font-size: .95rem; }

  /* Category filters become a horizontally scrollable nav that stays sticky with the search box. */
  .cat-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    gap: 8px;
    padding: 2px 16px 8px;
    margin: 0 -16px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
  }
  .cat-filters::-webkit-scrollbar { display: none; } /* Chrome / Safari */
  .cat-filters .cat-chip {
    flex: 0 0 auto;
    white-space: nowrap;
    scroll-snap-align: center;
  }
}
