/* Persistent study tools, using the existing theme. */
body { padding-bottom: 96px; }
.workspace-dock { position:fixed; bottom:18px; left:50%; transform:translateX(-50%); display:flex; align-items:center; gap:6px; z-index:1950; padding:8px 12px; border:1px solid var(--line-strong); border-radius:24px; background:var(--surface-strong,#fffaf9); box-shadow:var(--shadow-md); max-width:calc(100vw - 24px); }
.workspace-dock button,.desk-notes-dialog button { border:0; background:transparent; color:var(--ink); border-radius:14px; padding:10px 12px; cursor:pointer; font:600 13px var(--sans,system-ui); min-height:42px; white-space:nowrap; }
.workspace-dock button:hover,.desk-notes-dialog button:hover { background:var(--accent-soft); }
#desk-focus { display:flex; align-items:center; gap:10px; }
#desk-mode { color:var(--ink-2); font-size:11px; }
#desk-time { font-size:21px; font-variant-numeric:tabular-nums; }
#desk-toggle { background:var(--accent-soft); color:var(--accent-ink); min-width:64px; }
#desk-task-count { color:var(--accent-ink); }
.dock-divider { height:24px; border-left:1px solid var(--line-strong); }
.desk-notes-dialog { width:min(640px,calc(100vw - 32px)); max-height:calc(100dvh - 40px); overflow:auto; margin:auto; border:1px solid var(--line-strong); border-radius:24px; padding:26px; background:var(--bg,#fffaf9); color:var(--ink); box-shadow:var(--shadow-lg); }
.desk-notes-dialog::backdrop { background:rgba(45,25,35,.38); }
.desk-notes-dialog header { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.desk-notes-dialog h2 { margin:8px 0; font:400 32px var(--serif,serif); }
.notes-help,.local-data-notice { font:13px/1.6 var(--sans,system-ui); color:var(--ink-2); margin:12px 0; }
.desk-notes-dialog textarea { display:block; width:100%; min-height:240px; resize:vertical; padding:16px; border:1px solid var(--line-strong); border-radius:16px; background:var(--surface-strong,#fff); color:var(--ink); font:16px/1.65 var(--sans,system-ui); box-sizing:border-box; }
.desk-notes-dialog footer { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-top:12px; }
#desk-notes-status { font-size:12px; color:var(--ink-2); }
.storage-warning { position:fixed; bottom:90px; left:16px; max-width:430px; z-index:3000; padding:14px; background:#fff1d8; color:#593a13; border:1px solid #bc8c42; border-radius:12px; font:14px/1.5 system-ui; }
.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; }
.workspace-dock [hidden],.storage-warning[hidden] { display:none; }
.zen-mode .workspace-dock { display:none; }
@media(max-width:1100px) { .study-companion { bottom:100px; } }
@media(max-width:600px) {
  .workspace-dock { bottom:max(10px,env(safe-area-inset-bottom)); gap:2px; padding:6px; width:max-content; }
  .workspace-dock button { padding:8px; font-size:12px; }
  #desk-focus { gap:5px; } #desk-time { font-size:19px; } #desk-mode { display:none; }
  #desk-toggle { min-width:52px; } .dock-divider { display:none; }
  .desk-notes-dialog { padding:20px; } .desk-notes-dialog textarea { min-height:200px; }
  .study-companion { right:12px; bottom:86px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; } }

.modal-overlay { z-index:2500; }
.quiz-phrase-banner[hidden] { display:none; }
.word-item-card { content-visibility:auto; contain-intrinsic-size:auto 220px; }
/* Grid children must be allowed to shrink below their desktop content width. */
.dashboard > *, .lower > *, .studio-tables-grid > *, .kpi-strip > * { min-width:0; }
@media(max-width:1040px) { .dashboard { grid-template-columns:minmax(0,1fr); } }
@media(max-width:600px) {
  .timer-top { flex-wrap:wrap; justify-content:center; }
  .timer-card { padding:22px; }
  .ring-wrap { max-width:100%; }
  .task-form { flex-wrap:wrap; }
  .task-form input { flex-basis:100%; min-width:0; }
  .inline-table-form { flex-wrap:wrap; }
  .inline-table-form input { min-width:0; }
  .timer-partner-strip { flex-wrap:wrap; }
}
