:root {
  --color-bg: #ffffff;
  --color-bg-soft: #f5f6fa;
  --color-text: #16181d;
  --color-text-muted: #5a5f6b;
  --color-ink: #0c0e13;
  --color-accent: #3a5ddb;
  --color-accent-dark: #2944a8;
  --color-border: #e6e8ef;
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-mono: "SF Mono", "Consolas", monospace;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-base); color: var(--color-text); background: var(--color-bg-soft); line-height: 1.6; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
a { color: inherit; text-decoration: none; }

.tool-header { background: var(--color-ink); color: #fff; padding: 18px 0; }
.tool-header .wrap { display: flex; align-items: baseline; gap: 16px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; font-weight: 800; font-family: var(--font-base); letter-spacing: -0.01em; }
.logo img { display: block; height: 26px; width: auto; }
.logo span { color: var(--color-accent); }
.tool-header p { margin: 0; font-size: 0.85rem; color: rgba(255,255,255,0.6); }

.layout { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px; padding: 32px 24px 64px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--color-border); border-radius: 14px; padding: 28px; }
.panel h1 { font-size: 1.3rem; margin: 0 0 20px; }

.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; }
.field input[type="text"], .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 8px; font-family: inherit; font-size: 0.95rem;
}
fieldset.field { border: 1px solid var(--color-border); border-radius: 10px; padding: 14px 16px; }
fieldset.field legend { font-size: 0.85rem; font-weight: 700; padding: 0 4px; }
.hint { font-size: 0.78rem; color: var(--color-text-muted); margin: 6px 0 0; }
.checkbox, .radio { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; padding: 6px 0; border-bottom: 1px dashed var(--color-border); }
.checkbox:last-child, .radio:last-child { border-bottom: none; }
.checkbox .price { margin-left: auto; color: var(--color-accent-dark); font-family: var(--font-mono); font-size: 0.85rem; }

.btn-print { display: block; width: 100%; padding: 14px; border: none; border-radius: 8px; background: var(--color-accent); color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer; margin-top: 8px; }
.btn-print:hover { background: var(--color-accent-dark); }

.quote-panel { position: sticky; top: 20px; }
.quote-doc { font-size: 0.92rem; }
.quote-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--color-ink); padding-bottom: 16px; margin-bottom: 16px; }
.quote-brand { font-family: var(--font-mono); font-weight: 800; font-size: 1.2rem; margin: 0; }
.quote-brand span { color: var(--color-accent); }
.quote-sub { margin: 4px 0 0; color: var(--color-text-muted); font-size: 0.85rem; }
.quote-meta { text-align: right; font-size: 0.8rem; color: var(--color-text-muted); }
.quote-meta p { margin: 2px 0; }
.quote-client { margin-bottom: 16px; font-size: 0.9rem; }
.quote-client p { margin: 2px 0; }

.quote-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.quote-table th, .quote-table td { padding: 10px 8px; border-bottom: 1px solid var(--color-border); text-align: left; }
.quote-table th:last-child, .quote-table td:last-child { text-align: right; font-family: var(--font-mono); }
.quote-table tfoot .sub td { font-weight: 700; border-top: 1px solid var(--color-ink); }

.quote-note { font-size: 0.85rem; color: var(--color-text-muted); white-space: pre-wrap; }
.quote-footer { margin-top: 20px; padding-top: 14px; border-top: 1px dashed var(--color-border); font-size: 0.78rem; color: var(--color-text-muted); }
.quote-footer p { margin: 2px 0; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .quote-panel { position: static; }
}

@media print {
  body { background: #fff; }
  .tool-header, .no-print { display: none !important; }
  .layout { grid-template-columns: 1fr; padding: 0; }
  .panel.quote-panel { border: none; padding: 0; }
}

/* Mobile line-wrap fix: Korean text wraps at word boundaries, not mid-syllable */
body { word-break: keep-all; overflow-wrap: break-word; }
@media (max-width: 640px) {
  .lg-break { display: none; }
}
