/* Writing surfaces: understated chrome, readable controls, no blur or loops. */
.inky-editor .workspace-stage { box-shadow: 0 0 0 1px var(--rule); }
.inky-editor .workspace-stage::before { box-shadow: inset 0 1px 0 var(--w-2); }
.inky-editor .workspace-stage::after { background: none; }
.inky-editor .workspace-shell::before { background: none; }
.inky-editor body::before { opacity: .12; }
.quiet-writing :is(.toolbar,#menuBtn,#toolDock,.editor-mobile-brand,.tool-options) { visibility: hidden !important; pointer-events: none !important; }
.quiet-writing #workspaceShell { top: 10px !important; bottom: 98px !important; padding: 0 12px !important; left: 0 !important; right: 0 !important; }
.quiet-writing .workspace-stage { border-radius: 18px; }
.writing-bar {
  position: fixed; z-index: 9991; bottom: 36px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 3px; padding: 5px;
  max-width: calc(100vw - 20px); box-sizing: border-box;
  border: 1px solid var(--rule); border-radius: 17px; background: var(--surface);
  box-shadow: 0 6px 20px var(--d-2); color: var(--ink);
}
.writing-bar[hidden],.pen-studio[hidden] { display: none; }
.writing-bar button { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--ink-2); cursor: pointer; font: 12px var(--sans); }
.writing-bar button:hover { background: var(--raised); color: var(--ink); }
.writing-bar button[aria-pressed=true] { color: var(--accent); border-color: var(--accent); background: var(--accent-wash); }
.writing-bar button:disabled { opacity: .35; cursor: default; }
.writing-bar svg,.pen-studio-close svg { width: 21px; height: 21px; }
.writing-bar .writing-pen-choice { width: auto; min-width: 70px; padding: 0 10px; gap: 7px; }
.writing-ink-dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--rule); }
.writing-divider { flex: none; width: 1px; height: 22px; background: var(--rule); margin: 0 3px; }
.pen-studio { position: fixed; inset: 0; z-index: 11001; display: grid; place-items: center; padding: 16px; background: var(--d-5); box-sizing: border-box; }
.pen-studio-panel { box-sizing: border-box; width: min(480px,100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--rule); border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px var(--d-4); font-family: var(--sans); }
.pen-studio-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 24px; border-bottom: 1px solid var(--rule); }
.writing-kicker { margin: 0 0 8px; font: 10px var(--mono); letter-spacing: .13em; color: var(--ink-2); }
.pen-studio h2 { margin: 0; font-size: 27px; font-weight: 500; letter-spacing: -.035em; }
.pen-studio-close { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--rule); border-radius: 12px; background: var(--raised); color: var(--ink-2); cursor: pointer; }
.pen-studio-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 24px; display: grid; gap: 20px; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
#penStudioNote { font-size: 13px; line-height: 1.5; margin: 0; color: var(--ink-2); }
.pen-studio-presets { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.pen-studio-presets button { min-width: 0; padding: 12px 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; border: 1px solid var(--rule); border-radius: 13px; background: var(--surface); color: var(--ink); font: 12px var(--sans); text-align: left; cursor: pointer; }
.pen-studio-presets button[aria-pressed=true] { border-color: var(--accent); background: var(--accent-wash); }
.pen-studio-presets svg { width: 100%; height: 32px; color: var(--accent); }
.pen-studio-presets strong { font-weight: 600; }
.pen-studio-presets span { font-size: 11px; line-height: 1.5; color: var(--ink-2); }
.pen-studio-pad { position: relative; height: 160px; border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; background: var(--canvas-ground); }
.pen-studio-pad canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.pen-studio-pad > span { position: absolute; top: 50%; left: 0; width: 100%; text-align: center; pointer-events: none; color: var(--ink-2); opacity: .55; font: italic 20px Georgia,serif; }
.pen-studio-clear { position: absolute; right: 8px; bottom: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 9px; background: var(--surface); color: var(--ink-2); font: 11px var(--sans); cursor: pointer; }
.pen-studio-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pen-studio-fields label { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--ink-2); }
.pen-studio-fields input { width: 100%; min-width: 0; box-sizing: border-box; height: 44px; border: 1px solid var(--rule); border-radius: 10px; background: var(--raised); color: var(--ink); font: 14px var(--mono); padding: 8px 12px; }
.pen-studio-fields input[type=color] { padding: 6px; cursor: pointer; }
.pen-studio-assist { display: grid; gap: 8px; font-size: 12px; color: var(--ink-2); }
.pen-studio-assist > div { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.pen-studio-assist button { min-height: 44px; font: inherit; border: 1px solid var(--rule); border-radius: 10px; color: var(--ink-2); background: var(--raised); cursor: pointer; }
.pen-studio-assist button[aria-pressed=true] { border-color: var(--accent); color: var(--ink); background: var(--accent-wash); }
.pen-studio-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--rule); }
.pen-studio-foot button { min-height: 44px; padding: 0 16px; border: 1px solid var(--rule); border-radius: 11px; background: var(--raised); color: var(--ink-2); font: 13px var(--sans); cursor: pointer; }
.pen-studio-foot .pen-studio-use { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
:is(.pen-studio,.writing-bar) button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Pomodoro shares the writing desk's materials and keeps one clear hierarchy. */
.inky-editor .pomo-overlay { box-sizing: border-box; padding: 16px; }
.inky-editor .pomo-panel { width: min(420px,100%); max-height: calc(100dvh - 32px); padding: 0 24px 22px; border-radius: 22px; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
.pomo-head { position: sticky; top: 0; z-index: 2; margin: 0 -8px 16px; padding: 20px 0 12px; background: var(--surface); }
.pomo-heading { flex: 1; min-width: 0; }
.pomo-eyebrow { margin: 0 0 7px; font: 10px var(--mono); letter-spacing: .1em; color: var(--ink-2); }
.inky-editor .pomo-title { padding-left: 0; font-size: 25px; font-weight: 500; letter-spacing: -.035em; }
.inky-editor .pomo-view-main { gap: 12px; }
.inky-editor .pomo-tab { font-size: 12px; padding: 0 5px; }
.inky-editor .pomo-tabs { border: 1px solid var(--rule); background: var(--raised); }
.inky-editor .pomo-stage { width: min(208px,32dvh); margin: 0 auto; }
.inky-editor .pomo-time { font-size: 48px; font-weight: 400; letter-spacing: -.05em; }
.inky-editor .pomo-ring-track,.inky-editor .pomo-ring-fill { stroke-width: 2; }
.inky-editor .pomo-stage-mode { font-size: 10px; }
.pomo-next-note { margin: -4px 0 0; color: var(--ink-2); text-align: center; font: 11px var(--mono); }
.inky-editor .pomo-main { min-height: 48px; border-radius: 12px; }
.pomo-write { min-height: 44px; width: 100%; border: 1px solid var(--rule); border-radius: 12px; background: var(--raised); color: var(--ink); font-size: 13px; cursor: pointer; }
.pomo-write:hover { border-color: var(--accent); }
.inky-editor .pomo-task-row { display: grid; gap: 7px; padding: 0; border: 0; background: none; }
.pomo-task-label { color: var(--ink-2); font-size: 12px; }
.inky-editor .pomo-task-input { box-sizing: border-box; min-height: 44px; width: 100%; border: 1px solid var(--rule); border-radius: 11px; padding: 10px 12px; background: var(--raised); color: var(--ink); font: 13px var(--sans); }
.inky-editor .pomo-sound { gap: 4px; }
.pomo-volume-row[hidden] { display: none; }
.inky-editor .pomo-sound-options { gap: 4px; border: 1px solid var(--rule); background: var(--raised); }
.inky-editor .pomo-sound-option { min-height: 44px; font-size: 11px; font-weight: 450; }
.inky-editor .pomo-stats-line { line-height: 1.7; font-size: 10px; color: var(--ink-2); }
.pomo-settings-note { margin: 0 0 8px; color: var(--ink-2); font-size: 12px; line-height: 1.6; }
.inky-editor .pomo-settings-grid label { min-width: 0; }
.inky-editor .pomo-settings-grid input { min-width: 0; background: var(--raised); }
.inky-editor .pomo-preset { font-size: 12px; }
.inky-editor .pomo-preset em { font-size: 10px; }
.pomo-pill-open { display: flex; align-items: center; gap: 7px; min-height: 44px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; text-align: left; }
.inky-editor .pomo-pill { max-width: calc(100vw - 32px); box-sizing: border-box; bottom: 84px; border-radius: 14px; }
.quiet-writing .pomo-pill { top: 20px; bottom: auto; right: 24px; }
.quiet-writing.pomo-open .writing-bar { visibility: hidden; }
.inky-editor .pomo-pill-task { max-width: 110px; }
.inky-editor .pomo-pill-body { flex: 1; min-width: 0; }
.inky-editor .pomo-pill-play,.inky-editor .pomo-pill-close { flex: none; }
.inky-editor .pomo-toast-host { max-width: calc(100vw - 32px); }
.inky-editor .pomo-toast { box-sizing: border-box; max-width: 100%; text-align: center; }
@media(max-width:600px) {
  .pen-studio { padding: 10px; }
  .pen-studio-panel { max-height: calc(100dvh - 20px); border-radius: 16px; }
  .pen-studio-head { padding: 16px; }
  .pen-studio-body { padding: 16px; gap: 14px; }
  .pen-studio-foot { padding: 12px 16px; }
  .pen-studio-presets button { padding: 10px 7px; }
  .writing-bar .writing-pen-choice { width: 44px; min-width: 44px; padding: 0; }
  .writing-pen-name { display: none; }
  .writing-bar { gap: 0; padding: 4px; bottom: 34px; }
  .writing-divider { margin: 0; }
  .inky-editor .pomo-overlay { padding: 10px; }
  .inky-editor .pomo-panel { max-height: calc(100dvh - 20px); padding: 0 18px 18px; border-radius: 17px; }
  .pomo-head { padding: 14px 0 10px; }
  .pomo-eyebrow { font-size: 9px; }
  .inky-editor .pomo-title { font-size: 23px; }
  .inky-editor .pomo-controls { gap: 12px; }
  .inky-editor .pomo-main { min-width: 120px; }
  .inky-editor .pomo-stage { width: min(188px,29dvh); }
  .inky-editor .pomo-time { font-size: 42px; }
  .inky-editor .pomo-pill { right: 12px; }
  .quiet-writing .pomo-pill { top: 18px; right: 20px; }
}
@media(max-height:480px) {
  .pen-studio-head { padding: 12px 16px; }
  .pen-studio-body { gap: 12px; padding: 12px 16px; }
  .pen-studio-pad { height: 120px; }
  .pen-studio-foot { padding: 10px 16px; }
}
@media(max-width:360px) {
  .pen-studio-presets { grid-template-columns: 1fr; }
  .pen-studio-presets button { display: grid; grid-template-columns: 60px minmax(0,1fr); gap: 4px 12px; align-items: center; }
  .pen-studio-presets svg { grid-row: span 2; }
}
@media(prefers-reduced-motion:reduce) {
  .pomo-ring-fill,.pomo-pill-bar span { transition: none; }
  .pomo-pill-pop { animation: none; }
}
