/* App layout from react/<product>/src/components_static (jmt_app.jsx + index.css), plus the inline styles the React
   components set. PrimeReact's own structural CSS is in primereact.css (extracted from the component JS); colours,
   spacing and states come from the lara-light-blue theme. Avoid restyling .p-* classes here — that is what made the
   port drift from the React look. */
html { font-size: var(--app-font-size, 0.9rem); overflow: hidden; }
body { height: 100%; margin: 0; background: var(--surface-ground, #f8f9fa); font-family: var(--font-family); }

.app-root { height: 100vh; display: flex; flex-direction: column; }
.layout-topbar { position: sticky; top: 0; z-index: 1000; height: 56px; }
.layout-main { flex: 1; display: flex; min-height: 0; }
.layout-content { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem; background: var(--surface-ground, #f8f9fa); border-top-left-radius: 10px; }

.jmt-topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 1rem; }
.jmt-topbar-logo { height: 36px; margin-right: .75rem; border-radius: 8px; }
.jmt-topbar-title { font-weight: 700; font-size: 1.2rem; }

/* JMT_APP_SIDE_MENU: 170px column holding a PrimeReact Menu (styled by the theme), then logo + version */
.jmt-side-menu { width: 170px; padding: 2px 10px 10px 10px; overflow-y: auto; flex-shrink: 0; }
.jmt-side-menu .p-menu { width: 100%; }
body.jmt-menu-hidden .jmt-side-menu { display: none; }
@media (max-width: 768px) {
  .jmt-side-menu { position: fixed; top: 56px; bottom: 0; left: 0; z-index: 999; display: none; }
  body.jmt-menu-open .jmt-side-menu { display: block; }
  .jmt-topbar-title { display: none; }
}

/* html is overflow:hidden (the shell scrolls its own panels), so the login screen is its own viewport-high scroller.
   The card centres with auto margins rather than align-items:center, which would push its top out of reach when the
   window is shorter than the card. */
.jmt-login { height: 100vh; height: 100dvh; overflow-y: auto; }
.jmt-login > * { margin-top: auto; margin-bottom: auto; }
.jmt-login h1 { margin: .5rem 0 0; }

/* <a> styled as a button (LinkButton) */
a.p-button { text-decoration: none; }

/* JMT_FIELD_*: desktop layout from the React components — ruled row, 300px caption, 25px input, icon addon */
.jmt-field { padding: 0; border-bottom: 1px solid; }
/* 300px like React, but in a narrow panel the caption gives way before the input does */
.jmt-field-caption { flex: 0 1 300px; max-width: 45%; min-width: 0; padding: 2px; display: flex; align-items: center; overflow-wrap: anywhere; }
.jmt-field .p-inputgroup > .p-inputtext, .jmt-field .p-inputgroup > .jmt-field-checkbox { min-width: 5rem; }
.jmt-field .p-inputtext { height: 25px; padding: 3px; border-radius: 0; }
.jmt-field textarea.p-inputtext { height: auto; }
.jmt-field .p-inputgroup-addon { height: 25px; border: 0; border-radius: 0; }
.jmt-field-readonly .p-inputtext { background-color: lightgrey; border: 1px solid lightgrey; }
.jmt-field-edit .p-inputtext { border: 1px solid; border-bottom: 0; }
.jmt-field-edit .p-inputgroup-addon { background-color: white; }
.jmt-field-checkbox { flex: 1 1 auto; display: flex; align-items: center; padding: 0 3px; }
.jmt-field-lookup { border-bottom-width: 1px; }
.jmt-lookup-input { background-color: lightgreen; border-bottom: none; cursor: pointer; }
.jmt-lookup-button { background-color: #3B82F6; color: white; cursor: pointer; }
/* a blue button at the end of a text box (e.g. Bookings' Filter > Search): beat .jmt-field-edit's white addon */
.jmt-field .p-inputgroup-addon.jmt-lookup-button { background-color: #3B82F6; color: white; }
@media (max-width: 768px) {  /* React's mobile layout: caption above the input */
  .jmt-field { border-bottom: none; margin-bottom: .5rem; }
  .jmt-field .p-inputgroup { flex-wrap: wrap; }
  .jmt-field-caption { width: 100%; font-weight: 500; margin-bottom: .25rem; }
}

/* DataTable extras */
.p-datatable .p-sortable-column { white-space: nowrap; }
.jmt-group-total td { background-color: #aaffaa; }

/* Dialog: the mask's positioning is an inline style in PrimeReact (DialogBase); position="center" | "top" */
.p-dialog-mask { position: fixed; inset: 0; z-index: 1100; display: flex; justify-content: center; align-items: center; }
.p-dialog-mask.p-dialog-top { align-items: flex-start; }
.p-dialog-top .p-dialog { margin: .75rem; }
.p-dialog { max-width: 95vw; }
@media (max-width: 768px) { .p-dialog { width: 95vw !important; } }

/* Toast container placement (PrimeReact sets it inline) and long API errors: a narrow stack in the bottom-right corner;
   the container lets clicks through, only the messages themselves catch them */
.p-toast { position: fixed; bottom: 16px; right: 16px; z-index: 1200; width: auto; max-width: min(25rem, calc(100vw - 32px)); pointer-events: none; }
.p-toast-message { pointer-events: auto; }
.p-toast-message-success .p-toast-message-content { padding: 0.5rem 0.75rem; }
.p-toast-detail { white-space: pre-wrap; word-break: break-word; }

/* Global request indicator */
.jmt-global-loading { position: fixed !important; top: 0; left: 0; right: 0; z-index: 1300; }
/* Forgot password: covers the whole screen (no clicks get through) while the reset email is sent */
.jmt-busy-overlay { display: none; position: fixed; inset: 0; z-index: 3000; background: var(--surface-ground, #eff3f8); opacity: 1; align-items: center; justify-content: center; cursor: progress; }
.jmt-busy-overlay.htmx-request { display: flex; }
.jmt-busy-box { width: min(26rem, calc(100vw - 32px)); padding: 1.5rem; text-align: center; background: var(--surface-card, #fff); opacity: 1; }

/* htmx: indicators only show while a request is in flight */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: block; }

/* User endpoint permissions: one scrolling lane per folder (POPUP_USER_ENDPOINT_UPDATE) */
.jmt-lanes { display: flex; gap: 1rem; overflow-x: auto; align-items: flex-start; padding: .5rem 0 1rem; }
.jmt-lane { flex: 0 0 300px; max-height: 60vh; overflow-y: auto; background: var(--surface-card, #fff); border-radius: 6px;
            box-shadow: 0 2px 6px rgb(0 0 0 / .15); padding: .5rem .75rem; }
.jmt-lane summary { cursor: pointer; display: flex; align-items: center; }
.jmt-lane label { cursor: pointer; overflow-wrap: anywhere; }

/* JMT_API_BUTTON: style={{ margin: '-1px', height: '22px' }} (PrimeFlex mr-2/mb-2 still win on right/bottom) */
.jmt-api-button { height: 22px; margin: -1px; }

/* Top bar (JMT_APP_TOPBAR): round cog + sign-out buttons, cog opens the options list */
.jmt-topbar-title { text-decoration: none; margin-left: 10px; }
.jmt-topbar-button { width: 2.25rem; height: 2.25rem; cursor: pointer; }
.jmt-options-menu { position: relative; }
.jmt-options-menu > summary { list-style: none; }
.jmt-options-menu > summary::-webkit-details-marker { display: none; }
.jmt-options { position: absolute; top: 42px; right: 0; min-width: 190px; background: #fff; border: 1px solid #dcdcdc;
               border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.15); z-index: 9999; overflow: hidden; }
.jmt-option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid #eee;
              background: none; cursor: pointer; font: inherit; color: var(--text-color, #4b5563); text-align: left; }
.jmt-option:last-child { border-bottom: none; }
.jmt-option:hover, .jmt-option:focus-visible { background: var(--surface-hover, #f3f4f6); }

/* Login splash (React: 2.5s black screen with the pulsing logo) */
.jmt-splash { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: #000;
              animation: jmt-splash-out .3s ease 2.5s forwards; }
.jmt-splash img { max-width: 80%; max-height: 80%; border-radius: 30%; animation: jmt-pulse 1.5s ease-in-out infinite; }
@keyframes jmt-pulse { 0% { transform: scale(1); } 50% { transform: scale(.85); } 100% { transform: scale(1); } }
@keyframes jmt-splash-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .jmt-splash { display: none; } }

/* Lookup dialog (jmt_field_lookup.jsx): Status / Sort By dropdowns — same panel look as the top bar menus */
.jmt-dropdown { position: relative; flex: 1 1 auto; width: 1%; display: block; background: var(--surface-0, #fff);
                border: 1px solid var(--surface-border, #d1d5db); transition: border-color .15s, box-shadow .15s; }
.jmt-dropdown:hover { border-color: var(--primary-color, #3B82F6); }
/* open: its list must cover the grid and the other filters below it, so it sits well above the dialog's own layers
   (PrimeReact puts focused inputs, sticky headers and overlays at 1-10), still under the top bar (1000) */
.jmt-dropdown[open] { border-color: var(--primary-color, #3B82F6); box-shadow: 0 0 0 .2rem #BFDBFE; z-index: 50; }
.jmt-dropdown > summary { list-style: none; }
.jmt-dropdown > summary::-webkit-details-marker { display: none; }
.jmt-dropdown-trigger { display: flex; align-items: center; gap: .5rem; height: 100%; min-height: 2.5rem; padding: 0 .75rem; cursor: pointer; user-select: none; }
.jmt-dropdown-trigger:focus-visible { outline: none; }
.jmt-dropdown-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jmt-dropdown-placeholder { color: var(--text-color-secondary, #6b7280); }
.jmt-dropdown-clear { color: var(--text-color-secondary, #6b7280); padding: .25rem; border-radius: 50%; }
.jmt-dropdown-clear:hover { background: var(--surface-hover, #f3f4f6); color: var(--text-color, #4b5563); }
.jmt-dropdown-chevron { font-size: .75rem; color: var(--text-color-secondary, #6b7280); transition: transform .15s; }
.jmt-dropdown[open] .jmt-dropdown-chevron { transform: rotate(180deg); }
.jmt-options.jmt-dropdown-panel { top: calc(100% + 4px); left: -1px; right: auto; min-width: calc(100% + 2px); max-height: 18rem; overflow-y: auto; z-index: 20; }
/* PrimeReact-style checkbox on the status rows */
.jmt-check-option { cursor: pointer; }
.jmt-check-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.jmt-check-box { flex-shrink: 0; width: 1.25rem; height: 1.25rem; display: inline-flex; align-items: center; justify-content: center;
                 border: 2px solid var(--surface-border, #d1d5db); border-radius: 6px; color: transparent; font-size: .75rem;
                 transition: background-color .15s, border-color .15s; }
.jmt-check-option:hover .jmt-check-box { border-color: var(--primary-color, #3B82F6); }
.jmt-check-input:checked + .jmt-check-box { background: var(--primary-color, #3B82F6); border-color: var(--primary-color, #3B82F6); color: #fff; }
.jmt-check-input:focus-visible + .jmt-check-box { outline: 2px solid var(--primary-color, #3B82F6); outline-offset: 2px; }
.jmt-pager .p-inputgroup-addon.jmt-pager-arrow { cursor: pointer; }
.jmt-pager .p-button { border-radius: 0; }
.jmt-pager .p-button-blank { background-color: white; color: blue; border: 1px solid var(--surface-border, #d1d5db); }

.jmt-options-header { padding: 8px 12px; font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
                      color: var(--text-color-secondary, #6b7280); border-bottom: 1px solid #eee; }
.jmt-option-current { font-weight: 700; color: var(--primary-color, #3B82F6); }


/* Flatpickr date picker, themed to match PrimeReact lara-light-blue */
.flatpickr-calendar { font-family: var(--font-family); box-shadow: 0 2px 12px rgba(0,0,0,.1); border-radius: 6px; z-index: 1150; }
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.selected:focus {
  background: var(--highlight-bg, #EFF6FF); border-color: var(--highlight-bg, #EFF6FF); color: var(--highlight-text-color, #1D4ED8); font-weight: 700; }
.flatpickr-day.today { border-color: var(--primary-color, #3B82F6); }
.flatpickr-day:hover { background: var(--surface-hover, #f3f4f6); border-color: transparent; }
.flatpickr-months .flatpickr-month, .flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 600; }
.jmt-datepicker-buttonbar { display: flex; justify-content: space-between; padding: .25rem .5rem .5rem; border-top: 1px solid var(--surface-border, #dee2e6); }
.jmt-datepicker-toggle { cursor: pointer; }

/* Top bar cog + sign-out (colours inline from config.THEME, as React sets them) */
.jmt-topbar-button:focus-visible { outline: 2px solid var(--primary-color, #3B82F6); outline-offset: 2px; }

/* Side menu: the current page (jmt_app.jsx activeMenuCSS) */
.jmt-menu-item-active .p-menuitem-link { background-color: var(--jmt-button-bg, #133518) !important; border-radius: 6px; margin: 4px; }
.jmt-menu-item-active .p-menuitem-icon, .jmt-menu-item-active .p-menuitem-text { color: #fff !important; }

/* Dark mode (jmt_theme_provider.jsx): panels and tables follow the dark palette */
.jmt-dark .p-panel .p-panel-header, .jmt-dark .p-panel .p-panel-content, .jmt-dark .p-card,
.jmt-dark .p-datatable .p-datatable-thead > tr > th, .jmt-dark .p-datatable .p-datatable-tbody > tr { background: #1e1e1e; color: #f5f5f5; }

/* XlsxUpload preview */
.jmt-upload-preview td { white-space: nowrap; }

/* Menu navigation in flight (web.js, a.jmt-nav): dim the current page under a spinner until the next one swaps in */
body.jmt-navigating #content { opacity: .35; pointer-events: none; transition: opacity .15s ease-in; }
body.jmt-navigating .layout-content { position: relative; }
body.jmt-navigating .layout-content::after {
  content: ""; position: absolute; top: 8rem; left: 50%; width: 2.5rem; height: 2.5rem; margin-left: -1.25rem;
  border: 4px solid var(--jmt-button-bg, #133518); border-right-color: transparent; border-radius: 50%;
  animation: jmt-spin .8s linear infinite;
}
@keyframes jmt-spin { to { transform: rotate(360deg); } }


/* ---- jmtdev additions ---- */
/* JMT_FIELD_CHECKBOX: lavender strip holding the box */
.jmt-field-check .jmt-field-checkbox { background-color: lavender; min-height: 25px; }
.jmt-field-check .p-inputgroup-addon { height: 25px; border: 0; border-radius: 0; }
.jmt-field-multi { flex-wrap: wrap; gap: .25rem .75rem; }
.jmt-multi-option { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.jmt-field-edit select.p-inputtext { padding: 0 3px; }
/* JMT_FIELD_DOUBLE_LABEL */
.jmt-double { flex: 1 1 auto; display: flex; gap: 4px; }
.jmt-double-value { flex: 1; text-align: center; background-color: lavender; padding: 2px; min-height: 22px; }
.jmt-double-headers { display: flex; font-size: .9em; color: #555; font-weight: bold; }
.jmt-double-headers .jmt-field-caption { flex: 0 1 300px; }
.jmt-double-head { flex: 1; text-align: center; }

/* JMT_API_BUTTON tile variant (dashboard buttons with height + buttonColor) */
.jmt-tile { min-height: 80px; padding: 10px; border-radius: 15px; font-size: .8em; color: #fff; text-align: center; }
.jmt-tile-icon { padding: 8px; font-size: 2em; color: #000; background: #fff; border-radius: 10px; }

/* JMT_LOADING_PANEL toggleable */
.jmt-panel-toggleable > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.jmt-panel-toggleable > summary::-webkit-details-marker { display: none; }
.jmt-panel-toggleable:not([open]) .jmt-panel-toggle { transform: rotate(-90deg); }

/* JMT_DATATABLE tools row */
.jmt-table-tools { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.jmt-table-tools .jmt-api-button { margin: 0; }

/* Cog menu in dark mode (React: #000 panel, white text) */
.jmt-options-dark { background: #000; border-color: #333; }
.jmt-options-dark .jmt-option { color: #fff; border-bottom-color: #222; }
.jmt-options-dark .jmt-option:hover { background: #222; }
a.jmt-topbar-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* Menu entries whose icon is an image (capacitylog: Shopify) */
.jmt-menu-img { width: 1rem; height: 1rem; object-fit: contain; }

/* Debug dumps (<pre>{JSON.stringify(...)}</pre>) */
.jmt-pre { white-space: pre-wrap; font-size: .75rem; max-height: 50vh; overflow: auto; background: rgba(0,0,0,.04); padding: .5rem; }

/* Rows highlighted by a page (rowClassName) */
.jmt-row-red td { background-color: #ffcdd2 !important; }
.jmt-row-green td { background-color: #c8e6c9 !important; }
.jmt-row-amber td { background-color: #ffe0b2 !important; }
.jmt-row-blue td { background-color: #bbdefb !important; }
.jmt-row-selected td { background-color: var(--highlight-bg, #EFF6FF) !important; font-weight: 600; }

/* JMT_SMART_PANEL */
.jmt-smart-panel { background: #fff; color: var(--text-color, #4b5563); }
.jmt-smart-panel > summary { list-style: none; }
.jmt-smart-panel > summary::-webkit-details-marker { display: none; }
.jmt-smart-panel:not([open]) .jmt-smart-chevron { transform: rotate(180deg); }

/* The hidden attribute always wins (dialog masks and flex rows set display themselves) */
[hidden] { display: none !important; }

/* JMT_API_MONITOR: ListBox with count pills, uptime strips */
.jmt-listbox .p-listbox-list { list-style: none; margin: 0; padding: .25rem 0; }
.jmt-listbox .p-listbox-item { padding: 0; }
.jmt-listbox-link { display: flex; justify-content: space-between; align-items: center; padding: .4rem .75rem; color: inherit; text-decoration: none; }
.jmt-pill { background: #ef4444; color: #fff; border-radius: 9999px; padding: 1px 7px; font-size: .75rem; font-weight: 600; min-width: 20px; text-align: center; margin-left: 5px; }
.jmt-strips { border: 1px solid #ccc; padding: 5px; border-radius: 5px; min-height: 120px; }
/* Request/response dumps */
.jmt-code-block { color: #fff; background-color: #0065B3; padding: 10px; border-radius: 5px; white-space: pre-wrap; word-break: break-word; }
/* SelectButton built from links */
.jmt-selectbutton { display: inline-flex; flex-wrap: wrap; }
.jmt-selectbutton .p-button { text-decoration: none; }
/* Rows logged in the last 15 minutes (jmtdash recent-log-row) */
.jmt-row-recent td { background-color: #ffcccc !important; color: #990000 !important; font-weight: bold !important; }
/* JMTDash: "Enable Notifications" only on Safari */
.jmtdash-safari-only { display: none; }
.jmtdash-safari .jmtdash-safari-only { display: inline-flex; }
.p-datatable-wrapper { overflow-x: auto; }

/* JMT_MOBILE_* fields (flexybook): caption above the input at every width — wrap a form in .jmt-stacked */
.jmt-stacked .jmt-field { border-bottom: none; margin-bottom: .5rem; }
.jmt-stacked .jmt-field .p-inputgroup { flex-wrap: wrap; }
.jmt-stacked .jmt-field-caption { flex: 0 0 100%; max-width: 100%; font-weight: 500; margin-bottom: .25rem; padding: 0; }
.jmt-stacked .jmt-field .p-inputtext { height: auto; padding: .5rem; border-radius: 6px 0 0 6px; }
.jmt-stacked .jmt-field .p-inputgroup-addon { height: auto; border: 1px solid #d1d5db; border-left: 0; border-radius: 0 6px 6px 0; }
.jmt-stacked .jmt-field-multi { padding: .4rem .5rem; }
/* Booking detail (label: value grid in the Book dialogs) */
.jmt-detail-grid { display: grid; grid-template-columns: 40% 60%; row-gap: 4px; }
.jmt-detail-grid > b { padding-right: .5rem; }
.jmt-notice { text-align: center; background-color: #fff8e1; padding: 1rem; border: 1px solid var(--surface-border, #dee2e6); border-radius: 6px; }
.jmt-badges { font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: .25rem 0 .5rem; }
.jmt-badges .p-badge { border-radius: 3px; }
.jmt-field .jmt-field-checkbox { flex: 1 1 0; min-width: 0; }

/* Dataset cells (Cell): yellow once changed. In a table (no caption) a cell is a lavender box; with a caption it is a
   Field* row (FieldRow) and looks exactly like FieldTextbox / FieldDropdown / FieldLabel — only the yellow is its own. */
.jmt-cell { padding: 1px; }
.jmt-cell .jmt-cell-input { width: 100%; background-color: lavender; border: 1px solid #e2e2f0; border-radius: 0; padding: 3px; min-height: 28px; }
.jmt-cell select.jmt-cell-input { padding: 0 3px; }
.jmt-cell .jmt-cell-readonly { background-color: lightgrey; }
.jmt-cell-changed, .jmt-cell-changed.jmt-cell-input { background-color: yellow !important; }
.jmt-cell-check, .jmt-cell-multi { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: center; }
.jmt-color { display: flex; align-items: center; gap: .5rem; }
/* the cell controls that are not an <input> fill the row like FieldCheckbox's box does */
.jmt-field .jmt-cell-check, .jmt-field .jmt-cell-multi, .jmt-field .jmt-color { flex: 1 1 0; min-width: 0; min-height: 25px; padding: 0 3px; }
.jmt-field-check .jmt-cell-check, .jmt-field-check .jmt-cell-multi { background-color: lavender; }
.jmt-color-input { width: 2.5rem; height: 24px; padding: 0; border: 0; background: none; }
.jmt-status-filter { display: inline-flex; flex-wrap: wrap; gap: .25rem .75rem; font-weight: normal; font-size: .9em; }
.jmt-panel-tools { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
/* ErrorDialogOob: the API error to acknowledge; its rows (if any) scroll between the message and OK (bottom right) */
.jmt-modal .p-dialog:has(.jmt-error-detail) { min-width: min(420px, 95vw); min-height: 220px; }
.p-dialog-content:has(> .jmt-error-detail) { display: flex; flex-direction: column; gap: .5rem; min-height: 0; }
.jmt-error-title .pi { color: #dc2626; }
.jmt-error-detail { white-space: pre-wrap; }
.jmt-error-rows { flex: 1 1 auto; min-height: 0; overflow: auto; font-size: .9em; }
.jmt-error-rows .p-selectable-row { cursor: pointer; }
.p-dialog-footer { display: flex; justify-content: flex-end; }
.p-dialog-footer .jmt-error-ok { margin: 0; }
/* JMT_ASSISTANT: the assistant floating at the bottom right — a round button, and above it the chat panel it opens */
.jmt-assistant { position: fixed; right: 20px; bottom: 20px; z-index: 900; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.jmt-assistant-bubble { width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer; font-size: 1.5rem; color: #fff;
                        background: var(--jmt-button-bg, #122e50); box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.jmt-assistant-bubble:hover { filter: brightness(1.15); }
/* the panel runs from just under the top bar (56px + 12px) down to the button (20px + 56px + 12px gap) */
.jmt-assistant-panel { display: none; flex-direction: column; width: 420px; max-width: calc(100vw - 32px); height: calc(100vh - 156px);
                       background: #fff; color: #333; border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.3); overflow: hidden; }
.jmt-assistant-open .jmt-assistant-panel { display: flex; }
.jmt-assistant-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; color: #fff;
                        background: var(--jmt-button-bg, #122e50); }
.jmt-assistant-close { background: none; border: none; color: inherit; cursor: pointer; }
.jmt-assistant-log { flex: 1 1 auto; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.jmt-assistant-msg { margin: 0; padding: 8px 12px; border-radius: 12px; max-width: 85%; white-space: pre-wrap; line-height: 1.45; font-size: .9rem; }
.jmt-assistant-theirs { align-self: flex-start; background: #f1f3f5; }
.jmt-assistant-mine { align-self: flex-end; background: var(--jmt-button-bg, #122e50); color: #fff; }
.jmt-assistant-steps { align-self: flex-start; font-size: .75rem; color: #6b7280; display: flex; flex-direction: column; gap: 2px; }
.jmt-assistant-thinking { display: none; padding: 0 12px 8px; font-size: .85rem; color: #888; }
.jmt-assistant-thinking.htmx-request { display: block; }
.jmt-assistant-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid #e5e7eb; }
.jmt-assistant-input { flex: 1 1 auto; resize: none; }
.jmt-assistant-form .p-button { flex: 0 0 auto; }
.jmt-assistant-preview { position: relative; align-self: flex-start; margin: 0 10px 8px; }
.jmt-assistant-preview[hidden] { display: none; }
.jmt-assistant-preview img { display: block; max-height: 90px; max-width: 200px; border-radius: 6px; border: 1px solid #d1d5db; }
.jmt-assistant-unshot { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; border: none; cursor: pointer;
                        background: #374151; color: #fff; font-size: .65rem; display: flex; align-items: center; justify-content: center; }
.jmt-assistant-shot { display: block; max-width: 100%; border-radius: 6px; margin-bottom: 4px; }
/* Rendered markdown (web_helpers.markdown): the assistant's answers */
.jmt-markdown { white-space: normal; }
.jmt-markdown > :first-child { margin-top: 0; }
.jmt-markdown > :last-child { margin-bottom: 0; }
.jmt-markdown p, .jmt-markdown ul, .jmt-markdown ol, .jmt-markdown table, .jmt-markdown pre { margin: 0 0 .6em; }
.jmt-markdown ul, .jmt-markdown ol { padding-left: 1.25rem; }
.jmt-markdown li { margin: .15em 0; }
.jmt-markdown h1, .jmt-markdown h2, .jmt-markdown h3, .jmt-markdown h4 { font-size: 1em; margin: .8em 0 .4em; }
.jmt-markdown table { border-collapse: collapse; display: block; overflow-x: auto; font-size: .85em; }
.jmt-markdown th, .jmt-markdown td { border: 1px solid #d1d5db; padding: 3px 6px; text-align: left; vertical-align: top; }
.jmt-markdown th { background: rgba(0,0,0,.05); }
.jmt-markdown code { font-size: .9em; background: rgba(0,0,0,.07); padding: 0 3px; border-radius: 3px; }
.jmt-markdown pre { overflow-x: auto; background: rgba(0,0,0,.07); padding: 6px 8px; border-radius: 6px; }
.jmt-markdown pre code { background: none; padding: 0; }
.jmt-markdown hr { border: none; border-top: 1px solid #d1d5db; margin: .6em 0; }
.jmt-markdown a { color: inherit; text-decoration: underline; }
.jmt-dark .jmt-markdown th, .jmt-dark .jmt-markdown td, .jmt-dark .jmt-markdown hr { border-color: #444; }
.jmt-dark .jmt-markdown th, .jmt-dark .jmt-markdown code, .jmt-dark .jmt-markdown pre { background: rgba(255,255,255,.08); }
.jmt-dark .jmt-assistant-panel { background: #1e1e1e; color: #f5f5f5; }
.jmt-dark .jmt-assistant-theirs { background: #2c2c2c; }
.jmt-dark .jmt-assistant-form { border-top-color: #333; }
.jmt-dark .jmt-assistant-bubble, .jmt-dark .jmt-assistant-header, .jmt-dark .jmt-assistant-mine { color: #000; }
