:root {
  color-scheme: light;
  font-family: "DM Sans", sans-serif;
  color: #17202a;
  background: #f6f1e8;
  font-synthesis: none;
  --ink: #17202a;
  --cream: #f6f1e8;
  --orange: #ff6b35;
  --yellow: #ffd23f;
  --mint: #b8e3d1;
  --blue: #91c7e8;
  --pink: #f5a6b8;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; background: var(--cream); color: var(--ink); }
a { color: inherit; }
.announcement { background: var(--ink); color: var(--cream); padding: 11px 16px; text-align: center; font-size: .88rem; font-weight: 600; }
.page { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 76px; }
.site-header { display: flex; min-height: 94px; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-mark { display: grid; width: 46px; height: 46px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--orange); box-shadow: 4px 4px 0 var(--ink); font-family: Fraunces, serif; font-size: 1.45rem; font-weight: 800; }
.brand-copy { display: grid; gap: 3px; line-height: 1; }
.brand-copy strong { font-family: Fraunces, serif; font-size: 1.25rem; }
.brand-copy small { font-family: "DM Mono", monospace; font-size: .61rem; letter-spacing: .12em; }
.language-switch { display: flex; flex-wrap: wrap; gap: 4px; font-size: .9rem; font-weight: 700; }
.language-switch a { border: 2px solid transparent; padding: 8px 10px; text-decoration: none; }
.language-switch a:hover, .language-switch a[aria-current="page"] { border-color: var(--ink); background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
.hero { position: relative; display: flex; min-height: 300px; align-items: center; justify-content: space-between; gap: 32px; overflow: hidden; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); padding: 54px clamp(24px, 6vw, 76px); }
.grid-bg { background-image: linear-gradient(rgb(23 32 42 / 7%) 1px, transparent 1px), linear-gradient(90deg, rgb(23 32 42 / 7%) 1px, transparent 1px); background-size: 28px 28px; }
.hero-copy { max-width: 760px; }
.collection-badge { display: inline-flex; align-items: center; gap: 9px; transform: rotate(-2deg); border: 2px solid var(--ink); background: var(--mint); padding: 9px 14px; font-family: "DM Mono", monospace; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.collection-badge span { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 850px; margin: 24px 0 12px; font-family: Fraunces, Georgia, serif; font-size: clamp(2.8rem, 8vw, 5.5rem); font-weight: 800; letter-spacing: -.055em; line-height: .98; }
.intro { max-width: 650px; margin-bottom: 0; font-size: clamp(1.05rem, 2.2vw, 1.3rem); line-height: 1.55; }
.hero-note { display: grid; width: 126px; min-width: 126px; height: 126px; place-content: center; transform: rotate(5deg); border: 2px solid var(--ink); background: var(--blue); box-shadow: 7px 7px 0 var(--ink); text-align: center; }
.hero-note span { font-size: 2.6rem; line-height: 1; }
.hero-note small { font-family: "DM Mono", monospace; font-size: .6rem; letter-spacing: .08em; line-height: 1.4; }
.panel { margin-top: 46px; border: 2px solid var(--ink); background: var(--blue); padding: clamp(20px, 4vw, 34px); box-shadow: 7px 7px 0 var(--ink); }
h2 { margin-bottom: 20px; font-family: Fraunces, Georgia, serif; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; letter-spacing: -.025em; }
.material-form { display: grid; gap: 9px; }
label { font-size: .9rem; font-weight: 700; }
input, textarea, select { width: 100%; border: 2px solid var(--ink); border-radius: 0; background: white; color: var(--ink); font: inherit; padding: 11px 12px; }
input[type="file"] { background: #fff; padding: 8px; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--yellow); outline-offset: 2px; }
textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 4px 0 8px; }
.form-row > div { display: grid; gap: 9px; }
.locale-field { display: grid; gap: 9px; margin: 4px 0 8px; }
button { justify-self: start; transform: translate(0, 0); border: 2px solid var(--ink); border-radius: 0; background: var(--orange); box-shadow: 5px 5px 0 var(--ink); color: var(--ink); cursor: pointer; font: inherit; font-weight: 800; padding: 12px 18px; transition: transform .15s ease, box-shadow .15s ease; }
button:hover { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.error { margin: 0 0 8px; border: 2px solid var(--ink); background: var(--pink); padding: 11px 12px; }
.field-help { margin: -4px 0 8px; font-size: .84rem; }
.materials { margin-top: 44px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.add-material-panel { margin: 0 0 24px; }
.add-material-panel summary { display: inline-block; cursor: pointer; border: 2px solid var(--ink); background: var(--orange); box-shadow: 5px 5px 0 var(--ink); font-weight: 800; padding: 12px 18px; list-style: none; }
.add-material-panel summary::-webkit-details-marker { display: none; }
.add-material-panel summary::before { content: "+  "; }
.add-material-panel[open] summary::before { content: "−  "; }
.add-material-panel summary:hover { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.add-material-content { margin-top: 18px; border: 2px solid var(--ink); background: var(--blue); padding: clamp(20px, 4vw, 34px); box-shadow: 7px 7px 0 var(--ink); }
.add-material-content h3 { margin-bottom: 18px; font-family: Fraunces, Georgia, serif; font-size: 1.5rem; }
.count { font-family: "DM Mono", monospace; font-size: .78rem; text-transform: uppercase; }
.empty-state { border: 2px dashed var(--ink); background: rgb(255 255 255 / 42%); padding: 24px; text-align: center; }
.material-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.material-card { min-height: 180px; border: 2px solid var(--ink); background: white; padding: 20px; box-shadow: 5px 5px 0 var(--ink); }
.material-thumbnail { display: block; width: calc(100% + 40px); max-height: 190px; margin: -20px -20px 18px; border-bottom: 2px solid var(--ink); object-fit: cover; }
.material-card:nth-child(3n + 1) { background: #fffdf8; }
.material-card:nth-child(3n + 2) { background: #f9fcff; }
.material-card:nth-child(3n) { background: #f3fbf6; }
.material-topline { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.type, .status { border: 1.5px solid var(--ink); background: var(--yellow); font-family: "DM Mono", monospace; font-size: .68rem; padding: 4px 8px; text-transform: uppercase; }
.status-published { background: var(--mint); }
.material-card h3 { margin-bottom: 8px; font-family: Fraunces, Georgia, serif; font-size: 1.35rem; }
.material-card p { margin-bottom: 0; line-height: 1.5; }
.version-list { display: grid; gap: 6px; margin-top: 18px; border-top: 1.5px solid var(--ink); padding-top: 12px; }
.version-list h4 { margin: 0 0 2px; font-family: "DM Mono", monospace; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.version-link { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; color: var(--ink); font-size: .82rem; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.version-publication { margin: -2px 0 8px; font-size: .76rem !important; }
.available-locales { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 16px; font-family: "DM Mono", monospace; font-size: .68rem; }
.available-locales a { border: 1px solid var(--ink); background: var(--mint); padding: 3px 7px; text-decoration: none; }
.fallback-note { margin-top: 8px; font-family: "DM Mono", monospace; font-size: .72rem; }
.material-duration { margin-top: 10px; font-family: "DM Mono", monospace; font-size: .78rem; }
.material-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.material-tags span { padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font: .7rem "DM Mono", monospace; }
.translation-form { margin-top: 14px; border-top: 1px dashed var(--ink); padding-top: 12px; }
.translation-form summary { cursor: pointer; font-weight: 750; }
.translation-form .material-form { margin-top: 12px; }
.edit-localization { margin-top: 14px; border-top: 1px dashed var(--ink); padding-top: 12px; }
.edit-localization summary { cursor: pointer; font-weight: 750; }
.edit-localization .material-form { margin-top: 12px; }
.version-form { display: grid; gap: 8px; margin-top: 18px; border-top: 1px dashed var(--ink); padding-top: 14px; }
.version-form label { font-size: .8rem; }
.version-form input[type="file"] { font-size: .78rem; }
.version-form button { font-size: .82rem; }
.publish-form { margin: 12px 0; }
.publish-form label { display: block; margin-bottom: 6px; }
.publish-form textarea { margin-bottom: 10px; }
.publication-history { margin-top: 16px; border-top: 1px dashed var(--ink); padding-top: 12px; }
.publication-history h4 { margin: 0 0 8px; font-family: "DM Mono", monospace; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.publication-history p { margin: 0 0 8px; font-size: .82rem; }
.error-page { padding-top: 70px; }
.error-page h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); }
.back-link { display: inline-flex; margin-top: 22px; border: 2px solid var(--ink); background: var(--yellow); box-shadow: 4px 4px 0 var(--ink); font-weight: 800; padding: 10px 14px; text-decoration: none; }
.error-page .language-switch { margin-top: 24px; }

@media (max-width: 640px) {
  .page { width: min(100% - 28px, 1160px); }
  .site-header { min-height: 78px; gap: 10px; }
  .brand { gap: 10px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-copy strong { font-size: 1.05rem; }
  .brand-copy small { font-size: .52rem; }
  .language-switch { gap: 0; font-size: .8rem; }
  .language-switch a { padding: 7px; }
  .hero { min-height: 270px; padding: 38px 22px; }
  .hero-note { width: 76px; min-width: 76px; height: 88px; }
  .hero-note span { font-size: 1.8rem; }
  .hero-note small { font-size: .48rem; }
  .form-row { grid-template-columns: 1fr; }
  .panel { margin-top: 32px; }
}

@media (max-width: 430px) {
  .hero-note { display: none; }
}

.logs-nav { display: flex; align-items: center; gap: 14px; }
.logs-nav a { color: var(--ink); font-size: .8rem; text-decoration: none; }
.logs-nav a:hover { color: var(--green); text-decoration: underline; }
.logs-page { max-width: 1160px; }
.logs-hero { padding-bottom: 28px; }
.logs-panel-head { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:18px; }
.logs-panel-head h2 { margin:0; }
.logs-panel-head p { margin:8px 0 0; color:var(--muted); font-size:.8rem; }
.logs-panel-head code,.log-reference code { font: .78rem "DM Mono",monospace; color:var(--green); }
.logs-refresh,.log-reference a { color:var(--green); font-weight:700; }
.log-list { display:grid; gap:8px; }
.log-entry { border:1px solid var(--line); border-radius:8px; background:#fff; overflow:hidden; }
.log-entry summary { display:grid; grid-template-columns:170px minmax(130px,.6fr) minmax(110px,.4fr) minmax(180px,1fr); align-items:center; gap:10px; padding:12px 14px; cursor:pointer; list-style:none; }
.log-entry summary::-webkit-details-marker { display:none; }
.log-entry summary:hover { background:#f7f8f4; }
.log-entry time,.log-event,.log-code,.log-path { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.log-entry time,.log-code,.log-path { font: .7rem "DM Mono",monospace; color:var(--muted); }
.log-event { color:var(--green); font: .75rem "DM Mono",monospace; }
.log-entry pre { margin:0; padding:14px; max-height:420px; overflow:auto; background:#20211e; color:#e7eee8; font:.72rem/1.55 "DM Mono",monospace; white-space:pre-wrap; overflow-wrap:anywhere; }
.log-focused { border-color:var(--orange); box-shadow:0 0 0 2px #dc754d33; }
.logs-empty { padding:24px 0; color:var(--muted); }
.log-reference { padding:12px; border:1px solid var(--line); border-radius:8px; background:#fff; font-size:.85rem; }
@media(max-width:760px) { .log-entry summary { grid-template-columns:1fr 1fr; } .logs-nav { gap:8px; } }

.material-topline { align-items: center; flex-wrap: wrap; }
.material-availability { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.lti-toggle-form { margin: 0; }
button.lti-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--cream);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: "DM Mono", monospace;
  font-size: .68rem;
  line-height: 1.2;
}
button.lti-toggle[aria-checked="true"] { background: var(--mint); }
button.lti-toggle:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
button.lti-toggle:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.lti-toggle-track { display: inline-flex; align-items: center; width: 27px; height: 16px; padding: 2px; border: 1px solid var(--ink); border-radius: 10px; background: white; }
.lti-toggle-track span { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.lti-toggle[aria-checked="true"] .lti-toggle-track { justify-content: flex-end; }
.lti-toggle-state { font-weight: 400; }

.lti-toggle-form { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
button.lti-toggle:disabled { cursor: wait; opacity: .65; }
.lti-toggle-feedback { font-size: .75rem; max-width: 200px; }


.available-locales button.material-language {
  margin: 0;
  padding: 7px 10px;
  min-height: 34px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: white;
  box-shadow: none;
  font-family: "DM Sans", sans-serif;
  font-size: .78rem;
  font-weight: 600;
}
.available-locales button.material-language[aria-pressed="true"] { background: var(--mint); box-shadow: 2px 2px 0 var(--ink); }
.available-locales button.material-language:hover { background: var(--cream); transform: none; }
.available-locales button.material-language:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.available-locales button.material-language:disabled { opacity: .6; cursor: wait; }
.language-feedback { flex-basis: 100%; font-family: "DM Sans", sans-serif; }

.language-switch .logout-button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}
