@charset "UTF-8";

/* Admin-only polish. The student workspace keeps its existing layout. */
body.admin-mode {
  --bg: #f4f6f1;
  --paper: #fffefb;
  --ink: #172d28;
  --muted: #64766e;
  --line: #dce6dc;
  --green: #1d6650;
  --light: #e8f3eb;
  --orange: #e7b56f;
  background: radial-gradient(circle at 80% 0, #e5f0e8 0, transparent 34%), var(--bg);
}
.admin-mode .sidebar {background: #fffcf8; border-color: #e1e8dd;}
.admin-mode .sidebar-note {border-radius: 18px; background: #edf5eb; padding: 22px; margin-bottom: 20px;}
.admin-mode .nav-button {min-height: 48px; border-radius: 13px; transition: background .18s ease, transform .18s ease;}
.admin-mode .nav-button:hover {background: #edf5ec; transform: translateX(3px);}
.admin-mode .nav-button.active {background: #dceee0; box-shadow: inset 3px 0 #2b8b65;}
.admin-mode .nav-icon {display: inline-flex; align-items: center; justify-content: center; flex: 0 0 25px;}
.admin-mode .nav-icon svg {width: 22px; height: 22px;}
.admin-mode .workspace-label {color: #58816d;}
.admin-mode .group-switch select {border-radius: 12px; border-color: #cbded0; font-weight: 650;}
.admin-mode .workspace-top {align-items: end;}
.admin-mode .workspace-top h1 {font-weight: 800; letter-spacing: -.045em;}
.admin-mode .workspace-top .muted {max-width: 620px;}
.admin-mode .btn {border-radius: 11px; min-height: 44px;}
.admin-mode .btn.admin-primary {color: #fff; background: #206a50; border-color: #206a50; box-shadow: 0 8px 18px #0b503526;}
.admin-mode .btn.admin-primary:hover {background: #15583f;}
.admin-mode .btn.admin-ghost {background: #ffffff19; color: #fff; border-color: #ffffff68;}
.admin-mode .btn.admin-ghost:hover {background: #ffffff2b;}
.admin-mode .card {box-shadow: 0 7px 24px #19372909;}
.admin-mode .eyebrow {letter-spacing: .16em;}
.admin-mode .nav-more {display: none;}

.admin-hero {position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 250px; align-items: center; min-height: 250px; border-radius: 24px; background: linear-gradient(120deg, #102c28 0%, #1c5041 57%, #287259 100%); color: #fff; padding: 38px 42px; box-shadow: 0 18px 38px #19433224; isolation: isolate;}
.admin-hero::before {content: ""; position: absolute; width: 470px; height: 470px; border-radius: 50%; right: -150px; top: -230px; background: radial-gradient(circle, #e9d7a331, transparent 65%); pointer-events: none;}
.admin-hero-copy {position: relative; z-index: 2;}
.admin-kicker {font-size: 10px; font-weight: 800; letter-spacing: .2em; color: #c6e4ce;}
.admin-hero h2 {white-space: pre-line; font-size: clamp(26px, 3.6vw, 43px); font-weight: 800; line-height: 1.18; letter-spacing: -.045em; margin: 18px 0 12px;}
.admin-hero p {color: #d4e7db; font-size: 13px; line-height: 1.7; margin-bottom: 25px;}
.admin-hero .btn.admin-primary {background: #e8c691; color: #17342b; border-color: #e8c691; box-shadow: none;}
.admin-hero .actions {gap: 10px;}
.admin-hero-art {position: relative; height: 220px; width: 220px; justify-self: center;}
.orbit {position: absolute; inset: 16px; border-radius: 50%; border: 1px solid #bde0c363;}
.orbit-one {transform: rotate(-28deg) scaleX(.78); animation: orbit-breathe 8s ease-in-out infinite alternate;}
.orbit-two {inset: 0; transform: rotate(30deg) scaleX(.82); border-color: #e5c99088; animation: orbit-breathe 9s ease-in-out infinite alternate-reverse;}
.orbit-core {position: absolute; inset: 45px; border-radius: 28px; overflow: hidden; transform: rotate(-8deg); box-shadow: 0 14px 30px #041b174d; background: #fff;}
.orbit-core img {display: block; width: 100%; height: 100%; object-fit: cover; transform: rotate(8deg) scale(1.13);}
.orbit-chip {position: absolute; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; font-weight: 800; background: #f6dfad; color: #193b2d; box-shadow: 0 7px 16px #021a1736;}
.orbit-chip-one {right: 2px; top: 33px; transform: rotate(14deg);}
.orbit-chip-two {left: 4px; bottom: 26px; transform: rotate(-14deg);}
@keyframes orbit-breathe {to {transform: rotate(32deg) scaleX(.9); opacity: .56;}}

.admin-metrics {display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 22px;}
.admin-metrics .stat {padding: 17px 18px; box-shadow: 0 6px 20px #1937290a;}
.admin-metrics .stat strong {font-size: 22px; font-weight: 800; margin-top: 7px;}
.admin-metrics .stat small {font-size: 11px;}
.admin-home-grid {display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 18px; align-items: start;}
.admin-home-grid > .card {margin: 0; min-width: 0;}
.admin-home-grid > .card:nth-child(n+3) {grid-column: span 1;}
.journey {display: grid; gap: 10px;}
.journey-step {display: grid; grid-template-columns: 30px 42px minmax(0, 1fr) 18px; gap: 10px; align-items: center; width: 100%; padding: 13px 11px; border: 1px solid #e1e9df; border-radius: 13px; background: #fafcf8; text-align: left; color: var(--ink); transition: transform .17s ease, border-color .17s ease, background .17s ease;}
.journey-step:hover {transform: translateY(-2px); border-color: #9fc9a8; background: #f2faf2;}
.journey-index {display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #193f32; color: white; font-size: 12px; font-weight: 800;}
.journey-step.done .journey-index {background: #def1db; color: #196346;}
.journey-icon {display: grid; place-items: center; width: 40px; height: 40px; color: #246a4e; background: #e7f1e8; border-radius: 11px;}
.journey-copy strong,.journey-copy small {display: block;}
.journey-copy strong {font-size: 12px;}
.journey-copy small {font-size: 10px; color: var(--muted); line-height: 1.5; margin-top: 3px;}
.journey-arrow {font-size: 17px; color: #72a285;}
.next-action-icon {width: 54px; height: 54px; display: grid; place-items: center; margin: 15px 0; border-radius: 16px; background: #f0eadb; color: #7b5d26;}
.next-action-icon svg {width: 28px; height: 28px;}
.admin-home-grid .card > .muted {margin-bottom: 20px;}

.admin-page-intro {margin-bottom: 20px;}
.admin-page-intro p {font-size: 15px; margin: 5px 0 0; color: var(--muted);}
.groups-layout {display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: 20px;}
.groups-layout > .card {margin: 0;}
.connect-steps {display: grid; gap: 11px; margin: 21px 0;}
.connect-steps > div {display: grid; grid-template-columns: 32px 1fr; column-gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line);}
.connect-steps > div > span {grid-row: span 2; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: #e7f2e8; color: #1c6549; font-size: 12px; font-weight: 800;}
.connect-steps strong {font-size: 12px;}
.connect-steps small {font-size: 11px; color: var(--muted); line-height: 1.6; margin-top: 4px;}
.connect-buttons {display: grid; grid-template-columns: 1fr 1fr; gap: 8px;}
.connect-note {display: flex; align-items: flex-start; gap: 10px; margin: 17px 0 0; padding: 12px; border-radius: 11px; background: #f3f7ef; font-size: 11px; color: #526f5e; line-height: 1.6;}
.connect-note svg {flex: 0 0 19px; width: 19px; height: 19px;}
.advanced-connect summary {font-size: 11px;}
.classroom-list {display: grid; gap: 11px;}
.classroom-card {border: 1px solid #dce8da; border-radius: 15px; background: #fafcf9; padding: 17px; box-shadow: 0 5px 15px #1a43280a;}
.classroom-card.is-pending {border-color: #ecd7ad; background: #fffcf4;}
.classroom-top {display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center;}
.classroom-icon {display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: #e4f1e6; color: #176349;}
.classroom-icon svg {width: 21px; height: 21px;}
.classroom-top strong,.classroom-top small {display: block; overflow-wrap: anywhere;}
.classroom-top strong {font-size: 13px;}
.classroom-top small {font-size: 10px; color: var(--muted); margin-top: 3px;}
.classroom-card p {font-size: 11px; line-height: 1.65; margin: 11px 0;}
.classroom-linked {color: #52735e;}
.classroom-status {color: var(--muted);}
.classroom-card .actions {margin-top: 14px;}
.picker-guide {text-align: center; padding: 8px;}
.picker-guide h3 {font-size: 18px; margin: 14px 0 8px;}
.picker-guide .actions {justify-content: center; margin-top: 20px;}
.picker-picture {width: 86px; height: 86px; border-radius: 24px; background: linear-gradient(145deg, #d9eedd, #f6e1bc); color: #21634d; display: grid; place-items: center; margin: auto;}
.picker-picture svg {width: 40px; height: 40px;}
.more-links {display: grid; gap: 10px; margin-top: 18px;}
.more-links .btn {justify-content: flex-start;}

.owner-bank-hero {position: relative; padding: 24px; margin-bottom: 18px; border-radius: 18px; color: #fff; background: linear-gradient(120deg, #183b31, #326b54); overflow: hidden;}
.owner-bank-hero::after {content: "✦"; position: absolute; right: 24px; top: 8px; font-size: 74px; color: #d8e8ba55;}
.owner-bank-hero .eyebrow,.owner-bank-hero .muted {color: #d4e9d7;}
.owner-bank-hero h2 {margin: 8px 0; font-size: 25px;}
.owner-question-mark {color: #9d7b3e; font-size: 18px; line-height: 1;}
.source-pill {background: #f8edd3; color: #6c552d;}
.owner-bank-view .bank-filters {grid-template-columns: repeat(3, minmax(0, 1fr));}

.result-sheet {border-top: 5px solid var(--result-accent, #27634b); padding-top: 16px;}
.result-title {display: flex; align-items: center; gap: 14px; margin: 0 0 15px;}
.result-title h3 {font-size: 18px; margin: 0 0 3px;}
.result-trophy {width: 44px; height: 44px; border-radius: 12px; background: #fff0cf; display: grid; place-items: center; font-size: 22px;}
.result-metrics {display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 13px 0;}
.result-metrics .stat {padding: 10px;}
.result-metrics .stat strong {font-size: 17px; margin-top: 3px;}
.result-metrics .stat small {font-size: 10px;}
.result-scroll {margin: 15px 0; border: 1px solid var(--line); border-radius: 12px;}
.result-table {min-width: 520px;}
.result-table thead {background: #e6eee7;}
.result-table th {font-weight: 700; color: #385844;}
.result-table th,.result-table td {padding: 11px 7px; white-space: nowrap; text-align: center;}
.result-table th:nth-child(2),.result-table td:nth-child(2) {text-align: left;}
.result-table tbody tr:nth-child(even) {background: #f7faf6;}
.result-table .student-cell {min-width: 110px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; font-weight: 650;}
.result-table .rank-cell {font-size: 16px;}
.result-mobile-list {display: none;}
.result-note {font-size: 11px; color: var(--muted); line-height: 1.7; margin: 8px 0 17px;}
.class-identity {display:flex; align-items:center; gap:12px; margin:12px 0 8px; min-width:0;}
.class-identity strong {display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.class-identity small {display:block; color:var(--muted); font-size:11px;}
.class-avatar {width:46px; height:46px; flex:none; border-radius:16px; background:linear-gradient(135deg,#2a704f,#b78d46); color:#fff; display:grid; place-items:center; font-size:21px; font-weight:800; overflow:hidden;}
.class-avatar img {width:100%; height:100%; object-fit:cover;}
.route-preview {padding:12px 14px; border-radius:13px; background:var(--light); color:var(--ink); font-size:12px; line-height:1.55;}
.schedule-messages {display:grid; gap:10px; margin:16px 0; padding:16px; border:1px solid var(--line); border-radius:16px; background:var(--paper);}
.schedule-messages h3 {margin:0;}
.schedule-messages .hint {margin:0;}
.science-keyboard {position:sticky; top:8px; z-index:7; padding:10px 13px; border:1px solid #cfb77d; border-radius:16px; background:var(--paper); box-shadow:0 8px 22px #0002;}
.science-keyboard summary {cursor:pointer; font-weight:750; color:var(--ink);}
.science-keyboard select {max-width:170px; margin:8px 0;}
.science-key-grid {display:flex; flex-wrap:wrap; gap:6px; max-height:128px; overflow:auto;}
.science-key {min-width:38px; min-height:38px; border:1px solid var(--line); border-radius:9px; background:var(--light); color:var(--ink); font-size:17px; font-weight:650; touch-action:manipulation;}
.science-key:active {transform:scale(.94);}
.admin-mode dialog {overflow-y: auto;}

@media (max-width: 1000px) {
  .admin-home-grid,.groups-layout {grid-template-columns: 1fr;}
  .admin-metrics {grid-template-columns: repeat(2, minmax(0, 1fr));}
}
@media (max-width: 720px) {
  .result-scroll {display: none;}
  .result-mobile-list {display: grid; gap: 8px; margin: 14px 0;}
  .result-mobile-row {border: 1px solid var(--line); border-radius: 13px; padding: 11px; background: var(--paper);}
  .result-mobile-head {display: flex; align-items: center; gap: 9px; min-width: 0;}
  .result-mobile-head strong {min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; font-size: 12px;}
  .result-mobile-head b {color: var(--result-accent); font-size: 14px;}
  .result-mobile-medal {font-size: 20px; width: 27px; text-align: center;}
  .result-mobile-stats {display: flex; flex-wrap: wrap; gap: 5px 9px; margin: 8px 0 0 36px; font-size: 10px; color: var(--muted);}
  .admin-mode .sidebar {background: #fffdf9f5;}
  .admin-mode .nav-button {min-height: 57px; border-radius: 11px;}
  .admin-mode .nav-button:hover {transform: none;}
  .admin-mode .nav-button.active {box-shadow: inset 0 3px #2b8b65;}
  .admin-mode .nav-extra {display: none;}
  .admin-mode .nav-more {display: flex;}
  .admin-mode .nav-icon {flex: none; width: 24px; height: 24px;}
  .admin-mode .nav-icon svg {width: 22px; height: 22px;}
  .admin-mode .workspace {padding: 21px 14px 32px;}
  .admin-mode .workspace-top h1 {font-size: 26px;}
  .admin-hero {grid-template-columns: 1fr; min-height: 230px; padding: 26px 22px;}
  .admin-hero h2 {font-size: 31px; padding-right: 48px;}
  .admin-hero p {max-width: 75%; margin-bottom: 18px;}
  .admin-hero-art {position: absolute; right: -60px; top: 14px; width: 170px; height: 170px; opacity: .56; z-index: -1;}
  .orbit-core {inset: 40px;}
  .admin-metrics {gap: 8px; margin: 12px 0 18px;}
  .admin-metrics .stat {padding: 13px;}
  .admin-metrics .stat strong {font-size: 19px;}
  .admin-home-grid,.groups-layout {gap: 12px;}
  .admin-home-grid .card,.groups-layout .card {padding: 19px;}
  .connect-buttons {grid-template-columns: 1fr 1fr;}
  .connect-buttons .btn {padding: 10px 8px; font-size: 11px;}
  .owner-bank-view .bank-filters {grid-template-columns: repeat(2, minmax(0, 1fr));}
}
@media (max-width: 360px) {
  .admin-hero h2 {font-size: 27px;}
  .admin-hero p {max-width: 90%;}
  .classroom-top {grid-template-columns: 36px 1fr;}
  .classroom-top .pill {grid-column: 2; width: max-content;}
  .connect-buttons {grid-template-columns: 1fr;}
  .admin-mode .nav-button {font-size: 8px; padding-inline: 2px;}
}
[data-theme=dark] body.admin-mode {--bg: #121c19; --paper: #1d2923; --ink: #edf5ec; --muted: #adc0b1; --line: #3b4d41; --light: #2a4635; background: #121c19;}
[data-theme=dark] body.admin-mode .sidebar {background: #1a2620; border-color: var(--line);}
[data-theme=dark] body.admin-mode .sidebar-note,[data-theme=dark] body.admin-mode .journey-step,[data-theme=dark] body.admin-mode .classroom-card,[data-theme=dark] body.admin-mode .connect-note {background: #23352a; border-color: #3b5943; color: var(--ink);}
[data-theme=dark] body.admin-mode .result-table thead,[data-theme=dark] body.admin-mode .result-table tbody tr:nth-child(even) {background: #293d30;}
[data-theme=dark] body.admin-mode .result-table th {color: #d9e9db;}
[data-theme=dark] body.admin-mode .admin-hero {box-shadow: 0 18px 38px #0004;}
@media (prefers-reduced-motion: reduce) {
  .orbit,.journey-step,.admin-mode .nav-button {animation: none; transition: none;}
}

.option-editor textarea {min-height: 84px; line-height: 1.65; overflow-y: hidden;}
.preview-wrap .poll-option {display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; align-items: start;}
.preview-wrap .poll-option .radio {margin-top: 3px;}
.preview-wrap .poll-option .answer-preview-image {grid-column: 2;}

/* Keep selected and saved diagrams visible while editing imported drafts. */
.editor-image-preview{margin:8px 0;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--card);max-width:100%;}
.editor-image-preview[hidden]{display:none;}
.editor-image-preview img{display:block;width:100%;max-height:260px;object-fit:contain;border-radius:6px;}
.option-image-control summary{cursor:pointer;font-weight:600;}
.option-image-control input[type=file]{width:100%;}
