/* ============================================================
   RosterMates blog + free NZ leave tools
   Loaded by Views/Blog/* and Views/Tools/* (landing layout).
   Self-contained: does NOT depend on landing.css.
   ============================================================ */

:root {
    --bg-page: #eff4ff;
    --bg-card: #ffffff;
    --bg-soft: #f5f8ff;
    --brand: #155dee;
    --brand-dark: #163cc4;
    --brand-tint: #e8effe;
    --ink: #101828;
    --ink-2: #344054;
    --ink-3: #475467;
    --ink-4: #667085;
    --line: #e4e7ec;
    --line-2: #d0d5dd;
    --ok: #12b76a;
    --ok-bg: #ecfdf3;
    --ok-ink: #027a48;
    --warn: #f79009;
    --warn-bg: #fffaeb;
    --warn-ink: #b54708;
    --bad: #f04438;
    --bad-bg: #fef3f2;
    --bad-ink: #b42318;
    --violet: #7a5af8;
    --violet-bg: #f4f3ff;
    --violet-ink: #5925dc;
    --radius: 14px;
    --shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
    --shadow-2: 0 12px 32px rgba(16, 24, 40, 0.10);
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-head: 'Manrope', 'Inter', system-ui, sans-serif;
}

body {
    font-family: var(--font-body);
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg-page);
    overflow-x: hidden;
}

.blog-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 5rem;
}

.blog-shell h1, .blog-shell h2, .blog-shell h3, .blog-shell h4 {
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
}

.blog-shell a { color: var(--brand); }
.blog-shell a:hover { color: var(--brand-dark); }

/* ── Breadcrumb ─────────────────────────────────────────── */
.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    font-size: 0.85rem;
    color: var(--ink-4);
    margin-bottom: 1.25rem;
    list-style: none;
    padding: 0;
}
.crumbs li + li::before { content: "›"; margin-right: 0.4rem; color: var(--line-2); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }

/* ── Badges / pills ─────────────────────────────────────── */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: var(--brand-tint);
    color: var(--brand-dark);
    white-space: nowrap;
}
.pill--soon { background: var(--warn-bg); color: var(--warn-ink); }
.pill--pillar { background: var(--violet-bg); color: var(--violet-ink); }
.pill--free { background: var(--ok-bg); color: var(--ok-ink); }
.pill--ghost { background: transparent; border: 1px solid var(--line-2); color: var(--ink-3); }

/* ── Hub hero ───────────────────────────────────────────── */
.blog-hero {
    text-align: center;
    max-width: 820px;
    margin: 0 auto 3rem;
}
.blog-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 0.75rem; }
.blog-hero p { color: var(--ink-3); font-size: 1.1rem; }
.blog-hero .principle {
    margin-top: 1.25rem;
    display: inline-block;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-size: 0.92rem;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 0 0 1.25rem;
}
.section-head h2 { font-size: 1.5rem; }
.section-head p { color: var(--ink-3); margin: 0; }
.section-head a { font-weight: 600; text-decoration: none; white-space: nowrap; }

/* ── Category cards ─────────────────────────────────────── */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3.5rem;
}
.cat-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.cat-card:not(.is-soon):hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--brand); }
.cat-card.is-soon { opacity: 0.85; }
.cat-card__top { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.cat-card h2, .cat-card h3 { font-size: 1.35rem; margin: 0; }
.cat-card h2 a, .cat-card h3 a { color: var(--ink); text-decoration: none; }
.cat-card h2 a::after { content: ""; position: absolute; inset: 0; }
.cat-card p { color: var(--ink-3); margin: 0; }
.cat-card__count { font-size: 0.82rem; color: var(--ink-4); }
.subtopics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.subtopics li {
    font-size: 0.82rem;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    color: var(--ink-2);
}
.subtopics li a { color: inherit; text-decoration: none; position: relative; z-index: 1; }
.cat-card__cta { margin-top: auto; font-weight: 600; color: var(--brand); font-size: 0.95rem; }

/* ── Post cards ─────────────────────────────────────────── */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.post-card:not(.is-soon):hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--brand); }
.post-card.is-pillar { grid-column: 1 / -1; border-color: var(--brand); background: linear-gradient(135deg, #ffffff 0%, #f3f7ff 100%); }
.post-card.is-pillar h3 { font-size: 1.5rem; }
.post-card.is-soon { background: var(--bg-soft); border-style: dashed; }
.post-card__pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.post-card h3 { font-size: 1.15rem; margin: 0; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a::after { content: ""; position: absolute; inset: 0; }
.post-card p { color: var(--ink-3); margin: 0; font-size: 0.95rem; }
.post-card__meta { margin-top: auto; font-size: 0.82rem; color: var(--ink-4); display: flex; gap: 0.75rem; flex-wrap: wrap; }
.post-card__meta strong { color: var(--ink-2); font-weight: 600; }

/* ── Category page ──────────────────────────────────────── */
.cat-header { max-width: 860px; margin-bottom: 2.5rem; }
.cat-header h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0.5rem 0 0.75rem; }
.cat-header p { color: var(--ink-3); font-size: 1.08rem; }
.cat-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
}
.cat-nav a {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    color: var(--ink-2);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}
.cat-nav a:hover { border-color: var(--brand); color: var(--brand); }
.subtopic-section { margin-bottom: 3rem; scroll-margin-top: 100px; }
.subtopic-section h2 { font-size: 1.45rem; margin-bottom: 0.35rem; }
.subtopic-section > p { color: var(--ink-3); margin: 0 0 1.25rem; max-width: 760px; }

/* ── Tools strip (hub / category) ───────────────────────── */
.tools-strip {
    background: linear-gradient(135deg, #0f2f7a 0%, var(--brand) 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 2rem;
    margin: 0 0 3.5rem;
    display: grid;
    grid-template-columns: 1.2fr 2fr;
    gap: 2rem;
    align-items: center;
}
.tools-strip h2 { color: #fff; font-size: 1.5rem; margin-bottom: 0.5rem; }
.tools-strip p { color: rgba(255,255,255,0.85); margin: 0; }
.tools-strip__list { display: grid; gap: 0.75rem; }
.tools-strip__item {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    color: #fff;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    transition: background .15s ease;
}
.tools-strip__item:hover { background: rgba(255,255,255,0.18); color: #fff; }
.tools-strip__item.is-soon { opacity: 0.6; cursor: default; }
.tools-strip__item strong { display: block; font-size: 0.98rem; }
.tools-strip__item span { font-size: 0.85rem; color: rgba(255,255,255,0.8); }
.tools-strip__item .pill { background: #fff; color: var(--brand-dark); }
@media (max-width: 800px) { .tools-strip { grid-template-columns: 1fr; } }

/* ── Post page layout ───────────────────────────────────── */
.progress-bar {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    background: var(--brand);
    z-index: 9999;
    transition: width .1s linear;
}
.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 3rem;
    align-items: start;
}
@media (max-width: 1000px) {
    .blog-shell { padding-top: 4rem; }
    .post-layout { grid-template-columns: 1fr; }
    .post-aside { order: -1; }
}

.post-header { margin-bottom: 2rem; }
.post-kicker { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.post-header h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); margin-bottom: 1rem; letter-spacing: -0.01em; }
.post-header .lede { font-size: 1.15rem; color: var(--ink-2); max-width: 760px; }
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
    font-size: 0.88rem;
    color: var(--ink-4);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}
.post-meta strong { color: var(--ink-2); font-weight: 600; }

.post-aside { position: sticky; top: 96px; display: grid; gap: 1.25rem; }
.toc {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    max-height: calc(100vh - 130px);
    overflow: auto;
}
.toc h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-4); margin-bottom: 0.6rem; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a {
    display: block;
    padding: 0.32rem 0.5rem;
    border-left: 2px solid transparent;
    color: var(--ink-3);
    text-decoration: none;
    font-size: 0.86rem;
    line-height: 1.35;
    border-radius: 0 6px 6px 0;
}
.toc a:hover { color: var(--brand); background: var(--bg-soft); }
.toc a.active { color: var(--brand); border-left-color: var(--brand); background: var(--brand-tint); font-weight: 600; }
.toc li.h3 a { padding-left: 1.2rem; font-size: 0.8rem; }
.aside-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    font-size: 0.9rem;
}
.aside-card h3 { font-size: 0.95rem; margin-bottom: 0.5rem; }
.aside-card ul { margin: 0; padding-left: 1.1rem; color: var(--ink-3); }
.aside-card li { margin: 0.25rem 0; }
.aside-card .btn { margin-top: 0.75rem; }

/* ── Article body typography ───────────────────────────── */
.post-body {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(1.25rem, 3vw, 2.75rem);
    box-shadow: var(--shadow);
    font-size: 1.04rem;
    min-width: 0;
}
.post-body > * + * { margin-top: 1.1rem; }
.post-body h2 {
    font-size: 1.7rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    scroll-margin-top: 90px;
}
.post-body h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.post-body h3 { font-size: 1.25rem; margin-top: 2rem; scroll-margin-top: 90px; }
.post-body h4 { font-size: 1.05rem; margin-top: 1.5rem; }
.post-body h2 a.anchor, .post-body h3 a.anchor { color: var(--line-2); text-decoration: none; margin-left: 0.4rem; font-weight: 400; opacity: 0; }
.post-body h2:hover a.anchor, .post-body h3:hover a.anchor { opacity: 1; }
.post-body p { color: var(--ink-2); }
.post-body ul, .post-body ol { padding-left: 1.4rem; color: var(--ink-2); }
.post-body li { margin: 0.35rem 0; }
.post-body li::marker { color: var(--brand); }
.post-body strong { color: var(--ink); }
.post-body blockquote {
    border-left: 3px solid var(--brand);
    padding: 0.5rem 1rem;
    color: var(--ink-3);
    font-style: italic;
    background: var(--bg-soft);
    border-radius: 0 10px 10px 0;
}
.post-body code { background: var(--bg-soft); border: 1px solid var(--line); padding: 0.05rem 0.35rem; border-radius: 5px; font-size: 0.9em; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.post-body figure { margin: 1.5rem 0; }
.post-body figcaption { font-size: 0.85rem; color: var(--ink-4); margin-top: 0.4rem; }
.flowchart { margin: 1.25rem 0; }
.flowchart svg { max-width: 100%; }
.post-body .small { font-size: 0.9rem; color: var(--ink-4); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.post-body table, .tw-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
    background: var(--bg-card);
}
.post-body th, .tw-table th {
    text-align: left;
    background: var(--bg-soft);
    color: var(--ink-2);
    font-weight: 600;
    padding: 0.65rem 0.8rem;
    border-bottom: 2px solid var(--line-2);
    white-space: nowrap;
}
.post-body td, .tw-table td { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.post-body tr:last-child td { border-bottom: 0; }

/* Callouts */
.callout {
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    background: var(--bg-soft);
    border-radius: 10px;
    padding: 1rem 1.2rem;
}
.callout > :first-child { margin-top: 0; }
.callout > * + * { margin-top: 0.6rem; }
.callout__title { font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-head); }
.callout--warn { border-left-color: var(--warn); background: var(--warn-bg); }
.callout--tip { border-left-color: var(--ok); background: var(--ok-bg); }
.callout--rule { border-left-color: var(--violet); background: var(--violet-bg); }
.callout--example { border-left-color: var(--ink-4); background: #fafafa; }
.callout--rule .callout__title { color: var(--violet-ink); }
.callout--warn .callout__title { color: var(--warn-ink); }
.callout--tip .callout__title { color: var(--ok-ink); }
.callout p:last-child { margin-bottom: 0; }

/* "Rule" boxes: legislation vs our approach */
.compare-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 720px) { .compare-2 { grid-template-columns: 1fr; } }
.compare-2 > div { border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; background: var(--bg-card); }
.compare-2 > div h4 { margin: 0 0 0.5rem; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-4); }
.compare-2 > div.ours { border-color: var(--brand); background: var(--brand-tint); }
.compare-2 > div.ours h4 { color: var(--brand-dark); }

/* Definition cards */
.defs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.9rem; }
.def {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.95rem 1.05rem;
    background: var(--bg-card);
}
.def dt { font-family: var(--font-head); font-weight: 700; color: var(--ink); margin-bottom: 0.3rem; display: flex; gap: 0.5rem; align-items: center; }
.def dt .pill { font-size: 0.68rem; }
.def dd { margin: 0; color: var(--ink-3); font-size: 0.93rem; }

/* Step flow */
.flow { counter-reset: step; display: grid; gap: 0.6rem; }
.flow > div {
    display: grid;
    grid-template-columns: 2rem 1fr;
    gap: 0.75rem;
    align-items: start;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
}
.flow > div::before {
    counter-increment: step;
    content: counter(step);
    width: 2rem; height: 2rem;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
}
.flow .yes { color: var(--ok-ink); font-weight: 600; }
.flow .no { color: var(--bad-ink); font-weight: 600; }

/* Outcome chips inside tables */
.chip { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 6px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.chip--yes { background: var(--ok-bg); color: var(--ok-ink); }
.chip--no { background: var(--bad-bg); color: var(--bad-ink); }
.chip--maybe { background: var(--warn-bg); color: var(--warn-ink); }

/* Embedded tool inside a post */
.tool-embed {
    border: 2px solid var(--brand);
    border-radius: var(--radius);
    background: var(--bg-card);
    padding: 1.4rem;
    margin: 2rem 0;
}
.tool-embed__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.tool-embed__head h3 { margin: 0; font-size: 1.25rem; }
.tool-embed__head a { font-size: 0.88rem; font-weight: 600; text-decoration: none; }
.tool-embed .tool-instructions { margin-top: 1rem; font-size: 0.92rem; color: var(--ink-3); }

/* Full-width block between the article and the trailer (used for the decision tree) */
.post-wide { margin: 2.5rem 0 0; }
.post-wide h2 { font-size: 1.7rem; margin-bottom: 0.5rem; scroll-margin-top: 90px; }
.post-wide > p { color: var(--ink-2); font-size: 1.04rem; max-width: 860px; }
.post-layout--after { margin-top: 2.5rem; }

/* Featured businesses */
.featured {
    margin: 2.5rem 0;
    padding: 1.5rem;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #f8faff 0%, #eef3ff 100%);
    border: 1px solid #cfdcff;
}
.featured h2, .featured h3 { margin-top: 0 !important; padding-top: 0 !important; border-top: 0 !important; font-size: 1.4rem; }
.featured > p { color: var(--ink-3); margin-bottom: 1.1rem; }
.featured-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.9rem; }
.featured-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 150px;
}
.featured-card__n { font-size: 0.75rem; font-weight: 700; color: var(--brand); letter-spacing: 0.08em; text-transform: uppercase; }
.featured-card h4 { margin: 0; font-size: 1.05rem; }
.featured-card h4 a { color: var(--ink); text-decoration: none; }
.featured-card h4 a:hover { color: var(--brand); }
.featured-card p { margin: 0; font-size: 0.92rem; color: var(--ink-3); }
.featured-card small { color: var(--ink-4); }
.featured-card--open { border-style: dashed; background: rgba(255,255,255,0.6); justify-content: center; align-items: flex-start; }
.featured-card--open h4 { color: var(--ink-3); font-weight: 600; }
.featured-card--open a.btn { margin-top: 0.4rem; }
.featured__foot { margin-top: 1rem; font-size: 0.88rem; color: var(--ink-4); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    border: 1px solid var(--brand);
    color: var(--brand);
    background: var(--bg-card);
    cursor: pointer;
    transition: all .15s ease;
    line-height: 1.2;
}
.btn:hover { background: var(--brand-tint); color: var(--brand-dark); }
.btn--solid { background: var(--brand); color: #fff; }
.btn--solid:hover { background: var(--brand-dark); color: #fff; }
.blog-shell .btn--solid, .blog-shell .btn--solid:hover { color: #fff; }
.btn--sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }

/* Author, related, disclaimer */
.author-box {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 1rem;
    align-items: start;
    margin-top: 2.5rem;
    padding: 1.25rem;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--line);
}
.author-box img { width: 56px; height: 56px; border-radius: 12px; object-fit: contain; background: var(--bg-soft); padding: 6px; border: 1px solid var(--line); }
.author-box h3 { font-size: 1rem; margin: 0 0 0.3rem; }
.author-box p { margin: 0; color: var(--ink-3); font-size: 0.93rem; }
.author-box p + p { margin-top: 0.4rem; }
.disclaimer { margin-top: 1.25rem; font-size: 0.85rem; color: var(--ink-4); }
.related { margin-top: 3rem; }
.related h2 { font-size: 1.5rem; margin-bottom: 1rem; }

.sources ol { padding-left: 1.3rem; font-size: 0.92rem; }
.sources li { margin: 0.3rem 0; word-break: break-word; }

/* FAQ */
.faq details {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-card);
    padding: 0.2rem 1rem;
}
.faq details + details { margin-top: 0.6rem; }
.faq summary { cursor: pointer; font-weight: 600; padding: 0.7rem 0; color: var(--ink); font-family: var(--font-head); }
.faq details p { margin: 0 0 0.9rem; color: var(--ink-2); }

/* ── Tool pages ─────────────────────────────────────────── */
.tool-page { max-width: 980px; margin: 0 auto; }
.tool-page header.tool-header { margin-bottom: 1.5rem; }
.tool-header h1 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); margin: 0.5rem 0 0.6rem; }
.tool-header p { color: var(--ink-3); font-size: 1.08rem; max-width: 780px; }
.tool-widget {
    background: var(--bg-card);
    border: 2px solid var(--brand);
    border-radius: var(--radius);
    padding: clamp(1rem, 2.5vw, 1.75rem);
    box-shadow: var(--shadow);
}
.tool-section { margin-top: 2.5rem; }
.tool-section h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.tool-section h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
.tool-section p, .tool-section li { color: var(--ink-2); }
.tool-section ul, .tool-section ol { padding-left: 1.4rem; }
.tool-section .callout { margin: 1rem 0; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 0.6rem;
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tool-card:not(.is-soon):hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--brand); }
.tool-card.is-soon { border-style: dashed; background: var(--bg-soft); }
.tool-card h3 { margin: 0; font-size: 1.15rem; }
.tool-card h3 a { color: var(--ink); text-decoration: none; }
.tool-card h3 a::after { content: ""; position: absolute; inset: 0; }
.tool-card p { margin: 0; color: var(--ink-3); font-size: 0.95rem; }

/* ── Tool widget internals (tw-*) ───────────────────────── */
.tw-row { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: flex-end; }
.tw-field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 150px; flex: 1 1 160px; }
.tw-field label, .tw-label { font-size: 0.8rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.tw-input, .tw-select {
    font: inherit;
    font-size: 0.98rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    width: 100%;
}
.tw-input:focus, .tw-select:focus { outline: 2px solid var(--brand-tint); border-color: var(--brand); }
.tw-help { font-size: 0.83rem; color: var(--ink-4); }
.tw-btn {
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--line-2);
    background: #fff;
    color: var(--ink-2);
    cursor: pointer;
    transition: all .15s ease;
}
.tw-btn:hover { border-color: var(--brand); color: var(--brand); }
.tw-btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.tw-btn--primary:hover { background: var(--brand-dark); color: #fff; }
.tw-btn.is-active { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-dark); }
.tw-btn--sm { padding: 0.35rem 0.7rem; font-size: 0.82rem; }
.tw-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.tw-seg button { font: inherit; font-size: 0.9rem; font-weight: 600; padding: 0.5rem 0.9rem; border: 0; background: #fff; color: var(--ink-3); cursor: pointer; }
.tw-seg button + button { border-left: 1px solid var(--line-2); }
.tw-seg button.is-active { background: var(--brand); color: #fff; }
.tw-status { font-size: 0.88rem; color: var(--ink-4); margin-top: 0.5rem; min-height: 1.2em; }
.tw-error { color: var(--bad-ink); background: var(--bad-bg); border: 1px solid #fecdca; border-radius: 8px; padding: 0.6rem 0.8rem; font-size: 0.9rem; }
.tw-table-wrap { overflow-x: auto; margin-top: 1rem; border: 1px solid var(--line); border-radius: 10px; }
.tw-table td.tw-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tw-table tr.is-moved td { background: var(--warn-bg); }
.tw-table tr.is-regional td { background: #f7f5ff; }
.tw-badge { display: inline-block; padding: 0.12rem 0.5rem; border-radius: 6px; font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
.tw-badge--moved { background: var(--warn); color: #fff; }
.tw-badge--regional { background: var(--violet); color: #fff; }
.tw-badge--national { background: var(--line); color: var(--ink-2); }
.tw-badge--fri { background: var(--ok-bg); color: var(--ok-ink); }
.tw-legend { display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.83rem; color: var(--ink-3); margin-top: 0.75rem; }
.tw-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.tw-sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--line-2); }

/* Pattern builder */
.tw-pattern { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.4rem; margin-top: 0.6rem; }
@media (max-width: 520px) { .tw-pattern { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tw-day {
    border: 1px solid var(--line-2);
    border-radius: 10px;
    padding: 0.5rem 0.4rem;
    background: #fff;
    text-align: center;
    cursor: pointer;
    user-select: none;
    display: flex; flex-direction: column; gap: 0.25rem; align-items: center;
    transition: all .12s ease;
}
.tw-day .tw-day__n { font-size: 0.7rem; color: var(--ink-4); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.tw-day .tw-day__state { font-weight: 700; font-size: 0.85rem; color: var(--ink-3); }
.tw-day input { width: 3.6rem; font: inherit; font-size: 0.85rem; padding: 0.2rem 0.3rem; text-align: center; border: 1px solid var(--line-2); border-radius: 6px; }
.tw-day.is-on { background: var(--ok-bg); border-color: var(--ok); }
.tw-day.is-on .tw-day__state { color: var(--ok-ink); }
.tw-day.is-off { background: #fafafa; }
.tw-day.is-target { outline: 3px solid var(--brand); }
.tw-presets { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }

/* Lookback grid */
.tw-lookback { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.4rem; margin-top: 0.6rem; }
.tw-lb {
    border: 1px solid var(--line-2);
    border-radius: 10px;
    padding: 0.45rem 0.5rem;
    background: #fff;
    cursor: pointer;
    display: flex; align-items: center; gap: 0.45rem;
    font-size: 0.85rem;
    user-select: none;
}
.tw-lb input { margin: 0; }
.tw-lb.is-on { background: var(--ok-bg); border-color: var(--ok); }
.tw-lb small { color: var(--ink-4); display: block; font-size: 0.72rem; }
.tw-meter { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 0.75rem; }
.tw-meter > div { height: 100%; background: var(--ok); transition: width .2s ease; }
.tw-meter.is-short > div { background: var(--warn); }

/* Result panels */
.tw-result {
    margin-top: 1.25rem;
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--line);
    background: var(--bg-soft);
}
.tw-result h3, .tw-result h4 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.tw-result p { margin: 0.35rem 0; color: var(--ink-2); font-size: 0.95rem; }
.tw-result ul { margin: 0.4rem 0 0; padding-left: 1.2rem; color: var(--ink-2); font-size: 0.95rem; }
.tw-result--yes { background: var(--ok-bg); border-color: #a6f4c5; }
.tw-result--no { background: var(--bad-bg); border-color: #fecdca; }
.tw-result--warn { background: var(--warn-bg); border-color: #fedf89; }
.tw-result--info { background: var(--brand-tint); border-color: #b2ccff; }
.tw-verdict { font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; display: flex; align-items: center; gap: 0.5rem; }
.tw-verdict--yes { color: var(--ok-ink); }
.tw-verdict--no { color: var(--bad-ink); }
.tw-verdict--warn { color: var(--warn-ink); }
.tw-entitle { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.6rem; margin-top: 0.75rem; }
.tw-entitle > div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0.7rem 0.85rem; font-size: 0.9rem; }
.tw-entitle strong { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-4); margin-bottom: 0.2rem; }
.tw-entitle .v { font-weight: 700; color: var(--ink); font-size: 1rem; }
.tw-entitle .v.ok { color: var(--ok-ink); }
.tw-entitle .v.bad { color: var(--bad-ink); }
.tw-amount { font-family: var(--font-head); font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.tw-steps { display: grid; gap: 0.75rem; margin-top: 0.75rem; }
.tw-step { border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1rem; background: #fff; }
.tw-step.is-disabled { opacity: 0.45; pointer-events: none; }
.tw-step__q { font-weight: 700; color: var(--ink); margin-bottom: 0.5rem; display: flex; gap: 0.5rem; align-items: baseline; }
.tw-step__q .tw-n { color: var(--brand); font-family: var(--font-head); }
.tw-step .tw-help { margin-top: 0.4rem; }
.tw-choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tw-choice { font: inherit; font-size: 0.9rem; font-weight: 600; padding: 0.5rem 0.9rem; border-radius: 9px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); cursor: pointer; }
.tw-choice:hover { border-color: var(--brand); color: var(--brand); }
.tw-choice.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.tw-calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.6rem; margin-top: 0.6rem; }
.tw-muted { color: var(--ink-4); font-size: 0.85rem; }
.tw-hide { display: none !important; }
.tw-print { text-align: right; margin-top: 0.75rem; }

@media print {
    .rm-header, .rm-mobile-menu, footer, .post-aside, .progress-bar, .tools-strip, .related, .featured { display: none !important; }
    .post-layout { grid-template-columns: 1fr; }
    .post-body, .tool-widget { border: 0; box-shadow: none; padding: 0; }
}

/* Mobile overrides for rules declared above (must stay LAST in the file). */
@media (max-width: 1000px) {
    .post-aside { position: static; }
    .toc { max-height: 260px; }
    .post-aside .aside-card { display: none; }
}
