﻿    /* FWC & CocaCola - platinum/diamond gradient when duplicate */
    html:not(.light-mode) .sticker.special.have.dup[data-code^="FWC"],
    html:not(.light-mode) .sticker.special.have.dup[data-code^="COCA"],
    html:not(.light-mode) .sticker.special.have.dup[data-code^="CC"] {
      background: linear-gradient(135deg, #e0e0e0 40%, #b2bec3 100%, #fff 120%);
      border-color: #b2bec3;
      color: #222;
      box-shadow: 0 0 0 2px #636e72;
    }
:root {
      --bg-gradient: linear-gradient(135deg, #0b1220 0%, #111f38 55%, #12304e 100%);
      --header-bg: #101b2e;
      --header-text: #e8f0ff;
      --text-primary: #e8f0ff;
      --text-secondary: #9fb2cc;
      --accent-primary: #6ea8ff;
      --accent-secondary: #4ecdc4;
      --border-color: #2a3c56;
      --card-bg: #14243a;
      --card-bg-alt: #1b2f49;
      --success-color: #27ae60;
      --warning-color: #f39c12;
      --danger-color: #e74c3c;
      --info-color: #2ecc71;
      --btn-bg: #1b2e4a;
      --btn-bg-hover: #243a5c;
    }

    html.light-mode {
      --bg-gradient: linear-gradient(135deg, #1a2980 0%, #26d0ce 100%);
      --header-bg: #ffffff;
      --header-text: #1a1a1a;
      --text-primary: #1a1a1a;
      --text-secondary: #666;
      --accent-primary: #1a2980;
      --accent-secondary: #26d0ce;
      --border-color: #ddd;
      --card-bg: #f8f9fa;
      --card-bg-alt: #e9ecef;
      --btn-bg: #f0f4ff;
      --btn-bg-hover: #e8ecff;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
    }

    html,
    body {
      overscroll-behavior-y: contain;
    }

    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      background: var(--bg-gradient);
      min-height: 100vh;
      color: var(--text-primary);
      padding: 8px;
      padding-bottom: 80px;
      transition: background-color 0.3s ease, color 0.3s ease;
    }

    .container {
      max-width: 1400px;
      margin: 0 auto;
    }

    header {
      background: var(--header-bg);
      border-radius: 16px;
      padding: 14px;
      margin-bottom: 12px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
      transition: background-color 0.3s ease;
    }

    .header-top {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 8px;
      margin-bottom: 8px;
    }

    .header-buttons {
      display: flex;
      gap: 8px;
    }

    h1 {
      font-size: 1.3rem;
      background: linear-gradient(90deg, #1a2980, #26d0ce);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      line-height: 1.2;
    }

    .subtitle {
      font-size: 0.75rem;
      color: var(--text-secondary);
      margin-bottom: 12px;
    }

    .collapse-btn {
      background: var(--btn-bg);
      border: none;
      border-radius: 8px;
      padding: 6px 10px;
      cursor: pointer;
      font-size: 0.8rem;
      color: var(--accent-primary);
      font-weight: 600;
      flex-shrink: 0;
      transition: all 0.2s ease;
    }

    .collapse-btn:hover {
      background: var(--btn-bg-hover);
    }

    html:not(.light-mode) header,
    html:not(.light-mode) .quick-input-wrapper,
    html:not(.light-mode) .filters,
    html:not(.light-mode) .team-card,
    html:not(.light-mode) .legend,
    html:not(.light-mode) .bottom-bar,
    html:not(.light-mode) .modal-content,
    html:not(.light-mode) .sheet-content,
    html:not(.light-mode) .group-picker-dropdown,
    html:not(.light-mode) .ms-dropdown {
      background: var(--card-bg);
      color: var(--text-primary);
      border-color: var(--border-color);
    }

    html:not(.light-mode) .owner-row,
    html:not(.light-mode) .stat-card,
    html:not(.light-mode) details,
    html:not(.light-mode) .swap-mode-toggle,
    html:not(.light-mode) .sheet-btn,
    html:not(.light-mode) .team-progress,
    html:not(.light-mode) .ms-actions button {
      background: var(--card-bg-alt);
      color: var(--text-primary);
      border-color: var(--border-color);
    }

    html:not(.light-mode) .owner-row label,
    html:not(.light-mode) .stat-value,
    html:not(.light-mode) .team-name,
    html:not(.light-mode) .sheet-title,
    html:not(.light-mode) .modal-section h3,
    html:not(.light-mode) .swap-meta,
    html:not(.light-mode) .group-pick-btn,
    html:not(.light-mode) .btn-primary {
      color: var(--accent-primary);
    }

    html:not(.light-mode) .owner-row input,
    html:not(.light-mode) .quick-input,
    html:not(.light-mode) .search-box,
    html:not(.light-mode) .filter-select,
    html:not(.light-mode) .ms-button,
    html:not(.light-mode) .team-action-btn,
    html:not(.light-mode) .modal textarea,
    html:not(.light-mode) .chip {
      background: #0f1a2c;
      color: var(--text-primary);
      border-color: var(--border-color);
    }


    html:not(.light-mode) .sticker {
      background: #16243a;
      border-color: #2a3c56;
      color: var(--text-primary);
      /* fallback for non-state stickers */
    }

    html:not(.light-mode) .sticker.have {
      background: linear-gradient(135deg, #219150 60%, #27ae60 100%);
      border-color: #27ae60;
      color: #e8f0ff;
      box-shadow: 0 0 0 2px #1b2f49;
    }

    html:not(.light-mode) .sticker.dup {
      background: linear-gradient(135deg, #b97a10 60%, #f1c40f 100%);
      border-color: #f1c40f;
      color: #fffbe6;
      box-shadow: 0 0 0 2px #1b2f49;
    }

    html:not(.light-mode) .sticker.special {
      background: linear-gradient(135deg, #5e3370 60%, #8e44ad 100%);
      border-style: dashed;
      border-color: #a678d1;
      color: #f5eaff;
    }

    /* FWC & CocaCola - gold/diamond gradient when have */
    html:not(.light-mode) .sticker.special.have[data-code^="FWC"],
    html:not(.light-mode) .sticker.special.have[data-code^="COCA"],
    html:not(.light-mode) .sticker.special.have[data-code^="CC"] {
      background: linear-gradient(135deg, #ffe259 40%, #ffa751 100%, #fffbe6 120%);
      border-color: #ffe259;
      color: #473a1c;
      box-shadow: 0 0 0 2px #bfae60;
    }

    /* Default special.have fallback for other special stickers */
    html:not(.light-mode) .sticker.special.have {
      border-color: #d6b3ff;
      background: linear-gradient(135deg, #7d3c98 60%, #a678d1 100%);
      color: #fff;
    }

    html:not(.light-mode) .sticker .badge {
      background: #e74c3c;
      color: #fff;
      box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    }

    html:not(.light-mode) .team-header,
    html:not(.light-mode) .modal-header,
    html:not(.light-mode) .help-footer,
    html:not(.light-mode) .ms-actions {
      border-color: var(--border-color);
    }

    html:not(.light-mode) .subtitle,
    html:not(.light-mode) .last-updated,
    html:not(.light-mode) .quick-hint,
    html:not(.light-mode) .filter-label,
    html:not(.light-mode) .team-progress,
    html:not(.light-mode) .help-section,
    html:not(.light-mode) .help-checkbox,
    html:not(.light-mode) .ms-option-badge,
    html:not(.light-mode) .bb-btn,
    html:not(.light-mode) .swap-mode-btn,
    html:not(.light-mode) .swap-result.empty {
      color: var(--text-secondary);
    }

    .collapsible {
      transition: max-height 0.3s ease, opacity 0.2s;
      overflow: hidden;
    }

    .collapsible.collapsed {
      max-height: 0 !important;
      opacity: 0;
      margin: 0;
      padding: 0;
    }

    .owner-row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 12px;
      padding: 8px 10px;
      background: linear-gradient(135deg, #f0f4ff, #e8f5e9);
      border-radius: 10px;
      border-left: 4px solid #1a2980;
      flex-wrap: wrap;
    }

    .owner-row label {
      font-size: 0.85rem;
      font-weight: 600;
      color: #1a2980;
      white-space: nowrap;
    }

    .owner-row input {
      flex: 1;
      min-width: 140px;
      padding: 6px 10px;
      border: 1px solid #ddd;
      border-radius: 6px;
      font-size: 0.9rem;
      background: white;
    }

    .owner-row input:focus {
      outline: none;
      border-color: #1a2980;
    }

    .last-updated {
      font-size: 0.7rem;
      color: #666;
      font-family: monospace;
      width: 100%;
    }

    .stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
      gap: 8px;
      margin-bottom: 10px;
    }

    .stat-card {
      background: linear-gradient(135deg, #f8f9fa, #e9ecef);
      padding: 10px 8px;
      border-radius: 10px;
      text-align: center;
      border-left: 3px solid #1a2980;
    }

    .stat-card.repetidas {
      border-left-color: #f39c12;
    }

    .stat-card.faltan {
      border-left-color: #e74c3c;
    }

    .stat-card.completas {
      border-left-color: #27ae60;
    }

    .stat-value {
      font-size: 1.3rem;
      font-weight: 700;
      color: #1a2980;
      line-height: 1;
    }

    .stat-label {
      font-size: 0.7rem;
      color: #666;
      text-transform: uppercase;
      margin-top: 2px;
    }

    .progress-bar {
      height: 8px;
      background: #e9ecef;
      border-radius: 4px;
      overflow: hidden;
      margin-top: 4px;
    }

    .progress-fill {
      height: 100%;
      background: linear-gradient(90deg, #27ae60, #2ecc71);
      transition: width 0.3s;
    }

    .quick-input-wrapper {
      background: white;
      border-radius: 12px;
      padding: 10px;
      margin-bottom: 10px;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    }

    .quick-input {
      width: 100%;
      padding: 12px 14px;
      background: #fff8dc;
      border: 2px solid #f39c12;
      border-radius: 10px;
      font-size: 1rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .quick-input:focus {
      outline: none;
      border-color: #d68910;
      background: #fff3cd;
    }

    .quick-hint {
      font-size: 0.7rem;
      color: #666;
      margin-top: 4px;
      text-align: center;
    }

    .filters {
      background: white;
      border-radius: 12px;
      padding: 10px;
      margin-bottom: 10px;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    }

    .search-box {
      width: 100%;
      padding: 8px 10px;
      border: 1px solid #ddd;
      border-radius: 8px;
      font-size: 0.9rem;
      margin-bottom: 8px;
    }

    .chips-row {
      display: flex;
      gap: 6px;
      overflow-x: auto;
      padding-bottom: 4px;
      scrollbar-width: none;
      margin-bottom: 8px;
    }

    .chips-row::-webkit-scrollbar {
      display: none;
    }

    .chip {
      padding: 6px 12px;
      border: 1px solid #ddd;
      border-radius: 16px;
      background: white;
      font-size: 0.8rem;
      font-weight: 600;
      cursor: pointer;
      white-space: nowrap;
      flex-shrink: 0;
      transition: all 0.15s;
    }

    .chip.active {
      background: #1a2980;
      color: white;
      border-color: #1a2980;
    }

    .chip.have.active {
      background: #27ae60;
      border-color: #27ae60;
    }

    .chip.dup.active {
      background: #f39c12;
      border-color: #f39c12;
    }

    .chip.miss.active {
      background: #e74c3c;
      border-color: #e74c3c;
    }

    .filter-row {
      display: flex;
      gap: 8px;
      margin-bottom: 8px;
      position: relative;
      z-index: 2;
    }

    .filter-control {
      flex: 1;
      min-width: 0;
    }

    .filter-label {
      font-size: 0.7rem;
      font-weight: 600;
      color: #666;
      text-transform: uppercase;
      display: block;
      margin-bottom: 3px;
      letter-spacing: 0.05em;
    }

    .filter-select {
      width: 100%;
      padding: 8px 10px;
      border: 1px solid #ddd;
      border-radius: 8px;
      font-size: 0.85rem;
      background: white;
      cursor: pointer;
      appearance: auto;
      -webkit-appearance: menulist;
    }

    .filter-select:focus {
      outline: none;
      border-color: #1a2980;
    }

    .group-picker {
      position: relative;
    }

    .group-picker-btn {
      display: flex;
      justify-content: space-between;
      align-items: center;
      text-align: left;
    }

    .group-picker-dropdown {
      display: none;
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      margin-top: 4px;
      background: white;
      border: 1px solid #ddd;
      border-radius: 8px;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
      z-index: 100;
      padding: 8px;
      min-width: 220px;
    }

    .group-picker-dropdown.open {
      display: block;
    }

    .group-picker-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 4px;
    }

    .group-pick-btn {
      padding: 8px 4px;
      border: 1px solid #ddd;
      border-radius: 6px;
      background: white;
      cursor: pointer;
      font-size: 0.8rem;
      font-weight: 700;
      color: #1a2980;
      transition: all 0.15s;
    }

    .group-pick-btn:hover {
      background: #1a2980;
      color: white;
      border-color: #1a2980;
    }

    .group-pick-btn.active {
      background: #1a2980;
      color: white;
      border-color: #1a2980;
    }

    .group-pick-btn.group-pick-all {
      grid-column: 1 / -1;
      background: #f0f4ff;
      border-color: #1a2980;
      color: #1a2980;
    }

    .group-pick-btn.group-pick-all:hover,
    .group-pick-btn.group-pick-all.active {
      background: #1a2980;
      color: white;
    }

    .group-pick-progress {
      display: block;
      font-size: 0.65rem;
      font-weight: 600;
      margin-top: 2px;
      opacity: 0.85;
    }

    .multi-select {
      position: relative;
    }

    .ms-button {
      width: 100%;
      padding: 8px 12px;
      border: 1px solid #ddd;
      border-radius: 8px;
      font-size: 0.85rem;
      background: white;
      cursor: pointer;
      display: flex;
      gap: 8px;
      align-items: center;
      justify-content: space-between;
    }

    .ms-dropdown {
      display: none;
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      margin-top: 4px;
      background: white;
      border: 1px solid #ddd;
      border-radius: 8px;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
      z-index: 100;
      max-height: 50vh;
      overflow: hidden;
      flex-direction: column;
    }

    .ms-dropdown.open {
      display: flex;
    }

    .ms-actions {
      display: flex;
      gap: 6px;
      padding: 8px;
      border-bottom: 1px solid #eee;
    }

    .ms-actions button {
      flex: 1;
      padding: 6px;
      border: 1px solid #ddd;
      border-radius: 6px;
      background: #f8f9fa;
      cursor: pointer;
      font-size: 0.75rem;
      font-weight: 600;
    }

    .ms-options {
      overflow-y: auto;
      padding: 4px;
      flex: 1;
    }

    .ms-option {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px;
      cursor: pointer;
      border-radius: 4px;
      font-size: 0.85rem;
    }

    .ms-option input {
      width: 18px;
      height: 18px;
      flex: none;
    }

    .ms-option-label {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex: 1;
    }

    .team-flag {
      width: 18px;
      height: 13px;
      object-fit: cover;
      border-radius: 2px;
      flex: none;
      box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
    }

    .team-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      flex: none;
    }

    .ms-option-badge {
      font-size: 0.7rem;
      color: #666;
      background: #f0f0f0;
      padding: 2px 6px;
      border-radius: 10px;
    }

    .teams-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
      gap: 10px;
    }

    .team-card {
      background: white;
      border-radius: 12px;
      padding: 12px;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    }

    .team-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
      padding-bottom: 6px;
      border-bottom: 2px solid #f0f0f0;
      gap: 6px;
    }

    .team-header-left {
      display: flex;
      align-items: center;
      gap: 6px;
      flex: 1;
      min-width: 0;
    }

    .team-name {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.95rem;
      font-weight: 700;
      color: #1a2980;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .team-name span:last-child,
    .ms-option-label span:last-child {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .team-progress {
      font-size: 0.7rem;
      color: #666;
      background: #f8f9fa;
      padding: 2px 6px;
      border-radius: 10px;
      flex-shrink: 0;
    }

    .team-progress.complete {
      background: #d4edda;
      color: #155724;
    }

    .team-progress-row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 8px;
    }

    .team-progress-track {
      flex: 1;
      height: 6px;
      border-radius: 999px;
      background: #e2e8f0;
      overflow: hidden;
    }

    .team-progress-fill {
      height: 100%;
      border-radius: 999px;
      background: linear-gradient(90deg, #27ae60, #2ecc71);
      transition: width 0.25s ease;
    }

    .team-progress-percent {
      font-size: 0.72rem;
      font-weight: 700;
      min-width: 34px;
      text-align: right;
      color: #4a5568;
    }

    html:not(.light-mode) .team-progress-track {
      background: #24344c;
    }

    html:not(.light-mode) .team-progress-percent {
      color: var(--text-secondary);
    }

    .team-actions {
      display: flex;
      gap: 4px;
      flex-shrink: 0;
    }

    .team-action-btn {
      padding: 5px 8px;
      border: 1px solid #ddd;
      border-radius: 5px;
      background: white;
      cursor: pointer;
      font-size: 0.85rem;
      font-weight: 600;
    }

    .team-action-btn.have-all {
      color: #229954;
      border-color: #c3e6cb;
    }

    .team-action-btn.miss-all {
      color: #c0392b;
      border-color: #f5c6cb;
    }

    .team-action-btn:active {
      transform: scale(0.92);
    }

    .stickers-grid {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 4px;
    }

    .sticker {
      aspect-ratio: 1;
      border: 2px solid #ddd;
      border-radius: 6px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      background: white;
      transition: transform 0.1s;
      position: relative;
      user-select: none;
      -webkit-user-select: none;
      touch-action: manipulation;
    }

    .sticker:active {
      transform: scale(0.92);
    }

    .sticker.have {
      background: linear-gradient(135deg, #27ae60, #2ecc71);
      color: white;
      border-color: #229954;
    }

    .sticker.dup {
      background: linear-gradient(135deg, #f39c12, #f1c40f);
      color: white;
      border-color: #d68910;
    }

    .sticker .num {
      font-size: 0.75rem;
      line-height: 1.1;
      font-weight: 700;
      letter-spacing: -0.02em;
    }

    .sticker .badge {
      position: absolute;
      top: -4px;
      right: -4px;
      background: #e74c3c;
      color: white;
      border-radius: 50%;
      width: 18px;
      height: 18px;
      font-size: 0.65rem;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: bold;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .sticker.special {
      border-style: dashed;
      border-color: #9b59b6;
    }

    .sticker.special.have {
      border-color: #8e44ad;
    }

    .bottom-bar {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      background: white;
      border-top: 1px solid #e0e0e0;
      box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
      display: flex;
      justify-content: space-around;
      padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
      z-index: 50;
    }

    .bb-btn {
      flex: 1;
      background: none;
      border: none;
      padding: 8px 4px;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      color: #666;
      font-size: 0.65rem;
      font-weight: 600;
      border-radius: 8px;
      min-width: 0;
    }

    .bb-btn:active {
      background: #f0f4ff;
    }

    .bb-btn .icon {
      font-size: 1.4rem;
      line-height: 1;
    }

    .bb-btn .label {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
    }

    .bb-btn.primary {
      color: #1a2980;
    }

    .bb-btn.success {
      color: #27ae60;
    }

    .modal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.7);
      z-index: 1000;
      align-items: center;
      justify-content: center;
      padding: 8px;
    }

    .modal.active {
      display: flex;
    }

    .modal-content {
      background: white;
      border-radius: 12px;
      padding: 16px;
      max-width: 600px;
      width: 100%;
      max-height: 95vh;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }

    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 12px;
      position: sticky;
      top: 0;
      background: white;
      z-index: 1;
      padding-bottom: 8px;
      border-bottom: 1px solid #eee;
    }

    .modal-header h2 {
      font-size: 1.1rem;
    }

    .modal-close {
      background: #e74c3c;
      color: white;
      border: none;
      border-radius: 50%;
      width: 36px;
      height: 36px;
      cursor: pointer;
      font-size: 1.3rem;
      flex-shrink: 0;
    }

    .modal textarea {
      width: 100%;
      min-height: 100px;
      padding: 10px;
      border: 1px solid #ddd;
      border-radius: 8px;
      font-family: monospace;
      font-size: 0.85rem;
      resize: vertical;
    }

    .modal-section {
      margin-bottom: 12px;
    }

    .modal-section h3 {
      font-size: 0.95rem;
      margin-bottom: 6px;
      color: #1a2980;
    }

    .sheet {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.5);
      z-index: 999;
      align-items: flex-end;
      justify-content: center;
    }

    .sheet.active {
      display: flex;
    }

    .sheet-content {
      background: white;
      border-radius: 16px 16px 0 0;
      width: 100%;
      max-width: 500px;
      max-height: 80vh;
      overflow-y: auto;
      padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
      animation: slideUp 0.25s ease;
    }

    @keyframes slideUp {
      from {
        transform: translateY(100%);
      }

      to {
        transform: translateY(0);
      }
    }

    .sheet-handle {
      width: 40px;
      height: 4px;
      background: #ddd;
      border-radius: 2px;
      margin: 0 auto 12px;
    }

    .sheet-title {
      font-size: 1rem;
      font-weight: 700;
      margin-bottom: 12px;
      color: #1a2980;
      padding: 0 4px;
    }

    .sheet-btn {
      display: flex;
      align-items: center;
      gap: 12px;
      width: 100%;
      padding: 14px;
      border: none;
      border-radius: 10px;
      background: #f8f9fa;
      text-align: left;
      cursor: pointer;
      font-size: 0.9rem;
      font-weight: 600;
      margin-bottom: 6px;
      color: #333;
    }

    .sheet-btn:active {
      background: #e9ecef;
    }

    .sheet-btn .icon {
      font-size: 1.3rem;
      flex-shrink: 0;
    }

    .sheet-btn.primary {
      background: #e8f0ff;
      color: #1a2980;
    }

    .sheet-btn.success {
      background: #d4edda;
      color: #155724;
    }

    .sheet-btn.warning {
      background: #fff3cd;
      color: #856404;
    }

    .sheet-btn.danger {
      background: #f8d7da;
      color: #721c24;
    }

    .legend {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      font-size: 0.75rem;
      margin-bottom: 8px;
      background: white;
      padding: 8px 12px;
      border-radius: 10px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .legend-item {
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .legend-box {
      width: 14px;
      height: 14px;
      border: 2px solid #ddd;
      border-radius: 3px;
      flex-shrink: 0;
    }

    .legend-box.have {
      background: #27ae60;
      border-color: #229954;
    }

    .legend-box.dup {
      background: #f39c12;
      border-color: #d68910;
    }

    .toast {
      position: fixed;
      top: 20px;
      left: 50%;
      transform: translate(-50%, -150%);
      background: #1a2980;
      color: white;
      padding: 10px 18px;
      border-radius: 24px;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
      z-index: 2000;
      transition: transform 0.3s;
      font-size: 0.85rem;
      max-width: 90vw;
    }

    .toast.show {
      transform: translate(-50%, 0);
    }

    .toast.success {
      background: #27ae60;
    }

    .toast.error {
      background: #e74c3c;
    }

    .btn {
      padding: 10px 14px;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      font-size: 0.85rem;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .btn:active {
      transform: scale(0.95);
    }

    .btn-primary {
      background: #1a2980;
      color: white;
    }

    .btn-success {
      background: #27ae60;
      color: white;
    }

    .btn-warning {
      background: #f39c12;
      color: white;
    }

    .btn-danger {
      background: #e74c3c;
      color: white;
    }

    .btn-secondary {
      background: #6c757d;
      color: white;
    }

    details {
      background: #f8f9fa;
      border-radius: 8px;
      padding: 8px 12px;
      margin-bottom: 8px;
    }

    summary {
      cursor: pointer;
      font-weight: 600;
      font-size: 0.85rem;
    }

    .help-section {
      padding: 8px 0 4px;
      font-size: 0.85rem;
      line-height: 1.5;
      color: #333;
    }

    .help-section p {
      margin-bottom: 6px;
    }

    .help-section ul {
      padding-left: 22px;
      margin: 4px 0;
    }

    .help-section li {
      margin-bottom: 4px;
    }

    .help-section code {
      background: #fff3cd;
      padding: 1px 6px;
      border-radius: 4px;
      font-family: monospace;
      font-size: 0.85em;
      color: #856404;
    }

    .help-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      margin-top: 16px;
      padding-top: 12px;
      border-top: 1px solid #eee;
      flex-wrap: wrap;
    }

    .help-checkbox {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.85rem;
      color: #666;
      cursor: pointer;
      user-select: none;
    }

    .help-checkbox input {
      width: 18px;
      height: 18px;
      cursor: pointer;
    }

    .swap-result {
      margin-top: 12px;
      padding: 10px;
      border-radius: 8px;
      font-size: 0.85rem;
    }

    .swap-result.empty {
      background: #f8f9fa;
      color: #666;
    }

    .swap-result.useful {
      background: #d4edda;
      color: #155724;
    }

    .swap-mode-toggle {
      display: flex;
      gap: 4px;
      background: #f0f0f0;
      border-radius: 8px;
      padding: 4px;
      margin-bottom: 8px;
    }

    .swap-mode-btn {
      flex: 1;
      padding: 8px 6px;
      border: none;
      background: transparent;
      border-radius: 6px;
      cursor: pointer;
      font-size: 0.8rem;
      font-weight: 600;
      color: #666;
      transition: all 0.15s;
    }

    .swap-mode-btn.active {
      background: white;
      color: #1a2980;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .swap-meta {
      background: #e8f0ff;
      border-left: 3px solid #1a2980;
      padding: 8px 10px;
      border-radius: 6px;
      font-size: 0.8rem;
      margin: 8px 0;
      color: #1a2980;
    }

    .swap-meta strong {
      color: #0f1a5c;
    }

    .app-footer {
      margin: 16px 0 74px;
      padding: 12px 14px;
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.88);
      border: 1px solid rgba(26, 41, 128, 0.12);
      font-size: 0.78rem;
      line-height: 1.45;
      color: #475569;
      text-align: center;
      box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    }

    .app-footer a {
      color: #1a2980;
      text-decoration: none;
      font-weight: 700;
    }

    .app-footer a:hover {
      text-decoration: underline;
    }

    html:not(.light-mode) .modal-header,
    html:not(.light-mode) .modal-header h2,
    html:not(.light-mode) .modal-section h3,
    html:not(.light-mode) .help-section,
    html:not(.light-mode) .help-section p,
    html:not(.light-mode) .help-section li,
    html:not(.light-mode) .help-section strong,
    html:not(.light-mode) .help-footer,
    html:not(.light-mode) .help-checkbox,
    html:not(.light-mode) summary,
    html:not(.light-mode) [data-style="legend-help-summary"],
    html:not(.light-mode) [data-style="legend-help-content"],
    html:not(.light-mode) [data-style="ocr-hint"],
    html:not(.light-mode) [data-style="swap-title-good"],
    html:not(.light-mode) [data-style="swap-title-warn"],
    html:not(.light-mode) [data-style="swap-code-list"] {
      color: var(--text-primary);
    }

    html:not(.light-mode) .modal-header {
      background: var(--card-bg);
    }

    html:not(.light-mode) details {
      background: #1f324d;
      border: 1px solid var(--border-color);
    }

    html:not(.light-mode) .help-section code {
      background: #28466f;
      color: #d8e8ff;
      border: 1px solid rgba(110, 168, 255, 0.28);
    }

    html:not(.light-mode) .swap-result.empty {
      background: #1f324d;
      border: 1px solid var(--border-color);
    }

    html:not(.light-mode) .swap-result.useful {
      background: rgba(39, 174, 96, 0.18);
      color: #d9fbe7;
      border: 1px solid rgba(39, 174, 96, 0.42);
    }

    html:not(.light-mode) .swap-meta {
      background: rgba(110, 168, 255, 0.15);
      color: #cfe1ff;
      border-left-color: #7eb1ff;
    }

    html:not(.light-mode) .swap-meta strong {
      color: #eff6ff;
    }

    html:not(.light-mode) .sheet-btn.primary,
    html:not(.light-mode) .bb-btn.primary {
      color: #9bc2ff;
    }

    html:not(.light-mode) .app-footer {
      background: rgba(16, 27, 46, 0.92);
      border-color: var(--border-color);
      color: var(--text-secondary);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
    }

    html:not(.light-mode) .app-footer a {
      color: #b9d2ff;
    }

    @media (max-width: 600px) {
      body {
        padding: 6px;
        padding-bottom: 80px;
      }

      h1 {
        font-size: 1.1rem;
      }

      .subtitle {
        font-size: 0.7rem;
      }

      header {
        padding: 12px;
      }

      .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
      }

      .stat-card {
        padding: 6px 4px;
      }

      .stat-value {
        font-size: 1rem;
      }

      .stat-label {
        font-size: 0.6rem;
      }

      .stat-card:nth-child(5) {
        grid-column: span 4;
      }

      .teams-grid {
        grid-template-columns: 1fr;
        gap: 8px;
      }

      .team-card {
        padding: 10px;
      }

      .team-name {
        font-size: 0.9rem;
      }

      .stickers-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 3px;
      }

      .modal-content {
        padding: 12px;
        max-height: 92vh;
      }
    }

    @media (max-width: 380px) {
      .stickers-grid {
        grid-template-columns: repeat(4, 1fr);
      }

      .stats-grid {
        grid-template-columns: repeat(2, 1fr);
      }

      .stat-card:nth-child(5) {
        grid-column: span 2;
      }

      .quick-input {
        font-size: 0.95rem;
        padding: 10px 12px;
      }
    }

/* Inline-style replacements moved to stylesheet */
[data-style="header-body-expanded"] { max-height: 155px; }
[data-style="progress-initial"] { width: 5.7%; }
[data-style="badge-complete"] { background: rgb(212, 237, 218); color: rgb(21, 87, 36); }
[data-style="badge-empty"] { background: rgb(240, 240, 240); color: rgb(102, 102, 102); }
[data-style="legend-help-details"] { margin: 0; padding: 0; background: transparent; flex: 1; min-width: 0; }
[data-style="legend-help-summary"] { font-size: 0.75rem; text-align: right; }
[data-style="legend-help-content"] { padding: 8px 0; font-size: 0.75rem; line-height: 1.5; }
[data-style="hidden"] { display: none; }
[data-style="mt-6"] { margin-top: 6px; }
[data-style="mt-8"] { margin-top: 8px; }
[data-style="mt-12"] { margin-top: 12px; }
[data-style="btn-full-mt6"] { width: 100%; margin-top: 6px; }
[data-style="ocr-hint"] { font-size: 0.7rem; color: #666; margin-bottom: 6px; }
[data-style="no-results"] { color: white; text-align: center; padding: 20px; }
[data-style="swap-title-good"] { color: #155724; }
[data-style="swap-title-warn"] { color: #856404; }
[data-style="swap-code-list"] { margin: 6px 0; font-family: monospace; font-size: 0.8rem; }
