/* Ledger Web — Restrained Apple-Editorial Civic Interface */

:root {
  --bg-canvas: #f5f5f7;
  --bg-sidebar: #ededf1;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  --bg-subtle: rgba(120, 120, 128, 0.12);
  --bg-subtle-strong: rgba(120, 120, 128, 0.2);
  --bg-glass: rgba(245, 245, 247, 0.84);
  --bg-modal-backdrop: rgba(10, 12, 16, 0.42);

  --text-primary: #141417;
  --text-secondary: #5e6068;
  --text-tertiary: #8c8e96;

  --border-hairline: rgba(20, 20, 26, 0.08);
  --border-strong: rgba(20, 20, 26, 0.14);

  --tint: #e07b00;
  --tint-soft: rgba(224, 123, 0, 0.12);
  --yea: #1e9e46;
  --yea-soft: rgba(30, 158, 70, 0.14);
  --nay: #d9383a;
  --nay-soft: rgba(217, 56, 58, 0.13);

  --party-dem: #2b74e4;
  --party-rep: #dc4446;
  --party-ind: #868892;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.03), 0 0 0 1px var(--border-hairline);
  --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.24), 0 0 0 1px var(--border-hairline);

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --sidebar-width: 268px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-canvas: #0d0e11;
    --bg-sidebar: #121318;
    --bg-card: #17191f;
    --bg-card-hover: #1d2028;
    --bg-subtle: rgba(142, 145, 160, 0.15);
    --bg-subtle-strong: rgba(142, 145, 160, 0.26);
    --bg-glass: rgba(13, 14, 17, 0.82);
    --bg-modal-backdrop: rgba(0, 0, 0, 0.65);

    --text-primary: #f4f5f7;
    --text-secondary: #9da1ae;
    --text-tertiary: #6a6e7c;

    --border-hairline: rgba(255, 255, 255, 0.075);
    --border-strong: rgba(255, 255, 255, 0.14);

    --tint: #ff9f0a;
    --tint-soft: rgba(255, 159, 10, 0.16);
    --yea: #32d74b;
    --yea-soft: rgba(50, 215, 75, 0.16);
    --nay: #ff453a;
    --nay-soft: rgba(255, 69, 58, 0.16);

    --party-dem: #4992ff;
    --party-rep: #ff5c5f;
    --party-ind: #989aa6;

    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.28), 0 0 0 1px var(--border-hairline);
    --shadow-modal: 0 28px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--border-strong);
  }
}

:root[data-theme="dark"] {
  --bg-canvas: #0d0e11;
  --bg-sidebar: #121318;
  --bg-card: #17191f;
  --bg-card-hover: #1d2028;
  --bg-subtle: rgba(142, 145, 160, 0.15);
  --bg-subtle-strong: rgba(142, 145, 160, 0.26);
  --bg-glass: rgba(13, 14, 17, 0.82);
  --bg-modal-backdrop: rgba(0, 0, 0, 0.65);

  --text-primary: #f4f5f7;
  --text-secondary: #9da1ae;
  --text-tertiary: #6a6e7c;

  --border-hairline: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.14);

  --tint: #ff9f0a;
  --tint-soft: rgba(255, 159, 10, 0.16);
  --yea: #32d74b;
  --yea-soft: rgba(50, 215, 75, 0.16);
  --nay: #ff453a;
  --nay-soft: rgba(255, 69, 58, 0.16);

  --party-dem: #4992ff;
  --party-rep: #ff5c5f;
  --party-ind: #989aa6;

  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.28), 0 0 0 1px var(--border-hairline);
  --shadow-modal: 0 28px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--border-strong);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: var(--tint);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* App Shell Layout */

.app-shell {
  min-height: 100dvh;
  display: flex;
}

/* Desktop Sidebar */

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-hairline);
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 18px;
  cursor: pointer;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
  flex-shrink: 0;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.nav-item:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-card);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: inherit;
}

.nav-item.active svg {
  color: var(--tint);
}

.nav-badge {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--tint-soft);
  color: var(--tint);
}

.sidebar-spacer {
  flex: 1;
  min-height: 16px;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-hairline);
}

.sidebar-pill-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 11px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-card);
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease;
}

.sidebar-pill-btn:hover {
  background: var(--bg-card-hover);
}

.sidebar-pill-text {
  min-width: 0;
  flex: 1;
}

.sidebar-pill-title {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-pill-sub {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.ok {
  background: var(--yea);
}

.status-dot.warn {
  background: var(--tint);
}

.sidebar-meta-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 0;
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.sidebar-meta-links a {
  color: var(--text-secondary);
}

/* Main Content Area */

.main-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-glass);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border-hairline);
}

.topbar-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 6px 7px;
  border-radius: 9px;
  border: 0;
  background: var(--bg-subtle);
  color: var(--tint);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.back-btn:hover {
  background: var(--bg-subtle-strong);
}

.topbar-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.022em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-title.inline {
  font-size: 17px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  min-width: 34px;
  padding: 0 9px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.14s ease;
}

.icon-btn:hover {
  background: var(--bg-subtle);
}

.icon-btn.tinted {
  color: var(--tint);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.spin svg {
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.page-content {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Grouped Sections & Cards */

.section-block {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.section-subtitle {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.section-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--tint);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.section-link:hover {
  text-decoration: underline;
}

.section-footer {
  margin: 2px 4px 0;
  font-size: 12.5px;
  color: var(--text-tertiary);
}

.card-group {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-pad {
  padding: 16px 18px;
}

.row-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-hairline);
  transition: background 0.12s ease;
}

.row-item:last-child {
  border-bottom: 0;
}

.row-item.clickable {
  cursor: pointer;
}

.row-item.clickable:hover {
  background: var(--bg-card-hover);
}

.chevron-icon {
  width: 15px;
  height: 15px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* Segmented Control (iOS Picker Style) */

.segmented {
  display: flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: 11px;
  gap: 2px;
}

.seg-btn {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 6px 10px;
  border-radius: 8.5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.seg-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Setup & Status Banners */

.setup-banner {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setup-banner.accent-border {
  border-left: 3.5px solid var(--tint);
}

.setup-banner-head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.setup-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--tint-soft);
  color: var(--tint);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.setup-banner-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 650;
}

.setup-banner-desc {
  margin: 3px 0 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.inline-key-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.text-input {
  flex: 1;
  min-width: 200px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-canvas);
  color: var(--text-primary);
  outline: none;
}

.text-input:focus {
  border-color: var(--tint);
  box-shadow: 0 0 0 3px var(--tint-soft);
}

.btn-primary {
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 0;
  background: var(--tint);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--bg-subtle);
}

.btn-danger {
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--nay-soft);
  background: var(--nay-soft);
  color: var(--nay);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Representatives Horizontal Strip */

.rep-strip {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
}

.rep-strip-item {
  width: 78px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 12px;
  transition: background 0.14s ease, transform 0.14s ease;
}

.rep-strip-item:hover {
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.rep-strip-name {
  font-size: 12.5px;
  font-weight: 600;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rep-strip-role {
  font-size: 11px;
  color: var(--text-secondary);
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Avatars & Party Dots */

.avatar {
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.party-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.party-dot.dem {
  background: var(--party-dem);
}
.party-dot.rep {
  background: var(--party-rep);
}
.party-dot.ind {
  background: var(--party-ind);
}

/* Bill Row */

.bill-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bill-meta-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
}

.bill-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bill-status-line {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.rep-vote-callout.yea {
  color: var(--yea);
  font-weight: 500;
}

.rep-vote-callout.nay {
  color: var(--nay);
  font-weight: 500;
}

.bookmark-inline-btn {
  border: 0;
  background: transparent;
  color: var(--text-tertiary);
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bookmark-inline-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.bookmark-inline-btn.saved {
  color: var(--tint);
}

/* Vote Badges */

.vote-badge {
  font-size: 13px;
  font-weight: 650;
  padding: 3px 9px;
  border-radius: 999px;
  flex-shrink: 0;
}

.vote-badge.yea {
  color: var(--yea);
  background: var(--yea-soft);
}

.vote-badge.nay {
  color: var(--nay);
  background: var(--nay-soft);
}

.vote-badge.other {
  color: var(--text-secondary);
  background: var(--bg-subtle);
}

/* Hearing Row */

.hearing-date-box {
  width: 48px;
  padding: 6px 4px;
  border-radius: 10px;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hearing-month {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--nay);
}

.hearing-day {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
}

/* Bill Detail Stage Stepper & Vote Table */

.detail-hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-eyebrow {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-secondary);
}

.detail-h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.022em;
  line-height: 1.28;
}

.detail-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--text-secondary);
}

.stage-stepper {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.stage-bars {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.stage-bar {
  height: 4px;
  border-radius: 99px;
  background: var(--bg-subtle-strong);
}

.stage-bar.reached {
  background: var(--text-primary);
}

.stage-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.stage-labels span.current {
  color: var(--text-primary);
  font-weight: 650;
}

.summary-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vote-tally-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.vote-big-num {
  font-size: 32px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.vote-unit {
  font-size: 14px;
  color: var(--text-secondary);
  margin-left: 4px;
  margin-right: 14px;
}

.vote-progress-track {
  height: 5px;
  border-radius: 99px;
  background: var(--bg-subtle-strong);
  overflow: hidden;
  margin: 10px 0 14px;
}

.vote-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--text-primary);
}

.party-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.party-table th {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: right;
  padding: 4px 0 6px;
}

.party-table th:first-child {
  text-align: left;
}

.party-table td {
  padding: 8px 0;
  border-top: 1px solid var(--border-hairline);
  text-align: right;
}

.party-table td:first-child {
  text-align: left;
}

.timeline-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border-hairline);
}

.timeline-row:last-child {
  border-bottom: 0;
}

.timeline-date {
  width: 58px;
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* Representative Profile Header */

.rep-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 16px 4px;
  gap: 10px;
}

.rep-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 400px;
  margin-top: 6px;
}

.action-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 11px 8px;
  border-radius: 14px;
  border: 0;
  background: var(--bg-subtle);
  color: var(--tint);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.14s ease;
}

.action-tile:hover:not(.disabled) {
  background: var(--bg-subtle-strong);
  text-decoration: none;
}

.action-tile.disabled {
  opacity: 0.4;
  color: var(--text-secondary);
  pointer-events: none;
}

/* Search Bar & Filter Chips */

.search-box-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box-wrap svg.search-icon {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 84px 0 38px;
  border-radius: 12px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  font-size: 15px;
  outline: none;
}

.search-input:focus {
  border-color: var(--tint);
  box-shadow: 0 0 0 3px var(--tint-soft);
}

.search-submit-btn {
  position: absolute;
  right: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  border: 0;
  background: var(--tint);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.chip.active {
  background: var(--text-primary);
  color: var(--bg-card);
  font-weight: 600;
}

.chip-select {
  height: 32px;
  padding: 0 28px 0 13px;
  border-radius: 999px;
  border: 0;
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

/* Skeleton Placeholders */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-subtle) 25%,
    var(--bg-subtle-strong) 50%,
    var(--bg-subtle) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Modals / Sheets */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg-modal-backdrop);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-sheet {
  width: 100%;
  max-width: 540px;
  max-height: min(86dvh, 720px);
  background: var(--bg-canvas);
  border-radius: 20px;
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-hairline);
}

.modal-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 650;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Toast Notifications */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--text-primary);
  color: var(--bg-card);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

/* Mobile Tab Bar (Hidden on Desktop) */

.mobile-tabbar {
  display: none;
}

@media (max-width: 899px) {
  .sidebar {
    display: none;
  }

  .topbar-inner {
    padding: 11px 16px;
  }

  .page-content {
    padding: 16px 16px calc(84px + env(safe-area-inset-bottom));
    gap: 18px;
  }

  .mobile-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--bg-glass);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--border-hairline);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }

  .mobile-tab-btn {
    border: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 2px;
    color: var(--text-tertiary);
    font-size: 10.5px;
    font-weight: 500;
    cursor: pointer;
  }

  .mobile-tab-btn.active {
    color: var(--tint);
    font-weight: 600;
  }

  .mobile-tab-btn svg {
    width: 21px;
    height: 21px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-sheet {
    max-width: 100%;
    max-height: 90dvh;
    border-radius: 20px 20px 0 0;
  }

  .toast-container {
    bottom: calc(76px + env(safe-area-inset-bottom));
    left: 16px;
    right: 16px;
    align-items: center;
  }
}
