:root {
    --bg-main: #f8f9f8;
    --bg-panel: #ffffff;
    --ink: #182220;
    --muted: #5a6762;
    --accent: #1c6959;
    --accent-strong: #11463c;
    --edge: #d6ddd9;
    --edge-strong: #b9c3be;
    --warning: #8f2d1f;
}

* {
    box-sizing: border-box;
    border-radius: 0 !important;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: "Merriweather", Georgia, serif;
    color: var(--ink);
    background: var(--bg-main);
}

button,
input,
select,
textarea {
    font-family: "Merriweather", Georgia, serif;
}

body.overlay-locked {
    overflow: hidden;
}

a {
    color: var(--accent-strong);
}

h1,
h2,
h3,
h4,
h5 {
    margin: 0;
    font-family: "Merriweather", Georgia, serif;
}

p {
    margin: 0;
}

.hidden {
    display: none !important;
}

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

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    max-width: 100%;
    overflow-x: hidden;
}

.topbar {
    --logo-size: 52px;
    --logo-pad: 0.5em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
    background: #f8f9f8;
}

.brand-block {
    display: flex;
    flex: 1 1 220px;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--logo-pad);
    flex: 0 1 auto;
    max-width: min(100%, 420px);
    min-width: 0;
}

.brand-logo {
    height: auto;
    width: auto;
    max-height: var(--logo-size);
    max-width: 100%;
    display: block;
}

.topbar h1 {
    font-size: 1.18rem;
}

.topbar p {
    color: var(--muted);
    font-size: 0.9rem;
}

.topbar-actions {
    display: flex;
    flex: 1 1 260px;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
}

#showAuthBtn,
#sessionBadge,
#logoutBtn,
#authDialog {
    display: none !important;
}

.mobile-floating-back {
    display: none;
}

.mobile-detail-nav {
    display: none;
}

.mobile-detail-nav-btn {
    border: 1px solid #2d5c52;
    background: #1b4e44;
    color: #f2f9f6;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    font-size: 1.06rem;
    line-height: 1;
}

.mobile-detail-nav-pos {
    min-width: 66px;
    text-align: center;
    color: #f2f9f6;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.session-badge,
.scene-badge {
    font-size: 0.84rem;
    padding: 6px 8px;
    border: 1px solid var(--edge);
    background: #fff;
}

.subtle-link {
    border: none;
    background: transparent;
    color: #3a4f49;
    cursor: pointer;
    font-size: 0.86rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 2px 4px;
}

.icon-btn,
.ghost-btn,
.primary-btn,
.secondary-btn,
.carousel-nav,
.tri-state-btn {
    border: 1px solid var(--edge-strong);
    padding: 7px 10px;
    font: inherit;
    cursor: pointer;
    background: #fff;
    color: var(--ink);
}

.icon-btn:disabled,
.ghost-btn:disabled,
.primary-btn:disabled,
.secondary-btn:disabled,
.carousel-nav:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.primary-btn {
    background: var(--accent);
    border-color: var(--accent-strong);
    color: #f2f7f5;
}

.secondary-btn {
    background: #edf3f0;
    color: var(--accent-strong);
    border-color: #cddbd4;
}

.auth-wrap {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card,
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--edge);
}

.auth-card {
    padding: 14px;
}

.stack {
    display: grid;
    gap: 10px;
}

label {
    display: grid;
    gap: 5px;
    font-size: 0.92rem;
}

input,
select,
textarea {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #c5d2cb;
    background: #fff;
    font: inherit;
    color: var(--ink);
}

textarea {
    resize: vertical;
}

.workspace {
    flex: 1;
    display: grid;
    grid-template-columns:
        var(--col-w1, minmax(280px, 1.02fr))
        8px
        var(--col-w2, minmax(460px, 1.22fr))
        8px
        var(--col-w3, minmax(380px, 1.2fr));
    gap: 0;
    min-height: 0;
}

.column {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 8px;
    min-width: 0;
}

.column-resizer {
    width: 8px;
    border-left: 1px solid #d8dfdb;
    border-right: 1px solid #d8dfdb;
    background: #eef2f0;
    cursor: col-resize;
    user-select: none;
}

.column-resizer:hover {
    background: #e2ebe7;
}

.column-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f8f9f8;
}

.column-head .ghost-btn,
.column-head .icon-btn,
.column-head .tri-state-btn {
    border: none;
    background: transparent;
}

.column-head.sticky {
    position: sticky;
    top: 8px;
    z-index: 4;
}

.head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.head-actions.right {
    justify-content: flex-end;
}

.inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.inline.compact {
    gap: 8px;
}

.inline.compact span {
    color: var(--muted);
    font-size: 0.86rem;
}

.inline.compact select {
    width: auto;
    min-width: 70px;
    padding: 6px 8px;
}

.panel {
    padding: 10px;
    overflow: auto;
}

.panel.tight {
    padding: 0;
}

.mobile-filter-cta-wrap {
    display: none;
}

.mobile-filter-cta {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.filters-form {
    display: grid;
    gap: 0;
}

.filter-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 8px 0;
    border-bottom: 1px solid var(--edge);
}

.filter-row:last-child {
    border-bottom: none;
}

.filter-name {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #263833;
    font-size: 0.88rem;
    padding-top: 2px;
}

.filter-control {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.info-hint-btn {
    border: none;
    background: transparent;
    color: var(--accent-strong);
    cursor: help;
    padding: 0;
    margin-left: 2px;
    font: inherit;
    font-size: 0.8em;
    line-height: 1;
    text-decoration: underline;
    text-underline-offset: 1px;
}

.info-hint-btn:hover,
.info-hint-btn:focus-visible {
    color: var(--accent);
}

.mobile-filter-tip {
    position: fixed;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    max-width: min(92vw, 360px);
    background: rgba(18, 63, 56, 0.96);
    color: #eef6f2;
    padding: 7px 10px;
    font-size: 0.76rem;
    line-height: 1.3;
    text-align: left;
    z-index: 90;
    pointer-events: none;
    opacity: 0;
    transition: opacity 120ms ease;
    white-space: pre-line;
}

.mobile-filter-tip.visible {
    opacity: 1;
}

.filter-icon {
    width: 16px;
    height: 16px;
    display: inline-grid;
    place-items: center;
    background: #e7efeb;
    color: var(--accent-strong);
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid #cad8d1;
}

.group-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.icon-check-chip {
    border: 1px solid var(--edge-strong);
    background: #fbfcfb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 7px;
    min-height: 30px;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.icon-check-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.icon-check-chip .chip-icon {
    font-size: 1rem;
    line-height: 1;
}

.icon-check-chip .chip-short {
    font-size: 0.75rem;
    color: #445751;
}

.icon-check-chip.compact .chip-short {
    font-size: 0.71rem;
    letter-spacing: 0.2px;
}

.icon-check-chip.compact {
    min-width: 34px;
}

.icon-check-chip.selected,
.icon-check-chip:has(input:checked) {
    border-color: #1b7263;
    background: #e3f0ea;
    color: #134f44;
}

.combo-checklist {
    border: 1px solid var(--edge-strong);
    background: #fff;
}

.combo-checklist > summary {
    list-style: none;
    cursor: pointer;
    padding: 6px 8px;
    font-size: 0.84rem;
    color: #2f433d;
}

.combo-checklist > summary::-webkit-details-marker {
    display: none;
}

.combo-checklist > summary::after {
    content: "▾";
    float: right;
    color: #6a7a74;
}

.combo-checklist[open] > summary::after {
    content: "▴";
}

.combo-options {
    display: grid;
    gap: 2px;
    max-height: 180px;
    overflow: auto;
    border-top: 1px solid var(--edge);
    padding: 4px;
}

.combo-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    padding: 2px 0;
}

.combo-option input {
    width: auto;
    margin: 0;
}

.switch-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    color: #2e433e;
}

.switch-inline input {
    width: auto;
    margin: 0;
}

.dual-range-head {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.dual-range-current {
    font-size: 0.83rem;
    color: #2f4d46;
}

.dual-range-wrap {
    position: relative;
    height: 26px;
}

.dual-range-track {
    position: absolute;
    top: 50%;
    left: 3px;
    right: 3px;
    transform: translateY(-50%);
    height: 4px;
    background: #dbe5e0;
}

.dual-range-fill {
    position: absolute;
    height: 100%;
    background: #1d7565;
}

.dual-range-input {
    position: absolute;
    inset: 0;
    margin: 0;
    width: 100%;
    appearance: none;
    pointer-events: none;
    background: transparent;
    border: none;
    padding: 0;
}

.dual-range-input::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: #1a7565;
    border: 1px solid #f5faf8;
    pointer-events: auto;
    cursor: pointer;
}

.dual-range-input::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #1a7565;
    border: 1px solid #f5faf8;
    pointer-events: auto;
    cursor: pointer;
}

.dual-range-input::-webkit-slider-runnable-track,
.dual-range-input::-moz-range-track {
    background: transparent;
}

.dual-range-scale {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.75rem;
}

.results-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 10px;
    color: var(--muted);
    border-bottom: 1px solid var(--edge);
}

.results-head-count {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    color: var(--muted);
    font-size: 0.88rem;
}

.results-head-count strong {
    color: var(--ink);
    font-size: 1rem;
    line-height: 1;
}

.share-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    border: 1px solid var(--edge-strong);
    background: #fff;
    color: #23413a;
}

.share-link-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.results-list {
    overflow: auto;
    max-height: 56vh;
}

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

.results-table th,
.results-table td {
    border-bottom: 1px solid var(--edge);
    padding: 6px 8px;
    vertical-align: middle;
    text-align: left;
    white-space: nowrap;
}

.results-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f3f5f4;
    border-bottom: 2px solid var(--edge-strong);
    color: #334742;
    font-weight: 600;
}

.results-table tbody tr {
    cursor: pointer;
}

.results-table tbody tr:hover {
    background: #f8fbf9;
}

.results-table tbody tr.active {
    background: #e7f1ed;
}

.results-table th:first-child,
.results-table td:first-child {
    width: 44px;
}

.results-action-cell {
    text-align: center;
}

.queue-action-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    border: 1px solid var(--edge-strong);
    background: #fff;
    color: #23413a;
    cursor: pointer;
}

.queue-action-btn[disabled] {
    opacity: 0.45;
    cursor: default;
}

.queue-action-btn.remove {
    color: #7a1f1f;
    border-color: #d3aaaa;
    background: #fff8f8;
}

.results-latin-cell {
    font-weight: 600;
    color: #132621;
}

.group-meter {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.meter-dot {
    color: #9aacb4;
    font-size: 0.94rem;
    line-height: 1;
    opacity: 0.26;
    filter: grayscale(1) saturate(0);
}

.meter-dot.active {
    color: #1a6959;
    opacity: 1;
    filter: none;
}

.meter-dot-image {
    opacity: 1 !important;
    filter: none !important;
}

.meter-icon-image {
    display: block;
    width: auto;
    height: 16px;
}

.meter-dot-moisture .meter-icon-image {
    width: auto;
    height: 17px;
}

.meter-dot-moisture-water .meter-icon-image {
    width: auto;
    height: 18px;
}

.icon-overlap-drops {
    position: relative;
    display: inline-block;
    width: 1.5em;
    height: 1.04em;
    vertical-align: middle;
}

.icon-overlap-drops .drop {
    position: absolute;
    line-height: 1;
}

.icon-overlap-drops .drop-big {
    left: 0.04em;
    top: 0.08em;
    font-size: 0.92em;
}

.icon-overlap-drops .drop-small {
    left: 0.76em;
    top: 0.16em;
    font-size: 0.74em;
}

.rating-meter {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.rating-unit {
    color: #d7e0dc;
    font-size: 0.8rem;
    line-height: 1;
}

.rating-unit.filled {
    color: #2b6e5f;
}

.results-footer {
    border-top: 1px solid var(--edge);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.page-info {
    font-size: 0.84rem;
    color: var(--muted);
}

.pager-actions {
    display: flex;
    gap: 6px;
}

.export-panel {
    display: grid;
    gap: 9px;
}

.export-panel.collapsed .export-config,
.export-panel.collapsed .export-clipboard {
    display: none;
}

.export-head {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    position: relative;
}

.export-head button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.export-head #exportBtn {
    margin-right: auto;
}

.export-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--muted);
}

.export-meta #selectedCount {
    font-weight: 700;
    color: var(--ink);
}

.export-config {
    display: grid;
    gap: 8px;
}

.export-queue-list {
    border: 1px solid var(--edge);
    background: #fbfdfc;
    max-height: 280px;
    overflow: auto;
}

.export-queue-list .muted {
    padding: 8px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.chip {
    border: 1px solid var(--edge);
    padding: 3px 7px;
    font-size: 0.78rem;
    background: #f8fbfa;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: grab;
}

.chip input {
    width: auto;
    margin: 0;
}

.chip.dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.export-copy-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    transform: none;
    background: #123f38;
    color: #f2f8f4;
    padding: 6px 9px;
    font-size: 0.78rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 120ms ease;
    z-index: 70;
    white-space: nowrap;
}

.export-copy-tooltip.visible {
    opacity: 1;
}

.export-clipboard {
    border: 1px solid var(--edge);
    background: #fff;
    padding: 8px;
    overflow: auto;
    max-height: 320px;
}

.export-clipboard-note {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.export-doc-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 680px;
    font-size: 0.82rem;
}

.export-doc-table th,
.export-doc-table td {
    border: 1px solid #c7d2cd;
    padding: 4px 6px;
    vertical-align: middle;
    background: #fff;
}

.export-doc-table th {
    background: #f2f6f4;
}

.doc-icons {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.doc-rating {
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.detail-body {
    display: grid;
    gap: 11px;
    transform: translateX(var(--detail-swipe-offset, 0px));
    transition: transform 170ms ease;
    will-change: transform;
}

.detail-group {
    display: grid;
    gap: 6px;
}

.detail-group h4 {
    font-size: 0.92rem;
    color: #2b4740;
}

.detail-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.detail-head {
    padding-bottom: 6px;
    border-bottom: 1px solid var(--edge);
    display: grid;
    gap: 3px;
}

.detail-head-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.detail-head-top h2 {
    min-width: 0;
}

.detail-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.detail-head-actions .icon-btn,
.detail-head-actions .queue-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    width: 28px;
    height: 28px;
    padding: 0;
    line-height: 1;
}

.detail-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    width: 28px;
    height: 28px;
    padding: 0;
    color: #23413a;
    text-decoration: none;
    line-height: 1;
}

.detail-action-link.external-ref-btn {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.detail-action-link:hover,
.detail-action-link:focus-visible {
    color: #123f38;
}

.detail-add-btn {
    flex: 0 0 auto;
}

.share-loader-badge {
    position: fixed;
    z-index: 75;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #123f38;
    color: #f2f8f4;
    border: 1px solid #1e6a5d;
    padding: 6px 9px;
    font-size: 0.78rem;
    pointer-events: none;
    white-space: nowrap;
}

.share-loader-badge img {
    width: 16px;
    height: 16px;
    object-fit: cover;
}

.share-copy-tooltip {
    position: fixed;
    z-index: 76;
    background: #123f38;
    color: #f2f8f4;
    border: 1px solid #1e6a5d;
    padding: 6px 9px;
    font-size: 0.78rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 120ms ease;
    white-space: nowrap;
}

.share-copy-tooltip.visible {
    opacity: 1;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 6px;
}

.detail-card {
    border: 1px solid var(--edge);
    background: #fff;
    padding: 7px;
    display: grid;
    gap: 4px;
}

.detail-card span {
    font-size: 0.74rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.detail-card.iconized span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.detail-card-value {
    min-height: 1.1rem;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: #15231f;
}

.detail-meter {
    gap: 4px;
}

.detail-meter .meter-dot {
    font-size: 1rem;
}

.detail-rating .rating-unit {
    font-size: 0.9rem;
    color: #e6eeea;
}

.detail-rating .rating-unit.filled {
    color: #2b6e5f;
}

.detail-card-icon {
    width: 16px;
    text-align: center;
    color: #2a6558;
    font-weight: 700;
}

.detail-text {
    border-top: 1px solid var(--edge);
    padding-top: 8px;
    display: grid;
    gap: 4px;
    position: relative;
}

.detail-text-content {
    position: relative;
}

.related-section {
    display: grid;
    gap: 6px;
}

.related-table-wrap {
    overflow: auto;
    border: 1px solid var(--edge);
}

.related-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
    font-size: 0.82rem;
}

.related-table th,
.related-table td {
    border-bottom: 1px solid var(--edge);
    border-right: 1px solid var(--edge);
    padding: 5px 7px;
    text-align: left;
    vertical-align: top;
}

.related-table th:last-child,
.related-table td:last-child {
    border-right: none;
}

.related-table th {
    background: #f5f7f6;
    font-weight: 600;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 7px;
}

.photo-item {
    border: 1px solid var(--edge);
    overflow: hidden;
    background: #fff;
    display: grid;
}

.photo-item img {
    width: 100%;
    height: 84px;
    object-fit: cover;
    display: block;
}

.photo-item figcaption {
    font-size: 0.71rem;
    padding: 5px;
    color: var(--muted);
}

.web-images-section {
    display: grid;
    gap: 6px;
}

.web-images-title-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.web-images-title-link:hover {
    color: var(--accent-strong);
}

.web-carousel {
    border: 1px solid var(--edge);
    background: #fff;
    padding: 8px;
    display: grid;
    gap: 7px;
}

.web-carousel-stage {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
}

.web-carousel-track {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
}

.web-carousel-item {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.web-carousel-link {
    overflow: hidden;
    display: block;
    border: 1px solid var(--edge);
    background: #f9fbfa;
}

.web-carousel-link img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.web-carousel-item-caption {
    font-size: 0.74rem;
    color: #445d56;
    line-height: 1.2;
    min-height: 2.2em;
}

.web-carousel-caption {
    font-size: 0.82rem;
    color: #314742;
}

.web-carousel-dots {
    display: flex;
    gap: 5px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border: 1px solid #9ab7aa;
    background: #edf5f0;
    padding: 0;
    cursor: pointer;
}

.carousel-dot.active {
    background: #1f7f6f;
    border-color: #1f7f6f;
}

.dialog {
    border: 1px solid var(--edge-strong);
    padding: 0;
    max-width: 560px;
    width: min(94vw, 560px);
}

.dialog-body {
    padding: 14px;
    display: grid;
    gap: 10px;
}

.dialog-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.auth-dialog {
    max-width: 980px;
    width: min(95vw, 980px);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

#filterVisibilityList {
    gap: 0;
}

#filterVisibilityList label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--edge);
}

#filterVisibilityList label:last-child {
    border-bottom: none;
}

#filterVisibilityList label input {
    width: auto;
    margin: 0;
}

.footer {
    font-size: 0.82rem;
    color: var(--muted);
    text-align: center;
    padding: 8px;
}

.toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    background: #123f38;
    color: #f2f8f4;
    padding: 10px 12px;
    z-index: 40;
}

@media (max-width: 980px) {
    html,
    body,
    .app-shell,
    .workspace,
    .column {
        overflow-x: hidden;
    }

    .topbar {
        align-items: center;
        row-gap: 8px;
    }

    .brand-block {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
        padding-right: 6px;
    }

    .app-shell.mobile-back-visible .brand-block {
        padding-left: 46px;
    }

    .brand-logo-link {
        order: 2;
        flex: 1 1 100%;
        justify-content: flex-start;
        max-width: 100%;
    }

    .topbar-actions {
        order: 1;
        flex: 0 0 auto;
        justify-content: flex-end;
        margin-left: auto;
    }

    .topbar-actions .inline.compact {
        display: inline-flex;
        align-items: center;
    }

    .topbar-actions .inline.compact select {
        min-width: 64px;
        font-size: 0.84rem;
        padding: 5px 7px;
    }

    #mobileBackBtn,
    #mobileNextBtn,
    #sceneBadge {
        display: none !important;
    }

    .workspace {
        display: flex;
        overflow: hidden;
        position: relative;
    }

    .column {
        min-width: 100%;
        max-width: 100%;
        padding-bottom: 8px;
        transform: translateX(0);
        transition: transform 220ms ease;
    }

    .column-resizer {
        display: none !important;
    }

    .workspace.scene-0 .column {
        transform: translateX(0%);
    }

    .workspace.scene-1 .column {
        transform: translateX(-100%);
    }

    .workspace.scene-2 .column {
        transform: translateX(-200%);
    }

    .filter-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .results-list {
        max-height: none;
    }

    .export-head {
        flex-wrap: nowrap;
        gap: 4px;
    }

    .export-head #exportBtn {
        margin-right: 0;
    }

    .export-head button {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
        font-size: 0.68rem;
        padding: 4px 4px;
        gap: 3px;
        white-space: nowrap;
    }

    .export-doc-table {
        min-width: 0;
        width: 100%;
    }

    .mobile-filter-cta-wrap {
        display: block;
        position: sticky;
        bottom: 0;
        z-index: 8;
        padding: 10px;
        border-top: 1px solid var(--edge);
        background: linear-gradient(to top, #f8f9f8 74%, rgba(248, 249, 248, 0.92) 100%);
    }

    .mobile-floating-back {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: calc(10px + env(safe-area-inset-top));
        left: calc(10px + env(safe-area-inset-left));
        width: 40px;
        height: 40px;
        border: 1px solid #c3cfca;
        background: #ffffff;
        color: #182220;
        font-size: 1.2rem;
        line-height: 1;
        z-index: 30;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
    }

    .mobile-detail-nav {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        position: fixed;
        top: calc(10px + env(safe-area-inset-top));
        right: calc(10px + env(safe-area-inset-right));
        background: rgba(11, 48, 40, 0.9);
        border: 1px solid #2d5c52;
        padding: 3px;
        z-index: 31;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    }

    .mobile-detail-nav-btn[disabled] {
        opacity: 0.42;
        cursor: default;
    }

    .web-carousel-link img {
        height: 120px;
    }

    .share-loader-badge {
        max-width: min(90vw, 320px);
    }
}

@media (min-width: 981px) {
    html,
    body {
        height: 100%;
        overflow: hidden;
    }

    .app-shell {
        height: 100vh;
        min-height: 100vh;
        overflow: hidden;
    }

    .workspace {
        height: 100%;
        min-height: 0;
        align-items: stretch;
    }

    .column {
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .column-head.sticky {
        top: 0;
    }

    .panel {
        overflow: visible;
    }

    .results-list {
        overflow: visible;
        max-height: none;
    }

    #mobileBackBtn,
    #mobileNextBtn,
    #sceneBadge {
        display: none;
    }
}
