/* ══════════════════════════════════════════
   SPOOLVAULT — DESIGN SYSTEM
══════════════════════════════════════════ */

:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface-2:   #1c2128;
  --border:      #30363d;
  --border-dim:  #21262d;
  --teal:        #2dd4a0;
  --teal-2:      #1fa876;
  --teal-dark:   #0d6e4f;
  --teal-dim:    #1a3d30;
  --text-1:      #e6edf3;
  --text-2:      #8b949e;
  --text-3:      #484f58;
  --red:         #f85149;
  --amber:       #d29922;
  --green:       #3fb950;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 8px 32px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

/* ── TYPOGRAPHY ── */
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
h5 { font-size: 0.9rem; font-weight: 600; margin: 1rem 0 0.25rem; }
p  { color: var(--text-2); font-size: 0.9rem; }

.text-secondary { color: var(--text-2); }
.required { color: var(--red); }
.mono { font-family: 'DM Mono', monospace; }

/* ── BUTTONS ── */
button { cursor: pointer; font-family: inherit; border: none; background: none; }

.btn-primary {
  background: var(--teal);
  color: #0d1117;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0 16px;
  height: 36px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn-primary:hover { background: #38e8b2; }
.btn-primary:active { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 0.875rem;
  padding: 0 16px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}
.btn-secondary:hover { border-color: var(--text-2); }

.btn-sm { height: 28px; font-size: 0.8rem; padding: 0 12px; }

.btn-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text-1); }

.btn-full { width: 100%; }

.link-btn {
  color: var(--teal);
  text-decoration: underline;
  font: inherit;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

/* ── FORMS ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-family: inherit;
  font-size: 0.875rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); }
input::placeholder { color: var(--text-3); }
textarea { resize: vertical; min-height: 70px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 12px; }
@media (max-width: 480px) {
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
}

.form-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 18px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-dim);
}

.input-eye-wrap { position: relative; }
.input-eye-wrap input { padding-right: 40px; }
.eye-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: 14px; opacity: 0.7;
  background: none; border: none; padding: 0; cursor: pointer;
}
.eye-btn:hover { opacity: 1; }

/* ── AUTH SCREEN ── */
.auth-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.auth-bg-pattern {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 20% 10%, rgba(45,212,160,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 80% 90%, rgba(13,110,79,0.12) 0%, transparent 60%);
}

.auth-container {
  width: 100%; max-width: 400px;
  position: relative; z-index: 1;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  justify-content: center;
}
.auth-logo-full { height: 42px; width: auto; }

.auth-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: none;
}
.auth-panel.active { display: block; }

.auth-panel h2 { margin-bottom: 4px; }
.auth-subtitle { color: var(--text-2); font-size: 0.875rem; margin-bottom: 20px; }

.auth-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  align-items: center;
}
.auth-links button {
  color: var(--text-2);
  font-size: 0.8rem;
  text-decoration: underline;
  background: none; border: none; cursor: pointer;
}
.auth-links button:hover { color: var(--teal); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--text-3);
  font-size: 0.75rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  color: #1f1f1f;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid #dadce0;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn-google:hover { background: #f8f8f8; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.btn-google:active { background: #f0f0f0; }

.auth-error {
  color: var(--red);
  font-size: 0.8rem;
  min-height: 16px;
  margin-bottom: 10px;
}
.auth-success {
  color: var(--green);
  font-size: 0.8rem;
  min-height: 16px;
  margin-bottom: 10px;
}

.auth-confirm-icon { font-size: 2.5rem; text-align: center; margin-bottom: 12px; }

.privacy-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 14px;
}
.checkbox-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.8rem;
  color: var(--text-2);
  cursor: pointer;
}
.checkbox-label input { margin-top: 2px; accent-color: var(--teal); flex-shrink: 0; }

/* ── APP HEADER ── */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
}
.header-logo-full { height: 30px; width: auto; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.header-email { font-size: 0.75rem; color: var(--text-3); font-family: 'DM Mono', monospace; }

.header-menu-wrap { position: relative; }

/* ── STATS ROW ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-dim);
  border-bottom: 1px solid var(--border-dim);
}

.stat-card {
  background: var(--surface);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-family: 'DM Mono', monospace;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--teal);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .header-email { display: none; }
}

/* ── TABS ── */
.tab-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  padding: 0 16px;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab {
  padding: 12px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.tab:hover { color: var(--text-1); }

.tab-content { display: none; padding: 20px; max-width: 1200px; margin: 0 auto; }
.tab-content.active { display: block; }

/* ── INVENTORY TOOLBAR ── */
.inv-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-dim);
  /* Fix mobile overflow: never exceed viewport */
  max-width: 100%;
  box-sizing: border-box;
}

.add-fil-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 36px;
  line-height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.search-input:focus { border-color: var(--teal); }
.search-input::placeholder { color: var(--text-3); }

.filter-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
  position: relative;
}
.filter-toggle-btn:hover { border-color: var(--teal); color: var(--text-1); }
.filter-toggle-btn.active { border-color: var(--teal); color: var(--teal); background: var(--teal-dim); }

.filter-count-badge {
  background: var(--teal);
  color: #0d1117;
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

@media (max-width: 400px) {
  .inv-toolbar {
    flex-wrap: wrap;
    padding: 8px 12px;
  }
  .add-fil-btn { flex: 1; justify-content: center; }
  .filter-toggle-btn { flex-shrink: 0; }
  .search-wrap { order: 3; flex: 1 1 100%; }
}

/* ── FILTER PANEL DRAWER ── */
.filter-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 180;
}

.filter-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 92vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 181;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
  animation: panel-slide-in 0.2s cubic-bezier(0.32,0.72,0,1);
}
.filter-panel.hidden { display: none; }

@keyframes panel-slide-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.filter-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.filter-panel-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-1);
}

.filter-panel-close {
  color: var(--text-3);
  font-size: 16px;
  width: 28px; height: 28px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.filter-panel-close:hover { background: var(--surface-2); color: var(--text-1); }

.filter-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.filter-panel-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.filter-group {}

.filter-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}

.fp-select {
  width: 100%;
  height: 36px;
  font-size: 0.875rem;
}

.fp-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fp-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-2);
  cursor: pointer;
}
.fp-radio input[type="radio"] { accent-color: var(--teal); width: 15px; height: 15px; flex-shrink: 0; }
.fp-radio:hover { color: var(--text-1); }

.fp-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fp-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-2);
  cursor: pointer;
}
.fp-checkbox input[type="checkbox"] { accent-color: var(--teal); width: 15px; height: 15px; flex-shrink: 0; }
.fp-checkbox:hover { color: var(--text-1); }
.fp-checkbox.checked { color: var(--text-1); }

/* ── INVENTORY GRID ── */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.filament-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}
.filament-card:hover { border-color: var(--teal-dark); }

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border-dim);
}

.color-swatch {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.card-title { flex: 1; min-width: 0; }
.card-brand { font-size: 0.75rem; color: var(--text-2); }
.card-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-material { font-size: 0.75rem; color: var(--text-3); margin-top: 1px; }

.card-action-bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-dim);
  flex-wrap: wrap;
}

.card-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}
.card-btn:hover { border-color: var(--teal-dark); color: var(--teal); background: var(--teal-dim); }
.card-btn.danger:hover { border-color: var(--red); color: var(--red); background: rgba(248,81,73,0.08); }
.card-btn svg { flex-shrink: 0; opacity: 0.7; }
.card-btn:hover svg { opacity: 1; }

/* Settings tags on card */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 14px 10px;
}

.card-tag {
  font-size: 0.72rem;
  font-family: 'DM Mono', monospace;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border-dim);
  color: var(--text-2);
  white-space: nowrap;
}

.plate-tag {
  background: var(--teal-dim);
  border-color: var(--teal-dark);
  color: var(--teal);
}

.empty-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(248,81,73,0.15);
  color: var(--red);
  border: 1px solid rgba(248,81,73,0.3);
  vertical-align: middle;
  margin-left: 4px;
}

.card-rolls { padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }

.roll-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.roll-weight {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.roll-weight-bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.roll-weight-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 2px;
  transition: width 0.3s;
}
.roll-weight-fill.low { background: var(--amber); }
.roll-weight-fill.critical { background: var(--red); }

.roll-grams {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-1);
}

.roll-grams.low { color: var(--amber); }
.roll-grams.critical { color: var(--red); }

.roll-meta { font-size: 0.72rem; color: var(--text-3); }

.roll-actions { display: flex; gap: 4px; }
.roll-btn {
  font-size: 0.72rem;
  padding: 2px 8px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--surface-2);
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.roll-btn:hover { border-color: var(--teal); color: var(--teal); }
.roll-btn.danger:hover { border-color: var(--red); color: var(--red); }

.low-alert {
  font-size: 0.72rem;
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state p { color: var(--text-2); margin-bottom: 20px; }

/* ── HISTORY ── */
.history-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.history-filters select { width: auto; font-size: 0.8rem; height: 32px; padding: 0 28px 0 10px; }

.history-list { display: flex; flex-direction: column; gap: 6px; }

.history-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.history-dot.usage { background: var(--amber); }
.history-dot.add { background: var(--green); }

.history-main { flex: 1; min-width: 0; }
.history-title { font-size: 0.875rem; font-weight: 500; }
.history-meta { font-size: 0.75rem; color: var(--text-3); }

.history-amount {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: right;
}
.history-amount.usage { color: var(--amber); }
.history-amount.add { color: var(--green); }

.history-date { font-size: 0.72rem; color: var(--text-3); white-space: nowrap; }

/* ── COMMUNITY ── */
.community-header { margin-bottom: 16px; }
.community-header h3 { margin-bottom: 4px; }

.community-list { display: flex; flex-direction: column; gap: 8px; }

.community-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.community-swatch { width: 40px; height: 40px; border-radius: 8px; border: 2px solid rgba(255,255,255,0.07); flex-shrink: 0; }

.community-info { flex: 1; min-width: 0; }
.community-name { font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; gap: 6px; }
.community-meta { font-size: 0.75rem; color: var(--text-2); margin-top: 2px; }
.community-settings { font-size: 0.72rem; color: var(--text-3); font-family: 'DM Mono', monospace; margin-top: 4px; }
.verified-badge { background: var(--teal-dim); color: var(--teal); font-size: 0.65rem; font-weight: 600; padding: 1px 6px; border-radius: 3px; letter-spacing: 0.04em; }

.community-stat { font-size: 0.72rem; color: var(--text-3); text-align: right; white-space: nowrap; }

.community-use-btn {
  font-size: 0.75rem;
  padding: 4px 10px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid var(--teal-dark);
  color: var(--teal);
  background: var(--teal-dim);
  transition: background 0.15s;
  white-space: nowrap;
}
.community-use-btn:hover { background: rgba(45,212,160,0.2); }

.admin-edit-btn,
.admin-delete-btn {
  font-size: 0.72rem;
  padding: 2px 7px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--surface-2);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.admin-edit-btn:hover { background: var(--border); color: var(--text-1); }
.admin-delete-btn { border-color: rgba(248,81,73,0.3); color: var(--red); background: rgba(248,81,73,0.07); }
.admin-delete-btn:hover { background: rgba(248,81,73,0.18); }

/* ── KO-FI BAR ── */
.kofi-bar {
  background: var(--surface);
  border-top: 1px solid var(--border-dim);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-3);
  gap: 12px;
  flex-wrap: wrap;
}

.kofi-btn {
  background: var(--teal-dim);
  color: var(--teal);
  border: 1px solid var(--teal-dark);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.kofi-btn:hover { background: rgba(45,212,160,0.2); }

/* ── MODALS ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  animation: modal-in 0.18s ease;
}

.modal-sm { max-width: 420px; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-close {
  color: var(--text-3);
  font-size: 16px;
  width: 28px; height: 28px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: var(--surface-2); color: var(--text-1); }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* ── DROPDOWN MENU ── */
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 160px;
  z-index: 300;
}

.dropdown-menu button {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--text-1);
  transition: background 0.1s;
}
.dropdown-menu button:hover { background: var(--surface-2); }
.dropdown-menu button.danger { color: var(--red); }
.dropdown-menu button.danger:hover { background: rgba(248,81,73,0.1); }

/* ── ANNOUNCEMENTS BELL ── */
.announcements-bell-btn {
  position: relative;
}

.announcements-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  border: 1.5px solid var(--bg);
  pointer-events: none;
}

.announcements-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 300px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 300;
  display: flex;
  flex-direction: column;
}

.announcements-panel-header {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border-dim);
  flex-shrink: 0;
}

.announcements-list {
  padding: 6px 0;
}

.announcements-empty {
  font-size: 0.83rem;
  color: var(--text-3);
  padding: 12px 14px;
  text-align: center;
}

.announcement-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-dim);
}
.announcement-item:last-child { border-bottom: none; }
.announcement-pinned { background: var(--teal-dim); }

.announcement-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.announcement-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-1);
  flex: 1;
  min-width: 0;
}

.announcement-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.announcement-badge-new         { background: rgba(45,212,160,0.15); color: var(--teal); }
.announcement-badge-important   { background: rgba(248,81,73,0.12);  color: var(--red); }
.announcement-badge-maintenance { background: rgba(210,153,34,0.15); color: var(--amber); }

.announcement-date {
  font-size: 0.73rem;
  color: var(--text-3);
  display: block;
  margin-bottom: 4px;
}

.announcement-body {
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.5;
  margin-top: 4px;
}

/* ── COLOR PICKER ── */
.color-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.color-input-row input { flex: 1; }

.color-preview {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s;
}
.color-preview:hover { border-color: var(--teal); }

.color-picker-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}

.color-picker-hex-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.color-picker-hex-row input[type="color"] {
  width: 48px; height: 36px;
  padding: 2px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.color-picker-hex-row input[type="text"] { flex: 1; font-family: 'DM Mono', monospace; font-size: 0.875rem; }

.color-presets { margin-bottom: 10px; }
.presets-label { font-size: 0.7rem; color: var(--text-3); margin-bottom: 6px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }

.swatch-row { display: flex; flex-wrap: wrap; gap: 5px; }

.swatch {
  width: 22px; height: 22px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.1s, transform 0.1s;
}
.swatch:hover { border-color: rgba(255,255,255,0.4); transform: scale(1.15); }
.swatch.selected { border-color: white; }

.color-hex-display {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-2);
  text-align: center;
  margin-top: 8px;
}

/* ── WEIGHT INPUT ── */
.weight-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.weight-input-row input { flex: 1; text-align: center; font-family: 'DM Mono', monospace; }
.weight-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 1.1rem;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s;
  flex-shrink: 0;
}
.weight-btn:hover { border-color: var(--teal); color: var(--teal); }

/* ── TAGS ── */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.8rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.tag:hover { border-color: var(--teal-dark); }
.tag.active { background: var(--teal-dim); border-color: var(--teal-dark); color: var(--teal); }

/* ── BUILD PLATES ── */
.build-plate-row {
  display: grid;
  grid-template-columns: 1fr 80px 80px 28px;
  gap: 6px;
  align-items: end;
  margin-bottom: 8px;
}
.build-plate-row .form-group { margin-bottom: 0; }
.remove-plate-btn {
  width: 28px; height: 36px;
  color: var(--text-3);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.remove-plate-btn:hover { color: var(--red); background: rgba(248,81,73,0.1); }

/* ── SUGGESTION BANNER ── */
.suggestion-banner {
  background: var(--teal-dim);
  border: 1px solid var(--teal-dark);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.suggestion-banner button {
  background: var(--teal);
  color: #0d1117;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  z-index: 999;
  animation: toast-in 0.2s ease;
  white-space: nowrap;
}
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error   { border-color: var(--red);   color: var(--red);   }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── CONFIG NOTICE ── */
.config-notice {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(210,153,34,0.1);
  border: 1px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 0.85rem;
  color: var(--amber);
  z-index: 500;
  white-space: nowrap;
}
.config-notice code { font-family: 'DM Mono', monospace; }

/* ── PRIVACY TEXT ── */
.privacy-text { font-size: 0.85rem; color: var(--text-2); line-height: 1.7; }
.privacy-text h4 { color: var(--text-1); margin-bottom: 12px; }
.privacy-text strong { color: var(--text-1); }

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

/* ══════════════════════════════════════════
   DETAIL VIEW (Phase 2)
══════════════════════════════════════════ */
.detail-view {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 150;
  overflow-y: auto;
  animation: slide-up 0.22s cubic-bezier(0.32,0.72,0,1);
}

@keyframes slide-up {
  from { transform: translateY(32px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 10;
}

.detail-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--teal);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
}
.detail-back:hover { opacity: 0.8; }

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

.detail-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.detail-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-dim);
}

.detail-swatch {
  width: 64px; height: 64px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.detail-hero-info { flex: 1; }
.detail-brand  { font-size: 0.8rem; color: var(--text-2); }
.detail-name   { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.detail-sub    { font-size: 0.85rem; color: var(--text-2); margin-top: 2px; }

.detail-hero-weight { text-align: right; }
.detail-total-weight { font-family: 'DM Mono', monospace; font-size: 1.4rem; font-weight: 600; color: var(--teal); }
.detail-total-label  { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; }

.detail-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.detail-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}

.detail-kv-grid { display: flex; flex-direction: column; gap: 8px; }
.detail-kv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}
.detail-kv span { color: var(--text-2); }
.detail-kv strong { font-weight: 600; font-family: 'DM Mono', monospace; font-size: 0.85rem; }

.detail-plates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.detail-roll-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-dim);
}
.detail-roll-row:last-of-type { border-bottom: none; }
.detail-roll-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.detail-history-list { display: flex; flex-direction: column; gap: 8px; }
.detail-history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

/* Edit roll rows in modal */
.edit-roll-row { margin-bottom: 4px; }
.edit-roll-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Card updates */
.card-weight-summary {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.card-total-weight {
  font-family: 'DM Mono', monospace;
  font-size: 1rem;
  font-weight: 600;
  color: var(--teal);
}
.card-total-weight.low      { color: var(--amber); }
.card-total-weight.critical { color: var(--red); }
.card-roll-count { font-size: 0.7rem; color: var(--text-3); }
.card-cost { font-size: 0.7rem; color: var(--text-2); font-family: 'DM Mono', monospace; }
.card-weight-bar-wrap { padding: 0 14px 10px; }

/* Primary card button style */
.card-btn.primary-btn {
  background: var(--teal-dim);
  border-color: var(--teal-dark);
  color: var(--teal);
}
.card-btn.primary-btn:hover { background: rgba(45,212,160,0.25); }

/* Location tag */
.loc-tag {
  background: rgba(33,150,243,0.1);
  border-color: rgba(33,150,243,0.25);
  color: #64b5f6;
}

/* Own badge in community */
.own-badge {
  background: rgba(45,212,160,0.1);
  color: var(--teal);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--teal-dark);
  letter-spacing: 0.04em;
}

/* History cost */
.history-cost {
  font-size: 0.72rem;
  font-family: 'DM Mono', monospace;
  color: var(--text-3);
}

/* Cost input prefix */
.input-prefix-wrap { position: relative; }
.input-prefix {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--text-3);
  font-family: 'DM Mono', monospace;
  pointer-events: none;
}
.input-prefix-wrap input { padding-left: 44px; }

/* ── DROPDOWN DIVIDER ── */
.dropdown-divider {
  height: 1px;
  background: var(--border-dim);
  margin: 4px 0;
}

/* ── DANGER BUTTON ── */
.btn-danger {
  background: rgba(248,81,73,0.15);
  color: var(--red);
  border: 1px solid rgba(248,81,73,0.4);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0 16px;
  height: 36px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  font-family: inherit;
}
.btn-danger:hover { background: rgba(248,81,73,0.25); }

/* ── DELETE ACCOUNT WARNING ── */
.delete-account-warning {
  background: rgba(248,81,73,0.07);
  border: 1px solid rgba(248,81,73,0.25);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.delete-account-warning svg { color: var(--red); flex-shrink: 0; }
.delete-account-warning p { color: var(--text-2); font-size: 0.875rem; margin: 0; }
.delete-account-warning strong { color: var(--text-1); }

/* ── APP FOOTER ── */
.app-footer {
  background: var(--surface);
  border-top: 1px solid var(--border-dim);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: center;
}

.footer-link {
  font-size: 0.78rem;
  color: var(--text-3);
  text-decoration: none;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  padding: 2px 0;
  transition: color 0.15s;
}
.footer-link:hover { color: var(--teal); }

.footer-copy {
  font-size: 0.72rem;
  color: var(--text-3);
  white-space: nowrap;
}

/* ── INSIGHTS PAGE ── */
.insights-content {
  max-width: 900px;
  margin: 0 auto;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.insights-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.insights-kpi-value {
  font-family: 'DM Mono', monospace;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--teal);
  line-height: 1.1;
}
.insights-kpi-value.amber { color: var(--amber); }
.insights-kpi-value.red   { color: var(--red); }

.insights-kpi-label {
  font-size: 0.7rem;
  color: var(--text-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.insights-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
}

.insights-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  font-size: 0.85rem;
}

.bar-label {
  width: 120px;
  flex-shrink: 0;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.82rem;
}

.bar-track {
  flex: 1;
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--teal);
  transition: width 0.3s;
}

.bar-fill.amber { background: var(--amber); }
.bar-fill.red   { background: var(--red); }

.bar-value {
  width: 48px;
  text-align: right;
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-2);
  flex-shrink: 0;
}

.color-family-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.watchlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-dim);
}
.watchlist-item:last-child { border-bottom: none; }

.watchlist-swatch {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.watchlist-info { flex: 1; min-width: 0; }
.watchlist-name { font-size: 0.85rem; font-weight: 500; }
.watchlist-sub  { font-size: 0.75rem; color: var(--text-3); }

.watchlist-weight {
  font-family: 'DM Mono', monospace;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}
.watchlist-weight.low      { color: var(--amber); }
.watchlist-weight.critical { color: var(--red); }

.insights-usage-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-dim);
  font-size: 0.875rem;
}
.insights-usage-row:last-child { border-bottom: none; }
.insights-usage-row span { color: var(--text-2); }
.insights-usage-row strong {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-1);
}

.insights-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

@media (max-width: 600px) {
  .insights-two-col { grid-template-columns: 1fr; }
  .insights-grid { grid-template-columns: repeat(2, 1fr); }
  .bar-label { width: 90px; font-size: 0.78rem; }
}

/* ── INFO / ABOUT PAGES ── */
.info-page { font-size: 0.875rem; color: var(--text-2); line-height: 1.7; }
.info-page h4 { color: var(--text-1); margin-bottom: 12px; font-size: 1rem; }
.info-page h5 { color: var(--teal); font-size: 0.85rem; margin: 16px 0 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.info-page p  { margin-bottom: 10px; color: var(--text-2); font-size: 0.875rem; }
.info-page strong { color: var(--text-1); }

/* ── COMMUNITY SECTIONS ── */
.community-section { margin-bottom: 28px; }

.community-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-dim);
}

.community-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  flex-shrink: 0;
}

/* Community Library toolbar (search + filter button) */
.community-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.community-search-wrap {
  width: 180px;
}

/* Community filter inline panel */
.community-filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.cf-columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px 20px;
  margin-bottom: 4px;
}

.cf-group {
  margin-bottom: 0;
}

.cf-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border-dim);
}

@media (max-width: 500px) {
  .community-toolbar { width: 100%; }
  .community-search-wrap { flex: 1; width: auto; }
}

.community-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 0.875rem;
  line-height: 1.6;
}
.community-empty-icon {
  font-size: 1.6rem;
  margin-bottom: 8px;
}
.community-empty-sub {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-top: 4px;
}

/* Report button */
.community-report-btn {
  font-size: 0.75rem;
  padding: 4px 10px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid rgba(248,81,73,0.45);
  background: rgba(248,81,73,0.1);
  color: var(--red);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s;
}
.community-report-btn:hover:not(:disabled) { background: rgba(248,81,73,0.22); }
.community-report-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Unshare button */
.community-unshare-btn {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(248,81,73,0.35);
  background: rgba(248,81,73,0.08);
  color: var(--red);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.community-unshare-btn:hover { background: rgba(248,81,73,0.18); }

/* ── SHARE TO COMMUNITY FORM ROW ── */
.share-community-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 4px;
}

.share-community-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-1);
  font-weight: 500;
  user-select: none;
}

.share-community-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--teal);
  cursor: pointer;
  flex-shrink: 0;
}

.share-community-note {
  font-size: 0.77rem;
  color: var(--text-3);
  margin: 6px 0 0 23px;
  line-height: 1.5;
}

/* ── RELEASE NOTES MODAL ── */
.modal-lg .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

.release-notes-body {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.7;
}
.release-notes-body h2 {
  font-size: 1.15rem;
  color: var(--teal);
  margin: 0 0 2px;
  font-weight: 700;
}
.release-notes-body h3 {
  font-size: 0.95rem;
  color: var(--text-1);
  margin: 22px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-dim);
  font-weight: 600;
}
.release-notes-body h4 {
  font-size: 0.82rem;
  color: var(--teal);
  margin: 14px 0 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.release-notes-body p {
  margin: 5px 0;
  color: var(--text-2);
}
.release-notes-body ul {
  margin: 6px 0 10px 16px;
  padding: 0;
}
.release-notes-body li {
  margin-bottom: 4px;
  color: var(--text-2);
}
.release-notes-body strong { color: var(--text-1); }
.release-notes-body code {
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'DM Mono', monospace;
  font-size: 0.85em;
  color: var(--teal);
}
.release-notes-body hr {
  border: none;
  border-top: 1px solid var(--border-dim);
  margin: 20px 0;
}

/* ══════════════════════════════════════════
   LANDING PAGE
══════════════════════════════════════════ */

/* App and landing fill remaining body height */
#app, #page-landing { flex: 1; }

/* Shared bg glow visible on landing + auth pages */
.landing-bg-pattern {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 10%, rgba(45,212,160,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 80% 90%, rgba(13,110,79,0.12) 0%, transparent 60%);
}

#page-landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 20px;
  position: relative;
  min-height: 0;
}

.landing-hero {
  position: relative; z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 560px;
  gap: 16px;
}

.landing-logo-full {
  height: 56px;
  width: auto;
  display: block;
}

.landing-headline {
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.landing-sub {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-2);
  line-height: 1.65;
}

.landing-cta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
}
.landing-cta-primary {
  padding: 10px 24px;
  font-size: 0.9rem;
}
.landing-cta-secondary {
  padding: 10px 24px;
  font-size: 0.9rem;
}

.landing-features {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 900px;
  margin-top: 48px;
}

@media (max-width: 760px) {
  .landing-features { grid-template-columns: repeat(2, 1fr); }
  .landing-headline { font-size: 2rem; }
  .landing-logo-full { height: 46px; }
}
@media (max-width: 480px) {
  .landing-features { grid-template-columns: 1fr; }
  .landing-headline { font-size: 1.7rem; }
  .landing-logo-full { height: 36px; }
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-icon {
  font-size: 1.3rem;
  width: 36px; height: 36px;
  background: var(--teal-dim);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.feature-body strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
}
.feature-body p {
  font-size: 0.78rem;
  color: var(--text-2);
  line-height: 1.5;
}

/* ── BARCODE SCANNER ── */
.scan-barcode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.barcode-modal-body {
  padding: 16px 20px;
}

.barcode-scan-hint {
  font-size: 0.83rem;
  color: var(--text-2);
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.4;
}

/* html5-qrcode injects a video element into this div */
#barcode-reader {
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
  min-height: 200px;
}
#barcode-reader video {
  border-radius: var(--radius-sm);
}
/* Hide the default camera-select icon the library adds */
#barcode-reader img { display: none !important; }
#barcode-reader select {
  margin-top: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  padding: 4px 8px;
  font-size: 0.8rem;
  width: 100%;
}

.barcode-scan-status {
  font-size: 0.78rem;
  color: var(--text-2);
  text-align: center;
  margin-top: 10px;
  min-height: 1.1em;
}

/* Result card */
.barcode-result-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.barcode-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-dim);
}
.barcode-result-row:last-child { border-bottom: none; }

.barcode-result-label {
  font-size: 0.8rem;
  color: var(--text-2);
  flex-shrink: 0;
}

.barcode-result-value {
  font-size: 0.875rem;
  color: var(--text-1);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

/* No-match */
.barcode-nomatch-msg {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 12px;
}

.barcode-code-display {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  word-break: break-all;
}

/* ── BARCODE SECTION (Add Filament modal) ── */
.form-label-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-3);
  margin-left: 4px;
}

.barcode-section {
  margin-bottom: 4px;
}

.barcode-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.barcode-input-row input {
  flex: 1;
  min-width: 0;
}

.scan-inline-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  font-size: 0.8rem;
  padding: 0 12px;
  height: 36px;
}

.barcode-inline-status {
  font-size: 0.8rem;
  color: var(--text-2);
  margin-top: 6px;
  line-height: 1.4;
}

.barcode-inline-match {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}

.barcode-inline-match-header {
  padding: 10px 14px 0;
}

.barcode-inline-match-title {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--teal);
}

.barcode-inline-match-desc {
  font-size: 0.78rem;
  color: var(--text-2);
  margin: 6px 14px 0;
  line-height: 1.45;
}

.barcode-inline-match-rows {
  margin-top: 8px;
}

.barcode-inline-match-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-dim);
}

/* Source banner — shown after applying a cache match */
.barcode-source-banner {
  background: var(--teal-dim);
  border: 1px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.45;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.barcode-correction-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.4;
}
.barcode-correction-label input[type="checkbox"] {
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--teal);
}
