/* Office Board. Scoped to this workspace; the rest of Sunny stays unchanged. */
#view-board {
  --wb-paper: #faf9f5; --wb-surface: #fffefa; --wb-ink: #333a35;
  --wb-muted: #757c73; --wb-line: #e1e3db; --wb-accent: #426650;
  --wb-active: #e8efe5; --wb-shadow: 0 4px 18px #343c3010, 0 1px 3px #343c3008;
  color: var(--wb-ink);
}
[data-theme='dark'] #view-board {
  --wb-paper: #202722; --wb-surface: #2b332d; --wb-ink: #e4eadd;
  --wb-muted: #acb6a7; --wb-line: #445046; --wb-accent: #c1d7b5;
  --wb-active: #3c4b3b; --wb-shadow: 0 4px 18px #101a152e;
}
#view-board button { font-family: var(--font); touch-action: manipulation; }
#view-board button:focus-visible, #board-canvas:focus-visible { outline: 2px solid var(--wb-accent); outline-offset: 3px; }
#view-board .wb-eyebrow { margin: 0 0 9px; color: var(--wb-muted); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
#view-board .wb-gallery-head { align-items: center; margin-bottom: 32px; }
#view-board .wb-gallery-head h2 { box-shadow: none; font-size: clamp(30px, 3vw, 42px); letter-spacing: -.045em; margin: 0; }
.wb-subtitle { margin: 10px 0 0; color: var(--wb-muted); font-size: 14px; }
#view-board .boards-grid { grid-template-columns: repeat(auto-fill,minmax(250px,1fr)); gap: 24px; }
#view-board .board-card { position: relative; overflow: hidden; padding: 0; border: 1px solid var(--wb-line); background: var(--wb-surface); box-shadow: none; border-radius: 14px; cursor: pointer; transition: transform .18s, box-shadow .18s; }
#view-board .board-card:hover { transform: translateY(-3px); box-shadow: var(--wb-shadow); }
#view-board .board-thumb { border: 0; border-bottom: 1px solid var(--wb-line); border-radius: 0; margin: 0; background: var(--wb-paper); }
#view-board .board-thumb canvas { width: 100%; aspect-ratio: 16/10; transform: none; filter: none; opacity: 1; animation: none; }
#view-board .board-card h3 { margin: 16px 18px 3px; color: var(--wb-ink); font-size: 16px; }
#view-board .board-card-sub { margin: 0 12px 12px 18px; color: var(--wb-muted); font-size: 12px; }
#view-board .board-del { opacity: 1; }
.wb-gallery-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(50px,10vh,110px) 24px; border: 1px dashed var(--wb-line); border-radius: 18px; background: var(--wb-paper); }
.wb-empty-icon { display: grid; place-items: center; width: 68px; height: 76px; background: #f4e8ac; color: #6f6740; border-radius: 6px 6px 20px 6px; transform: rotate(-7deg); margin-bottom: 20px; }
.wb-empty-icon .ic { width: 28px; height: 28px; }
.wb-gallery-empty h3 { font-size: 25px; letter-spacing: -.03em; margin: 8px 0; }
.wb-gallery-empty p { color: var(--wb-muted); max-width: 340px; margin: 0 0 24px; }
#board-editor { height: calc(100dvh - 130px); min-height: 490px; display: flex; flex-direction: column; background: var(--wb-paper); border: 1px solid var(--wb-line); border-radius: 16px; overflow: hidden; position: relative; }
#view-board.wb-editing > .wb-gallery-head, #view-board.wb-editing > #boards-empty { display: none; }
/* The shell's entrance animation otherwise makes fixed editors relative to
   the view, clipping focus mode and the phone layout to the content column. */
#view-board.wb-editing { animation: none; transform: none; }
#view-board .wb-button { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 13px; background: transparent; border: 0; border-radius: 9px; box-shadow: none; color: var(--wb-ink); font: 500 13px var(--font); cursor: pointer; transition: background .16s, transform .16s; text-decoration: none; }
#view-board .wb-button:hover { background: var(--wb-active); transform: none; }
#view-board .wb-button:active { transform: scale(.96); }
#view-board .wb-button:disabled { opacity: .32; cursor: default; transform: none; }
#view-board .wb-square { width: 44px; padding: 0; }
#view-board .wb-button .ic { width: 18px; height: 18px; flex-shrink: 0; }
#view-board .wb-primary { background: var(--wb-accent); color: var(--wb-surface); padding-inline: 18px; }
#view-board .wb-primary:hover { background: var(--wb-accent); filter: brightness(.94); }
#view-board .wb-danger { color: var(--tomato-deep); }
.wb-header { display: flex; align-items: center; gap: 9px; padding: 11px 14px; min-height: 74px; flex-shrink: 0; background: var(--wb-surface); border-bottom: 1px solid var(--wb-line); z-index: 5; }
.wb-document { flex: 1; min-width: 0; }
.wb-title-button { border: 0; background: transparent; color: inherit; display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 0; cursor: pointer; font-size: 15px; font-weight: 700; }
#board-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-title-button .ic { width: 13px; height: 13px; flex-shrink: 0; color: var(--wb-muted); }
.wb-save { display: block; color: var(--wb-muted); font-size: 11px; margin-top: 3px; }
.wb-save { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-save[data-state='error'] { color: var(--tomato-deep); }
.wb-header-actions { display: flex; align-items: center; gap: 2px; }
#view-board .board-wrap { flex: 1; min-height: 0; height: auto; width: 100%; border: 0; border-radius: 0; box-shadow: none; background: var(--wb-paper); overflow: hidden; isolation: isolate; }
#board-canvas { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: contain; }
#board-canvas[data-tool='select'] { cursor: default; }
#board-canvas[data-tool='eraser'] { cursor: crosshair; }
.wb-floating { background: var(--wb-surface); border: 1px solid var(--wb-line); border-radius: 13px; box-shadow: var(--wb-shadow); }
.wb-options { position: absolute; z-index: 2; top: 18px; left: 18px; display: flex; align-items: center; padding: 5px 9px; gap: 6px; max-width: calc(100% - 36px); }
.wb-tool-label { font-size: 12px; font-weight: 700; padding: 0 9px 0 5px; min-width: 44px; }
.wb-divider { width: 1px; height: 24px; background: var(--wb-line); flex-shrink: 0; margin: 0 3px; }
.wb-colors, .wb-widths { display: flex; align-items: center; }
.wb-color, .wb-width { border: 0; background: transparent; width: 36px; height: 40px; display: grid; place-items: center; border-radius: 8px; cursor: pointer; color: var(--wb-ink); }
.wb-color i { display: block; width: 19px; height: 19px; background: var(--swatch); border-radius: 50%; box-shadow: inset 0 0 0 1px #00000015; }
.wb-color[aria-pressed='true'] i { outline: 2px solid var(--wb-accent); outline-offset: 4px; }
.wb-width[aria-pressed='true'] { background: var(--wb-active); }
.wb-width i { background: currentColor; border-radius: 50%; }
.wb-canvas-empty { position: absolute; top: 44%; left: 50%; transform: translate(-50%,-50%); text-align: center; width: min(500px,calc(100% - 38px)); pointer-events: none; }
.wb-canvas-empty h3 { font-size: clamp(25px,3vw,38px); font-weight: 500; letter-spacing: -.045em; margin: 10px 0; }
.wb-canvas-empty p { color: var(--wb-muted); font-size: 14px; margin: 0 0 24px; }
.wb-canvas-empty > div { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; pointer-events: auto; }
.wb-empty-caption { display: block; margin-top: 24px; font-size: 11px; color: var(--wb-muted); }
.wb-bottom { position: absolute; bottom: 36px; left: 18px; right: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none; z-index: 3; }
.wb-bottom > * { pointer-events: auto; }
.wb-dock { display: flex; align-items: center; gap: 2px; padding: 6px; }
.wb-tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 46px; height: 54px; padding: 4px 0; border: 0; border-radius: 9px; background: transparent; color: var(--wb-muted); cursor: pointer; transition: background .16s,color .16s; }
.wb-tool .ic { width: 20px; height: 20px; stroke-width: 1.8; }
.wb-tool > span { font-size: 9px; font-weight: 700; }
.wb-tool:hover { background: var(--wb-active); color: var(--wb-ink); }
.wb-tool[aria-pressed='true'] { background: var(--wb-accent); color: var(--wb-surface); }
.wb-history, .wb-zoom { display: flex; align-items: center; padding: 3px; }
#board-zoom-label { min-width: 48px; font-size: 11px; padding: 0; font-variant-numeric: tabular-nums; }
.wb-gesture-hint { position: absolute; bottom: 11px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--wb-muted); pointer-events: none; }
.wb-notice { position: absolute; z-index: 9; left: 50%; bottom: 185px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 40px); padding: 11px 16px; background: var(--wb-surface); color: var(--wb-ink); border: 1px solid var(--wb-line); border-radius: 9px; box-shadow: var(--wb-shadow); font-size: 12px; text-align: center; pointer-events: none; }
.wb-notice[data-error='true'] { color: var(--tomato-deep); }
.wb-selection { position: absolute; top: 84px; left: 18px; z-index: 3; padding: 3px 6px 3px 12px; display: flex; align-items: center; gap: 4px; }
#board-selection-label { font-size: 12px; margin-right: 6px; }
.wb-panel { position: absolute; z-index: 7; right: 0; top: 0; bottom: 0; width: min(340px,100%); padding: 22px; background: var(--wb-surface); border-left: 1px solid var(--wb-line); box-shadow: -10px 0 35px #343c3008; display: flex; flex-direction: column; }
.wb-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wb-panel-head h3 { margin: 0; font-size: 23px; letter-spacing: -.03em; font-weight: 700; }
.wb-panel-description { color: var(--wb-muted); font-size: 12px; line-height: 1.7; margin: 16px 0; }
#view-board input:not([type='checkbox']), #view-board textarea, #view-board select { font-family: var(--font); border: 1px solid var(--wb-line); background: var(--wb-surface); color: var(--wb-ink); border-radius: 8px; box-shadow: none; }
#board-note-search { width: 100%; min-height: 44px; padding: 10px 12px; }
.wb-note-list { overflow-y: auto; margin-top: 18px; overscroll-behavior: contain; }
.wb-library-note { display: block; position: relative; width: 100%; background: var(--wb-paper); color: var(--wb-ink); text-align: left; border: 1px solid var(--wb-line); border-radius: 8px; padding: 16px; margin: 0 0 12px; cursor: pointer; }
.wb-library-note strong { font-size: 14px; display: block; margin-bottom: 8px; }
.wb-library-note p { color: var(--wb-muted); font-size: 12px; line-height: 1.6; margin: 0 0 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.wb-library-note > span { font-size: 11px; font-weight: 700; color: var(--wb-accent); }
.wb-library-note:hover { border-color: var(--wb-accent); }
.wb-settings { position: absolute; right: 16px; top: 14px; z-index: 8; padding: 22px; width: min(330px,calc(100% - 32px)); max-height: calc(100% - 28px); overflow: auto; }
.wb-settings h3 { font-size: 17px; margin: 0 0 14px; }
.wb-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; padding: 12px 0; border-bottom: 1px solid var(--wb-line); }
.wb-setting small { display: block; font-size: 11px; color: var(--wb-muted); margin-top: 3px; }
.wb-setting input[type='checkbox'] { width: 22px; height: 22px; accent-color: var(--wb-accent); flex-shrink: 0; margin: 0; cursor: pointer; }
.wb-setting select { width: 132px; padding: 8px; font-size: 12px; }
.wb-setting-help { font-size: 12px; line-height: 1.7; color: var(--wb-muted); margin: 18px 0; }
.wb-settings > .wb-button { width: 100%; justify-content: flex-start !important; }
.wb-note-editor { position: absolute; inset: 0; z-index: 10; background: #2029203d; display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.wb-note-form { width: min(440px,100%); background: var(--wb-surface); padding: 24px; border-radius: 15px; box-shadow: 0 20px 70px #20292030; }
#board-note-title { width: 100%; padding: 12px 0; border: 0 !important; margin-top: 18px; font-size: 19px; font-weight: 700; }
#board-note-content { width: 100%; padding: 12px 0; border: 0 !important; resize: vertical; font-size: 16px; line-height: 1.7; min-height: 120px; max-height: 36dvh; }
.wb-note-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 14px; }
#board-note-papers { display: flex; }
#board-note-papers .wb-color { width: 32px; }
.wb-name-dialog { color: var(--wb-ink); background: var(--wb-surface); border: 1px solid var(--wb-line); border-radius: 16px; padding: 28px; width: min(420px,calc(100% - 32px)); box-shadow: var(--wb-shadow); }
.wb-name-dialog::backdrop { background: #20292050; }
.wb-name-dialog h3 { font-size: 24px; letter-spacing: -.03em; margin: 0 0 24px; }
.wb-name-dialog label { font-size: 12px; }
#board-name-input { width: 100%; margin: 8px 0 0; padding: 12px; font-size: 16px; }
#board-name-error { color: var(--tomato-deep); font-size: 12px; }
#board-name-form > div { display: flex; justify-content: flex-end; gap: 6px; margin-top: 22px; }
#view-board #board-editor:fullscreen, #view-board #board-editor.board-fs-css { height: 100dvh; width: 100%; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; }
#view-board #board-editor.board-fs-css { position: fixed; inset: 0; z-index: 500; }
#view-board #board-editor:fullscreen #board-toolbar, #view-board #board-editor.board-fs-css #board-toolbar { margin: 0; }
#view-board #board-editor:fullscreen .board-wrap, #view-board #board-editor.board-fs-css .board-wrap { border-radius: 0; }
@media (max-width: 1250px) {
  .wb-bottom { bottom: 34px; justify-content: center; }
  .wb-history { position: absolute; left: 0; bottom: 84px; }
  .wb-zoom { position: absolute; right: 0; bottom: 84px; }
}
@media (pointer: coarse) {
  .wb-color, .wb-width { min-width: 40px; min-height: 44px; }
  .wb-tool { width: 48px; height: 57px; }
}
@media (max-width: 700px) {
  #view-board.wb-editing #board-editor { position: fixed; inset: 0; z-index: 500; height: 100dvh; width: 100%; min-height: 0; margin: 0; border: 0; border-radius: 0; }
  .wb-header { padding: max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) 8px max(8px,env(safe-area-inset-left)); min-height: 66px; gap: 3px; }
  .wb-header-actions .wb-button { width: 40px; min-height: 44px; padding: 0; }
  .wb-header-actions .wb-button > span { display: none; }
  .wb-title-button { font-size: 13px; }
  .wb-save { font-size: 10px; }
  .wb-header > .wb-square { width: 36px !important; }
  .wb-options { top: 12px; left: 12px; right: 12px; max-width: none; padding: 3px 6px; gap: 0; width: fit-content; }
  .wb-tool-label { display: none; }
  .wb-color, .wb-width { width: 34px; min-width: 34px; height: 44px; }
  .wb-options .wb-divider { margin-inline: 4px; }
  .wb-options .wb-color i { width: 17px; height: 17px; }
  .wb-bottom { left: 8px; right: 8px; bottom: max(30px,env(safe-area-inset-bottom)); }
  .wb-dock { overflow-x: auto; max-width: 100%; scrollbar-width: thin; padding: 5px; border-radius: 12px; justify-content: flex-start; }
  .wb-tool { width: 44px; min-width: 44px; height: 52px; gap: 4px; }
  .wb-dock .wb-divider { margin: 0 2px; height: 24px; }
  .wb-history, .wb-zoom { bottom: 76px; }
  .wb-zoom .wb-square { width: 36px !important; }
  .wb-zoom .wb-divider { margin: 0; }
  .wb-gesture-hint { bottom: 10px; font-size: 9px; }
  .wb-selection { top: 75px; left: 12px; }
  .wb-canvas-empty { top: 40%; }
  .wb-canvas-empty p { font-size: 12px; margin-bottom: 16px; }
  .wb-canvas-empty .wb-empty-caption { margin-top: 16px; font-size: 10px; }
  .wb-canvas-empty .wb-eyebrow { font-size: 9px; }
  .wb-canvas-empty .wb-button { font-size: 12px !important; padding-inline: 12px !important; }
  .wb-gallery-empty h3 { font-size: 23px; }
  .wb-gallery-empty p { font-size: 13px; }
  .wb-note-form { padding: 18px; }
  .wb-note-footer { flex-wrap: wrap; }
}
@media (max-height: 570px) and (orientation: landscape) {
  #board-editor { min-height: 310px; }
  .wb-header { min-height: 54px; padding-block: 3px; }
  .wb-gesture-hint { display: none; }
  .wb-bottom { bottom: 10px; }
  .wb-canvas-empty .wb-empty-caption, .wb-canvas-empty .wb-eyebrow { display: none; }
  .wb-canvas-empty h3 { font-size: 22px; }
  .wb-canvas-empty p { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  #view-board *, #view-board *::before, #view-board *::after { animation: none !important; transition: none !important; }
}
