/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

:root {
  --ink: #17212b;
  --muted: #687684;
  --line: #dce4e9;
  --panel: #ffffff;
  --canvas: #f4f7f8;
  --accent: #176b87;
  --accent-dark: #105267;
  --note: #fff7df;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; overflow-x: hidden; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 30px; line-height: 1.15; margin-bottom: 8px; }
h2 { font-size: 18px; margin-bottom: 0; }
a { color: var(--accent); }
.topbar { background: #203647; box-shadow: 0 2px 12px rgba(23, 33, 43, .16); color: #f5fbfc; padding-top: env(safe-area-inset-top); position: sticky; top: 0; z-index: 30; }
.topbar-inner { align-items: center; display: flex; gap: 24px; margin: 0 auto; max-width: 1500px; min-height: 64px; padding: 8px 28px; }
.brand { align-items: center; color: #fff; display: inline-flex; flex: 0 0 auto; gap: 9px; text-decoration: none; }
.brand > span:last-child { display: grid; line-height: 1.05; }
.brand strong { font-size: 17px; letter-spacing: .01em; }
.brand small { color: #aac0ca; font-size: 10px; letter-spacing: .1em; margin-top: 4px; text-transform: uppercase; }
.brand-mark { align-items: center; background: var(--accent); border-radius: 9px; color: #fff; display: inline-flex; font-size: 13px; font-weight: 800; height: 35px; justify-content: center; letter-spacing: .04em; width: 35px; }
.top-nav { align-items: center; display: flex; flex: 1 1 auto; gap: 4px; justify-content: center; }
.nav-toggle { align-items: center; background: #315368; border: 1px solid #668392; border-radius: 7px; color: #fff; cursor: pointer; display: none; font-size: 18px; height: 40px; justify-content: center; width: 42px; }
.top-nav > a, .nav-menu summary { border-radius: 7px; color: #d7e5ea; cursor: pointer; font-size: 13px; font-weight: 700; list-style: none; padding: 10px 11px; text-decoration: none; white-space: nowrap; }
.top-nav > a:hover, .nav-menu summary:hover, .top-nav > a.active, .nav-menu[open] summary { background: #315368; color: #fff; }
.new-ticket-nav { align-items: center; display: inline-flex; flex-direction: column; gap: 0; justify-content: center; min-width: 62px; padding: 4px 9px !important; }
.new-ticket-icon { color: #046a38; font-size: 27px; font-weight: 400; line-height: .9; }
.new-ticket-nav > span:last-child { color: #d7e5ea; font-size: 11px; line-height: 1.2; }
.new-ticket-nav:hover > span:last-child, .new-ticket-nav.active > span:last-child { color: #fff; }
.nav-badge { background: #e36b5d; border-radius: 999px; color: #fff; display: inline-block; font-size: 11px; line-height: 18px; margin-left: 5px; min-width: 18px; padding: 0 5px; text-align: center; }
.nav-menu { position: relative; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary span { color: #9fb8c3; font-size: 16px; margin-left: 4px; }
.sms-nav-menu summary { align-items: center; display: inline-flex; gap: 4px; }
.sms-nav-menu summary .sms-nav-label { color: inherit; font-size: 13px; margin-left: 0; }
.sms-nav-menu summary .nav-badge { color: #fff; font-size: 11px; margin-left: 1px; }
.sms-nav-menu summary > span[aria-hidden="true"] { margin-left: 0; }
.sms-inbound-number { background: #e7f4f7; border: 1px solid #c9e3e9; border-radius: 8px; color: var(--accent-dark); display: inline-block; font-size: 13px; margin: 10px 0 0; padding: 8px 11px; }
.nav-dropdown { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 30px rgba(23, 33, 43, .16); display: grid; gap: 2px; left: 0; min-width: 210px; padding: 7px; position: absolute; top: calc(100% + 5px); }
.nav-dropdown a { border-radius: 5px; color: var(--ink); font-size: 13px; padding: 9px 10px; text-decoration: none; }
.nav-dropdown a:hover { background: #edf5f7; color: var(--accent-dark); }
.nav-overflow-menu > summary { align-items: center; display: inline-flex; height: 40px; justify-content: center; min-width: 42px; padding: 8px 10px; }
.hamburger-mark { color: #d7e5ea !important; font-size: 20px !important; line-height: 1; margin: 0 !important; }
.nav-overflow-menu .nav-overflow-dropdown { display: grid; gap: 10px; left: auto; max-height: min(75vh, 680px); min-width: 270px; overflow-y: auto; padding: 10px; right: 0; }
.nav-dropdown-section { border-bottom: 1px solid var(--line); display: grid; gap: 2px; padding-bottom: 8px; }
.nav-dropdown-section:last-child { border-bottom: 0; padding-bottom: 0; }
.nav-dropdown-section > strong { color: var(--muted); font-size: 10px; letter-spacing: .1em; padding: 5px 10px 3px; text-transform: uppercase; }
.topbar-user { align-items: center; display: flex; flex: 0 0 auto; gap: 10px; }
.topbar .agent-chip { background: #315368; color: #eef8fa; }
.button-topbar { background: transparent; border: 1px solid #668392; color: #fff; font-size: 12px; padding: 7px 10px; }
.button-topbar:hover { background: #315368; }
.page-shell { max-width: 1220px; margin: 0 auto; padding: 42px 28px 72px; }
.page-heading, .section-heading, .heading-actions, .message-meta { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.page-heading { margin-bottom: 28px; align-items: flex-start; }
.heading-actions { flex-wrap: wrap; }
.eyebrow, .section-label { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.section-label { margin-bottom: 14px; }
.muted { color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 22px; box-shadow: 0 2px 8px rgba(27, 52, 66, .04); }
.filter-bar { margin-bottom: 18px; }
.filter-accordion { background: rgba(255, 255, 255, .82); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 8px rgba(27, 52, 66, .04); }
.filter-accordion > summary { align-items: center; cursor: pointer; display: flex; gap: 12px; justify-content: space-between; list-style: none; padding: 14px 16px; }
.filter-accordion > summary::-webkit-details-marker { display: none; }
.filter-accordion > summary::after { color: var(--accent); content: "⌄"; font-size: 18px; line-height: 1; transition: transform .15s ease; }
.filter-accordion[open] > summary::after { transform: rotate(180deg); }
.filter-accordion-title { color: var(--ink); font-size: 14px; font-weight: 800; }
.filter-accordion-meta { color: var(--muted); font-size: 13px; }
.filter-form { align-items: stretch; border-top: 1px solid var(--line); display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(170px, 1fr)); padding: 14px 16px 16px; }
.filter-field { display: grid; gap: 4px; }
.filter-field-search { flex: 1 1 280px; }
.filter-field-search input { width: 100%; }
.filter-field-wide { min-width: 175px; }
.filter-field-wide select { min-width: 175px; }
.filter-dropdown { min-width: 0; position: relative; }
.filter-dropdown > summary { align-items: center; background: #fff; border: 1px solid #c9d5dc; border-radius: 6px; cursor: pointer; display: flex; gap: 8px; justify-content: space-between; list-style: none; min-height: 43px; padding: 9px 10px; }
.filter-dropdown > summary::-webkit-details-marker { display: none; }
.filter-dropdown > summary::after { color: var(--accent); content: "⌄"; font-size: 16px; line-height: 1; }
.filter-dropdown[open] > summary { border-color: var(--accent); border-bottom-left-radius: 0; border-bottom-right-radius: 0; outline: 2px solid rgba(23, 107, 135, .15); }
.filter-dropdown > summary span { color: var(--muted); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-dropdown > summary strong { color: var(--ink); font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-dropdown-menu { background: #fff; border: 1px solid var(--accent); border-top: 0; border-radius: 0 0 6px 6px; box-shadow: 0 10px 22px rgba(23, 33, 43, .14); display: grid; gap: 2px; left: 0; max-height: 240px; overflow-y: auto; padding: 7px; position: absolute; right: 0; top: 100%; z-index: 5; }
.checkbox-option { align-items: flex-start; border-radius: 5px; color: var(--ink); cursor: pointer; display: flex; font-size: 13px; font-weight: 500; gap: 8px; line-height: 1.3; padding: 8px; }
.checkbox-option:hover { background: #edf5f7; }
.checkbox-option input { flex: 0 0 auto; margin: 2px 0 0; padding: 0; }
.filter-dropdown-empty { display: block; padding: 8px; }
.filter-search-field { align-self: center; }
.filter-check-group { align-items: center; border: 1px solid var(--line); border-radius: 8px; display: flex; gap: 12px; margin: 0; padding: 8px 12px; }
.filter-check-group legend { color: var(--muted); float: left; font-size: 13px; font-weight: 700; margin-right: 3px; padding: 0; }
.advanced-search-dropdown { background: #f7fafb; border: 1px solid var(--line); border-radius: 8px; grid-column: 1 / -1; }
.advanced-search-dropdown > summary { color: var(--accent-dark); cursor: pointer; font-size: 13px; font-weight: 800; list-style: none; padding: 10px 12px; }
.advanced-search-dropdown > summary::-webkit-details-marker { display: none; }
.advanced-search-dropdown > summary::after { content: "⌄"; float: right; font-size: 16px; }
.advanced-search-dropdown[open] > summary { border-bottom: 1px solid var(--line); }
.advanced-search-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 14px; }
.advanced-search-section { min-width: 0; }
.advanced-search-section h3 { font-size: 13px; margin: 0 0 8px; }
.advanced-search-fields { display: grid; gap: 8px; }
.advanced-search-fields input, .advanced-search-fields select { min-width: 0; width: 100%; }
.advanced-check-group { border: 1px solid var(--line); border-radius: 7px; display: flex; flex-wrap: wrap; gap: 5px 10px; margin: 0; padding: 8px; }
.advanced-check-group legend { color: var(--muted); font-size: 12px; font-weight: 700; padding: 0 4px; width: 100%; }
.date-range-fields { display: grid; gap: 5px; }
.date-range-fields > label { color: var(--muted); font-size: 12px; font-weight: 700; }
.date-range-fields > div { align-items: center; display: flex; gap: 6px; }
.date-range-fields > div span { color: var(--muted); font-size: 12px; }
.date-range-fields input { min-width: 0; }
.ticket-search, .asset-search { min-width: 240px; }
.saved-filter-bar { align-items: center; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; margin: 0 0 18px; }
.saved-filter-list { align-items: center; display: flex; flex: 1 1 420px; flex-wrap: wrap; gap: 8px; }
.saved-filter-list .section-label { margin: 0 4px 0 0; }
.saved-filter-chip { align-items: center; background: #e2f0f4; border-radius: 999px; display: inline-flex; gap: 6px; padding: 5px 8px 5px 11px; }
.saved-filter-chip a { color: var(--accent-dark); font-size: 13px; font-weight: 700; text-decoration: none; }
.saved-filter-delete { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 17px; line-height: 1; padding: 0; }
.save-filter-form { align-items: center; display: flex; flex: 0 1 330px; gap: 8px; }
.save-filter-form input[type="text"] { min-width: 0; width: 100%; }
.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover { color: var(--accent); }
.visually-hidden { height: 1px; margin: -1px; overflow: hidden; position: absolute; width: 1px; clip: rect(0, 0, 0, 0); }
.form-help { color: var(--muted); font-size: 12px; margin: 0 0 4px; }
.asset-list { list-style: none; margin: 0; padding: 0; }
.asset-list li { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 12px; justify-content: space-between; padding: 10px 0; }
.asset-list li:last-child { border-bottom: 0; }
.asset-list li > div, .asset-list li > span { display: grid; gap: 2px; }
.asset-list .muted { font-size: 12px; }
.asset-category-nav { align-items: center; display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 18px; }
.asset-category-button { background: #e7eef1; border: 1px solid #d4e0e5; border-radius: 7px; color: var(--ink); display: inline-flex; font-size: 13px; font-weight: 700; min-height: 38px; align-items: center; padding: 8px 13px; text-decoration: none; transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease; }
.asset-category-button:hover { background: #dbeaf0; border-color: #b9d0d9; color: var(--accent-dark); transform: translateY(-1px); }
.asset-category-button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.asset-category-button.active:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.asset-attach-form { border-top: 1px solid var(--line); display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; }
.detail-list { display: grid; gap: 18px; }
.detail-list > div { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.detail-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.detail-list .section-label, .detail-list strong { display: block; }
.source-badge { border-radius: 999px; display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 9px; }
.source-mosyle { background: #e5f1ff; color: #175684; }
.source-snipe_it { background: #eee4f7; color: #69418a; }
.source-freshdesk { background: #fff1d2; color: #805a10; }
.source-nexus { background: #e3f2eb; color: #176044; }
.mosyle-device-panel { grid-column: 1 / -1; }
.mosyle-device-meta { margin: -8px 0 20px; }
.mosyle-device-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mosyle-device-group { background: var(--surface-muted, #f7f9fa); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.mosyle-device-group h3 { margin: 0 0 14px; }
.mosyle-facts { display: grid; gap: 10px; margin: 0; }
.mosyle-facts > div { border-bottom: 1px solid var(--line); display: grid; gap: 12px; grid-template-columns: minmax(110px, .7fr) minmax(0, 1.3fr); padding-bottom: 9px; }
.mosyle-facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.mosyle-facts dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.mosyle-facts dd { margin: 0; overflow-wrap: anywhere; }
.mosyle-facts .breakable { word-break: break-all; }
.bulk-toolbar { align-items: center; background: #f7fafb; border: 1px solid var(--line); border-radius: 8px; display: flex; gap: 16px; justify-content: space-between; margin-bottom: 16px; padding: 12px 14px; }
.bulk-controls { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.selection-cell { padding-left: 4px; padding-right: 4px; width: 34px; }
.selection-cell input { accent-color: var(--accent); }
.checkbox-field { align-items: center; display: inline-flex; gap: 7px; white-space: nowrap; }
.checkbox-field input { margin: 0; }
label { color: var(--muted); font-size: 13px; font-weight: 600; }
input, select, textarea { border: 1px solid #c9d5dc; border-radius: 6px; background: #fff; color: var(--ink); font: inherit; padding: 9px 10px; }
input::placeholder, textarea::placeholder { color: #b9c3c9; opacity: 1; }
.dashboard-grid { display: grid; gap: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.weekday-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.weekday-chip { border: 1px solid #cbd6dc; border-radius: 999px; background: #fff; color: #526579; padding: 5px 9px; cursor: pointer; }
.weekday-chip.selected { background: #176f8b; border-color: #176f8b; color: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid rgba(23, 107, 135, .15); }
.button { border: 0; border-radius: 6px; cursor: pointer; font: inherit; font-weight: 700; padding: 10px 15px; }
.button-primary { background: var(--accent); color: white; }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { background: #e7eef1; color: var(--ink); }
.agent-chip { background: #e2f0f4; border-radius: 999px; color: var(--accent-dark); padding: 7px 12px; font-size: 13px; font-weight: 700; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 14px 12px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.ticket-link { font-weight: 800; text-decoration: none; }
.subject { color: var(--muted); margin-top: 3px; }
.status { border-radius: 999px; display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 9px; text-transform: capitalize; }
.status-open { background: #e3f2eb; color: #176044; }
.status-urgent { background: #f3e3e3; color: #8b302b; }
.status-pending { background: #fff1d2; color: #805a10; }
.status-waiting_on_vendor, .status-waiting_on_customer_update, .status-waiting_on_other_department { background: #e4eef8; color: #275d89; }
.status-under_internal_review, .status-assigned_to_ai_agent { background: #eee4f7; color: #69418a; }
.status-resolved, .status-closed { background: #e8edf0; color: #596872; }
.status-running { background: #fff1d2; color: #805a10; }
.status-succeeded { background: #e3f2eb; color: #176044; }
.status-failed { background: #f3e3e3; color: #8b302b; }
.status-deleted { background: #f3e3e3; color: #8b302b; }
.embedded-widget { background: #f5f8f8; color: #182530; font-family: inherit; margin: 0 auto; max-width: 760px; min-height: 100vh; padding: 24px; }
.embedded-widget-header { background: #075f3b; color: #fff; margin: -24px -24px 24px; padding: 28px 24px; }
.embedded-widget-header h1 { color: #fff; margin: 5px 0; }
.embedded-widget-header p { margin: 0; opacity: .88; }
.widget-instructions { background: #edf7f1; border-left: 4px solid #16845b; border-radius: 6px; color: #305546; padding: 10px 12px; }
.status-service-list { display: grid; gap: 10px; }
.status-service-row { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 14px; justify-content: space-between; padding: 12px 0; }
.status-service-row:last-child { border-bottom: 0; }
.status-operational { background: #e3f2eb; color: #176044; }
.status-degraded_performance, .status-partial_outage { background: #fff1d2; color: #805a10; }
.status-major_outage { background: #f3e3e3; color: #8b302b; }
.status-subscribe-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.status-subscribe-grid label { align-items: center; display: flex; gap: 7px; }
.status-spam { background: #eee4f7; color: #69418a; }
.ticket-statuses { align-items: center; display: flex; flex-wrap: wrap; gap: 6px; }
.ticket-queue-update, .ticket-viewer-presence { align-items: center; border: 1px solid #b8dce6; border-radius: 10px; color: #164d60; display: flex; flex-wrap: wrap; gap: 10px; margin: -10px 0 22px; padding: 11px 14px; }
.ticket-queue-update { background: #e8f5f8; justify-content: space-between; }
.conversation-live-feedback { margin: 0 0 14px; }
.ticket-viewer-presence { background: #f1f8fa; font-size: 13px; margin: -12px 0 18px; }
.ticket-viewer-presence-icon { color: var(--accent); font-size: 17px; }
.ticket-queue-update[hidden], .ticket-viewer-presence[hidden] { display: none; }
.empty-state { color: var(--muted); padding: 32px; text-align: center; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.summary-card { display: flex; flex-direction: column; gap: 6px; }
.summary-card strong { font-size: 20px; }
.provider-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.provider-section > h2, .provider-note h2 { font-size: 22px; margin: 0 0 14px; }
.provider-section { margin-top: 22px; }
.provider-card { display: flex; flex-direction: column; min-height: 240px; }
.provider-heading { align-items: center; display: flex; gap: 14px; }
.provider-heading .section-label { margin-bottom: 5px; }
.provider-heading h3 { font-size: 20px; margin: 0; }
.provider-mark { align-items: center; background: #e2f0f4; border-radius: 12px; color: var(--accent-dark); display: flex; flex: 0 0 58px; font-size: 16px; font-weight: 800; height: 58px; justify-content: center; letter-spacing: .04em; }
.provider-coverage { font-weight: 700; margin: 24px 0 4px; }
.provider-card .button { align-self: flex-start; margin-top: auto; }
.provider-note { margin-top: 18px; }
.knowledge-search-card { margin-bottom: 22px; }
.knowledge-chat-layout { align-items: start; display: grid; gap: 18px; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); }
.knowledge-chat-sidebar { position: sticky; top: 18px; }
.knowledge-new-chat { margin: 0 0 12px; width: 100%; }
.knowledge-chat-list { display: grid; gap: 6px; }
.knowledge-chat-row { align-items: stretch; display: flex; gap: 4px; }
.knowledge-chat-list a { border-radius: 7px; color: var(--ink); display: grid; gap: 4px; padding: 10px; text-decoration: none; }
.knowledge-chat-list a:hover, .knowledge-chat-list a.active { background: #e7f0f3; color: var(--accent-dark); }
.knowledge-chat-row > a { flex: 1 1 auto; min-width: 0; }
.knowledge-chat-list a span { color: var(--muted); font-size: 12px; }
.knowledge-chat-delete { align-self: center; background: transparent; border: 0; color: var(--muted); cursor: pointer; flex: 0 0 auto; font: inherit; font-size: 12px; padding: 7px; }
.knowledge-chat-delete:hover { color: #a83232; }
.knowledge-chat-pagination { align-items: center; display: flex; flex-wrap: wrap; gap: 7px; justify-content: space-between; margin-top: 12px; }
.knowledge-chat-main { display: grid; gap: 16px; min-height: 420px; position: relative; }
.knowledge-chat-transcript { display: grid; gap: 12px; }
.knowledge-chat-message { border: 1px solid var(--line); border-radius: 9px; padding: 13px 15px; }
.knowledge-chat-message-user { background: #f3f8fa; margin-left: 8%; }
.knowledge-chat-message-assistant { margin-right: 8%; }
.knowledge-chat-message > div > p:last-child { margin-bottom: 0; }
.knowledge-chat-empty { align-self: center; color: var(--muted); justify-self: center; max-width: 440px; text-align: center; }
.knowledge-chat-main .knowledge-search-form { border-top: 1px solid var(--line); padding-top: 14px; }
.knowledge-chat-main .knowledge-search-popover { bottom: 80px; left: 50%; top: auto; }
.knowledge-search-form { display: grid; gap: 8px; }
.knowledge-search-row { align-items: center; display: flex; gap: 10px; }
.knowledge-search-row input[type="search"] { flex: 1; min-width: 0; }
.knowledge-search-card { position: relative; }
.knowledge-search-popover { align-items: center; background: #203647; border-radius: 8px; box-shadow: 0 12px 28px rgba(23, 33, 43, .2); color: #fff; display: inline-flex; gap: 9px; left: 50%; padding: 10px 14px; position: absolute; top: 50%; transform: translate(-50%, -50%); z-index: 2; }
.knowledge-search-popover[hidden] { display: none; }
.knowledge-search-spinner { animation: knowledge-search-spin .8s linear infinite; border: 2px solid rgba(255, 255, 255, .35); border-radius: 50%; border-top-color: #fff; display: inline-block; height: 15px; width: 15px; }
@keyframes knowledge-search-spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) { .knowledge-chat-layout { grid-template-columns: 1fr; } .knowledge-chat-sidebar { position: static; } .knowledge-chat-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.trainual-search-results { max-width: 900px; }
.sync-detail-grid { align-items: start; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sync-error-list { list-style: none; margin: 0; padding: 0; }
.sync-error-list li { border-bottom: 1px solid var(--line); padding: 12px 0; }
.sync-error-list li:first-child { padding-top: 0; }
.sync-error-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.sync-error-list strong, .sync-error-list span { display: block; }
.sync-error-list span { color: var(--muted); font-size: 13px; margin-top: 3px; }
.sync-error-list p { margin: 8px 0 0; overflow-wrap: anywhere; }
.ticket-layout { align-items: start; display: grid; grid-template-columns: minmax(200px, 240px) minmax(0, 1fr) 310px; gap: 22px; }
.ticket-layout > * { min-width: 0; }
.ticket-sidebar-disclosure > summary { list-style: none; cursor: pointer; }
.ticket-sidebar-disclosure > summary::-webkit-details-marker { display: none; }
.equipment-disclosure-arrow { border-bottom: 2px solid var(--muted); border-right: 2px solid var(--muted); height: 8px; margin-left: 4px; transform: rotate(-45deg); transition: transform .15s ease; width: 8px; }
.equipment-disclosure-heading[aria-expanded="true"] .equipment-disclosure-arrow { transform: rotate(45deg); }
.ticket-tag-picker { display: grid; gap: 8px; position: relative; }
.ticket-tag-selected { display: flex; flex-wrap: wrap; gap: 6px; }
.ticket-tag-chip { background: #e7f0f3; border-radius: 999px; color: var(--accent-dark); font-size: 12px; padding: 4px 9px; }
.ticket-tag-options { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 22px rgba(24, 50, 64, .12); max-height: 220px; overflow-y: auto; padding: 6px; position: absolute; top: 100%; width: 100%; z-index: 8; }
.ticket-tag-options[hidden] { display: none; }
.ticket-tag-option { align-items: center; border-radius: 5px; display: flex; gap: 8px; padding: 7px; }
.ticket-tag-option:hover { background: #f1f6f8; }
.disclosure-heading { align-items: center; display: flex; gap: 10px; justify-content: space-between; }
.disclosure-heading h2 { margin: 0; }
.ticket-knowledge-rail { min-width: 0; position: sticky; top: 18px; }
.ticket-knowledge-rail .knowledge-disclosure,
.ticket-knowledge-rail .knowledge-disclosure-body,
.ticket-knowledge-rail .trainual-match-list,
.ticket-knowledge-rail .trainual-match-list li,
.ticket-knowledge-rail .trainual-match-list li > div:first-child { max-width: 100%; min-width: 0; }
.ticket-knowledge-rail .trainual-match-list li { grid-template-columns: minmax(0, 1fr); }
.ticket-knowledge-rail .trainual-match-list li > div:first-child,
.ticket-knowledge-rail .trainual-match-list li strong,
.ticket-knowledge-rail .trainual-match-list li span,
.ticket-knowledge-rail .trainual-match-list li p { overflow-wrap: anywhere; word-break: break-word; }
.ticket-knowledge-rail .trainual-match-actions { max-width: 100%; min-width: 0; }
.ticket-knowledge-rail .trainual-panel { border-left: 4px solid #6f8ed6; padding: 18px; }
.knowledge-disclosure > summary::-webkit-details-marker { display: none; }
.knowledge-disclosure-summary { align-items: center; cursor: pointer; display: flex; gap: 12px; justify-content: space-between; list-style: none; }
.knowledge-disclosure-summary .section-label { margin-bottom: 8px; }
.knowledge-disclosure-toggle { color: var(--accent); font-size: 20px; line-height: 1; transition: transform .15s ease; }
.knowledge-disclosure[open] .knowledge-disclosure-toggle { transform: rotate(180deg); }
.knowledge-disclosure-body { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 14px; }
.ticket-knowledge-rail .section-heading { align-items: flex-start; display: block; }
.ticket-knowledge-rail .section-heading .button { margin-top: 10px; }
.ticket-knowledge-rail .trainual-check-meta { align-items: flex-start; display: grid; }
.ticket-knowledge-rail .trainual-match-list li { display: grid; }
.ticket-knowledge-rail .trainual-match-actions { align-items: flex-start; text-align: left; }
.ticket-knowledge-rail .trainual-match-list li > div:first-child { grid-column: 1; grid-row: 2; width: 100%; }
.ticket-knowledge-rail .trainual-match-list li > .trainual-match-actions { align-items: flex-start; flex-direction: row; flex-wrap: wrap; grid-column: 1; grid-row: 1; justify-content: flex-start; text-align: left; width: 100%; }
.ticket-knowledge-rail .historical-panel { border-left: 4px solid #4a9b88; }
.ticket-knowledge-rail .historical-match-list li { display: grid; }
.ticket-knowledge-rail .historical-match-list p { margin: 7px 0 0; }
.ticket-description { margin-bottom: 24px; }
.conversation { margin-bottom: 24px; }
.ticket-message-history { margin-bottom: 16px; }
.ticket-message-history > summary { background: #f7fafb; border: 1px solid var(--line); border-radius: 8px; color: var(--accent-dark); cursor: pointer; font-size: 13px; font-weight: 700; list-style-position: inside; padding: 11px 14px; }
.ticket-message-history[open] > summary { border-radius: 8px 8px 0 0; }
.ticket-message-history-list { border-left: 3px solid var(--line); padding: 14px 0 1px 14px; }
.trainual-matches { margin-bottom: 24px; }
.trainual-check-meta { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.trainual-answer { background: #f7fafb; border: 1px solid var(--line); border-radius: 7px; padding: 12px 14px; }
.trainual-answer p:last-child { margin-bottom: 0; }
.trainual-match-list { list-style: none; margin: 14px 0 0; padding: 0; }
.trainual-match-list li { align-items: flex-start; border-top: 1px solid var(--line); display: flex; gap: 12px; justify-content: space-between; padding: 12px 0; }
.trainual-match-list li strong, .trainual-match-list li span { display: block; }
.trainual-match-actions { align-items: flex-end; display: flex; flex-direction: column; gap: 5px; text-align: right; }
.section-heading { margin-bottom: 12px; }
.ops-subnav { align-items: center; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 22px; padding-bottom: 8px; }
.ops-subnav a { border-radius: 6px; color: var(--muted); font-size: 13px; font-weight: 700; padding: 8px 11px; text-decoration: none; }
.ops-subnav a:hover, .ops-subnav a.active { background: #e7f0f3; color: var(--accent-dark); }
.compact-list, .report-list { list-style: none; margin: 0; padding: 0; }
.compact-list li { font-size: 13px; padding: 2px 0; }
.low-stock { color: #9b3f31; }
.report-list li { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 9px 0; }
.report-list li:last-child { border-bottom: 0; }
.inline-form { align-items: center; display: flex; flex-wrap: wrap; gap: 6px; }
.inline-form select, .inline-form input { padding: 6px 8px; }
.asset-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 22px; }
.token-value { font-size: 12px !important; overflow-wrap: anywhere; }
.asset-quick-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; margin-top: 10px; max-width: 760px; }
.asset-quick-actions .button { font-size: 12px; padding: 8px 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.message { margin-bottom: 16px; }
.message-internal_note { background: var(--note); border-color: #f1dfad; }
.message-agent { border-left: 4px solid #4388a0; }
.message-requester { border-left: 4px solid #e0b84f; }
.message-participant { border-left: 4px solid #9aabb5; }
.message-heading { align-items: center; display: flex; gap: 10px; margin-bottom: 12px; }
.message-avatar { align-items: center; background: #e4eef2; border-radius: 50%; color: var(--accent-dark); display: inline-flex; flex: 0 0 34px; font-size: 12px; font-weight: 800; height: 34px; justify-content: center; }
.message-requester .message-avatar { background: #fff0ad; color: #80610d; }
.message-meta { color: var(--muted); display: grid; font-size: 12px; gap: 2px; }
.message-meta strong { color: var(--ink); font-size: 14px; }
.message-role { color: var(--muted); display: block; font-size: 12px; }
.message-body { min-width: 0; }
.message-recipient-line { color: var(--muted); font-size: 13px; margin: -3px 0 12px 44px; overflow-wrap: anywhere; }
.message-quoted-history { border-left: 3px solid var(--line); color: var(--muted); margin-top: 14px; padding: 0 0 0 13px; }
.message-quoted-history > summary { cursor: pointer; font-size: 13px; font-weight: 700; }
.message-quoted-history .message-body { margin-top: 10px; }
.composer-mode-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.composer-kind-select { position: absolute; height: 1px; overflow: hidden; width: 1px; clip: rect(0 0 0 0); }
.agent-threads { background: #f8fbfc; }
.service-dashboard-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; }
.service-dashboard-refresh-setting { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.thread-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; padding: 14px; }
.thread-heading { align-items: flex-start; display: flex; gap: 12px; justify-content: space-between; }
.thread-heading strong, .thread-heading span { display: block; }
.thread-message { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.thread-message p { margin-bottom: 6px; }
.thread-reply-form, .thread-new-form { display: flex; gap: 8px; margin-top: 12px; }
.thread-new-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.thread-new-form textarea { grid-column: 1 / -1; }
.thread-reply-form textarea, .thread-new-form input[type="text"] { flex: 1; min-width: 0; }
.relationship-list { list-style: none; margin: 0 0 16px; padding: 0; }
.relationship-list li { border-bottom: 1px solid var(--line); padding: 8px 0; }
.relationship-list li:last-child { border-bottom: 0; }
.relationship-kind { background: #e4eef2; border-radius: 999px; color: var(--accent-dark); display: inline-block; font-size: 11px; font-weight: 700; margin-right: 7px; padding: 3px 7px; }
.relationship-actions { border-top: 1px solid var(--line); display: grid; gap: 12px; padding-top: 14px; }
.relationship-form { display: grid; gap: 7px; }
.attachments { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.asset-image { display: block; max-height: 220px; max-width: 100%; object-fit: contain; }
.attachment-list { list-style: none; margin: 0; padding: 0; }
.attachment-list li { align-items: center; display: flex; gap: 8px; justify-content: space-between; padding: 5px 0; }
.attachment-image-link { align-items: flex-start; display: inline-flex; flex-direction: column; gap: 6px; min-width: 0; }
.attachment-image-preview { background: #f5f8f9; border: 1px solid var(--line); border-radius: 8px; display: block; max-height: 360px; max-width: min(100%, 560px); object-fit: contain; }
.stacked-form { display: grid; gap: 8px; }
.stacked-form .button { justify-self: start; margin-top: 5px; }
.sidebar-stack { display: grid; align-content: start; gap: 22px; }
.admin-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px; }
.group-description { color: var(--muted); font-size: 13px; margin-top: 6px; max-width: 440px; }
.action-cell { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; }
.action-cell .button { white-space: nowrap; }
.ticket-actions { border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; }
.agent-group-form { display: grid; gap: 10px; }
.group-checkboxes { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.checkbox-stack { background: #f7fafb; border: 1px solid var(--line); border-radius: 7px; display: grid; gap: 1px; max-height: 180px; overflow-y: auto; padding: 4px; }
.button-small { font-size: 12px; padding: 6px 9px; }
.button-danger { background: #f3e3e3; color: #8b302b; }
.button-danger:hover { background: #e8c9c7; }
.list-toolbar { align-items: center; display: flex; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.list-toolbar .muted { font-size: 13px; }
.pagination-bar { align-items: center; border-top: 1px solid var(--line); display: flex; gap: 16px; justify-content: space-between; margin-top: 14px; padding-top: 14px; }
.pagination-controls { align-items: center; display: flex; gap: 8px; }
.pagination-size { align-items: center; display: inline-flex; gap: 6px; }
.pagination-size select { padding: 5px 8px; }
.pagination-page { color: var(--muted); font-size: 13px; }
.modal { background: var(--panel); border: 0; border-radius: 12px; box-shadow: 0 20px 70px rgba(23, 33, 43, .28); max-height: min(90vh, 780px); max-width: min(620px, calc(100vw - 32px)); padding: 0; width: 100%; }
.modal::backdrop { background: rgba(23, 33, 43, .48); }
.modal-content { max-height: min(90vh, 780px); overflow-y: auto; padding: 26px; }
.modal-header { align-items: flex-start; display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.modal-header h2 { margin: 0; }
.modal-close { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 24px; line-height: 1; padding: 0 4px; }
.modal .stacked-form { gap: 9px; }
.narrow-card { max-width: 560px; }
.sms-inbox-layout { display: grid; grid-template-columns: minmax(270px, 340px) minmax(0, 1fr); gap: 18px; min-height: 620px; }
.sms-conversation-sidebar { min-width: 0; padding: 0; }
.sms-sidebar-heading { align-items: flex-start; border-bottom: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; padding: 18px; }
.sms-sidebar-heading strong, .sms-sidebar-heading span { display: block; }
.sms-sidebar-heading .muted { font-size: 12px; margin-top: 3px; }
.sms-conversation-sidebar .sms-search-form { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; margin: 0; padding: 12px; }
.sms-conversation-sidebar .sms-search-form input[type="search"] { flex-basis: 100%; }
.sms-conversation-sidebar .sms-search-form .button { padding: 7px 10px; }
.sms-conversation-list { display: grid; gap: 0; max-height: 610px; overflow-y: auto; }
.sms-conversation-row { align-items: center; border-bottom: 1px solid var(--line); color: var(--ink); display: flex; gap: 11px; min-width: 0; padding: 13px 14px; text-decoration: none; }
.sms-conversation-row:hover { background: #f5fafb; }
.sms-conversation-row.active { background: #e4f1f5; box-shadow: inset 3px 0 0 var(--accent); }
.sms-contact-avatar { align-items: center; background: linear-gradient(145deg, #d8edf2, #9cc8d4); border-radius: 50%; color: var(--accent-dark); display: inline-flex; flex: 0 0 38px; font-size: 12px; font-weight: 800; height: 38px; justify-content: center; letter-spacing: .03em; width: 38px; }
.sms-conversation-row-content { display: grid; gap: 2px; min-width: 0; width: 100%; }
.sms-conversation-row-topline { align-items: center; display: flex; gap: 8px; justify-content: space-between; }
.sms-conversation-row-topline strong, .sms-conversation-row-topline time { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sms-conversation-row-topline strong { font-size: 13px; }
.sms-conversation-row-topline time { color: var(--muted); flex: 0 0 auto; font-size: 11px; }
.sms-conversation-row-preview, .sms-conversation-row-meta { color: var(--muted); display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sms-conversation-row-meta { align-items: center; display: flex; gap: 6px; }
.sms-row-unclaimed { color: #8b302b; font-size: 11px; font-weight: 700; }
.sms-inbox-detail { min-width: 0; padding: 0; }
.sms-inbox-detail > .sms-conversation { border: 0; border-radius: 10px; min-height: 100%; }
.sms-contact-heading { align-items: center; display: flex; gap: 10px; }
.sms-contact-heading .sms-contact-avatar { flex-basis: 42px; height: 42px; width: 42px; }
.sms-contact-heading > div { min-width: 0; }
.sms-contact-editor { position: relative; }
.sms-contact-editor summary { cursor: pointer; list-style: none; }
.sms-contact-editor summary::-webkit-details-marker { display: none; }
.sms-phone-link { color: var(--accent-dark); text-decoration: underline; }
.sms-contact-editor-popover { background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 12px 30px rgba(23, 33, 43, .16); display: grid; gap: 9px; left: 0; min-width: 280px; padding: 13px; position: absolute; top: 100%; z-index: 6; }
.sms-contact-editor-popover .stacked-form { gap: 6px; }
.sms-contact-heading strong, .sms-contact-heading span { display: block; }
.sms-conversation { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sms-conversation-heading { align-items: flex-start; background: #f7fafb; display: flex; gap: 12px; justify-content: space-between; padding: 13px 15px; }
.sms-conversation-heading strong, .sms-conversation-heading span { display: block; }
.sms-conversation-meta { align-items: flex-end; display: flex; flex-direction: column; gap: 6px; }
.inline-form { display: inline-flex; margin: 0; }
.sms-svo-match { color: #176044; font-size: 11px; font-weight: 700; margin-top: 4px; }
.sms-thread-meta { color: var(--accent-dark); display: block; font-size: 11px; font-weight: 700; margin-top: 4px; }
.sms-message-history { display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.sms-bubble { border-radius: 14px; max-width: 88%; padding: 10px 13px; }
.sms-bubble-inbound { align-self: flex-start; background: #eef3f5; }
.sms-bubble-outbound { align-self: flex-end; background: #dff2e9; }
.sms-bubble-body { white-space: pre-wrap; }
.sms-bubble-body p { margin: 0; }
.sms-bubble-time { color: var(--muted); display: block; font-size: 11px; margin-top: 5px; }
.sms-bubble-footer { align-items: center; display: flex; flex-wrap: wrap; gap: 7px; justify-content: space-between; }
.sms-bubble-footer .sms-bubble-time { flex: 1 1 auto; }
.sms-ticket-link { font-size: 11px; font-weight: 700; }
.sms-media-preview { border-radius: 8px; display: block; margin-top: 8px; max-height: 220px; max-width: 100%; object-fit: contain; }
.media-request-card { align-items: center; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
.sms-media-preview video { height: auto; }
.sms-media-link { display: block; font-size: 12px; margin-top: 7px; }
.sms-media-link .sms-media-preview { margin-top: 0; }
.sms-search-form { align-items: center; background: #f7fafb; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; padding: 10px; }
.sms-search-form input[type="search"] { flex: 1 1 280px; min-width: 0; }
.sms-item { border: 1px solid var(--line); border-radius: 9px; padding: 16px; }
.sms-item-unclaimed { border-color: #e4b4ae; box-shadow: 0 0 0 2px rgba(227, 107, 93, .08); }
.sms-item-heading { align-items: flex-start; display: flex; gap: 14px; justify-content: space-between; }
.sms-item-heading strong, .sms-item-heading span { display: block; }
.sms-body { margin: 12px 0; white-space: pre-wrap; }
.sms-actions { align-items: flex-start; display: flex; flex-wrap: wrap; gap: 8px; }
.sms-ticket-form { flex: 1 1 100%; margin-top: 6px; }
.sms-ticket-form > summary { display: inline-block; list-style: none; }
.sms-ticket-form > summary::-webkit-details-marker { display: none; }
.sms-ticket-form[open] > summary { display: none; }
.sms-ticket-form .stacked-form { background: #f7fafb; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; padding: 14px; }
.sms-conversation-actions { border-top: 1px solid var(--line); display: grid; gap: 9px; padding: 12px 14px; }
.sms-reply-form { display: grid; gap: 8px; }
.sms-reply-form textarea { min-height: 56px; }
.sms-reply-toolbar { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.sms-reply-toolbar input[type="file"] { max-width: 220px; }
.sms-ticket-conversation { padding: 18px; }
.sms-ticket-conversation .sms-message-history { padding: 0; margin: 12px 0 16px; }
.form-errors { background: #fde8e7; border-radius: 6px; color: #8b302b; padding: 10px; }
.audit-list { list-style: none; margin: 0; padding: 0; }
.audit-list li { border-bottom: 1px solid var(--line); padding: 10px 0; }
.audit-list li:last-child { border-bottom: 0; }
.audit-list strong, .audit-list span { display: block; }
.audit-list span { color: var(--muted); font-size: 12px; }
.back-link { margin-bottom: 22px; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin: 12vh auto; max-width: 430px; padding: 38px; box-shadow: 0 8px 32px rgba(27, 52, 66, .08); }
.auth-card h1 { margin-top: 8px; }
.flash-region { left: 0; pointer-events: none; position: fixed; right: 0; top: 0; z-index: 20; }
.authenticated .flash-region { top: calc(64px + env(safe-area-inset-top)); }
.flash { align-items: center; display: flex; gap: 12px; justify-content: center; margin: 12px auto; max-width: 760px; padding: 11px 12px 11px 16px; border-radius: 6px; background: #e3f2eb; color: #176044; pointer-events: auto; text-align: center; transition: opacity .18s ease, transform .18s ease; }
.flash-alert { background: #fde8e7; color: #8b302b; }
.flash-dismiss { background: transparent; border: 0; color: currentColor; cursor: pointer; font-size: 20px; line-height: 1; margin-left: auto; opacity: .7; padding: 0 2px; }
.flash-dismiss:hover { opacity: 1; }
.flash-dismissed { opacity: 0; transform: translateY(-5px); }
@media (max-width: 900px) {
  .topbar-inner { align-items: flex-start; flex-wrap: wrap; padding-bottom: 10px; padding-top: 10px; }
  .top-nav { flex-basis: 100%; justify-content: flex-start; order: 3; overflow-x: auto; }
  .topbar-user { margin-left: auto; }
}
@media (max-width: 1050px) { .ticket-layout { grid-template-columns: minmax(0, 1fr) 310px; } .ticket-knowledge-rail { grid-column: 1 / -1; position: static; } }
@media (max-width: 800px) { .ticket-layout, .admin-layout, .sync-detail-grid, .sms-inbox-layout { grid-template-columns: 1fr; } .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .page-heading { display: block; } .heading-actions { margin-top: 18px; } .table-card { overflow-x: auto; } table { min-width: 700px; } .thread-reply-form, .thread-new-form { align-items: stretch; flex-direction: column; } .pagination-bar { align-items: flex-start; flex-direction: column; } }
@media (max-width: 800px) { .asset-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 800px) { .asset-quick-actions { justify-content: flex-start; } }
@media (max-width: 760px) { .mosyle-device-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .filter-form { grid-template-columns: 1fr; } .filter-accordion > summary { align-items: flex-start; flex-direction: column; gap: 4px; } .filter-accordion-meta { padding-right: 22px; } .filter-check-group { justify-content: flex-start; } .filter-search-field .ticket-search { min-width: 0; width: 100%; } }
@media (max-width: 560px) { .summary-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .topbar-inner { align-items: center; display: grid; gap: 9px 12px; grid-template-columns: auto 1fr auto; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); }
  .topbar-user { grid-column: 3; grid-row: 1; }
  .nav-toggle { grid-column: 2; grid-row: 1; }
  .brand small { display: none; }
  .nav-toggle { display: inline-flex; }
  .top-nav { align-items: stretch; display: none; flex-direction: column; gap: 3px; grid-column: 1 / -1; overflow: visible; padding: 4px 0 2px; width: 100%; }
  .topbar.nav-open .top-nav { display: flex; }
  .top-nav > a, .nav-menu summary { width: 100%; }
  .nav-menu .nav-dropdown { background: transparent; border: 0; box-shadow: none; min-width: 0; padding: 2px 0 5px 14px; position: static; }
  .nav-menu .nav-dropdown a { color: #d7e5ea; }
  .nav-menu .nav-dropdown a:hover, .nav-menu .nav-dropdown a.active { background: #315368; color: #fff; }
  .nav-overflow-menu .nav-overflow-dropdown { max-height: none; min-width: 0; }
  .nav-overflow-menu .hamburger-mark { display: none; }
  .nav-overflow-menu > summary .visually-hidden { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; }
  .nav-overflow-menu > summary .visually-hidden::after { color: #9fb8c3; content: "⌄"; margin-left: 5px; }
  .topbar-user { justify-content: flex-end; margin-left: 0; }
  .topbar-user .agent-chip { max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-shell { padding: 28px max(16px, env(safe-area-inset-right)) max(52px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  h1 { font-size: 26px; }
  .page-heading { margin-bottom: 20px; }
  .card { padding: 16px; }
  .list-toolbar, .sms-conversation-heading { align-items: flex-start; flex-direction: column; }
  .sms-conversation-meta { align-items: center; flex-direction: row; flex-wrap: wrap; }
  .sms-bubble { max-width: 96%; }
  .sms-reply-toolbar { align-items: stretch; flex-direction: column; }
  .sms-reply-toolbar input[type="file"] { max-width: 100%; width: 100%; }
  .sms-search-form { align-items: stretch; flex-direction: column; }
  .sms-search-form input[type="search"], .sms-search-form .button { width: 100%; }
  .sms-search-form .checkbox-field { padding: 3px 0; }
  .sms-conversation-list { max-height: 320px; }
  .sms-inbox-detail { min-height: 520px; }
  .action-cell { align-items: stretch; flex-direction: column; }
  .action-cell .button { width: 100%; }
}

/* If the full navigation no longer fits, the same hamburger interaction used on phones is activated. */
.topbar.nav-overflow .topbar-inner { align-items: center; flex-wrap: wrap; padding-bottom: 10px; padding-top: 10px; }
.topbar.nav-overflow .nav-toggle { display: inline-flex; margin-left: auto; }
.topbar.nav-overflow .top-nav { align-items: stretch; display: none; flex-basis: 100%; flex-direction: column; gap: 3px; order: 4; overflow: visible; padding: 4px 0 2px; width: 100%; }
.topbar.nav-overflow.nav-open .top-nav { display: flex; }
.topbar.nav-overflow .top-nav > a, .topbar.nav-overflow .nav-menu summary { width: 100%; }
.topbar.nav-overflow .nav-menu .nav-dropdown { background: transparent; border: 0; box-shadow: none; min-width: 0; padding: 2px 0 5px 14px; position: static; }
.topbar.nav-overflow .nav-menu .nav-dropdown a { color: #d7e5ea; }
.topbar.nav-overflow .nav-menu .nav-dropdown a:hover, .topbar.nav-overflow .nav-menu .nav-dropdown a.active { background: #315368; color: #fff; }
.topbar.nav-overflow .topbar-user { margin-left: 0; order: 3; }
@media (max-width: 700px) { .advanced-search-grid { grid-template-columns: 1fr; } }

.service-dashboard-header { align-items: flex-start; }
.service-dashboard-toolbar { align-items: center; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin: 0 0 18px; }
.service-dashboard-count { color: var(--muted); font-size: 13px; font-weight: 700; }
.service-dashboard-config { margin-bottom: 22px; }
.service-dashboard-config > summary { align-items: center; color: var(--accent-dark); cursor: pointer; display: flex; font-weight: 800; gap: 8px; list-style: none; }
.service-dashboard-config > summary::-webkit-details-marker { display: none; }
.service-dashboard-config > summary::after { content: "⌄"; font-size: 18px; margin-left: auto; }
.service-dashboard-config[open] > summary::after { transform: rotate(180deg); }
.service-dashboard-config-body { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.service-source-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.service-source-option { border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 10px; padding: 12px; }
.service-source-option:has(.service-dashboard-source-check:checked) { background: #edf7f9; border-color: var(--accent); }
.service-source-choice { align-items: flex-start; cursor: pointer; display: flex; gap: 10px; }
.service-source-choice input { flex: 0 0 auto; margin-top: 4px; }
.service-source-option strong, .service-source-option small { display: block; }
.service-source-option small { color: var(--muted); font-size: 12px; margin-top: 3px; }
.service-target-picker { border-top: 1px solid var(--line); padding-top: 8px; }
.service-target-picker summary { color: var(--accent-dark); cursor: pointer; font-size: 12px; font-weight: 700; }
.service-target-picker-options { display: grid; gap: 5px; margin-top: 8px; max-height: 180px; overflow-y: auto; }
.service-target-picker-options label { align-items: flex-start; display: flex; font-size: 12px; gap: 7px; }
.service-target-picker-options input { margin: 2px 0 0; }
.service-dashboard-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.service-dashboard-card h2 { font-size: 15px; margin: 0; }
.service-dashboard-card-head { align-items: flex-start; display: flex; gap: 12px; justify-content: space-between; }
.service-dashboard-source { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.service-dashboard-live-data { background: #f7fafb; border-radius: 7px; margin-top: 16px; min-height: 105px; padding: 16px; }
.service-dashboard-value { align-items: baseline; display: flex; flex-wrap: wrap; gap: 8px; }
.service-dashboard-value strong { color: var(--ink); font-size: 27px; }
.service-dashboard-value span, .service-dashboard-detail { color: var(--muted); }
.service-dashboard-data-message { color: var(--muted); margin: 8px 0; }
.service-dashboard-comparison { display: grid; gap: 10px; }
.service-dashboard-comparison-item { align-items: baseline; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: space-between; padding-bottom: 8px; }
.service-dashboard-comparison-item:last-child { border-bottom: 0; padding-bottom: 0; }
.service-dashboard-comparison-item span { color: var(--muted); }
.service-dashboard-comparison-item strong { color: var(--ink); }
.service-dashboard-target-values { display: grid; gap: 12px; }
.service-dashboard-target-value { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.service-dashboard-target-value:last-child { border-bottom: 0; padding-bottom: 0; }
.service-dashboard-target-label { color: var(--accent-dark); display: block; font-size: 13px; margin-bottom: 6px; overflow-wrap: anywhere; }
.service-dashboard-log-tail { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; list-style: none; margin: 0 0 12px; max-height: 220px; overflow: auto; padding: 0; }
.service-dashboard-log-tail li { border-bottom: 1px solid var(--line); overflow-wrap: anywhere; padding: 8px 0; }
.service-dashboard-log-tail li:last-child { border-bottom: 0; }
@media (max-width: 900px) { .service-source-grid, .service-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .service-source-grid, .service-dashboard-grid { grid-template-columns: 1fr; } }

.push-notifications-card { max-width: 860px; }
.push-notifications-card .section-heading { align-items: flex-start; }
.push-notifications-card .section-heading h2 { margin-bottom: 5px; }
.push-notifications-card .section-heading p { margin: 0; max-width: 620px; }
.push-notification-actions { align-items: center; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding-top: 18px; }
.push-notification-actions [data-push-message] { flex: 1 1 260px; }
.push-message-error { color: #8b302b; }
.push-notification-preferences { border-top: 1px solid var(--line); display: grid; gap: 9px; margin-top: 22px; padding-top: 18px; }
.push-notification-preferences h3, .push-install-help h3 { font-size: 15px; margin: 0 0 4px; }
.push-install-help { background: #f7fafb; border: 1px solid var(--line); border-radius: 8px; margin-top: 22px; padding: 14px; }
.push-install-help p { margin: 0; }
.notification-center-card { margin-top: 18px; max-width: 860px; }
.notification-feed { border-top: 1px solid var(--line); margin-top: 18px; }
.notification-item { border-bottom: 1px solid var(--line); padding: 14px 0; }
.notification-item:last-child { border-bottom: 0; }
.notification-item-heading { align-items: baseline; display: flex; gap: 12px; justify-content: space-between; }
.notification-item-heading time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.notification-item p { margin: 6px 0 10px; }
.notification-item-actions { align-items: center; display: flex; gap: 10px; }
.notification-unread { border-left: 4px solid var(--accent); padding-left: 12px; }
.business-hours-fieldset { border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 8px; margin: 10px 0; padding: 12px; }
.business-hours-fieldset legend { font-weight: 700; padding: 0 5px; }
.business-hours-row { align-items: center; display: grid; gap: 8px; grid-template-columns: minmax(130px, 1fr) auto auto auto; }
.business-hours-row input[type="time"] { min-width: 110px; }
.location-contact-list { display: grid; gap: 16px; }
.location-contact-rule { margin: 0; }
.location-contact-rule__heading { align-items: flex-end; display: flex; gap: 18px; justify-content: space-between; margin-bottom: 20px; }
.location-contact-rule__location { align-items: flex-end; display: grid; gap: 8px 14px; grid-template-columns: auto minmax(220px, 1fr); }
.location-contact-rule__location strong { align-self: center; font-size: 18px; }
.location-contact-rule__location input { min-width: 0; }
.location-contact-rule__fields { display: grid; gap: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.part-detail-form { display: grid; gap: 16px; }
.part-compatible-models { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.part-compatible-models .checkbox-field { align-items: flex-start; }
.part-compatible-models small { color: var(--muted); display: block; margin-top: 3px; }
.part-equipment-picker { max-width: 760px; }
.part-equipment-picker .filter-dropdown-menu { gap: 8px; }
.part-equipment-picker__menu > input[type="search"] { position: sticky; top: 0; z-index: 1; }
.part-equipment-picker .part-compatible-models { grid-template-columns: 1fr; }
.part-equipment-picker .checkbox-option { align-items: flex-start; }
.part-equipment-picker .checkbox-option small { color: var(--muted); display: block; margin-top: 3px; }
.location-list-controls { align-items: center; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin: 0 0 12px; }
.location-row-actions { align-items: center; display: flex; gap: 6px; }
.form-grid-span-two { grid-column: 1 / -1; }
.location-contact-field { align-content: start; display: grid; gap: 8px; min-width: 0; }
.location-contact-field > label, .location-contact-field__label { color: var(--muted); font-size: 13px; font-weight: 700; }
.location-contact-picker { display: grid; gap: 8px; }
.location-contact-picker__row { align-items: center; display: flex; gap: 8px; min-width: 0; }
.location-contact-picker__select { min-width: 0; width: 100%; }
.contact-search-select { min-width: 0; width: 100%; }
.contact-search-select > summary { min-height: 42px; }
.contact-search-select > summary span { color: var(--ink); font-size: 14px; font-weight: 500; }
.contact-search-select__menu { max-height: 310px; }
.contact-search-select__options { display: grid; gap: 2px; }
.contact-search-select__options button { background: transparent; border: 0; border-radius: 5px; color: var(--ink); cursor: pointer; font: inherit; padding: 8px; text-align: left; }
.contact-search-select__options button:hover, .contact-search-select__options button[aria-selected="true"] { background: #edf5f7; color: var(--accent-dark); }
.contact-search-select__options button[hidden] { display: none; }
.location-contact-field > .button { justify-self: start; }
.inspections-page { max-width: 1280px; }
.inspection-layout { align-items: start; display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) 360px; }
.inspection-form-card { max-width: 920px; }
.inspection-section { border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 10px; margin: 0 0 18px; padding: 16px; }
.inspection-section legend { color: var(--accent-dark); font-size: 18px; font-weight: 800; padding: 0 6px; }
.inspection-item { border-bottom: 1px solid var(--line); display: grid; gap: 8px; padding: 10px 0; }
.inspection-item:last-child { border-bottom: 0; }
.inspection-item-heading { align-items: baseline; display: flex; gap: 10px; justify-content: space-between; }
.inspection-item-type { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.inspection-item select, .inspection-item input { max-width: 480px; }
.inspection-sidebar { display: grid; gap: 18px; position: sticky; top: 16px; }
.inspection-asset-row, .inspection-asset-match { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; padding: 10px 0; }
.inspection-asset-row:last-of-type { border-bottom: 0; }
.asset-match-list { margin-top: 12px; }
.button-small { font-size: 12px; padding: 7px 10px; }
.inspection-summary { display: flex; gap: 24px; }
.inspection-summary div { display: grid; gap: 2px; }
.inspection-summary strong { font-size: 26px; }
.inspection-summary span { color: var(--muted); font-size: 12px; }
.inspection-scan-button { margin-top: 10px; }
.inspection-scanner-modal { align-items: center; background: rgba(15, 28, 38, .9); display: flex; flex-direction: column; gap: 16px; inset: 0; justify-content: center; padding: 24px; position: fixed; z-index: 1000; }
.inspection-scanner-modal video { border: 3px solid white; border-radius: 12px; max-height: 70vh; max-width: 90vw; width: 520px; }
@media (max-width: 900px) { .inspection-layout { grid-template-columns: 1fr; } .inspection-sidebar { position: static; } }
@media (max-width: 1000px) { .location-contact-rule__fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .part-compatible-models { grid-template-columns: 1fr; }
  .form-grid-span-two { grid-column: auto; }
  .location-contact-rule__heading { align-items: stretch; flex-direction: column; }
  .location-contact-rule__location { grid-template-columns: 1fr; }
  .location-contact-rule__fields { grid-template-columns: 1fr; }
  .location-contact-rule__heading > .button { width: 100%; }
}
@media (max-width: 760px) {
  .push-notification-actions { align-items: stretch; flex-direction: column; }
  .push-notification-actions .button { width: 100%; }
  .push-notification-actions [data-push-message] { min-height: 20px; }
}
.inspection-filters .form-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; }
.inspection-filters .form-field-actions { display: flex; gap: .5rem; align-items: center; }
.inspection-pagination { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-top: 1rem; color: var(--muted, #687887); }
.inspection-coming-soon { border-style: dashed; }
.inspection-photos { margin: 1.5rem 0; padding: 1rem; border: 1px solid #d7e1e8; border-radius: .75rem; }
.inspection-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem; margin-top: 1rem; }
.inspection-photo-grid a { display: grid; gap: .35rem; color: inherit; text-decoration: none; }
.inspection-photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .5rem; }
.inspection-photo-grid span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.inspection-save-status { position: sticky; top: 0; z-index: 2; padding: .65rem .8rem; margin-bottom: 1rem; border-radius: .6rem; background: var(--surface-soft, #f2f7f8); color: var(--muted); }
.inspection-save-status[data-error="true"] { color: var(--danger, #9b2c2c); }
.inspection-section[hidden] { display: none; }
.inspection-check-for { margin: 0; color: var(--muted); line-height: 1.45; }
.inspection-step-controls { align-items: center; display: flex; justify-content: space-between; gap: .75rem; margin: 1rem 0; }
.inspection-step-controls button { min-height: 44px; }
.inspection-item { border: 1px solid var(--line); border-radius: .75rem; padding: 1rem; margin: .65rem 0; }
.inspection-item select, .inspection-item textarea, .inspection-item input[type="date"] { width: 100%; max-width: none; }
.inspection-item-photos { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
.inspection-item-photos a { width: 96px; display: grid; gap: .25rem; color: inherit; font-size: .75rem; }
.inspection-item-photos img { width: 96px; height: 76px; object-fit: cover; border-radius: .45rem; }
.inspection-item-photo-upload { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.inspection-review-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .25rem 1rem; }
.inspection-review-summary p { margin: .25rem 0; }
.inspection-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.inspection-grade-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.inspection-grade-option { cursor: pointer; min-width: 74px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: .55rem; padding: .3rem .65rem; background: var(--surface, #fff); }
.inspection-grade-option:has(input:checked) { border-color: var(--accent, #176f83); background: var(--accent-soft, #e5f2f5); box-shadow: inset 0 0 0 1px var(--accent, #176f83); }
.inspection-grade-option input { accent-color: var(--accent, #176f83); margin-right: .3rem; }
.inspection-attention-label { display: inline-block; width: fit-content; padding: .2rem .5rem; border-radius: 999px; color: var(--danger, #8e2b25); background: var(--danger-soft, #fbe9e7); font-weight: 700; font-size: .85rem; }
.inspection-draft-list { display: grid; gap: .5rem; }
.inspection-draft-row { display: grid; gap: .25rem; border: 1px solid var(--line); border-radius: .65rem; padding: .8rem; color: inherit; text-decoration: none; }
.app-version-footer { background: rgba(244, 247, 248, .92); border: 1px solid rgba(220, 228, 233, .8); border-radius: 999px; bottom: max(8px, env(safe-area-inset-bottom)); color: var(--muted); font-size: 11px; line-height: 1; padding: 6px 9px; pointer-events: none; position: fixed; right: max(10px, env(safe-area-inset-right)); z-index: 20; }
.changelog-page { max-width: 980px; }
.changelog-release { margin-top: 22px; padding: 24px; }
.changelog-release__header { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 16px; justify-content: space-between; padding-bottom: 16px; }
.changelog-release__header h2 { font-size: 24px; margin: 0; }
.changelog-release__header time { color: var(--muted); font-size: 14px; }
.changelog-section { padding-top: 18px; }
.changelog-section h3 { color: var(--accent-dark); font-size: 16px; margin: 0 0 8px; }
.changelog-section ul { margin: 0; padding-left: 22px; }
.changelog-section li + li { margin-top: 7px; }
@media (max-width: 600px) { .changelog-release { padding: 18px; } .changelog-release__header { align-items: flex-start; flex-direction: column; gap: 4px; } }
@media (max-width: 640px) { .inspection-pagination { align-items: flex-start; flex-direction: column; } }
.inspection-section-nav { display: flex; gap: .5rem; overflow-x: auto; padding: .5rem 0 1rem; margin-bottom: 1rem; }
.inspection-section-nav button { flex: 0 0 auto; min-height: 44px; padding: .55rem .85rem; border: 1px solid var(--border-color, #d5e0e5); border-radius: .65rem; background: var(--surface-color, #fff); color: inherit; cursor: pointer; }
.inspection-section-nav button[aria-selected="true"] { border-color: var(--brand-color, #176f83); box-shadow: inset 0 0 0 1px var(--brand-color, #176f83); }

/* Per-agent appearance preferences. */
body[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8eef2;
  --muted: #a9bac4;
  --line: #3a4b55;
  --panel: #202c34;
  --canvas: #141d23;
  --accent: #61c6dd;
  --accent-dark: #9be1ef;
  --note: #3b3422;
}
@media (prefers-color-scheme: dark) {
  body[data-theme="system"] {
    color-scheme: dark;
    --ink: #e8eef2;
    --muted: #a9bac4;
    --line: #3a4b55;
    --panel: #202c34;
    --canvas: #141d23;
    --accent: #61c6dd;
    --accent-dark: #9be1ef;
    --note: #3b3422;
  }
}
body[data-theme="dark"] .card,
body[data-theme="dark"] .filter-accordion,
body[data-theme="dark"] .filter-dropdown-menu,
body[data-theme="dark"] .nav-dropdown,
body[data-theme="dark"] .modal-card,
body[data-theme="dark"] .ticket-card,
body[data-theme="dark"] .requester-ticket-row,
body[data-theme="dark"] .inspection-item,
body[data-theme="dark"] .inspection-section-nav button,
body[data-theme="dark"] .inspection-grade-option,
body[data-theme="dark"] .inspection-draft-row {
  background-color: var(--panel);
  border-color: var(--line);
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  body[data-theme="system"] .card,
  body[data-theme="system"] .filter-accordion,
  body[data-theme="system"] .filter-dropdown-menu,
  body[data-theme="system"] .nav-dropdown,
  body[data-theme="system"] .modal-card,
  body[data-theme="system"] .ticket-card,
  body[data-theme="system"] .requester-ticket-row,
  body[data-theme="system"] .inspection-item,
  body[data-theme="system"] .inspection-section-nav button,
  body[data-theme="system"] .inspection-grade-option,
  body[data-theme="system"] .inspection-draft-row {
    background-color: var(--panel);
    border-color: var(--line);
    color: var(--ink);
  }
}
body[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] .filter-dropdown > summary,
body[data-theme="dark"] .filter-dropdown > summary strong,
body[data-theme="dark"] .nav-dropdown a {
  background-color: #18232a;
  border-color: #50616b;
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  body[data-theme="system"] input:not([type="checkbox"]):not([type="radio"]),
  body[data-theme="system"] select,
  body[data-theme="system"] textarea,
  body[data-theme="system"] .filter-dropdown > summary,
  body[data-theme="system"] .filter-dropdown > summary strong,
  body[data-theme="system"] .nav-dropdown a {
    background-color: #18232a;
    border-color: #50616b;
    color: var(--ink);
  }
}
body[data-theme="dark"] .app-version-footer { background: rgba(32, 44, 52, .94); border-color: var(--line); }
@media (prefers-color-scheme: dark) { body[data-theme="system"] .app-version-footer { background: rgba(32, 44, 52, .94); border-color: var(--line); } }
.button-theme-toggle { align-items: center; border: 1px solid #668392; border-radius: 999px; color: #f5fbfc; display: inline-flex; font-size: 17px; height: 36px; justify-content: center; line-height: 1; min-width: 36px; padding: 0; text-decoration: none; }
.topbar-user form { margin: 0; }
.button-theme-toggle:hover { background: #315368; }
.requester-profile-card { margin-bottom: 20px; }
.requester-profile-card h2 { margin-bottom: 16px; }
.requester-details { display: grid; gap: 0; grid-template-columns: minmax(130px, .35fr) 1fr; margin: 0; }
.requester-details dt, .requester-details dd { border-bottom: 1px solid var(--line); margin: 0; padding: 11px 0; }
.requester-details dt { color: var(--muted); font-weight: 700; }
.requester-ticket-list { display: grid; gap: 8px; }
.requester-ticket-row { align-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); display: flex; gap: 12px; justify-content: space-between; padding: 12px; text-decoration: none; }
.requester-ticket-row small { color: var(--muted); display: block; margin-top: 4px; }
.preference-priorities { border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 10px; margin: 8px 0; padding: 14px; }
.preference-priorities legend { font-weight: 700; padding: 0 5px; }
.preference-priority-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.checkbox-option { align-items: center; display: inline-flex; gap: 7px; }
.agent-preferences-card .stacked-form { max-width: 650px; }
.agent-preferences-card .stacked-form > label { font-weight: 700; }
.agent-preferences-card .stacked-form > select { margin-bottom: 8px; }

body[data-theme="dark"] .advanced-search-dropdown,
body[data-theme="dark"] .bulk-toolbar,
body[data-theme="dark"] .checkbox-stack,
body[data-theme="dark"] .knowledge-chat-message-user,
body[data-theme="dark"] .ticket-message-history > summary,
body[data-theme="dark"] .trainual-answer,
body[data-theme="dark"] .ticket-viewer-presence,
body[data-theme="dark"] .ticket-queue-update,
body[data-theme="dark"] .agent-threads,
body[data-theme="dark"] .thread-card,
body[data-theme="dark"] .ticket-tag-options,
body[data-theme="dark"] .mosyle-device-group,
body[data-theme="dark"] .empty-state {
  background-color: #25343d;
  border-color: var(--line);
  color: var(--ink);
}
body[data-theme="dark"] .button-secondary,
body[data-theme="dark"] .asset-category-button:not(.active),
body[data-theme="dark"] .weekday-chip,
body[data-theme="dark"] .knowledge-chat-list a:hover,
body[data-theme="dark"] .knowledge-chat-list a.active,
body[data-theme="dark"] .ticket-tag-chip,
body[data-theme="dark"] .saved-filter-chip,
body[data-theme="dark"] .relationship-kind,
body[data-theme="dark"] .message-avatar {
  background-color: #2b3c46;
  border-color: var(--line);
  color: var(--ink);
}
body[data-theme="dark"] .checkbox-option:hover,
body[data-theme="dark"] .nav-dropdown a:hover { background-color: #304650; }
@media (prefers-color-scheme: dark) {
  body[data-theme="system"] .advanced-search-dropdown,
  body[data-theme="system"] .bulk-toolbar,
  body[data-theme="system"] .checkbox-stack,
  body[data-theme="system"] .knowledge-chat-message-user,
  body[data-theme="system"] .ticket-message-history > summary,
  body[data-theme="system"] .trainual-answer,
  body[data-theme="system"] .ticket-viewer-presence,
  body[data-theme="system"] .ticket-queue-update,
  body[data-theme="system"] .agent-threads,
  body[data-theme="system"] .thread-card,
  body[data-theme="system"] .ticket-tag-options,
  body[data-theme="system"] .mosyle-device-group,
  body[data-theme="system"] .empty-state {
    background-color: #25343d;
    border-color: var(--line);
    color: var(--ink);
  }
  body[data-theme="system"] .button-secondary,
  body[data-theme="system"] .asset-category-button:not(.active),
  body[data-theme="system"] .weekday-chip,
  body[data-theme="system"] .knowledge-chat-list a:hover,
  body[data-theme="system"] .knowledge-chat-list a.active,
  body[data-theme="system"] .ticket-tag-chip,
  body[data-theme="system"] .saved-filter-chip,
  body[data-theme="system"] .relationship-kind,
  body[data-theme="system"] .message-avatar {
    background-color: #2b3c46;
    border-color: var(--line);
    color: var(--ink);
  }
  body[data-theme="system"] .checkbox-option:hover,
  body[data-theme="system"] .nav-dropdown a:hover { background-color: #304650; }
}

/* Dark-mode contrast for views that use intentionally light, fixed surfaces. */
body[data-theme="dark"] .sms-inbound-number,
body[data-theme="dark"] .sms-search-form,
body[data-theme="dark"] .sms-conversation-heading,
body[data-theme="dark"] .sms-contact-editor-popover,
body[data-theme="dark"] .sms-ticket-form .stacked-form,
body[data-theme="dark"] .service-dashboard-live-data,
body[data-theme="dark"] .push-install-help {
  background-color: #25343d;
  border-color: var(--line);
  color: var(--ink);
}
body[data-theme="dark"] .sms-inbound-number,
body[data-theme="dark"] .sms-inbound-number strong,
body[data-theme="dark"] .sms-bubble,
body[data-theme="dark"] .sms-bubble-body,
body[data-theme="dark"] .sms-contact-editor-popover strong,
body[data-theme="dark"] .sms-contact-editor-popover label,
body[data-theme="dark"] .service-dashboard-live-data,
body[data-theme="dark"] .push-install-help h3,
body[data-theme="dark"] .push-install-help p {
  color: var(--ink);
}
body[data-theme="dark"] .sms-conversation-row:hover { background-color: #25343d; }
body[data-theme="dark"] .sms-conversation-row.active { background-color: #294752; }
body[data-theme="dark"] .sms-bubble-inbound { background-color: #2b3c46; }
body[data-theme="dark"] .sms-bubble-outbound { background-color: #24463b; }
body[data-theme="dark"] .sms-bubble-time { color: #b5c4cc; }
body[data-theme="dark"] .sms-svo-match { color: #8be0b4; }
body[data-theme="dark"] .asset-category-button.active { background-color: #275363; border-color: #61c6dd; color: #f5fbfc; }
body[data-theme="dark"] .button-primary { background-color: #176b87; color: #fff; }
body[data-theme="dark"] .button-primary:hover { background-color: #105267; }
@media (prefers-color-scheme: dark) {
  body[data-theme="system"] .sms-inbound-number,
  body[data-theme="system"] .sms-search-form,
  body[data-theme="system"] .sms-conversation-heading,
  body[data-theme="system"] .sms-contact-editor-popover,
  body[data-theme="system"] .sms-ticket-form .stacked-form,
  body[data-theme="system"] .service-dashboard-live-data,
  body[data-theme="system"] .push-install-help {
    background-color: #25343d;
    border-color: var(--line);
    color: var(--ink);
  }
  body[data-theme="system"] .sms-inbound-number,
  body[data-theme="system"] .sms-inbound-number strong,
  body[data-theme="system"] .sms-bubble,
  body[data-theme="system"] .sms-bubble-body,
  body[data-theme="system"] .sms-contact-editor-popover strong,
  body[data-theme="system"] .sms-contact-editor-popover label,
  body[data-theme="system"] .service-dashboard-live-data,
  body[data-theme="system"] .push-install-help h3,
  body[data-theme="system"] .push-install-help p {
    color: var(--ink);
  }
  body[data-theme="system"] .sms-conversation-row:hover { background-color: #25343d; }
  body[data-theme="system"] .sms-conversation-row.active { background-color: #294752; }
  body[data-theme="system"] .sms-bubble-inbound { background-color: #2b3c46; }
  body[data-theme="system"] .sms-bubble-outbound { background-color: #24463b; }
  body[data-theme="system"] .sms-bubble-time { color: #b5c4cc; }
  body[data-theme="system"] .sms-svo-match { color: #8be0b4; }
  body[data-theme="system"] .asset-category-button.active { background-color: #275363; border-color: #61c6dd; color: #f5fbfc; }
  body[data-theme="system"] .button-primary { background-color: #176b87; color: #fff; }
  body[data-theme="system"] .button-primary:hover { background-color: #105267; }
}
@media (max-width: 600px) {
  .requester-details { grid-template-columns: 1fr; }
  .requester-details dt { border-bottom: 0; padding-bottom: 0; }
  .requester-details dd { padding-top: 3px; }
  .requester-ticket-row { align-items: flex-start; }
}
