/* SnipFerry Text Tools — analytics + extras (layout comes from json.css) */

.analytics-dashboard { display: flex; flex-direction: column; gap: 12px; }
.metrics-cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 640px) { .metrics-cards-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; } }
@media (min-width: 1200px) { .metrics-cards-grid { grid-template-columns: repeat(7, 1fr); } }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; }
.metric-card strong { display: block; font-family: var(--font-display); font-size: clamp(22px, 5vw, 28px); color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric-card span { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.metric-card:first-child { background: var(--ink); border-color: var(--ink); grid-column: span 2; }
@media (min-width: 1200px) { .metric-card:first-child { grid-column: auto; } }
.metric-card:first-child strong { color: var(--lime); }
.metric-card:first-child span { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.dark .metric-card:first-child { background: var(--brand-soft); border-color: var(--line-strong); }
.dark .metric-card:first-child span { color: var(--muted); }
.analytics-input .editor-container { height: 260px; }
@media (min-width: 900px) { .analytics-input .editor-container { height: 340px; } }

.analytics-split { display: grid; gap: 12px; }
@media (min-width: 900px) { .analytics-split { grid-template-columns: 1fr 1fr; } }
.analytics-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.analytics-panel h3 { font-size: 17px; margin: 0 0 14px; }
.social-progress-list { display: flex; flex-direction: column; gap: 14px; }
.social-item { display: flex; flex-direction: column; gap: 6px; }
.social-item-header { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
.social-item-header span:last-child { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.progress-track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--brand); border-radius: 999px; transition: width .2s ease; }
.dark .progress-fill { background: var(--lime); }
.progress-fill.bar-overflow { background: var(--danger) !important; }
.keywords-container { display: flex; flex-wrap: wrap; gap: 8px; min-height: 80px; align-content: flex-start; }
.kw-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.kw-pill strong { color: var(--ink); font-weight: 650; }
.kw-pill span { color: var(--muted); font-size: 13px; }

.case-buttons-row { display: flex; flex-wrap: wrap; gap: 6px; }
.case-quick-btn { min-height: 34px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; font-family: var(--font-mono); transition: background .15s, border-color .15s; }
.case-quick-btn:hover { border-color: var(--brand); color: var(--brand-text); }

/* Text output wraps by default; markdown can render as HTML */
#text-output { white-space: pre-wrap; word-break: break-word; }
#text-output.is-rendered { white-space: normal; font-family: var(--font-body); font-size: 16px; line-height: 1.65; }
#text-output.is-rendered h1, #text-output.is-rendered h2, #text-output.is-rendered h3 { margin: 1em 0 .4em; }
#text-output.is-rendered h1:first-child, #text-output.is-rendered h2:first-child { margin-top: 0; }
#text-output.is-rendered pre { background: var(--surface-2); padding: 12px; border-radius: 8px; overflow: auto; font-family: var(--font-mono); font-size: 13px; }
#text-output.is-rendered code { font-family: var(--font-mono); font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
#text-output.is-rendered blockquote { margin: 0 0 1em; padding-left: 14px; border-left: 3px solid var(--line-strong); color: var(--muted); }
#text-output.is-rendered a { color: var(--brand-text); text-decoration: underline; }

/* Prose inputs wrap like a normal text box */
body[data-page="text"] #input-rail { display: none; }
#text-input, #text-input-single { white-space: pre-wrap; word-break: break-word; font-family: var(--font-body); font-size: 16px; line-height: 1.6; }
body[data-tool="jwt-decoder"] #text-input-single, body[data-tool="regex-tester"] #text-input-single, body[data-tool="hash-generator"] #text-input-single,
body[data-tool="base64-encode-decode"] #text-input-single, body[data-tool="url-encode-decode"] #text-input-single, body[data-tool="html-encode-decode"] #text-input-single,
body[data-tool="timestamp-converter"] #text-input-single, body[data-tool="cron-parser"] #text-input-single, body[data-tool="markdown-preview"] #text-input-single { font-family: var(--font-mono); font-size: 14px; }
