:root {
  font-family: Inter, Pretendard, "Noto Sans KR", "Segoe UI", sans-serif;
  color: #e9f0fa;
  background: #101a2b;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.page { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding: 27px 0 70px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 800; letter-spacing: .03em; }
.brand img { display: block; width: 28px; height: 28px; flex: none; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 56px 0 29px; }
.eyebrow { margin: 0 0 12px; color: #82a9c6; font-size: 11px; font-weight: 800; letter-spacing: .18em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(29px, 4vw, 43px); letter-spacing: -.055em; line-height: 1.25; }
h2 { margin-bottom: 0; font-size: 22px; letter-spacing: -.04em; }
.description { margin-bottom: 0; color: #a7b5c8; font-size: 15px; }
.unit-picker, .input-card label { color: #aebcd0; font-size: 13px; font-weight: 650; }
.unit-picker { display: grid; gap: 9px; min-width: 155px; }
input, select { width: 100%; height: 42px; border: 1px solid #364960; border-radius: 8px; outline: none; background: #17253a; color: #f1f7ff; padding: 0 12px; }
input:focus, select:focus, button:focus-visible, .display:focus-visible { outline: 2px solid #78cfee; outline-offset: 2px; }
select { padding-right: 30px; }
.inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.screen-list-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.screen-list-actions button { border: 1px solid #426179; border-radius: 9px; padding: 10px 15px; background: #24455b; color: #eaf7fc; font-size: 13px; font-weight: 750; }
.screen-list-actions button:hover:not(:disabled) { background: #315e79; }
.screen-list-actions button:disabled { opacity: .5; cursor: default; }
#screen-count { margin-left: 8px; color: #a8d6e8; font-variant-numeric: tabular-nums; }
.input-card { position: relative; min-width: 0; margin: 0; padding: 20px 22px 17px; border: 1px solid #35465c; border-radius: 14px; background: #18263a; }
.remove-card { position: absolute; top: 12px; right: 14px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid #426179; border-radius: 7px; background: #20334a; color: #c5d3e2; font-size: 20px; line-height: 1; }
.remove-card:hover { background: #36546d; color: #fff; }
.input-card-a { border-top: 3px solid #76d7f1; }
.input-card-b { border-top: 3px solid #f3b678; }
.input-card-c { border-top: 3px solid #bda8ff; }
.input-card-d { border-top: 3px solid #8ed7a2; }
.input-card-e { border-top: 3px solid #f197ae; }
.input-card-f { border-top: 3px solid #e3d17d; }
.input-card legend { float: left; width: 100%; padding: 0; margin-bottom: 18px; color: #f4f7fb; font-size: 17px; font-weight: 800; }
.screen-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; vertical-align: 1px; }
.screen-dot-a { background: #76d7f1; }
.screen-dot-b { background: #f3b678; }
.screen-dot-c { background: #bda8ff; }
.screen-dot-d { background: #8ed7a2; }
.screen-dot-e { background: #f197ae; }
.screen-dot-f { background: #e3d17d; }
.field-grid { clear: both; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-grid label, .custom-ratio label { display: grid; gap: 9px; }
.custom-ratio { display: flex; align-items: end; gap: 11px; margin-top: 14px; }
.custom-ratio[hidden] { display: none; }
.custom-ratio label { width: 105px; }
.custom-ratio > span { padding-bottom: 9px; font-weight: 800; }
.pivot-control { display: flex; align-items: center; gap: 9px; width: fit-content; margin-top: 15px; cursor: pointer; }
.pivot-control input { width: 17px; height: 17px; margin: 0; padding: 0; accent-color: #78cfee; }
.pivot-control span { color: #d5e4f1; }
.input-error { min-height: 17px; margin: 10px 0 0; color: #ff9c91; font-size: 12px; }
.comparison, .stats { margin-top: 32px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.section-heading .eyebrow { margin-bottom: 6px; }
.section-heading > p { margin-bottom: 0; color: #8799af; font-size: 13px; }
.mode-switch { display: flex; gap: 3px; padding: 4px; border: 1px solid #34465b; border-radius: 10px; background: #17253a; }
.mode-button { border: 0; border-radius: 7px; padding: 9px 14px; background: transparent; color: #a7b6c9; font-size: 13px; font-weight: 700; }
.mode-button.is-active { background: #31576b; color: #f5fcff; }
.stage-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 15px; border: 1px solid #34465b; border-bottom: 0; border-radius: 12px 12px 0 0; background: #19283d; color: #a9bacf; font-size: 12px; }
.stage-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.zoom-control { display: flex; align-items: center; gap: 9px; margin-right: 9px; white-space: nowrap; }
.zoom-control input { width: 120px; height: 24px; padding: 0; border: 0; background: transparent; accent-color: #78cfee; }
.zoom-control output { min-width: 34px; color: #e9f0fa; font-variant-numeric: tabular-nums; }
.stage-actions button { border: 1px solid #3b5067; border-radius: 6px; padding: 6px 9px; background: #1e3046; color: #bdcadd; font-size: 12px; }
.stage-actions button:hover, .stage-actions button.is-active { background: #30506b; color: white; }
.stage-actions .screen-dot { width: 7px; height: 7px; margin-right: 5px; }
.stage { position: relative; height: clamp(420px, 55vw, 650px); overflow-x: auto; overflow-y: hidden; border: 1px solid #34465b; border-radius: 0 0 12px 12px; background: #122033; }
.stage-canvas { position: relative; height: 100%; min-width: 100%; background-image: linear-gradient(#ffffff08 1px, transparent 1px), linear-gradient(90deg, #ffffff08 1px, transparent 1px); background-size: 24px 24px; }
.display { position: absolute; display: flex; align-items: center; justify-content: center; min-width: 1px; min-height: 1px; border: 2px solid; border-radius: 3px; cursor: grab; touch-action: none; user-select: none; overflow: hidden; }
.display[hidden] { display: none; }
.display:active { cursor: grabbing; }
.display.is-selected { z-index: 2; box-shadow: 0 0 0 3px #ffffff24, 0 16px 38px #0005; }
.display-a { border-color: #78dbf2; background: #54bbdd68; }
.display-b { border-color: #fac188; background: #ec9d5666; }
.display-c { border-color: #bda8ff; background: #9b7bea66; }
.display-d { border-color: #8ed7a2; background: #58b67966; }
.display-e { border-color: #f197ae; background: #de729066; }
.display-f { border-color: #e3d17d; background: #c4ad5066; }
.display-content { display: grid; justify-items: center; gap: 7px; padding: 4px; color: white; text-align: center; text-shadow: 0 1px 5px #142536a8; pointer-events: none; }
.display-name { font-size: clamp(18px, 3vw, 31px); font-weight: 850; }
.display-content strong { font-size: clamp(11px, 1.6vw, 16px); white-space: nowrap; }
.stage-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #a9bacf; }
.stage-empty[hidden] { display: none; }
.stage-note { margin: 11px 0 0; color: #8294a9; font-size: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid #34465b; border-radius: 12px; background: #18263a; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.stats th, .stats td { white-space: nowrap; }
thead { background: #1e3046; }
th, td { padding: 14px 20px; }
thead th { color: #dae6f3; font-weight: 750; }
tbody tr + tr { border-top: 1px solid #304158; }
tbody th { color: #a8b9cc; font-weight: 550; }
tbody td { min-width: 140px; color: #f0f5fb; font-variant-numeric: tabular-nums; }
.site-footer { margin-top: 44px; padding-top: 20px; border-top: 1px solid #304158; color: #8294a9; font-size: 12px; text-align: center; }

@media (max-width: 700px) {
  .page { width: min(100% - 28px, 520px); padding-top: 18px; }
  .intro { align-items: start; flex-direction: column; margin-top: 40px; }
  .unit-picker { width: 100%; }
  .inputs { grid-template-columns: 1fr; gap: 12px; }
  .section-heading { align-items: start; flex-direction: column; }
  .mode-switch { width: 100%; }
  .mode-button { flex: 1; }
  .stage-toolbar { align-items: start; flex-direction: column; }
  .stage { height: 420px; }
  .stats .section-heading { gap: 6px; }
  th, td { padding: 13px 12px; }
}

@media (max-width: 390px) {
  .field-grid { gap: 9px; }
  .input-card { padding-left: 14px; padding-right: 14px; }
  .stage-actions button { padding: 6px; }
}
