/*
 * components.css — Dropdowns, modal, subscribe, hearing timeline
 * Apple × Notion design system
 */

/* ================================================================
   DROPDOWN MENUS
   ================================================================ */
.fdrop-menu {
  display: none; position: fixed; z-index: 9000;
  background: rgba(250,250,249,.95);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 0.5px solid rgba(0,0,0,.1);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
  min-width: 265px;
  max-height: 480px;          /* cap total height */
  display: none;
  flex-direction: column;     /* stack header / body / actions */
}
.fdrop-menu.open { display: flex; }


.fm-hd {
  padding: 11px 16px 8px; font-size: 9.5px; font-weight: 700;
  color: var(--ink-4); text-transform: uppercase; letter-spacing: .07em;
  border-bottom: 0.5px solid var(--line);
}
.fm-body    { padding: 12px 16px; display: flex; flex-direction: column; gap: 9px; flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--paper-3) transparent; }
.fm-label   { font-size: 11.5px; color: var(--ink-1); font-weight: 600; letter-spacing: -.01em; }
.fm-hint    { font-size: 11px; color: var(--ink-4); }
.fm-divider { border-top: 0.5px solid var(--line); margin: 2px 0; }

.fchk-list {
  max-height: 168px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 5px;
  scrollbar-width: thin; scrollbar-color: var(--paper-3) transparent;
}
.fchk-list::-webkit-scrollbar { width: 4px; }
.fchk-list::-webkit-scrollbar-thumb { background: var(--paper-3); border-radius: 2px; }
.fchk {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 3px 0; font-size: 12px; color: var(--ink-2); transition: color .12s; letter-spacing: -.01em;
}
.fchk:hover { color: var(--ink-1); }
.fchk input { accent-color: var(--ink-1); cursor: pointer; width: 14px; height: 14px; flex-shrink: 0; }
.fchk-dot   { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; border: 0.5px solid rgba(0,0,0,.1); }
.fchk-group-hd {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-4); padding: 8px 0 3px; border-top: 0.5px solid var(--line); margin-top: 2px;
}
.fchk-group-hd:first-child { border-top: none; padding-top: 2px; margin-top: 0; }

.preset-row { display: flex; gap: 5px; flex-wrap: wrap; }
.preset-btn {
  border: 0.5px solid var(--line-2); border-radius: 8px;
  padding: 4px 9px; font-size: 11px; font-weight: 500;
  color: var(--ink-3); background: var(--white); cursor: pointer;
  font-family: var(--font); transition: all .15s;
}
.preset-btn:hover { background: var(--paper-2); color: var(--ink-1); }
.preset-btn.on { background: var(--ink-1); color: var(--white); border-color: var(--ink-1); }

.date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.date-grid label { font-size: 10px; color: var(--ink-4); display: block; margin-bottom: 3px; font-weight: 500; letter-spacing: .02em; }
.fm-date {
  width: 100%; border: 0.5px solid var(--line-2); border-radius: 8px;
  padding: 6px 8px; font-size: 12px; color: var(--ink-1);
  font-family: var(--font); background: var(--white); transition: border-color .15s;
}
.fm-date:focus { outline: none; border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.fm-sel {
  width: 100%; border: 0.5px solid var(--line-2); border-radius: 8px;
  padding: 6px 8px; font-size: 12px; color: var(--ink-1);
  font-family: var(--font); background: var(--white); transition: border-color .15s;
}
.fm-sel:focus { outline: none; border-color: var(--ink-3); }

.buf-slider  { width: 100%; accent-color: var(--ink-1); }
.fm-actions { display: flex; gap: 6px; padding: 9px 16px 12px; border-top: 0.5px solid var(--line); flex-shrink: 0; }
.fm-apply {
  flex: 1; background: var(--ink-1); color: var(--white); border: none;
  border-radius: var(--radius-pill); padding: 7px;
  font-family: var(--font); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background .15s; letter-spacing: -.01em;
}
.fm-apply:hover { background: var(--ink-2); }
.fm-clear {
  background: none; color: var(--ink-3); border: 0.5px solid var(--line-2);
  border-radius: var(--radius-pill); padding: 7px 13px;
  font-family: var(--font); font-size: 12px; cursor: pointer; transition: all .15s;
}
.fm-clear:hover { border-color: var(--ink-3); color: var(--ink-1); background: var(--paper-2); }

/* ================================================================
   MODAL
   ================================================================ */
#ov {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.38);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  align-items: flex-start; justify-content: center;
  padding-top: 52px; overflow-y: auto;
}
#ov.on { display: flex; }

#mb {
  background: var(--paper);
  border-radius: 20px;
  width: min(680px, 96vw); max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 28px 64px rgba(0,0,0,.2), 0 8px 20px rgba(0,0,0,.1), 0 0 0 0.5px rgba(0,0,0,.08);
  margin-bottom: 20px;
  scrollbar-width: thin; scrollbar-color: var(--paper-3) transparent;
}

#mh {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 22px 24px 16px;
  border-bottom: 0.5px solid var(--line);
  position: sticky; top: 0;
  background: rgba(250,250,249,.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  z-index: 1; border-radius: 20px 20px 0 0;
}
#mt { font-weight: 600; font-size: 17px; line-height: 1.3; color: var(--ink-1); letter-spacing: -.025em; }
#ms { font-size: 11px; color: var(--ink-4); margin-top: 3px; line-height: 1.5; letter-spacing: -.005em; }
#mh-right { display: flex; align-items: center; gap: 7px; flex-shrink: 0; margin-left: 12px; }

#zoom-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--paper-2); border: 0.5px solid var(--line-2); color: var(--ink-2);
  font-size: 11px; font-weight: 500; padding: 4px 11px; border-radius: 8px;
  cursor: pointer; font-family: var(--font); transition: all .15s;
}
#zoom-btn:hover { background: var(--white); box-shadow: var(--shadow-sm); }
#mx {
  border: none; background: none; font-size: 18px; cursor: pointer;
  color: var(--ink-4); padding: 3px; line-height: 1;
  border-radius: 8px; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
#mx:hover { color: var(--ink-1); background: var(--paper-2); }

.mtabs { display: flex; border-bottom: 0.5px solid var(--line); padding: 0 24px; gap: 2px; }
.mtab {
  font-size: 12px; font-weight: 500; color: var(--ink-4);
  padding: 12px 16px; cursor: pointer;
  border-bottom: 1.5px solid transparent; margin-bottom: -0.5px;
  white-space: nowrap; transition: all .18s; font-family: var(--font);
  letter-spacing: -.01em;
}
.mtab:hover { color: var(--ink-2); }
.mtab.on { color: var(--ink-1); border-bottom-color: var(--ink-1); font-weight: 600; }
.mtab-panel { display: none; padding: 20px 24px; }
.mtab-panel.on { display: block; }

/* Map popup */
.pp b { font-size: 13px; display: block; margin-bottom: 5px; color: var(--ink-1); font-weight: 600; letter-spacing: -.01em; }
.pp table { font-size: 11px; border-collapse: collapse; width: 100%; }
.pp td { padding: 2px 0; vertical-align: top; }
.pp td:first-child { color: var(--ink-4); width: 64px; padding-right: 8px; white-space: nowrap; font-size: 10px; }

/* Hearing phase tabs in modal */
.pb { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.pbt {
  background: var(--white); border: 0.5px solid var(--line-2); color: var(--ink-4);
  font-size: 11px; font-weight: 500; padding: 5px 13px; border-radius: var(--radius-pill);
  cursor: pointer; font-family: var(--font);
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .18s; letter-spacing: -.01em;
}
.pbt.has   { color: var(--ink-2); font-weight: 600; }
.pbt:hover { border-color: var(--line-2); background: var(--paper-2); color: var(--ink-1); }
.pbt.on    { background: var(--ink-1); border-color: var(--ink-1); color: var(--white); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.pc { background: rgba(0,0,0,.1); color: inherit; font-size: 9px; padding: 1px 6px; border-radius: 10px; font-weight: 700; }
.pbt.on .pc { background: rgba(255,255,255,.2); }

/* Hearing timeline */
.tl { display: flex; flex-direction: column; gap: 0; position: relative; padding-left: 22px; }
.tl::before { content: ''; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 1px; background: var(--line-2); border-radius: 1px; }
.ti { position: relative; margin-bottom: 4px; }
.dot { position: absolute; left: -18px; top: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--blue-600); border: 2px solid var(--white); box-shadow: 0 0 0 1.5px var(--blue-300); }
.dot.nh { background: var(--paper-3); box-shadow: 0 0 0 1.5px var(--line-2); }

.hrow {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 9px 12px; border-radius: 10px; cursor: pointer; gap: 8px;
  background: var(--white); border: 0.5px solid var(--line);
  transition: all .18s; box-shadow: var(--shadow-xs);
}
.hrow:hover { background: var(--paper); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.hrow.on    { background: var(--paper); border-color: var(--line-2); border-radius: 10px 10px 0 0; }
.hleft  { flex: 1; min-width: 0; }
.hd     { font-size: 12px; font-weight: 600; color: var(--ink-1); letter-spacing: -.01em; }
.ht     { font-size: 10px; color: var(--ink-4); margin-top: 2px; }
.hjudge { font-size: 10px; color: var(--blue-700); margin-top: 2px; font-weight: 500; }
.hw     { font-size: 10px; color: #92400E; margin-top: 2px; }
.hbadge { font-size: 9px; padding: 2px 7px; border-radius: 10px; font-weight: 600; white-space: nowrap; display: inline-block; }
.hby { background: var(--blue-50); color: var(--blue-700); border: 0.5px solid var(--blue-200); }
.hbn { background: var(--rose-50); color: var(--rose-700); border: 0.5px solid var(--rose-200); }
.hchev { font-size: 9px; color: var(--ink-4); transition: transform .2s; }
.hchev.on { transform: rotate(180deg); color: var(--ink-3); }

.hdet    { display: none; padding: 0 12px 12px; animation: fadeIn .15s ease; }
.hdet.on { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

.hdet-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; margin-bottom: 12px;
  padding: 10px 12px; background: var(--paper); border-radius: 8px; border: 0.5px solid var(--line);
}
.hdet-grid > div { display: flex; flex-direction: column; }
.hdl { font-size: 9px; color: var(--ink-4); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 1px; }
.hdv { font-size: 11px; font-weight: 500; color: var(--ink-2); line-height: 1.4; letter-spacing: -.005em; }

.hpeople      { margin-top: 10px; border-radius: 10px; border: 0.5px solid var(--line); overflow: hidden; }
.hpeople-hd   { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-4); padding: 7px 12px; background: var(--white); border-bottom: 0.5px solid var(--line); }
.hperson-row  { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 0.5px solid var(--line); background: var(--paper); transition: background .1s; }
.hperson-row:last-child { border-bottom: none; }
.hperson-row:hover { background: var(--white); }
.hperson-role { font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); white-space: nowrap; flex-shrink: 0; text-transform: uppercase; letter-spacing: .04em; min-width: 76px; text-align: center; }
.judge-role { background: var(--blue-50); color: var(--blue-800); border: 0.5px solid var(--blue-200); }
.pros-role  { background: var(--rose-50); color: var(--rose-700); border: 0.5px dashed var(--rose-200); }
.def-role   { background: #FFFBEB; color: #92400E; border: 0.5px dotted #FCD34D; }
.wit-role   { background: var(--paper-2); color: var(--ink-3); border: 0.5px solid var(--line-2); }
.hperson-name { font-size: 12px; font-weight: 500; color: var(--ink-1); flex: 1; letter-spacing: -.01em; }
.hperson-sub  { font-size: 10px; color: var(--ink-4); margin-left: auto; flex-shrink: 0; }
.hnote {
  margin-top: 10px; background: var(--paper-2); border-left: 2px solid var(--line-2);
  border-radius: 0 8px 8px 0; padding: 8px 12px;
  font-size: 11px; color: var(--ink-3); line-height: 1.65; white-space: pre-wrap; word-break: break-word; letter-spacing: -.005em;
}

/* ================================================================
   SUBSCRIBE PANEL
   ================================================================ */
#sub-ov {
  display: none; position: fixed; inset: 0; z-index: 4000;
  background: rgba(0,0,0,.38); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  align-items: center; justify-content: center;
}
#sub-ov.on { display: flex; }
#sub-panel {
  background: var(--paper); border-radius: 20px;
  width: min(400px, 94vw);
  box-shadow: 0 24px 60px rgba(0,0,0,.2), 0 0 0 0.5px rgba(0,0,0,.06);
  overflow: hidden;
}
#sub-hd { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 22px 18px; background: var(--ink-1); }
#sub-title { font-size: 16px; font-weight: 600; color: var(--white); letter-spacing: -.025em; }
#sub-desc  { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 4px; line-height: 1.5; }
.sub-x { background: rgba(255,255,255,.12); border: none; color: var(--white); font-size: 16px; cursor: pointer; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s; }
.sub-x:hover { background: rgba(255,255,255,.22); }
#sub-form-wrap { padding: 20px 22px 22px; }
.sub-label { font-size: 10px; font-weight: 700; color: var(--ink-4); display: block; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.sub-input { width: 100%; border: 0.5px solid var(--line-2); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--ink-1); font-family: var(--font); background: var(--white); transition: border-color .15s; letter-spacing: -.01em; }
.sub-input:focus { outline: none; border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
#sub-types { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.sub-type-btn { border: 0.5px solid var(--line-2); border-radius: var(--radius-pill); padding: 4px 11px; font-size: 11px; font-weight: 500; color: var(--ink-3); background: var(--white); cursor: pointer; font-family: var(--font); transition: all .15s; display: inline-flex; align-items: center; gap: 5px; }
.sub-type-btn.on { background: var(--paper-2); border-color: var(--ink-3); color: var(--ink-1); }
.sub-type-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
#sub-btn { width: 100%; background: var(--ink-1); color: var(--white); border: none; border-radius: var(--radius-pill); padding: 11px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font); transition: background .15s; display: flex; align-items: center; justify-content: center; gap: 7px; letter-spacing: -.02em; }
#sub-btn:hover { background: var(--ink-2); }
#sub-btn:disabled { background: var(--paper-3); cursor: not-allowed; }
#sub-msg { font-size: 12px; margin-top: 12px; text-align: center; line-height: 1.5; min-height: 18px; }
#sub-msg.ok  { color: #065F46; }
#sub-msg.err { color: var(--rose-700); }

/* ── Table city filter tabs ────────────────────────────────────────────────── */
.tbl-city-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 16px 0;
  border-bottom: 1px solid var(--line, rgba(0,0,0,.08));
}
.tbl-city-tab {
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--line, rgba(0,0,0,.1));
  background: transparent;
  color: var(--ink-2, #4a4a4a);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 8px;
}
.tbl-city-tab:hover { background: var(--paper-2, #f0ede8); }
.tbl-city-tab.on {
  background: var(--ink-1, #1a1a1a);
  color: #fff;
  border-color: var(--ink-1, #1a1a1a);
}

/* ── City chips in filter bar ──────────────────────────────────────────────── */
.city-chips {
  display: flex;
  gap: 3px;
  align-items: center;
}
.city-chip {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--line, rgba(0,0,0,.1));
  background: transparent;
  color: var(--ink-2, #4a4a4a);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.city-chip:hover { background: var(--paper-2, #f0ede8); }
.city-chip.on {
  background: var(--ink-1, #1a1a1a);
  color: #fff;
  border-color: var(--ink-1, #1a1a1a);
}

/* ── City badge in table rows ──────────────────────────────────────────────── */
.tbl-td-city { padding: 0 8px; text-align: center; }
.tbl-city-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .03em;
}
.tbl-city-dc  { background: #dbeafe; color: #1e40af; }
.tbl-city-bal { background: #fce7f3; color: #9d174d; }
