/* SWADE Character Creator - Savage Master Parchment Theme */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  --bg-dark: #1a1510;
  --bg-panel: #231e16;
  --bg-card: #2a2318;
  --bg-input: #332b20;
  --border: #5a4d3a;
  --accent: #c6a84b;
  --accent-dim: #8b7633;
  --accent-glow: rgba(198, 168, 75, 0.2);
  --danger: #c94040;
  --success: #4ecca3;
  --info: #6ec6ff;
  --text: #d4cbb5;
  --text-dim: #998e7a;
  --text-bright: #f0e8d8;
  --sidebar-width: 220px;
  --summary-width: 300px;
  --font-heading: 'Cinzel', 'Georgia', serif;
  --font-body: 'Crimson Text', 'Georgia', serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Layout */
.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #2a2318 0%, #1a1510 100%);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 20px rgba(0,0,0,0.4);
  max-height: 100vh;
  overflow-y: auto;
}

.sidebar h1 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--accent);
  text-align: center;
  padding: 0 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}

.sidebar h1 span {
  display: block;
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-top: 2px;
  text-transform: uppercase;
}

.sidebar-logo {
  text-align: center;
  padding: 1.2rem 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
}
.logo-wrap {
  display: inline-block;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  border: 5px solid var(--accent-dim);
  outline: 2px solid rgba(198, 168, 75, 0.15);
  outline-offset: 3px;
  box-shadow: 0 4px 20px rgba(198, 168, 75, 0.35), 0 0 40px rgba(0,0,0,0.5), inset 0 0 15px rgba(0,0,0,0.5);
  transition: box-shadow 0.3s, transform 0.3s;
  background: #2a2318;
}
.logo-wrap:hover {
  box-shadow: 0 6px 28px rgba(198, 168, 75, 0.5), 0 0 50px rgba(0,0,0,0.6), inset 0 0 15px rgba(0,0,0,0.5);
  transform: scale(1.03);
}
.logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 48%;
  transform: scale(3.2);
  display: block;
}

.sidebar-credit {
  margin-top: 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(90, 77, 58, 0.3);
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  line-height: 1.5;
}
.sidebar-credit .credit-name {
  font-family: var(--font-heading);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
}

.steps {
  list-style: none;
  margin-top: 1rem;
}

.steps li {
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-dim);
  border-left: 3px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
}

.steps li:hover {
  background: rgba(198, 168, 75, 0.06);
  color: var(--text);
}

.steps li.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-glow);
  font-weight: 600;
}

.steps li.completed {
  color: var(--success);
}

.steps li .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 0.7rem;
  flex-shrink: 0;
  font-family: var(--font-heading);
}

.steps li.active .step-num {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg-dark);
}

.steps li.completed .step-num {
  border-color: var(--success);
  background: var(--success);
  color: var(--bg-dark);
}

/* Main Content */
.content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  max-height: 100vh;
  background: url('bg-parchment.jpg') center/cover fixed;
  background-color: var(--bg-dark);
  position: relative;
}
.content::before {
  content: '';
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: var(--summary-width);
  bottom: 0;
  background: rgba(26, 21, 16, 0.82);
  pointer-events: none;
  z-index: 0;
}
.step-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.step-content h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
}

.step-content .step-desc {
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Setting Tip Box */
.tip-box {
  background: linear-gradient(135deg, rgba(62, 48, 28, 0.6) 0%, rgba(45, 36, 22, 0.6) 100%);
  border: 1px solid var(--accent-dim);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  margin-bottom: 1.2rem;
  position: relative;
}
.tip-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}
.tip-icon {
  font-size: 1.1rem;
  line-height: 1;
}
.tip-label {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tip-text {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0;
}

/* Point Tracker */
.point-tracker {
  background: linear-gradient(135deg, rgba(42, 35, 24, 0.95) 0%, rgba(35, 30, 22, 0.95) 100%);
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  box-shadow: inset 0 1px 0 rgba(198, 168, 75, 0.1), 0 2px 10px rgba(0,0,0,0.3);
}

.point-tracker .pt-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.point-tracker .pt-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-heading);
}

.point-tracker .pt-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-heading);
}

.point-tracker .pt-value.over-budget {
  color: var(--danger);
}

.point-tracker .pt-value.zero {
  color: var(--success);
}

/* Cards */
.card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(42, 35, 24, 0.9) 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.75rem;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.card:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}

.card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow), 0 4px 16px rgba(0,0,0,0.35);
}

.card.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.card-title {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-bright);
  font-size: 0.95rem;
}

.card-badge {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent-dim);
  color: var(--bg-dark);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-badge.minor { background: var(--info); }
.card-badge.major { background: var(--danger); }

.card-desc {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.card-reqs {
  font-size: 0.78rem;
  color: var(--accent-dim);
  margin-top: 0.3rem;
  font-style: italic;
}

.card-reqs.unmet {
  color: var(--danger);
}

/* Inputs */
input[type="text"],
textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  width: 100%;
  font-family: var(--font-body);
  transition: border-color 0.2s;
}

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

textarea {
  resize: vertical;
  min-height: 80px;
}

label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group {
  margin-bottom: 1.2rem;
}

/* Die Selector */
.die-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.die-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.die-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

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

.die-value {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 48px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}

.die-value.base {
  color: var(--text-dim);
}

.die-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  vertical-align: middle;
}

.die-icon svg {
  width: 100%;
  height: 100%;
}

/* Smaller dice in summary panel */
.s-value .die-icon {
  width: 22px;
  height: 22px;
}

.summary-row .s-value .die-icon {
  width: 22px;
  height: 22px;
}

/* Attribute/Skill Row */
.trait-row {
  display: flex;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(90, 77, 58, 0.3);
  gap: 1rem;
}

.trait-row:last-child {
  border-bottom: none;
}

.trait-name {
  flex: 1;
  font-weight: 500;
}

.trait-name small {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.82rem;
}

.trait-name .core-badge {
  font-family: var(--font-heading);
  font-size: 0.55rem;
  color: var(--success);
  border: 1px solid var(--success);
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.trait-cost {
  font-size: 0.78rem;
  color: var(--text-dim);
  min-width: 60px;
  text-align: right;
}

/* Buttons */
.btn {
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  font-size: 0.88rem;
  font-family: var(--font-body);
  transition: all 0.2s;
}

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

.btn-primary {
  font-family: var(--font-heading);
  background: linear-gradient(135deg, #c6a84b 0%, #a8892e 100%);
  color: var(--bg-dark);
  border-color: var(--accent);
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(255,255,255,0.15);
  box-shadow: 0 2px 8px rgba(198, 168, 75, 0.25);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.8rem;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #d4b654 0%, #c6a84b 100%);
  color: var(--bg-dark);
  box-shadow: 0 4px 16px rgba(198, 168, 75, 0.35);
  transform: translateY(-1px);
}

.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  position: relative;
}
.nav-buttons::before {
  content: '\2726';
  position: absolute;
  top: -0.4rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--accent-dim);
  font-size: 0.6rem;
  background: var(--bg-dark);
  padding: 0 0.5rem;
  opacity: 0.5;
}

/* Filters */
.filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.35rem 0.8rem;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.82rem;
  font-family: var(--font-body);
  transition: all 0.15s;
}

.filter-btn:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}

.filter-btn.active {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent);
}

/* Search */
.search-box {
  position: relative;
  margin-bottom: 1rem;
}

.search-box input {
  padding-left: 2rem;
}

.search-box::before {
  content: '\1F50D';
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.5;
}

/* Gear Table */
.gear-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.gear-table th {
  font-family: var(--font-heading);
  text-align: left;
  padding: 0.5rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gear-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid rgba(90, 77, 58, 0.2);
}

.gear-table tr:hover {
  background: rgba(198, 168, 75, 0.06);
}

.gear-table tr.selected {
  background: var(--accent-glow);
}

.gear-table tr.gear-locked {
  opacity: 0.3;
  pointer-events: none;
}
.gear-table tr.gear-locked td {
  text-decoration: line-through;
  text-decoration-color: rgba(150, 130, 100, 0.4);
}

.gear-table .cost {
  color: var(--accent);
  font-weight: 600;
}

/* Character Summary Panel */
.summary-panel {
  width: var(--summary-width);
  background: linear-gradient(180deg, #2a2318 0%, #1a1510 100%);
  border-left: 1px solid var(--border);
  padding: 1.5rem;
  flex-shrink: 0;
  overflow-y: auto;
  max-height: 100vh;
  box-shadow: -2px 0 20px rgba(0,0,0,0.4);
}

.summary-panel h3 {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.summary-panel h3::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 30px;
  height: 1px;
  background: var(--accent);
}

.summary-section {
  margin-bottom: 1.2rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  padding: 0.15rem 0;
}

.summary-row .s-label {
  color: var(--text-dim);
}

.summary-row .s-value {
  color: var(--text-bright);
  font-weight: 600;
  font-family: var(--font-heading);
  font-size: 0.82rem;
}

.summary-list {
  list-style: none;
  font-size: 0.88rem;
}

.summary-list li {
  padding: 0.1rem 0;
  color: var(--text);
}

.summary-list li::before {
  content: '\25B8';
  color: var(--accent);
  margin-right: 0.4rem;
}

.summary-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.1rem;
}

.summary-concept {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 0.8rem;
}

.summary-race {
  font-size: 0.88rem;
  color: var(--info);
}

/* Derived Stats */
.derived-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.derived-stat-box {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(42, 35, 24, 0.9) 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 2px 8px rgba(0,0,0,0.25);
}

.derived-stat-box .ds-label {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.derived-stat-box .ds-value {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}

/* Hindrance Point Allocation */
.hp-allocation {
  background: var(--bg-card);
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  padding: 1.2rem;
  margin-top: 1.5rem;
}

.hp-allocation h3 {
  font-family: var(--font-heading);
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}

.hp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(90, 77, 58, 0.3);
}

.hp-row:last-child {
  border-bottom: none;
}

.hp-row label {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-body);
}

.hp-row .hp-cost {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Checkbox */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.3rem 0;
}

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

/* Select */
select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.5rem;
  font-size: 0.88rem;
  font-family: var(--font-body);
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Quantity controls */
.qty-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.qty-controls button {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-controls button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.qty-controls .qty-val {
  min-width: 20px;
  text-align: center;
  font-weight: 600;
}

/* Heritage Choice */
.heritage-choices {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.heritage-choice {
  flex: 1;
  padding: 0.8rem;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.heritage-choice:hover {
  border-color: var(--accent-dim);
}

.heritage-choice.selected {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.heritage-choice .hc-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.heritage-choice .hc-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* Tabs for gear categories */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1rem;
}

.tab {
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  font-family: var(--font-heading);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.72rem;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Export/Print section */
.export-section {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Race ability list */
.ability-list {
  list-style: none;
  margin-top: 0.5rem;
}

.ability-list li {
  padding: 0.3rem 0;
  font-size: 0.88rem;
}

.ability-list .ability-label {
  color: var(--accent);
  font-weight: 600;
}

.ability-list .ability-desc {
  color: var(--text-dim);
}

/* Grid for race/hindrance selection */
.selection-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

/* Scrollable area within cards */
.scrollable {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.scrollable::-webkit-scrollbar {
  width: 6px;
}

.scrollable::-webkit-scrollbar-track {
  background: var(--bg-dark);
  border-radius: 3px;
}

.scrollable::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.scrollable::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dim);
}

/* ============================================================
   MOBILE & TABLET ELEMENTS (hidden on desktop by default)
   ============================================================ */

/* Mobile top header bar */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(180deg, #2a2318 0%, #231e16 100%);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  align-items: center;
  padding: 0 0.75rem;
  gap: 0.6rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.mobile-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 48%;
  border: 2px solid var(--accent-dim);
}
.mobile-title {
  flex: 1;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-summary-btn {
  padding: 0.3rem 0.7rem;
  border-radius: 15px;
  border: 1px solid var(--accent-dim);
  background: transparent;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.mobile-summary-btn:hover {
  background: var(--accent-glow);
}

/* Mobile bottom navigation bar */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(0deg, #1a1510 0%, #231e16 100%);
  border-top: 1px solid var(--border);
  z-index: 100;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.4);
}
.mobile-nav::-webkit-scrollbar { display: none; }

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-width: 56px;
  height: 100%;
  padding: 0.3rem 0.4rem;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s;
  flex-shrink: 0;
}
.mobile-nav-btn:hover {
  color: var(--text);
}
.mobile-nav-btn.active {
  color: var(--accent);
}
.mobile-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  font-size: 0.72rem;
  font-family: var(--font-heading);
  font-weight: 700;
  transition: all 0.15s;
}
.mobile-nav-btn.active .mobile-nav-icon {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg-dark);
}
.mobile-nav-label {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-family: var(--font-heading);
  white-space: nowrap;
}

/* Summary overlay (dark backdrop for drawer) */
.summary-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 149;
  opacity: 0;
  transition: opacity 0.3s;
}
.summary-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Table scroll wrapper */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Setting Selection */
.setting-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.setting-card {
  padding: 0 !important;
  transition: all 0.3s;
  overflow: hidden;
  border-radius: 10px;
  border: 2px solid var(--border);
}

.setting-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.setting-card.selected {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  border-color: var(--accent);
}

.setting-banner {
  width: 100%;
  height: 140px;
  object-fit: cover;
  object-position: center center;
  display: block;
  filter: brightness(0.8);
  transition: filter 0.3s;
}

.setting-card:hover .setting-banner {
  filter: brightness(1);
}

.setting-card-body {
  padding: 1rem 1.2rem 1.2rem;
}

/* Decorative section dividers */
.section-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.8rem 0 1.2rem;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent-dim), transparent);
}

/* Ornamental corners on cards */
.card-ornate {
  position: relative;
}
.card-ornate::before,
.card-ornate::after {
  content: '\2726';
  position: absolute;
  color: var(--accent-dim);
  font-size: 0.7rem;
  opacity: 0.5;
}
.card-ornate::before { top: 4px; left: 8px; }
.card-ornate::after { bottom: 4px; right: 8px; }

/* Step header ornament */
.step-content h2 {
  position: relative;
  padding-bottom: 0.6rem;
}
.step-content h2::after {
  content: '\2014\2014\2014  \2726  \2014\2014\2014';
  display: block;
  color: var(--accent-dim);
  font-size: 0.6rem;
  letter-spacing: 3px;
  margin-top: 0.3rem;
  opacity: 0.5;
}

/* Export Buttons Grid */
.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.export-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1rem 0.5rem !important;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  min-height: 90px;
  justify-content: center;
}
.export-btn:hover {
  border-color: var(--accent);
  background: var(--bg-input);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.export-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.export-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text-bright);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.export-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
}
.export-btn--foundry:hover {
  border-color: #e8772e;
  box-shadow: 0 4px 16px rgba(232, 119, 46, 0.15);
}
.export-btn--foundry .export-icon { color: #e8772e; }
.export-btn--roll20:hover {
  border-color: #d4111e;
  box-shadow: 0 4px 16px rgba(212, 17, 30, 0.15);
}
.export-btn--roll20 .export-icon { color: #d4111e; }

/* ============================================================
   RESPONSIVE OVERRIDES (must come after all base styles)
   ============================================================ */

/* Tablet: hide summary panel */
@media (max-width: 1100px) {
  .summary-panel {
    display: none;
  }
  .content::before {
    right: 0;
  }
}

/* Mobile: ≤768px — full mobile layout */
@media (max-width: 768px) {
  /* Hide desktop sidebar */
  .sidebar {
    display: none !important;
  }

  /* Show mobile header & bottom nav */
  .mobile-header {
    display: flex;
  }
  .mobile-nav {
    display: flex;
  }

  /* Main content takes full width with header/nav clearance */
  .app {
    flex-direction: column;
  }
  .content {
    padding: 58px 0.75rem 68px;
    max-height: none;
    min-height: 100vh;
  }
  .content::before {
    left: 0;
    right: 0;
  }

  /* Summary panel becomes slide-up drawer */
  .summary-panel {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    height: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 150;
    border-left: none;
    border-top: 1px solid var(--accent-dim);
    border-radius: 16px 16px 0 0;
    padding: 1.2rem 1rem 5rem;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.5);
  }
  .summary-panel.open {
    transform: translateY(0);
  }
  .summary-overlay {
    display: block;
    pointer-events: none;
  }
  .summary-overlay.open {
    pointer-events: auto;
  }

  /* Drawer handle indicator */
  .summary-panel::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 1rem;
  }

  /* Setting cards stack single column */
  .setting-grid {
    grid-template-columns: 1fr;
  }
  .setting-banner {
    height: 120px;
  }
  .setting-card-body {
    padding: 0.8rem 1rem 1rem;
  }

  /* Trait rows tighter */
  .trait-row {
    gap: 0.5rem;
    padding: 0.5rem 0;
  }
  .trait-cost {
    min-width: 45px;
    font-size: 0.72rem;
  }

  /* Die buttons smaller */
  .die-btn {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }
  .die-icon {
    width: 24px;
    height: 24px;
  }
  .die-value {
    min-width: 36px;
    font-size: 0.85rem;
  }

  /* Tabs wrap on small screens */
  .tabs {
    flex-wrap: wrap;
  }
  .tab {
    padding: 0.4rem 0.65rem;
    font-size: 0.65rem;
  }

  /* Heritage choices stack */
  .heritage-choices {
    flex-direction: column;
  }

  /* Export grid single column */
  .export-grid {
    grid-template-columns: 1fr;
  }

  /* Scrollable areas shorter on mobile */
  .scrollable {
    max-height: 50vh;
  }

  /* Cards tighter padding */
  .card {
    padding: 0.8rem;
  }

  /* Point tracker wrap nicely */
  .point-tracker {
    gap: 1rem;
    padding: 0.8rem 1rem;
    justify-content: center;
  }

  /* Step content headings */
  .step-content h2 {
    font-size: 1.2rem;
  }
  .step-content .step-desc {
    font-size: 0.88rem;
  }

  /* Filter buttons wrap tighter */
  .filters {
    gap: 0.35rem;
  }
  .filter-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }

  /* Nav buttons */
  .nav-buttons {
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
  }

  /* Derived stats boxes */
  .derived-stat-box .ds-value {
    font-size: 1.3rem;
  }

  /* Qty controls */
  .qty-controls button {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  /* Tip box mobile */
  .tip-box {
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
  }
  .tip-text {
    font-size: 0.8rem;
  }
}

/* Print styles */
@media print {
  .sidebar, .nav-buttons, .filters, .search-box, .btn { display: none !important; }
  .app { display: block; }
  .content { max-height: none; padding: 0; }
  .summary-panel { display: block; width: 100%; border: none; }
  body { background: white; color: black; }
  .card { border-color: #ccc; }
  .print-modal-overlay { display: none !important; }
}

/* ============================================================
   PRINT STYLE SELECTION MODAL
   ============================================================ */
.print-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}
.print-modal-overlay.active {
  background: rgba(0, 0, 0, 0.7);
}
.print-modal {
  background: linear-gradient(145deg, #3e301c, #2d2416);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 1.5rem 1.8rem;
  max-width: 720px;
  width: 92%;
  position: relative;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
  animation: modalSlideIn 0.3s ease;
}
@keyframes modalSlideIn {
  from { transform: translateY(30px) scale(0.95); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.print-modal h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.3rem;
}
.print-modal-close {
  position: absolute;
  top: 10px; right: 14px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
.print-modal-close:hover { color: var(--accent); }
.print-style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}
.print-style-card {
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
}
.print-style-card:hover {
  border-color: var(--accent);
  background: rgba(200,170,110,0.08);
  box-shadow: 0 0 16px rgba(200,170,110,0.15);
  transform: translateY(-2px);
}
.print-style-card .print-style-icon {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}
.print-style-card h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.print-style-card p {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* Mobile print modal */
@media (max-width: 600px) {
  .print-modal {
    padding: 1rem 1.2rem;
    max-width: 95%;
  }
  .print-style-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  .print-style-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-align: left;
    padding: 0.8rem;
  }
  .print-style-card .print-style-icon {
    font-size: 1.5rem;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .print-style-card h3 { font-size: 0.8rem; margin-bottom: 0.15rem; }
  .print-style-card p { font-size: 0.68rem; }
}

/* ============================================================
   BONUS RULES SYSTEM
   ============================================================ */

/* Bonus Rules Grid */
.bonus-rules-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Bonus Rule Card */
.bonus-rule-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.bonus-rule-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(139, 109, 56, 0.15);
}

.bonus-rule-card.selected {
  border-color: var(--success);
  box-shadow: 0 0 0 2px rgba(92, 133, 68, 0.25), 0 2px 8px rgba(92, 133, 68, 0.15);
}

.bonus-rule-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.bonus-rule-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.bonus-rule-title {
  flex: 1;
}

.bonus-rule-title h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
}

.bonus-rule-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.bonus-rule-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.bonus-rule-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bonus-rule-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(139, 109, 56, 0.12);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border);
  border-radius: 24px;
  transition: background-color 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--success);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* GM Note Bar */
.bonus-gm-note {
  background: rgba(139, 109, 56, 0.08);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* Bonus Active Summary */
.bonus-active-summary {
  background: rgba(92, 133, 68, 0.08);
  border: 1px solid rgba(92, 133, 68, 0.3);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-top: 1rem;
}

.bonus-active-summary h4 {
  margin: 0 0 0.5rem;
  color: var(--success);
  font-size: 0.85rem;
}

.bonus-active-summary ul {
  margin: 0;
  padding: 0 0 0 1.2rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

/* Language Family Groups */
.lang-family {
  margin-bottom: 0.75rem;
}

.lang-family-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent-dark);
  margin-bottom: 0.35rem;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border);
}

.lang-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 4px;
}

.lang-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-bg);
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.lang-option:hover:not(.disabled) {
  border-color: var(--accent);
  background: rgba(139, 109, 56, 0.06);
}

.lang-option.selected {
  background: var(--success);
  border-color: var(--success);
  color: white;
  font-weight: 600;
}

.lang-option.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lang-option .lang-check {
  font-size: 0.7rem;
}

/* Bonus Edge Card (Linguist auto-granted) */
.card.bonus-edge {
  border-color: var(--success) !important;
  background: rgba(92, 133, 68, 0.06);
  cursor: default;
  opacity: 1 !important;
}

.card.bonus-edge:hover {
  transform: none;
  box-shadow: none;
}

.bonus-edge-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--success);
  color: white;
  font-weight: 600;
  margin-top: 4px;
}

/* Language selection header */
.lang-selection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.lang-selection-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
}

.lang-slot-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.lang-slot-count .count {
  color: var(--success);
}

.lang-slot-count .full {
  color: var(--danger);
}

/* ============================================================
   STEP VALIDATION TOAST
   ============================================================ */

.validation-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 10000;
  background: #1a1208;
  border: 2px solid var(--danger);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  max-width: 480px;
  width: calc(100% - 2rem);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 12px rgba(183, 65, 51, 0.25);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.validation-toast.show {
  transform: translateX(-50%) translateY(0);
}

.validation-toast-icon {
  font-size: 1.3rem;
  color: var(--danger);
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.validation-toast-body {
  flex: 1;
  min-width: 0;
}

.validation-toast-body strong {
  display: block;
  color: var(--danger);
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.validation-toast-body ul {
  margin: 0;
  padding: 0 0 0 1.1rem;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.6;
}

.validation-toast-body li {
  margin-bottom: 2px;
}

.validation-toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.validation-toast-close:hover {
  opacity: 1;
  color: var(--danger);
}

@media (max-width: 600px) {
  .validation-toast {
    top: 0.5rem;
    max-width: calc(100% - 1rem);
    padding: 0.75rem 0.9rem;
  }
  .validation-toast-body strong { font-size: 0.8rem; }
  .validation-toast-body ul { font-size: 0.78rem; }
}

/* ============================================================
   OFFICIAL CONTENT / STORE PAGE
   ============================================================ */
.btn-store {
  background: linear-gradient(135deg, #7b2d8e 0%, #c6a84b 100%) !important;
  color: #fff !important;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.btn-store:hover {
  filter: brightness(1.15);
}

.store-page { max-width: 960px; margin: 0 auto; }

.store-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}
.store-header h1 {
  font-family: var(--font-heading);
  color: var(--accent);
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}
.store-header p {
  color: var(--text-dim);
  font-size: 0.95rem;
  max-width: 600px;
  margin: 0 auto;
}

.store-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
  transition: all 0.2s;
}
.store-back-btn:hover {
  background: var(--accent);
  color: var(--bg-dark);
  border-color: var(--accent);
}

.store-section {
  margin-bottom: 2.5rem;
}

/* --- Section Banner --- */
.store-section-banner {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.2rem;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  min-height: 160px;
  background: var(--bg-card);
}
.store-banner-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.22;
  z-index: 0;
  filter: blur(1px);
}
.store-banner-content {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 1.2rem 1.5rem;
  min-width: 0;
}
.store-banner-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}
.store-banner-desc {
  font-size: 0.88rem;
  color: var(--text);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  max-width: 360px;
  line-height: 1.4;
}
.store-banner-showcase {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  padding: 0.8rem 1.2rem 0.8rem 0;
  flex-shrink: 0;
}
.store-showcase-book {
  width: 90px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.1);
  object-fit: cover;
  max-height: 130px;
}
.store-showcase-hero {
  width: 110px;
  max-height: 160px;
}
.store-showcase-accessory {
  width: 65px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  object-fit: cover;
  max-height: 95px;
}

/* Legacy header (unused but kept) */
.store-section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.store-section-icon {
  font-size: 1.4rem;
}
.store-section-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--text-bright);
}
.store-section-color {
  width: 4px;
  height: 1.4rem;
  border-radius: 2px;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.store-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}
.store-item-has-img {
  flex-direction: row;
  gap: 0.8rem;
  align-items: stretch;
}
.store-item-img {
  flex-shrink: 0;
  width: 70px;
  display: flex;
  align-items: flex-start;
}
.store-item-img img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  object-fit: cover;
  max-height: 100px;
}
.store-item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.store-item:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}
.store-item-name {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text-bright);
  margin-bottom: 0.3rem;
}
.store-item-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
  flex: 1;
  line-height: 1.4;
}
.store-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
}
.store-item-price {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}
.store-item-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--accent);
  color: var(--bg-dark);
  padding: 0.3rem 0.8rem;
  border-radius: 5px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-heading);
  transition: all 0.2s;
}
.store-item-link:hover {
  filter: brightness(1.15);
  text-decoration: none;
}
.store-item-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.store-badge-pdf { background: #2a4a6b; color: #6ec6ff; }
.store-badge-print { background: #4a3a2a; color: #d4a64a; }
.store-badge-kickstarter { background: #3a5a3a; color: #4ecca3; }
.store-badge-free { background: #2a4a3a; color: #4ecca3; }
.store-badge-accessory { background: #3a2a4a; color: #b48adb; }

.store-callout {
  background: linear-gradient(135deg, #2a3a2a 0%, #1a2a1a 100%);
  border: 2px solid #4ecca3;
  border-radius: 10px;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
.store-callout h3 {
  font-family: var(--font-heading);
  color: #4ecca3;
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}
.store-callout p {
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.6rem;
}
.store-callout a {
  color: #4ecca3;
  text-decoration: underline;
}

.store-quick-links {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
}
.store-quick-link {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-family: var(--font-heading);
  transition: all 0.2s;
}
.store-quick-link:hover {
  background: var(--accent);
  color: var(--bg-dark);
  border-color: var(--accent);
}

.store-footer {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 2px solid var(--border);
  margin-top: 2rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.6;
}
.store-footer a {
  color: var(--accent);
  text-decoration: none;
}
.store-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .store-grid {
    grid-template-columns: 1fr;
  }
  .store-header h1 { font-size: 1.3rem; }
  .store-quick-links { flex-direction: column; align-items: stretch; }
  .store-section-banner {
    flex-direction: column;
    min-height: auto;
  }
  .store-banner-content {
    padding: 1rem;
  }
  .store-banner-title {
    font-size: 1.2rem;
  }
  .store-banner-showcase {
    padding: 0 1rem 0.8rem 1rem;
    justify-content: center;
  }
  .store-showcase-book {
    width: 70px;
    max-height: 100px;
  }
  .store-showcase-accessory {
    width: 50px;
    max-height: 72px;
  }
  .store-item-has-img {
    flex-direction: row;
  }
  .store-item-img {
    width: 55px;
  }
}

/* =============================
   INSTALL / GET THE APP MODAL
   ============================= */
.install-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
.install-overlay.active {
  display: flex;
}
.install-modal {
  position: relative;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.install-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.4rem;
}
.install-close:hover {
  color: var(--text);
}
.install-header {
  text-align: center;
  margin-bottom: 1.5rem;
}
.install-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  margin-bottom: 0.8rem;
}
.install-header h2 {
  font-family: var(--font-heading);
  color: var(--accent);
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
}
.install-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}
.install-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.install-tab {
  flex: 1;
  padding: 0.6rem 0.8rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.install-tab:hover {
  border-color: var(--accent);
  color: var(--text);
}
.install-tab.active {
  background: var(--accent);
  color: var(--bg-dark);
  border-color: var(--accent);
  font-weight: 700;
}
.install-content {
  padding: 0.2rem 0;
}
.install-subtitle {
  font-family: var(--font-heading);
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}
.install-steps {
  list-style: none;
  counter-reset: steps;
  padding: 0;
  margin: 0;
}
.install-steps li {
  counter-increment: steps;
  position: relative;
  padding: 0.7rem 0.5rem 0.7rem 2.8rem;
  margin-bottom: 0.4rem;
  background: var(--bg-dark);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.4;
}
.install-steps li::before {
  content: counter(steps);
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-dark);
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.install-icon {
  display: inline-block;
  font-weight: 700;
  font-size: 1.1em;
  vertical-align: middle;
  color: var(--accent);
}
.install-native-btn {
  width: 100%;
  padding: 0.9rem;
  font-size: 1rem;
  font-family: var(--font-heading);
  background: var(--accent);
  color: var(--bg-dark);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 1rem;
  transition: background 0.2s;
}
.install-native-btn:hover {
  background: #d4a64a;
}
.install-note {
  margin-top: 1rem;
  padding: 0.7rem;
  background: rgba(184, 134, 11, 0.1);
  border: 1px solid rgba(184, 134, 11, 0.3);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

@media (max-width: 600px) {
  .install-modal {
    padding: 1.5rem 1.2rem;
    border-radius: 14px;
  }
  .install-header h2 {
    font-size: 1.2rem;
  }
}
/* Account panel */
.account-panel { border-bottom: 1px solid var(--border); padding-bottom: .8rem; margin-bottom: .8rem; color: var(--text); font-size: .8rem; }
.account-panel h3 { margin: 0 0 .5rem; font-size: .95rem; }
.account-panel p { margin: .35rem 0; }
.account-panel .btn { width: 100%; margin: .2rem 0; }
.account-panel input { box-sizing: border-box; width: 100%; padding: .5rem; margin: .2rem 0; border: 1px solid var(--border); border-radius: 4px; }
.account-switch { display: block; background: none; border: 0; padding: .4rem 0; color: inherit; text-decoration: underline; cursor: pointer; text-align: left; }
.account-list { max-height: 8rem; overflow-y: auto; margin: .5rem 0; }
.account-item { display: block; width: 100%; background: transparent; border: 1px solid var(--border); color: inherit; padding: .35rem; text-align: left; cursor: pointer; }
.account-status { overflow-wrap: anywhere; }
.account-close { display: none; }
@media (max-width: 768px) {
  .sidebar.account-open { display: flex !important; position: fixed; z-index: 210; top: 0; left: 0; bottom: 0; width: min(300px, 90vw); max-height: 100vh; }
  .sidebar.account-open .account-close { display: block; margin: 0 1rem; }
}
