:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef1f5;
  color: #172034;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.landing {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, #dfeaff 0, transparent 28%),
    radial-gradient(circle at 85% 80%, #d9f7ed 0, transparent 25%),
    #f4f6f9;
}

.landing-card {
  width: min(100%, 580px);
  padding: clamp(28px, 6vw, 56px);
  border: 1px solid rgba(23, 32, 52, 0.08);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 80px rgba(23, 32, 52, 0.12);
}

.eyebrow {
  margin: 0 0 12px;
  color: #5d6a82;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(40px, 8vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.lede {
  margin: 20px 0 30px;
  color: #5d6a82;
  font-size: 18px;
}

.primary-action,
.join-row button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  background: #172034;
  color: white;
  padding: 0 20px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.join-form {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid #e5e9ef;
}

.join-form label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
}

.join-row {
  display: flex;
  gap: 10px;
}

.join-row input {
  min-width: 0;
  flex: 1;
  border: 1px solid #ccd3df;
  border-radius: 14px;
  padding: 0 14px;
  text-transform: uppercase;
}

.error {
  min-height: 20px;
  color: #b42318;
  font-size: 13px;
}

.workspace,
.viewer {
  overflow: hidden;
  background: #dfe4eb;
}

.toolbar {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 72px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(23, 32, 52, 0.1);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.wordmark {
  color: inherit;
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.tool-group,
.session-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.session-info {
  justify-self: end;
}

.color-control,
.width-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5d6a82;
  font-size: 12px;
  font-weight: 700;
}

.color-control input {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  padding: 0;
}

.quiet-button,
.code-button {
  border: 1px solid #d5dbe5;
  border-radius: 12px;
  background: white;
  color: #172034;
  cursor: pointer;
}

.quiet-button {
  min-height: 38px;
  padding: 0 14px;
}

.code-button {
  display: flex;
  min-width: 122px;
  flex-direction: column;
  align-items: flex-start;
  padding: 7px 12px;
}

.code-button span {
  color: #748096;
  font-size: 10px;
}

.code-button strong {
  font-size: 15px;
  letter-spacing: 0.08em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #5d6a82;
  font-size: 12px;
  font-weight: 700;
}

.status::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f79009;
  content: "";
}

.status[data-state="connected"]::before {
  background: #12b76a;
}

.status[data-state="offline"]::before {
  background: #f04438;
}

.canvas-stage,
.viewer-stage {
  position: relative;
  display: grid;
  width: 100%;
  place-items: center;
}

.canvas-stage {
  height: calc(100% - 120px);
  padding: 18px;
}

.page-bar {
  display: flex;
  height: 48px;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 18px;
  border-bottom: 1px solid rgba(23, 32, 52, 0.1);
  background: rgba(247, 249, 252, 0.96);
}

.page-list {
  display: flex;
  gap: 8px;
}

.page-button,
.add-page {
  min-height: 34px;
  flex: 0 0 auto;
  border: 1px solid #d5dbe5;
  border-radius: 10px;
  background: white;
  color: #526078;
  padding: 0 12px;
  cursor: pointer;
}

.page-button[data-active="true"] {
  border-color: #172034;
  background: #172034;
  color: white;
}

.page-button:disabled,
.add-page:disabled {
  cursor: default;
  opacity: 0.45;
}

.viewer-page {
  color: #526078;
  font-size: 12px;
  font-weight: 700;
}

.viewer-stage {
  height: 100%;
  padding: 16px;
}

#board {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: white;
  box-shadow: 0 12px 36px rgba(23, 32, 52, 0.12);
  touch-action: none;
}

.canvas-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  margin: 0;
  border-radius: 999px;
  background: rgba(23, 32, 52, 0.76);
  color: white;
  padding: 8px 13px;
  font-size: 12px;
  transform: translateX(-50%);
  transition: opacity 180ms ease;
  pointer-events: none;
}

.canvas-hint[hidden] {
  opacity: 0;
}

.viewer-badge {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(23, 32, 52, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  padding: 8px 12px;
  backdrop-filter: blur(12px);
}

.viewer-badge strong {
  font-size: 12px;
  letter-spacing: 0.08em;
}

.missing-card {
  position: absolute;
  border-radius: 20px;
  background: white;
  padding: 30px;
  text-align: center;
}

.missing-card h1 {
  margin-bottom: 20px;
  font-size: 28px;
}

@media (max-width: 780px) {
  .toolbar {
    grid-template-columns: auto 1fr;
  }

  .tool-group {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
  }

  .session-info {
    grid-column: 2;
    grid-row: 1;
  }

  .canvas-stage {
    height: calc(100% - 176px);
    padding: 8px;
  }

  .width-control span,
  .color-control span {
    display: none;
  }

  .join-row {
    flex-direction: column;
  }

  .join-row input {
    min-height: 48px;
  }
}
