/* ============================================
   SCRINE — Card Management System
   Deep navy + white, editorial luxury
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=DM+Mono:wght@400;500&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&display=swap');

:root {
  --bg: #050830;
  --surface: #111550;
  --surface-2: #191E62;
  --surface-3: #20266E;
  --border: rgba(255, 255, 255, 0.18);
  --border-hover: rgba(255, 255, 255, 0.32);
  --text: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.82);
  --text-tertiary: rgba(255, 255, 255, 0.52);
  --accent: #8B7FFF;
  --accent-soft: #B5ADFF;
  --accent-dim: rgba(139, 127, 255, 0.12);
  --green: #3DD89A;
  --green-dim: rgba(61, 216, 154, 0.12);
  --orange: #E5A344;
  --orange-dim: rgba(229, 163, 68, 0.12);
  --red: #E55252;
  --red-dim: rgba(229, 82, 82, 0.12);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Plus Jakarta Sans', system-ui, sans-serif;
  --mono: 'DM Mono', monospace;
  --radius: 8px;
  --radius-lg: 12px;
  --touch: 48px;
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

input, select, button, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

/* --- App Shell --- */
#app {
  max-width: 540px;
  margin: 0 auto;
  padding: 0 20px calc(var(--nav-h) + 32px) 20px;
  min-height: 100dvh;
}

body.shooter-mode #app { padding-bottom: 32px; }
body.shooter-mode .nav { display: none; }

.view { display: none; padding-top: 24px; }
.view.active { display: block; }

/* --- Brand Header --- */
.brand-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 32px;
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  height: 22px;
  width: auto;
  color: var(--text);
  flex-shrink: 0;
}

.brand-section {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 300;
  font-style: italic;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* --- Shooter Header --- */
.shooter-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.shooter-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid rgba(139, 127, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--accent-soft);
  flex-shrink: 0;
}

.shooter-info h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}

.shooter-info p {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(5, 8, 48, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-inner {
  display: flex;
  max-width: 540px;
  width: 100%;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: var(--touch);
  cursor: pointer;
  color: var(--text-tertiary);
  transition: color 0.2s;
  position: relative;
  -webkit-user-select: none;
  user-select: none;
}

.nav-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.5;
}

.nav-btn span {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-btn.active {
  color: var(--text);
}

.nav-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-btn.admin-locked {
  opacity: 0.25;
}

.nav-btn.admin-active {
  color: var(--green);
}

/* --- Auth Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 48, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 32px;
  width: 100%;
  max-width: 360px;
}

.modal-brand {
  text-align: center;
  margin-bottom: 4px;
}

.modal-brand svg {
  height: 28px;
  color: var(--text);
}

.modal-sub {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 300;
  font-style: italic;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 10px;
}

.auth-error {
  color: var(--red);
  font-size: 13px;
  text-align: center;
  margin-top: 14px;
}

/* --- Counters --- */
.counters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.counter {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.counter::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.counter--ready::before { background: var(--green); }
.counter--shooting::before { background: var(--orange); }
.counter--to_backup::before { background: var(--accent); }

.counter-value {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 8px;
}

.counter--ready .counter-value { color: var(--green); }
.counter--shooting .counter-value { color: var(--orange); }
.counter--to_backup .counter-value { color: var(--accent); }

.counter-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

/* --- Badges --- */
.badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge--ready { color: var(--green); background: var(--green-dim); border: 1px solid rgba(61, 216, 154, 0.2); }
.badge--shooting { color: var(--orange); background: var(--orange-dim); border: 1px solid rgba(229, 163, 68, 0.2); }
.badge--to_backup { color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(139, 127, 255, 0.2); }
.badge--backed_up { color: var(--green); background: var(--green-dim); border: 1px solid rgba(61, 216, 154, 0.2); }

/* --- Card Items --- */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  transition: border-color 0.2s;
}

.card-item:active {
  border-color: var(--border-hover);
}

.card-item-id {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  min-width: 56px;
}

.card-item-meta { flex: 1; min-width: 0; }

.card-item-shoot {
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-item-details {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.card-item-details .shooter-tag {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 13px;
  color: var(--accent-soft);
}

.card-item-time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-tertiary);
}

.card-item .badge { flex-shrink: 0; }

/* --- Shooter Pill (visible initials badge) --- */
.shooter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 32px;
  padding: 0 10px;
  border-radius: 16px;
  background: var(--accent-dim);
  border: 1px solid rgba(139, 127, 255, 0.3);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-soft);
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

.shooter-pill .sp-name { display: none; }
.shooter-pill .sp-initials { display: inline; }

/* --- Card Chips (selectable) --- */
.card-chips { display: flex; flex-wrap: wrap; gap: 10px; }

.card-chip {
  min-width: 72px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-user-select: none;
  user-select: none;
}

.card-chip.selected {
  border-color: rgba(61, 216, 154, 0.5);
  color: var(--green);
  background: var(--green-dim);
}

.card-chip:active { transform: scale(0.96); }

/* --- Triage --- */
.triage-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
}

.triage-item + .triage-item { margin-top: 6px; }

.triage-actions { display: flex; gap: 6px; flex-shrink: 0; }

.triage-btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  background: transparent;
}

.triage-btn.active-backup {
  border-color: rgba(229, 163, 68, 0.5);
  color: #fff;
  background: rgba(229, 163, 68, 0.25);
}

.triage-btn.active-release {
  border-color: rgba(61, 216, 154, 0.5);
  color: #fff;
  background: rgba(61, 216, 154, 0.25);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch);
  padding: 0 24px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  -webkit-user-select: none;
  user-select: none;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

.btn--primary { background: var(--accent); color: #fff; }
.btn--success { background: var(--green); color: var(--bg); }
.btn--danger { background: var(--red); color: #fff; }

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

.btn--ghost:active { border-color: var(--border-hover); }

.btn--take {
  width: 100%;
  min-height: 58px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-lg);
}

.btn--finish {
  width: 100%;
  min-height: 58px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
}

.btn--sm {
  min-height: 38px;
  padding: 0 16px;
  font-size: 12px;
  border-radius: 20px;
}

.btn--backup-confirm {
  background: var(--accent-dim);
  color: var(--accent-soft);
  border: 1px solid rgba(139, 127, 255, 0.25);
  border-radius: 20px;
}

.btn--full { width: 100%; }

.btn-delete {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid transparent;
}

.btn-delete svg { width: 14px; height: 14px; }

.btn-add {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
}

.btn-add svg { width: 16px; height: 16px; }

.btn-add:hover {
  color: var(--green);
  border-color: rgba(61, 216, 154, 0.3);
  background: var(--green-dim);
}

.btn-add:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-delete:hover {
  color: var(--red);
  border-color: rgba(229, 82, 82, 0.3);
  background: var(--red-dim);
}

.btn--copy {
  background: transparent;
  color: var(--text-tertiary);
  border: 1px solid var(--border);
  min-height: 34px;
  padding: 0 14px;
  font-size: 11px;
  border-radius: 20px;
}

/* --- Forms --- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field + .field { margin-top: 16px; }

.field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.field-input {
  min-height: 52px;
  padding: 0 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
  transition: border-color 0.2s;
}

.field-input:focus {
  border-color: rgba(139, 127, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(139, 127, 255, 0.1);
}

.field-input::placeholder { color: var(--text-tertiary); }
.field-input--mono { font-family: var(--mono); font-size: 13px; }

select.field-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='rgba(255,255,255,0.5)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 44px;
}

/* --- Radio Group --- */
.radio-group { display: flex; flex-wrap: wrap; gap: 8px; }

.radio-btn {
  min-width: var(--touch);
  min-height: var(--touch);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-user-select: none;
  user-select: none;
}

.radio-btn.selected {
  border-color: rgba(139, 127, 255, 0.4);
  color: var(--accent-soft);
  background: var(--accent-dim);
}

.radio-btn:active { transform: scale(0.96); }

/* --- Sections --- */
.section { margin-bottom: 32px; }

.section-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}

/* --- Backup Panel --- */
.backup-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 12px;
}

.backup-panel .field-input--mono { font-size: 12px; }

/* --- Settings Items --- */
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.settings-item + .settings-item { margin-top: 4px; }
.settings-item-label { font-size: 15px; font-weight: 400; }

.settings-item-sub {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-tertiary);
}

/* --- Shooter Link Items --- */
.shooter-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.shooter-link-item + .shooter-link-item { margin-top: 4px; }

.shooter-link-url {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-tertiary);
  word-break: break-all;
  margin-top: 4px;
}

/* --- Form Row --- */
.form-row { display: flex; gap: 8px; align-items: flex-end; }
.form-row .field { flex: 1; }
.form-row .btn { flex-shrink: 0; }

/* --- Group Header --- */
.group-header {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
  font-style: italic;
  color: var(--accent-soft);
  padding: 24px 0 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.group-header::before {
  content: '';
  width: 3px;
  height: 16px;
  background: var(--accent);
  border-radius: 2px;
  opacity: 0.6;
}

/* --- Event Bar --- */
.event-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.event-bar-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.event-bar-name {
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- History Items --- */
.digi-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 4px;
}

.digi-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.digi-item-path {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-tertiary);
  word-break: break-all;
  line-height: 1.6;
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  max-width: 420px;
  width: calc(100% - 40px);
  padding: 16px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

body.shooter-mode .toast { bottom: 20px; }

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast--success {
  background: var(--surface-2);
  color: var(--green);
  border: 1px solid rgba(61, 216, 154, 0.25);
}

.toast--error {
  background: var(--surface-2);
  color: var(--red);
  border: 1px solid rgba(229, 82, 82, 0.25);
}

/* --- Loading --- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  color: var(--text-secondary);
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
}

.loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  margin-left: 14px;
  animation: spin 0.8s linear infinite;
}

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

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-tertiary);
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
}

.no-event-warning {
  background: var(--orange-dim);
  border: 1px solid rgba(229, 163, 68, 0.2);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--orange);
  font-size: 14px;
}

/* --- Finish Group (admin triage) --- */
.finish-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 8px;
}

.finish-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.finish-triage {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* --- Event Picker (radio-style) --- */
.event-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.event-option {
  min-height: 44px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-user-select: none;
  user-select: none;
}

.event-option:active { transform: scale(0.97); }

.event-option.selected {
  border-color: rgba(61, 216, 154, 0.5);
  color: #fff;
  background: rgba(61, 216, 154, 0.18);
}

.event-option--custom {
  flex: 1;
  min-width: 180px;
  padding: 0;
  cursor: text;
}

.event-custom-input {
  width: 100%;
  height: 100%;
  min-height: 44px;
  padding: 0 18px;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.event-custom-input::placeholder { color: var(--text-tertiary); }

/* --- Verification --- */
.badge--verified {
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid rgba(61, 216, 154, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.verify-summary {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--green);
}

.verify-panel { margin-top: 4px; }

.verify-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.verify-result-label {
  font-family: var(--mono);
  font-size: 12px;
}

.verify-ok { color: var(--green); }

.verify-match-result {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  margin-top: 12px;
}

.verify-match-ok {
  background: var(--green-dim);
  border: 1px solid rgba(61, 216, 154, 0.25);
  color: var(--green);
}

.verify-match-fail {
  background: var(--red-dim);
  border: 1px solid rgba(229, 82, 82, 0.25);
  color: var(--red);
}

.verify-diff {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.verify-diff strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 12px;
}

.verify-diff ul {
  list-style: none;
  padding: 0;
}

.verify-diff li {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 2px 0;
}

.verify-comparison { margin-top: 8px; }

/* --- History event groups --- */
.history-event-group {
  margin-bottom: 20px;
}
.history-event-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.history-event-name {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--text);
  font-weight: 600;
}
.history-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* --- File list display --- */
.files-list {
  margin-top: 8px;
  padding: 8px 0;
}
.files-source-title {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 0 2px;
  margin-top: 6px;
}
.files-source-title:first-child { margin-top: 0; }
.files-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.files-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.files-row:last-child { border-bottom: none; }
.files-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.files-size {
  color: var(--text-secondary);
  white-space: nowrap;
}
.files-date {
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* --- XS button variant --- */
.btn--xs {
  font-size: 11px;
  padding: 3px 8px;
  min-height: auto;
}

/* --- Mismatch badge --- */
.badge--mismatch {
  background: rgba(229, 82, 82, 0.15);
  color: var(--red);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* --- Share backup view --- */
.share-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.share-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.share-title {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 10px;
}
.share-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.share-details {
  margin-bottom: 16px;
}
.share-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.share-detail-row:last-child { border-bottom: none; }
.share-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  min-width: 60px;
}
.share-path {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}
.share-verification {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.share-files-section {
  margin-top: 12px;
}
.share-event-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.share-event-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  transition: border-color 0.15s, background 0.15s;
}
.share-event-link:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}
.share-event-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-tertiary);
  background: rgba(255,255,255,0.06);
  padding: 1px 6px;
  border-radius: 8px;
}

/* --- Assign Panel --- */
.assign-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

/* --- Utility --- */
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.hidden { display: none !important; }

/* --- Desktop enhancements --- */
@media (min-width: 768px) {
  #app {
    max-width: 640px;
    padding: 0 32px calc(var(--nav-h) + 40px) 32px;
  }

  .nav-inner { max-width: 640px; }

  .brand-header { padding: 32px 0 32px; margin-bottom: 36px; }
  .brand-logo { height: 28px; }
  .brand-section { font-size: 24px; }

  .counters { gap: 16px; margin-bottom: 32px; }
  .counter { padding: 28px 20px; }
  .counter-value { font-size: 52px; margin-bottom: 10px; }
  .counter-label { font-size: 13px; }

  .card-item { padding: 18px 22px; min-height: 62px; }
  .card-item-id { font-size: 17px; min-width: 64px; }
  .card-item-details { font-size: 14px; }
  .card-item-details .shooter-tag { font-size: 14px; }

  .section-title { font-size: 20px; margin-bottom: 16px; }

  .badge { font-size: 12px; padding: 6px 14px; }

  .field-input { min-height: 54px; font-size: 16px; }

  .shooter-header { padding: 28px; }
  .shooter-avatar { width: 64px; height: 64px; font-size: 20px; }
  .shooter-info h2 { font-size: 30px; }
  .shooter-info p { font-size: 14px; }

  .card-chip { min-width: 80px; min-height: 56px; font-size: 16px; }

  .settings-item { min-height: 58px; padding: 14px 22px; }
  .settings-item-label { font-size: 16px; }

  .shooter-link-item { padding: 16px 22px; }

  .shooter-pill .sp-name { display: inline; }
  .shooter-pill .sp-initials { display: none; }
  .shooter-pill { font-family: var(--sans); font-size: 13px; font-weight: 500; }

  .modal { padding: 48px 36px; max-width: 400px; }
  .modal-brand svg { height: 34px; }
  .modal-sub { font-size: 18px; }
}
