/* ==========================================================================
   BLOCK TIMER - RETRO CONSOLE / TUI MONOCHROME DESIGN SYSTEM
   Theme: Pure Black & White Solid Colors, Dashed Borders, Monospace Fonts
   Single-Screen Fit for 13" Laptops & Standard Displays (No Scroll Needed)
   ========================================================================== */

:root {
  /* Solid Monochrome Palette */
  --c-bg: #000000;
  --c-fg: #ffffff;
  --c-dim: #a0a0a0;
  --c-dark: #121212;
  --c-border: #ffffff;
  
  /* Monospace Typography */
  --font-mono: 'JetBrains Mono', 'VT323', 'Fira Code', 'Courier New', 'SF Mono', Consolas, monospace;
  
  /* Borders */
  --border-dashed-thick: 2px dashed #ffffff;
  --border-dashed-thin: 1px dashed #ffffff;
  --border-dotted-thin: 1px dotted #ffffff;
}

/* Reset & Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important; /* Force crisp console corners */
}

html, body {
  height: 100vh;
  height: 100dvh;
  background-color: var(--c-bg);
  color: var(--c-fg);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden; /* No page scroll on standard screen */
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

/* Fallback for small screens or mobile */
@media (max-width: 850px), (max-height: 520px) {
  html, body {
    height: auto;
    overflow-y: auto;
  }
}

/* Subtle Retro Terminal CRT Scanline & Grid Effect */
body {
  background-color: #000000;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0;
}

/* Custom Console Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #000000;
  border-left: 1px dashed #ffffff;
}
::-webkit-scrollbar-thumb {
  background: #ffffff;
  border: 1px solid #000000;
}
::-webkit-scrollbar-thumb:hover {
  background: #cccccc;
}

/* Selection */
::selection {
  background-color: #ffffff;
  color: #000000;
}

/* ==========================================================================
   APP CONTAINER & FULL-VIEWPORT LAYOUT
   ========================================================================== */

.app-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.5rem 0.85rem;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
  box-sizing: border-box;
}

@media (max-width: 850px), (max-height: 520px) {
  .app-wrapper {
    height: auto;
    max-height: none;
    padding: 0.75rem;
    gap: 0.75rem;
  }
}

/* ==========================================================================
   CONSOLE HEADER (COMPACT)
   ========================================================================== */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.75rem;
  background-color: #000000;
  border: 2px dashed #ffffff;
  position: relative;
  flex-shrink: 0;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Retro ASCII Box Icon */
.brand-logo-retro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px dashed #ffffff;
  background: #000000;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 1.1rem;
  color: #ffffff;
}

.brand-title-group h1 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.1;
}

.brand-title-group h1 .console-cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background-color: #ffffff;
  vertical-align: middle;
  animation: cursorBlink 1s infinite steps(1);
}

@keyframes cursorBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.brand-tagline {
  font-size: 0.68rem;
  color: var(--c-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1;
}

.brand-tagline .status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: #ffffff;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Console Switch / Mode Button */
.btn-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  background: #000000;
  color: #ffffff;
  border: 1px dashed #ffffff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.1s ease;
}

.btn-mode-switch:hover {
  background: #ffffff;
  color: #000000;
}

/* Tech Icon Buttons (Console Style) */
.btn-icon-tech {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  color: #ffffff;
  border: 1px dashed #ffffff;
  cursor: pointer;
  font-family: var(--font-mono);
  font-weight: bold;
  font-size: 0.8rem;
  transition: all 0.1s ease;
}

.btn-icon-tech svg {
  stroke: #ffffff;
}

.btn-icon-tech:hover {
  background: #ffffff;
  color: #000000;
}

.btn-icon-tech:hover svg {
  stroke: #000000;
}

.btn-icon-tech.active {
  background: #ffffff;
  color: #000000;
  border: 1px dashed #ffffff;
}

.btn-icon-tech.active svg {
  stroke: #000000;
}

.btn-icon-tech:active,
.btn-mode-switch:active {
  transform: translate(1px, 1px);
}

/* ==========================================================================
   MAIN 2-COLUMN DASHBOARD (EXPAND TO FIT VIEWPORT)
   ========================================================================== */

.main-dashboard {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 0.65rem;
  flex: 1;
  min-height: 0; /* Crucial for inner scroll containers */
}

/* ==========================================================================
   RESPONSIVE VIEW SWITCHER TABS & CONTROLS (TUI RETRO THEME)
   ========================================================================== */

.responsive-view-switcher {
  display: none;
  width: 100%;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  box-sizing: border-box;
}

.view-tab-btn {
  flex: 1;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: #000000;
  color: #ffffff;
  border: 2px dashed #ffffff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0 0.5rem;
  box-sizing: border-box;
}

.view-tab-btn svg {
  stroke: #ffffff;
  flex-shrink: 0;
}

.view-tab-btn:hover {
  background: #1a1a1a;
}

.view-tab-btn.active {
  background: #ffffff;
  color: #000000;
  font-weight: 800;
  box-shadow: 2px 2px 0px #ffffff;
}

.view-tab-btn.active svg {
  stroke: #000000;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 1px dashed currentColor;
  font-size: 0.68rem;
  font-weight: 800;
}

.tab-badge-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ff0055;
  box-shadow: 0 0 6px #ff0055;
  animation: tabBlink 1s infinite alternate;
}

@keyframes tabBlink {
  0% { opacity: 0.3; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.2); }
}

/* Stack Quick Start Banner */
.stack-quick-start-banner {
  display: none;
  width: 100%;
  margin-bottom: 0.5rem;
}

.btn-stack-start-action {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #ffffff;
  color: #000000;
  border: 2px solid #ffffff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 3px 3px 0px #555555;
  transition: transform 0.1s, box-shadow 0.1s;
}

.btn-stack-start-action:hover {
  background: #dddddd;
}

.btn-stack-start-action:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px #555555;
}

.btn-stack-start-action svg {
  fill: #000000;
}

/* Mobile Quick Switch in HUD */
.hud-mobile-footer {
  display: none;
  width: 100%;
  justify-content: center;
  margin-top: 0.35rem;
}

.btn-hud-view-stack {
  width: 100%;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: #000000;
  color: #ffffff;
  border: 1px dashed #ffffff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.btn-hud-view-stack svg {
  stroke: #ffffff;
}

.btn-hud-view-stack:hover {
  background: #222222;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (TABLET & MOBILE <= 900PX)
   ========================================================================== */

@media (max-width: 900px) {
  html, body {
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-wrapper {
    height: auto;
    min-height: 100dvh;
    max-height: none;
    padding: 0.45rem;
    gap: 0.6rem;
    box-sizing: border-box;
  }

  .main-dashboard {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    flex: 1;
    min-height: 0;
    gap: 0.65rem;
  }

  .responsive-view-switcher {
    display: none !important;
  }

  .timer-hud-panel {
    display: flex !important;
    width: 100%;
    flex: none;
    min-height: auto;
    padding: 0.85rem 0.65rem;
  }

  .stack-panel {
    display: flex !important;
    width: 100%;
    flex: 1;
    min-height: 380px;
  }

  /* Impressive fluid countdown graphic */
  .timer-radial-container {
    width: min(340px, 86vw);
    max-width: 360px;
    height: auto;
    max-height: none;
    aspect-ratio: 1 / 1;
    margin: 0.4rem auto;
    flex-shrink: 0;
  }

  .timer-digits-display {
    font-size: clamp(2.8rem, 10vw, 3.8rem);
  }

  .timer-block-title {
    font-size: 1rem;
    max-width: 240px;
  }

  .timer-controls-group {
    width: 100%;
    max-width: 380px;
  }

  .hud-secondary-toolbar {
    width: 100%;
    max-width: 380px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
  }

  .toolbar-toggle-group {
    flex-wrap: wrap;
    justify-content: center;
  }

  .app-header {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .brand-title-group h1 {
    font-size: 1.15rem;
  }

  .shortcuts-footer {
    display: none;
  }
}

/* ==========================================================================
   LEFT COLUMN: RETRO TIMER HUD / CONSOLE DISPLAY
   ========================================================================== */

.timer-hud-panel {
  background: #000000;
  border: 2px dashed #ffffff;
  padding: 0.85rem 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  gap: 0.45rem;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}

/* Panel Corner ASCII Anchor */
.timer-hud-panel::before {
  content: "+--[ TIMER.EXE ]--+";
  position: absolute;
  top: -0.55rem;
  left: 50%;
  transform: translateX(-50%);
  background: #000000;
  padding: 0 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffffff;
  white-space: nowrap;
}

/* Status Banner */
.hud-status-banner {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed #ffffff;
  font-size: 0.76rem;
  flex-shrink: 0;
}

.sequence-badge {
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
  border: 1px dashed #ffffff;
  padding: 0.15rem 0.45rem;
  background: #000000;
}

.state-badge {
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.45rem;
  border: 1px dashed #ffffff;
  background: #000000;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.state-badge .status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: #ffffff;
}

/* Running State - Inverted Flash */
.timer-hud-panel[data-state="running"] .state-badge {
  background: #ffffff;
  color: #000000;
  animation: consolePulse 1.5s infinite;
}
.timer-hud-panel[data-state="running"] .state-badge .status-dot {
  background-color: #000000;
}

/* Paused State */
.timer-hud-panel[data-state="paused"] .state-badge {
  border-style: dotted;
}

@keyframes consolePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* ==========================================================================
   RADIAL & CONSOLE TIMER DISPLAY (ENLARGED & WELL SPACED)
   ========================================================================== */

.timer-radial-container {
  position: relative;
  width: clamp(310px, 28vw, 400px);
  max-width: 95%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.25rem auto;
  border: 1px dashed #ffffff;
  background: #000000;
  flex-shrink: 0;
  box-sizing: border-box;
}

.timer-radial-container::before {
  content: "[ GAUGE ]";
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 0.62rem;
  color: var(--c-dim);
}

.timer-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

/* SVG Elements in Retro Mode */
.radial-track {
  fill: none;
  stroke: #222222;
  stroke-width: 14;
  stroke-dasharray: 4 4;
}

.radial-ticks {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
  stroke-dasharray: 2 8;
  opacity: 0.45;
}

.radial-progress {
  fill: none;
  stroke: #ffffff !important;
  stroke-width: 16;
  stroke-linecap: square;
  stroke-dasharray: 8 4;
  transition: stroke-dashoffset 0.1s linear;
}

/* Inside Radial Content */
.radial-center-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.35rem;
  width: 72%;
  max-width: 250px;
  box-sizing: border-box;
  pointer-events: none;
  gap: 0.15rem;
  transform: translateY(-2px);
}

.timer-block-title {
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #ffffff;
  text-transform: uppercase;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  line-height: 1.2;
}

.timer-digits-display {
  font-size: clamp(3rem, 4.8vw, 4.2rem);
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1;
  color: #ffffff;
  margin: 0.1rem 0 0.25rem 0;
  font-variant-numeric: tabular-nums;
  text-shadow: none;
}

.timer-sub-metrics {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--c-dim);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.2;
  margin: 0;
  max-width: 220px;
}

.timer-sub-metrics .highlight {
  color: #ffffff;
  font-weight: 800;
  border: 1px dashed #ffffff;
  padding: 0.05rem 0.3rem;
  background: #000000;
}

/* ==========================================================================
   LINEAR PROGRESS BAR (COMPACT)
   ========================================================================== */

.hud-linear-progress {
  width: 100%;
  height: 10px;
  background: #000000;
  border: 1px dashed #ffffff;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.hud-linear-bar {
  height: 100%;
  width: 100%;
  background: #ffffff;
  transform-origin: left center;
  transform: scaleX(1);
  transition: transform 0.1s linear;
}

/* Description (Compact) */
.timer-block-description {
  font-size: 0.78rem;
  color: var(--c-fg);
  text-align: center;
  max-width: 480px;
  line-height: 1.3;
  border: 1px dashed #ffffff;
  padding: 0.25rem 0.55rem;
  width: 100%;
  background: #000000;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timer-block-description::before {
  content: "INFO: ";
  font-weight: bold;
  color: var(--c-dim);
}

/* ==========================================================================
   TACTILE CONTROL BUTTONS (COMPACT)
   ========================================================================== */

.timer-controls-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  flex-shrink: 0;
}

.btn-primary-action {
  flex: 1;
  max-width: 200px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #ffffff;
  color: #000000;
  border: 2px dashed #ffffff;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.1s ease;
}

.btn-primary-action svg {
  fill: #000000;
  width: 16px;
  height: 16px;
}

.btn-primary-action:hover {
  background: #000000;
  color: #ffffff;
  border: 2px dashed #ffffff;
}

.btn-primary-action:hover svg {
  fill: #ffffff;
}

.btn-primary-action:active {
  transform: translate(1px, 1px);
}

/* Secondary Action Button (Reset) */
.btn-secondary-action {
  height: 40px;
  padding: 0 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: #000000;
  color: #ffffff;
  border: 2px dashed #ffffff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.1s ease;
}

.btn-secondary-action svg {
  stroke: #ffffff;
  width: 15px;
  height: 15px;
}

.btn-secondary-action:hover {
  background: #ffffff;
  color: #000000;
}

.btn-secondary-action:hover svg {
  stroke: #000000;
}

.btn-secondary-action:active {
  transform: translate(1px, 1px);
}

/* ==========================================================================
   SECONDARY TOOLBAR (COMPACT)
   ========================================================================== */

.hud-secondary-toolbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.35rem;
  border-top: 1px dashed #ffffff;
  gap: 0.45rem;
  flex-shrink: 0;
}

.nav-step-group {
  display: flex;
  gap: 0.35rem;
}

.btn-nav-step {
  height: 30px;
  width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  color: #ffffff;
  border: 1px dashed #ffffff;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: all 0.1s ease;
}

.btn-nav-step svg {
  stroke: #ffffff;
}

.btn-nav-step:hover:not(:disabled) {
  background: #ffffff;
  color: #000000;
}

.btn-nav-step:hover:not(:disabled) svg {
  stroke: #000000;
}

.btn-nav-step:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  border-style: dotted;
}

.toolbar-toggle-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tech-toggle-btn {
  height: 30px;
  padding: 0 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #000000;
  color: #ffffff;
  border: 1px dashed #ffffff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.1s ease;
}

.tech-toggle-btn svg {
  stroke: #ffffff;
}

.tech-toggle-btn:hover {
  background: #222222;
}

.tech-toggle-btn.active {
  background: #ffffff;
  color: #000000;
  font-weight: 800;
}

.tech-toggle-btn.active svg {
  stroke: #000000;
}

/* ==========================================================================
   RIGHT COLUMN: REORDERABLE BLOCK STACK PANEL (FLEX SCROLL CONTAINER)
   ========================================================================== */

.stack-panel {
  background: #000000;
  border: 2px dashed #ffffff;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: relative;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}

.stack-panel::before {
  content: "+--[ STACK.DAT ]--+";
  position: absolute;
  top: -0.55rem;
  left: 50%;
  transform: translateX(-50%);
  background: #000000;
  padding: 0 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffffff;
  white-space: nowrap;
}

.stack-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed #ffffff;
  gap: 0.5rem;
  flex-shrink: 0;
}

.stack-title-wrap h2 {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.stack-title-wrap h2 svg {
  stroke: #ffffff !important;
}

.stack-metrics-total {
  font-size: 0.7rem;
  color: var(--c-dim);
  font-weight: 600;
}

.stack-metrics-total span {
  color: #ffffff;
  font-weight: 800;
}

.btn-add-block {
  height: 30px;
  padding: 0 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #ffffff;
  color: #000000;
  border: 1px dashed #ffffff;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.1s ease;
}

.btn-add-block svg {
  stroke: #000000;
}

.btn-add-block:hover {
  background: #000000;
  color: #ffffff;
  border: 1px dashed #ffffff;
}

.btn-add-block:hover svg {
  stroke: #ffffff;
}

/* Stack Tools Sub-bar */
.stack-quick-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.3rem;
  border-bottom: 1px dotted #ffffff;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.stack-tools-left {
  display: flex;
  gap: 0.35rem;
}

.btn-text-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #000000;
  color: #ffffff;
  border: 1px dashed #ffffff;
  padding: 0.2rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.1s ease;
}

.btn-text-tool svg {
  stroke: #ffffff;
}

.btn-text-tool:hover {
  background: #ffffff;
  color: #000000;
}

.btn-text-tool:hover svg {
  stroke: #000000;
}

/* ==========================================================================
   BLOCK ITEM CARDS (FLEXIBLE VERTICAL STACK LIST)
   ========================================================================== */

.block-stack-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.block-item-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.65rem;
  background: #000000;
  border: 1px dashed #ffffff;
  cursor: grab;
  position: relative;
  transition: all 0.1s ease;
  user-select: none;
  flex-shrink: 0;
}

.block-item-card:hover {
  border: 1px solid #ffffff;
  background: #111111;
}

/* Active Running Card */
.block-item-card.is-active {
  background: #ffffff;
  color: #000000;
  border: 2px dashed #ffffff;
}

.block-item-card.is-active .card-index,
.block-item-card.is-active .card-title,
.block-item-card.is-active .card-desc,
.block-item-card.is-active .card-duration-badge {
  color: #000000;
}

.block-item-card.is-active .card-drag-handle svg,
.block-item-card.is-active .btn-card-action svg {
  stroke: #000000;
  fill: none;
}

.block-item-card.is-active .btn-card-action.btn-play-card svg {
  fill: #000000;
  stroke: none;
}

.block-item-card.is-active .btn-card-action {
  border-color: #000000;
  background: #ffffff;
  color: #000000;
}

.block-item-card.is-active .btn-card-action:hover {
  background: #000000;
  color: #ffffff;
}

.block-item-card.is-active .btn-card-action:hover svg {
  stroke: #ffffff;
}
.block-item-card.is-active .btn-card-action.btn-play-card:hover svg {
  fill: #ffffff;
}

/* Completed Card */
.block-item-card.is-completed {
  opacity: 0.55;
  border-style: dotted;
}

.block-item-card.is-completed .card-title {
  text-decoration: line-through;
}

/* Dragging state */
.block-item-card.is-dragging {
  opacity: 0.35;
  border: 2px dashed #ffffff;
}

.block-item-card.drag-over {
  border-top: 3px solid #ffffff;
}

/* Card Drag Handle */
.card-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  padding: 0.1rem;
}

.card-drag-handle svg {
  width: 14px;
  height: 14px;
  stroke: #ffffff;
}

/* Card Index */
.card-index {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--c-dim);
  width: 18px;
}

/* Card Content */
.card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.card-color-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: #ffffff !important;
  box-shadow: none !important;
  border: 1px solid #000000;
}

.block-item-card:not(.is-active) .card-color-dot {
  background-color: #ffffff !important;
  border: 1px solid #ffffff;
}

.card-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.card-desc {
  font-size: 0.7rem;
  color: var(--c-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Card Duration Badge */
.card-duration-badge {
  font-size: 0.74rem;
  font-weight: 800;
  border: 1px dashed currentColor;
  padding: 0.15rem 0.35rem;
  color: #ffffff;
  white-space: nowrap;
}

/* Card Action Buttons */
.card-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-card-action {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  border: 1px dashed #ffffff;
  color: #ffffff;
  cursor: pointer;
  padding: 0;
  transition: all 0.1s ease;
}

.btn-card-action svg {
  width: 12px;
  height: 12px;
  stroke: #ffffff;
}

.btn-card-action.btn-play-card svg {
  fill: #ffffff;
  stroke: none;
}

.btn-card-action:hover {
  background: #ffffff;
  color: #000000;
}

.btn-card-action:hover svg {
  stroke: #000000;
}

.btn-card-action.btn-play-card:hover svg {
  fill: #000000;
}

/* Empty State */
.stack-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  border: 1px dashed #ffffff;
  text-align: center;
  gap: 0.5rem;
}

.stack-empty-state svg {
  width: 28px;
  height: 28px;
  stroke: #ffffff;
}

/* ==========================================================================
   FOOTER SHORTCUTS (COMPACT, ALWAYS VISIBLE IN VIEWPORT)
   ========================================================================== */

.shortcuts-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  padding: 0.3rem 0.75rem;
  background: #000000;
  border: 2px dashed #ffffff;
  font-size: 0.72rem;
  text-transform: uppercase;
  flex-shrink: 0;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--c-fg);
}

.kbd-badge {
  background: #ffffff;
  color: #000000;
  font-weight: 900;
  padding: 0.1rem 0.35rem;
  border: 1px solid #000000;
  font-size: 0.68rem;
}

/* ==========================================================================
   RETRO MODALS & DIALOGS
   ========================================================================== */

dialog {
  background: #000000 !important;
  color: #ffffff !important;
  border: 2px dashed #ffffff !important;
  padding: 0;
  max-width: 500px;
  width: calc(100% - 2rem);
  margin: auto;
  position: fixed;
  inset: 0;
  font-family: var(--font-mono);
  box-shadow: none !important;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: none;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px dashed #ffffff;
}

.modal-header h3 {
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-close-modal {
  background: #000000;
  border: 1px dashed #ffffff;
  color: #ffffff;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-close-modal:hover {
  background: #ffffff;
  color: #000000;
}

.btn-close-modal svg {
  stroke: currentColor;
}

.modal-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 65vh;
  overflow-y: auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--c-fg);
}

.input-cyber {
  width: 100%;
  padding: 0.5rem 0.65rem;
  background: #000000;
  color: #ffffff;
  border: 1px dashed #ffffff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  outline: none;
}

.input-cyber:focus {
  background: #111111;
  border: 1px solid #ffffff;
}

textarea.input-cyber {
  min-height: 60px;
  resize: vertical;
}

.duration-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}

.time-unit-box {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.time-unit-box span {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--c-dim);
}

.preset-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.chip-btn {
  background: #000000;
  color: #ffffff;
  border: 1px dashed #ffffff;
  padding: 0.25rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s ease;
}

.chip-btn:hover {
  background: #ffffff;
  color: #000000;
}

/* Color picker in retro mode */
.color-picker-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.color-option-radio {
  cursor: pointer;
}

.color-option-radio input {
  display: none;
}

.color-option-radio .color-swatch {
  display: inline-block;
  width: 26px;
  height: 26px;
  border: 1px dashed #ffffff;
  background: #000000 !important;
  color: #ffffff;
  position: relative;
}

.color-option-radio input:checked + .color-swatch {
  background: #ffffff !important;
  border: 2px solid #ffffff;
}

.color-option-radio input:checked + .color-swatch::after {
  content: "X";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #000000;
  font-weight: 900;
  font-size: 0.8rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px dashed #ffffff;
}

.btn-modal-cancel {
  padding: 0.45rem 1rem;
  background: #000000;
  color: #ffffff;
  border: 1px dashed #ffffff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.btn-modal-cancel:hover {
  background: #222222;
}

.btn-modal-submit {
  padding: 0.45rem 1.25rem;
  background: #ffffff;
  color: #000000;
  border: 1px dashed #ffffff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.btn-modal-submit:hover {
  background: #000000;
  color: #ffffff;
}

/* ==========================================================================
   TEMPLATES & SETTINGS MODAL STYLES
   ========================================================================= */

.template-grid {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.template-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  background: #000000;
  border: 1px dashed #ffffff;
  cursor: pointer;
  transition: all 0.1s ease;
}

.template-card:hover {
  background: #ffffff;
  color: #000000;
}

.template-card:hover .template-info h4,
.template-card:hover .template-info p,
.template-card:hover .template-info div {
  color: #000000 !important;
}

.template-card:hover .btn-secondary-action {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

.template-info h4 {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
}

.template-info p {
  font-size: 0.72rem;
  color: var(--c-dim);
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px dashed #ffffff;
  gap: 0.75rem;
}

.setting-label-group h4 {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.setting-label-group p {
  font-size: 0.68rem;
  color: var(--c-dim);
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #000000;
  border: 1px dashed #ffffff;
  transition: 0.1s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.1s;
}

input:checked + .slider {
  background-color: #ffffff;
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: #000000;
}

/* Cyber Range in Retro Mode */
.cyber-range {
  -webkit-appearance: none;
  width: 100px;
  height: 6px;
  background: #000000;
  border: 1px dashed #ffffff;
  outline: none;
}

.cyber-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #ffffff;
  cursor: pointer;
  border: 1px solid #000000;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toast {
  background: #000000;
  color: #ffffff;
  border: 2px dashed #ffffff;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 3px 3px 0px #ffffff;
}

.toast svg {
  stroke: #ffffff !important;
  width: 14px;
  height: 14px;
}

.toast::before {
  content: ">>>";
  font-weight: 900;
  color: #ffffff;
}
