body[data-active-tab="sets"] .topbar,
body[data-active-tab="workspace"] .topbar { background: var(--canvas); }

#sets.tab-panel.active,
#workspace.tab-panel.active { background: var(--canvas); color: #222; padding: 0; }

.sets-page { max-width: 1420px; margin: 0 auto; padding: 36px 40px 96px; }
.sets-header, .sets-toolbar, .workspace-toolbar, .workspace-section-title, .workspace-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.sets-header h3 { font-size: 28px; font-weight: 650; }
.sets-header p { margin-top: 7px; color: #6a6965; }
.sets-toolbar { margin: 28px 0 24px; }
.sets-toolbar .field { flex: 1; min-width: 0; background: #fff; }
.sets-toolbar .select { width: 230px; flex: none; background: #fff; }
#studySetListStatus, #workspaceStatus { min-height: 22px; color: #7a6251; }
#workspaceStatus:empty { display: none; }
.sets-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.study-set-card { min-width: 0; min-height: 228px; padding: 22px; border: 1px solid #e5e2d9; border-radius: 8px; background: #fff; cursor: pointer; display: flex; flex-direction: column; }
.study-set-card:hover, .study-set-card:focus-visible { border-color: #242424; outline: none; }
.study-set-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.study-set-mark { width: 54px; height: 54px; flex: 0 0 54px; display: grid; place-items: center; border-radius: 8px; font-size: 27px; color: #242424; }
.study-set-mark .icon { width: 50%; height: 50%; }
.study-set-card h4 { font-size: 18px; margin: 17px 0 6px; overflow-wrap: anywhere; }
.study-set-card p { color: #77746c; overflow-wrap: anywhere; }
.study-set-card-bottom { margin-top: auto; display: flex; justify-content: space-between; gap: 12px; color: #77746c; font-size: 13px; }
.study-set-menu { position: relative; z-index: 2; }
.study-set-menu summary { list-style: none; cursor: pointer; font-size: 24px; width: 30px; text-align: center; }
.study-set-menu summary::-webkit-details-marker { display: none; }
.study-set-menu div { position: absolute; right: 0; top: 32px; z-index: 3; width: 130px; padding: 6px; border: 1px solid #e2dfd6; border-radius: 6px; background: white; box-shadow: 0 8px 18px #0001; }
.study-set-menu button { width: 100%; text-align: left; padding: 9px; background: transparent; cursor: pointer; border-radius: 4px; }
.study-set-menu button:hover { background: #f3f2ec; }
.create-card { justify-content: center; align-items: center; text-align: center; border-style: dashed; background: #faf9f4; }
.create-card strong { font-size: 42px; font-weight: 400; line-height: 1; }
.create-card p { max-width: 210px; }
.sets-empty { grid-column: 1 / -1; min-height: 200px; display: grid; place-content: center; justify-items: center; gap: 14px; color: #666; }

.study-set-dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; border: 1px solid #dedbd3; border-radius: 8px; padding: 26px; color: #242424; background: #fffefa; box-shadow: 0 18px 70px #0003; }
.study-set-dialog::backdrop { background: #0007; }
.study-set-dialog form, .study-set-dialog label, .focus-settings { display: grid; gap: 10px; }
.study-set-dialog h3 { margin-bottom: 18px; font-size: 20px; }
.study-set-dialog label { margin: 12px 0; font-size: 14px; }
.study-set-dialog .field, .study-set-dialog .select { width: 100%; }
.study-set-dialog textarea.field { padding: 10px 12px; line-height: 1.6; resize: vertical; }
.study-set-description-count { justify-self: end; color: #77746c; font-size: 12px; line-height: 1.4; }
.study-set-appearance { display: flex; align-items: end; gap: 12px; }
.study-set-appearance > label:first-child { flex: 1; min-width: 0; }
.study-set-dialog .study-set-color-label { flex: none; align-items: start; }
.study-set-color-label input { width: 48px; height: 42px; padding: 4px; border: 1px solid #dedbd3; border-radius: 7px; background: #fff; cursor: pointer; }
.study-set-icon-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding: 0; border: 0; }
.study-set-icon-choices legend { margin-bottom: 10px; font-size: 14px; }
.study-set-dialog .study-set-icon-choice { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.study-set-icon-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.study-set-icon-choice span { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #dedbd3; border-radius: 8px; background: #fff; font-size: 22px; }
.study-set-icon-choice .icon { width: 23px; height: 23px; }
.study-set-icon-choice input:checked + span { border-color: #242424; background: #f3f2ec; box-shadow: inset 0 0 0 1px #242424; }
.study-set-icon-choice input:focus-visible + span { outline: 2px solid #242424; outline-offset: 2px; }
.study-set-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.form-error { min-height: 20px; color: #b42318; font-size: 13px; }

.workspace-layout { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100%; }
.workspace-content { min-width: 0; width: 100%; margin-inline: auto; padding: 24px 24px 90px; }
.workspace-toolbar { margin-bottom: 24px; }
.workspace-toolbar .select { max-width: 280px; }
.workspace-title { justify-content: flex-start; align-items: center; margin: 0 0 34px; gap: 16px; }
.workspace-title .study-set-mark { width: 80px; height: 80px; flex-basis: 80px; border-radius: 14px; font-size: 41px; }
.workspace-title-copy { min-width: 0; flex: 1; }
.workspace-title-line { display: flex; align-items: center; gap: 14px; }
.workspace-title h3 { font: 400 30px/1.25 var(--font-reading); overflow-wrap: anywhere; }
.workspace-settings-button { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 6px; color: #77746c; background: transparent; cursor: pointer; }
.workspace-settings-button:hover { background: #f0eee8; }
.workspace-settings-button:focus-visible { outline: 2px solid #222; }
.workspace-status-row { display: flex; align-items: center; gap: 0; width: min(100%, 510px); min-height: 38px; border: 1px solid #e3e0d8; border-radius: 9px; background: #fff; font-size: 14px; }
.workspace-status-row > span { display: flex; align-items: center; gap: 6px; min-height: 23px; padding: 0 11px; white-space: nowrap; }
.workspace-status-row > span + span { border-left: 1px solid #e3e0d8; }
.workspace-status-row .icon { width: 16px; height: 16px; flex: none; color: #77746c; }
.workspace-status-row .workspace-purple-icon { color: #bb5adf; }
.workspace-mode-menu { position: relative; flex: none; }
.workspace-mode-menu summary { display: grid; place-items: center; width: 32px; height: 32px; list-style: none; border-radius: 50%; background: #f7f5ef; cursor: pointer; font-size: 23px; line-height: 1; }
.workspace-mode-menu summary::-webkit-details-marker { display: none; }
.workspace-mode-menu summary:focus-visible { outline: 2px solid #222; outline-offset: 2px; }
.workspace-mode-popover { position: absolute; top: 38px; left: 0; z-index: 4; width: 188px; padding: 5px; border: 1px solid #e3e0d8; border-radius: 10px; background: #fff; box-shadow: 0 10px 30px #0002; }
.workspace-mode-heading { display: block; padding: 7px 10px; color: #77746c; font-size: 12px; }
.workspace-mode-popover button { display: flex; align-items: center; width: 100%; min-height: 40px; gap: 10px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; text-align: left; font-size: 13px; }
.workspace-mode-popover button:hover, .workspace-mode-popover button:focus-visible { background: #f6f4ee; }
.workspace-mode-menu[data-current-mode="sprint"] [data-workspace-mode="sprint"],
.workspace-mode-menu[data-current-mode="standard"] [data-workspace-mode="standard"],
.workspace-mode-menu[data-current-mode="comprehensive"] [data-workspace-mode="comprehensive"] { background: #f6f4ee; }
.workspace-mode-glyph { width: 16px; flex: none; font-size: 18px; letter-spacing: -4px; }
.workspace-mode-check { margin-left: auto; }
.workspace-recommendations-title { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.workspace-recommendations-title .icon { width: 20px; height: 20px; }
.workspace-recommendations-title h4 { margin: 0; font: 400 21px/1.3 var(--font-reading); }
.workspace-topic-tabs { display: flex; gap: 12px; width: min(100%, 600px); overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; }
.workspace-topic-tab { flex: 0 0 192px; min-width: 0; min-height: 42px; display: flex; align-items: center; gap: 8px; overflow: hidden; padding: 0 12px; border: 1px solid #e4e2de; border-radius: 11px; background: transparent; color: #77746c; cursor: pointer; text-align: left; }
.workspace-topic-index { flex: none; color: #77746c; font: 13px var(--font-code); }
.workspace-topic-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-topic-tab.active { border-color: #e4e2de; background: #fff; color: #222; box-shadow: 0 2px 4px #0002; }
.workspace-recommendation-card { width: min(100%, 900px); min-height: 220px; padding: 20px; border-radius: 22px; background: #fbf5ff; }
.workspace-recommendation-card > p { margin: 0 0 8px; color: #77746c; font-size: 13px; }
.workspace-recommendation-card > strong { display: block; font-size: 19px; }
.workspace-recommendation-card .btn { margin-top: 12px; }
.workspace-recommendation-card.is-empty { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-content: center; align-items: center; column-gap: 24px; row-gap: 6px; width: min(100%, 720px); min-height: 112px; padding: 24px; border-radius: 16px; }
.workspace-recommendation-card.is-empty > strong { grid-column: 1; grid-row: 1; margin: 0; font-size: 18px; line-height: 1.4; }
.workspace-recommendation-card.is-empty > p { grid-column: 1; grid-row: 2; margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.workspace-recommendation-card.is-empty > .btn { grid-column: 2; grid-row: 1 / 3; align-self: center; min-height: 40px; margin: 0; white-space: nowrap; }
.workspace-activity-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.workspace-activity-cards button { display: flex; flex-direction: column; min-width: 0; padding: 9px; border: 1px solid #e3e0d8; border-radius: 9px; background: #fff; cursor: pointer; text-align: left; }
.workspace-activity-cards button:hover { border-color: #242424; }
.workspace-activity-cards button:disabled { cursor: not-allowed; opacity: .55; }
.workspace-activity-cards button > span:first-child { min-height: 22px; font-size: 11px; font-weight: 600; }
.workspace-activity-art { display: grid; place-items: center; width: 100%; height: 86px; border-radius: 7px; }
.workspace-activity-art svg { width: 90px; height: 66px; }
.workspace-activity-art.chat { background: #f7d8ff; }
.workspace-activity-art.read { background: #fff686; }
.workspace-activity-art.assess { background: #b9fa92; }
.workspace-activity-cards strong { margin-top: 9px; font-size: 13px; }
.workspace-band { padding: 26px 0; }
.workspace-band h4 { font-size: 20px; font-weight: 620; margin-bottom: 12px; }
.workspace-band p { color: #77746c; line-height: 1.6; }
.workspace-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.workspace-methods button { min-height: 88px; border: 1px solid #e3e0d7; border-radius: 10px; background: #fff; cursor: pointer; text-align: left; padding: 15px; font-weight: 600; }
.workspace-methods button:hover { border-color: #222; }
.workspace-methods button:disabled { cursor: not-allowed; color: #888; background: #f4f3ef; }
.workspace-recommended-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.workspace-recommended-actions button { border: 1px solid #dedbd3; border-radius: 6px; padding: 9px 12px; background: #fff; cursor: pointer; }
.workspace-section-title h4 { margin: 0; }
.workspace-documents { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 14px; }
.workspace-doc { display: flex; justify-content: space-between; gap: 12px; min-width: 0; min-height: 56px; align-items: center; padding: 14px 16px; border: 1px solid #e5e2d9; border-radius: 8px; background: #fff; cursor: pointer; text-align: left; }
.workspace-doc strong { overflow-wrap: anywhere; }
.workspace-doc span { flex: none; color: #77746c; }
.focus-presets { display: flex; justify-content: center; gap: 8px; }
.focus-presets button { padding: 7px 12px; background: #f0eee7; border-radius: 5px; cursor: pointer; }

@media (max-width: 1300px) {
  .sets-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-methods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .workspace-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .sets-page { padding: 24px 16px 64px; }
  .sets-toolbar, .workspace-toolbar, .workspace-title { flex-wrap: wrap; }
  .sets-toolbar .select { width: 100%; }
  .sets-grid, .workspace-methods, .workspace-documents { grid-template-columns: minmax(0, 1fr); }
  .workspace-content { padding: 24px 16px 48px; }
  .workspace-title .study-set-mark { width: 62px; height: 62px; flex-basis: 62px; font-size: 32px; }
  .workspace-title h3 { font-size: 23px; }
  .workspace-status-row > span { padding: 0 10px; }
  .workspace-toolbar .select { max-width: none; }
}

.workspace-mode-settings { display:flex; margin-top:10px; }
