*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ── Global focus ring ──────────────────────────────────── */

:focus {
  outline: none;
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-sm);
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-mono);
  font-size: var(--font-size-base);
}

/* ── App shell ─────────────────────────────────────────── */

#app {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

/* ── HUD ────────────────────────────────────────────────── */

#hud {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

#hud-main {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

#hud-title {
  color: var(--color-accent-cyan);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 2px;
  flex-shrink: 0;
}

#hud-stats {
  display: flex;
  flex-direction: row;
  gap: var(--space-sm);
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

/* ── Stat bars ──────────────────────────────────────────── */

.stat-bar-wrapper {
  display: flex;
  flex-direction: column;
  width: 80px;
}

.stat-label {
  font-size: var(--font-size-sm);
  font-size: 10px;
  color: #A8A8A8;
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
}

.stat-bar-track {
  height: 6px;
  background-color: var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 0.4s ease;
}

.stat-bar-fill--kompetenz  { background-color: var(--color-accent-cyan); }
.stat-bar-fill--bullshit   { background-color: var(--color-accent-amber); }
.stat-bar-fill--kundenliebe { background-color: var(--color-accent-green); }
.stat-bar-fill--burnout    { background-color: var(--color-accent-red); }
.stat-bar-fill--prestige   { background-color: var(--color-accent-purple); }

/* ── HUD stat clickable ─────────────────────────────────── */

.hud-stat {
  cursor: pointer;
  transition: opacity 0.15s;
}
.hud-stat:hover {
  opacity: 0.75;
}

/* ── Live widget (currently playing) ─────────────────────── */

#live-widget {
  padding: 8px 10px;
  border-top: 1px solid #1a1a1a;
  margin-top: 8px;
}

#live-widget[hidden] {
  display: none;
}

.lw-row {
  font-size: 0.72rem;
  color: #505050;
  line-height: 1.8;
}

.lw-label {
  font-size: 0.65rem;
  color: #383838;
  font-style: italic;
  margin-top: 4px;
}

/* ── Stat detail panel ──────────────────────────────────── */

#stat-detail-panel,
.stat-detail-panel {
  position: fixed;
  z-index: 9000;
  background: #1a1a1a;
  border: 1px solid #505050;
  border-radius: 6px;
  padding: 14px 16px;
  width: 260px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  animation: sdpFadeIn 0.15s ease;
}

@keyframes sdpFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sdp-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.sdp-emoji { font-size: 1.1rem; }
.sdp-label {
  font-size: 0.85rem;
  color: #D0D0D0;
  font-weight: 600;
  flex: 1;
}
.sdp-value { font-size: 1.1rem; font-weight: 700; }
.sdp-close {
  background: none;
  border: none;
  color: #A0A0A0;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0;
  margin-left: 4px;
}
.sdp-close:hover { color: #C0C0C0; }

.sdp-bar-track {
  height: 3px;
  background: #2a2a2a;
  border-radius: 2px;
  margin-bottom: 10px;
  overflow: hidden;
}
.sdp-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.sdp-description {
  font-size: 0.78rem;
  color: #A8A8A8;
  line-height: 1.5;
  margin: 0 0 10px;
}

.sdp-threshold {
  font-size: 0.74rem;
  color: #808080;
  font-style: italic;
  padding: 6px 10px;
  background: #111;
  border-radius: 4px;
  margin-bottom: 6px;
}

.sdp-warning {
  font-size: 0.74rem;
  color: #E8622A;
  font-style: italic;
  padding: 6px 10px;
  background: rgba(232,98,42,0.08);
  border: 1px solid rgba(232,98,42,0.2);
  border-radius: 4px;
  margin-top: 6px;
}

@media (max-width: 599px) {
  .stat-detail-panel {
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%);
    max-width: calc(100vw - 32px);
  }
}

/* ── Game container ─────────────────────────────────────── */

#game-container {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  flex: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

#scene-location {
  font-size: var(--font-size-sm);
  color: #909090;
  text-transform: uppercase;
  letter-spacing: 2px;
}

#npc-display:empty {
  display: none;
}

#npc-display {
  font-size: var(--font-size-lg);
  padding: var(--space-sm) 0;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 0;
  flex: 0 1 auto;
  max-width: 160px;
  overflow: hidden;
}

#npc-display .npc-portrait {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
}

#npc-display .npc-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}

#npc-display .npc-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #E0E0E0;
}

#npc-display .npc-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #909090;
}

#story-text {
  font-family: var(--font-mono);
  font-size: var(--font-size-base);
  line-height: 1.7;
  color: #E8E8E8;
  min-height: 120px;
  pointer-events: auto;
  position: relative;
  user-select: none;
}

#story-text.typing {
  cursor: pointer;
}

#story-text.typing::after {
  content: "[ Klicken zum Überspringen ]";
  display: block;
  font-size: 0.65rem;
  color: var(--color-text-tertiary);
  margin-top: 12px;
  font-style: italic;
  pointer-events: none;
}

#story-text.typing-done::after {
  display: none;
}

#feedback-text {
  font-size: var(--font-size-sm);
  color: #C8C8C8;
  font-style: italic;
  min-height: 32px;
  padding: var(--space-sm);
  border-left: 3px solid var(--color-accent-amber);
}

/* ── Choices ────────────────────────────────────────────── */

#choices-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.choice-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  background-color: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  color: #D0D0D0;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  text-align: left;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
  /* Minimum touch target size */
  min-height: var(--touch-target-min);
  min-width: var(--touch-target-min);
}

.choice-text {
  display: block;
  text-align: left;
  line-height: 1.4;
}

.effect-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.effect-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  line-height: 1.4;
  font-style: normal;
  pointer-events: none;
}

.effect-good {
  color: #66BB6A;
  background: rgba(76, 175, 80, 0.12);
  border: 1px solid rgba(76, 175, 80, 0.25);
}

.effect-bad {
  color: #EF5350;
  background: rgba(244, 67, 54, 0.12);
  border: 1px solid rgba(244, 67, 54, 0.25);
}

.effect-hidden .effect-unknown {
  font-size: 0.72rem;
  color: #B0B0B0;
  letter-spacing: 0.2em;
  font-style: italic;
}

.choice-btn:hover .effect-badge {
  filter: brightness(1.2);
}

.choice-locked .effect-bar {
  opacity: 0.3;
}

.choice-btn:hover {
  border-color: var(--color-accent-cyan);
  color: #FFFFFF;
  background-color: rgba(88, 166, 255, 0.08);
}

.choice-btn:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
  border-color: var(--color-accent-cyan);
}

.choice-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Keyboard hint badges ────────────────────────────────── */

kbd.key-hint {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #A8A8A8;
  background-color: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 1px 6px;
  line-height: 1.6;
  user-select: none;
}

/* ── Dialog overlays ─────────────────────────────────────── */

[role="dialog"] {
  /* Overlays already positioned via inline style; ensure they receive focus events */
  outline: none;
}

/* ── Footer ─────────────────────────────────────────────── */

#game-footer {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  color: #B0B0B0;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#btn-exit-to-menu {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ── Touch improvements (all viewports) ─────────────────── */

button,
[role="button"],
.choice-btn,
input[type="range"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.choice-btn:active {
  transform: scale(0.97);
}

/* ── Responsive: 768px and below ────────────────────────── */

@media (max-width: 768px) {
  #app {
    max-width: 100%;
  }

  #hud {
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-sm);
    min-height: var(--hud-height-mobile);
    height: auto;
    align-items: stretch;
  }

  #hud-main {
    flex-direction: column;
    gap: var(--space-sm);
  }

  #hud-title {
    text-align: center;
  }

  #hud-stats {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-xs);
  }

  .stat-bar-wrapper {
    width: 56px;
  }

  .stat-label {
    font-size: 9px;
  }

  #hud-achievements-btn {
    align-self: center;
  }

  #npc-display {
    text-align: center;
    max-width: none;
    flex: 1 1 auto;
  }

  #game-container {
    padding: var(--container-padding-mobile);
  }

  #story-text {
    font-size: 15px;
    line-height: 1.6;
  }

  #choices-container {
    grid-template-columns: 1fr;
  }

  .choice-btn {
    min-height: var(--touch-target);
    padding: var(--space-sm) var(--space-md);
    font-size: 14px;
  }

  /* Overlays: full-bleed on mobile */
  [role="dialog"] {
    border-radius: 0 !important;
  }

  /* Email overlay: tighten padding */
  #email-overlay {
    padding: var(--space-sm) !important;
    gap: var(--space-sm) !important;
  }
}

/* ── Responsive: 480px and below ────────────────────────── */

@media (max-width: 480px) {
  #hud-title {
    font-size: 11px;
  }

  .stat-bar-wrapper {
    width: 48px;
  }

  #story-text {
    font-size: 14px;
    min-height: 100px;
  }

  /* Vendor ad: fit on small screens */
  .vendor-ad-card {
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }

  .vendor-ad-buttons {
    flex-direction: column;
  }

  .vendor-ad-btn {
    width: 100%;
  }
}

/* ── Mobile email detail view ────────────────────────────── */

#email-detail-mobile {
  position: fixed;
  inset: 0;
  z-index: 1700;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  /* Slide-in from right */
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

#email-detail-mobile.is-open {
  transform: translateX(0);
}

#email-detail-mobile .edm-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  flex-shrink: 0;
  min-height: var(--touch-target);
}

#email-detail-mobile .edm-header button {
  background: none;
  border: none;
  color: var(--color-accent-cyan);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  cursor: pointer;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  min-height: var(--touch-target);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#email-detail-mobile .edm-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

#email-detail-mobile .edm-footer {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  flex-shrink: 0;
}

#email-detail-mobile .edm-footer .choice-btn {
  flex: 1;
}

/* ── Easter egg: Partner-level Comic Sans ─────────────────── */

#hud-title.hud-title--partner {
  font-family: 'Comic Sans MS', 'Comic Sans', cursive !important;
  letter-spacing: 0.5px;
}

/* ── Calendar overlay: mobile stack columns ───────────────── */

@media (max-width: 600px) {
  #calendar-overlay #cal-grid {
    flex-direction: column;
    overflow-x: visible;
    align-items: stretch;
  }

  #calendar-overlay #cal-grid > div {
    min-width: 100%;
  }
}

/* ── Vendor ad overlay ───────────────────────────────────── */

#vendor-ad-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease;
}

.vendor-ad-card {
  background: #ffffff;
  border-radius: 4px;
  max-width: 520px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  font-family: -apple-system, "Segoe UI", sans-serif;
  color: #1a1a1a;
}

.vendor-ad-color-bar {
  height: 6px;
  width: 100%;
}

.vendor-ad-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 8px;
}

.vendor-ad-logo {
  font-size: 1.8rem;
}

.vendor-ad-vendor-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4A4A4A;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex: 1;
}

.vendor-ad-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vendor-ad-badge.flashing {
  animation: badgePulse 1.5s ease-in-out infinite;
}

@keyframes badgePulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.vendor-ad-headline {
  font-size: 1.15rem;
  font-weight: 700;
  padding: 4px 20px 4px;
  line-height: 1.3;
}

.vendor-ad-subline {
  font-size: 0.85rem;
  font-style: italic;
  color: #3A3A3A;
  padding: 0 20px 12px;
}

.vendor-ad-body {
  font-size: 0.85rem;
  color: #1A1A1A;
  padding: 0 20px 12px;
  line-height: 1.5;
}

.vendor-ad-small-print {
  font-size: 0.68rem;
  color: #5A5A5A;
  font-style: italic;
  padding: 0 20px 12px;
  line-height: 1.4;
}

.vendor-ad-divider {
  height: 1px;
  background: #eee;
  margin: 0 20px;
}

.vendor-ad-buttons {
  display: flex;
  gap: 8px;
  padding: 14px 20px 6px;
  flex-wrap: wrap;
}

.vendor-ad-btn {
  font-size: 0.8rem;
  padding: 8px 14px;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: opacity 0.15s;
}

.vendor-ad-btn:hover {
  opacity: 0.85;
}

.vendor-ad-btn.primary {
  background: var(--vendor-color, #0078d4);
  color: white;
}

.vendor-ad-btn.secondary {
  background: #f0f0f0;
  color: #1A1A1A;
  border: 1px solid #ddd;
}

.vendor-ad-btn.ghost {
  background: transparent;
  color: #5A5A5A;
  border: none;
  text-decoration: underline;
  padding: 8px 6px;
}

.vendor-ad-skip-row {
  text-align: right;
  padding: 6px 20px 14px;
}

.vendor-ad-skip {
  font-size: 0.72rem;
  color: #5A5A5A;
  cursor: pointer;
  display: none;
}

.vendor-ad-skip.visible {
  display: inline;
}

.vendor-ad-skip:hover {
  color: #3A3A3A;
}

/* Phone call special style */
.vendor-ad-card.phone-call .vendor-ad-logo {
  animation: phonePulse 0.8s ease-in-out infinite;
}

.vendor-ad-card.phone-call .vendor-ad-btn.primary {
  background: #107c10;
  color: white;
}

.vendor-ad-card.phone-call .vendor-ad-btn.ghost {
  background: #d13438;
  color: white;
  text-decoration: none;
}

/* ── Dashboard button ───────────────────────────────────── */

#dashboard-btn {
  background: linear-gradient(135deg, rgba(232, 98, 42, 0.2), rgba(232, 98, 42, 0.05));
  border: 1px solid rgba(232, 98, 42, 0.5);
  color: #E8622A;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(232, 98, 42, 0.15);
}

#dashboard-btn:hover {
  border-color: #E8622A;
  color: #fff;
  background: rgba(232, 98, 42, 0.35);
  box-shadow: 0 6px 16px rgba(232, 98, 42, 0.3);
}

#framework-btn {
  background: linear-gradient(135deg, rgba(232, 98, 42, 0.2), rgba(232, 98, 42, 0.05));
  border: 1px solid rgba(232, 98, 42, 0.5);
  color: #E8622A;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(232, 98, 42, 0.15);
}

#framework-btn:hover {
  border-color: #E8622A;
  color: #fff;
  background: rgba(232, 98, 42, 0.35);
  box-shadow: 0 6px 16px rgba(232, 98, 42, 0.3);
}

/* ── Dashboard overlay ───────────────────────────────────── */

.dashboard-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #0f0f0f 0%, #1a1520 40%, #0d1117 100%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  overflow-y: auto;
}

.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  gap: 16px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(232, 98, 42, 0.2);
}

.dashboard-close {
  flex-shrink: 0;
  order: 1;
  background: rgba(232, 98, 42, 0.15);
  border: 1px solid rgba(232, 98, 42, 0.4);
  color: #E8622A;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.dashboard-close:hover {
  background: rgba(232, 98, 42, 0.3);
  border-color: #E8622A;
  color: #fff;
}

.dashboard-header-center {
  flex: 1;
  min-width: 180px;
  order: 2;
  text-align: center;
}

.dashboard-header-right {
  flex-shrink: 0;
  order: 3;
  text-align: right;
}

.dashboard-title {
  font-size: 1.25rem;
  color: #fff;
  margin: 0 0 4px 0;
  text-shadow: 0 0 20px rgba(232, 98, 42, 0.3);
}

.dashboard-subtitle {
  font-size: 0.75rem;
  color: #B0B0B0;
}

.dashboard-clock {
  font-size: 1.15rem;
  color: #58a6ff;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.dashboard-refresh {
  font-size: 0.7rem;
  color: #989898;
}

.dashboard-subtitle-bar {
  background: linear-gradient(90deg, rgba(88, 166, 255, 0.08), rgba(232, 98, 42, 0.08));
  padding: 10px 24px;
  font-size: 0.75rem;
  color: #B0B0B0;
  border-bottom: 1px solid rgba(110, 118, 129, 0.3);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 20px;
  flex: 1;
}

@media (max-width: 600px) {
  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-close {
    align-self: flex-start;
  }

  .dashboard-header-center {
    text-align: left;
  }

  .dashboard-header-right {
    text-align: left;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-tile {
  background: linear-gradient(145deg, rgba(26, 26, 30, 0.95), rgba(22, 27, 34, 0.98));
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dashboard-tile:hover {
  border-color: rgba(232, 98, 42, 0.6);
  box-shadow: 0 6px 20px rgba(232, 98, 42, 0.2);
  transform: translateY(-2px);
}

.dashboard-tile--locked {
  opacity: 0.3;
  pointer-events: none;
}

.dashboard-tile--locked:hover {
  border-color: #2a2a2a;
  box-shadow: none;
}

.dashboard-tile--new {
  animation: dashboardTileNew 0.5s ease;
}

@keyframes dashboardTileNew {
  0% { box-shadow: 0 0 0 2px #E8622A; }
  100% { box-shadow: none; }
}

.dashboard-tile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.dashboard-tile-title {
  font-size: 0.8rem;
  color: #A8A8A8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dashboard-mini-chart {
  width: 100%;
  height: 6px;
  background: rgba(110, 118, 129, 0.3);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.dashboard-mini-chart-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.dashboard-trend {
  font-size: 0.75rem;
}

.dashboard-trend--up {
  color: var(--color-accent-red);
}

.dashboard-trend--down {
  color: var(--color-accent-green);
}

.dashboard-trend--neutral {
  color: #909090;
}

.dashboard-tile-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 48px;
}

.dashboard-tile-subtext {
  font-size: 0.75rem;
  color: #989898;
  font-style: italic;
  line-height: 1.4;
}

.dashboard-value {
  font-size: 1.75rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
}

.dashboard-unit {
  font-size: 0.85rem;
  color: #A8A8A8;
  margin-left: 4px;
}

.dashboard-status {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: bold;
}

.dashboard-status--green {
  background: linear-gradient(135deg, rgba(46, 160, 67, 0.4), rgba(35, 134, 54, 0.3));
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.4);
}

.dashboard-status--amber {
  background: linear-gradient(135deg, rgba(210, 153, 34, 0.4), rgba(166, 121, 27, 0.3));
  color: #d29922;
  border: 1px solid rgba(210, 153, 34, 0.4);
}

.dashboard-status--red {
  background: linear-gradient(135deg, rgba(248, 81, 73, 0.4), rgba(207, 34, 46, 0.3));
  color: #f85149;
  border: 1px solid rgba(248, 81, 73, 0.4);
}

.dashboard-status--gray {
  background: rgba(110, 118, 129, 0.3);
  color: #A8A8A8;
}

.dashboard-fraction--ok {
  color: var(--color-accent-green);
}

.dashboard-fraction--low {
  color: var(--color-accent-red);
}

.dashboard-fraction {
  font-size: 1.25rem;
  font-weight: bold;
}

.dashboard-currency {
  font-size: 1.25rem;
  font-weight: bold;
  color: #fff;
  text-align: right;
}

.dashboard-trend-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
}

.dashboard-special {
  font-size: 1rem;
  font-style: italic;
  color: #A0A0A0;
}

.dashboard-loading-text {
  font-size: 0.9rem;
  color: #A0A0A0;
}

.dashboard-loadbar {
  width: 100%;
  height: 4px;
  background: #2a2a2a;
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.dashboard-loadbar-fill {
  height: 100%;
  width: 0;
  background: #E8622A;
  border-radius: 2px;
}

.dashboard-tile-locked {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 8px;
}

.dashboard-tile-locked-text {
  font-size: 0.75rem;
  color: #909090;
  text-align: center;
}

/* ── Copyright ───────────────────────────────────────────── */

#copyright {
  position: fixed;
  bottom: 8px;
  right: 12px;
  font-size: 0.68rem;
  color: #787878;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

@keyframes phonePulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2) rotate(-10deg);
  }
}

/* ── Flexera Certification Overlay (flexera_cert.js) ───────── */

#flexera-cert-overlay .flexera-option:hover {
  border-color: var(--flexera-orange, #E8622A);
  background: #FFF3E0;
}

#flexera-cert-overlay .npc-name,
#flexera-cert-overlay .question-text,
#flexera-cert-overlay .answer-text,
#flexera-cert-overlay .flexera-option span,
#flexera-cert-overlay [style*="color:#1D1D1D"],
#flexera-cert-overlay [style*="color:#333"] {
  color: #1A1A1A !important;
}

#flexera-cert-overlay .section-label,
#flexera-cert-overlay .question-counter {
  color: #3A3A3A !important;
}

#flexera-cert-overlay .hint-text,
#flexera-cert-overlay .footer-text,
#flexera-cert-overlay [style*="color:#6B6B6B"],
#flexera-cert-overlay [style*="color:#888"] {
  color: #3A3A3A !important;
}

#flexera-cert-overlay .feedback-correct,
#flexera-cert-overlay [style*="background:#E8F5E9"] span {
  color: #1B5E20 !important;
}

#flexera-cert-overlay .feedback-wrong,
#flexera-cert-overlay [style*="background:#FFEBEE"] span {
  color: #B71C1C !important;
}

@media (max-width: 480px) {
  #flexera-cert-overlay .flexera-info-grid {
    grid-template-columns: 1fr !important;
  }
  #flexera-cert-overlay .flexera-option {
    width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 375px) {
  #flexera-cert-overlay [id="flexera-card-body"] {
    padding: 20px 16px !important;
  }
}

/* ── Compliance Training Overlay (compliance.js) ───────────── */

#compliance-overlay .question-text,
#compliance-overlay p[style*="font-size:15px"],
#compliance-overlay .compliance-question p {
  color: #1A1A1A !important;
}

#compliance-overlay .answer-option,
#compliance-overlay .compliance-option,
#compliance-overlay .compliance-option span {
  color: #2A2A2A !important;
}

#compliance-overlay .feedback-text,
#compliance-overlay [style*="color:#2ea043"],
#compliance-overlay [style*="color:#cf2222"] {
  color: #1A1A1A !important;
}

#compliance-overlay .module-title,
#compliance-overlay h2 {
  color: #1A1A1A !important;
}

#compliance-overlay .module-subtitle,
#compliance-overlay [style*="color:#555"] {
  color: #4A4A4A !important;
}

/* ── Onboarding skip button ───────────────────────────────── */

#skip-onboarding-btn {
  color: #707070 !important;
}

#skip-onboarding-btn:hover {
  color: #909090 !important;
}

/* ── Toast (dark background) ───────────────────────────────── */

#renderer-toast {
  color: #E8E8E8 !important;
}

/* ── Community choice statistics ───────────────────────────── */

.community-stats {
  margin-top: 20px;
  padding: 14px 16px;
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 6px;
  animation: csFadeIn 0.3s ease;
}

@keyframes csFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cs-header {
  font-size: 0.72rem;
  color: #505050;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}

.cs-total {
  color: #404040;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
}

.cs-row {
  display: grid;
  grid-template-columns: 1fr 120px 36px;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

.cs-row:last-child {
  margin-bottom: 0;
}

.cs-row-selected .cs-label {
  color: #E8622A;
}

.cs-label {
  font-size: 0.74rem;
  color: #505050;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-bar-track {
  height: 3px;
  background: #1a1a1a;
  border-radius: 2px;
  overflow: hidden;
}

.cs-bar-fill {
  height: 100%;
  background: #2a2a2a;
  border-radius: 2px;
  transition: width 0.6s ease;
}

.cs-row-selected .cs-bar-fill {
  background: #E8622A;
}

.cs-percent {
  font-size: 0.72rem;
  color: #404040;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .cs-row {
    grid-template-columns: 1fr 80px 32px;
    gap: 8px;
  }
}
