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

/* Hero for hub */
.hub-hero { padding: 54px 0 34px; background: linear-gradient(180deg, #fdf7f0 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 { position: sticky; top: 66px; z-index: 40; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); padding: 16px 0; border-bottom: 1px solid var(--line); }
.search-wrap { position: relative; max-width: 560px; margin: 0 auto 14px; }
.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: 13px 16px 13px 46px; border: 1px solid var(--line); border-radius: 26px; font-size: .98rem; box-shadow: var(--shadow); }
.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; }
.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: 140px; }
.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); }
.no-results b { color: var(--text); }

/* 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 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); }
.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)); }

/* 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; }
.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); }

@media (max-width: 900px) {
  .workbench { grid-template-columns: 1fr; }
  .hows { grid-template-columns: 1fr; }
  .uses-list { grid-template-columns: 1fr; }
  /* Keep the search + category bar pinned directly below the 66px sticky header. */
  .tool-controls { top: 66px; 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); }

  /* 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;
  }
}
