/* Bundle Offers — v2 design tokens & base styles */
/* Loaded only on offers.indie.io (and v2=1 cookie/query for local dev). */

:root {
  /* Brand (indie.io) */
  --brand-50:  #F4F2FF;
  --brand-100: #E7E3FA;
  --brand-200: #CFC8F2;
  --brand-300: #A8A0E0;
  --brand-400: #7A6FD0;
  --brand-500: #5B53C7;
  --brand-600: #463FA8;
  --brand-700: #373278;
  --brand-800: #2A2660;

  --accent:        #E3414F;
  --accent-soft:   #FBE7EA;

  /* Semantic */
  --warning:      #C8761B;
  --warning-soft: #FBEAD3;
  --success:      #2F8F58;
  --success-soft: #DCEFE3;
  --danger:       #D14437;
  --danger-soft:  #FBE2DE;
  --info:         var(--brand-500);
  --info-soft:    var(--brand-100);

  /* Surfaces — Light (default) */
  --bg:    #FFFFFF;
  --bg-2:  #FBFBFD;
  --bg-3:  #F2F2F7;
  --line:  #E5E5EE;
  --line-2:#EFEFF4;
  --fg-1:  #14132A;
  --fg-2:  #383551;
  --fg-3:  #6B6885;
  --fg-4:  #9C99B2;
  --fg-5:  #C4C2D2;

  --brand:        var(--brand-700);
  --brand-soft:   var(--brand-100);
  --brand-strong: var(--brand-800);

  /* Typography */
  --font-display: 'Ubuntu', system-ui, sans-serif;
  --font-body:    'Lexend', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;

  /* Shape */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 22px;

  --shadow-1: 0 1px 2px rgba(20, 18, 40, 0.05);
  --shadow-2: 0 8px 24px -8px rgba(20, 18, 40, 0.12);
  --shadow-3: 0 20px 40px -16px rgba(20, 18, 40, 0.18);

  /* Density (default = comfortable) */
  --row-h:   48px;
  --pad:     16px;
  --pad-lg:  24px;
  --gap:     16px;
  --font-size: 14px;
}

[data-theme="dark"] {
  --bg:    #14121E;
  --bg-2:  #1C1A29;
  --bg-3:  #211E30;
  --line:  #2C2942;
  --line-2:#25223A;
  --fg-1:  #F5F2FF;
  --fg-2:  #C8C2E3;
  --fg-3:  #9088B3;
  --fg-4:  #6E6789;
  --fg-5:  #4A4565;

  --brand:        #9690F0;
  --brand-soft:   #2C264A;
  --brand-strong: #C9C4FF;

  --warning-soft: #3A2D14;
  --success-soft: #14302A;
  --danger-soft:  #3A1E1A;
  --accent-soft:  #3A1A22;
  --info-soft:    #2C264A;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 20px 40px -16px rgba(0, 0, 0, 0.6);
}

[data-density="compact"]    { --row-h: 38px; --pad: 12px; --pad-lg: 18px; --gap: 12px; --font-size: 13px; }
[data-density="comfortable"]{ --row-h: 48px; --pad: 16px; --pad-lg: 24px; --gap: 16px; --font-size: 14px; }
[data-density="spacious"]   { --row-h: 56px; --pad: 20px; --pad-lg: 30px; --gap: 22px; --font-size: 15px; }

/* Reset that overrides Pico just enough not to fight it. We keep Pico loaded
   for form-control resets but our own tokens drive the visual treatment. */
* { box-sizing: border-box; }
button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: inherit;
  padding: 0;
  margin: 0;
}

html, body {
  background: var(--bg);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: var(--font-size);
  line-height: 1.5;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--fg-1);
  margin: 0 0 0.6em 0;
  line-height: 1.2;
}
h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  position: relative;
  display: inline-block;
}
h1::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -2px;
  height: 7px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 7' preserveAspectRatio='none'><path d='M2 4 Q 18 1 36 3.2 T 72 3.4 T 110 3.6 T 148 3.5 T 186 3.4 T 218 3.2' fill='none' stroke='%23E3414F' stroke-width='2.2' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
  opacity: 0.85;
}
h1.no-underline::after { display: none; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; color: var(--fg-2); }

code, pre, .mono { font-family: var(--font-mono); }

/* === Topbar === */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 56px;
  padding: 0 var(--pad-lg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.topbar .brand-cluster img {
  height: 22px;
  width: auto;
  display: block;
}
.topbar .brand-cluster .divider {
  width: 1px;
  height: 22px;
  background: var(--line);
}
.topbar .product-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--fg-1);
  letter-spacing: 0.02em;
}
.topbar .nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  margin-left: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.topbar .nav::-webkit-scrollbar { display: none; }
.topbar .nav a {
  padding: 7px 12px;
  border-radius: var(--r-sm);
  color: var(--fg-3);
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.topbar .nav a:hover {
  background: var(--bg-3);
  color: var(--fg-1);
}
.topbar .nav a.active {
  background: var(--brand-soft);
  color: var(--brand);
}
.topbar .right-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.topbar .icon-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  width: 34px !important;
  height: 34px !important;
  min-width: 34px;
  min-height: 34px;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 1;
  color: var(--fg-2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.topbar .icon-btn svg {
  width: 18px !important;
  height: 18px !important;
  display: block;
  flex-shrink: 0;
  color: currentColor;
  stroke: currentColor;
}
.topbar .right-cluster > * {
  vertical-align: middle;
}
.topbar .icon-btn:hover {
  background: var(--bg-3);
  border-color: var(--line);
  color: var(--fg-1);
}
.topbar .avatar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--bg-2);
}
.topbar .avatar .av-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.topbar .avatar .av-name { font-size: 13px; font-weight: 500; }
.topbar .avatar .av-role {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-3);
}
.topbar button.avatar {
  cursor: pointer;
  font-family: inherit;
}
.avatar-menu {
  position: relative;
  display: inline-block;
}
.avatar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-1, var(--bg));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  padding: 6px;
  z-index: 200;
}
.avatar-dropdown-header {
  padding: 8px 10px 6px;
}
.av-dropdown-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-1);
}
.av-dropdown-email {
  font-size: 12px;
  color: var(--fg-3);
  word-break: break-all;
}
.avatar-dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}
.avatar-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--fg-2);
  background: none;
  border: none;
  border-radius: var(--r-sm, 6px);
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.avatar-dropdown-item:hover {
  background: var(--bg-3);
  color: var(--fg-1);
}
.avatar-dropdown-item-danger:hover {
  color: var(--danger);
}
.dropdown-enter { transition: opacity 0.12s ease-out, transform 0.12s ease-out; }
.dropdown-enter-start { opacity: 0; transform: translateY(-4px); }
.dropdown-enter-end { opacity: 1; transform: translateY(0); }

/* Konami easter egg — logo gentle sway */
@keyframes logoSway {
  0%, 100% { transform: rotate(0); }
  25%      { transform: rotate(-6deg); }
  75%      { transform: rotate(6deg); }
}
body.konami-active .topbar .brand-cluster img {
  animation: logoSway 1.2s ease-in-out 5;
  transform-origin: 50% 100%;
}

/* === Main container === */
main.container-v2 {
  max-width: 1480px;
  margin: 0 auto;
  padding: var(--pad-lg);
}

/* === Cards === */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--pad-lg);
  box-shadow: var(--shadow-1);
}
.card-flat {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--pad);
}

/* Stat card with colored top accent stripe */
.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-1);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  display: block;
  color: inherit;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-stripe, var(--brand));
}
.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}
.stat-card .stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-3);
}
.stat-card .stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  color: var(--fg-1);
  line-height: 1.1;
  margin-top: 6px;
}
.stat-card .stat-sub {
  font-size: 12px;
  color: var(--fg-3);
  margin-top: 4px;
}
.stat-card.tone-brand   { --accent-stripe: var(--brand); }
.stat-card.tone-warning { --accent-stripe: var(--warning); }
.stat-card.tone-success { --accent-stripe: var(--success); }
.stat-card.tone-accent  { --accent-stripe: var(--accent); }
.stat-card.tone-danger  { --accent-stripe: var(--danger); }

/* === Dashboard layout === */
.hero-greeting {
  margin: 6px 0 28px;
}
.hero-greeting h1 {
  margin: 0 0 0.5em 0;
}
.hero-greeting .signoff {
  margin-top: 14px;
  font-size: 13px;
  color: var(--fg-3);
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  margin-bottom: var(--pad-lg);
}
@media (max-width: 1100px) { .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .stat-row { grid-template-columns: 1fr; } }
.dashboard-body {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--pad-lg);
}
@media (max-width: 1100px) { .dashboard-body { grid-template-columns: 1fr; } }

/* Activity feed (timeline-style) */
.activity-feed { list-style: none; padding: 0; margin: 0; }
.activity-feed li {
  position: relative;
  padding: 10px 0 14px 22px;
  border-left: 1px solid var(--line);
  margin-left: 6px;
  font-size: 13px;
  color: var(--fg-2);
}
.activity-feed li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 14px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--bg);
}
.activity-feed li.tone-success::before { background: var(--success); }
.activity-feed li.tone-warning::before { background: var(--warning); }
.activity-feed li.tone-danger::before  { background: var(--danger); }
.activity-feed li.tone-accent::before  { background: var(--accent); }
.activity-feed li .meta {
  display: block;
  font-size: 11px;
  color: var(--fg-4);
  margin-top: 2px;
}
.activity-feed li a { color: var(--fg-1); font-weight: 500; }
.activity-feed li a:hover { color: var(--brand); }

/* What's-next info card */
.info-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--pad-lg);
  position: relative;
  box-shadow: var(--shadow-1);
}
[data-theme="dark"] .info-card {
  border-left: 3px solid var(--brand);
}
.info-card h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--fg-1);
}
.info-card p { font-size: 13px; color: var(--fg-2); margin: 0 0 8px 0; }
.info-card ul { padding-left: 18px; margin: 0; font-size: 13px; color: var(--fg-2); }
.info-card ul li { margin-bottom: 4px; }

/* Lifecycle legend */
.lifecycle-legend {
  margin-top: var(--gap);
  padding: var(--pad);
  background: var(--bg-3);
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--fg-3);
}
.lifecycle-legend .row {
  display: flex; align-items: center; gap: 8px; padding: 3px 0;
}
.lifecycle-legend .dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.lifecycle-legend .dot.brand { background: var(--brand); }
.lifecycle-legend .dot.warning { background: var(--warning); }
.lifecycle-legend .dot.success { background: var(--success); }
.lifecycle-legend .dot.danger { background: var(--danger); }

/* === Status pills === */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--r-xl);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill.tone-info     { background: var(--info-soft);    color: var(--info); }
.pill.tone-warning  { background: var(--warning-soft); color: var(--warning); }
.pill.tone-success  { background: var(--success-soft); color: var(--success); }
.pill.tone-danger   { background: var(--danger-soft);  color: var(--danger); }
.pill.tone-brand    { background: var(--brand-soft);   color: var(--brand); }
.pill.tone-accent   { background: var(--accent-soft);  color: var(--accent); }
.pill.tone-neutral  { background: var(--bg-3);         color: var(--fg-3); }

/* === Buttons === */
.btn, button.btn, a.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
  text-decoration: none;
  line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.btn.secondary {
  background: var(--bg-2);
  color: var(--fg-1);
  border-color: var(--line);
}
.btn.secondary:hover { background: var(--bg-3); }
.btn.ghost {
  background: transparent;
  color: var(--fg-2);
  border-color: transparent;
}
.btn.ghost:hover { background: var(--bg-3); color: var(--fg-1); }
.btn.danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }
.btn.success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn.success:hover { background: color-mix(in srgb, var(--success) 85%, #000); }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === Empty state === */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--fg-3);
}
.empty-state svg { width: 96px; height: 96px; margin-bottom: 12px; }
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--fg-1);
  margin-bottom: 6px;
}
.empty-state p { font-size: 13px; color: var(--fg-3); margin: 0 0 12px 0; }

/* === Toast (Konami + future use) === */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--fg-1);
  box-shadow: var(--shadow-2);
  pointer-events: auto;
  animation: toastIn 0.25s ease-out;
}
@keyframes toastIn {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Banner / inline alert */
.banner {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--fg-1);
  margin-bottom: var(--pad-lg);
  display: flex;
  align-items: center;
  gap: 12px;
}
.banner.tone-success { border-left-color: var(--success); }
.banner.tone-warning { border-left-color: var(--warning); }
.banner.tone-danger  { border-left-color: var(--danger); }

/* Hide v1 site-header inside v2 in case any include slips through */
.site-header.v1-only { display: none; }

/* === Page header === */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--gap);
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-header .breadcrumb {
  font-size: 12px;
  color: var(--fg-4);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.page-header .breadcrumb a { color: var(--fg-3); }
.page-header .breadcrumb a:hover { color: var(--fg-1); }
.page-header .subtitle {
  font-size: 13px;
  color: var(--fg-3);
  margin-top: 14px;
}
.page-header .actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* === Tables === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-4);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  color: var(--fg-2);
  vertical-align: middle;
  height: var(--row-h);
}
.data-table tbody tr {
  transition: background 0.12s;
}
.data-table tbody tr:hover {
  background: var(--bg-2);
}
.data-table tbody tr.is-inactive {
  opacity: 0.55;
}
.data-table .col-meta {
  font-size: 12px;
  color: var(--fg-4);
  font-family: var(--font-mono);
}
.data-table .col-email {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-2);
}

/* Role pills (specific tints — see design README) */
.role-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-xl);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.role-pill.role-admin     { background: var(--accent-soft);  color: var(--accent); }
.role-pill.role-partner   { background: var(--info-soft);    color: var(--info); }
.role-pill.role-developer { background: var(--brand-soft);   color: var(--brand); }
.role-pill.role-viewer    { background: var(--bg-3);         color: var(--fg-3); }

/* === Form controls === */
.form-grid {
  display: grid;
  gap: 12px;
}
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) {
  .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: 1fr; }
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-2);
}
.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field input[type="date"],
.field input[type="password"],
.field select,
.field textarea,
input.input-v2,
select.input-v2,
textarea.input-v2 {
  background: var(--bg);
  color: var(--fg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 13px;
  width: 100%;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
input.input-v2:focus,
select.input-v2:focus,
textarea.input-v2:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}
.field .hint { font-size: 11px; color: var(--fg-4); }

/* Disclosure (collapsible add-form) */
details.add-form {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: var(--pad-lg);
  overflow: hidden;
}
details.add-form > summary {
  cursor: pointer;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-1);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
details.add-form > summary::-webkit-details-marker { display: none; }
details.add-form > summary::before {
  content: "+";
  display: inline-flex;
  width: 18px; height: 18px;
  align-items: center; justify-content: center;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: var(--r-sm);
  font-weight: 700;
  transition: transform 0.15s;
}
details.add-form[open] > summary::before { content: "−"; }
details.add-form > .add-form-body {
  padding: 0 16px 16px 16px;
  border-top: 1px solid var(--line-2);
  margin-top: 4px;
  padding-top: 16px;
}

/* Inline form (used inside table cells, e.g. invoice-email) */
.inline-form {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
}
.inline-form input[type="email"],
.inline-form input[type="text"] {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--fg-1);
  max-width: 14rem;
}
.inline-form input[type="email"]:focus,
.inline-form input[type="text"]:focus {
  outline: none;
  border-color: var(--brand);
}
.inline-form label.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--fg-3);
}
.inline-form button.btn,
.inline-form button:not(.btn) {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--r-sm);
}

/* Status text */
.status-active   { color: var(--success); font-weight: 600; }
.status-inactive { color: var(--fg-4); }

/* === Filter bar === */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: var(--pad);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: var(--pad-lg);
}
.filter-bar > div { display: flex; flex-direction: column; gap: 4px; }
.filter-bar label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-4);
}
.filter-bar input[type="search"],
.filter-bar input[type="number"],
.filter-bar input[type="text"],
.filter-bar select {
  background: var(--bg);
  color: var(--fg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 7px 10px;
  font-size: 13px;
  font-family: var(--font-body);
  margin: 0;
  height: 38px;
  box-sizing: border-box;
}
/* Ensure TomSelect-controlled inputs in the filter bar match height */
.filter-bar .ts-wrapper { min-height: 38px; }
.filter-bar .ts-wrapper .ts-control {
  min-height: 38px !important;
  padding: 7px 10px !important;
}
.filter-bar input:focus, .filter-bar select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* Status filter pills (segmented) */
.status-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--bg-3);
  border-radius: var(--r-xl);
}
.status-pills a {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-3);
  border-radius: var(--r-xl);
  transition: background 0.15s, color 0.15s;
}
.status-pills a:hover { color: var(--fg-1); }
.status-pills a.active {
  background: var(--bg);
  color: var(--brand);
  box-shadow: var(--shadow-1);
}

/* === Lifecycle / Pipeline stepper (horizontal — dot + label inline) === */
.offer-pipeline {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px 20px;
  margin-bottom: var(--pad-lg);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow-x: auto;
  justify-content: center;
}
.offer-pipeline .pipeline-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  position: relative;
  min-width: max-content;
}
.offer-pipeline .pipeline-step + .pipeline-step::before,
.offer-pipeline .pipeline-step.has-pre-line::before {
  content: '';
  flex: 0 0 auto;
  width: 56px;
  height: 2px;
  background: var(--line);
  margin: 0 10px;
  border-radius: 1px;
}
.offer-pipeline .pipeline-step.line-done::before { background: var(--brand); }
.offer-pipeline .pipeline-step.line-cut::before {
  background: repeating-linear-gradient(90deg, var(--danger) 0 6px, transparent 6px 12px);
  height: 2px;
}
.offer-pipeline .p-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 2px solid var(--line);
  flex-shrink: 0;
  box-sizing: border-box;
}
.offer-pipeline .p-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-4);
  white-space: nowrap;
  letter-spacing: 0;
}
.offer-pipeline .p-done .p-dot {
  background: var(--brand);
  border-color: var(--brand);
}
.offer-pipeline .p-done .p-label { color: var(--fg-2); }
.offer-pipeline .p-current .p-dot {
  background: var(--bg-2);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
  animation: pulseRing 2.4s ease-in-out infinite;
}
.offer-pipeline .p-current .p-label { color: var(--brand); font-weight: 600; }
.offer-pipeline .p-faded .p-dot { opacity: 0.5; }
.offer-pipeline .p-faded .p-label { opacity: 0.7; }
.offer-pipeline .p-terminal .p-dot,
.offer-pipeline .p-failed .p-dot {
  background: var(--danger);
  border-color: var(--danger);
}
.offer-pipeline .p-terminal .p-label,
.offer-pipeline .p-failed .p-label { color: var(--danger); font-weight: 600; }
@keyframes pulseRing {
  0%, 100% { box-shadow: 0 0 0 4px var(--brand-soft); }
  50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 25%, transparent); }
}

/* === Next-action callout === */
.next-action {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin-bottom: var(--pad-lg);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.next-action strong { color: var(--fg-1); font-size: 14px; }
.next-action span { font-size: 13px; color: var(--fg-2); }
.next-action.tone-warning { border-left-color: var(--warning); }
.next-action.tone-danger  { border-left-color: var(--danger); }
.next-action.tone-success { border-left-color: var(--success); }

/* === Detail card / section === */
.detail-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: var(--pad-lg);
  overflow: hidden;
}
.detail-card > header {
  padding: 14px 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--fg-1);
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
}
.detail-card > .body { padding: 18px; }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-grid p { margin: 4px 0; font-size: 13px; }
.detail-grid p strong { color: var(--fg-1); margin-right: 4px; font-weight: 600; }

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--gap);
  font-size: 12px;
  color: var(--fg-3);
}
.pagination .page-info { font-size: 12px; }
.pagination .page-controls { display: flex; gap: 6px; }

/* === Tab-nav (segmented control for create offer) === */
.tab-nav {
  display: inline-flex;
  background: var(--bg-3);
  border-radius: var(--r-md);
  padding: 4px;
  margin-bottom: var(--pad-lg);
}
.tab-nav button {
  padding: 8px 18px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-3);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab-nav button.active {
  background: var(--bg);
  color: var(--brand);
  box-shadow: var(--shadow-1);
}

/* === Capsule grid (Game Discovery) === */
.capsule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 14px;
  padding-bottom: 5rem;
}
.game-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: var(--r-md);
  padding: 12px;
  margin: 0;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.game-card:hover {
  transform: translateY(-2px) rotate(-0.4deg);
  box-shadow: var(--shadow-2);
}
.game-card.selected {
  border-left-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--bg-2));
}
.game-card-img {
  position: relative;
  width: 100%;
  aspect-ratio: 231 / 87;
  background: linear-gradient(135deg, var(--brand-soft) 0%, var(--accent-soft) 100%);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.game-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.game-card-img.no-art::before {
  content: "🎮";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  opacity: 0.6;
}
.game-card-img .game-select-cb {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--brand);
  background: rgba(255,255,255,0.85);
  border-radius: 4px;
}
.game-card .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-1);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-card .meta {
  font-size: 11px;
  color: var(--fg-4);
  font-family: var(--font-mono);
}
.game-card .review-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.game-card .review-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  white-space: nowrap;
}
.game-card .review-score { font-size: 12px; font-weight: 600; }
.game-card .review-count { font-size: 11px; color: var(--fg-4); }
.game-card .game-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.game-card .game-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  background: var(--bg-3);
  color: var(--fg-3);
  white-space: nowrap;
}

/* Steam review pill colors (per design README) */
.review-pill.review-overwhelmingly-positive { background: rgba(47,143,88,0.12);  color: #2F8F58; }
.review-pill.review-very-positive            { background: rgba(63,160,99,0.12);  color: #3FA063; }
.review-pill.review-mostly-positive          { background: rgba(122,174,61,0.12); color: #7AAE3D; }
.review-pill.review-mixed                    { background: rgba(200,118,27,0.14); color: #C8761B; }
.review-pill.review-mostly-negative          { background: rgba(209,68,55,0.14);  color: #D14437; }
.review-pill.review-overwhelmingly-negative  { background: rgba(184,50,39,0.16);  color: #B83227; }

/* === Selection tray (fixed bottom) === */
.selection-tray {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 30px -10px rgba(0,0,0,0.25);
  padding: 12px var(--pad-lg);
  display: none;
}
.selection-tray.is-open { display: block; }
.selection-tray .inner {
  max-width: 1480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.selection-tray .count {
  font-weight: 700;
  color: var(--brand);
  font-size: 13px;
}
.selection-tray .names {
  flex: 1;
  font-size: 12px;
  color: var(--fg-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.selection-tray .template-controls {
  display: inline-block;
  white-space: nowrap;
  font-size: 0;
  height: 32px;
  line-height: 32px;
}
.selection-tray .template-controls > * {
  display: inline-block !important;
  vertical-align: middle;
  margin: 0 6px 0 0;
  font-size: 12px;
}
.selection-tray .template-controls > *:last-child { margin-right: 0; }
.selection-tray .template-controls label {
  font-size: 11px;
  color: var(--fg-3);
  line-height: 32px;
  white-space: nowrap;
}
.selection-tray .template-controls select {
  height: 32px;
  padding: 4px 28px 4px 10px;
  font-size: 12px;
  line-height: 24px;
}
.selection-tray .template-controls .btn { height: 32px; padding: 4px 14px; line-height: 24px; }

/* === Two-column form layout (offer create) === */
.create-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--pad-lg);
  align-items: flex-start;
}
@media (max-width: 1100px) { .create-grid { grid-template-columns: 1fr; } }
.create-grid .summary-card {
  position: sticky;
  top: 72px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--pad-lg);
}
.create-grid .summary-card h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--fg-1);
}
.create-grid .summary-card .summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
}
.create-grid .summary-card .summary-row:last-child { border-bottom: none; }
.create-grid .summary-card .summary-row .label { color: var(--fg-3); }
.create-grid .summary-card .summary-row .value { color: var(--fg-1); font-weight: 500; font-family: var(--font-mono); }
.create-grid .summary-card .summary-total {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}
.create-grid .summary-card .summary-total .value { color: var(--brand); }

/* Hide x-cloak'd content until alpine boots */
[x-cloak] { display: none !important; }

/* Pico tom-select polish — let Pico's theme drive it but trim some edges */
.ts-control {
  background: var(--bg) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-md) !important;
  font-family: var(--font-body) !important;
}
.ts-control input { color: var(--fg-1) !important; }
.ts-dropdown {
  background: var(--bg-2) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-md) !important;
}
.ts-dropdown .option { color: var(--fg-1) !important; padding: 8px 10px !important; }
.ts-dropdown .option.active { background: var(--brand-soft) !important; color: var(--brand) !important; }

/* Chevron rotation for accordion open state */
.accordion-row[open] .accordion-chevron {
  transform: rotate(90deg);
  color: var(--brand);
}
.accordion-chevron {
  display: inline-block;
  transition: transform 0.18s, color 0.18s;
  color: var(--fg-4);
}

/* === Section divider + title (used inside cards on create/detail) === */
.section-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-4);
  margin-bottom: 12px;
}
.divider { height: 1px; background: var(--line); margin: 22px 0; }
.divider.thin { margin: 12px 0; }
.card-pad { padding: var(--pad-lg); }

/* === Segmented option cards (offer type picker) === */
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.seg-btn {
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--fg-3);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  cursor: pointer;
  font-family: var(--font-body);
}
.seg-btn strong { font-family: var(--font-display); color: var(--fg-1); font-size: 15px; }
.seg-btn span   { font-size: 12px; color: var(--fg-4); }
.seg-btn:hover { border-color: var(--fg-5); }
.seg-btn.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.seg-btn.active strong { color: var(--brand); }
.seg-btn.active span   { color: var(--brand); }

/* === Canonical input/select/textarea (consistent heights) ===
   Tag-prefixed so TomSelect's .ts-wrapper (which inherits the source <select>'s
   classes) doesn't get double-styled — it has its own border/bg from TomSelect's
   stylesheet, and we don't want our input shell drawn around it. */
input.input, input.input-v2,
select.select, select.input, select.input-v2,
textarea.textarea, textarea.input, textarea.input-v2 {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--fg-1);
  font: inherit;
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  height: 38px;
  box-sizing: border-box;
  transition: border-color 0.12s, box-shadow 0.12s;
}
textarea.textarea, textarea.input, textarea.input-v2 { height: auto; min-height: 80px; resize: vertical; }
input.input:focus, input.input-v2:focus,
select.select:focus, select.input:focus, select.input-v2:focus,
textarea.textarea:focus, textarea.input:focus, textarea.input-v2:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}
.input-prefix { position: relative; }
.input-prefix .prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-4);
  pointer-events: none;
  font-size: 13px;
}
.input-prefix .input { padding-left: 26px; }

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-2);
  margin-bottom: 5px;
}
.field-hint {
  font-size: 11.5px;
  color: var(--fg-4);
  margin-top: 5px;
}

/* TomSelect alignment with .input height */
.ts-wrapper.single .ts-control,
.ts-wrapper:not(.form-control):not(.form-select) .ts-control {
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 12px !important;
  font-size: 13px !important;
  display: flex !important;
  align-items: center !important;
}
/* Defeat Pico's default `input { height: ... }` swelling — these inner
   inputs should sit at line-height. */
.ts-wrapper .ts-control > input,
.ts-wrapper .ts-control > .item {
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 18px !important;
  font-size: 13px !important;
  border: none !important;
}
/* Hide the native <select> after TomSelect upgrades it (otherwise it
   renders alongside the styled control on browsers/CSP combos that
   ignore TomSelect's inline display:none). */
select.tomselected,
select.ts-hidden-accessible {
  display: none !important;
}

/* Custom chevron for native <select> so the dropdown indicator
   stays visible on dark backgrounds and consistent across OSes. */
select.input,
select.input-v2,
select.select,
.filter-bar select,
.selection-tray select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239C99B2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 32px;
}

/* === Summary card — dashed-row style (matches design) === */
.summary-card-v2 {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--pad-lg);
}
.summary-card-v2 .summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--line-2);
}
.summary-card-v2 .summary-row:last-of-type { border-bottom: none; }
.summary-card-v2 .summary-row > span:first-child { color: var(--fg-4); }
.summary-card-v2 .summary-row > span:last-child  {
  color: var(--fg-1);
  font-weight: 500;
  text-align: right;
}
.summary-card-v2 .total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 0;
  font-size: 13px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.summary-card-v2 .total-row > span:first-child { color: var(--fg-3); }
.summary-card-v2 .total-amount {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--fg-1);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* What-happens-next info-card (gradient on light, brand-stripe on dark) */
.next-info-card {
  background: linear-gradient(180deg, var(--brand-soft) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--pad-lg);
}
[data-theme="dark"] .next-info-card {
  background: var(--bg-2);
  border-left: 3px solid var(--brand);
}
.next-info-card .next-info-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.next-info-card .next-info-icon {
  color: var(--brand);
  flex-shrink: 0;
  margin-top: 1px;
}
.next-info-card .next-info-title {
  font-weight: 600;
  color: var(--fg-1);
  margin-bottom: 4px;
}
.next-info-card .next-info-body {
  font-size: 13px;
  color: var(--fg-2);
  line-height: 1.55;
}

/* === Lifecycle timeline (vertical) === */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.timeline-entry {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.timeline-entry .te-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.timeline-entry.tone-info    .te-icon { background: var(--brand-soft); color: var(--brand); }
.timeline-entry.tone-success .te-icon { background: var(--success-soft); color: var(--success); }
.timeline-entry.tone-warning .te-icon { background: var(--warning-soft); color: var(--warning); }
.timeline-entry.tone-danger  .te-icon { background: var(--danger-soft); color: var(--danger); }
.timeline-entry.tone-neutral .te-icon { background: var(--bg-3); color: var(--fg-3); }
.timeline-entry .te-body { flex: 1; min-width: 0; }
.timeline-entry .te-label { font-size: 13px; color: var(--fg-1); font-weight: 500; }
.timeline-entry .te-meta  { font-size: 11.5px; color: var(--fg-4); margin-top: 1px; }
.timeline-entry .te-detail { font-size: 12px; color: var(--fg-3); margin-top: 3px; word-break: break-word; }

/* === Game card checkbox: dark bg + visible white check === */
.game-card-img .game-select-cb {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  background: rgba(20, 18, 30, 0.65);
  backdrop-filter: blur(2px);
  transition: background 0.12s, border-color 0.12s;
}
.game-card-img .game-select-cb:hover {
  background: rgba(20, 18, 30, 0.85);
  border-color: rgba(255, 255, 255, 0.8);
}
.game-card-img .game-select-cb:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.game-card-img .game-select-cb:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.game-card.selected {
  border-left-color: var(--accent);
}

/* Page-header action buttons spacing */
.page-header .actions .btn { white-space: nowrap; }

/* Htmx target row that's empty until the user clicks "Show" — collapse to
   zero height so the table doesn't look spaced out. Once content lands in
   the td (via htmx innerHTML swap), :not(:empty) restores normal styling. */
.data-table tr.attempts-row > td {
  padding: 0;
  border-bottom: 0;
  height: 0;
}
.data-table tr.attempts-row > td:not(:empty) {
  border-bottom: 1px solid var(--line-2);
}
.data-table tr.attempts-row:hover { background: transparent; }

/* Drop-zone affordance for the upload page. The dashed border + icon make
   it read as a file target immediately, with a brand-tint dragover state. */
.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px dashed var(--line);
  border-radius: var(--r-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  background: var(--bg-2);
  color: var(--fg-2);
}
.upload-dropzone:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--fg-1);
}
.upload-dropzone.dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--fg-1);
  border-style: solid;
}
.upload-dropzone .icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  transition: background 0.15s;
}
.upload-dropzone:hover .icon,
.upload-dropzone.dragover .icon { background: var(--bg); }
.upload-dropzone .primary-line {
  font-weight: 500;
  color: var(--fg-1);
  font-size: 15px;
}
.upload-dropzone .secondary-line {
  font-size: 13px;
  color: var(--fg-3);
}
.upload-dropzone .formats {
  font-size: 12px;
  color: var(--fg-4);
  font-family: var(--font-mono);
  margin-top: 4px;
}
