/* Nastavni pregled — stable visual layer (v3) */
:root {
  --ink: #173454;
  --ink-soft: #56708d;
  --teal: #168b8f;
  --teal-dark: #096d73;
  --teal-pale: #e7f6f5;
  --gold: #ffad19;
  --gold-dark: #e89500;
  --gold-pale: #fff5df;
  --green: #10a779;
  --green-pale: #e4f8f0;
  --warning: #bd7018;
  --warning-pale: #fff0dc;
  --canvas: #f6f9f8;
  --surface: #ffffff;
  --line: #dce8e8;
  --line-strong: #c7dbdc;
  --shadow: 0 18px 42px rgba(18, 52, 81, .10);
  --radius: 22px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.14; }
h1 { margin-bottom: 14px; font-size: clamp(2rem, 4vw, 3.25rem); letter-spacing: -.04em; }
h2 { margin-bottom: 10px; font-size: clamp(1.35rem, 2.2vw, 1.85rem); letter-spacing: -.025em; }
h3 { margin-bottom: 0; font-size: 1.05rem; }
small { color: var(--ink-soft); }
[hidden] { display: none !important; }

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 11px clamp(20px, 4vw, 56px);
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 15px rgba(24, 61, 82, .035);
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: max-content; }
.brand-link { color: var(--ink); text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #fff;
  background: linear-gradient(145deg, #159aa0, #08777d);
  border-radius: 15px;
  font-size: 27px;
  box-shadow: 0 8px 17px rgba(12, 128, 134, .19);
}
.brand strong { display: block; font-size: 1.12rem; line-height: 1.1; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 3px; font-size: .76rem; }
.site-header nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.site-header nav > a,
.logout-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 0 13px;
  border: 0;
  border-radius: 12px;
  color: var(--ink-soft);
  background: transparent;
  font-weight: 750;
  text-decoration: none;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.site-header nav > a:hover,
.site-header nav > a.active { color: var(--teal-dark); background: var(--teal-pale); }
.logout-form { margin: 0 0 0 4px; }
.logout-form button { min-height: 38px; border: 1px solid var(--line-strong); color: var(--ink); background: #fff; }
.logout-form button:hover { background: #f3f8f8; }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 70px; }
.hero, .library-hero, .plan-header, .my-plan-head {
  position: relative;
  overflow: hidden;
  border: 1px solid #d7ebea;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #fff 0%, #f0faf9 100%);
  box-shadow: 0 10px 30px rgba(19, 79, 89, .055);
}
.hero::after, .library-hero::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -110px;
  top: -120px;
  border-radius: 50%;
  background: rgba(25, 158, 159, .08);
}
.hero { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: clamp(28px, 5vw, 52px); }
.hero > *, .library-hero > * { position: relative; z-index: 1; }
.hero h1 { margin-bottom: 8px; }
.hero p:last-child, .library-hero p:last-child { max-width: 740px; margin-bottom: 0; color: var(--ink-soft); font-size: 1.04rem; }
.library-hero { padding: clamp(27px, 5vw, 48px); }
.library-hero h1 { margin-bottom: 9px; }
.eyebrow { margin-bottom: 8px; color: var(--teal-dark); font-size: .83rem; font-weight: 850; letter-spacing: .02em; text-transform: uppercase; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 47px;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--ink);
  font-weight: 820;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button-gold { color: #5f3b00; background: linear-gradient(135deg, #ffc34a, var(--gold)); box-shadow: 0 10px 23px rgba(240, 161, 17, .23); }
.button-gold:hover { background: linear-gradient(135deg, #ffd36d, #ffb31c); box-shadow: 0 13px 26px rgba(240, 161, 17, .30); }
.button-secondary { color: var(--ink); background: #fff; border-color: var(--line-strong); }
.button-secondary:hover { background: #f5fbfb; }
.button-teal { color: #fff; background: linear-gradient(135deg, #17999d, var(--teal-dark)); box-shadow: 0 10px 22px rgba(17, 132, 135, .2); }
.button-teal:hover { background: linear-gradient(135deg, #1da8ac, #08747a); }

.notice, .help, .empty {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.notice { margin: 24px 0; padding: 15px 18px; color: var(--ink-soft); }
.help { margin-top: 26px; padding: 23px 26px; background: linear-gradient(135deg, #eef9f8, #fff); }
.help h2 { font-size: 1.25rem; }
.help p, .empty p { margin-bottom: 0; color: var(--ink-soft); }
.empty { margin: 25px 0; padding: 38px; text-align: center; box-shadow: var(--shadow); }
.empty .button { margin-top: 18px; }

/* Engagement overview and detail */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 20px; }
.engagement-card, .detail-card, .course-detail, .schedule-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.engagement-card { padding: 20px; }
.card-head { width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 0; border: 0; color: var(--ink); background: none; text-align: left; }
.card-head small { color: var(--teal-dark); font-size: .7rem; font-weight: 850; letter-spacing: .07em; }
.card-head h2 { margin: 2px 0 4px; font-size: 1.3rem; }
.card-head p { margin-bottom: 0; color: var(--ink-soft); font-size: .9rem; }
.card-head > b { color: var(--teal); font-size: 2rem; line-height: 1; }
.status, .row-status, .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800;
  white-space: nowrap;
}
.status.success, .row-status.success { color: #087354; background: var(--green-pale); border-color: #b8ead8; }
.status.warning, .row-status.warning { color: #9d5810; background: var(--warning-pale); border-color: #f6d49e; }
.pill { color: var(--teal-dark); background: var(--teal-pale); border-color: #b9e3e2; }
.engagement-card > .status { margin-top: 17px; }
.count { margin: 12px 0; color: var(--ink-soft); font-size: .9rem; font-weight: 700; }
.course-mini-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.course-mini-list li + li { border-top: 1px solid var(--line); }
.course-mini-list button { width: 100%; display: grid; grid-template-columns: 33px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 11px 12px; border: 0; color: var(--ink); background: #fcfefe; text-align: left; }
.course-mini-list button:hover { background: var(--teal-pale); }
.grade { display: inline-grid; place-items: center; min-width: 31px; height: 31px; padding: 0 6px; border-radius: 50%; color: var(--teal-dark); background: var(--teal-pale); font-weight: 850; }
.course-mini-list i { color: var(--warning); font-style: normal; }
.course-mini-list strong { color: var(--ink); font-size: .9rem; white-space: nowrap; }
.course-mini-list strong small { font-size: .74rem; font-weight: 600; }
.empty-add { width: 100%; margin-top: 14px; min-height: 48px; border: 1.5px dashed #9bcfce; border-radius: 14px; color: var(--teal-dark); background: #f9ffff; font-weight: 850; }
.empty-add:hover { background: var(--teal-pale); }
.back { display: inline-flex; margin-bottom: 19px; border: 0; color: var(--teal-dark); background: transparent; font-weight: 800; text-decoration: none; }
.back:hover { text-decoration: underline; }
.detail-card > header { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 22px; padding: 31px 34px; background: linear-gradient(135deg, #f5fcfc, #fff); border-bottom: 1px solid var(--line); }
.detail-card header h1 { margin-bottom: 6px; font-size: clamp(1.8rem, 3vw, 2.65rem); }
.detail-card header p:last-of-type { margin-bottom: 0; color: var(--ink-soft); }
.detail-list { padding: 12px 22px 23px; }
.course-row { width: 100%; display: grid; grid-template-columns: 38px minmax(150px, 1fr) auto auto 18px; align-items: center; gap: 14px; padding: 17px 10px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; }
.course-row:hover { color: var(--teal-dark); background: #f7fcfc; }
.course-row > span:nth-child(2) { display: grid; gap: 2px; }
.course-row > span:nth-child(2) small { font-size: .83rem; }
.course-row > b { font-size: 1.02rem; white-space: nowrap; }
.course-row > b small { font-weight: 500; }

/* Course screen */
.course-detail { padding: clamp(27px, 4vw, 43px); }
.course-detail h1 { margin-bottom: 10px; }
.course-detail > p:not(.eyebrow) { color: var(--ink-soft); font-size: 1.05rem; }
.course-detail > p .status { margin-left: 8px; vertical-align: middle; }
.progress { height: 13px; margin: 27px 0 24px; overflow: hidden; border-radius: 999px; background: #e4efef; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #10bb90, #17c8a0); transition: width .2s ease; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin: 34px 0 0; padding-top: 28px; border-top: 1px solid var(--line); }
.metrics div { text-align: center; }
.metrics div + div { border-left: 1px solid var(--line); }
.metrics dt { order: 2; color: var(--ink-soft); font-size: .73rem; font-weight: 780; letter-spacing: .05em; text-transform: uppercase; }
.metrics dd { margin: 0 0 3px; color: var(--teal-dark); font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 850; line-height: 1.1; }
.schedule-card { margin-top: 22px; padding: clamp(23px, 4vw, 36px); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.row h2 { margin-bottom: 0; }
.text-button { border: 0; color: var(--teal-dark); background: transparent; font-weight: 850; }
.text-button:hover { text-decoration: underline; }
.week { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 28px; }
.week > div { display: grid; place-items: center; min-height: 118px; padding: 15px 7px; border-radius: 19px; background: #f2f8f8; text-align: center; }
.week small { color: var(--ink-soft); font-size: .76rem; font-weight: 800; text-transform: uppercase; }
.week strong { font-size: 2rem; line-height: 1.15; }
.week span { color: var(--ink-soft); font-size: .82rem; }

/* Library, plans and schools */
.plan-filter { display: flex; align-items: center; gap: 10px; margin: 24px 0; padding: 0 17px; min-height: 54px; border: 1px solid #bddbdc; border-radius: 16px; color: var(--teal-dark); background: #fff; box-shadow: 0 5px 16px rgba(20, 94, 102, .04); }
.plan-filter:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(22, 139, 143, .12); }
.plan-filter input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.plan-filter input::placeholder { color: #8aa1b4; }
.plan-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.plan-card { display: grid; grid-template-columns: 45px minmax(0, 1fr) auto; align-items: center; gap: 13px; min-height: 136px; padding: 20px; border: 1px solid var(--line); border-radius: 19px; color: var(--ink); background: #fff; box-shadow: 0 8px 21px rgba(19, 66, 80, .055); text-decoration: none; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.plan-card:hover { transform: translateY(-3px); border-color: #a7d7d8; box-shadow: 0 15px 28px rgba(19, 66, 80, .10); }
.plan-card .grade { width: 42px; height: 42px; font-size: 1.03rem; }
.plan-card h2 { margin: 2px 0 5px; font-size: 1.13rem; }
.plan-card p { margin: 0; color: var(--ink-soft); font-size: .82rem; line-height: 1.35; }
.plan-card > b { color: var(--teal-dark); font-size: .85rem; white-space: nowrap; }
.my-library .plan-card { border-left: 4px solid var(--teal); }

.school-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 20px; }
.school-group { overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: #fff; box-shadow: 0 8px 21px rgba(19, 66, 80, .05); }
.school-group h2 { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 17px 20px; color: var(--teal-dark); background: linear-gradient(120deg, #ebf8f7, #fff); border-bottom: 1px solid var(--line); font-size: 1.08rem; }
.school-group h2 span { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 999px; color: var(--teal-dark); background: #fff; border: 1px solid #b9e3e1; font-size: .75rem; }
.school-line { display: grid; gap: 3px; padding: 14px 20px; }
.school-line + .school-line { border-top: 1px solid #edf2f2; }
.school-line:hover { background: #f7fcfc; }
.school-line strong { font-size: .94rem; }
.school-line small { font-size: .8rem; }

/* Public plan detail */
.crumb { margin: 0 0 18px; color: var(--ink-soft); font-size: .91rem; }
.crumb a { color: var(--teal-dark); font-weight: 800; }
.plan-header { padding: clamp(28px, 5vw, 47px); }
.plan-header h1 { max-width: 1020px; margin-bottom: 31px; }
.plan-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.plan-stats div { padding: 0 14px 0 0; }
.plan-stats div + div { padding-left: 18px; border-left: 1px solid #cce4e3; }
.plan-stats small { display: block; color: var(--ink-soft); font-size: .68rem; font-weight: 820; letter-spacing: .055em; }
.plan-stats strong { display: block; margin-top: 2px; color: var(--teal-dark); font-size: 1.65rem; letter-spacing: -.02em; }
.topics { margin-top: 30px; padding: clamp(24px, 4vw, 38px); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.topics > h2 { margin-bottom: 6px; }
.topics > p { margin-bottom: 28px; color: var(--ink-soft); }
.topic { padding: 22px 0; border-top: 1px solid var(--line); }
.topic > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 12px; }
.topic h3 { font-size: 1.15rem; }
.topic h3 span { display: inline-flex; margin-left: 7px; padding: 2px 8px; border: 1px solid #cbe3e4; border-radius: 999px; color: var(--teal-dark); background: #f2fbfb; font-size: .72rem; font-weight: 780; vertical-align: 2px; }
.topic header > b { min-width: max-content; padding: 4px 10px; border: 1px solid #b9e2e2; border-radius: 999px; color: var(--teal-dark); background: var(--teal-pale); font-size: .78rem; }
.topic > p { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 15px; margin: 0; padding: 6px 0; color: #31516f; }
.topic > p small { white-space: nowrap; }
.take-plan { display: flex; justify-content: center; margin: 30px 0 0; }

/* Private lesson library */
.my-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: clamp(27px, 4vw, 42px); }
.my-plan-head h1 { margin-bottom: 8px; }
.my-plan-head p:last-child { margin-bottom: 0; color: var(--ink-soft); }
.workspace { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 25px; margin-top: 26px; }
.workspace aside { position: sticky; top: 20px; align-self: start; display: grid; gap: 3px; padding: 19px 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 8px 21px rgba(19, 66, 80, .05); }
.workspace aside > small { padding: 0 10px 7px; color: var(--teal-dark); font-size: .7rem; font-weight: 850; letter-spacing: .06em; }
.workspace aside a { padding: 9px 10px; border-radius: 9px; color: var(--ink-soft); font-size: .86rem; font-weight: 700; text-decoration: none; }
.workspace aside a:hover { color: var(--teal-dark); background: var(--teal-pale); }
.lesson-area { display: grid; gap: 17px; }
.lesson-topic { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 8px 21px rgba(19, 66, 80, .055); }
.lesson-topic > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 25px; background: linear-gradient(120deg, #f2fbfb, #fff); border-bottom: 1px solid var(--line); }
.lesson-topic > header h2 { margin: 0; font-size: 1.13rem; }
.lesson-topic > header span { display: grid; place-items: center; min-width: 28px; height: 28px; border: 1px solid #b9e3e1; border-radius: 50%; color: var(--teal-dark); background: #fff; font-size: .78rem; font-weight: 820; }
.lesson-line { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 15px; padding: 14px 25px; color: var(--ink); text-decoration: none; }
.lesson-line + .lesson-line { border-top: 1px solid var(--line); }
.lesson-line:hover { background: #f7fcfc; }
.lesson-line > small { color: #8ca1b6; font-weight: 820; }
.lesson-line > b { color: var(--ink-soft); font-size: .82rem; white-space: nowrap; }
.lesson-line em { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; color: #967001; background: var(--gold-pale); font-size: .68rem; font-style: normal; font-weight: 800; }
.add-lesson-link { display: block; margin: 0 25px 20px; padding: 12px; border: 1.5px dashed #9bcfce; border-radius: 12px; color: var(--teal-dark); background: #fbffff; font-size: .9rem; font-weight: 820; text-align: center; text-decoration: none; }
.add-lesson-link:hover { background: var(--teal-pale); }

/* Forms, dialogs, schedules */
dialog { width: min(660px, calc(100% - 30px)); max-height: min(850px, calc(100vh - 30px)); padding: 0; border: 0; border-radius: 25px; color: var(--ink); background: #fff; box-shadow: 0 28px 70px rgba(11, 30, 50, .34); }
dialog::backdrop { background: rgba(21, 41, 61, .56); backdrop-filter: blur(3px); }
.modal-form { display: grid; gap: 18px; padding: 26px; }
.modal-form > header { display: grid; grid-template-columns: 50px 1fr 38px; align-items: center; gap: 13px; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.modal-form header h2 { margin: 0 0 2px; font-size: 1.4rem; }
.modal-form header p { margin: 0; color: var(--ink-soft); font-size: .9rem; }
.icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #1a989c, var(--teal-dark)); font-size: 1.45rem; }
.close { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-soft); background: #fff; font-size: 1.7rem; line-height: 1; }
.close:hover { color: var(--ink); background: #f5f9f9; }
.modal-form label, .edit-form label, .auth-form label { display: grid; gap: 7px; color: var(--ink); font-size: .88rem; font-weight: 790; }
.modal-form input, .modal-form select, .edit-form input, .edit-form select, .auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  outline: 0;
  color: var(--ink);
  background: #fbfdfd;
}
.modal-form input:focus, .modal-form select:focus, .edit-form input:focus, .edit-form select:focus, .auth-form input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(22, 139, 143, .12); background: #fff; }
.modal-form fieldset { margin: 0; padding: 0; border: 0; }
.modal-form legend { margin-bottom: 8px; color: var(--ink); font-size: .88rem; font-weight: 790; }
.duration-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.duration-options label { position: relative; min-height: 109px; display: block; padding: 15px; border: 1px solid var(--line-strong); border-radius: 15px; background: #fff; cursor: pointer; }
.duration-options label:has(input:checked) { border-color: var(--teal); background: #f1fbfb; box-shadow: inset 0 0 0 1px var(--teal); }
.duration-options input { position: absolute; opacity: 0; pointer-events: none; }
.duration-options strong { display: block; margin-bottom: 4px; color: var(--ink); }
.duration-options small { display: block; line-height: 1.25; }
.search-results { display: grid; overflow: auto; max-height: 205px; border-radius: 13px; }
.search-results:empty { display: none; }
.search-results button { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 13px; border: 1px solid var(--line); color: var(--ink); background: #fff; text-align: left; }
.search-results button + button { border-top: 0; }
.search-results button:hover { background: var(--teal-pale); }
.search-results button span { display: grid; gap: 2px; }
.search-results button small { display: block; }
.search-results > p { margin: 0; padding: 12px; border: 1px solid var(--line); color: var(--ink-soft); font-size: .9rem; }
.selected-plan { display: grid; gap: 3px; padding: 15px; border: 1px solid #bde4e2; border-radius: 14px; background: #f2fbfa; }
.selected-plan span { color: var(--ink-soft); font-size: .86rem; }
.schedule-editor { padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: #fbfdfd; }
.day-controls { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 14px; }
.day-controls > div { display: grid; gap: 5px; place-items: center; padding: 11px 5px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.day-controls small { font-size: .69rem; font-weight: 820; text-transform: uppercase; }
.day-controls strong { font-size: 1.4rem; }
.day-controls span { display: flex; gap: 4px; }
.day-controls button { display: grid; place-items: center; width: 27px; height: 27px; padding: 0; border: 1px solid #b8dcdc; border-radius: 50%; color: var(--teal-dark); background: #f4fbfb; font-weight: 850; }
.modal-form footer, .edit-form footer { display: flex; justify-content: flex-end; gap: 11px; padding-top: 4px; }
.form-error { min-height: 1.25em; margin: 0; color: #ba3f35; font-size: .87rem; font-weight: 700; }

/* Sign-in and lesson editor */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 10% 0%, #dff7f5 0, transparent 32%), linear-gradient(135deg, #f6fbfb, #eef4f8); }
.auth-card, .edit-form { width: min(520px, 100%); border: 1px solid var(--line); border-radius: 25px; background: #fff; box-shadow: 0 22px 52px rgba(16, 53, 76, .13); }
.auth-card { padding: clamp(28px, 6vw, 46px); }
.auth-card .brand { margin-bottom: 32px; }
.auth-card h1 { font-size: 2.15rem; }
.auth-copy { color: var(--ink-soft); }
.auth-form { display: grid; gap: 17px; margin-top: 25px; }
.auth-form .button { width: 100%; margin-top: 5px; }
.auth-switch { margin: 23px 0 0; color: var(--ink-soft); text-align: center; }
.auth-switch a { color: var(--teal-dark); font-weight: 820; }
.edit-form { display: grid; gap: 18px; margin: 12px auto 0; padding: clamp(25px, 5vw, 40px); }
.edit-form h1 { margin-bottom: 0; font-size: 2.1rem; }

@media (max-width: 800px) {
  .site-header { align-items: flex-start; flex-direction: column; padding: 14px 20px; gap: 12px; }
  .site-header nav { width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .site-header nav > a, .logout-form button { min-height: 39px; white-space: nowrap; }
  main { width: min(100% - 28px, 1180px); padding-top: 27px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .plan-stats { grid-template-columns: repeat(2, 1fr); gap: 20px 10px; }
  .plan-stats div + div { padding-left: 0; border-left: 0; }
  .plan-stats div:nth-child(even) { padding-left: 16px; border-left: 1px solid #cce4e3; }
  .workspace { grid-template-columns: 1fr; }
  .workspace aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace aside > small { grid-column: 1 / -1; }
  .detail-card > header, .my-plan-head { align-items: flex-start; grid-template-columns: 1fr; flex-direction: column; }
}

@media (max-width: 560px) {
  h1 { font-size: 2rem; }
  .brand-mark { width: 43px; height: 43px; border-radius: 13px; }
  .brand strong { font-size: 1.02rem; }
  .hero, .library-hero, .plan-header, .my-plan-head { border-radius: 19px; }
  .card-grid, .plan-library, .school-groups { grid-template-columns: 1fr; }
  .course-row { grid-template-columns: 35px minmax(0, 1fr) auto; gap: 10px; }
  .course-row .row-status { display: none; }
  .course-row > b { grid-column: 2 / -1; color: var(--ink-soft); }
  .metrics { gap: 7px; }
  .metrics dd { font-size: 1.75rem; }
  .week { gap: 6px; }
  .week > div { min-height: 100px; padding: 10px 3px; border-radius: 14px; }
  .week strong { font-size: 1.55rem; }
  .week span { font-size: .72rem; }
  .plan-stats strong { font-size: 1.4rem; }
  .topic > header { align-items: flex-start; flex-direction: column; gap: 9px; }
  .topic > p { grid-template-columns: 1fr; gap: 1px; }
  .topic > p small { font-size: .76rem; }
  .workspace aside { grid-template-columns: 1fr; }
  .lesson-topic > header, .lesson-line { padding-left: 16px; padding-right: 16px; }
  .lesson-line { grid-template-columns: 39px minmax(0, 1fr); gap: 8px; font-size: .91rem; }
  .lesson-line > b { grid-column: 2; }
  .add-lesson-link { margin-left: 16px; margin-right: 16px; }
  .duration-options { grid-template-columns: 1fr; }
  .duration-options label { min-height: 78px; }
  .day-controls { gap: 5px; }
  .day-controls > div { padding: 8px 2px; }
  .modal-form footer, .edit-form footer { flex-direction: column-reverse; }
  .modal-form footer .button, .edit-form footer .button { width: 100%; }
}
