/**
 * 2count - Project Styles (2026-11-17 modernization)
 * Builds on tokens.css (family tokens + self-hosted fonts). Replaces the
 * legacy css/styles.css. Layout goal: header + hero + the whole counter +
 * the first row of feature cards on one 1280x720 screen, no scrolling.
 */

/* ============================================
   Base
   ============================================ */
html, body {
    background: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
}
body { overflow-x: hidden; }

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1280px;
    margin: 0 auto;
}

.hidden { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--brand-blue-light); outline-offset: 2px; }

/* ============================================
   Accent hues (family --acc-* values, Tailwind 400 family in dark,
   700 family in light for contrast). Same values as 2scrape/2convert.
   ============================================ */
:root {
    --acc-blue: #60A5FA;
    --acc-violet: #A78BFA;
    --acc-orange: #FB923C;
    --acc-teal: #2DD4BF;
    --acc-amber: #F59E0B;
    --acc-green: #22C55E;
    --acc-sky: #0EA5E9;
    --acc-red: #F87171;
}
[data-theme="light"] {
    --acc-blue: #1D4ED8;
    --acc-violet: #6D28D9;
    --acc-orange: #C2410C;
    --acc-teal: #0F766E;
    --acc-amber: #B45309;
    --acc-green: #15803D;
    --acc-sky: #0369A1;
    --acc-red: #B91C1C;
}
.acc-blue   { --cat: var(--acc-blue);   --cat-g1: #60A5FA; --cat-g2: #2563EB; }
.acc-violet { --cat: var(--acc-violet); --cat-g1: #8B5CF6; --cat-g2: #7C3AED; }
.acc-orange { --cat: var(--acc-orange); --cat-g1: #F97316; --cat-g2: #EA580C; }
.acc-teal   { --cat: var(--acc-teal);   --cat-g1: #14B8A6; --cat-g2: #0D9488; }
.acc-amber  { --cat: var(--acc-amber);  --cat-g1: #F59E0B; --cat-g2: #D97706; }
.acc-green  { --cat: var(--acc-green);  --cat-g1: #10B981; --cat-g2: #059669; }
.acc-sky    { --cat: var(--acc-sky);    --cat-g1: #0EA5E9; --cat-g2: #0284C7; }

/* ============================================
   Header (family standard: logo left; badge + Updates/Help/Theme right)
   ============================================ */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid var(--border-medium);
    background: var(--bg-app);
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}
.app-logo {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 10px;
    background: var(--brand-blue);
    color: #FFFFFF;
    font-weight: 800;
    font-size: 1.75rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.app-name {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}
.app-name .domain { color: var(--brand-blue); }

.header-right { display: flex; align-items: center; gap: 1rem; }
.header-icons { display: flex; gap: 0.4rem; }
.header-icon-btn {
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.header-icon-btn:hover {
    color: var(--brand-blue);
    border-color: var(--brand-blue);
    background: rgba(59, 130, 246, 0.08);
}
.header-icon-btn svg { width: 18px; height: 18px; }

/* Zero Data Retention badge with the click-to-reveal popup extension */
.privacy-wrap { position: relative; }
.privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--brand-blue);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
.privacy-badge svg { width: 16px; height: 16px; }
.privacy-popup {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    width: 300px;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.5);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    z-index: var(--z-dropdown);
    cursor: default;
}
.privacy-popup strong { display: block; color: var(--text-primary); margin-bottom: 0.3rem; font-size: 0.9rem; }
.privacy-popup p + p { margin-top: 0.4rem; }

@media (max-width: 640px) {
    .privacy-badge > span { display: none; }
    .privacy-wrap { position: static; }
    .app-header { padding: 0.75rem 1rem; }
    .app-name { font-size: 1.25rem; }
    .header-right { gap: 0.6rem; }
    .header-icon-btn { width: 36px; height: 36px; }
    .privacy-popup { position: fixed; top: 64px; left: 1rem; right: 1rem; width: auto; }
}

/* ============================================
   Main + Hero (CAPS, original size/weight, white + brand-blue split)
   ============================================ */
.main-content { flex: 1; padding: 0 1.5rem 1rem; }

.lp-hero {
    max-width: 960px;
    margin: 0 auto 0.9rem;
    padding: 1.1rem 0 0;
    text-align: center;
}
.lp-hero h1 {
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 0.45rem;
    color: var(--text-primary);
}
.lp-hero h1 .h1-accent { color: #60A5FA; }
[data-theme="light"] .lp-hero h1 .h1-accent { color: #3B82F6; }
.lp-hero p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 860px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ============================================
   Counter tool
   ============================================ */
.ct-tool {
    max-width: 1180px;
    margin: 0 auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: 16px;
    padding: 0.9rem;
    box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.6);
}
[data-theme="light"] .ct-tool { box-shadow: 0 8px 24px -16px rgba(15, 23, 42, 0.25); }

/* --- Metrics strip --- */
.ct-metrics {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.65rem;
}
.ct-metric {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.9rem;
    border-radius: 12px;
    background: var(--bg-app);
    border: 1px solid var(--border-medium);
    min-width: 0;
}
[data-theme="light"] .ct-metric { background: var(--slate-50); }
.ct-metric-text { display: flex; flex-direction: column; gap: 0.05rem; min-width: 0; }
.ct-metric-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.ct-metric-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ct-metric-sub { font-size: 0.78rem; color: var(--text-tertiary); white-space: nowrap; }
.ct-metric-value.limit-exceeded { color: var(--acc-red); }

/* PII alert: a button so it is reachable by keyboard; opens the analysis panel */
.ct-pii {
    -webkit-appearance: none;
    appearance: none;
    flex: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--acc-amber) 55%, transparent);
    background: color-mix(in srgb, var(--acc-amber) 12%, transparent);
    color: var(--acc-amber);
    cursor: pointer;
    text-align: left;
}
.ct-pii svg { width: 22px; height: 22px; flex: none; }
.ct-pii .ct-metric-value { color: var(--acc-amber); }
.ct-pii .ct-metric-label { color: var(--acc-amber); }

/* --- Body: editor column + side column --- */
.ct-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 0.9rem;
}
.ct-editor { display: flex; flex-direction: column; min-width: 0; }

.ct-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}
.ct-toolbar .ct-spacer { flex: 1; }
.tool-group { display: flex; gap: 0.25rem; }
.tool-btn {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 34px;
    padding: 0 0.7rem;
    border-radius: 8px;
    background: var(--bg-app);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
[data-theme="light"] .tool-btn { background: var(--slate-50); }
.tool-btn svg { width: 15px; height: 15px; flex: none; }
.tool-btn:hover { color: var(--brand-blue-light); border-color: var(--brand-blue); }
[data-theme="light"] .tool-btn:hover { color: var(--brand-blue-hover); }
.tool-btn.is-active {
    color: #FFFFFF;
    background: var(--brand-blue);
    border-color: var(--brand-blue);
}
.tool-btn.copied { color: var(--acc-green); border-color: var(--acc-green); }
.tool-btn.danger:hover { color: var(--danger); border-color: var(--danger); }

/* Editor surface with the search-highlight backdrop behind the textarea */
.text-container {
    position: relative;
    flex: 1;
    min-height: 220px;
    border-radius: 12px;
    background: var(--bg-app);
    border: 1px solid var(--border-medium);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
[data-theme="light"] .text-container { background: #FFFFFF; }
.text-container:focus-within {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.text-container.is-dragover {
    border-color: var(--acc-teal);
    border-style: dashed;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc-teal) 25%, transparent);
}
#text-input,
.highlight-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0.85rem 1rem;
    border: 0;
    font-family: var(--font-sans);
    font-size: 1.06rem;
    line-height: 1.6;
    letter-spacing: normal;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: normal;
    tab-size: 4;
}
.highlight-backdrop {
    color: transparent;
    overflow: hidden;
    pointer-events: none;
    border-radius: 12px;
}
.highlight-backdrop mark {
    color: transparent;
    background: color-mix(in srgb, var(--acc-amber) 40%, transparent);
    border-radius: 3px;
}
#text-input {
    background: transparent;
    color: var(--text-primary);
    resize: none;
    outline: none;
    overflow-y: auto;
    border-radius: 12px;
}
#text-input::placeholder { color: var(--text-tertiary); }

.ct-editor-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.45rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}
.ct-file-btn {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    color: var(--brand-blue-light);
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
}
[data-theme="light"] .ct-file-btn { color: var(--brand-blue-hover); }
.ct-file-btn:hover { text-decoration: underline; }
.countdown-timer {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.countdown-timer svg { width: 14px; height: 14px; }
.countdown-timer.active { color: var(--text-secondary); }
.countdown-timer.warning { color: var(--acc-amber); font-weight: 600; }
.ct-status { color: var(--acc-teal); font-weight: 600; }
.ct-status.is-error { color: var(--acc-red); }

/* --- Panels shown above the editor (Analysis / Time Machine) --- */
.ct-panel {
    margin-bottom: 0.5rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: var(--bg-app);
    border: 1px solid var(--border-medium);
}
[data-theme="light"] .ct-panel { background: var(--slate-50); }
.ct-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.ct-panel-head h2 {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0;
}
.close-btn {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.close-btn:hover { color: var(--brand-blue); border-color: var(--brand-blue); }
.close-btn svg { width: 13px; height: 13px; }

.analysis-grid {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 0.5rem 1.5rem;
    align-items: start;
}
.analysis-stat { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.analysis-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}
.analysis-value { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.badge { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.9rem; }
.badge.easy { color: var(--acc-green); background: color-mix(in srgb, var(--acc-green) 14%, transparent); }
.badge.moderate { color: var(--acc-amber); background: color-mix(in srgb, var(--acc-amber) 14%, transparent); }
.badge.difficult { color: var(--acc-red); background: color-mix(in srgb, var(--acc-red) 14%, transparent); }
.keyword-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.keyword-tag, .pii-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.82rem;
    background: color-mix(in srgb, var(--acc-violet) 13%, transparent);
    color: var(--acc-violet);
    font-weight: 600;
}
.pii-section { grid-column: 1 / -1; }
.pii-item {
    background: color-mix(in srgb, var(--acc-amber) 13%, transparent);
    color: var(--acc-amber);
    font-family: var(--font-mono);
    font-weight: 500;
}
.pii-type { font-family: var(--font-sans); font-weight: 700; }
.warning-text { color: var(--acc-amber); }
.ct-muted { color: var(--text-tertiary); font-size: 0.85rem; }

.history-list { display: flex; flex-direction: column; gap: 0.35rem; max-height: 180px; overflow-y: auto; }
.history-item {
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    width: 100%;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--border-medium);
    background: var(--bg-surface);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    font-size: 0.88rem;
}
.history-item:hover { border-color: var(--brand-blue); }
.history-meta { flex: none; color: var(--text-tertiary); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.history-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* --- Side column --- */
.ct-side { display: flex; flex-direction: column; gap: 0.7rem; min-width: 0; }
.ct-field { display: flex; flex-direction: column; gap: 0.35rem; }
.ct-field-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.ct-input, .ct-select {
    width: 100%;
    height: 36px;
    padding: 0 0.75rem;
    border-radius: 8px;
    background: var(--bg-app);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    font-size: 0.92rem;
    transition: border-color var(--transition-fast);
}
[data-theme="light"] .ct-input, [data-theme="light"] .ct-select { background: #FFFFFF; }
.ct-input:focus, .ct-select:focus { outline: none; border-color: var(--brand-blue); box-shadow: 0 0 0 3px var(--accent-glow); }
.ct-input::placeholder { color: var(--text-tertiary); }
.ct-select {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
}
.ct-row { display: flex; gap: 0.4rem; }
.ct-row > .input-wrap { flex: 1; }
.ct-btn {
    -webkit-appearance: none;
    appearance: none;
    height: 36px;
    padding: 0 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--brand-blue);
    background: var(--brand-blue);
    color: #FFFFFF;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition-fast);
}
.ct-btn:hover { background: var(--brand-blue-hover); }
.ct-note { font-size: 0.8rem; color: var(--acc-teal); font-weight: 600; min-height: 1em; }
.ct-note:empty { display: none; }

/* Clear-X inside inputs (family input standard) */
.input-wrap { position: relative; display: flex; min-width: 0; }
.input-wrap > input { width: 100%; padding-right: 2.2rem; }
.input-clear-btn {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--border-medium);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.input-wrap.has-value .input-clear-btn { display: flex; }
.input-clear-btn:hover { background: var(--danger); color: #FFFFFF; }
.input-clear-btn svg { width: 12px; height: 12px; }

/* Platform limit meter */
.limit-meter { display: flex; flex-direction: column; gap: 0.3rem; }
.limit-bar { height: 6px; border-radius: 999px; background: var(--border-medium); overflow: hidden; }
.limit-fill { height: 100%; width: 0; border-radius: inherit; background: var(--acc-green); transition: width 0.15s ease, background 0.15s ease; }
.limit-meter.is-near .limit-fill { background: var(--acc-amber); }
.limit-meter.is-over .limit-fill { background: var(--acc-red); }
.limit-text { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.8rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.limit-meter.is-near .limit-left { color: var(--acc-amber); font-weight: 600; }
.limit-meter.is-over .limit-left { color: var(--acc-red); font-weight: 700; }
.limit-hint { font-size: 0.76rem; color: var(--text-tertiary); }

/* Search results (shown only while a search term is active) */
.filter-results { display: none; grid-template-columns: 1fr 1fr; gap: 0.25rem 0.75rem; font-size: 0.8rem; color: var(--text-secondary); }
.filter-results.active { display: grid; }
.filter-stat { display: flex; justify-content: space-between; gap: 0.4rem; }
.filter-stat-value { color: var(--text-primary); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ============================================
   Feature cards (family bento language; informational, not links)
   ============================================ */
.lp-features { max-width: 1180px; margin: 0.9rem auto 2.25rem; }
.ft-grid { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
@media (min-width: 640px) { .ft-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .ft-grid { grid-template-columns: repeat(3, 1fr); } }
.ft-card {
    display: grid;
    grid-template-columns: 40px 1fr;
    column-gap: 0.85rem;
    align-items: start;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--cat, #3B82F6) 7%, rgba(30, 41, 59, 0.92)), rgba(17, 24, 39, 0.92));
    border: 1px solid color-mix(in srgb, var(--cat, #3B82F6) 22%, rgba(148, 163, 184, 0.14));
    color: var(--text-primary);
}
.ft-chip {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #FFFFFF;
    background: linear-gradient(140deg, var(--cat-g1, #60A5FA), var(--cat-g2, #2563EB));
    box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--cat-g2, #2563EB) 70%, transparent);
}
.ft-body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.ft-cat {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cat, var(--brand-blue-light));
}
.ft-card h3 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.ft-card p { margin: 0; font-size: 0.9rem; line-height: 1.5; color: var(--text-secondary); }
[data-theme="light"] .ft-card {
    background: color-mix(in srgb, var(--cat, #3B82F6) 4%, #FFFFFF);
    border-color: color-mix(in srgb, var(--cat, #3B82F6) 22%, rgba(15, 23, 42, 0.1));
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

/* ============================================
   Collapsible SEO sections (all copy stays in the DOM; <details> only hides it)
   ============================================ */
.lp-more { max-width: 1000px; margin: 0 auto 2rem; line-height: 1.7; }
.lp-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
}
.lp-fold {
    background: var(--bg-surface);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 14px;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}
[data-theme="light"] .lp-fold { border-color: rgba(15, 23, 42, 0.1); }
.lp-fold:hover, .lp-fold[open] { border-color: color-mix(in srgb, var(--cat, #3B82F6) 45%, transparent); }
.lp-fold[open] > summary .lp-fold-chev { color: var(--cat, var(--text-secondary)); }
.lp-fold > summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.05rem 1.4rem;
    cursor: pointer;
    border-radius: 14px;
}
.lp-fold > summary::-webkit-details-marker { display: none; }
.lp-fold > summary:focus-visible { outline: 2px solid var(--brand-blue-light); outline-offset: 3px; }
.lp-fold > summary h2 {
    flex: 1;
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
}
.lp-fold-hint { font-size: 0.85rem; color: var(--text-secondary); white-space: nowrap; }
.lp-fold-chev { flex: none; color: var(--text-secondary); transition: transform 0.2s ease; }
.lp-fold[open] .lp-fold-chev { transform: rotate(180deg); }
.lp-fold-body { padding: 0 1.4rem 1.4rem; border-top: 1px solid rgba(148, 163, 184, 0.12); }
.lp-fold-body > :first-child { margin-top: 1rem; }
.lp-fold-body h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
    color: var(--text-primary);
    padding-left: 0.75rem;
    border-left: 3px solid var(--cat, var(--brand-blue));
    line-height: 1.35;
}
.lp-fold-body p { color: var(--text-secondary); margin: 0 0 0.85rem; font-size: 0.98rem; }
.lp-fold-body p:last-child { margin-bottom: 0; }
.lp-fold-body ul, .lp-fold-body ol { color: var(--text-secondary); padding-left: 1.4rem; margin: 0 0 0.85rem; font-size: 0.98rem; }
.lp-fold-body li { margin-bottom: 0.5rem; }
.lp-fold-body ol li::marker { color: var(--cat, var(--brand-blue)); font-weight: 700; }
.lp-fold-body strong { color: var(--text-primary); font-weight: 600; }
.lp-fold-body code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    padding: 0.1em 0.4em;
    background: rgba(59, 130, 246, 0.1);
    color: var(--brand-blue-light);
    border-radius: 4px;
}
.lp-fold-body a { color: var(--brand-blue-light); text-decoration: none; border-bottom: 1px solid rgba(59, 130, 246, 0.35); }
.lp-fold-body a:hover { border-bottom-color: var(--brand-blue); }
[data-theme="light"] .lp-fold-body a, [data-theme="light"] .lp-fold-body code { color: var(--brand-blue-hover); }
.lp-faq article { padding: 0.9rem 0; border-bottom: 1px solid rgba(148, 163, 184, 0.15); }
.lp-faq article:first-child { padding-top: 0; }
.lp-faq article:last-child { padding-bottom: 0; border-bottom: none; }
.lp-faq article h3 { margin-top: 0.25rem; font-size: 1rem; }
.lp-faq article p { font-size: 0.95rem; margin: 0; }

/* ============================================
   Feedback bar (end of page) + footer
   ============================================ */
.lp-feedback {
    max-width: 1280px;
    margin: 0.5rem auto 0;
    padding: 1.25rem 1.5rem 0.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.lp-feedback-prompt { font-weight: 500; }
.lp-feedback-buttons { display: flex; gap: 0.5rem; }
.lp-feedback-btn {
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}
.lp-feedback-btn:hover, .lp-feedback-btn[aria-pressed="true"] {
    color: var(--brand-blue);
    border-color: var(--brand-blue);
    background: rgba(59, 130, 246, 0.08);
    transform: translateY(-1px);
}
.lp-feedback-btn svg { width: 18px; height: 18px; }
.lp-feedback-comment { display: flex; gap: 0.5rem; justify-content: center; width: 100%; max-width: 480px; }
.lp-feedback-comment .ct-input { flex: 1; }
.lp-feedback-thanks { width: 100%; text-align: center; color: var(--acc-green); font-weight: 600; font-size: 0.9rem; }

.app-footer {
    text-align: center;
    padding: 1.25rem 1.5rem 2.25rem;
    color: var(--text-tertiary);
    font-size: 0.8rem;
}
.app-footer p { max-width: 760px; margin: 0 auto 0.75rem; }
.ecosystem-footer { margin-top: 0.75rem; font-size: 0.8rem; }
.ecosystem-footer a { color: var(--brand-blue); font-weight: 600; text-decoration: none; }
.ecosystem-footer a:hover { text-decoration: underline; }

/* ============================================
   Modals (Updates / Help / Thread preview)
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 9, 11, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: var(--z-modal);
    animation: modal-fade-in 0.18s ease-out;
}
.modal-overlay.hidden { display: none; }
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
    position: relative;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: 16px;
    padding: 1.75rem 2rem 1.5rem;
    max-width: 640px;
    width: 100%;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.6);
    animation: modal-card-in 0.22s ease-out;
}
@keyframes modal-card-in {
    from { transform: translateY(8px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-close {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-app);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover { color: var(--brand-blue); border-color: var(--brand-blue); }
.modal-close svg { width: 14px; height: 14px; }
.modal-title { font-size: 1.4rem; font-weight: 700; margin: 0 0 0.3rem; padding-right: 2.5rem; color: var(--text-primary); }
.modal-subtitle { color: var(--text-secondary); font-size: 0.9rem; margin: 0 0 1.25rem; }
.modal-card h3 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-blue-light);
    margin: 1.1rem 0 0.5rem;
}
[data-theme="light"] .modal-card h3 { color: var(--brand-blue-hover); }
.modal-card p, .modal-card li { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.6; }
.modal-card ul { padding-left: 1.2rem; }
.modal-card li { margin-bottom: 0.3rem; }
.modal-card strong { color: var(--text-primary); }

.timeline { display: flex; flex-direction: column; gap: 1rem; }
.timeline-item { padding-left: 1rem; border-left: 2px solid var(--border-strong); }
.timeline-item:first-child { border-left-color: var(--brand-blue); }
.timeline-version-row { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 0.3rem; }
.timeline-version { font-weight: 700; color: var(--text-primary); }
.timeline-date { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-tertiary); }

.thread-container { display: flex; flex-direction: column; gap: 0.75rem; }
.tweet-box {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: var(--bg-app);
    border: 1px solid var(--border-medium);
}
.tweet-box p { color: var(--text-primary); white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 0.6rem; }
.tweet-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.8rem; color: var(--text-tertiary); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    .ct-body { grid-template-columns: 1fr; }
    .ct-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.7rem; }
}
@media (max-width: 639px) {
    .main-content { padding: 0 0.75rem 1rem; }
    .lp-hero { padding-top: 0.9rem; }
    .lp-hero p { font-size: 0.98rem; }
    .ct-tool { padding: 0.65rem; border-radius: 14px; }
    .ct-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
    .ct-pii { grid-column: 1 / -1; }
    .ct-metric { padding: 0.45rem 0.65rem; }
    .ct-metric-value { font-size: 1.35rem; }
    .ct-toolbar { gap: 0.3rem; }
    .tool-btn { padding: 0 0.55rem; font-size: 0.8rem; }
    .tool-btn .tool-btn-text { display: none; }
    .ct-toolbar .ct-spacer { display: none; }
    .text-container { min-height: 200px; }
    .analysis-grid { grid-template-columns: 1fr 1fr; }
    .analysis-grid .keywords-stat { grid-column: 1 / -1; }
    .lp-fold > summary { padding: 1rem 1.1rem; }
    .lp-fold-hint { display: none; }
    .lp-fold-body { padding: 0 1.1rem 1.1rem; }
    .modal-card { padding: 1.4rem 1.2rem 1.2rem; }
    .ct-editor-foot { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
