:root {
  --navy: #12285a;
  --navy-deep: #0c1c42;
  --ink: #16213a;
  --subtle: #5c667a;
  --border: #e4e8f0;
  --grey-frame: #eef1f6;
  --blue: #155eef;
  --blue-soft: #e7efff;
  --green: #067647;
  --green-soft: #e3f7ec;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --shadow: 0 6px 18px rgba(18, 40, 90, 0.08);
  --pad-x: 24px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  min-height: 100vh;
}

img { display: block; max-width: 100%; }

/* ── Sticky shell: banner + past strip as one block ───────────── */
.sticky-shell {
  position: sticky;
  top: 0;
  z-index: 30;
}

/* Top banner: dark navy, slim */
.top-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px var(--pad-x);
  background: linear-gradient(90deg, var(--navy-deep), var(--navy));
  color: #fff;
}

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

.wordmark {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.brand-copy { line-height: 1.15; }

.product-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.product-subtitle {
  font-size: 0.78rem;
  color: #bcc8e6;
}

.clock-wrap {
  text-align: right;
  flex-shrink: 0;
  line-height: 1.2;
}

.clock-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  justify-content: flex-end;
}

.clock-day {
  font-size: 1.15rem;
  font-weight: 800;
}

.clock-datetime {
  font-size: 1rem;
  color: #dbe3f6;
  font-variant-numeric: tabular-nums;
}

.sync-status {
  font-size: 0.72rem;
  color: #93a4cf;
}

/* ── Past strip: light grey frame ─────────────────────────────── */
.past-strip-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--grey-frame);
  border-bottom: 1px solid var(--border);
  padding: 6px var(--pad-x);
}

.strip-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--subtle);
  flex-shrink: 0;
}

.past-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  min-width: 0;
}

.past-strip::-webkit-scrollbar { height: 6px; }
.past-strip::-webkit-scrollbar-thumb { background: #cbd3e1; border-radius: 999px; }

.empty-past {
  font-size: 0.8rem;
  color: var(--subtle);
  padding: 4px 0;
}

.past-card {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid #d6dce8;
  border-radius: 10px;
  background: #f7f8fb;
  filter: grayscale(100%);
  opacity: 0.85;
  line-height: 1.2;
}

.past-card img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.past-card .mini-title {
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.past-card .mini-meta {
  font-size: 0.68rem;
  color: #4a5568;
  white-space: nowrap;
}

/* ── Board ────────────────────────────────────────────────────── */
.board-main {
  padding: 16px var(--pad-x) 60vh;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  align-items: start;
}

.loading-card,
.empty-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 22px;
  color: var(--subtle);
  font-size: 1rem;
}

/* ── Tile ─────────────────────────────────────────────────────── */
.tile {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tile.now { border-color: #bfe3cf; }

.tile-media {
  position: relative;
  height: 110px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fd 100%);
  border-bottom: 1px solid var(--border);
}

.tile.now .tile-media {
  background: linear-gradient(180deg, #ffffff 0%, #eefaf3 100%);
}

.tile-media img {
  max-height: 96px;
  width: auto;
  object-fit: contain;
}

.badge {
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.badge.now { background: var(--green); color: #fff; }
.badge.soon { background: var(--blue-soft); color: var(--blue); }

.tile-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.teacher {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.12;
  color: var(--navy);
}

.pair-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.pair {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
}

.pair .k {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
}

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

.cart-chip {
  background: var(--navy);
  color: #ffd44d;
  border-radius: 10px;
  padding: 5px 14px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.device {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.add-row {
  background: var(--amber-soft);
  color: var(--amber);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.9rem;
  font-weight: 800;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 700px) {
  :root { --pad-x: 14px; }
  .wordmark { height: 34px; }
  .product-subtitle { display: none; }
  .clock-day { font-size: 1rem; }
  .clock-datetime { font-size: 0.85rem; }
  .cards-grid { grid-template-columns: 1fr; }
}
