:root {
  --chrome: rgba(255, 253, 247, 0.97);
  --edge: #ded8cb;
  --dim: #686458;
  --lit: #242a25;
  --gold: #466c57;
}
body {
  font:
    13px/1.4 system-ui,
    -apple-system,
    sans-serif;
}
.slab,
.pop {
  box-shadow:
    0 4px 20px #33301c0c,
    0 1px 3px #33301c0b;
}
.slab button {
  min-width: 42px;
  height: 42px;
  letter-spacing: 0;
}
.slab button:hover,
.grid button:hover {
  background: #eeeade;
  color: #252a25;
}
.slab button[aria-pressed="true"],
.grid button[aria-pressed="true"] {
  background: #e2eadd;
  color: #274e39;
}
.slab button .num {
  color: #8e8a80;
}
.grid button:not(.sw),
#knobs-reset {
  background: #f1eee5 !important;
  color: var(--dim) !important;
}
/* The forced background above hid which size was chosen; say it plainly. */
.grid button:not(.sw)[aria-pressed="true"] {
  background: #dfe9dc !important;
  color: #274e39 !important;
  box-shadow: inset 0 0 0 2px #466c57;
}
#actions #trigger-style {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px 0 8px;
  background: #ece8dc;
  color: #274e39;
}
#actions #trigger-style svg {
  width: 17px;
  height: 17px;
}
.paper-custom {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.paper-custom input[type="color"] {
  width: 36px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: #fffdf7;
  cursor: pointer;
}
.paper-custom input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: #fffdf7;
  color: var(--lit);
  font:
    12px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  -webkit-user-select: text;
  user-select: text;
}
.pop h4 {
  color: #686458;
  font-weight: 600;
}
.pop {
  bottom: 80px;
}
.knob .row2 {
  color: #686458;
}
.knob input {
  background: #d7d3c8;
  height: 5px;
}
.knob input::-webkit-slider-thumb {
  background: #41694f;
  width: 20px;
  height: 20px;
}
#keys,
#stat {
  display: none;
}
#board-header {
  position: fixed;
  z-index: 4;
  top: 20px;
  left: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}
#board-header > * {
  pointer-events: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #283a2e;
  text-decoration: none;
  font:
    27px Georgia,
    serif;
  letter-spacing: -1px;
}
.brand img {
  width: 30px;
  height: 30px;
}
.board-details {
  border-left: 1px solid #d5d1c4;
  padding-left: 17px;
  min-width: 0;
}
#board-title {
  display: block;
  border: 0;
  background: transparent;
  font: 500 14px system-ui;
  color: #373b32;
  width: 220px;
  padding: 2px 0;
  outline-offset: 3px;
}
#save-state {
  font-size: 11px;
  color: #72776a;
}
.header-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.ui-button {
  border: 1px solid #d7d3c6;
  background: #fffdf7;
  color: #384033;
  border-radius: 9px;
  padding: 10px 15px;
  min-height: 42px;
  font: 500 13px system-ui;
  cursor: pointer;
}
.ui-button.primary {
  background: #355640;
  border-color: #355640;
  color: #fffdf5;
}
.ui-button:hover {
  filter: brightness(0.96);
}
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid #4b765a;
  outline-offset: 3px;
}
#actions {
  top: auto;
  bottom: 22px;
  left: 24px;
  padding: 3px;
}
#actions button {
  min-width: 32px;
  height: 36px;
  font-size: 12px;
  padding: 0 7px;
}
#actions .div {
  margin: 3px;
}
.bottom {
  bottom: 20px;
}
#hello {
  gap: 16px;
  padding-bottom: 60px;
}
#hello b {
  font:
    italic 48px/1.1 Georgia,
    serif;
  letter-spacing: -1.5px;
  color: #707a62;
}
#hello span {
  font: 14px/1.6 system-ui;
  color: #7c8071;
  max-width: 340px;
  opacity: 1;
}
#canvas-note {
  position: fixed;
  right: 24px;
  bottom: 33px;
  color: #828575;
  font-size: 11px;
  pointer-events: none;
}
#share-dialog {
  width: min(460px, calc(100vw - 28px));
  border: 1px solid #d7d3c6;
  border-radius: 18px;
  padding: 26px;
  background: #fffdf7;
  color: #343c30;
  box-shadow: 0 20px 90px #18251930;
  touch-action: auto;
  user-select: text;
}
#share-dialog::backdrop {
  background: #34372b38;
  backdrop-filter: blur(3px);
}
#share-dialog h2 {
  font:
    28px Georgia,
    serif;
  margin: 0 0 10px;
}
#share-dialog p {
  color: #737668;
  line-height: 1.6;
}
#share-dialog label {
  display: block;
  margin: 20px 0 7px;
  font-weight: 600;
}
#share-dialog input {
  width: 100%;
  font: 12px monospace;
  padding: 11px;
  border: 1px solid #d7d3c6;
  border-radius: 7px;
  color: #4b5845;
  background: #f4f2e9;
  user-select: text;
  touch-action: auto;
}
.link-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
#share-close {
  float: right;
  border: 0;
  background: none;
  font-size: 22px;
  cursor: pointer;
}
#share-message {
  min-height: 1.5em;
  font-size: 12px;
}
#recovery {
  position: fixed;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
}
body.viewing #dock,
body.viewing #trigger-paper {
  display: none;
}
body.presenting #dock,
body.presenting #actions,
body.presenting .board-details,
body.presenting #canvas-note {
  display: none;
}
@media (min-width: 1100px) {
  #actions {
    bottom: 90px;
  }
}
@media (max-width: 820px) {
  #board-header {
    top: max(14px, env(safe-area-inset-top));
    left: 14px;
    right: 14px;
    gap: 10px;
  }
  .brand {
    font-size: 0;
    gap: 0;
  }
  .brand img {
    width: 28px;
    height: 28px;
  }
  .board-details {
    padding-left: 10px;
  }
  #board-title {
    width: 140px;
    font-size: 13px;
  }
  .header-actions {
    gap: 5px;
  }
  .header-actions .ui-button {
    padding: 8px 11px;
  }
  #present-button,
  #export-button {
    display: none;
  }
  .bottom {
    bottom: calc(14px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 20px);
  }
  #actions {
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100vw - 20px);
  }
  #canvas-note {
    display: none;
  }
  #hello b {
    font-size: 37px;
  }
  #hello span {
    font-size: 13px;
    max-width: 290px;
  }
  .pop {
    bottom: calc(140px + env(safe-area-inset-bottom));
    max-height: 60vh;
    overflow: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
/* Desktop follows a familiar whiteboard: tools above, contextual styles left. */
.side-panel {
  position: fixed;
  z-index: 7;
  left: 20px;
  top: 78px;
  width: 238px;
  padding: 14px;
  background: var(--chrome);
  border: 1px solid var(--edge);
  border-radius: 12px;
  box-shadow: 0 5px 20px #332f2010;
  color: #454d3e;
  touch-action: auto;
}
.side-panel[hidden] {
  display: none;
}
.side-panel h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #888b7b;
  font-weight: 500;
  margin: 5px 10px 14px;
}
.side-panel button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  font: 13px system-ui;
  color: #454d3e;
  padding: 12px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.side-panel button:hover {
  background: #ecefe4;
}
.side-panel button span {
  float: right;
  font-size: 11px;
  color: #929585;
}
.side-panel hr {
  border: 0;
  border-top: 1px solid #e5e3d8;
  margin: 10px 0;
}
.side-panel p {
  font-size: 11px;
  line-height: 1.8;
  color: #96988a;
  margin: 12px 10px;
}
#keys.visible {
  display: block;
  top: 85px;
  left: 280px;
  padding: 16px;
  background: var(--chrome);
  border-radius: 10px;
  border: 1px solid var(--edge);
  z-index: 7;
  color: #757b6b;
}
@media (min-width: 1000px) {
  .bottom {
    top: 20px;
    bottom: auto;
  }
  #board-header {
    gap: 10px;
  }
  .brand {
    font-size: 23px;
  }
  .brand img {
    width: 25px;
    height: 25px;
  }
  .board-details {
    position: fixed;
    left: 28px;
    top: 82px;
    padding: 0;
    border: 0;
  }
  #pop-style {
    display: block;
    left: 20px !important;
    top: 148px;
    bottom: auto;
    width: 202px;
    padding: 18px;
    max-height: calc(100vh - 170px);
    overflow-y: auto;
  }
  /* the sidebar is always open here, so its toggle would only duplicate it */
  #actions #trigger-style {
    display: none;
  }
  #pop-style section + section {
    margin-top: 22px;
  }
  #pop-style .grid {
    gap: 10px;
  }
  #actions {
    bottom: 20px;
  }
  #pop-shape {
    top: 84px;
    bottom: auto;
  }
  #hello {
    padding-left: 120px;
  }
  body.presenting .pop,
  body.viewing .pop {
    display: none !important;
  }
}
@media (min-width: 1000px) and (max-width: 1250px) {
  #present-button {
    display: none;
  }
}
.peer-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 3;
  pointer-events: none;
  background: var(--peer, #567259);
  color: white;
  font: 11px system-ui;
  padding: 3px 7px;
  border-radius: 0 5px 5px 5px;
}
.peer-cursor:before {
  content: "";
  position: absolute;
  left: -3px;
  top: -10px;
  border-left: 6px solid var(--peer, #567259);
  border-right: 5px solid transparent;
  border-bottom: 13px solid transparent;
}
#presence {
  display: flex;
  align-items: center;
  margin-right: 4px;
}
.peer-avatar {
  width: 30px;
  height: 30px;
  margin-left: -7px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #fffdf7;
  background: var(--peer);
  color: #fff;
  font:
    600 12px system-ui,
    -apple-system,
    sans-serif;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.peer-avatar:first-child {
  margin-left: 0;
}
.peer-avatar:hover {
  transform: translateY(-1px);
}
.peer-avatar[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--peer);
}
.peer-more {
  margin-left: 6px;
  font-size: 12px;
  color: var(--dim);
}
#follow-frame {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  box-shadow: inset 0 0 0 3px var(--follow);
}
#follow-banner {
  position: fixed;
  z-index: 5;
  left: 50%;
  top: max(78px, calc(env(safe-area-inset-top) + 66px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 14px;
  border-radius: 999px;
  background: var(--follow);
  color: #fff;
  font:
    500 13px system-ui,
    -apple-system,
    sans-serif;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}
#follow-banner button {
  border: 0;
  border-radius: 999px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
#follow-frame[hidden],
#follow-banner[hidden] {
  display: none;
}
#actions #laser-action {
  display: none;
}
body.viewing #actions #laser-action {
  display: grid;
}
#png-action[hidden] {
  display: none;
}
body.viewing #undo-action,
body.viewing #redo-action,
body.viewing #clear-board {
  display: none;
}
body.viewing #actions {
  bottom: calc(16px + env(safe-area-inset-bottom));
}
#actions .div:last-of-type {
  display: none;
}
@media (max-width: 420px) {
  #hello b {
    font-size: 32px;
  }
  #hello {
    padding-left: 12px;
    padding-right: 12px;
  }
}
