/* Distribution Portal pages. default.css (tokens, forms, buttons) and portal-chrome.css (header, sidebar,
   footer) are shared with apexweb2; this file is what is specific to this portal. */

.header-app {
    font-weight: 400;
    opacity: 0.85;
    margin-left: 6px;
}

.user-dropdown-scope {
    padding: 10px 16px 6px;
    font-size: 0.8125em;
    color: #475569;
    max-width: 280px;
}

/* ===== Header: language toggle (EN | ES) =====
   White here is the header's ink, --color-header-text (portal-chrome.css): white unless a light-header theme
   (Seashell Cove) sets it, in which case the selected pill inverts to that ink on the header's own color. */
.lang-toggle {
    display: inline-flex;
    border: 1px solid color-mix(in srgb, var(--color-header-text, #fff) 60%, transparent);
    border-radius: 4px;
    overflow: hidden;
    margin-right: 10px;
    vertical-align: middle;
}

.lang-toggle-btn {
    background: transparent;
    color: color-mix(in srgb, var(--color-header-text, #fff) 85%, transparent);
    border: none;
    padding: 4px 10px;
    font-size: 0.8125em;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family), sans-serif;
}

.lang-toggle-btn.active {
    background: var(--color-header-text, #fff);
    color: var(--color-header-bg, var(--color-primary));
}

.lang-toggle-btn:focus-visible {
    outline: 2px solid var(--color-header-text, #fff);
    outline-offset: -2px;
}

/* ===== Page layout ===== */
.content {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.page-head {
    margin: 4px 0 14px;
}

.page-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.375em;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 4px;
}

.page-heading .material-icons {
    color: var(--color-primary);
}

.page-sub {
    color: var(--color-text-secondary);
    font-size: 0.9375em;
    margin: 0;
}

.page-card {
    margin-bottom: 16px;
}

.card-title {
    font-size: 1.0625em;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 10px;
}

.card-grid {
    display: grid;
    /* min(): never wider than the content area, or a 320px screen scrolls sideways (WCAG 1.4.10) */
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.card-grid .page-card {
    margin: 0;
}

.stat-body {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    align-items: flex-end;
}

.stat {
    display: flex;
    flex-direction: column;
    min-width: 110px;
}

.stat-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-secondary);
}

.stat-value {
    font-size: 1.125em;
    font-weight: 600;
    color: var(--color-text);
}

.muted {
    color: var(--color-text-secondary);
}

.num {
    text-align: right;
    white-space: nowrap;
}

.cell-strong {
    font-weight: 600;
}

/* ===== Toolbar ===== */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 12px;
}

.toolbar-spacer {
    flex: 1;
}

.form-group.inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.form-group.inline label {
    margin: 0;
}

.form-group.inline select, select {
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: var(--font-family), sans-serif;
    font-size: 0.9375em;
}

select:focus {
    outline: 2px solid transparent;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.btn-inline {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    margin: 0;
    padding: 8px 14px;
    line-height: 1.2;
}

.btn-inline .material-icons {
    font-size: 1.125em;
}

.btn-primary:disabled {
    background: var(--color-disabled-bg);
    color: var(--color-disabled-text);
    cursor: not-allowed;
}

.link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.switch-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9375em;
    color: var(--color-text);
}

.switch-label input {
    width: 18px;
    height: 18px;
}

/* ===== Plain tables ===== */
.plain-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875em;
}

.plain-table th, .plain-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--color-divider);
    text-align: left;
    color: var(--color-text);
}

.plain-table thead th {
    background: var(--color-bg);
    border-bottom: 2px solid var(--color-border);
    font-weight: 600;
}

.plain-table tbody tr:hover {
    background: var(--color-row-hover);
}

.plain-table .check-col {
    width: 40px;
    text-align: center;
}

.plain-table .check-col input {
    width: 18px;
    height: 18px;
}

.plain-table.compact th, .plain-table.compact td {
    padding: 6px 8px;
}

.table-scroll {
    overflow-x: auto;
    /* Contains the .sr-only header labels (position: absolute): otherwise they escape the scroll box at
       their column's x and widen the page on a 320px screen (WCAG 1.4.10) */
    position: relative;
}

/* A scroll box with no links inside takes keyboard focus itself (tabindex=0), so arrow keys can scroll it */
.table-scroll:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ===== Tabulator (shared look with apexweb2) ===== */
.tabulator {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-family), sans-serif;
    font-size: 0.8125em;
    background-color: var(--color-surface);
}

.tabulator .tabulator-header {
    background-color: var(--color-bg);
    border-bottom: 2px solid var(--color-border);
    font-weight: 600;
    color: var(--color-text);
}

.tabulator .tabulator-header .tabulator-col {
    border-right: 1px solid var(--color-border);
    background-color: var(--color-bg);
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-content {
    padding: 10px 12px;
}

.tabulator .tabulator-tableholder .tabulator-table .tabulator-row {
    border-bottom: 1px solid var(--color-divider);
}

.tabulator .tabulator-tableholder .tabulator-table .tabulator-row:hover {
    background-color: var(--color-row-hover);
}

.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-selected {
    background-color: var(--color-primary-light);
}

.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell {
    padding: 10px 12px;
    border-right: none;
    color: var(--color-text);
}

.tabulator .tabulator-row .tabulator-cell[tabulator-field="actions"] {
    overflow: visible;
}

.tabulator .tabulator-footer {
    background: var(--color-bg);
    border-top: 2px solid var(--color-border);
    font-weight: 600;
}

.tabulator .tabulator-footer .tabulator-calcs-holder {
    background: var(--color-bg);
    border-top: none;
    border-bottom: none;
}

.tabulator .tabulator-row.tabulator-group {
    background: var(--color-widget-bg);
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    padding: 8px 12px;
    font-weight: 600;
}

.tabulator .tabulator-row.tabulator-group .muted {
    font-weight: 400;
}

/* The gridcell a group header's text sits in (ARIA, portal.js): not Tabulator's red, indented group span */
.tabulator .tabulator-row.tabulator-group .group-cell {
    color: inherit;
    margin-left: 0;
}

#history-table .tabulator-row {
    cursor: pointer;
}

.row-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--color-primary);
    text-decoration: none;
    margin: 0 1px;
}

.row-icon:hover, .row-icon:focus-visible {
    background: var(--color-primary-light);
}

.row-icon .material-icons {
    font-size: 1.25em;
}

/* ===== Login ===== */
/* A field the page fills and the visitor may not change (set_password's username, taken from the link) */
.form-group input[readonly] {
    background: var(--color-bg);
    color: var(--color-text-secondary);
    cursor: default;
}


.login-card {
    max-width: 440px;
    margin-top: 48px;
    padding: 28px 28px 20px;
}

.login-icon {
    text-align: center;
    margin-bottom: 8px;
}

.login-icon .material-icons {
    font-size: 3em;
    color: var(--color-primary);
}

.login-intro, .login-help {
    font-size: 0.875em;
    color: var(--color-text-secondary);
    text-align: center;
    margin: 0 0 18px;
}

.login-help {
    margin: 16px 0 0;
}

.field-error {
    display: block;
    color: var(--color-danger);
    font-size: 0.8125em;
    margin-top: 4px;
}

.field-error[hidden] {
    display: none;
}

/* ===== Dashboard ===== */
.dash-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px 20px;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.tile {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tile-strong {
    border-left: 4px solid var(--color-primary);
}

.tile-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-secondary);
}

.tile-value {
    font-size: 1.375em;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
}

.tile-note {
    font-size: 0.75em;
    color: var(--color-text-secondary);
}

.dash-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
}

.chart-box-sm {
    height: 260px;
}

.chart-empty {
    padding: 24px 0;
    text-align: center;
}

.swatch-col {
    width: 24px;
    padding-right: 0 !important;
}

.swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    vertical-align: middle;
}

/* ===== Charts ===== */
.chart-card, .table-block {
    margin-bottom: 22px;
}

.chart-title {
    font-size: 1em;
    font-weight: 600;
    margin: 0 0 2px;
    color: var(--color-text);
}

.chart-box {
    position: relative;
    height: 320px;
}

/* Chart.js sets the canvas width in px and resizes it a frame after its box shrinks. Until then a chart drawn on a
   wide screen widened the page: zoomed to 320px, the dashboard measured 1179px (WCAG 1.4.10, adatool audit 197). */
.chart-box canvas {
    max-width: 100%;
}

/* ===== Toasts ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 320px;
    z-index: 2000;
}

/* Moved down by portal.js when keyboard focus lands on a control under the toasts; clears the Sojo button */
.toast-container.toast-container-low {
    bottom: 80px;
}

.toast {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-danger);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-in-out;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--color-text);
}

.toast-message {
    color: var(--color-text-secondary);
    font-size: 0.875em;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 0;
    margin-left: 10px;
}

.toast.error { border-left-color: var(--color-danger); }
.toast.success { border-left-color: var(--color-success); }
.toast.info { border-left-color: var(--color-accent); }
.toast.warning { border-left-color: var(--color-warning-border); }

/* ===== Error page ===== */
.error-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.error-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.error-card {
    text-align: center;
    max-width: 480px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 32px;
}

.error-icon {
    font-size: 3.5em;
    color: var(--color-primary);
}

.error-code {
    color: var(--color-text-secondary);
    margin: 8px 0 0;
}

.error-title {
    font-size: 1.375em;
    margin: 4px 0 10px;
}

.error-actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

@media (max-width: 768px) {
    .content {
        padding: 12px;
    }

    .toolbar .toolbar-spacer {
        display: none;
    }

    .toast-container {
        width: calc(100% - 32px);
        right: 16px;
    }
}

/* ===== Users page and its dialogs (native <dialog>: modal, Esc closes, focus stays inside) ===== */
.portal-dialog {
    /* default.css zeroes every margin, which pins a modal dialog to the top left; centre it again */
    position: fixed;
    inset: 0;
    margin: auto;
    height: fit-content;
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 22px 24px 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow-lg);
}

.portal-dialog-sm {
    width: min(440px, calc(100vw - 32px));
}

.portal-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.dialog-title {
    font-size: 1.125em;
    font-weight: 600;
    margin: 0 0 14px;
}

.dialog-error {
    background: var(--color-danger-bg);
    border: 1px solid var(--color-danger-border);
    color: var(--color-danger);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.875em;
    margin: 0 0 14px;
}

.dialog-error[hidden] {
    display: none;
}

.dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.dialog-buttons .btn-secondary {
    margin-right: 0;
}

.field-note {
    font-size: 0.8125em;
    color: var(--color-text-secondary);
    margin: 6px 0 0;
}

.check-list {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px 12px;
    margin: 0 0 14px;
}

.check-list legend {
    font-weight: 500;
    font-size: 0.875em;
    color: var(--color-text-label);
    padding: 0 4px;
}

.switch-label[hidden] {
    display: none;
}

.check-list .check-item {
    display: flex;
    margin: 6px 0;
}

.check-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: none;
    padding: 0;
}

.tag {
    display: inline-block;
    font-size: 0.75em;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--color-primary-light);
    color: var(--color-primary);
    white-space: nowrap;
}

.small {
    font-size: 0.8125em;
}

.status-off {
    color: var(--color-danger);
    font-weight: 500;
}

.plain-table .actions-col {
    white-space: nowrap;
    text-align: right;
}

.row-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.row-button:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* ===== Help panel (PageBuilder.build_help_panel; the accessibility panel's frame from a11y.css) ===== */
.help-panel { width: 440px; right: -460px; }
.help-panel-title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--color-text-inverse, #fff);
    display: flex;
    align-items: center;
    gap: 8px;
}
.help-panel-body {
    padding: 1rem 1.25rem 1.5rem;
    line-height: 1.6;
    color: var(--color-text);
    font-size: 0.9375rem;
}
.help-panel-body h1, .help-panel-body h2, .help-panel-body h3 {
    font-size: 1rem;
    margin: 1.1rem 0 0.4rem;
    color: var(--color-primary);
}
.help-panel-body p { margin: 0 0 0.6rem; }
.help-panel-body ul, .help-panel-body ol { margin: 0 0 0.8rem; padding-left: 1.3rem; }
.help-panel-body li { margin-bottom: 0.3rem; }
.help-panel-body .ql-size-large { font-size: 1.15rem; }

/* ===== FAQ page (faq.html; apexweb2's FAQ styles) ===== */
.faq-container { max-width: 900px; }
.faq-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.faq-search {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    font-size: 0.875em;
    color: var(--color-text, #1e293b);
    background: var(--color-surface);
}
.faq-search:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.faq-search::placeholder { color: var(--color-text-secondary, #5f6e84); }
.faq-toggle-all {
    background: none;
    border: none;
    color: var(--color-primary, #1e3a5f);
    font-size: 0.875em;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
}
.faq-toggle-all:hover { background: var(--color-bg); }
.faq-accordion { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-surface);
}
.faq-item.open { border-left: 3px solid var(--color-accent); }
.faq-heading { margin: 0; font-size: inherit; }
.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    font-size: 0.9375em;
    font-weight: 600;
    color: var(--color-text, #1e293b);
    background: var(--color-surface);
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.faq-question:hover { background: var(--color-bg); }
.faq-question .material-icons {
    font-size: 1.25em;
    color: var(--color-text-secondary, #5f6e84);
    transition: transform 0.25s;
    flex-shrink: 0;
    margin-left: 12px;
}
.faq-item.open .faq-question .material-icons { transform: rotate(180deg); }
/* A closed answer is out of the tab order too (visibility), not only zero height. */
.faq-answer { max-height: 0; overflow: hidden; visibility: hidden; }
.faq-item.open .faq-answer { visibility: visible; }
.faq-answer.measured { transition: max-height 0.3s ease, visibility 0s linear 0.3s; }
.faq-item.open .faq-answer.measured { transition: max-height 0.3s ease, visibility 0s; }
.faq-answer-inner {
    padding: 14px 18px 16px;
    font-size: 0.9375em;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
}
.faq-answer-inner p { margin: 0 0 0.6rem; }
.faq-error { color: var(--color-danger, #b91c1c); }

/* ===== Sojo, the portal's assistant (PageBuilder.build_sojo_widget, static/js/sojo.js) ===== */
.sojo-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 10040;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: none;
    border-radius: 28px;
    background: var(--color-primary, #1e3a5f);
    color: var(--color-text-inverse, #fff);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.sojo-launcher:hover { background: var(--color-primary-hover, #2a4f7f); }
.sojo-launcher:focus-visible { outline: 3px solid var(--color-accent, #2563eb); outline-offset: 3px; }
.sojo-launcher[aria-expanded="true"] { display: none; }
.sojo-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 10041;
    box-sizing: border-box;  /* sojo.js saves offsetWidth / offsetHeight; with the border inside, a reopen is the same size */
    width: 400px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    background: var(--color-surface, #fff);
    color: var(--color-text);
    border: 1px solid var(--color-border, #cbd5e1);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}
.sojo-panel[hidden] { display: none; }
/* .hc-toggle's display: flex beat [hidden]: a page with no help module (legal, contact, error) showed a dead Help button */
.hc-toggle[hidden] { display: none; }
/* Drag the top-left corner to resize, as tourexweb's Spirit panel; the header's expand button is the one-click way */
.sojo-resize-handle { position: absolute; top: 0; left: 0; width: 20px; height: 20px; cursor: nw-resize; z-index: 2; }
.sojo-resize-handle::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 7px;
    height: 7px;
    border-top: 2px solid rgba(255, 255, 255, 0.45);
    border-left: 2px solid rgba(255, 255, 255, 0.45);
}
.sojo-resize-handle:hover::after { border-color: rgba(255, 255, 255, 0.9); }
.sojo-header-buttons { display: flex; align-items: center; gap: 4px; }
#sojoExpand .material-icons { font-size: 1.15rem; }
.sojo-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--color-primary, #1e3a5f);
    color: var(--color-text-inverse, #fff);
}
.sojo-title { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; color: inherit; }
.sojo-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid currentColor;
}
.sojo-close { background: none; border: none; color: inherit; cursor: pointer; padding: 4px; display: flex; }
.sojo-close:focus-visible { outline: 2px solid var(--color-text-inverse, #fff); outline-offset: 2px; }
.sojo-log { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.sojo-log:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.sojo-msg { max-width: 88%; padding: 9px 12px; border-radius: 10px; line-height: 1.5; font-size: 0.9375rem; }
.sojo-msg p { margin: 0 0 0.5rem; }
.sojo-msg p:last-child { margin-bottom: 0; }
.sojo-msg ul, .sojo-msg ol { margin: 0.3rem 0 0.5rem; padding-left: 1.2rem; }
.sojo-msg-bot { align-self: flex-start; background: var(--color-bg, #f8fafc); border: 1px solid var(--color-border); }
.sojo-msg-user { align-self: flex-end; background: var(--color-primary, #1e3a5f); color: var(--color-text-inverse, #fff); }
.sojo-disclosure { font-size: 0.8125rem; color: var(--color-text-secondary, #5f6e84); }
.sojo-sources { margin-top: 6px; font-size: 0.8125rem; display: flex; flex-wrap: wrap; gap: 6px; }
.sojo-sources a { color: var(--color-accent, #2563eb); }
.sojo-rate { margin-top: 6px; display: flex; gap: 4px; }
.sojo-rate button {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 2px 6px;
    cursor: pointer;
    color: var(--color-text-secondary, #5f6e84);
    display: flex;
}
.sojo-rate button[aria-pressed="true"] { color: var(--color-accent, #2563eb); border-color: currentColor; }
.sojo-rate .material-icons { font-size: 1rem; }
.sojo-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.sojo-suggestions:empty { display: none; }
.sojo-chip {
    background: var(--color-surface);
    border: 1px solid var(--color-accent, #2563eb);
    color: var(--color-accent, #2563eb);
    border-radius: 14px;
    padding: 4px 10px;
    font: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
    text-align: left;
}
.sojo-chip:hover { background: var(--color-bg); }
.sojo-form { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--color-border); }
.sojo-form input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font: inherit;
    background: var(--color-surface);
    color: var(--color-text);
}
.sojo-form input:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.sojo-send {
    border: none;
    border-radius: 8px;
    padding: 0 12px;
    background: var(--color-primary, #1e3a5f);
    color: var(--color-text-inverse, #fff);
    cursor: pointer;
    display: flex;
    align-items: center;
}
.sojo-send:disabled { opacity: 0.6; cursor: default; }
.sojo-disclosure a, .sojo-footer-links a { color: var(--color-accent, #2563eb); text-decoration: underline; }
.sojo-footer-links { padding: 0 14px 6px; font-size: 0.75rem; }
@media (max-width: 600px) {
    /* !important: a size chosen on a wider screen (inline style) must not apply here */
    .sojo-panel { right: 8px; left: 8px; bottom: 8px; width: auto !important; height: calc(100vh - 80px) !important; }
    .sojo-resize-handle, #sojoExpand { display: none; }
    .sojo-launcher-text { display: none; }
    .sojo-launcher { padding: 14px; }
}

/* The footer's legal and contact pages (standalone, opened in a new tab) */
.legal-container, .contact-container { max-width: 800px; line-height: 1.6; }
.legal-container h1, .contact-container h1 { font-size: 1.5em; margin: 0 0 12px; }
.legal-container h2 { font-size: 1.125em; margin: 20px 0 6px; }
.legal-container a, .contact-container a { color: var(--color-accent, #2563eb); overflow-wrap: anywhere; }
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.contact-card { border: 1px solid var(--color-border); border-radius: var(--radius-md, 8px); padding: 14px; }
.contact-card h2 { font-size: 1em; margin: 4px 0; }
.contact-card p { margin: 0; overflow-wrap: anywhere; }
.contact-card-icon { color: var(--color-accent, #2563eb); }
