/* ==========================================================================
   Corrector.cat — estils
   ========================================================================== */

/* Inter allotjada al nostre servidor (abans Google Fonts): una connexió menys i sense bloquejar */
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url('/fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url('/fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --bg: #fbfaf7;
    --surface: #ffffff;
    --surface-2: #f5f3ee;
    --ink: #1d1b18;
    --ink-2: #4f4a43;
    --ink-3: #6f6a62;
    --line: #e7e3da;
    --line-2: #d9d4c8;
    --accent: #9a5b06;
    --accent-strong: #7d4a05;
    --accent-soft: #fbf1df;
    --brand: #e39d1a;

    --c-ortografia: #d93025;
    --c-ortografia-bg: rgba(217, 48, 37, 0.09);
    --c-gramatica: #7247d6;
    --c-gramatica-bg: rgba(114, 71, 214, 0.09);
    --c-puntuacio: #c77700;
    --c-puntuacio-bg: rgba(199, 119, 0, 0.11);
    --c-estil: #1a73c8;
    --c-estil-bg: rgba(26, 115, 200, 0.09);
    --c-ok: #1e8a4c;
    --c-ok-bg: rgba(30, 138, 76, 0.1);

    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(29, 27, 24, 0.04), 0 4px 16px rgba(29, 27, 24, 0.05);
    --shadow-pop: 0 4px 12px rgba(29, 27, 24, 0.08), 0 16px 40px rgba(29, 27, 24, 0.14);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color-scheme: light;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[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;
}

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 880px; }
.muted { color: var(--ink-3); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Header ------------------------------------------------------------ */

.site-header {
    position: sticky; top: 0; z-index: 40;
    background: rgba(251, 250, 247, 0.85);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand-name, .footer-brand { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.brand-dot { color: var(--accent); }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
    text-decoration: none; color: var(--ink-2); font-size: 14px; font-weight: 500;
    padding: 6px 12px; border-radius: 8px; transition: background .15s, color .15s;
}
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }

/* --- Hero -------------------------------------------------------------- */

.hero { text-align: center; padding-top: 56px; padding-bottom: 32px; }
.eyebrow {
    display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent);
    background: var(--accent-soft); padding: 4px 12px; border-radius: 99px; margin-bottom: 18px;
}
.hero h1 {
    font-size: clamp(32px, 5vw, 52px); line-height: 1.08; letter-spacing: -0.035em;
    font-weight: 700; max-width: 760px; margin: 0 auto 16px;
}
.lead { font-size: 18px; color: var(--ink-2); max-width: 640px; margin: 0 auto; }

/* --- Buttons ----------------------------------------------------------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
    font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #000; }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-sm svg { width: 15px; height: 15px; }

/* --- Tool layout ------------------------------------------------------- */

.tool { padding-bottom: 24px; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: stretch; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.editor { display: flex; flex-direction: column; min-width: 0; }

.editor-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 14px; border-bottom: 1px solid var(--line);
}

/* Paraules disponibles avui */
.quota {
    display: flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 4px;
    font-size: 13px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.quota-meter { width: 56px; height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; flex-shrink: 0; }
.quota-meter span { display: block; height: 100%; width: 100%; background: var(--c-ok); border-radius: 99px; transition: width .4s ease; }
.quota.is-low .quota-meter span { background: var(--c-puntuacio); }
.quota.is-low { color: var(--accent-strong); }
.quota.is-empty { color: var(--c-ortografia); }

.segmented { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
    padding: 6px 14px; font-size: 14px; font-weight: 600; color: var(--ink-3);
    border-radius: 8px; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s;
}
.segmented input:checked + label { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.segmented input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }
.segmented input:disabled + label { cursor: not-allowed; }

.editor-body { position: relative; height: clamp(360px, 58vh, 620px); }

#input-text, .result-view {
    position: absolute; inset: 0; width: 100%; height: 100%;
    padding: 22px 24px; margin: 0; border: 0; outline: none; resize: none;
    background: transparent; color: var(--ink);
    font-family: var(--font); font-size: 17px; line-height: 1.75;
    overflow-y: auto; white-space: pre-wrap; overflow-wrap: break-word;
}
#input-text::placeholder { color: var(--ink-3); }

/* Canvis marcats sobre el text corregit */
.mk { cursor: pointer; border-radius: 3px; padding: 1px 0; transition: background .15s, box-shadow .15s; }
.mk:focus-visible { outline: none; }
.chg { background: var(--mark-bg); border-bottom: 2px solid var(--mark); }
.chg:hover, .chg:focus-visible, .chg.is-active {
    background: var(--mark-bg-strong, var(--mark-bg)); box-shadow: 0 0 0 2px var(--mark-bg);
}
.chg-ortografia { --mark: var(--c-ortografia); --mark-bg: var(--c-ortografia-bg); --mark-bg-strong: rgba(217,48,37,.18); }
.chg-gramatica  { --mark: var(--c-gramatica);  --mark-bg: var(--c-gramatica-bg);  --mark-bg-strong: rgba(114,71,214,.18); }
.chg-puntuacio  { --mark: var(--c-puntuacio);  --mark-bg: var(--c-puntuacio-bg);  --mark-bg-strong: rgba(199,119,0,.2); }
.chg-estil      { --mark: var(--c-estil);      --mark-bg: var(--c-estil-bg);      --mark-bg-strong: rgba(26,115,200,.18); }
/* Paraula eliminada: petita marca visual que no es copia */
.mk.is-empty::before {
    content: ''; display: inline-block; width: 7px; height: 1em; vertical-align: -0.15em;
    border-left: 2px solid var(--mark, var(--ink-3)); border-bottom: 2px solid var(--mark, var(--ink-3));
}
/* Canvi desfet: es mostra l'original amb un subratllat discontinu */
.rev { border-bottom: 2px dashed var(--line-2); }
.rev:hover, .rev:focus-visible, .rev.is-active { background: var(--surface-2); }

/* Càrrega */
.loading {
    position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px;
    background: rgba(255, 255, 255, 0.82); backdrop-filter: blur(2px);
    color: var(--ink-2); font-weight: 500; border-radius: 0;
}
.spinner {
    width: 34px; height: 34px; border-radius: 50%;
    border: 3px solid var(--line); border-top-color: var(--ink);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress { width: min(280px, 80%); height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 99px; transition: width .3s ease; }

/* Avisos */
.notice {
    margin: 0 14px 12px; padding: 10px 14px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; background: #fdecea; color: #a12a20;
}
.notice.is-warn { background: var(--accent-soft); color: var(--accent-strong); }

.editor-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 12px 14px; border-top: 1px solid var(--line);
}
.counter { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.counter.is-over { color: var(--c-ortografia); font-weight: 600; }
.foot-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kbd-hint { font-size: 12px; color: var(--ink-3); margin-right: 4px; }
kbd {
    font-family: var(--font); font-size: 11px; font-weight: 600; color: var(--ink-2);
    background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px;
    border-radius: 5px; padding: 1px 5px;
}

.view-toggle { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.view-toggle button {
    border: 0; background: transparent; padding: 0 12px; height: 36px; border-radius: 8px;
    font-size: 14px; font-weight: 600; color: var(--ink-3); cursor: pointer;
}
.view-toggle button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* --- Panell de revisió -------------------------------------------------- */

.panel { display: flex; flex-direction: column; min-height: 0; max-height: calc(clamp(360px, 58vh, 620px) + 120px); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; }
.panel-title { font-weight: 700; font-size: 15px; }
.panel-count {
    font-size: 12px; font-weight: 700; background: var(--ink); color: #fff;
    min-width: 24px; height: 24px; padding: 0 8px; border-radius: 99px;
    display: inline-flex; align-items: center; justify-content: center;
}
.panel-count.is-zero { background: var(--c-ok); }

.panel-empty, .panel-clean { padding: 4px 18px 20px; font-size: 14px; color: var(--ink-2); display: grid; gap: 14px; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.legend li { display: flex; align-items: center; gap: 8px; font-weight: 500; }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: var(--ink-3); }
.dot-ortografia { background: var(--c-ortografia); }
.dot-gramatica  { background: var(--c-gramatica); }
.dot-puntuacio  { background: var(--c-puntuacio); }
.dot-estil      { background: var(--c-estil); }

.panel-clean { text-align: center; justify-items: center; padding-top: 24px; }
.clean-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--c-ok-bg); color: var(--c-ok); display: grid; place-items: center; }
.clean-icon svg { width: 24px; height: 24px; }

.panel-summary { padding: 0 18px 12px; border-bottom: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
    color: var(--ink-2); background: var(--surface-2); padding: 3px 9px 3px 8px; border-radius: 99px;
}
.chip .dot { width: 8px; height: 8px; }

.issue-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; min-height: 0; }
.issue {
    padding: 12px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
    transition: background .15s, border-color .15s;
}
.issue + .issue { margin-top: 2px; }
.issue:hover, .issue.is-active { background: var(--surface-2); }
.issue-type { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.issue-change { margin: 6px 0 4px; font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.issue-change svg { width: 14px; height: 14px; color: var(--ink-3); }
.orig { color: var(--ink-3); text-decoration: line-through; text-decoration-color: rgba(217,48,37,.6); }
.sugg { font-weight: 600; color: var(--ink); }
.issue-expl { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.issue-actions { display: flex; gap: 6px; margin-top: 8px; }
.issue.is-reverted .issue-change, .issue.is-reverted .issue-expl { opacity: .55; }
.issue-flag {
    margin-left: auto; font-size: 11px; text-transform: none; letter-spacing: 0;
    background: var(--surface-2); color: var(--ink-2); padding: 1px 8px; border-radius: 99px;
}
.link-btn { border: 0; background: none; padding: 0; font-size: 12px; font-weight: 600; color: var(--ink-2); text-decoration: underline; cursor: pointer; }

.privacy-note {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 16px; font-size: 13px; color: var(--ink-3); text-align: center;
}
.privacy-note svg { width: 15px; height: 15px; }

/* --- Popover ------------------------------------------------------------ */

.popover {
    position: fixed; z-index: 60; width: min(340px, calc(100vw - 24px));
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow-pop); padding: 14px 16px 14px;
    animation: pop-in .12s ease-out;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.pop-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.pop-change { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 8px; font-size: 17px; }
.pop-change svg { width: 16px; height: 16px; color: var(--ink-3); }
.pop-orig { color: var(--ink-3); text-decoration: line-through; text-decoration-color: rgba(217,48,37,.6); }
.pop-sugg { font-weight: 700; background: var(--c-ok-bg); color: #145c33; padding: 1px 6px; border-radius: 5px; }
.pop-expl { font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.pop-actions { display: flex; gap: 8px; margin-top: 14px; }

/* --- Contingut SEO ------------------------------------------------------ */

.seo { padding: 72px 0 40px; }
.seo-block + .seo-block { margin-top: 72px; }
.seo-block h2 { font-size: clamp(26px, 3.4vw, 34px); line-height: 1.2; letter-spacing: -0.025em; font-weight: 700; margin-bottom: 24px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.two-col p { font-size: 17px; color: var(--ink-2); }
.two-col strong, .faq-body strong { color: var(--ink); }

.tips { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 40px; }
.tips-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 24px 32px; }
.tips-list li { display: flex; gap: 14px; }
.tips-list p { color: var(--ink-2); font-size: 15px; }
.tips-list strong { color: var(--ink); }
.tip-num {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px;
}

/* Què és Corrector.cat */
.about-lead { font-size: 18px; color: var(--ink-2); margin-bottom: 24px; }
.about-lead strong { color: var(--ink); font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 32px; margin: 0; border-top: 1px solid var(--line); }
.facts > div { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { width: 112px; flex-shrink: 0; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.facts dd { margin: 0; font-size: 15px; color: var(--ink); }
.updated { margin-top: 14px; font-size: 13px; color: var(--ink-3); }
.updated a { color: var(--accent-strong); }

/* Com funciona */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { display: flex; gap: 14px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.steps h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.steps p { font-size: 14px; color: var(--ink-2); }
.step-num {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
    background: var(--ink); color: #fff; font-weight: 700; font-size: 14px;
}

/* Comparativa */
.section-intro { color: var(--ink-2); font-size: 17px; margin: -8px 0 20px; }
.section-note { margin-top: 14px; font-size: 14px; color: var(--ink-3); }
.section-note a { color: var(--accent-strong); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.compare { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.compare thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); background: var(--surface-2); }
.compare tbody th { font-weight: 600; white-space: nowrap; }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare tbody tr:first-child { background: var(--accent-soft); }
.compare td { color: var(--ink-2); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.feature svg { width: 22px; height: 22px; color: var(--accent); margin-bottom: 14px; }
.feature h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.feature p { font-size: 14px; color: var(--ink-2); }

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 20px 2px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { font-size: 17px; font-weight: 600; }
.faq summary::after {
    content: ''; width: 10px; height: 10px; flex-shrink: 0; margin-right: 4px;
    border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
    transform: rotate(45deg) translateY(-3px); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.faq summary:hover h3 { color: var(--accent-strong); }
.faq-body { padding: 0 2px 22px; color: var(--ink-2); font-size: 16px; max-width: 760px; }

/* --- Pàgines interiors (Sobre el projecte, Privadesa) ------------------- */

.page { padding: 28px 0 40px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--ink-3); margin-bottom: 32px; }
.breadcrumbs a { color: var(--ink-2); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.page-hero { margin-bottom: 40px; }
.page-hero h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.1; letter-spacing: -0.035em; font-weight: 700; margin-bottom: 16px; }
.lead-left { font-size: 19px; color: var(--ink-2); max-width: 720px; }

.prose { font-size: 17px; color: var(--ink-2); }
.prose h2 { font-size: clamp(24px, 3vw, 30px); line-height: 1.25; letter-spacing: -0.02em; color: var(--ink); margin: 48px 0 14px; }
.prose h3 { font-size: 18px; color: var(--ink); margin: 28px 0 8px; }
.prose p + p { margin-top: 14px; }
.prose ul { padding-left: 20px; margin: 12px 0; }
.prose li + li { margin-top: 8px; }
.prose a { color: var(--accent-strong); }
.prose strong { color: var(--ink); }
.prose code { font-size: 14px; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }

.pull {
    margin: 40px 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--brand);
    font-size: 22px; line-height: 1.45; font-weight: 600; color: var(--ink); letter-spacing: -0.01em;
}
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }
.pillars section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.pillars h3 { margin: 0 0 8px; font-size: 17px; }
.pillars p { font-size: 15px; }
.principles { list-style: none; padding: 0 !important; }
.principles li { padding: 14px 0; border-bottom: 1px solid var(--line); margin: 0 !important; }

.summary-box { background: var(--accent-soft); border-radius: var(--radius); padding: 24px 28px; margin-bottom: 8px; }
.summary-box h2 { font-size: 18px; margin-bottom: 10px; color: var(--accent-strong); }
.summary-box ul { margin: 0; padding-left: 20px; color: var(--ink); }
.summary-box li + li { margin-top: 6px; }
.cookies { min-width: 520px; }

.cta-box {
    margin-top: 56px; padding: 36px; text-align: center; border-radius: 20px;
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.cta-box h2 { font-size: 26px; letter-spacing: -0.02em; margin-bottom: 8px; }
.cta-box p { color: var(--ink-2); max-width: 520px; margin: 0 auto 20px; }
.cta-box .btn { text-decoration: none; }

/* --- Guies de català ------------------------------------------------------ */

.guide-meta { font-size: 14px; color: var(--ink-3); margin-top: 10px; }
.quick {
    background: var(--accent-soft); border-left: 4px solid var(--brand);
    border-radius: 0 var(--radius) var(--radius) 0; padding: 18px 22px; margin-bottom: 36px;
}
.quick-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-strong); margin-bottom: 6px; }
.quick p:last-child { font-size: 17px; color: var(--ink); line-height: 1.6; }

.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.prose thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); background: var(--surface-2); }
.prose tr:last-child td { border-bottom: 0; }
.prose .ok { color: #145c33; font-weight: 600; }
.prose .ko { color: #a12a20; text-decoration: line-through; text-decoration-color: rgba(161,42,32,.5); }
.prose .note {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 20px; margin: 20px 0; font-size: 16px;
}
.prose .note strong:first-child { color: var(--accent-strong); }
.prose ol { padding-left: 22px; }

.try-box {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    margin: 44px 0 8px; padding: 24px 26px; border-radius: 16px;
    background: var(--ink); color: #f5f3ee;
}
.try-box .try-title { font-weight: 700; font-size: 18px; color: #fff; margin-bottom: 4px; }
.try-box p { font-size: 15px; color: #d9d4c8; }
.try-box a:not(.btn) { color: #fff; }
.try-box .btn-primary { background: var(--brand); color: var(--ink); flex-shrink: 0; text-decoration: none; }
.try-box .btn-primary:hover { background: #f0b03a; }

.guide-section { margin-top: 52px; }
.guide-section > h2 { font-size: 24px; letter-spacing: -0.02em; margin-bottom: 16px; }
.guide-section > h2 a { color: inherit; text-decoration: none; }
.guide-section > h2 a:hover { text-decoration: underline; }
.guide-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.guide-card {
    display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; text-decoration: none; color: inherit;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.guide-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.card-cluster { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.card-title { font-weight: 600; font-size: 16px; line-height: 1.35; color: var(--ink); }
.card-desc { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.card-badge { align-self: flex-start; margin-top: 4px; font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent-strong); padding: 2px 8px; border-radius: 99px; }
.sources ul { padding-left: 20px; color: var(--ink-2); font-size: 15px; }
.sources li + li { margin-top: 6px; }
.sources a { color: var(--accent-strong); }
.seo #guies .guide-cards { margin-top: 4px; }

/* --- Índex de guies (/guies/) --------------------------------------------- */

.hub-hero { margin-bottom: 28px; }
.hub-search {
    position: relative; display: flex; align-items: center; margin-top: 26px;
    background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px;
    box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.hub-search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(29,27,24,.06), var(--shadow); }
.hub-search svg { position: absolute; left: 18px; width: 20px; height: 20px; color: var(--ink-3); pointer-events: none; }
.hub-search input {
    flex: 1; min-width: 0; height: 58px; padding: 0 56px 0 50px; border: 0; outline: none; background: transparent;
    font: inherit; font-size: 17px; color: var(--ink); border-radius: 14px;
}
.hub-search input::placeholder { color: var(--ink-3); }
.hub-search input::-webkit-search-cancel-button { cursor: pointer; }
.hub-kbd { position: absolute; right: 16px; }
.hub-search:focus-within .hub-kbd { display: none; }
.hub-popular { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; }
.hub-popular span { color: var(--ink-3); margin-right: 2px; }
.hub-popular a {
    text-decoration: none; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line);
    padding: 4px 12px; border-radius: 99px; transition: border-color .15s, color .15s;
}
.hub-popular a:hover { border-color: var(--ink-3); color: var(--ink); }

.hub-chips {
    position: sticky; top: 60px; z-index: 5; display: flex; gap: 8px; overflow-x: auto;
    padding: 12px 0; margin-bottom: 8px; background: var(--bg); scrollbar-width: none;
}
.hub-chips::-webkit-scrollbar { display: none; }
.hub-chips a {
    flex-shrink: 0; text-decoration: none; font-size: 14px; font-weight: 600; color: var(--ink-2);
    background: var(--surface); border: 1px solid var(--line); padding: 7px 14px; border-radius: 99px;
}
.hub-chips a:hover { border-color: var(--ink-3); color: var(--ink); }
.hub-chips a span { font-weight: 500; color: var(--ink-3); margin-left: 2px; }

.hub-cluster { margin-top: 40px; scroll-margin-top: 130px; }
.hub-cluster-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.hub-cluster-head h2 { font-size: 24px; letter-spacing: -0.02em; }
.hub-cluster-head h2 a { color: inherit; text-decoration: none; }
.hub-cluster-head h2 a:hover { text-decoration: underline; }
.hub-cluster-head span { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.hub-pillar {
    display: flex; flex-direction: column; gap: 6px; padding: 20px 22px; margin-bottom: 4px;
    text-decoration: none; color: inherit; border-radius: var(--radius);
    background: var(--accent-soft); border: 1px solid #f1dfbf; transition: box-shadow .15s, transform .15s;
}
.hub-pillar:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.hub-pillar .card-badge { margin: 0 0 2px; background: var(--surface); }
.hub-pillar .card-title { font-size: 18px; }
.hub-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.hub-list li { border-bottom: 1px solid var(--line); }
.hub-list a { display: flex; flex-direction: column; gap: 2px; padding: 14px 2px; text-decoration: none; color: inherit; }
.hub-item-title { font-weight: 600; font-size: 15px; line-height: 1.35; }
.hub-list a:hover .hub-item-title { color: var(--accent-strong); text-decoration: underline; }
.hub-item-desc { font-size: 13px; color: var(--ink-3); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hub-more { display: inline-block; margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--accent-strong); text-decoration: none; }
.hub-more:hover { text-decoration: underline; }

.hub-az { margin-top: 56px; scroll-margin-top: 130px; padding-top: 28px; border-top: 1px solid var(--line); }
.hub-az h2 { font-size: 20px; margin-bottom: 14px; }
.az-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; font-size: 14px; }
.az-list li { break-inside: avoid; padding: 5px 0; }
.az-list a { color: var(--ink-2); text-decoration: none; }
.az-list a:hover { color: var(--ink); text-decoration: underline; }

.search-results { margin-bottom: 20px; }
.search-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.search-count { font-weight: 600; }
.search-empty { padding: 26px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--ink-2); display: grid; gap: 10px; }
.search-empty a { color: var(--accent-strong); font-weight: 600; }

/* Enllaç «Aprèn la regla» al popover del corrector */
.pop-learn { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--accent-strong); text-decoration: none; }
.pop-learn:hover { text-decoration: underline; }
.issue-learn { font-size: 12px; font-weight: 600; color: var(--accent-strong); text-decoration: none; margin-left: 10px; }
.issue-learn:hover { text-decoration: underline; }

/* --- Footer ------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 36px 0 28px; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.footer-inner .muted { font-size: 14px; margin-top: 4px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.footer-copy { margin-top: 28px; font-size: 13px; color: var(--ink-3); }

/* --- Avís de galetes ----------------------------------------------------- */

.cookie-banner {
    position: fixed; z-index: 70; left: 20px; bottom: 20px; width: min(440px, calc(100vw - 40px));
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: var(--shadow-pop); padding: 18px 20px;
    animation: pop-in .2s ease-out;
}
.cookie-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.cookie-text { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.cookie-text a { color: var(--accent-strong); }
.cookie-actions { display: flex; gap: 8px; margin-top: 14px; }
.cookie-actions .btn { flex: 1; height: 38px; font-size: 14px; }
.link-like {
    border: 0; background: none; padding: 0; font: inherit; font-size: 14px;
    color: var(--ink-2); cursor: pointer; text-decoration: none;
}
.link-like:hover { color: var(--ink); text-decoration: underline; }

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 980px) {
    .tool-grid { grid-template-columns: 1fr; }
    .panel { max-height: 520px; }
}

@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .site-nav a:nth-child(n+3) { display: none; }
    .site-nav a { padding: 6px 8px; }
    .hero { padding-top: 36px; padding-bottom: 24px; }
    .lead { font-size: 16px; }
    .editor-body { height: 52vh; min-height: 320px; }
    #input-text, .result-view { padding: 16px; font-size: 16px; }
    .kbd-hint { display: none; }
    .editor-bar { flex-wrap: wrap; }
    .quota { order: 3; width: 100%; margin: 2px 0 0; }
    .quota-meter { width: 72px; }
    .editor-foot { flex-direction: column; align-items: stretch; }
    .foot-actions { justify-content: flex-end; }
    #input-actions .btn-primary { flex: 1; }
    #result-actions .view-toggle { flex: 1; }
    #result-actions .view-toggle button { flex: 1; }
    .two-col, .tips-list, .features, .steps, .facts { grid-template-columns: 1fr; }
    .facts dt { width: 96px; }
    .pillars { grid-template-columns: 1fr; }
    .lead-left { font-size: 17px; }
    .prose { font-size: 16px; }
    .pull { font-size: 19px; }
    .cta-box { padding: 28px 20px; }
    .cookie-banner { left: 12px; right: 12px; bottom: 12px; width: auto; }
    .guide-cards { grid-template-columns: 1fr; }
    .hub-list { grid-template-columns: 1fr; }
    .az-list { columns: 1; }
    .hub-kbd { display: none; }
    .hub-search input { height: 52px; font-size: 16px; padding-right: 16px; }
    .hub-chips { top: 60px; }
    .try-box { flex-direction: column; align-items: stretch; text-align: left; padding: 22px; }
    .quick { padding: 16px 18px; }
    .quick p:last-child { font-size: 16px; }
    .about-lead { font-size: 16px; }
    .tips { padding: 24px; }
    .seo { padding-top: 48px; }
    .seo-block + .seo-block { margin-top: 56px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
