:root[data-theme="light"]{color-scheme:light;--bg:#f7f7f8;--surface:#fff;--ink:#18181b;--muted:#64646e;--line:#e4e4e7;--sidebar:#fff;--shadow:0 8px 28px #18181b08}
:root[data-theme="dark"]{color-scheme:dark;--bg:#0b0b0d;--surface:#17171a;--ink:#f4f4f5;--muted:#aaaab5;--line:#34343c;--sidebar:#101012;--secondary:#282433;--green:#75d9ba;--shadow:0 8px 28px #0005}
.preferences-bar{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-shrink:0;margin-inline-start:auto}.preferences-bar button,.preferences-bar select{margin:0;min-height:40px;height:40px;font-size:12px;line-height:1.4;border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:12px;box-shadow:none}.preferences-bar button{padding:7px 11px;gap:7px}.preference-theme>span:first-child{font-size:19px}.preferences-bar select{width:89px;padding:7px 6px}.preferences-bar label{margin:0}.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}.login-form-area .preferences-bar{margin-bottom:24px}.app-topbar{height:auto!important;min-height:76px;flex-wrap:wrap;padding-top:10px;padding-bottom:10px}.topbar-right{min-width:0}.topbar-right>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.public-header{flex-wrap:wrap}
html[data-theme] body{background:var(--bg);color:var(--ink)}html[data-theme] .sidebar{background:var(--sidebar);color:var(--muted);border-inline-end:1px solid var(--line)}html[data-theme] .sidebar .brand{color:var(--ink)}html[data-theme] .sidebar nav a{color:var(--muted)}html[data-theme] .sidebar nav a.active{color:var(--ink);background:var(--secondary);border-color:var(--line)}html[data-theme] .sidebar nav a:hover{color:var(--ink);background:var(--secondary)}html[data-theme] .sidebar .nav-icon{stroke:currentColor}html[data-theme] .app-topbar,html[data-theme] .public-header{background:var(--surface)!important;border-color:var(--line)}html[data-theme] .panel,html[data-theme] .card,html[data-theme] .class-card,html[data-theme] .lesson-card,html[data-theme] .kpi,html[data-theme] .auth-card,html[data-theme] .owner-dialog,html[data-theme] .room-stage,html[data-theme] .room-sidebar,html[data-theme] .login-form-area{background:var(--surface);color:var(--ink);border-color:var(--line)}html[data-theme] .kpi strong,html[data-theme] label,html[data-theme] .stage-bar,html[data-theme] .teacher-tools summary{color:var(--ink)}html[data-theme] input,html[data-theme] textarea,html[data-theme] select{background:var(--bg);border-color:var(--line);color:var(--ink)}html[data-theme] input::placeholder,html[data-theme] textarea::placeholder{color:var(--muted);opacity:1}html[data-theme] .outline,html[data-theme] .empty,html[data-theme] .question,html[data-theme] th{background:var(--bg);color:var(--ink);border-color:var(--line)}html[data-theme] tbody tr:hover{background:var(--bg)}html[data-theme] .table-wrap,html[data-theme] .school-heading,html[data-theme] .footer,html[data-theme] td,html[data-theme] .list-row,html[data-theme] .stage-bar,html[data-theme] .device-dock,html[data-theme] .room-side-tabs,html[data-theme] .room-person,html[data-theme] .hand-row,html[data-theme] .teacher-tools{border-color:var(--line)}html[data-theme] .device-dock,html[data-theme] .room-side-tabs,html[data-theme] .teacher-tools{background:var(--surface)}html[data-theme] .stage-video,html[data-theme] .classroom-shell:fullscreen{background:var(--bg)}html[data-theme] .classroom-shell:fullscreen{direction:inherit}html[data-theme] .class-card .tag,html[data-theme] .role-tag,html[data-theme] .card-icon,html[data-theme] .avatar{background:var(--secondary);color:var(--ink)}html[data-theme] .room-meta,html[data-theme] .room-breadcrumb,html[data-theme] .device-hint,html[data-theme] .compose-hint,html[data-theme] .person-devices,html[data-theme] .stage-placeholder p,html[data-theme] .stage-placeholder>span:last-child,html[data-theme] .classroom-page #chat-status,html[data-theme] .classroom-page #people-status{color:var(--muted)}
html[data-theme="light"] .home-board,html[data-theme="light"] .login-art{background:#efeff2;color:#18181b;border-color:#dedee4}html[data-theme="light"] .home-board .muted,html[data-theme="light"] .login-art p{color:#64646e!important}html[data-theme="light"] .board-track{background:#fff;color:#37373f;border-color:#dcdce2}html[data-theme="light"] .board-row{border-color:#dcdce2}html[data-theme="light"] .stage-placeholder{color:#18181b}
html[data-theme="dark"] .home-board,html[data-theme="dark"] .login-art{background:#101012;color:#f4f4f5;border-color:#34343c}html[data-theme="dark"] .board-track{background:#242429;color:#f4f4f5;border-color:#34343c}html[data-theme="dark"] .board-row{border-color:#34343c}html[data-theme="dark"] .home-board .muted{color:var(--muted)}html[data-theme="dark"] .status,html[data-theme="dark"] #status,html[data-theme="dark"] #message{background:#262333;color:#e3def9;border-color:#443a5c}html[data-theme="dark"] .chat-message{background:#202025;border-color:var(--line);color:var(--ink)}html[data-theme="dark"] .chat-message.mine{background:#292435;border-color:#443b59}html[data-theme="dark"] .message-body,html[data-theme="dark"] .message-author,html[data-theme="dark"] .person-info,html[data-theme="dark"] .stage-placeholder h2{color:var(--ink)}html[data-theme="dark"] .chat-shortcut{background:#17332e;color:#98e4d1}html[data-theme="dark"] .room-side-tabs button,html[data-theme="dark"] .stage-tabs button{color:var(--muted);background:transparent}html[data-theme="dark"] .room-side-tabs button[aria-selected="true"],html[data-theme="dark"] .stage-tabs button[aria-selected="true"]{background:#30293e;color:#f0e9ff}html[data-theme="dark"] .stage-placeholder,html[data-theme="dark"] .device-button{color:var(--ink)}html[data-theme="dark"] .device-button{background:#25252c;border-color:var(--line)}html[data-theme="dark"] .device-button img{filter:brightness(0) invert(1)}html[data-theme="dark"] .hand-button,html[data-theme="dark"] .hand-row .hand-order{background:#332916;color:#ffdc8a}html[data-theme="dark"] .classroom-page #hands-status,html[data-theme="dark"] .classroom-page #experience-status{background:#332916;color:#ffdc8a}html[data-theme="dark"] .placeholder-mark{background:#25212e;color:#dbd0ff}html[data-theme="dark"] .media-request-row{background:#202025;border-color:var(--line)}html[data-theme="dark"] .badge{background:#17332e;color:#98e4d1;border-color:#29594c}html[data-theme="dark"] .login-form-area #show-password{background:#282433;color:#e3def9}html[data-theme="dark"] .whiteboard-panel{background:var(--surface);border-color:var(--line)}
.preferences-bar button{width:auto}html[data-theme="dark"] .chat-messages{background:var(--bg);border-color:var(--line)}html[data-theme="dark"] .chat-message.mine{background:#292435;border-color:#443b59}html[data-theme="dark"] .classroom-page :is(h1,h2,h3){color:var(--ink)}html[data-theme="dark"] .classroom-page #leave{background:#30232b;color:#ffb8c5}html[data-theme="dark"] .classroom-page #room-fullscreen{background:#25252c;color:var(--ink)}html[data-theme="dark"] .classroom-page #media-controls button{background:#25252c;color:var(--ink);border:1px solid var(--line)}html[data-theme="dark"] .classroom-page #media-controls .device-on{background:#17332e!important;color:#98e4d1!important;border-color:#29594c}html[data-theme="dark"] .classroom-page #media-controls .media-control-request{background:#332916!important;color:#ffdc8a!important}
/* The drawing canvas stays white so saved colors remain faithful. */
html[data-theme] #whiteboard{background:#fff;color:#18181b;color-scheme:light}
html[dir="ltr"] .sidebar{inset:0 auto 0 0}html[dir="ltr"] .app-main,html[dir="ltr"] body.app-page>main{margin:30px 36px 80px 268px}html[dir="ltr"] .sidebar nav a.active{box-shadow:inset 3px 0 #9e95ff}html[dir="ltr"] .sidebar nav a{text-align:start}html[dir="ltr"] .message-body,html[dir="ltr"] .resource-body{unicode-bidi:plaintext;text-align:start}html[dir="rtl"] .message-body,html[dir="rtl"] .resource-body{unicode-bidi:plaintext;text-align:start}
@media(min-width:1250px){html[dir="ltr"] .classroom-page .app-main{margin:25px 30px 45px 114px}}
@media(min-width:1600px){html[dir="ltr"] .app-main,html[dir="ltr"] body.app-page>main{margin-inline-end:auto;margin-inline-start:calc(232px + (100vw - 1500px)/2)}html[dir="ltr"] .classroom-page .app-main{margin:25px 30px 45px 114px}}
@media(min-width:951px) and (max-width:1180px){html[dir="ltr"] .app-main,html[dir="ltr"] body.app-page>main{margin:28px 24px 60px 229px}}
@media(max-width:950px){html[dir="ltr"] .sidebar{transform:translateX(-100%)}html[dir="ltr"] .sidebar.open{transform:translateX(0)}html[dir="ltr"] .app-main,html[dir="ltr"] body.app-page>main{margin:25px 18px 65px}html[dir="ltr"] .classroom-page .app-main{margin:20px 16px 45px}.app-topbar{gap:8px;min-height:68px}.preferences-bar{gap:5px}.preferences-bar select{width:80px}.preferences-bar button{padding:7px 9px}.preferences-bar .preference-theme-label{display:none}}
@media(max-width:480px){.app-topbar .user-chip [data-user-name]{display:none}.app-topbar .topbar-right>span{max-width:75px;font-size:11px}.public-header .preferences-bar{flex-basis:100%;padding-top:6px}.preferences-bar select{font-size:12px}.app-topbar{padding-inline:12px}.user-chip{flex-shrink:0}.preferences-bar button,.preferences-bar select{min-height:44px;height:44px}}
@media print{.preferences-bar{display:none!important}html[data-theme] body,html[data-theme] .panel,html[data-theme] .card{background:white!important;color:black!important}html[data-theme] :is(h1,h2,h3,p,label,td,th){color:black!important}}

/* SAMAROOM CHAT THEME V33 START */
html[data-theme] #room-chat-form #chat-body,
html[data-theme] .chat-compose textarea#chat-body {
  background: var(--surface) !important;
  color: var(--ink) !important;
  -webkit-text-fill-color: var(--ink) !important;
  caret-color: var(--ink) !important;
  border-color: var(--line) !important;
}
html[data-theme] #chat-body::placeholder {
  color: var(--muted) !important;
  -webkit-text-fill-color: var(--muted) !important;
  opacity: 1;
}
html[data-theme="dark"] #chat-body { color-scheme: dark; }
html[data-theme="light"] #chat-body { color-scheme: light; }
/* SAMAROOM CHAT THEME V33 END */
