:root {
  --bg-primary: #000000; /*pure black = transparent on additive display*/
  --bg-secondary: #0a0a0f;
  --bg-tertiary: #14141f;
  --bg-card: #1a1a2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --accent-primary: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --success: #00ff88;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --focus-tf: transform 475ms cubic-bezier(0.6, 0, 0.4, 1),
              border-color 300ms cubic-bezier(0.4, 0.04, 0.5, 1),
              box-shadow 300ms cubic-bezier(0.4, 0.04, 0.5, 1),
              background 300ms cubic-bezier(0.4, 0.04, 0.5, 1);
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 600px;
  height: 600px;
  overflow: hidden;
}

#app { width: 100%; height: 100%; position: relative; padding: 8px; box-sizing: border-box; }

.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
}
.screen.hidden { display: none; }

.header {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-secondary);
  gap: 12px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
}
.header h1 { font-size: 24px; font-weight: 700; flex: 1; }
.header-meta { font-size: 14px; color: var(--accent-secondary); font-variant-numeric: tabular-nums; }
.back-btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 22px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
}

.content {
  flex: 1;
  padding: 14px 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* --- Hub buttons --- */
.big-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 96px;
  padding: 0 20px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  text-align: left;
  cursor: pointer;
  transition: var(--focus-tf);
}
.big-btn-icon { font-size: 30px; width: 40px; text-align: center; flex-shrink: 0; color: var(--accent-primary); }
.content-label { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.btn-title { font-size: 20px; font-weight: 600; }
.btn-sub { font-size: 14px; color: var(--text-secondary); }

/* --- Scroll region + scrims --- */
.scroll-region { position: relative; flex: 1; min-height: 0; }
.scroll-body {
  height: 100%;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: none;
}
.scroll-body::-webkit-scrollbar { display: none; }
.scrim {
  position: absolute;
  left: 0;
  right: 0;
  height: 56px;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 250ms ease;
}
.scrim-top { top: 0; background: linear-gradient(to bottom, #000000 0%, transparent 100%); }
.scrim-bottom { bottom: 0; background: linear-gradient(to top, #000000 0%, transparent 100%); }
.scrim.show { opacity: 1; }

/* --- List items --- */
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--focus-tf);
}
.list-item-icon { font-size: 26px; width: 36px; text-align: center; flex-shrink: 0; }
.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-size: 18px; font-weight: 600; }
.list-item-meta { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }

/* --- Carousel --- */
.carousel-content { justify-content: center; }
.carousel-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px 60px; /*edge padding lets first/last card center*/
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-card {
  flex: 0 0 452px;
  height: 360px;
  scroll-snap-align: center;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
  transition: var(--focus-tf);
}
.carousel-card-icon { font-size: 72px; }
.carousel-card-title { font-size: 26px; font-weight: 700; }
.carousel-card-sub { font-size: 16px; color: var(--text-secondary); }
.carousel-dots { display: flex; gap: 10px; justify-content: center; padding-top: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bg-tertiary); }
.dot.active { background: var(--accent-primary); width: 26px; border-radius: 5px; }

/* --- Tile grid --- */
.tiles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: start;
}
.tile {
  min-height: 120px;
  background: var(--bg-tertiary);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--focus-tf);
}
.tile-icon { font-size: 34px; }
.tile-label { font-size: 16px; font-weight: 600; }

/* --- Settings rows --- */
.setting-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 12px 18px;
  background: var(--bg-tertiary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--focus-tf);
}
.setting-label { flex: 1; font-size: 18px; font-weight: 500; }
.setting-value { font-size: 20px; font-weight: 700; color: var(--accent-primary); font-variant-numeric: tabular-nums; }
.setting-value.off { color: var(--text-secondary); }
.stepper-hint { font-size: 20px; color: var(--text-secondary); }
.setting-row[data-role="stepper"] .setting-value { min-width: 64px; text-align: right; }

/* --- Focus states --- */
.focusable { outline: none; }
.big-btn:focus, .back-btn:focus, .list-item:focus,
.carousel-card:focus, .tile:focus, .setting-row:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 24px var(--focus-glow);
  transform: scale(calc(1 - 8/96));
}
.big-btn:focus, .list-item:focus, .tile:focus, .setting-row:focus { background: var(--bg-card); }
.carousel-card:focus { transform: scale(1.02); }

/* --- Toast --- */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 12px 22px;
  border-radius: 24px;
  font-size: 16px;
  max-width: 536px;
  border: 1px solid var(--accent-primary);
  transition: transform 300ms cubic-bezier(0.6, 0, 0.4, 1);
  z-index: 100;
  pointer-events: none;
}
.toast.visible { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--success); }

.hidden { display: none !important; }
