:root {
  font-family: -apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Noto Sans KR",sans-serif;
  color: #243b34;
  background: #f7f8f4;
  font-size: 15px;
  line-height: 1.6;
  font-synthesis: none;
  --ink: #243b34;
  --muted: #69776f;
  --line: #e0e6de;
  --green: #315b49;
  --soft: #eaf0e5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,input,select {
  font: inherit;
}

button,a,input,select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: .48;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible {
  outline: 3px solid #99bba0;
  outline-offset: 3px;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none!important;
}

.topbar {
  height: 86px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1440px;
  padding: 0 54px;
  margin: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.5px;
}

.brand-mark {
  background: var(--green);
  color: white;
  border-radius: 11px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-family: Georgia,serif;
  font-style: italic;
  font-size: 24px;
  padding-bottom: 3px;
}

.brand-sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-left: 1px solid #c8d1c6;
  padding-left: 12px;
  margin-left: 6px;
}

.pilot,.small-label,.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--green);
}

.pilot {
  border: 1px solid #cfdacb;
  border-radius: 30px;
  padding: 5px 12px;
  font-size: 10px;
}

.account {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
}

.account>span {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-button {
  border: 0;
  background: none;
  color: var(--green);
  padding: 7px 0;
  font-size: 13px;
}

.text-button:hover {
  text-decoration: underline;
}

main {
  max-width: 1280px;
  margin: auto;
  padding: 36px 54px 70px;
  min-height: calc(100vh - 161px);
}

h1,h2,h3,p {
  margin: 0;
}

h1 {
  font-size: 32px;
  letter-spacing: -1.4px;
  line-height: 1.4;
  font-weight: 650;
}

h2 {
  font-size: 19px;
  letter-spacing: -.6px;
  font-weight: 650;
}

h3 {
  font-size: 17px;
  letter-spacing: -.3px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.eyebrow {
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
}

.login-layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  align-items: center;
  gap: 70px;
  min-height: calc(100vh - 267px);
  max-width: 1000px;
  margin: 0 auto;
}

.login-intro h1 {
  font-size: 48px;
  letter-spacing: -2px;
  line-height: 1.35;
}

.lead {
  color: var(--muted);
  margin-top: 22px;
  font-size: 16px;
  line-height: 1.9;
}

.intro-steps {
  display: flex;
  gap: 20px;
  margin-top: 56px;
  color: #6c7c6f;
  font-size: 11px;
}

.intro-steps span {
  border-top: 2px solid #c3d2bd;
  padding-top: 12px;
}

.login-panel {
  padding: 34px;
  box-shadow: 0 12px 40px #263f3210;
}

.login-panel h2 {
  font-size: 25px;
  margin: 9px 0 8px;
}

.login-panel label {
  margin-top: 28px;
}

.fine-print {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.75;
  margin-top: 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 550;
  margin: 18px 0 7px;
}

input:not([type=checkbox]):not([type=radio]),select {
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  border: 1px solid #d6dfd3;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

input::placeholder {
  color: #8a958e;
}

.primary,.secondary {
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 20px;
  font-weight: 550;
  font-size: 14px;
}

.primary {
  background: var(--green);
  color: white;
  border: 1px solid var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.primary:hover:not(:disabled) {
  background: #264c3d;
}

.secondary {
  background: #f7f9f5;
  border: 1px solid var(--line);
  color: var(--green);
}

.full {
  width: 100%;
}

.login-panel .primary {
  margin-top: 18px;
}

.notice {
  background: #fff7df;
  border: 1px solid #e7d9ad;
  border-radius: 10px;
  color: #715521;
  padding: 12px 16px;
  margin-bottom: 22px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0 34px;
}

.page-heading .muted {
  margin-top: 12px;
}

.heading-note {
  color: #7c8b7c;
  font-size: 13px;
  white-space: nowrap;
  padding-left: 15px;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0,1.8fr) minmax(280px,1fr);
  gap: 24px;
  align-items: start;
  margin-top: 24px;
}

.selection-bar {
  position: sticky;
  bottom: 12px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid #b6c9b1;
  border-radius: 12px;
  box-shadow: 0 6px 28px #243b3420;
}

.selection-bar>div { display: flex; gap: 18px; align-items: center; }
.selection-bar strong { font-size: 14px; }
.practice-setup, .attempt, .results-panel { scroll-margin-top: 90px; }
.practice-links { display: flex; align-items: center; gap: 22px; }
.question-navigation { max-width: 850px; margin: 0 auto 20px; }
.question-navigation>p { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.question-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.question-button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}
.question-button.answered { background: var(--green); border-color: var(--green); color: #fff; }
.feedback-notice { margin-top: 18px; }

.side-stack {
  display: grid;
  gap: 22px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.section-heading select {
  width: 116px;
  min-height: 37px;
  padding: 6px 9px;
  font-size: 12px;
}

.item-list {
  display: grid;
  gap: 12px;
}

.item-card {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  margin: 0;
  font-weight: 400;
}

.item-card:has(input:checked) {
  border-color: #688960;
  background: #f3f7ef;
}

.item-card input {
  margin: 5px 0 0;
  accent-color: var(--green);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.item-card .item-copy {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.library-preview {
  display: grid;
  place-items: center;
  min-height: 100px;
  margin: 7px 0 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.library-preview-image {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: contain;
  object-position: left top;
}

.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  background: var(--soft);
  border-radius: 5px;
  margin-bottom: 7px;
  color: #46634f;
}

.item-preview {
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}

.item-id {
  font-size: 11px;
  color: #819080;
  margin-top: 7px;
  overflow-wrap: anywhere;
}

.empty {
  padding: 40px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.empty p {
  margin-top: 8px;
  font-size: 12px;
}

.practice-setup h2 {
  font-size: 26px;
  margin: 6px 0;
}

.practice-setup h2 span {
  font-size: 36px;
  margin-right: 5px;
}

.input-unit {
  display: flex;
  align-items: center;
  gap: 12px;
}

.input-unit input {
  width: 100%;
}

.practice-setup .primary {
  margin-top: 20px;
}

.practice-setup>.muted {
  font-size: 12px;
}

.history h2 {
  font-size: 17px;
}

.history-row {
  display: block;
  text-align: left;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 14px 0;
  background: #fff;
  color: var(--ink);
}

.history-row:hover {
  color: var(--green);
}

.history-row strong {
  display: block;
  font-size: 13px;
  font-weight: 550;
}

.history-row span {
  font-size: 11px;
  color: var(--muted);
}

#more-items {
  margin-top: 20px;
}

.practice-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f8f4f5;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.timer-block {
  display: flex;
  align-items: center;
  gap: 15px;
}

.timer-block>span {
  font-size: 12px;
  color: var(--muted);
}

#timer {
  font-variant-numeric: tabular-nums;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 1px;
}

#timer.urgent {
  color: #b15d40;
}

.practice-heading {
  margin: 30px 0;
}

.practice-heading .muted {
  margin-top: 12px;
}

.attempt-list {
  display: grid;
  gap: 24px;
  max-width: 850px;
  margin: auto;
}

.attempt {
  padding: 30px;
}

.attempt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.attempt-number {
  font-size: 12px;
  color: var(--muted);
}

.attempt-status {
  font-size: 12px;
  color: var(--green);
}

.stimulus {
  padding: 20px;
  background: #f8f9f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 22px;
}

.stimulus h3 {
  font-size: 14px;
  margin-bottom: 10px;
}

.content-part {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 10px 0;
  line-height: 1.9;
}

.content-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px auto;
}

.image-error {
  color: #9f5838;
  font-size: 12px;
}

.photo-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.photo-section h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.photo-section>.muted {
  font-size: 12px;
}

.photo-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.photo-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 15px;
  min-width: 0;
}

.photo-label {
  font-size: 12px;
  font-weight: 550;
}

.photo-card .fine-print {
  margin-top: 4px;
}

.photo-actions {
  display: flex;
  gap: 20px;
}

.photo-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 12px auto 0;
}

.answer-options {
  border: 0;
  padding: 0;
  margin: 20px 0 0;
  min-width: 0;
}

.answer-options legend {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  padding: 9px 14px;
  border-radius: 8px;
  margin: 9px 0;
  font-weight: 400;
}

.choice:has(input:checked) {
  border-color: #688960;
  background: #f3f7ef;
}

.choice input {
  accent-color: var(--green);
  margin: 9px 0 0;
}

.choice .content-part {
  margin: 3px 0;
}

.choice>div {
  min-width: 0;
}

.submit-bar {
  max-width: 850px;
  margin: 28px auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.submit-bar .muted {
  font-size: 12px;
}

.results-panel {
  max-width: 850px;
  margin: 36px auto;
}

.result-summary {
  border-radius: 12px;
  background: var(--soft);
  padding: 26px;
  margin-bottom: 22px;
}

.result-summary h2 {
  font-size: 24px;
}

.result-summary p {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.result-card {
  margin-top: 16px;
}

.result-card .content-part {
  font-size: 14px;
}

.result-label {
  font-size: 13px;
  font-weight: 650;
  color: var(--green);
  margin-bottom: 12px;
}

.result-label.incorrect {
  color: #a3593d;
}

.review-note {
  background: #fff5dc;
  padding: 10px;
  border-radius: 6px;
  color: #795b27;
  font-size: 12px;
  margin-top: 10px;
}

.sync-panel {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.sync-panel strong {
  font-size: 12px;
  font-weight: 550;
}

.sync-panel p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

.sync-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

.sync-actions button {
  font-size: 12px;
  white-space: nowrap;
}

footer {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 23px;
  color: #83907e;
  font-size: 11px;
  letter-spacing: .2px;
}

footer span {
  margin: 0 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media(max-width:900px) {
  .topbar {
    padding: 0 28px;
  }
  main {
    padding: 28px 28px 50px;
  }
  .login-layout {
    gap: 36px;
  }
  .login-intro h1 {
    font-size: 38px;
  }
  .intro-steps {
    gap: 12px;
    font-size: 10px;
  }
  .home-grid {
    grid-template-columns: minmax(0,1.5fr) minmax(260px,1fr);
    gap: 18px;
  }
  .panel {
    padding: 22px;
  }
  .heading-note {
    display: none;
  }
}

@media(max-width:650px) {
  .topbar {
    height: 72px;
    padding: 0 20px;
  }
  .brand-sub {
    display: none;
  }
  .account {
    gap: 12px;
  }
  .account>span {
    max-width: 115px;
  }
  .selection-bar { gap: 10px; padding: 12px; bottom: max(10px, env(safe-area-inset-bottom)); }
  .selection-bar>div { flex-direction: column; align-items: flex-start; gap: 0; }
  .selection-bar .primary { padding: 10px 12px; }
  .practice-links { flex-direction: column; align-items: flex-start; gap: 0; }
  .practice-links .text-button { min-height: 36px; }
  .question-buttons { gap: 7px; }
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px; }
  .text-button { min-height: 44px; }
  .coaching-controls label { width: 100%; margin-top: 0; }
  main {
    padding: 25px 20px 40px;
    min-height: calc(100vh - 140px);
  }
  .login-layout {
    grid-template-columns: 1fr;
    gap: 30px;
    min-height: 0;
  }
  .login-intro {
    padding: 12px 0;
  }
  .login-intro h1 {
    font-size: 36px;
  }
  .lead {
    font-size: 14px;
    margin-top: 18px;
  }
  .intro-steps {
    margin-top: 26px;
    gap: 20px;
  }
  .login-panel {
    padding: 25px;
  }
  .home-grid {
    grid-template-columns: 1fr;
  }
  .page-heading {
    margin: 2px 0 25px;
  }
  h1 {
    font-size: 27px;
  }
  .panel {
    padding: 20px;
  }
  .library {
    order: 1;
  }
  .side-stack {
    order: 2;
  }
  .practice-heading h1 {
    font-size: 26px;
  }
  .submit-bar,.sync-panel {
    align-items: stretch;
    flex-direction: column;
  }
  .submit-bar .primary {
    width: 100%;
  }
  .sync-actions {
    justify-content: space-between;
  }
  .attempt {
    padding: 20px;
  }
  .stimulus {
    padding: 15px;
  }
  .content-part {
    font-size: 14px;
  }
  .timer-block {
    gap: 10px;
  }
  .timer-block>span {
    font-size: 11px;
  }
  .results-panel {
    margin: 25px auto;
  }
  .pilot {
    font-size: 9px;
  }
  .item-card {
    padding: 15px;
  }
}

/* Document coordinates stay fixed while the canvas scales to the device width. */
.ink-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line, #d9e4df); }
.ink-section h3, .ink-playback h4 { margin: 0 0 12px; }
.ink-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0; }
.ink-toolbar select { min-width: 80px; max-width: 100%; padding: 9px; }
.ink-canvas { display: block; width: 100%; height: auto; aspect-ratio: 10 / 7; border: 1px solid #aec2bd; border-radius: 10px; background: #fff; }
.ink-section > .ink-canvas { touch-action: none; cursor: crosshair; }
.ink-recordings { display: grid; gap: 12px; margin-top: 12px; }
.ink-recording { padding: 14px; border: 1px solid #d9e4df; border-radius: 10px; }
.ink-playback { margin-top: 18px; padding: 14px; border-radius: 10px; background: #f1f6f3; }
.ink-playback input[type="range"] { width: 100%; margin: 14px 0; }
.ink-playback button { margin-right: 12px; }
@media (max-width: 540px) {
  .ink-toolbar { gap: 8px; }
  .ink-toolbar button { min-height: 44px; }
}

.video-section { border-top: 1px solid var(--line, #dce5e4); margin-top: 1.5rem; padding-top: 1.2rem; }
.video-preview, .video-replay { display: block; width: 100%; max-height: 420px; background: #172f35; border-radius: 12px; margin: 0.75rem 0; }
.video-preview[hidden] { display: none; }
.video-state { font-weight: 600; }
.video-group { margin: 1rem 0; padding: 0.5rem 0; }
.video-file-label { display: block; margin-top: 1rem; font-weight: 600; }
.video-section input[type=file] { width: 100%; max-width: 100%; box-sizing: border-box; margin-top: 0.5rem; }
.video-list .photo-card { display: block; overflow-wrap: anywhere; }
.video-list .text-button { margin-right: 0.75rem; }
.video-timeline { display: block; margin: 0.6rem 0; }
.video-timeline[hidden] { display: none; }
.video-timeline input { display: block; width: 100%; margin: 0.4rem 0; }

.review-section { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; overflow-wrap: anywhere; }
.review-section h3 { margin: 0 0 12px; }
.review-section .ink-canvas { aspect-ratio: auto; }
.review-form { margin-top: 18px; }
.review-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.review-form label { display: block; margin: 14px 0; font-weight: 600; }
.review-form label[hidden] { display: none; }
.review-form select, .review-form textarea { display: block; width: 100%; max-width: 100%; box-sizing: border-box; margin-top: 8px; padding: 10px; border: 1px solid #aec2bd; border-radius: 8px; font: inherit; background: #fff; }
.review-form textarea { resize: vertical; }
.review-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.review-history { margin-top: 16px; }
.review-history summary { cursor: pointer; padding: 10px 0; }
.review-history-entry { padding: 14px; margin-top: 10px; background: #f1f6f3; border-radius: 10px; }
.coaching-panel { margin-top: 28px; overflow-wrap: anywhere; }
.coaching-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin-bottom: 24px; }
.coaching-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.coaching-entry, .coaching-skill { border: 1px solid var(--line); padding: 18px; border-radius: 12px; margin: 12px 0; }
.coaching-panel details { margin: 16px 0; }
.coaching-panel summary { cursor: pointer; }
.coaching-panel .text-button { display: block; text-align: left; margin: 8px 0; }
.coaching-assistance { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 12px; }
.coaching-assistance .text-button { margin-right: 14px; }
