/* Targeted repairs; original thin rail and canvas layout remain in write.css. */
body { height: 100dvh; min-height: 0; font-family: 'Segoe UI', system-ui, sans-serif; }
[hidden] { display: none !important; }
footer { box-sizing: border-box; pointer-events: none; }
.ink-smooth-btn { border: 1px solid var(--rule); border-radius: 5px; background: var(--raised); color: var(--ink); cursor: pointer; }
.ink-smooth-btn.active { border-color: var(--accent); background: var(--accent-wash); }
.tool-options:not(.is-docked) .ink-smoothing { display: flex; flex-wrap: wrap; gap: 5px; }
.tool-options:not(.is-docked) .ink-smooth-btn { display: flex; align-items: center; gap: 5px; padding: 7px; font: inherit; font-size: 11px; }
.tool-options:not(.is-docked) .ink-smooth-btn svg { width: 24px; height: 16px; }
.tool-dock input[type="color"] { width: 22px; height: 22px; padding: 0; border: 1px solid var(--rule); border-radius: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.toolbar {
  left: 72px; right: 12px; width: auto; max-width: none; transform: none;
  justify-content: center; gap: 7px; padding: 8px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--rule); backdrop-filter: none;
}
body.toolbar-location-down .toolbar { left: 72px; right: 12px; width: auto; transform: none; }
.toolbar .tool { min-width: 40px; min-height: 40px; padding: 8px; flex: 0 0 auto; }
.toolbar .tool.active { box-shadow: none; background: var(--accent-wash); outline: 2px solid var(--accent); }
.toolbar-divider { width: 1px; height: 24px; margin: 0 3px; background: var(--rule); }
.menu-btn { left: 12px; top: 12px; width: 44px; height: 44px; backdrop-filter: none; }
.side-menu { width: min(340px, calc(100vw - 20px)); max-height: calc(100dvh - 76px); overflow-y: auto; background: var(--surface); backdrop-filter: none; }
.menu-overlay { backdrop-filter: none; }
/* Preserve the original thin options rail. Shape choices use icons in the rail. */
.tool-panel-close { width: 36px; height: 36px; flex: none; border: 0; border-radius: 8px; color: var(--ink-2); background: transparent; cursor: pointer; }
.tool-panel-close:hover { background: var(--raised); }
#shapeOptions.is-docked .shape-grid,
#shapeOptions.is-docked .shape-style-options { grid-template-columns: 1fr; gap: 4px; }
#shapeOptions.is-docked .shape-btn,
#shapeOptions.is-docked .shape-style-option { min-height: 30px; width: 32px; padding: 3px; margin-inline: auto; }
#shapeOptions.is-docked .shape-btn-label { display: none; }
#shapeOptions.is-docked .shape-group-heading { font-size: .5rem; text-align: center; overflow-wrap: anywhere; }
#shapeOptions.is-docked .shape-picker,
#shapeOptions.is-docked .shape-style { gap: 8px; }
.tool-options:not(.is-docked) { left: 12px; right: auto; width: min(300px, calc(100vw - 24px)); box-sizing: border-box; transform: none; overflow: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: 14px; backdrop-filter: none; }
.tool-options-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: -12px; background: var(--surface); z-index: 2; padding: 4px 0; }
.tool-options.is-docked > .tool-options-head { display: none; }
.shape-tool .shape-tool-svg { opacity: 1; transform: none; transition: none; }
.shape-tool.is-changing .shape-tool-svg { opacity: 1; transform: none; }
.shape-tool.is-changing { animation: shapeToolPop 240ms ease-out; }
.shape-tool.is-changing .shape-tool-svg * { animation: shapeToolTrace 360ms ease-out; }
.editor-brand { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-size: 12px; font-weight: 600; }
.editor-brand img { border-radius: 5px; animation: brand-arrive 300ms ease-out both; }
.editor-mobile-brand { display: none; }
.pomo-pill { top: auto; bottom: 40px; right: 16px; backdrop-filter: none; }
body.toolbar-location-down .pomo-pill { top: 16px; bottom: auto; }
.canvas-theme-pop { overflow-y: auto; }
.toolbar-position-control { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.toolbar-position-control > span { margin-right: auto; }
.toolbar-position-control button { min-height: 40px; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--raised); color: var(--ink); cursor: pointer; }
.toolbar-position-control button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); }
#emptyHint { color: var(--ink-2); }
@keyframes brand-arrive { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tool-help-sheet { display: none; position: fixed; inset: 0; z-index: 10002; }
.tool-help-sheet.is-open { display: block; }
.tool-help-sheet-backdrop { position: absolute; inset: 0; background: #0008; }
.tool-help-sheet-panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 32px)); max-height: 80dvh; overflow: auto; box-sizing: border-box; padding: 24px; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); color: var(--ink); }
.tool-help-sheet-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 8px; background: var(--raised); color: var(--ink); font-size: 22px; cursor: pointer; }
.tool-help-sheet-title { margin: 0 40px 20px 0; font-size: 18px; }
.tool-dock-shortcuts { display: grid; grid-template-columns: minmax(60px, 1fr) 1.4fr; gap: 12px; font-size: 12px; }
.tool-dock-shortcuts dd { margin: 0; color: var(--ink-2); }
.tool-dock-shortcuts kbd { padding: 3px 5px; margin-right: 3px; border: 1px solid var(--rule); border-radius: 4px; font: inherit; }
.tool-dock-shortcuts-heading { font-size: 13px; font-weight: 650; }
@media (max-width: 1179px) {
  .toolbar, body.toolbar-location-down .toolbar { left: 68px; right: 8px; gap: 6px; padding: 8px; flex-wrap: wrap; }
  .toolbar .tool, body.toolbar-location-down .toolbar .tool { min-width: 40px; min-height: 40px; padding: 8px; }
  .toolbar-divider { display: none; }
}
@media (max-width: 600px) {
  .editor-mobile-brand { display: inline-flex; position: fixed; top: 22px; left: 72px; z-index: 100; font-size: 15px; }
  .toolbar, body.toolbar-location-down .toolbar { left: 8px; right: 8px; top: 62px; justify-content: flex-start; gap: 6px; max-height: 154px; }
  body.toolbar-location-down .toolbar { top: auto; bottom: max(34px, env(safe-area-inset-bottom)); }
  .toolbar .tool, body.toolbar-location-down .toolbar .tool { min-width: 40px; min-height: 40px; }
  .side-menu { top: 62px; bottom: 12px; max-height: calc(100dvh - 74px); }
  #emptyHint { font-size: 11px; letter-spacing: .12em; }

}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
