:root {
  color-scheme: dark;
  --bg: #070707;
  --surface: #111111;
  --surface-2: #171717;
  --surface-3: #202020;
  --line: #2d2a26;
  --text: #f6f3ed;
  --muted: #a9a29a;
  --muted-2: #7d756d;
  --orange: #ef233c;
  --orange-2: #ff5a66;
  --danger: #f04444;
  --good: #30d158;
  --warn: #ffd166;
  --info: #4da3ff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  --radius: 8px;
  --sidebar-collapsed: 72px;
  --sidebar-expanded: 280px;
  --sidebar: var(--sidebar-collapsed);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

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

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top left, rgba(239, 35, 60, 0.2), transparent 30rem),
    linear-gradient(135deg, #050505 0%, #0a0a0a 45%, #15100c 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

.app-background-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(7, 7, 7, calc(1 - var(--app-bg-opacity))), rgba(7, 7, 7, calc(1 - var(--app-bg-opacity)))),
    var(--app-bg-image) center / cover no-repeat;
}

.mobile-topbar,
.app-shell {
  position: relative;
  z-index: 1;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(100%, 980px);
  display: grid;
  grid-template-columns: 1fr 420px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 12, 12, 0.92);
  box-shadow: var(--shadow);
}

.auth-brand {
  min-height: 560px;
  padding: 38px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(135deg, rgba(239, 35, 60, 0.24), transparent 42%),
    repeating-linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.035) 0,
      rgba(255, 255, 255, 0.035) 1px,
      transparent 1px,
      transparent 12px
    ),
    #090909;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--orange), #7f1020);
  color: #100905;
  font-weight: 900;
  box-shadow: 0 12px 32px rgba(239, 35, 60, 0.26);
}

.app-logo {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 46px;
}

.app-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.app-logo .logo-mark {
  width: 46px;
  height: 46px;
}

.brand-kicker,
.eyebrow {
  margin: 0 0 8px;
  color: var(--orange-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-title {
  margin: 0;
  font-size: clamp(42px, 6vw, 68px);
  line-height: 0.94;
  max-width: 620px;
}

.brand-copy {
  max-width: 540px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.auth-form-panel {
  padding: 34px;
  background: var(--surface);
  border-left: 1px solid var(--line);
}

.auth-form-panel h1,
.page-title h1,
.modal-title h2 {
  margin: 0;
}

.auth-form-panel h1 {
  font-size: 27px;
}

.auth-form-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  transition: grid-template-columns 320ms ease;
}

.app-shell.sidebar-expanded {
  grid-template-columns: var(--sidebar-expanded) 1fr;
}

.app-shell.sidebar-collapsing {
  grid-template-columns: var(--sidebar) 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--sidebar-collapsed);
  padding: 18px 10px;
  border-right: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.96);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  transition:
    width 320ms ease,
    padding 320ms ease,
    box-shadow 280ms ease;
}

.sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sidebar.sidebar-expanded {
  width: var(--sidebar-expanded);
  padding: 20px 16px;
  box-shadow: 14px 0 34px rgba(0, 0, 0, 0.18);
}

.sidebar.sidebar-collapsing {
  width: var(--sidebar-collapsed);
  padding: 18px 10px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  min-width: 0;
}

.sidebar-header strong {
  display: block;
  font-size: 15px;
}

.sidebar-header span {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-header > div:not(.logo-mark) {
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity 180ms ease,
    transform 220ms ease;
}

.sidebar.sidebar-labels-visible .sidebar-header > div:not(.app-logo) {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0ms;
}

.mobile-topbar {
  display: none;
}

.mobile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-category {
  display: block;
  position: relative;
  height: 12px;
  margin: 14px 8px 2px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
  transition:
    height 220ms ease,
    margin 220ms ease,
    opacity 160ms ease;
}

.nav-category::before {
  position: absolute;
  top: 50%;
  left: 10px;
  right: 10px;
  height: 1px;
  content: "";
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-50%);
  transition: opacity 120ms ease;
}

.sidebar.sidebar-labels-visible .nav-category {
  height: 14px;
  margin: 18px 8px 5px;
  opacity: 1;
  transition-delay: 0ms;
}

.sidebar.sidebar-labels-visible .nav-category::before {
  opacity: 0;
}

.nav-button {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.nav-button:hover,
.nav-button.active {
  border-color: rgba(239, 35, 60, 0.24);
  background: rgba(239, 35, 60, 0.08);
  color: var(--text);
}

.nav-button.active {
  box-shadow: inset 3px 0 0 var(--orange);
}

.nav-icon,
.btn-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--orange-2);
  font-weight: 800;
  font-size: 12px;
}

.btn-icon {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}

.nav-icon.image {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

.nav-icon.image img {
  display: block;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  image-rendering: auto;
  object-fit: contain;
}

.nav-label,
.sidebar-footer {
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  flex: 0 1 auto;
  transition:
    opacity 140ms ease,
    max-width 260ms ease;
}

.sidebar.sidebar-labels-visible .nav-label {
  max-width: 190px;
  opacity: 1;
  transition:
    opacity 160ms ease,
    max-width 260ms ease;
}

.sidebar-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.sidebar.sidebar-labels-visible .sidebar-footer {
  max-width: 220px;
  opacity: 1;
  transition-delay: 0ms;
}

.user-chip {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.user-chip strong {
  display: block;
}

.user-chip span {
  color: var(--muted);
  font-size: 12px;
}

.main {
  min-width: 0;
  padding: 28px;
}

.global-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.global-search {
  min-width: min(100%, 420px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(9, 9, 9, 0.9);
}

.global-search .input {
  border: 0;
  min-height: 30px;
  padding: 4px 6px;
  background: transparent;
}

.global-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.profile-menu {
  position: relative;
}

.notification-menu {
  position: relative;
}

.notification-trigger {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 12, 12, 0.92);
  color: var(--text);
}

.notification-trigger:hover,
.notification-trigger:focus-visible,
.notification-menu.open .notification-trigger {
  border-color: rgba(239, 35, 60, 0.44);
  background: rgba(239, 35, 60, 0.08);
  outline: none;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 1px solid #2a0508;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 950;
}

.notification-lottie {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
}

.notification-lottie svg {
  width: 30px !important;
  height: 30px !important;
}

.notification-dropdown {
  position: absolute;
  right: 0;
  z-index: 85;
  top: calc(100% + 8px);
  width: min(360px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 120px));
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(239, 35, 60, 0.3);
  border-radius: var(--radius);
  background: #0a0a0a;
  box-shadow: var(--shadow);
}

.notification-dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--orange-2);
  font-size: 12px;
  font-weight: 850;
}

.notification-list {
  display: grid;
  gap: 0;
  overflow-y: auto;
}

.notification-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.notification-item.unread {
  background: rgba(239, 35, 60, 0.08);
}

.notification-item > button:first-child {
  display: grid;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.notification-item span,
.notification-item time {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 12, 12, 0.92);
  color: var(--text);
}

.profile-trigger:hover,
.profile-trigger:focus-visible,
.profile-menu.open .profile-trigger {
  border-color: rgba(239, 35, 60, 0.44);
  background: rgba(239, 35, 60, 0.08);
  outline: none;
}

.profile-trigger-text {
  display: grid;
  gap: 2px;
  justify-items: start;
  min-width: 0;
}

.profile-trigger-text strong {
  max-width: 160px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  position: relative;
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 42px;
  overflow: hidden;
  border: 1px solid rgba(239, 35, 60, 0.34);
  border-radius: 999px;
  background: #17110c;
  color: var(--orange-2);
  font-size: 13px;
  font-weight: 950;
}

.avatar.small {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  font-size: 11px;
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar img + span {
  visibility: hidden;
}

.profile-dropdown {
  position: absolute;
  right: 0;
  z-index: 80;
  top: calc(100% + 8px);
  min-width: 210px;
  padding: 8px;
  border: 1px solid rgba(239, 35, 60, 0.3);
  border-radius: var(--radius);
  background: #0a0a0a;
  box-shadow: var(--shadow);
}

.profile-dropdown button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.profile-dropdown button:hover,
.profile-dropdown button:focus-visible {
  background: rgba(239, 35, 60, 0.1);
  outline: none;
}

.save-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(48, 209, 88, 0.22);
  border-radius: var(--radius);
  background: rgba(48, 209, 88, 0.07);
  color: #98f2ad;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.refresh-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(239, 35, 60, 0.28);
  border-radius: var(--radius);
  background: rgba(239, 35, 60, 0.09);
  color: #ffb66b;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.global-results {
  margin-bottom: 18px;
}

.result-list {
  display: grid;
  gap: 8px;
}

.result-item {
  width: 100%;
  display: grid;
  grid-template-columns: max-content minmax(140px, 0.6fr) 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d0d0d;
  color: var(--text);
  text-align: left;
}

.result-item:hover {
  border-color: rgba(239, 35, 60, 0.5);
  background: #17110c;
}

.result-item span:last-child {
  color: var(--muted);
}

.debug-panel {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(77, 163, 255, 0.35);
  border-radius: var(--radius);
  background: rgba(77, 163, 255, 0.07);
}

.debug-panel strong {
  display: block;
  margin-bottom: 4px;
}

.debug-panel span {
  color: #bfdcff;
  font-size: 12px;
}

.debug-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.error-card {
  width: min(100%, 760px);
}

.page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-title-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.page-title-icon {
  width: clamp(40px, 5vw, 56px);
  height: clamp(40px, 5vw, 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.page-title-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.page-title h1 {
  font-size: clamp(27px, 4vw, 42px);
  line-height: 1.05;
}

.page-title p {
  margin: 8px 0 0;
  color: var(--muted);
}

.toolbar,
.filters,
.button-row,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 16px;
}

.filters {
  flex: 1;
}

.filters .input {
  max-width: 320px;
}

.filters .select {
  max-width: 210px;
}

.list-summary {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.progress-wrap {
  position: relative;
  height: 28px;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #090909;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--good));
}

.progress-wrap span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.grid {
  display: grid;
  gap: 14px;
}

.grouped-list {
  display: grid;
  gap: 18px;
}

.calendar-shell {
  display: grid;
  gap: 14px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calendar-toolbar h2 {
  margin: 0;
  font-size: 22px;
}

.team-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekdays span {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0c0c0c;
}

.calendar-day.muted {
  opacity: 0.45;
}

.calendar-day.today {
  border-color: rgba(239, 35, 60, 0.65);
  box-shadow: inset 0 0 0 1px rgba(239, 35, 60, 0.18);
}

.calendar-day-number {
  color: var(--text);
  font-weight: 900;
}

.calendar-day-events {
  display: grid;
  gap: 5px;
}

.calendar-event-pill {
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.calendar-event-pill:hover,
.calendar-event-pill:focus-visible {
  border-color: rgba(239, 35, 60, 0.5);
  outline: none;
}

.calendar-event-pill span {
  color: var(--muted-2);
  font-size: 11px;
}

.calendar-event-pill strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event-pill.danger {
  border-color: rgba(240, 68, 68, 0.4);
}

.calendar-event-pill.warn {
  border-color: rgba(255, 90, 102, 0.4);
}

.calendar-event-pill.info {
  border-color: rgba(239, 35, 60, 0.28);
}

.grind-hero {
  margin-bottom: 14px;
}

.grind-hero-grid,
.dashboard-grind-widget,
.grind-entry-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.grind-hero-grid {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.grind-hero-copy h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.grind-hero-copy p,
.grind-dashboard-copy {
  margin: 0;
  color: var(--text);
  font-weight: 850;
}

.dashboard-grind-widget {
  grid-template-columns: auto minmax(0, 1fr);
}

.grind-dashboard-copy {
  display: grid;
  gap: 8px;
}

.grind-team-mini {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.flame-icon {
  display: inline-grid;
  min-width: 24px;
  min-height: 24px;
  place-items: center;
  border: 1px solid rgba(239, 35, 60, 0.45);
  border-radius: 999px;
  background: rgba(239, 35, 60, 0.12);
  color: var(--orange-2);
  font-size: 10px;
  font-weight: 950;
}

.grind-toolbar {
  margin-bottom: 14px;
}

.grind-week-card,
.grind-month-card {
  margin-bottom: 14px;
}

.grind-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.grind-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.grind-day {
  display: grid;
  min-height: 98px;
  gap: 7px;
  align-content: center;
  justify-items: center;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0c0c0c;
  color: var(--text);
  cursor: pointer;
}

.grind-day.prominent {
  min-height: 154px;
}

.grind-day:hover,
.grind-day:focus-visible,
.grind-day.selected {
  border-color: rgba(239, 35, 60, 0.62);
  outline: none;
}

.grind-day.today {
  box-shadow: inset 0 0 0 1px rgba(239, 35, 60, 0.2);
}

.grind-day.muted {
  opacity: 0.42;
}

.grind-day-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.grind-day-status {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 850;
}

.grind-dot {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  color: #050505;
  font-size: 13px;
  font-weight: 950;
}

.grind-score {
  --score-color: var(--danger);
  --score-bg: rgba(240, 68, 68, 0.15);
  display: grid;
  width: 82px;
  gap: 6px;
  justify-items: center;
  color: var(--text);
}

.grind-score.large {
  width: 116px;
}

.grind-score-inner {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, #101010 0 55%, transparent 56%),
    conic-gradient(var(--score-color) var(--score-progress), #282828 0);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.grind-score.large .grind-score-inner {
  width: 104px;
  height: 104px;
}

.grind-score-inner strong {
  align-self: end;
  font-size: 24px;
  line-height: 1;
}

.grind-score.large .grind-score-inner strong {
  font-size: 34px;
}

.grind-score-inner span {
  align-self: start;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.grind-score small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.grind-score.danger,
.grind-dot.danger {
  --score-color: #f04444;
  --score-bg: rgba(240, 68, 68, 0.16);
  background: #f04444;
}

.grind-score.warn,
.grind-dot.warn {
  --score-color: #ffd166;
  --score-bg: rgba(255, 209, 102, 0.16);
  background: #ffd166;
}

.grind-score.good-light,
.grind-dot.good-light {
  --score-color: #8ef58e;
  --score-bg: rgba(142, 245, 142, 0.16);
  background: #8ef58e;
}

.grind-score.good,
.grind-dot.good {
  --score-color: #30d158;
  --score-bg: rgba(48, 209, 88, 0.18);
  background: #30d158;
}

.grind-score.danger,
.grind-score.warn,
.grind-score.good-light,
.grind-score.good {
  background: transparent;
}

.grind-detail-card {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0c0c0c;
}

.grind-form-score {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 17, 17, 0.94);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

.card-body {
  padding: 16px;
}

.settings-accordion {
  display: grid;
  gap: 12px;
  max-width: 1180px;
}

.settings-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 17, 17, 0.94);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

.settings-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
  transition:
    background 140ms ease,
    color 140ms ease;
}

.settings-summary::-webkit-details-marker {
  display: none;
}

.settings-summary:hover,
.settings-summary:focus-visible {
  background: rgba(239, 35, 60, 0.08);
  outline: none;
}

.settings-summary strong,
.settings-summary small {
  display: block;
}

.settings-summary strong {
  font-size: 16px;
  line-height: 1.25;
}

.settings-summary small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.settings-chevron {
  flex: 0 0 auto;
  color: var(--orange-2);
  font-size: 15px;
  font-weight: 950;
  transition: transform 160ms ease;
}

.settings-panel[open] .settings-chevron {
  transform: rotate(90deg);
}

.settings-panel-body {
  padding: 0 16px 16px;
  animation: settingsReveal 160ms ease;
}

.settings-section-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.settings-section-top .card-text {
  margin: 0;
}

.settings-subsection {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.settings-subsection h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.settings-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-role-card {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0c0c0c;
}

.settings-role-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.profile-card-title,
.profile-form-preview {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-form-preview {
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0c0c0c;
}

.profile-form-preview small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

@keyframes settingsReveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-top,
.dashboard-strip,
.dashboard-secondary {
  margin-top: 14px;
}

.dashboard-top {
  align-items: stretch;
}

.dashboard-top .card-body,
.dashboard-secondary .card-body {
  padding: 14px;
}

.dashboard-priority {
  border-left: 3px solid var(--orange);
}

.dashboard-hero {
  margin-top: 4px;
  border-color: rgba(239, 35, 60, 0.25);
  background: linear-gradient(135deg, rgba(239, 35, 60, 0.11), rgba(17, 17, 17, 0.94) 42%);
}

.dashboard-hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 32px;
  align-items: end;
  padding: 28px;
}

.dashboard-hero h2 {
  max-width: 780px;
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
}

.dashboard-hero p:not(.eyebrow) {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.dashboard-hero-side {
  display: grid;
  gap: 12px;
}

.dashboard-hero-side > span {
  color: var(--orange-2);
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.dashboard-key-grid {
  margin-top: 22px;
}

.dashboard-key-grid .card-body {
  padding: 14px;
}

.dashboard-calendar-card {
  margin-top: 22px;
}

.dashboard-calendar-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.mini-calendar {
  display: grid;
  gap: 8px;
}

.mini-calendar-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.mini-calendar-weekdays,
.mini-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.mini-calendar-weekdays span {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.mini-calendar-day {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b0b0b;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.mini-calendar-day.muted {
  opacity: 0.35;
}

.mini-calendar-day.today {
  border-color: rgba(239, 35, 60, 0.6);
}

.mini-calendar-day.has-event {
  color: #fff;
  background: rgba(239, 35, 60, 0.16);
}

.dashboard-actions,
.dashboard-activity {
  margin-top: 28px;
}

.section-label {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dashboard-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-action-row .btn {
  min-height: 36px;
  padding: 8px 10px;
}

.dashboard-activity .card {
  box-shadow: none;
}

.pickem-hero {
  margin-bottom: 16px;
  border-color: rgba(239, 35, 60, 0.25);
  background:
    linear-gradient(135deg, rgba(239, 35, 60, 0.16), transparent 42%),
    rgba(17, 17, 17, 0.94);
}

.pickem-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}

.pickem-hero h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
}

.pickem-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 10px;
  min-width: min(100%, 420px);
}

.pickem-hero-stats div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 8, 8, 0.42);
}

.pickem-hero-stats span,
.pickem-pick-groups span {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pickem-hero-stats strong {
  display: block;
  margin-top: 6px;
}

.pickem-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.pickem-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.tab-button {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d0d0d;
  color: var(--muted);
  font-weight: 800;
}

.tab-button.mini {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 11px;
}

.tab-button.active,
.tab-button:hover,
.tab-button:focus-visible {
  border-color: rgba(239, 35, 60, 0.5);
  background: rgba(239, 35, 60, 0.1);
  color: var(--text);
  outline: none;
}

.pickem-main,
.pickem-admin,
.pickem-stage-teams,
.pickem-bracket {
  margin-top: 14px;
}

.team-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  margin: 3px 4px 3px 0;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0d0d0d;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.team-chip img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

.team-chip.inactive {
  opacity: 0.55;
  border-style: dashed;
}

button.team-chip.removable {
  cursor: pointer;
}

button.team-chip.removable:hover,
button.team-chip.removable:focus-visible {
  border-color: rgba(239, 35, 60, 0.5);
  background: rgba(239, 35, 60, 0.1);
  outline: none;
}

.pickem-pick-groups {
  display: grid;
  gap: 14px;
}

.pickem-team-admin-list,
.pickem-builder {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.pickem-team-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d0d0d;
}

.pickem-pick-section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d0d0d;
}

.pickem-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pickem-counter {
  color: var(--orange-2);
  font-size: 13px;
  font-weight: 900;
}

.pickem-selected {
  min-height: 34px;
  margin-bottom: 10px;
}

.pickem-compare,
.pickem-table {
  display: grid;
  gap: 8px;
}

.pickem-compare-row,
.pickem-table-row {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d0d0d;
}

.pickem-compare-player {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.pickem-compare-player span,
.pickem-compare-group > span,
.pickem-slot span {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pickem-compare-group {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.pickem-slot-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.pickem-slot {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.pickem-slot em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.pickem-table-row {
  grid-template-columns: 42px minmax(120px, 1fr) repeat(4, minmax(70px, auto));
  align-items: center;
}

.pickem-table-row span {
  color: var(--muted);
  font-size: 12px;
}

.pickem-team-grid,
.pickem-stage-team-grid,
.pickem-checkboxes,
.pickem-results-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.pickem-stage-team-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.pickem-stage-team-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d0d0d;
}

.pickem-stage-team-card img,
.pickem-stage-team-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.pickem-stage-team-card img {
  object-fit: cover;
}

.pickem-stage-team-logo {
  display: grid;
  place-items: center;
  border: 1px solid rgba(239, 35, 60, 0.25);
  background: rgba(239, 35, 60, 0.1);
  color: var(--orange-2);
  font-size: 11px;
  font-weight: 900;
}

.pickem-stage-team-card strong,
.pickem-stage-team-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pickem-stage-team-card strong {
  font-size: 13px;
}

.pickem-stage-team-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.pickem-bracket-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.playoff-round {
  display: grid;
  align-content: start;
  gap: 10px;
}

.playoff-match-card,
.playoff-pick-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d0d0d;
}

.playoff-match-top,
.playoff-versus {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.playoff-match-top span,
.playoff-versus > span {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.playoff-versus {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.pickem-results-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.muted-text {
  color: var(--muted);
}

.static-item {
  cursor: default;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 0;
}

.dashboard-link {
  margin: -1px -1px 0;
  padding: 16px;
  border: 1px solid transparent;
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.dashboard-link:hover,
.dashboard-link:focus-visible {
  border-color: rgba(239, 35, 60, 0.45);
  background: rgba(239, 35, 60, 0.08);
  outline: none;
}

.dashboard-link:hover .link-arrow,
.dashboard-link:focus-visible .link-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.link-arrow {
  display: inline-block;
  color: var(--orange-2);
  opacity: 0.7;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.card-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.card-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.card-text {
  margin: 12px 0 0;
  color: #d7d0c8;
  line-height: 1.55;
  white-space: pre-wrap;
}

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

.section-title {
  margin: 24px 0 12px;
  font-size: 18px;
}

.compact-heading {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-card {
  min-height: 82px;
  padding: 13px;
  border-left: 3px solid var(--orange);
}

.stat-link {
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

.stat-link:hover,
.stat-link:focus-visible {
  border-color: rgba(239, 35, 60, 0.5);
  background: rgba(239, 35, 60, 0.08);
  outline: none;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.view-all-chip {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 4px 7px;
  border: 1px solid rgba(239, 35, 60, 0.28);
  border-radius: var(--radius);
  color: var(--orange-2);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-summary-item {
  width: 100%;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d0d0d;
  color: var(--text);
  text-align: left;
}

.dashboard-summary-item:hover,
.dashboard-summary-item:focus-visible {
  border-color: rgba(239, 35, 60, 0.45);
  background: #17110c;
  outline: none;
}

.dashboard-summary-item span {
  color: var(--muted);
  font-size: 13px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quick-grid .btn {
  min-height: 36px;
  justify-content: flex-start;
  padding: 8px 9px;
}

.empty-state {
  padding: 28px;
  border: 1px dashed #3a332d;
  border-radius: var(--radius);
  background: rgba(239, 35, 60, 0.04);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.btn:hover {
  border-color: rgba(239, 35, 60, 0.5);
  background: #21160e;
}

.btn.primary {
  border-color: #e16612;
  background: linear-gradient(180deg, #ff831f, #d95508);
  color: #140a03;
  font-weight: 850;
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  border-color: rgba(240, 68, 68, 0.55);
  background: rgba(240, 68, 68, 0.12);
  color: #ffb4b4;
}

.btn.icon-only {
  width: 38px;
  padding: 0;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
}

.field label {
  color: #d9d2ca;
  font-size: 13px;
  font-weight: 700;
}

.field small {
  color: var(--muted-2);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0b0b;
  color: var(--text);
  padding: 9px 10px;
  outline: none;
}

.textarea {
  min-height: 98px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(239, 35, 60, 0.14);
}

.map-picker {
  position: relative;
}

.map-picker-filter {
  min-width: 190px;
  max-width: 230px;
  margin-bottom: 0;
}

.map-picker-toggle,
.map-picker-option {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0b0b;
  color: var(--text);
  padding: 0;
  text-align: left;
}

.map-picker-toggle:hover,
.map-picker-toggle:focus-visible,
.map-picker-option:hover,
.map-picker-option:focus-visible,
.map-picker-option.selected {
  border-color: rgba(239, 35, 60, 0.55);
  outline: none;
}

.map-picker-toggle:focus-visible {
  box-shadow: 0 0 0 3px rgba(239, 35, 60, 0.14);
}

.map-picker-visual {
  position: relative;
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  border-radius: calc(var(--radius) - 1px);
  padding: 8px 10px;
}

.map-picker-visual.has-banner {
  background:
    linear-gradient(90deg, rgba(7, 7, 7, 0.86), rgba(7, 7, 7, 0.7)),
    var(--map-banner) center / cover;
}

.map-picker-visual img,
.map-choice img {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 5px;
  object-fit: cover;
}

.map-picker-visual span,
.map-choice span {
  position: relative;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-picker-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  left: 0;
  width: min(360px, 100%);
  padding: 8px;
  border: 1px solid rgba(239, 35, 60, 0.26);
  border-radius: var(--radius);
  background: #0a0a0a;
  box-shadow: var(--shadow);
}

.map-picker-search {
  min-height: 34px;
  margin-bottom: 8px;
}

.map-picker-options {
  display: grid;
  max-height: 260px;
  overflow: auto;
  gap: 6px;
}

.map-picker-option {
  min-height: 36px;
}

.map-picker-option .map-picker-visual {
  min-height: 36px;
  padding: 7px 9px;
}

.map-check-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.map-choice {
  position: relative;
  overflow: hidden;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: #0c0c0c;
}

.map-choice.has-banner {
  background:
    linear-gradient(90deg, rgba(7, 7, 7, 0.9), rgba(7, 7, 7, 0.72)),
    var(--map-banner) center / cover;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0d0d0d;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pill.orange {
  border-color: rgba(239, 35, 60, 0.44);
  color: var(--orange-2);
}

.pill.good {
  border-color: rgba(48, 209, 88, 0.44);
  color: #8df0a5;
}

.pill.warn {
  border-color: rgba(255, 90, 102, 0.44);
  color: #ffe19a;
}

.pill.danger {
  border-color: rgba(240, 68, 68, 0.44);
  color: #ffb4b4;
}

.map-pill img {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
}

.map-pill.has-banner {
  border-color: rgba(239, 35, 60, 0.5);
  background:
    linear-gradient(90deg, rgba(7, 7, 7, 0.88), rgba(7, 7, 7, 0.72)),
    var(--map-banner) center / cover;
  color: var(--text);
}

.map-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.map-inline-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}

.map-inline-label img {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  object-fit: cover;
}

.card.map-card {
  position: relative;
  overflow: hidden;
}

.card.map-card::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(135deg, rgba(17, 17, 17, 0.92), rgba(17, 17, 17, 0.78)),
    var(--map-banner) center / cover;
  opacity: 0.55;
}

.card.map-card > * {
  position: relative;
  z-index: 1;
}

.map-pool-list {
  display: grid;
  gap: 10px;
}

.map-pool-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0c0c0c;
}

.map-pool-row strong,
.map-pool-row small {
  display: block;
}

.map-pool-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.map-pool-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111;
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
}

.map-pool-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.compact-details {
  margin-top: 10px;
  gap: 8px;
}

.detail-row {
  display: grid;
  gap: 5px;
}

.detail-row span {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-row p {
  margin: 0;
  color: #e8e0d6;
  line-height: 1.45;
  white-space: pre-wrap;
}

.legacy-util {
  color: var(--muted-2) !important;
  font-size: 13px;
}

.utility-chip-list,
.utility-picker-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.utility-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(239, 35, 60, 0.38);
  border-radius: 999px;
  background: rgba(239, 35, 60, 0.08);
  color: #ffd4d9;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.utility-chip:hover,
.utility-chip:focus-visible {
  border-color: rgba(239, 35, 60, 0.72);
  background: rgba(239, 35, 60, 0.16);
  outline: none;
}

.utility-picker {
  display: grid;
  gap: 10px;
}

.utility-picker-selected {
  display: grid;
}

.utility-selected-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d0d0d;
}

.utility-picker-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  padding-right: 2px;
}

.utility-option {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0b0b;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.utility-option:hover,
.utility-option:focus-visible {
  border-color: rgba(239, 35, 60, 0.42);
  background: rgba(239, 35, 60, 0.07);
  outline: none;
}

.utility-option span,
.empty-inline {
  color: var(--muted-2);
  font-size: 12px;
}

.utility-popout {
  display: grid;
  gap: 22px;
}

.embedded-utility-grid {
  display: grid;
  gap: 8px;
}

.embedded-utility-card {
  width: 100%;
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0b0b;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.embedded-utility-card:hover,
.embedded-utility-card:focus-visible,
.utility-thumb:hover,
.utility-thumb:focus-visible,
.utility-detail-image:hover,
.utility-detail-image:focus-visible {
  border-color: rgba(239, 35, 60, 0.5);
  background: rgba(239, 35, 60, 0.07);
  outline: none;
}

.embedded-utility-grid.no-map-visuals .embedded-utility-card {
  background: #0b0b0b;
}

.embedded-utility-grid.no-map-visuals .map-inline-label img {
  display: none;
}

.embedded-utility-card img,
.utility-thumb img,
.utility-thumb-placeholder {
  width: 58px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #050505;
}

.utility-thumb-placeholder {
  display: grid;
  place-items: center;
  color: var(--orange-2);
  font-size: 11px;
  font-weight: 900;
}

.embedded-utility-card strong,
.image-gallery-item strong {
  display: block;
  margin-bottom: 3px;
}

.embedded-utility-card small,
.image-gallery-item small,
.utility-more {
  display: block;
  color: var(--muted-2);
  font-size: 12px;
}

.utility-card-gallery {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.utility-thumb,
.utility-detail-image {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #080808;
  cursor: pointer;
  overflow: hidden;
}

.image-gallery-field,
.image-gallery-list {
  display: grid;
  gap: 10px;
}

.image-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr) auto;
  gap: 8px;
}

.image-gallery-item {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d0d0d;
}

.form-section {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0c0c0c;
}

.form-section + .form-section {
  margin-top: 14px;
}

.form-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.strat-slot-list,
.strat-assignment-list {
  display: grid;
  gap: 12px;
}

.strat-slot-card,
.strat-assignment-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0b0b;
}

.strat-slot-header,
.strat-assignment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.strat-assignment-card p {
  margin: 0;
  color: #e8e0d6;
  line-height: 1.45;
  white-space: pre-wrap;
}

.strat-detail-clean {
  gap: 12px;
}

.strat-assignment-toggle {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.strat-assignment-toggle summary {
  width: fit-content;
  color: var(--orange-2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.strat-assignment-toggle summary:hover,
.strat-assignment-toggle summary:focus-visible {
  color: #fff;
  outline: none;
}

.bomb-check {
  margin: 0;
  white-space: nowrap;
}

.utility-detail-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.utility-detail-gallery figure {
  margin: 0;
}

.utility-image-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 12px;
}

.utility-detail-gallery figcaption,
.utility-lightbox p {
  margin: 6px 0 0;
  color: var(--muted-2);
  font-size: 13px;
}

.utility-detail-gallery figcaption {
  display: grid;
  gap: 3px;
}

.utility-detail-gallery figcaption strong {
  color: var(--text);
  font-size: 12px;
  text-transform: uppercase;
}

.single-image-field,
.single-image-preview {
  display: grid;
  gap: 8px;
}

.file-btn {
  justify-content: center;
  cursor: pointer;
}

.side-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.side-check-grid .check-row {
  width: auto;
  min-width: 84px;
}

.utility-detail-image,
.utility-detail-image img,
.utility-lightbox img {
  width: 100%;
}

.utility-detail-image img,
.utility-lightbox img {
  display: block;
  max-height: 70vh;
  object-fit: contain;
  background: #050505;
}

.utility-detail-image img {
  aspect-ratio: 16 / 10;
  max-height: none;
  object-fit: cover;
}

.utility-lightbox {
  display: grid;
  gap: 12px;
}

.utility-popout-media {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #080808;
}

.compact-details .detail-row p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.activity-list {
  display: grid;
  gap: 9px;
}

.activity-item {
  width: 100%;
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #dfd8cf;
  line-height: 1.45;
  text-align: left;
}

.clickable-activity,
.activity-item[title] {
  cursor: pointer;
}

.activity-item:hover,
.activity-item:focus-visible {
  border-color: rgba(239, 35, 60, 0.35);
  background: rgba(239, 35, 60, 0.06);
  outline: none;
}

.activity-dot {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--orange);
  flex: 0 0 8px;
}

.activity-item time {
  display: block;
  color: var(--muted-2);
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
}

.modal {
  width: min(100%, 720px);
  max-height: min(90vh, 900px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101010;
  box-shadow: var(--shadow);
}

.modal.modal-wide {
  width: min(100%, 1120px);
}

.modal-title {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #101010;
}

.modal-content {
  padding: 18px;
}

.modal.modal-wide .modal-title,
.modal.modal-wide .modal-content {
  padding: 22px;
}

.modal-actions {
  justify-content: flex-end;
  padding-top: 10px;
}

#toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}

.toast {
  padding: 12px 14px;
  border: 1px solid rgba(239, 35, 60, 0.45);
  border-radius: var(--radius);
  background: #14110f;
  color: var(--text);
  box-shadow: var(--shadow);
}

.hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-item {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d0d0d;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.compact-item:hover,
.compact-item:focus-visible {
  border-color: rgba(239, 35, 60, 0.45);
  background: #17110c;
  outline: none;
}

.compact-item span {
  color: var(--muted);
  font-size: 13px;
}

.section-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.check-grid {
  display: grid;
  gap: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0c0c0c;
  color: #dcd5cc;
  font-size: 13px;
  font-weight: 700;
}

.check-row input {
  accent-color: var(--orange);
}

@media (max-width: 1100px) {
  .grid.cols-4,
  .grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-hero-content {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .pickem-hero {
    display: grid;
  }

  .pickem-hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .debug-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .utility-detail-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-panel {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: 360px;
  }

  .auth-form-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .app-shell {
    display: block;
    grid-template-columns: none;
  }

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 8, 8, 0.96);
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 25;
    width: min(88vw, 320px);
    padding: 20px 16px;
    transform: translateX(-100%);
    transition: transform 160ms ease;
  }

  .sidebar.sidebar-expanded,
  .sidebar.open {
    width: min(88vw, 320px);
    padding: 20px 16px;
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-header > div:not(.logo-mark),
  .nav-label,
  .sidebar-footer {
    max-width: none;
    opacity: 1;
    transform: none;
  }

  .nav-category,
  .nav-button {
    justify-content: flex-start;
  }

  .nav-category {
    margin: 14px 8px 4px;
  }

  .nav-category::before {
    opacity: 0;
  }

  .main {
    padding: 18px 14px 28px;
  }

  .global-bar,
  .global-meta {
    display: grid;
    justify-content: stretch;
  }

  .global-search {
    min-width: 0;
  }

  .filters .input,
  .filters .select,
  .global-meta .btn {
    max-width: none;
    width: 100%;
  }

  .global-meta .profile-menu {
    display: none;
  }

  .mobile-actions .notification-dropdown {
    right: -56px;
  }

  .mobile-actions .profile-trigger-text {
    display: none;
  }

  .save-status {
    justify-content: center;
  }

  .refresh-status {
    justify-content: center;
  }

  .dashboard-hero-content {
    padding: 22px;
    gap: 22px;
  }

  .dashboard-hero h2 {
    font-size: 28px;
  }

  .pickem-table-row {
    grid-template-columns: 1fr 1fr;
  }

  .pickem-filter-tabs {
    justify-content: flex-start;
  }

  .pickem-slot-list {
    grid-template-columns: 1fr;
  }

  .pickem-bracket-grid {
    grid-template-columns: 1fr;
  }

  .pickem-results-grid {
    grid-template-columns: 1fr;
  }

  .pickem-team-admin-row {
    grid-template-columns: 1fr;
  }

  .dashboard-calendar-grid {
    grid-template-columns: 1fr;
  }

  .grind-hero-grid,
  .dashboard-grind-widget {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .grind-week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-calendar-grid {
    gap: 5px;
  }

  .calendar-day {
    min-height: 104px;
    padding: 7px;
  }
}

@media (max-width: 620px) {
  .calendar-toolbar {
    display: grid;
  }

  .calendar-weekdays {
    display: none;
  }

  .team-calendar-grid {
    grid-template-columns: 1fr;
  }

  .grind-month-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grind-entry-layout {
    grid-template-columns: 1fr;
  }

  .calendar-day.muted {
    display: none;
  }

  .utility-detail-gallery {
    grid-template-columns: 1fr;
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }

  .page-title,
  .toolbar {
    display: grid;
  }

  .page-title {
    gap: 12px;
  }

  .page-title-main {
    align-items: flex-start;
  }

  .page-title-icon {
    width: 40px;
    height: 40px;
  }

  .card-header {
    display: grid;
  }

  .settings-section-top,
  .settings-summary {
    display: grid;
  }

  .settings-role-grid {
    grid-template-columns: 1fr;
  }

  .map-check-grid {
    grid-template-columns: 1fr;
  }

  .map-picker-menu {
    width: 100%;
  }

  .utility-selected-card {
    display: grid;
  }

  .utility-selected-card .button-row {
    justify-content: flex-start;
  }

  .image-add-row,
  .image-gallery-item,
  .strat-slot-header,
  .strat-assignment-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .button-row,
  .modal-actions {
    width: 100%;
  }

  .button-row .btn:not(.icon-only),
  .modal-actions .btn {
    flex: 1 1 140px;
  }

  .result-item {
    grid-template-columns: 1fr;
  }

  .map-pool-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .map-pool-row .button-row,
  .map-pool-row .card-meta {
    grid-column: 1 / -1;
  }

  .debug-grid {
    grid-template-columns: 1fr;
  }

  .section-picker {
    grid-template-columns: 1fr;
  }

  .dashboard-action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .auth-shell {
    padding: 12px;
  }

  .auth-brand,
  .auth-form-panel {
    padding: 24px;
  }
}

