@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --dw-orange: #ff5a1f;
  --dw-ink: #171717;
  --dw-paper: #f5f3ef;
  --dw-panel: #ffffff;
  --dw-line: #dedbd5;
  --dw-muted: #77746e;
  --dw-shadow: 0 10px 35px rgba(25, 20, 14, .12);
  --dw-topbar: 66px;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { font-family: "Manrope", Arial, sans-serif; color: var(--dw-ink); background: var(--dw-paper); }
button, input { font: inherit; }
button { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.dw-topbar {
  position: fixed; z-index: 100; inset: 0 0 auto; height: var(--dw-topbar);
  display: grid; grid-template-columns: auto auto minmax(180px, 1fr) auto auto; align-items: center; gap: 14px;
  padding: 0 16px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--dw-line);
  box-shadow: 0 3px 18px rgba(18,16,13,.05); backdrop-filter: blur(16px);
}
.dw-brand { display: inline-flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.dw-brand-mark { width: 30px; height: auto; flex: 0 0 auto; object-fit: contain; }
.dw-brand > span { color: var(--dw-ink); font-size: 19px; font-weight: 800; letter-spacing: -.05em; line-height: 1; }
.dw-brand > span span { color: inherit; }
.dw-brand small {
  margin-left: 4px; padding: 4px 7px; border-radius: 99px; background: #fff0e9; color: #b63b0c;
  font: 9px "DM Mono", monospace; letter-spacing: .05em; text-transform: uppercase;
}
.dw-board-switcher {
  width: 36px; height: 36px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--dw-line); border-radius: 8px; background: white; cursor: pointer;
}
.dw-board-switcher:hover { border-color: #aaa69f; background: #faf9f7; }
.dw-board-switcher svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.dw-board-name { justify-self: center; width: min(390px, 100%); }
.dw-board-name input {
  width: 100%; padding: 8px 12px; border: 1px solid transparent; border-radius: 7px;
  background: transparent; text-align: center; font-weight: 700; outline: none;
}
.dw-board-name input:hover, .dw-board-name input:focus { border-color: var(--dw-line); background: white; }
.dw-save-state { display: flex; align-items: center; gap: 7px; color: var(--dw-muted); font: 10px "DM Mono", monospace; white-space: nowrap; }
.dw-save-state span { width: 7px; height: 7px; border-radius: 50%; background: #44aa6b; }
.dw-save-state.saving span { background: #e5a52e; }
.dw-save-state.offline span { background: #cf4931; }
.dw-collaboration { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.dw-participants {
  display: flex; flex-direction: row-reverse; justify-content: flex-start; min-width: 28px;
  padding: 0; border: 0; background: transparent; cursor: pointer;
}
.dw-participant {
  width: 28px; height: 28px; display: grid; place-items: center; margin-left: -7px;
  border: 2px solid white; border-radius: 50%; color: white; font-size: 10px; font-weight: 800;
  box-shadow: 0 2px 7px rgba(0,0,0,.12);
}
.dw-top-actions { display: flex; align-items: center; gap: 8px; }
.dw-icon-button, .dw-secondary-button, .dw-share-button, .dw-account-button {
  height: 38px; border: 1px solid var(--dw-line); border-radius: 7px; background: white; cursor: pointer;
}
.dw-icon-button { width: 38px; display: grid; place-items: center; }
.dw-icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dw-secondary-button, .dw-share-button { padding: 0 16px; font-size: 12px; font-weight: 700; }
.dw-share-button { border-color: var(--dw-ink); background: var(--dw-ink); color: white; }
.dw-account-button {
  width: 36px; padding: 0; border-radius: 50%; border-color: var(--dw-orange);
  background: var(--dw-orange); color: white; font-size: 10px; font-weight: 800; cursor: pointer;
}
.dw-icon-button:hover, .dw-secondary-button:hover { border-color: #aaa69f; background: #faf9f7; }
.dw-share-button:hover { background: var(--dw-orange); border-color: var(--dw-orange); }

.dw-workspace { position: fixed; inset: var(--dw-topbar) 0 0; }
.dw-viewport {
  position: absolute; inset: 0; overflow: hidden; background: #ebe9e4; cursor: default; outline: none;
}
.dw-viewport.tool-hand, .dw-viewport.is-panning { cursor: grab; }
.dw-viewport.is-panning { cursor: grabbing; }
.dw-viewport.tool-sticky, .dw-viewport.tool-text, .dw-viewport.tool-rectangle,
.dw-viewport.tool-circle, .dw-viewport.tool-connector { cursor: crosshair; }
.dw-canvas {
  position: absolute; z-index: 1; left: 0; top: 0; width: 4000px; height: 3000px;
  transform-origin: 0 0; background-color: #f8f7f4;
  background-image: radial-gradient(circle, #cbc8c1 1px, transparent 1px);
  background-size: 24px 24px; box-shadow: 0 0 0 1px rgba(0,0,0,.04);
  will-change: transform;
}
.dw-connectors, .dw-object-layer, .dw-live-cursors { position: absolute; inset: 0; width: 100%; height: 100%; }
.dw-connectors { z-index: 1; overflow: visible; pointer-events: none; }
.dw-connectors line { stroke: #4f4b45; stroke-width: 3; marker-end: url(#arrowhead); }
.dw-object-layer { z-index: 2; pointer-events: none; }
.dw-live-cursors { z-index: 30; pointer-events: none; }
.dw-live-cursor {
  position: absolute; display: flex; align-items: flex-start; gap: 4px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.16)); transition: left .16s linear, top .16s linear;
}
.dw-live-cursor svg { width: 20px; height: 24px; fill: var(--cursor-colour); stroke: white; stroke-width: 1.5; }
.dw-live-cursor span {
  margin-top: 15px; padding: 4px 7px; border-radius: 4px; background: var(--cursor-colour);
  color: white; font-size: 10px; font-weight: 700; line-height: 1; white-space: nowrap;
}
.board-object {
  position: absolute; display: flex; align-items: center; justify-content: center;
  padding: 18px; color: #202020; pointer-events: auto; cursor: move; user-select: none;
  overflow: hidden; overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.32;
  transition: box-shadow .12s, outline-color .12s;
}
.board-object:hover { box-shadow: 0 8px 25px rgba(30,25,18,.13); }
.board-object.selected { z-index: 20 !important; outline: 3px solid var(--dw-orange); outline-offset: 4px; box-shadow: 0 10px 32px rgba(30,25,18,.18); }
.board-object.connect-source { outline: 4px solid #1e73d8; outline-offset: 5px; }
.board-object.editing { cursor: text; user-select: text; outline: 3px solid #1e73d8; }
.board-object.sticky { align-items: flex-start; justify-content: flex-start; padding: 24px; font-size: 18px; font-weight: 600; box-shadow: 0 8px 18px rgba(43,37,28,.14); }
.board-object.sticky::after {
  content: ""; position: absolute; right: 0; bottom: 0; width: 22px; height: 22px;
  background: linear-gradient(135deg, rgba(0,0,0,.08) 0 49%, rgba(255,255,255,.36) 51% 100%);
}
.board-object.text { justify-content: flex-start; padding: 4px; background: transparent !important; font-size: 30px; font-weight: 700; letter-spacing: -.04em; }
.board-object.rectangle { border: 2px solid rgba(30,30,30,.55); border-radius: 8px; background: white; font-size: 16px; font-weight: 700; text-align: center; }
.board-object.circle { border: 2px solid rgba(30,30,30,.55); border-radius: 50%; background: white; font-size: 15px; font-weight: 700; text-align: center; }
.board-object.image { padding: 0; background: white; border: 1px solid rgba(30,30,30,.12); border-radius: 5px; }
.board-object.image img { width: 100%; height: 100%; display: block; object-fit: contain; pointer-events: none; }
.board-object [contenteditable="true"] { width: 100%; height: 100%; outline: none; cursor: text; user-select: text; }

.dw-toolbar {
  position: absolute; z-index: 50; left: 18px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 5px; padding: 7px;
  background: rgba(255,255,255,.97); border: 1px solid var(--dw-line); border-radius: 12px; box-shadow: var(--dw-shadow);
}
.dw-tool {
  width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 8px;
  background: transparent; cursor: pointer;
}
.dw-tool:hover { background: #f2f0eb; }
.dw-tool.active { background: var(--dw-ink); color: white; }
.dw-tool.danger:hover { background: #fff0ec; color: #bd3718; }
.dw-tool svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dw-tool-divider { width: 28px; height: 1px; margin: 3px auto; background: var(--dw-line); }

.dw-inspector {
  position: absolute; z-index: 40; right: 18px; top: 18px; width: 230px; min-height: 145px;
  padding: 20px; background: rgba(255,255,255,.97); border: 1px solid var(--dw-line);
  border-radius: 12px; box-shadow: var(--dw-shadow); backdrop-filter: blur(15px);
}
.dw-inspector-empty span { font-size: 12px; font-weight: 800; }
.dw-inspector-empty p { margin: 9px 0 0; color: var(--dw-muted); font-size: 12px; line-height: 1.5; }
.dw-inspector-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.dw-inspector-heading span, .dw-property-label { color: var(--dw-muted); font: 9px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .09em; }
.dw-inspector-heading strong { display: block; margin-top: 4px; font-size: 14px; text-transform: capitalize; }
.dw-inspector-heading button { width: 27px; height: 27px; border: 0; border-radius: 6px; background: #f2f0eb; cursor: pointer; font-size: 19px; line-height: 1; }
.dw-colours { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin: 10px 0 22px; }
.dw-colours button { aspect-ratio: 1; border: 1px solid #bdb9b2; border-radius: 50%; background: var(--swatch); cursor: pointer; }
.dw-colours button.active { outline: 2px solid var(--dw-ink); outline-offset: 2px; }
.dw-property-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dw-property-grid label { color: var(--dw-muted); font: 9px "DM Mono", monospace; }
.dw-property-grid input { width: 100%; margin-top: 5px; padding: 8px; border: 1px solid var(--dw-line); border-radius: 6px; font: 11px "DM Mono", monospace; outline: none; }
.dw-property-grid input:focus { border-color: var(--dw-orange); }
.dw-inspector-button { width: 100%; margin-top: 12px; padding: 9px; border: 1px solid var(--dw-line); border-radius: 6px; background: white; cursor: pointer; font-size: 11px; font-weight: 700; }

.dw-zoom-controls {
  position: absolute; z-index: 30; left: 18px; bottom: 18px; display: flex; align-items: center;
  overflow: hidden; background: white; border: 1px solid var(--dw-line); border-radius: 9px; box-shadow: 0 5px 18px rgba(30,25,18,.1);
}
.dw-zoom-controls button { width: 38px; height: 36px; border: 0; border-right: 1px solid var(--dw-line); background: white; cursor: pointer; }
.dw-zoom-controls button:last-child { border-right: 0; }
.dw-zoom-controls button:hover { background: #f4f2ed; }
.dw-zoom-controls .dw-zoom-value { width: 58px; font: 10px "DM Mono", monospace; }
.dw-zoom-controls svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.dw-shortcut-hint {
  position: absolute; z-index: 20; left: 50%; bottom: 22px; transform: translateX(-50%);
  padding: 8px 12px; border-radius: 99px; background: rgba(255,255,255,.88); color: var(--dw-muted);
  font: 9px "DM Mono", monospace; white-space: nowrap; pointer-events: none;
}
.dw-room-note {
  position: absolute; z-index: 20; right: 18px; bottom: 22px; padding: 8px 11px;
  border-radius: 7px; background: rgba(255,255,255,.88); color: var(--dw-muted);
  font: 9px "DM Mono", monospace; pointer-events: none;
}
.dw-canvas-hint {
  position: absolute; z-index: 10; left: 50%; top: 50%; transform: translate(-50%,-50%);
  display: none; flex-direction: column; align-items: center; gap: 6px; color: var(--dw-muted); pointer-events: none;
}
.dw-canvas-hint strong { color: var(--dw-ink); font-size: 20px; }
.dw-canvas-hint span { font-size: 12px; }
.dw-canvas-hint.visible { display: flex; }
.dw-toast {
  position: fixed; z-index: 200; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  max-width: min(430px, calc(100vw - 30px)); padding: 11px 16px; border-radius: 8px;
  background: var(--dw-ink); color: white; font-size: 12px; box-shadow: var(--dw-shadow);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.dw-toast.visible { opacity: 1; transform: translate(-50%, 0); }

.dw-auth-shell {
  position: fixed; z-index: 1000; inset: 0; display: grid; grid-template-columns: minmax(300px, 1fr) minmax(440px, .72fr);
  padding: clamp(24px, 5vw, 80px); background:
    radial-gradient(circle at 20% 25%, rgba(255,255,255,.25), transparent 28%),
    linear-gradient(125deg, #ff6a27 0 54%, #f5f3ef 54% 100%);
}
.dw-auth-shell[hidden] { display: none; }
.dw-auth-brand { display: flex; align-items: center; gap: 15px; color: #1d1b19; }
.dw-auth-brand .dw-brand-mark { width: 52px; }
.dw-auth-brand > span { font-size: clamp(30px, 4vw, 58px); font-weight: 800; letter-spacing: -.07em; line-height: .9; }
.dw-auth-brand > span span { color: inherit; }
.dw-auth-card {
  align-self: center; width: 100%; max-width: 460px; min-width: 0; justify-self: center; padding: clamp(28px, 4vw, 48px);
  border: 1px solid rgba(20,18,15,.1); border-radius: 18px; background: rgba(255,255,255,.96);
  box-shadow: 0 28px 90px rgba(63,29,11,.18);
}
.dw-eyebrow { color: var(--dw-orange); font: 10px "DM Mono", monospace; letter-spacing: .09em; text-transform: uppercase; }
.dw-auth-card h1, .dw-dialog h2 { margin: 12px 0 8px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.05em; }
.dw-auth-card > p, .dw-dialog > p { margin: 0; color: var(--dw-muted); font-size: 13px; line-height: 1.55; }
.dw-auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 28px 0 20px; padding: 4px; border-radius: 9px; background: #efede8; }
.dw-auth-tabs button { min-width: 0; padding: 9px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; white-space: nowrap; }
.dw-auth-tabs button.active { background: white; box-shadow: 0 2px 8px rgba(20,18,15,.08); }
.dw-auth-form { display: grid; gap: 14px; }
.dw-auth-form .dw-register-field[hidden] { display: none; }
.dw-auth-form label, .dw-dialog label { display: grid; gap: 7px; color: #494641; font-size: 11px; font-weight: 700; }
.dw-auth-form input, .dw-link-field input {
  width: 100%; height: 45px; padding: 0 13px; border: 1px solid var(--dw-line); border-radius: 8px; background: white; outline: none; font-size: 13px;
}
.dw-auth-form input:focus, .dw-link-field input:focus { border-color: var(--dw-orange); box-shadow: 0 0 0 3px rgba(255,90,31,.1); }
.dw-auth-error { min-height: 18px; margin: -2px 0; color: #bd3718; font-size: 11px; }
.dw-auth-submit { height: 47px; border: 0; border-radius: 8px; background: var(--dw-ink); color: white; cursor: pointer; font-size: 12px; font-weight: 800; }
.dw-auth-submit:hover { background: var(--dw-orange); }
.dw-auth-submit:disabled { opacity: .55; cursor: wait; }
.dw-auth-card > small { display: block; margin-top: 18px; color: var(--dw-muted); font-size: 9px; line-height: 1.5; }

.dw-scrim { position: fixed; z-index: 300; inset: 0; background: rgba(18,16,13,.34); backdrop-filter: blur(2px); }
.dw-board-panel, .dw-account-panel, .dw-dialog {
  position: fixed; z-index: 310; background: white; border: 1px solid var(--dw-line); box-shadow: 0 24px 70px rgba(20,18,15,.2);
}
.dw-board-panel {
  left: 0; top: 0; bottom: 0; width: min(360px, 92vw); padding: 22px;
  transform: translateX(-105%); transition: transform .2s ease;
}
.dw-board-panel.open { transform: translateX(0); }
.dw-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.dw-panel-heading span { display: block; color: var(--dw-muted); font: 9px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .09em; }
.dw-panel-heading strong { display: block; margin-top: 4px; font-size: 24px; letter-spacing: -.04em; }
.dw-panel-heading button, .dw-dialog-close { width: 34px; height: 34px; border: 0; border-radius: 7px; background: #f1efeb; cursor: pointer; font-size: 21px; }
.dw-new-board { width: 100%; padding: 12px; border: 1px solid var(--dw-ink); border-radius: 8px; background: var(--dw-ink); color: white; cursor: pointer; font-size: 12px; font-weight: 700; text-align: left; }
.dw-new-board span { margin-right: 8px; color: var(--dw-orange); font-size: 18px; }
.dw-board-list { display: grid; gap: 7px; margin-top: 20px; }
.dw-board-item {
  display: grid; grid-template-columns: 40px 1fr; gap: 11px; align-items: center; width: 100%;
  padding: 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; cursor: pointer; text-align: left;
}
.dw-board-item:hover, .dw-board-item.active { border-color: var(--dw-line); background: #f7f5f1; }
.dw-board-item > span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 7px; background: #fff0e9; color: var(--dw-orange); font-weight: 800; }
.dw-board-item strong, .dw-board-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-board-item strong { font-size: 12px; }
.dw-board-item small { margin-top: 4px; color: var(--dw-muted); font-size: 9px; text-transform: capitalize; }
.dw-account-panel { top: 58px; right: 14px; width: min(300px, calc(100vw - 28px)); padding: 16px; border-radius: 12px; display: none; }
.dw-account-panel.open { display: block; }
.dw-account-summary { display: grid; grid-template-columns: 42px 1fr; gap: 11px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--dw-line); }
.dw-account-summary > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--dw-orange); color: white; font-size: 11px; font-weight: 800; }
.dw-account-summary strong, .dw-account-summary small { display: block; }
.dw-account-summary strong { font-size: 12px; }
.dw-account-summary small { margin-top: 4px; color: var(--dw-muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
.dw-account-panel > button { width: 100%; margin-top: 12px; padding: 10px; border: 0; border-radius: 7px; background: #f3f1ed; cursor: pointer; text-align: left; font-size: 11px; font-weight: 700; }
.dw-dialog { left: 50%; top: 50%; width: min(500px, calc(100vw - 28px)); padding: 32px; border-radius: 16px; transform: translate(-50%,-50%); }
.dw-dialog[hidden] { display: none; }
.dw-dialog-close { position: absolute; top: 14px; right: 14px; }
.dw-dialog h2 { font-size: 30px; }
.dw-dialog label { margin-top: 24px; }
.dw-link-field { display: grid; grid-template-columns: 1fr auto; }
.dw-link-field input { border-radius: 8px 0 0 8px; font: 10px "DM Mono", monospace; }
.dw-link-field button { padding: 0 17px; border: 0; border-radius: 0 8px 8px 0; background: var(--dw-orange); color: white; cursor: pointer; font-size: 11px; font-weight: 800; }

@media (max-width: 900px) {
  .dw-topbar { grid-template-columns: auto auto 1fr auto auto; gap: 8px; }
  .dw-save-state { display: none; }
  .dw-board-name { justify-self: stretch; }
  .dw-inspector { display: none; }
  .dw-brand small, .dw-secondary-button { display: none; }
  .dw-shortcut-hint { display: none; }
  .dw-room-note { right: 12px; bottom: 22px; max-width: 210px; }
}

@media (max-width: 600px) {
  :root { --dw-topbar: 58px; }
  .dw-topbar { padding: 0 8px; grid-template-columns: auto auto minmax(0,1fr) auto; }
  .dw-brand > span { font-size: 17px; }
  .dw-brand-mark { width: 23px; }
  .dw-board-name input { padding: 7px 5px; font-size: 12px; text-align: left; }
  .dw-board-switcher { width: 32px; height: 32px; }
  .dw-collaboration { display: none; }
  .dw-top-actions { gap: 5px; }
  .dw-top-actions .dw-icon-button { display: none; }
  .dw-share-button { height: 34px; padding: 0 12px; }
  .dw-account-button { width: 32px; height: 32px; }
  .dw-toolbar {
    left: 10px; right: 10px; top: auto; bottom: 10px; transform: none;
    flex-direction: row; justify-content: flex-start; overflow-x: auto; gap: 3px; padding: 6px;
  }
  .dw-tool { flex: 0 0 40px; width: 40px; height: 40px; }
  .dw-tool-divider { flex: 0 0 1px; width: 1px; height: 28px; margin: 6px 3px; }
  .dw-zoom-controls { left: 10px; bottom: 68px; }
  .dw-toast { bottom: 122px; }
  .dw-room-note { display: none; }
  .dw-auth-shell { grid-template-columns: 1fr; padding: 18px; background: linear-gradient(155deg, #ff6a27 0 28%, #f5f3ef 28% 100%); overflow-y: auto; }
  .dw-auth-brand { margin: 12px 0 45px; }
  .dw-auth-brand .dw-brand-mark { width: 33px; }
  .dw-auth-brand > span { font-size: 34px; }
  .dw-auth-card { width: 100%; max-width: 100%; padding: 27px 22px; }
  .dw-dialog { padding: 27px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
