/* Keep the supplied whiteboard's complete visual system; refine touch and print. */
:focus-visible { outline: 3px solid #818cf8; outline-offset: 3px; }
html { scroll-padding-top: 12px; }
body { font-family: Inter, 'Noto Sans Devanagari', system-ui, sans-serif; }
.board-language { font-size: 11px; padding: 5px; border: 1px solid var(--ui-border); border-radius: 7px; }
.board-menu-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.board-menu-grid > * { font-size: 12px; padding: 10px; text-align: left; border-radius: 9px; background: rgba(99,102,241,.09); }
#printBoardPages { display: none; }
@media (max-width:1599px) { #topAppHeader > div:nth-child(2) { display:none!important; } }
#whiteboardViewport { height: calc(100dvh - 48px); }
#leftMainToolbar { max-height: calc(100dvh - 110px); scrollbar-width: thin; }
#subToolPanel { max-height: calc(100dvh - 140px); }
#selectionContextBar { max-width: calc(100vw - 24px); flex-wrap: wrap; }
body.focus-mode #whiteboardViewport, body.presentation-mode #whiteboardViewport { height: 100dvh !important; }
body.focus-mode #presentationFloatingBar, body.presentation-mode #presentationFloatingBar { display: flex !important; }
body.presentation-mode #leftMainToolbar, body.presentation-mode #subToolPanel { visibility: hidden; }
@media (min-width:640px) and (max-height:830px) { #leftMainToolbar { overflow-y: auto !important; } .tool-btn { flex-shrink:0; } }
@media (max-width:639px) {
  #fullscreenBtn, #uiThemeBtn, #shortcutsModalBtn, #openClearModalBtn, #openTemplatesBtn { display:none!important; }
  #topAppHeader > :last-child { flex-shrink:0; }
  #topAppHeader { gap:3px; padding-inline:5px; }
  #topAppHeader > :first-child { flex:1; min-width:80px; }
  #boardTitleInput { width:62px; min-width:0; font-size:11px; padding-inline:3px; }
  #topAppHeader a > div:first-child { width:26px; height:26px; }
  #topAppHeader .tool-btn { width:28px !important; height:32px !important; flex-shrink:0; }
  #openBgModalBtn, #openTemplatesBtn { padding:6px; }
  #leftMainToolbar { bottom:calc(58px + env(safe-area-inset-bottom)); width:max-content; overflow-x:auto; }
  #leftMainToolbar .tool-btn { flex-shrink:0; width:38px; height:40px; }
  #pageBottomBar { bottom:calc(5px + env(safe-area-inset-bottom)); gap:4px; padding-inline:6px; }
  #pageBottomBar > :first-child { max-width:44vw; }
  #subToolPanel { width:min(270px,calc(100vw - 24px)); max-height:calc(100dvh - 200px); }
  #presentationFloatingBar { max-width:calc(100vw - 12px); flex-wrap:wrap; border-radius:14px; }
  #inlineTextEditor { max-width:calc(100vw - 12px); }
  .glass-panel { backdrop-filter:blur(8px); }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important;transition:none!important;scroll-behavior:auto!important; } }
@media print {
  @page { margin:0; }
  html,body { background:white!important; margin:0!important; padding:0!important; }
  body > :not(#printBoardPages) { display:none!important; }
  #printBoardPages { display:block!important; }
  #printBoardPages img { display:block; width:100%; height:auto; break-after:page; }
  #printBoardPages img:last-child { break-after:auto; }
}

#autosaveStatus[data-failed="true"] { color:#be123c; background:#fff1f2; }
.board-export-download { display:block; padding:12px; margin-top:10px; color:#4338ca; background:#eef2ff; border:1px solid #a5b4fc; border-radius:10px; font-size:13px; font-weight:600; overflow-wrap:anywhere; }
html.dark .board-export-download { background:#1e1b4b; color:#c7d2fe; }

/* Full-window writing view, with the complete workspace one click away. */
#cleanBoardToolbar, #cleanViewControls, #cleanSaveStatus { display:none; }
body.clean-board { overflow:hidden; }
body.clean-board #topAppHeader,
body.clean-board #leftMainToolbar,
body.clean-board #pageBottomBar,
body.clean-board #minimapContainer,
body.clean-board #seoScrollPill,
body.clean-board #emptyBoardHint,
body.clean-board #seoContentSection { display:none!important; }
body.clean-board #whiteboardViewport { width:100%; height:100dvh; }
body.clean-board #cleanBoardToolbar { display:flex; }
body.clean-board #cleanViewControls { display:flex; }
body.clean-board #cleanSaveStatus { display:block; }
.clean-board-tools { position:fixed; z-index:35; left:14px; top:50%; transform:translateY(-50%); flex-direction:column; align-items:center; gap:3px; padding:6px; border:1px solid #e2e8f0; border-radius:15px; background:rgba(255,255,255,.97); box-shadow:0 4px 18px #0f172a0d; }
.clean-tool-btn { width:38px; height:38px; display:inline-flex; flex-shrink:0; align-items:center; justify-content:center; border:0; border-radius:10px; background:transparent; color:#334155; cursor:pointer; }
.clean-tool-btn svg { width:19px; height:19px; }
.clean-tool-btn:hover { background:#f1f5f9; }
.clean-tool-btn.active { background:#4f46e5; color:white; }
.clean-tool-divider { width:22px; height:1px; background:#e2e8f0; margin:3px 0; }
.clean-ink-swatch { width:21px; height:21px; border:3px solid white; outline:1px solid #cbd5e1; border-radius:50%; background:#0f172a; box-shadow:0 0 0 3px #f1f5f9; }
.clean-view-controls { position:fixed; z-index:35; right:16px; top:14px; }
.clean-view-controls button { padding:8px 12px; color:#64748b; background:rgba(255,255,255,.95); border:1px solid #e2e8f0; border-radius:10px; font-size:12px; cursor:pointer; }
.clean-save-status { position:fixed; right:16px; bottom:12px; z-index:30; color:#94a3b8; max-width:calc(100vw - 88px); font-size:11px; pointer-events:none; }
.clean-save-status[data-failed="true"] { color:#be123c; padding:8px; background:#fff1f2; border:1px solid #fecdd3; border-radius:8px; }
.clean-ink-panel { position:fixed; z-index:40; left:77px; top:50%; transform:translateY(-50%); width:235px; max-width:calc(100vw - 90px); padding:15px; border-radius:14px; box-shadow:0 10px 35px #0f172a17; font-size:12px; }
.clean-panel-heading { display:flex; align-items:center; justify-content:space-between; margin-bottom:13px; gap:8px; }
.clean-panel-heading button { padding:2px 6px; cursor:pointer; }
.clean-color-palette { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; margin-bottom:13px; }
.clean-color-button { width:22px; height:22px; padding:0; border:1px solid #94a3b8; border-radius:50%; cursor:pointer; }
.clean-custom-color { display:flex; justify-content:space-between; align-items:center; margin-bottom:13px; }
.clean-custom-color input { width:34px; height:28px; padding:0; border:0; background:transparent; }
.clean-ink-panel label[for="cleanStrokeWidth"] { display:flex; justify-content:space-between; gap:8px; }
#cleanStrokeWidth { width:100%; margin-top:8px; accent-color:#4f46e5; }
.clean-menu-view { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.clean-menu-view button,.clean-menu-view a { font-size:12px; color:#4338ca; background:#eef2ff; padding:8px 11px; border-radius:8px; cursor:pointer; }
.clean-menu-label { display:block; font-size:12px; font-weight:600; margin:14px 0 7px; }
.clean-menu-input { width:100%; padding:9px; font-size:13px; border-radius:8px; border:1px solid var(--ui-border); background:transparent; color:var(--ui-text); margin-bottom:14px; }
.clean-all-tools { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
.clean-menu-tool { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; min-height:62px; padding:8px 3px; border:1px solid var(--ui-border); border-radius:9px; font-size:10px; line-height:1.4; cursor:pointer; }
.clean-menu-tool svg { width:19px; height:19px; }
.clean-menu-tool:hover { background:#eef2ff; color:#4338ca; }
body.clean-board #subToolPanel { position:fixed; left:77px; top:12px; max-height:calc(100dvh - 24px); }
body.focus-mode #cleanBoardToolbar, body.focus-mode #cleanViewControls, body.focus-mode #cleanSaveStatus,
body.presentation-mode #cleanBoardToolbar, body.presentation-mode #cleanViewControls, body.presentation-mode #cleanSaveStatus { display:none; }
html.dark .clean-board-tools { background:#0f172a; border-color:#334155; }
html.dark .clean-tool-btn { color:#cbd5e1; }
html.dark .clean-tool-btn.active { color:white; }
html.dark .clean-tool-btn:hover,html.dark .clean-view-controls button { background:#1e293b; color:#e2e8f0; border-color:#334155; }
@media(max-width:639px) {
  .clean-board-tools { left:50%; top:auto; bottom:calc(12px + env(safe-area-inset-bottom)); transform:translateX(-50%); flex-direction:row; max-width:calc(100vw - 16px); gap:2px; padding:5px; }
  .clean-tool-divider { width:1px; height:20px; margin:0 2px; }
  .clean-tool-btn { width:36px; height:40px; }
  .clean-view-controls { top:12px; right:12px; }
  .clean-view-controls button { font-size:11px; }
  .clean-save-status { right:auto; left:12px; top:17px; bottom:auto; max-width:calc(100vw - 135px); font-size:10px; }
  body.clean-board #cleanSaveStatus:not([data-failed="true"]) { display:none; }
  .clean-ink-panel { top:auto; left:50%; bottom:calc(78px + env(safe-area-inset-bottom)); transform:translateX(-50%); width:245px; max-width:calc(100vw - 24px); }
  body.clean-board #subToolPanel { left:12px; right:12px; top:auto; bottom:calc(78px + env(safe-area-inset-bottom)); width:auto; max-height:calc(100dvh - 155px); }
}
@media print {
  #cleanBoardToolbar,#cleanViewControls,#cleanSaveStatus,#cleanInkPanel { display:none!important; }
}
