/* ============================================================================
   Case-management dashboard + auth styling.
   Built entirely on the design tokens from styles.css (loaded first).
   Adds the form system the marketing site never needed, plus dashboard,
   auth, modal, and activity-timeline components.
   ========================================================================== */

/* ---------- Form system ---------- */
.form-group { margin-bottom: 1.15rem; }

.form-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-500);
  margin-bottom: 0.45rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--ink-900);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 0.98rem;
  padding: 0.7rem 0.85rem;
  transition: border-color var(--speed) var(--ease),
              box-shadow var(--speed) var(--ease),
              background-color var(--speed) var(--ease);
}
.form-textarea { min-height: 110px; resize: vertical; line-height: 1.5; }

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-low); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(201, 162, 83, 0.15);
  background: var(--ink-800);
}

/* Native select with a gold chevron */
.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold-500) 50%),
    linear-gradient(135deg, var(--gold-500) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 13px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.25rem;
  cursor: pointer;
}
.form-select option { background: var(--ink-900); color: var(--text-hi); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.form-hint { font-size: 0.78rem; color: var(--text-low); margin-top: 0.4rem; }

/* ---------- Inline message banners ---------- */
.banner {
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--line-soft);
}
.banner[hidden] { display: none; }
.banner-error { background: rgba(200, 80, 80, 0.1); border-color: rgba(200, 80, 80, 0.45); color: #f0b4b4; }
.banner-ok    { background: rgba(120, 180, 120, 0.1); border-color: rgba(120, 180, 120, 0.4); color: #bfe6bf; }
.banner-warn  { background: rgba(201, 162, 83, 0.1); border-color: var(--line-gold); color: var(--gold-400); }

/* ---------- Button additions (base .btn lives in styles.css) ---------- */
.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.74rem; }
.btn-danger {
  background: transparent;
  border: 1px solid rgba(200, 80, 80, 0.5);
  color: #e69595;
}
.btn-danger:hover {
  background: rgba(200, 80, 80, 0.12);
  border-color: rgba(200, 80, 80, 0.85);
  transform: translateY(-2px);
}
.btn-block { display: block; width: 100%; text-align: center; }

/* ============================================================================
   Auth page (login.html)
   ========================================================================== */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 3rem 1.25rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--ink-800);
  border: 1px solid var(--line-soft);
  border-top: 2px solid var(--line-gold);
  border-radius: var(--radius-sm);
  padding: 2.5rem 2.25rem;
  box-shadow: var(--shadow-card);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
  text-decoration: none;
}
.auth-brand .brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-500);
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.55rem;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
.auth-brand .brand-name {
  font-family: var(--font-display);
  color: var(--text-hi);
  font-size: 1.05rem;
}

.auth-eyebrow {
  text-align: center;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--gold-500);
  margin-bottom: 0.4rem;
}
.auth-card h1 {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 1.75rem;
}

/* Login / Sign-up segmented toggle */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 1.75rem;
  overflow: hidden;
}
.auth-tab {
  background: transparent;
  border: none;
  color: var(--text-low);
  font-family: var(--font-body);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.7rem;
  cursor: pointer;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}
.auth-tab.is-active { background: rgba(201, 162, 83, 0.12); color: var(--gold-400); }

.auth-foot {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-low);
}
.auth-foot a { color: var(--gold-500); }

/* ============================================================================
   Dashboard chrome (dashboard.html)
   ========================================================================== */
.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 15, 26, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.dash-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
}
.dash-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.dash-brand .brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-500);
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
}
.dash-brand .brand-name { font-family: var(--font-display); color: var(--text-hi); font-size: 1rem; }
.dash-brand .brand-tag {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-low);
  border-left: 1px solid var(--line-soft); padding-left: 0.6rem; margin-left: 0.2rem;
}

.dash-user { display: flex; align-items: center; gap: 1rem; }
.dash-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text-hi);
  font-size: 0.9rem;
}
.dash-user-chip:hover .user-name { color: var(--gold-400); }
.user-headshot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ink-700);
  border: 1px solid var(--line-gold);
  flex-shrink: 0;
}
.user-name { color: var(--text-mid); transition: color var(--speed) var(--ease); }
@media (max-width: 560px) { .user-name, .dash-brand .brand-tag { display: none; } }

.dash-main { padding: 2.5rem 0 4.5rem; }

.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.dash-head h1 { font-size: 1.9rem; }
.dash-head h1::after { content: none; }   /* no double-rule here */
.dash-head .dash-sub { color: var(--text-low); font-size: 0.92rem; margin-top: 0.25rem; }

.view[hidden] { display: none; }

/* ---------- Toolbar / filters ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
}
.toolbar .form-input,
.toolbar .form-select { margin: 0; }
.toolbar-search { flex: 1 1 240px; }
.toolbar-filter { flex: 0 0 auto; min-width: 150px; }

/* ---------- Cases table ---------- */
.case-table-wrap {
  border: 1px solid var(--line-soft);
  border-top: 2px solid var(--line-gold);
  border-radius: var(--radius-sm);
  background: var(--ink-800);
  overflow: hidden;
}
.case-table { width: 100%; border-collapse: collapse; }
.case-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-low);
  background: var(--ink-700);
  padding: 0.85rem 1.25rem;
  white-space: nowrap;
}
.case-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-mid);
  vertical-align: middle;
}
.case-table tbody tr { cursor: pointer; transition: background-color var(--speed) var(--ease); }
.case-table tbody tr:hover { background: rgba(201, 162, 83, 0.06); }
.case-table tbody tr:last-child td { border-bottom: 0; }
.c-matter { color: var(--text-hi); font-weight: 600; }
.c-client { display: block; color: var(--text-low); font-size: 0.82rem; margin-top: 0.15rem; }
.c-num { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Plaintiff v. Defendant matchup in the list */
.matchup { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.party-mini { display: inline-flex; align-items: center; gap: 0.45rem; min-width: 0; }
.party-mini img {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  background: var(--ink-700); border: 1px solid var(--line-soft); flex-shrink: 0;
}
.party-mini span { color: var(--text-hi); font-weight: 600; white-space: nowrap; }
.matchup .vs { color: var(--gold-500); font-family: var(--font-display); font-style: italic; font-size: 0.85rem; }

/* ---------- Status badges ---------- */
.status-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}
.status-badge[data-status="intake"]        { color: #9ec5ff; border-color: rgba(120,170,255,0.4); background: rgba(120,170,255,0.1); }
.status-badge[data-status="open"]          { color: var(--gold-400); border-color: var(--line-gold); background: rgba(201,162,83,0.1); }
.status-badge[data-status="in-litigation"] { color: #f0c08a; border-color: rgba(220,150,60,0.45); background: rgba(220,150,60,0.12); }
.status-badge[data-status="on-appeal"]     { color: #d3b0f0; border-color: rgba(170,120,220,0.45); background: rgba(170,120,220,0.12); }
.status-badge[data-status="settled"]       { color: #8fd6c4; border-color: rgba(90,190,165,0.4); background: rgba(90,190,165,0.1); }
.status-badge[data-status="closed-won"]    { color: #aee0a6; border-color: rgba(120,190,110,0.45); background: rgba(120,190,110,0.12); }
.status-badge[data-status="closed-lost"]   { color: #e69595; border-color: rgba(200,90,90,0.45); background: rgba(200,90,90,0.12); }

/* ---------- Party (plaintiff/defendant) lookup widget ---------- */
.party-field { margin-bottom: 1.15rem; }

.party-input-row { display: flex; gap: 0.5rem; align-items: stretch; }
.party-input-row .party-username { flex: 1 1 auto; margin: 0; }

.party-check {
  flex: 0 0 auto;
  width: 44px;
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-sm);
  background: rgba(201, 162, 83, 0.08);
  color: var(--gold-500);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color var(--speed) var(--ease), border-color var(--speed) var(--ease),
              color var(--speed) var(--ease), opacity var(--speed) var(--ease);
}
.party-check:hover { background: rgba(201, 162, 83, 0.18); }
.party-check:disabled { opacity: 0.5; cursor: default; }
/* In "preview" state the check means CONFIRM — make it solid gold */
.party-check[data-state="preview"] {
  background: linear-gradient(135deg, var(--gold-600), var(--gold-500));
  color: var(--ink-950);
  border-color: var(--gold-500);
}

.party-preview {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.6rem;
  padding: 0.55rem 0.7rem;
  background: var(--ink-900);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}
.party-preview[hidden] { display: none; }
.party-headshot {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  background: var(--ink-700); border: 1px solid var(--line-gold); flex-shrink: 0;
}
.party-meta { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.party-displayname { color: var(--text-hi); font-weight: 600; font-size: 0.95rem; }
.party-username-tag { color: var(--text-low); font-size: 0.8rem; text-decoration: none; }
.party-username-tag:hover { color: var(--gold-500); text-decoration: underline; }
.party-confirmed-badge {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: #aee0a6; border: 1px solid rgba(120,190,110,0.45); background: rgba(120,190,110,0.12);
  padding: 0.2rem 0.5rem; border-radius: 999px; white-space: nowrap; flex-shrink: 0;
}
.party-confirmed-badge[hidden] { display: none; }
.party-edit {
  background: none; border: none; color: var(--text-low); cursor: pointer;
  font-family: var(--font-body); font-size: 0.8rem; text-decoration: underline; flex-shrink: 0;
}
.party-edit:hover { color: var(--gold-500); }
.party-edit[hidden] { display: none; }
.party-error { color: #f0b4b4; font-size: 0.8rem; margin-top: 0.4rem; }
.party-error[hidden] { display: none; }

/* ---------- States ---------- */
.empty-state, .loading-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-low);
}
.empty-state {
  border: 1px dashed var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--ink-800);
}
.empty-state h3 { color: var(--text-mid); margin-bottom: 0.5rem; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 1.5rem;
  background: rgba(5, 8, 15, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal-overlay.is-open { display: grid; }
.modal {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--ink-800);
  border: 1px solid var(--line-soft);
  border-top: 2px solid var(--line-gold);
  border-radius: var(--radius-sm);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.modal-head h2 { font-size: 1.4rem; }
.modal-head h2::after { content: none; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-low);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  transition: color var(--speed) var(--ease);
}
.modal-close:hover { color: var(--gold-500); }
.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* ---------- Case detail view ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-low);
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 1.25rem;
  transition: color var(--speed) var(--ease);
}
.back-link:hover { color: var(--gold-500); }

.detail-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.75rem;
  align-items: start;
}
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--ink-800);
  border: 1px solid var(--line-soft);
  border-top: 2px solid var(--line-gold);
  border-radius: var(--radius-sm);
  padding: 1.75rem;
}
.panel-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text-hi);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line-soft);
}

/* ---------- Activity timeline ---------- */
.activity-timeline {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.activity-entry {
  border-left: 2px solid var(--gold-500);
  padding: 0.1rem 0 0.1rem 1rem;
}
.activity-meta {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.activity-date {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-500);
  font-variant-numeric: tabular-nums;
}
.activity-type { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-low); }
.activity-note { color: var(--text-mid); font-size: 0.95rem; margin-top: 0.3rem; line-height: 1.5; }
.activity-empty { color: var(--text-low); font-size: 0.9rem; margin-bottom: 1.25rem; }

.activity-form { border-top: 1px solid var(--line-soft); padding-top: 1.25rem; }

/* ---------- Tiny helpers ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Responsive: cases table → stacked cards ---------- */
@media (max-width: 720px) {
  .case-table thead { display: none; }
  .case-table, .case-table tbody, .case-table tr, .case-table td { display: block; }
  .case-table tr { border-bottom: 1px solid var(--line-soft); padding: 0.4rem 0; }
  .case-table tbody tr:last-child { border-bottom: 0; }
  .case-table td { border-bottom: 0; padding: 0.35rem 1.25rem; display: flex; justify-content: space-between; gap: 1rem; }
  .case-table td::before {
    content: attr(data-label);
    font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--text-low); flex-shrink: 0;
  }
  .case-table td.c-matter-cell { display: block; }
  .case-table td.c-matter-cell::before { content: none; }
}

/* ============================================================================
   App v2: sidebar shell, directory, calendar, segmented toggle, suggestions
   ========================================================================== */

/* ---------- Shell + sidebar ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--ink-900);
  border-right: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.9rem;
  gap: 0.4rem;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 0.55rem;
  text-decoration: none; padding: 0.4rem 0.6rem 1.1rem;
}
.sidebar-brand .brand-mark {
  font-family: var(--font-display); font-weight: 700; color: var(--gold-500);
  border: 1px solid var(--line-gold); border-radius: var(--radius-sm);
  padding: 0.2rem 0.45rem; font-size: 0.85rem;
}
.sidebar-brand .brand-name { font-family: var(--font-display); color: var(--text-hi); font-size: 1rem; }
.sidebar-brand .brand-name em { color: var(--gold-500); font-style: italic; }

.sidebar-nav { display: flex; flex-direction: column; gap: 0.2rem; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.65rem 0.7rem;
  color: var(--text-mid);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  font-size: 0.95rem;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease), border-color var(--speed) var(--ease);
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.04); color: var(--text-hi); }
.sidebar-nav a.is-active {
  background: rgba(201,162,83,0.1);
  color: var(--gold-400);
  border-left-color: var(--gold-500);
}
.sidebar-nav .nav-ico { width: 1.1rem; text-align: center; opacity: 0.9; }
.sidebar-foot { margin-top: auto; color: var(--text-low); font-size: 0.82rem; text-decoration: none; padding: 0.6rem; }
.sidebar-foot:hover { color: var(--gold-500); }

.app-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.app-topbar-title { font-size: 0.72rem; text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-low); }
.app-main { padding: 2.25rem clamp(1rem, 4vw, 2.5rem) 4rem; flex: 1; }

@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 0.75rem 1rem; }
  .sidebar-brand { padding: 0.2rem 0.4rem; }
  .sidebar-nav { flex-direction: row; flex: 1; justify-content: center; flex-wrap: wrap; }
  .sidebar-nav a { border-left: none; border-bottom: 2px solid transparent; }
  .sidebar-nav a.is-active { border-left: none; border-bottom-color: var(--gold-500); }
  .sidebar-foot { margin: 0; }
}

/* ---------- Segmented toggle (Civil / Criminal) ---------- */
.seg-toggle {
  display: inline-flex;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1.15rem;
}
.seg-toggle button {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-low); font-family: var(--font-body);
  font-size: 0.8rem; padding: 0.55rem 1rem;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}
.seg-toggle button.is-active { background: rgba(201,162,83,0.14); color: var(--gold-400); }

/* ---------- Party pick-existing suggestions ---------- */
.party-field { position: relative; }
.party-suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
  margin-top: 2px;
  background: var(--ink-800);
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  max-height: 240px; overflow-y: auto;
}
.party-suggest[hidden] { display: none; }
.party-suggest-row {
  display: flex; align-items: center; gap: 0.55rem; width: 100%;
  background: none; border: none; cursor: pointer; text-align: left;
  padding: 0.5rem 0.7rem; color: var(--text-mid);
  border-bottom: 1px solid var(--line-soft);
}
.party-suggest-row:last-child { border-bottom: none; }
.party-suggest-row:hover { background: rgba(201,162,83,0.08); }
.party-suggest-row img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--ink-700); }
.party-suggest-row .ps-name { color: var(--text-hi); font-weight: 600; }
.party-suggest-row .ps-tag { color: var(--text-low); font-size: 0.8rem; }

/* entity party (criminal prosecutor) in list/detail */
.party-mini-entity .entity-glyph { color: var(--gold-500); margin-right: 0.1rem; }

/* ---------- Directory ---------- */
.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
}
.person-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  background: var(--ink-800);
  border: 1px solid var(--line-soft);
  border-top: 2px solid var(--line-gold);
  border-radius: var(--radius-sm);
  padding: 1.5rem 1rem; cursor: pointer; text-align: center;
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), border-color var(--speed) var(--ease);
  color: inherit; font-family: var(--font-body);
}
.person-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-top-color: var(--gold-500); }
.person-card img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--ink-700); border: 1px solid var(--line-gold); }
.person-name { color: var(--text-hi); font-weight: 600; }
.person-tag { color: var(--text-low); font-size: 0.82rem; }
.person-count { color: var(--gold-500); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.2rem; }

.person-header { display: flex; align-items: center; gap: 1.1rem; margin: 0.5rem 0 1.5rem; }
.person-header img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--ink-700); border: 1px solid var(--line-gold); }
.person-header h1 { font-size: 1.6rem; }
.person-profile { color: var(--gold-500); font-size: 0.88rem; text-decoration: none; }
.person-profile:hover { text-decoration: underline; }
.section-gap { margin-top: 1rem; }

/* ---------- Case page header ---------- */
.case-page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin: 0.5rem 0 1.5rem;
}
.case-page-matchup .matchup { font-size: 1.05rem; }
.case-page-matchup .party-mini img { width: 38px; height: 38px; }
.case-page-tags { display: flex; align-items: center; gap: 0.6rem; }
.cat-pill {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-low); border: 1px solid var(--line-soft); border-radius: 999px; padding: 0.2rem 0.6rem;
}
.case-deadlines { margin-top: 1.75rem; }
.deadline-add { border-bottom: 1px solid var(--line-soft); padding-bottom: 1rem; margin-bottom: 1.25rem; }

/* ---------- Calendar ---------- */
.calendar { width: 100%; }
.cal-header { display: flex; align-items: center; justify-content: center; gap: 1.25rem; margin-bottom: 1rem; }
.cal-title { font-family: var(--font-display); color: var(--text-hi); font-size: 1.15rem; min-width: 12ch; text-align: center; }
.cal-nav { background: none; border: 1px solid var(--line-soft); color: var(--gold-500); border-radius: var(--radius-sm); width: 32px; height: 32px; cursor: pointer; font-size: 1.1rem; }
.cal-nav:hover { background: rgba(201,162,83,0.1); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekday { text-align: center; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-low); padding: 0.3rem 0; }
.cal-day {
  min-height: 78px; background: var(--ink-900); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 0.3rem; display: flex; flex-direction: column; gap: 0.2rem;
}
.cal-day.is-other { background: transparent; border-color: transparent; }
.cal-day.is-addable { cursor: pointer; }
.cal-day.is-addable:hover { border-color: var(--line-gold); }
.cal-day.is-today { border-color: var(--gold-500); }
.cal-day-num { font-size: 0.75rem; color: var(--text-mid); font-variant-numeric: tabular-nums; }
.cal-day.is-today .cal-day-num { color: var(--gold-400); font-weight: 700; }
.cal-chips { display: flex; flex-direction: column; gap: 2px; }
.cal-chip {
  background: rgba(201,162,83,0.16); color: var(--gold-400); border: none; cursor: pointer;
  font-size: 0.66rem; text-align: left; padding: 0.1rem 0.3rem; border-radius: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-body);
}
.cal-chip:hover { background: rgba(201,162,83,0.3); }
.cal-more { font-size: 0.62rem; color: var(--text-low); }

.cal-upcoming { margin-top: 1.5rem; border-top: 1px solid var(--line-soft); padding-top: 1.1rem; }
.cal-upcoming-title { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold-500); margin-bottom: 0.6rem; }
.cal-empty { color: var(--text-low); font-size: 0.9rem; }
.deadline-row {
  display: flex; align-items: center; gap: 0.75rem; width: 100%;
  background: none; border: none; border-bottom: 1px solid var(--line-soft);
  cursor: pointer; text-align: left; padding: 0.55rem 0.2rem; color: var(--text-mid); font-family: var(--font-body);
}
.deadline-row:hover { color: var(--text-hi); }
.deadline-date { color: var(--gold-500); font-size: 0.78rem; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 9ch; }
.deadline-title { color: var(--text-hi); font-weight: 600; flex: 1; }
.deadline-type { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-low); }
.deadline-case { font-size: 0.74rem; color: var(--text-low); }

@media (max-width: 560px) {
  .cal-day { min-height: 56px; }
  .deadline-case { display: none; }
}
