.fi-layout {
    min-height: 100vh;
}

.fi-sidebar {
    background-color: #0B2945 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 4px 0 12px rgba(7, 25, 41, 0.15);
    min-height: 100vh;
}

.fi-sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Filament picks the logo by colour scheme, but this header is navy in both. */
.fi-sidebar-header .fi-logo.fi-logo-light { display: none; }
.fi-sidebar-header .fi-logo.fi-logo-dark { display: flex; }

.fi-sidebar-nav-groups {
    padding-top: 0.5rem;
    padding-bottom: 4rem; /* extra space so the last link clears the bottom of the viewport */
    gap: 0.25rem; /* tighter spacing between groups (default is ~1rem) */
}

/* Tighten spacing inside each nav group */
.fi-sidebar-group {
    gap: 0.125rem;
}

.fi-sidebar-group-items {
    gap: 0.125rem;
}

/* Reduce vertical padding on the group header (label + collapse btn) */
.fi-sidebar-group-label,
.fi-sidebar-group-btn {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.fi-sidebar-group-label {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.675rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fi-sidebar-group-btn .fi-icon {
    color: rgba(255, 255, 255, 0.5) !important;
}

.fi-sidebar-group-collapse-btn {
    color: rgba(255, 255, 255, 0.4) !important;
}

.fi-sidebar-item-label {
    color: rgba(255, 255, 255, 0.8) !important;
}

.fi-sidebar-item-btn > .fi-icon {
    color: rgba(255, 255, 255, 0.5) !important;
}

.fi-sidebar-item-grouped-border-part,
.fi-sidebar-item-grouped-border-part-not-first,
.fi-sidebar-item-grouped-border-part-not-last {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Hover: dark-friendly background with bright text */
.fi-sidebar-item.fi-sidebar-item-has-url > .fi-sidebar-item-btn:hover,
.fi-sidebar-item.fi-sidebar-item-has-url > .fi-sidebar-item-btn:focus-visible {
    background-color: rgba(255, 255, 255, 0.07) !important;
}

.fi-sidebar-item > .fi-sidebar-item-btn:hover .fi-sidebar-item-label,
.fi-sidebar-item > .fi-sidebar-item-btn:focus-visible .fi-sidebar-item-label {
    color: #fff !important;
}

.fi-sidebar-item > .fi-sidebar-item-btn:hover > .fi-icon,
.fi-sidebar-item > .fi-sidebar-item-btn:focus-visible > .fi-icon {
    color: #fff !important;
}

/* Active state: override Filament's bg-gray-100 and text-primary-700 */
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background-color: rgba(255, 255, 255, 0.12) !important;
    border-radius: 0.375rem;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label {
    color: #fff !important;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-icon {
    color: #fff !important;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-grouped-border .fi-sidebar-item-grouped-border-part {
    background-color: #fff !important;
}

.fi-topbar {
    border-bottom: 1px solid #E7ECF0;
}

.fi-main-ctn {
    background-color: #F4F6F8;
    min-height: 100vh;
}

/* ── Module Library Grid ── */

.fiscal-module-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.25rem;
    /* Cards are as tall as their own preview rather than stretching to match
       the tallest in the row, so a thin module does not sit above dead space. */
    align-items: start;
}

@media (min-width: 640px) {
    .fiscal-module-grid { grid-template-columns: repeat(2, 1fr); }
}

.fiscal-module-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s, transform 0.2s;
}

.fiscal-module-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.fiscal-module-card-header {
    padding: 1rem 1rem 0.75rem;
}

.fiscal-module-card-title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    transition: color 0.15s;
}

.fiscal-module-card:hover .fiscal-module-card-title {
    color: #d97706;
}

.fiscal-module-card-desc {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fiscal-module-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    background: #fffbeb;
    color: #92400e;
}

.fiscal-module-card-screenshot {
    margin: 0 1rem 0.75rem;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #f3f4f6;
    background: #f9fafb;
}

/* Module screenshots are cropped to their content, so their aspect ratios run
   from roughly 35:1 (the announcement bar) to 3:2. Forcing them into a fixed
   box would crop a wide module down to a meaningless sliver, so the preview
   keeps the image's own proportions and only clamps the very tall ones. */
.fiscal-module-card-screenshot img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 18rem;
    object-fit: cover;
    object-position: top;
    transition: transform 0.3s;
}

.fiscal-module-card:hover .fiscal-module-card-screenshot img {
    transform: scale(1.02);
}

.fiscal-module-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
}

/* The library card no longer has a fixed-height preview box for height: 100%
   to resolve against, so a module without a screenshot needs its own. */
.fiscal-module-card-screenshot .fiscal-module-card-placeholder {
    min-height: 8rem;
}

.fiscal-module-card-footer {
    padding: 0 1rem 0.75rem;
    margin-top: auto;
}

.fiscal-module-card-footer > div,
.fiscal-module-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.6875rem;
    color: #9ca3af;
}

.fiscal-module-card-edit {
    font-weight: 500;
    color: #d97706;
    opacity: 0;
    transition: opacity 0.15s;
}

.fiscal-module-card:hover .fiscal-module-card-edit {
    opacity: 1;
}

/* ── Module Picker Modal Grid ── */

.fiscal-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    max-height: 28rem;
    overflow-y: auto;
    padding: 0.125rem;
}

@media (min-width: 640px) {
    .fiscal-picker-grid { grid-template-columns: repeat(3, 1fr); }
}

.fiscal-picker-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 0.625rem;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    text-align: left;
    padding: 0;
    font-family: inherit;
    color: inherit;
}

.fiscal-picker-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.fiscal-picker-card--selected {
    border-color: #d97706 !important;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2), 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.fiscal-picker-card--selected::after {
    content: '✓';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.375rem;
    height: 1.375rem;
    background: #d97706;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 2;
}

.fiscal-picker-card-screenshot {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
}

/* The picker stays on a uniform grid so it is quick to scan, so here the whole
   screenshot is fitted inside the box instead of cropped to fill it — a wide
   module reads as a wide module rather than a zoomed fragment. */
.fiscal-picker-card-screenshot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.fiscal-picker-card-info {
    padding: 0.625rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.fiscal-picker-card-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #111827;
}

.fiscal-picker-card-desc {
    font-size: 0.6875rem;
    color: #6b7280;
    line-height: 1.4;
}

/* ── Module Search ── */

.fiscal-module-search {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #111827;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.fiscal-module-search::placeholder {
    color: #9ca3af;
}

.fiscal-module-search:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.15);
}

/* ── Load More ── */

.fiscal-load-more-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.fiscal-load-more-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ── Repeater Collapse / Expand Actions ── */

.fi-fo-repeater-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.fi-fo-repeater-actions .fi-link {
    display: inline-flex !important;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #124F84 !important;
    background: #EDF5FB;
    border: 1px solid #C6DEF0;
    border-radius: 0.375rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    text-decoration: none !important;
}

.fi-fo-repeater-actions .fi-link:hover {
    background: #D6EAFA;
    color: #0B2945 !important;
    border-color: #8FC1E3;
    box-shadow: 0 1px 3px rgba(18, 79, 132, 0.1);
}

.fi-fo-repeater-actions .fi-link .fi-icon {
    width: 0.875rem;
    height: 0.875rem;
    color: inherit !important;
}

/* ── Module Repeater Items ── */

.fiscal-module-repeater .fi-fo-repeater-item {
    background: #f8f9fb;
    border: 1px solid #e2e6eb;
    border-radius: 0.5rem;
}

.fiscal-module-repeater .fi-fo-repeater-item-header {
    background: #f0f2f5;
    border-bottom: 1px solid #e2e6eb;
    border-radius: 0.5rem 0.5rem 0 0;
}

/* ── Brand Colour Swatches ── */

.fiscal-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.fiscal-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    width: 4.25rem;
    cursor: pointer;
}

/* The radio stays in the accessibility tree and keeps arrow-key navigation;
   the chip below is what the editor actually sees. */
.fiscal-swatch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.fiscal-swatch-chip {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 2px solid #d7dce2;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.fiscal-swatch:hover .fiscal-swatch-chip {
    transform: scale(1.06);
    border-color: #a8b2bd;
}

.fiscal-swatch input:checked + .fiscal-swatch-chip {
    border-color: #377E53;
    box-shadow: 0 0 0 3px rgba(55, 126, 83, 0.25);
    transform: scale(1.08);
}

.fiscal-swatch input:focus-visible + .fiscal-swatch-chip {
    outline: 2px solid #377E53;
    outline-offset: 3px;
}

.fiscal-swatch-label {
    font-size: 0.6875rem;
    line-height: 1.25;
    text-align: center;
    color: #6b7280;
}

.fiscal-swatch input:checked ~ .fiscal-swatch-label {
    color: #2F6B47;
    font-weight: 600;
}

/* ── Brand Button Styles ── */

.fiscal-button-styles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.875rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e6eb;
}

.fiscal-button-styles-light { background: #FFFFFF; }
.fiscal-button-styles-dark { background: #313131; border-color: #313131; }

.fiscal-button-style {
    position: relative;
    cursor: pointer;
    border-radius: 6px;
    padding: 4px;
    border: 2px solid transparent;
    transition: border-color 0.15s;
}

/* The radio stays in the accessibility tree and keeps arrow-key navigation;
   the sample is what the editor actually sees. */
.fiscal-button-style input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Close enough to .btn in resources/css/app.css to judge by. */
.fiscal-button-style-sample {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 3px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.fiscal-button-style:hover { border-color: #a8b2bd; }
.fiscal-button-styles-dark .fiscal-button-style:has(input:checked) { border-color: #F3BA40; }
.fiscal-button-styles-light .fiscal-button-style:has(input:checked) { border-color: #377E53; }

.fiscal-button-style:has(input:focus-visible) {
    outline: 2px solid #377E53;
    outline-offset: 2px;
}

/* ==========================================================================
   AI Assistant chat (Filament page: app/Filament/Pages/AiAssistant.php)
   ========================================================================== */

.oc-chat-wrap {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 13rem);
    min-height: 400px;
}

.oc-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: none;
    border-radius: 0.75rem 0.75rem 0 0;
    background: rgba(0, 0, 0, 0.02);
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.6);
}

.oc-status-left,
.oc-status-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.oc-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    flex-shrink: 0;
}

.oc-status-dot.connected { background: #22c55e; }
.oc-status-dot.connecting { background: #eab308; animation: oc-pulse 1.5s infinite; }
.oc-status-dot.pairing { background: #f97316; animation: oc-pulse 1.5s infinite; }
.oc-status-dot.unconfigured { background: #9ca3af; }

@keyframes oc-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.oc-text-btn {
    background: none;
    border: none;
    color: #377E53;
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

/* Setup and pairing instructions. Amber rather than red: nothing is broken,
   something needs doing on the server. */
.oc-notice {
    padding: 0.75rem 1rem;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    background: #fffbeb;
    color: #78350f;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.oc-notice-command {
    margin-top: 0.375rem;
    font-size: 0.75rem;
}

.oc-notice-command code {
    font-family: ui-monospace, monospace;
    background: rgba(0, 0, 0, 0.06);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.oc-messages {
    flex: 1;
    overflow-y: auto;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.oc-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: rgba(0, 0, 0, 0.45);
}

.oc-empty-icon {
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 0.75rem;
    color: rgba(0, 0, 0, 0.25);
}

.oc-empty-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.65);
}

.oc-empty-hint {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    max-width: 24rem;
}

.oc-msg-row { display: flex; }
.oc-msg-row.user { justify-content: flex-end; }
.oc-msg-row.assistant { justify-content: flex-start; }

.oc-bubble {
    max-width: 80%;
    padding: 0.625rem 1rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
    overflow-wrap: break-word;
}

.oc-bubble.user {
    background: #2F6B47;
    color: #fff;
    border-bottom-right-radius: 0.375rem;
}

/* pre-wrap belongs on the text node, never the bubble: on the bubble it also
   renders the Blade template's indentation and newlines, which inflated these
   bubbles to several times their content. */
.oc-user-text {
    display: block;
    white-space: pre-wrap;
}

.oc-user-text + .oc-user-image {
    margin-top: 0.5rem;
}

.oc-bubble.assistant {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.85);
    border-bottom-left-radius: 0.375rem;
}

.oc-bubble.assistant pre {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin: 0.75rem 0;
    overflow-x: auto;
    font-size: 0.8rem;
}

.oc-bubble.assistant code {
    font-family: ui-monospace, monospace;
    font-size: 0.8125rem;
    background: rgba(0, 0, 0, 0.06);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.oc-bubble.assistant pre code {
    background: none;
    padding: 0;
}

.oc-bubble.assistant p { margin: 0.625rem 0; }
.oc-bubble.assistant p:first-child { margin-top: 0; }
.oc-bubble.assistant p:last-child { margin-bottom: 0; }
.oc-bubble.assistant ul { margin: 0.5rem 0; padding-left: 1.25rem; list-style: disc; }
.oc-bubble.assistant li { margin: 0.25rem 0; }
.oc-bubble.assistant strong { font-weight: 600; }

.oc-user-image {
    display: block;
    max-width: 200px;
    max-height: 150px;
    border-radius: 0.5rem;
}

.oc-typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
}

.oc-typing-dots span {
    width: 6px;
    height: 6px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 50%;
    animation: oc-bounce 1.2s infinite;
}

.oc-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.oc-typing-dots span:nth-child(3) { animation-delay: 0.3s; }
.oc-working-note { margin-top: 0.25rem; font-size: 0.8125rem; opacity: 0.6; }

@keyframes oc-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

.oc-attachment-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.02);
}

.oc-attachment-preview img {
    width: 48px;
    height: 48px;
    border-radius: 0.375rem;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.oc-attach-name {
    flex: 1;
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.oc-attach-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.oc-attach-remove:hover { background: rgba(239, 68, 68, 0.1); }

.oc-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-top: none;
    border-radius: 0 0 0.75rem 0.75rem;
    background: rgba(0, 0, 0, 0.02);
}

.oc-file-input { display: none; }

.oc-input-bar textarea {
    flex: 1;
    resize: none;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    background: #fff;
    color: rgba(0, 0, 0, 0.85);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    max-height: 150px;
    outline: none;
    transition: border-color 0.15s;
}

.oc-input-bar textarea:focus { border-color: #377E53; }
.oc-input-bar textarea::placeholder { color: rgba(0, 0, 0, 0.4); }
.oc-input-bar textarea:disabled { opacity: 0.5; cursor: not-allowed; }

.oc-send-btn,
.oc-stop-btn,
.oc-attach-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s, color 0.15s;
}

.oc-send-btn { background: #377E53; color: #fff; }
.oc-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.oc-stop-btn { background: #ef4444; color: #fff; }

.oc-attach-btn { background: none; color: rgba(0, 0, 0, 0.5); }
.oc-attach-btn:hover { color: rgba(0, 0, 0, 0.8); }
.oc-attach-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.oc-icon { width: 1.25rem; height: 1.25rem; }

/* Dark mode */
.dark .oc-status-bar {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.6);
}

.dark .oc-notice { background: #451a03; color: #fed7aa; }
.dark .oc-notice-command code { background: rgba(255, 255, 255, 0.1); }
.dark .oc-messages { border-color: rgba(255, 255, 255, 0.1); }
.dark .oc-empty-state { color: rgba(255, 255, 255, 0.45); }
.dark .oc-empty-icon { color: rgba(255, 255, 255, 0.25); }
.dark .oc-empty-title { color: rgba(255, 255, 255, 0.75); }
.dark .oc-bubble.user { background: #2F6B47; }

.dark .oc-bubble.assistant {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.dark .oc-bubble.assistant pre { background: rgba(255, 255, 255, 0.1); }
.dark .oc-bubble.assistant code { background: rgba(255, 255, 255, 0.1); }
.dark .oc-typing-dots span { background: rgba(255, 255, 255, 0.35); }

.dark .oc-attachment-preview {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.dark .oc-attach-name { color: rgba(255, 255, 255, 0.6); }

.dark .oc-input-bar {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.dark .oc-input-bar textarea {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
}

.dark .oc-input-bar textarea::placeholder { color: rgba(255, 255, 255, 0.4); }
.dark .oc-attach-btn { color: rgba(255, 255, 255, 0.5); }
.dark .oc-attach-btn:hover { color: rgba(255, 255, 255, 0.85); }

/* Assets page: every file on the media disk. */
.fiscal-asset-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.5rem 0 1.25rem;
}

.fiscal-asset-toolbar > * { max-width: 24rem; }

.fiscal-asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.fiscal-asset-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
}

/* A checkerboard, so white and transparent artwork is still visible. */
.fiscal-asset-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
    padding: 0.75rem;
    background-color: #f3f4f6;
    background-image:
        linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
        linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.fiscal-asset-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.fiscal-asset-meta { padding: 0.625rem 0.75rem 0.75rem; }

.fiscal-asset-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fiscal-asset-detail {
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.fiscal-asset-copy {
    margin-top: 0.5rem;
    padding: 0.25rem 0.625rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    background: #fff;
}

.fiscal-asset-copy:hover { border-color: #377E53; color: #377E53; }

.dark .fiscal-asset-card { background: #18181b; border-color: #3f3f46; }
.dark .fiscal-asset-name { color: #f4f4f5; }
.dark .fiscal-asset-detail { color: #a1a1aa; }
.dark .fiscal-asset-copy { background: #27272a; border-color: #52525b; color: #e4e4e7; }
