/* Public Tools Pages */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&family=Playfair+Display:wght@700&display=swap');

*, *::before, *::after { box-sizing: border-box; }

body { font-family: 'Montserrat', sans-serif; margin: 0; padding: 0; background: #f8fafc; color: #0f172a; }

/* Hero */
.tool-hero { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%); color: #fff; padding: 3rem 1.5rem 2.5rem; text-align: center; }
.tool-hero-badge { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; background: rgba(255,255,255,.15); border-radius: 14px; font-size: 1.4rem; margin-bottom: 1rem; }
.tool-hero h1 { margin: 0 0 .6rem; font-family: 'Playfair Display', serif; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.tool-hero p { margin: 0 auto; max-width: 560px; font-size: .95rem; opacity: .85; line-height: 1.65; }
.tool-breadcrumb { font-size: .78rem; opacity: .7; margin-bottom: .75rem; }
.tool-breadcrumb a { color: #fff; text-decoration: none; }
.tool-breadcrumb a:hover { text-decoration: underline; }

/* Main layout */
.tool-main { max-width: 820px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.tool-main-wide { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

/* Cards */
.t-card { background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 1.75rem; margin-bottom: 1.25rem; border: 1px solid #e2e8f0; }
.t-card h2 { margin: 0 0 1.25rem; font-size: 1rem; font-weight: 700; color: #0f172a; }

/* Form elements */
.t-label { display: block; font-size: .82rem; font-weight: 600; color: #374151; margin-bottom: .35rem; }
.t-label span { font-weight: 400; color: #9ca3af; }
.t-input { width: 100%; padding: .65rem .9rem; border: 1px solid #d1d5db; border-radius: 8px; font-size: .9rem; font-family: inherit; color: #111827; transition: border-color .15s, box-shadow .15s; }
.t-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
textarea.t-input { resize: vertical; min-height: 140px; }
.t-group { margin-bottom: 1.1rem; }
.t-group-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.t-group-row .t-input { flex: 1; min-width: 180px; }

/* Buttons */
.t-btn { display: inline-flex; align-items: center; gap: .5rem; background: #2563eb; color: #fff; border: none; padding: .7rem 1.75rem; border-radius: 9999px; font-size: .9rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: background .2s, box-shadow .2s; }
.t-btn:hover { background: #1d4ed8; box-shadow: 0 2px 8px rgba(37,99,235,.3); }
.t-btn:disabled { background: #93c5fd; cursor: not-allowed; box-shadow: none; }
.t-btn-sm { padding: .4rem 1rem; font-size: .82rem; border-radius: 6px; }
.t-btn-green { background: #16a34a; }
.t-btn-green:hover { background: #15803d; }

/* Divider */
.t-divider { text-align: center; color: #9ca3af; font-size: .78rem; margin: 1rem 0; position: relative; }
.t-divider::before, .t-divider::after { content:''; position:absolute; top:50%; width:44%; height:1px; background:#e5e7eb; }
.t-divider::before { left:0; } .t-divider::after { right:0; }

/* Loading */
.t-loading { display: none; text-align: center; padding: 2.5rem; background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; margin-bottom: 1.25rem; }
.t-loading.show { display: block; }
.t-spinner { width: 40px; height: 40px; border: 3px solid #e5e7eb; border-top-color: #2563eb; border-radius: 50%; animation: tspin .8s linear infinite; margin: 0 auto .75rem; }
@keyframes tspin { to { transform: rotate(360deg); } }
.t-loading p { color: #6b7280; font-size: .875rem; margin: 0; }

/* Error */
.t-error { display: none; background: #fee2e2; border: 1px solid #fca5a5; border-radius: 8px; padding: .9rem 1.2rem; color: #991b1b; font-size: .875rem; margin-top: .75rem; }
.t-error.show { display: block; }

/* Score circle */
.score-circle { width: 90px; height: 90px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 900; border: 5px solid; flex-shrink: 0; }
.score-circle .sub { font-size: .6rem; font-weight: 600; opacity: .7; margin-top: 1px; }
.sc-green  { border-color: #16a34a; color: #16a34a; }
.sc-orange { border-color: #d97706; color: #d97706; }
.sc-red    { border-color: #dc2626; color: #dc2626; }

/* Score header */
.score-header { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; background: #f8fafc; border-radius: 10px; padding: 1.25rem; margin-bottom: 1.25rem; }
.score-meta h3 { margin: 0 0 .3rem; font-size: .95rem; }
.score-meta p  { margin: 0; font-size: .82rem; color: #6b7280; }
.count-chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }
.chip { padding: .25rem .65rem; border-radius: 9999px; font-size: .75rem; font-weight: 700; display: inline-flex; align-items: center; gap: .3rem; }
.chip-high   { background: #fee2e2; color: #991b1b; }
.chip-medium { background: #ffedd5; color: #9a3412; }
.chip-low    { background: #fef3c7; color: #92400e; }
.chip-pass   { background: #dcfce7; color: #15803d; }
.chip-info   { background: #dbeafe; color: #1e40af; }

/* Section header */
.sec-header { display: flex; align-items: center; gap: .5rem; font-size: .78rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .07em; padding: .75rem 1.25rem; background: #f8fafc; border-bottom: 1px solid #e2e8f0; border-radius: 10px 10px 0 0; }

/* Audit rows */
.audit-wrap { border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 1.25rem; overflow: hidden; }
.audit-row { display: flex; align-items: flex-start; gap: .9rem; padding: .9rem 1.25rem; border-bottom: 1px solid #f1f5f9; }
.audit-row:last-child { border-bottom: none; }
.audit-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.audit-icon.high   { background: #fee2e2; }
.audit-icon.medium { background: #ffedd5; }
.audit-icon.low    { background: #fef3c7; }
.audit-icon.pass   { background: #dcfce7; }
.audit-check { font-size: .875rem; font-weight: 600; color: #0f172a; }
.audit-detail { font-size: .82rem; color: #6b7280; margin-top: .2rem; line-height: 1.5; }
.audit-fix { font-size: .8rem; color: #2563eb; margin-top: .25rem; }
.badge { display: inline-block; padding: .1rem .45rem; border-radius: 4px; font-size: .65rem; font-weight: 700; text-transform: uppercase; margin-left: .35rem; vertical-align: middle; }
.badge-high    { background: #fee2e2; color: #991b1b; }
.badge-medium  { background: #ffedd5; color: #9a3412; }
.badge-low     { background: #fef3c7; color: #92400e; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-notice  { background: #dbeafe; color: #1e40af; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat-card { background: #fff; border-radius: 10px; border: 1px solid #e2e8f0; padding: 1rem 1.25rem; }
.stat-card .val { font-size: 1.5rem; font-weight: 800; color: #111827; }
.stat-card .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; font-weight: 600; margin-top: .15rem; }

/* Suggestions */
.suggestion { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem 1rem; border-radius: 8px; margin-bottom: .5rem; font-size: .875rem; }
.sug-pass    { background: #dcfce7; color: #15803d; }
.sug-warning { background: #fef3c7; color: #92400e; }
.sug-notice  { background: #dbeafe; color: #1e40af; }
.sug-icon    { flex-shrink: 0; margin-top: 2px; }

/* Table */
.t-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid #e2e8f0; }
.t-table { width: 100%; border-collapse: collapse; font-size: .83rem; }
.t-table th { background: #f8fafc; padding: .65rem 1rem; text-align: left; font-size: .75rem; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.t-table td { padding: .65rem 1rem; border-bottom: 1px solid #f1f5f9; color: #374151; vertical-align: top; }
.t-table tr:last-child td { border-bottom: none; }
.t-table .ok   { color: #15803d; font-weight: 600; }
.t-table .warn { color: #d97706; font-weight: 600; }
.t-table .bad  { color: #dc2626; font-weight: 600; }
.t-table .cell-url { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: monospace; font-size: .78rem; }

/* Result box */
.result-box { background: #eff6ff; border-left: 4px solid #2563eb; border-radius: 8px; padding: 1.25rem 1.5rem; word-break: break-all; }
.result-box .url-text { font-family: monospace; font-size: .875rem; color: #111827; margin-bottom: .75rem; }
.copy-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem 1rem; background: #2563eb; color: #fff; border: none; border-radius: 6px; font-size: .82rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.copy-btn:hover { background: #1d4ed8; }
.copy-btn.copied { background: #15803d; }

/* Redirect chain */
.chain-wrap { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; margin-bottom: 1.25rem; }
.chain-step { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-bottom: 1px solid #f1f5f9; font-size: .85rem; }
.chain-step:last-child { border-bottom: none; }
.chain-num { width: 24px; height: 24px; border-radius: 50%; background: #e2e8f0; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; color: #475569; flex-shrink: 0; }
.chain-url { flex: 1; font-family: monospace; font-size: .78rem; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { padding: .2rem .6rem; border-radius: 9999px; font-size: .72rem; font-weight: 700; flex-shrink: 0; }
.s-2xx { background: #dcfce7; color: #15803d; }
.s-3xx { background: #fef3c7; color: #92400e; }
.s-4xx, .s-5xx, .s-err { background: #fee2e2; color: #991b1b; }

/* Similarity bars */
.sim-row { display: flex; align-items: center; gap: 1rem; margin-bottom: .85rem; }
.sim-label { width: 140px; flex-shrink: 0; font-size: .82rem; font-weight: 600; color: #374151; }
.sim-track { flex: 1; height: 10px; background: #e5e7eb; border-radius: 9999px; overflow: hidden; }
.sim-fill  { height: 100%; border-radius: 9999px; transition: width .4s ease; }
.sim-pct   { width: 42px; text-align: right; font-size: .82rem; font-weight: 700; color: #111827; }

/* Flesch gauge */
.gauge-wrap   { margin-top: .75rem; }
.gauge-label  { display: flex; justify-content: space-between; font-size: .72rem; color: #6b7280; margin-bottom: .3rem; }
.gauge-track  { height: 10px; background: #e5e7eb; border-radius: 9999px; }
.gauge-fill   { height: 100%; border-radius: 9999px; transition: width .4s; }
.gauge-zones  { display: flex; justify-content: space-between; font-size: .65rem; color: #9ca3af; margin-top: .2rem; }

/* Flesch circle */
.flesch-circle { width: 90px; height: 90px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.flesch-circle .num { font-size: 1.8rem; line-height: 1; }
.flesch-circle .lbl { font-size: .58rem; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.fc-good { background: #dcfce7; color: #15803d; border: 3px solid #86efac; }
.fc-ok   { background: #fef9c3; color: #92400e; border: 3px solid #fde047; }
.fc-poor { background: #fee2e2; color: #991b1b; border: 3px solid #fca5a5; }

/* Checklist */
.cat-header { display: flex; align-items: center; gap: .5rem; padding: .75rem 1.25rem; background: #f8fafc; border-bottom: 1px solid #e2e8f0; font-size: .8rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .07em; }
.checks-grid { display: grid; grid-template-columns: 1fr 1fr; }
.check-item { display: flex; align-items: flex-start; gap: .75rem; padding: .8rem 1.25rem; border-bottom: 1px solid #f1f5f9; border-right: 1px solid #f1f5f9; }
.check-item:nth-child(even) { border-right: none; }
@media (max-width: 640px) { .checks-grid { grid-template-columns: 1fr; } .check-item { border-right: none; } }
.check-icon { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.ci-pass { background: #dcfce7; }
.ci-fail { background: #fee2e2; }
.check-text { font-size: .875rem; font-weight: 600; color: #0f172a; }
.check-detail { font-size: .8rem; color: #6b7280; margin-top: .15rem; line-height: 1.5; }
.check-fix { font-size: .78rem; color: #2563eb; margin-top: .2rem; }

/* Risk badge */
.risk-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem 1rem; border-radius: 9999px; font-size: .82rem; font-weight: 700; }
.risk-low    { background: #dcfce7; color: #15803d; }
.risk-medium { background: #fef3c7; color: #92400e; }
.risk-high   { background: #fee2e2; color: #991b1b; }

/* UTM history */
.history-table { width: 100%; border-collapse: collapse; font-size: .83rem; }
.history-table th { background: #f8fafc; padding: .6rem 1rem; text-align: left; font-size: .72rem; color: #6b7280; text-transform: uppercase; border-bottom: 1px solid #e2e8f0; }
.history-table td { padding: .6rem 1rem; border-bottom: 1px solid #f1f5f9; color: #374151; }
.history-table tr:last-child td { border-bottom: none; }
.tag-pill { display: inline-block; background: #f3f4f6; color: #374151; font-size: .72rem; border-radius: 4px; padding: 1px 7px; }
.copy-row-btn { padding: .25rem .7rem; background: #e5e7eb; border: none; border-radius: 4px; font-size: .75rem; cursor: pointer; font-family: inherit; }
.copy-row-btn:hover { background: #d1d5db; }

/* Empty state */
.t-empty { text-align: center; padding: 2.5rem; color: #9ca3af; }
.t-empty i { font-size: 2.5rem; display: block; margin-bottom: .75rem; color: #cbd5e1; }
.t-empty p { font-size: .9rem; margin: 0; }

/* Warning */
.t-warning { background: #fef3c7; border: 1px solid #fde68a; border-radius: 8px; padding: .75rem 1rem; color: #92400e; font-size: .82rem; margin-bottom: 1rem; display: flex; gap: .5rem; align-items: flex-start; }

/* Signup CTA strip */
.tool-signup-cta { background: linear-gradient(135deg,#1e3a8a 0%,#2563eb 100%); color:#fff; padding:2rem 1.5rem; text-align:center; margin-top:2rem; }
.tool-signup-cta h3 { font-size:1.1rem; font-weight:800; margin:0 0 .4rem; }
.tool-signup-cta p  { font-size:.83rem; opacity:.82; margin:0 0 1.1rem; }
.tool-signup-cta a.tsc-btn { display:inline-flex; align-items:center; gap:.5rem; background:#fff; color:#1e3a8a; font-size:.82rem; font-weight:800; padding:.55rem 1.3rem; border-radius:8px; text-decoration:none; transition:opacity .15s; }
.tool-signup-cta a.tsc-btn:hover { opacity:.9; }
.tool-signup-cta .tsc-note { font-size:.72rem; opacity:.5; margin-top:.65rem; }

/* Responsive */
@media (max-width: 640px) {
    .tool-hero { padding: 2rem 1rem 1.75rem; }
    .tool-main, .tool-main-wide { padding: 1.25rem .9rem 3rem; }
    .t-card { padding: 1.25rem; }
    .score-header { flex-direction: column; align-items: flex-start; }
    .sim-label { width: 90px; font-size: .75rem; }
}
