/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #232636;
  --border: #2e3248;
  --accent: #6c63ff;
  --accent-hover: #7d75ff;
  --accent2: #00c9a7;
  --text: #e8eaf0;
  --text-muted: #8b8fa8;
  --danger: #ff4d6d;
  --warning: #ffb347;
  --success: #00c9a7;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  header { padding: 12px 16px; gap: 12px; }
}

.mobile-step-label {
  display: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: #00c9a7;
  background: rgba(0, 201, 167, 0.15);
  border: 1px solid #00c9a7;
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .mobile-step-label { display: block; }
  .steps { display: none !important; }
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--accent);
}

.steps {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.step {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.step.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.step.done {
  color: var(--accent2);
  border-color: var(--accent2);
}

/* ── Main ── */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 32px 16px;
}

@media (max-width: 600px) {
  main { padding: 12px 8px; }
}

/* ── Screens ── */
.screen { display: none; width: 100%; max-width: 900px; }
.screen.active { display: flex; flex-direction: column; align-items: center; }

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow);
}

.card.wide { max-width: 800px; }
.card.center { text-align: center; padding: 64px 32px; }

@media (max-width: 600px) {
  .card { padding: 20px 16px; border-radius: var(--radius-sm); }
  .card.center { padding: 40px 16px; }
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* ── Drop Zone ── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(108,99,255,0.07);
}

.drop-icon { font-size: 3rem; margin-bottom: 12px; }

.or {
  color: var(--text-muted);
  margin: 12px 0;
  font-size: 0.85rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 4px 10px;
  font-size: 0.8rem;
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

.actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  flex-wrap: wrap;
}

.cropper-wrap img,
.preview-wrap img {
  image-orientation: none;
}

.cropper-view-box {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px;
}

.cropper-line,
.cropper-point {
  opacity: 0.6;
}

.cropper-point {
  width: 14px !important;
  height: 14px !important;
  border-radius: 50% !important;
}

@media (max-width: 600px) {
  .cropper-wrap {
    max-height: 55vh;
    touch-action: none;
  }

  .cropper-wrap img {
    max-height: 55vh;
  }

  .cropper-container {
    touch-action: none;
  }

  .cropper-view-box {
    outline-width: 3px !important;
  }

  .cropper-point {
    width: 18px !important;
    height: 18px !important;
  }

  .cropper-modal {
    background: rgba(0, 0, 0, 0.5);
  }
}
.cropper-wrap {
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
  max-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cropper-wrap img {
  max-width: 100%;
  max-height: 60vh;
  display: block;
}

/* ── Preview ── */
.preview-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 70vh;
}

.preview-wrap img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: block;
}

/* ── Spinner ── */
.spinner {
  width: 56px;
  height: 56px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}

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

/* ── Analysis Status Banner ── */
.analysis-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 20px;
}

.analysis-status.hidden { display: none; }

.analysis-status.processing {
  background: rgba(108,99,255,0.1);
  border: 1px solid rgba(108,99,255,0.3);
  color: var(--accent);
}

.analysis-status.done {
  background: rgba(0,201,167,0.1);
  border: 1px solid rgba(0,201,167,0.3);
  color: var(--success);
}

.analysis-status.error {
  background: rgba(255,77,109,0.1);
  border: 1px solid rgba(255,77,109,0.3);
  color: var(--danger);
}

.analysis-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(108,99,255,0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* ── Forms ── */
.form-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 16px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
}

.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.indent { padding-left: 28px; margin-top: 14px; }

.field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.field-row span:first-child { min-width: 120px; color: var(--text-muted); }

.field-row input[type="number"],
.field-row input[type="text"],
.field-row input[type="date"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 6px 10px;
  font-size: 0.9rem;
  width: 100px;
  transition: border-color 0.15s;
}

.field-row input:focus { outline: none; border-color: var(--accent); }

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

.hint { font-size: 0.75rem; color: var(--text-muted); }

input[type="text"], input[type="number"], input[type="date"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.9rem;
  transition: border-color 0.15s;
}

/* Prevent iOS zoom on input focus — 16px minimum keeps browser from zooming */
@media (max-width: 600px) {
  input[type="text"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus { outline: none; border-color: var(--accent); }

/* ── Participants ── */
.participant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 36px;
}

.participant-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.85rem;
}

.participant-chip button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.participant-chip button:hover { color: var(--danger); }

.add-participant {
  display: flex;
  gap: 8px;
}

.add-participant input { flex: 1; }

/* ── Receipt Meta ── */
.receipt-meta {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
}

.receipt-meta .field-row { margin-bottom: 8px; }
.receipt-meta .field-row:last-child { margin-bottom: 0; }
.receipt-meta input[type="text"] { flex: 1; width: auto; }
.receipt-meta input[type="date"] { width: auto; }

/* ── Items Cards (mobile-first) ── */
.items-cards-wrap {
  margin-bottom: 16px;
}

.items-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.item-card-name {
  flex: 1;
}

.item-card-name input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 6px 10px;
  font-size: 0.95rem;
  font-weight: 500;
}

.item-card-name input:focus {
  outline: none;
  border-color: var(--accent);
}

.item-card-total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent2);
  white-space: nowrap;
}

.item-card-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.item-card-remove:hover {
  color: var(--danger);
}

.item-card-fields {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.item-card-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 80px;
}

.item-card-field label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.item-card-field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 10px;
  font-size: 0.9rem;
  text-align: right;
}

.item-card-field input:focus {
  outline: none;
  border-color: var(--accent);
}

.item-card-field input[type="text"] {
  text-align: left;
}

@media (min-width: 640px) {
  .item-card {
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
  }

  .item-card-header {
    flex: 1;
    gap: 16px;
  }

  .item-card-fields {
    flex: 0 0 auto;
    flex-wrap: nowrap;
  }

  .item-card-field {
    min-width: 100px;
  }
}

/* ── Items Table (desktop fallback) ── */
.items-table-wrap {
  margin-bottom: 16px;
  display: none;
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.items-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.items-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.items-table tr:last-child td {
  border-bottom: none;
}

.items-table input[type="text"] {
  width: 100%;
  min-width: 120px;
  padding: 4px 8px;
  font-size: 0.85rem;
}

.items-table input[type="number"] {
  width: 110px;
  padding: 4px 8px;
  font-size: 0.85rem;
  text-align: right;
}

.items-table .qty-input {
  width: 56px;
  text-align: center;
}

.items-table .computed {
  color: var(--accent2);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.totals-section {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 8px;
}

.totals-section .field-row { margin-bottom: 8px; }
.totals-section .field-row:last-child { margin-bottom: 0; }

.review-summary {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.review-summary-row span:last-child { font-weight: 600; color: var(--text); }
.review-summary-row.discount span:last-child { color: var(--success); }
.review-summary-row.tip span:last-child { color: var(--warning); }
.review-summary-row.grand {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
  font-size: 1rem;
  color: var(--text);
  font-weight: 700;
}
.review-summary-row.grand span:last-child { color: var(--accent); font-size: 1.2rem; }

/* ── Assign Layout ── */
#screen-assign {
  max-width: 1200px;
}

.assign-layout {
  display: flex;
  gap: 20px;
  width: 100%;
  align-items: flex-start;
}

.assign-main {
  flex: 3;
  min-width: 0;
}

.assign-sidebar {
  flex: 2;
  min-width: 260px;
  max-width: 360px;
  position: sticky;
  top: 72px;
}

#screen-assign.locked-mode .assign-sidebar {
  display: none;
}

@media (max-width: 768px) {
  .assign-layout {
    flex-direction: column;
  }
  .assign-sidebar {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}

/* ── Assign Screen ── */
.participant-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tab-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.tab-btn {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.15s;
}

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tab-btn.tab-other {
  opacity: 0.35;
  cursor: default;
}

.btn-share {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0;
}

.btn-share:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 600px) {
  .btn-share { font-size: 0.7rem; width: 24px; height: 24px; }
}

.saved-confirmation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 24px;
  text-align: center;
}

.saved-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0,201,167,0.15);
  border: 2px solid var(--success);
  color: var(--success);
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.saved-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.saved-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 300px;
}

.assign-hint { margin-bottom: 16px; }

.assign-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  max-height: 50vh;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .assign-items { max-height: none; overflow-y: visible; }
}

.assign-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.assign-item:hover:not(.locked) { border-color: var(--accent); }

.assign-item.selected {
  border-color: var(--accent);
  background: rgba(108,99,255,0.12);
}

.assign-item.locked {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: transparent;
}

.assign-item .check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: all 0.15s;
}

.assign-item.selected .check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.assign-item .item-info { flex: 1; }
.assign-item .item-name { font-weight: 500; font-size: 0.9rem; }
.assign-item .item-price { color: var(--text-muted); font-size: 0.8rem; }

.assign-item .split-info {
  font-size: 0.78rem;
  color: var(--accent2);
  background: rgba(0,201,167,0.1);
  border-radius: 12px;
  padding: 2px 8px;
  white-space: nowrap;
}

.split-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
}

.split-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.btn-deselect {
  padding: 4px 10px;
  font-size: 0.78rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Multi-qty stepper card */
.assign-item.qty-multi {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  cursor: default;
}

.assign-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.assign-item-cost {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent2);
  white-space: nowrap;
}

.assign-item-bottom {
  display: flex;
  align-items: center;
  gap: 16px;
}

.assign-remaining {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Stepper control */
.stepper {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.stepper-btn {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}

.stepper-btn:hover:not(:disabled) { background: var(--surface2); }
.stepper-btn:disabled { color: var(--border); cursor: not-allowed; }

.stepper-value {
  min-width: 40px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  line-height: 36px;
}

.assign-person-total {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.assign-person-total .total-cols {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.assign-person-total .total-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.assign-person-total .total-col .label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.assign-person-total .total-col .value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.assign-person-total .total-col.grand .value {
  color: var(--accent);
  font-size: 1.1rem;
}

.assign-person-total .total-col.tip .value { color: var(--warning); }
.assign-person-total .total-col.discount .value { color: var(--success); }

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

#assignProgress {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ── Summary ── */
.summary-totals {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.total-tile {
  text-align: center;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.total-tile .label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.total-tile .amount { font-size: 1.3rem; font-weight: 700; }
.total-tile.grand .amount { color: var(--accent); font-size: 1.6rem; }
.total-tile.tip .amount { color: var(--warning); }
.total-tile.discount .amount { color: var(--success); }

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.summary-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.summary-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 12px;
}

.summary-card .item-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.summary-card .item-line:last-of-type { border-bottom: none; }

.summary-card .item-line .name { color: var(--text-muted); }
.summary-card .item-line.split .name::after { content: ' · compartido'; font-size: 0.75em; color: var(--accent2); }
.qty-label {
  display: inline-block;
  background: rgba(108,99,255,0.15);
  color: var(--accent);
  font-size: 0.72em;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: 5px;
  vertical-align: middle;
}

.summary-divider { border: none; border-top: 1px solid var(--border); margin: 10px 0; }

.summary-grand-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 8px;
}

.summary-card .subtotals { font-size: 0.82rem; color: var(--text-muted); }
.summary-card .subtotals div { display: flex; justify-content: space-between; padding: 2px 0; }
.summary-card .subtotals .total-row { color: var(--text); font-weight: 700; font-size: 1rem; margin-top: 6px; }

/* ── Assign Overall Summary ── */
.assign-overall-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.assign-overall-summary:empty { display: none; }

.overall-label {
  padding: 10px 16px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.overall-cards {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-summary-card {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
  padding: 16px;
}

.sidebar-summary-card:last-child { border-bottom: none; }
.sidebar-summary-card:hover { background: rgba(108,99,255,0.06); }

.sidebar-summary-card.sidebar-active {
  background: rgba(108,99,255,0.1);
  box-shadow: inset 3px 0 0 var(--accent);
}

.picks-empty {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
  padding: 2px 0 6px;
}

/* ── Utils ── */
.hidden { display: none !important; }

.error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(255,77,109,0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,77,109,0.3);
  white-space: pre-line;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
