:root {
  --ink: #1b1b19;
  --muted: #67655f;
  --paper: #fbfaf6;
  --line: #e8e4db;
  --cream: #f2efe4;
  --sage: #dce8dc;
  --green: #255b43;
  --orange: #e36a36;
  --shadow: 0 18px 45px rgba(40, 36, 28, .08);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: ui-rounded, "Hiragino Maru Gothic ProN", "Noto Sans JP", system-ui, sans-serif; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.site-header { height: 76px; padding: 0 max(24px, calc((100vw - 1140px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: rgba(251,250,246,.92); position: sticky; top: 0; z-index: 3; backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 210px; }
.brand-mark { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: white; background: var(--green); font-size: 20px; font-weight: 800; }
.brand strong, .brand small { display: block; line-height: 1.15; }.brand small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.view-switch { border: 1px solid var(--line); background: white; padding: 3px; border-radius: 999px; display: flex; gap: 2px; }.view-switch button, .language-toggle { border: 0; background: transparent; border-radius: 999px; padding: 8px 14px; color: var(--muted); font-size: 13px; }.view-switch button.active { background: var(--ink); color: white; }.language-toggle { border: 1px solid var(--line); background: white; color: var(--ink); }
main { max-width: 1140px; margin: 0 auto; padding: 48px 24px 90px; }.view { display: none; }.view.active { display: block; }.hero { min-height: 235px; padding: 42px; background: linear-gradient(115deg, #e8eee1 0%, #f6f1df 100%); border-radius: 28px; display: flex; justify-content: space-between; align-items: end; gap: 30px; }.eyebrow { color: var(--orange); font-size: 12px; font-weight: 800; letter-spacing: .11em; margin: 0 0 10px; }.hero h1, .teacher-intro h1 { margin: 0; font-size: clamp(34px, 5vw, 58px); line-height: 1.12; letter-spacing: -.04em; }.hero-copy { max-width: 590px; margin: 14px 0 0; color: var(--muted); }.streak-card { width: 240px; padding: 19px; background: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.9); border-radius: 18px; }.streak-card span { color: var(--muted); display:block; font-size: 12px; }.streak-card strong { display:block; margin: 4px 0 13px; font-size: 14px; }.progress { height: 7px; background: #e5e5dc; border-radius: 99px; overflow: hidden; }.progress i { height: 100%; width: 0%; display:block; background: var(--orange); border-radius: inherit; transition: width .3s; }
.lesson-section { padding-top: 56px; }.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 20px; }.section-heading > div { display: flex; align-items: center; gap: 10px; }.section-heading h2, .homework-card h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; }.section-heading p { margin: 0; max-width: 390px; color: var(--muted); font-size: 14px; }.section-number { color: var(--orange); font-size: 12px; letter-spacing: .1em; font-weight: 800; }.expression-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }.expression-card, .grammar-card, .quiz-card { background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 4px 18px rgba(30,25,18,.025); }.expression-card { padding: 23px; }.expression-card .korean { display: block; font-weight: 800; font-size: 21px; letter-spacing: -.02em; }.expression-card .japanese { color: var(--muted); margin-top: 5px; }.expression-card .tip { margin: 17px 0 0; padding-top: 13px; border-top: 1px solid var(--line); color: var(--green); font-size: 13px; }.grammar-section { margin-top: 10px; }.grammar-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }.grammar-card { padding: 24px; background: #f7f9f4; }.grammar-card h3 { margin: 0; font-size: 20px; }.grammar-card p { margin: 8px 0 14px; color: var(--muted); font-size: 14px; }.example { padding: 13px; background: white; border-radius: 11px; font-size: 14px; }.example strong { display:block; }.example span { color: var(--muted); }.quiz-list { display: grid; gap: 15px; }.quiz-card { padding: 24px; }.quiz-card h3 { margin: 0 0 16px; font-size: 17px; }.options { display: grid; gap: 8px; }.option { text-align: left; padding: 12px 15px; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; transition: .15s; }.option:hover { border-color: var(--green); }.option.correct { background: #e4f0e5; border-color: #6eaa78; }.option.wrong { background: #fff0ec; border-color: #e39577; }.explanation { margin: 14px 0 0; color: var(--muted); font-size: 14px; }.homework-card { margin-top: 56px; padding: 28px; border-radius: 20px; background: var(--ink); color: white; display: flex; justify-content: space-between; gap: 25px; align-items: center; }.homework-card .section-number { color: #f5a578; }.homework-card p { margin: 8px 0 0; color: #dddcd6; }.check-control { min-width: max-content; display: flex; align-items: center; gap: 9px; padding: 10px 14px; background: rgba(255,255,255,.12); border-radius: 10px; }.check-control input { accent-color: var(--orange); }
.notice { margin-top: 18px; border-left: 4px solid var(--orange); padding: 12px 15px; background: #fff3df; color: #6f451f; font-size: 14px; }.hidden { display: none !important; }
.connection-status { margin: 15px 0 0; color: var(--muted); font-size: 13px; }.connection-status.ready { color: var(--green); }
.teacher-view { max-width: 900px; margin: 0 auto; }.teacher-intro { text-align: center; margin: 25px auto 36px; }.teacher-intro h1 { font-size: clamp(32px, 4.5vw, 52px); }.teacher-intro > p:last-child { max-width: 620px; color: var(--muted); margin: 16px auto 0; }.privacy-note { display: flex; gap: 12px; padding: 15px 17px; margin-bottom: 20px; background: #fff2e9; border-radius: 13px; color: #6b4324; font-size: 13px; }.privacy-note strong { white-space: nowrap; }.lesson-form { display: grid; gap: 20px; }.upload-zone { min-height: 220px; border: 1.5px dashed #bcb6aa; border-radius: 19px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; background: white; cursor: pointer; }.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; }.upload-zone strong { margin-top: 8px; }.upload-zone small { color: var(--muted); margin-top: 2px; }.upload-icon { width: 42px; height: 42px; display:grid; place-items:center; border-radius: 50%; background: var(--sage); color: var(--green); font-size: 24px; }.upload-zone img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; background:white; z-index:2; }.form-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }.form-fields label { font-size: 13px; font-weight: 700; }.form-fields input, .form-fields select, .form-fields textarea { display: block; width:100%; margin-top: 6px; padding: 11px 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; outline-color: var(--green); background: white; font-weight: 400; }.form-fields .wide { grid-column: 1 / -1; }.primary-button { border: 0; border-radius: 13px; padding: 15px 20px; color: white; background: var(--green); display:flex; justify-content:center; align-items:center; gap:9px; font-weight:800; }.primary-button:disabled { opacity:.6; cursor: wait; }.primary-button small { padding: 2px 7px; background: rgba(255,255,255,.15); border-radius: 5px; font-weight:500; }.generation-status { min-height: 20px; text-align:center; margin: -7px 0 0; color: var(--muted); font-size: 13px; }.share-panel { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:18px; margin-top:20px; border:1px solid #b9d5bc; border-radius:14px; background:#eff8ef; }.share-panel strong,.share-panel span { display:block; }.share-panel span { font-size:13px; color:var(--muted); margin-top:3px; }.secondary-button { border:1px solid var(--green); padding:9px 13px; background:white; color:var(--green); border-radius:9px; white-space:nowrap; font-weight:700; }
@media (max-width: 680px) { .site-header { height:auto; padding:13px 18px; flex-wrap:wrap; }.brand { min-width:0; }.view-switch { order:3; width:100%; justify-content:center; }.hero { padding:27px; display:block; }.streak-card { width:auto; margin-top:25px; }.expression-grid,.grammar-grid,.form-fields { grid-template-columns:1fr; }.section-heading,.homework-card,.share-panel { align-items:flex-start; flex-direction:column; }.section-heading p { max-width:none; }.teacher-intro { text-align:left; }.form-fields .wide { grid-column:auto; } }

/* iOS-inspired surface for the student-facing app */
:root { --paper:#f2f2f7; --ink:#1c1c1e; --muted:#6e6e73; --line:#e5e5ea; --green:#087f5b; --orange:#ff8a3d; --shadow:0 14px 38px rgba(60,58,70,.09); }
body { background:var(--paper); color:var(--ink); }
.site-header { background:rgba(242,242,247,.84); border-bottom-color:rgba(60,60,67,.12); box-shadow:0 1px 0 rgba(255,255,255,.75); }
.brand-mark { border-radius:13px; background:linear-gradient(145deg,#178a69,#07573f); box-shadow:0 7px 15px rgba(8,127,91,.22); }
.view-switch { background:#e5e5ea; border-color:rgba(60,60,67,.08); }
.view-switch button { transition:background .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease; }
.view-switch button.active { background:#fff; color:var(--ink); box-shadow:0 2px 8px rgba(60,60,67,.13); }
.view-switch button:active { transform:scale(.97); }
.language-toggle { border-color:rgba(60,60,67,.12); box-shadow:0 2px 7px rgba(60,60,67,.06); }
.hero { background:linear-gradient(135deg,#e4f4ec 0%,#edf4ff 100%); border:1px solid rgba(255,255,255,.8); box-shadow:var(--shadow); }
.streak-card { box-shadow:0 8px 20px rgba(40,80,70,.07); }
.expression-card,.grammar-card,.quiz-card { border-color:rgba(60,60,67,.12); border-radius:22px; box-shadow:0 5px 18px rgba(60,60,67,.05); transition:transform .2s ease, box-shadow .2s ease; }
.expression-card:hover,.grammar-card:hover,.quiz-card:hover,.ios-card:hover { transform:translateY(-2px); box-shadow:var(--shadow); }
.option { border-color:rgba(60,60,67,.14); background:#f8f8fa; }
.homework-card { box-shadow:var(--shadow); }
.section-hero { min-height:280px; padding:42px; border-radius:30px; display:flex; align-items:center; justify-content:space-between; gap:24px; color:var(--ink); background:linear-gradient(135deg,#fff 0%,#e7f3ff 100%); border:1px solid rgba(255,255,255,.9); box-shadow:var(--shadow); }
.section-hero h1 { margin:0; font-size:clamp(34px,5vw,58px); line-height:1.12; letter-spacing:-.05em; }
.section-hero p:last-child { max-width:560px; color:var(--muted); margin:16px 0 0; }
.hero-orb { width:104px; height:104px; flex:0 0 auto; display:grid; place-items:center; border-radius:34px; color:#fff; background:linear-gradient(145deg,#0c8a66,#07543f); font-size:55px; font-weight:800; transform:rotate(7deg); box-shadow:0 18px 30px rgba(8,127,91,.22); }
.level-pills { display:flex; flex-wrap:wrap; gap:9px; margin:20px 0; }
.level-pills span { padding:8px 12px; color:#3c3c43; background:#fff; border:1px solid rgba(60,60,67,.11); border-radius:999px; font-size:13px; box-shadow:0 3px 10px rgba(60,60,67,.04); }
.textbook-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; }
.ios-card { display:flex; align-items:center; gap:14px; min-height:126px; padding:20px; background:#fff; border:1px solid rgba(60,60,67,.1); border-radius:23px; box-shadow:0 5px 18px rgba(60,60,67,.05); transition:transform .2s ease, box-shadow .2s ease; }
.ios-card h2 { margin:3px 0 4px; font-size:20px; letter-spacing:-.03em; }
.ios-card p { margin:0; color:var(--muted); font-size:14px; }
.card-kicker { color:var(--orange); font-size:11px; font-weight:800; letter-spacing:.08em; }
.card-icon { width:42px; height:42px; flex:0 0 auto; display:grid; place-items:center; border-radius:13px; color:#fff; font-weight:800; }
.green-icon { background:#0a8b65; }.orange-icon { background:#ff8a3d; }.arrow { margin-left:auto; color:#8e8e93; font-size:27px; font-weight:300; }
.empty-note { display:flex; flex-direction:column; gap:4px; margin-top:18px; padding:16px 18px; color:#515158; background:rgba(255,255,255,.62); border:1px solid rgba(60,60,67,.1); border-radius:17px; }
.empty-note span { color:var(--muted); font-size:13px; }
.shorts-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:18px 0 28px; }
.shorts-heading h1 { margin:0; font-size:clamp(35px,5vw,58px); letter-spacing:-.05em; }.shorts-heading p:last-child { margin:10px 0 0; color:var(--muted); }
.shorts-mark { width:86px; height:86px; display:grid; place-items:center; border-radius:28px; color:#fff; background:linear-gradient(145deg,#ff6f61,#ff9f43); font-size:30px; box-shadow:0 17px 28px rgba(255,111,97,.2); }
.shorts-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; }
.short-card { overflow:hidden; background:#fff; border:1px solid rgba(60,60,67,.1); border-radius:22px; box-shadow:0 5px 18px rgba(60,60,67,.05); }
.short-placeholder { height:190px; padding:18px; display:flex; flex-direction:column; justify-content:flex-end; gap:2px; color:#fff; background:linear-gradient(155deg,#0c8a66,#1ac59a); }.short-placeholder.warm { background:linear-gradient(155deg,#e65f42,#ffaf49); }.short-placeholder.blue { background:linear-gradient(155deg,#3565c6,#77a9ff); }
.short-placeholder span { opacity:.8; font-size:12px; }.short-placeholder strong { font-size:25px; letter-spacing:-.04em; }.short-meta { display:flex; justify-content:space-between; padding:14px 16px; color:var(--muted); font-size:13px; }.short-meta b { color:var(--ink); }
.connection-status { padding-left:2px; }.connection-status.ready { font-weight:700; }
.textbook-match { margin-top:22px; padding:18px; background:rgba(255,255,255,.75); border:1px solid rgba(60,60,67,.1); border-radius:20px; box-shadow:0 5px 18px rgba(60,60,67,.04); }
.textbook-match-heading { display:flex; align-items:center; gap:9px; margin-bottom:12px; }.textbook-match-heading strong { font-size:16px; }.textbook-match-heading span:last-child { margin-left:auto; color:var(--muted); font-size:12px; }
.textbook-match-card { display:grid; grid-template-columns:1fr auto; gap:3px 12px; padding:13px 0; border-top:1px solid rgba(60,60,67,.09); }.textbook-match-card:first-of-type { border-top:0; }.textbook-match-card b,.textbook-match-card span { display:block; }.textbook-match-card span { margin-top:2px; color:var(--muted); font-size:12px; }.textbook-match-card em { align-self:start; padding:3px 7px; color:var(--green); background:#e5f5ee; border-radius:999px; font-size:11px; font-style:normal; }.textbook-match-card p { grid-column:1 / -1; margin:5px 0 0; color:var(--muted); font-size:13px; }
@media (max-width:680px) { .section-hero { min-height:240px; padding:27px; align-items:flex-start; }.hero-orb { width:72px; height:72px; border-radius:24px; font-size:38px; }.textbook-grid,.shorts-grid { grid-template-columns:1fr; }.shorts-heading { align-items:flex-start; }.shorts-mark { width:66px; height:66px; border-radius:22px; font-size:24px; }.short-placeholder { height:150px; } }

/* Lightweight iOS-style navigation: native View Transitions when available,
   with the same direction-aware fallback on older mobile browsers. */
main { view-transition-name: main; }
::view-transition-old(main),
::view-transition-new(main) {
  animation-duration: .32s;
  animation-timing-function: cubic-bezier(.22, .61, .36, 1);
}
::view-transition-old(main) { animation-name: view-fade-out; }
::view-transition-new(main) { animation-name: view-fade-in; }
html[data-navigation="back"] ::view-transition-new(main) { animation-name: view-fade-in-back; }
html[data-navigation="back"] ::view-transition-old(main) { animation-name: view-fade-out-back; }
@keyframes view-fade-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
@keyframes view-fade-out { from { opacity: 1; } to { opacity: 0; transform: translateX(-10px); } }
@keyframes view-fade-in-back { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: translateX(0); } }
@keyframes view-fade-out-back { from { opacity: 1; } to { opacity: 0; transform: translateX(10px); } }
html:not([data-navigation]) .view.active,
html[data-navigation="forward"] .view.active { animation: view-fallback-forward .32s cubic-bezier(.22, .61, .36, 1); }
html[data-navigation="back"] .view.active { animation: view-fallback-back .32s cubic-bezier(.22, .61, .36, 1); }
@keyframes view-fallback-forward { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }
@keyframes view-fallback-back { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: translateX(0); } }

@media (max-width:680px) {
  .site-header { padding-bottom: 88px; }
  .view-switch {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 20;
    width: auto;
    order: 0;
    justify-content: space-around;
    padding: 6px;
    border: 1px solid rgba(60, 60, 67, .12);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(18px) saturate(1.3);
    box-shadow: 0 12px 28px rgba(60, 60, 67, .16);
  }
  .view-switch button { flex: 1; min-width: 0; padding: 8px 4px; font-size: 11px; }
  .view-switch button::before { display: block; margin-bottom: 2px; color: #8e8e93; font-size: 16px; line-height: 1; }
  .view-switch button[data-view="student"]::before { content: "⌂"; }
  .view-switch button[data-view="teacher"]::before { content: "＋"; }
  .view-switch button[data-view="textbook"]::before { content: "▤"; }
  .view-switch button[data-view="shorts"]::before { content: "▶"; }
  .view-switch button.active::before { color: var(--green); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Apple-platform typography: use the device's native typeface for each script.
   The fallbacks keep the same feel on non-Apple browsers. */
html,
body,
button,
input,
select,
textarea {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

html:lang(ko) body,
html:lang(ko) button,
html:lang(ko) input,
html:lang(ko) select,
html:lang(ko) textarea {
  font-family: "Apple SD Gothic Neo", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

html:lang(ja) body,
html:lang(ja) button,
html:lang(ja) input,
html:lang(ja) select,
html:lang(ja) textarea {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

/* Premium Apple-like light surface: quiet neutrals, one calm accent, and
   translucent layers instead of many competing colors. */
:root {
  --paper: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, .14);
  --surface: rgba(255, 255, 255, .92);
  --surface-soft: rgba(255, 255, 255, .68);
  --green: #087f69;
  --orange: #a97943;
  --shadow: 0 20px 48px rgba(28, 35, 44, .085);
}

body {
  background:
    radial-gradient(circle at 88% -8%, rgba(180, 207, 223, .34), transparent 33%),
    radial-gradient(circle at -8% 32%, rgba(220, 211, 194, .2), transparent 34%),
    linear-gradient(180deg, #f8f9fb 0%, #f3f4f6 48%, #eef0f3 100%);
  color: var(--ink);
}

.site-header {
  background: rgba(248, 249, 251, .78);
  border-bottom-color: rgba(60, 60, 67, .12);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .88);
}

.brand-mark {
  background: linear-gradient(145deg, #16866f, #064d3d);
  box-shadow: 0 9px 22px rgba(8, 127, 105, .2);
}

.view-switch {
  background: rgba(229, 229, 234, .76);
  border-color: rgba(60, 60, 67, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .76);
}

.language-toggle {
  background: rgba(255, 255, 255, .76);
  border-color: rgba(60, 60, 67, .13);
}

.hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, .96) 0%, rgba(234, 245, 242, .92) 55%, rgba(235, 241, 249, .94) 100%);
  border-color: rgba(255, 255, 255, .95);
  box-shadow: var(--shadow);
}

.hero-copy,
.section-heading p,
.section-hero p:last-child,
.teacher-intro > p:last-child,
.shorts-heading p:last-child {
  color: #68686d;
}

.eyebrow,
.section-number,
.card-kicker {
  color: var(--orange);
}

.streak-card,
.expression-card,
.grammar-card,
.quiz-card,
.ios-card,
.short-card,
.upload-zone,
.form-fields input,
.form-fields select,
.form-fields textarea {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 8px 24px rgba(35, 42, 52, .045);
}

.expression-card:hover,
.grammar-card:hover,
.quiz-card:hover,
.ios-card:hover {
  box-shadow: 0 22px 46px rgba(35, 42, 52, .11);
}

.grammar-card {
  background: linear-gradient(145deg, rgba(245, 251, 248, .96), rgba(239, 247, 247, .86));
}

.option {
  background: rgba(246, 246, 248, .9);
  border-color: rgba(60, 60, 67, .14);
}

.option:hover {
  border-color: rgba(8, 127, 105, .58);
  background: #fff;
}

.homework-card {
  background: linear-gradient(145deg, #202b35, #17211f);
  box-shadow: 0 24px 48px rgba(22, 33, 37, .16);
}

.homework-card .section-number {
  color: #c5a77d;
}

.primary-button {
  background: linear-gradient(145deg, #0b866d, #05634f);
  box-shadow: 0 12px 22px rgba(8, 127, 105, .18);
}

.secondary-button {
  background: rgba(255, 255, 255, .78);
  border-color: rgba(8, 127, 105, .5);
}

.section-hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(237, 244, 248, .96) 62%, rgba(235, 244, 241, .94));
  border-color: rgba(255, 255, 255, .95);
  box-shadow: var(--shadow);
}

.hero-orb {
  background: linear-gradient(145deg, #128a70, #064f3e);
  box-shadow: 0 20px 34px rgba(8, 127, 105, .22);
}

.level-pills span,
.empty-note,
.textbook-match {
  background: var(--surface-soft);
  border-color: var(--line);
}

.green-icon {
  background: linear-gradient(145deg, #0c9275, #08634e);
}

.orange-icon {
  background: linear-gradient(145deg, #c4945c, #8f6235);
}

.shorts-mark {
  background: linear-gradient(145deg, #a87945, #704829);
  box-shadow: 0 18px 32px rgba(142, 98, 53, .2);
}

.short-placeholder {
  background: linear-gradient(155deg, #0d8269, #13534b);
}

.short-placeholder.warm {
  background: linear-gradient(155deg, #b2834e, #76512f);
}

.short-placeholder.blue {
  background: linear-gradient(155deg, #526d9b, #334a70);
}

.privacy-note {
  background: rgba(255, 247, 237, .86);
  color: #6f5030;
  border: 1px solid rgba(169, 121, 67, .16);
}

.generation-status.ready {
  color: var(--green);
  font-weight: 700;
}

.connection-status.ready {
  color: #087f69;
}

@media (max-width: 680px) {
  .view-switch {
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 14px 32px rgba(43, 47, 56, .15), inset 0 1px 0 rgba(255, 255, 255, .9);
  }
}

.homework-card {
  position: relative;
  overflow: hidden;
}

.homework-card.celebrating {
  animation: homework-celebration 620ms var(--ease-out, cubic-bezier(.23, 1, .32, 1));
}

.celebration-burst {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.celebration-burst i {
  position: absolute;
  display: block;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(244, 228, 189, .45);
  transform: translate(-50%, -50%);
}

@keyframes homework-celebration {
  0% { box-shadow: 0 24px 48px rgba(22, 33, 37, .16); }
  35% { box-shadow: 0 24px 55px rgba(8, 127, 105, .21), 0 0 0 1px rgba(214, 180, 119, .2); }
  100% { box-shadow: 0 24px 48px rgba(22, 33, 37, .16); }
}

@media (prefers-reduced-motion: reduce) {
  .homework-card.celebrating { animation: homework-celebration 180ms ease-out; }
  .celebration-burst { display: none; }
}

/* The daily goal settles into a calm accent once every task is complete. */
.progress i {
  background: #0a84ff;
  transition: width .3s ease, background .45s ease, box-shadow .45s ease;
}

.streak-card.is-complete {
  border-color: rgba(48, 209, 88, .24);
  box-shadow: 0 10px 28px rgba(48, 209, 88, .14), 0 0 0 1px rgba(48, 209, 88, .08);
}

.streak-card.is-complete .progress {
  background: #e5e5ea;
}

.streak-card.is-complete .progress i {
  background: #30d158;
  box-shadow: 0 0 12px rgba(48, 209, 88, .28);
}

/* Keep the daily goal available while the learner works through the lesson. */
.streak-card.is-floating {
  position: fixed;
  top: var(--goal-top, 88px);
  right: max(24px, calc((100vw - 1140px) / 2));
  z-index: 4;
  width: 240px;
  margin: 0;
  animation: goal-dock-in 240ms cubic-bezier(.22, .61, .36, 1);
}

@keyframes goal-dock-in {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 680px) {
  .streak-card.is-floating {
    top: var(--goal-top, 156px);
    right: 12px;
    left: 12px;
    width: auto;
    padding: 14px 16px;
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .streak-card.is-floating { animation: none; }
}

.auth-card,
.saved-lessons {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(60, 60, 67, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 8px 24px rgba(35, 42, 52, .045);
}

.auth-copy strong,
.auth-copy p {
  display: block;
}

.auth-copy strong {
  margin-top: 4px;
  font-size: 16px;
}

.auth-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-area {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-top: 15px;
}

.auth-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 1;
}

.auth-fields label {
  color: var(--muted);
  font-size: 12px;
}

.auth-fields input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  outline-color: var(--green);
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.text-button {
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.auth-user-label {
  flex: 1;
  margin: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.auth-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.saved-lessons .section-heading {
  margin-bottom: 12px;
}

.saved-lessons-list {
  display: grid;
  gap: 8px;
}

.saved-lesson {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  text-align: left;
}

.saved-lesson span {
  font-weight: 700;
}

.saved-lesson small {
  color: var(--muted);
  font-size: 12px;
}

.saved-lesson:hover {
  border-color: rgba(8, 127, 105, .42);
  background: #fff;
}

@media (max-width: 680px) {
  .auth-area,
  .auth-fields {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .auth-actions {
    justify-content: space-between;
  }
}
