:root {
  color-scheme: light;
  --paper: #f7f8f5;
  --card: #fff;
  --ink: #202e2a;
  --muted: #617069;
  --line: #dce3dc;
  --green: #205c48;
  --green-dark: #173e33;
  --pale: #eaf2e9;
  --warm: #fbf6e7;
  --radius: 15px;
  font:
    15px/1.55 "Pretendard",
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
textarea,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.52;
}
button {
  color: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--green);
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #d0a349;
  outline-offset: 3px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #408465;
  outline-offset: 1px;
}
img {
  max-width: 100%;
}
svg {
  flex: none;
  vertical-align: middle;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1,
h2,
h3,
h4 {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
h1 {
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.22;
  letter-spacing: -0.075em;
  font-weight: 750;
}
h2 {
  font-size: 23px;
  letter-spacing: -0.06em;
}
h3 {
  font-size: 17px;
  letter-spacing: -0.048em;
}
h4 {
  font-size: 15px;
}
p {
  overflow-wrap: anywhere;
}
small {
  color: var(--muted);
}
button svg,
a svg {
  pointer-events: none;
}
.sr,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  background: white;
  padding: 8px;
}
.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
}
.side {
  position: sticky;
  top: 0;
  height: 100dvh;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  padding: 32px 18px 20px;
  background: #fbfcf9;
  border-right: 1px solid var(--line);
}
.brand-link {
  padding: 0 12px;
  margin-bottom: 53px;
  align-self: flex-start;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 1;
}
.brand b {
  font-size: 25px;
  letter-spacing: -0.09em;
  font-weight: 800;
}
.brand img {
  width: 37px;
  height: 37px;
}
.side nav {
  display: grid;
  gap: 6px;
}
.nav-link,
.side-recent a,
.side-foot {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-link {
  height: 47px;
  padding: 0 15px;
  border-radius: 9px;
  font-weight: 610;
  color: #56645c;
}
.nav-link.current {
  color: #27563f;
  background: #e5eee1;
}
.nav-link:hover,
.side-recent a:hover {
  background: #edf2e9;
}
.side-recent {
  border-top: 1px solid var(--line);
  margin-top: 27px;
  padding: 23px 9px 0;
}
.side-recent h2 {
  font-size: 12px;
  color: #657366;
  letter-spacing: 0;
  margin: 0 5px 10px;
}
.side-recent a {
  min-height: 36px;
  border-radius: 6px;
  padding: 6px;
  font-size: 13px;
  color: #515f56;
  min-width: 0;
  gap: 9px;
}
.side-recent span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-recent a[aria-current] {
  color: var(--green);
  font-weight: 700;
}
.side-foot {
  margin-top: auto;
  padding: 18px 10px 1px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: #5c695e;
}
.workspace {
  min-width: 0;
}
.top {
  height: 64px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 4.3vw, 74px);
  background: rgba(255, 255, 255, 0.64);
}
.crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #67756c;
}
.crumb b,
.crumb a {
  font-weight: 630;
  color: #40554a;
}
.top-settings,
.top .mobile-brand,
.mobile-brand,
.mobile-tabs {
  display: none;
}
.page {
  max-width: 1330px;
  margin: 0 auto;
  padding: clamp(32px, 4vw, 62px) clamp(22px, 4.3vw, 74px) 64px;
}
.heading-row,
.section-head,
.material-top,
.mat-bottom,
.panel-head,
.composer-tools,
.dialog-head,
.dialog-actions,
.setting-row,
.toggle-row,
.result-row,
.source-info,
.device-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.subtitle {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: -0.025em;
}
.btn,
.icon-btn,
.send-btn,
.chip,
.mode,
.mobile-tab,
.talk-tab,
.text-btn,
.mic-btn,
.voice-btn,
.citation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  background: none;
  line-height: 1.35;
}
.btn {
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid #cbd6ce;
  background: white;
  border-radius: 8px;
  font-weight: 650;
  font-size: 14px;
  white-space: normal;
}
.btn:hover {
  background: #f1f5ee;
  color: var(--green);
}
.btn.primary,
.send-btn {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.btn.primary:hover,
.send-btn:hover {
  background: #194836;
  color: white;
}
.btn.cream {
  background: #faf8e9;
  color: #244433;
  border-color: transparent;
  min-height: 43px;
  padding: 10px 19px;
}
.btn.cream:hover {
  background: white;
}
.btn.subtle {
  background: transparent;
  color: var(--green);
  border-color: #c6d5c7;
}
.btn.small {
  font-size: 12px;
  min-height: 34px;
  padding: 6px 10px;
}
.btn.wide {
  width: 100%;
}
.icon-btn {
  width: 38px;
  height: 38px;
  flex: none;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.icon-btn:hover {
  background: #eaf1e9;
}
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 250px;
  display: flex;
  align-items: center;
  margin-top: 29px;
  border: 1px solid #214b3e;
  border-radius: 17px;
  background:
    radial-gradient(ellipse at 88% 110%, #446a4d 0%, transparent 49%),
    linear-gradient(100deg, #193f35 8%, #28503e 80%);
  color: #fffcf0;
}
.hero-copy {
  padding: 25px clamp(24px, 3.3vw, 55px);
  position: relative;
  z-index: 2;
}
.hero-mark,
.lesson-label,
.doc-meta,
.mat-kind,
.source-info > span,
.context-label,
.quiet,
.panel-head h2,
.settings-heading,
.file-icon,
.features,
.brand-link,
.pdf-file,
.pdf-file a,
.connection-box a,
.empty-glyph,
.feature-icon,
.source-position {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.hero-mark {
  font-size: 12px;
  font-weight: 600;
  color: #c4d7bd;
  letter-spacing: 0.02em;
}
.hero h2 {
  font-size: clamp(27px, 3.2vw, 43px);
  line-height: 1.23;
  letter-spacing: -0.075em;
  margin: 12px 0 9px;
  font-weight: 720;
}
.hero p {
  color: #e1e9d9;
  font-size: 14px;
  letter-spacing: -0.035em;
  margin-bottom: 19px;
}
.book-art {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  inset: 0 0 0 auto;
  width: 39%;
  min-width: 188px;
  overflow: hidden;
}
.art-grid {
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image: radial-gradient(#dce7bd 1px, transparent 1.4px);
  background-size: 15px 15px;
  mask-image: linear-gradient(to right, transparent, #000);
}
.art-ring {
  position: absolute;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(212, 225, 180, 0.17);
  border-radius: 50%;
  top: 0;
  left: 20%;
}
.art-ring:after {
  content: "";
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  border: 1px solid rgba(212, 225, 180, 0.15);
}
.book-shadow {
  position: absolute;
  width: 168px;
  height: 17px;
  bottom: 15%;
  left: 31%;
  background: rgba(2, 16, 9, 0.23);
  filter: blur(9px);
  transform: rotate(-12deg);
}
.book-sheet {
  position: absolute;
  display: block;
  border-radius: 4px 10px 10px 4px;
  width: clamp(84px, 9vw, 132px);
  height: clamp(115px, 12.3vw, 176px);
  box-shadow:
    2px 4px #d9cda6,
    3px 7px #b3a980,
    5px 10px 12px #102e2855;
  top: 50%;
  left: 50%;
}
.book-sheet-back {
  transform: translate(-75%, -48%) rotate(-24deg);
  background: repeating-linear-gradient(90deg, #b49a5e 0 3px, #c6ad73 4px 5px);
  border: 1px solid #a59359;
}
.book-sheet-front {
  transform: translate(-31%, -45%) rotate(12deg);
  background: linear-gradient(90deg, #d6c995 0 7%, #e9dfb7 8% 12%, #f2ebcd 13%);
  border: 1px solid #d8cd9c;
}
.book-sheet-front:before,
.book-sheet-front:after {
  content: "";
  position: absolute;
  left: 22%;
  width: 52%;
  top: 35%;
  height: 1px;
  background: #a0a17f;
}
.book-sheet-front:after {
  top: 40%;
  width: 38%;
}
.book-sheet-front em {
  position: absolute;
  bottom: 13%;
  left: 22%;
  width: 12px;
  height: 12px;
  border: 1px solid #a3a580;
  border-radius: 50%;
}
.book-sheet-front b {
  position: absolute;
  right: 18%;
  top: -2px;
  height: 25%;
  width: 15%;
  background: #466a53;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
}
.pencil {
  position: absolute;
  z-index: 2;
  width: 6px;
  height: 42%;
  top: 44%;
  left: 66%;
  transform: rotate(46deg);
  background: linear-gradient(
    90deg,
    #c19650 0 32%,
    #dbb76f 33% 68%,
    #b48945 69%
  );
  border-radius: 2px;
}
.pencil:after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 9px solid #ddc69c;
}
.catalog {
  margin-top: 32px;
}
.section-head {
  margin-bottom: 16px;
}
.section-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #e6eee2;
  color: #476843;
  font-size: 13px;
  letter-spacing: 0;
  padding: 0 5px;
}
.search {
  border: 1px solid #d6dfd7;
  border-radius: 8px;
  background: white;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: #68776e;
  height: 36px;
}
.search input {
  border: none;
  padding: 0;
  margin: 0;
  width: 130px;
  min-height: 0;
  background: none;
  outline: 0;
  font-size: 13px;
}
.search:focus-within {
  outline: 2px solid #458466;
}
.search input:focus-visible {
  outline: 0;
}
.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.chip {
  min-height: 33px;
  font-size: 13px;
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 6px 14px;
  color: #55655a;
  background: #fff;
}
.chip.on {
  background: #e7efe4;
  color: #28563f;
  border-color: #becfbb;
  font-weight: 700;
}
.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 14px;
}
.material,
.panel,
.settings-card,
.state-panel,
.empty.catalog-empty {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.material {
  display: flex;
  flex-direction: column;
  padding: 18px;
  min-width: 0;
  min-height: 172px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.material:hover {
  border-color: #a4b8a4;
  box-shadow: 0 3px 13px #304f3410;
}
.file-icon,
.feature-icon,
.empty-glyph {
  justify-content: center;
  background: #e9f0e6;
  color: #3d684b;
  border-radius: 11px;
  width: 44px;
  height: 44px;
}
.file-icon.youtube,
.file-icon.media {
  background: #f4e8dc;
  color: #9a6439;
}
.file-icon.pdf {
  background: #f3e6e2;
  color: #9c554b;
}
.file-icon.web {
  background: #e7eff3;
  color: #46697c;
}
.mat-kind {
  font-size: 12px;
  color: #66766a;
  font-weight: 600;
}
.material .mat-kind {
  margin: 14px 0 4px;
}
.material h3 {
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mat-bottom {
  margin-top: 16px;
  border-top: 1px solid #e8ece5;
  padding-top: 10px;
  font-size: 12px;
  color: #6b786e;
}
.mat-bottom span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.badge {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 20px;
  min-height: 24px;
  padding: 3px 8px;
  background: #edf0ea;
  color: #54645a;
  font-weight: 680;
  white-space: nowrap;
}
.badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.ready {
  color: #376542;
  background: #e8f1e3;
}
.badge.failed {
  color: #945540;
  background: #faeae3;
}
.badge.partial,
.badge.processing,
.badge.queued {
  color: #825e25;
  background: #f7eed9;
}
.empty {
  text-align: center;
  padding: 36px 20px;
}
.empty.catalog-empty {
  background: #fcfdfa;
  border-style: dashed;
  min-height: 190px;
  display: grid;
  justify-items: center;
  align-content: center;
}
.empty-glyph {
  width: 47px;
  height: 47px;
  border-radius: 14px;
  margin: 0 0 10px;
  background: #eaf0e6;
}
.empty p,
.source-blank p,
.chat-start p,
.lesson-intro p,
.settings-card p,
.auth-form > p,
.login-card p {
  color: var(--muted);
  font-size: 14px;
}
.empty .btn {
  margin-top: 14px;
}
.empty h3 {
  margin: 0 0 3px;
}
.study .heading-row {
  margin-bottom: 23px;
  align-items: flex-start;
}
.doc-meta {
  margin-bottom: 10px;
  gap: 11px;
}
.study h1 {
  font-size: clamp(25px, 2.65vw, 36px);
  max-width: 830px;
}
.study-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}
.panel {
  min-width: 0;
  overflow: hidden;
}
.panel-head {
  min-height: 62px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  font-size: 18px;
}
.quiet,
.text-btn,
.voice-btn {
  font-size: 12px;
  color: #506a54;
  font-weight: 650;
}
.external:hover,
.text-btn:hover,
.voice-btn:hover {
  text-decoration: underline;
}
.media {
  background: #1b2620;
  aspect-ratio: 16/9;
  display: grid;
  place-items: center;
}
.media iframe,
.media video {
  border: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.pdf-file {
  display: flex;
  justify-content: flex-start;
  padding: 13px 18px;
  background: #faf6ec;
  color: #665b3d;
  font-size: 13px;
}
.pdf-file a:hover {
  text-decoration: underline;
}
.source-info {
  font-size: 13px;
  color: #506157;
  padding: 16px 18px 9px;
  gap: 6px;
}
.source-info .source-position {
  font-size: 11px;
  background: #eef4eb;
  border-radius: 5px;
  color: #385c40;
  padding: 3px 6px;
}
.source-origin {
  padding: 0 18px 10px;
}
.text-btn {
  padding: 3px 0;
  justify-content: flex-start;
}
.chapter {
  margin: 0 18px 10px;
  font-size: 12px;
}
.chapter select {
  margin-top: 3px;
  min-height: 34px;
  font-size: 12px;
  padding: 4px 6px;
}
.segments {
  max-height: min(65vh, 610px);
  overflow: auto;
  padding: 0 8px 9px;
  scrollbar-width: thin;
  scrollbar-color: #c6d1c5 transparent;
}
.segment {
  position: relative;
  border-radius: 9px;
  margin: 3px 0;
  border: 1px solid transparent;
}
.segment.selected {
  background: #eef4e9;
  border-color: #dbe7d5;
}
.seg-read {
  width: 100%;
  border: 0;
  border-radius: 8px;
  display: grid;
  align-items: start;
  gap: 3px;
  background: none;
  text-align: left;
  padding: 10px 12px;
  word-break: break-word;
}
.seg-read:hover {
  background: #f1f5ee;
}
.seg-read b {
  font-size: 11px;
  color: #477051;
}
.seg-read span {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.7;
}
.segment.selected .seg-read {
  padding-right: 34px;
}
.segment .icon-btn {
  position: absolute;
  right: 3px;
  top: 5px;
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: #527057;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 9px;
  color: var(--muted);
  font-size: 12px;
}
.pager .icon-btn {
  height: 32px;
  width: 32px;
}
.source-blank,
.chat-start,
.lesson-intro {
  text-align: center;
  padding: 35px 22px;
  color: var(--muted);
}
.source-blank p,
.chat-start p,
.lesson-intro p {
  margin-top: 7px;
}
.talk-tabs {
  background: #fbfcf9;
  border-bottom: 1px solid var(--line);
  padding: 0 15px;
}
.talk-tabs > div {
  display: flex;
  align-items: stretch;
  gap: 14px;
}
.talk-tab {
  font-size: 14px;
  font-weight: 600;
  min-height: 61px;
  position: relative;
  padding: 9px 4px;
  color: #68766c;
}
.talk-tab.on {
  color: var(--green);
  font-weight: 710;
}
.talk-tab.on:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 3px;
  background: var(--green);
}
.provider-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 8px;
  background: #f7f4e9;
  padding: 10px 16px;
  color: #655936;
  font-size: 12px;
}
.provider-note > a {
  font-weight: 750;
  text-decoration: underline;
}
.chat-start {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 230px;
}
.chat-start h3,
.lesson-intro h3 {
  color: var(--ink);
  margin-top: 11px;
  font-size: 19px;
}
.messages {
  max-height: min(64vh, 570px);
  min-height: 225px;
  overflow: auto;
  scrollbar-width: thin;
  padding: 12px 17px;
  overscroll-behavior: contain;
}
.msg {
  margin: 9px 0 18px;
  font-size: 14px;
}
.msg header {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #41614b;
  display: flex;
  align-items: center;
  gap: 5px;
}
.msg .msg-text,
.question,
.lesson-card .plan p,
.feedback,
.attempt p,
.lesson-hint p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
.mine {
  margin-left: 12%;
}
.mine header {
  justify-content: flex-end;
}
.mine .msg-text {
  padding: 9px 13px;
  background: #ecf2e8;
  border: 1px solid #e0e8db;
  border-radius: 12px 3px 12px 12px;
}
.msg footer,
.inline-actions,
.manage-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.msg footer {
  margin-top: 7px;
}
.citation {
  background: #eef2e9;
  border: 1px solid #dde6d7;
  border-radius: 5px;
  font-size: 11px;
  color: #3a5c40;
  min-height: 27px;
  padding: 4px 6px;
}
.voice-btn {
  padding: 4px 6px;
  min-height: 30px;
}
.composer {
  margin: 0 12px 13px;
  border: 1px solid #c6d3c5;
  border-radius: 12px;
  background: #fdfefb;
  overflow: hidden;
}
.composer:focus-within {
  box-shadow: 0 0 0 2px #99b89c;
}
.context-label {
  font-size: 11px;
  color: #537056;
  margin: 9px 12px 0;
}
.composer textarea {
  border: 0;
  background: transparent;
  margin: 0;
  resize: vertical;
  min-height: 60px;
  max-height: 200px;
  width: 100%;
  font-size: 14px;
  padding: 9px 12px 3px;
  display: block;
}
.composer textarea:focus-visible {
  outline: 0;
}
.composer-tools {
  padding: 3px 7px 7px;
}
.mic-btn {
  font-size: 12px;
  color: #506b52;
  min-height: 34px;
  padding: 4px 6px;
}
.mic-btn.recording {
  color: #a34539;
}
.send-btn {
  width: 35px;
  height: 35px;
  border: 0;
  border-radius: 8px;
}
.composer .error,
.composer .form-status:not(:empty) {
  margin: 3px 10px 9px;
}
.lesson-card,
.lesson-intro,
#lesson-start {
  padding: 18px;
}
.lesson-intro {
  padding-bottom: 0;
}
.lesson-label {
  color: var(--green);
  font-size: 12px;
  font-weight: 650;
}
.lesson-card h3 {
  margin: 6px 0 12px;
  font-size: 20px;
}
.lesson-card h4 {
  margin: 16px 0 5px;
}
.lesson-card .inline-actions {
  margin: 12px 0;
}
.lesson-card summary,
.range summary {
  color: #42634a;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.plan,
.attempts {
  background: #f7f9f4;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 12px 0;
  font-size: 13px;
}
.plan p,
.attempt {
  margin-top: 8px;
}
.attempt {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.attempt small {
  display: block;
}
.lesson-hint,
.feedback {
  font-size: 13px;
  background: #fbf6e9;
  border-left: 2px solid #b79d5a;
  padding: 8px 11px;
  margin: 8px 0;
}
.result-row {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  font-size: 13px;
}
.result-row b {
  margin-left: auto;
  color: var(--green);
}
.state-panel {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
  margin-bottom: 16px;
}
.state-panel h2 {
  font-size: 17px;
}
.state-panel p {
  font-size: 13px;
  margin: 3px 0 7px;
  color: var(--muted);
}
.state-panel .feature-icon {
  width: 36px;
  height: 36px;
  flex: none;
}
.load {
  padding: 28px;
  color: var(--muted);
}
.settings {
  max-width: 1050px;
  margin-left: 0;
}
.settings h1 + .subtitle {
  margin-bottom: 25px;
}
.settings-card {
  padding: 20px 24px;
  margin-bottom: 14px;
}
.settings-card h2 {
  font-size: 18px;
}
.settings-card h3 {
  font-size: 15px;
}
.settings-heading {
  gap: 12px;
}
.settings-heading p {
  font-size: 12px;
}
.setting-row,
.toggle-row {
  padding: 15px 0;
  border-bottom: 1px solid #e8ece5;
}
.setting-row > div {
  min-width: 0;
}
.settings-card.setting-row {
  padding: 18px 24px;
  border: 1px solid var(--line);
}
.settings-card .help-note {
  margin: 12px 0;
  font-size: 12px;
}
.toggle-row {
  font-weight: 550;
  font-size: 14px;
}
.toggle-row input,
.check-line input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  accent-color: var(--green);
  margin: 0;
  flex: none;
}
.settings .inline-actions {
  margin-top: 10px;
}
.limits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 25px;
  margin-top: 14px;
}
.limits > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.limits b {
  color: var(--ink);
}
.connection-box {
  padding: 14px;
  background: #f0f4eb;
  border-radius: 8px;
  margin-bottom: 10px;
}
.device-code {
  font-size: 13px;
  margin: 8px 0;
}
.device-code strong {
  font-family: monospace;
  font-size: 21px;
}
.connection-box a {
  font-size: 13px;
}
.start-screen,
.auth-screen {
  min-height: 100dvh;
  display: grid;
  place-content: center;
}
.login-card,
.auth-form {
  max-width: 510px;
  padding: 36px;
  background: white;
  border-radius: 16px;
}
.login-card h1,
.auth-form h1 {
  font-size: 32px;
  margin: 15px 0 8px;
}
.login-card .btn {
  margin-top: 17px;
}
.auth-screen {
  display: grid;
  grid-template-columns: minmax(325px, 480px) minmax(340px, 460px);
  align-content: center;
  justify-content: center;
  padding: 24px;
}
.auth-aside {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 490px;
  padding: 31px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(140deg, #183c32, #365c42);
  color: #fffdf1;
}
.auth-aside .brand img {
  background: #ebf0dc;
  border: 1px solid #6c866b;
}
.auth-aside .book-art {
  width: 80%;
  height: 65%;
  top: 0;
}
.auth-aside h2 {
  font-size: 39px;
  line-height: 1.25;
  letter-spacing: -0.08em;
}
.auth-aside p {
  font-size: 13px;
  color: #d8e4cd;
  margin-top: 11px;
}
.auth-form {
  border: 1px solid var(--line);
  border-radius: 0 18px 18px 0;
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-form form {
  margin-top: 22px;
}
.auth-form .btn {
  margin-top: 18px;
}
.auth-form .feature-icon {
  border-radius: 50%;
}
dialog {
  width: min(480px, calc(100% - 28px));
  max-height: calc(100dvh - 35px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  color: var(--ink);
  background: white;
  box-shadow: 0 20px 70px #152c2540;
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #12291ed0;
  background: rgba(21, 38, 30, 0.46);
}
.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
}
.dialog-head h2 {
  font-size: 20px;
}
.dialog-head .icon-btn {
  border: 0;
  background: #f2f5ef;
  width: 32px;
  height: 32px;
}
.dialog-body {
  padding: 19px 20px;
}
.dialog-body > p,
.dialog-body form > p {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 11px;
}
.mode-chooser {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: #f1f4ee;
  border-radius: 9px;
  margin-bottom: 15px;
}
.mode {
  flex: 1;
  min-height: 37px;
  font-size: 13px;
  color: var(--muted);
  border-radius: 6px;
}
.mode.on {
  background: white;
  box-shadow: 0 1px 5px #273f2e18;
  color: var(--green);
  font-weight: 700;
}
label:not(.search, .toggle-row, .check-line, .sr) {
  display: block;
  font-size: 13px;
  font-weight: 640;
}
label small {
  font-weight: 400;
  margin-left: 4px;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #cbd5ca;
  border-radius: 7px;
  color: var(--ink);
  background: white;
  min-height: 40px;
  max-width: 100%;
}
label + input,
label + select,
label + textarea,
label > input,
label > select,
.split {
  margin-top: 5px;
}
form > label:not(:first-child),
#add-fields > label:not(:first-child) {
  margin-top: 14px;
}
textarea {
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: #858e85;
}
.check-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 9px;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin: 13px 0;
}
.range {
  margin-top: 10px;
}
.file-picker {
  background: #f8faf5;
  padding: 14px 10px;
}
.file-picker::file-selector-button {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: white;
  padding: 6px 8px;
  color: var(--ink);
  margin-right: 7px;
}
.dialog-actions {
  justify-content: flex-end;
  margin-top: 21px;
}
.error,
.dialog-body p.error {
  color: #913d30;
  background: #fcf0eb;
  border-radius: 5px;
  padding: 7px 9px;
  font-size: 13px;
  margin: 10px 0;
  white-space: pre-wrap;
}
.error[hidden],
[hidden] {
  display: none !important;
}
.form-status {
  font-size: 12px;
  color: var(--muted);
}
.danger {
  color: #923f35;
}
.danger-solid {
  background: #934438;
  color: white;
  border-color: #934438;
}
.danger-solid:hover {
  background: #81372f;
  color: white;
}
.notice {
  position: fixed;
  z-index: 15;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translate(-50%, 8px);
  width: max-content;
  max-width: calc(100vw - 28px);
  border-radius: 9px;
  background: #223b2e;
  color: white;
  font-size: 13px;
  box-shadow: 0 5px 20px #1b2a1c30;
  opacity: 0;
  pointer-events: none;
  transition: 0.15s;
  padding: 9px 15px;
}
.notice.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (min-width: 1540px) {
  .page {
    margin-left: auto;
    margin-right: auto;
  }
  .settings {
    margin-left: 0;
  }
}
@media (max-width: 1130px) {
  .layout {
    grid-template-columns: 180px minmax(0, 1fr);
  }
  .side {
    padding: 25px 12px 18px;
  }
  .brand-link {
    margin-bottom: 37px;
  }
  .page {
    padding: 30px 24px 55px;
  }
  .top {
    padding: 0 24px;
  }
  .study-grid {
    gap: 12px;
  }
  .book-art {
    width: 36%;
  }
}
@media (max-width: 820px) {
  .layout {
    display: block;
  }
  .side {
    display: none;
  }
  .top {
    height: 56px;
    padding: 0 18px;
    background: #fcfdf9;
  }
  .top .mobile-brand,
  .top-settings {
    display: inline-flex;
    align-items: center;
  }
  .top .brand img {
    width: 30px;
    height: 30px;
  }
  .top .brand b {
    font-size: 21px;
  }
  .top .crumb {
    display: none;
  }
  .top-settings {
    width: 40px;
    height: 40px;
    justify-content: center;
  }
  .page {
    padding: 25px 18px max(40px, env(safe-area-inset-bottom));
  }
  .study-grid {
    display: block;
  }
  .mobile-tabs {
    display: flex;
    margin: 0 0 12px;
    background: #e9eee6;
    border-radius: 10px;
    padding: 4px;
    position: sticky;
    top: 0;
    z-index: 3;
  }
  .mobile-tab {
    flex: 1;
    min-height: 38px;
    border-radius: 7px;
    color: var(--muted);
    font-size: 14px;
  }
  .mobile-tab.on {
    background: white;
    color: var(--green);
    font-weight: 700;
    box-shadow: 0 1px 4px #20392912;
  }
  .study-grid[data-mobile="chat"]:has(.talk-panel) .source-panel,
  .study-grid[data-mobile="source"] .talk-panel {
    display: none;
  }
  .study .heading-row {
    margin-bottom: 17px;
  }
  .segments {
    max-height: 68vh;
  }
  .messages {
    max-height: 54dvh;
  }
  .hero {
    min-height: 235px;
    margin-top: 23px;
  }
  .hero-copy {
    padding: 23px 27px;
  }
  .book-art {
    width: 39%;
  }
  .book-sheet {
    width: 98px;
    height: 133px;
  }
  .auth-screen {
    grid-template-columns: minmax(280px, 400px) minmax(280px, 400px);
  }
  .auth-form {
    padding: 27px;
  }
  .search input {
    width: 95px;
  }
  .catalog {
    margin-top: 25px;
  }
}
@media (max-width: 600px) {
  .auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
  }
  .auth-aside {
    display: none;
  }
  .auth-form {
    border-radius: 16px;
    padding: 25px;
    width: 100%;
    max-width: 420px;
  }
  .auth-form .mobile-brand {
    display: inline-flex;
    margin-bottom: 27px;
  }
  .auth-form .feature-icon {
    display: none;
  }
  .auth-form h1 {
    margin-top: 0;
  }
  .study h1 {
    font-size: 25px;
  }
  .page {
    padding: 23px 15px 38px;
  }
  .section-head h2 {
    font-size: 20px;
  }
  .hero {
    min-height: 218px;
  }
  .hero-copy {
    padding: 20px 18px;
    width: 73%;
  }
  .hero-mark {
    font-size: 10px;
  }
  .hero h2 {
    font-size: 27px;
    margin: 9px 0 6px;
  }
  .hero p {
    font-size: 12px;
    margin-bottom: 13px;
    max-width: 245px;
  }
  .hero .book-art {
    width: 32%;
    min-width: 85px;
    opacity: 0.94;
  }
  .book-sheet {
    width: 64px;
    height: 89px;
    left: 47%;
  }
  .book-sheet-front {
    transform: translate(-43%, -40%) rotate(12deg);
  }
  .art-ring {
    width: 125px;
    height: 125px;
    top: 24%;
    left: 2%;
  }
  .pencil {
    height: 30%;
    left: 66%;
    width: 4px;
  }
  .art-grid {
    background-size: 11px 11px;
  }
  .hero .btn.cream {
    min-height: 37px;
    padding: 7px 12px;
    font-size: 13px;
  }
  .subtitle {
    font-size: 13px;
  }
  .search {
    padding: 0 8px;
    height: 33px;
  }
  .search input {
    width: 75px;
  }
  .filters {
    gap: 5px;
  }
  .chip {
    min-height: 32px;
    padding: 5px 11px;
    font-size: 12px;
  }
  .settings-card {
    padding: 16px;
  }
  .limits {
    grid-template-columns: 1fr;
  }
  .settings-card.setting-row {
    padding: 15px;
  }
  .talk-tab {
    min-height: 49px;
  }
  .chat-start {
    min-height: 185px;
  }
  .messages {
    min-height: 185px;
  }
  .material-grid {
    grid-template-columns: 1fr;
  }
  .material {
    min-height: 145px;
  }
  .dialog-body {
    padding: 16px;
  }
  .dialog-head {
    padding: 12px 16px;
  }
  .manage-list {
    align-items: stretch;
  }
  .auth-form label,
  .auth-form input {
    font-size: 16px;
  }
  .composer textarea {
    font-size: 16px;
  }
  .material h3 {
    font-size: 17px;
  }
  .dialog-actions {
    flex-wrap: wrap;
  }
  .lesson-card {
    padding: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.source-method {
  margin: 0 18px 9px;
  font-size: 12px;
  color: var(--muted);
}
.message-state {
  display: block;
  margin-top: 4px;
  color: #85613b;
}
#pdf-original {
  display: block;
  width: 100%;
  height: clamp(230px, 35vh, 400px);
  border: 0;
  background: #e9eee7;
}
