:root {
  color-scheme: light;
  --ink: #17243d;
  --ink-soft: #53617a;
  --blue: #315bd6;
  --blue-dark: #2448b2;
  --blue-pale: #eaf0ff;
  --coral: #ec704d;
  --paper: #f5f7fb;
  --white: #ffffff;
  --line: #dce2ee;
  --line-strong: #c8d0df;
  --success: #17846a;
  --danger: #b54141;
  --shadow: 0 24px 70px rgba(23, 36, 61, 0.10);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(49, 91, 214, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 91, 214, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.site-header {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--ink);
  border-radius: 12px 12px 12px 4px;
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: 1.25rem;
  font-weight: 700;
  box-shadow: 4px 4px 0 var(--coral);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.05rem;
  letter-spacing: -0.035em;
}

.brand small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.local-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #35506f;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.82rem;
  font-weight: 650;
  backdrop-filter: blur(12px);
}

.local-note svg {
  width: 16px;
  height: 16px;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 38px auto 80px;
}

.intro {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: end;
  gap: 80px;
  margin: 46px 0 36px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.intro h1 {
  margin: 0;
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: clamp(2.4rem, 5.3vw, 4.9rem);
  line-height: 1.12;
  letter-spacing: -0.065em;
  word-break: keep-all;
}

.intro-copy {
  max-width: 470px;
  margin: 0 0 7px;
  color: var(--ink-soft);
  font-size: 1.04rem;
  line-height: 1.8;
  word-break: keep-all;
}

.flow {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin: 0 0 22px;
  padding: 18px 22px;
  color: #748099;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(12px);
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.84rem;
}

.flow-step span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 0.72rem;
}

.flow-step.is-current {
  color: var(--ink);
}

.flow-step.is-current span {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.flow-line {
  height: 1px;
  background: var(--line);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.writing-card,
.progress-card,
.project-card,
.font-card,
.result-section,
.install-guide,
.technical-note {
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.writing-card {
  padding: 30px;
  border-radius: var(--radius-xl);
}

.card-heading,
.progress-heading,
.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.card-heading h2,
.progress-heading h2,
.font-card h2,
.result-heading h2,
.install-guide h2 {
  margin: 0;
  letter-spacing: -0.045em;
}

.card-heading h2 {
  font-size: 1.45rem;
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  background: #e9f7f2;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.76rem;
  font-weight: 750;
}

.save-state::before {
  width: 6px;
  height: 6px;
  content: "";
  background: currentColor;
  border-radius: 50%;
}

.save-state.is-saving {
  color: #8b641d;
  background: #fff6dd;
}

.component-panel {
  position: relative;
  margin: 24px 0 18px;
  overflow: hidden;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(232, 244, 255, 0.92), rgba(255, 255, 255, 0.98) 58%),
    #fff;
  border: 1px solid #bfd2ee;
  border-radius: 20px;
}

.component-panel::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  content: "";
  background: linear-gradient(var(--blue), var(--success));
}

.component-set-nav {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: stretch;
  gap: 10px;
  margin: 0 0 20px;
}

.component-heading,
.component-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.component-heading h3 {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: -0.035em;
}

.component-heading > strong {
  flex: 0 0 auto;
  color: var(--blue-dark);
  font-size: 0.85rem;
}

.component-active-info {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 16px 0 12px;
  padding: 10px 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #d5e1f3;
  border-radius: 12px;
  font-size: 0.76rem;
}

.component-active-info > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.component-active-info strong,
#componentStrokeStats {
  color: var(--ink);
  font-weight: 750;
}

.component-active-info p {
  margin: 0;
}

#componentGuideNote {
  color: var(--blue-dark);
  text-align: center;
  font-weight: 720;
}

#componentStrokeStats {
  white-space: nowrap;
}

.component-cell-context {
  overflow: hidden;
  color: #687791;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.component-context-badge {
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 3;
  padding: 3px 6px;
  color: #5e6f8d;
  background: rgba(247, 250, 255, 0.9);
  border: 1px solid #d9e2f0;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
  pointer-events: none;
}

.manuscript-cell.is-active .component-cell-context {
  color: rgba(255, 255, 255, 0.82);
}

.component-meta {
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.55;
}

.component-meta p {
  margin: 0;
}

.component-meta > strong {
  flex: 0 0 auto;
  color: var(--blue-dark);
}

.guide-swatch {
  width: 15px;
  height: 4px;
  display: inline-block;
  margin-right: 7px;
  vertical-align: middle;
  background: rgba(49, 91, 214, 0.28);
  border-radius: 999px;
}

.component-writing-parking {
  min-height: 0;
}

.passage-enrichment {
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.passage-enrichment > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 18px;
  cursor: pointer;
  list-style: none;
  background: #f8f9fc;
  border-radius: 18px;
}

.passage-enrichment[open] > summary {
  border-bottom: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
}

.passage-enrichment > summary::-webkit-details-marker {
  display: none;
}

.passage-enrichment > summary span,
.passage-enrichment > summary strong,
.passage-enrichment > summary small {
  display: block;
}

.passage-enrichment > summary strong {
  font-size: 0.96rem;
}

.passage-enrichment > summary small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 600;
}

.passage-enrichment > summary em {
  flex: 0 0 auto;
  color: var(--blue-dark);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 800;
}

.passage-enrichment[open] > summary em::before {
  content: "닫기";
}

.passage-enrichment[open] > summary em {
  font-size: 0;
}

.passage-enrichment[open] > summary em::before {
  font-size: 0.75rem;
}

.passage-enrichment > .passage-card,
.passage-enrichment > .representative-panel,
.passage-enrichment > .composition-panel,
.passage-enrichment > .supplement-heading,
.passage-enrichment > .glyph-tabs,
.passage-enrichment > .supplement-writing-panel,
.passage-enrichment > .legacy-reset-button {
  margin-right: 18px;
  margin-left: 18px;
}

.passage-enrichment > .passage-card {
  margin-top: 18px;
}

.legacy-reset-button {
  margin-top: 0;
  margin-bottom: 18px;
}

.passage-card {
  position: relative;
  margin: 24px 0 18px;
  overflow: hidden;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(234, 240, 255, 0.88), rgba(255, 255, 255, 0.96) 58%),
    #fff;
  border: 1px solid #ccd8f4;
  border-radius: 20px;
}

.passage-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  content: "";
  background: linear-gradient(var(--blue), var(--coral));
}

.passage-set-nav {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: stretch;
  gap: 10px;
  margin: 0 0 20px;
}

.passage-nav-button {
  width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  color: var(--blue-dark);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccd8ee;
  border-radius: 12px;
  cursor: pointer;
}

.passage-nav-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.passage-nav-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.passage-picker {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 7px 9px 7px 13px;
  color: var(--blue-dark);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccd8ee;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 800;
}

.passage-picker select,
.representative-picker select {
  min-width: 0;
  width: 100%;
  min-height: 32px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d7dfed;
  border-radius: 8px;
  padding: 5px 30px 5px 9px;
  font: inherit;
}

.passage-heading,
.passage-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.passage-heading h3 {
  margin: 0;
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: 1.14rem;
  letter-spacing: -0.035em;
}

.rights-badge {
  flex: 0 0 auto;
  color: #49607c;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #d6ddec;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 0.72rem;
  font-weight: 750;
}

.passage-text {
  margin: 19px 0 14px;
  color: var(--ink);
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
  font-weight: 700;
  line-height: 1.65;
  letter-spacing: -0.025em;
  word-break: keep-all;
}

.manuscript-active-info {
  min-height: 42px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 0 0 11px;
  padding: 9px 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #d7e0f4;
  border-radius: 12px;
  font-size: 0.76rem;
}

.manuscript-active-info[hidden] {
  display: none;
}

.manuscript-active-info > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.manuscript-active-info strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.manuscript-active-info p {
  margin: 0;
}

#passageStrokeTip {
  color: var(--blue);
  text-align: center;
  font-weight: 720;
}

#passageStrokeStats {
  color: var(--ink);
  font-weight: 750;
  white-space: nowrap;
}

.manuscript-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 15px;
}

.manuscript-cell {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #cfd9ed;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(31, 54, 96, 0.045);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.manuscript-cell:hover {
  transform: translateY(-1px);
  border-color: var(--blue);
}

.manuscript-cell.is-active {
  transform: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(49, 91, 214, 0.18), 0 13px 28px rgba(49, 91, 214, 0.14);
}

.manuscript-cell.is-complete:not(.is-active) {
  border-color: #9bd0c1;
}

.component-cell.is-review:not(.is-active) {
  border-color: #d7ae67;
  background: #fffaf0;
}

.component-cell.is-locked {
  cursor: not-allowed;
  opacity: 0.58;
}

.component-cell.is-locked.is-active {
  border-color: #aeb8ca;
  box-shadow: 0 0 0 2px rgba(116, 128, 153, 0.12);
}

.component-cell.is-locked.is-active .manuscript-cell-head {
  color: #687791;
  background: #eef1f6;
  border-color: #d8deea;
}

.component-cell.is-locked.is-active .manuscript-cell-number,
.component-cell.is-locked.is-active .component-cell-context {
  color: #7e899c;
}

.manuscript-cell-head {
  min-height: 34px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  background: #f8faff;
  border-bottom: 1px solid #dce4f3;
}

.manuscript-cell.is-active .manuscript-cell-head {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.manuscript-cell-number {
  color: #7a879e;
  font-size: 0.66rem;
  font-weight: 800;
}

.manuscript-cell.is-active .manuscript-cell-number {
  color: rgba(255, 255, 255, 0.75);
}

.manuscript-cell-target {
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
}

.manuscript-cell-status {
  color: #75829a;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 750;
}

.manuscript-cell.is-complete .manuscript-cell-status {
  color: var(--success);
}

.manuscript-cell.is-active .manuscript-cell-status {
  color: rgba(255, 255, 255, 0.86);
}

.manuscript-cell-stage {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background:
    linear-gradient(rgba(49, 91, 214, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 91, 214, 0.08) 1px, transparent 1px),
    #fff;
  background-size: 25% 25%;
}

.manuscript-cell-stage::after {
  position: absolute;
  top: 82%;
  right: 0;
  left: 0;
  z-index: 1;
  height: 0;
  content: "";
  border-top: 2px solid rgba(236, 112, 77, 0.74);
  pointer-events: none;
}

.manuscript-preview {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.manuscript-cell .canvas-wrap {
  z-index: 3;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  box-shadow: none;
}

.manuscript-cell .canvas-baseline span {
  display: none;
}

.manuscript-cell .canvas-corner {
  width: 13px;
  height: 13px;
}

.manuscript-cell .canvas-corner::before {
  width: 13px;
}

.manuscript-cell .canvas-corner::after {
  height: 13px;
}

.passage-meta {
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.55;
}

.passage-meta p {
  margin: 0;
}

.passage-meta strong {
  flex: 0 0 auto;
  color: var(--blue-dark);
  font-size: 0.8rem;
}

.passage-counts {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.passage-counts > span {
  color: var(--ink-soft);
  font-weight: 700;
}

.passage-progress {
  height: 5px;
  margin-top: 11px;
  overflow: hidden;
  background: rgba(202, 212, 233, 0.66);
  border-radius: 999px;
}

.passage-progress span {
  width: 0;
  height: 100%;
  display: block;
  background: linear-gradient(90deg, var(--blue), var(--success));
  border-radius: inherit;
  transition: width 250ms ease;
}

.representative-panel {
  margin: 18px 0 24px;
  padding: 21px;
  background: linear-gradient(145deg, #fffdf9, #fff 64%);
  border: 1px solid #e4d8c9;
  border-radius: 18px;
}

.representative-panel[hidden] {
  display: none;
}

.representative-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.representative-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  letter-spacing: -0.035em;
}

.representative-heading > p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
}

.representative-picker {
  display: grid;
  grid-template-columns: auto minmax(0, 230px);
  align-items: center;
  gap: 11px;
  margin: 16px 0 13px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
}

.representative-samples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
}

.representative-sample {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9deea;
  border-radius: 13px;
  cursor: pointer;
  text-align: left;
}

.representative-sample.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(49, 91, 214, 0.15);
}

.representative-sample-stage {
  position: relative;
  aspect-ratio: 1;
  display: block;
  background:
    linear-gradient(rgba(49, 91, 214, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 91, 214, 0.07) 1px, transparent 1px),
    #fff;
  background-size: 25% 25%;
  border-bottom: 1px solid #e2e6ef;
}

.representative-sample-label,
.representative-sample strong {
  display: block;
  padding: 7px 9px 0;
  font-size: 0.72rem;
}

.representative-sample-label {
  overflow: hidden;
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.representative-sample strong {
  padding-top: 3px;
  padding-bottom: 9px;
  color: var(--blue);
}

.representative-help {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.55;
}

.composition-panel {
  margin: 18px 0 24px;
  padding: 21px;
  background: linear-gradient(145deg, #f4f8ff, #fbfffd 70%);
  border: 1px solid #cedbf4;
  border-radius: 18px;
}

.composition-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.composition-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  letter-spacing: -0.035em;
}

.composition-heading > strong {
  flex: 0 0 auto;
  color: var(--blue-dark);
  font-size: 0.84rem;
}

.composition-copy {
  margin: 11px 0 12px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.6;
}

.composition-progress {
  height: 5px;
  overflow: hidden;
  background: rgba(202, 212, 233, 0.72);
  border-radius: 999px;
}

.composition-progress span {
  width: 0;
  height: 100%;
  display: block;
  background: linear-gradient(90deg, var(--blue), var(--success));
  border-radius: inherit;
  transition: width 250ms ease;
}

.composition-groups {
  display: grid;
  gap: 15px;
  margin-top: 17px;
}

.composition-group h4 {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.composition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 8px;
}

.composition-tab {
  min-height: 80px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  justify-content: initial;
  gap: 2px 9px;
  padding: 10px 11px;
  text-align: left;
}

.composition-tab span {
  grid-row: 1 / 3;
  align-self: center;
}

.composition-tab em,
.composition-tab small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composition-tab em {
  align-self: end;
  color: var(--ink);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
}

.composition-tab small {
  align-self: start;
}

.composition-trial-panel {
  margin: 22px 0;
  padding: clamp(22px, 4vw, 36px);
  background: linear-gradient(145deg, #ffffff, #f3f7ff 58%, #f2fbf8);
  border: 1px solid #cad7ef;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.composition-trial-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.composition-trial-heading h2 {
  margin: 0;
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  letter-spacing: -0.05em;
}

.composition-trial-heading p:last-child {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.7;
  word-break: keep-all;
}

.composition-trial-state {
  flex: 0 0 auto;
  padding: 9px 13px;
  color: #5d687b;
  background: #edf0f5;
  border: 1px solid #d9dee8;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
}

.composition-trial-state.is-ready,
.composition-trial-state.is-complete {
  color: #0d7059;
  background: #e9f8f3;
  border-color: #b9e3d6;
}

.composition-trial-state.is-busy,
.composition-trial-state.is-stale {
  color: #8b5c16;
  background: #fff6df;
  border-color: #ead397;
}

.composition-trial-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  gap: 18px;
  margin-top: 25px;
}

.composition-coverage,
.composition-trial-launch {
  padding: 17px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 17px;
}

.composition-coverage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.composition-coverage div,
.composition-trial-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.composition-coverage div {
  min-height: 58px;
  padding: 10px 13px;
  background: #f7f9fd;
  border-radius: 12px;
}

.composition-coverage span,
.composition-trial-summary span {
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 750;
}

.composition-coverage strong {
  color: var(--blue-dark);
  font-size: 0.95rem;
}

.composition-trial-launch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.composition-trial-launch p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.55;
}

.composition-trial-launch .button {
  min-height: 48px;
  white-space: nowrap;
}

.composition-trial-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 25px;
}

.composition-trial-summary div {
  min-height: 60px;
  padding: 12px 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.composition-trial-summary strong {
  font-size: 1.16rem;
}

.composition-trial-summary .is-ready strong { color: var(--success); }
.composition-trial-summary .is-review strong { color: #a16916; }
.composition-trial-summary .is-blocked strong { color: var(--danger); }
.composition-trial-summary .is-reviewed strong { color: var(--blue-dark); }

.composition-trial-results {
  display: grid;
  gap: 28px;
}

.composition-trial-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed #bfcbe0;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.7;
  text-align: center;
}

.composition-trial-group-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 12px;
}

.composition-trial-group-heading h3 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
}

.composition-trial-group-heading p {
  max-width: 620px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.55;
  text-align: right;
}

.composition-trial-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 13px;
}

.composition-trial-card {
  min-width: 0;
  padding: 15px;
  background: #fff;
  border: 1px solid #d9dfeb;
  border-radius: 17px;
  box-shadow: 0 10px 28px rgba(23, 36, 61, 0.055);
}

.composition-trial-card.is-user-accepted {
  border-color: #70b9a7;
  box-shadow: 0 0 0 2px rgba(23, 132, 106, 0.13);
}

.composition-trial-card.is-user-needs-review {
  border-color: #dcad62;
  box-shadow: 0 0 0 2px rgba(207, 145, 45, 0.13);
}

.composition-trial-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.composition-trial-card-heading > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.composition-trial-character {
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: 1.7rem;
}

.composition-trial-card-heading > div span {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.composition-trial-badge {
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.composition-trial-badge.is-ready {
  color: #0d7059;
  background: #e8f7f2;
}

.composition-trial-badge.is-review {
  color: #8b5c16;
  background: #fff4d8;
}

.composition-trial-badge.is-blocked {
  color: #9d3838;
  background: #fff0f0;
}

.composition-trial-risk {
  width: fit-content;
  margin: 8px 0 0;
  padding: 5px 8px;
  color: #8b5c16;
  background: #fff6df;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 800;
}

.composition-trial-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.composition-trial-preview {
  min-width: 0;
  margin: 0;
}

.composition-trial-preview-stage {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background:
    linear-gradient(rgba(49, 91, 214, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 91, 214, 0.06) 1px, transparent 1px),
    #fbfcff;
  background-size: 25% 25%;
  border: 1px solid #e1e6ef;
  border-radius: 11px;
}

.composition-trial-svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.composition-trial-preview-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 8px;
  color: #8b95a7;
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: 1.45rem;
  font-weight: 700;
  text-align: center;
}

.composition-trial-preview figcaption {
  padding-top: 6px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 750;
  text-align: center;
}

.composition-trial-reason,
.composition-trial-sources {
  margin: 10px 0 0;
  font-size: 0.8rem;
  line-height: 1.55;
}

.composition-trial-reason {
  color: var(--ink);
  font-weight: 700;
}

.composition-trial-sources {
  min-height: 2.5em;
  color: var(--ink-soft);
}

.composition-trial-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.composition-review-button,
.composition-rewrite-button {
  min-height: 42px;
  padding: 7px 10px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 0.79rem;
  font-weight: 800;
  cursor: pointer;
}

.composition-review-button[aria-pressed="true"].is-accept {
  color: #0d7059;
  background: #e8f7f2;
  border-color: #70b9a7;
}

.composition-review-button[aria-pressed="true"].is-flag {
  color: #8b5c16;
  background: #fff4d8;
  border-color: #dcad62;
}

.composition-review-button:disabled {
  color: #a4acb9;
  background: #f1f3f6;
  cursor: not-allowed;
}

.composition-rewrite-button {
  grid-column: 1 / -1;
  color: var(--blue-dark);
  border-color: #b8c7ed;
}

.composition-trial-note {
  margin: 24px 0 0;
  padding: 15px 17px;
  color: #495974;
  background: #edf3ff;
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.65;
}

.supplement-heading {
  margin-top: 20px;
}

.supplement-heading .section-kicker {
  margin-bottom: 5px;
}

.supplement-heading p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.55;
}

.glyph-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 18px;
  margin: 24px 0 16px;
}

.glyph-group {
  min-width: 0;
}

.glyph-group-title {
  margin: 0 0 7px;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 800;
}

.glyph-group-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.glyph-tab {
  min-width: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #f8f9fc;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.glyph-tab:hover {
  border-color: #a8b8e5;
  transform: translateY(-1px);
}

.glyph-tab.is-active {
  color: var(--blue);
  background: var(--blue-pale);
  border-color: #9bb0ed;
  box-shadow: inset 0 0 0 1px rgba(49, 91, 214, 0.13);
}

.glyph-tab.is-complete:not(.is-active) {
  background: #f0faf7;
  border-color: #bce2d7;
}

.glyph-tab span {
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: 1.55rem;
  font-weight: 700;
}

.glyph-tab small {
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 700;
}

.glyph-tab.is-complete small {
  color: var(--success);
}

.canvas-shell {
  padding: 16px;
  background: #f8faff;
  border: 1px solid #dfe6f5;
  border-radius: 22px;
}

.supplement-writing-panel[hidden] {
  display: none;
}

.supplement-writing-home {
  min-height: 0;
}

.canvas-topline {
  min-height: 33px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.canvas-topline .target-label {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.canvas-topline strong {
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: 1.2rem;
}

.stroke-tip {
  margin-left: auto;
  color: var(--blue);
  background: var(--blue-pale);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 700;
}

.canvas-wrap {
  position: relative;
  width: min(100%, 520px);
  margin: 0 auto;
  aspect-ratio: 1;
  background: #fff;
  border: 1px solid #cad3e5;
  box-shadow: 0 13px 38px rgba(42, 62, 101, 0.08);
}

.canvas-baseline {
  position: absolute;
  top: 82%;
  left: 0;
  right: 0;
  z-index: 2;
  height: 0;
  border-top: 2px solid rgba(236, 112, 77, 0.9);
  pointer-events: none;
}

.canvas-baseline::after {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 20px;
  content: "";
  background: linear-gradient(rgba(236, 112, 77, 0.055), transparent);
}

.canvas-baseline span {
  position: absolute;
  right: 9px;
  bottom: 6px;
  padding: 3px 6px;
  color: #b9492d;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

#writingCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.canvas-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.canvas-corner::before,
.canvas-corner::after {
  position: absolute;
  content: "";
  background: var(--coral);
}

.canvas-corner::before {
  width: 18px;
  height: 2px;
}

.canvas-corner::after {
  width: 2px;
  height: 18px;
}

.canvas-corner.top-left { top: -1px; left: -1px; }
.canvas-corner.top-right { top: -1px; right: -1px; transform: rotate(90deg); }
.canvas-corner.bottom-right { right: -1px; bottom: -1px; transform: rotate(180deg); }
.canvas-corner.bottom-left { bottom: -1px; left: -1px; transform: rotate(270deg); }

.canvas-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 2px 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.canvas-meta p {
  margin: 0;
}

#strokeStats {
  flex: 0 0 auto;
  color: var(--ink);
  font-weight: 750;
}

.writing-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 17px;
}

.brush-control {
  min-width: 190px;
  display: grid;
  grid-template-columns: auto minmax(74px, 1fr) auto;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.brush-control input {
  width: 100%;
  accent-color: var(--blue);
}

.brush-control output {
  min-width: 26px;
  color: var(--ink);
}

.tool-buttons {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 15px;
  font-size: 0.84rem;
  font-weight: 780;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:focus-visible,
.glyph-tab:focus-visible,
.manuscript-cell:focus-visible,
.passage-nav-button:focus-visible,
.representative-sample:focus-visible,
.composition-review-button:focus-visible,
.composition-rewrite-button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(49, 91, 214, 0.28);
  outline-offset: 2px;
}

.button:disabled {
  color: #9ba5b5;
  background: #edf0f5;
  border-color: #e2e6ed;
  cursor: not-allowed;
}

.button svg {
  width: 17px;
  height: 17px;
}

.button-ghost {
  background: #fff;
  border-color: var(--line);
}

.button-secondary {
  color: var(--blue);
  background: var(--blue-pale);
  border-color: #ced9f7;
}

.button-primary {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 9px 22px rgba(49, 91, 214, 0.2);
}

.button-primary:hover:not(:disabled) {
  background: var(--blue-dark);
  box-shadow: 0 12px 28px rgba(49, 91, 214, 0.28);
}

.button-outline {
  color: var(--blue);
  background: #fff;
  border-color: #aebee9;
}

.button-danger-outline {
  color: var(--danger);
  background: #fff;
  border-color: #e6bcbc;
}

.button-danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 9px 22px rgba(181, 65, 65, 0.18);
}

.button-danger:hover:not(:disabled) {
  background: #963535;
}

.button-wide {
  width: 100%;
}

.build-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.progress-card,
.project-card,
.font-card {
  padding: 24px;
  border-radius: var(--radius-lg);
}

.progress-heading h2 {
  font-size: 1.65rem;
}

.progress-ring {
  --progress: 0deg;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(var(--blue) var(--progress), #edf0f6 0);
  border-radius: 50%;
}

.progress-ring::before {
  position: absolute;
  inset: 6px;
  content: "";
  background: #fff;
  border-radius: inherit;
}

.progress-ring span {
  position: relative;
  font-size: 0.72rem;
  font-weight: 800;
}

.progress-track {
  height: 6px;
  margin: 21px 0 18px;
  overflow: hidden;
  background: #edf0f6;
  border-radius: 999px;
}

.progress-track span {
  width: 0;
  height: 100%;
  display: block;
  background: linear-gradient(90deg, var(--blue), #6d8eec);
  border-radius: inherit;
  transition: width 250ms ease;
}

.glyph-checklist {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.glyph-checklist li {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: #f8f9fc;
  border: 1px solid #eef0f5;
  border-radius: 11px;
}

.glyph-checklist li span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #79859a;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-weight: 700;
}

.glyph-checklist li strong {
  margin-left: auto;
  color: #8993a4;
  font-size: 0.76rem;
}

.glyph-checklist li.is-complete {
  background: #f0faf7;
  border-color: #d0ebe3;
}

.glyph-checklist li.is-complete span {
  color: #fff;
  background: var(--success);
  border-color: var(--success);
}

.glyph-checklist li.is-complete strong {
  color: var(--success);
}

.category-checklist li span {
  width: auto;
  height: auto;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-family: inherit;
  font-size: 0.78rem;
}

.category-checklist li.is-complete span {
  color: var(--success);
  background: transparent;
  border-color: transparent;
}

.project-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.project-heading h2 {
  margin: 0;
  font-size: 1.16rem;
  letter-spacing: -0.035em;
}

.project-heading > strong {
  flex: 0 0 auto;
  color: var(--blue-dark);
  background: var(--blue-pale);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 0.76rem;
}

.project-copy,
.project-note {
  color: var(--ink-soft);
  line-height: 1.55;
}

.project-copy {
  margin: 11px 0 15px;
  font-size: 0.84rem;
}

.snapshot-label {
  display: block;
  margin: 17px 0 7px;
  font-size: 0.84rem;
  font-weight: 800;
}

.project-card select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 0 36px 0 11px;
  color: var(--ink);
  background: #fff;
  font-size: 0.86rem;
}

.project-card select:disabled {
  color: #8e98a9;
  background: #f1f3f7;
}

.snapshot-actions,
.backup-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.backup-actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.backup-share-button {
  grid-column: 1 / -1;
}

.project-note {
  margin: 11px 0 0;
  font-size: 0.76rem;
}

.font-card {
  position: sticky;
  top: 18px;
  overflow: hidden;
}

.font-card::after {
  position: absolute;
  right: -35px;
  bottom: -56px;
  width: 130px;
  height: 130px;
  content: "가";
  color: rgba(49, 91, 214, 0.055);
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: 7rem;
  font-weight: 700;
  transform: rotate(-8deg);
  pointer-events: none;
}

.font-card label,
.preview-card label {
  display: block;
  margin: 18px 0 8px;
  font-size: 0.84rem;
  font-weight: 800;
}

.name-input-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.name-input-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 91, 214, 0.12);
}

.name-input-wrap input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 12px 0 12px 13px;
  color: var(--ink);
  background: transparent;
  font-size: 0.92rem;
  font-weight: 700;
}

.name-input-wrap span {
  padding: 0 13px 0 8px;
  color: #8993a4;
  font-size: 0.79rem;
}

.field-help,
.build-note {
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.55;
}

.field-help {
  margin: 7px 0 17px;
}

.build-note {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
}

.result-section {
  margin-top: 24px;
  padding: 30px;
  border-radius: var(--radius-xl);
}

.result-section[hidden] {
  display: none;
}

.result-heading {
  align-items: center;
}

.result-heading h2 {
  font-size: 1.55rem;
}

.success-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--success);
  background: #e9f7f2;
  border: 1px solid #cce9df;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.76rem;
  font-weight: 800;
}

.success-badge svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(250px, 0.65fr);
  gap: 18px;
  margin-top: 22px;
}

.preview-card,
.download-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
}

.preview-card {
  background:
    linear-gradient(rgba(49, 91, 214, 0.045) 1px, transparent 1px),
    #fbfcff;
  background-size: 100% 42px;
}

.preview-card label {
  margin-top: 0;
}

.preview-card input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
}

.font-preview {
  min-height: 150px;
  display: flex;
  align-items: center;
  overflow-wrap: anywhere;
  padding: 22px 4px 10px;
  font-size: clamp(2.8rem, 7vw, 5.8rem);
  line-height: 1.25;
}

.preview-card > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.download-card {
  display: grid;
  align-content: start;
  gap: 11px;
}

.file-icon {
  width: 52px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 8px 15px 8px 8px;
  font-family: Georgia, serif;
  font-size: 1.2rem;
}

.download-card strong {
  display: block;
  overflow-wrap: anywhere;
}

.download-card p {
  margin: 4px 0 3px;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.download-card .word-download-help {
  margin: -3px 2px 2px;
  font-size: 0.7rem;
  line-height: 1.5;
}

.installed-name {
  margin: 3px 0 5px;
  padding: 12px 13px;
  background: var(--blue-pale);
  border: 1px solid #ced9f7;
  border-radius: 12px;
}

.installed-name span {
  display: block;
  margin-bottom: 5px;
  color: var(--blue-dark);
  font-size: 0.7rem;
  font-weight: 750;
}

.installed-name strong {
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.45;
}

.quality-panel {
  margin-top: 18px;
  padding: 20px;
  background: #f7fbfa;
  border: 1px solid #d7ebe5;
  border-radius: 18px;
}

.quality-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.quality-heading h3 {
  margin: 4px 0 0;
  font-size: 1.05rem;
}

.quality-summary {
  flex: 0 0 auto;
  color: #11664f;
  background: #e5f5f0;
  border: 1px solid #c7e7dd;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.76rem;
}

.quality-checklist {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 17px 0 0;
  padding: 0;
  list-style: none;
}

.quality-check {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: #fff;
  border: 1px solid #dce9e5;
  border-radius: 12px;
}

.quality-check-icon {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--success);
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 900;
}

.quality-check strong {
  display: block;
  font-size: 0.86rem;
}

.quality-check p,
.quality-note {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 0.74rem;
  line-height: 1.45;
}

.quality-note {
  margin-top: 14px;
}

.confirm-dialog {
  width: min(430px, calc(100% - 32px));
  padding: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 28px 90px rgba(23, 36, 61, 0.24);
}

.confirm-dialog::backdrop {
  background: rgba(16, 25, 43, 0.48);
  backdrop-filter: blur(3px);
}

.confirm-dialog form {
  padding: 26px;
}

.confirm-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--danger);
  background: #fff0f0;
  border-radius: 50%;
  font-weight: 900;
}

.confirm-dialog h2 {
  margin: 16px 0 8px;
  font-size: 1.22rem;
  letter-spacing: -0.035em;
}

.confirm-dialog p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.65;
}

.confirm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 22px;
}

.install-guide {
  display: grid;
  grid-template-columns: auto 1fr 1.5fr;
  align-items: center;
  gap: 24px;
  margin-top: 24px;
  padding: 26px 30px;
  border-radius: var(--radius-xl);
}

.guide-number {
  align-self: stretch;
  display: grid;
  place-items: center;
  padding-right: 24px;
  color: var(--coral);
  border-right: 1px solid var(--line);
  font-size: 1.1rem;
  font-weight: 850;
}

.install-guide h2 {
  font-size: 1.25rem;
  line-height: 1.35;
}

.install-guide ol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.word-test-note {
  grid-column: 3;
  margin: 10px 0 0;
  padding: 10px 12px;
  color: var(--ink-soft);
  background: #fff8ed;
  border: 1px solid #f2dcc4;
  border-radius: 10px;
  font-size: 0.76rem;
  line-height: 1.55;
}

.install-guide li {
  display: flex;
  gap: 9px;
}

.install-guide li > span {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-pale);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
}

.install-guide li p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.45;
}

.install-guide li strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 0.78rem;
}

.technical-note {
  margin-top: 16px;
  padding: 16px 20px;
  border-radius: 16px;
  box-shadow: none;
}

.technical-note summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.technical-note p {
  margin: 12px 0 1px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.7;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  max-width: calc(100% - 40px);
  padding: 11px 16px;
  color: #fff;
  background: rgba(23, 36, 61, 0.94);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(23, 36, 61, 0.22);
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 930px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .build-panel {
    grid-template-columns: 1fr 1fr;
  }

  .manuscript-board {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .font-card {
    position: relative;
    top: auto;
  }

  .install-guide {
    grid-template-columns: auto 1fr;
  }

  .install-guide ol {
    grid-column: 1 / -1;
  }

  .word-test-note {
    grid-column: 1 / -1;
  }

  .quality-checklist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .composition-trial-overview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header,
  main {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    min-height: 72px;
  }

  .local-note {
    width: 36px;
    height: 36px;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    white-space: nowrap;
  }

  .local-note svg {
    flex: 0 0 16px;
  }

  main {
    margin-top: 25px;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 31px 0 27px;
  }

  .intro h1 {
    font-size: clamp(2.25rem, 12vw, 3.6rem);
  }

  .intro-copy {
    font-size: 0.95rem;
  }

  .flow {
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    padding: 12px;
  }

  .flow-line {
    display: none;
  }

  .flow-step {
    justify-content: center;
    gap: 6px;
  }

  .flow-step strong {
    font-size: 0.72rem;
  }

  .flow-step span {
    width: 23px;
    height: 23px;
  }

  .writing-card,
  .result-section,
  .composition-trial-panel,
  .component-panel {
    padding: 20px;
    border-radius: 21px;
  }

  .component-panel {
    margin-top: 18px;
    padding: 17px 15px 16px 18px;
  }

  .component-set-nav {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 7px;
  }

  .component-heading,
  .component-meta {
    display: grid;
    gap: 7px;
  }

  .component-active-info {
    grid-template-columns: 1fr auto;
  }

  #componentGuideNote {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: left;
  }

  .component-meta > strong {
    justify-self: end;
  }

  .passage-enrichment > summary {
    align-items: flex-start;
    padding: 15px;
  }

  .passage-enrichment > summary small {
    max-width: 250px;
    line-height: 1.45;
  }

  .composition-trial-heading,
  .composition-trial-group-heading {
    display: grid;
    gap: 9px;
  }

  .composition-trial-group-heading p {
    text-align: left;
  }

  .composition-trial-state {
    width: fit-content;
  }

  .composition-trial-launch {
    grid-template-columns: 1fr;
  }

  .composition-trial-launch .button {
    width: 100%;
  }

  .composition-trial-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .composition-trial-card-grid {
    grid-template-columns: 1fr;
  }

  .card-heading {
    align-items: center;
  }

  .card-heading h2 {
    font-size: 1.2rem;
  }

  .save-state {
    flex: 0 0 auto;
  }

  .passage-card {
    margin-top: 18px;
    padding: 17px 15px 16px 18px;
  }

  .passage-set-nav {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 7px;
  }

  .passage-nav-button {
    width: 38px;
    min-height: 46px;
  }

  .passage-picker {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 6px 8px;
  }

  .passage-picker > span {
    padding-left: 3px;
    font-size: 0.72rem;
  }

  .passage-heading,
  .passage-meta {
    display: grid;
  }

  .rights-badge {
    width: fit-content;
  }

  .passage-text {
    margin: 15px 0 13px;
    font-size: 1.26rem;
    line-height: 1.9;
  }

  .manuscript-active-info {
    grid-template-columns: 1fr auto;
  }

  #passageStrokeTip {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: left;
  }

  .manuscript-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .passage-meta {
    gap: 5px;
  }

  .passage-counts {
    justify-content: space-between;
  }

  .representative-panel {
    padding: 17px;
  }

  .representative-heading {
    display: grid;
    gap: 7px;
  }

  .representative-heading > p {
    text-align: left;
  }

  .representative-picker {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .representative-samples {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .composition-panel {
    padding: 17px;
  }

  .composition-heading {
    display: grid;
    gap: 7px;
  }

  .composition-grid {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  }

  .glyph-tabs {
    grid-template-columns: 1fr;
  }

  .glyph-tab {
    min-height: 60px;
    gap: 7px;
  }

  .glyph-tab span {
    font-size: 1.3rem;
  }

  .canvas-shell {
    padding: 10px;
  }

  .stroke-tip {
    max-width: 150px;
    padding: 5px 8px;
    text-align: center;
  }

  .canvas-baseline span {
    right: 6px;
    font-size: 0.64rem;
  }

  .canvas-meta {
    display: grid;
    gap: 4px;
  }

  .writing-tools {
    display: grid;
  }

  .brush-control {
    width: 100%;
  }

  .tool-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .tool-buttons .button-secondary {
    grid-column: 1 / -1;
  }

  .tool-buttons .button-danger-outline {
    grid-column: 1 / -1;
  }

  .build-panel,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .result-heading {
    display: grid;
  }

  .success-badge {
    width: fit-content;
  }

  .quality-heading {
    display: grid;
    align-items: start;
  }

  .quality-summary {
    width: fit-content;
  }

  .quality-checklist {
    grid-template-columns: 1fr;
  }

  .install-guide {
    grid-template-columns: auto 1fr;
    padding: 22px 20px;
  }

  .install-guide ol {
    grid-template-columns: 1fr;
    gap: 13px;
  }
}

@media (max-width: 480px) {
  .manuscript-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manuscript-cell-status {
    font-size: 0.58rem;
  }

  .composition-coverage {
    grid-template-columns: 1fr;
  }

  .composition-trial-summary {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
.contextual-test-list { display: grid; gap: 8px; margin: 18px 0 10px; }
.contextual-test-list p { display: flex; align-items: center; gap: 12px; margin: 0; }
.contextual-test-list span { flex: 1; font-size: 14px; color: #59677c; }
.contextual-test-list strong { font-size: 22px; }
.contextual-test-list .is-ready { color: #315bd6; }
.contextual-test-list .is-missing { color: #7b8493; font-weight: 400; }
.contextual-test-status { font-size: 14px; line-height: 1.6; color: #315bd6; }
#contextualMissingBtn { margin-bottom: 10px; }
.legacy-font-options { border-top: 1px solid #dfe4ee; margin-top: 20px; padding-top: 16px; }
.legacy-font-options summary { cursor: pointer; font-size: 14px; color: #59677c; margin-bottom: 12px; }


/* First-use guidance and required progress share the writing layout. */
.work-start { margin: 0 0 24px; padding: 22px 26px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.work-start-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.work-start-heading p { margin: 0; font-weight: 700; line-height: 1.6; }
.work-start-heading .button { flex-shrink: 0; }
.work-start details { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.work-start summary { cursor: pointer; color: var(--blue-dark); font-weight: 700; }
.work-start details > p, .workflow-note, .transfer-note, .result-coverage { color: var(--ink-soft); font-size: .88rem; line-height: 1.7; }
.getting-started-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; padding-left: 22px; margin: 22px 0; color: var(--ink-soft); font-size: .9rem; line-height: 1.7; }
.getting-started-list strong { display: block; margin-bottom: 6px; color: var(--ink); }
.category-checklist li { padding: 0; }
.category-checklist li button, .required-inputs button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 9px 12px; border: 0; border-radius: 10px; color: var(--ink-soft); background: transparent; font: inherit; text-align: left; cursor: pointer; }
.category-checklist li button:hover, .required-inputs button:hover { background: var(--blue-pale); }
.category-checklist li button:focus-visible, .required-inputs button:focus-visible, .work-start summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.category-checklist li button span { font-size: .86rem; }
.required-inputs { margin-top: 18px; padding-top: 8px; border-top: 1px solid var(--line); }
.required-inputs > p:first-child { color: var(--ink); font-size: .9rem; font-weight: 700; }
.required-inputs button { margin-bottom: 8px; background: #f8f9fc; font-size: .84rem; }
.required-inputs strong { white-space: nowrap; font-size: .8rem; }
.transfer-note { margin: 18px 0; }
@media (max-width: 700px) {
  .work-start { padding: 20px; }
  .work-start-heading { align-items: stretch; flex-direction: column; gap: 12px; }
  .getting-started-list { grid-template-columns: 1fr; gap: 16px; }
}
