/* Calm shared surfaces. Business flows and native, accessible controls stay intact. */
:root { --workspace-bg: #f4f6f9; --workspace-soft: #f5f7fb; }
html[data-theme="dark"] { --workspace-bg: #101722; --workspace-soft: #1c293b; }
body, html[data-theme="dark"] body { background: var(--workspace-bg); }
.workspace .card, .workspace .entity-card, .workspace .tile, .auth-card, .upcoming-panel {
  box-shadow: none; border-radius: 14px;
}
.workspace .card { padding: 22px; }
.workspace .entity-card--link:hover { transform: none; box-shadow: none; border-color: var(--blue); }
.workspace .page-heading h1 { font-size: clamp(24px, 2.5vw, 32px); line-height: 1.2; letter-spacing: -.025em; }
.workspace .card h2 { line-height: 1.3; }
.workspace .form-stack label, .workspace .field legend { font-size: 14px; font-weight: 600; }
.weekday-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.weekday-field { padding: 0; border: 0; min-width: 0; }
.weekday-field legend { margin-bottom: 10px; font-weight: 600; }
.weekday-choices label { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.weekday-choices input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.workspace .form-stack :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea) {
  font-size: 16px; min-height: 44px; border-radius: 8px;
}
.workspace .hero, .workspace .lesson-hero { border-radius: 14px; box-shadow: none; }
.group-editor { max-width: 920px; gap: 12px; margin-top: 0; }
.workspace .group-editor-card { display: grid; gap: 16px; padding: 20px; }
.group-editor-card h2 { margin: 0; font-size: 18px; }
.group-basics-grid, .group-people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.group-editor .field { min-width: 0; margin: 0; }
.group-editor .field legend { margin-bottom: 8px; }
.group-editor .choice-list { max-height: 260px; overflow-y: auto; }
.workspace .group-editor .choice-list label { min-height: 44px; padding: 10px 12px; font-weight: 500; }
.group-editor .choice-list input[type=checkbox], .group-schedule-choice input { width: 20px; height: 20px; flex: 0 0 20px; accent-color: var(--blue); }
.group-editor .helptext { font-size: 13px; line-height: 1.4; }
.workspace .group-options { padding: 0 20px; }
.group-options > summary { cursor: pointer; min-height: 52px; display: flex; align-items: center; font-size: 14px; font-weight: 600; }
.group-options > summary::after { content: '+'; margin-left: auto; font-size: 22px; font-weight: 400; }
.group-options[open] > summary::after { content: '−'; }
.group-options > summary::-webkit-details-marker { display: none; }
.group-options-fields { display: grid; gap: 16px; padding: 4px 0 20px; }
.group-options-fields .field:first-child { max-width: 280px; }
.workspace .group-editor-footer { display: flex !important; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.workspace .group-schedule-choice { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 500; cursor: pointer; }
.group-editor-footer .form-actions { margin-left: auto; gap: 8px; }
.group-current-lesson { border-left: 3px solid var(--cyan); margin-bottom: 12px; }
.week-hour-line { position: absolute; left: 0; right: 0; height: 1px; border-top: 1px solid var(--line); pointer-events: none; }
.week-time-axis span:last-child { transform: translateY(-100%); }
.workspace .calendar-extra-actions > summary.button { padding: 11px 16px; min-width: 60px; white-space: nowrap; }
.calendar-extra-actions { flex-shrink: 0; }
.paper-summary > span { display: grid; gap: 4px; }
.paper-summary small { color: var(--muted); }
@media (max-width: 640px) {
  .workspace .lesson-hero { padding: 14px; gap: 10px; }
  .workspace .lesson-hero h1 { font-size: 20px; margin: 4px 0 6px; }
  .workspace .lesson-hero .eyebrow { font-size: 11px; margin: 0 0 4px; }
  .workspace .lesson-hero > div > p { margin: 4px 0; }
  .workspace .lesson-topic { padding: 10px; }
  .workspace .lesson-edit-button { min-height: 40px; padding: 8px 12px; margin-top: 8px; }
  .workspace .card { padding: 16px; }
  .group-basics-grid, .group-people-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .workspace .group-editor-card { gap: 14px; padding: 16px; }
  .workspace .group-options { padding: 0 16px; }
  .workspace .group-editor-footer { padding: 12px 16px; }
  .group-editor-footer .form-actions { width: 100%; margin: 0; }
  .group-editor-footer .form-actions > .button { flex: 1; }
  .group-editor .choice-list { max-height: 220px; }
}
/* Search-first roster: selected people stay visible, results are capped by API. */
.people-results { display: grid; gap: 6px; max-height: 280px; overflow: auto; }
.people-result { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 10px 12px; text-align: left; font: inherit; color: var(--navy); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.people-result span { overflow-wrap: anywhere; }
.people-result small { color: var(--blue); flex-shrink: 0; }
.people-result:disabled { cursor: default; opacity: .6; }
.people-result[hidden] { display: none; }
.people-result:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.workspace [data-people-query] { width: 100%; padding: 12px 14px; background: var(--surface); color: var(--navy); border: 1px solid var(--line); }
.people-selected:empty { display: none; }
.library-filters { display: grid; grid-template-columns: minmax(150px,2fr) repeat(3,minmax(120px,1fr)); gap: 12px; align-items: end; }
.workspace .lesson-grid { display:flex; flex-direction:column; gap:20px; }
.lesson-grid > [data-lesson-panel] { width:100%; min-width:0; }
.lesson-grid #lesson-materials { order:-1; }
[data-lesson-panel][hidden], [data-office-option][hidden] { display:none !important; }
.workspace .lesson-tabs { display:flex; gap:24px; padding:0; margin:24px 0 20px; border-bottom:1px solid var(--line); overflow-x:auto; }
.workspace .lesson-tabs a { flex:0 0 auto; border:0; border-radius:0; padding:14px 4px; background:transparent; font-weight:600; color:var(--muted); text-decoration:none; border-bottom:3px solid transparent; }
.workspace .lesson-tabs a[aria-selected="true"] { color:var(--navy); border-bottom-color:var(--blue); }
.lesson-context-actions { display:flex; flex-wrap:wrap; gap:12px 24px; margin:16px 0; font-size:14px; }
.lesson-context-actions a { text-underline-offset:4px; }
.library-file-options { border:0; padding:0; margin:0; min-width:0; }
.library-file-option { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 0; border-bottom:1px solid var(--line); }
.library-file-option label { display:flex; gap:12px; align-items:flex-start; cursor:pointer; min-width:0; }
.library-file-option input[type=radio] { flex:0 0 20px; width:20px; height:20px; margin:2px 0; accent-color:var(--blue); }
.library-file-option small { display:block; font-weight:400; color:var(--muted); margin-top:6px; overflow-wrap:anywhere; }
.lesson-library-filters { grid-template-columns:minmax(0,2fr) minmax(0,1fr) auto auto; }
.library-attach-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-top:20px; }
@media(max-width:640px) { .lesson-library-filters,.library-attach-options { grid-template-columns:1fr; } .library-file-option { align-items:flex-start; } }
.lesson-note-editor { border-top:1px solid var(--line); padding-top:20px; }
.lesson-note-editor textarea { min-height:88px; }
.journal-reminder { display:flex; justify-content:space-between; gap:16px; padding:16px 0; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.journal-reminder strong,.journal-reminder small { display:block; }
.journal-reminder small { color:var(--muted); margin-top:6px; }
.material-source { font-size:13px; color:var(--muted); margin:8px 0; }
.office-switcher { position:relative; max-width:310px; }
.office-switcher > summary { display:flex; align-items:center; gap:10px; min-height:44px; padding:8px 12px; border:1px solid var(--line); border-radius:8px; cursor:pointer; }
.office-switcher > summary > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.office-switcher > summary .ui-icon { filter:brightness(0) invert(1); flex:0 0 20px; }
.office-switcher > summary::-webkit-details-marker { display:none; }
.office-switcher__menu { position:absolute; top:calc(100% + 8px); right:0; z-index:100; width:320px; max-width:calc(100vw - 24px); max-height:60vh; overflow:auto; padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--surface); color:var(--navy); box-shadow:0 8px 24px #0002; }
.office-switcher__menu input { width:100%; margin:8px 0; }
.office-switcher__menu button { display:block; width:100%; text-align:left; border:0; border-radius:6px; padding:12px; background:transparent; color:var(--navy); font:inherit; cursor:pointer; }
.office-switcher__menu button:hover, .office-switcher__menu button[aria-current] { background:var(--workspace-soft); }
@media(max-width:640px) { .office-switcher { grid-column:1/-1; grid-row:2; width:100%; max-width:none; min-width:0; } .office-switcher > summary { font-size:12px; padding:6px 8px; gap:6px; } .office-switcher__menu { left:0; right:auto; } .workspace .lesson-tabs { gap:18px; margin-top:16px; } }
.library-filters .field { min-width: 0; display: grid; gap: 6px; }
.library-filters :is(input,select) { width:100%; min-height:44px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--navy); padding:10px; font:inherit; }
.library-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.library-item { min-width:0; padding:16px; border:1px solid var(--line); border-radius:12px; }
.library-item h3 { font-size:16px; line-height:1.4; margin:12px 0 8px; overflow-wrap:anywhere; }
.library-item h3 a { text-decoration:none; }
.library-item p { font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
.library-item__tags,.library-item__footer { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.library-item__footer { justify-content:space-between; padding-top:12px; }
@media(max-width:950px) { .library-filters { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:560px) { .library-filters,.library-grid { grid-template-columns:minmax(0,1fr); } }

/* The common form grid must not reveal inactive salary targets. */
[data-salary-rate] [data-rate-target][hidden] { display:none !important; }
@media(max-width:560px) {
  .salary-table table,.salary-table tbody { display:block; width:100%; min-width:0; }
  .salary-table thead { display:none; }
  .salary-table tbody tr { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; padding:16px 0; border-bottom:1px solid var(--line); }
  .salary-table tbody td { display:block; min-width:0; padding:0; border:0; overflow-wrap:anywhere; }
  .salary-table tbody td:first-child,.salary-table tbody td:last-child { grid-column:1/-1; }
  .salary-table tbody td[data-label]::before { content:attr(data-label); display:block; margin-bottom:4px; font-size:12px; color:var(--muted); }
  .salary-table tbody td:last-child { font-weight:750; }
}
/* Owner cohort: overflow belongs to the table, never to the mobile page. */
.sales-control-filters{margin-top:0;grid-template-columns:repeat(4,minmax(0,1fr));align-items:end}
.sales-control-filters .form-actions,.sales-control-filters .errorlist{grid-column:1/-1}
.sales-control-table{min-width:2100px;background:var(--surface);font-size:13px}
.sales-control-table td{vertical-align:top;max-width:260px;overflow-wrap:anywhere}
.sales-control-table small,.sales-control-table td>a{display:block;margin-top:5px}
.sales-control-table small{color:var(--muted)}
.sales-control-table .danger-text{color:#bf3838}
@media(max-width:768px){.sales-control-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:420px){.sales-control-filters{grid-template-columns:minmax(0,1fr)}}
.message--error{background:#fff1f2;color:#9f1239;border:1px solid #fda4af}
.message--warning{background:#fffbeb;color:#854d0e;border:1px solid #fcd34d}
.message--info{background:#eff6ff;color:#1e40af;border:1px solid #93c5fd}
html[data-theme="dark"] .message--error{background:#3a1621;color:#fecdd3;border-color:#9f3450}
html[data-theme="dark"] .message--warning{background:#382b15;color:#fde68a;border-color:#8a6a30}
html[data-theme="dark"] .message--info{background:#152a43;color:#bfdbfe;border-color:#3c6b9a}
