:root {
  color-scheme: dark;
  --bg: #0d1112;
  --panel: #151c1d;
  --panel-2: #1b2526;
  --field: #101617;
  --ink: #f5f8f6;
  --soft-ink: #c5d0cc;
  --muted: #91a29d;
  --line: #2b3a39;
  --teal: #5bc0d2;
  --amber: #f0bf61;
  --coral: #df725f;
  --green: #95bf70;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(91, 192, 210, 0.13), transparent 34%),
    linear-gradient(180deg, #0a0d0e 0%, var(--bg) 100%);
  font-family: "Segoe UI", system-ui, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  width: min(1040px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 22px 0 40px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand p,
.brand-line,
.clock span,
.question span,
.entry-row label span,
.now-card span,
.command-grid span,
.timeline span {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.brand-line {
  margin-top: 10px;
  color: var(--amber);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.brand-logo {
  flex: 0 0 82px;
  width: 82px;
  height: 82px;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35));
}

.clock {
  min-width: 152px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 28, 29, 0.82);
  text-align: right;
}

.clock strong {
  display: block;
  font-size: 1.85rem;
  line-height: 1;
}

.guide-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 28, 29, 0.94);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
}

.step-tab {
  min-height: 68px;
  border: 0;
  color: var(--muted);
  background: #101617;
  font-weight: 900;
}

.step-tab span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-right: 7px;
  border-radius: 50%;
  color: var(--bg);
  background: var(--muted);
}

.step-tab.is-active {
  color: var(--ink);
  background: var(--panel-2);
}

.step-tab.is-active span {
  background: var(--amber);
}

.step-panel {
  display: none;
  min-height: 430px;
  padding: clamp(20px, 4vw, 42px);
}

.step-panel.is-active {
  display: block;
}

.question {
  max-width: 700px;
  margin-bottom: 22px;
}

.question h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.75rem, 5vw, 3.55rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.question p {
  max-width: 620px;
  margin: 0;
  color: var(--soft-ink);
  font-size: 1.06rem;
  line-height: 1.45;
}

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

.guard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 8px;
}

label small {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

input {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--field);
}

input:focus {
  outline: 3px solid rgba(91, 192, 210, 0.22);
  border-color: var(--teal);
}

.entry-list {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.entry-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(210px, 0.72fr) 46px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.entry-row.fixed {
  grid-template-columns: minmax(180px, 1fr) 112px 112px 46px;
}

.duration-field {
  display: grid;
  gap: 8px;
}

.duration-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.duration-buttons button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--field);
  font-weight: 900;
}

.duration-buttons button.is-selected {
  color: #071012;
  background: var(--amber);
  border-color: var(--amber);
}

.icon-button,
.add-button,
.primary-button,
.secondary-button {
  border: 0;
  border-radius: 8px;
  font-weight: 950;
}

.icon-button {
  width: 46px;
  height: 54px;
  color: #0b1112;
  background: var(--coral);
}

.add-button {
  min-height: 50px;
  padding: 0 16px;
  color: #071012;
  background: var(--teal);
}

.now-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 14px;
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.now-card.is-alerting {
  animation: alertPulse 0.85s ease-in-out 6;
  border-color: var(--amber);
}

.alert-banner {
  display: none;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(240, 191, 97, 0.76);
  border-radius: 8px;
  background: rgba(240, 191, 97, 0.12);
}

.alert-banner.is-visible {
  display: block;
}

.alert-banner.is-alerting {
  animation: alertPulse 0.85s ease-in-out 6;
}

.alert-banner span {
  display: block;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.alert-banner strong {
  display: block;
  margin-top: 5px;
  font-size: 1.2rem;
}

.alert-banner p {
  margin: 4px 0 0;
  color: var(--soft-ink);
}

.now-card strong {
  display: block;
  margin: 8px 0;
  font-size: clamp(1.45rem, 3vw, 2.4rem);
  line-height: 1.05;
}

.now-card p {
  margin: 0;
  color: var(--soft-ink);
  line-height: 1.42;
}

.now-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.now-stats div {
  min-height: 88px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}

.now-stats strong {
  margin: 6px 0 0;
  font-size: 1rem;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.command-grid div {
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}

.command-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 1.02rem;
  line-height: 1.25;
}

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

.timeline-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 7px solid var(--teal);
  border-radius: 8px;
  background: var(--field);
}

.timeline-item.is-fixed {
  border-left-color: var(--coral);
}

.timeline-item.is-current {
  outline: 3px solid rgba(240, 191, 97, 0.35);
}

.timeline-item.is-alerting {
  animation: alertPulse 0.85s ease-in-out 6;
}

@keyframes alertPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(240, 191, 97, 0.3);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(240, 191, 97, 0.14);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(240, 191, 97, 0);
  }
}

.timeline-time {
  flex: 0 0 132px;
  color: var(--muted);
  font-weight: 900;
}

.timeline strong {
  display: block;
}

.timeline span {
  margin-top: 3px;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #101617;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  padding: 0 18px;
}

.primary-button {
  min-width: 150px;
  color: #071012;
  background: var(--amber);
}

.secondary-button {
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
}

@media (max-width: 820px) {
  .top-bar,
  .now-card {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .clock {
    text-align: left;
  }

  .simple-grid,
  .guard-grid,
  .command-grid,
  .now-stats {
    grid-template-columns: 1fr;
  }

  .entry-row,
  .entry-row.fixed {
    grid-template-columns: 1fr 46px;
  }

  .entry-row label,
  .entry-row .duration-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100vw - 18px, 1040px);
    padding-top: 12px;
  }

  .brand-logo {
    flex-basis: 62px;
    width: 62px;
    height: 62px;
  }

  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .step-tab {
    min-height: 56px;
  }

  .step-panel {
    min-height: 0;
    padding: 20px;
  }

  .entry-row,
  .entry-row.fixed {
    grid-template-columns: 1fr 46px;
  }

  .entry-row label {
    grid-column: 1 / -1;
  }

  .entry-row .icon-button {
    grid-column: 2;
  }

  .timeline-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .timeline-time {
    flex-basis: auto;
  }

  .actions {
    flex-wrap: wrap;
  }

  .primary-button {
    flex: 1 0 100%;
    order: -1;
  }
}
