:root {
  color-scheme: light;
  --ink: #1c2420;
  --muted: #737a74;
  --canvas: #f3f0e8;
  --paper: #fffdf8;
  --line: #e4ded2;
  --green: #1f6e59;
  --green-dark: #174c3f;
  --green-soft: #e4f0eb;
  --orange: #e7a05f;
  --danger: #ad4c3e;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
body { background: var(--canvas); color: var(--ink); margin: 0; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .18em; }

.login-shell { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(420px, .75fr); min-height: 100vh; }
.login-copy { background: #1f4137; color: white; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: 10vw; position: relative; }
.login-copy::after { background: rgba(238, 180, 116, .14); border-radius: 50%; content: ""; height: 560px; position: absolute; right: -240px; top: -220px; width: 560px; }
.login-copy .eyebrow { color: #a9d7c8; }
.login-copy h1 { font-family: Georgia, serif; font-size: clamp(52px, 6vw, 92px); font-weight: 500; letter-spacing: -.05em; line-height: 1.04; margin: 28px 0; }
.login-copy p { color: #bfd0ca; font-size: 18px; line-height: 1.8; max-width: 600px; }
.login-card { align-self: center; justify-self: center; max-width: 430px; padding: 50px; width: 100%; }
.logo { align-items: center; background: var(--green); border-radius: 18px; color: white; display: flex; font-family: Georgia, serif; font-size: 30px; height: 58px; justify-content: center; width: 58px; }
.login-card h2 { font-size: 32px; margin: 30px 0 8px; }
.login-card > p { color: var(--muted); margin: 0 0 30px; }
label { color: #505751; display: flex; flex-direction: column; font-size: 13px; font-weight: 650; gap: 8px; }
input, textarea, select { background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); outline: none; padding: 12px 13px; transition: border-color .15s, box-shadow .15s; width: 100%; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 110, 89, .1); }
.login-card form { display: grid; gap: 18px; }
.login-card button { margin-top: 8px; width: 100%; }
.error { color: var(--danger); font-size: 13px; min-height: 20px; }
.dev-note { color: var(--muted); font-size: 11px; line-height: 1.6; margin-top: 24px; }

button.primary, button.secondary, button.danger-outline { border: 0; border-radius: 10px; font-size: 13px; font-weight: 750; padding: 12px 18px; }
button.primary { background: var(--green); color: #fff; }
button.primary:hover { background: var(--green-dark); }
button.secondary { background: var(--green-soft); color: var(--green-dark); }
button.danger-outline { background: transparent; border: 1px solid #e2b9b2; color: var(--danger); }
button.full { width: 100%; }

.app-shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #20352f; color: white; display: flex; flex-direction: column; padding: 26px 18px; position: sticky; top: 0; height: 100vh; }
.brand { align-items: center; display: flex; gap: 12px; padding: 0 8px 34px; }
.brand > span { align-items: center; background: #f2c58e; border-radius: 11px; color: #25483d; display: flex; font-family: Georgia, serif; font-size: 23px; height: 42px; justify-content: center; width: 42px; }
.brand strong, .brand small { display: block; }
.brand small { color: #93aaa2; font-size: 10px; margin-top: 3px; }
nav { display: grid; gap: 7px; }
.nav-item { background: transparent; border: 0; border-radius: 10px; color: #a8bbb5; padding: 12px 14px; text-align: left; }
.nav-item.active { background: rgba(255,255,255,.09); color: white; font-weight: 700; }
.sidebar-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: auto; padding: 20px 8px 0; }
.current-user { color: #d9e3df; font-size: 12px; line-height: 1.6; }
.text-button { background: transparent; border: 0; color: #95aaa2; font-size: 12px; margin-top: 8px; padding: 0; }

.workspace { min-width: 0; padding: 28px 34px 60px; }
.topbar { align-items: center; display: flex; justify-content: space-between; }
.topbar h1 { font-size: 34px; margin: 5px 0 0; }
.top-actions { display: flex; gap: 10px; }
.metrics { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); margin: 24px 0; }
.metric { background: var(--paper); border: 1px solid rgba(45, 50, 45, .07); border-radius: 14px; padding: 18px; }
.metric strong { display: block; font-size: 26px; }
.metric span { color: var(--muted); font-size: 11px; }

.content-layout { align-items: start; display: grid; gap: 18px; grid-template-columns: 300px minmax(0, 1fr); }
.catalog-panel, .editor, .empty-editor, .audit-panel { background: var(--paper); border: 1px solid rgba(45, 50, 45, .07); border-radius: 16px; box-shadow: 0 10px 30px rgba(43, 39, 30, .04); }
.catalog-panel { max-height: calc(100vh - 185px); overflow: auto; padding: 18px; position: sticky; top: 20px; }
.panel-title { align-items: center; display: flex; justify-content: space-between; }
.panel-title span { color: var(--muted); font-size: 10px; }
.search { background: #f4f1ea; border: 0; margin: 15px 0; }
.scene-group { margin-top: 17px; }
.scene-group-title { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 0 8px 7px; text-transform: uppercase; }
.lesson-item { border: 0; border-radius: 10px; cursor: pointer; display: block; margin: 4px 0; padding: 11px 10px; width: 100%; }
.lesson-item:hover, .lesson-item.active { background: var(--green-soft); }
.lesson-item strong { display: block; font-size: 13px; }
.lesson-item small { color: var(--muted); display: flex; font-size: 10px; justify-content: space-between; margin-top: 5px; }
.empty-editor { color: var(--muted); padding: 140px 40px; text-align: center; }
.empty-editor > div { color: var(--green); font-size: 58px; }
.empty-editor h2 { color: var(--ink); }
.empty-editor p { font-size: 13px; }

.editor { overflow: hidden; }
.editor-head { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 22px 26px; }
.editor-head h2 { font-size: 22px; margin: 7px 0 0; }
.editor-actions { display: flex; gap: 8px; }
.badge { background: #eeeae2; border-radius: 99px; color: var(--muted); font-size: 10px; font-weight: 750; padding: 6px 10px; }
.badge.awaiting_review { background: #fff0db; color: #9b5d28; }
.badge.published { background: var(--green-soft); color: var(--green); }
.badge.offline { background: #f5e5e2; color: var(--danger); }
.form-section { padding: 26px; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.section-heading { align-items: flex-start; display: flex; justify-content: space-between; margin-bottom: 22px; }
.section-heading > div { align-items: center; display: flex; gap: 10px; }
.section-heading span { color: var(--orange); font-size: 11px; font-weight: 800; }
.section-heading h3 { margin: 0; }
.section-heading p { color: var(--muted); font-size: 11px; margin: 3px 0 0; }
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-grid .wide { grid-column: 1 / -1; }
textarea { line-height: 1.55; resize: vertical; }

.sentence-editor-list { display: grid; gap: 16px; }
.sentence-editor { background: #f7f4ed; border: 1px solid #ebe5da; border-radius: 13px; padding: 18px; }
.sentence-head { align-items: center; display: flex; justify-content: space-between; margin-bottom: 15px; }
.sentence-head strong { font-size: 14px; }
.remove-sentence { background: transparent; border: 0; color: var(--danger); font-size: 11px; }
.audio-field { display: flex; gap: 7px; }
.audio-field input[type=file] { font-size: 9px; max-width: 125px; padding: 9px 5px; }
.save-bar { align-items: center; background: #f6f2e9; border-top: 1px solid var(--line); bottom: 0; display: flex; justify-content: space-between; padding: 16px 26px; position: sticky; }
.save-message { color: var(--muted); font-size: 11px; }

.audit-panel { overflow: hidden; padding: 24px; }
.audit-head { align-items: center; display: flex; justify-content: space-between; }
.audit-head h2 { margin: 0; }
.audit-head p { color: var(--muted); font-size: 12px; }
table { border-collapse: collapse; margin-top: 24px; width: 100%; }
th, td { border-bottom: 1px solid var(--line); font-size: 12px; padding: 13px 10px; text-align: left; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.toast { background: #20352f; border-radius: 10px; bottom: 30px; color: white; left: 50%; opacity: 0; padding: 12px 18px; pointer-events: none; position: fixed; transform: translate(-50%, 20px); transition: .2s; z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 78px minmax(0, 1fr); }
  .brand div, .nav-item { font-size: 0; }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .content-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .metrics { grid-template-columns: 1fr 1fr; }
}

