/* Local workspace layer. No remote fonts, assets or services. */
body { --ws-ink: #192e28; --ws-muted: #66766e; --ws-line: #dce6df; --ws-paper: #f3f6f2; --ws-surface: #fff; --ws-soft: #edf4ef; --ws-accent: #176349; --ws-top: #143f31; --ws-warning: #8b591b; --ws-warning-bg: #fff5df; --ink: var(--ws-ink); --muted: var(--ws-muted); --line: var(--ws-line); --paper: var(--ws-paper); --surface: var(--ws-surface); --forest: var(--ws-top); --forest-2: var(--ws-accent); --teal: var(--ws-accent); color: var(--ws-ink); background: var(--ws-paper); }
body[data-theme="dark"] { color-scheme: dark; --ws-ink: #e4eee8; --ws-muted: #a4b7ac; --ws-line: #35483e; --ws-paper: #141c18; --ws-surface: #1d2922; --ws-soft: #293c31; --ws-accent: #88d5ac; --ws-top: #0e251b; --ws-warning: #f1cf8a; --ws-warning-bg: #3c311d; }
body[data-theme="forest"] { color-scheme: dark; --ws-ink: #ecf2e5; --ws-muted: #afc3ad; --ws-line: #3c5943; --ws-paper: #192d22; --ws-surface: #233a2a; --ws-soft: #304a35; --ws-accent: #b7d49a; --ws-top: #112619; --ws-warning: #e9d295; --ws-warning-bg: #3b3b21; }
[hidden] { display: none !important; }
body[data-theme] :is(input, textarea, select) { color: var(--ws-ink); background: var(--ws-surface); border-color: var(--ws-line); }
body[data-theme] :is(label, .teacher-panel summary) { color: var(--ws-ink); }
body[data-theme] :is(.panel, .service-office, .service-guide-card, .service-history article, .contacts-panel, .conversation-panel, .case-panel, .files-card, .profile-card, .preferences-card) { background: var(--ws-surface); border-color: var(--ws-line); color: var(--ws-ink); }
body[data-theme] :is(.empty-copy, .service-guide-card p, .service-office small, .service-history p, .service-breadcrumb) { color: var(--ws-muted); }
body[data-theme] :is(.contact-item, .conversation-head, .side-section, .service-entry, .service-content, th, td) { border-color: var(--ws-line); }
body[data-theme] .message-stream { background: var(--ws-paper); }
body[data-theme] .message.contact { background: var(--ws-surface); color: var(--ws-ink); }
body[data-theme] .contact-item.active { background: var(--ws-soft); }
body[data-theme] :is(.guide-card, .file-card, .empty-files, .conversation-head, .composer, .pending-list li, .document-list a, .date-divider span) { background: var(--ws-surface); color: var(--ws-ink); border-color: var(--ws-line); }
body[data-theme] :is(.avatar, .file-icon, .panel-title small, .section-row > span, .attachment, .status-closed) { background: var(--ws-soft); color: var(--ws-accent); border-color: var(--ws-line); }
body[data-theme] .contact-item:hover { background: var(--ws-soft); }
body[data-theme] .message { background: var(--ws-surface); color: var(--ws-ink); }
body[data-theme] .message.student { background: var(--ws-soft); }
body[data-theme] :is(.message.system, .guide-note) { background: var(--ws-warning-bg); color: var(--ws-ink); border-color: var(--ws-line); }
body[data-theme] .message time { color: var(--ws-muted); }
body[data-theme] .rural-ad { background: var(--ws-warning-bg); border-color: var(--ws-line); }
body[data-theme] :is(.rural-ad h1, .ad-facts strong, .ad-contact strong, .magazine-bar span) { color: var(--ws-ink); }
body[data-theme] :is(.ad-kicker, .ad-location, .ad-facts span, .ad-copy, .ad-contact small, .ad-contact > span) { color: var(--ws-muted); }
body[data-theme] :is(.magazine-bar, .ad-facts, .ad-facts div, .ad-contact) { border-color: var(--ws-line); }
body[data-theme] .primary { background: var(--ws-accent); color: var(--ws-surface); }
body[data-theme="light"] .primary { color: #fff; }
body[data-theme] .secondary { background: var(--ws-soft); color: var(--ws-ink); border: 1px solid var(--ws-line); }
body[data-theme] .eyebrow { color: var(--ws-accent); }
body[data-theme] .app-topbar, body[data-theme] .admin-top { background: var(--ws-top); }
body[data-theme] a:focus-visible, body[data-theme] button:focus-visible, body[data-theme] summary:focus-visible { outline: 3px solid var(--ws-accent); outline-offset: 4px; }
.admin-shell { max-width: 1440px; }
.notice.success { background: var(--ws-soft); color: var(--ws-ink); border: 1px solid var(--ws-line); }
.admin-grid { display: block; min-width: 0; }
.admin-grid > .panel { min-width: 0; width: 100%; box-sizing: border-box; margin-top: 20px; }
.admin-grid .table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; }
.workspace-tabs { display: flex; gap: 6px; padding: 7px; margin: 24px 0 30px; background: var(--ws-surface); border: 1px solid var(--ws-line); border-radius: 14px; overflow-x: auto; }
.workspace-tabs a { text-decoration: none; padding: 12px 19px; border-radius: 9px; color: var(--ws-muted); font-size: .9rem; font-weight: 700; white-space: nowrap; display: flex; gap: 10px; align-items: center; }
.workspace-tabs a:hover { background: var(--ws-soft); color: var(--ws-ink); }
.workspace-tabs a.is-active { background: var(--ws-top); color: #fff; }
.workspace-tabs a span { padding: 2px 6px; border-radius: 6px; background: var(--ws-soft); color: var(--ws-ink); font-size: .72rem; }
.workspace-panel { min-width: 0; }
.workspace-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 0 0 22px; }
.workspace-section-heading h2 { font-family: Georgia, serif; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 500; margin: 6px 0 10px; }
.workspace-section-heading p:not(.eyebrow) { color: var(--ws-muted); max-width: 750px; margin: 0; }
.workspace-section-heading > .secondary { flex-shrink: 0; }
.workspace-preservation { padding: 15px 18px; background: var(--ws-soft); border: 1px solid var(--ws-line); border-left: 3px solid var(--ws-accent); border-radius: 9px; color: var(--ws-ink); font-size: .86rem; line-height: 1.65; }
.workspace-toolbar { display: flex; align-items: center; gap: 24px; margin: 24px 0; }
.workspace-toolbar label { width: min(100%, 410px); flex-shrink: 0; }
.workspace-muted { color: var(--ws-muted); font-size: .85rem; line-height: 1.65; }
.workspace-toolbar p { max-width: 500px; }
.office-layout { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(0, 2.8fr); gap: 20px; align-items: start; }
.office-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.office-card { background: var(--ws-surface); border: 1px solid var(--ws-line); border-radius: 14px; padding: 22px; min-width: 0; transition: box-shadow .15s, border-color .15s; }
.office-pool { border-style: dashed; position: sticky; top: 20px; min-height: 210px; }
.office-card-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 18px; align-items: flex-start; }
.office-card-heading h3 { font-size: 1.15rem; line-height: 1.45; margin: 9px 0 4px; overflow-wrap: anywhere; }
.office-card-logo { width: 40px; height: 40px; object-fit: contain; vertical-align: middle; margin-right: 10px; border-radius: 8px; }
.office-count { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; background: var(--ws-soft); border-radius: 10px; font-size: .85rem; font-weight: 800; }
.workspace-badge { display: inline-flex; align-items: center; max-width: 100%; gap: 4px; padding: 4px 8px; background: var(--ws-soft); color: var(--ws-muted); border-radius: 6px; font-size: .67rem; font-weight: 800; letter-spacing: .025em; overflow-wrap: anywhere; }
.badge-active, .chief-badge { color: var(--ws-accent); }
.badge-warning { background: var(--ws-warning-bg); color: var(--ws-warning); }
.office-students { display: grid; gap: 8px; min-height: 42px; }
.student-chip { display: flex; align-items: center; gap: 10px; padding: 11px 10px; border: 1px solid var(--ws-line); border-radius: 9px; background: var(--ws-paper); cursor: grab; }
.student-chip:active { cursor: grabbing; }
.student-initial { width: 29px; height: 29px; flex: 0 0 29px; background: var(--ws-soft); color: var(--ws-accent); border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.student-chip-copy { min-width: 0; flex: 1; }
.student-chip-copy strong { font-size: .79rem; display: block; line-height: 1.45; overflow-wrap: anywhere; }
.student-chip-copy small { display: block; color: var(--ws-muted); font-size: .68rem; margin-top: 3px; }
.student-chip .workspace-badge { font-size: .6rem; padding: 3px 5px; }
.drag-handle { color: var(--ws-muted); font-size: 1.2rem; }
.student-inactive { opacity: .7; }
.is-dragging { opacity: .4; }
.is-drop-target { border-color: var(--ws-accent); box-shadow: 0 0 0 3px var(--ws-soft); }
.office-card-footer { padding-top: 15px; border-top: 1px solid var(--ws-line); margin-top: 17px; }
.office-settings { margin: 12px 0 0 !important; }
.office-settings summary { font-size: .8rem; color: var(--ws-accent); }
.compact-form { border-top: 1px solid var(--ws-line); padding: 17px 0 6px; margin-top: 14px; gap: 12px; }
.compact-form label { font-size: .78rem; }
.compact-form input, .compact-form select { width: 100%; padding: 9px; }
.workspace-empty { color: var(--ws-muted); font-size: .83rem; padding: 14px 0; line-height: 1.6; }
.workspace-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.workspace-form-grid .panel { margin: 0; }
.workspace-panel .settings-form { max-width: 760px; margin-top: 18px; }
.workspace-panel .settings-form input, .workspace-panel .settings-form select, .workspace-panel .settings-form textarea { width: 100%; min-width: 0; }
.form-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.workspace-panel table { width: 100%; }
.workspace-panel table th { color: var(--ws-muted); background: var(--ws-soft); font-size: .74rem; font-weight: 700; text-align: left; }
.workspace-panel table td { font-size: .82rem; vertical-align: top; overflow-wrap: anywhere; }
.table-secondary { display: block; color: var(--ws-muted); margin-top: 5px; font-size: .72rem; }
.workspace-panel pre { background: var(--ws-paper); border: 1px solid var(--ws-line); padding: 16px; border-radius: 10px; overflow: auto; font-size: .78rem; }
.intervention-details > summary { padding: 15px 0; color: var(--ws-accent); }
.checkbox-label { display: flex; align-items: flex-start; gap: 10px; line-height: 1.6; }
.checkbox-label input { width: auto !important; margin-top: 4px; }
.inventory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
.inventory-item { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--ws-line); border-radius: 10px; }
.inventory-item strong { font-size: .8rem; font-weight: 600; overflow-wrap: anywhere; flex: 1; min-width: 0; }
.inventory-item .workspace-badge { flex-shrink: 0; }
.version-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid rgba(255,255,255,.25); border-radius: 7px; font-size: .67rem; letter-spacing: .035em; color: #d5e8dc; white-space: nowrap; }
.profile-shell, .preferences-shell { width: min(960px, calc(100% - 32px)); margin: 36px auto 60px; }
.profile-card, .preferences-card { background: var(--ws-surface); border: 1px solid var(--ws-line); border-radius: 15px; padding: 26px; margin: 20px 0; }
.profile-form, .preferences-form { display: grid; gap: 18px; max-width: 650px; }
.profile-grid, .preferences-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.logo-preview, .office-logo-preview { display: block; max-width: 180px; max-height: 120px; object-fit: contain; padding: 12px; border: 1px solid var(--ws-line); border-radius: 10px; background: var(--ws-soft); }
.office-logo { max-width: 46px; max-height: 46px; object-fit: contain; border-radius: 8px; }
.profile-logo { max-width: 180px; max-height: 120px; margin: 12px 0; padding: 10px; border: 1px solid var(--ws-line); background: var(--ws-soft); }
.profile-shell > .panel { margin-top: 20px; }
.profile-shell > h1 { font-family: Georgia, serif; font-weight: 500; font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 8px 0 24px; }
.profile-shell .settings-form { max-width: 640px; }
.profile-shell input[type="checkbox"] { width: auto; justify-self: start; }
@media (min-width: 1500px) { .office-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1050px) { .office-layout { grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); } .office-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .workspace-tabs { gap: 3px; margin-top: 18px; } .workspace-tabs a { padding: 11px 13px; font-size: .8rem; } .workspace-section-heading { flex-wrap: wrap; gap: 12px; } .workspace-toolbar { align-items: stretch; flex-direction: column; gap: 6px; } .workspace-toolbar label { width: 100%; } .office-layout, .workspace-form-grid, .inventory-grid, .profile-grid, .preferences-grid { grid-template-columns: 1fr; } .office-pool { position: static; } .office-card { padding: 18px; } .workspace-panel .table-wrap { max-width: 100%; overflow-x: auto; } .workspace-panel table { min-width: 580px; } .workspace-form-grid { gap: 16px; } .version-badge { font-size: .6rem; } }
@media (max-width: 420px) { .form-two-col { grid-template-columns: 1fr; } .inventory-item { flex-wrap: wrap; } .workspace-panel .panel, .profile-card, .preferences-card { padding: 18px; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } .office-card { transition: none; } }
