#study-dashboard { width: 100%; max-width: 1500px; margin: 0 auto 28px; }
.study-completion-choice { display:flex; align-items:center; gap:10px; min-height:44px; font-size:14px; cursor:pointer; }
.study-completion-choice input { width:20px; height:20px; flex-shrink:0; accent-color:var(--point-main); }
#study-recording-status { min-height:1.5em; color:var(--point-main); font-size:14px; line-height:1.5; }
.focus-mode-bottom { gap:12px; flex-wrap:wrap; }
#focus-complete-btn[hidden] { display:none; }
.weekly-item-open { flex:1; min-width:0; text-align:left; background:transparent; border:0; color:inherit; font:inherit; cursor:pointer; padding:6px 2px; overflow-wrap:anywhere; }
.weekly-item-open:disabled { pointer-events:none; opacity:1; }
body.study-execution-idle #timer-container { display: none; }
#study-dashboard h2, #study-dashboard h3, #study-dashboard p { margin: 0; }
.study-next { background: var(--bg-card); border: 1px solid var(--border-light); border-left: 5px solid var(--point-main); border-radius: 18px; padding: 26px; }
#study-dashboard .study-eyebrow { color: #386855; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
#study-dashboard h2 { font-size: 25px; line-height: 1.4; overflow-wrap: anywhere; }
#study-dashboard .study-description { font-size: 14px; color: #576c62; line-height: 1.7; margin: 8px 0 14px; }
.study-primary, .study-secondary { min-height: 44px; padding: 10px 17px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 700; }
.study-primary { border: 1px solid #285e4c; background: #285e4c; color: white; }
.study-secondary { background: var(--bg-card); border: 1px solid #b5c9c0; color: #345e4f; }
.study-next > button + button { margin-left: 8px; }
#study-dashboard button:hover { filter: brightness(.96); }
#study-dashboard button:disabled { opacity: .6; cursor: wait; }
#study-dashboard button:focus-visible { outline: 3px solid #285e4c; outline-offset: 3px; }
.study-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.study-metric { padding: 18px; display: flex; flex-direction: column; gap: 7px; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 12px; }
.study-metric > span, .study-metric small { font-size: 13px; color: #576c62; line-height: 1.5; }
.study-metric strong { font-size: 21px; overflow-wrap: anywhere; }
.study-queue, .study-recent { border: 1px solid var(--border-light); background: var(--bg-card); border-radius: 14px; padding: 18px; margin-top: 14px; }
#study-dashboard h3 { font-size: 16px; line-height: 1.5; }
.study-section-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.study-section-heading > span { font-size: 13px; color: #576c62; }
.study-queue-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-light); }
.study-pin { width: 44px; flex-shrink: 0; padding: 8px; font-size: 22px; }
.study-pin[aria-pressed="true"] { background: #edf6f0; color: #285e4c; border-color: #285e4c; }
.study-queue-label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; overflow-wrap: anywhere; }
.study-queue-label strong { font-size: 15px; }
.study-queue-label span { font-size: 13px; color: #576c62; }
.study-queue-row > button:last-child { flex-shrink: 0; }
.study-recent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.study-recent-card { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--border-light); border-radius: 10px; padding: 14px; overflow-wrap: anywhere; }
.study-recent-card span, .study-recent-card small { color: #576c62; font-size: 13px; }
.study-recent-card button { margin-top: auto; }
@media (max-width: 600px) {
  .study-next { padding: 19px 16px; }
  #study-dashboard h2 { font-size: 21px; }
  .study-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .study-metric:last-child { grid-column: 1 / -1; }
  .study-recent-grid { grid-template-columns: 1fr; gap: 9px; }
  .study-metric { padding: 14px 16px; }
  .study-metric strong { font-size: 20px; }
  .study-queue, .study-recent { padding: 14px; }
  .study-queue-row { gap: 9px; }
}

/* Small controls remain usable with a keyboard and on narrow touch screens. */
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #285e4c !important;
  outline-offset: 3px;
}
.exec-step-state-wrapper button.circle-btn { padding: 0; transition: background-color .2s, border-color .2s; }
.exec-step-state-wrapper button:disabled { cursor: default; opacity: .5; }
.study-field-label { display: block; margin: 12px 0 7px; font-weight: 700; font-size: 14px; }
.study-field-label span { color: #576c62; font-weight: 400; }
.study-field-hint { color: #576c62; font-size: 13px; line-height: 1.6; }
.study-date-picker { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.study-date-picker button { border:1px solid var(--border-light); border-radius:8px; padding:0 14px; background:var(--bg-card); color:var(--text-sub); cursor:pointer; }
.study-date-picker button[aria-pressed="true"] { border-color:var(--point-main); background:#edf7f2; color:#34745d; }
.study-date-picker input { flex:1; min-width:140px; min-height:44px; padding:8px 10px; font:inherit; }
.study-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
#quick-add-modal button { min-height: 44px; }
#quick-add-modal button:disabled { opacity:.45; cursor:not-allowed; }
#quick-add-modal #gear-btn { min-width: 44px; color: #345e4f; font-size: 20px; }
#quick-add-modal .modal-content { max-height: calc(100dvh - 32px); overflow-y: auto; }
#qa-target-h, #qa-target-m { min-width: 0; }
.study-sync-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 4px 24px 10px; font-size: 13px; color: #345e4f; }
.study-sync-bar[hidden], .study-sync-bar button[hidden] { display: none; }
.records-status-slot .study-sync-bar[data-needs-action=true]:not([hidden]){display:flex!important;flex-wrap:wrap}
.study-sync-bar button { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.study-sync-dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow: auto; border: 1px solid #b5c9c0; border-radius: 16px; background: #fff; color: #273b32; padding: 22px; }
.study-sync-dialog::backdrop { background: rgba(15, 30, 23, .55); }
.study-sync-dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.study-sync-dialog h2 { font-size: 20px; margin: 0; }
.study-sync-dialog-header button { flex-shrink: 0; white-space: nowrap; }
.study-sync-dialog > p { font-size: 14px; line-height: 1.7; }
.study-sync-conflicts fieldset { border: 1px solid #d6e4dc; border-radius: 10px; margin: 16px 0; padding: 12px; min-width: 0; }
.study-sync-conflicts legend { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.study-sync-choice { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; padding: 12px; margin-top: 6px; border: 1px solid #d6e4dc; border-radius: 8px; cursor: pointer; }
.study-sync-choice:has(input:checked) { border-color: #285e4c; background: #edf6f0; }
.study-sync-choice input { width: 18px; height: 18px; }
.study-sync-choice pre { grid-column: 2; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 160px; overflow: auto; margin: 0; font-family: inherit; font-size: 13px; line-height: 1.6; }
.study-sync-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.study-sync-error { color: #a52c2c; }
.study-sync-recovery { border-top: 1px solid #d6e4dc; padding: 12px 0; }
.study-sync-recovery button + button { margin-left: 8px; }
@media (max-width: 600px) { .study-sync-bar { padding: 4px 12px 10px; } .study-sync-dialog { padding: 16px; } }
@media (max-width: 600px) {
  .exec-step-row { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
  .exec-step-left { width: 100%; min-height: 32px; }
  .exec-step-name { min-width: 0 !important; font-size: 15px; }
  .exec-step-right { width: 100%; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
  .exec-step-time { margin-right: auto; }
  .exec-step-btn-wrapper { width: auto; }
  .exec-step-start-btn { min-height: 44px; min-width: 64px; font-size: 13px !important; }
  .exec-step-state-wrapper { margin-left: 0; }
  .exec-step-state-wrapper button.circle-btn { width: 44px; height: 44px; flex-shrink: 0; }
  #quick-add-modal input, #quick-add-modal select { font-size: 16px !important; }
}

.study-action-row { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.study-action-row button, .study-action-row input { min-height:44px; }
.study-action-row label { font-size:13px; }
.study-carryover summary { cursor:pointer; padding:12px 0; }
.study-carryover-row { display:flex; flex-direction:column; gap:10px; padding:14px 0; border-top:1px solid var(--border-light); }
.study-carryover-row small { color:var(--text-sub); }
.study-undo { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); z-index:20000; display:flex; gap:16px; align-items:center; max-width:calc(100vw - 24px); width:max-content; box-sizing:border-box; padding:12px 18px; background:#243e33; color:#fff; border-radius:12px; box-shadow:0 4px 20px #0003; }
.study-undo button { min-height:44px; flex-shrink:0; border:1px solid #bce4cd; background:transparent; color:#fff; border-radius:8px; padding:8px 12px; cursor:pointer; }
@media(max-width:600px) { .study-action-row { align-items:stretch; } .study-action-row input { max-width:160px; font-size:16px; } .study-undo { bottom:16px; } }

/* Keep the execution board close to the top; supporting tools live below it. */
#study-dashboard { margin-bottom:16px; }
.study-next { padding:16px 20px; border-radius:12px; display:grid; grid-template-columns:minmax(0,max-content) auto; justify-content:start; gap:4px 20px; align-items:center; }
#study-dashboard .study-eyebrow { grid-column:1; font-size:12px; margin:0 0 2px; }
#study-dashboard h2 { grid-column:1; font-size:20px; }
#study-dashboard .study-next .study-description { grid-column:1; margin:2px 0 0; font-size:13px; }
.study-next > button { grid-column:2; grid-row:1 / 4; margin:0; }
.study-summary { gap:0; margin:10px 0 0; padding:10px 0; border-bottom:1px solid var(--border-light); }
.study-metric { padding:4px 16px; gap:3px; border:0; border-radius:0; background:transparent; }
.study-metric + .study-metric { border-left:1px solid var(--border-light); }
.study-metric strong { font-size:17px; }
.study-metric small { display:none; }
#study-dashboard-tools { width:100%; max-width:1500px; margin:20px auto; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.study-disclosure { min-width:0; align-self:start; border:1px solid var(--border-light); border-radius:10px; background:var(--bg-card); padding:0 16px; }
.study-disclosure > summary { cursor:pointer; min-height:48px; padding:14px 0; box-sizing:border-box; color:var(--text-main); font-size:14px; font-weight:600; }
.study-disclosure[open] { padding-bottom:16px; }
.study-disclosure > .study-description { color:var(--text-sub); font-size:13px; }
.study-disclosure .study-recent-grid { grid-template-columns:1fr; }
.study-disclosure .study-recent-card { border:0; border-top:1px solid var(--border-light); border-radius:0; padding:12px 0; }
.study-disclosure .study-primary,.study-disclosure .study-secondary { font-size:13px; padding:8px 12px; }
.study-disclosure summary:focus-visible { outline:3px solid #285e4c; outline-offset:2px; border-radius:4px; }
@media(max-width:600px) {
  .study-next { padding:14px 16px; gap:6px; grid-template-columns:minmax(0,1fr); }
  #study-dashboard h2 { font-size:18px; }
  .study-next > button { grid-column:1; grid-row:auto; justify-self:start; margin-top:4px; }
  .study-summary { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .study-metric { padding:2px 8px; }
  .study-metric:last-child { grid-column:auto; }
  .study-metric strong { font-size:14px; }
  .study-metric > span { font-size:11px; }
  #study-dashboard-tools { grid-template-columns:1fr; margin-top:16px; }
  #execution-tab .plan-main-header-actions { flex-wrap:wrap; justify-content:flex-start; }
}

/* Status indicators share the account area instead of taking two header rows. */
#header-section .header-content { padding-top:10px; padding-bottom:10px; }
#header-section .header-right { display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
.header-status-row { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:4px 12px; min-width:0; }
#header-section .header-status-row .save-status,
#header-section .header-status-row .study-sync-bar { padding:0; margin:0; min-height:20px; font-size:11px; gap:5px; line-height:1.5; }
#header-section .header-status-row button { min-height:28px; padding:3px 8px; font-size:11px; border:1px solid currentColor; border-radius:6px; background:transparent; color:inherit; }
#header-section .tab-btn { padding-top:12px; padding-bottom:12px; }
@media(max-width:600px) {
  #header-section .header-right { display:contents; }
  .header-status-row { grid-column:1 / -1; grid-row:4; justify-content:flex-start; }
  #header-section .header-content { row-gap:8px; }
  #header-section .header-status-row button { min-height:36px; }
}

.nickname-settings { margin-bottom:22px; padding-bottom:16px; border-bottom:1px solid var(--border-light); }
.nickname-settings > label { display:block; margin-bottom:8px; font-size:13px; color:var(--text-main); font-weight:600; }
.nickname-settings > div { display:flex; gap:8px; }
.nickname-settings input { min-width:0; flex:1; padding:11px; border:1px solid var(--border-light); border-radius:8px; color:var(--text-main); background:var(--bg-input); font:inherit; }
.nickname-settings button { min-height:44px; padding:8px 14px; border:0; border-radius:8px; color:white; background:#285e4c; cursor:pointer; }
.nickname-settings button:disabled { opacity:.5; }
.nickname-settings p { min-height:18px; margin:6px 0 0; font-size:12px; color:var(--text-sub); }

/* Record mode dedicates the viewport to the embedded calendar/timeline. */
#header-section.viewing-records { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; transition:none; }
#header-section.viewing-records .header-content { display:none; }
#header-section.viewing-records .app-tabs { grid-column:1; grid-row:1; }
#header-section.viewing-records.records-has-session #timer-container { grid-column:2; grid-row:1; gap:8px; padding:4px 12px; }
#header-section.viewing-records #time-display { font-size:14px; font-weight:650; }
#header-section.viewing-records #active-task-info { display:none; }
#header-section.viewing-records .timer-actions { gap:6px !important; }
#header-section.viewing-records .timer-actions button { padding:5px 8px !important; font-size:11px; }
#records-tab { padding:8px 12px 0; max-width:none; }
#records-tab .records-toolbar { flex-wrap:nowrap; gap:12px; padding-bottom:6px; }
#records-tab .records-toolbar > h2 { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
#records-tab .records-view-switch { flex-shrink:0; }
.records-status-slot { min-width:0; margin-left:auto; }
.records-status-slot .header-status-row { gap:4px 10px; justify-content:flex-end; }
.records-status-slot .save-status,.records-status-slot .study-sync-bar { padding:0; min-height:20px; font-size:11px; }
.records-status-slot button { min-height:28px; font-size:11px; padding:3px 7px; }
#records-tab .records-frame { min-height:260px; border-radius:10px; }
@media(max-width:600px) {
  #header-section.viewing-records { grid-template-columns:1fr; }
  #header-section.viewing-records.records-has-session #timer-container { grid-column:1; grid-row:2; justify-content:flex-end; }
  #records-tab { padding:6px 6px 0; }
  #records-tab .records-toolbar { align-items:center; gap:8px; }
  .records-status-slot .study-sync-bar { display:none; }
  .records-status-slot:has(.study-sync-bar button:not([hidden])) .study-sync-bar { display:flex; }
}

/* One decision and one primary save action; recovery stays available on demand. */
.study-sync-dialog{max-width:560px;box-sizing:border-box}.study-sync-presets{display:grid;gap:10px;margin:18px 0}.study-sync-presets .study-sync-choice{margin:0;align-items:start}.study-sync-choice small{grid-column:2;font-size:12px;line-height:1.7;color:#61776a;overflow-wrap:anywhere}.study-sync-selection{font-size:12px!important;color:#587362}.study-sync-options{border-top:1px solid #dce7df;padding-top:10px;margin-top:16px}.study-sync-options>summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-size:12px;color:#61776a}.study-sync-options:not([open])>:not(summary){display:none}.study-sync-options>button{margin:5px 8px 5px 0}.study-sync-actions .study-primary:disabled{opacity:.5;cursor:default}.study-sync-recovery-hint{font-size:12px;line-height:1.7;color:#61776a}.study-sync-options[open]>summary{font-weight:600}@media(max-width:600px){.study-sync-dialog .study-sync-actions>.study-primary{width:100%;min-height:44px}.study-sync-choice{min-height:44px}.study-sync-dialog{padding:20px}}
