/* Navigation shell: sidebar + top bar around the existing screens.
   Screens themselves keep styles.css untouched. */

body { padding: 0; }

.app-shell {
    max-width: none;
    margin: 0;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 100vh;
}
/* auth.js replaces the shell's contents with the sign-in page - lay that out as before */
.app-shell:not(:has(.sidebar)) { display: block; max-width: 90%; margin: 0 auto; padding: 20px; }

/* ---------- sidebar ---------- */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #002c58;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    overflow: hidden;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 18px 16px 14px;
    background: transparent;
    border: none;
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    font-size: 15px;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}
.sidebar-brand img { height: 30px; flex-shrink: 0; }
.sidebar-brand .brand-toggle { margin-left: auto; font-size: 18px; color: #9fb3c8; }
.sidebar-brand:hover .brand-toggle { color: #ffffff; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.nav-group {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9fb3c8;
    padding: 16px 10px 6px;
    white-space: nowrap;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    margin: 1px 0;
    border-radius: 6px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}
.nav-item i { font-size: 18px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; }
.nav-item.active { background: #ffffff; color: #2d3748; font-weight: 600; }

/* collapsed: the sidebar slides away; the brand moves into the top bar */
.app-shell { transition: grid-template-columns 0.2s ease; }
.app-shell.collapsed { grid-template-columns: 0px minmax(0, 1fr); }
.app-shell.collapsed .sidebar { border-right: none; }
.topbar-brand {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    cursor: pointer;
}
.topbar-brand:hover { background: rgba(255, 255, 255, 0.1); }
.topbar-brand i { font-size: 20px; }
.topbar-brand img { height: 26px; }
.app-shell.collapsed .topbar-brand { display: flex; }

/* ---------- main area ---------- */
.main-area { min-width: 0; padding: 0 28px 20px; }
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 0;
    color: #ffffff;
}
.breadcrumb { flex: 1; min-width: 0; font-size: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb .crumb-group { color: #9fb3c8; font-weight: 400; }
.breadcrumb .crumb-sep { color: #6b86a3; margin: 0 8px; font-weight: 400; }
.search-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    min-width: 260px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #e2e8f0;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}
.search-trigger:hover { background: rgba(255, 255, 255, 0.16); }
.search-trigger span { flex: 1; text-align: left; }
.search-trigger kbd, .palette-hint kbd {
    font-family: inherit;
    font-size: 11px;
    padding: 1px 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}
#message { margin: 0 0 16px; }
#devModeBanner { grid-column: 1 / -1; }

/* ---------- quick search ---------- */
.palette-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 20, 45, 0.55);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 12vh;
}
.palette {
    width: min(620px, 92vw);
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}
.palette input {
    width: 100%;
    padding: 16px 18px;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    font: inherit;
    font-size: 16px;
    outline: none;
}
.palette-results { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #2d3748;
}
.palette-item i { font-size: 18px; color: #718096; }
.palette-item .palette-sub { margin-left: auto; font-size: 12px; color: #a0aec0; }
.palette-item.selected { background: #ebf4ff; }
.palette-section { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #a0aec0; padding: 10px 12px 4px; }
.palette-empty { padding: 16px; color: #718096; }
.palette-hint { padding: 8px 14px; font-size: 12px; color: #a0aec0; border-top: 1px solid #edf2f7; }
.palette-hint kbd { border-color: #cbd5e0; }

/* ---------- home ---------- */
.home-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.home-count { background: #f7fafc; border-radius: 8px; padding: 14px 16px; }
.home-count .label { font-size: 13px; color: #718096; }
.home-count .value { font-size: 26px; font-weight: 600; color: #2d3748; }
.home-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.home-check { border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px 16px; }
.home-check.attention { border-left: 4px solid #dd6b20; }
.home-check.ok { border-left: 4px solid #38a169; }
.home-check-head { display: flex; align-items: center; gap: 8px; font-weight: 600; color: #2d3748; }
.home-check-head .badge { margin-left: auto; font-size: 12px; padding: 2px 9px; border-radius: 10px; }
.home-check.attention .badge { background: #feebc8; color: #7b341e; }
.home-check.ok .badge { background: #c6f6d5; color: #22543d; }
.home-check p { color: #718096; font-size: 13px; margin: 6px 0 8px; }
.home-check ul { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow-y: auto; }
.home-check li a { display: block; padding: 4px 0; font-size: 13px; color: #4c51bf; text-decoration: none; }
.home-check li a:hover { text-decoration: underline; }
.home-check .open-link { display: inline-block; margin-top: 8px; font-size: 13px; color: #4c51bf; text-decoration: none; }

/* ---------- rep pages ---------- */
.rep-index-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.rep-index-item { display: block; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; text-decoration: none; color: #2d3748; }
.rep-index-item:hover { border-color: #667eea; background: #f7f8ff; }
.rep-index-item .code { font-weight: 600; }
.rep-index-item .code .sep { color: #a0aec0; font-weight: 400; margin: 0 2px; }
.rep-index-item .code .region { font-size: 13px; font-style: italic; font-weight: 500; color: #4a5568; }
.rep-index-item .name { font-size: 13px; color: #718096; }
.rep-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.rep-avatar { width: 48px; height: 48px; border-radius: 50%; background: #ebf4ff; color: #4c51bf; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.rep-title { font-size: 20px; font-weight: 600; color: #2d3748; }
.rep-title .rep-name { color: #718096; font-weight: 400; }
.rep-sub { font-size: 13px; color: #718096; }
.rep-pill { font-size: 12px; padding: 3px 10px; border-radius: 10px; }
.rep-pill.on { background: #c6f6d5; color: #22543d; }
.rep-pill.off { background: #fed7d7; color: #742a2a; }
.rep-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.rep-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 22px; }
.rep-fact { background: #f7fafc; border-radius: 8px; padding: 10px 12px; }
.rep-fact .label { font-size: 12px; color: #718096; }
.rep-fact .value { font-weight: 600; color: #2d3748; word-break: break-word; }
.rep-section-title { font-weight: 600; color: #2d3748; margin: 4px 0 10px; display: flex; align-items: center; gap: 8px; }
.rep-section-title a { margin-left: auto; font-size: 13px; font-weight: 400; color: #4c51bf; text-decoration: none; }
.rep-timeline { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 8px; }
.rep-stint { background: #f7fafc; border-radius: 8px; padding: 9px 11px; }
.rep-stint.current { background: #ebf4ff; }
.rep-stint .code { font-size: 12px; color: #718096; }
.rep-stint.current .code, .rep-stint.current .who { color: #434190; }
.rep-stint .who { font-weight: 600; color: #2d3748; }
.rep-stint .when { font-size: 12px; color: #718096; }
.rep-note { font-size: 12px; color: #a0aec0; margin-bottom: 22px; }
.rep-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.rep-panel { border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 14px; }
.rep-panel table { width: 100%; font-size: 13px; border-collapse: collapse; }
.rep-panel td { padding: 3px 0; color: #4a5568; }
.rep-panel td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.rep-panel .muted { color: #a0aec0; font-size: 13px; }

@media (max-width: 900px) {
    .topbar-brand span { display: none; }
    .search-trigger { min-width: 0; }
    .search-trigger span, .search-trigger kbd { display: none; }
    .main-area { padding: 0 14px 20px; }
}

/* ---------- zip map (browser-drawn; static/js/zip-map.js) ---------- */
.zm-card { padding: 0; overflow: hidden; }
.zm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: calc(100vh - 150px); min-height: 540px; }
.zm-map-wrap { position: relative; min-width: 0; height: 100%; }
.zm-map { width: 100%; height: 100%; }
.zm-draw { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.zm-draw rect, .zm-draw polygon { fill: rgba(221, 107, 32, 0.12); stroke: #dd6b20; stroke-width: 2; stroke-dasharray: 5 4; }
.zm-status { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,0.92); padding: 4px 10px; border-radius: 6px; font-size: 13px; color: #4a5568; }
.zm-status:empty { display: none; }
.zm-hover { position: absolute; left: 12px; right: 60px; bottom: 34px; background: rgba(255,255,255,0.92); padding: 6px 10px; border-radius: 6px; font-size: 13px; color: #2d3748; pointer-events: none; }
.zm-panel { border-left: 1px solid #e2e8f0; padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.zm-modes { display: flex; gap: 4px; }
.zm-mode { flex: 1; padding: 7px 6px; border: 1px solid #cbd5e0; background: #fff; border-radius: 6px; font: inherit; font-size: 13px; cursor: pointer; color: #4a5568; }
.zm-mode.active { background: #2c5282; border-color: #2c5282; color: #fff; }
.zm-input { width: 100%; padding: 8px 10px; border: 1px solid #cbd5e0; border-radius: 6px; font: inherit; font-size: 14px; }
.zm-selection { background: #f7fafc; border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.zm-sel-head { font-weight: 600; color: #2d3748; margin-bottom: 4px; }
.zm-sel-row { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.zm-sel-row span:nth-child(2) { flex: 1; }
.zm-actions { display: flex; gap: 8px; }
.zm-actions .btn { padding: 8px 14px; font-size: 14px; }
.zm-actions .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.zm-territories { display: flex; flex-direction: column; }
.zm-group { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: #718096; padding: 10px 2px 4px; }
.zm-terr { display: flex; align-items: center; gap: 8px; padding: 3px 2px; }
.zm-color { width: 26px; height: 22px; padding: 0; border: 1px solid #cbd5e0; border-radius: 4px; background: none; cursor: pointer; flex-shrink: 0; }
.zm-terr-name { flex: 1; min-width: 0; text-align: left; background: none; border: none; padding: 2px 4px; border-radius: 4px; font: inherit; font-size: 13px; color: #2d3748; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zm-terr-name span { color: #718096; margin-left: 6px; }
.zm-terr-name:hover { background: #edf2f7; }
.zm-count { color: #718096; font-size: 12px; font-variant-numeric: tabular-nums; }
.zm-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.2); }
.zm-muted { color: #718096; font-size: 12px; }
.zm-link { background: none; border: none; color: #4c51bf; font: inherit; font-size: 13px; text-align: left; padding: 0; cursor: pointer; }
.zm-changes { font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.zm-modal { position: fixed; inset: 0; background: rgba(0, 20, 45, 0.5); z-index: 2000; align-items: center; justify-content: center; }
.zm-modal-box { background: #fff; border-radius: 10px; padding: 20px 22px; width: min(520px, 92vw); display: flex; flex-direction: column; gap: 8px; box-shadow: 0 20px 50px rgba(0,0,0,0.3); }
.zm-modal-box h3 { margin: 0 0 6px; color: #2d3748; }
.zm-label { font-size: 13px; color: #4a5568; }
.zm-preview { font-size: 13px; color: #2d3748; background: #f7fafc; border-radius: 8px; padding: 10px 12px; min-height: 40px; max-height: 220px; overflow-y: auto; }
.zm-preview ul { margin: 6px 0 0 18px; }
@media (max-width: 900px) { .zm-layout { grid-template-columns: 1fr; grid-template-rows: 60vh auto; height: auto; } .zm-panel { border-left: none; border-top: 1px solid #e2e8f0; } }
.zm-colorby { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #4a5568; }
.zm-colorby span { margin-right: 4px; }
.zm-colorby-btn { padding: 5px 9px; border: 1px solid #cbd5e0; background: #fff; border-radius: 6px; font: inherit; font-size: 12px; color: #4a5568; cursor: pointer; }
.zm-colorby-btn.active { background: #2c5282; border-color: #2c5282; color: #fff; }
.zm-rename { background: none; border: none; color: #a0aec0; cursor: pointer; padding: 2px 4px; border-radius: 4px; font-size: 14px; }
.zm-rename:hover { color: #2c5282; background: #edf2f7; }
.zm-rename-input { flex: 1; min-width: 0; padding: 3px 6px; border: 1px solid #4c51bf; border-radius: 4px; font: inherit; font-size: 13px; }
.zm-list-head { display: flex; gap: 6px; }
.zm-list-head .btn { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
.zm-warn { color: #9c4221; background: #feebc8; border-radius: 6px; padding: 6px 8px; margin-top: 6px; }
.zm-pick { flex: 1; padding: 5px 6px; border: 1px solid #cbd5e0; border-radius: 6px; font: inherit; font-size: 12px; color: #2d3748; background: #fff; }
.zm-zip-list { margin-top: 6px; font-size: 12px; color: #4a5568; max-height: 160px; overflow-y: auto; }
.zm-card-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 4px 0; }
.zm-card-table td { padding: 3px 0; vertical-align: middle; color: #2d3748; }
.zm-card-table td:first-child { color: #718096; width: 30%; }
.zm-inline { display: flex; align-items: center; gap: 6px; }
.zm-input-sm { padding: 4px 6px; font-size: 13px; }
.zm-btn-sm { padding: 3px 8px !important; font-size: 12px !important; white-space: nowrap; }

/* VGM Map (read-only; reuses the .zm-* layout) */
.vm-legend { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #4a5568; }
.vm-legend-row { display: flex; align-items: center; gap: 8px; }
.vm-dot { border-radius: 50%; border: 1px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.25); flex-shrink: 0; }
.vm-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #4a5568; }
.vm-filters { display: flex; gap: 8px; }
.vm-filters label { flex: 1; display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #4a5568; }
.vm-select { width: 100%; padding: 7px 8px; font-size: 13px; }
.vm-list { display: flex; flex-direction: column; font-size: 13px; }
.vm-item { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 6px; cursor: pointer; text-align: left; background: none; border: none; font: inherit; color: #2d3748; width: 100%; }
.vm-item:hover { background: #edf2f7; }
.vm-item-main { flex: 1; min-width: 0; }
.vm-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-item-sub { color: #718096; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-ranks { font-size: 11px; color: #4a5568; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vm-popup .maplibregl-popup-content { padding: 0; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); }
.vm-pop { max-height: 380px; overflow-y: auto; padding: 12px 14px; font-size: 13px; color: #2d3748; min-width: 270px; }
.vm-pop-count { font-size: 12px; color: #718096; margin-bottom: 6px; }
.vm-card + .vm-card { border-top: 1px solid #e2e8f0; margin-top: 10px; padding-top: 10px; }
.vm-card-name { font-weight: 600; font-size: 14px; }
.vm-card-sub { color: #718096; font-size: 12px; margin-bottom: 6px; }
.vm-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.vm-badge { background: #edf2f7; border-radius: 10px; padding: 2px 8px; font-size: 12px; white-space: nowrap; }
.vm-badge b { font-variant-numeric: tabular-nums; }
.vm-card ul { margin: 2px 0 6px 16px; padding: 0; }
.vm-card-meta { color: #4a5568; font-size: 12px; line-height: 1.5; }
.vm-approx { color: #9c4221; font-size: 11px; }

/* VGM Map - notes & visits */
.vm-act-box { width: min(600px, 94vw); max-height: 90vh; overflow-y: auto; }
.vm-act-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.vm-act-head h3 { margin: 0; }
.vm-textarea { resize: vertical; font-size: 13px; }
.vm-act-form { display: flex; flex-direction: column; gap: 6px; }
.vm-act-visits { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.vm-visit { background: #f7fafc; border-radius: 8px; padding: 8px 10px; }
.vm-visit-head { display: flex; align-items: center; gap: 8px; color: #4a5568; font-size: 12px; }
.vm-visit-head b { color: #2d3748; font-size: 13px; }
.vm-visit-note { white-space: pre-wrap; margin-top: 4px; color: #2d3748; }
.vm-type { background: #e2e8f0; border-radius: 10px; padding: 1px 7px; font-size: 11px; text-transform: capitalize; }
.vm-act-btn { margin-top: 6px; }
.vm-crm { font-size: 12px; color: #2f855a; margin-bottom: 4px; }
.vm-crm.none { color: #a0aec0; }
.vm-visited { color: #2f855a; font-size: 11px; }

/* Reports - embedded Power BI */
.rp-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.rp-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #e2e8f0; flex-wrap: wrap; }
.rp-tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; min-width: 0; }
.rp-tab { padding: 6px 12px; border-radius: 6px; color: #4a5568; text-decoration: none; font-size: 14px; white-space: nowrap; }
.rp-tab:hover { background: #edf2f7; }
.rp-tab.active { background: #2c5282; color: #fff; }
.rp-open { white-space: nowrap; }
.rp-frame { width: 100%; height: calc(100vh - 200px); min-height: 480px; border: 0; display: block; }
.rp-empty { padding: 48px 24px; text-align: center; color: #718096; }
.rp-error { color: #c53030; font-size: 13px; min-height: 1em; }

/* Reports: sidebar heading gear (admin) + sections dialog */
.nav-group-tools { display: flex; align-items: center; }
.nav-group-tools .nav-label { flex: 1; }
.nav-gear { background: none; border: none; color: #9fb3c8; cursor: pointer; padding: 2px 4px; border-radius: 4px; font-size: 15px; line-height: 1; }
.nav-gear:hover { color: #ffffff; background: rgba(255, 255, 255, 0.1); }
.rp-sec-list { display: flex; flex-direction: column; gap: 6px; }
.rp-sec-row { display: flex; align-items: center; gap: 6px; }
.rp-sec-row .zm-input { flex: 1; }
.rp-sec-row .rp-sec-order { width: 70px; flex: none; }
.rp-sec-count { color: #718096; font-size: 12px; white-space: nowrap; width: 54px; }

/* REVO Keystone brand (sidebar + top bar) - REVO-style wordmark on SGM's navy */
.sidebar-brand .brand-mark { height: 30px; width: 30px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-size: 18px; font-weight: 300; letter-spacing: 0.01em; }
.brand-title b { font-weight: 600; letter-spacing: 0.04em; }
.env-tag { font-size: 11px; font-weight: 400; color: #fc8181; letter-spacing: 0.02em; }
.env-tag:empty { display: none; }
.env-tag.dev { color: #f6ad55; }
.topbar-brand .brand-mark { height: 24px; width: 24px; }
.topbar-brand .brand-title { font-size: 16px; }

/* Territories: status chips */
.terr-flag { display: inline-block; background: #fdf0d8; color: #9a5b00; border-radius: 10px; padding: 0 8px; font-size: 12px; line-height: 20px; }

/* ---------- Data Dictionary (data-dictionary.js) ---------- */
.dd-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.dd-list { border: 1px solid #e2e8f0; border-radius: 8px; max-height: 75vh; overflow-y: auto; position: sticky; top: 70px; }
.dd-group { background: #f7fafc; color: #4a5568; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding: 8px 12px; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; }
.dd-group span { color: #a0aec0; font-weight: 400; }
.dd-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid #edf2f7; padding: 8px 12px; cursor: pointer; color: #2d3748; }
.dd-item:hover { background: #f7f8ff; }
.dd-item.active { background: #ebf4ff; box-shadow: inset 3px 0 0 #667eea; }
.dd-item-name { display: block; font-weight: 600; font-size: 14px; word-break: break-word; }
.dd-item-sub { display: block; font-size: 12px; color: #718096; }
.dd-item-sub em { color: #9a5b00; font-style: normal; }
.dd-detail { min-width: 0; }
.dd-head h3 { margin: 0; font-size: 20px; word-break: break-word; }
.dd-meta { color: #718096; font-size: 13px; margin: 4px 0 14px; }
.dd-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.dd-edit label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: #4a5568; }
.dd-edit textarea { font: inherit; font-weight: 400; padding: 8px; border: 1px solid #ddd; border-radius: 4px; resize: vertical; }
.dd-edit-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.dd-links { display: flex; flex-direction: column; gap: 6px; font-size: 13px; margin-bottom: 12px; }
.dd-links strong { color: #4a5568; margin-right: 6px; }
.dd-chip { display: inline-block; border: 1px solid #c3dafe; background: #ebf4ff; color: #2c5282; border-radius: 12px; padding: 1px 10px; font-size: 12px; cursor: pointer; margin: 2px 2px 2px 0; }
.dd-chip:hover { background: #c3dafe; }
.dd-chip-plain { border-color: #e2e8f0; background: #f7fafc; color: #718096; cursor: default; }
.dd-expr { margin: 10px 0; }
.dd-expr summary { cursor: pointer; color: #2c5282; font-size: 13px; }
.dd-expr pre { background: #f7fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px; font-size: 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.dd-expr-title { font-size: 13px; color: #4a5568; margin-bottom: 4px; }
.dd-grid { width: 100%; }
.dd-from-source { color: #718096; font-style: italic; }
.dd-muted { color: #718096; font-size: 13px; }
@media (max-width: 900px) {
    .dd-layout { grid-template-columns: 1fr; }
    .dd-list { position: static; max-height: 40vh; }
    .dd-edit { grid-template-columns: 1fr; }
}

