:root {
    --blue: #1e5bd6;
    --blue-dark: #143984;
    --hero: #8f94f2;
    --hero-deep: #6d74e8;
    --paper: #fafafa;
    --ink: #1c1c1c;
    --muted: #5c5c5c;
    --line: rgba(28, 28, 28, 0.12);
    --ok: #15803d;
    --danger: #dc2626;
    --warn: #ca8a04;
    --font: "Outfit", sans-serif;
    --per: #38bdf8;
    --org: #a78bfa;
    --loc: #34d399;
    --misc: #fbbf24;
    --gpe: #2dd4bf;
    --fac: #fb7185;
    --norp: #c084fc;
    --date: #60a5fa;
    --time: #818cf8;
    --cardinal: #f59e0b;
    --ordinal: #f97316;
    --quantity: #84cc16;
    --percent: #14b8a6;
    --money: #4ade80;
    --event: #f472b6;
    --product: #22d3ee;
    --law: #e879f9;
    --language: #67e8f9;
    --art: #fda4af;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5.5rem;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
}

body.is-home {
    --home-navy: #10192e;
    --home-soft: #e7eef8;
    --home-paper: #f3f5f8;
    --home-ink: #14181f;
    --home-muted: #5c6573;
    --home-line: rgba(16, 36, 72, 0.12);
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    overflow-x: clip;
    background: var(--home-paper);
    color: var(--home-ink);
}

body.is-home ::selection {
    background: #c9d7f5;
    color: var(--home-navy);
}

body.is-home main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
.logo,
.ghost-btn,
.sample-chip,
.primary-btn,
.nav-parent,
.nav-toggle,
.site-nav a,
.home-go,
.home-quiet,
.home-strip a,
.home-story h3 a {
    cursor: pointer;
}

.site-header {
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.85rem 1.25rem;
}

.is-home .site-header {
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    z-index: 40;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0.95rem max(2rem, calc((100% - 1240px) / 2));
    color: var(--home-ink);
    background: rgba(243, 245, 248, 0.88);
    border: 0;
    border-bottom: 1px solid var(--home-line);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: blur(16px);
}

.is-home .logo {
    justify-self: start;
}

.is-home .site-nav {
    margin: 0;
    justify-self: center;
}

.is-app .site-header {
    position: sticky;
    top: 0;
    flex-shrink: 0;
    z-index: 40;
    width: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    padding: 0.95rem max(2rem, calc((100% - 1240px) / 2));
    background: rgba(243, 245, 248, 0.88);
    color: var(--ink);
    border-bottom: 1px solid rgba(16, 36, 72, 0.12);
    box-shadow: none;
    backdrop-filter: blur(16px);
}

.site-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-left: auto;
}

.is-app .logo {
    justify-self: start;
}

.is-app .site-nav {
    margin: 0;
    justify-self: center;
}

.is-app .header-tools {
    justify-self: end;
    margin-left: 0;
}

.nav-group {
    position: relative;
}

.site-nav a,
.nav-parent {
    padding: 0.52rem 0.95rem;
    border-radius: 999px;
    color: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1;
    transition: background-color 180ms ease, color 180ms ease;
}

.nav-parent {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 0;
    background: transparent;
    font-family: inherit;
}

.nav-parent::after {
    content: "";
    width: 0.38rem;
    height: 0.38rem;
    margin-top: -0.15rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
}

.nav-sub {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    display: none;
    min-width: 13.5rem;
    padding-top: 0.45rem;
}

.nav-group.is-open .nav-sub {
    display: block;
}

@media (min-width: 1121px) {
    .nav-group:hover .nav-sub,
    .nav-group:focus-within .nav-sub {
        display: block;
    }
}

.nav-sub-panel {
    display: grid;
    gap: 0.15rem;
    padding: 0.4rem;
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(20, 57, 132, 0.14);
}

.nav-sub a {
    border-radius: 8px;
    color: var(--ink);
    white-space: nowrap;
}

.is-home .site-nav a,
.is-home .nav-parent,
.is-app .site-nav a,
.is-app .nav-parent {
    padding: 0.62rem 0.78rem;
    border-radius: 0;
    background: transparent;
    font-size: 1rem;
}

.is-home .nav-parent:hover,
.is-home .nav-parent:focus-visible,
.is-home .nav-group:hover > .nav-parent,
.is-home .site-nav a:hover,
.is-home .site-nav a:focus-visible,
.is-app .nav-parent:hover,
.is-app .nav-parent:focus-visible,
.is-app .nav-group:hover > .nav-parent,
.is-app .site-nav a:hover,
.is-app .site-nav a:focus-visible {
    background: transparent;
    color: var(--blue);
}

.is-home .nav-parent.is-active,
.is-home .nav-group:hover > .nav-parent.is-active,
.is-home .site-nav a.is-active,
.is-app .nav-parent.is-active,
.is-app .nav-group:hover > .nav-parent.is-active,
.is-app .site-nav a.is-active {
    background: transparent;
    color: var(--blue);
    box-shadow: inset 0 -2px 0 var(--blue);
}

.is-home .site-nav .nav-sub a,
.is-app .site-nav .nav-sub a {
    box-shadow: none;
}

.is-home .site-nav .nav-sub a:hover,
.is-home .site-nav .nav-sub a:focus-visible,
.is-app .site-nav .nav-sub a:hover,
.is-app .site-nav .nav-sub a:focus-visible {
    background: #eef3ff;
    color: var(--blue-dark);
}

.is-home .site-nav .nav-sub a.is-active,
.is-app .site-nav .nav-sub a.is-active {
    background: var(--blue);
    color: #fff;
    box-shadow: none;
}

.is-app .lang-switch {
    padding: 0.2rem;
    background: #fff;
    border-color: rgba(16, 36, 72, 0.16);
    border-radius: 8px;
}

.is-app .lang-switch button {
    padding: 0.38rem 0.52rem;
    border-radius: 6px;
    font-size: 0.78rem;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.is-home .header-tools {
    justify-self: end;
}

.is-home .header-tools .theme-toggle,
.is-home .header-tools .header-aside {
    display: none;
}

.is-home .lang-switch {
    padding: 0.2rem;
    background: #fff;
    border-color: rgba(16, 36, 72, 0.16);
    border-radius: 8px;
}

.is-home .lang-switch button {
    padding: 0.38rem 0.52rem;
    color: #4b5870;
    border-radius: 6px;
    font-size: 0.78rem;
}

.is-home .lang-switch button[aria-pressed="true"] {
    color: #fff;
    background: var(--blue);
}

.header-aside {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.lang-switch {
    display: inline-flex;
    padding: 0.15rem;
    background: #f4f7ff;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.lang-switch button {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.45rem;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 999px;
    font: 0.75rem/1 var(--font);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.lang-switch button[aria-pressed="true"] {
    color: #fff;
    background: var(--blue);
}

.flag {
    display: block;
    width: 16px;
    height: 11px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--ink);
    background: #fff;
    border: 1px solid rgba(16, 36, 72, 0.16);
    border-radius: 8px;
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-toggle .icon-moon {
    display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
    display: none;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
    display: block;
}

.lang-en { display: none !important; }
html[data-lang="en"] .lang-ro { display: none !important; }
html[data-lang="en"] .lang-en { display: inline !important; }

.is-app .health-panel {
    background: #f4f7ff;
    border-color: color-mix(in srgb, var(--blue) 18%, white);
}

.logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.logo img {
    display: block;
    height: 2.15rem;
    width: auto;
}

.is-home .logo img,
.is-app .logo img {
    height: 2.45rem;
}

.nav-toggle {
    display: none;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
}

.nav-toggle svg {
    width: 22px;
    height: 22px;
}

.nav-toggle .icon-close {
    display: none;
}

body.nav-open .nav-toggle .icon-menu {
    display: none;
}

body.nav-open .nav-toggle .icon-close {
    display: block;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
    background: #e8eef8;
}

.home-shell {
    width: min(1240px, calc(100% - 4rem));
    margin-inline: auto;
}

.home-kicker {
    margin: 0 0 1.05rem;
    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.home-kicker b,
.home-board b,
.home-board-foot b,
.spec-image b,
.spec-doc b {
    font-weight: 500;
}

.home-hero {
    position: relative;
    padding-top: 4.25rem;
    background-color: var(--home-paper);
    background-image:
        radial-gradient(rgba(30, 91, 214, 0.45) 0.9px, transparent 1px),
        linear-gradient(rgba(16, 36, 72, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 36, 72, 0.045) 1px, transparent 1px),
        radial-gradient(ellipse at 74% 36%, rgba(30, 91, 214, 0.09), transparent 46%);
    background-size: 72px 72px, 72px 72px, 72px 72px, auto;
    background-position: -1px -1px, -1px -1px, -1px -1px, center;
}

.home-hero::before {
    content: "::";
    position: absolute;
    z-index: 0;
    top: 1.5rem;
    right: max(1.5rem, calc((100% - 1240px) / 2));
    color: rgba(30, 91, 214, 0.055);
    font-size: clamp(8rem, 16vw, 15rem);
    font-weight: 500;
    letter-spacing: -0.08em;
    line-height: 0.8;
    pointer-events: none;
    user-select: none;
}

.home-hero-grid,
.home-strip {
    position: relative;
    z-index: 1;
}

.home-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 3rem 4rem;
    align-items: center;
    padding-bottom: 3.5rem;
}

.home-hero h1 {
    margin: 0;
    color: var(--home-ink);
    font-size: clamp(4rem, 5.15vw, 4.85rem);
    font-weight: 500;
    letter-spacing: -0.046em;
    line-height: 0.98;
}

.home-lead {
    margin: 1.25rem 0 0;
    max-width: 36rem;
    color: var(--home-muted);
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1.5;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1.5rem;
    margin-top: 1.9rem;
}

.home-go {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0.8rem 1.15rem;
    color: #fff;
    background: var(--blue);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 180ms ease;
}

.home-go:hover,
.home-go:focus-visible {
    background: var(--blue-dark);
}

.home-quiet {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 48px;
    color: var(--home-ink);
    font-size: 1rem;
    font-weight: 500;
    transition: color 180ms ease;
}

.home-quiet svg {
    width: 16px;
    height: 16px;
    transition: transform 180ms ease;
}

.home-quiet:hover,
.home-quiet:focus-visible {
    color: var(--blue);
}

.home-quiet:hover svg,
.home-quiet:focus-visible svg {
    transform: translateX(3px);
}

.home-board {
    margin: 0;
    color: var(--home-ink);
    background: #fbfcfe;
    border: 1px solid rgba(16, 36, 72, 0.14);
    border-radius: 2px;
}

.home-board figcaption,
.home-board-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem 1rem;
    margin: 0;
    padding: 0.7rem 1rem;
    color: #667388;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.home-board figcaption {
    border-bottom: 1px solid var(--home-line);
    border-left: 3px solid var(--blue);
}

.home-board figcaption b,
.home-board-foot b {
    color: var(--blue);
}

.home-board-body {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(11rem, 0.85fr);
    gap: 1.15rem 1.25rem;
    padding: 1.15rem 1.1rem 1.05rem;
}

.home-source {
    margin: 0;
    font-size: 1.22rem;
    line-height: 1.6;
}

.home-source mark,
.spec-text mark {
    padding: 0.02em 0.16em;
    border-radius: 2px;
    font-weight: 500;
}

mark.is-per { color: #143984; background: rgba(30, 91, 214, 0.16); }
mark.is-org { color: #145c38; background: rgba(36, 140, 90, 0.18); }
mark.is-loc { color: #6a4b10; background: rgba(196, 146, 42, 0.24); }
mark.is-out {
    color: #7a736a;
    background: transparent;
    font-weight: 400;
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
}

.home-source mark {
    animation: home-mark 420ms ease both;
}

.home-source mark:nth-of-type(1) { animation-delay: 0.25s; }
.home-source mark:nth-of-type(2) { animation-delay: 0.48s; }
.home-source mark:nth-of-type(3) { animation-delay: 0.7s; }
.home-source mark:nth-of-type(4) { animation-delay: 0.92s; }

.home-found {
    margin: 0;
    padding-left: 1rem;
    border-left: 1px solid var(--home-line);
}

.home-found div {
    display: grid;
    grid-template-columns: 6.2rem minmax(0, 1fr);
    gap: 0.45rem;
    align-items: baseline;
    padding: 0.48rem 0;
    border-bottom: 1px solid rgba(16, 36, 72, 0.08);
    animation: home-row 400ms ease both;
}

.home-found div:nth-child(1) { animation-delay: 0.72s; }
.home-found div:nth-child(2) { animation-delay: 0.84s; }
.home-found div:nth-child(3) { animation-delay: 0.96s; }
.home-found div:nth-child(4) { animation-delay: 1.08s; }

.home-found dt {
    color: #6d7888;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.home-found dd {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
}

.home-found .is-out s {
    color: #7a736a;
    text-decoration-thickness: 1.5px;
}

.home-found em {
    margin-left: 0.35rem;
    color: #8a6840;
    font-style: normal;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
}

.home-board-foot {
    justify-content: flex-start;
    gap: 0.45rem 1.15rem;
    border-top: 1px solid var(--home-line);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: none;
}

.home-strip {
    background: #fff;
    border-top: 1px solid rgba(16, 36, 72, 0.1);
}

.home-strip-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-strip a {
    display: block;
    min-width: 0;
    padding: 1.4rem 1.35rem 1.55rem 1.35rem;
    color: inherit;
    border-left: 1px solid rgba(16, 36, 72, 0.1);
    box-shadow: inset 0 2px 0 transparent;
    transition: box-shadow 180ms ease, color 180ms ease;
}

.home-strip a:first-child {
    padding-left: 0;
    border-left: 0;
}

.home-strip a:hover,
.home-strip a:focus-visible {
    box-shadow: inset 0 2px 0 var(--blue);
}

.home-idx {
    display: block;
    color: #8b95a5;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
}

.home-strip-title {
    display: block;
    margin-top: 0.55rem;
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    transition: color 180ms ease;
}

.home-strip a:hover .home-strip-title,
.home-strip a:focus-visible .home-strip-title,
.home-strip a:hover .home-idx,
.home-strip a:focus-visible .home-idx {
    color: var(--blue);
}

.home-strip-text {
    display: block;
    max-width: 28ch;
    margin-top: 0.4rem;
    color: var(--home-muted);
    font-size: 0.98rem;
    line-height: 1.45;
}

.home-story {
    background: var(--home-soft);
}

.home-story-grid {
    display: grid;
    grid-template-columns: minmax(16rem, 0.72fr) minmax(0, 1.35fr);
    gap: 2.5rem 4.5rem;
    align-items: start;
    padding: 5rem 0 4.5rem;
}

.home-story-intro {
    position: sticky;
    top: 6.25rem;
}

.home-story h2,
.home-direct h2 {
    margin: 0;
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 1.08;
}

.home-story h2 {
    font-size: clamp(2.5rem, 3.6vw, 3.55rem);
}

.home-story-intro p {
    margin: 1rem 0 0;
    max-width: 28ch;
    color: var(--home-muted);
    font-size: 1.05rem;
    line-height: 1.5;
}

.home-story-list article {
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr) minmax(10.5rem, 15rem);
    gap: 0.7rem 1.25rem;
    align-items: center;
    padding: 1.45rem 0 1.55rem;
    border-top: 1px solid rgba(16, 36, 72, 0.12);
}

.home-story-list article:last-child {
    border-bottom: 1px solid rgba(16, 36, 72, 0.12);
}

.home-story-list .home-idx {
    align-self: start;
    padding-top: 0.45rem;
}

.home-story h3 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 500;
    letter-spacing: -0.03em;
}

.home-story h3 a {
    transition: color 180ms ease;
}

.home-story h3 a:hover,
.home-story h3 a:focus-visible {
    color: var(--blue);
}

.home-story-list article > div:first-of-type p {
    margin: 0.35rem 0 0;
    max-width: 46ch;
    color: var(--home-muted);
    font-size: 1.02rem;
    line-height: 1.5;
}

.home-story-list .spec-text,
.home-story-list .spec-audio {
    grid-column: 2 / -1;
}

.spec-text p {
    max-width: none;
    margin: 0;
    padding: 0.7rem 0 0.15rem;
    color: var(--home-ink);
    font-size: 1.12rem;
    line-height: 1.5;
    border-top: 1px solid rgba(16, 36, 72, 0.1);
}

.spec-image,
.spec-doc,
.spec-audio {
    min-width: 0;
}

.spec-field {
    position: relative;
    width: min(100%, 220px);
    height: 108px;
    background: #d5deea;
    border: 1px solid rgba(16, 36, 72, 0.16);
}

.spec-shape {
    position: absolute;
    display: block;
}

.spec-shape.a {
    top: 18px;
    left: 14px;
    width: 46px;
    height: 58px;
    background: #b7c6da;
}

.spec-shape.b {
    top: 28px;
    left: 42px;
    width: 70px;
    height: 34px;
    background: #9aafc8;
}

.spec-shape.c {
    display: none;
}

.spec-crop {
    position: absolute;
    top: 22px;
    left: 38px;
    width: 78px;
    height: 48px;
    border: 1.5px solid var(--blue);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.spec-crop::before,
.spec-crop::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    border-color: var(--blue);
    border-style: solid;
}

.spec-crop::before {
    top: -1.5px;
    left: -1.5px;
    border-width: 1.5px 0 0 1.5px;
}

.spec-crop::after {
    right: -1.5px;
    bottom: -1.5px;
    border-width: 0 1.5px 1.5px 0;
}

.spec-image p,
.spec-audio p,
.spec-doc p {
    display: flex;
    gap: 0.4rem;
    margin: 0.4rem 0 0;
    color: #667388;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.spec-image b,
.spec-doc b {
    color: var(--blue);
}

.spec-audio svg {
    display: block;
    width: 100%;
    height: 46px;
}

.spec-audio p span:first-child {
    color: var(--blue);
}

.spec-page {
    display: grid;
    gap: 0.45rem;
    width: min(100%, 168px);
    margin-left: auto;
    padding: 0.85rem 0.8rem;
    background: #fbfcfe;
    border: 1px solid rgba(16, 36, 72, 0.16);
}

.spec-page span {
    display: block;
    height: 7px;
    background: #d5deea;
}

.spec-page .is-hit {
    background: rgba(30, 91, 214, 0.55);
}

.spec-page .short {
    width: 62%;
}

.home-direct {
    background: var(--home-navy);
    color: #f3f6fb;
}

.home-direct-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 3rem 4rem;
    align-items: center;
    padding: 5.25rem 0;
}

.home-direct .home-kicker {
    color: #9eb6e8;
}

.home-direct h2 {
    max-width: 14ch;
    color: #f4f7fb;
    font-size: clamp(2.2rem, 3.3vw, 3.25rem);
}

.home-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 4.25rem minmax(12rem, 0.82fr);
    align-items: center;
}

.home-flow-in {
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-flow-in li {
    position: relative;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 1.05rem;
    font-weight: 500;
}

.home-flow-in li::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    width: 4.25rem;
    border-top: 1px solid rgba(158, 182, 232, 0.9);
    transform-origin: left center;
    animation: home-draw 420ms ease both;
}

.home-flow-in li:nth-child(1)::after { animation-delay: 0.05s; }
.home-flow-in li:nth-child(2)::after { animation-delay: 0.12s; }
.home-flow-in li:nth-child(3)::after { animation-delay: 0.19s; }
.home-flow-in li:nth-child(4)::after { animation-delay: 0.26s; }

.home-flow-rail {
    position: relative;
    align-self: stretch;
}

.home-flow-rail::before {
    content: "";
    position: absolute;
    top: 1.45rem;
    right: 0;
    bottom: 1.45rem;
    border-left: 1px solid rgba(158, 182, 232, 0.9);
}

.home-flow-out {
    padding: 1.15rem 1.2rem 1rem;
    background: rgba(30, 91, 214, 0.18);
    border: 1px solid rgba(158, 182, 232, 0.45);
}

.home-flow-out > p:first-child,
.home-flow-cut em {
    margin: 0;
    color: #9eb6e8;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.home-flow-out ul {
    margin: 0.7rem 0 0;
    padding: 0;
    list-style: none;
}

.home-flow-out li {
    padding: 0.28rem 0;
    font-weight: 500;
}

.home-flow-cut {
    margin: 0.75rem 0 0;
    padding-top: 0.7rem;
    color: #9aa3b2;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.home-flow-cut s {
    text-decoration-thickness: 1.5px;
}

.home-flow-cut em {
    margin-left: 0.4rem;
    text-decoration: none;
}

.is-home .site-footer {
    background: var(--home-paper);
    border-top-color: var(--home-line);
    padding: 1.15rem max(2rem, calc((100% - 1240px) / 2));
}

@keyframes home-mark {
    from { background-color: transparent; }
}

@keyframes home-row {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@keyframes home-draw {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.spec-audio p {
    text-transform: none;
    letter-spacing: 0.01em;
    font-weight: 500;
}

.spec-audio p span:first-child {
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.polarity-band,
.workspace {
    padding: 5rem 1.25rem;
}

.polarity-band {
    background: #fff;
}

.polarity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    max-width: 1180px;
    margin: 0 auto;
}

.polarity-card {
    min-height: 280px;
    padding: 2rem;
    border-radius: 8px;
}

.polarity-card.is-positive {
    background: #ecf8ef;
    color: #14532d;
}

.polarity-card.is-negative {
    background: #fdecec;
    color: #7f1d1d;
}

.polarity-kicker {
    margin: 0 0 0.8rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.polarity-card h2 {
    margin: 0 0 0.8rem;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    letter-spacing: -0.04em;
}

.polarity-card p {
    margin: 0 0 1.4rem;
    max-width: 38ch;
    line-height: 1.6;
}

.polarity-tag {
    display: inline-block;
    padding: 0.45rem 0.7rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    font-weight: 600;
}

.polarity-tag.is-negated {
    text-decoration: line-through;
}

.polarity-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem 1rem;
    margin: 0.7rem 0 0.25rem;
}

.polarity-legend p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.polarity-chip {
    display: inline-flex;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.polarity-chip.is-positive {
    color: #14532d;
    background: #dcfce7;
}

.polarity-chip.is-negative {
    color: #7f1d1d;
    background: #fee2e2;
    text-decoration: line-through;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.45rem 1.5rem;
    padding: 0.75rem 1.5rem;
    background: #fff;
    border-top: 1px solid var(--line);
}

.footer-copy {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.85rem;
}

.footer-copy p {
    margin: 0;
    max-width: none;
    font-size: 0.88rem;
    letter-spacing: 0;
}

.footer-copy .footer-legal,
.footer-copy .footer-powered {
    margin-top: 0;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 400;
}

.footer-meta {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.footer-meta a:hover {
    color: var(--blue);
}

.is-app {
    height: 100svh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.is-app main {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding: 1.15rem 2rem 0.75rem;
    min-height: 0;
    overflow: hidden;
}

.is-app .workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.is-app .site-footer {
    flex-shrink: 0;
    padding: 0.45rem 2rem;
}

.is-app .footer-copy p:first-child {
    font-size: 0.8rem;
}

.workspace-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.workspace-head > div {
    flex: 1;
}

.eyebrow {
    margin: 0 0 0.6rem;
    color: var(--blue);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.workspace h1 {
    margin: 0 0 0.75rem;
    font-size: clamp(2.4rem, 4vw, 4.2rem);
    font-weight: 400;
    letter-spacing: -0.04em;
}

.is-app .workspace h1 {
    margin: 0 0 0.3rem;
    font-size: clamp(1.55rem, 2.2vw, 2.2rem);
}

.is-app .lede {
    font-size: 0.95rem;
}

.lede {
    margin: 0;
    max-width: 72ch;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.65;
}

.health-panel {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.7rem;
    background: #fff;
    border: 1px solid rgba(16, 36, 72, 0.16);
    border-radius: 8px;
    white-space: nowrap;
    font-size: 0.78rem;
}

.health-label {
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.health-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
}

.health-dot[data-health="ok"] { background: var(--ok); }
.health-dot[data-health="loading"] { background: var(--warn); }
.health-dot[data-health="down"] { background: var(--danger); }

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.35rem 0 0.65rem;
    padding: 0;
    list-style: none;
}

.type-pill {
    display: inline-flex;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: #e8eefc;
    color: var(--blue-dark);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.workspace-head,
.polarity-legend,
.legend {
    flex-shrink: 0;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
    flex: 1;
    min-height: 0;
    align-items: stretch;
    overflow: hidden;
}

.panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 1.35rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
    flex-shrink: 0;
}

.panel-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 500;
}

textarea {
    width: 100%;
    flex: 1;
    min-height: 0;
    padding: 1.1rem 1.2rem;
    resize: none;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    font: 1rem/1.65 var(--font);
}

textarea:focus,
.primary-btn:focus-visible,
.ghost-btn:focus-visible,
.sample-chip:focus-visible,
.hs-suggestion:focus-visible,
.logo:focus-visible,
.nav-toggle:focus-visible,
.home-go:focus-visible,
.home-quiet:focus-visible,
.home-strip a:focus-visible,
.home-story h3 a:focus-visible,
.site-nav a:focus-visible,
.nav-parent:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

.sample-chip,
.ghost-btn {
    padding: 0.45rem 0.8rem;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    font: 0.8rem/1 var(--font);
    font-weight: 500;
    transition: border-color 200ms ease, background-color 200ms ease;
}

.sample-chip:hover,
.ghost-btn:hover {
    background: #eef3ff;
    border-color: color-mix(in srgb, var(--blue) 40%, white);
}

.actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 148px;
    min-height: 46px;
    padding: 0.8rem 1.2rem;
    color: #fff;
    background: var(--blue);
    border: 0;
    border-radius: 999px;
    font: 0.95rem/1 var(--font);
    font-weight: 600;
    transition: background-color 200ms ease;
}

.primary-btn:hover {
    background: var(--blue-dark);
}

.primary-btn:disabled {
    cursor: wait;
    opacity: 0.7;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.hint,
.form-status,
.empty-state p {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.form-status {
    min-height: 1.2rem;
    margin-top: 0.8rem;
}

.form-status.is-error {
    color: var(--danger);
}

.form-status a {
    color: inherit;
    word-break: break-all;
}

.stats {
    display: flex;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.stats strong {
    color: var(--ink);
}

.empty-state {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    text-align: center;
}

.empty-state p {
    max-width: 42ch;
}

#composer {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#results,
.table-wrap {
    flex: 1 1 0%;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

.annotated {
    flex: 1 1 0%;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 1.1rem 1.2rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    line-height: 1.9;
    font-size: 1.05rem;
}

.entity-chip,
.entity-anchor {
    scroll-margin: 2.4rem 0;
}

.entity-chip {
    padding: 0.05rem 0.28rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.entity-chip.is-active {
    outline: 2px solid var(--blue);
    box-shadow: 0 0 0 3px rgba(30, 91, 214, 0.22);
}

.entity-chip.is-negated {
    text-decoration: line-through;
    outline: 2px solid var(--danger);
}

.table-wrap {
    margin-top: 0;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.results-table th,
.results-table td {
    padding: 0.75rem 0.55rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.results-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.entity-row {
    cursor: pointer;
    transition: background-color 160ms ease;
}

.entity-row:hover {
    background: #f4f7ff;
}

.entity-row.is-active {
    background: #e8eefc;
}

.neg-yes { color: var(--danger); font-weight: 700; }
.neg-no { color: var(--ok); font-weight: 700; }

[hidden] { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.type-PER, .type-PERSON { color: #082f49; background: var(--per); }
.type-ORG { color: #2e1065; background: var(--org); }
.type-LOC { color: #064e3b; background: var(--loc); }
.type-MISC { color: #451a03; background: var(--misc); }
.type-GPE { color: #042f2e; background: var(--gpe); }
.type-FAC { color: #4c0519; background: var(--fac); }
.type-NORP { color: #3b0764; background: var(--norp); }
.type-DATE { color: #1e3a8a; background: var(--date); }
.type-TIME { color: #312e81; background: var(--time); }
.type-CARDINAL { color: #451a03; background: var(--cardinal); }
.type-ORDINAL { color: #431407; background: var(--ordinal); }
.type-QUANTITY { color: #1a2e05; background: var(--quantity); }
.type-PERCENT { color: #134e4a; background: var(--percent); }
.type-MONEY { color: #052e16; background: var(--money); }
.type-EVENT { color: #500724; background: var(--event); }
.type-PRODUCT { color: #083344; background: var(--product); }
.type-LAW { color: #4a044e; background: var(--law); }
.type-LANGUAGE { color: #083344; background: var(--language); }
.type-WORK_OF_ART { color: #4c0519; background: var(--art); }

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1100px) {
    .home-hero-grid,
    .home-story-grid,
    .home-direct-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .home-story-intro {
        position: static;
    }

    .home-hero-grid {
        padding-bottom: 2.4rem;
    }

    .home-story-grid,
    .home-direct-grid {
        padding: 3.25rem 0;
    }

    .home-direct h2,
    .home-story-intro p {
        max-width: 22ch;
    }

    .home-strip-grid {
        grid-template-columns: 1fr 1fr;
    }

    .home-strip a {
        padding: 1.15rem 1rem 1.25rem;
        border-left: 0;
        border-bottom: 1px solid rgba(16, 36, 72, 0.1);
    }

    .home-strip a:nth-child(odd) {
        padding-left: 0;
        border-right: 1px solid rgba(16, 36, 72, 0.1);
    }
}

@media (max-width: 800px) {
    .home-hero::before {
        display: none;
    }

    .home-hero h1 {
        font-size: clamp(2.75rem, 7vw, 3.5rem);
    }

    .home-story-list article {
        grid-template-columns: 2.5rem minmax(0, 1fr);
    }

    .home-story-list .spec-text,
    .home-story-list .spec-audio,
    .home-story-list .spec-image,
    .home-story-list .spec-doc {
        grid-column: 2;
    }

    .home-story-list .home-idx {
        padding-top: 0;
    }

    .spec-page {
        margin-left: 0;
    }

    .home-flow {
        grid-template-columns: 1fr;
    }

    .home-flow-in li::after {
        display: none;
    }

    .home-flow-rail {
        height: 1.6rem;
    }

    .home-flow-rail::before {
        top: 0;
        bottom: 0;
        left: 0;
        right: auto;
    }
}

@media (max-width: 1120px) {
    .polarity-grid,
    body.is-app:has(.workspace-grid) .workspace-head {
        grid-template-columns: 1fr;
        display: grid;
    }

    /* The desktop shell is a fixed viewport. On a phone that shrinks the
       text card and clips Analizează. Let the page grow and keep the button
       in normal flow, directly under the text. */
    body.is-app:has(.workspace-grid) {
        height: auto !important;
        max-height: none !important;
        min-height: 100svh;
        overflow-x: clip !important;
        overflow-y: auto !important;
    }

    body.is-app:has(.workspace-grid) main,
    body.is-app:has(.workspace-grid) .workspace,
    body.is-app:has(.workspace-grid) .workspace-grid,
    body.is-app:has(.workspace-grid) .panel,
    body.is-app:has(.workspace-grid) #composer,
    body.is-app:has(.workspace-grid) .annotated,
    body.is-app:has(.workspace-grid) #results,
    body.is-app:has(.workspace-grid) .table-wrap,
    body.is-app:has(.workspace-grid) .empty-state {
        display: block;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        overflow: visible !important;
        flex: none !important;
    }

    body.is-app:has(.workspace-grid) .workspace,
    body.is-app:has(.workspace-grid) .workspace-grid,
    body.is-app:has(.workspace-grid) .panel,
    body.is-app:has(.workspace-grid) .legend,
    body.is-app:has(.workspace-grid) .polarity-legend,
    body.is-app:has(.workspace-grid) .chip-row {
        min-width: 0;
        max-width: 100%;
    }

    body.is-app:has(.workspace-grid) .workspace-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.9rem;
    }

    body.is-app:has(.workspace-grid) .annotated,
    body.is-app:has(.workspace-grid) #source-text,
    body.is-app:has(.workspace-grid) .entity-chip,
    body.is-app:has(.workspace-grid) .results-table td,
    body.is-app:has(.workspace-grid) .results-table th {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    body.is-app:has(.workspace-grid) #results,
    body.is-app:has(.workspace-grid) .table-wrap {
        max-width: 100%;
        overflow-x: auto !important;
    }

    body.is-app:has(.workspace-grid) .results-table {
        width: 100%;
        table-layout: fixed;
    }

    body.is-app:has(.workspace-grid) .site-header {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    body.is-app:has(.workspace-grid) .panel-head {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
    }

    body.is-app:has(.workspace-grid) #composer {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    body.is-app:has(.workspace-grid) #source-text {
        order: 1;
        flex: 0 0 auto;
        height: 15rem;
        min-height: 15rem;
        font-size: 16px;
    }

    body.is-app:has(.workspace-grid) .actions {
        order: 2;
        display: block;
        margin: 0;
    }

    body.is-app:has(.workspace-grid) #analyze-btn {
        display: flex;
        width: 100%;
        min-height: 48px;
    }

    body.is-app:has(.workspace-grid) .chip-row {
        order: 3;
        margin-top: 0;
    }

    body.is-app:has(.workspace-grid) .form-status {
        order: 4;
        margin-top: 0;
    }

    body.is-app:has(.workspace-grid) .hint {
        display: none;
    }

    body.is-app:has(.workspace-grid) .stats {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem 0.8rem;
    }
}

@media (max-width: 640px) {
    .is-home .site-header {
        padding: 0.75rem 1rem;
    }

    .is-app .site-header {
        padding: 0.75rem 1rem;
    }

    .site-nav a,
    .nav-parent {
        font-size: 0.82rem;
        padding: 0.42rem 0.7rem;
    }

    .polarity-band {
        padding: 3.2rem 1rem;
    }

    .home-shell {
        width: min(1240px, calc(100% - 2rem));
    }

    .home-hero {
        padding-top: 1.85rem;
    }

    .home-hero h1 {
        font-size: clamp(2.75rem, 12vw, 3.25rem);
    }

    .home-lead {
        font-size: 1.05rem;
    }

    .home-strip-grid {
        grid-template-columns: 1fr;
    }

    .home-strip a,
    .home-strip a:nth-child(odd) {
        padding: 1.05rem 0;
        border-right: 0;
        border-left: 0;
    }

    .home-board-body {
        grid-template-columns: 1fr;
    }

    .home-found {
        padding-top: 0.35rem;
        padding-left: 0;
        border-left: 0;
    }

    .is-home .site-footer {
        padding: 1rem;
    }

    .is-app main {
        padding: 0.85rem 1rem 0.75rem;
    }
}

@media (max-width: 420px) {
    .header-tools {
        gap: 0.28rem;
    }

    .lang-switch button span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .is-home .lang-switch button,
    .is-app .lang-switch button {
        padding: 0.38rem 0.36rem;
    }

    .theme-toggle,
    .nav-toggle {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 1120px) {
    .nav-toggle {
        display: grid;
    }

    .is-home .site-header,
    .is-app .site-header {
        display: flex;
        justify-content: space-between;
    }

    .is-home .header-tools,
    .is-app .header-tools {
        margin-left: auto;
    }

    .is-home .site-nav,
    .is-app .site-nav {
        position: absolute;
        top: calc(100% + 0.45rem);
        left: 0;
        right: 0;
        z-index: 60;
        display: none;
        flex-direction: column;
        align-items: stretch;
        justify-self: stretch;
        gap: 0.15rem;
        width: auto;
        max-height: min(70dvh, 32rem);
        margin: 0;
        padding: 0.45rem;
        overflow: auto;
        color: #0c1b33;
        background: #fff;
        border: 1px solid rgba(12, 27, 51, 0.08);
        border-radius: 16px;
        box-shadow: 0 18px 48px rgba(12, 27, 51, 0.14);
    }

    body.nav-open.is-home .site-nav,
    body.nav-open.is-app .site-nav {
        display: flex;
    }

    .is-home .site-nav,
    .is-app .site-nav {
        top: 100%;
        border-radius: 0;
        border-right: 0;
        border-left: 0;
        box-shadow: 0 16px 28px rgba(16, 25, 46, 0.08);
    }

    .is-home .logo img,
    .is-app .logo img {
        height: 2.05rem;
    }

    .health-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .health-panel {
        padding: 0.55rem;
    }

    .is-home .site-nav a,
    .is-app .site-nav a,
    .is-home .nav-parent,
    .is-app .nav-parent {
        justify-content: flex-start;
        width: 100%;
        min-height: 44px;
        font-size: 0.95rem;
        white-space: normal;
    }

    .nav-parent::after {
        margin-left: auto;
    }

    .nav-sub {
        position: static;
        min-width: 0;
        padding-top: 0.15rem;
    }

    .nav-sub-panel {
        border: 0;
        box-shadow: none;
        background: #f5f7fb;
    }

    body.is-app[data-theme="dark"] .site-nav {
        color: var(--ink);
        background: #182230;
        border-color: var(--line);
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
    }

    body.is-app[data-theme="dark"] .nav-sub-panel,
    body.is-app[data-theme="dark"] .nav-toggle:hover,
    body.is-app[data-theme="dark"] .nav-toggle:focus-visible {
        background: #10161f;
    }
}

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

body.is-app.is-scroll {
    height: auto;
    min-height: 100svh;
    overflow: auto;
}

body.is-app.is-scroll main,
body.is-app.is-scroll .workspace {
    overflow: visible;
}

.image-tool .tool-layout {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.image-tool .panel {
    overflow: visible;
}

.image-tool .primary-btn {
    gap: 0.65rem;
}

.image-tool .primary-btn:disabled {
    cursor: not-allowed;
}

.dropzone {
    display: grid;
    gap: 0.25rem;
    padding: 1.4rem 1.1rem;
    background: var(--paper);
    border: 1px dashed color-mix(in srgb, var(--blue) 45%, white);
    border-radius: 12px;
    cursor: pointer;
}

.dropzone.is-over {
    background: #eef3ff;
}

.dropzone-title {
    font-weight: 600;
}

.dropzone-meta,
.dropzone-file,
.results-meta,
.empty-note,
.result-folder {
    color: var(--muted);
    font-size: 0.88rem;
}

.dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.preview-frame {
    margin-top: 0.9rem;
    overflow: hidden;
    border-radius: 12px;
    background: #111;
}

.preview-frame img,
.result-media img {
    display: block;
    width: 100%;
    max-height: 280px;
    object-fit: contain;
}

.option-row,
.option-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1rem;
    margin-top: 1rem;
}

.option-row label,
.option-grid label,
.advanced {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.option-row input,
.option-grid input,
.option-grid select,
#class-filter {
    min-width: 0;
    padding: 0.55rem 0.7rem;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: 0.95rem/1.2 var(--font);
}

#class-filter {
    width: 100%;
    margin-bottom: 0.75rem;
}

.step-head {
    margin-top: 1.4rem;
}

.class-grid,
.method-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.sample-chip.is-on {
    color: #fff;
    background: var(--blue);
    border-color: var(--blue);
}

.advanced {
    margin-top: 0.9rem;
}

.advanced summary {
    cursor: pointer;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.8rem;
}

.result-card {
    display: grid;
    gap: 0.35rem;
    padding: 0.45rem;
    text-align: left;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    color: inherit;
}

button.result-card {
    cursor: pointer;
}

.result-media {
    display: grid;
    place-items: center;
    min-height: 120px;
    overflow: hidden;
    border-radius: 8px;
    background: #ececec;
}

.result-media img {
    max-height: 180px;
}

.result-score {
    justify-self: start;
    padding: 0.15rem 0.45rem;
    color: var(--blue-dark);
    background: #e8eefc;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.result-title {
    font-size: 0.88rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-card .ghost-btn {
    justify-self: start;
    text-decoration: none;
}

.remove-note {
    display: grid;
    gap: 0.35rem;
    margin-top: 1rem;
}

.remove-note span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.remove-note textarea {
    min-height: 5.5rem;
    flex: none;
    resize: vertical;
}

.result-zoom {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    gap: 0.8rem;
    padding: 2rem;
    background: rgba(16, 18, 32, 0.82);
}

.lightbox img {
    max-width: min(1100px, 92vw);
    max-height: 78vh;
    object-fit: contain;
}

.lightbox-caption {
    margin: 0;
    color: #fff;
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 42px;
    height: 42px;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 900px) {
    .image-tool .tool-layout {
        grid-template-columns: 1fr;
    }
}

.mode-row {
    display: flex;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

#youtube-panel label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

#youtube-url {
    width: 100%;
    padding: 0.7rem 0.8rem;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: 0.95rem/1.3 var(--font);
}

#bird-preview {
    width: 100%;
    max-height: 240px;
    margin-top: 0.9rem;
    background: #111;
    border-radius: 12px;
}

.species-list,
.segment-list {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.species-list li,
.segment-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.15rem 0.8rem;
    padding: 0.75rem 0.85rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.species-list strong,
.segment-list span {
    font-weight: 600;
}

.species-list em,
.species-list small,
.segment-list small {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
}

.species-list li > span,
.segment-list li > span:last-child {
    color: var(--blue);
    font-weight: 700;
}

#segment-list h3 {
    margin: 1.2rem 0 0.55rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.doc-flow {
    gap: 1rem;
}

.doc-flow .dropzone {
    position: relative;
    margin-top: 0.85rem;
}

.dp-lane-row {
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
}

.dp-lane-step {
    flex: 1 0 6.5rem;
}

.dp-node {
    width: 100%;
    min-height: 4.4rem;
    padding: 0.55rem 0.7rem;
    text-align: left;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    font: inherit;
}

.dp-node-kicker,
.dp-node-title {
    display: block;
}

.dp-node-kicker {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dp-node-title {
    margin-top: 0.2rem;
    font-size: 0.92rem;
    font-weight: 600;
}

.dp-node.is-done {
    color: #fff;
    background: var(--blue);
    border-color: var(--blue);
}

.dp-node.is-done .dp-node-kicker {
    color: rgba(255, 255, 255, 0.8);
}

.dp-node.is-current {
    border-color: var(--blue);
    box-shadow: inset 0 0 0 1px var(--blue);
}

.dp-node.is-view:not(.is-done) {
    background: #eef3ff;
}

.dp-node:disabled {
    cursor: default;
    opacity: 0.55;
}

.dp-seg {
    flex: 0 0 0.7rem;
    align-self: center;
    height: 2px;
    background: var(--line);
}

.dp-seg.is-done {
    background: var(--blue);
}

.dp-nav {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.dp-note {
    flex: 1;
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.dp-body h2,
.dp-card h3,
.dp-folder h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.dp-toolbar,
.dp-toolbar-actions,
.dp-folders {
    display: flex;
    gap: 0.75rem;
}

.dp-toolbar {
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.dp-toolbar p,
.dp-hero-panel p,
.dp-meta,
.empty-note {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.dp-toolbar-actions {
    flex-shrink: 0;
    align-items: center;
}

.dp-split {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
    gap: 1rem;
    align-items: start;
}

.dp-table-wrap {
    overflow-x: auto;
}

.dp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.dp-table th,
.dp-table td {
    padding: 0.55rem 0.45rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
}

.dp-table th {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dp-table tr.is-selected td {
    background: #eef3ff;
}

.dp-link {
    padding: 0;
    color: var(--blue-dark);
    background: none;
    border: 0;
    font: inherit;
    font-weight: 600;
    text-align: left;
}

.dp-input,
.dp-table select,
.dp-alloc select {
    width: 100%;
    min-width: 10rem;
    padding: 0.4rem 0.55rem;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

.dp-folders,
.dp-alloc,
.dp-leftover {
    flex-wrap: wrap;
}

.dp-folder,
.dp-card {
    margin-top: 0.9rem;
    padding: 0.85rem 0.9rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.dp-folder ul,
.dp-alloc,
.dp-leftover {
    display: grid;
    gap: 0.45rem;
    margin: 0.7rem 0 0;
    padding: 0;
    list-style: none;
}

.dp-alloc li,
.dp-leftover li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.dp-preview {
    position: sticky;
    top: 0.75rem;
}

.dp-text {
    max-height: 28rem;
    margin: 0.8rem 0 0;
    padding: 0.85rem;
    overflow: auto;
    white-space: pre-wrap;
    color: var(--ink);
    background: var(--paper);
    border-radius: 10px;
    font: 0.84rem/1.45 var(--font);
}

.dp-pill {
    display: inline-flex;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.dp-pill.is-ok {
    color: var(--ok);
    background: #ecf8ef;
}

.dp-pill.is-lipsa {
    color: var(--danger);
    background: #fdecec;
}

.dp-pill.is-neclar,
.dp-pill.is-neincadrat {
    color: #92400e;
    background: #fef3c7;
}

.dp-done {
    margin: 0 0 0.9rem;
    padding: 0.75rem 0.9rem;
    color: var(--ok);
    background: #ecf8ef;
    border-radius: 10px;
}

.dp-hero-panel {
    display: grid;
    gap: 0.8rem;
    justify-items: start;
}

@media (max-width: 900px) {
    .dp-split,
    .dp-toolbar,
    .dp-nav {
        display: grid;
        grid-template-columns: 1fr;
    }

    .dp-toolbar-actions {
        flex-wrap: wrap;
    }
}

body.is-app:has(.handbook-search) main {
    max-width: none;
    padding: 0.55rem 0.7rem 0.55rem;
}

body.is-app:has(.handbook-search) .site-footer {
    display: none;
}

.handbook-search .tool-layout {
    flex: 1;
    min-height: 0;
    align-items: stretch;
    grid-template-columns: minmax(340px, 32%) minmax(0, 1fr);
}

.handbook-search .eyebrow {
    margin-bottom: 0.2rem;
}

.handbook-search h1 {
    margin: 0 0 0.75rem;
    font-size: 1.65rem;
}

.handbook-search .panel {
    overflow: auto;
}

.hs-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: stretch;
}

.hs-bar input {
    flex: 1 1 16rem;
    min-width: 12rem;
    padding: 0.75rem 0.9rem;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    font: 0.98rem/1.3 var(--font);
}

.hs-bar input:focus {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.hs-bar .primary-btn {
    min-width: 7.5rem;
}

.handbook-search .mode-row {
    margin: 0.85rem 0 0.35rem;
}

.hs-suggestions {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.85rem;
}

.hs-suggestions-label {
    margin: 0;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hs-suggestion {
    width: 100%;
    padding: 0.55rem 0.75rem;
    text-align: left;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    font: 0.86rem/1.4 var(--font);
    cursor: pointer;
}

.hs-suggestion:hover,
.hs-suggestion:focus-visible {
    background: #eef3ff;
    border-color: color-mix(in srgb, var(--blue) 40%, white);
}

.hs-suggestion.is-on {
    border-color: var(--blue);
    box-shadow: inset 0 0 0 1px var(--blue);
}

.hs-hits {
    display: grid;
    gap: 0.7rem;
    margin-top: 0.85rem;
}

.hs-hit {
    display: grid;
    gap: 0.45rem;
    width: 100%;
    padding: 0.9rem 1rem;
    text-align: left;
    color: inherit;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    font: inherit;
    cursor: pointer;
}

.hs-hit.is-on {
    border-color: var(--blue);
    box-shadow: inset 0 0 0 1px var(--blue);
}

.hs-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.hs-meta span {
    padding: 0.15rem 0.55rem;
    color: var(--blue-dark);
    background: #e8eefc;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.hs-score {
    color: #fff !important;
    background: var(--blue) !important;
}

.hs-content {
    margin: 0;
    color: var(--ink);
    font-size: 0.92rem;
    line-height: 1.5;
}

.hs-path {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.handbook-preview {
    overflow: hidden;
    padding: 0.35rem;
}

.pdf-stage {
    flex: 1;
    min-height: 0;
    height: 100%;
    display: flex;
    overflow: hidden;
    border-radius: 8px;
    background: #525659;
}

.pdf-stage .empty-note {
    margin: auto;
    padding: 1.5rem;
    color: #d6d6d6;
    text-align: center;
}

.pdf-stage.has-pdf .empty-note {
    display: none;
}

#handbook-frame {
    display: none;
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: #111;
}

.pdf-stage.has-pdf #handbook-frame {
    display: block;
}

@media (max-width: 900px) {
    .handbook-search .tool-layout {
        grid-template-columns: 1fr;
    }

    .hs-bar {
        flex-direction: column;
    }

    .pdf-stage {
        min-height: 70vh;
    }
}

body.is-app[data-theme="dark"] {
    --paper: #10161f;
    --ink: #eef3fb;
    --muted: #a9b4c8;
    --line: rgba(226, 232, 240, 0.14);
    --blue-dark: #c5d4ff;
    color-scheme: dark;
    background: var(--paper);
    color: var(--ink);
}

body.is-app[data-theme="dark"] .site-header,
body.is-app[data-theme="dark"] .site-footer,
body.is-app[data-theme="dark"] .panel,
body.is-app[data-theme="dark"] .health-panel,
body.is-app[data-theme="dark"] .nav-sub-panel,
body.is-app[data-theme="dark"] .lang-switch,
body.is-app[data-theme="dark"] .theme-toggle,
body.is-app[data-theme="dark"] .ghost-btn,
body.is-app[data-theme="dark"] .sample-chip,
body.is-app[data-theme="dark"] .hs-suggestion,
body.is-app[data-theme="dark"] .dp-node,
body.is-app[data-theme="dark"] .dp-input,
body.is-app[data-theme="dark"] .dp-table select,
body.is-app[data-theme="dark"] .dp-alloc select,
body.is-app[data-theme="dark"] input,
body.is-app[data-theme="dark"] select,
body.is-app[data-theme="dark"] textarea {
    background: #182230;
    color: var(--ink);
    border-color: var(--line);
}

body.is-app[data-theme="dark"] .site-header {
    background: rgba(16, 22, 31, 0.92);
    box-shadow: none;
    backdrop-filter: blur(16px);
}

body.is-app[data-theme="dark"] .site-nav > a:hover,
body.is-app[data-theme="dark"] .site-nav > a:focus-visible,
body.is-app[data-theme="dark"] .nav-parent:hover,
body.is-app[data-theme="dark"] .nav-parent:focus-visible,
body.is-app[data-theme="dark"] .nav-group:hover > .nav-parent {
    background: transparent;
    color: #c5d4ff;
}

body.is-app[data-theme="dark"] .site-nav > a.is-active,
body.is-app[data-theme="dark"] .nav-parent.is-active,
body.is-app[data-theme="dark"] .nav-group:hover > .nav-parent.is-active {
    background: transparent;
    color: #c5d4ff;
    border-color: transparent;
    box-shadow: inset 0 -2px 0 var(--blue);
}

body.is-app[data-theme="dark"] .nav-sub a:hover,
body.is-app[data-theme="dark"] .ghost-btn:hover,
body.is-app[data-theme="dark"] .sample-chip:hover,
body.is-app[data-theme="dark"] .hs-suggestion:hover,
body.is-app[data-theme="dark"] .hs-suggestion:focus-visible,
body.is-app[data-theme="dark"] .dp-node.is-view:not(.is-done),
body.is-app[data-theme="dark"] .dp-table tr.is-selected td,
body.is-app[data-theme="dark"] .hs-hit,
body.is-app[data-theme="dark"] .result-card,
body.is-app[data-theme="dark"] .species-list li,
body.is-app[data-theme="dark"] .segment-list li {
    background: #223044;
    color: var(--ink);
}

body.is-app[data-theme="dark"] .nav-sub a.is-active,
body.is-app[data-theme="dark"] .sample-chip.is-on,
body.is-app[data-theme="dark"] .hs-suggestion.is-on,
body.is-app[data-theme="dark"] .lang-switch button[aria-pressed="true"],
body.is-app[data-theme="dark"] .primary-btn,
body.is-app[data-theme="dark"] .dp-node.is-done {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

body.is-app[data-theme="dark"] .hs-meta span,
body.is-app[data-theme="dark"] .type-pill,
body.is-app[data-theme="dark"] .result-score {
    color: #dbe6ff;
    background: #2a3a58;
}

body.is-app[data-theme="dark"] .hs-score {
    color: #fff !important;
    background: var(--blue) !important;
}

body.is-app[data-theme="dark"] .dropzone {
    background: #121a26;
}

body.is-app[data-theme="dark"] .preview-frame,
body.is-app[data-theme="dark"] .pdf-stage,
body.is-app[data-theme="dark"] #handbook-frame {
    background: #0b0f16;
}

.stt-log {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.stt-log li.done {
    color: var(--muted);
}

.stt-title {
    margin: 0 0 0.7rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.stt-player {
    width: 100%;
    margin-bottom: 0.8rem;
}

.stt-transcript,
.stt-text {
    max-height: 280px;
    overflow: auto;
    margin: 0;
    padding: 0.85rem 0.95rem;
    white-space: pre-wrap;
    line-height: 1.7;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    font: 0.95rem/1.7 var(--font);
}

.stt-transcript {
    white-space: normal;
}

.stt-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.9rem 0 0.6rem;
}

.stt-word {
    cursor: pointer;
    border-radius: 4px;
}

.stt-word.active {
    background: #dbe6ff;
    color: var(--blue-dark);
}

.stt-word.suspect {
    text-decoration: underline wavy #c2410c;
    text-underline-offset: 3px;
}

body.is-app[data-theme="dark"] .stt-transcript,
body.is-app[data-theme="dark"] .stt-text {
    background: #121a26;
}

body.is-app[data-theme="dark"] .stt-word.active {
    background: #2a3a58;
    color: #dbe6ff;
}

.stt-saved {
    margin-top: 1.2rem;
}

.stt-saved h3 {
    margin: 0 0 0.55rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.stt-saved ul {
    display: grid;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.stt-saved button {
    width: 100%;
    padding: 0.55rem 0.7rem;
    text-align: left;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    font: 0.88rem/1.35 var(--font);
    cursor: pointer;
}

.stt-saved button.is-on {
    border-color: var(--blue);
    background: #e8eefc;
}

body.is-app[data-theme="dark"] .stt-saved button {
    background: #121a26;
}

body.is-app[data-theme="dark"] .stt-saved button.is-on {
    background: #2a3a58;
}

.image-tool .tool-layout > .panel,
.receipt-tool .tool-layout > .panel {
    min-width: 0;
}

.receipt-stage {
    display: grid;
    place-items: center;
    min-height: 240px;
    overflow: hidden;
    border-radius: 12px;
    background: #111;
    color: #e8eefc;
}

.receipt-stage video,
.receipt-stage img {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
}

.receipt-stage .empty-note {
    margin: 0;
    padding: 1.2rem;
    color: #c5d0e6;
    text-align: center;
}

.camera-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    opacity: 0;
}

.receipt-total {
    margin: 0 0 0.9rem;
    font-size: 1.45rem;
    font-weight: 650;
}

.receipt-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.65rem;
}

.receipt-fact {
    display: grid;
    gap: 0.2rem;
    padding: 0.7rem 0.8rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.receipt-fact span {
    color: var(--muted);
    font-size: 0.75rem;
}

.receipt-fact strong {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.receipt-subtitle {
    margin: 1.1rem 0 0.45rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.receipt-vat {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--ink);
}

.receipt-table-wrap {
    max-width: 100%;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.receipt-table th,
.receipt-table td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

.receipt-table th:nth-child(2),
.receipt-table td:nth-child(2) {
    white-space: normal;
    min-width: 140px;
}

.receipt-table th {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
}

body.is-app[data-theme="dark"] .receipt-fact,
body.is-app[data-theme="dark"] .receipt-table-wrap {
    background: #121a26;
}

.receipt-archive {
    margin-top: 1rem;
}

.receipt-gallery {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
}

.receipt-card {
    flex: 0 0 148px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    text-align: left;
    color: inherit;
    font: inherit;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
}

.receipt-card img {
    display: block;
    width: 100%;
    height: 168px;
    object-fit: cover;
    background: #111;
}

.receipt-card span {
    display: block;
    padding: 0.45rem 0.55rem 0.6rem;
    font-size: 0.75rem;
    line-height: 1.35;
}

.receipt-card.is-on {
    border-color: var(--blue);
    box-shadow: 0 0 0 1px var(--blue);
}

body.is-app[data-theme="dark"] .receipt-card {
    background: #121a26;
}

