:root {
  --surface: #ffffff;
  --panel: #eef4f2;
  --soft: #f3f7f6;
  --head: #f5f8f7;
  --day-head: #e3f3ed;
  --selected: #e5f4ef;
  --track: #e9eff0;
  --input-border: #9cb0ab;
  --disabled: #e5ece9;
  --error: #9e2824;
  --error-bg: #fff3f0;
  --warning: #6b4c14;
  --warning-bg: #fff6e6;
  --button: #081f45;
  --button-text: #ffffff;
  --button-hover: #143566;
  --button-arrow: #42e8d0;
  --ink: #081f45;
  --muted: #46576b;
  --line: #d5e0e4;
  --paper: #f6f8f7;
  --aqua: #42e8d0;
  --wood: #156249;
  --fire: #ad342f;
  --earth: #7d5813;
  --metal: #49566e;
  --water: #1f569c;
  font-size: 18px;
  color-scheme: light;
  font-family: "Noto Sans KR", "Pretendard", "맑은 고딕", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  line-height: 1.7;
  scroll-behavior: smooth;
  scrollbar-color: #9eb2b8 var(--paper);
}

:root[data-theme="dark"] {
  --ink: #f4f7fc;
  --muted: #d8e2ef;
  --line: #384c63;
  --paper: #0e1826;
  --surface: #152336;
  --panel: #192b3b;
  --soft: #1e3146;
  --head: #1d2f44;
  --day-head: #21433d;
  --selected: #234e45;
  --track: #2f4359;
  --input-border: #7f9892;
  --disabled: #223338;
  --error: #ffb4a9;
  --error-bg: #482628;
  --warning: #f3d59b;
  --warning-bg: #42361f;
  --button: #42e8d0;
  --button-text: #081f45;
  --button-hover: #8cf2e1;
  --button-arrow: #081f45;
  --wood: #a5edcf;
  --fire: #ffc1b9;
  --earth: #f8dda4;
  --metal: #e1e8f5;
  --water: #b4d3ff;
  color-scheme: dark;
  scrollbar-color: #61798c var(--paper);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
summary {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-underline-offset: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--wood);
  outline-offset: 3px;
}

::selection {
  background: var(--aqua);
  color: #081f45;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.38;
  word-break: keep-all;
  letter-spacing: -0.03em;
}

p {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  background: var(--button);
  color: var(--button-text);
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 30;
}

.skip-link:focus {
  top: 12px;
}

/* Header & Display Controls */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  min-height: 92px;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  min-width: 0;
}

.brand svg {
  width: 42px;
  height: 42px;
  fill: #081f45;
  flex-shrink: 0;
}

.brand svg path {
  stroke: var(--aqua);
  stroke-width: 1.8;
  fill: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-text strong {
  font-size: 1.222rem;
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.25;
}

.brand-text small {
  font-size: 0.833rem;
  color: var(--muted);
  line-height: 1.3;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.display-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.944rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.font-setting,
.theme-setting {
  display: flex;
  align-items: center;
  gap: 10px;
}

.font-buttons {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  color: var(--ink);
}

.font-buttons button {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  width: 44px;
  height: 44px;
  line-height: 1;
}

.font-buttons button:hover:not(:disabled) {
  background: var(--selected);
}

.font-buttons button:disabled {
  opacity: 0.5;
  cursor: default;
}

.font-buttons button:focus-visible {
  outline-offset: -4px;
}

.font-buttons output {
  min-width: 38px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  font-weight: 650;
}

.theme-setting select {
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  min-height: 44px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 600;
}

.header-link {
  font-size: 0.944rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  padding: 8px 0;
  white-space: nowrap;
}

.header-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

.header-link span {
  margin-left: 4px;
}

/* Main Layout */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
}

/* Intro Banner */
.intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 44px 0 36px;
  gap: 32px;
}

.intro h1 {
  font-size: 2.556rem;
  font-weight: 750;
  line-height: 1.35;
}

.intro h1 span {
  color: var(--wood);
}

.intro-lead {
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.056rem;
  line-height: 1.85;
}

.intro-note {
  padding: 18px 22px;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 1px solid var(--wood);
  border-radius: 12px;
}

.note-mark {
  display: block;
  font-family: "Noto Serif CJK KR", "Batang", serif;
  font-size: 1.556rem;
  letter-spacing: 0.24em;
  color: var(--wood);
  font-weight: 600;
}

.intro-note p {
  font-size: 0.944rem;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.75;
}

.mobile-break {
  display: none;
}

/* Step Labels & Typography Helpers */
.step-label {
  display: inline-block;
  font-size: 0.833rem;
  font-weight: 700;
  color: var(--wood);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

h2 {
  font-size: 1.389rem;
  font-weight: 750;
}

.muted {
  color: var(--muted);
}

/* Workspace Split View */
.workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  align-items: stretch;
  box-shadow: 0 2px 10px rgba(8, 31, 69, 0.03);
}

/* Input Panel */
.input-panel {
  padding: 32px 28px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.input-intro {
  font-size: 1rem;
  margin-top: 6px;
}

form {
  margin-top: 24px;
}

.field-group + .field-group {
  margin-top: 22px;
}

.field-group > label:not(.checkbox-label),
form > label:not(.checkbox-label) {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.field-note {
  font-size: 0.889rem;
  color: var(--muted);
  font-weight: 500;
}

input[type="date"],
input[type="time"] {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.056rem;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  caret-color: var(--wood);
}

input:disabled {
  background: var(--disabled);
  color: var(--muted);
  cursor: not-allowed;
}

.field-help {
  font-size: 0.889rem;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 8px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 12px;
  cursor: pointer;
  min-height: 36px;
}

.checkbox-label input {
  accent-color: var(--wood);
  height: 20px;
  width: 20px;
  margin: 0;
  flex-shrink: 0;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--button);
  color: var(--button-text);
  border: 0;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 1.056rem;
  font-weight: 700;
  width: 100%;
  min-height: 54px;
  margin-top: 26px;
  transition: background 0.16s;
}

.primary-button:hover {
  background: var(--button-hover);
}

.primary-button svg {
  width: 20px;
  height: 20px;
  stroke: var(--button-arrow);
  stroke-width: 1.7;
  fill: none;
  flex-shrink: 0;
}

.form-error {
  font-size: 0.944rem;
  font-weight: 600;
  color: var(--error);
  background: var(--error-bg);
  border: 1px solid var(--error);
  padding: 12px 14px;
  border-radius: 8px;
  margin-top: 16px;
}

.example-block {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 20px;
}

.example-block > p {
  font-size: 0.889rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.text-button {
  border: 0;
  background: none;
  padding: 6px 0;
  font-size: 1rem;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.text-button:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.privacy-note {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 0.889rem;
  line-height: 1.75;
}

.privacy-note svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.4;
  fill: none;
  flex-shrink: 0;
  margin-top: 4px;
}

/* Result Panel */
.result-panel {
  padding: 32px 34px 36px;
  scroll-margin-top: 20px;
  min-width: 0;
}

.result-panel:focus {
  outline: none;
}

.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.result-heading h2 {
  font-size: 1.389rem;
}

.result-heading .muted {
  font-size: 0.944rem;
  margin-top: 6px;
}

.example-badge {
  background: var(--day-head);
  color: var(--wood);
  border: 1px solid var(--wood);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.889rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Empty State */
.empty-state {
  min-height: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 16px;
}

.empty-characters {
  display: flex;
  gap: 14px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 3rem;
  font-family: "Noto Serif CJK KR", "Batang", serif;
}

.empty-characters span {
  padding: 4px 14px;
  border-bottom: 2px solid var(--line);
}

.empty-state h3 {
  font-size: 1.278rem;
}

.empty-state p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--muted);
  margin: 12px 0 18px;
}

/* Warnings & Chart Guide */
.chart-warnings:not(:empty) {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--warning-bg);
  color: var(--warning);
  border-radius: 8px;
  font-size: 0.944rem;
  line-height: 1.7;
}

.chart-warnings p + p {
  margin-top: 8px;
}

.chart-guide {
  font-size: 0.944rem;
  color: var(--muted);
  margin: 22px 0 14px;
}

.chart-guide span {
  margin-left: 6px;
  color: var(--ink);
  font-weight: 600;
}

/* Four Pillars Grid — Strict Column Alignment */
.pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.pillar {
  display: flex;
  flex-direction: column;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  min-width: 0;
}

.pillar h3 {
  font-size: 1rem;
  font-weight: 750;
  background: var(--head);
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  min-height: 4.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pillar h3 > span {
  display: block;
  font-size: 0.833rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 3px;
  letter-spacing: 0;
}

.day-pillar {
  border-color: var(--wood);
  box-shadow: inset 0 0 0 1px var(--wood);
}

.day-pillar h3 {
  background: var(--day-head);
}

.glyph-button {
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 0;
  background: transparent;
  min-height: 9rem;
  padding: 14px 4px 12px;
  transition: background 0.16s;
}

.glyph-button:hover {
  background: var(--soft);
}

.glyph-button[aria-pressed="true"] {
  background: var(--selected);
  box-shadow: inset 0 0 0 2px var(--wood);
}

.glyph-button:focus-visible {
  outline-offset: -4px;
}

.glyph {
  font-family: "Noto Serif CJK KR", "Batang", serif;
  font-size: 3rem;
  line-height: 1.15;
}

.glyph-name {
  font-size: 0.944rem;
  font-weight: 700;
  margin-top: 6px;
  line-height: 1.3;
}

.polarity {
  position: static;
  order: 3;
  margin-top: 3px;
  font-size: 0.778rem;
  line-height: 1.2;
  color: var(--muted);
}

.god-label {
  font-size: 0.889rem;
  padding: 6px 4px;
  border-block: 1px solid var(--line);
  color: var(--muted);
  background: var(--head);
  height: 3.1rem;
  min-height: 3.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.35;
}

.day-pillar .god-label {
  color: var(--wood);
  font-weight: 700;
  background: var(--day-head);
}

.unknown-pillar {
  flex: 1;
  min-height: calc(18rem + 3.1rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 6px;
  font-size: 0.889rem;
  color: var(--muted);
  line-height: 1.6;
}

.unknown-pillar > span {
  font-size: 2rem;
  color: var(--muted);
}

/* Character Reading Panel — Core Explanation >= 1rem */
.reading-panel {
  margin-top: 26px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--head);
}

.reading-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  animation: reading-in 0.22s ease-out;
}

@keyframes reading-in {
  from {
    transform: translateY(4px);
  }
  to {
    transform: translateY(0);
  }
}

.reading-glyph {
  font-family: "Noto Serif CJK KR", "Batang", serif;
  font-size: 3.111rem;
  line-height: 1.15;
  flex-shrink: 0;
}

.reading-category {
  display: inline-block;
  font-size: 0.889rem;
  font-weight: 600;
  color: var(--muted);
}

.reading-top h3 {
  font-size: 1.222rem;
  margin-top: 3px;
}

.reading-panel p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--muted);
}

.reading-relation {
  margin-top: 18px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.reading-relation h4 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--ink);
}

.reading-relation p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--muted);
}

/* Five Elements Section */
.elements-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 10px;
  flex-wrap: wrap;
}

.section-heading h3 {
  font-size: 1.111rem;
}

.section-heading > span {
  font-size: 0.889rem;
  color: var(--muted);
}

.element-bars {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.element-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.944rem;
}

.element-label {
  font-weight: 750;
  width: 22px;
}

.bar-track {
  height: 9px;
  background: var(--track);
  flex: 1;
  border-radius: 5px;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  background: currentColor;
  border-radius: 5px;
}

.element-count {
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  text-align: right;
  font-weight: 700;
}

.element-count > span {
  font-size: 0.833rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 3px;
}

.e0,
.e1,
.e2,
.e3,
.e4 {
  transition: color 0.15s;
}

.e0 {
  color: var(--wood);
}

.e1 {
  color: var(--fire);
}

.e2 {
  color: var(--earth);
}

.e3 {
  color: var(--metal);
}

.e4 {
  color: var(--water);
}

/* Lesson Accordion Section */
.lesson-section {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 36px;
  padding: 52px 0 42px;
  border-bottom: 1px solid var(--line);
}

.lesson-heading h2 {
  font-size: 1.389rem;
}

.lesson-heading p {
  font-size: 1rem;
  margin-top: 8px;
}

.lesson-list details {
  border-bottom: 1px solid var(--line);
}

.lesson-list details:first-child {
  border-top: 1px solid var(--line);
}

summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  font-size: 1.056rem;
  font-weight: 700;
}

summary::-webkit-details-marker {
  display: none;
}

.details-plus {
  font-size: 1.333rem;
  font-weight: 400;
  color: var(--wood);
  flex-shrink: 0;
}

details[open] .details-plus {
  transform: rotate(45deg);
}

details > p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--muted);
  padding: 0 20px 20px 0;
}

/* Rules & Limitations Section */
.rules-section {
  padding: 36px 0 42px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 36px;
}

.rules-section h2 {
  font-size: 1.167rem;
}

.rules-content p {
  font-size: 0.944rem;
  line-height: 1.85;
  color: var(--muted);
}

.rules-content p + p {
  margin-top: 12px;
}

.rules-content a {
  font-weight: 700;
}

/* Footer */
footer {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 26px 40px 36px;
  display: flex;
  align-items: baseline;
  gap: 24px;
  font-size: 0.944rem;
}

footer > span {
  font-weight: 750;
}

footer p {
  color: var(--muted);
  flex: 1;
  font-size: 0.889rem;
}

footer a {
  font-size: 0.889rem;
  font-weight: 600;
  text-decoration: none;
}

.noscript {
  padding: 20px;
  text-align: center;
  background: #fff4ed;
  color: #081f45;
}

/* Responsive Breakpoints */
@media (max-width: 1080px) {
  .header-inner,
  main,
  footer {
    padding-left: 24px;
    padding-right: 24px;
  }

  .workspace {
    grid-template-columns: 290px minmax(0, 1fr);
  }

  .input-panel {
    padding: 26px 22px;
  }

  .result-panel {
    padding: 26px 24px;
  }

  .intro h1 {
    font-size: 2.278rem;
  }

  .lesson-section,
  .rules-section {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 28px;
  }

  .chart-guide span {
    display: block;
    margin-left: 0;
    margin-top: 2px;
  }

  .pillars {
    gap: 6px;
  }

  .glyph {
    font-size: 2.667rem;
  }
}

@media (max-width: 820px) {
  .header-inner {
    padding: 14px 20px;
    gap: 12px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  main {
    padding-inline: 20px;
  }

  .intro {
    padding: 32px 0 26px;
  }

  .intro h1 {
    font-size: 2rem;
  }

  .intro-note {
    display: none;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .input-panel {
    padding: 24px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .privacy-note {
    margin-top: 18px;
    padding-top: 0;
    align-items: center;
  }

  .privacy-note br {
    display: none;
  }

  .privacy-note svg {
    margin: 0;
  }

  .result-panel {
    padding: 26px 20px 30px;
  }

  .empty-state {
    min-height: 340px;
    padding: 28px 10px;
  }

  .empty-characters {
    font-size: 2.333rem;
    gap: 10px;
  }

  .empty-characters span {
    padding: 2px 8px;
  }

  .reading-panel {
    padding: 20px 18px;
  }

  .reading-relation {
    padding: 16px;
  }

  .lesson-section,
  .rules-section {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-block: 34px 30px;
  }

  footer {
    padding-inline: 20px;
    gap: 14px;
    flex-wrap: wrap;
  }

  footer p {
    order: 3;
    flex-basis: 100%;
  }

  footer a {
    margin-left: auto;
  }
}

@media (max-width: 480px) {
  .header-inner,
  main,
  footer {
    padding-inline: 12px;
  }

  .brand svg {
    width: 34px;
    height: 34px;
  }

  .brand-text strong {
    font-size: 1.056rem;
  }

  .brand-text small {
    display: none;
  }

  .display-controls {
    gap: 10px;
    font-size: 0.833rem;
    width: 100%;
    justify-content: space-between;
  }

  .font-setting,
  .theme-setting {
    gap: 6px;
  }

  .font-buttons button {
    width: 38px;
    height: 40px;
  }

  .font-buttons output {
    min-width: 28px;
  }

  .theme-setting select {
    min-height: 40px;
    padding-inline: 6px;
  }

  .header-link {
    font-size: 0.833rem;
  }

  .header-link span {
    display: none;
  }

  .intro h1 {
    font-size: 1.778rem;
  }

  .input-panel {
    padding: 20px 14px;
  }

  .result-panel {
    padding: 22px 12px 26px;
  }

  .pillars {
    gap: 4px;
  }

  .pillar h3 {
    font-size: 0.889rem;
    padding: 10px 2px;
    min-height: 3.9rem;
  }

  .pillar h3 > span {
    font-size: 0.722rem;
  }

  .glyph-button {
    padding-inline: 2px;
    min-height: 8.4rem;
  }

  .glyph {
    font-size: clamp(1.5rem, 9.5vw, 2.222rem);
  }

  .glyph-name {
    font-size: 0.778rem;
  }

  .polarity {
    font-size: 0.722rem;
  }

  .god-label {
    font-size: 0.778rem;
    height: 3rem;
    min-height: 3rem;
    padding-inline: 2px;
  }

  .unknown-pillar {
    min-height: calc(16.8rem + 3rem);
    font-size: 0.778rem;
    padding-inline: 2px;
  }

  .reading-panel {
    padding: 18px 14px;
  }

  .reading-top {
    gap: 12px;
  }

  .reading-top h3 {
    font-size: 1.056rem;
  }

  .reading-relation {
    padding: 14px 12px;
  }

  details > p {
    padding-right: 4px;
  }

  .privacy-note p {
    word-break: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .site-header {
    border-bottom: 1px solid #cccccc;
  }

  .header-actions,
  .input-panel,
  .intro,
  .lesson-section,
  .rules-section,
  footer,
  .skip-link {
    display: none;
  }

  main {
    padding: 0;
  }

  .workspace {
    display: block;
    border: 0;
  }

  .result-panel {
    padding: 20px 0;
  }

  .glyph-button {
    print-color-adjust: exact;
  }

  .reading-panel,
  .elements-section {
    break-inside: avoid;
  }
}

/* Keep the rotated disclosure mark inside the row at maximum text size. */
.details-plus { width: 1em; height: 1em; line-height: 1; text-align: center; flex-shrink: 0; }
.lesson-list summary { padding-right: .4rem; }
