:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #252639;
  background: #fff;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
[hidden] { display: none !important; }

/* Entry screen: entirely viewport-bound, including mobile browsers. */
.landing {
  position: fixed;
  inset: 0;
  height: 100dvh;
  padding: 38px max(6vw, 28px);
  overflow: hidden;
  background: #faf9f6;
}
.brand { font-weight: 850; letter-spacing: -1.6px; font-size: 25px; display: flex; align-items: center; gap: 4px; }
.brand-icon { display: inline-flex; background: #7356e8; color: white; width: 35px; height: 35px; border-radius: 12px; align-items: center; justify-content: center; margin-right: 8px; font-size: 24px; }
.brand-muted { color: #a6a4a9; }
.intro { position: relative; z-index: 1; max-width: 590px; margin-top: clamp(35px, 10vh, 130px); }
.eyebrow { font-size: 11px; letter-spacing: 2.1px; font-weight: 800; color: #6556ad; display: flex; gap: 11px; align-items: center; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #52ba9b; display: inline-block; box-shadow: 0 0 0 4px #52ba9b20; }
h1 { font-weight: 800; font-size: clamp(47px, 5.7vw, 78px); line-height: 1.09; letter-spacing: -4px; margin: 25px 0 22px; }
h1 em { font-style: normal; color: #7356e8; }
.intro > p { font-size: 17px; line-height: 1.7; color: #777785; max-width: 480px; margin-bottom: 38px; }
.entry { background: #fff; border: 1px solid #e9e7ed; border-radius: 20px; max-width: 470px; padding: 23px; box-shadow: 0 16px 48px #2120380a; }
.entry label { display: block; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; color: #79798a; margin-bottom: 10px; }
.entry input { width: 100%; height: 47px; border: 1px solid #e3e1e9; border-radius: 9px; padding: 0 14px; outline: none; color: #252639; background: white; }
.entry input:focus { border-color: #7356e8; box-shadow: 0 0 0 3px #7356e81a; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 13px; }
.actions button, .join-fields button { border-radius: 9px; height: 46px; border: 1px solid #e5e3eb; padding: 0 16px; font-weight: 700; font-size: 13px; }
.actions button span { margin-left: 8px; }
.primary, .join-fields button { background: #7356e8; color: white; border-color: #7356e8 !important; }
.secondary { background: #f5f4f9; color: #333042; }
.join-row { margin-top: 22px; }
.join-fields { display: flex; gap: 8px; }
.join-fields input { text-transform: uppercase; }
.error { font-size: 12px; color: #c73e53; min-height: 0; margin-top: 9px; }
.error:empty { display: none; }
.footnote { font-size: 12px; color: #9995a0; margin: 21px 4px; display: flex; align-items: center; gap: 10px; }
.footnote > span:first-child { font-size: 19px; color: #7356e8; }
.dot { font-size: 17px; }
.splash-art { position: absolute; right: 2vw; top: 17vh; width: min(42vw, 560px); opacity: .91; pointer-events: none; }
.splash-art svg { width: 100%; }

/* The canvas IS the full screen. Controls float over it rather than consume layout space. */
.workspace {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: white;
  isolation: isolate;
}
.canvas-shell {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: white;
  overflow: hidden;
}
#board {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  touch-action: none;
  cursor: crosshair;
}

/* Minimal floating meeting details at the top. */
.topbar {
  position: absolute;
  z-index: 5;
  top: max(12px, env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 0;
  background: none;
  padding: 0;
  pointer-events: none;
}
.small-brand, .room-section, .people { pointer-events: auto; }
.small-brand { display: inline-flex; align-items: center; font-weight: 850; font-size: 22px; letter-spacing: -1px; white-space: nowrap; padding: 6px 10px; background: #fffffff0; border: 1px solid #eeebf3; border-radius: 12px; box-shadow: 0 4px 18px #25233d0a; }
.small-brand span:last-child { color: #aba9b4; }
.small-logo { color: #7356e8; font-size: 25px; margin-right: 4px; }
.room-section { display: flex; align-items: center; gap: 9px; padding: 5px; background: #fffffff5; border: 1px solid #eae8ef; border-radius: 12px; box-shadow: 0 4px 18px #25233d10; }
.room-label { font-size: 10px; letter-spacing: 1px; color: #92919b; font-weight: 800; margin-left: 8px; }
#room-code { border: 1px dashed #c6bedb; background: #f6f2ff; border-radius: 8px; letter-spacing: 2px; color: #7356e8; font-weight: 800; font-size: 14px; padding: 9px 12px; }
.share-btn { border: 0; border-radius: 9px; background: #7356e8; color: #fff; font-size: 12px; font-weight: 750; padding: 11px 14px; white-space: nowrap; }
.people { display: flex; align-items: center; gap: 10px; color: #90909b; font-size: 12px; padding: 7px 11px; background: #fffffff0; border: 1px solid #eeebf3; border-radius: 12px; box-shadow: 0 4px 18px #25233d0a; white-space: nowrap; }
.avatars { display: flex; padding-left: 8px; }
.avatar { margin-left: -8px; border: 2px solid white; width: 28px; height: 28px; border-radius: 50%; font-size: 11px; font-weight: 800; display: grid; place-items: center; color: white; }

/* Draggable toolbar; initially centred at the bottom. Its handle is the only drag target. */
.tools {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 20px);
  margin: 0;
  padding: 7px 11px;
  background: #fff;
  border: 1px solid #e7e3ef;
  border-radius: 14px;
  box-shadow: 0 8px 32px #25233d23;
  user-select: none;
}
.tools.dragging { box-shadow: 0 12px 36px #25233d36; }
.toolbar-handle { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 36px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #a5a1b1; font-size: 19px; font-weight: 700; cursor: grab; touch-action: none; user-select: none; }
.toolbar-handle:hover, .toolbar-handle:focus-visible { background: #f1eff8; color: #7356e8; }
.toolbar-handle:active, .tools.dragging .toolbar-handle { cursor: grabbing; }
.tool-group, .swatches { display: flex; align-items: center; gap: 6px; }
.action-group { gap: 2px; }
.tool { background: transparent; border: 0; border-radius: 8px; height: 36px; min-width: 37px; padding: 0 9px; font-size: 21px; color: #686778; }
.tool.active { background: #eee9ff; color: #7356e8; }
.text-tool { font-size: 12px; font-weight: 700; white-space: nowrap; }
.danger { color: #d35b67; }
.separator { height: 26px; width: 1px; flex: none; background: #e8e5ee; }
.swatches { gap: 8px; }
.swatch { width: 22px; height: 22px; border: 2px solid white; box-shadow: inset 0 0 0 10px var(--swatch); border-radius: 50%; padding: 0; }
.swatch.selected { outline: 2px solid var(--swatch); outline-offset: 2px; }
.size-label { display: flex; align-items: center; gap: 8px; color: #86838f; font-size: 10px; font-weight: 800; letter-spacing: .7px; }
.size-label input { accent-color: #7356e8; width: 78px; }
.toast { position: fixed; z-index: 20; bottom: max(88px, calc(env(safe-area-inset-bottom) + 66px)); left: 50%; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: .2s; background: #252639; color: white; padding: 10px 18px; border-radius: 8px; font-size: 12px; white-space: nowrap; max-width: calc(100vw - 20px); text-overflow: ellipsis; overflow: hidden; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 850px) {
  .splash-art { opacity: .15; right: -200px; top: 25vh; width: 600px; }
  .intro { margin-top: 9vh; }
  .topbar { left: 10px; right: 10px; top: max(9px, env(safe-area-inset-top)); gap: 6px; }
  .small-brand { font-size: 16px; }
  .room-label { display: none; }
  #room-code { font-size: 12px; padding: 9px; }
  .share-btn { padding: 10px; font-size: 12px; }
  .people #count { display: none; }
  .tools { gap: 7px; padding: 7px 9px; }
  .size-label input { width: 56px; }
}
@media (max-width: 620px) {
  .small-brand { display: none; }
  .topbar { justify-content: space-between; }
  .people { padding: 4px 6px; }
  .tools { gap: 6px; }
  .separator { display: none; }
  .swatches { gap: 6px; }
}
@media (max-width: 400px) {
  .landing { padding: 20px 18px; }
  .intro { margin-top: 45px; }
  h1 { letter-spacing: -2px; font-size: 42px; }
  .intro > p { font-size: 14px; margin-bottom: 20px; }
  .entry { padding: 14px; }
  .actions button { padding: 0 7px; font-size: 12px; }
  .topbar { justify-content: center; }
  .people { display: none; }
  .swatches { gap: 4px; }
  .swatch { width: 20px; height: 20px; }
  .size-label { display: none; }
  .toolbar-handle { flex-basis: 18px; width: 18px; }
  .tools { padding: 6px; gap: 5px; border-radius: 12px; }
  .tool { padding: 0 7px; min-width: 32px; }
}
@media (max-height: 680px) {
  .intro { margin-top: 26px; }
  .intro h1 { margin: 14px 0; }
  .intro > p { margin-bottom: 16px; }
  .footnote { display: none; }
}
@media (max-height: 540px) {
  .landing { padding-top: 10px; }
  .landing .brand { font-size: 18px; }
  .intro { margin-top: 10px; }
  .intro h1 { font-size: 36px; line-height: 1; }
  .intro > p { display: none; }
  .entry { padding: 10px; }
}
