/* App shell styles. Tokens match the hub (wizetool.com) so every tool feels like one product. */
:root {
  --ink: #101828; --text: #344054; --muted: #667085; --line: #e4e7ec; --soft: #f7f8fc;
  --brand: #5b4dfe; --brand-dark: #4538e0; --tint: #efedff;
  --ok: #067647; --ok-bg: #ecfdf3; --warn: #93370d; --warn-bg: #fef0c7; --bad: #b42318; --bad-bg: #fee4e2;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bar: 44px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--text); background: var(--soft); }
a { color: var(--brand); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { color: var(--ink); letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
kbd { font: inherit; font-size: .85em; background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; }

/* ---- network bar ---- */
.netbar { height: var(--bar); display: flex; align-items: center; gap: 20px; padding: 0 16px; background: var(--ink); color: #d0d5dd; font-size: .9rem; }
.netbar a { color: #d0d5dd; text-decoration: none; }
.netbar a:hover { color: #fff; }
.netbar-logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 750; color: #fff !important; }
.netbar-back { background: #fff; color: var(--ink) !important; font-weight: 650; padding: 5px 12px; border-radius: 999px; }
.netbar-back:hover { background: var(--tint); }
.netbar-help { margin-left: auto; }

/* ---- single-screen workspace ---- */
.app { display: grid; grid-template-columns: 340px minmax(0, 1fr) 400px; height: calc(100vh - var(--bar)); height: calc(100dvh - var(--bar)); min-height: 560px; transition: grid-template-columns .25s ease; position: relative; overflow: hidden; }
.app.slide-out { grid-template-columns: 340px minmax(0, 1fr) 0; }
.sidebar, .workspace, .assistant { min-height: 0; }
.assistant { transition: transform .25s ease; }
.app.slide-out .assistant { position: absolute; right: 0; top: 0; bottom: 0; width: min(360px, 30vw); transform: translateX(105%); box-shadow: -8px 0 32px -12px rgba(16, 24, 40, .25); z-index: 10; }
.app.slide-out .assistant.visible { transform: translateX(0); }
.assistant-pin-btn { margin-left: auto; border: 1px solid var(--line); background: var(--soft); color: var(--muted); cursor: pointer; line-height: 1; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; transition: background .15s, color .15s, border-color .15s; }
.assistant-pin-btn:hover { background: var(--tint); color: var(--brand); border-color: var(--brand); }
.assistant-tab { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 32px; height: 56px; background: var(--brand); color: #fff; border: 0; border-radius: 8px 0 0 8px; cursor: pointer; display: none; align-items: center; justify-content: center; z-index: 11; font-size: 1.1rem; box-shadow: -4px 0 12px -2px rgba(0,0,0,.2); }
.app.slide-out .assistant-tab { display: flex; }
.app.slide-out .assistant.visible ~ .assistant-tab { display: none; }
.sidebar h1 { font-size: 1.5rem; }
.sub { margin: 6px 0 18px; color: var(--muted); font-size: .95rem; }
label { display: block; margin: 14px 0 6px; font-weight: 650; color: var(--ink); font-size: .92rem; }
.opt { font-weight: 500; color: var(--muted); }
input[type="text"], select, textarea { width: 100%; font: inherit; font-size: .95rem; color: var(--ink); padding: 10px 12px; background: #fff; border: 1px solid #cfd4dc; border-radius: 10px; }
textarea { resize: vertical; min-height: 180px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
.counter { margin-top: 6px; color: var(--muted); font-size: .85rem; text-align: right; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn { font: inherit; font-weight: 650; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--brand); color: #fff; flex: 1; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; color: var(--ink); border-color: #cfd4dc; }
.btn-ghost:hover { border-color: var(--ink); }
.privacy { margin: 14px 0 0; color: var(--muted); font-size: .85rem; }

/* single minimal ad: fixed height, pinned to bottom of sidebar, never overlays controls */
.ad-slot { margin-top: auto; padding-top: 20px; }
.ad-slot[hidden] { display: none; }
.ad-label { display: block; font-size: .7rem; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.ad-box { height: 250px; overflow: hidden; }

/* ---- results ---- */
.workspace { overflow-y: auto; padding: 28px clamp(16px, 3vw, 40px) 40px; }
.empty { max-width: 560px; margin: 8vh auto 0; text-align: center; }
.empty h2 { font-size: 1.4rem; margin-bottom: 8px; }
#results[hidden], .empty[hidden] { display: none; }
.summary { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.2rem; font-weight: 800; color: var(--ink); }
.summary h2 { font-size: 1.5rem; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pill { font-size: .82rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.pill-pass { background: var(--ok-bg); color: var(--ok); }
.pill-partial { background: var(--warn-bg); color: var(--warn); }
.pill-fail { background: var(--bad-bg); color: var(--bad); }
.stats { margin: 10px 0 0; color: var(--muted); font-size: .9rem; }

.panel { margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.panel h3 { font-size: 1.1rem; margin-bottom: 10px; }
.fixes { margin: 0; padding-left: 1.2em; }
.fixes li { margin-bottom: 10px; }
.fixes strong { color: var(--ink); }
.group { margin-top: 22px; }
.group > h3 { font-size: .95rem; color: var(--muted); font-weight: 650; margin-bottom: 8px; }
.check { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; }
.dot { width: 18px; height: 18px; border-radius: 50%; margin-top: 3px; }
.dot-pass { background: #12b76a; } .dot-partial { background: #f79009; } .dot-fail { background: #f04438; }
.check h4 { margin: 0; font-size: 1rem; color: var(--ink); }
.check p { margin: 2px 0 0; font-size: .92rem; }
.check .tip { color: var(--text); margin-top: 6px; }
.check .tip b { color: var(--ink); }
.pts { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.disclaimer { margin-top: 20px; color: var(--muted); font-size: .88rem; }
.report-actions { display: flex; gap: 8px; margin-top: 16px; }

/* ---- crawlable text below the app ---- */
.about { background: #fff; border-top: 1px solid var(--line); padding: 40px 20px 56px; }
.about-inner { max-width: 760px; margin: 0 auto; }
.about h2 { font-size: 1.3rem; margin-bottom: 10px; }

@media (max-width: 1240px) {
  .app { grid-template-columns: 340px minmax(0, 1fr); height: auto; min-height: 0; }
  .sidebar, .workspace { max-height: none; }
  .assistant { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .app { display: block; height: auto; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .workspace { overflow: visible; }
  .netbar-help { display: none; }
  .check { grid-template-columns: 22px 1fr; }
  .pts { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---- additions: tabs, hints, errors, tech panels ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 4px; }
.tab { flex: 1; font: inherit; font-weight: 650; font-size: .92rem; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--text); cursor: pointer; }
.tab.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.12); }
.hint { margin: 6px 0 0; color: var(--muted); font-size: .85rem; }
[hidden] { display: none !important; }
.error { max-width: 640px; margin: 8vh auto 0; padding: 18px 20px; background: var(--bad-bg); border: 1px solid #fda29b; color: #7a271a; border-radius: 12px; }
.error strong { display: block; margin-bottom: 4px; color: var(--bad); }
.noscript { padding: 20px; text-align: center; }
.btn-sm { padding: 7px 12px; font-size: .88rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.tag { display: inline-block; font-size: .75rem; font-weight: 650; padding: 2px 10px; border-radius: 999px; background: var(--tint); color: var(--brand-dark); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.fact { background: var(--soft); border-radius: 10px; padding: 10px 12px; }
.fact b { display: block; color: var(--ink); font-size: 1.05rem; }
.fact span { color: var(--muted); font-size: .82rem; }
.bots { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 8px; }
.bots th, .bots td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.bots th { color: var(--muted); font-weight: 650; font-size: .8rem; }
.pill-note { background: var(--soft); color: var(--muted); }
.url-line { word-break: break-all; color: var(--muted); font-size: .88rem; margin: 6px 0 0; }

/* ---- assistant ---- */
.assistant { background: #fff; border-left: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; height: 100%; min-height: 0; }
.assistant-head { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.assistant h2 { font-size: 1.2rem; }
.badge { font-size: .72rem; font-weight: 800; color: #fff; background: var(--brand); border-radius: 6px; padding: 2px 7px; }
.assistant-note { margin: 0; color: var(--muted); font-size: .9rem; flex-shrink: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; flex-shrink: 0; }
.fixbox { border: 1px solid var(--brand); border-radius: 12px; padding: 14px; background: var(--tint); flex-shrink: 0; }
.fixbox-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.fixbox h3 { font-size: 1rem; }
.fixbox textarea { width: 100%; font: .82rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #fff; border: 1px solid #cfd4dc; border-radius: 8px; padding: 10px; resize: vertical; min-height: 160px; }
.fixbox .row { margin-top: 10px; }
.chat { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 120px; overflow-y: auto; padding-right: 4px; }
.msg { padding: 10px 12px; border-radius: 12px; font-size: .93rem; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
.msg p { margin: 0 0 .6em; } .msg p:last-child { margin: 0; }
.msg ul { margin: 0 0 .6em; padding-left: 1.2em; }
.msg-user { align-self: flex-end; background: var(--ink); color: #fff; max-width: 88%; }
.msg-ai { align-self: stretch; background: var(--soft); border: 1px solid var(--line); }
.msg-err { align-self: stretch; background: var(--bad-bg); color: #7a271a; }
.msg pre { margin: 8px 0; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: auto; font-size: .8rem; white-space: pre-wrap; }
.msg code { font-size: .88em; }
.msg .copy-code { font: inherit; font-size: .78rem; font-weight: 650; padding: 3px 9px; border: 1px solid #cfd4dc; background: #fff; border-radius: 6px; cursor: pointer; }
.typing { color: var(--muted); font-style: italic; }
.chat-form { display: flex; gap: 8px; align-items: stretch; flex-shrink: 0; padding-top: 4px; border-top: 1px solid var(--line); margin-top: auto; }
.chat-form textarea { flex: 1 1 auto; font: inherit; font-size: .93rem; padding: 9px 11px; border: 1px solid #cfd4dc; border-radius: 10px; resize: none; line-height: 1.5; min-height: 40px; max-height: 100px; overflow-y: auto; }
.chat-form button { align-self: stretch; min-height: 40px; }
.assistant-foot { margin: 0; color: var(--muted); font-size: .78rem; flex-shrink: 0; }

/* ---- SEO additions: snippet preview, terms ---- */
.serp { max-width: 600px; padding: 4px 0; font-family: Arial, Helvetica, sans-serif; }
.serp-url { color: #202124; font-size: .82rem; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp-title { color: #1a0dab; font-size: 1.25rem; line-height: 1.3; margin: 2px 0; }
.serp-desc { color: #4d5156; font-size: .88rem; line-height: 1.58; }
.terms { display: flex; flex-wrap: wrap; gap: 8px; }
.term { background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: .88rem; }
.term b { color: var(--muted); font-weight: 650; margin-left: 4px; }
.term-hit { background: var(--ok-bg); border-color: #a6f4c5; color: var(--ok); }
