:root {
  --bg: #eceae4;
  --panel: #fbfaf8;
  --panel-alt: #e9e3da;
  --text: #27231e;
  --accent: #bb4f00;
  --accent-soft: #bf7a4b;
  --success: #4f8f1e;
  --line: #cb936d;
  --line-soft: rgba(166, 107, 62, 0.18);
  --panel-glow: rgba(255, 255, 255, 0.7);
  --time-column-width: clamp(120px, 8.2vw, 156px);
}

:root[data-theme='dark'] {
  --bg: #090807;
  --panel: #11100e;
  --panel-alt: #0d0c0a;
  --text: #dddddd;
  --accent: #cc5a00;
  --accent-soft: #b5622b;
  --success: #4e9f11;
  --line: #8a3e0d;
  --line-soft: rgba(138, 62, 13, 0.28);
  --panel-glow: rgba(255, 255, 255, 0.03);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Roboto Condensed', 'Arial Narrow', sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.92), transparent 28%),
    linear-gradient(180deg, #f5f1ea 0%, var(--bg) 52%, #e7e1d8 100%);
  color: var(--text);
  min-height: 100vh;
}

.dashboard {
  position: relative;
  width: min(1900px, 100vw);
  min-height: 100vh;
  margin: 0 auto;
  padding: 10px 12px 96px;
}

.board-header {
  position: absolute;
  top: 18px;
  right: 14px;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  border: none;
  margin: 0;
  gap: 12px;
}

.board-header time {
  font-family: 'Oswald', 'Arial Narrow', sans-serif;
  font-size: clamp(1.8rem, 3.4vw, 4rem);
  font-weight: 600;
  color: color-mix(in srgb, var(--text), #4c4c4c 18%);
  letter-spacing: 0.03em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
}

.board {
  display: grid;
  grid-template-columns: var(--time-column-width) repeat(var(--posts-count, 1), minmax(240px, 1fr));
  align-items: stretch;
  position: relative;
}

.board::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0, var(--line) 8%, var(--line) 92%, transparent 100%);
  opacity: 0.95;
  pointer-events: none;
}

.head-cell {
  color: var(--accent);
  text-transform: uppercase;
  font-family: 'Oswald', 'Arial Narrow', sans-serif;
  font-size: clamp(1.7rem, 3vw, 3.2rem);
  border-bottom: 2px solid color-mix(in srgb, var(--line), white 8%);
  padding: 9px 14px 7px;
  min-height: 62px;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
}

.head-cell.empty {
  border-color: transparent;
}

.time-cell {
  font-family: 'Oswald', 'Arial Narrow', sans-serif;
  font-size: clamp(1.9rem, 2.45vw, 3.45rem);
  color: var(--accent);
  padding: 12px 10px 12px 8px;
  line-height: 1;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08)),
    color-mix(in srgb, var(--panel-alt), transparent 30%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.post-cell {
  min-height: 98px;
  padding: 8px 12px;
  border-left: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background:
    linear-gradient(180deg, var(--panel-glow), rgba(255, 255, 255, 0)),
    var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.post-cell.empty {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)),
    color-mix(in srgb, var(--panel), #f2eee8 32%);
}

.time-cell.row-active,
.post-cell.row-active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)),
    linear-gradient(90deg, color-mix(in srgb, var(--success), white 15%), color-mix(in srgb, var(--success), black 10%));
  color: #fff;
}

.time-cell.row-past {
  font-size: clamp(1.35rem, 1.8vw, 2.35rem);
  opacity: 0.68;
  padding-top: 8px;
  padding-bottom: 8px;
}

.post-cell.row-past {
  min-height: 72px;
  padding-top: 6px;
  padding-bottom: 6px;
  opacity: 0.82;
  filter: saturate(0.78) brightness(0.985);
}

.row-active .slot-details {
  color: rgba(255, 255, 255, 0.92);
}

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

.post-cell.no-plate .slot-top {
  min-height: 0;
}

.post-cell.no-plate .slot-details:first-of-type {
  margin-top: 10px;
}

.plate {
  border: 3px solid var(--line);
  border-radius: 9px;
  color: var(--accent);
  font-family: 'Oswald', 'Arial Narrow', sans-serif;
  font-size: clamp(2rem, 2.9vw, 4.5rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  padding: 4px 14px 7px;
  text-transform: lowercase;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.row-active .plate {
  border-color: rgba(255, 255, 255, 0.8);
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.post-cell.row-past .plate {
  font-size: clamp(1.3rem, 2vw, 2.8rem);
  border-width: 2px;
  padding: 2px 8px 4px;
}

.done {
  width: clamp(30px, 2.5vw, 52px);
  height: clamp(30px, 2.5vw, 52px);
  border-radius: 50%;
  background: linear-gradient(180deg, #8ccf3f, #5ca51d);
  color: white;
  font-size: clamp(18px, 2vw, 30px);
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.done.is-completed {
  background: linear-gradient(180deg, #e76453, #b82117);
}

.slot-details {
  margin-top: 5px;
  color: color-mix(in srgb, var(--accent), #70411f 18%);
  font-weight: 400;
  font-family: 'Oswald', 'Arial Narrow', sans-serif;
  letter-spacing: 0.005em;
  font-size: clamp(1rem, 1.55vw, 1.75rem);
  line-height: 1.08;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.post-cell.row-past .slot-details {
  margin-top: 4px;
  font-size: clamp(1rem, 1.45vw, 1.45rem);
  line-height: 1.08;
}

.slot-details.is-completed {
  text-transform: uppercase;
}

.empty-screen {
  display: none;
}

.dashboard.is-empty {
  width: 100vw;
  max-width: none;
  padding: 14px 26px;
}

.dashboard.is-empty .board {
  display: none;
}

.dashboard.is-empty .board-header {
  position: static;
  border-bottom: none;
  justify-content: flex-end;
  margin-bottom: 0;
}

.dashboard.is-empty .board-header time {
  color: #929397;
  font-size: clamp(2.6rem, 5.4vw, 7.4rem);
  line-height: 1;
}

body.empty-mode {
  background: #000;
  color: #fff;
}

.dashboard.is-empty .empty-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 155px);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: clamp(28px, 2.9vw, 46px);
  transform: translateY(-1vh);
}

.brand-mark {
  width: clamp(110px, 9.8vw, 190px);
  height: clamp(110px, 9.8vw, 190px);
  border-radius: 50%;
  background: #ffb000;
}

.brand-text {
  font-family: 'Montserrat', 'Arial Black', sans-serif;
  font-size: clamp(3.3rem, 9.3vw, 12rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.015em;
  text-transform: lowercase;
  color: #ffb000;
}

.date-switcher {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 4;
  width: min(1120px, calc(100vw - 28px));
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 20%);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.68)),
    color-mix(in srgb, var(--panel), transparent 4%);
  box-shadow:
    0 14px 38px rgba(67, 39, 13, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
}

.date-switcher[hidden] {
  display: none;
}

.date-switcher__track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.date-switcher__track::-webkit-scrollbar {
  display: none;
}

.date-chip {
  border: 1px solid color-mix(in srgb, var(--line), transparent 28%);
  border-radius: 999px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.62);
  color: color-mix(in srgb, var(--text), #533319 14%);
  font-family: 'Oswald', 'Arial Narrow', sans-serif;
  font-size: clamp(1rem, 1.2vw, 1.35rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease, border-color 140ms ease;
}

.date-chip:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent), white 8%);
}

.date-chip.is-active {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent), white 12%), color-mix(in srgb, var(--accent), black 6%));
  color: #fff;
  border-color: color-mix(in srgb, var(--accent), black 8%);
}

@media (max-width: 980px) {
  .dashboard {
    padding: 8px 8px 90px;
  }

  .board-header {
    top: 16px;
    right: 8px;
  }

  .board {
    grid-template-columns: 72px repeat(var(--posts-count, 1), minmax(180px, 1fr));
  }

  .post-cell {
    min-height: 84px;
    padding: 7px;
  }

  .plate {
    border-width: 2px;
    padding: 4px 10px 6px;
  }
}

@media (max-width: 720px) {
  .dashboard.is-empty {
    padding: 14px 12px;
  }

  .dashboard {
    padding-bottom: 82px;
  }

  .dashboard.is-empty .empty-screen {
    min-height: calc(100vh - 130px);
  }

  .brand-logo {
    flex-direction: column;
    transform: none;
    text-align: center;
  }

  .board {
    display: block;
  }

  .board-header {
    position: static;
    margin-bottom: 8px;
    align-items: center;
  }

  .head-cell.empty,
  .time-cell {
    display: none;
  }

  .head-cell {
    margin-top: 12px;
    border-top: 1px solid var(--line);
  }

  .post-cell {
    border-left: none;
    border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 75%);
  }

  .post-cell::before {
    content: attr(data-time);
    display: block;
    font-family: 'Oswald', 'Arial Narrow', sans-serif;
    color: var(--accent);
    font-size: 1.4rem;
    margin-bottom: 6px;
  }

  .date-switcher {
    width: calc(100vw - 16px);
    bottom: 8px;
    padding: 8px;
    border-radius: 18px;
  }

  .date-chip {
    padding: 9px 14px;
    font-size: 1rem;
  }
}
