/* MetroDocket Subscriber Workspace — Editorial Architectural Design System */
:root {
  --paper: #FAF8F4;
  --paper-alt: #F2EEE5;
  --surface: #FFFFFF;
  --ink: #1C1917;
  --ink-muted: #57534E;
  --ink-subtle: #78716C;
  --rule: #E7E5E0;
  --rule-strong: #D6D1C7;
  --forest: #1B4332;
  --forest-hover: #143326;
  --forest-soft: #ECF3EF;
  --brass: #9A6B2F;
  --brass-soft: #FBF3E4;
  --brass-line: #D4B483;
  --danger: #991B1B;
  --danger-soft: #FEF2F2;
  --danger-border: #FECACA;
  --shadow-sm: 0 2px 8px rgba(28, 25, 23, 0.04);
  --shadow-md: 0 12px 32px rgba(28, 25, 23, 0.06);
  --shadow-lg: 0 20px 50px rgba(28, 25, 23, 0.14);
  --radius: 8px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.text-right {
  text-align: right;
}

/* Boot Screen */
.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--paper);
}

.boot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.boot-status {
  font-size: 13px;
  color: var(--ink-subtle);
}

/* Shared Brand & Typography */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-name {
  font-family: "Newsreader", Georgia, serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.brand-edition {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--brass);
  padding-left: 10px;
  border-left: 1px solid var(--rule);
}

.kicker {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 8px;
}

.text-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-muted);
}

.text-link:hover {
  color: var(--forest);
}

.mono-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn:disabled,
.btn-disabled,
.btn[aria-disabled="true"] {
  opacity: 0.68;
  cursor: default;
  pointer-events: none;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12.5px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--forest);
  color: #FAF8F5;
}

.btn-primary:hover:not(:disabled) {
  background: var(--forest-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--rule-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--paper-alt);
  border-color: var(--ink-subtle);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--paper-alt);
  color: var(--ink);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: transparent;
}

.btn-danger-ghost:hover:not(:disabled) {
  background: var(--danger-soft);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--paper-alt);
  color: var(--ink);
}

/* Inputs & Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label,
.facet label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.2px;
}

.input,
.select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus,
.select:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.08);
}

.inline-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.inline-row .input {
  flex: 1;
  min-width: 0;
}

.form-hint {
  font-size: 12.5px;
  color: var(--ink-subtle);
  line-height: 1.5;
}

/* Alerts */
.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 16px;
  border: 1px solid var(--rule);
}

.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-border);
}

.alert-success {
  background: var(--forest-soft);
  color: var(--forest);
  border-color: #C3D9CD;
}

.alert-info {
  background: var(--brass-soft);
  color: #7C511B;
  border-color: var(--brass-line);
}

/* ==================== AUTH VIEW ==================== */
.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-topbar {
  background: rgba(250, 248, 244, 0.92);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: blur(10px);
}

.auth-topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 48px 28px 64px;
}

.auth-grid {
  max-width: 1060px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: start;
}

.auth-editorial h1 {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(32px, 3.6vw, 44px);
  line-height: 1.14;
  letter-spacing: -0.6px;
  font-weight: 600;
  color: var(--ink);
}

.auth-lead {
  margin-top: 16px;
  font-size: 15.5px;
  color: var(--ink-muted);
  max-width: 500px;
}

.auth-ledger {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
}

.auth-ledger-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--forest);
}

.auth-ledger-row {
  padding: 12px 0;
  border-bottom: 1px solid #F2EFE9;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-ledger-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.auth-ledger-row strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.auth-ledger-row span {
  font-size: 12.5px;
  color: var(--ink-muted);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 28px;
  box-shadow: var(--shadow-md);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: var(--paper-alt);
  padding: 4px;
  border-radius: 7px;
  margin-bottom: 22px;
}

.auth-tab {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 6px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.08);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.dev-magic-box {
  background: var(--forest-soft);
  border: 1px solid #C3D9CD;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dev-magic-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--forest);
}

.dev-magic-note {
  font-size: 12.5px;
  color: var(--ink-muted);
}

.magic-token-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--ink-subtle);
  margin-top: 4px;
}

.magic-token-divider::before,
.magic-token-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.local-demo-box {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--rule-strong);
}

.local-demo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.local-demo-copy {
  font-size: 12px;
  color: var(--ink-subtle);
  margin-bottom: 10px;
}

.local-demo-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* ==================== WORKSPACE SHELL ==================== */
.workspace-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 248, 244, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.app-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 0;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-tab:hover {
  background: var(--paper-alt);
  color: var(--ink);
}

.nav-tab.active {
  background: var(--forest-soft);
  color: var(--forest);
  font-weight: 600;
}

.nav-badge {
  background: var(--forest);
  color: #FAF8F5;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.3;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.user-email {
  font-size: 13px;
  color: var(--ink-muted);
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tier-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 9px;
  border-radius: 4px;
  white-space: nowrap;
}

.tier-free {
  background: var(--brass-soft);
  color: #8A5A1E;
  border: 1px solid var(--brass-line);
}

.tier-solo {
  background: var(--forest-soft);
  color: var(--forest);
  border: 1px solid #C3D9CD;
}

.tier-team,
.tier-enterprise {
  background: var(--forest);
  color: #FAF8F5;
}

/* Free Preview Banner */
.preview-banner {
  background: var(--brass-soft);
  border-bottom: 1px solid var(--brass-line);
}

.preview-banner-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 11px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.preview-banner-text {
  font-size: 13px;
  color: #5E3D13;
}

.preview-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Main Content */
.app-main {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.view-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.view-title {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(26px, 2.8vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.4px;
  font-weight: 600;
  color: var(--ink);
}

.view-subtitle {
  margin-top: 6px;
  font-size: 14.5px;
  color: var(--ink-muted);
}

/* ==================== DOCKET EXPLORER ==================== */
.filter-panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filter-row-search {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-wrap {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-subtle);
  pointer-events: none;
}

.search-input {
  padding-left: 36px;
}

.filter-row-facets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.facet {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 2px 10px;
  font-size: 13px;
  color: var(--ink-muted);
}

.results-count strong {
  color: var(--ink);
}

.results-scope {
  font-size: 12.5px;
  color: var(--ink-subtle);
}

/* Table */
.table-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

.docket-table,
.seats-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.docket-table th,
.seats-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.65px;
  color: var(--ink-subtle);
  background: #F8F6F1;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

.docket-table td,
.seats-table td {
  padding: 14px;
  border-bottom: 1px solid #F0EDE7;
  vertical-align: top;
  font-size: 13.5px;
}

.docket-table tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}

.docket-table tbody tr:hover {
  background: #FAF8F4;
}

.docket-table tbody tr:last-child td,
.seats-table tbody tr:last-child td {
  border-bottom: none;
}

.table-empty {
  text-align: center;
  padding: 40px 20px !important;
  color: var(--ink-subtle);
  cursor: default !important;
}

.case-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--forest);
  white-space: nowrap;
}

.city-name {
  font-weight: 600;
  color: var(--ink);
}

.board-name {
  font-size: 12px;
  color: var(--ink-subtle);
  margin-top: 2px;
}

.hearing-date {
  font-weight: 500;
  white-space: nowrap;
}

.status-tag,
.asset-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.status-upcoming {
  background: var(--brass-soft);
  color: #8A5A1E;
}

.status-done {
  background: var(--forest-soft);
  color: var(--forest);
}

.status-neutral {
  background: var(--paper-alt);
  color: var(--ink-muted);
}

.asset-tag {
  background: var(--paper-alt);
  color: var(--ink-muted);
  border: 1px solid var(--rule);
}

.headline-cell-title {
  font-family: "Newsreader", Georgia, serif;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.headline-cell-sub {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-subtle);
}

.acreage-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--brass);
  font-weight: 600;
}

.track-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink-subtle);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.track-btn:hover {
  border-color: var(--brass);
  color: var(--brass);
  background: var(--brass-soft);
}

.track-btn.tracked {
  background: var(--brass-soft);
  border-color: var(--brass-line);
  color: var(--brass);
}

/* ==================== PANELS (WATCHLIST & TEAM) ==================== */
.two-col-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 18px;
}

.panel-title {
  font-family: "Newsreader", Georgia, serif;
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
}

.panel-desc {
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: 3px;
}

.empty-box {
  padding: 26px 18px;
  text-align: center;
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--ink-subtle);
  background: var(--paper);
}

/* Tracked Cases List */
.tracked-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tracked-item {
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--paper);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.tracked-item-meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--forest);
  font-weight: 600;
  text-transform: uppercase;
}

.tracked-item-title {
  font-family: "Newsreader", Georgia, serif;
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 4px;
}

.tracked-item-sub {
  font-size: 12.5px;
  color: var(--ink-subtle);
  margin-top: 3px;
}

.tracked-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Alert Rules */
.rule-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 16px;
}

.rule-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.rule-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.rule-keyword {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}

/* ==================== WEEKLY EDITIONS ==================== */
.editions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.edition-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.edition-card.locked {
  background: #F6F3EC;
  border-style: dashed;
}

.edition-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.edition-market {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--brass);
}

.edition-title {
  font-family: "Newsreader", Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 8px;
}

.edition-meta {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-muted);
}

.edition-cities {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.city-chip {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--paper-alt);
  color: var(--ink-muted);
}

.lock-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--brass-soft);
  color: #8A5A1E;
  border: 1px solid var(--brass-line);
}

/* ==================== BILLING & TEAM SEATS ==================== */
.billing-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.fact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #F1EFE9;
  font-size: 13.5px;
}

.fact-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.fact-label {
  color: var(--ink-subtle);
}

.fact-value {
  font-weight: 600;
  color: var(--ink);
}

.billing-actions {
  margin-bottom: 14px;
}

.upgrade-strip {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.upgrade-strip-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.upgrade-strip-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seat-meter {
  height: 6px;
  border-radius: 99px;
  background: var(--paper-alt);
  overflow: hidden;
  margin-bottom: 18px;
}

.seat-meter-fill {
  height: 100%;
  background: var(--forest);
  border-radius: 99px;
  transition: width 0.25s ease;
}

.invite-form {
  margin-bottom: 18px;
}

.seat-email {
  font-weight: 600;
  color: var(--ink);
}

.seat-role {
  font-size: 12px;
  color: var(--ink-subtle);
}

/* ==================== CASE DETAIL DRAWER ==================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(28, 25, 23, 0.42);
  display: flex;
  justify-content: flex-end;
  backdrop-filter: blur(2px);
}

.drawer {
  width: min(580px, 100%);
  height: 100%;
  background: var(--paper);
  border-left: 1px solid var(--rule);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-header {
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--forest);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.drawer-headline {
  font-family: "Newsreader", Georgia, serif;
  font-size: 26px;
  line-height: 1.24;
  font-weight: 600;
  color: var(--ink);
}

.drawer-location {
  font-size: 14px;
  color: var(--ink-muted);
  margin-top: -10px;
}

.drawer-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.drawer-section {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--brass);
  margin-bottom: 10px;
}

.drawer-summary {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
}

.drawer-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.drawer-fact dt {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.55px;
  color: var(--ink-subtle);
}

.drawer-fact dd {
  margin-top: 3px;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.45;
}

.drawer-fact-full {
  grid-column: 1 / -1;
}

/* ==================== UPGRADE MODAL ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(28, 25, 23, 0.48);
  display: grid;
  place-items: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal-card {
  width: min(640px, 100%);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 26px 28px;
  box-shadow: var(--shadow-lg);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.modal-title {
  font-family: "Newsreader", Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
}

.modal-body {
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink-muted);
}

.modal-benefits {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.modal-plan {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.modal-plan-featured {
  background: var(--forest-soft);
  border-color: #B8D4C4;
}

.modal-plan-kicker {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--forest);
}

.modal-plan ul {
  list-style: none;
  display: grid;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-muted);
}

.modal-plan li {
  padding-left: 14px;
  position: relative;
}

.modal-plan li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--brass);
  font-weight: 700;
}

/* ==================== TOASTS ==================== */
.toast-region {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  background: var(--ink);
  color: #FAF8F5;
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--shadow-md);
  border-left: 3px solid var(--brass-line);
}

.toast-error {
  background: var(--danger);
  border-left-color: #FCA5A5;
}

/* ==================== KPI STRIP & QUICK PRESETS ==================== */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 15px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease;
}

.kpi-card:hover {
  border-color: var(--brass-line);
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--ink-subtle);
}

.kpi-value {
  margin-top: 6px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--forest);
  letter-spacing: -0.4px;
}

.kpi-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-chip {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.preset-chip:hover {
  border-color: var(--ink-subtle);
  color: var(--ink);
  background: var(--paper-alt);
}

.preset-chip.active {
  background: var(--forest);
  border-color: var(--forest);
  color: #FAF8F5;
}

.kbd-hints {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--ink-subtle);
}

.kbd-hints kbd {
  display: inline-block;
  padding: 1px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  margin-right: 3px;
}

/* Skeleton Loader & Empty State */
@keyframes mdShimmer {
  0% { background-position: -240px 0; }
  100% { background-position: 240px 0; }
}

.skeleton-bar {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--paper-alt) 25%, #FAF8F4 50%, var(--paper-alt) 75%);
  background-size: 480px 100%;
  animation: mdShimmer 1.3s ease-in-out infinite;
}

.empty-state-box {
  padding: 36px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--ink-muted);
}

.empty-state-title {
  font-family: "Newsreader", Georgia, serif;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
}

@keyframes drawerSlideIn {
  from { transform: translateX(28px); opacity: 0.7; }
  to { transform: translateX(0); opacity: 1; }
}

.drawer-backdrop:not(.hidden) .drawer {
  animation: drawerSlideIn 0.18s ease-out;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1040px) {
  .kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filter-row-facets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .editions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .app-header-inner {
    flex-wrap: wrap;
    padding: 10px 18px;
  }
  .header-left {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
  }
  .header-right {
    width: 100%;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--rule);
  }
}

@media (max-width: 820px) {
  .auth-grid,
  .two-col-layout,
  .modal-benefits,
  .editions-grid,
  .drawer-facts {
    grid-template-columns: 1fr;
  }
  .filter-row-facets {
    grid-template-columns: 1fr;
  }
  .local-demo-actions {
    grid-template-columns: 1fr;
  }
  .kbd-hints {
    display: none;
  }
  .app-nav {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 560px) {
  .kpi-strip {
    grid-template-columns: 1fr;
  }
  .drawer {
    width: 100%;
  }
}
