@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Serif+Display&display=swap');

:root {
  --ink: #17231f;
  --muted: #68736f;
  --paper: #f4f0e7;
  --panel: #fffdf8;
  --line: #dcd7cc;
  --green: #234c3d;
  --green-soft: #dbe8df;
  --coral: #ec765d;
  --yellow: #f0c862;
  --blue: #4e7193;
  --shadow: 0 20px 60px rgba(31, 42, 37, .08);
  --radius: 5px;
  --display: "DM Serif Display", Georgia, serif;
  --body: "DM Sans", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; color: var(--ink); font-family: var(--body); min-height: 100vh; background: var(--paper); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.paper-noise { position: fixed; inset: 0; pointer-events: none; opacity: .28; z-index: 20; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E"); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px 1fr; }
.sidebar { height: 100vh; position: sticky; top: 0; padding: 34px 25px 26px; display: flex; flex-direction: column; background: var(--green); color: #f8f5ec; overflow: hidden; }
.sidebar::after { content: ""; width: 220px; height: 220px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; position: absolute; left: -95px; bottom: 95px; box-shadow: 0 0 0 34px rgba(255,255,255,.025), 0 0 0 68px rgba(255,255,255,.025); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; position: relative; z-index: 1; }
.brand-mark { width: 39px; height: 39px; background: var(--yellow); color: var(--ink); display: grid; place-items: center; font: 26px/1 var(--display); border-radius: 50% 50% 50% 7px; }
.brand strong, .brand small, .profile strong, .profile small { display: block; }
.brand strong { font: 20px/1 var(--display); letter-spacing: .2px; }
.brand small { opacity: .65; font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; margin-top: 4px; }
.primary-nav { display: grid; gap: 7px; margin-top: 70px; position: relative; z-index: 1; }
.nav-item { border: 0; background: transparent; color: rgba(255,255,255,.64); padding: 12px 10px; text-align: left; border-radius: var(--radius); cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 14px; transition: .2s ease; }
.nav-item span { font-size: 9px; opacity: .6; letter-spacing: 1px; }
.nav-item:hover { color: white; transform: translateX(3px); }
.nav-item.active { color: var(--ink); background: var(--yellow); box-shadow: 5px 5px 0 rgba(0,0,0,.14); }
.sidebar-bottom { margin-top: auto; position: relative; z-index: 1; }
.term-progress { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: rgba(255,255,255,.62); }
.term-progress > div:first-child { display: flex; justify-content: space-between; align-items: center; }
.term-progress strong { color: white; font-size: 9px; }
.progress-track { height: 3px; background: rgba(255,255,255,.15); margin: 10px 0 24px; }
.progress-track i { display: block; width: 22%; height: 100%; background: var(--yellow); }
.profile { border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.05); width: 100%; color: white; padding: 10px; display: flex; gap: 10px; align-items: center; text-align: left; cursor: pointer; }
.profile > span:first-child { width: 32px; height: 32px; display: grid; place-items: center; background: var(--coral); border-radius: 50%; font-size: 10px; font-weight: 700; }
.profile strong { font-size: 11px; }
.profile small { color: rgba(255,255,255,.55); font-size: 9px; margin-top: 2px; }

.main-panel { min-width: 0; padding: 42px clamp(28px, 4vw, 66px) 110px; max-width: 1500px; width: 100%; margin-inline: auto; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 35px; animation: rise .45s ease both; }
.eyebrow { margin: 0 0 7px; color: var(--coral); text-transform: uppercase; font-size: 10px; letter-spacing: 1.6px; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
h1 { font: clamp(34px, 4vw, 52px)/1 var(--display); margin-bottom: 0; font-weight: 400; letter-spacing: -.6px; }
h2 { font: 26px/1.1 var(--display); font-weight: 400; margin: 0; }
.top-actions { display: flex; align-items: center; gap: 7px; }
.icon-button, .date-pill, .add-button { border: 1px solid var(--line); min-height: 39px; background: var(--panel); cursor: pointer; transition: .18s ease; }
.icon-button { width: 39px; }
.icon-button:hover { background: var(--yellow); transform: translateY(-2px); }
.date-pill { padding: 0 15px; font-size: 10px; letter-spacing: 1px; font-weight: 700; }
.add-button { border-color: var(--green); background: var(--green); color: white; padding: 0 16px; margin-left: 7px; font-size: 11px; font-weight: 700; box-shadow: 4px 4px 0 var(--yellow); }
.add-button:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--yellow); }
.add-button span { color: var(--yellow); font-size: 16px; margin-right: 6px; }
.view-root { animation: rise .5s .06s ease both; }
.today-grid { display: grid; grid-template-columns: minmax(500px, 1.45fr) minmax(300px, .72fr); gap: 22px; align-items: start; }
.card { background: rgba(255,253,248,.86); border: 1px solid var(--line); box-shadow: var(--shadow); }
.schedule-card { padding: 27px 30px 13px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.section-heading.compact { padding: 21px 22px 17px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.lesson-count { font-size: 9px; font-weight: 700; padding: 7px 9px; background: var(--green-soft); color: var(--green); letter-spacing: .7px; text-transform: uppercase; }
.timeline { padding-top: 10px; }
.lesson { display: grid; grid-template-columns: 52px 16px 1fr; min-height: 87px; position: relative; }
.lesson time { font-size: 10px; color: var(--muted); padding-top: 22px; font-weight: 600; }
.line-dot { position: relative; }
.line-dot::before { content: ""; position: absolute; width: 1px; background: var(--line); top: 0; bottom: 0; left: 5px; }
.line-dot::after { content: ""; position: absolute; width: 7px; height: 7px; background: var(--panel); border: 2px solid #aab2ae; border-radius: 50%; left: 0; top: 20px; z-index: 1; }
.lesson:first-child .line-dot::before { top: 22px; }
.lesson:last-child .line-dot::before { bottom: calc(100% - 23px); }
.lesson-body { margin: 8px 0 7px 13px; padding: 11px 13px; display: flex; justify-content: space-between; align-items: center; border: 1px solid transparent; transition: .18s ease; }
.lesson:not(.break):hover .lesson-body { background: white; border-color: var(--line); transform: translateX(3px); }
.lesson h3 { font-size: 13px; margin: 5px 0 3px; }
.lesson p { margin-bottom: 0; font-size: 10px; color: var(--muted); }
.tag { display: inline-block; font-size: 7px; line-height: 1; padding: 4px 5px; letter-spacing: .8px; font-weight: 700; }
.tag.english { color: #684337; background: #f4dcd1; }
.tag.media { color: #314e6b; background: #dce7f0; }
.tag.admin { color: #385446; background: #dce8de; }
.tag.neutral { color: #6d6658; background: #eae5d8; }
.lesson-action { width: 27px; height: 27px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.lesson.current .lesson-body { background: var(--green); color: white; box-shadow: 5px 5px 0 var(--yellow); }
.lesson.current p { color: rgba(255,255,255,.62); }
.lesson.current .line-dot::after { border-color: var(--coral); background: var(--coral); box-shadow: 0 0 0 4px rgba(236,118,93,.2); }
.now-label { font-size: 8px; color: var(--yellow); font-weight: 700; letter-spacing: 1px; }
.lesson.done { opacity: .62; }
.lesson.done h3 { text-decoration: line-through; }
.lesson.break { min-height: 67px; }
.lesson.break .lesson-body { padding-top: 7px; }

.right-rail { display: grid; gap: 18px; }
.priority-card, .support-card { overflow: hidden; }
.section-heading.compact h2 { font-size: 21px; }
.section-heading.compact > span { font-size: 9px; font-weight: 700; background: var(--yellow); padding: 5px 7px; }
.tasks { padding: 7px 22px 12px; }
.task { display: grid; grid-template-columns: 18px 1fr; gap: 8px; position: relative; cursor: pointer; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.task:last-child { border: 0; }
.task input { position: absolute; opacity: 0; }
.task i { width: 15px; height: 15px; border: 1px solid #a4ada8; margin-top: 2px; position: relative; }
.task input:checked + i { background: var(--green); border-color: var(--green); }
.task input:checked + i::after { content: "✓"; position: absolute; color: white; font-size: 10px; left: 2px; top: -1px; }
.task strong, .task small { display: block; }
.task strong { font-size: 11px; line-height: 1.35; }
.task small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.task.checked strong { color: var(--muted); text-decoration: line-through; }
.support-card { padding-bottom: 8px; }
.text-button { border: 0; background: transparent; color: var(--coral); font-size: 9px; font-weight: 700; cursor: pointer; }
.support-note { display: grid; grid-template-columns: 31px 1fr; gap: 11px; margin: 15px 21px; }
.support-note > span { width: 31px; height: 31px; background: var(--blue); color: white; display: grid; place-items: center; font-size: 8px; font-weight: 700; border-radius: 50%; }
.support-note strong { font-size: 11px; }
.support-note p { color: var(--muted); font-size: 9px; line-height: 1.45; margin: 2px 0 0; }
.nudge-card { margin: 0; padding: 20px 22px; background: var(--yellow); border: 0; position: relative; overflow: hidden; }
.nudge-card::after { content: "”"; font: 90px/1 var(--display); position: absolute; right: 6px; bottom: -28px; opacity: .13; }
.nudge-card span { text-transform: uppercase; font-size: 8px; letter-spacing: 1px; font-weight: 700; }
.nudge-card p { font: 17px/1.25 var(--display); margin: 8px 25px 0 0; }

/* Additional views */
.week-board { display: grid; grid-template-columns: repeat(5, minmax(145px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.day-column { background: var(--panel); border: 1px solid var(--line); min-height: 520px; padding: 15px 12px; }
.day-column.today { border-top: 4px solid var(--coral); padding-top: 12px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 11px; }
.day-head strong { font: 19px/1 var(--display); }
.day-head span { color: var(--muted); font-size: 9px; }
.week-lesson { padding: 10px; margin: 8px 0; background: var(--green-soft); border-left: 3px solid var(--green); }
.week-lesson.alt { background: #f3e0d7; border-color: var(--coral); }
.week-lesson.free { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.week-lesson time, .week-lesson small { display: block; font-size: 8px; }
.week-lesson strong { display: block; font-size: 10px; margin: 4px 0; }
.week-lesson small { color: var(--muted); }
.class-grid, .notebook-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }
.class-card { background: var(--panel); border: 1px solid var(--line); padding: 22px; min-height: 200px; cursor: pointer; transition: .2s ease; position: relative; overflow: hidden; }
.class-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.class-card::after { content: attr(data-year); position: absolute; right: -8px; bottom: -25px; font: 90px/1 var(--display); color: var(--green); opacity: .06; }
.class-card .class-meta { display: flex; justify-content: space-between; }
.class-card h3 { font: 26px/1 var(--display); margin: 28px 0 7px; }
.class-card p { font-size: 10px; color: var(--muted); }
.metric-row { display: flex; gap: 18px; border-top: 1px solid var(--line); padding-top: 15px; margin-top: 20px; }
.metric-row strong, .metric-row small { display: block; }
.metric-row strong { font-size: 16px; }
.metric-row small { font-size: 8px; color: var(--muted); text-transform: uppercase; }
.notebook-grid { grid-template-columns: 1.2fr .8fr .8fr; }
.note-tile { min-height: 230px; padding: 23px; background: var(--panel); border: 1px solid var(--line); position: relative; cursor: pointer; }
.note-tile:hover { box-shadow: var(--shadow); }
.note-tile h3 { font: 24px/1 var(--display); margin-top: 26px; }
.note-tile p, .note-tile li { color: var(--muted); font-size: 10px; line-height: 1.6; }
.note-tile ul { padding-left: 17px; }
.note-tile.featured { background: var(--green); color: white; }
.note-tile.featured p { color: rgba(255,255,255,.65); }
.empty-state { padding: 70px; text-align: center; background: var(--panel); border: 1px dashed var(--line); }

.style-switcher { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--ink); color: white; border-radius: 30px; padding: 5px 6px 5px 15px; display: flex; align-items: center; gap: 4px; z-index: 30; box-shadow: 0 12px 35px rgba(0,0,0,.22); font-size: 9px; text-transform: uppercase; letter-spacing: .8px; }
.style-switcher span { margin-right: 5px; opacity: .55; }
.style-switcher a { color: white; text-decoration: none; padding: 8px 11px; border-radius: 20px; }
.style-switcher a.active { color: var(--ink); background: var(--yellow); }

dialog { width: min(480px, calc(100% - 30px)); padding: 0; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 30px 100px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(19,34,29,.64); backdrop-filter: blur(4px); }
dialog form { padding: 28px; }
.modal-head { display: flex; justify-content: space-between; margin-bottom: 28px; }
.modal-head h2 { font-size: 30px; }
.close-button { width: 32px; height: 32px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 20px; }
dialog label { display: grid; gap: 7px; font-size: 9px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
dialog input, dialog select { width: 100%; border: 1px solid var(--line); background: white; padding: 13px; color: var(--ink); outline: none; }
dialog input:focus, dialog select:focus { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 24px; }
.submit-button { width: 100%; border: 0; background: var(--green); color: white; padding: 14px; font-weight: 700; cursor: pointer; box-shadow: 5px 5px 0 var(--yellow); }
.toast { position: fixed; right: 24px; bottom: 24px; background: var(--green); color: white; padding: 13px 18px; font-size: 11px; z-index: 50; animation: toast 2.8s ease both; }

/* Prototype variations */
body.style-notebook { --paper: #ece7db; --panel: #fffef9; --green: #344c75; --green-soft: #e0e7f0; --coral: #d65f4c; --yellow: #efc75e; --radius: 0; }
body.style-notebook .main-panel { background-image: linear-gradient(rgba(74,95,127,.08) 1px, transparent 1px); background-size: 100% 28px; }
body.style-notebook .card, body.style-notebook .class-card, body.style-notebook .note-tile { box-shadow: 5px 5px 0 rgba(52,76,117,.14); }
body.style-notebook .sidebar { background: #344c75; }
body.style-notebook .schedule-card { transform: rotate(-.12deg); }
body.style-notebook h1 { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 7px; text-underline-offset: -2px; }
body.style-focus { --paper: #101513; --panel: #19201d; --ink: #f0f2eb; --muted: #9aa39f; --line: #34403b; --green: #dbe8a8; --green-soft: #263328; --coral: #ff886e; --yellow: #dbe8a8; --shadow: 0 25px 70px rgba(0,0,0,.25); }
body.style-focus .sidebar { background: #0b0f0d; }
body.style-focus .brand-mark, body.style-focus .nav-item.active, body.style-focus .nudge-card { color: #17231f; }
body.style-focus .add-button { color: #17231f; }
body.style-focus .lesson.current .lesson-body { background: var(--green); color: #17231f; }
body.style-focus .lesson.current p { color: rgba(23,35,31,.65); }
body.style-focus .card { background: var(--panel); }
body.style-focus .lesson:not(.break):hover .lesson-body { background: #202a26; }
body.style-focus dialog, body.style-focus dialog input, body.style-focus dialog select { background: var(--panel); color: var(--ink); }
body.style-focus .class-card, body.style-focus .note-tile, body.style-focus .day-column { background: var(--panel); }
body.style-focus .note-tile.featured { background: var(--green); color: #17231f; }
body.style-focus .note-tile.featured p { color: rgba(23,35,31,.6); }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast { 0%,100% { opacity: 0; transform: translateY(8px); } 12%,85% { opacity: 1; transform: none; } }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 82px 1fr; }
  .sidebar { padding-inline: 15px; }
  .brand > span:last-child, .nav-item:not(.active) { font-size: 0; }
  .nav-item { justify-content: center; }
  .nav-item span { font-size: 9px; }
  .nav-item.active { font-size: 0; }
  .sidebar-bottom { display: none; }
  .today-grid { grid-template-columns: 1fr; }
  .right-rail { grid-template-columns: 1fr 1fr; }
  .nudge-card { grid-column: 1 / -1; }
  .class-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; height: 64px; width: 100%; left: 0; bottom: 0; top: auto; z-index: 25; flex-direction: row; padding: 8px 10px; align-items: center; }
  .brand, .sidebar-bottom { display: none; }
  .primary-nav { margin: 0; width: 100%; grid-template-columns: repeat(4,1fr); gap: 3px; }
  .nav-item, .nav-item.active, .nav-item:not(.active) { display: grid; justify-items: center; gap: 3px; padding: 7px 3px; font-size: 8px; }
  .nav-item span, .nav-item.active span { font-size: 8px; }
  .main-panel { padding: 25px 16px 135px; }
  .topbar { display: block; }
  h1 { font-size: 38px; }
  .top-actions { margin-top: 20px; }
  .add-button { margin-left: auto; }
  .today-grid { display: block; }
  .right-rail { display: grid; grid-template-columns: 1fr; margin-top: 16px; }
  .schedule-card { padding: 22px 16px 10px; }
  .lesson { grid-template-columns: 42px 14px 1fr; }
  .lesson-body { margin-left: 7px; }
  .class-grid, .notebook-grid { grid-template-columns: 1fr; }
  .week-board { margin-right: -16px; }
  .style-switcher { bottom: 73px; white-space: nowrap; }
  .style-switcher span { display: none; }
}
