:root {
  color-scheme: dark;
  --bg: #08131c;
  --panel: rgba(7, 24, 36, 0.86);
  --panel-strong: rgba(9, 36, 55, 0.96);
  --line: rgba(93, 203, 242, 0.65);
  --line-soft: rgba(93, 203, 242, 0.25);
  --text: #f8fbff;
  --muted: #b6c7d7;
  --cyan: #54d7ff;
  --red: #ff405d;
  --green: #31c878;
  --amber: #f08a22;
  --blue: #2985cf;
  --teal: #1aa7a6;
  --shadow: 0 16px 55px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(8, 50, 79, 0.55), rgba(6, 13, 23, 0.85)),
    radial-gradient(circle at 20% 0%, rgba(84, 215, 255, 0.23), transparent 32%),
    radial-gradient(circle at 84% 16%, rgba(240, 138, 34, 0.14), transparent 28%),
    #07111a;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(84, 215, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84, 215, 255, 0.08) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.74), transparent);
}

.app-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  min-width: 0;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.topbar > * {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--cyan);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 980px;
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.96;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
}

.time-panel {
  display: grid;
  min-width: 170px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow), inset 0 0 30px rgba(84, 215, 255, 0.09);
}

.time-label,
.time-panel span:last-child {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.time-panel strong {
  font-size: 2rem;
  line-height: 1.05;
}

.status-strip {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(7, 24, 36, 0.72);
  color: var(--muted);
  font-weight: 700;
}

#scheduleStatus {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 16px var(--green);
}

.layout-grid {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  min-width: 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow), inset 0 0 42px rgba(84, 215, 255, 0.08);
}

.baseline {
  position: sticky;
  top: 16px;
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
}

.panel-heading span,
.day-title span {
  color: var(--cyan);
  font-weight: 800;
}

.panel-heading strong,
.day-title {
  font-size: 1.45rem;
  font-weight: 950;
  text-transform: uppercase;
}

.table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}

th,
td {
  padding: 10px;
  border: 1px solid rgba(213, 236, 255, 0.32);
  vertical-align: middle;
}

th {
  background: rgba(20, 74, 113, 0.86);
  font-size: 0.92rem;
}

td {
  background: rgba(255, 255, 255, 0.04);
  color: #eef8ff;
  font-weight: 650;
}

tbody tr:nth-child(even) td {
  background: rgba(59, 134, 100, 0.18);
}

tr.is-today td {
  background: rgba(84, 215, 255, 0.16);
  box-shadow: inset 4px 0 0 var(--cyan);
}

.days-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  gap: 16px;
}

.day-card,
.rules {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px;
}

.day-card.is-today {
  border-color: #ffffff;
  box-shadow: var(--shadow), 0 0 0 2px rgba(84, 215, 255, 0.24), inset 0 0 40px rgba(84, 215, 255, 0.13);
}

.day-title {
  line-height: 1;
}

.task-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  min-height: 78px;
  padding: 13px;
  border: 2px solid var(--blue);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(41, 133, 207, 0.45), rgba(14, 32, 48, 0.82));
  box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.04);
}

.task-card strong {
  display: block;
  font-size: clamp(1rem, 1.2vw, 1.24rem);
  line-height: 1.1;
}

.task-card span {
  display: block;
  color: #e3edf6;
  font-weight: 650;
  line-height: 1.15;
}

.task-card time {
  justify-self: end;
  padding: 6px 8px;
  border: 1px solid var(--cyan);
  border-radius: 8px;
  color: #fff;
  font-size: 1.08rem;
  font-weight: 850;
  box-shadow: 0 0 16px rgba(84, 215, 255, 0.42);
}

.task-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  background-color: rgba(2, 10, 18, 0.54);
  background-image: url("assets/icons/generated-icon-reference.png");
  background-repeat: no-repeat;
  background-size: 300% 300%;
  box-shadow: inset 0 0 16px rgba(84, 215, 255, 0.12);
  color: transparent;
  overflow: hidden;
  text-indent: -999px;
}

.icon-calculator {
  background-position: 0% 0%;
}

.icon-headphones {
  background-position: 50% 0%;
}

.icon-book {
  background-position: 100% 0%;
}

.icon-checklist {
  background-position: 0% 50%;
}

.icon-clock {
  background-position: 50% 50%;
}

.icon-broom {
  background-position: 100% 50%;
}

.icon-shield {
  background-position: 0% 100%;
}

.icon-window {
  background-position: 50% 100%;
}

.icon-bolt {
  background-position: 100% 100%;
}

.task-kicker {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 950;
  line-height: 1.02;
  text-transform: uppercase;
}

.focus {
  grid-template-columns: auto 1fr auto;
  border-color: var(--red);
  background: linear-gradient(135deg, rgba(255, 64, 93, 0.28), rgba(42, 10, 29, 0.86));
  box-shadow: 0 0 18px rgba(255, 64, 93, 0.75), inset 0 0 20px rgba(255, 64, 93, 0.18);
}

.focus::after {
  position: absolute;
  top: 10px;
  right: 14px;
  color: #ffd25a;
  content: "!";
  font-size: 1.5rem;
  font-weight: 950;
  text-shadow: 0 0 12px rgba(255, 210, 90, 0.7);
}

.green {
  border-color: var(--green);
  background: linear-gradient(135deg, rgba(49, 200, 120, 0.46), rgba(9, 42, 40, 0.85));
}

.amber {
  border-color: var(--amber);
  background: linear-gradient(135deg, rgba(240, 138, 34, 0.5), rgba(49, 29, 13, 0.87));
}

.blue {
  border-color: var(--blue);
}

.teal {
  border-color: var(--teal);
  background: linear-gradient(135deg, rgba(26, 167, 166, 0.52), rgba(7, 43, 51, 0.86));
}

.priority::after {
  position: absolute;
  top: -11px;
  right: -9px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #ffd25a;
  color: #10131a;
  content: "2";
  font-weight: 950;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.task-card.is-current {
  transform: translateY(-2px);
  border-color: #fff;
  outline: 4px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 3px rgba(84, 215, 255, 0.5), 0 0 34px rgba(84, 215, 255, 0.8), inset 0 0 24px rgba(255, 255, 255, 0.16);
}

.task-card.is-next {
  outline: 2px dashed rgba(255, 210, 90, 0.7);
  outline-offset: 3px;
}

.rules {
  grid-row: span 2;
}

.rule-block {
  padding: 18px;
  border-left: 5px solid #f7d457;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.rule-block strong {
  display: block;
  color: #f7d457;
  font-size: 1.15rem;
}

.rule-block span {
  display: block;
  color: #f4f7fa;
  font-weight: 650;
}

.mini-reference {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mini-reference img {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

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

  .baseline {
    position: static;
  }

  .days-grid {
    grid-template-columns: repeat(2, minmax(250px, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .status-strip,
  .layout-grid,
  .panel {
    max-width: calc(100vw - 28px);
  }

  .topbar {
    display: grid;
  }

  h1 {
    font-size: clamp(1.4rem, 6.5vw, 1.7rem);
  }

  .time-panel {
    grid-template-columns: 1fr;
    align-items: start;
    min-width: 0;
    width: 100%;
  }

  .time-panel strong {
    min-width: 0;
    font-size: clamp(1.45rem, 7.6vw, 1.9rem);
    justify-self: start;
  }

  .time-panel span:last-child {
    grid-column: auto;
  }

  .status-strip {
    align-items: flex-start;
    font-size: 0.78rem;
    line-height: 1.25;
  }

  table {
    min-width: 0;
    table-layout: fixed;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 8px;
    padding: 0 12px 12px;
  }

  tr {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    border: 1px solid rgba(213, 236, 255, 0.24);
    border-radius: 8px;
    overflow: hidden;
  }

  th,
  td {
    padding: 8px 6px;
    font-size: 0.78rem;
    overflow-wrap: anywhere;
  }

  td {
    display: block;
    border: 0;
    background: rgba(255, 255, 255, 0.04);
  }

  td:first-child {
    display: grid;
    grid-row: 1 / 4;
    place-items: center;
    background: rgba(20, 74, 113, 0.86);
    font-size: 0.9rem;
  }

  td:not(:first-child)::before {
    display: block;
    margin-bottom: 2px;
    color: var(--cyan);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  td:nth-child(2)::before {
    content: "School";
  }

  td:nth-child(3)::before {
    content: "Fixed";
  }

  td:nth-child(4)::before {
    content: "Open";
  }

  .focus,
  .task-card {
    grid-template-columns: 1fr;
  }

  .task-card time {
    justify-self: start;
  }

  .days-grid {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    display: grid;
  }

  .task-card {
    min-height: 74px;
  }
}

@media (max-width: 430px) {
  .app-shell {
    padding: 10px;
  }

  .topbar,
  .status-strip,
  .layout-grid,
  .panel {
    max-width: calc(100vw - 20px);
  }

  h1 {
    font-size: 1.85rem;
  }

  .task-card {
    grid-template-columns: 1fr;
  }

  .task-icon {
    width: 42px;
    height: 42px;
  }

  .task-card time {
    justify-self: start;
  }
}
