:root{
  --bg:#0f1221;
  --card:#151935;
  --muted:#8c90a6;
  --text:#e6e8f2;
  --accent:#7c8cfb;
  --accent2:#6ff2d9;
  --danger:#ff6b6b;
  --radius:16px;
  --shadow:0 10px 30px rgba(0,0,0,.25);
}

body.light{
  --bg:#f7f8ff;
  --card:#ffffff;
  --muted:#60657a;
  --text:#0f1221;
  --accent:#4c5df7;
  --accent2:#10c7a6;
  --danger:#e5484d;
  --shadow:0 10px 30px rgba(15,18,33,.08);
}

.light .btn-primary,
.light .btn.primary,
.light .open-hw-btn,
.light .homework-panel .open-btn {
  color: #111 !important;
}


*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124,140,251,.25), transparent 40%),
    radial-gradient(1000px 500px at 110% 0%, rgba(111,242,217,.20), transparent 35%),
    var(--bg);
}

.container{max-width:1100px;margin:0 auto;padding:24px}

header.card{
  position:sticky; top:0; z-index:10;
  display:flex; justify-content:space-between; align-items:center; gap:16px;
  padding:16px 24px; margin:-16px -24px 24px;
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(12,14,28,.65), rgba(12,14,28,.25));
  border:1px solid rgba(255,255,255,.08);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
body.light header.card{background:linear-gradient(to bottom,rgba(255,255,255,.75),rgba(255,255,255,.35)); border-color:rgba(15,18,33,.08)}

.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:40px;height:40px;border-radius:10px;display:grid;place-items:center;
  background: conic-gradient(from 180deg, var(--accent), var(--accent2), var(--accent));
  color:#0b0f1f; font-weight:800; box-shadow:var(--shadow)
}
.title{font-weight:700}
.small{font-size:13px}
.bold{font-weight:700}
.muted{color:var(--muted)}
.push-right{margin-left:auto}

.controls{display:flex; gap:12px; align-items:center; flex-wrap:wrap}
.select,.input,.btn,.chip{
  padding:10px 12px; border-radius:12px; border:1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  color:var(--text);
}
body.light .select, body.light .input, body.light .btn, body.light .chip{
  border:1px solid rgba(15,18,33,.1);
  background: linear-gradient(180deg, #fff, #f7f8ff);
}
.btn{cursor:pointer; transition:transform .15s ease, box-shadow .15s ease}
.btn:hover{transform:translateY(-1px); box-shadow:var(--shadow)}
.btn.primary{background:linear-gradient(180deg, var(--accent), #6576ff); border:none; color:#fff}

.grid{display:grid; grid-template-columns:1.5fr 1fr; gap:24px}
@media (max-width:980px){ .grid{ grid-template-columns:1fr } }

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid rgba(255,255,255,.08);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
body.light .card{ background:#fff; border:1px solid rgba(15,18,33,.08) }

.panel{padding:18px 18px 6px}
.teacher{display:flex; gap:14px; align-items:center}
.avatar{
  width:48px; height:48px; border-radius:12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display:grid; place-items:center; color:#0b0f1f; font-weight:800
}

.section-title{display:flex; justify-content:space-between; align-items:center; gap:12px; padding:16px; border-top:1px dashed rgba(255,255,255,.08)}
body.light .section-title{border-top-color:rgba(15,18,33,.08)}

.materials{display:flex; flex-direction:column; gap:14px; padding:16px}
.date-card{
  padding:16px; border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
}
body.light .date-card{ background:linear-gradient(180deg,#fff,#f6f7ff); border-color:rgba(15,18,33,.1)}

.date-head{display:flex; align-items:center; justify-content:space-between; gap:16px}
.date-head h3{margin:0; font-size:16px}
.tags{display:flex; gap:8px; flex-wrap:wrap}
.badge{padding:6px 10px; border-radius:999px; font-weight:700; font-size:12px; background:rgba(124,140,251,.18); border:1px solid rgba(124,140,251,.35)}

ul.links{list-style:none; padding:8px 0 0 0; margin:0; display:flex; flex-direction:column; gap:10px}
ul.links a{display:inline-flex; gap:8px; text-decoration:none; font-weight:600; color:var(--text); padding:8px 10px; border-radius:10px; border:1px solid transparent}
ul.links a:hover{border-color:rgba(255,255,255,.18); background:rgba(124,140,251,.12)}
body.light ul.links a:hover{border-color:rgba(15,18,33,.12); background:rgba(76,93,247,.08)}

.aside{display:flex; flex-direction:column; gap:16px}
.sticky-cta{position:sticky; top:92px; padding:16px; display:flex; gap:12px; align-items:center; justify-content:space-between}

.footer{margin:24px 0; display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; color:var(--muted); font-size:13px}
.chips{display:flex; gap:8px; flex-wrap:wrap}
.chip{font-size:12px}

.hw-list{display:flex;flex-direction:column;gap:10px}
.hw-item{border:1px solid rgba(255,255,255,.08);border-radius:14px;padding:10px;background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(255,255,255,.02))}
body.light .hw-item{background:#fff;border-color:rgba(15,18,33,.1)}
.hw-head{display:flex;align-items:center;gap:10px;cursor:pointer}
.hw-head .due{padding:6px 10px;border-radius:999px;background:rgba(124,140,251,.18);border:1px solid rgba(124,140,251,.35);font-weight:700;font-size:12px}
.hw-head h4{margin:0;flex:1}
.hw-body{display:none;margin-top:8px}
.hw-body.open{display:block}
.hw-links{list-style:none;margin:8px 0 0 0;padding:0;display:flex;flex-direction:column;gap:8px}
.hw-links a{display:inline-flex;gap:8px;text-decoration:none;font-weight:600;color:var(--text);padding:6px 8px;border-radius:10px;border:1px solid transparent}
.hw-links a:hover{border-color:rgba(255,255,255,.18);background:rgba(124,140,251,.12)}
body.light .hw-links a:hover{border-color:rgba(15,18,33,.12);background:rgba(76,93,247,.08)}
.hw-empty{color:var(--muted);font-size:13px}

.iconbtn.confirm-mini[data-state="ask"]{
  position: relative;
  border-color: var(--accent);
}
.iconbtn.confirm-mini[data-state="ask"]::after{
  content: "✓  |  ✗";
  position: absolute;
  left: 50%;
  bottom: -40px;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(11,14,35,.96);
  border: 1px dashed var(--accent);
  white-space: nowrap;
  font-weight: 700;
  font-size: 12px;
  pointer-events: none;
}


@keyframes pulseFocus{
  0%{ box-shadow: 0 0 0 0 rgba(124,140,251,.55) }
  100%{ box-shadow: 0 0 0 0 rgba(124,140,251,0) }
}
.focus-pulse{
  animation: pulseFocus .9s ease-out 2;
  outline: none !important;
}


select[multiple]{ min-height: 260px; }

.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.grid3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px}
@media (max-width:900px){ .grid3{grid-template-columns:1fr} }
@media (max-width:700px){ .grid2{grid-template-columns:1fr} }

/* Стили для галереи на главной странице */
.images-section {
  margin-top: 12px;
}
.images-toggle-btn {
  background: none;
  border: 1px solid rgba(124, 140, 251, .35);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 10px;
}
body.light .images-toggle-btn {
  color: var(--accent);
  border-color: rgba(76, 93, 247, .3);
}
.images-container {
  display: none; /* Скрыты по умолчанию */
  flex-wrap: wrap;
  gap: 8px;
}
.images-container.visible {
  display: flex; /* Показываем по клику */
}
.images-container img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.1);
  transition: transform .2s ease, box-shadow .2s ease;
}
.images-container img:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 15px rgba(0,0,0,.2);
}

a.no-link {
  cursor: default;
}