:root {
  --dark-navy: #0d1b2e;
  --darker-navy: #091525;
  --darkest-navy: #060f1c;
  --page-black: #060913;
  --timeline-bg: #0c1017;
  --border: #1a2e44;
  --red: #e8401c;
  --occupied: #8b1a1a;
  --available: #155230;
  --green: #2db86a;
  --white: #ffffff;
  --gray: #7a92a8;
  --muted: #5f7285;
  --error-bg: #5c1010;
  --error-text: #ff9b9b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
}

#app {
  display: flex;
  flex-direction: column;
}

body {
  background: var(--page-black);
  color: var(--white);
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.splash {
  display: grid;
  min-height: 100%;
  place-items: center;
  background: var(--dark-navy);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark { width: var(--brand-width,34px); height: var(--brand-height,26px); flex: 0 0 auto; background: url('/assets/favicon.svg') center / contain no-repeat; }
/* Keep controls in their own row instead of covering room statistics. */
.demo-toolbar {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  align-self: center;
  max-width: calc(100% - 16px);
  margin: 4px 8px max(8px, env(safe-area-inset-bottom));
  padding: 6px 10px;
  background: #101b2e;
  border: 1px solid #42516a;
  border-radius: 12px;
  font-size: 12px;
  color: white;
}
.demo-toolbar button,.demo-toolbar select,.demo-toolbar a { background:#23344e; border:0; border-radius:6px; color:white; padding:6px 8px; text-decoration:none; cursor:pointer; }
.demo-toolbar button[aria-pressed=true] { background:#297563; }
.calendar-note {
  flex: 0 0 auto;
  margin: 0 16px max(8px, env(safe-area-inset-bottom));
  color: var(--gray);
  font-size: 11px;
  text-align: center;
}
.brand-title {
  color: var(--white);
  font-size: var(--brand-title, 13px);
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--gray);
  font-size: var(--brand-subtitle, 9px);
  font-weight: 600;
  letter-spacing: 3px;
  line-height: 1;
}

.setup-screen {
  height: 100%;
  overflow: auto;
  background: var(--dark-navy);
  padding: 24px 18px;
}

.setup-center {
  display: grid;
  min-height: 100%;
  place-items: center;
}

.setup-card {
  width: min(100%, 980px);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--darker-navy);
}

.setup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.setup-pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--dark-navy);
  color: var(--gray);
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.3px;
  white-space: nowrap;
}

.setup-copy {
  margin: 22px 0 0;
}

.setup-copy h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 32px);
  line-height: 1.15;
}

.setup-copy p,
.setup-note {
  color: var(--gray);
  line-height: 1.45;
}

.setup-copy p {
  margin: 10px 0 0;
  font-size: 15px;
}

.setup-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.field label {
  color: var(--gray);
  font-size: 13px;
  font-weight: 600;
}

.field input {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: var(--dark-navy);
  color: var(--white);
  padding: 0 14px;
}

.field input:focus {
  border-color: #34516f;
  box-shadow: 0 0 0 3px rgba(52, 81, 111, 0.35);
}

.field input::placeholder {
  color: rgba(122, 146, 168, 0.8);
}

.setup-divider {
  height: 1px;
  margin: 22px 0;
  background: var(--border);
}

.setup-note {
  margin: 0 0 16px;
  font-size: 13px;
}

.setup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.button {
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0 18px;
  color: var(--white);
  background: transparent;
  font-weight: 700;
}

.button:disabled {
  cursor: default;
  opacity: 0.7;
}

.button-primary {
  border-color: var(--red);
  background: var(--red);
}

.button-secondary {
  border-color: var(--border);
}

.button-warn {
  border-color: #7a3010;
  background: #22120f;
  color: #f1b5a6;
}

.error-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  background: var(--error-bg);
  color: var(--error-text);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
}

.display-frame {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  height: auto;
  padding: 4px;
  background: var(--page-black);
}

.display-surface {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 2px solid rgba(26, 46, 68, 0.55);
  border-radius: 28px;
  background: var(--available);
  user-select: none;
  touch-action: manipulation;
}

.display-surface.is-occupied {
  background: var(--occupied);
}

.display-surface.is-available {
  background: var(--available);
}

.timeline-panel {
  display: flex;
  flex: 0 0 500px;
  flex-direction: column;
  height: 100%;
  background: var(--timeline-bg);
  padding: 28px;
}

.timeline-title {
  margin: 0 0 14px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2.2px;
}

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

.timeline-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 84px;
  border-radius: 14px;
  background: #151a24;
  padding: 16px;
  opacity: 1;
}

.timeline-item.is-past {
  background: #141922;
  opacity: 0.45;
}

.timeline-item.is-active {
  background: #311a1e;
}

.timeline-time {
  display: grid;
  flex: 0 0 74px;
  gap: 6px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 18px;
  font-weight: 600;
}

.timeline-time span:last-child {
  color: rgba(255, 255, 255, 0.48);
}

.timeline-accent {
  width: 4px;
  height: 52px;
  border-radius: 999px;
  background: transparent;
}

.is-active .timeline-accent {
  background: var(--red);
}

.is-upcoming .timeline-accent {
  background: rgba(45, 184, 106, 0.12);
}

.timeline-main {
  min-width: 0;
  flex: 1 1 auto;
  margin-left: 16px;
}

.timeline-subject {
  overflow: hidden;
  color: var(--white);
  font-size: 22px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-organizer {
  overflow: hidden;
  margin-top: 4px;
  color: rgba(122, 146, 168, 0.95);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-badge {
  flex: 0 0 auto;
  margin-left: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--gray);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.is-active .timeline-badge {
  background: var(--red);
  color: var(--white);
}

.empty-timeline {
  border-radius: 14px;
  background: #141922;
  color: var(--gray);
  padding: 18px;
  font-size: 15px;
}

.timeline-footer {
  margin-top: auto;
  border-top: 1px solid rgba(26, 46, 68, 0.9);
  padding-top: 18px;
}

.status-side {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  height: 100%;
  background: inherit;
}

.status-header {
  display: flex;
  min-height: 160px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.32);
  padding: 30px 36px;
}

.day-label {
  align-self: center;
  color: rgba(255, 255, 255, 0.62);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
}

.room-meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.room-name {
  overflow: hidden;
  max-width: 64vw;
  color: rgba(255, 255, 255, 0.82);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-email {
  overflow: hidden;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clock {
  margin-top: 10px;
  font-size: 58px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1.5px;
  line-height: 1.1;
}

.date {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 15px;
  line-height: 1.4;
}

.status-panel {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.hero {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 30px 28px 0;
  text-align: center;
  container-type: inline-size;
}

.hero-title {
  margin: 0;
  color: var(--white);
  font-size: clamp(56px, 10vw, 160px);
  font-size: clamp(48px, 18cqi, 160px);
  max-width: 100%;
  white-space: nowrap;
  font-weight: 950;
  line-height: 1.18;
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  font-style: normal;
  line-height: 1.5;
}

.summary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  height: 258px;
  padding: 52px 36px 0;
}

.summary-row-single {
  grid-template-columns: minmax(0, 680px);
  justify-content: center;
}
.summary-row-single .summary-card {
  align-self: start;
  text-align: center;
}
.summary-row-single .summary-card-head {
  justify-content: center;
}

.summary-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.32);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.12);
  padding: 18px 24px;
}

.summary-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.6px;
}

.summary-title-right {
  color: rgba(255, 255, 255, 0.58);
  letter-spacing: 1.2px;
  white-space: nowrap;
}

.summary-card h2 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--white);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.16;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.summary-card .headline-medium {
  font-size: 28px;
}

.summary-card .headline-small {
  font-size: 26px;
  line-height: 1.24;
}

.summary-card p {
  overflow: hidden;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-card strong {
  display: block;
  overflow: hidden;
  margin-top: 12px;
  color: var(--white);
  font-size: 21px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-spacer {
  flex: 1 1 auto;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.32);
  padding: 16px 36px;
}

.metric-card {
  min-width: 0;
  border: 1px solid rgba(0, 0, 0, 0.32);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.1);
  padding: 14px 18px;
}

.metric-label {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-value {
  margin-top: 8px;
  color: var(--white);
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
}

.connection-error {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 5;
}

@media (max-width: 1379px), (max-height: 819px) {
  .display-surface {
    border-radius: 26px;
  }

  .timeline-panel {
    flex-basis: 340px;
    padding: 18px;
  }

  .timeline-title {
    font-size: 10px;
  }

  .timeline-item {
    min-height: 68px;
    border-radius: 12px;
    padding: 12px;
  }

  .timeline-time {
    flex-basis: 56px;
    font-size: 14px;
  }

  .timeline-accent {
    height: 34px;
  }

  .timeline-subject {
    font-size: 18px;
  }

  .timeline-organizer {
    font-size: 12px;
  }

  .timeline-badge {
    padding: 6px 8px;
    font-size: 10px;
  }

  .status-header {
    min-height: 132px;
    padding: 20px 24px;
  }

  .day-label {
    font-size: 18px;
  }

  .room-name {
    font-size: 20px;
  }

  .room-email {
    font-size: 12px;
  }

  .clock {
    font-size: 50px;
  }

  .date {
    font-size: 14px;
  }

  .hero {
    padding: 18px 18px 0;
  }

  .hero-title {
    font-size: clamp(48px, 13vw, 110px);
    font-size: clamp(40px, 18cqi, 110px);
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .summary-row {
    height: 192px;
    gap: 14px;
    padding: 42px 18px 0;
  }

  .summary-card {
    border-radius: 14px;
    padding: 16px;
  }

  .summary-card-head {
    font-size: 10px;
    margin-bottom: 8px;
  }

  .summary-card h2,
  .summary-card .headline-medium {
    font-size: 22px;
  }

  .summary-card .headline-small {
    font-size: 20px;
  }

  .summary-card p {
    margin-top: 8px;
    font-size: 16px;
  }

  .summary-card strong {
    margin-top: 8px;
    font-size: 17px;
  }

  .metrics-strip {
    gap: 10px;
    padding: 16px 18px;
  }

  .metric-card {
    border-radius: 12px;
    padding: 12px 14px;
  }

  .metric-label {
    font-size: 9px;
  }

  .metric-value {
    font-size: 24px;
  }
}

@media (max-width: 899px), (max-height: 499px) {
  .display-surface {
    border-radius: 22px;
  }

  .timeline-panel {
    flex-basis: 240px;
    padding: 16px;
  }

  .status-header {
    min-height: 124px;
    padding: 18px;
  }

  .day-label {
    font-size: 17px;
  }

  .room-name {
    font-size: 18px;
  }

  .room-email {
    font-size: 11px;
  }

  .clock {
    font-size: 44px;
  }

  .date {
    font-size: 13px;
  }

  .metrics-strip {
    display: none;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  #app {
    min-height: 100%;
    height: auto;
  }

  .display-frame {
    min-height: 100vh;
    height: auto;
  }

  .display-surface {
    min-height: calc(100vh - 8px);
    flex-direction: column;
  }

  .timeline-panel {
    flex: 0 0 auto;
    width: 100%;
    max-height: none;
  }

  .timeline-footer {
    margin-top: 18px;
  }

  .status-header {
    min-height: auto;
  }

  .day-label {
    align-self: flex-start;
  }

  .room-name {
    max-width: 55vw;
  }

  .summary-row {
    grid-template-columns: 1fr;
    height: auto;
    padding-bottom: 18px;
  }

  .summary-card {
    min-height: 160px;
  }

  .setup-card {
    padding: 20px;
  }

  .setup-header,
  .setup-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .button {
    width: 100%;
  }
}
