:root {
  color-scheme: light;
  --background: #f5f6ef;
  --surface: #fff;
  --ink: #20332b;
  --muted: #52645a;
  --line: #dce3d9;
  --purple: #285442;
  --purple-dark: #1b3a2d;
  --purple-light: #e2eee4;
  --radius: 13px;
  --sidebar-width: 226px;
  --header-height: 68px;
  font-family: "Avenir Next", Avenir, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.48;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--background); }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
input, textarea, select { font-weight: 500; }
button { color: inherit; }
button:disabled { opacity: .48; cursor: default; }
svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-library { width: 0; height: 0; position: absolute; overflow: hidden; }
:focus-visible { outline: 2px solid #397953; outline-offset: 3px; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.24; }
.visually-hidden, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; left: 12px; top: 12px; background: var(--surface); border-radius: 8px; padding: 9px 15px; z-index: 10; }
.workspace-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; z-index: 3; display: flex; flex-direction: column;
  padding: 24px 15px 19px; background: #fafbf6; border-right: 1px solid var(--line); overflow: auto;
}
.wordmark { display: flex; align-items: center; gap: 12px; width: fit-content; margin: 0; text-decoration: none; }
.wordmark img { border-radius: 10px; }
.sidebar-brand { display: flex; align-items: center; margin: 0 7px 28px; justify-content: space-between; gap: 6px; }
.wordmark span { font-size: 21px; font-weight: 700; letter-spacing: -.04em; line-height: 1.08; }
.wordmark small { display: block; color: var(--muted); font-size: 12px; font-weight: 550; letter-spacing: .01em; margin-top: 5px; }
.side-nav { display: grid; gap: 4px; }
.side-nav a, .sidebar-help { display: flex; padding: 11px 11px; gap: 11px; align-items: center; min-height: 44px; color: var(--muted); border-radius: 9px; font-size: .93rem; font-weight: 650; text-decoration: none; }
.side-nav a:hover, .sidebar-help:hover { background: #edf3ea; color: var(--purple-dark); }
.side-nav a[aria-current="page"] { background: var(--purple-light); color: var(--purple-dark); font-weight: 700; }
.side-nav .external-icon { width: 14px; height: 14px; margin-left: auto; }
.side-secondary { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 19px; }
.side-secondary p { padding: 0 11px 4px; color: var(--muted); font-weight: 700; font-size: .78rem; }
.sidebar-end { margin-top: auto; padding-top: 12px; }
.sidebar-help { border-top: 1px solid var(--line); border-radius: 0; }
.workspace-main { min-width: 0; }
.workspace-header {
  height: var(--header-height); background: var(--surface); padding: 0 clamp(24px, 3.2vw, 54px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line);
}
.breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .91rem; white-space: nowrap; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb svg { width: 13px; height: 13px; }
.breadcrumb span { color: var(--ink); font-weight: 700; }
.workspace-header-actions { display: flex; gap: 12px; align-items: center; }
.workspace-search { display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); background: #f6f8f3; border-radius: 9px; }
.workspace-search svg { width: 17px; color: var(--muted); }
.workspace-search input { background: transparent; border: 0; min-height: 36px; padding: 2px 0; width: 168px; font-size: .89rem; }
.workspace-search input:focus-visible { outline: none; }
.workspace-search:focus-within { outline: 2px solid #397953; outline-offset: 2px; }
.icon-button { display: inline-grid; align-items: center; justify-items: center; width: 39px; height: 39px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--muted); }
.icon-button:hover { color: var(--purple-dark); background: var(--purple-light); }
.mobile-menu, .sidebar-overlay, .sidebar-close { display: none; }
.account-link { min-height: 38px; }
.workspace-content { width: min(100%, 1450px); margin-inline: auto; padding: clamp(23px, 3.1vw, 43px) clamp(24px, 3.2vw, 54px) 56px; }
.surface { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 15px;
  border: 1px solid transparent; border-radius: 9px; background: none; color: var(--purple); cursor: pointer;
  font-size: .91rem; font-weight: 700; text-align: center; text-decoration: none; line-height: 1.24;
}
.button svg, .text-link svg { width: 17px; height: 17px; }
.button-primary { background: var(--purple); color: white; border-color: var(--purple); }
.button-primary:hover:not(:disabled) { background: var(--purple-dark); border-color: var(--purple-dark); }
.button-secondary { background: var(--surface); border-color: #ccd9cd; }
.button-secondary:hover:not(:disabled), .button-text:hover:not(:disabled) { background: var(--purple-light); }
.button-danger { color: #9f2d47; }
.button-danger:hover:not(:disabled) { background: #fdeaf0; }
.text-link { display: inline-flex; gap: 7px; align-items: center; text-decoration: none; color: var(--purple); font-weight: 700; font-size: .92rem; }
.text-link:hover { text-decoration: underline; }
.welcome {
  position: relative; isolation: isolate; overflow: hidden; min-height: 259px; display: flex; align-items: center;
  border: 1px solid #cddbc6; border-radius: 18px; background: #e6efde;
}
.welcome::before {
  content: ""; position: absolute; z-index: -2; inset: 0 0 0 auto; width: 60%;
  background: url("/images/lessonroom-desk.jpg") center 60% / cover no-repeat;
}
.welcome::after {
  content: ""; z-index: -1; position: absolute; inset: 0;
  background: linear-gradient(90deg, #e6efde 40%, rgb(230 239 222 / 94%) 45%, rgb(230 239 222 / 12%) 62%, transparent 76%);
}
.welcome-copy { width: min(530px, 63%); padding: 27px clamp(25px, 3.7vw, 52px) 30px; }
.welcome h1 { font-family: Georgia, serif; letter-spacing: -.063em; font-size: clamp(2.65rem, 4.3vw, 4.3rem); font-weight: 500; line-height: .99; color: #1e392e; }
.welcome h1 em { color: #355d3c; font-weight: inherit; }
.welcome p { max-width: 380px; margin: 14px 0 17px; color: #3c5747; font-size: 1rem; }
.welcome .button { padding-inline: 16px; }
.home-workflows { display: grid; grid-template-columns: minmax(0, 2.05fr) minmax(235px, 1fr); gap: 20px; margin-top: 27px; }
.home-section { margin-top: 27px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.section-heading h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -.038em; }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tool-card, .teaching-link {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: start;
  text-decoration: none; padding: 14px; min-height: 89px;
}
.tool-card:hover, .resource-card:hover { border-color: #98b8a4; box-shadow: 0 5px 16px rgb(27 58 45 / 7%); }
.teaching-links { overflow: clip; }
.teaching-link + .teaching-link { border-top: 1px solid var(--line); }
.teaching-link:hover { background-color: #f1f6ee; }
[data-tone="purple"] { --tone-bg: #e1eee5; --tone-ink: #2a6247; }
[data-tone="green"] { --tone-bg: #f5ebcc; --tone-ink: #755113; }
[data-tone="peach"] { --tone-bg: #f7e8dd; --tone-ink: #8f4828; }
[data-tone="blue"] { --tone-bg: #e3eef1; --tone-ink: #325c6a; }
.tool-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 9px; background: var(--tone-bg, var(--purple-light)); color: var(--tone-ink, var(--purple)); }
.tool-icon svg { width: 20px; height: 20px; }
.card-arrow { color: var(--purple); height: 16px; width: 16px; align-self: center; }
.tool-card h3, .teaching-link h3 { font-size: 1rem; font-weight: 700; letter-spacing: -.018em; margin-bottom: 4px; }
.tool-card p, .teaching-link p { color: var(--muted); font-size: .87rem; line-height: 1.4; }
.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.resource-card { display: grid; align-content: start; gap: 8px; width: 100%; padding: 17px; text-align: left; text-decoration: none; cursor: pointer; color: var(--ink); }
.resource-card-title { font-size: 1.08rem; font-weight: 700; line-height: 1.24; }
.resource-card-summary { color: var(--muted); font-size: .89rem; line-height: 1.42; }
.resource-topline { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.resource-topline .tool-icon { width: 31px; height: 31px; border-radius: 8px; }
.resource-topline .tool-icon svg { width: 17px; height: 17px; }
.resource-meta { display: flex; flex-wrap: wrap; gap: 4px 9px; align-items: center; color: var(--muted); font-size: .79rem; font-weight: 600; }
.resource-type { background: var(--tone-bg, var(--purple-light)); color: var(--tone-ink, var(--purple)); border-radius: 6px; padding: 3px 7px; }
.page-heading { display: flex; align-items: flex-start; gap: 14px; margin: 3px 0 24px; }
.page-heading .tool-icon { width: 49px; height: 49px; border-radius: 13px; }
.page-heading h1 { margin-bottom: 5px; font-size: clamp(1.9rem, 4vw, 2.65rem); font-weight: 700; letter-spacing: -.05em; }
.page-heading p { color: var(--muted); }
.filters { display: grid; grid-template-columns: minmax(164px, 1.45fr) repeat(4, minmax(92px, 1fr)) auto; padding: 17px; align-items: end; gap: 12px; }
.field { display: grid; position: relative; align-content: start; min-width: 0; gap: 6px; color: var(--ink); font-weight: 670; font-size: .9rem; }
.field-note { color: var(--muted); font-weight: 500; font-size: .81rem; }
input:not([type="checkbox"]):not([type="radio"]), textarea, select {
  color: var(--ink); background: var(--surface); border: 1px solid #cdd9cb; border-radius: 8px; padding: 9px 10px; min-width: 0;
}
input:not([type="checkbox"]):not([type="radio"]), select { min-height: 42px; }
.field input, .field textarea, .field select { width: 100%; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #617266; opacity: 1; }
.search-control { position: relative; }
.search-control svg { position: absolute; left: 10px; top: 12px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search-control input[type="search"] { padding-left: 33px; }
.workspace-search input[type="search"] { background: transparent; border: 0; min-height: 36px; padding: 2px 0; }
.library-results-heading { display: flex; justify-content: space-between; gap: 10px; min-height: 56px; align-items: center; }
.library-results-heading p { color: var(--muted); font-size: .92rem; font-weight: 620; }
.library-results-heading button { min-height: 34px; padding: 6px 9px; }
.filter-shortcuts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.filter-shortcuts:empty { display: none; }
.filter-shortcuts .button { min-height: 33px; padding: 5px 11px; border-radius: 999px; }
.filter-shortcuts [aria-current="true"] { background: var(--purple-light); }
.pagination { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 20px; }
.pagination span { color: var(--muted); font-size: .88rem; }
.library-empty { grid-column: 1 / -1; padding: 26px; color: var(--muted); }
.editor-layout { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 17px; }
.editor-form, .editor-output { display: grid; align-content: start; gap: 16px; padding: clamp(16px, 2.2vw, 25px); }
.editor-form { align-self: start; }
.editor-form h2, .editor-output h2, .result-empty h2 { font-size: 1.18rem; letter-spacing: -.024em; font-weight: 700; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions, .dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-feedback { color: var(--purple-dark); font-size: .88rem; }
.form-feedback:empty { display: none; }
.form-feedback[data-error="true"], .planner-message[data-error="true"] { color: #9f2d47; }
.result-panel { align-self: start; min-height: 290px; }
.result-empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 52px 20px; color: var(--muted); }
.result-empty h2 { color: var(--ink); }
.result-empty .tool-icon { width: 48px; height: 48px; border-radius: 13px; }
.editor-output > .button-text { justify-self: start; }
.answer-guide { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; }
.answer-guide summary { cursor: pointer; color: var(--purple-dark); font-weight: 700; }
.answer-guide textarea { display: block; width: 100%; margin: 12px 0 9px; }
#resource-detail {
  width: min(720px, calc(100% - 24px)); max-height: calc(100dvh - 30px); padding: 0; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 18px 70px #172e2530;
}
#resource-detail::backdrop { background: #172e2583; }
.dialog-header { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 17px 19px; }
.dialog-header h2 { margin-top: 6px; font-size: 1.5rem; }
.dialog-body, .dialog-actions { padding: 15px 19px; }
.dialog-body > p { color: var(--muted); margin-bottom: 12px; }
.dialog-body .form-feedback { margin: 8px 0 0; }
.dialog-actions { padding-top: 0; }
.planner-layout { display: grid; grid-template-columns: minmax(180px, .32fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.planner-sidebar, .planner-panel, .planner-empty { padding: clamp(15px, 2vw, 23px); }
.planner-sidebar h2, .planner-panel h2 { font-size: 1.18rem; }
.planner-sidebar > .button { width: 100%; margin-top: 12px; }
.planner-main { min-width: 0; }
.planner-layout-shared { display: block; }
.planner-layout-shared .planner-panel > * + * { margin-top: 12px; }
.planner-unit-list, .planner-form, .planner-fields, .planner-lessons { display: grid; gap: 13px; }
.planner-unit-list { margin: 12px 0 0; padding: 0; list-style: none; }
.planner-unit-item { width: 100%; }
.planner-unit-item .button { display: grid; justify-content: stretch; width: 100%; text-align: left; overflow-wrap: anywhere; }
.planner-unit-item .button[aria-current="true"] { background: var(--purple-light); }
.planner-unit-meta { color: var(--muted); font-size: .84rem; font-weight: 520; }
.planner-form, .planner-share { margin-top: 12px; }
.planner-form fieldset { display: grid; min-width: 0; gap: 13px; border: 0; margin: 0; padding: 0; }
.planner-form fieldset > .button { justify-self: start; }
.planner-lessons { margin: 0; padding: 0; list-style: none; }
.planner-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.planner-fields label > :is(input, select, textarea), .planner-lesson label > :is(input, textarea) { min-width: 0; width: 100%; }
.planner-lesson { border: 1px solid var(--line); border-radius: 11px; padding: 13px; display: grid; gap: 10px; }
.planner-lesson-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; justify-content: space-between; }
.planner-lesson-fields { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) minmax(105px, .55fr); }
.planner-lesson-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.planner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.planner-message, .planner-empty p, .planner-resource { color: var(--muted); font-size: .9rem; }
.planner-message { margin-bottom: 10px; }
.planner-message:empty { display: none; }
.planner-resource { padding: 14px; margin-bottom: 13px; display: grid; gap: 10px; }
.planner-resource > label { max-width: 320px; }
.planner-share { border-top: 1px solid var(--line); padding-top: 16px; }
.planner-share input[readonly] { width: 100%; }
.planner-share p, .planner-empty p { margin: 7px 0 12px; }
.planner-empty { padding: 5px 0; }
.planner-share .planner-actions { margin-top: 8px; align-items: end; }
.planner-share .planner-actions .field:has(input) { flex: 1 0 min(200px, 100%); }
.auth-layout { max-width: 1000px; margin: 0 auto; padding: 28px clamp(18px, 4vw, 40px) 50px; }
.auth-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 25px; text-decoration: none; font-weight: 700; }
.auth-hero { display: grid; grid-template-columns: minmax(0, .87fr) minmax(0, 1fr); overflow: hidden; min-height: 445px; }
.auth-intro { padding: clamp(22px, 4.5vw, 48px); background: #e5eddf url("/images/lessonroom-desk.jpg") center bottom / auto 235px no-repeat; }
.auth-intro h1 { margin-bottom: 10px; font: 500 clamp(2.1rem, 4vw, 3.3rem)/1.04 Georgia, serif; letter-spacing: -.045em; }
.auth-intro p { color: var(--muted); max-width: 235px; }
.auth-content { padding: clamp(22px, 4.2vw, 42px); }
.auth-content h2 { font-size: 1.38rem; margin-bottom: 10px; }
.auth-form { display: grid; gap: 13px; }
.auth-content > p { margin-bottom: 11px; color: var(--muted); }
.auth-modes { display: flex; gap: 7px; margin-bottom: 14px; }
.auth-modes a[aria-current="true"] { background: var(--purple-light); }
.auth-form .button { justify-self: start; }
.auth-status { margin-top: 11px; }
.auth-note, .auth-member-actions { margin-top: 15px; }
.auth-google { display: grid; gap: 7px; margin-bottom: 14px; }
.button.auth-google-button { justify-content: center; gap: 10px; background: #fff; border: 1px solid #747775; color: #1f1f1f; font-weight: 600; }
.button.auth-google-button:hover { background: #f5f8ff; }
.auth-google-button img { flex: none; object-fit: contain; }
.auth-divider { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .82rem; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; background: var(--line); flex: 1; }
@media (max-width: 620px) {
  .auth-hero { grid-template-columns: 1fr; min-height: 0; }
  .auth-intro { background-image: none; }
}
.print-sheet { display: none; }
.noscript-message { margin: 20px; }
@media (max-width: 1120px) {
  .home-workflows { grid-template-columns: minmax(0, 1.55fr) minmax(215px, 1fr); }
  .tool-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filter-search { grid-column: 1 / -1; }
  .filters > .button { grid-column: 1 / -1; justify-self: end; }
}
@media (max-width: 950px) {
  :root { --sidebar-width: 216px; }
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-layout { grid-template-columns: 1fr; }
  .home-workflows { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teaching-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teaching-link + .teaching-link { border-top: 0; border-left: 1px solid var(--line); }
  .welcome h1 { font-size: clamp(2.55rem, 5.3vw, 3.65rem); }
}
@media (max-width: 740px) {
  :root { --header-height: 59px; }
  .workspace-shell { display: block; }
  .workspace-header { justify-content: flex-start; padding-inline: 15px; gap: 10px; }
  .workspace-header-actions { margin-left: auto; }
  .workspace-search, .breadcrumb a, .breadcrumb svg { display: none; }
  .mobile-menu, .sidebar-close { display: inline-grid; }
  .sidebar { visibility: hidden; position: fixed; inset: 0 auto 0 0; width: min(265px, calc(100% - 52px)); }
  body.menu-open { overflow: hidden; }
  body.menu-open .sidebar { visibility: visible; }
  .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 2; background: #172e2580; border: 0; cursor: pointer; }
  .workspace-content { padding-inline: 15px; }
  .welcome { min-height: 204px; }
  .welcome-copy { width: 72%; padding: 21px 21px; }
  .welcome::before { width: 63%; background-position: 66% center; }
  .welcome::after { background: linear-gradient(90deg, #e6efde 33%, rgb(230 239 222 / 91%) 52%, rgb(230 239 222 / 10%) 76%, transparent); }
  .tool-card { padding: 14px; }
}
@media (max-width: 430px) {
  .welcome h1 { font-size: clamp(2.2rem, 8.8vw, 2.55rem); }
  .welcome-copy { width: 88%; }
  .welcome::before { width: 64%; opacity: .45; background-position: 56% center; }
  .welcome p { font-size: .91rem; }
  .home-section { margin-top: 25px; }
  .section-heading { align-items: flex-start; }
  .section-heading h2 { font-size: 1.28rem; }
  .section-heading .text-link { font-size: .8rem; text-align: right; }
  .tool-grid, .teaching-links { grid-template-columns: 1fr; gap: 8px; }
  .teaching-links { gap: 0; }
  .teaching-link + .teaching-link { border-top: 1px solid var(--line); border-left: 0; }
  .tool-card, .teaching-link { min-height: 74px; padding: 12px; }
  .resource-grid, .planner-layout, .planner-fields, .planner-lesson-fields { grid-template-columns: 1fr; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters > .button { justify-self: stretch; }
  .field-row { grid-template-columns: 1fr; }
}
@media print {
  @page { margin: 15mm; }
  body { color: #111; background: white; font: 11pt/1.45 system-ui, sans-serif; }
  body > :not(.print-sheet) { display: none !important; }
  .print-sheet { display: block; }
  .print-sheet h1 { margin-bottom: 12pt; font-size: 20pt; }
  .print-sheet p { white-space: pre-wrap; overflow-wrap: anywhere; }
}

.planner-curriculum { border: 1px solid var(--line, #d8d7e0); border-radius: 9px; padding: 10px 12px; }
.planner-curriculum summary { cursor: pointer; font-weight: 650; }
.planner-curriculum .field { margin-top: 10px; }
