:root {
  color-scheme: dark;
  --bg: #090b0f;
  --panel: rgba(17, 21, 29, 0.68);
  --panel-strong: rgba(19, 24, 33, 0.9);
  --line: rgba(255,255,255,.105);
  --line-strong: rgba(255,255,255,.18);
  --text: #f5f7fa;
  --muted: #a6afbe;
  --muted-2: #778191;
  --accent: #d4e7ff;
  --accent-2: #95bbef;
  --danger: #ff8d98;
  --success: #a4e2b5;
  --shadow: 0 28px 70px rgba(0,0,0,.28);
  --radius: 22px;
  --radius-sm: 14px;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -10%, rgba(104,150,211,.14), transparent 30%),
    radial-gradient(circle at 92% 8%, rgba(145,119,181,.10), transparent 24%),
    linear-gradient(180deg, #0b0e13 0%, #090b0f 45%, #080a0e 100%);
}
body::before {
  content:""; position:fixed; inset:0; pointer-events:none; opacity:.18;
  background-image: linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 42px 42px; mask-image: linear-gradient(to bottom, black, transparent 80%);
}
a { color: inherit; text-decoration: none; }
button,input,textarea,select { font: inherit; }
button { color: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.glass {
  background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.03));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), var(--shadow);
  backdrop-filter: blur(22px) saturate(125%);
  -webkit-backdrop-filter: blur(22px) saturate(125%);
}
.ambient { position: fixed; pointer-events:none; filter: blur(40px); border-radius: 999px; opacity:.24; z-index:-1; animation: drift 16s ease-in-out infinite alternate; }
.ambient-one { width: 320px; height: 320px; background:#48688f; left:-110px; top:120px; }
.ambient-two { width: 260px; height:260px; background:#5e496d; right:-90px; top:34%; animation-delay:-7s; }
@keyframes drift { to { transform: translate3d(26px, 34px, 0) scale(1.08); } }
.reveal { animation: rise .52s cubic-bezier(.2,.72,.25,1) both; }
@keyframes rise { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform:none; } }
.site-header { min-height:86px; display:flex; align-items:center; justify-content:space-between; gap:20px; }
.brand { display:inline-flex; align-items:center; gap:11px; min-width:0; }
.brand-mark { width:40px; height:40px; display:grid; place-items:center; border-radius:13px; font-size:12px; font-weight:800; letter-spacing:.08em; background:rgba(255,255,255,.075); border:1px solid var(--line-strong); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.brand > span:last-child { display:grid; gap:1px; min-width:0; }
.brand strong { font-size:13px; letter-spacing:-.01em; white-space:nowrap; }
.brand small { color:var(--muted-2); font-size:11px; }
.nav { display:flex; gap:5px; padding:5px; border:1px solid rgba(255,255,255,.075); background:rgba(12,15,20,.54); backdrop-filter:blur(16px); border-radius:14px; }
.nav a { padding:9px 13px; color:var(--muted); border-radius:10px; font-size:12px; font-weight:650; transition:.18s ease; }
.nav a:hover { color:var(--text); background:rgba(255,255,255,.055); }
.nav a.active { color:#fff; background:rgba(255,255,255,.095); box-shadow:inset 0 0 0 1px rgba(255,255,255,.04); }
.survey-layout, .board-page, .teacher-page { padding:26px 0 84px; }
.intro { border-radius:28px; padding:34px; display:grid; grid-template-columns:minmax(0,1.25fr) minmax(260px,.75fr); gap:30px; align-items:end; }
.eyebrow, .section-kicker { display:block; text-transform:uppercase; letter-spacing:.16em; font-size:10px; font-weight:800; color:#9db7da; margin-bottom:10px; }
h1,h2,h3,p { margin-top:0; }
h1 { margin-bottom:12px; font-size:clamp(29px,4vw,50px); line-height:1.02; letter-spacing:-.045em; max-width:760px; }
.intro p, .board-heading p, .dashboard-heading p, .login-panel > p { color:var(--muted); line-height:1.65; margin-bottom:0; max-width:670px; font-size:14px; }
.privacy-card { padding:18px; border:1px solid var(--line); border-radius:18px; background:rgba(3,6,10,.28); display:flex; gap:12px; align-items:flex-start; }
.privacy-card strong,.privacy-card span { display:block; }
.privacy-card strong { font-size:13px; margin-bottom:4px; }
.privacy-card span:last-child { font-size:12px; line-height:1.5; color:var(--muted); }
.privacy-dot { flex:0 0 auto; width:9px; height:9px; margin-top:5px; border-radius:50%; background:var(--success); box-shadow:0 0 0 5px rgba(164,226,181,.08); }
.identity { margin-top:16px; padding:24px; border-radius:22px; display:grid; grid-template-columns:1fr auto; gap:18px 26px; align-items:end; }
.identity h2, .submit-card h2 { font-size:18px; letter-spacing:-.025em; margin:0; }
.segmented { padding:4px; border-radius:13px; background:rgba(0,0,0,.24); border:1px solid var(--line); display:flex; }
.segmented label { cursor:pointer; }
.segmented input { position:absolute; opacity:0; pointer-events:none; }
.segmented span { display:block; padding:9px 13px; border-radius:9px; color:var(--muted); font-size:12px; font-weight:700; transition:.18s ease; }
.segmented input:checked + span { color:#fff; background:rgba(255,255,255,.095); box-shadow:0 5px 14px rgba(0,0,0,.16); }
.name-field { grid-column:1/-1; display:grid; gap:7px; }
.name-field[hidden] { display:none; }
.name-field label, .login-form label, .question-editor label { color:var(--muted); font-size:11px; font-weight:700; }
input, textarea, select { width:100%; color:var(--text); background:rgba(5,8,12,.5); border:1px solid var(--line); border-radius:12px; outline:none; transition:.18s ease; }
input, select { min-height:43px; padding:0 13px; }
textarea { min-height:95px; resize:vertical; padding:12px 13px; line-height:1.5; }
input::placeholder, textarea::placeholder { color:#606978; }
input:focus, textarea:focus, select:focus { border-color:rgba(149,187,239,.55); box-shadow:0 0 0 3px rgba(149,187,239,.095); }
.progress-wrap { margin-top:16px; padding:14px 16px; border-radius:16px; position:sticky; top:10px; z-index:20; }
.progress-copy { display:flex; justify-content:space-between; color:var(--muted); font-size:11px; font-weight:700; margin-bottom:9px; }
.progress-track { height:4px; background:rgba(255,255,255,.075); border-radius:999px; overflow:hidden; }
.progress-bar { width:0; height:100%; border-radius:inherit; background:linear-gradient(90deg,#8cadde,#d5e6fb); transition:width .28s cubic-bezier(.2,.7,.2,1); }
.questions { display:grid; gap:14px; margin-top:18px; }
.question-card { padding:24px; border-radius:22px; background:rgba(15,19,26,.72); border:1px solid var(--line); box-shadow:0 16px 40px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.035); animation:rise .45s both; }
.question-top { display:flex; gap:15px; align-items:flex-start; margin-bottom:18px; }
.question-number { width:31px; height:31px; flex:0 0 auto; display:grid; place-items:center; border-radius:10px; background:rgba(255,255,255,.065); border:1px solid var(--line); color:#a9c3e7; font-size:11px; font-weight:800; }
.question-card h3 { font-size:16px; line-height:1.4; letter-spacing:-.018em; margin:4px 0 0; }
.choice-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.choice { position:relative; cursor:pointer; }
.choice input { position:absolute; opacity:0; pointer-events:none; }
.choice-body { min-height:54px; display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:13px; border:1px solid rgba(255,255,255,.075); background:rgba(255,255,255,.025); color:#c2c9d3; transition:.17s ease; }
.choice:hover .choice-body { border-color:rgba(255,255,255,.15); background:rgba(255,255,255,.045); transform:translateY(-1px); }
.choice-letter { width:27px; height:27px; flex:0 0 auto; display:grid; place-items:center; border-radius:8px; background:rgba(255,255,255,.055); color:#a9b3c1; font-size:10px; font-weight:800; }
.choice-text { font-size:12px; line-height:1.4; }
.choice input:checked + .choice-body { border-color:rgba(149,187,239,.45); background:rgba(107,147,202,.11); color:#f1f6fc; box-shadow:inset 0 0 0 1px rgba(149,187,239,.08); }
.choice input:checked + .choice-body .choice-letter { background:#c8dcf8; color:#172333; }
.custom-choice { grid-column:1/-1; }
.custom-answer { margin-top:9px; padding-top:9px; border-top:1px solid rgba(255,255,255,.055); animation:rise .2s both; }
.custom-answer[hidden] { display:none; }
.submit-card { margin-top:18px; padding:26px; border-radius:23px; }
.board-choice { display:flex; align-items:center; justify-content:space-between; gap:24px; }
.board-choice p { margin:8px 0 0; max-width:650px; color:var(--muted); font-size:12px; line-height:1.55; }
.switch-row { display:flex; align-items:center; gap:10px; color:#d9dee5; font-size:12px; font-weight:700; cursor:pointer; white-space:nowrap; }
.switch-row input { position:absolute; opacity:0; pointer-events:none; }
.switch { width:42px; height:23px; border-radius:999px; background:rgba(255,255,255,.1); border:1px solid var(--line); padding:3px; transition:.2s ease; }
.switch::before { content:""; display:block; width:15px; height:15px; border-radius:50%; background:#9aa4b0; transition:.2s ease; }
.switch-row input:checked + .switch { background:rgba(149,187,239,.28); border-color:rgba(149,187,239,.38); }
.switch-row input:checked + .switch::before { transform:translateX(18px); background:#e6f0ff; }
.board-identity { margin-top:18px; padding-top:18px; border-top:1px solid rgba(255,255,255,.07); display:flex; align-items:center; justify-content:space-between; gap:18px; }
.board-identity[hidden] { display:none; }
.board-identity > span { color:var(--muted); font-size:12px; }
.submit-actions { margin-top:24px; border-top:1px solid rgba(255,255,255,.065); padding-top:18px; display:flex; align-items:center; justify-content:space-between; gap:18px; }
.form-status { color:var(--muted); font-size:12px; margin:0; min-height:18px; }
.form-status.error { color:#ffadb5; }
.form-status.success { color:var(--success); }
.primary-btn,.secondary-btn,.danger-btn,.icon-btn { border:0; cursor:pointer; transition:.17s ease; }
.primary-btn { min-height:43px; display:inline-flex; align-items:center; justify-content:center; gap:15px; padding:0 16px; border-radius:12px; color:#101720; background:#e8eef6; font-size:12px; font-weight:800; box-shadow:0 10px 24px rgba(0,0,0,.2); }
.primary-btn:hover { transform:translateY(-1px); background:#fff; }
.primary-btn:disabled { opacity:.55; cursor:not-allowed; transform:none; }
.secondary-btn { min-height:40px; display:inline-flex; align-items:center; justify-content:center; padding:0 14px; border-radius:11px; color:#dde3eb; background:rgba(255,255,255,.055); border:1px solid var(--line); font-size:11px; font-weight:750; }
.secondary-btn:hover { background:rgba(255,255,255,.085); border-color:var(--line-strong); }
.secondary-btn.compact { min-height:38px; }
.danger-btn { min-height:36px; padding:0 12px; border-radius:10px; background:rgba(255,85,100,.08); border:1px solid rgba(255,120,130,.18); color:#ffabb3; font-size:10px; font-weight:800; }
.danger-btn:hover { background:rgba(255,85,100,.13); }
.icon-btn { width:36px; height:36px; display:grid; place-items:center; border-radius:11px; background:rgba(255,255,255,.05); border:1px solid var(--line); }
.toast { position:fixed; right:18px; bottom:18px; z-index:100; max-width:min(390px,calc(100% - 36px)); padding:12px 14px; border-radius:12px; background:#eef3f9; color:#131a23; font-size:12px; font-weight:750; box-shadow:0 20px 50px rgba(0,0,0,.34); opacity:0; transform:translateY(12px); pointer-events:none; transition:.22s ease; }
.toast.show { opacity:1; transform:none; }
.board-heading,.dashboard-heading { display:flex; justify-content:space-between; gap:24px; align-items:end; margin:14px 0 20px; }
.board-heading h1,.dashboard-heading h1,.login-panel h1 { font-size:clamp(30px,4vw,46px); margin-bottom:10px; }
.board-toolbar,.teacher-toolbar { padding:12px; border-radius:16px; display:flex; align-items:center; gap:12px; margin-bottom:17px; }
.search-field { flex:1; position:relative; min-width:0; }
.search-field span { position:absolute; left:13px; top:50%; transform:translateY(-50%); color:var(--muted-2); }
.search-field input { padding-left:36px; }
.muted { color:var(--muted-2); font-size:11px; white-space:nowrap; }
.notes-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.note-card { position:relative; min-height:210px; padding:21px; border-radius:18px; cursor:pointer; overflow:hidden; border:1px solid rgba(255,255,255,.13); color:#1d232c; background:linear-gradient(145deg,#e8e1bf,#dcd2a8); box-shadow:0 14px 35px rgba(0,0,0,.18); transform:rotate(var(--tilt,0deg)); transition:.2s cubic-bezier(.2,.7,.2,1); }
.note-card:nth-child(3n+2){ --tilt:.7deg; background:linear-gradient(145deg,#dbe2c6,#cfd9b1); }
.note-card:nth-child(3n){ --tilt:-.55deg; background:linear-gradient(145deg,#d6e2e8,#c3d5df); }
.note-card:hover { transform:translateY(-4px) rotate(0); box-shadow:0 22px 50px rgba(0,0,0,.28); }
.note-card::after { content:""; position:absolute; inset:0; pointer-events:none; background:linear-gradient(130deg,rgba(255,255,255,.34),transparent 38%); }
.note-meta { position:relative; z-index:1; display:flex; justify-content:space-between; gap:12px; font-size:10px; color:rgba(22,28,36,.57); text-transform:uppercase; letter-spacing:.09em; font-weight:800; }
.note-card h3 { position:relative; z-index:1; margin:34px 0 9px; font-size:17px; line-height:1.32; letter-spacing:-.025em; color:#20252b; }
.note-card p { position:relative; z-index:1; margin:0; font-size:12px; line-height:1.55; color:rgba(31,37,44,.72); display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; }
.empty-state { padding:34px; border-radius:20px; text-align:center; color:var(--muted); }
.empty-state strong,.empty-state span { display:block; }
.empty-state strong { color:var(--text); font-size:14px; margin-bottom:6px; }
.note-dialog { width:min(760px,calc(100% - 28px)); max-height:86vh; padding:0; border:1px solid var(--line-strong); border-radius:24px; color:var(--text); background:rgba(12,16,22,.94); box-shadow:0 40px 100px rgba(0,0,0,.55); backdrop-filter:blur(26px); }
.note-dialog::backdrop { background:rgba(2,4,7,.66); backdrop-filter:blur(5px); }
.dialog-shell { position:relative; padding:27px; overflow:auto; max-height:86vh; }
.close-btn { position:absolute; right:16px; top:16px; z-index:2; }
.dialog-header { padding-right:46px; margin-bottom:22px; }
.dialog-header h2 { font-size:24px; letter-spacing:-.035em; margin:0 0 7px; }
.dialog-header p { margin:0; color:var(--muted); font-size:11px; }
.answer-stack { display:grid; gap:9px; }
.answer-item { padding:15px; border-radius:14px; background:rgba(255,255,255,.035); border:1px solid rgba(255,255,255,.065); }
.answer-item .q { display:block; color:#a5aeba; font-size:10px; line-height:1.45; margin-bottom:7px; }
.answer-item .a { display:block; color:#f2f5f8; font-size:13px; line-height:1.55; }
.login-panel { width:min(580px,100%); margin:7vh auto 0; padding:31px; border-radius:26px; }
.login-form { margin-top:24px; display:grid; gap:8px; }
.code-row { display:grid; grid-template-columns:1fr auto; gap:9px; }
.stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:11px; margin:0 0 13px; }
.stat-card { padding:17px; border-radius:17px; }
.stat-card span { display:block; color:var(--muted); font-size:10px; margin-bottom:9px; }
.stat-card strong { font-size:24px; letter-spacing:-.035em; }
.teacher-tabs { display:flex; gap:6px; margin:0 0 13px; }
.teacher-tabs button { min-height:38px; padding:0 13px; border-radius:11px; color:var(--muted); background:rgba(255,255,255,.035); border:1px solid var(--line); cursor:pointer; font-size:11px; font-weight:750; }
.teacher-tabs button.active { color:#fff; background:rgba(255,255,255,.09); }
.teacher-toolbar select { width:auto; min-width:150px; }
.submission-list { display:grid; gap:10px; }
.submission { border-radius:18px; overflow:hidden; background:rgba(15,19,26,.7); border:1px solid var(--line); }
.submission-summary { width:100%; border:0; background:transparent; color:inherit; text-align:left; padding:17px 18px; cursor:pointer; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:18px; align-items:center; }
.submission-summary:hover { background:rgba(255,255,255,.025); }
.submission-person { display:flex; align-items:center; gap:11px; min-width:0; }
.avatar { width:34px; height:34px; flex:0 0 auto; display:grid; place-items:center; border-radius:11px; background:rgba(255,255,255,.07); border:1px solid var(--line); font-size:10px; font-weight:850; color:#c4d7ef; }
.submission-person strong { display:block; font-size:12px; margin-bottom:3px; }
.submission-person span { display:block; color:var(--muted-2); font-size:10px; }
.badges { display:flex; gap:6px; justify-content:flex-end; flex-wrap:wrap; }
.badge { padding:5px 8px; border-radius:999px; background:rgba(255,255,255,.055); border:1px solid rgba(255,255,255,.07); color:#aeb7c4; font-size:9px; font-weight:800; white-space:nowrap; }
.submission-body { display:none; border-top:1px solid rgba(255,255,255,.065); padding:18px; }
.submission.open .submission-body { display:block; animation:rise .22s both; }
.submission-actions { display:flex; justify-content:flex-end; margin-bottom:13px; }
.teacher-answer { display:grid; grid-template-columns:1fr auto; gap:14px; align-items:start; padding:13px 0; border-bottom:1px solid rgba(255,255,255,.055); }
.teacher-answer:last-child { border-bottom:0; }
.teacher-answer .q { color:var(--muted); font-size:10px; line-height:1.5; margin-bottom:5px; }
.teacher-answer .a { font-size:12px; line-height:1.55; }
.question-admin { display:grid; gap:11px; }
.question-admin-card { border-radius:18px; padding:18px; background:rgba(15,19,26,.72); border:1px solid var(--line); }
.question-admin-head { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:12px; }
.drag-index { width:30px; height:30px; display:grid; place-items:center; border-radius:9px; background:rgba(255,255,255,.05); border:1px solid var(--line); color:var(--muted); font-size:10px; font-weight:800; }
.question-admin-head strong { font-size:12px; line-height:1.45; }
.question-admin-head span { display:block; margin-top:3px; font-size:9px; color:var(--muted-2); }
.question-admin-actions { display:flex; gap:6px; }
.question-editor { margin-top:14px; padding-top:14px; border-top:1px solid rgba(255,255,255,.065); display:grid; gap:12px; }
.question-editor[hidden] { display:none; }
.editor-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.option-field { display:grid; grid-template-columns:32px 1fr; align-items:center; gap:8px; }
.option-field b { width:32px; height:32px; display:grid; place-items:center; border-radius:9px; background:rgba(255,255,255,.055); border:1px solid var(--line); font-size:10px; }
.editor-actions { display:flex; justify-content:flex-end; gap:8px; }
.add-question { margin-bottom:12px; padding:20px; border-radius:19px; }
.add-question h2 { font-size:17px; margin-bottom:6px; }
.add-question p { color:var(--muted); font-size:11px; margin-bottom:16px; }
.loading-row { min-height:180px; display:grid; place-items:center; color:var(--muted); font-size:11px; }
.spinner { width:22px; height:22px; border-radius:50%; border:2px solid rgba(255,255,255,.12); border-top-color:#c7d8ec; animation:spin .7s linear infinite; margin:0 auto 8px; }
@keyframes spin { to { transform:rotate(360deg); } }
@media (max-width:850px) {
  .intro { grid-template-columns:1fr; }
  .notes-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .stats-grid { grid-template-columns:repeat(2,1fr); }
  .teacher-toolbar { align-items:stretch; flex-wrap:wrap; }
  .teacher-toolbar .search-field { flex-basis:100%; }
  .teacher-toolbar select { flex:1; }
}
@media (max-width:620px) {
  .shell { width:min(100% - 22px,1180px); }
  .site-header { min-height:72px; align-items:center; }
  .brand > span:last-child { display:none; }
  .nav { margin-left:auto; }
  .nav a { padding:8px 9px; font-size:10px; }
  .survey-layout,.board-page,.teacher-page { padding-top:12px; }
  .intro { padding:23px; border-radius:22px; }
  h1 { font-size:34px; }
  .identity { grid-template-columns:1fr; align-items:stretch; padding:19px; }
  .segmented { width:100%; }
  .segmented label { flex:1; text-align:center; }
  .name-field { grid-column:auto; }
  .progress-wrap { top:6px; }
  .question-card { padding:18px; border-radius:18px; }
  .choice-grid { grid-template-columns:1fr; }
  .custom-choice { grid-column:auto; }
  .board-choice,.submit-actions,.board-heading,.dashboard-heading,.board-identity { align-items:stretch; flex-direction:column; }
  .submit-actions .primary-btn { width:100%; }
  .notes-grid { grid-template-columns:1fr; }
  .note-card { min-height:180px; }
  .board-toolbar { align-items:stretch; flex-direction:column; }
  .stats-grid { grid-template-columns:1fr 1fr; }
  .teacher-tabs { overflow-x:auto; padding-bottom:2px; }
  .submission-summary { grid-template-columns:1fr; }
  .badges { justify-content:flex-start; }
  .teacher-answer { grid-template-columns:1fr; }
  .editor-grid { grid-template-columns:1fr; }
  .question-admin-head { grid-template-columns:auto 1fr; }
  .question-admin-actions { grid-column:1/-1; justify-content:flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration:.001ms!important; animation-iteration-count:1!important; transition-duration:.001ms!important; scroll-behavior:auto!important; }
}
