/* Hugsa AI page and tool layout.

   css/brand.css holds the shared Hugsa public foundation: palette, type scale,
   spacing rhythm, content width, focus treatment, buttons, form controls and the
   theme switch. This file adds only the composition of this product: the shell,
   the marketing sections, the tool workspaces and the printed quotation. */

body {
    isolation: isolate;
    position: relative;
    background-image: var(--page-gradient);
}

body::before,
body::after {
    content: "";
    inset: 0;
    pointer-events: none;
    /* The atmosphere belongs to the page, not the viewport: an absolute layer
       covers the whole document instead of ending at the first screen height. */
    position: absolute;
}

body::before {
    background: var(--ambient-glow);
    z-index: -2;
}

body::after {
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 4rem 4rem;
    mask-image: radial-gradient(ellipse at 50% 26%, black, transparent 72%);
    opacity: 0.5;
    z-index: -1;
}

[hidden] {
    display: none !important;
}

/* ---------------------------------------------------------------- shell */

.site-shell {
    margin: 0 auto;
    max-width: calc(var(--content-max-width) + (2 * var(--page-gutter)));
    padding: 0 var(--page-gutter);
}

.site-header {
    align-items: center;
    background: var(--header-gradient);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
    padding: 1rem 0;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.35rem;
    margin-right: auto;
}

.site-nav a {
    border-radius: var(--radius-sm);
    color: var(--muted-text);
    font-weight: 600;
    padding: 0.35rem 0.1rem;
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--text);
}

.site-nav a.active {
    color: var(--text);
    box-shadow: inset 0 -2px 0 var(--accent);
}

.site-header__tools {
    align-items: center;
    display: flex;
    gap: 0.6rem;
    margin-left: auto;
}

#main-content {
    margin: 0 auto;
    max-width: var(--content-max-width);
    min-height: 62vh;
    padding: var(--space-5) 0;
    position: relative;
}

.site-footer {
    border-top: 1px solid var(--border-color);
    display: grid;
    gap: var(--space-3);
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
    padding: var(--space-4) 0 var(--space-3);
}

.site-footer__intro p {
    margin: 0 0 0.4rem;
}

.site-footer__name {
    align-items: baseline;
    color: var(--text);
    display: inline-flex;
    font-size: 1.15rem;
    font-weight: 700;
    gap: 0.4rem;
    letter-spacing: -0.03em;
}

.site-footer__intro > p:not(.site-footer__name) {
    color: var(--muted-text);
    font-size: var(--font-size-small);
    max-width: 32ch;
}

.site-footer__column {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.site-footer__column h2 {
    color: var(--muted-text);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin: 0 0 0.2rem;
    text-transform: uppercase;
}

.site-footer__column a,
.site-footer__intro a {
    color: var(--muted-text);
    font-size: var(--font-size-small);
    text-decoration: none;
}

.site-footer__column a:hover,
.site-footer__intro a:hover {
    color: var(--text);
    text-decoration: underline;
}

.site-footer__legal {
    border-top: 1px solid var(--border-color);
    color: var(--muted-text);
    display: flex;
    flex-wrap: wrap;
    font-size: var(--font-size-small);
    gap: 0.35rem 0.6rem;
    grid-column: 1 / -1;
    margin: 0;
    padding-top: var(--space-2);
}

/* ---------------------------------------------------------------- hero */

.hero {
    align-items: center;
    display: grid;
    gap: var(--space-4);
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    padding-bottom: var(--space-5);
}

.hero h1 {
    max-width: 22ch;
}

.hero__intro {
    color: var(--muted-text);
    font-size: clamp(1.075rem, 1.4vw, 1.25rem);
    max-width: 56ch;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.hero__panel {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 18px 48px rgba(8, 45, 61, 0.08);
    padding: var(--space-3);
}

.hero__panel-head {
    color: var(--muted-text);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin: 0 0 var(--space-2);
    text-transform: uppercase;
}

.hero--task {
    align-items: start;
}

.hero--task h1 {
    max-width: 26ch;
}

.popular-list {
    display: grid;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.popular-tool {
    align-items: center;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text);
    display: grid;
    gap: 0.75rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 0.55rem 0.6rem;
    text-decoration: none;
    transition: background-color 140ms ease, border-color 140ms ease;
}

.popular-tool:hover {
    background: var(--surface-strong);
    border-color: var(--border-color);
    color: var(--text);
}

.popular-tool__icon {
    color: var(--accent);
    height: 1.3rem;
    width: 1.3rem;
}

.popular-tool__text {
    display: grid;
    gap: 0.1rem;
}

.popular-tool__name {
    font-weight: 650;
    line-height: 1.25;
}

.popular-tool__task {
    color: var(--muted-text);
    font-size: var(--font-size-small);
    line-height: 1.3;
}

.popular-tool__arrow {
    color: var(--accent);
    font-weight: 700;
}

/* ---------------------------------------------------------------- sections */

.section {
    border-top: 1px solid var(--border-color);
    padding: var(--space-5) 0;
}

.section__head {
    max-width: 60ch;
}

.section__head p {
    color: var(--muted-text);
}

.section__foot {
    margin-top: var(--space-3);
}

/* ---------------------------------------------------------------- discovery */

.section--discovery {
    border-top: 0;
    padding-top: 0;
}

.discovery {
    margin-top: var(--space-3);
}

.discovery__search {
    align-items: center;
    display: flex;
    max-width: 44rem;
    position: relative;
}

.discovery__search-icon {
    color: var(--muted-text);
    display: inline-flex;
    left: 1.05rem;
    pointer-events: none;
    position: absolute;
}

.discovery__search-icon svg {
    height: 1.2rem;
    width: 1.2rem;
}

.discovery__input {
    background: var(--background);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    box-shadow: 0 10px 30px rgba(8, 45, 61, 0.07);
    color: var(--text);
    font: inherit;
    font-size: 1.05rem;
    min-height: 3.25rem;
    padding: 0.8rem 3.4rem 0.8rem 3rem;
    width: 100%;
}

.discovery__input::placeholder {
    color: var(--muted-text);
}

.discovery__input:hover {
    border-color: var(--accent-soft);
}

.discovery__input:focus {
    border-color: var(--accent);
}

.discovery__input::-webkit-search-cancel-button,
.discovery__input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.discovery__clear {
    align-items: center;
    background: none;
    border: 1px solid transparent;
    border-radius: 50%;
    color: var(--muted-text);
    cursor: pointer;
    display: inline-flex;
    height: 2.25rem;
    justify-content: center;
    position: absolute;
    right: 0.45rem;
    width: 2.25rem;
}

.discovery__clear:hover {
    background: var(--control-hover);
    color: var(--text);
}

.discovery__clear svg {
    height: 1rem;
    width: 1rem;
}

.discovery__hint {
    color: var(--muted-text);
    font-size: var(--font-size-small);
    margin: 0.6rem 0 0;
}

.discovery__categories,
.all-tasks,
.discovery__results {
    margin-top: var(--space-4);
}

.category-grid {
    display: grid;
    gap: var(--space-2);
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-card {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text);
    display: grid;
    gap: 0.75rem 1rem;
    grid-template-columns: auto minmax(0, 1fr);
    height: 100%;
    padding: var(--space-3);
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.category-card:hover {
    background: var(--surface);
    border-color: var(--accent-soft);
    box-shadow: 0 12px 32px rgba(8, 45, 61, 0.07);
    color: var(--text);
    transform: translateY(-2px);
}

.category-card__icon {
    align-items: center;
    background: var(--surface-strong);
    border-radius: var(--radius-sm);
    color: var(--accent);
    display: inline-flex;
    height: 2.6rem;
    justify-content: center;
    width: 2.6rem;
}

.category-card__icon-svg {
    height: 1.45rem;
    width: 1.45rem;
}

.category-card__body {
    display: grid;
    gap: 0.25rem;
}

.category-card__name {
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.category-card__description {
    color: var(--muted-text);
    font-size: var(--font-size-small);
    line-height: 1.45;
}

.category-card__meta {
    align-items: center;
    display: flex;
    gap: 1rem;
    grid-column: 1 / -1;
    justify-content: space-between;
    padding-top: 0.25rem;
}

.category-card__count {
    color: var(--muted-text);
    font-size: 0.78rem;
    font-weight: 650;
}

.category-card__arrow {
    color: var(--accent);
    font-weight: 700;
    transition: transform 160ms ease;
}

.category-card:hover .category-card__arrow {
    transform: translateX(2px);
}

.task-grid {
    display: grid;
    gap: var(--space-2);
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    list-style: none;
    margin: 0;
    max-width: 56rem;
    padding: 0;
}

.task-card {
    align-items: start;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text);
    display: grid;
    gap: 1rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
    height: 100%;
    padding: var(--space-3);
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.task-card:hover {
    background: var(--surface);
    border-color: var(--accent-soft);
    box-shadow: 0 12px 32px rgba(8, 45, 61, 0.07);
    color: var(--text);
    transform: translateY(-2px);
}

.task-card__icon {
    color: var(--accent);
    height: 2rem;
    width: 2rem;
}

.task-card__body {
    display: grid;
    gap: 0.2rem;
}

.task-card__task {
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.task-card__tool {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.task-card__description {
    color: var(--muted-text);
    font-size: var(--font-size-small);
    line-height: 1.45;
    margin-top: 0.15rem;
}

.task-card__arrow {
    align-self: center;
    color: var(--accent);
    font-weight: 700;
}

.all-tasks__head {
    max-width: 60ch;
}

.all-tasks__head p {
    color: var(--muted-text);
}

.task-index {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    list-style: none;
    margin: var(--space-3) 0 0;
    overflow: hidden;
    padding: 0;
}

.task-index li + li {
    border-top: 1px solid var(--border-color);
}

.task-index__link {
    align-items: center;
    color: var(--text);
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: 0.9rem var(--space-3);
    text-decoration: none;
    transition: background-color 140ms ease;
}

.task-index__link:hover {
    background: var(--surface);
    color: var(--text);
}

.task-index__task {
    font-weight: 650;
}

.task-index__tool {
    color: var(--muted-text);
    font-size: var(--font-size-small);
}

.task-index__arrow {
    color: var(--accent);
    font-weight: 700;
}

.discovery__results-head {
    align-items: baseline;
    display: flex;
    gap: 0.6rem;
}

.discovery__results-head h2 {
    margin: 0;
}

.discovery__results .task-grid {
    margin-top: var(--space-3);
}

.discovery__results-count {
    background: var(--surface-strong);
    border-radius: var(--radius-pill);
    color: var(--muted-text);
    font-size: 0.78rem;
    font-weight: 700;
    min-width: 1.7rem;
    padding: 0.15rem 0.5rem;
    text-align: center;
}

.discovery__empty {
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    margin-top: var(--space-2);
    padding: var(--space-4) var(--space-3);
    text-align: center;
}

.discovery__empty h3 {
    margin: 0 0 0.35rem;
}

.discovery__empty p {
    color: var(--muted-text);
    margin: 0 auto;
    max-width: 46ch;
}

.steps {
    counter-reset: step;
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    margin-top: var(--space-4);
}

.step {
    border-left: 2px solid var(--accent-soft);
    padding-left: var(--space-2);
}

.step__number {
    color: var(--accent);
    font-size: var(--font-size-small);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.step h3 {
    font-size: 1.1rem;
    margin: 0.25rem 0 0.4rem;
}

.step p {
    color: var(--muted-text);
    font-size: var(--font-size-small);
    margin: 0;
}

.callout {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: space-between;
    margin-top: var(--space-4);
    padding: var(--space-3);
}

.callout h2,
.callout h3 {
    margin: 0 0 0.4rem;
}

.callout p {
    color: var(--muted-text);
    margin: 0;
    max-width: 60ch;
}

.callout--quiet {
    background: transparent;
}

/* ---------------------------------------------------------------- inner pages */

.page-head {
    max-width: 62ch;
    padding-bottom: var(--space-4);
}

.page-head h1 {
    max-width: 24ch;
}

.page-head .lede {
    color: var(--muted-text);
}

.page-section {
    border-top: 1px solid var(--border-color);
    padding: var(--space-4) 0;
}

.page-section:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.prose {
    max-width: 68ch;
}

.prose h2 {
    margin-top: var(--space-4);
}

.prose h2:first-child {
    margin-top: 0;
}

.prose p,
.prose li {
    color: var(--muted-text);
}

.prose ul {
    padding-left: 1.15rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose a {
    color: var(--link-color);
}

.service-list {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    list-style: none;
    margin: var(--space-4) 0 0;
    padding: 0;
}

.service-list li {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--space-3);
}

.service-list h3 {
    font-size: 1.05rem;
    margin: 0 0 0.4rem;
}

.service-list p {
    color: var(--muted-text);
    font-size: var(--font-size-small);
    margin: 0;
}

.badge {
    background: var(--surface-strong);
    border-radius: var(--radius-pill);
    color: var(--muted-text);
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-top: 0.6rem;
    padding: 0.2rem 0.6rem;
    text-transform: uppercase;
}

.breadcrumbs {
    color: var(--muted-text);
    font-size: var(--font-size-small);
    margin-bottom: var(--space-3);
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.55rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumbs li {
    align-items: center;
    display: flex;
    gap: 0.55rem;
}

.breadcrumbs li + li::before {
    color: var(--border-strong);
    content: "/";
}

.breadcrumbs a {
    color: var(--muted-text);
    font-weight: 600;
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--text);
    text-decoration: underline;
}

.breadcrumbs [aria-current="page"] {
    color: var(--text);
    font-weight: 650;
}

.category-page__foot {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.other-categories {
    border-top: 1px solid var(--border-color);
    margin-top: var(--space-5);
    padding-top: var(--space-3);
}

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: var(--space-2) 0 0;
    padding: 0;
}

.category-chips a {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    color: var(--text);
    display: inline-flex;
    font-size: var(--font-size-small);
    font-weight: 650;
    padding: 0.45rem 0.8rem;
    text-decoration: none;
}

.category-chips a:hover {
    background: var(--surface-strong);
    border-color: var(--accent-soft);
    color: var(--text);
}

/* ---------------------------------------------------------------- workspace */

.tool-page .page-head {
    padding-bottom: var(--space-3);
}

.workspace {
    align-items: start;
    display: grid;
    gap: var(--space-3);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
}

.panel {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--space-3);
}

.panel--form {
    position: sticky;
    top: var(--space-2);
}

.panel__head {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.panel__head h2 {
    font-size: 1.2rem;
    margin: 0;
}

.panel__head p {
    color: var(--muted-text);
    font-size: var(--font-size-small);
    margin: 0;
}

.mode-switch {
    background: var(--control-track);
    border: 1px solid var(--control-border);
    border-radius: var(--radius-pill);
    display: inline-flex;
    gap: 0.15rem;
    padding: 0.15rem;
}

.mode-switch button {
    background: none;
    border: 0;
    border-radius: var(--radius-pill);
    color: var(--control-text);
    cursor: pointer;
    font: inherit;
    font-size: var(--font-size-small);
    font-weight: 700;
    padding: 0.45rem 0.9rem;
}

.mode-switch button[aria-pressed="true"] {
    background: var(--control-active);
    box-shadow: var(--control-active-shadow);
    color: var(--control-active-text);
}

.dropzone {
    background: var(--surface);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    margin-bottom: var(--space-3);
    padding: var(--space-3);
    text-align: center;
}

.dropzone:hover,
.dropzone:focus-within {
    border-color: var(--accent);
}

.dropzone input[type="file"] {
    background: var(--background);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    display: block;
    font: inherit;
    font-size: var(--font-size-small);
    margin: 0 auto;
    max-width: 100%;
    padding: 0.55rem;
    width: 100%;
}

.dropzone input[type="file"]::file-selector-button {
    background: var(--button-bg);
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--button-text);
    cursor: pointer;
    font: inherit;
    font-size: var(--font-size-small);
    font-weight: 650;
    margin-right: 0.75rem;
    padding: 0.5rem 0.85rem;
}

.dropzone__hint {
    color: var(--muted-text);
    font-size: var(--font-size-small);
    margin: 0.6rem 0 0;
}

.file-chip {
    align-items: center;
    background: var(--surface-strong);
    border-radius: var(--radius-sm);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    justify-content: space-between;
    margin-bottom: var(--space-3);
    padding: 0.6rem 0.8rem;
}

.file-chip span {
    font-size: var(--font-size-small);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.link-button {
    background: none;
    border: 0;
    color: var(--link-color);
    cursor: pointer;
    font: inherit;
    font-size: var(--font-size-small);
    font-weight: 650;
    padding: 0;
    text-decoration: underline;
}

.actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.actions--end {
    justify-content: flex-end;
}

.muted {
    color: var(--muted-text);
    font-size: var(--font-size-small);
}

.inline-note {
    background: var(--surface);
    border-left: 3px solid var(--accent-soft);
    border-radius: var(--radius-sm);
    color: var(--muted-text);
    font-size: var(--font-size-small);
    margin: var(--space-2) 0 0;
    padding: 0.7rem 0.85rem;
}

/* ---------------------------------------------------------------- feedback */

.alert {
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-small);
    margin: var(--space-2) 0;
    padding: var(--space-2) var(--space-3);
}

.alert h3 {
    font-size: 1rem;
    margin: 0 0 0.3rem;
}

.alert p {
    margin: 0;
}

.alert--error {
    background: var(--danger-surface);
    border-color: var(--danger);
}

.alert--warning {
    background: var(--warning-surface);
    border-color: var(--warning);
}

.alert--success {
    background: var(--success-surface);
    border-color: var(--success);
}

.alert a {
    color: inherit;
    font-weight: 650;
}

.progress {
    align-items: center;
    color: var(--muted-text);
    display: flex;
    font-size: var(--font-size-small);
    gap: 0.65rem;
    margin-top: var(--space-3);
}

.spinner {
    animation: spin 900ms linear infinite;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    border-top-color: var(--accent);
    display: inline-block;
    height: 1rem;
    width: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .spinner { animation: none; }
    .category-card,
    .task-card,
    .popular-tool,
    .task-index__link,
    .category-card__arrow {
        transition: none;
    }
}

/* ---------------------------------------------------------------- results */

.result-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.result-empty {
    align-items: center;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--muted-text);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    justify-content: center;
    min-height: 18rem;
    padding: var(--space-3);
    text-align: center;
}

.result-empty svg {
    color: var(--accent-soft);
    height: 2.2rem;
    width: 2.2rem;
}

.result-empty p {
    margin: 0;
    max-width: 34ch;
}

.result-card {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--space-3);
}

.result-card__head {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.result-card__head h2 {
    font-size: 1.25rem;
    margin: 0;
}

.result-meta {
    color: var(--muted-text);
    display: flex;
    flex-wrap: wrap;
    font-size: var(--font-size-small);
    gap: 0.35rem 1rem;
    margin: 0;
}

.result-section {
    border-top: 1px solid var(--border-color);
    padding-top: var(--space-2);
    margin-top: var(--space-2);
}

.result-section:first-of-type {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.result-section h3 {
    font-size: 1.02rem;
    margin: 0 0 0.5rem;
}

.result-section p {
    margin: 0 0 0.5rem;
}

.result-list {
    margin: 0;
    padding-left: 1.1rem;
}

.result-list li {
    margin-bottom: 0.5rem;
}

.result-list li:last-child {
    margin-bottom: 0;
}

.result-list strong {
    font-weight: 650;
}

.task-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.task-list li {
    border-left: 2px solid var(--accent-soft);
    margin-bottom: 0.7rem;
    padding-left: 0.75rem;
}

.task-list li:last-child {
    margin-bottom: 0;
}

.task-list p {
    color: var(--muted-text);
    font-size: var(--font-size-small);
    margin: 0.15rem 0 0;
}

.task-meta {
    color: var(--muted-text);
    display: flex;
    flex-wrap: wrap;
    font-size: var(--font-size-small);
    gap: 0.3rem 0.9rem;
    margin-top: 0.2rem;
}

.quote-card {
    background: var(--surface);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    margin-bottom: 0.65rem;
    padding: 0.65rem 0.8rem;
}

.quote-card blockquote {
    color: var(--text);
    font-style: italic;
    margin: 0 0 0.35rem;
}

.quote-card footer {
    color: var(--muted-text);
    display: flex;
    flex-wrap: wrap;
    font-size: var(--font-size-small);
    gap: 0.3rem 0.8rem;
}

.draft-reply {
    display: grid;
    gap: var(--space-2);
}

.draft-reply textarea {
    background: var(--background);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    line-height: 1.55;
    min-height: 18rem;
    padding: 0.75rem;
    resize: vertical;
    width: 100%;
}

.print-only-quote {
    display: none;
}

.example-panel {
    background: var(--surface);
    border-style: dashed;
    margin-top: var(--space-3);
}

.example-reply {
    white-space: pre-line;
}

.example-panel .result-section h3 {
    color: var(--muted-text);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ---------------------------------------------------------------- quotation */

.totals {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-top: var(--space-2);
    padding: 0.7rem 0.9rem;
}

.totals__row {
    display: flex;
    font-size: var(--font-size-small);
    gap: var(--space-2);
    justify-content: space-between;
    padding: 0.2rem 0;
}

.totals__row--total {
    border-top: 1px solid var(--border-strong);
    font-size: 1rem;
    font-weight: 700;
    margin-top: 0.35rem;
    padding-top: 0.5rem;
}

.totals__value {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.line-editor {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-2);
    padding: var(--space-2);
}

.line-editor__head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.line-editor__head span {
    color: var(--muted-text);
    font-size: var(--font-size-small);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.line-editor__grid {
    display: grid;
    gap: 0 0.75rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.line-editor__grid .field {
    margin-bottom: 0.6rem;
}

.line-editor__description {
    grid-column: 1 / -1;
}

.line-editor__grid .field label {
    font-size: var(--font-size-small);
    font-weight: 600;
}

.line-editor__total {
    color: var(--muted-text);
    font-size: var(--font-size-small);
    margin: 0.2rem 0 0;
    text-align: right;
}

.quotation-paper {
    background: var(--background);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: clamp(1.25rem, 3vw, 2.25rem);
}

.quotation-paper__top {
    align-items: start;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: space-between;
    padding-bottom: var(--space-3);
}

.quotation-paper__supplier {
    color: var(--muted-text);
    font-size: var(--font-size-small);
    max-width: 30ch;
    white-space: pre-line;
}

.quotation-paper__supplier strong {
    color: var(--text);
    display: block;
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}

.quotation-paper__title {
    margin: 0;
    text-align: right;
}

.quotation-paper__title h2 {
    font-size: 1.6rem;
    letter-spacing: 0.06em;
    margin: 0 0 0.4rem;
    text-transform: uppercase;
}

.paper-meta {
    color: var(--muted-text);
    display: grid;
    font-size: var(--font-size-small);
    gap: 0.15rem;
    justify-items: end;
    margin: 0;
}

.paper-parties {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    padding-bottom: var(--space-3);
}

.paper-parties h3,
.paper-section h3 {
    color: var(--muted-text);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin: 0 0 0.35rem;
    text-transform: uppercase;
}

.paper-parties p,
.paper-section p {
    font-size: var(--font-size-small);
    margin: 0 0 0.4rem;
    white-space: pre-line;
}

.paper-section {
    border-top: 1px solid var(--border-color);
    padding: var(--space-2) 0;
}

.paper-section:last-of-type {
    border-bottom: 0;
}

.paper-section ul {
    font-size: var(--font-size-small);
    margin: 0;
    padding-left: 1.1rem;
}

.paper-section li {
    margin-bottom: 0.3rem;
}

.paper-table {
    border-collapse: collapse;
    font-size: var(--font-size-small);
    margin-top: 0.3rem;
    width: 100%;
}

.paper-table th,
.paper-table td {
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0.35rem;
    text-align: left;
    vertical-align: top;
}

.paper-table th {
    color: var(--muted-text);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.paper-table th:not(:first-child),
.paper-table td:not(:first-child) {
    text-align: right;
    white-space: nowrap;
}

.paper-table td:first-child {
    min-width: 9rem;
}

.paper-totals {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--space-2);
}

.paper-totals table {
    border-collapse: collapse;
    font-size: var(--font-size-small);
    min-width: 14rem;
}

.paper-totals td {
    padding: 0.25rem 0.35rem;
}

.paper-totals td:last-child {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.paper-totals tr:last-child td {
    border-top: 1px solid var(--border-strong);
    font-size: 1rem;
    font-weight: 700;
    padding-top: 0.5rem;
}

.paper-footnote {
    color: var(--muted-text);
    font-size: 0.78rem;
    margin: var(--space-3) 0 0;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 64rem) {
    .site-nav {
        order: 4;
        width: 100%;
    }

    .hero {
        grid-template-columns: 1fr;
    }

    .hero__panel {
        order: -1;
    }

    .hero--task .hero__panel {
        order: 0;
    }

    .workspace {
        grid-template-columns: 1fr;
    }

    .panel--form {
        position: static;
    }

    .site-footer {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 44rem) {
    .site-header {
        gap: 0.75rem;
    }

    .site-header__tools {
        width: 100%;
        justify-content: space-between;
    }

    .site-nav {
        gap: 0.25rem 0.9rem;
    }

    .task-index__link {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .task-index__task {
        grid-column: 1;
        grid-row: 1;
    }

    .task-index__tool {
        grid-column: 1;
        grid-row: 2;
    }

    .task-index__arrow {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .line-editor__grid {
        grid-template-columns: 1fr 1fr;
    }

    .quotation-paper__top {
        flex-direction: column;
    }

    .quotation-paper__title {
        text-align: left;
    }

    .paper-meta {
        justify-items: start;
    }

    .paper-table th:nth-child(3),
    .paper-table td:nth-child(3),
    .paper-table th:nth-child(5),
    .paper-table td:nth-child(5) {
        display: none;
    }

    .site-footer {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 34rem) {
    .line-editor__grid {
        grid-template-columns: 1fr;
    }

    .panel,
    .result-card,
    .quotation-paper {
        padding: var(--space-2);
    }
}

/* ---------------------------------------------------------------- print */

@media (forced-colors: active) {
    .category-card,
    .task-card,
    .task-index,
    .discovery__input,
    .category-chips a {
        border: 1px solid ButtonText;
    }

    .category-card__icon,
    .discovery__results-count {
        background: Canvas;
        border: 1px solid ButtonText;
    }
}

@media print {
    body {
        background: #fff;
        color: #000;
    }

    body::before,
    body::after {
        display: none;
    }

    .site-header,
    .site-footer,
    .no-print,
    .page-head,
    .panel--form,
    .breadcrumbs,
    .discovery,
    .category-page__foot,
    .other-categories {
        display: none !important;
    }

    #main-content {
        max-width: none;
        padding: 0;
    }

    .workspace {
        display: block;
    }

    .result-card,
    .quotation-paper {
        background: #fff;
        border: 0;
        box-shadow: none;
        color: #000;
        padding: 0;
    }

    .quotation-paper__supplier,
    .quotation-paper__supplier strong,
    .paper-meta,
    .paper-parties h3,
    .paper-section h3,
    .paper-table th,
    .paper-footnote {
        color: #000;
    }

    a {
        color: #000;
        text-decoration: none;
    }

    .result-empty,
    .alert,
    .actions {
        display: none;
    }

    .print-only-quote {
        display: block;
    }

    @page {
        margin: 18mm;
    }
}

/* ---------------------------------------------------- shared tool workspace */

.grid-2 {
    display: grid;
    gap: var(--space-2);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    display: grid;
    gap: var(--space-2);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.document-source + .document-source,
.grid-2 .document-source {
    min-width: 0;
}

.section-toggle {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    justify-content: space-between;
}

.check-field {
    align-items: center;
    display: inline-flex;
    font-size: var(--font-size-small);
    gap: 0.5rem;
}

.check-field input[type="checkbox"] {
    accent-color: var(--accent-strong);
    height: 1.05rem;
    width: 1.05rem;
}

.metric-grid {
    display: grid;
    gap: 0.6rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0.8rem;
}

.metric__value {
    color: var(--text);
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 1.1;
}

.metric__label {
    color: var(--muted-text);
    font-size: var(--font-size-small);
}

.metric--added {
    border-left: 3px solid var(--success);
}

.metric--removed {
    border-left: 3px solid var(--danger);
}

.metric--changed {
    border-left: 3px solid var(--warning);
}

.diff-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
}

.diff-block {
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--border-strong);
    border-radius: var(--radius-sm);
    display: grid;
    gap: 0.6rem;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    padding: 0.6rem 0.75rem;
}

.diff-block__label {
    color: var(--muted-text);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.diff-block__body p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    overflow-wrap: anywhere;
}

.diff-block__before {
    color: var(--danger);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.diff-block__after {
    color: var(--success);
}

.diff-block__page {
    color: var(--muted-text);
    display: inline-block;
    font-size: 0.78rem;
    margin-top: 0.3rem;
}

.diff-block--added {
    background: var(--success-surface);
    border-left-color: var(--success);
}

.diff-block--removed {
    background: var(--danger-surface);
    border-left-color: var(--danger);
}

.diff-block--changed {
    background: var(--warning-surface);
    border-left-color: var(--warning);
}

.diff-block--unchanged {
    background: var(--surface);
}

.table-wrap {
    margin-top: 0.6rem;
    max-width: 100%;
    overflow-x: auto;
}

.data-table {
    border-collapse: collapse;
    font-size: 0.94rem;
    min-width: 34rem;
    width: 100%;
}

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

.data-table thead th {
    color: var(--muted-text);
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table tbody th {
    font-weight: 600;
}

.data-table__row--missing {
    background: var(--warning-surface);
}

.table-input {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    min-width: 8rem;
    padding: 0.35rem 0.45rem;
    width: 100%;
}

.table-input:focus {
    border-color: var(--focus-color);
    outline: 2px solid color-mix(in srgb, var(--focus-color) 30%, transparent);
    outline-offset: 1px;
}

.status {
    border-radius: var(--radius-pill);
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.1rem 0.45rem;
    white-space: nowrap;
}

.status--ok {
    background: var(--success-surface);
    color: var(--success);
}

.status--warn {
    background: var(--warning-surface);
    color: var(--warning);
}

.status--missing {
    background: var(--danger-surface);
    color: var(--danger);
}

.source-excerpt {
    border-left: 2px solid var(--border-strong);
    color: var(--muted-text);
    font-size: 0.83rem;
    font-style: italic;
    margin: 0.35rem 0 0.2rem;
    max-width: 40ch;
    padding-left: 0.5rem;
}

.source-line {
    display: block;
    font-style: italic;
    margin-top: 0.25rem;
}

.checklist,
.edit-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    list-style: none;
    margin: 0.6rem 0;
    padding: 0;
}

.checklist li {
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-bottom: 0.55rem;
}

.checklist li:last-child {
    border-bottom: 0;
}

.edit-row {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

.edit-row .table-input {
    flex: 1 1 auto;
}

.editor-textarea {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    line-height: 1.55;
    padding: 0.6rem 0.7rem;
    resize: vertical;
    width: 100%;
}

.editor-textarea:focus {
    border-color: var(--focus-color);
    outline: 2px solid color-mix(in srgb, var(--focus-color) 30%, transparent);
    outline-offset: 1px;
}

@media (max-width: 34rem) {
    .grid-2,
    .grid-3,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .diff-block {
        grid-template-columns: 1fr;
    }
}

@media print {
    .table-input,
    .editor-textarea {
        background: transparent;
        border: 0;
        padding: 0;
    }

    .status {
        border: 1px solid #000;
    }

    .edit-row .link-button,
    .panel--form {
        display: none;
    }
}

.sub-heading {
    font-size: 1rem;
    margin: 0.25rem 0 0;
}

.status--info {
    background: var(--brand-pale);
    color: var(--brand-deep);
}

.quote-input {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-2);
    padding-bottom: var(--space-2);
}

.quote-input:last-of-type {
    border-bottom: 0;
}

.data-table--steps {
    min-width: 46rem;
}

.opportunity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    list-style: none;
    margin: 0.6rem 0;
    padding: 0;
}

.opportunity {
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.85rem;
}

.opportunity--automation {
    border-left-color: var(--success);
}

.opportunity--ai {
    border-left-color: var(--accent-strong);
}

.opportunity--process {
    border-left-color: var(--warning);
}

.opportunity__head {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    justify-content: space-between;
}

.opportunity__head h4 {
    font-size: 1.05rem;
    margin: 0;
}

.opportunity p {
    margin: 0.4rem 0 0;
}

.opportunity__benefit {
    color: var(--success);
    font-weight: 600;
}

.word-diff {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    line-height: 1.8;
    margin: 0.5rem 0;
    max-height: 24rem;
    overflow-y: auto;
    padding: 0.75rem 0.85rem;
    white-space: pre-wrap;
}

.word-diff__same {
    color: var(--text);
}

.word-diff__added {
    background: var(--success-surface);
    color: var(--success);
    text-decoration: underline;
    text-decoration-color: var(--success);
}

.word-diff__removed {
    background: var(--danger-surface);
    color: var(--danger);
    text-decoration: line-through;
}

.legend {
    border-bottom: 3px solid transparent;
    padding-bottom: 0.1rem;
}

.legend--same {
    border-bottom-color: var(--border-strong);
}

.legend--added {
    border-bottom-color: var(--success);
}

.legend--removed {
    border-bottom-color: var(--danger);
}

.channel-options {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.2rem;
    margin: 0 0 var(--space-2);
    padding: 0.65rem 0.8rem;
}

.channel-options legend {
    color: var(--muted-text);
    font-size: var(--font-size-small);
    font-weight: 600;
    padding: 0 0.3rem;
}

.channel-card,
.product-card,
.faq-entry {
    border-top: 1px solid var(--border-color);
    padding-top: var(--space-2);
}

.channel-card:first-of-type,
.product-card:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.faq-entry {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
