/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face { font-family: "Schibsted Grotesk"; font-weight: 600; font-display: swap; src: url("../fonts/schibsted-grotesk-600.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 700; font-display: swap; src: url("../fonts/schibsted-grotesk-700.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 800; font-display: swap; src: url("../fonts/schibsted-grotesk-800.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-600.woff2") format("woff2"); }
/* Sinhala letters only (unicode-range), so other pages never download it. Variable font: one file for every weight. */
@font-face { font-family: "Noto Sans Sinhala"; font-weight: 100 900; font-display: swap; src: url("../fonts/noto-sans-sinhala.woff2") format("woff2"); unicode-range: U+0964-0965, U+0D81-0DF4, U+1CF2, U+200C-200D, U+25CC, U+111E1-111F4; }
@font-face { font-family: "Dancing Script"; font-weight: 600; font-display: swap; src: url("../fonts/dancing-script-600.woff2") format("woff2"); }
@font-face { font-family: "Great Vibes"; font-weight: 400; font-display: swap; src: url("../fonts/great-vibes-400.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
    color-scheme: light;

    --ink: #0F1D3A;          /* navy: text, statement panels, hero */
    --ink-2: #1B2C52;        /* raised navy surfaces */
    --slate: #55627A;        /* secondary text */
    --slate-2: #657186;      /* tertiary text, placeholders (4.8:1 on white) */
    --canvas: #F5F7FA;       /* page background */
    --paper: #FFFFFF;        /* panels */
    --mist: #EEF2F7;         /* subtle fills */
    --line: #E2E7EF;         /* borders */
    --line-strong: #CBD3DF;

    --signal: #FF5A1F;       /* the one accent */
    --signal-deep: #E2470F;
    --signal-soft: #FFF0E8;
    --signal-ink: #B23A0C;   /* accent text on light backgrounds (AA contrast) */
    --signal-fill: #D4410E;  /* filled buttons: white text on it is 4.6:1 (AA) */

    --good: #0B7D55;
    --good-soft: #E3F5EE;
    --warn: #B26A00;
    --warn-soft: #FFF4DE;
    --bad: #C4352B;
    --bad-soft: #FDECEA;

    /* chart colors, tuned for the navy statement panel */
    --c1: #FF7A45;
    --c2: #7FB2FF;
    --c3: #4FD6A8;
    --c4: #FFC857;
    --c5: #C3A6FF;

    --display: "Schibsted Grotesk", "Noto Sans Sinhala", "Helvetica Neue", Arial, sans-serif;
    --text: "IBM Plex Sans", "Noto Sans Sinhala", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --r-control: 8px;
    --r-panel: 14px;
    --shadow-1: 0 1px 2px rgb(15 29 58 / 0.06);
    --shadow-2: 0 1px 2px rgb(15 29 58 / 0.05), 0 8px 24px -12px rgb(15 29 58 / 0.18);
    --shadow-3: 0 2px 4px rgb(15 29 58 / 0.06), 0 24px 48px -16px rgb(15 29 58 / 0.35);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font: 400 16px/1.6 var(--text);
    font-feature-settings: "tnum" 0;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: clamp(2rem, 1.55rem + 1.8vw, 2.75rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: 1.45rem; font-weight: 700; }
h3 { font-size: 1.12rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--signal-ink); text-underline-offset: 3px; }
a:hover { color: var(--signal-deep); }
img { max-width: 100%; height: auto; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--mist); padding: 1px 6px; border-radius: 5px; }
kbd { font-family: var(--text); font-size: 0.75rem; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; color: var(--slate); background: var(--paper); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--signal) 55%, transparent); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--signal) 25%, transparent); }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }

/* !important so element styles (e.g. full-width inputs) can never make hidden elements take up space. */
.visually-hidden {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
    overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important;
}
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 8px; z-index: 50; background: var(--paper); padding: 8px 12px; border-radius: var(--r-control); }

.icon {
    width: 1.25em; height: 1.25em; flex-shrink: 0;
    fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 20;
    background: rgb(255 255 255 / 0.92);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 28px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 32px; height: 32px; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 1.22rem; letter-spacing: -0.01em; }
.brand-inverse { color: #fff; }
.brand-inverse:hover { color: #fff; }

.main-nav { display: flex; gap: 2px; flex: 1; }
.main-nav a {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 12px; border-radius: var(--r-control);
    color: var(--slate); text-decoration: none; font-weight: 500; font-size: 0.95rem; white-space: nowrap;
}
.main-nav a .icon { width: 1.1em; height: 1.1em; }
.main-nav a:hover { color: var(--ink); background: var(--mist); }

.search-trigger {
    display: inline-flex; align-items: center; gap: 10px; min-width: 220px;
    font: 500 0.92rem var(--text); color: var(--slate-2);
    background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-control);
    padding: 8px 10px 8px 12px; cursor: pointer;
}
.search-trigger span { flex: 1; text-align: left; }
.search-trigger:hover { border-color: var(--line-strong); color: var(--slate); }

/* With eight categories the menu shows text only (the icons stay in the mobile menu), so it fits next to the search box. */
.header-inner { gap: 16px; }
.main-nav a { padding: 8px 10px; }
.main-nav a .icon { display: none; }
@media (max-width: 1100px) {
    .search-trigger { min-width: 0; }
    .search-trigger span, .search-trigger kbd { display: none; }
}
/* ---------- Mobile header & menu ---------- */
.menu-toggle, .menu-close {
    display: none; place-items: center; width: 44px; height: 44px; padding: 0; cursor: pointer;
    color: var(--ink); background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-control);
}
.menu-toggle .icon, .menu-close .icon { width: 22px; height: 22px; }
@media (max-width: 900px) {
    .header-inner { gap: 8px; min-height: 60px; }
    .brand { flex: 1; min-width: 0; }
    .main-nav { display: none; }
    .search-trigger { width: 44px; height: 44px; padding: 0; justify-content: center; }
    .search-trigger .icon { width: 20px; height: 20px; }
    .menu-toggle { display: inline-grid; }
}

html.menu-open { overflow: hidden; }

/* ---------- Search dialog ---------- */
.search-panel {
    width: min(640px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 120px));
    margin: 12vh auto 0; padding: 0; border: 0; border-radius: var(--r-panel);
    background: var(--paper); color: var(--ink); box-shadow: var(--shadow-3);
    overflow: hidden; display: none; flex-direction: column;
}
.search-panel[open] { display: flex; }
.search-panel::backdrop { background: rgb(15 29 58 / 0.45); backdrop-filter: blur(2px); }
.search-field { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--slate); }
.search-field input { flex: 1; border: 0; outline: 0; font: 500 1.08rem var(--text); color: var(--ink); background: transparent; padding: 4px 0; }
.search-close { border: 0; background: var(--mist); color: var(--slate); border-radius: var(--r-control); padding: 6px; cursor: pointer; display: inline-flex; }
.search-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.search-results { list-style: none; margin: 0; padding: 8px; }
.search-results .search-label { padding: 8px 12px 2px; color: var(--slate); font-size: 0.85rem; font-weight: 600; }

/* Browsing in the search panel (phones and tablets, before anything is typed): sections and other ways in. */
.search-browse { display: none; padding: 4px 16px 20px; }
@media (max-width: 1099px) { .search-panel.is-empty .search-browse { display: block; } }
.search-browse-title { margin: 6px 4px 10px; color: var(--slate); font-size: 0.85rem; font-weight: 600; }
.mobile-menu-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; }
.mobile-menu-list a { display: flex; align-items: center; gap: 10px; height: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; }
.mobile-menu-list a:active { background: var(--signal-soft); }
.mobile-menu-list .side-dot-lg, .mobile-menu-list .category-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; }
.mobile-menu-list .category-icon .icon, .mobile-menu-list .side-dot-lg .icon { width: 19px; height: 19px; }
.mobile-menu-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.mobile-menu-text strong { font-weight: 600; font-size: 0.92rem; }
.mobile-menu-text small { color: var(--slate); font-size: 0.78rem; }
.mobile-menu-chevron { display: none; }
.mobile-menu-all {
    display: block; margin: 12px 0 0; padding: 13px; text-align: center; font-weight: 600; text-decoration: none;
    color: #fff; background: var(--signal-fill); border-radius: 12px;
}
.mobile-menu-all:hover, .mobile-menu-all:active { color: #fff; background: var(--signal-ink); }
.mobile-menu-small { list-style: none; display: flex; justify-content: center; gap: 22px; margin: 16px 0 0; padding: 0; }
.mobile-menu-small a { color: var(--slate); text-decoration: none; font-size: 0.92rem; }
/* Where the tab bar has Search, the header doesn't need its own search button. */
@media (max-width: 1099px) {
    .site-header .search-trigger { display: none; }
    .site-header .brand { margin-right: auto; }
}
.search-results a {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-control);
    color: var(--ink); text-decoration: none;
}
.search-results a span:last-child { margin-left: auto; color: var(--slate-2); font-size: 0.85rem; }
.search-results a[aria-selected="true"], .search-results a:hover { background: var(--signal-soft); }
.search-empty { padding: 20px 12px; color: var(--slate); }

/* ---------- Page heads ---------- */
.page-head { background: var(--paper); border-bottom: 1px solid var(--line); padding: 22px 0 30px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.88rem; color: var(--slate-2); margin-bottom: 18px; }
.breadcrumbs a { color: var(--slate); text-decoration: none; }
.breadcrumbs a:hover { color: var(--signal-ink); }
.tool-header { display: flex; align-items: flex-start; gap: 18px; }
.tool-header-text { flex: 1; min-width: 0; }
.tool-header h1 { margin-bottom: 8px; }
.lead { color: var(--slate); font-size: 1.1rem; max-width: 66ch; margin: 0; }
.page-body { padding-top: 32px; padding-bottom: 56px; }
@media (max-width: 600px) {
    .tool-header { flex-wrap: wrap; }
    .tool-icon-lg { display: none !important; }
}

.tool-icon {
    display: inline-grid; place-items: center; flex-shrink: 0;
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--signal-soft); color: var(--signal-deep);
    transition: background 0.15s, color 0.15s;
}
.tool-icon .icon { width: 21px; height: 21px; }
.tool-icon-lg { width: 56px; height: 56px; border-radius: 14px; }
.tool-icon-lg .icon { width: 28px; height: 28px; }

.btn-favorite { flex-shrink: 0; }
.btn-favorite[aria-pressed="true"] { color: var(--signal-deep); border-color: color-mix(in srgb, var(--signal) 45%, transparent); background: var(--signal-soft); }
.btn-favorite[aria-pressed="true"] .icon { fill: currentColor; }
#offline-toggle[aria-pressed="true"] .icon { fill: none; }
#offline-toggle:disabled { opacity: 1; cursor: progress; }

/* ---------- Hero (home) ---------- */
.hero {
    background:
        radial-gradient(900px 420px at 88% -10%, rgb(255 90 31 / 0.22), transparent 60%),
        linear-gradient(180deg, var(--ink) 0%, #13244A 100%);
    color: #fff;
    padding: 64px 0 72px;
    overflow: hidden;
}
.hero-inner { display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.5rem); max-width: 17ch; margin-bottom: 18px; }
.hero-lead { color: #C5CEDF; font-size: 1.15rem; max-width: 52ch; margin-bottom: 28px; }
.hero-search {
    display: flex; align-items: center; gap: 12px; width: 100%; max-width: 520px;
    padding: 15px 18px; border-radius: 12px; border: 0; cursor: pointer;
    background: #fff; color: var(--slate); font: 500 1rem var(--text); text-align: left;
    box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.5);
}
.hero-search .icon { color: var(--signal); }
.hero-search:hover { color: var(--ink); }
.hero-points { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 10px 26px; color: #C5CEDF; font-size: 0.95rem; }
.hero-points li { display: inline-flex; align-items: center; gap: 8px; }
.hero-points .icon { color: var(--c1); }

@media (max-width: 900px) {
    .hero { padding: 40px 0 48px; }
    .hero-inner { grid-template-columns: 1fr; gap: 36px; }
}

/* ---------- Statement panel (results) ----------
   Every result appears on navy, like a printed statement; the site's signature element. */
.statement, .results {
    background: linear-gradient(160deg, var(--ink-2) 0%, var(--ink) 70%);
    color: #E7ECF5;
    border-radius: var(--r-panel);
    box-shadow: var(--shadow-3);
    padding: 26px;
    position: relative;
    overflow: hidden;
}
.statement::before, .results::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
    background: linear-gradient(90deg, var(--signal), #FF9A3D);
}
.statement-title, .result-label { margin: 0 0 4px; color: #A9B5CB; font-weight: 500; font-size: 0.95rem; }
.statement-figure, .result-big {
    margin: 0 0 14px; color: #fff;
    font-family: var(--display); font-weight: 800; letter-spacing: -0.03em;
    font-size: clamp(2.3rem, 1.8rem + 2.4vw, 3.3rem); line-height: 1.05;
    font-variant-numeric: tabular-nums;
}
.statement-sub { margin: -6px 0 18px; color: #A9B5CB; font-size: 0.92rem; }
.statement-link { color: #FFB08F; font-weight: 600; text-decoration: none; }
.statement-link:hover { color: #fff; text-decoration: underline; }
.statement-error, .results .form-error { color: #FFB4A8; margin: 8px 0 0; }

.hero-demo-fields { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; margin: 16px 0 18px; }
.hero-demo-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; color: #A9B5CB; font-weight: 500; }
.hero-demo-fields input {
    width: 100%; font: 600 1.05rem var(--text); color: #fff; font-variant-numeric: tabular-nums;
    background: rgb(255 255 255 / 0.07); border: 1px solid rgb(255 255 255 / 0.16); border-radius: var(--r-control); padding: 10px 12px;
}
.hero-demo-fields input:focus { outline: none; border-color: var(--c1); background: rgb(255 255 255 / 0.11); }

.results { align-self: start; }
.results .note { color: #A9B5CB; }
.results .positive { color: var(--c3); }
.results dl { margin: 0; }
.results .breakdown div, .results .stats div {
    display: flex; justify-content: space-between; gap: 14px; padding: 10px 0;
    border-bottom: 1px solid rgb(255 255 255 / 0.09);
}
.results .stats div:last-child { border-bottom: 0; }
.results dt { color: #A9B5CB; }
.results dd { margin: 0; color: #fff; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.results .stats { margin-top: 10px; }
.results table th { color: #A9B5CB; border-color: rgb(255 255 255 / 0.12); }
.results table td { color: #fff; border-color: rgb(255 255 255 / 0.09); }
@media (min-width: 900px) { .results { position: sticky; top: 86px; } }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 9px; vertical-align: 1px; }

.scale { position: relative; margin: 6px 0 18px; }

.progress { height: 8px; border-radius: 999px; background: rgb(255 255 255 / 0.1); overflow: hidden; margin-bottom: 8px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--signal), #FF9A3D); transition: width 0.25s ease; }

/* ---------- Panels, forms, buttons ---------- */
.card {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-panel);
    box-shadow: var(--shadow-2); padding: 24px;
}
@media (max-width: 600px) { .card, .statement, .results { padding: 18px; } }

.tool-grid { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
.tool-grid > * { min-width: 0; } /* wide tables scroll inside their card instead of widening the page */
@media (min-width: 900px) { .tool-grid { grid-template-columns: 1.2fr 1fr; } }

.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px 14px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 0.92rem; color: var(--ink); }
.field-hint { color: var(--slate); font-size: 0.84rem; line-height: 1.45; }
.field-error, .form-error { color: var(--bad); font-size: 0.9rem; }

input[type="number"], input[type="text"], input[type="email"], input[type="date"], input[type="time"], input[type="search"], input[type="tel"], input[type="url"], input[type="password"], input[type="datetime-local"], select, textarea {
    width: 100%; font: 400 1rem var(--text); color: var(--ink);
    background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--r-control);
    padding: 10px 12px; transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="number"] { font-variant-numeric: tabular-nums; }
input:hover, select:hover, textarea:hover { border-color: var(--slate-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 18%, transparent); }
input[aria-invalid="true"], .input-validation-error { border-color: var(--bad); }
select {
    appearance: none; padding-right: 36px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2355627A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}
input[type="range"] { width: 100%; accent-color: var(--signal); }
textarea { resize: vertical; line-height: 1.55; padding: 12px 14px; }
textarea.code { font-family: var(--mono); font-size: 0.88rem; tab-size: 4; background: #FBFCFE; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: 600 0.95rem var(--text); padding: 10px 18px; border-radius: var(--r-control);
    border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink);
    cursor: pointer; text-decoration: none; box-shadow: var(--shadow-1); transition: background 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--slate-2); color: var(--ink); background: #FBFCFE; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn .icon { width: 1.1em; height: 1.1em; }
.btn-primary { background: var(--signal-fill); border-color: var(--signal-fill); color: #fff; box-shadow: 0 1px 2px rgb(178 58 12 / 0.3), inset 0 1px 0 rgb(255 255 255 / 0.18); }
.btn-primary:hover:not(:disabled) { background: var(--signal-ink); border-color: var(--signal-ink); color: #fff; }
.btn-small { padding: 6px 12px; font-size: 0.88rem; }
.btn-icon { padding: 5px 10px; min-width: 36px; }
.calc-form .btn { margin-top: 18px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.checkbox { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--signal); }
.inline-select { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.inline-select select { width: auto; padding-top: 8px; padding-bottom: 8px; }
.note { color: var(--slate); font-size: 0.9rem; margin: 12px 0 0; }
.status { margin: 0; color: var(--slate); min-height: 1.6em; }
.status-ok { color: var(--good); }
.settings-note { margin: 0 0 12px; color: var(--slate); font-size: 0.88rem; }
.settings-reset { padding: 0; border: 0; background: none; color: var(--signal-ink); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.settings-reset:hover { color: var(--ink); }
.status-error { color: var(--bad); }
.positive { color: var(--good); }

/* ---------- Tables ---------- */
.schedule { margin-top: 24px; }
.schedule summary { cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 1.05rem; }
.table-scroll { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--slate); font-weight: 600; font-size: 0.86rem; }
tbody tr:hover td { background: #FAFBFD; }
.results tbody tr:hover td { background: transparent; }

/* ---------- Tool lists ---------- */

.tool-group + .tool-group { margin-top: 36px; }
.tool-group h2 { font-size: 1.1rem; color: var(--slate); font-weight: 600; margin-bottom: 14px; }

/* ---------- Home ---------- */
.home { padding-top: 48px; padding-bottom: 64px; }
.home-section + .home-section { margin-top: 56px; }
.section-heading { margin-bottom: 20px; }
.section-heading h2 { margin-bottom: 4px; }
.section-heading p { color: var(--slate); margin: 0; }
.section-heading-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }

.popular-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.popular-tile {
    display: flex; flex-direction: column; gap: 4px; height: 100%;
    padding: 18px; border-radius: var(--r-panel); background: var(--paper); border: 1px solid var(--line);
    box-shadow: var(--shadow-1); color: var(--ink); text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.popular-tile .tool-icon { margin-bottom: 10px; }
.popular-tile strong { font-weight: 600; }
.popular-tile > span:last-child { color: var(--slate); font-size: 0.88rem; }
.popular-tile:hover { color: var(--ink); border-color: color-mix(in srgb, var(--signal) 45%, var(--line)); box-shadow: var(--shadow-2); }
.popular-tile:hover .tool-icon { background: var(--signal); color: #fff; }

.category-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 26px 28px 18px; box-shadow: var(--shadow-1); }
.category-panel-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.category-panel-head > div { flex: 1; min-width: 0; }
.category-panel-head h2 { margin-bottom: 4px; }
.category-panel-head h2 a { color: var(--ink); text-decoration: none; }
.category-panel-head h2 a:hover { color: var(--signal-ink); }
.category-panel-head p { color: var(--slate); margin: 0; }
.category-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--ink); color: #fff; flex-shrink: 0; }
.category-icon .icon { width: 24px; height: 24px; }
@media (max-width: 600px) {
    .category-panel { padding: 18px 16px 10px; }
    .category-panel-head { flex-wrap: wrap; }
}

.your-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px 32px; }
.your-tools h3 { display: flex; align-items: center; gap: 8px; font-size: 1rem; color: var(--slate); }
.your-tools h3 .icon { color: var(--signal); }

/* ---------- Converters ---------- */
.converter { display: flex; flex-direction: column; gap: 18px; }
.converter-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; align-items: end; }
.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 200px; padding: 28px; text-align: center; cursor: pointer;
    border: 2px dashed var(--line-strong); border-radius: var(--r-panel);
    background: repeating-linear-gradient(135deg, #FBFCFE 0 12px, var(--canvas) 12px 24px);
    transition: border-color 0.15s, background 0.15s;
}
.dropzone::before {
    content: ""; width: 48px; height: 48px; margin-bottom: 8px; border-radius: 12px;
    background: var(--signal-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E2470F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m17 8-5-5-5 5'/%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3C/svg%3E") center / 24px no-repeat;
}
.dropzone strong { font-family: var(--display); font-size: 1.15rem; color: var(--ink); }
.dropzone span { color: var(--slate); }
.dropzone small { color: var(--slate-2); }
.dropzone:hover, .dropzone.is-dragging, .dropzone:focus-within { border-color: var(--signal); background: var(--signal-soft); }
.dropzone-small { min-height: 120px; }
.dropzone-small::before { display: none; }
.file-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- Ads ---------- */
.ad { margin: 32px 0; min-height: 100px; }
.ad-placeholder {
    display: flex; align-items: center; justify-content: center; min-height: 100px;
    border: 1px dashed var(--line-strong); border-radius: var(--r-panel); color: var(--slate-2); font-size: 0.85rem;
}

/* ---------- Article, FAQ, related ---------- */
.prose { max-width: 72ch; margin-top: 48px; color: #23324F; }
.prose h2 { margin-top: 1.8em; font-size: 1.5rem; }
.prose h3 { margin-top: 1.4em; }
.prose li { margin-bottom: 0.35em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose table { margin: 8px 0; }
/* Guide tables hold sentences, not just numbers: wrap the text and read left to right. */
.page-body > .prose:first-child { margin-top: 0; }
.formula {
    font-family: var(--mono); font-size: 0.92rem; background: var(--paper); border: 1px solid var(--line);
    border-left: 3px solid var(--signal); padding: 12px 16px; border-radius: var(--r-control); overflow-x: auto;
}
pre.formula { white-space: pre; }

.faq { max-width: 72ch; margin-top: 48px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--signal); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 10px 0 0; color: var(--slate); }

.related { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line); }

/* ---------- Text tools ---------- */
.text-tool { display: flex; flex-direction: column; gap: 18px; }
.split-panes { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.small-heading { font-size: 1rem; margin-bottom: 10px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Footer: one slim line ---------- */
.site-footer { margin-top: 32px; padding: 18px 0; border-top: 1px solid var(--line); color: var(--slate-2); font-size: 0.85rem; }
.footer-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px; }
.footer-line p { margin: 0; }
.footer-line ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; }
.footer-line a { color: var(--slate); text-decoration: none; }
.footer-line a:hover { color: var(--signal-ink); }
@media (max-width: 600px) { .footer-line { justify-content: center; text-align: center; } .footer-line ul { justify-content: center; } }

/* Result panels are also .card (for spacing in older markup); the statement look must win. */
.card.results { background: linear-gradient(160deg, var(--ink-2) 0%, var(--ink) 70%); border: 0; box-shadow: var(--shadow-3); padding: 26px; }
@media (max-width: 600px) { .card.results { padding: 18px; } }

@media (max-width: 600px) {
    .tool-header-text { flex-basis: 100%; order: 1; }
    .btn-favorite { order: 2; }
    .tool-header-actions { order: 2; }
}
.converter > .status:empty, .converter > ul:empty, .converter > ol:empty { display: none; }

/* ---------- QR code ---------- */
input[type="color"] { width: 100%; height: 44px; padding: 4px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--paper); cursor: pointer; }

/* ---------- Stopwatch & timer ---------- */
.clock-tabs { display: inline-flex; align-self: flex-start; background: var(--mist); border-radius: 10px; padding: 4px; gap: 4px; }
.clock-tabs button { font: 600 0.95rem var(--text); border: 0; background: transparent; color: var(--slate); padding: 8px 18px; border-radius: 8px; cursor: pointer; }
.clock-tabs button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1); }
.laps { list-style: none; margin: 18px auto 0; padding: 0; max-width: 480px; text-align: left; font-variant-numeric: tabular-nums; }
.laps li { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 8px 4px; border-top: 1px solid rgb(255 255 255 / 0.1); color: #C9D3E5; }
.laps li span:not(:first-child) { text-align: right; }
@keyframes alarm { 50% { background: var(--signal-deep); } }

/* ---------- PDF compress & rotate ---------- */
.compare { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.compare div { background: var(--ink); color: #fff; border-radius: 12px; padding: 14px 16px; }
.compare span { display: block; color: #A9B5CB; font-size: 0.85rem; }
.compare strong { font: 800 1.5rem var(--display); }

/* ---------- Result actions ---------- */
.result-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / 0.1); }
.result-action {
    display: inline-flex; align-items: center; gap: 7px; font: 500 0.86rem var(--text); color: #C9D3E5;
    background: rgb(255 255 255 / 0.06); border: 1px solid rgb(255 255 255 / 0.12); border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.result-action:hover { background: rgb(255 255 255 / 0.12); color: #fff; }
.result-action .icon { width: 15px; height: 15px; }

/* ---------- Print: just the tool and its results ---------- */
@media print {
    @page { margin: 14mm; }
    body { background: #fff; font-size: 11pt; }
    .site-header, .site-footer, .search-panel, .ad, .related, .faq, .prose, .breadcrumbs, .btn-favorite,
    .result-actions, .skip-link, .actions, .button-row, .dropzone, .schedule:not([open]) { display: none !important; }
    .page-head { border: 0; padding: 0 0 12px; }
    .page-body { padding: 0; }
    .tool-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
    .card, .results, .statement, .card.results { box-shadow: none !important; break-inside: avoid; }
    .results, .card.results, .statement, .pct-result, .stat-tiles div, .compare div {
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    .results { position: static !important; }
    a { color: inherit; text-decoration: none; }
}

/* ---------- All tools ---------- */
.all-tools-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 20px 32px; margin-top: 14px; }
.all-tools-groups h3 { font-family: var(--text); font-size: 0.85rem; font-weight: 600; color: var(--slate); margin: 0 0 6px; }
.all-tools-groups ul { list-style: none; margin: 0; padding: 0; }
.all-tools-groups a { display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin: 0 -8px; border-radius: var(--r-control); color: var(--ink); text-decoration: none; font-weight: 500; }
.all-tools-groups a .icon { width: 18px; height: 18px; color: var(--signal-deep); }
.all-tools-groups a:hover { background: var(--paper); box-shadow: var(--shadow-1); }

/* ---------- Ad placements ---------- */
.ad { margin: 36px 0; }
.ad-label { display: block; margin-bottom: 6px; font-size: 0.72rem; color: var(--slate-2); text-align: center; }
.prose .ad { margin: 32px 0; }
.ad-sidebar { margin: 20px 0 0; min-height: 250px; }
.ad-sidebar.ad-placeholder { min-height: 250px; }
/* Sidebar units are responsive ads, so hiding them on small screens is allowed and avoids an ad above the article. */
@media (max-width: 900px) { .ad-sidebar { display: none; } }
.home .ad { margin: 48px 0 0; }

/* Logo on dark backgrounds: white disc, navy Z. */
.brand-inverse { --mark-z: var(--ink); }

/* ---------- Developer tools ---------- */
.diff-add { background: #E6F6EE; }
.diff-del { background: #FDECEA; }
input.code { font-family: var(--mono); font-size: 0.95rem; }

/* ---------- Web tools ---------- */
.checkerboard {
    background-color: #fff;
    background-image: conic-gradient(#E9EDF3 25%, transparent 0 50%, #E9EDF3 0 75%, transparent 0);
    background-size: 18px 18px;
}

/* Meta tag generator */
.counter { font-weight: 500; font-size: 0.8rem; color: var(--slate-2); margin-left: 6px; }
.og-image { aspect-ratio: 1200 / 630; background: var(--mist) center / cover no-repeat; display: grid; place-items: center; color: var(--slate-2); font-size: 0.9rem; }

/* Color palette */
.palette { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }

/* Code examples in articles scroll sideways instead of widening the page */
.prose pre:not(.formula) { max-width: 100%; overflow-x: auto; margin: 0 0 1em; padding: 14px 16px; border-radius: 10px; background: var(--mist); border: 1px solid var(--line); font-size: 0.9rem; line-height: 1.55; }
.prose pre code { background: none; padding: 0; font-size: inherit; }

/* ---------- Image editor (shared by watermark, text, border, filters and more) ---------- */
.ie-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.ie-workspace[hidden] { display: none; }
.ie-stage { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ie-canvas-wrap { position: relative; display: grid; place-items: center; min-height: 260px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.ie-canvas-wrap canvas { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; box-shadow: var(--shadow-1); }
.ie-panel { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--mist); }
.ie-panel .actions { margin-top: 4px; }
.ie-panel .dropzone-small { padding: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row[hidden] { display: none; }
.check-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.swatch-row { gap: 8px; }
.swatch-btn { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--swatch); box-shadow: inset 0 0 0 1px rgb(15 29 58 / 0.2); cursor: pointer; }
.swatch-btn:hover { box-shadow: inset 0 0 0 1px rgb(15 29 58 / 0.2), 0 0 0 3px var(--signal-soft); }
@media (max-width: 900px) { .ie-workspace { grid-template-columns: 1fr; } }

/* Sign PDF */
.sign-item-text span { display: block; white-space: nowrap; font-family: Helvetica, Arial, sans-serif; line-height: 1; color: #0F1D3A; }

/* ---------- OCR ---------- */
.ocr-progress { display: flex; flex-direction: column; gap: 8px; }
.ocr-progress[hidden] { display: none; }
.ocr-bar { height: 8px; border-radius: 999px; background: var(--mist); overflow: hidden; }
.ocr-bar span { display: block; height: 100%; width: 0; background: var(--signal); transition: width 0.2s ease; }

/* ---------- Home: tool of the week & recently added ---------- */
.home-highlights { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 24px; align-items: start; }
.totw-card {
    display: flex; flex-direction: column; gap: 8px; padding: 24px; border-radius: var(--r-panel); text-decoration: none;
    background: linear-gradient(160deg, var(--ink-2), var(--ink)); color: #A9B5CB; box-shadow: var(--shadow-3); position: relative; overflow: hidden;
}
.totw-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--signal), #FF9A3D); }
.totw-card[hidden] { display: none; }
.totw-card .tool-icon { background: rgb(255 255 255 / 0.1); color: #FFB08F; }
.totw-card strong { color: #fff; font: 700 1.35rem/1.2 var(--display); }
.totw-cta { margin-top: 6px; color: #FFB08F; font-weight: 600; }
.totw-card:hover { color: #A9B5CB; box-shadow: var(--shadow-3), 0 0 0 2px var(--signal); }
.badge-new { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--signal-soft); color: var(--signal-ink); font: 600 0.72rem/1.6 var(--text); vertical-align: 2px; }
@media (max-width: 900px) { .home-highlights { grid-template-columns: 1fr; } }

/* ---------- Video & audio tools ---------- */
.media-result, .media-editor { display: flex; flex-direction: column; gap: 14px; }
.media-result[hidden], .media-editor[hidden] { display: none; }
.media-result video, .media-editor video, #vg-player { width: 100%; max-height: 60vh; border-radius: var(--r-panel); background: #000; }
.wave { display: block; width: 100%; height: 140px; border: 1px solid var(--line); border-radius: var(--r-control); background: #fff; cursor: crosshair; touch-action: none; }
.ocr-progress .actions { justify-content: space-between; }

/* ---------- Screen & voice recorder ---------- */
@keyframes rec-blink { 50% { opacity: 0.25; } }

/* ---------- Install the app ---------- */
.install-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--r-control); font: 600 0.92rem var(--text); cursor: pointer; }
.install-btn[hidden] { display: none; }
.install-btn svg { width: 18px; height: 18px; }
.install-btn-footer { margin-top: 14px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); }
.install-btn-footer:hover { background: var(--canvas); }
.install-btn-menu { width: 100%; justify-content: center; margin-top: 12px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); }
.install-btn:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.install-dialog { width: min(440px, calc(100vw - 32px)); padding: 22px; border: 0; border-radius: var(--r-panel); box-shadow: var(--shadow-3); color: var(--ink); }
.install-dialog::backdrop { background: rgb(15 29 58 / 0.5); }
.install-dialog-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.install-dialog-head img { border-radius: 12px; }
.install-dialog-head h2 { margin: 0; flex: 1; font-size: 1.25rem; }
.install-dialog p { margin: 0 0 12px; color: var(--slate); }
.install-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.install-steps[hidden] { display: none; }
.install-steps svg { width: 16px; height: 16px; vertical-align: -3px; }
.install-dialog .menu-close { display: inline-grid; flex: none; }
.install-dialog:focus, .install-dialog:focus-visible { outline: none; }

/* ---------- Embeddable calculators ---------- */
.tool-header-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.embed-dialog { width: min(600px, calc(100vw - 32px)); }
.embed-code { font-size: 0.8rem; margin-bottom: 10px; }
.embed-dialog .checkbox { margin-bottom: 12px; }
html.embed body { background: #fff; }
.embed-main { padding: 12px; }
.embed-main .prose, .embed-main .faq, .embed-main .ad, .embed-main .related, .embed-main .guide-cards { display: none; }
.embed-main > :first-child { margin-top: 0; }
.embed-credit { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px 12px; font-size: 0.82rem; color: var(--slate); }
.embed-credit .brand-mark, .embed-credit svg { height: 20px; width: auto; }
.embed-credit > a:first-child { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.embed-credit span a { color: var(--signal-ink); font-weight: 600; }
/* Sinhala letters are taller than Latin ones, so give headings and text a little more line height. */
html[lang="si"] h1, html[lang="si"] h2, html[lang="si"] h3 { line-height: 1.35; letter-spacing: 0; }
html[lang="si"] body { line-height: 1.7; }
.btn-lang { text-decoration: none; }
/* On English pages, links to the Sinhala section use the device's own Sinhala font, so the web font isn't downloaded. */
html:not([lang="si"]) [lang="si"] { font-family: system-ui, -apple-system, "Segoe UI", "Nirmala UI", sans-serif; }

/* =====================================================================================================
   App shell (2026-10 redesign): a sidebar on wide screens, visual tool cards, shelves and sections.
   ===================================================================================================== */
:root { --side-w: 248px; }

/* ---------- Sidebar ---------- */
.sidebar { display: none; }
@media (min-width: 1100px) {
    .sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--side-w);
        display: flex; flex-direction: column; gap: 14px; padding: 18px 14px 14px;
        background: var(--paper); border-right: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain;
    }
    .sidebar .brand { padding: 2px 8px 6px; }
    .app-main { margin-left: var(--side-w); }
    .site-header { display: none; }
    html { scroll-padding-top: 20px; }
}
.side-search {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
    font: 500 0.92rem var(--text); color: var(--slate-2); text-align: left; cursor: pointer;
    background: var(--canvas); border: 1px solid var(--line); border-radius: 12px;
}
.side-search span { flex: 1; }
.side-search .icon { color: var(--signal); }
.side-search:hover { border-color: var(--line-strong); color: var(--slate); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-label { margin: 14px 10px 4px; color: var(--slate-2); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.side-link {
    display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 10px;
    color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.94rem; line-height: 1.25;
}
.side-link > .icon { width: 20px; height: 20px; color: var(--slate); }
.side-link:hover { background: var(--mist); color: var(--ink); }
.side-link[aria-current] { background: var(--signal-soft); color: var(--signal-ink); font-weight: 600; }
.side-link[aria-current] > .icon { color: var(--signal-ink); }
.side-link-sm { font-size: 0.88rem; padding: 6px 10px; }
.side-link-sm .icon { width: 18px; height: 18px; }
.side-yours ul { list-style: none; margin: 0; padding: 0; }
.side-yours .side-link { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.side-dot {
    display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px;
    background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff;
}
.side-dot .icon { width: 16px; height: 16px; stroke-width: 2; }
.side-dot-lg { width: 42px; height: 42px; border-radius: 12px; }
.side-dot-lg .icon { width: 21px; height: 21px; }
.side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.side-foot ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 6px 0; padding: 0; }
.side-foot a { color: var(--slate); font-size: 0.82rem; text-decoration: none; }
.side-foot a:hover { color: var(--signal-ink); }
.install-btn-side { width: 100%; justify-content: center; }
.mobile-menu-list .side-dot-lg { margin-right: 2px; }

/* The header now only appears on smaller screens. */
.site-header .header-inner { padding: 0 16px; justify-content: space-between; }
.site-header .search-trigger { margin-left: auto; }
.site-header .menu-toggle { display: inline-grid; }
@media (max-width: 1099px) {
    .site-header .search-trigger { min-width: 0; width: 44px; height: 44px; padding: 0; justify-content: center; }
    .site-header .search-trigger span, .site-header .search-trigger kbd { display: none; }
}

/* ---------- Home ---------- */
.home { padding-top: 24px; padding-bottom: 56px; max-width: 1240px; }

/* Round section icons, like app shortcuts. */
.circle {
    display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff;
    box-shadow: 0 8px 18px -10px var(--c1); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.circle .icon { width: 28px; height: 28px; stroke-width: 1.9; }
@media (max-width: 600px) { .circle { width: 56px; height: 56px; } .circle .icon { width: 24px; height: 24px; } }

/* ---------- Shelves (horizontal rows of cards) ---------- */
.shelf { margin-top: 40px; }
.shelf-track {
    list-style: none; margin: 0 -4px; padding: 4px 4px 14px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 230px);
    gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; overscroll-behavior-x: contain;
}
.shelf-track > li { scroll-snap-align: start; display: flex; }
@media (max-width: 600px) { .shelf-track { grid-auto-columns: 74%; margin: 0 -16px; padding-inline: 16px; scroll-padding-inline: 16px; } }

/* ---------- Visual tool cards ---------- */
.tile-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 18px; }
.tile-grid > li { display: flex; }
.vcard {
    display: flex; flex-direction: column; width: 100%; overflow: hidden; border-radius: 16px;
    background: var(--paper); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.vcard:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: transparent; }
.vcard-art {
    position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden;
    background: linear-gradient(135deg, var(--c1), var(--c2));
}
.vcard[data-v="1"] .vcard-art { background: linear-gradient(200deg, var(--c1), var(--c2)); }
.vcard[data-v="2"] .vcard-art { background: linear-gradient(60deg, var(--c2), var(--c1)); }
.vcard[data-v="3"] .vcard-art { background: radial-gradient(circle at 20% 15%, var(--c2), var(--c1) 70%); }
.vcard-blob { position: absolute; border-radius: 50%; background: rgb(255 255 255 / 0.16); }
.vcard-b1 { width: 62%; aspect-ratio: 1; top: -26%; right: -12%; }
.vcard-b2 { width: 38%; aspect-ratio: 1; bottom: -18%; left: -8%; background: rgb(255 255 255 / 0.12); }
.vcard[data-v="1"] .vcard-b1 { top: auto; bottom: -30%; right: -10%; }
.vcard[data-v="1"] .vcard-b2 { bottom: auto; top: -14%; left: 8%; width: 30%; }
.vcard[data-v="2"] .vcard-b1 { border-radius: 30%; transform: rotate(28deg); top: -30%; right: 30%; width: 50%; }
.vcard[data-v="2"] .vcard-b2 { left: auto; right: -8%; bottom: -24%; width: 44%; }
.vcard[data-v="3"] .vcard-b1 { width: 120%; top: 48%; right: -10%; background: rgb(255 255 255 / 0.1); }
.vcard[data-v="3"] .vcard-b2 { width: 22%; left: 12%; bottom: 14%; border-radius: 6px; transform: rotate(-18deg); }
.vcard-icon {
    position: relative; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px;
    background: rgb(255 255 255 / 0.22); color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.35);
    backdrop-filter: blur(4px); transition: transform 0.2s ease;
}
.vcard-icon .icon { width: 30px; height: 30px; stroke-width: 1.8; }
/* A tool's own picture (ToolArt) fills the art area. */
.vcard-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.vcard:hover .vcard-img { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) { .vcard-img, .vcard:hover .vcard-img { transition: none; transform: none; } }
.vcard:hover .vcard-icon { transform: scale(1.08) rotate(-4deg); }
.vcard-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.vcard-body strong { font-weight: 600; font-size: 0.98rem; line-height: 1.3; }
.vcard-body > span { color: var(--slate); font-size: 0.85rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard .badge-new { margin-left: 6px; vertical-align: 1px; }
/* Wider screens: wrap onto more lines, since a mouse can't swipe a row with no scrollbar. Phones keep the swipeable row. */
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font: 600 0.9rem var(--text); cursor: pointer; }
.chip span { color: var(--slate-2); font-weight: 500; font-size: 0.82rem; }
.chip:hover { border-color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.is-on span { color: rgb(255 255 255 / 0.7); }

/* Tool pages: the big icon wears the section's colours. */
.tool-icon-section { background: linear-gradient(135deg, var(--c1), var(--c2)) !important; color: #fff !important; }
.related .tile-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
@media (max-width: 600px) {
    .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .vcard { border-radius: 14px; }
    .vcard-icon { width: 46px; height: 46px; border-radius: 13px; }
    .vcard-icon .icon { width: 24px; height: 24px; }
    .vcard-body { padding: 10px 11px 12px; }
    .vcard-body strong { font-size: 0.9rem; }
    .vcard-body > span { font-size: 0.78rem; }
    .shelf-track { grid-auto-columns: 62%; }
}

/* =====================================================================================================
   Phones and tablets: app-style tab bar, bottom sheets, compact banners and tool headers.
   ===================================================================================================== */
.tabbar { display: none; }
@media (max-width: 1099px) {
    :root { --tabbar-h: 62px; }
    body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
    .tabbar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
        display: grid; grid-template-columns: repeat(4, 1fr);
        height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
        background: rgb(255 255 255 / 0.96); backdrop-filter: saturate(1.4) blur(12px);
        border-top: 1px solid var(--line); box-shadow: 0 -6px 20px -14px rgb(15 29 58 / 0.35);
    }
    .tab {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0;
        border: 0; background: none; color: var(--slate); font: 600 0.72rem var(--text); text-decoration: none; cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .tab .icon { width: 24px; height: 24px; transition: transform 0.15s ease; }
    .tab:active .icon { transform: scale(0.9); }
    .tab[aria-current] { color: var(--signal-ink); }
    .tab[aria-current] .icon { stroke-width: 2.2; }
    .tab:hover { color: var(--ink); }
    .tab:focus-visible { outline-offset: -4px; }

    /* Menus open from the bottom, within thumb reach. */
    .mobile-menu {
        inset: auto 0 0 0; max-height: 88dvh; border-radius: 22px 22px 0 0; padding: 6px 16px calc(20px + env(safe-area-inset-bottom));
    }
    .mobile-menu::before { content: ""; display: block; width: 40px; height: 5px; margin: 4px auto 0; border-radius: 3px; background: var(--line-strong); }
    .mobile-menu[open] { animation: sheet-in 0.24s cubic-bezier(.2, .8, .2, 1); }
    @keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
    .mobile-menu-head { min-height: 52px; }
    .mobile-menu-head h2 { margin: 0; font-size: 1.25rem; }
    .sheet .tile-grid { margin-bottom: 14px; }
    .sheet-label { margin: 6px 0 10px; font-size: 0.95rem; color: var(--slate); }
    .sheet-empty { margin: 20px 4px 28px; color: var(--slate); text-align: center; }

    /* The header carries just the logo and search; the menu lives in the tab bar. */
    .site-header .header-inner { min-height: 56px; }
}

@media (max-width: 600px) {
    /* Home: a shorter banner, so the sections and tools show on the first screen. */
    .home { padding-top: 14px; }
    .shelf { margin-top: 28px; }

    /* Tool pages: a compact header so the tool itself is near the top. */
    .page-head { padding: 12px 0 16px; }
    .page-head .breadcrumbs { margin-bottom: 8px; font-size: 0.8rem; }
    .tool-header { gap: 10px; }
    .tool-header h1 { font-size: 1.6rem; margin-bottom: 4px; }
    .tool-header .lead { font-size: 0.95rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .tool-header-actions { width: 100%; }
    .tool-header-actions .btn { padding: 6px 12px; font-size: 0.88rem; }
    .page-body { padding-top: 16px; }
}

/* ---------- + Create ---------- */
.btn-create {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border: 0; border-radius: 12px; cursor: pointer;
    font: 700 0.98rem var(--text); color: #fff; background: linear-gradient(120deg, #FF5A1F, #F43F5E 55%, #8B5CF6);
    box-shadow: 0 8px 18px -10px #F43F5E; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-create:hover { transform: translateY(-1px); box-shadow: 0 12px 22px -10px #F43F5E; color: #fff; }
.btn-create .icon { width: 20px; height: 20px; stroke-width: 2.4; }
.side-create { width: 100%; }
.create-dialog {
    width: min(760px, calc(100vw - 32px)); max-height: min(720px, calc(100dvh - 48px)); margin: auto; padding: 0 22px 22px;
    border: 0; border-radius: 22px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-3); overflow-y: auto;
}
.create-dialog::backdrop { background: rgb(15 29 58 / 0.5); backdrop-filter: blur(2px); }
.create-dialog[open] { animation: menu-in 0.2s ease-out; }
.create-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 8px; background: var(--paper); }
.create-head h2 { margin: 0; font-size: 1.35rem; }
.create-dialog .menu-close { display: inline-grid; }
.create-group { margin: 14px 0 8px; font-size: 0.85rem; color: var(--slate); text-transform: uppercase; letter-spacing: 0.04em; }
.create-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.create-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.create-item:hover { border-color: transparent; background: var(--canvas); color: var(--ink); box-shadow: var(--shadow-1); }
.create-item strong { display: block; font-weight: 600; font-size: 0.95rem; }
.create-item small { color: var(--slate); font-size: 0.8rem; }
.create-more { display: block; margin-top: 18px; text-align: center; font-weight: 600; }
@media (max-width: 1099px) {
    .create-dialog { inset: auto 0 0 0; width: 100%; max-width: 100%; max-height: 88dvh; margin: 0; border-radius: 22px 22px 0 0; padding: 0 16px calc(18px + env(safe-area-inset-bottom)); }
    .create-dialog[open] { animation: sheet-in 0.24s cubic-bezier(.2, .8, .2, 1); }
    .create-grid { grid-template-columns: 1fr 1fr; }
    .create-item { flex-direction: column; align-items: flex-start; gap: 8px; }
    /* Five tabs, with Create in the middle as a raised round button. */
    .tabbar { grid-template-columns: repeat(5, 1fr); }
    .tab-create { position: relative; }
    .tab-create-btn {
        display: grid; place-items: center; width: 50px; height: 50px; margin-top: -18px; border-radius: 50%; color: #fff;
        background: linear-gradient(135deg, #FF5A1F, #F43F5E 55%, #8B5CF6); box-shadow: 0 8px 18px -6px rgb(244 63 94 / 0.6), 0 0 0 4px var(--paper);
    }
    .tab-create-btn .icon { width: 26px; height: 26px; stroke-width: 2.4; }
}
/* PDF page views with things laid over them (fill PDF form, redact PDF) */
.pv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 4px 0 14px; }
.pv-bar .checkbox { margin: 0; }
.pv-bar > label:not(.checkbox) { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; font-size: 0.9rem; }
.pv-bar select { width: auto; min-width: 0; }
.pv-page { position: relative; flex: none; background: #fff; box-shadow: var(--shadow-2); }
.pv-canvas { display: block; width: 100%; height: 100%; }

/* ---------- Accounts ---------- */
.account-slot { min-height: 0; }
.account-signin { width: 100%; justify-content: center; }
.account-chip {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--paper); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.account-chip:hover { background: var(--canvas); }
.account-chip-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.account-chip-text strong { font-size: 0.9rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account-chip-text small { color: var(--good); font-size: 0.75rem; font-weight: 600; }
.account-slot-head .account-chip { width: auto; padding: 2px; border-radius: 50%; }
.account-slot-head .btn { white-space: nowrap; }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.avatar-letter { display: grid; place-items: center; background: linear-gradient(135deg, #FF5A1F, #8B5CF6); color: #fff; font-weight: 700; font-size: 0.95rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1.3rem; }
/* A centred box on desktop; below 1100px it stays the full-width bottom sheet every .create-dialog becomes. */
@media (min-width: 1100px) { .account-dialog { width: min(460px, calc(100vw - 32px)); } }
@media (max-width: 1099px) { .account-email-row .btn { flex: 1 1 100%; justify-content: center; } }
.account-lead { color: var(--slate); margin: 0 0 18px; }
.account-google { width: 100%; justify-content: center; gap: 10px; padding: 12px; font-weight: 600; border: 1px solid var(--line-strong); background: var(--paper); }
.account-google:hover { background: var(--canvas); }
.account-or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--slate-2); font-size: 0.85rem; }
.account-or::before, .account-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.account-email label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.92rem; }
.account-email-row { display: flex; gap: 8px; flex-wrap: wrap; }
.account-email-row input { flex: 1 1 200px; }
.account-fine { margin: 14px 0 0; color: var(--slate-2); font-size: 0.82rem; }
.account-menu-who { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; }
.account-menu-who span { display: flex; flex-direction: column; min-width: 0; }
.account-menu-who small { color: var(--slate); overflow-wrap: anywhere; }
.account-menu-status { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--good); font-size: 0.9rem; font-weight: 600; }
.account-menu-status .icon { width: 18px; height: 18px; }
.account-menu-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.account-menu-list a, .account-menu-list button {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--line);
    background: none; color: var(--ink); font: 500 0.98rem var(--text); text-align: left; text-decoration: none; cursor: pointer;
}
.account-menu-list .icon { width: 20px; height: 20px; color: var(--slate); }
.account-menu-list .cd-danger, .account-menu-list .cd-danger .icon { color: var(--bad); }
.account-menu-list a:hover, .account-menu-list button:hover { background: var(--canvas); }
.sync-banner {
    position: fixed; left: 50%; bottom: calc(var(--tabbar-h, 0px) + 16px + env(safe-area-inset-bottom)); z-index: 40; transform: translateX(-50%);
    display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 14px;
    background: var(--ink); color: #fff; box-shadow: var(--shadow-3); font-size: 0.92rem; max-width: calc(100vw - 32px);
}
@media (min-width: 1100px) { .sync-banner { left: calc(50% + var(--side-w) / 2); } }
/* The sidebar scrolls when it's full; its parts must never be squeezed (they'd overlap). */
.sidebar > * { flex-shrink: 0; }

/* ---------- Brand kit ---------- */
.brand-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--canvas); }
.brand-bar img, .brand-bar-dot { flex: none; width: 36px; height: 36px; border-radius: 9px; object-fit: contain; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.brand-bar-text { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-bar-text strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.brand-bar-text small { color: var(--slate); font-size: 0.8rem; }
.brand-bar-edit { font-size: 0.85rem; font-weight: 600; }
.brand-bar-empty { gap: 10px; padding: 8px 12px; background: none; border-style: dashed; font-size: 0.88rem; }
.brand-bar-empty .icon { color: var(--signal); width: 20px; height: 20px; }
.brand-bar-empty a { color: var(--slate); text-decoration: none; }
.brand-bar-empty a:hover { color: var(--signal-ink); }

/* ---------- Send to another tool (after a download) ---------- */
.send-bar {
    position: fixed; left: 50%; bottom: calc(var(--tabbar-h, 0px) + 16px + env(safe-area-inset-bottom)); z-index: 45; transform: translateX(-50%);
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; width: min(720px, calc(100vw - 32px));
    padding: 12px 12px 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow-3);
    animation: send-in 0.22s ease-out;
}
@media (min-width: 1100px) { .send-bar { left: calc(50% + var(--side-w) / 2); width: min(720px, calc(100vw - var(--side-w) - 48px)); } }
@keyframes send-in { from { opacity: 0; transform: translate(-50%, 12px); } }
@media (prefers-reduced-motion: reduce) { .send-bar { animation: none; } }
.send-head { margin: 0; font-size: 0.95rem; color: var(--slate); }
.send-head strong { color: var(--ink); }
.send-close { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--slate); cursor: pointer; }
.send-close:hover { background: var(--mist); color: var(--ink); }
.send-close .icon { width: 18px; height: 18px; }
.send-chips { grid-column: 1 / -1; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.send-chip {
    display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--canvas); color: var(--ink); font-size: 0.88rem; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.send-chip .icon { width: 16px; height: 16px; color: var(--signal-ink); }
.send-chip:hover { border-color: var(--signal); background: var(--signal-soft); }

/* ---------- Full-screen previews (data-fullscreen, site.js) ---------- */
.pv-wrap { display: flex; flex-direction: column; min-width: 0; }
.pv-bar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.pv-toggle .icon { width: 16px; height: 16px; }
html.pv-open { overflow: hidden; }
.pv-wrap.is-full { position: fixed; inset: 0; z-index: 150; padding: 12px 16px 16px; background: #E4E8EF; overflow: hidden; }
.pv-wrap.is-full > :not(.pv-bar) { flex: 1; min-height: 0; overflow: auto; max-width: none; max-height: none; }

/* Open with (files shared from the phone's share menu) */
.open-with h1 { margin-bottom: 8px; }
.open-with .tile-grid { margin-top: 18px; }

/* Random name picker and team generator */
@keyframes np-pop { from { transform: scale(0.94); } to { transform: none; } }

/* Dice roller */
.die {
    display: grid; width: 72px; height: 72px; padding: 9px; border-radius: 14px; background: #FFFFFF;
    box-shadow: 0 6px 0 #D5DCE6, 0 10px 18px -6px rgb(0 0 0 / 0.45);
}
.die:not(.die-d6) { place-items: center; font: 800 1.7rem var(--display); color: #111827; }

/* Coin flip */
.coin { position: relative; width: 160px; height: 160px; transform-style: preserve-3d; transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
@media (prefers-reduced-motion: reduce) { .coin { transition: none; } }

/* Change PNG colour: colour choice and preview background */
.ie-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.ie-choice label { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.ie-choice label:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.ie-choice input { position: absolute; opacity: 0; pointer-events: none; }
.ie-choice label:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 2px; }
.ie-dot { width: 18px; height: 18px; border-radius: 50%; border: 1px solid #C3CCD8; }
.ie-dot-any { background: conic-gradient(#FF5A1F, #F59E0B, #10B981, #2563EB, #8B5CF6, #EC4899, #FF5A1F); }
.field-label-text { font-weight: 600; font-size: 0.92rem; color: var(--ink); }
.ie-canvas-wrap[data-bg="dark"] { background: #111827; }
.ie-canvas-wrap[data-bg="light"] { background: #FFFFFF; }

/* Design viewer: page transitions and the presenter button */
@keyframes dv-fade { from { opacity: 0; } }
@keyframes dv-slide { from { transform: translateX(40%); opacity: 0; } }
@keyframes dv-slide-back { from { transform: translateX(-40%); opacity: 0; } }
@keyframes dv-zoom { from { transform: scale(1.15); opacity: 0; } }

/* Event budget */
.eb-tool, .rs-tool, .sl-tool, .mpl-tool, .wp-tool, .br-tool { display: flex; flex-direction: column; gap: 14px; }

/* Birthday reminders */
@media print { .eb-tool .actions, .mpl-tool .actions, .wp-tool .actions, .wp-add, .wp-del, .site-header, .site-side, .prose, .faq { display: none !important; } }

/* ---------- Flowchart maker ---------- */
[data-edge] { cursor: pointer; }

/* ---------- Drop or paste anywhere (site.js pageDrop) ---------- */
.page-drop { position: fixed; inset: 12px; z-index: 300; display: grid; place-content: center; justify-items: center; gap: 12px; border: 3px dashed var(--signal); border-radius: 20px; background: rgb(255 247 240 / 0.92); color: var(--signal-ink); font-size: 1.25rem; pointer-events: none; opacity: 0; transition: opacity 0.12s; }
.page-drop.is-on { opacity: 1; }
.page-drop .icon { width: 44px; height: 44px; }
.dropzone .dz-paste { display: block; margin-top: 4px; color: var(--slate-2); font-size: 0.78rem; }

/* ---------- Phones ---------- */
@media (max-width: 600px) {
    /* Save, Offline and the language button stay on one line (scrolling sideways if they must). */
    .tool-header-actions { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: calc(100% + 32px); margin: 0 -16px; padding: 2px 16px; }
    .tool-header-actions::-webkit-scrollbar { display: none; }
    .tool-header-actions .btn { flex: none; gap: 6px; padding: 6px 11px; }
    .tool-header-actions .btn .icon { width: 16px; height: 16px; }
    /* A shorter file box, so the settings under it are on screen too. */
    .dropzone { min-height: 150px; padding: 20px 16px; }
    .dropzone::before { width: 40px; height: 40px; margin-bottom: 4px; }
    /* Calculators: two fields side by side, so the result is nearer the top. */
    .calc-form .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
    .calc-form .field-grid > .field-wide, .calc-form .field-grid > .field:has(textarea, .seg, .chips, [role="radiogroup"]) { grid-column: 1 / -1; }
    .calc-form .field label { font-size: 0.88rem; }
    /* A label on two lines doesn't push its box below the one next to it. */
    .calc-form .field-grid > .field > label:first-child { flex: 1 0 auto; display: flex; align-items: flex-end; }
    /* Search fills the top of the screen (the keyboard takes the bottom), with each tool's section under its name. */
    .search-panel { margin-top: 8px; max-height: calc(100dvh - 16px); width: calc(100vw - 16px); }
    .search-results a { display: grid; grid-template-columns: auto 1fr; align-content: center; gap: 1px 12px; padding: 8px 10px; line-height: 1.3; }
    .search-results a .tool-icon { grid-row: span 2; }
    .search-results a span:last-child { margin-left: 0; font-size: 0.8rem; }
}
@media (max-width: 340px) { .calc-form .field-grid { grid-template-columns: 1fr; } }
[data-calc-results] { scroll-margin-top: 76px; }

/* The main result above the tab bar while a calculator's result is off screen (site.js resultPeek). */
.calc-peek {
    position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-h, 0px) + 12px + env(safe-area-inset-bottom)); z-index: 44;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px;
    border: 0; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: var(--shadow-3); font: inherit; text-align: left; cursor: pointer;
}
.calc-peek[hidden] { display: none; }
.calc-peek span { display: flex; flex-direction: column-reverse; min-width: 0; }
.calc-peek strong { font: 700 1.15rem var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calc-peek small { font-size: 0.76rem; color: rgb(255 255 255 / 0.72); }
.calc-peek .icon { flex: none; width: 20px; height: 20px; }
@media (max-width: 600px) {
    /* Text under 16px makes iPhones zoom in when a field is tapped. (html raises this above the tools' own sizes.) */
    html :is(input, select, textarea):not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"]) { font-size: 16px; }
    /* Small buttons are still a comfortable size to tap. */
    .btn-small, .tool-header-actions .btn, .result-action { min-height: 38px; }
}

/* Share (send bar) and "Your file is ready" (site.js initReadyBar) */
button.send-chip { font-family: var(--text); cursor: pointer; }
.send-chip.is-share { border-color: var(--signal-fill); background: var(--signal-fill); color: #fff; }
.ready-bar {
    position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-h, 0px) + 12px + env(safe-area-inset-bottom)); z-index: 45;
    display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 14px; border-radius: 16px;
    background: var(--ink); color: #fff; box-shadow: var(--shadow-3); animation: ready-in 0.22s ease-out;
}
.ready-bar p { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; margin: 0; font-size: 0.95rem; }
.ready-bar p .icon { flex: none; width: 20px; height: 20px; color: #4ADE80; }
.ready-actions { display: flex; gap: 6px; }
.ready-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border: 1px solid rgb(255 255 255 / 0.25); border-radius: 999px; background: transparent; color: #fff; font: 600 0.88rem var(--text); cursor: pointer; }
.ready-btn.is-main { border-color: var(--signal-fill); background: var(--signal-fill); }
.ready-btn .icon { width: 16px; height: 16px; }
.ready-bar .send-close { color: rgb(255 255 255 / 0.7); }
@media (prefers-reduced-motion: reduce) { .ready-bar { animation: none; } }
@keyframes ready-in { from { opacity: 0; transform: translateY(12px); } }
.camera-btn { display: flex; width: fit-content; margin: 12px auto 0; }
.camera-btn[hidden] { display: none; }
.search-body:focus { outline: none; }
