/* ============================================================
   Epoch Trader Editor — tool stylesheet
   dze.armatools.com/trader-editor
   ============================================================ */
:root {
  --bg:          #0d0d0d;
  --bg-panel:    #111111;
  --bg-card:     #1c1c1c;
  --bg-card2:    #222222;
  --border:      #2a2a2a;
  --border-hi:   #3e5a28;
  --accent:      #4e8a2e;
  --accent-hi:   #62ae3a;
  --accent-dim:  #2e5018;
  --text:        #d0d0d0;
  --text-muted:  #5e5e5e;
  --text-hi:     #eaeaea;
  --danger:      #c0392b;
  --danger-hi:   #e74c3c;
  --warning:     #d68910;
  --radius:      6px;
  --shadow:      0 2px 12px rgba(0,0,0,.55);
  --font:        'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono:        'Consolas', 'Courier New', monospace;
  --max-w:       min(1680px, 97vw);
}

/* ============================================================
   LIGHT THEME
   ============================================================ */
[data-theme="light"] {
  --bg:          #f5f5f4;
  --bg-panel:    #ececea;
  --bg-card:     #ffffff;
  --bg-card2:    #f0f0ee;
  --border:      #cccccc;
  --border-hi:   #5a9e30;
  --accent:      #3d7020;
  --accent-hi:   #2e5818;
  --accent-dim:  #cce4b0;
  --text:        #222222;
  --text-muted:  #777777;
  --text-hi:     #111111;
  --shadow:      0 2px 12px rgba(0,0,0,.10);
}

[data-theme="light"] .site-nav {
  background: #e4e4e2;
}

[data-theme="light"] .site-nav-links a {
  color: #666;
}

[data-theme="light"] code {
  background: #eef4e8;
  border-color: #b8d898;
  color: #2e6010;
}

[data-theme="light"] .notes-box {
  background: #f2f9eb;
  border-color: #b8d898;
}

[data-theme="light"] .bulk-edit-panel {
  background: #f4f8f0;
}

[data-theme="light"] .stats-bar {
  background: #efefed;
}

[data-theme="light"] .export-note {
  background: #fffce8;
  border-color: #d4c060;
}

[data-theme="light"] .status-bar {
  background: #f0f8e8;
  border-color: #90c860;
}

[data-theme="light"] .drop-zone {
  border-color: #b8b8b8;
}
[data-theme="light"] .drop-zone:hover,
[data-theme="light"] .drop-zone.drag-over {
  border-color: var(--accent);
  background: #e8f4dc;
}

[data-theme="light"] .btn-outline {
  color: #333;
  border-color: #bbb;
}
[data-theme="light"] .btn-secondary {
  background: #ddeec8;
  color: var(--accent);
  border-color: #a8cc88;
}
[data-theme="light"] .btn-secondary:hover { background: #cce4b0; }

[data-theme="light"] .tool-header {
  background: #e8f2de;
  border-bottom-color: #b8d4a0;
}

/* Tabulator light overrides */
[data-theme="light"] .tabulator                            { background: #ffffff !important; }
[data-theme="light"] .tabulator .tabulator-header          { background: #e8f2de !important; }
[data-theme="light"] .tabulator .tabulator-header .tabulator-col {
  background: transparent !important;
  color: #2e6010 !important;
  border-right: 1px solid #ccc !important;
}
[data-theme="light"] .tabulator .tabulator-row            { background: #ffffff !important; border-bottom: 1px solid #e3e3e0 !important; color: #1c1c1c !important; }
[data-theme="light"] .tabulator .tabulator-row:nth-child(even) { background: #eef4e6 !important; }
[data-theme="light"] .tabulator .tabulator-row:hover       { background: #e2efd2 !important; }
[data-theme="light"] .tabulator .tabulator-row.tabulator-selected { background: #d8ecbe !important; }
[data-theme="light"] .tabulator .tabulator-cell { color: #1c1c1c !important; }
[data-theme="light"] .tabulator .tabulator-cell            { border-right: 1px solid #e8e8e8 !important; color: #222 !important; }
[data-theme="light"] .tabulator .tabulator-cell.tabulator-editing input,
[data-theme="light"] .tabulator .tabulator-cell.tabulator-editing select {
  background: #eaf4dc !important;
  color: #111 !important;
  border: 1px solid var(--accent) !important;
}
[data-theme="light"] .tabulator-header-filter input,
[data-theme="light"] .tabulator-header-filter select {
  background: #ffffff !important;
  color: #555 !important;
  border: 1px solid #ccc !important;
}
[data-theme="light"] .tabulator .tabulator-footer {
  background: #f0f0ee !important;
  border-top: 1px solid #ccc !important;
  color: #777 !important;
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent-hi); text-decoration: none; }
a:hover { color: var(--text-hi); }

code {
  font-family: var(--mono);
  background: #1e1e1e;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: .875em;
  color: #98d66e;
}

em.muted { color: var(--text-muted); font-style: normal; font-size: .85em; }
.hidden { display: none !important; }

/* ============================================================
   SITE NAV (shared with landing)
   ============================================================ */
.site-nav {
  background: #0a0a0a;
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-hi);
  letter-spacing: .02em;
  text-decoration: none;
}
.site-brand:hover { color: var(--accent-hi); }
.site-brand-icon { font-size: 1.25rem; }
.site-brand-dim { color: var(--text-muted); font-weight: 400; }

.site-nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav-links a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: .25rem 0;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.site-nav-links a:hover,
.site-nav-links a.active {
  color: var(--accent-hi);
  border-bottom-color: var(--accent);
}

/* ============================================================
   TOOL HEADER (sub-page banner)
   ============================================================ */
.tool-header {
  background: linear-gradient(160deg, #0e1a09 0%, #0d0d0d 60%);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 1.25rem;
}

.tool-header-inner {
  max-width: min(960px, 96vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tool-header-title {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.tool-header-icon {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px var(--accent));
}

.tool-header-title h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-hi);
}

.tool-header-sub {
  font-size: .82rem;
  color: var(--text-muted);
}

.tool-header-link {
  font-size: .85rem;
  font-weight: 600;
  color: #62ae3a;
  border: 1px solid #2e5018;
  border-radius: var(--radius);
  padding: .35rem .85rem;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
  text-decoration: none;
}
.tool-header-link:hover {
  background: #2e5018;
  color: var(--text-hi);
  border-color: var(--accent);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
main {
  flex: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-hi);
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .65rem;
}

.card-desc {
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 50%;
  font-size: .8rem;
  font-weight: 800;
  color: var(--accent-hi);
  flex-shrink: 0;
}

/* ============================================================
   NOTES BOX
   ============================================================ */
.notes-box {
  margin-top: 1rem;
  padding: .75rem 1rem;
  background: #141a0f;
  border: 1px solid #2a3a18;
  border-radius: var(--radius);
  font-size: .83rem;
  color: var(--text-muted);
}

.notes-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: .4rem;
}

.notes-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.notes-box ul li::before {
  content: '○ ';
  color: var(--accent);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: none;
  border-radius: var(--radius);
  padding: .5rem 1.1rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, opacity .15s;
  font-family: var(--font);
}
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover  { background: var(--accent-hi); }

.btn-secondary { background: #2a3f20; color: var(--accent-hi); border: 1px solid var(--accent-dim); }
.btn-secondary:hover { background: var(--accent-dim); }

.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-hi); }

.btn-danger  { background: #3a1010; color: var(--danger-hi); border: 1px solid #5a1515; }
.btn-danger:hover  { background: #5a1515; }

.btn-sm { padding: .3rem .75rem; font-size: .82rem; }

/* ============================================================
   IMPORT
   ============================================================ */
.import-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
}

@media (max-width: 640px) {
  .import-grid { grid-template-columns: 1fr; }
  .import-or   { text-align: center; }
}

.drop-zone {
  position: relative;
  background: var(--bg-card2);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: border-color .2s, background .2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: #1a2a12;
}

/* "Recommended" badge on the folder drop zone */
.drop-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
#folder-drop-zone { border-color: var(--border-hi); }
.drop-zone input[type="file"] { display: none; }

.drop-icon  { font-size: 2.2rem; line-height: 1; }
.drop-label { font-weight: 600; color: var(--text-hi); }
.drop-hint  { font-size: .8rem; color: var(--text-muted); }

.import-or {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: .5rem;
}

/* ============================================================
   STATUS / STATS
   ============================================================ */
.status-bar {
  margin-top: 1rem;
  padding: .6rem 1rem;
  background: #1a2a12;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  font-size: .85rem;
  color: var(--accent-hi);
}

.stats-bar {
  display: flex;
  gap: .5rem;
  align-items: center;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
  padding: .4rem .75rem;
  background: #181818;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stats-bar span { color: var(--text); }
.stats-sep { color: var(--border); }

/* ============================================================
   TOOLBAR
   ============================================================ */
.toolbar {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}

.toolbar-left, .toolbar-right {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Search field: icon + input wrapped so the magnifier sits inside the box */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 360px;
  min-width: 240px;
  max-width: 580px;
}
.search-icon {
  position: absolute;
  left: .7rem;
  font-size: 1rem;
  pointer-events: none;
  opacity: .85;
}
.search-input {
  background: var(--bg-card2);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  color: var(--text);
  padding: .65rem .9rem .65rem 2.3rem;
  font-size: .98rem;
  width: 100%;
  font-family: var(--font);
  box-shadow: 0 0 0 1px rgba(78,138,46,.15);
  transition: border-color .15s, box-shadow .15s;
}
.search-input::placeholder { color: var(--text-muted); opacity: 1; }
.search-input:focus {
  outline: none;
  border-color: var(--accent-hi);
  box-shadow: 0 0 0 3px rgba(78,138,46,0.25);
}

.filter-select {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: .35rem .6rem;
  font-size: .85rem;
  font-family: var(--font);
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--accent); }

/* let the search/filter group expand to fill the toolbar width */
.toolbar-left { flex: 1 1 auto; }

/* undo / redo */
.undo-redo-group {
  display: inline-flex;
  gap: 2px;
  margin-right: .25rem;
  border-right: 1px solid var(--border);
  padding-right: .5rem;
}
#undo-btn:disabled,
#redo-btn:disabled { opacity: .4; cursor: default; }

/* search + filter clarity hint under the toolbar */
.toolbar-hint {
  font-size: .78rem;
  color: var(--text-muted);
  margin: -.4rem 0 .85rem;
  line-height: 1.5;
}
.toolbar-hint strong { color: var(--text); font-weight: 600; }
.toolbar-hint kbd {
  font-family: var(--mono);
  font-size: .85em;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
  color: var(--text);
}

/* ============================================================
   BULK EDIT
   ============================================================ */
.bulk-edit-panel {
  background: #161a12;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  overflow: hidden;
}

.bulk-edit-panel summary {
  padding: .5rem .85rem;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
  list-style: none;
}
.bulk-edit-panel summary::marker { display: none; }
.bulk-edit-panel[open] summary { color: var(--accent-hi); }

.bulk-edit-inner {
  padding: .75rem .85rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .88rem;
}

.bulk-edit-inner label {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}

.bulk-num-input {
  width: 70px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: .2rem .4rem;
  font-size: .88rem;
  font-family: var(--font);
  text-align: center;
}
.bulk-num-input:focus { outline: none; border-color: var(--accent); }

.bulk-edit-inner select {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: .2rem .4rem;
  font-size: .88rem;
  font-family: var(--font);
}

/* ============================================================
   TABULATOR OVERRIDES
   ============================================================ */
#data-table {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.tabulator {
  background: #161616 !important;
  border: none !important;
  font-family: var(--font) !important;
  font-size: .85rem !important;
}

.tabulator .tabulator-header {
  background: #1e2a15 !important;
  border-bottom: 1px solid var(--border-hi) !important;
}

.tabulator .tabulator-header .tabulator-col {
  background: transparent !important;
  border-right: 1px solid var(--border) !important;
  color: var(--accent-hi) !important;
  font-weight: 700 !important;
  font-size: .8rem !important;
  letter-spacing: .04em !important;
}

.tabulator .tabulator-row { background: #1a1a1a !important; border-bottom: 1px solid #232323 !important; }
.tabulator .tabulator-row:nth-child(even) { background: #1f1f1f !important; }
.tabulator .tabulator-row:hover { background: #26331a !important; }
.tabulator .tabulator-row.tabulator-selected { background: #2c4020 !important; }

.tabulator .tabulator-cell {
  border-right: 1px solid #1e1e1e !important;
  color: var(--text) !important;
}

.tabulator .tabulator-cell.tabulator-editing input,
.tabulator .tabulator-cell.tabulator-editing select {
  background: #1a2a12 !important;
  color: var(--text-hi) !important;
  border: 1px solid var(--accent) !important;
  padding: 2px 5px !important;
  font-size: .85rem !important;
}

.tabulator-header-filter input,
.tabulator-header-filter select {
  background: #111 !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border) !important;
  font-size: .78rem !important;
  border-radius: 3px !important;
}

.tabulator .tabulator-footer {
  background: #1a1a1a !important;
  border-top: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
  font-size: .8rem !important;
}

/* ============================================================
   EXPORT
   ============================================================ */
.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 640px) { .export-grid { grid-template-columns: 1fr; } }

.export-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.export-card h3 { font-size: .95rem; color: var(--text-hi); }
.export-card p  { font-size: .85rem; color: var(--text-muted); }

.economy-toggle {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .85rem;
}
.economy-toggle label {
  display: flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
}
.economy-toggle input[type="radio"] { accent-color: var(--accent); }

.export-note {
  font-size: .82rem;
  color: var(--text-muted);
  padding: .5rem .75rem;
  border: 1px solid #2a2000;
  border-radius: var(--radius);
  background: #1a1500;
}

/* ============================================================
   DELETE CELL ICON
   ============================================================ */
.delete-row-btn {
  cursor: pointer;
  color: var(--danger-hi);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.delete-row-btn:hover { color: #ff6b6b; }

/* ============================================================
   THEME TOGGLE
   ============================================================ */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  padding: .22rem .55rem;
  font-size: .95rem;
  cursor: pointer;
  line-height: 1;
  transition: border-color .15s, color .15s;
  font-family: var(--font);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent-hi); }

/* ============================================================
   EXAMPLE CSV LINK
   ============================================================ */
.example-csv-link {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .2rem;
}
.example-csv-link a {
  color: var(--accent-hi);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.example-csv-link a:hover { color: var(--text-hi); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .toolbar { flex-direction: column; align-items: flex-start; }
  .search-input { width: 100%; }
}

/* ============================================================
   ADD-ROW MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3vh 1rem 2rem;
  z-index: 1000;
  overflow-y: auto;
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
}

.modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-hi);
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.modal-close:hover { background: var(--bg-card2); color: var(--text-hi); }

.modal-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Type selector ── */
.ar-type-selector {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.ar-type-prompt {
  font-size: .8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ar-type-btns {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.ar-type-btn {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: .82rem;
  padding: .3rem .65rem;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.ar-type-btn:hover {
  background: var(--bg-panel);
  border-color: var(--accent);
  color: var(--text);
}
.ar-type-btn-active {
  background: var(--accent-dim) !important;
  border-color: var(--accent-hi) !important;
  color: var(--text-hi) !important;
  font-weight: 600;
}

/* ── Fields ── */
.ar-fields {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.ar-label {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: .82rem;
  color: var(--text-muted);
}
.ar-label-wide { width: 100%; }
.ar-input {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-hi);
  padding: .35rem .55rem;
  font-size: .88rem;
  font-family: var(--mono);
  width: 100%;
  box-sizing: border-box;
}
.ar-input:focus {
  outline: none;
  border-color: var(--accent-hi);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
.ar-row-inline {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.ar-row-inline .ar-label { flex: 1 1 120px; min-width: 80px; }
.ar-row-inline .ar-label-grow { flex: 2 1 200px; }

/* ── Classname group (input + picker, kept together) ── */
.ar-classname-group {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

/* ── Classname picker ── */
.ar-picker {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.modal-class-search {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-hi);
  padding: .35rem .55rem;
  font-size: .88rem;
}
.modal-class-search:focus {
  outline: none;
  border-color: var(--accent-hi);
}

.base-arma-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.base-arma-label input { cursor: pointer; }
.base-arma-label.hidden { display: none; }

/* ── Chip categories (reuse loot-editor pattern) ── */
.zombie-quick-cats {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-height: 340px;
  overflow-y: auto;
  padding: .25rem .1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
}
.zombie-quick-cats.hidden { display: none; }

.zombie-cat { padding: .2rem .45rem; }
.zombie-cat-label {
  font-size: .73rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .25rem;
}
.zombie-cat-chips { display: flex; flex-wrap: wrap; gap: 4px; }

.zombie-chip {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-size: .75rem;
  font-family: var(--mono);
  padding: 2px 6px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.zombie-chip:hover {
  background: var(--accent-dim);
  border-color: var(--accent-hi);
  color: var(--text-hi);
}

/* ── Display names chips ──────────────────────────────────────── */
.dn-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.dn-toggle { font-size: 0.76rem; padding: 2px 8px; }
.dn-toggle.active { border-color: var(--accent-hi); color: var(--accent-hi); }
.chip-has-dn {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  padding: 3px 7px; line-height: 1.3; font-family: inherit;
}
.chip-dn  { font-size: 0.74rem; color: var(--text-hi); }
.chip-cn-sub { font-size: 0.62rem; color: var(--text); font-family: var(--mono); }
.dn-upload-btn {
  font-size: 0.76rem; padding: 2px 9px; cursor: pointer; display: inline-flex;
  align-items: center; gap: 0.3rem;
}
.dn-upload-status {
  font-size: 0.77rem; color: var(--accent-hi); padding: 2px 0;
}

/* Table display name cells */
.tbl-dn     { display: block; font-size: 0.82rem; color: var(--text-hi); }
.tbl-cn-sub { display: block; font-size: 0.7rem; color: var(--text); font-family: var(--mono); }

/* Chip search input */
.ar-class-search {
  flex: 1; min-width: 120px; max-width: 200px;
  background: var(--bg-input, var(--bg-card2)); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); padding: 3px 8px; font-size: 0.78rem;
}
.ar-class-search:focus { outline: none; border-color: var(--accent-hi); }

/* ── Footer ── */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
}

/* ── Label header row (text + info icon) ── */
.ar-label-hdr {
  display: flex;
  align-items: center;
  gap: .3rem;
}

/* ── Where section (filename + category) ── */
.ar-where-section {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.ar-where-row {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.ar-where-file {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.ar-select {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.ar-new-file-row {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.ar-new-file-err {
  font-size: .75rem;
  color: var(--danger-hi, #e05050);
}
.ar-where-cat {
  max-width: 160px;
}

/* ── Info tooltip icon ── */
.tip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: .72rem;
  color: var(--text-muted);
  cursor: help;
  position: relative;
  flex-shrink: 0;
  line-height: 1;
}
.tip-icon::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: .45rem .6rem;
  font-size: .77rem;
  line-height: 1.55;
  color: var(--text);
  white-space: normal;
  width: 240px;
  pointer-events: none;
  opacity: 0;
  z-index: 200;
  transition: opacity .15s;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
  text-align: left;
}
.tip-icon:hover::after { opacity: 1; }

/* ── Duplicate category warning ── */
.dup-cat-warning {
  background: #2a1a0a;
  border: 1px solid #c07020;
  border-radius: var(--radius);
  padding: .55rem .8rem;
  font-size: .82rem;
  color: #e9a050;
  line-height: 1.65;
  margin-top: .5rem;
}
.dup-cat-warning code {
  background: rgba(0,0,0,.3);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: .85em;
}

/* ── Category preview panel ── */
.ar-cat-preview {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .5rem .6rem;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .78rem;
  margin-top: .2rem;
}
.ar-cat-preview-lbl {
  font-size: .73rem;
  color: var(--text-muted);
  margin-bottom: .1rem;
}
.ar-cat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .3rem .5rem;
  cursor: pointer;
  color: var(--text);
  display: flex;
  gap: .5rem;
  align-items: baseline;
  text-align: left;
  width: 100%;
  font-size: .78rem;
  transition: border-color .12s, background .12s;
}
.ar-cat-pill:hover { border-color: var(--accent-hi); background: var(--bg-card2); }
.ar-cat-num  { font-family: var(--mono); font-weight: 600; color: var(--accent-hi); flex-shrink: 0; }
.ar-cat-type { color: var(--text-muted); font-style: italic; flex-shrink: 0; }
.ar-cat-count { color: var(--text-muted); flex-shrink: 0; font-size: .73rem; }
.ar-cat-sample { color: var(--text-dim, #888); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; font-size: .73rem; }
