/* Glossary Concepts & Descriptions — restricted review tool layout.
   Component styles (.modal, .btn, .aat-*) are inherited from glossary-editor.css. */

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1a202c;
    background: #f7fafc;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.gc-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 18px; background: #2d3748; color: #fff; flex: 0 0 auto;
}
.gc-header-title h1 { font-size: 18px; margin: 0; }
.gc-subtitle { font-size: 12px; color: #a0aec0; }
.gc-header-actions { display: flex; align-items: center; gap: 14px; }
.gc-status { font-size: 13px; color: #cbd5e0; }

.gc-main { flex: 1 1 auto; display: flex; min-height: 0; }

/* List pane */
.gc-list-pane { width: 320px; flex: 0 0 320px; border-right: 1px solid #e2e8f0; background: #fff; display: flex; flex-direction: column; }
.gc-search-box { padding: 10px; border-bottom: 1px solid #edf2f7; position: relative; }
.gc-search-box input { width: 100%; padding: 7px 28px 7px 10px; border: 1px solid #cbd5e0; border-radius: 5px; font-size: 13px; }
.gc-search-clear { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); width: 18px; height: 18px; padding: 0; line-height: 16px; text-align: center; border: none; border-radius: 50%; background: #cbd5e0; color: #fff; font-size: 14px; cursor: pointer; }
.gc-search-clear:hover { background: #a0aec0; }
.gc-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 8px 10px; border-bottom: 1px solid #edf2f7; font-size: 12px; color: #4a5568; }
.gc-filters label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.gc-listnav { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid #edf2f7; }
.gc-listnav-hint { margin-left: auto; font-size: 10px; color: #a0aec0; user-select: none; }
/* overflow-anchor:none is essential for the virtual list: as drawVirtualWindow
   resizes the top spacer, CSS scroll-anchoring would otherwise compensate by
   shifting scrollTop, feeding back into a runaway where one wheel nudge flings
   the list to the far end. */
.gc-list { flex: 1 1 auto; overflow-y: auto; overflow-anchor: none; }
.gc-list-item { display: flex; align-items: center; justify-content: space-between; padding: 7px 12px; cursor: pointer; border-bottom: 1px solid #f7fafc; font-size: 13px; }
.gc-list-item:hover { background: #f0f5ff; }
.gc-list-item.active { background: #e6effd; font-weight: 600; }
.gc-li-badges { display: flex; gap: 3px; }
.gc-b { font-size: 10px; padding: 1px 4px; border-radius: 3px; line-height: 1.4; }
.gc-b-aat { background: #b2f5ea; color: #234e52; }
.gc-b-desc { background: #e9d8fd; color: #44337a; }
.gc-b-instr { background: #feebc8; color: #7b341e; }
.gc-b-rev { background: #c6f6d5; color: #22543d; }
.gc-more { padding: 10px 12px; font-size: 12px; color: #a0aec0; font-style: italic; }

/* Editor pane */
.gc-editor { flex: 1 1 auto; overflow-y: auto; padding: 20px 26px; }
.gc-empty { color: #a0aec0; font-size: 15px; padding: 40px; text-align: center; }
.gc-entry-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 2px solid #e2e8f0; padding-bottom: 8px; margin-bottom: 14px; }
.gc-entry-head h2 { margin: 0; font-size: 22px; }
.gc-key { font-size: 12px; color: #a0aec0; font-weight: normal; }
.gc-flags { display: flex; gap: 14px; font-size: 13px; color: #4a5568; white-space: nowrap; }
.gc-flags label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }

.gc-context { background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px 14px; margin-bottom: 18px; font-size: 13px; line-height: 1.8; }
.gc-lbl { display: inline-block; min-width: 84px; color: #718096; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.gc-ro { color: #a0aec0; font-size: 11px; }
.gc-grp { background: #edf2f7; border-radius: 4px; padding: 1px 7px; font-size: 12px; }

.gc-section { margin-bottom: 20px; }
.gc-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.gc-section-head h3 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: .03em; color: #4a5568; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.gc-none { color: #a0aec0; font-size: 13px; font-style: italic; }

.gc-concept { border: 1px solid #e2e8f0; border-radius: 6px; padding: 8px 12px; margin-bottom: 8px; background: #fff; }
.gc-concept-main { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.gc-sym { font-weight: 700; color: #0d9488; width: 14px; text-align: center; }
.gc-wd { background: #6b46c1; color: #fff; font-size: 10px; font-weight: 700; border-radius: 3px; padding: 0 4px; }
.gc-cid { font-size: 11px; color: #a0aec0; }
.gc-unc { color: #d69e2e; font-weight: 700; }
.gc-x { margin-left: auto; border: none; background: none; color: #cbd5e0; font-size: 18px; cursor: pointer; line-height: 1; }
.gc-x:hover { color: #e53e3e; }
.gc-scope { font-size: 12px; color: #4a5568; margin-top: 5px; line-height: 1.5; border-top: 1px dashed #edf2f7; padding-top: 5px; }

.gc-compose { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.gc-compose-lbl { width: 100%; font-size: 12px; color: #718096; margin-bottom: 2px; }
.gc-ins { font-size: 12px; padding: 3px 9px; border: 1px solid #b2f5ea; background: #e6fffa; color: #234e52; border-radius: 12px; cursor: pointer; }
.gc-ins:hover { background: #b2f5ea; }
.gc-desc, .gc-instr { width: 100%; padding: 10px; border: 1px solid #cbd5e0; border-radius: 6px; font-size: 14px; font-family: inherit; line-height: 1.5; resize: vertical; }
.gc-instr { background: #fffdf7; border-color: #f6e05e; }
.gc-hint { font-size: 12px; color: #718096; margin-bottom: 6px; }

/* Reference definitions panel */
.gc-def-card { border: 1px solid #e2e8f0; border-left: 3px solid #cbd5e0; border-radius: 6px; padding: 7px 11px; margin-bottom: 7px; background: #fff; }
.gc-def-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.gc-def-src { font-size: 12px; font-weight: 600; color: #2d3748; }
.gc-def-matched { font-size: 11px; color: #a0aec0; font-style: italic; }
.gc-def-link { font-size: 12px; color: #718096; text-decoration: none; }
.gc-def-link:hover { color: #4299e1; }
.gc-def-append { margin-left: auto; font-size: 12px; padding: 3px 9px; border: 1px solid #b2f5ea; background: #e6fffa; color: #234e52; border-radius: 12px; cursor: pointer; }
.gc-def-append:hover { background: #b2f5ea; }
.gc-def-text { font-size: 12.5px; color: #4a5568; line-height: 1.5; }
/* per-source accent on the card's left border */
.gc-def-wiktionary { border-left-color: #4299e1; }
.gc-def-wikipedia  { border-left-color: #2d3748; }
.gc-def-wikidata   { border-left-color: #6b46c1; }
.gc-def-yorkshire  { border-left-color: #38a169; }
.gc-def-dsl        { border-left-color: #805ad5; }
.gc-def-comercio   { border-left-color: #dd6b20; }
.gc-def-live-row { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; }
.gc-def-live-lbl { color: #718096; }
.gc-def-live { color: #4a5568; text-decoration: none; border: 1px solid #e2e8f0; border-radius: 12px; padding: 2px 9px; background: #f7fafc; }
.gc-def-live:hover { background: #edf2f7; }

.gc-spinner-dot { width: 28px; height: 28px; border: 3px solid #e2e8f0; border-top-color: #4299e1; border-radius: 50%; margin: 6px auto; animation: gc-spin 0.8s linear infinite; }
@keyframes gc-spin { to { transform: rotate(360deg); } }

/* ---- filter counts ---- */
.gc-cnt { background: #edf2f7; color: #4a5568; border-radius: 8px; padding: 0 6px; font-size: 10px; font-weight: 600; }

/* ---- headword row ---- */
.gc-hw-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gc-hw-row select, .gc-hw-row input { padding: 4px 6px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 13px; }

/* ---- concepts: material tag + related ---- */
.gc-mat-tag { background: #fbd38d; color: #7b341e; font-size: 10px; font-weight: 700; border-radius: 3px; padding: 0 5px; text-transform: uppercase; }
.gc-sub { font-size: 11px; color: #a0aec0; text-transform: none; letter-spacing: 0; }
.gc-rel-list { display: flex; flex-wrap: wrap; gap: 8px; }
.gc-rel { display: inline-flex; align-items: center; gap: 4px; background: #faf5ff; border: 1px solid #e9d8fd; border-radius: 14px; padding: 3px 6px 3px 11px; font-size: 13px; }
.gc-rel a { color: #6b46c1; text-decoration: none; }
.gc-related-results { max-height: 320px; overflow-y: auto; border: 1px solid #edf2f7; border-radius: 6px; }
.gc-rr { padding: 7px 10px; cursor: pointer; border-bottom: 1px solid #f7fafc; font-size: 13px; }
.gc-rr:hover { background: #f0f5ff; }

/* ---- description tools + instruction modes ---- */
.gc-desc-tools { display: flex; gap: 6px; }
.btn-outline { background: #fff; border: 1px solid #cbd5e0; color: #4a5568; }
.btn-outline:hover { background: #f7fafc; }
.gc-modes { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; }
.gc-mode { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: #4a5568; cursor: pointer; }

/* ---- reviewed lock ---- */
.gc-body.gc-locked { background: #fffaf0; border-radius: 8px; padding: 10px; position: relative; }
.gc-body.gc-locked .gc-context,
.gc-body.gc-locked .gc-section { opacity: 0.55; pointer-events: none; }
.gc-entry-head.locked h2 { color: #975a16; }

/* ---- wide 2-column AAT picker with sticky footer ---- */
.gc-picker-wide {
    width: 1100px !important; max-width: 95vw !important; max-height: 90vh !important;
    display: flex !important; flex-direction: column; overflow: hidden !important;
}
.gc-picker-cols { display: flex; gap: 16px; flex: 1 1 auto; min-height: 0; height: 58vh; }
.gc-picker-left { flex: 1.5 1 0; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.gc-picker-left .aat-search-results { flex: 0 0 auto; max-height: 38%; overflow-y: auto; }
.gc-picker-left .aat-tree { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.gc-picker-right { flex: 1 1 0; overflow-y: auto; border-left: 1px solid #e2e8f0; padding-left: 16px; min-width: 0; }
.gc-picker-footer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 0 0 auto; padding-top: 12px; margin-top: 12px; border-top: 1px solid #e2e8f0; }
.gc-footer-spacer { flex: 1 1 auto; }
.gc-material-toggle { font-size: 13px; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.gc-material-toggle strong { color: #b7791f; }
.gc-hw-note { font-size: 11px; color: #a0aec0; }
.gc-hw-note code { background: #edf2f7; padding: 0 4px; border-radius: 3px; }
.gc-b-note { background: #bee3f8; color: #2a4365; }
.gc-b-help { background: #fed7d7; color: #822727; }
.gc-note { width: 100%; padding: 10px; border: 1px solid #cbd5e0; border-radius: 6px; font-size: 14px; font-family: inherit; line-height: 1.5; resize: vertical; background: #f7fbff; }
.gc-sym { cursor: help; }
.gc-unc { cursor: help; }
.gc-b-chk { background: #e2e8f0; color: #4a5568; }
.gc-local { color: #718096; font-style: italic; }
.gc-tip {
    position: fixed; z-index: 2000; max-width: 320px; pointer-events: none;
    background: #1a202c; color: #f7fafc; font-size: 12px; line-height: 1.5;
    padding: 7px 10px; border-radius: 6px; white-space: pre-line;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.gc-sample { font-size: 13px; line-height: 1.55; padding: 7px 10px; margin-bottom: 6px; background: #fff; border: 1px solid #edf2f7; border-radius: 5px; }
.gc-sample mark { background: #fefcbf; color: inherit; padding: 0 2px; border-radius: 2px; font-weight: 600; }
.gc-banner { background: #fffaf0; border-bottom: 1px solid #f6e05e; color: #744210; padding: 8px 18px; font-size: 13px; flex: 0 0 auto; }
.gc-banner[hidden] { display: none; }
.gc-banner a { color: #975a16; }

/* ── Concepts ↔ Qualifiers mode switch ─────────────────────────────────── */
.gc-mode-switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; margin-right: 12px; }
.gc-mode-switch input { display: none; }
.gc-mode-slider { position: relative; width: 38px; height: 20px; background: #5a6678; border-radius: 10px; transition: background .15s; }
.gc-mode-slider::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .15s; }
.gc-mode-switch input:checked + .gc-mode-slider { background: #b794f4; }
.gc-mode-switch input:checked + .gc-mode-slider::after { transform: translateX(18px); }
/* labels sit on the dark header — keep them light and high-contrast */
.gc-mode-lbl { font-size: 12px; color: #cbd5e0; font-weight: 600; }
body:not(.gc-mode-qualifiers) .gc-mode-concepts { color: #fff; }
body.gc-mode-qualifiers .gc-mode-quals { color: #e9d8fd; }

/* brighter, readable header title */
.gc-header-title h1 { color: #fff; font-weight: 700; }
.gc-subtitle { color: #cbd5e0; }

/* qualifier-mode list/editor chrome */
.gc-quals-only { display: none; }
body.gc-mode-qualifiers #gc-new-qual-btn { display: inline-block; margin: 0 10px 8px; }
body.gc-mode-qualifiers .gc-filters { display: none; }
.gc-qfilters { display: none; flex-wrap: wrap; gap: 8px 12px; padding: 8px 10px; border-bottom: 1px solid #edf2f7; font-size: 12px; color: #4a5568; }
.gc-qfilters label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
body.gc-mode-qualifiers .gc-qfilters { display: flex; }
.gc-mini-lbl { font-size: 10px; color: #a0aec0; text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.gc-qual-label { font-size: 18px; font-weight: 600; border: 1px solid #d6dae2; border-radius: 4px; padding: 3px 8px; min-width: 220px; }
.gc-section { margin: 14px 0; }
.gc-forms { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0; }
.gc-form-chip { display: inline-flex; align-items: center; gap: 4px; background: #eef1f6; border: 1px solid #d6dae2; border-radius: 12px; padding: 1px 4px 1px 9px; font-size: 13px; }
.gc-form-chip .gc-x { border: none; background: none; cursor: pointer; color: #99a; font-size: 14px; line-height: 1; }
.gc-form-chip .gc-x:hover { color: #c0392b; }
.gc-form-add { display: flex; gap: 6px; margin-top: 4px; }
.gc-form-add input { border: 1px solid #d6dae2; border-radius: 4px; padding: 3px 8px; }
.gc-geo-pt { color: #888; font-size: 12px; margin-left: 4px; }
.gc-compose-hint { color: #a0aec0; font-weight: normal; font-style: italic; font-size: 11px; }

/* subtle background distinction between the two editing modes */
body.gc-mode-qualifiers { background: #f6f4fb; }
body.gc-mode-qualifiers .gc-editor { background: #faf9fe; }
body.gc-mode-qualifiers .gc-list-pane { background: #fdfdff; }
.gc-b-note { background: #fefcbf; color: #744210; }
.gc-b-help { background: #fed7d7; color: #822727; }
.gc-b-chk { background: #bee3f8; color: #2a4365; }
.gc-b-edit { background: #c6f6d5; color: #22543d; }

/* 3-way mode segmented control (replaces the 2-way switch) */
.gc-mode-seg { display: inline-flex; border: 1px solid #5a6678; border-radius: 6px; overflow: hidden; }
.gc-seg-btn { background: transparent; color: #cbd5e0; border: none; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.gc-seg-btn + .gc-seg-btn { border-left: 1px solid #5a6678; }
.gc-seg-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.gc-seg-btn.active { background: #b794f4; color: #1a202c; }
.gc-seg-btn:disabled, .gc-seg-btn.gc-disabled { color: #6b7280; cursor: not-allowed; opacity: 0.55; }
.gc-seg-btn:disabled:hover, .gc-seg-btn.gc-disabled:hover { background: transparent; color: #6b7280; }
/* "added since leftover work" review flag */
.gc-b-new { background: #fefcbf; color: #744210; }
/* unattested concept/qualifier (no corpus anchors) */
.gc-b-unatt { background: #edf2f7; color: #718096; }
/* un-promoted raw qualifier + its corpus-attestation count */
.gc-b-raw { background: #feebc8; color: #7b341e; }
.gc-b-att { background: #e6fffa; color: #234e52; font-variant-numeric: tabular-nums; }

/* raw-qualifier promote actions + fold picker rows */
.gc-promote-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gc-pick-row { padding: 7px 9px; border-radius: 5px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.gc-pick-row:hover { background: #ebf8ff; }
.gc-pick-row .gc-sub { font-size: 12px; color: #718096; }

/* qualifier "attested on" concept links */
.gc-qual-concepts { line-height: 1.9; }
.gc-qual-concept { color: #6b46c1; text-decoration: none; }
.gc-qual-concept:hover { text-decoration: underline; }

/* Leftovers mode chrome */
.gc-lofilters { display: none; flex-wrap: wrap; gap: 8px 12px; padding: 8px 10px; border-bottom: 1px solid #edf2f7; font-size: 12px; color: #4a5568; }
.gc-lofilters label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.gc-lofilters label.gc-filter-done { opacity: 0.4; }
.gc-lofilters label.gc-filter-done .gc-cnt { color: #2e7d32; }
body.gc-mode-leftovers .gc-lofilters { display: flex; }
body.gc-mode-leftovers .gc-filters,
body.gc-mode-leftovers .gc-qfilters { display: none; }
body.gc-mode-leftovers { background: #f3f7f4; }
body.gc-mode-leftovers .gc-editor { background: #f9fcfa; }
.gc-lo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.gc-lo-decided { background: #ebf8ff; border: 1px solid #bee3f8; border-radius: 6px; padding: 6px 10px; margin-bottom: 12px; font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gc-lo-maps { flex: 1 1 100%; display: flex; flex-direction: column; gap: 5px; }
.gc-lo-map-row { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #cfe6f6; border-radius: 5px; padding: 4px 8px; }
.gc-lo-map-row strong { color: #2b6cb0; }
.gc-lo-map-row .btn { margin-left: auto; }
#gc-lo-search { width: 100%; padding: 7px 10px; border: 1px solid #cbd5e0; border-radius: 5px; font-size: 13px; margin-bottom: 6px; }
.gc-sample { background: #fff; border: 1px solid #edf2f7; border-radius: 5px; padding: 7px 10px; margin-bottom: 6px; font-size: 13px; line-height: 1.5; }
.gc-sample mark { background: #fefcbf; padding: 0 2px; border-radius: 2px; }
.btn-warning { background: #ed8936; color: #fff; border: none; }

/* Leftovers: nearest-existing list */
.gc-lo-near-list { display: flex; flex-direction: column; gap: 5px; }
.gc-lo-near-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid #edf2f7; border-radius: 6px; padding: 5px 10px; }
.gc-lo-near-lbl { font-size: 13px; }
.gc-lo-store { display: inline-block; min-width: 64px; font-size: 10px; text-transform: uppercase; letter-spacing: .03em; color: #718096; }
.gc-b-revd { background: #c6f6d5; color: #22543d; }
.gc-rr-head { font-size: 13px; }
.gc-rr-desc { font-size: 11px; color: #718096; margin-top: 2px; line-height: 1.35; }
.gc-lo-hint-tag { font-size: 10px; color: #a0aec0; text-transform: uppercase; letter-spacing: .04em; border: 1px solid #e2e8f0; border-radius: 4px; padding: 1px 6px; }

/* A related concept in someone else's vocabulary (entry.relatedConcepts): related
   to the commodity but not a type of it, so it is not in entry.aat. Dashed, to say
   it links out rather than to another entry here. */
.gc-rel-ext { background: #f7f5ff; border-style: dashed; padding-right: 11px; }
.gc-rel-ext a { color: #5f4374; }
