/* 견적 장부 · 행사 장비 대여 업체 내부 견적관리 */
:root {
  --bg: #F3F4F2;
  --surface: #FFFFFF;
  --line: #D9DEDB;
  --line-soft: #E8EBE9;
  --text: #1B2627;
  --muted: #586465;
  --primary: #0E5258;
  --primary-ink: #093C41;
  --primary-soft: #E1EDED;
  --accent: #E2701F;
  --accent-ink: #A54C0C;
  --accent-soft: #FDEBDC;
  --ok: #22704A;
  --ok-soft: #E0F0E6;
  --warn: #855600;
  --warn-soft: #FBEFD3;
  --danger: #B42318;
  --danger-soft: #FCE4E0;
  --r: 6px;
  --display: "IBM Plex Sans KR", "Pretendard Variable", system-ui, sans-serif;
  --body: "Pretendard Variable", "Pretendard", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.qt { margin: 0; min-height: 100vh; font-family: var(--body); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); word-break: keep-all; overflow-wrap: anywhere; }
:where(.qt) button, :where(.qt) input, :where(.qt) select, :where(.qt) textarea { font: inherit; color: inherit; }
:where(.qt) button { cursor: pointer; }
:where(.qt) a { color: var(--primary); }
.qt :focus-visible { outline: 3px solid rgba(226, 112, 31, .45); outline-offset: 2px; }
.qt [hidden] { display: none !important; }
.qt-sprites { position: absolute; width: 0; height: 0; overflow: hidden; }
.qt-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.qt-mono { font-variant-numeric: tabular-nums; letter-spacing: .005em; }
.qt-muted { color: var(--muted); }
.qt-break { word-break: break-all; }
.qt-c { text-align: center; }
.qt-r { text-align: right; }

/* 머리 */
.qt-band { height: 28px; display: flex; align-items: center; justify-content: center; padding: 0 12px; background: #E4E8E6; color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qt-top { position: sticky; top: 0; z-index: 30; background: var(--primary-ink); color: #fff; }
.qt-top__inner { max-width: 1240px; margin: 0 auto; padding: 8px 16px 0; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "brand right" "nav nav"; gap: 4px 12px; align-items: center; }
.qt-brand { grid-area: brand; display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.qt-brand__mark { width: 28px; height: 28px; flex: none; }
.qt-brand__mark rect { fill: #13666D; }
.qt-brand__name { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.qt-top__right { grid-area: right; display: flex; align-items: center; gap: 8px; }
.qt-user { display: none; align-items: center; gap: 6px; font-size: 13px; color: #CFE2E2; }
.qt-user i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-style: normal; font-weight: 700; font-size: 12px; }
.qt-reset { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, .28); border-radius: var(--r); background: transparent; color: #E7F0F0; font-size: 13px; font-weight: 600; }
.qt-reset:hover { background: rgba(255, 255, 255, .08); }
.qt-nav { grid-area: nav; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 12px; }
.qt-nav::-webkit-scrollbar { display: none; }
.qt-nav__item { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: #B9D3D4; text-decoration: none; font-weight: 600; font-size: 14.5px; border-bottom: 3px solid transparent; }
.qt-nav__item:hover { color: #fff; }
.qt-nav__item.is-on { color: #fff; border-bottom-color: var(--accent); }
@media (min-width: 900px) {
  .qt-top__inner { grid-template-columns: auto 1fr auto; grid-template-areas: "brand nav right"; padding: 0 24px; gap: 28px; }
  .qt-nav { margin: 0; padding: 0; align-self: stretch; }
  .qt-nav__item { min-height: 54px; padding: 0 12px; }
  .qt-user { display: inline-flex; }
}

.qt-main { max-width: 1240px; margin: 0 auto; padding: 16px 16px 120px; }
@media (min-width: 900px) { .qt-main { padding: 24px 24px 120px; } }
.qt-page { display: grid; gap: 14px; min-width: 0; }

.qt-eyebrow { margin: 0 0 2px; font-size: 12.5px; font-weight: 700; color: var(--accent-ink); }
.qt-eyebrow--warn { color: var(--warn); }
.qt-h1 { margin: 0; font-family: var(--display); font-size: 22px; line-height: 1.3; letter-spacing: -.02em; }
.qt-h1__sub { display: block; margin-top: 2px; font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.qt-h2 { margin: 0; font-family: var(--display); font-size: 17px; letter-spacing: -.01em; }
.qt-h3 { margin: 0 0 8px; font-family: var(--display); font-size: 15px; }
.qt-help { margin: 0; font-size: 13px; color: var(--muted); }
.qt-note { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
@media (min-width: 900px) { .qt-h1 { font-size: 26px; } .qt-h1__sub { display: inline; margin: 0 0 0 6px; font-size: 17px; } }

.qt-intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; }
.qt-crumb { font-size: 13px; color: var(--muted); }
.qt-crumb a { color: var(--muted); }

.qt-card { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.qt-card--flush { padding: 0; overflow: hidden; }
.qt-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; }
.qt-card__head--pad { padding: 12px 14px 0; }
@media (min-width: 900px) { .qt-card { padding: 16px 18px; } .qt-card--flush { padding: 0; } .qt-card__head--pad { padding: 14px 18px 0; } }

/* 버튼·입력 */
.qt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text); font-weight: 700; font-size: 14.5px; text-decoration: none; white-space: nowrap; }
.qt-btn:hover { border-color: var(--primary); }
.qt-btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.qt-btn--primary:hover { background: var(--primary-ink); }
.qt-btn--accent { background: var(--accent); border-color: var(--accent); color: #1B1209; }
.qt-btn--accent:hover { background: #CC6119; }
.qt-btn--danger { border-color: #E6B4AD; color: var(--danger); background: #fff; }
.qt-btn--danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.qt-btn--sm { min-height: 36px; padding: 0 10px; font-size: 13.5px; }
.qt-btn--block { width: 100%; }
.qt-btn--wide { min-width: 180px; }
.qt-btn:disabled, .qt-btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.qt-icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text); }
.qt-input { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; font-size: 15px; }
.qt-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 82, 88, .15); }
textarea.qt-input { line-height: 1.6; resize: vertical; }

/* 상태 표시 */
.qt-status { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 4px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.qt-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.qt-status--draft { background: #ECEEED; color: #4D5758; }
.qt-status--review { background: var(--accent-soft); color: var(--accent-ink); }
.qt-status--confirmed { background: var(--primary-soft); color: var(--primary); }
.qt-status--sent { background: #E3ECF7; color: #24508A; }
.qt-status--ordered { background: var(--ok-soft); color: var(--ok); }
.qt-status--hold { background: #EEEAE4; color: #6B5B45; }
.qt-flag { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 4px; font-size: 12px; font-weight: 700; white-space: nowrap; background: #ECEEED; color: var(--muted); }
.qt-flag--danger { background: var(--danger-soft); color: var(--danger); }
.qt-flag--accent { background: var(--accent-soft); color: var(--accent-ink); }
.qt-flag--ok { background: var(--ok-soft); color: var(--ok); }
.qt-flag--warn { background: var(--warn-soft); color: var(--warn); }
.qt-flag--primary { background: var(--primary-soft); color: var(--primary); }
.qt-flag--muted { background: #ECEEED; color: var(--muted); }
.qt-tag { display: inline-flex; align-items: center; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); background: #fff; white-space: nowrap; }
.qt-tag--accent { border-color: #F2C29C; color: var(--accent-ink); background: var(--accent-soft); }
.qt-ver { display: inline-flex; padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 12.5px; font-weight: 700; color: var(--primary); background: #fff; font-variant-numeric: tabular-nums; }

/* 견적 목록 */
.qt-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 900px) { .qt-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.qt-tile { display: grid; gap: 2px; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: var(--r); background: var(--surface); text-align: left; text-decoration: none; color: var(--text); }
.qt-tile:hover { border-color: var(--primary); }
.qt-tile--alert { border-left-color: var(--danger); }
.qt-tile__label { font-size: 13px; font-weight: 600; color: var(--muted); }
.qt-tile__n { font-family: var(--display); font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.qt-tile--alert .qt-tile__n { color: var(--danger); }

.qt-toolbar { display: grid; gap: 8px; }
@media (min-width: 900px) { .qt-toolbar { grid-template-columns: 1fr 280px; align-items: center; } }
.qt-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.qt-chips::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .qt-chips { flex-wrap: wrap; margin: 0; padding: 0; } }
.qt-chip { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-weight: 600; font-size: 14px; color: var(--muted); }
.qt-chip b { font-variant-numeric: tabular-nums; color: var(--text); }
.qt-chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.qt-chip[aria-pressed="true"] b { color: #fff; }

.qt-tablewrap { min-width: 0; }
.qt-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.qt-table th { padding: 8px 10px; border-bottom: 1px solid var(--line); background: #F7F8F7; color: var(--muted); font-size: 12.5px; font-weight: 700; text-align: left; white-space: nowrap; }
.qt-table th.qt-r { text-align: right; }
.qt-table th.qt-c { text-align: center; }
.qt-table td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.qt-table small { color: var(--muted); }
.qt-table--quotes { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.qt-table--quotes tbody tr:hover { background: #F8FAF9; }
.qt-row__no a { font-weight: 700; text-decoration: none; }
.qt-row__customer { display: block; font-weight: 700; color: var(--text); text-decoration: none; }
.qt-row__customer:hover { text-decoration: underline; }
.qt-row__title { display: block; font-size: 13px; color: var(--muted); }
.qt-row__total { font-weight: 700; }
.qt-row__status { white-space: nowrap; }
.qt-row__status [data-role="fail"]:not(:empty) { margin-left: 4px; }
.qt-empty { margin: 0; padding: 24px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); }

@media (max-width: 899px) {
  .qt-table--quotes, .qt-table--quotes tbody { display: block; border: 0; background: transparent; }
  .qt-table--quotes thead { display: none; }
  .qt-table--quotes tr.qt-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; margin-bottom: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
  .qt-table--quotes tr.qt-row[hidden] { display: none; }
  .qt-table--quotes td { display: block; padding: 0; border: 0; text-align: left; }
  .qt-row__no { grid-column: 1; font-size: 13px; }
  .qt-row__status { grid-column: 2; grid-row: 1; text-align: right; }
  .qt-row__who { grid-column: 1 / -1; margin-bottom: 6px; }
  .qt-table--quotes td[data-label] { display: flex; justify-content: space-between; gap: 10px; grid-column: 1 / -1; font-size: 13.5px; }
  .qt-table--quotes td[data-label]::before { content: attr(data-label); color: var(--muted); font-weight: 600; }
  .qt-table--quotes td.qt-row__status[data-label] { display: block; grid-column: 2; grid-row: 1; }
  .qt-table--quotes td.qt-row__status::before { content: none; }
}

/* 상세 머리 */
.qt-head { display: grid; gap: 10px; }
@media (min-width: 900px) { .qt-head { grid-template-columns: 1fr auto; align-items: end; } }
.qt-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.qt-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.qt-head__actions:empty { display: none; }
@media (max-width: 899px) { .qt-head__actions > * { flex: 1 1 140px; } }

/* 업무 흐름(시그니처) */
.qt-flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; padding: 10px 12px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); counter-reset: s; }
.qt-flow__step { position: relative; display: grid; justify-items: center; gap: 4px; text-align: center; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.qt-flow__step:not(:last-child)::after { content: ""; position: absolute; top: 13px; left: calc(50% + 17px); right: calc(-50% + 17px); height: 2px; background: var(--line); }
.qt-flow__step.is-done:not(:last-child)::after { background: var(--primary); }
.qt-flow__dot { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.qt-flow__step.is-done { color: var(--primary); }
.qt-flow__step.is-done .qt-flow__dot { border-color: var(--primary); background: var(--primary); color: #fff; }
.qt-flow__step.is-now { color: var(--accent-ink); font-weight: 700; }
.qt-flow__step.is-now .qt-flow__dot { border-color: var(--accent); background: var(--accent); color: #1B1209; box-shadow: 0 0 0 4px rgba(226, 112, 31, .2); animation: qt-pulse 1.8s ease-out infinite; }
@keyframes qt-pulse { 0% { box-shadow: 0 0 0 0 rgba(226, 112, 31, .45); } 70% { box-shadow: 0 0 0 9px rgba(226, 112, 31, 0); } 100% { box-shadow: 0 0 0 0 rgba(226, 112, 31, 0); } }
.qt-flow__short { display: inline; }
.qt-flow__long { display: none; }
@media (min-width: 700px) { .qt-flow__short { display: none; } .qt-flow__long { display: inline; } .qt-flow__step { font-size: 13.5px; } }

.qt-split { display: grid; gap: 14px; }
.qt-split__main, .qt-split__side { display: grid; gap: 14px; align-content: start; min-width: 0; }
@media (min-width: 1000px) { .qt-split { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; } }

.qt-facts { padding: 0; }
.qt-facts__list { display: grid; grid-template-columns: 1fr; margin: 0; }
.qt-facts__list > div { display: grid; grid-template-columns: 96px 1fr; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.qt-facts__list > div:last-child { border-bottom: 0; }
.qt-facts__list dt { color: var(--muted); font-weight: 600; }
.qt-facts__list dd { margin: 0; min-width: 0; }
@media (min-width: 700px) {
  .qt-facts__list { grid-template-columns: 1fr 1fr; }
  .qt-facts__list > div:nth-child(odd) { border-right: 1px solid var(--line-soft); }
  .qt-facts__list > div:nth-last-child(-n+2) { border-bottom: 0; }
}

.qt-tabs { display: inline-flex; padding: 3px; gap: 3px; border-radius: var(--r); background: #ECEFED; }
.qt-tab { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px; border-radius: 4px; color: var(--muted); font-weight: 700; text-decoration: none; font-size: 14px; }
.qt-tab small { font-weight: 500; font-variant-numeric: tabular-nums; }
.qt-tab.is-on { background: var(--surface); color: var(--primary); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

.qt-banner { margin: 0 0 10px; padding: 9px 12px; border-radius: var(--r); font-size: 14px; border: 1px solid transparent; }
.qt-page > .qt-banner { margin: 0; }
.qt-banner--muted { background: #F1F3F2; color: var(--muted); }
.qt-banner--accent { background: var(--accent-soft); color: #6E3608; border-color: #F4CDAE; }
.qt-banner--warn { background: var(--warn-soft); color: var(--warn); border-color: #EFD8A4; }
.qt-banner--danger { background: var(--danger-soft); color: var(--danger); border-color: #F1BEB7; }
.qt-banner--ok { background: var(--ok-soft); color: var(--ok); border-color: #B9DCC7; }
.qt-banner--row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; font-weight: 600; }

/* 견적 줄 */
.qt-table--lines td { font-size: 14px; }
.qt-line__name b { font-weight: 700; }
.qt-line__name small { display: block; font-size: 12.5px; }
.qt-line.is-added { background: #FFF7F0; }
.qt-line.is-changed { background: #FFFAF5; }
.qt-line.is-removed { color: var(--muted); background: #F7F7F6; }
.qt-from { color: var(--muted); font-weight: 400; }
.qt-changed { color: var(--accent-ink); font-weight: 800; }
.qt-line.is-added .qt-line__name b { color: var(--accent-ink); }
.qt-avail { display: inline-flex; padding: 1px 7px; border-radius: 4px; font-size: 12.5px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qt-avail--ok { background: var(--ok-soft); color: var(--ok); }
.qt-avail--full { background: var(--warn-soft); color: var(--warn); }
.qt-avail--short { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 699px) {
  .qt-table--lines thead { display: none; }
  .qt-table--lines, .qt-table--lines tbody { display: block; }
  .qt-table--lines tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; padding: 10px 2px; border-bottom: 1px solid var(--line-soft); }
  .qt-table--lines tr.qt-line { padding: 10px 8px; }
  .qt-table--lines td { display: flex; justify-content: space-between; gap: 6px; padding: 0; border: 0; text-align: right; font-size: 13.5px; }
  .qt-table--lines td:empty, .qt-table--lines td.qt-na { display: none; }
  .qt-table--lines td[data-label]::before { content: attr(data-label); color: var(--muted); font-weight: 600; text-align: left; }
  .qt-table--lines td.qt-line__name { display: block; grid-column: 1 / -1; text-align: left; margin-bottom: 2px; }
  .qt-table--lines td.qt-line__avail { grid-column: 1 / -1; justify-content: flex-start; }
  .qt-table--lines td[data-label="금액"] { grid-column: 2; }
  .qt-table--lines td.qt-line__avail::before { content: none; }
}

.qt-sum { display: grid; margin: 12px 0 8px auto; max-width: 340px; }
.qt-sum > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.qt-sum dt { color: var(--muted); }
.qt-sum dd { margin: 0; font-weight: 700; }
.qt-sum__total { border-bottom: 0 !important; padding-top: 10px !important; }
.qt-sum__total dt { color: var(--text); font-weight: 700; }
.qt-sum__total dd { font-family: var(--display); font-size: 20px; color: var(--primary); }
.qt-sum--tight { margin: 10px 0 12px; max-width: none; }

.qt-versions { margin: 0; padding: 0; list-style: none; }
.qt-versions__row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.qt-versions__row:last-child { border-bottom: 0; }
.qt-versions__row a { color: var(--text); text-decoration: none; min-width: 0; }
.qt-versions__row a span { font-size: 13px; }
.qt-versions__row.is-on b { color: var(--accent-ink); }
.qt-versions__row .qt-mono { font-weight: 700; white-space: nowrap; }

.qt-log { margin: 0; padding: 0; list-style: none; }
.qt-log li { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 0 8px; padding: 0 0 12px 16px; font-size: 13.5px; }
.qt-log li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.qt-log li::after { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 1px; background: var(--line-soft); }
.qt-log li:last-child::after { display: none; }
.qt-log li.is-new::before { background: var(--accent); }
.qt-log__at { color: var(--muted); font-size: 12.5px; }
.qt-log__who { font-weight: 700; font-size: 12.5px; }
.qt-log__text { grid-column: 1 / -1; }

.qt-linkcard { display: grid; gap: 2px; text-decoration: none; color: var(--text); }
.qt-linkcard span:last-child { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); font-weight: 700; font-size: 14px; }

/* 견적서 */
.qt-docgrid { display: grid; gap: 14px; }
@media (min-width: 1000px) { .qt-docgrid { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } .qt-docside { position: sticky; top: 74px; } }
.qt-docside { display: grid; gap: 10px; }
.qt-paperwrap { container-type: inline-size; padding: 12px; background: #D9DDDB; border-radius: var(--r); }
@media (min-width: 900px) { .qt-paperwrap { padding: 24px; } }
.qt-paper { position: relative; width: 100%; max-width: 794px; margin: 0 auto; aspect-ratio: 210 / 297; padding: 6.5% 6.5%; background: #fff; color: #111; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); font-size: 1.62cqw; line-height: 1.55; font-family: var(--body); overflow: hidden; }
.qt-paper__mark { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 6em; font-weight: 700; color: rgba(226, 112, 31, .13); transform: rotate(-24deg); pointer-events: none; white-space: nowrap; }
.qt-paper__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1em; padding-bottom: .8em; border-bottom: .25em solid var(--primary); }
.qt-paper__title { margin: 0; font-family: var(--display); font-size: 2.6em; letter-spacing: .3em; line-height: 1; color: var(--primary-ink); }
.qt-paper__no { margin: 0; display: grid; gap: .1em; font-size: .92em; }
.qt-paper__no > div { display: flex; gap: .6em; justify-content: flex-end; }
.qt-paper__no dt { color: #555; }
.qt-paper__no dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.qt-paper__parties { display: grid; grid-template-columns: 1fr 1.05fr; gap: 1.6em; margin: 1.4em 0 1.2em; }
.qt-paper__to p { margin: 0 0 .25em; }
.qt-paper__customer { font-size: 1.45em; padding-bottom: .3em; border-bottom: .08em solid #333; margin-bottom: .5em !important; }
.qt-paper__lead { margin-top: .8em !important; font-weight: 600; }
.qt-paper__from { width: 100%; border-collapse: collapse; font-size: .9em; }
.qt-paper__from caption { text-align: left; font-weight: 700; padding-bottom: .3em; color: var(--primary-ink); }
.qt-paper__from th, .qt-paper__from td { padding: .32em .5em; border: .08em solid #9AA5A6; text-align: left; vertical-align: middle; }
.qt-paper__from th { width: 26%; background: #EEF3F3; font-weight: 600; white-space: nowrap; }
.qt-paper__ceo { position: relative; }
.qt-seal { position: absolute; right: .4em; top: 50%; transform: translateY(-50%) rotate(-6deg); display: grid; place-items: center; width: 3.4em; height: 3.4em; border: .16em solid rgba(196, 30, 30, .82); border-radius: .3em; color: rgba(196, 30, 30, .85); font-family: var(--display); font-weight: 700; font-size: .95em; line-height: 1.05; text-align: center; }
.qt-seal span { display: block; }
.qt-paper__total { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4em 1.2em; padding: .7em 1em; margin-bottom: 1em; background: #EEF3F3; border: .08em solid #9AA5A6; }
.qt-paper__total span { color: #444; font-weight: 600; }
.qt-paper__total b { font-size: 1.3em; font-family: var(--display); }
.qt-paper__num { margin-left: auto; color: var(--primary-ink); font-variant-numeric: tabular-nums; }
.qt-paper__lines { width: 100%; border-collapse: collapse; font-size: .92em; font-variant-numeric: tabular-nums; }
.qt-paper__lines th, .qt-paper__lines td { padding: .38em .45em; border: .08em solid #9AA5A6; text-align: center; }
.qt-paper__lines thead th { background: var(--primary); color: #fff; font-weight: 600; border-color: var(--primary); }
.qt-paper__l { text-align: left !important; }
.qt-paper__n { text-align: right !important; }
.qt-paper__blank td { height: 1.9em; }
.qt-paper__lines tfoot th { text-align: right; background: #F5F7F7; font-weight: 600; }
.qt-paper__sum th, .qt-paper__sum td { font-weight: 800; background: #EEF3F3; }
.qt-paper__terms { margin: 1.2em 0 0; padding-left: 1.4em; font-size: .9em; color: #333; }
.qt-paper__terms li { margin-bottom: .2em; }
.qt-zoom { display: none; }
@media (max-width: 699px) {
  .qt-zoom { display: inline-flex; margin: 0 0 10px; }
  .qt-paperwrap.is-zoom { overflow-x: auto; }
  .qt-paperwrap.is-zoom .qt-paper { width: 720px; max-width: none; font-size: 11.6px; }
}

.qt-kv { display: grid; margin: 0; }
.qt-kv > div { display: grid; grid-template-columns: 84px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.qt-kv dt { color: var(--muted); font-weight: 600; }
.qt-kv dd { margin: 0; min-width: 0; }
.qt-stack { display: grid; gap: 8px; }

/* 메일 발송 */
.qt-compose { display: grid; gap: 0; }
.qt-compose__row { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); align-items: center; }
.qt-compose__label { font-size: 13px; font-weight: 700; color: var(--muted); }
.qt-compose__value { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14.5px; min-width: 0; }
.qt-compose__body { min-height: 260px; font-size: 14.5px; }
@media (min-width: 700px) {
  .qt-compose__row { grid-template-columns: 96px 1fr; gap: 12px; }
  .qt-compose__row--top { align-items: start; }
  .qt-compose__row--top .qt-compose__label { padding-top: 9px; }
}
.qt-file { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; max-width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: #F7F9F8; color: var(--text); text-decoration: none; font-size: 14px; }
.qt-file svg { color: var(--primary); flex: none; }
.qt-file small { color: var(--muted); }
.qt-confirm { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 10px 12px; border: 1px solid #F2C29C; border-radius: var(--r); background: var(--accent-soft); font-size: 14px; font-weight: 600; cursor: pointer; }
.qt-confirm input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--primary); }
.qt-compose__foot { display: flex; justify-content: flex-end; margin-top: 12px; }
@media (max-width: 699px) { .qt-compose__foot .qt-btn { width: 100%; } }

.qt-history { display: grid; font-size: 13.5px; }
.qt-hrow { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 2px; border-bottom: 1px solid var(--line-soft); align-items: center; }
.qt-hrow--head { display: none; }
.qt-hrow.is-mine { background: #F6FAFA; }
.qt-hrow.is-fail { background: #FFF6F4; }
.qt-hrow__at { color: var(--muted); font-size: 12.5px; }
.qt-hrow__q { grid-column: 1 / -1; color: var(--text); text-decoration: none; }
.qt-hrow__q b { color: var(--primary); }
.qt-hrow__to { grid-column: 1 / -1; color: var(--muted); word-break: break-all; }
.qt-hrow__result { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.qt-hrow__by { grid-column: 2; grid-row: 1; font-size: 12.5px; color: var(--muted); }
.qt-hrow__act:empty { display: none; }
.qt-hrow__act { grid-column: 1 / -1; margin-top: 4px; }
@media (min-width: 1000px) {
  .qt-hrow { grid-template-columns: 96px 210px minmax(0, 1fr) minmax(0, 1.4fr) 64px 92px; gap: 10px; padding: 9px 8px; }
  .qt-hrow--head { display: grid; padding: 6px 8px; background: #F7F8F7; color: var(--muted); font-weight: 700; font-size: 12.5px; }
  .qt-hrow__q, .qt-hrow__to, .qt-hrow__result { grid-column: auto; }
  .qt-hrow__by { grid-column: auto; grid-row: auto; }
  .qt-hrow__act, .qt-hrow__act:empty { display: block; grid-column: auto; margin: 0; text-align: right; }
}

/* 대화상자 */
.qt-modal, .qt-sheet { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; }
.qt-modal::backdrop, .qt-sheet::backdrop { background: rgba(9, 30, 32, .5); }
.qt-modal { margin: auto; width: min(480px, calc(100vw - 24px)); }
.qt-modal__body, .qt-sheet__body { padding: 16px; background: var(--surface); border-radius: 8px; }
.qt-sheet__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.qt-sheet__title { margin: 0; font-family: var(--display); font-size: 19px; }
.qt-modal__text { margin: 12px 0; font-size: 14.5px; }
.qt-field { display: grid; gap: 4px; }
.qt-field__label { font-size: 13px; font-weight: 700; color: var(--muted); }
.qt-modal__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
@media (max-width: 499px) { .qt-modal__foot .qt-btn { flex: 1 1 auto; } }

.qt-fab { position: fixed; right: 16px; bottom: 34px; z-index: 40; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--r); background: var(--accent); color: #1B1209; font-weight: 700; font-size: 14px; box-shadow: 0 6px 16px rgba(165, 76, 12, .3); }
.qt-sheet { margin: auto auto 0; width: 100%; }
.qt-sheet__body { border-radius: 10px 10px 0 0; max-height: 86vh; overflow: auto; }
@media (min-width: 700px) { .qt-sheet { margin: auto; width: 600px; } .qt-sheet__body { border-radius: 8px; } }
.qt-map { margin: 12px 0 0; padding: 0; list-style: none; }
.qt-map__row { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.qt-map__need { color: var(--text); }
.qt-map__show { font-weight: 700; color: var(--primary); text-decoration: none; }
.qt-sheet__foot { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

.qt-toast { position: fixed; left: 50%; bottom: 88px; z-index: 60; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: var(--r); background: var(--primary-ink); color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 8px 20px rgba(0, 0, 0, .22); transform: translateX(-50%); }
.qt-toast.is-in { animation: qt-in .22s ease-out; }
@keyframes qt-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 재고·일정 */
.qt-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.qt-legend .qt-cell { min-height: 26px; padding: 0 8px; font-size: 12px; }
.qt-cell { display: grid; place-items: center; min-height: 38px; border-radius: 4px; font-variant-numeric: tabular-nums; font-size: 13.5px; position: relative; }
.qt-cell b { font-weight: 700; }
.qt-cell--ok { background: #EEF4F3; color: #31595C; }
.qt-cell--low { background: var(--warn-soft); color: var(--warn); }
.qt-cell--full { background: var(--accent); color: #1B1209; }
.qt-cell--short { background: var(--danger); color: #fff; }
.qt-cell.is-focus { box-shadow: inset 0 0 0 2px var(--primary-ink); }
.qt-cell__d { display: none; font-size: 10.5px; font-weight: 600; opacity: .8; line-height: 1; }

.qt-grid { display: grid; gap: 0; padding: 8px 10px 12px; }
.qt-grid__head { display: none; }
.qt-grid__section { margin: 12px 0 4px; font-size: 12.5px; font-weight: 700; color: var(--accent-ink); }
.qt-grid__row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; text-align: left; width: 100%; font: inherit; color: inherit; }
.qt-grid__row--lane { cursor: pointer; }
.qt-grid__row--lane.is-focus { background: #F2F8F8; }
.qt-grid__item { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-bottom: 4px; }
.qt-grid__item b { font-size: 14px; }
.qt-grid__item small { font-size: 12.5px; color: var(--muted); }
.qt-grid__min { margin-left: auto; padding: 0 6px; border-radius: 4px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.qt-grid__min--ok { background: #EEF4F3; color: #31595C; }
.qt-grid__min--low { background: var(--warn-soft); color: var(--warn); }
.qt-grid__min--full { background: var(--accent-soft); color: var(--accent-ink); }
.qt-grid__min--short { background: var(--danger-soft); color: var(--danger); }
.qt-cell__d, .qt-lane__cell .qt-cell__d { display: block; }
.qt-cell { padding: 4px 0; gap: 2px; }
.qt-lane__cell { display: grid; place-items: center; gap: 2px; min-height: 38px; padding: 4px 0; border-radius: 4px; background: #F5F6F5; color: var(--muted); font-size: 12px; }
.qt-lane__cell b { font-weight: 700; }
.qt-lane__cell.is-out { background: var(--primary); color: #fff; }
.qt-lane__cell.is-use { background: var(--primary-soft); color: var(--primary-ink); }
.qt-lane__cell.is-wait { background: #DDE9E9; color: var(--primary-ink); }
.qt-lane__cell.is-back { background: #3E7F84; color: #fff; }
.qt-grid__row--lane.is-focus .qt-lane__cell.is-out, .qt-grid__row--lane.is-focus .qt-lane__cell.is-back { box-shadow: inset 0 0 0 2px var(--accent); }
@media (min-width: 1000px) {
  .qt-grid { padding: 6px 18px 14px; }
  .qt-grid__head, .qt-grid__row { display: grid; grid-template-columns: 210px repeat(14, minmax(0, 1fr)); gap: 3px; align-items: center; }
  .qt-grid__head { position: sticky; top: 54px; z-index: 2; padding: 8px 0 6px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .qt-grid__corner { font-size: 12.5px; font-weight: 700; color: var(--muted); }
  .qt-grid__day { display: grid; justify-items: center; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
  .qt-grid__day small { font-size: 11px; font-weight: 500; color: var(--muted); }
  .qt-grid__day.is-weekend, .qt-grid__day.is-weekend small { color: var(--accent-ink); }
  .qt-grid__item { grid-column: auto; display: grid; gap: 0; margin: 0; padding-right: 8px; }
  .qt-grid__min { margin: 2px 0 0; justify-self: start; }
  .qt-grid__row { padding: 4px 0; }
  .qt-cell__d, .qt-lane__cell .qt-cell__d { display: none; }
  .qt-cell, .qt-lane__cell { min-height: 34px; padding: 0; }
}

.qt-orders { display: grid; gap: 8px; }
@media (min-width: 1000px) { .qt-orders { grid-template-columns: 1fr 1fr; } }
.qt-order { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.qt-order.is-focus { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.qt-order.is-fresh { border-left: 4px solid var(--accent); }
.qt-order__main { display: grid; gap: 2px; padding: 0; border: 0; background: transparent; text-align: left; }
.qt-order__no { font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 6px; }
.qt-order__who { font-size: 14.5px; }
.qt-order__when { font-size: 13px; color: var(--muted); }
.qt-order__items { font-size: 13px; color: var(--text); }
.qt-order__state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 8px; border-top: 1px dashed var(--line); }
.qt-order__chip { display: inline-flex; align-items: center; gap: 6px; }
.qt-order__link { margin-left: auto; font-size: 13px; font-weight: 600; }

.demo-notice { margin: 0; padding: 10px 16px 64px; text-align: center; font-size: 12px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .qt-flow__step.is-now .qt-flow__dot, .qt-toast.is-in { animation: none; }
}
