:root {
  color-scheme: dark;
  --bg: #0d1b2a;
  --text: #e6edf7;
  --muted: #9db0c8;
  --placeholder: rgba(230, 237, 247, 0.58);
  --border: rgba(255, 255, 255, 0.12);
  --border-2: rgba(255, 255, 255, 0.18);
  --danger: #fb7185;
  --shadow: 0 24px 70px rgba(8, 24, 44, 0.34);
  --shadow-2: 0 12px 30px rgba(15, 23, 42, 0.22);
  --ring: rgba(14, 116, 144, 0.45);
  --ring-2: rgba(59, 130, 246, 0.28);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 16px;
  --r-pill: 999px;
  --primary: #0f766e;
  --primaryHover: #0d5f59;
  --accent-purple: #1d4ed8;
  --accent-purple-2: #2563eb;
  --accent-orange: #d97706;
  --accent-cyan: #0891b2;
  --accent-blue: #2563eb;
  --accent-yellow: #eab308;
  --cover-image: none;
  --cover-brightness: 1.02;
  --cover-contrast: 1.08;
  --bg-gradient: radial-gradient(
    1200px 760px at 15% 8%,
    rgba(37, 99, 235, 0.18) 0%,
    rgba(8, 145, 178, 0.12) 34%,
    rgba(13, 27, 42, 0.08) 58%
  ),
  radial-gradient(
    980px 680px at 85% 12%,
    rgba(234, 179, 8, 0.14) 0%,
    rgba(14, 116, 144, 0.08) 30%,
    rgba(13, 27, 42, 0.02) 62%
  ),
  linear-gradient(180deg, #081523 0%, #10233a 46%, #0b1726 100%);
  --header-bg: rgba(255, 255, 255, 0.84);
  --header-border: rgba(148, 163, 184, 0.2);
  --header-shine: linear-gradient(90deg, rgba(37, 99, 235, 0.12), rgba(8, 145, 178, 0.08), rgba(234, 179, 8, 0.1));
  --glass-1: rgba(255, 255, 255, 0.06);
  --glass-2: rgba(255, 255, 255, 0.08);
  --glass-3: rgba(255, 255, 255, 0.12);
  --glass-4: rgba(255, 255, 255, 0.18);
  --surface-1: rgba(11, 23, 38, 0.72);
  --surface-2: rgba(11, 28, 46, 0.82);
  --surface-3: rgba(10, 25, 42, 0.9);
  --cover-overlay: linear-gradient(180deg, rgba(7, 18, 31, 0.16), rgba(8, 20, 35, 0.44));
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f9fd;
  --text: #162235;
  --muted: #5a6f8d;
  --placeholder: rgba(36, 59, 85, 0.48);
  --border: rgba(148, 163, 184, 0.18);
  --border-2: rgba(148, 163, 184, 0.26);
  --danger: #be123c;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  --shadow-2: 0 12px 30px rgba(15, 23, 42, 0.1);
  --ring: rgba(14, 116, 144, 0.26);
  --ring-2: rgba(37, 99, 235, 0.18);
  --primary: #0f766e;
  --primaryHover: #0d5f59;
  --header-bg: rgba(255, 255, 255, 0.86);
  --header-border: rgba(148, 163, 184, 0.22);
  --header-shine: linear-gradient(90deg, rgba(37, 99, 235, 0.1), rgba(8, 145, 178, 0.08), rgba(234, 179, 8, 0.1));
  --glass-1: rgba(255, 255, 255, 0.42);
  --glass-2: rgba(255, 255, 255, 0.54);
  --glass-3: rgba(255, 255, 255, 0.68);
  --glass-4: rgba(255, 255, 255, 0.8);
  --surface-1: rgba(255, 255, 255, 0.9);
  --surface-2: rgba(255, 255, 255, 0.95);
  --surface-3: rgba(255, 255, 255, 0.98);
  --cover-overlay: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(243, 247, 251, 0.42));
  --cover-brightness: 0.97;
  --cover-contrast: 1.18;
  --bg-gradient: radial-gradient(
    980px 760px at 10% 0%,
    rgba(37, 99, 235, 0.12) 0%,
    rgba(245, 249, 253, 0.12) 44%
  ),
  radial-gradient(
    900px 680px at 90% 8%,
    rgba(8, 145, 178, 0.12) 0%,
    rgba(250, 252, 255, 0.12) 38%
  ),
  linear-gradient(180deg, #f7fbff 0%, #f3f8fc 42%, #edf4fa 100%);
}

* {
  box-sizing: border-box;
}

[tabindex="-1"]:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

html,
body {
  padding: 0;
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Zoho Puvi", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: calc(var(--vh, 1vh) * 100);
  min-height: 100vh;
  background: var(--bg-gradient);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

body.loginLocked header.header,
body.loginLocked main.main {
  filter: blur(6px);
  opacity: 0.35;
}

.loginGate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.55);
}

.loginCard {
  width: min(520px, calc(100vw - 24px));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: rgba(15, 26, 46, 0.98);
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}

.loginTitle {
  font-weight: 800;
  font-size: 16px;
}

/* cover image (keep full page + improve visibility without opacity) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: var(--cover-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(var(--cover-brightness)) contrast(var(--cover-contrast));
  transform: translateZ(0);
  z-index: 0;
}

/* extra readability over the drawing background (kept transparent by default) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: var(--cover-overlay);
  z-index: 0;
}

body > *:not(.balloonBg):not(.celebrate) {
  position: relative;
  z-index: 3;
}

.celebrate {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.balloon {
  position: absolute;
  bottom: -120px;
  width: 38px;
  height: 48px;
  border-radius: 50% 50% 48% 48%;
  opacity: 0.55;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.35));
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.55), rgba(125, 211, 252, 0.35) 28%, rgba(56, 189, 248, 0.22) 60%, rgba(2, 132, 199, 0.14) 100%);
  transform: translate3d(0, 0, 0);
  animation: balloonUp var(--dur, 18s) linear infinite;
}

.balloon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 10px;
  height: 8px;
  transform: translateX(-50%);
  background: rgba(230, 237, 247, 0.25);
  border-radius: 0 0 10px 10px;
}

.balloon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 64px;
  transform: translateX(-50%);
  background: rgba(230, 237, 247, 0.18);
}

@keyframes balloonUp {
  0% {
    transform: translate3d(0, 0, 0) rotate(-2deg);
    opacity: 0;
  }
  6% {
    opacity: 0.55;
  }
  100% {
    transform: translate3d(var(--drift, 40px), -120vh, 0) rotate(6deg);
    opacity: 0;
  }
}

.b1 { left: 6%;  --dur: 22s; --drift: 34px; animation-delay: -2s; }
.b2 { left: 18%; --dur: 18s; --drift: -28px; animation-delay: -10s; }
.b3 { left: 48%; --dur: 26s; --drift: 52px; animation-delay: -6s; opacity: 0.42; }
.b4 { left: 72%; --dur: 20s; --drift: -46px; animation-delay: -14s; }
.b5 { left: 88%; --dur: 24s; --drift: 26px; animation-delay: -8s; opacity: 0.38; }

.cracker {
  position: absolute;
  top: 18px;
  width: 68px;
  height: 16px;
  border-radius: 999px;
  opacity: 0.7;
  background: linear-gradient(90deg, rgba(125, 211, 252, 0.15), rgba(230, 237, 247, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.14);
  transform-origin: center;
  animation: crackerWiggle 4.4s ease-in-out infinite;
}

.cracker::before,
.cracker::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: rgba(230, 237, 247, 0.22);
}

.cracker::before { left: 6px; }
.cracker::after { right: 6px; }

.c1 { left: 14px; transform: rotate(-12deg); }
.c2 { right: 14px; transform: rotate(12deg); }

@keyframes crackerWiggle {
  0%, 72%, 100% { transform: rotate(var(--base, -10deg)) scale(1); }
  78% { transform: rotate(calc(var(--base, -10deg) - 10deg)) scale(1.02); }
  86% { transform: rotate(calc(var(--base, -10deg) + 16deg)) scale(1.03); }
  92% { transform: rotate(var(--base, -10deg)) scale(1); }
}
.c1 { --base: -12deg; }
.c2 { --base: 12deg; }

.sparkBurst {
  position: absolute;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0;
  background: rgba(125, 211, 252, 0.9);
  box-shadow:
    14px -10px 0 rgba(230, 237, 247, 0.8),
    22px 6px 0 rgba(125, 211, 252, 0.75),
    -14px -8px 0 rgba(230, 237, 247, 0.55),
    -22px 8px 0 rgba(125, 211, 252, 0.6),
    0 22px 0 rgba(230, 237, 247, 0.55);
  animation: sparkBurst 4.4s ease-in-out infinite;
}

.s1 { left: 64px; }
.s2 { right: 64px; animation-delay: 0.2s; }

@keyframes sparkBurst {
  0%, 70% {
    transform: scale(0.6);
    opacity: 0;
    filter: blur(0px);
  }
  78% {
    transform: scale(1.1);
    opacity: 0.55;
    filter: blur(0px);
  }
  84% {
    transform: scale(1.6);
    opacity: 0.85;
    filter: blur(0.2px);
  }
  92% {
    transform: scale(2.2);
    opacity: 0;
    filter: blur(0.6px);
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .celebrate {
    display: none;
  }

  .tab,
  .btn,
  .field,
  .rowActions {
    transition: none !important;
  }

  dialog[open],
  dialog[open]::backdrop {
    animation: none !important;
  }
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 20px;
}

main.container {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: none;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

.topbarInner {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logoWrap {
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.topbar .logo {
  height: 28px;
  width: auto;
  display: block;
  border-radius: 10px;
}

html[data-theme="light"] .topbar .logo {
  /* The bundled logo is white; invert it for light header background. */
  filter: invert(1) brightness(0.2);
}

.tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.04);
}

.tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: background 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease);
}

.tab:hover {
  background: var(--glass-3);
}

.tabActive {
  color: #ffffff;
  border-color: rgba(109, 94, 252, 0.75);
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-2));
  box-shadow: 0 10px 22px rgba(109, 94, 252, 0.25);
}

.tab:active {
  transform: translateY(1px);
}

.field {
  width: 100%;
  padding: 10px 12px;
  background: var(--glass-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease);
}

.fieldSearch {
  flex: 1 1 auto;
  min-width: 260px;
  border-radius: var(--r-pill);
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.06);
}

.field::placeholder {
  color: var(--placeholder);
}

.field:focus {
  outline: none;
}

.field:focus-visible {
  border-color: rgba(125, 211, 252, 0.6);
  box-shadow: 0 0 0 4px rgba(43, 102, 217, 0.18);
}

.btn {
  border: 1px solid var(--border);
  background: var(--glass-3);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: background 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease);
}

.btn:hover {
  background: var(--glass-4);
  border-color: rgba(125, 211, 252, 0.32);
}

.btn:active {
  transform: translateY(1px);
}

.btnSmall {
  padding: 6px 10px;
  height: 30px;
  font-size: 12px;
  border-radius: var(--r-sm);
}

dialog#layoutModal::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

dialog#layoutModal {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  width: min(720px, calc(100vw - 24px));
  background: var(--surface-3);
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog#adminsModal::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

dialog#adminsModal {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  width: min(720px, calc(100vw - 24px));
  background: var(--surface-3);
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog textarea.field {
  min-height: 140px;
  resize: vertical;
}

.iconBtn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  border-radius: 999px;
}

.topbarMeta {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  white-space: nowrap;
  font-size: 13px;
}

.metaItem {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--text);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.dotDev {
  background: var(--accent-orange);
}

.dotDesign {
  background: var(--accent-purple);
}

.btnPrimary {
  border-color: rgba(43, 102, 217, 0.95);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(43, 102, 217, 0.28);
}

.btnPrimary:hover {
  background: var(--primaryHover);
  box-shadow: 0 12px 28px rgba(43, 102, 217, 0.35);
}

.btnDanger {
  border-color: rgba(251, 113, 133, 0.5);
  background: rgba(251, 113, 133, 0.12);
}

.pageHeader {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 10px 2px 18px;
}

.pageHeader .titleBlock {
  gap: 6px;
  padding-left: 16px;
  border-left: 4px solid var(--accent-purple);
}

.headerActions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.chipIcon {
  opacity: 0.8;
}

.btnIcon {
  margin-right: 8px;
  opacity: 0.9;
}

.btnGhost {
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="light"] .btnGhost {
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.phaseGrid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  min-height: 0;
}

.phaseGrid.singleSection {
  grid-template-rows: 1fr;
}

.titleBlock {
  display: grid;
  gap: 2px;
}

.title {
  font-weight: 750;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.error {
  margin-top: 12px;
  color: var(--danger);
}

.empty {
  padding: 18px 2px;
}

.phaseSection {
  margin-top: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-1);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
  box-shadow: var(--shadow-2);
}

.phaseHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.phaseMeta {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.phaseIcon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  flex: 0 0 auto;
}

.phaseIconDev {
  background: var(--accent-orange);
}

.phaseIconDesign {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-2));
}

.phaseInfo {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.phaseTitle {
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 12px;
  color: var(--muted);
}

.phaseCount {
  font-size: 13px;
  color: var(--muted);
}

.phaseHeaderActions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.featureList {
  list-style: none;
  padding: 10px 12px 14px;
  margin: 0;
  display: block;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.featureRow {
  height: 40px;
  padding: 0 6px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.featureRow:not(:last-child) {
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.featureRow:hover {
  background: rgba(125, 211, 252, 0.05);
  border-radius: 12px;
}

.rowSelect {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-left: 2px;
  accent-color: var(--primary);
}

.featureList.selectOn .featureRow {
  gap: 8px;
}

.featureRow.draggable {
  cursor: grab;
}

.featureRow.draggable.dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.featureName {
  font-size: 14px;
  font-weight: 450;
  line-height: 40px;
  color: inherit;
  text-decoration: none;
  display: inline-block;
  position: relative;
  padding-left: 22px;
  padding-right: 120px; /* space for hover actions */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.featureName[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.featureName::before {
  content: "›";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  font-size: 18px;
  color: rgba(148, 163, 184, 0.85);
  opacity: 1;
}

.featureList.reorderOn .featureName::before {
  content: "";
  background: url("./assets/drag-handle.svg") no-repeat center / contain;
  opacity: 0.95;
}

.featureName:hover {
  text-decoration: underline;
  text-decoration-color: rgba(125, 211, 252, 0.7);
  text-underline-offset: 4px;
}

.featureNameBtn {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.rowActions {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms var(--ease), transform 160ms var(--ease);
}

.rowActions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 1px 6px;
  height: 24px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.featureRow:hover .rowActions {
  opacity: 1;
  transform: translateY(-50%) translateX(-2px);
  pointer-events: auto;
}

body.kbdNav .featureRow:focus-within .rowActions {
  opacity: 1;
  transform: translateY(-50%) translateX(-2px);
  pointer-events: auto;
}

/* inner kanban boxes removed; outer phase box is enough */

dialog {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0;
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  color: var(--text);
  box-shadow: var(--shadow);
  width: min(860px, calc(100vw - 24px));
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

dialog[open] {
  animation: dialogIn 180ms var(--ease);
}

dialog[open]::backdrop {
  animation: backdropIn 180ms var(--ease);
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modalHeader {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.modalTitle {
  font-weight: 700;
}

.modalBody {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.modalFooter {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.moduleFieldRow,
.moduleEditorRow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.moduleFieldRow .field,
.moduleEditorRow .field {
  flex: 1 1 auto;
  min-width: 0;
}

.moduleManager {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  display: grid;
  gap: 12px;
}

.moduleManager[hidden] {
  display: none;
}

.moduleManagerHead,
.moduleItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.moduleList {
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
}

.moduleItem {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.08);
}

.moduleItemName {
  font-size: 14px;
  color: var(--text);
}

.moduleItemActions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: color-mix(in srgb, var(--text) 82%, var(--accent-blue) 18%);
}

dialog .label {
  line-height: 1.35;
}

dialog .field {
  line-height: 1.4;
  padding-top: 12px;
  padding-bottom: 12px;
}

.historyTableWrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: auto;
  max-height: min(62vh, 560px);
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .historyTableWrap {
  background: rgba(255, 255, 255, 0.03);
}

.historyTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.historyTable th,
.historyTable td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.historyTable th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-weight: 700;
  color: var(--muted);
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
}

.historyTable tr:last-child td {
  border-bottom: 0;
}

.historyTime {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.historyAdmin {
  white-space: nowrap;
}

.historyAction {
  font-weight: 700;
}

.historyDetails {
  color: var(--muted);
  word-break: break-word;
}

.alignEnd {
  align-content: end;
}

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

.carousel {
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  gap: 10px;
  align-items: center;
}

.carouselImgWrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  height: min(60vh, 520px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.carouselImgWrap img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.carouselImgWrap img.naturalPreview {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: initial;
}

.thumbRow {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 10px 2px 2px;
}

.thumb {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.thumbActive {
  border-color: rgba(125, 211, 252, 0.6);
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.18) inset;
}

.thumb img {
  width: 86px;
  height: 52px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

@media (max-width: 860px) {
  .topbarInner {
    flex-wrap: wrap;
  }

  .fieldSearch {
    flex-basis: 100%;
    order: 3;
  }

  .topbarMeta {
    order: 4;
    width: 100%;
    justify-content: flex-end;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .carousel {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 980px) {
  .phaseGrid {
    grid-template-columns: 540px 540px;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    justify-content: center;
  }

  .phaseGrid.singleSection {
    grid-template-columns: minmax(0, 1100px);
  }

  .phaseGrid.singleSection.twoCol .featureList {
    display: grid;
    align-content: start;
    grid-template-columns: 1fr 1fr;
    column-gap: 14px;
    row-gap: 0;
  }
}

/* ------------------------------------------------------------
   ui-showcase.html template styles (public/admin showcase pages)
   ------------------------------------------------------------ */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: var(--cover-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: var(--cover-opacity, 0.18);
  z-index: -2;
}

/* Optional tint overlay (kept subtle; adjust if needed). */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: var(--cover-tint, transparent);
  z-index: -1;
}

body {
  min-height: 100vh;
  background: #f5f6fa;
  font-family: "Zoho Puvi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1a1d23;
  transition: background 0.4s, color 0.4s;
  overflow-x: hidden;
  --layout-max: 1100px;
  --cover-opacity: 0.28;
  --cover-tint: rgba(245, 246, 250, 0.18);
}

html[data-theme="dark"] body {
  background: #0d0f14;
  color: #e8eaf0;
  --cover-opacity: 0.38;
  --cover-tint: rgba(0, 0, 0, 0.14);
}

/* ------------------------------------------------------------
   Colorful balloon background (non-interactive)
   ------------------------------------------------------------ */
.balloonBg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
  opacity: 1;
}

body.balloonsOff .balloonBg {
  display: none;
}

body[data-page="admin"] .balloonBg {
  display: none;
}

.gasBalloon {
  position: absolute;
  left: var(--x, 50%);
  bottom: -22vh;
  width: var(--size, 82px);
  height: calc(var(--size, 82px) * 1.28);
  animation: balloonFly var(--dur, 18s) linear infinite;
  animation-delay: var(--delay, 0s);
  filter: drop-shadow(0 18px 24px rgba(15, 23, 42, 0.18));
  will-change: transform;
  opacity: var(--alpha, 0.9);
}

.gasBalloonInner {
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 48% 48% / 56% 56% 44% 44%;
  background: radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 36%),
    radial-gradient(circle at 35% 30%, hsla(var(--h, 230), 96%, 76%, 0.92), hsla(var(--h, 230), 85%, 54%, 0.88) 62%, hsla(var(--h, 230), 80%, 42%, 0.92));
  box-shadow:
    inset 0 -16px 22px rgba(0, 0, 0, 0.14),
    inset 0 10px 18px rgba(255, 255, 255, 0.22),
    0 12px 24px rgba(37, 99, 235, 0.12);
  animation: balloonBob var(--bob, 3.6s) ease-in-out infinite;
}

.gasBalloon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% - 6px);
  width: 2px;
  height: calc(var(--size, 82px) * 0.95);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), rgba(17, 24, 39, 0.18));
  transform: translateX(-50%);
  opacity: 0.55;
}

.gasBalloon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%) rotate(-6deg);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: calc(var(--size, 82px) * 0.14);
  white-space: nowrap;
  color: rgba(9, 15, 28, 0.72);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(6px);
}

html[data-theme="dark"] .gasBalloon::after {
  color: rgba(255, 255, 255, 0.82);
  background: rgba(0, 0, 0, 0.28);
  border-color: rgba(255, 255, 255, 0.16);
}

@keyframes balloonFly {
  0% {
    transform: translate3d(0, 18vh, 0) rotate(calc(var(--rot, -6deg))) scale(var(--scale, 1));
    opacity: 0;
  }
  8% { opacity: var(--alpha, 0.9); }
  50% {
    transform: translate3d(calc(var(--drift, 0) * 0.55vw), -72vh, 0) rotate(calc(var(--rot, -6deg) + 5deg)) scale(var(--scale, 1));
    opacity: var(--alpha, 0.9);
  }
  100% {
    transform: translate3d(calc(var(--drift, 0) * 1vw), -150vh, 0) rotate(calc(var(--rot, -6deg) + 10deg)) scale(var(--scale, 1));
    opacity: 0;
  }
}

@keyframes balloonBob {
  0%, 100% { transform: translateY(0) rotate(1deg); }
  50% { transform: translateY(-10px) rotate(-1deg); }
}

.gb1 { --x: 8%;  --size: 78px; --h: 258; --drift: 4;  --dur: 20s; --delay: -6s; --bob: 3.8s; --scale: 0.95; --rot: -8deg; }
.gb2 { --x: 18%; --size: 92px; --h: 200; --drift: -2; --dur: 24s; --delay: -14s; --bob: 4.4s; --scale: 1.05; --rot: -4deg; --alpha: 0.88; }
.gb3 { --x: 30%; --size: 70px; --h: 145; --drift: 2;  --dur: 19s; --delay: -10s; --bob: 3.2s; --scale: 0.9;  --rot: -10deg; --alpha: 0.72; }
.gb4 { --x: 42%; --size: 104px;--h: 24;  --drift: -5; --dur: 26s; --delay: -18s; --bob: 4.8s; --scale: 1.12; --rot: -2deg; --alpha: 0.84; }
.gb5 { --x: 55%; --size: 82px; --h: 320; --drift: 3;  --dur: 22s; --delay: -9s;  --bob: 3.9s; --scale: 1.0;  --rot: -7deg; --alpha: 0.82; }
.gb6 { --x: 66%; --size: 96px; --h: 285; --drift: -3; --dur: 25s; --delay: -21s; --bob: 4.6s; --scale: 1.08; --rot: -3deg; --alpha: 0.86; }
.gb7 { --x: 76%; --size: 74px; --h: 96;  --drift: 5;  --dur: 21s; --delay: -12s; --bob: 3.4s; --scale: 0.92; --rot: -11deg; --alpha: 0.78; }
.gb8 { --x: 86%; --size: 110px;--h: 210; --drift: -4; --dur: 28s; --delay: -16s; --bob: 5.1s; --scale: 1.18; --rot: -1deg; --alpha: 0.8; }
.gb9 { --x: 94%; --size: 66px; --h: 12;  --drift: -1; --dur: 18s; --delay: -5s;  --bob: 3.0s; --scale: 0.86; --rot: -12deg; --alpha: 0.7; }
.gb10{ --x: 4%;  --size: 58px; --h: 180; --drift: 6;  --dur: 17s; --delay: -8s;  --bob: 2.9s; --scale: 0.82; --rot: -14deg; --alpha: 0.66; }
.gb11{ --x: 12%; --size: 64px; --h: 338; --drift: 7;  --dur: 16s; --delay: -11s; --bob: 2.8s; --scale: 0.84; --rot: -9deg;  --alpha: 0.68; }
.gb12{ --x: 38%; --size: 88px; --h: 188; --drift: -6; --dur: 23s; --delay: -4s;  --bob: 4.1s; --scale: 1.02; --rot: -5deg;  --alpha: 0.8; }
.gb13{ --x: 62%; --size: 72px; --h: 42;  --drift: 4;  --dur: 20s; --delay: -15s; --bob: 3.5s; --scale: 0.9;  --rot: -8deg;  --alpha: 0.74; }
.gb14{ --x: 90%; --size: 84px; --h: 220; --drift: -7; --dur: 27s; --delay: -19s; --bob: 4.9s; --scale: 1.06; --rot: -2deg;  --alpha: 0.82; }

@media (prefers-reduced-motion: reduce) {
  .gasBalloon { animation: none !important; }
  .gasBalloonInner { animation: none !important; }
  .gb1 { bottom: 6vh; }
  .gb2 { bottom: 12vh; }
  .gb3 { bottom: 18vh; }
  .gb4 { bottom: 24vh; }
  .gb5 { bottom: 30vh; }
  .gb6 { bottom: 10vh; }
  .gb7 { bottom: 16vh; }
  .gb8 { bottom: 22vh; }
  .gb9 { bottom: 28vh; }
  .gb10 { bottom: 34vh; }
}

/* blobs removed */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background:
    var(--header-shine),
    var(--header-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--header-border);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
  transition: background 0.4s, border-color 0.4s;
}

html[data-theme="dark"] .header {
  background:
    var(--header-shine),
    rgba(12, 26, 42, 0.82);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.header-inner {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0 20px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.logoImgFull {
  height: 38px;
  width: auto;
  display: block;
}

/* Keep logo colors identical in light/dark by rendering it on a subtle dark pill. */
.logo {
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.92);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .logo {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

html[data-theme="dark"] .logo {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

/* Swap logo asset by theme. */
.logoImgLight {
  display: none;
}

html[data-theme="light"] .logoImgDark {
  display: none;
}

html[data-theme="light"] .logoImgLight {
  display: block;
}

.toggle-group {
  display: flex;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: background 0.3s;
}

html[data-theme="dark"] .toggle-group {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.toggle-btn {
  padding: 7px 18px;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: #52657f;
  transition: all 0.2s;
}

.toggle-btn:hover {
  color: #17324d;
  background: rgba(255, 255, 255, 0.34);
}

.toggle-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--accent-blue) 60%, #3b82f6);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24);
}

html[data-theme="dark"] .toggle-btn { color: rgba(255, 255, 255, 0.45); }
html[data-theme="dark"] .toggle-btn:hover { color: rgba(255, 255, 255, 0.85); }
html[data-theme="dark"] .toggle-btn.active { color: #fff; }

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 380px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.58);
  color: #17324d;
  outline: none;
  transition: all 0.2s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.search-input::placeholder { color: #9ca3af; }

.search-input:focus {
  background: #fff;
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

html[data-theme="dark"] .search-input {
  background: rgba(255, 255, 255, 0.1);
  color: #e8eaf0;
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .search-input::placeholder { color: rgba(255, 255, 255, 0.28); }

html[data-theme="dark"] .search-input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(8, 145, 178, 0.36);
  box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.14);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.stats {
  display: flex;
  gap: 14px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
}

html[data-theme="dark"] .stat-item { color: rgba(255, 255, 255, 0.38); }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-amber { background: #f59e0b; }
.dot-indigo { background: #6366f1; }

.icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.56);
  color: #2563eb;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.82);
  color: #0f766e;
}

/* Keep public/admin header alignment identical (public reserves admin-only slot). */
.adminActionSlot {
  width: 108px;
  height: 36px;
  border-radius: 10px;
  visibility: hidden;
  flex: 0 0 auto;
}

html[data-theme="dark"] .icon-btn {
  background: rgba(255, 255, 255, 0.09);
  color: #fbbf24;
}

html[data-theme="dark"] .icon-btn:hover { background: rgba(255, 255, 255, 0.14); }

.main {
  position: relative;
  z-index: 1;
  max-width: var(--layout-max);
  margin: 20px auto 0;
  padding: 0 20px 40px;
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  box-sizing: border-box;
}

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(232, 243, 252, 0.72));
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
}

html[data-theme="dark"] .page-title-row {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.84));
  border-color: rgba(96, 165, 250, 0.18);
  box-shadow: 0 16px 36px rgba(2, 6, 23, 0.28);
}

.page-title-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.title-bar {
  width: 8px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-blue), var(--primary), var(--accent-orange));
  flex-shrink: 0;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  color: #18314b;
  line-height: 1.2;
  margin: 0;
}

.page-subtitle {
  font-size: 13px;
  color: #5d7390;
  margin-top: 2px;
  margin-bottom: 0;
}

html[data-theme="dark"] .page-title { color: #f1f5f9; }
html[data-theme="dark"] .page-subtitle { color: rgba(255, 255, 255, 0.38); }

.page-title-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.refresh-btn.active,
html[data-theme="dark"] .refresh-btn.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(8, 145, 178, 0.12));
  border-color: rgba(37, 99, 235, 0.34);
  color: #0f3f75;
}

html[data-theme="dark"] .refresh-btn.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.24), rgba(8, 145, 178, 0.2));
  border-color: rgba(125, 211, 252, 0.36);
  color: #ffffff;
}

.total-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: #214463;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(239, 246, 255, 0.82));
  border: 1px solid rgba(148, 163, 184, 0.28);
  white-space: nowrap;
}

html[data-theme="dark"] .total-badge {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(8, 145, 178, 0.16));
  border-color: rgba(96, 165, 250, 0.22);
  color: rgba(255, 255, 255, 0.92);
}

.totalNum {
  font-weight: 700;
  color: inherit;
}

.totalLabel {
  opacity: 0.8;
}

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 1.5px solid rgba(148, 163, 184, 0.26);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.88));
  font-size: 13px;
  font-weight: 700;
  color: #214463;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.08);
}

.refresh-btn:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(236, 252, 255, 0.92));
  border-color: rgba(37, 99, 235, 0.3);
  color: #17324d;
}

html[data-theme="dark"] .refresh-btn {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.9));
  border-color: rgba(96, 165, 250, 0.22);
  color: #f8fafc;
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.28);
}

html[data-theme="dark"] .refresh-btn:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.24), rgba(8, 145, 178, 0.2));
  border-color: rgba(125, 211, 252, 0.34);
  color: #ffffff;
}

#bulkDeleteBtn {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}

#bulkDeleteBtn:hover {
  background: #ffe4e6;
  border-color: #fda4af;
  color: #9f1239;
}

html[data-theme="dark"] #bulkDeleteBtn {
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.28);
  color: rgba(255, 228, 230, 0.92);
}

html[data-theme="dark"] #bulkDeleteBtn:hover {
  background: rgba(248, 113, 113, 0.22);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  min-height: 0;
}

.grid.phaseGrid {
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  justify-content: center;
}

.grid.phaseGrid.singleSection {
  grid-template-columns: 1fr;
}

@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr; }
}

@media (min-width: 980px) {
  .grid.phaseGrid {
    grid-template-columns: minmax(0, 540px) minmax(0, 540px);
  }

  .grid.phaseGrid.singleSection {
    grid-template-columns: minmax(0, 1100px);
  }
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 24px;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 20px 38px rgba(15, 23, 42, 0.08);
  transition: background 0.3s, border-color 0.3s;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

html[data-theme="dark"] .card {
  background: linear-gradient(180deg, rgba(12, 28, 44, 0.94), rgba(10, 22, 35, 0.96));
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 50px rgba(5, 12, 22, 0.34);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  justify-content: flex-start;
  text-align: left;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.94));
}

html[data-theme="dark"] .card-header { border-bottom-color: rgba(255, 255, 255, 0.08); }

html[data-theme="dark"] .card-header {
  background: linear-gradient(135deg, rgba(15, 38, 61, 0.9), rgba(8, 145, 178, 0.12));
}

.card-header-amber { border-top: 4px solid var(--accent-orange); }
.card-header-indigo { border-top: 4px solid var(--accent-blue); }

.card-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon-amber { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; box-shadow: 0 10px 22px rgba(217, 119, 6, 0.24); }
.card-icon-indigo { background: linear-gradient(135deg, #2563eb, #0891b2); color: #fff; box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22); }

.card-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9ca3af;
  margin: 0;
}

.phaseTitle {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #111827;
  text-align: left;
}

html[data-theme="dark"] .phaseTitle {
  color: #f1f5f9;
}

.phaseInfo {
  text-align: left;
}

.phaseHeaderActions {
  margin-left: auto;
}

.card-count {
  font-size: 13px;
  color: #6b7280;
  margin-top: 1px;
  margin-bottom: 0;
}

html[data-theme="dark"] .card-label { color: rgba(255, 255, 255, 0.38); }
html[data-theme="dark"] .card-count { color: rgba(255, 255, 255, 0.5); }

.feature-list {
  list-style: none;
  padding: 8px;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}

.module-group-heading {
  list-style: none;
  margin: 10px 8px 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(8, 145, 178, 0.08));
  border: 1px solid rgba(37, 99, 235, 0.12);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1d4ed8;
}

html[data-theme="dark"] .module-group-heading {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(8, 145, 178, 0.14));
  border-color: rgba(125, 211, 252, 0.18);
  color: #bfdbfe;
}

/* Override legacy list styles (we keep the class for JS hooks). */
.featureList {
  list-style: none;
  padding: 8px;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

html[data-theme="dark"] .feature-list { scrollbar-color: rgba(255, 255, 255, 0.12) transparent; }

.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  transition: background 0.15s;
  list-style: none;
  position: relative;
  border: 1px solid transparent;
}

.featureRow.feature-item {
  height: auto;
  margin: 0;
  border-bottom: 0;
  padding-right: 96px; /* reserve space for row actions */
  font-size: 16px;
}

.rowActions {
  position: absolute;
  right: 12px;
  top: 50%;
  margin-left: 0;
  height: 32px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 140ms ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: center;
}

.feature-item:hover .rowActions,
body.kbdNav .feature-item:focus-within .rowActions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%);
}

.rowActions .btn {
  padding: 6px 10px;
  height: auto;
  border-radius: 10px;
  font-size: 12px;
}

.actionBtn {
  width: 32px;
  height: 32px;
  padding: 0;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: rgba(255, 255, 255, 0.8);
  color: rgba(17, 24, 39, 0.75);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 0;
  flex: 0 0 auto;
}

.actionBtn svg {
  display: block;
  transform: none;
}

.actionBtn:hover {
  border-color: rgba(99, 102, 241, 0.4);
  color: #4338ca;
  background: #eef2ff;
}

.actionBtnDanger {
  border-color: rgba(244, 63, 94, 0.25);
  color: rgba(190, 18, 60, 0.9);
  background: rgba(255, 241, 242, 0.9);
}

.actionBtnDanger:hover {
  border-color: rgba(244, 63, 94, 0.45);
  background: #ffe4e6;
  color: rgba(190, 18, 60, 1);
}

html[data-theme="dark"] .actionBtn {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
}

html[data-theme="dark"] .actionBtn:hover {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.16);
  color: #e0e7ff;
}

html[data-theme="dark"] .actionBtnDanger {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.14);
  color: rgba(255, 228, 230, 0.92);
}

html[data-theme="dark"] .actionBtnDanger:hover {
  background: rgba(248, 113, 113, 0.22);
}

.feature-item:hover {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(240, 249, 255, 0.96));
  border-color: rgba(37, 99, 235, 0.16);
}
html[data-theme="dark"] .feature-item:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(8, 145, 178, 0.1));
  border-color: rgba(255, 255, 255, 0.08);
}

.chevron {
  flex-shrink: 0;
  color: #9ca3af;
  transition: color 0.15s, transform 0.15s;
}

.feature-item:hover .chevron { color: var(--primary); transform: translateX(2px); }

html[data-theme="dark"] .chevron {
  color: rgba(255, 255, 255, 0.42);
}

.featureRow.draggable .chevron {
  color: rgba(17, 24, 39, 0.55);
  cursor: grab;
}

.featureRow.draggable:hover .chevron {
  color: rgba(17, 24, 39, 0.72);
  transform: none;
}

.featureRow.draggable:active .chevron {
  cursor: grabbing;
}

html[data-theme="dark"] .featureRow.draggable .chevron {
  color: rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .featureRow.draggable:hover .chevron {
  color: rgba(255, 255, 255, 0.75);
  transform: none;
}

.feature-name {
  flex: 1;
  font-size: 16px;
  color: #111827;
  transition: color 0.15s;
  text-decoration: none;
}

.feature-item:hover .feature-name { color: #1d4ed8; }
html[data-theme="dark"] .feature-name { color: rgba(255, 255, 255, 0.65); }
html[data-theme="dark"] .feature-item:hover .feature-name { color: #bfdbfe; }

.build-number {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

html[data-theme="dark"] .build-number {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(30, 64, 175, 0.24);
  color: #bfdbfe;
}

/* NEW badge removed */

.empty-state {
  text-align: center;
  padding: 18px 8px;
  font-size: 13px;
  color: #d1d5db;
}

html[data-theme="dark"] .empty-state { color: rgba(255, 255, 255, 0.22); }

.footer {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: rgba(76, 99, 126, 0.82);
}

html[data-theme="dark"] .footer { color: rgba(255, 255, 255, 0.18); }

@media (max-width: 640px) {
  .stats { display: none; }
  .header-inner { gap: 10px; }
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"],
input[type="number"],
select,
textarea {
  border: 1px solid #ced3dd;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.72);
}

html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  border-color: #ced3dd;
}

html[data-theme="dark"] input[type="text"]:focus,
html[data-theme="dark"] input[type="email"]:focus,
html[data-theme="dark"] input[type="password"]:focus,
html[data-theme="dark"] input[type="url"]:focus,
html[data-theme="dark"] input[type="search"]:focus,
html[data-theme="dark"] input[type="number"]:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  border-color: rgba(8, 145, 178, 0.78);
}

dialog input[type="text"],
dialog input[type="email"],
dialog input[type="password"],
dialog input[type="url"],
dialog input[type="search"],
dialog input[type="number"],
dialog select,
dialog textarea,
.modal input[type="text"],
.modal input[type="email"],
.modal input[type="password"],
.modal input[type="url"],
.modal input[type="search"],
.modal input[type="number"],
.modal select,
.modal textarea,
form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="url"],
form input[type="search"],
form input[type="number"],
form select,
form textarea {
  border: 1px solid #ced3dd !important;
}

dialog input[type="text"]:focus,
dialog input[type="email"]:focus,
dialog input[type="password"]:focus,
dialog input[type="url"]:focus,
dialog input[type="search"]:focus,
dialog input[type="number"]:focus,
dialog select:focus,
dialog textarea:focus,
.modal input[type="text"]:focus,
.modal input[type="email"]:focus,
.modal input[type="password"]:focus,
.modal input[type="url"]:focus,
.modal input[type="search"]:focus,
.modal input[type="number"]:focus,
.modal select:focus,
.modal textarea:focus,
form input[type="text"]:focus,
form input[type="email"]:focus,
form input[type="password"]:focus,
form input[type="url"]:focus,
form input[type="search"]:focus,
form input[type="number"]:focus,
form select:focus,
form textarea:focus {
  border-color: rgba(37, 99, 235, 0.72) !important;
}

