/* Tool pages: builds on /style.css */
.tool-page { padding-top: 96px; }
.crumbs { color: var(--muted); display: flex; gap: 8px; align-items: center; margin-bottom: 22px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

.tool-hero { padding: clamp(32px, 6vw, 72px) var(--pad) clamp(28px, 4vw, 48px); max-width: 1280px; margin: 0 auto; }
.tool-hero h1 { font: 400 clamp(2.8rem, 7vw, 5.6rem)/0.98 var(--serif); letter-spacing: -0.02em; margin-bottom: 18px; }
.tool-hero h1 em { color: var(--accent); }
.tool-hero .lede { max-width: 720px; font-size: 1.12rem; color: var(--ink); margin-bottom: 28px; }
.tool-hero .lede strong { font-weight: 600; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.install {
  display: inline-flex; align-items: center; gap: 12px; max-width: 100%;
  background: var(--term); color: #e9e3d4; border-radius: 999px; padding: 8px 8px 8px 20px;
  font: 400 .88rem var(--mono); border: 1px solid #2a2822;
}
.install code { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.install code::-webkit-scrollbar { display: none; }
.install .pr { color: #7c7566; user-select: none; }
.install button {
  flex: none; border: 0; border-radius: 999px; padding: 7px 14px; cursor: pointer;
  background: #2a2822; color: #e9e3d4; font: 500 .75rem var(--mono); transition: background .2s;
}
.install button:hover { background: var(--accent); color: #fff; }
.links { display: flex; gap: 18px; flex-wrap: wrap; }
.links a { text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.links a:hover { border-color: var(--accent); color: var(--accent); }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.facts span { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; color: var(--muted); }

/* demo shell */
.demo-wrap { max-width: 1280px; margin: 0 auto; padding: 0 var(--pad) clamp(56px, 8vw, 96px); }
.demo-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.demo-head h2 { font: 400 clamp(1.8rem, 3.6vw, 2.6rem)/1.05 var(--serif); }
.live-pill { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.live-pill .dot { animation: pulse 2s infinite; }
.live-pill.off .dot { background: #a8a29e; animation: none; box-shadow: none; }
.demo { border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; }
.demo-grid { display: grid; grid-template-columns: 320px 1fr; min-height: 520px; }
.demo-side { border-right: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 18px; background: var(--paper); }
.demo-main { padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 900px) {
  .demo-grid { grid-template-columns: 1fr; }
  .demo-side { border-right: 0; border-bottom: 1px solid var(--line); }
}
.side-title { display: flex; justify-content: space-between; align-items: center; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* form controls */
.field { display: grid; gap: 6px; }
.field > span { font: 500 .72rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: flex; justify-content: space-between; }
.field input[type=text], .field input[type=url], .field input[type=number], .field select, .field textarea {
  width: 100%; font: 400 .92rem var(--sans); color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; outline: none; transition: border-color .2s;
}
.field textarea { font: 400 .8rem/1.5 var(--mono); resize: vertical; min-height: 220px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type=color] { width: 40px; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--card); cursor: pointer; flex: none; }
.color-row input[type=text] { font-family: var(--mono); text-transform: lowercase; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--paper); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatches button:hover { transform: scale(1.12); }
.small-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px;
  padding: 7px 14px; font: 500 .8rem var(--sans); cursor: pointer; transition: border-color .2s, color .2s;
}
.small-btn:hover { border-color: var(--accent); color: var(--accent); }
.small-btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; background: var(--card); flex-wrap: wrap; }
.seg button { border: 0; background: none; color: var(--muted); border-radius: 999px; padding: 6px 12px; font: 500 .8rem var(--sans); cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--paper); }

/* code & output */
.codebox { background: var(--term); color: #d6cfbf; border-radius: 10px; border: 1px solid #2a2822; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.codebox .term-bar { justify-content: space-between; }
.codebox pre { margin: 0; padding: 14px 16px; overflow: auto; font: 400 .78rem/1.6 var(--mono); max-height: 380px; white-space: pre; }
.codebox pre.wrap { white-space: pre-wrap; word-break: break-word; }
.codebox .k { color: #f97316; } .codebox .s { color: #a7f3d0; } .codebox .c { color: #7c7566; } .codebox .ok { color: #4ade80; } .codebox .err { color: #fb923c; }
.flash { animation: flash 1s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.note { color: var(--muted); font-size: .9rem; }
.note b { color: var(--ink); font-weight: 600; }
.err-text { color: #c2410c; }
@media (prefers-color-scheme: dark) { .err-text { color: #fb923c; } }

/* feature + quick start sections */
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.feat { background: var(--paper); padding: 26px 24px; }
.feat h3 { font: 400 1.5rem/1.15 var(--serif); margin-bottom: 8px; }
.feat p { color: var(--muted); font-size: .95rem; }
@media (max-width: 900px) { .feat-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .feat-grid { grid-template-columns: 1fr; } }
.steps-code { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .steps-code { grid-template-columns: 1fr; } }

.cta-band { max-width: 1280px; margin: 0 auto clamp(64px, 9vw, 110px); padding: clamp(28px, 4vw, 44px); border: 1px solid var(--line); border-radius: 14px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; background: var(--card); }
.cta-band h3 { font: 400 clamp(1.6rem, 3vw, 2.2rem)/1.1 var(--serif); max-width: 620px; }
.cta-wrap { padding: 0 var(--pad); }

/* tools index */
.tool-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .tool-cards { grid-template-columns: 1fr; } }
.tool-card {
  border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 26px; text-decoration: none;
  display: flex; flex-direction: column; gap: 14px; transition: border-color .25s, transform .25s; min-width: 0;
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.tool-card .tag { color: var(--accent); }
.tool-card h3 { font: 400 2rem/1.05 var(--serif); }
.tool-card p { color: var(--muted); flex: 1; }
.tool-card .mini { background: var(--term); color: #d6cfbf; border-radius: 8px; padding: 12px 14px; font: 400 .74rem/1.6 var(--mono); white-space: pre; overflow-x: auto; }
.tool-card .mini .k { color: #f97316; } .tool-card .mini .ok { color: #4ade80; } .tool-card .mini .c { color: #7c7566; }
.tool-card .go { display: flex; justify-content: space-between; color: var(--ink); }
