:root {
  --bg: #0b0c10;
  --panel: #121522;
  --panel2: #0f1118;
  --border: #262b42;
  --text: #e7e9ee;
  --muted: rgba(231, 233, 238, 0.78);
  --muted2: rgba(231, 233, 238, 0.62);

  --radius: 18px;
  --radius2: 22px;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
  --shadow2: 0 8px 18px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(1200px 700px at 25% -10%, rgba(95, 115, 255, 0.18), transparent 55%),
              radial-gradient(900px 600px at 90% 0%, rgba(40, 220, 180, 0.10), transparent 60%),
              var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px;
}

header.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 6px 0 14px;
}

header.topbar h1 {
  font-size: 22px;
  margin: 0;
  letter-spacing: 0.2px;
}

header.topbar .sub {
  font-size: 13px;
  color: var(--muted2);
}

.layout {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 14px;
  align-items: start;
}

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

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%),
              var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow2);
}

.card h2 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(231, 233, 238, 0.88);
}

.sectionHint {
  margin-top: -6px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted2);
}

.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: rgba(231, 233, 238, 0.9);
}

input,
select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(38, 43, 66, 0.9);
  background: rgba(15, 17, 24, 0.92);
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(95, 115, 255, 0.85);
  box-shadow: 0 0 0 3px rgba(95, 115, 255, 0.18);
}

small {
  color: var(--muted2);
  line-height: 1.35;
}

.row {
  grid-column: span 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(38, 43, 66, 0.9);
  background: rgba(15, 17, 24, 0.5);
}

@media (max-width: 900px) {
  .row {
    grid-column: span 2;
  }
}

@media (max-width: 520px) {
  .row {
    grid-column: span 1;
  }
}

.row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.buttons {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

button {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(38, 43, 66, 0.95);
  background: rgba(27, 31, 47, 0.96);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.06s ease, background 0.2s ease, border-color 0.2s ease;
}

button:hover {
  background: rgba(34, 39, 62, 0.98);
  border-color: rgba(95, 115, 255, 0.45);
}

button:active {
  transform: translateY(1px);
}

button.primary {
  background: rgba(95, 115, 255, 0.25);
  border-color: rgba(95, 115, 255, 0.45);
}

button.primary:hover {
  background: rgba(95, 115, 255, 0.32);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.timerHero {
  border-radius: var(--radius2);
  padding: 18px;
  border: 1px solid rgba(95, 115, 255, 0.30);
  background:
    radial-gradient(600px 280px at 10% 10%, rgba(95, 115, 255, 0.22), transparent 60%),
    radial-gradient(600px 280px at 90% 0%, rgba(40, 220, 180, 0.12), transparent 60%),
    rgba(15, 17, 24, 0.7);
  box-shadow: var(--shadow);
}

.timer {
  display: grid;
  gap: 10px;
}

.timerTop {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.phase {
  font-size: 13px;
  color: var(--muted2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.count {
  font-size: 62px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.0;
}

@media (max-width: 520px) {
  .count {
    font-size: 52px;
  }
}

.current {
  font-size: 18px;
  font-weight: 650;
}

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

kbd.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(231, 233, 238, 0.06);
  border: 1px solid rgba(231, 233, 238, 0.10);
  color: var(--muted);
  font-size: 12px;
}

.planMeta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.planList {
  margin: 0;
  padding-left: 18px;
}

.planList li {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 17, 24, 0.86);
  border: 1px solid rgba(38, 43, 66, 0.9);
}

.planList li.active {
  border-color: rgba(95, 115, 255, 0.6);
  background: linear-gradient(
      180deg,
      rgba(95, 115, 255, 0.18),
      rgba(15, 17, 24, 0.9)
  );
  box-shadow: 0 0 0 3px rgba(95, 115, 255, 0.14);
}

.planList li.done {
  opacity: 0.55;
}

.planList {
  list-style-position: outside;
  padding-left: 28px;   /* room for 2–3 digit numbers */
}

.planList li {
  overflow: visible;    /* important */
}


/* Plan scroll container so page doesn't jump */
#planWrap {
  max-height: 46vh;           /* adjust to taste */
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;         /* space for scrollbar */
  scroll-behavior: smooth;
}

/* On small screens, give it less height */
@media (max-width: 980px) {
  #planWrap {
    max-height: 34vh;
  }
}


hr.sep {
  border: 0;
  border-top: 1px solid rgba(38, 43, 66, 0.9);
  margin: 14px 0;
}

.stickyTimer {
  position: sticky;
  top: 12px;
}

@media (max-width: 900px) {
  .stickyTimer {
    position: static;
  }
}

.overallProgress {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.overallProgressLabel {
  font-size: 12px;
  color: var(--muted2);
}

progress#overallProgress {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(231, 233, 238, 0.08);
  border: 1px solid rgba(38, 43, 66, 0.9);
}

/* WebKit */
progress#overallProgress::-webkit-progress-bar {
  background: rgba(231, 233, 238, 0.08);
}
progress#overallProgress::-webkit-progress-value {
  background: rgba(95, 115, 255, 0.55);
  border-radius: 999px;
}

/* Firefox */
progress#overallProgress::-moz-progress-bar {
  background: rgba(95, 115, 255, 0.55);
  border-radius: 999px;
}


/* ---------- Shell layout ---------- */
.shell {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 14px;
  align-items: start;
}

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

/* ---------- Drawer ---------- */
.drawer {
  position: sticky;
  top: 12px;
  align-self: start;
  border-radius: var(--radius);
  border: 1px solid rgba(38, 43, 66, 0.9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%), var(--panel);
  box-shadow: var(--shadow2);
  overflow: hidden;
}

.drawerHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(38, 43, 66, 0.75);
  background: rgba(15, 17, 24, 0.35);
}

.drawerTitle .kicker {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: 4px;
}

.titleRow {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.drawerTitle .title {
  font-size: 18px;
  font-weight: 750;
}

.drawerTitle .summary {
  font-size: 12px;
  color: var(--muted2);
}

.drawerToggle {
  padding: 8px 10px;
  border-radius: 12px;
}

/* inner card has no extra border, because drawer already has one */
.cardInner {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 14px;
}

.drawerBody {
  max-height: calc(100vh - 92px);
  overflow: auto;
}

/* Collapsed state */
.drawer.closed .drawerBody {
  display: none;
}

.drawer.closed .drawerToggle {
  background: rgba(231, 233, 238, 0.06);
}

/* ---------- Mobile: turn drawer into a bottom sheet ---------- */
@media (max-width: 980px) {
  .drawer {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    top: auto;
    z-index: 1000;
    max-height: 86vh;
    transform: translateY(0);
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .drawer.closed {
    transform: translateY(calc(100% - 58px));
    opacity: 0.98;
  }

  .drawerBody {
    max-height: calc(86vh - 58px);
  }

  /* prevent content being hidden behind the sheet */
  .main {
    padding-bottom: 90px;
  }
}

/* ---------- Timer header row ---------- */
.timerHeaderRow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.timerSub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted2);
}

.timerHeaderButtons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Plan collapse ---------- */
.planHeaderRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#planWrap.collapsed {
  display: none;
}

/* ---------- Hint row ---------- */
.hintRow {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(38, 43, 66, 0.9);
  background: rgba(15, 17, 24, 0.5);
  color: var(--muted2);
  font-size: 13px;
}
