:root {
  color-scheme: light;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  color: #14243b;
  background: #edf1f6;
  font-size: 16px;
  --navy: #16243b;
  --accent: #264fd5;
  --muted: #52637a;
  --border: #d8e0ea;
  --soft: #f6f8fc;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 290px; }
a { color: inherit; }
.wrap { width: min(calc(100% - 56px), 1420px); margin-inline: auto; }
.masthead { background: var(--navy); color: #fff; }
.bar, .layout, .intro, .output-heading, .row-title, .actions, .attach-buttons, .dialog-bar { display: flex; align-items: center; }
.bar, .intro, .output-heading, .row-title, .dialog-bar { justify-content: space-between; }
.bar { min-height: 72px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: white; text-decoration: none; font-weight: 750; white-space: nowrap; }
.monogram { padding: 6px 8px; border-radius: 4px; background: #3962e8; color: #fff; font: 800 0.8rem/1.3 system-ui, sans-serif; letter-spacing: 0.08em; }
nav { display: flex; gap: 8px; }
.intro { gap: 15px; padding-block: 34px 24px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 4vw, 2.4rem); line-height: 1.3; letter-spacing: -0.06em; }
h2 { font-size: 1.13rem; line-height: 1.4; letter-spacing: -0.025em; }
p { line-height: 1.6; }
.intro p { color: var(--muted); margin-top: 7px; }
.jump { color: #2649b6; white-space: nowrap; font-size: 0.9rem; font-weight: 700; text-underline-offset: 4px; }
.layout { align-items: flex-start; gap: 18px; }
.workbench { display: grid; gap: 15px; flex: 0 0 clamp(340px, 35%, 480px); min-width: 0; }
.panel { border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 20px; min-width: 0; }
.output { flex: 1; position: sticky; top: 16px; padding: 0; overflow: hidden; }
.output-heading, .output-footer { padding: 18px 20px; }
.output-heading { gap: 14px; }
.output-heading p, h2 + p { margin-top: 5px; }
.muted { color: var(--muted); }
.fine, small { font-size: 0.83rem; }
.paper-holder { padding: clamp(12px, 2.5vw, 32px); background-color: #1b2b42; background-image: radial-gradient(#536985 0.65px, transparent 0.65px); background-size: 13px 13px; }
.paper { background: #fff; width: 100%; aspect-ratio: 420 / 297; box-shadow: 0 5px 18px #0b1429ad; }
.paper svg, #viewer-content svg { display: block; width: 100%; height: auto; }
.button { appearance: none; border: 1px solid transparent; border-radius: 6px; min-height: 40px; padding: 8px 12px; display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 0.88rem; line-height: 1.3; font-weight: 700; white-space: nowrap; text-decoration: none; cursor: pointer; }
.button.solid { color: #fff; background: var(--accent); }
.button.secondary { color: #223a61; background: #fff; border-color: #b8c7df; }
.nav-button { color: #fff; background: transparent; border-color: #576884; }
.button:hover:not(:disabled) { filter: brightness(0.93); }
.button:disabled { color: #596a81; background: #edf1f7; border-color: #d8e1ec; cursor: default; }
:focus-visible { outline: 3px solid #5078ff; outline-offset: 2px; }
.drop { border: 1px dashed #a6b7d3; background: #f6f8fd; border-radius: 8px; margin-top: 14px; padding: 14px 10px; display: grid; justify-items: center; gap: 8px; }
.drop.active { background: #e4ebff; border-color: var(--accent); }
.drop small { color: var(--muted); text-align: center; }
.drop-symbol { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-size: 20px; color: #2949af; background: #e4ebff; }
.capture { display: none; }
@media (pointer: coarse), (max-width: 760px) { .capture { display: inline-flex; } }
.actions, .attach-buttons { flex-wrap: wrap; gap: 7px; }
.references { margin-top: 12px; display: grid; gap: 7px; }
.reference { display: flex; align-items: center; gap: 8px; padding: 5px; border: 1px solid var(--border); border-radius: 7px; }
.reference .open-image { border: 0; background: none; color: #223a61; cursor: pointer; display: flex; align-items: center; gap: 8px; overflow: hidden; flex: 1; min-width: 0; text-align: left; font: inherit; }
.reference .open-image span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reference .open-image img { width: 48px; height: 42px; object-fit: cover; border-radius: 3px; background: var(--soft); }
.reference .remove-image { padding-inline: 8px; min-height: 36px; }
details { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 11px; }
summary { cursor: pointer; color: #244487; font-size: 0.9rem; font-weight: 750; }
details p, details .actions, details textarea, details p + .button, details textarea + .button { margin-top: 8px; }
.message { margin-top: 10px; font-size: 0.88rem; padding: 8px 10px; background: #edf2ff; color: #28447b; border-radius: 5px; overflow-wrap: anywhere; }
.message[data-error="true"] { color: #8d331f; background: #fff0ec; }
.shape-choice { border: 0; padding: 0; margin: 13px 0 12px; display: flex; flex-wrap: wrap; gap: 7px; }
legend, label, .row-title > label { font-size: 0.88rem; font-weight: 700; }
legend { margin-bottom: 6px; }
.shape-choice label { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 6px; padding: 7px; cursor: pointer; }
.shape-choice label:has(input:checked) { background: #edf2ff; border-color: #8ba2e7; color: #223f99; }
input[type="radio"], input[type="checkbox"] { margin: 0; width: 17px; height: 17px; accent-color: var(--accent); flex: 0 0 auto; }
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 8px; row-gap: 10px; }
.field-grid label, .notes-label { display: block; }
input[type="text"], input:not([type]), textarea, select { min-width: 0; width: 100%; min-height: 41px; border: 1px solid #bdc9dc; border-radius: 6px; background: #fff; padding: 7px 9px; font: inherit; font-size: 1rem; color: #16243b; }
.field-grid input, .notes-label textarea { display: block; margin-top: 5px; }
input::placeholder, textarea::placeholder { color: #677991; font-size: 0.86rem; }
textarea { line-height: 1.5; resize: vertical; }
select { appearance: none; padding-right: 28px; background-color: white; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23374761' stroke-width='1.6'/%3E%3C/svg%3E"); background-position: right 8px center; background-repeat: no-repeat; background-size: 15px; }
.row-title select { width: auto; max-width: 145px; min-height: 36px; }
.row-title { margin-top: 14px; }
#holes { display: grid; gap: 6px; }
.hole { border: 0; padding: 0; margin: 5px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.hole legend { margin-bottom: 2px; color: #244487; }
.hole input { display: block; margin-top: 3px; }
.order-fields { grid-template-columns: minmax(0, 2.3fr) minmax(0, 1.3fr) minmax(0, 0.8fr); margin-top: 12px; }
.notes-label { margin-top: 12px; }
dl { display: grid; grid-template-columns: minmax(4.5em, auto) 1fr; gap: 5px 8px; font-size: 0.83rem; line-height: 1.5; }
dt { font-weight: 700; }
dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; white-space: pre-line; }
.validation { font-size: 0.91rem; color: #314972; }
.validation[data-error="true"] { color: #8d331f; }
.approve { display: flex; gap: 9px; align-items: center; margin: 12px 0; line-height: 1.5; }
.approve:has(:disabled) { color: #667489; }
.page-footer { color: var(--muted); padding-block: 18px 24px; font-size: 0.84rem; }
dialog { width: min(calc(100% - 24px), 1020px); max-height: calc(100% - 24px); color: inherit; border: 1px solid var(--border); padding: 14px; border-radius: 10px; }
dialog::backdrop { background: #101c30bc; }
.dialog-bar { gap: 10px; margin-bottom: 8px; overflow-wrap: anywhere; }
#viewer-content { overflow-x: auto; }
.zoom-document { min-width: 760px; }
#viewer-content img { display: block; max-width: 100%; max-height: 75vh; margin: auto; object-fit: contain; }
@media (max-width: 760px) {
  .wrap { width: calc(100% - 24px); }
  .bar { min-height: 61px; }
  .intro { display: block; padding-block: 22px 17px; }
  .jump { display: inline-block; margin-top: 8px; }
  .layout { display: grid; gap: 14px; }
  .workbench { gap: 12px; }
  .panel { padding: 15px; }
  .output { padding: 0; position: static; }
  .output-heading, .output-footer { padding: 14px; }
  .button { min-height: 44px; }
}
@media (max-width: 350px) {
  .nav-button { padding-inline: 7px; }
  .panel:not(.output) { padding-inline: 11px; }
}
