/* 티켓타카 관리자·제휴사 포탈 공통. 토큰 → 셸(사이드바) → 요소. 모든 화면이 이 파일 하나만 쓴다. 테마는 html[data-theme] 또는 시스템 설정. */
:root {
  --tt-bg: #f4f5f7; --tt-surface: #ffffff; --tt-surface-2: #f8f9fb; --tt-text: #15171a; --tt-muted: #6b717b; --tt-line: #e5e7eb; --tt-line-2: #eef0f3;
  --tt-primary: #d8322b; --tt-primary-ink: #ffffff; --tt-primary-soft: rgba(216, 50, 43, .09);
  --tt-ok: #157347; --tt-ok-bg: #e5f5ec; --tt-warn: #9a5b00; --tt-warn-bg: #fff3d6; --tt-bad: #b42318; --tt-bad-bg: #fde8e7; --tt-info: #5b3fb8; --tt-info-bg: #ece8fb;
  --tt-side-bg: #ffffff; --tt-side-w: 232px; --tt-radius: 10px; --tt-radius-s: 7px;
  --tt-font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", sans-serif;
  --tt-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --tt-bg: #0f1115; --tt-surface: #171a20; --tt-surface-2: #1d2129; --tt-text: #eef0f3; --tt-muted: #9aa1ab; --tt-line: #272b34; --tt-line-2: #20242c;
  --tt-primary: #ef4f47; --tt-primary-soft: rgba(239, 79, 71, .14);
  --tt-ok: #4ade80; --tt-ok-bg: rgba(74, 222, 128, .12); --tt-warn: #fbbf24; --tt-warn-bg: rgba(251, 191, 36, .12); --tt-bad: #f87171; --tt-bad-bg: rgba(248, 113, 113, .12); --tt-info: #a78bfa; --tt-info-bg: rgba(167, 139, 250, .14);
  --tt-side-bg: #131519; color-scheme: dark;
} }
:root[data-theme="dark"] {
  --tt-bg: #0f1115; --tt-surface: #171a20; --tt-surface-2: #1d2129; --tt-text: #eef0f3; --tt-muted: #9aa1ab; --tt-line: #272b34; --tt-line-2: #20242c;
  --tt-primary: #ef4f47; --tt-primary-soft: rgba(239, 79, 71, .14);
  --tt-ok: #4ade80; --tt-ok-bg: rgba(74, 222, 128, .12); --tt-warn: #fbbf24; --tt-warn-bg: rgba(251, 191, 36, .12); --tt-bad: #f87171; --tt-bad-bg: rgba(248, 113, 113, .12); --tt-info: #a78bfa; --tt-info-bg: rgba(167, 139, 250, .14);
  --tt-side-bg: #131519;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--tt-bg); color: var(--tt-text); font-family: var(--tt-font); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
code { font-family: var(--tt-mono); font-size: .92em; background: var(--tt-surface-2); padding: 1px 5px; border-radius: 4px; }
button { font-family: inherit; }
small { color: var(--tt-muted); }

/* ── 셸: 사이드바 + 본문 */
.tt-shell { display: grid; grid-template-columns: var(--tt-side-w) 1fr; min-height: 100vh; }
.tt-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--tt-side-bg); border-right: 1px solid var(--tt-line); padding: 18px 14px 14px; }
.tt-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; text-decoration: none; }
.tt-brand__mark { width: 28px; height: 28px; border-radius: 8px; background: var(--tt-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; letter-spacing: -.02em; }
.tt-brand__name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; line-height: 1.15; }
.tt-brand__face { display: block; font-size: 11.5px; color: var(--tt-muted); font-weight: 500; }
.tt-nav { display: flex; flex-direction: column; gap: 2px; }
.tt-nav__label { font-size: 11px; color: var(--tt-muted); text-transform: uppercase; letter-spacing: .06em; margin: 14px 10px 6px; }
.tt-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--tt-radius-s); color: var(--tt-muted); text-decoration: none; font-weight: 500; }
.tt-nav a svg { width: 17px; height: 17px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tt-nav a:hover { background: var(--tt-surface-2); color: var(--tt-text); }
.tt-nav a.is-active { background: var(--tt-primary-soft); color: var(--tt-primary); font-weight: 600; }
.tt-session { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; font-size: 12.5px; color: var(--tt-muted); }
.tt-session__left { font-variant-numeric: tabular-nums; color: var(--tt-text); }
.tt-session.is-low .tt-session__left { color: var(--tt-bad); }
.tt-session .tt-btn { padding: 4px 10px; }
.tt-side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--tt-line); }
.tt-me { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; font-size: 13px; }
.tt-me__link { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; padding: 4px 6px 4px 4px; margin-left: -4px; border-radius: var(--tt-radius-s); text-decoration: none; color: inherit; }
.tt-me__link:hover { background: var(--tt-surface-2); }
.tt-me__link.is-active { background: var(--tt-primary-soft); }
.tt-me__link.is-active .tt-me__name { color: var(--tt-primary); }
.tt-me__avatar { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--tt-surface-2); border: 1px solid var(--tt-line); display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; color: var(--tt-muted); }
.tt-me__link.is-active .tt-me__avatar { background: var(--tt-primary); border-color: var(--tt-primary); color: var(--tt-primary-ink); }
.tt-me__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tt-me__sub { display: block; font-size: 11.5px; color: var(--tt-muted); font-weight: 400; }
.tt-seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--tt-surface-2); border: 1px solid var(--tt-line); border-radius: 999px; padding: 3px; }
.tt-seg button { border: 0; background: transparent; color: var(--tt-muted); padding: 5px 0; border-radius: 999px; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px; }
.tt-seg button svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tt-seg button.is-on { background: var(--tt-surface); color: var(--tt-text); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }
.tt-side__toggle { display: none; }
.tt-side__panel { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.tt-tabbar, .tt-side__backdrop { display: none; }
.tt-main { min-width: 0; }
.tt-page { max-width: 1480px; margin: 0 auto; padding: 28px 32px 72px; }
.tt-page--narrow { max-width: 760px; }

/* ── 제목·텍스트 */
.tt-h1 { font-size: 21px; font-weight: 700; letter-spacing: -.015em; margin: 0 0 18px; }
.tt-h2 { font-size: 15px; font-weight: 700; margin: 28px 0 10px; letter-spacing: -.01em; }
.tt-h2--first { margin-top: 0; }
.tt-h3 { font-size: 13.5px; font-weight: 700; margin: 22px 0 8px; color: var(--tt-muted); }
.tt-grid--form { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; }
.tt-input--w90 { width: 90px; } .tt-input--w140 { width: 140px; }
.tt-table--edit td { padding: 6px 6px; }
.tt-note { color: var(--tt-muted); font-size: 13px; margin: 8px 0; }
.tt-note--ok { color: var(--tt-ok); }
.tt-note--tight { margin: 0; font-size: 11.5px; }
.tt-note img { vertical-align: middle; max-height: 28px; }
.tt-alert { padding: 10px 12px; border-radius: var(--tt-radius-s); background: var(--tt-bad-bg); color: var(--tt-bad); font-size: 13.5px; margin: 0 0 14px; }
.tt-inline { display: inline; }
.tt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tt-row .tt-h1 { margin: 0; }
/* 페이지 머리(h1 + 버튼들): 제목은 왼쪽, 버튼(엑셀 다운로드·등록·처리·← 목록)은 전부 오른쪽 끝에 한 줄로(사용자 2026-10-29). 좁으면 버튼 줄이 아래로 감 */
.tt-row:has(> .tt-h1) { justify-content: flex-end; gap: 10px 8px; margin-bottom: 16px; }
.tt-row:has(> .tt-h1) > .tt-h1 { margin-right: auto; }
.tt-row--end { justify-content: flex-end; margin: 14px 0 0; }
.tt-actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* 표 셀에 붙은 tt-actions 는 셀을 깨지 않게(td 는 table-cell 유지, 버튼만 가로 배치) */
td.tt-actions { display: table-cell; white-space: nowrap; }
td.tt-actions > .tt-btn, td.tt-actions > form, td.tt-actions > button { display: inline-block; vertical-align: middle; margin-right: 4px; }
td.tt-actions > :last-child { margin-right: 0; }

/* ── 카드·통계 */
.tt-card { background: var(--tt-surface); border: 1px solid var(--tt-line); border-radius: var(--tt-radius); padding: 20px; }
.tt-page > .tt-card + .tt-card, .tt-page > section + section.tt-card { margin-top: 14px; }
.tt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tt-stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; }
.tt-stat__label { font-size: 12.5px; color: var(--tt-muted); }
.tt-stat__num { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tt-stat__num--warn { color: var(--tt-warn); }
.tt-stat--link { text-decoration: none; transition: border-color .12s; }
.tt-stat--link:hover { border-color: var(--tt-primary); }
.tt-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tt-cols--top { align-items: start; }
.tt-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 0; font-size: 13.5px; }
.tt-dl dt { color: var(--tt-muted); }
.tt-dl dd { margin: 0; }
/* 상세 화면용 키·값 타일 격자: 쌍을 <div>로 감싸고, 긴 값은 tt-dl__wide 로 한 줄 전체 */
.tt-dl--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 20px; }
.tt-dl--grid > div { min-width: 0; }
.tt-dl--grid dt { font-size: 12.5px; margin-bottom: 3px; }
.tt-dl--grid dd { font-size: 14px; overflow-wrap: anywhere; }
.tt-dl--grid dd code { font-size: 12.5px; }
.tt-dl--grid > .tt-dl__wide { grid-column: 1 / -1; }
.tt-cols > * { min-width: 0; }
input[type="file"].tt-input { max-width: 100%; }

/* ── 표 */
.tt-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tt-card:has(> .tt-table) { overflow-x: auto; }
.tt-table th, .tt-table td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--tt-line-2); vertical-align: middle; white-space: nowrap; }
.tt-table th { color: var(--tt-muted); font-weight: 500; font-size: 12.5px; background: var(--tt-surface-2); }
.tt-table tbody tr:last-child td { border-bottom: 0; }
.tt-table tbody tr:hover td { background: var(--tt-surface-2); }
/* 표 안의 링크(상세로 들어가는 아이디·번호·제목)는 한눈에 "누를 수 있다"가 보이게: 주색 + 밑줄 + 굵게 (사용자 2026-10-29) */
.tt-table td a:not(.tt-btn) { color: var(--tt-primary); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--tt-primary) 45%, transparent); }
.tt-table td a:not(.tt-btn):hover { text-decoration-color: var(--tt-primary); }
.tt-table td a:not(.tt-btn) code { color: inherit; background: var(--tt-primary-soft); }
.tt-row--muted td { color: var(--tt-muted); }
.tt-num { text-align: right; font-variant-numeric: tabular-nums; }
.tt-wrap { white-space: normal !important; max-width: 420px; }
.tt-card > .tt-table { margin: -6px 0 -8px; }

/* ── 대시보드: 기간·차트·알림 */
.tt-period { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.tt-period__presets { display: inline-flex; background: var(--tt-surface); border: 1px solid var(--tt-line); border-radius: 999px; padding: 3px; }
.tt-period__btn { padding: 5px 12px; border-radius: 999px; font-size: 13px; color: var(--tt-muted); text-decoration: none; }
.tt-period__btn.is-on { background: var(--tt-primary-soft); color: var(--tt-primary); font-weight: 600; }
.tt-period__custom { display: inline-flex; align-items: center; gap: 6px; }
.tt-period__custom .tt-input { width: auto; padding: 6px 8px; font-size: 13px; }
.tt-period__label { font-size: 12.5px; color: var(--tt-muted); margin-left: auto; }
.tt-stat__sub { font-size: 12px; color: var(--tt-muted); }
.tt-stat__num small { font-size: 13px; font-weight: 500; color: var(--tt-muted); margin-left: 2px; }
.tt-stat--accent { border-color: var(--tt-primary); }
.tt-stat--accent .tt-stat__num { color: var(--tt-primary); }
.tt-cols--chart { grid-template-columns: 2fr 1fr; margin-top: 14px; }
.tt-cols--top { margin-top: 14px; }
.tt-page > .tt-cols + .tt-card, .tt-page > .tt-grid + .tt-card { margin-top: 14px; }
.tt-chart { margin-bottom: 14px; }
.tt-chart__head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--tt-muted); margin-bottom: 6px; }
.tt-chart__svg { width: 100%; height: auto; display: block; }
.tt-chart__bar { fill: var(--tt-primary); opacity: .85; }
.tt-chart__bar:hover { opacity: 1; }
.tt-chart__axis { stroke: var(--tt-line); stroke-width: 1; }
.tt-chart__label { font-size: 9px; fill: var(--tt-muted); font-family: var(--tt-font); }
.tt-alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.tt-alertbar { display: block; padding: 10px 14px; border-radius: var(--tt-radius-s); background: var(--tt-info-bg); color: var(--tt-info); text-decoration: none; font-size: 13.5px; }
.tt-alertbar--warn { background: var(--tt-warn-bg); color: var(--tt-warn); }
/* 제휴사 화면 보기(총관리자 대리 접속, 읽기 전용): 상단 띠 + 저장·발송 버튼은 눌리지 않게(서버도 POST 를 403 으로 막음) */
.tt-viewas { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: var(--tt-warn-bg); color: var(--tt-warn); border-bottom: 1px solid var(--tt-line); font-size: 13.5px; }
.tt-viewas .tt-btn { margin: 0; }
body:has(.tt-viewas) .tt-page form[method="post"] button[type="submit"], body:has(.tt-viewas) .tt-page [data-modal-open], body:has(.tt-viewas) .tt-me form { pointer-events: none; opacity: .4; }
.tt-table--compact th, .tt-table--compact td { padding: 6px 8px; }
.tt-table th.tt-num { text-align: right; }
@media (max-width: 860px) { .tt-cols--chart { grid-template-columns: 1fr; } .tt-period__label { margin-left: 0; } }

/* ── 검색 바·페이저·정렬 */
.tt-filter { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; padding: 14px 16px; margin-bottom: 14px; }
.tt-filter__item { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--tt-muted); }
.tt-filter__item > span:first-child { padding-left: 2px; }
.tt-filter__item .tt-input { width: auto; min-width: 140px; padding: 8px 10px; font-size: 13.5px; }
.tt-filter__item--grow { flex: 1 1 220px; } .tt-filter__item--grow .tt-input { width: 100%; }
.tt-filter__item:has(.tt-filter__tilde) { flex-direction: row; align-items: center; flex-wrap: wrap; }
.tt-filter__item:has(.tt-filter__tilde) > span:first-child { width: 100%; }
.tt-filter__tilde { color: var(--tt-muted); }
.tt-filter__actions { display: flex; gap: 6px; align-items: center; }
.tt-filter .tt-btn { margin: 0; padding: 8px 14px; width: auto; white-space: nowrap; }
.tt-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--tt-muted); }
.tt-pager__nav { display: flex; gap: 4px; }
.tt-pager__btn { min-width: 32px; height: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--tt-line); border-radius: var(--tt-radius-s); background: var(--tt-surface); color: var(--tt-text); text-decoration: none; font-variant-numeric: tabular-nums; }
.tt-pager__btn:hover { background: var(--tt-surface-2); }
.tt-pager__btn.is-on { background: var(--tt-primary); border-color: var(--tt-primary); color: var(--tt-primary-ink); font-weight: 600; }
.tt-pager__btn.is-off { opacity: .35; pointer-events: none; }
.tt-pager__size a { display: inline-block; padding: 2px 6px; margin-right: 2px; border-radius: 4px; text-decoration: none; }
.tt-pager__size a.is-on { background: var(--tt-surface-2); color: var(--tt-text); font-weight: 600; }
.tt-th a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: inherit; }
.tt-th__arrow { font-size: 10px; opacity: .45; }
.tt-th.is-on a { color: var(--tt-text); } .tt-th.is-on .tt-th__arrow { opacity: 1; color: var(--tt-primary); }

/* ── 뱃지 */
.tt-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--tt-surface-2); color: var(--tt-muted); line-height: 1.6; }
.tt-badge--track { background: var(--tt-info-bg); color: var(--tt-info); margin-right: 4px; }
.tt-tracks { white-space: nowrap; }
.tt-swatch { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--tt-line); vertical-align: -3px; margin-right: 5px; }
.tt-logo-preview { height: 28px; width: auto; max-width: 200px; vertical-align: middle; background: var(--tt-surface-2); padding: 3px 6px; border-radius: 6px; }
.tt-badge--ACTIVE, .tt-badge--CONFIRMED, .tt-badge--RECOVERED, .tt-badge--SENT, .tt-badge--COMPLETED { background: var(--tt-ok-bg); color: var(--tt-ok); }
.tt-badge--PENDING, .tt-badge--SUBMITTING, .tt-badge--OPEN { background: var(--tt-warn-bg); color: var(--tt-warn); }
.tt-badge--SUSPENDED, .tt-badge--FAILED, .tt-badge--REVOKED, .tt-badge--ERROR { background: var(--tt-bad-bg); color: var(--tt-bad); }
.tt-badge--UNKNOWN { background: var(--tt-info-bg); color: var(--tt-info); }
.tt-badge--ADMIN, .tt-badge--OWNER { background: var(--tt-primary-soft); color: var(--tt-primary); }
.tt-badge--OPERATOR, .tt-badge--STAFF, .tt-badge--DRAFT { background: var(--tt-info-bg); color: var(--tt-info); }
.tt-badge--DISABLED, .tt-badge--INACTIVE, .tt-badge--CANCELLED, .tt-badge--EXPIRED, .tt-badge--SKIPPED { background: var(--tt-surface-2); color: var(--tt-muted); }
.tt-badge--PAID { background: var(--tt-ok-bg); color: var(--tt-ok); }

/* ── 폼 */
.tt-label { display: block; font-size: 12.5px; color: var(--tt-muted); margin: 14px 0 6px; }
.tt-input, select.tt-input { width: 100%; padding: 10px 12px; border: 1px solid var(--tt-line); border-radius: var(--tt-radius-s); background: var(--tt-surface); color: var(--tt-text); font-size: 14px; font-family: inherit; }
.tt-input:focus { outline: 2px solid var(--tt-primary); outline-offset: 1px; border-color: transparent; }
.tt-input--sm { padding: 6px 8px; font-size: 13px; width: 120px; }
.tt-input--code { font-size: 22px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.tt-form .tt-btn--primary { width: auto; margin-top: 18px; }
.tt-form--inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.tt-form--inline .tt-input { width: auto; flex: 1 1 160px; min-width: 0; max-width: 100%; }
.tt-form--inline .tt-btn { margin: 0; }
form.tt-card.tt-form--inline { margin-bottom: 14px; padding: 14px 16px; }
.tt-btn { display: inline-block; padding: 9px 14px; border-radius: var(--tt-radius-s); border: 1px solid var(--tt-line); background: var(--tt-surface); color: var(--tt-text); font-size: 13.5px; font-weight: 500; cursor: pointer; text-decoration: none; line-height: 1.3; }
.tt-btn:hover { background: var(--tt-surface-2); }
.tt-btn--primary { width: 100%; margin-top: 20px; background: var(--tt-primary); color: var(--tt-primary-ink); border-color: var(--tt-primary); font-weight: 600; padding: 11px 16px; }
.tt-btn--primary:hover { filter: brightness(.95); background: var(--tt-primary); }
.tt-btn--sm { padding: 7px 11px; font-size: 13px; width: auto; margin: 0; }
.tt-btn--ghost { padding: 5px 9px; font-size: 12.5px; background: transparent; }
.tt-link { background: none; border: 0; padding: 0; color: var(--tt-muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.tt-secret { border-color: var(--tt-primary); margin-bottom: 14px; }
.tt-secret__value { font-family: var(--tt-mono); font-size: 13px; background: var(--tt-surface-2); padding: 12px; border-radius: var(--tt-radius-s); white-space: pre-wrap; word-break: break-all; user-select: all; }
pre.tt-secret__value { max-height: 320px; overflow: auto; }

.tt-checks { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13.5px; }
.tt-checks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tt-checks input { accent-color: var(--tt-primary); width: 15px; height: 15px; }
/* 넓은 편집 폼: 짧은 칸을 가로로 나란히(--3 = 3칸, --4 = 4칸, __span2 = 두 칸 차지). 폰에선 1~2칸으로 접힘 */
.tt-fields { display: grid; grid-template-columns: repeat(var(--tt-fields-n, 2), minmax(0, 1fr)); gap: 0 16px; }
.tt-fields--3 { --tt-fields-n: 3; } .tt-fields--4 { --tt-fields-n: 4; }
.tt-fields__span2 { grid-column: span 2; }
.tt-row--head { margin-bottom: 0; } .tt-row--head .tt-h2 { margin: 0; }
.tt-checks--field { min-height: 41px; align-items: center; }
.tt-modal .tt-fields--4 { --tt-fields-n: 2; } .tt-modal .tt-fields--3 { --tt-fields-n: 1; }

/* ── 로그인·OTP */
.tt-auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; gap: 14px; }
.tt-auth__form { width: 100%; max-width: 380px; padding: 28px 26px; }
.tt-auth__form--wide { max-width: 460px; }
.tt-auth__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.tt-auth__alt { font-size: 13px; }
.tt-otp { display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: start; margin: 14px 0 6px; }
.tt-otp__qr { border: 1px solid var(--tt-line); border-radius: var(--tt-radius-s); background: #fff; display: block; }
.tt-otp__secret { display: block; font-family: var(--tt-mono); font-size: 13px; word-break: break-all; padding: 8px 10px; background: var(--tt-surface-2); border-radius: var(--tt-radius-s); user-select: all; }

/* ── 반응형(≤860px, 폰·앱 웹뷰): 사이드바 → 상단 바 + 하단 탭바. "더보기"/상단 버튼 → 전체 메뉴 바텀시트 */
@media (max-width: 860px) {
  :root { --tt-tabbar-h: 58px; --tt-safe-b: env(safe-area-inset-bottom, 0px); }
  .tt-shell { grid-template-columns: 1fr; }
  .tt-side { position: sticky; top: 0; z-index: 30; height: auto; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--tt-line); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
  .tt-brand { padding: 4px 0; }
  .tt-side__toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--tt-line); border-radius: var(--tt-radius-s); background: var(--tt-surface); color: var(--tt-text); cursor: pointer; }
  .tt-side__toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
  /* 전체 메뉴 = 바텀시트(탭바 위로 올라옴) */
  .tt-side__panel { display: none; }
  .tt-side.is-open .tt-side__panel { display: flex; flex-direction: column; position: fixed; left: 0; right: 0; bottom: calc(var(--tt-tabbar-h) + var(--tt-safe-b)); max-height: 72vh; overflow: auto; z-index: 41; background: var(--tt-side-bg); border-top: 1px solid var(--tt-line); border-radius: 16px 16px 0 0; padding: 12px 14px 16px; box-shadow: 0 -10px 30px rgba(0, 0, 0, .22); }
  .tt-side.is-open .tt-side__backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .42); z-index: 40; }
  .tt-nav a { padding: 11px 10px; font-size: 14.5px; }
  .tt-nav__label { margin-top: 12px; }
  .tt-side__foot { padding-top: 12px; }
  body.tt-lock { overflow: hidden; }
  /* 하단 탭바 */
  .tt-tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 42; background: var(--tt-side-bg); border-top: 1px solid var(--tt-line); padding: 5px 4px calc(5px + var(--tt-safe-b)); height: calc(var(--tt-tabbar-h) + var(--tt-safe-b)); }
  .tt-tabbar a, .tt-tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; border: 0; background: transparent; color: var(--tt-muted); font-size: 10.5px; font-weight: 500; font-family: inherit; text-decoration: none; padding: 2px 0; border-radius: var(--tt-radius-s); cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tt-tabbar svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tt-tabbar .is-active, .tt-tabbar .is-on { color: var(--tt-primary); font-weight: 600; }
  /* 본문: 탭바 높이만큼 아래 여백, 카드·표·폼은 폰 폭에 맞춤 */
  .tt-page { padding: 16px 16px calc(28px + var(--tt-tabbar-h) + var(--tt-safe-b)); }
  .tt-h1 { font-size: 19px; margin-bottom: 14px; }
  .tt-card { padding: 16px; }
  .tt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tt-stat { padding: 12px 14px; } .tt-stat__num { font-size: 20px; }
  .tt-cols { grid-template-columns: 1fr; }
  .tt-dl { grid-template-columns: 1fr; gap: 2px; } .tt-dl dt { margin-top: 8px; }
  .tt-dl--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; } .tt-dl--grid dt { margin-top: 0; }
  .tt-otp { grid-template-columns: 1fr; justify-items: center; }
  .tt-filter { padding: 12px 14px; gap: 10px 12px; }
  .tt-filter__item { flex: 1 1 140px; min-width: 0; } .tt-filter__item .tt-input { width: 100%; min-width: 0; }
  .tt-filter__actions { width: 100%; } .tt-filter__actions .tt-btn { flex: 1 1 auto; }
  .tt-btn { padding: 10px 14px; min-height: 40px; }
  .tt-btn--sm, .tt-btn--ghost { min-height: 0; }
  .tt-form .tt-btn--primary { width: 100%; }
  .tt-fields, .tt-fields--3 { --tt-fields-n: 1; } .tt-fields--4 { --tt-fields-n: 2; } .tt-fields__span2 { grid-column: 1 / -1; }
  .tt-input, select.tt-input { font-size: 16px; } /* iOS 자동 확대 방지 */
  .tt-pager { justify-content: center; }
  .tt-doc { padding: 20px 16px; } .tt-doc__parties { grid-template-columns: 1fr; } .tt-doc__totals { width: 100%; }
  .tt-doc__actions { flex-wrap: wrap; }
}
/* ── 문서(정산서·거래명세서): 화면에서도 종이처럼, 인쇄 땐 문서만 */
.tt-doc { background: var(--tt-surface); border: 1px solid var(--tt-line); border-radius: var(--tt-radius); padding: 36px 40px; max-width: 860px; margin: 0 auto; color: var(--tt-text); }
.tt-doc__title { font-size: 24px; font-weight: 800; letter-spacing: .08em; text-align: center; margin: 0 0 6px; }
.tt-doc__no { text-align: center; color: var(--tt-muted); font-size: 13px; margin: 0 0 24px; font-family: var(--tt-mono); }
.tt-doc__parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.tt-doc__party { border: 1px solid var(--tt-line); border-radius: var(--tt-radius-s); padding: 12px 14px; font-size: 13px; }
.tt-doc__party h3 { margin: 0 0 8px; font-size: 12px; color: var(--tt-muted); letter-spacing: .04em; }
.tt-doc__party dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; }
.tt-doc__party dt { color: var(--tt-muted); } .tt-doc__party dd { margin: 0; }
.tt-doc__meta { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--tt-muted); margin-bottom: 16px; }
.tt-doc__meta strong { color: var(--tt-text); font-weight: 600; }
.tt-doc__table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tt-doc__table th, .tt-doc__table td { border: 1px solid var(--tt-line); padding: 7px 8px; }
.tt-doc__table th { background: var(--tt-surface-2); font-weight: 600; color: var(--tt-text); text-align: center; }
.tt-doc__table td.tt-num, .tt-doc__table th.tt-num { text-align: right; font-variant-numeric: tabular-nums; }
.tt-doc__totals { margin-top: 16px; margin-left: auto; width: 360px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; font-size: 13.5px; }
.tt-doc__totals dt { color: var(--tt-muted); } .tt-doc__totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.tt-doc__totals .is-grand { font-size: 16px; font-weight: 700; color: var(--tt-text); border-top: 2px solid var(--tt-text); padding-top: 6px; }
.tt-doc__summary { width: 100%; max-width: 420px; margin: 16px 0 0 auto; }
.tt-doc__summary th { text-align: left; width: 45%; }
.tt-doc__date { text-align: right; color: var(--tt-muted); font-size: 12.5px; margin-top: 18px; }
.tt-doc .tt-table th, .tt-doc .tt-table td { border: 1px solid var(--tt-line); }
.tt-doc .tt-table th { text-align: center; }
.tt-doc .tt-table { border: 1px solid var(--tt-line); }
.tt-doc .tt-table tbody tr:last-child td { border-bottom: 1px solid var(--tt-line); }
.tt-doc .tt-table tbody tr:hover td { background: transparent; }
.tt-doc__summary { max-width: none; width: 100%; margin: 16px 0 0; }
.tt-doc__summary th:first-child, .tt-doc__summary td:first-child { width: 60%; text-align: left; }
.tt-doc__summary tbody tr:last-child td { font-weight: 700; }
/* 날인 블록 — 맨 마지막: 확인 문구 · 날짜 · 법인명/대표이사 + (인) 위에 인장 */
.tt-doc__sign { margin-top: 32px; text-align: right; }
.tt-doc__sign-line { margin: 0 0 10px; font-size: 13.5px; text-align: center; color: var(--tt-text); }
.tt-doc__sign-date { margin: 0 0 14px; font-size: 13.5px; text-align: center; }
.tt-doc__sign-corp { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 15px; font-weight: 700; letter-spacing: .06em; padding-right: 8px; }
.tt-doc__sign-seal { position: relative; display: inline-block; width: 52px; text-align: center; color: var(--tt-muted); font-weight: 500; }
.tt-doc__seal { position: absolute; left: 50%; top: 50%; width: 78px; height: 78px; transform: translate(-46%, -52%) rotate(-6deg); opacity: .92; pointer-events: none; }
@media (max-width: 860px) { .tt-doc__sign-corp { font-size: 13.5px; letter-spacing: .02em; } .tt-doc__seal { width: 64px; height: 64px; } }
.tt-doc__foot { margin-top: 28px; font-size: 12px; color: var(--tt-muted); display: flex; justify-content: space-between; }
.tt-doc__stamp { font-size: 12px; color: var(--tt-muted); text-align: right; margin-top: 8px; }
.tt-doc__actions { max-width: 860px; margin: 0 auto 12px; display: flex; gap: 8px; justify-content: space-between; align-items: center; }
.tt-doc__actions .tt-btn { width: auto; margin: 0; }
.tt-filter--bare { padding: 0; margin-bottom: 6px; border: 0; background: transparent; }
.tt-print .tt-page { padding-top: 16px; }
@media print {
  .tt-doc { border: 0; padding: 0; max-width: none; box-shadow: none; }
  .tt-doc__actions, .tt-alerts, .tt-period { display: none !important; }
  .tt-doc__table th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tt-doc__seal { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tt-doc__sign { page-break-inside: avoid; }
  @page { margin: 14mm; }
  .tt-side, .tt-row--end, .tt-btn { display: none !important; }
  .tt-shell { display: block; } body { background: #fff; color: #000; } .tt-card { border-color: #bbb; break-inside: avoid; }
}

/* ── 상세 화면 가로 탭(제휴사 상세 등) ── */
.tt-tabs { display: flex; gap: 4px; margin: -4px 0 18px; border-bottom: 2px solid var(--tt-line); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tt-tabs__item { display: inline-flex; align-items: center; gap: 7px; padding: 11px 16px; margin-bottom: -2px; border-bottom: 2px solid transparent; color: var(--tt-muted); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; border-radius: 8px 8px 0 0; transition: color .12s, background .12s; }
.tt-tabs__item svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tt-tabs__item:hover { color: var(--tt-text); background: var(--tt-surface-2); }
.tt-tabs__item.is-on { color: var(--tt-primary); border-bottom-color: var(--tt-primary); }
@media (max-width: 860px) { .tt-tabs { margin: 0 -16px 14px; padding: 0 16px; } .tt-tabs__item { padding: 10px 12px; font-size: 13.5px; } }

/* ── 연동 문서(마크다운 렌더) ── */
.tt-docpage { max-width: 1180px; margin: 0 auto; padding: 18px 20px 48px; }
.tt-docpage__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--tt-line); margin-bottom: 18px; }
.tt-brand--inline { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.tt-docpage__body { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 32px; align-items: start; }
.tt-docpage__body--single { display: block; max-width: 820px; }
.tt-docpage__toc { position: sticky; top: 16px; font-size: 13px; max-height: calc(100vh - 32px); overflow: auto; padding-right: 6px; }
.tt-docpage__toc-title { display: block; font-size: 11.5px; font-weight: 600; color: var(--tt-muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; list-style: none; cursor: default; }
.tt-docpage__toc-title::-webkit-details-marker { display: none; }
.tt-docpage__toc-list { display: flex; flex-direction: column; gap: 1px; }
.tt-docpage__toc a { color: var(--tt-text); text-decoration: none; padding: 5px 9px; border-radius: 6px; line-height: 1.35; }
.tt-docpage__toc a:hover { background: var(--tt-surface-2); color: var(--tt-primary); }
.tt-docpage__toc-l3 { padding-left: 22px !important; color: var(--tt-muted) !important; font-size: 12.5px; }
.tt-docpage__foot { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--tt-line); color: var(--tt-muted); font-size: 12.5px; }
.tt-md { font-size: 14.5px; line-height: 1.72; min-width: 0; max-width: 860px; }
.tt-md h1 { font-size: 26px; margin: 4px 0 18px; letter-spacing: -.02em; line-height: 1.3; }
.tt-md h2 { font-size: 19px; margin: 40px 0 12px; padding-top: 18px; border-top: 1px solid var(--tt-line); letter-spacing: -.01em; }
.tt-md h3 { font-size: 15.5px; margin: 26px 0 8px; }
.tt-md h2:first-of-type { margin-top: 28px; }
.tt-md p, .tt-md ul, .tt-md ol { margin: 8px 0; }
.tt-md ul, .tt-md ol { padding-left: 22px; }
.tt-md li { margin: 3px 0; }
.tt-md li > p { margin: 2px 0; }
.tt-md blockquote { margin: 14px 0; padding: 10px 16px; border-left: 3px solid var(--tt-primary); background: var(--tt-surface-2); border-radius: 0 var(--tt-radius-s) var(--tt-radius-s) 0; color: var(--tt-text); }
.tt-md blockquote p { margin: 4px 0; }
.tt-md code { font-family: var(--tt-mono); font-size: 12.5px; background: var(--tt-surface-2); border: 1px solid var(--tt-line); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
.tt-md pre { background: var(--tt-surface-2); border: 1px solid var(--tt-line); padding: 12px 14px; border-radius: var(--tt-radius-s); overflow-x: auto; font-size: 12.5px; line-height: 1.55; margin: 10px 0 14px; }
.tt-md pre code { background: none; border: 0; padding: 0; font-size: inherit; word-break: normal; }
.tt-md table { border-collapse: collapse; width: 100%; margin: 12px 0 16px; font-size: 13px; display: block; overflow-x: auto; }
.tt-md th, .tt-md td { border: 1px solid var(--tt-line); padding: 7px 10px; text-align: left; vertical-align: top; }
.tt-md th { background: var(--tt-surface-2); font-weight: 600; white-space: nowrap; }
.tt-md a { color: var(--tt-primary); }
.tt-md hr { border: 0; border-top: 1px solid var(--tt-line); margin: 28px 0; }
.tt-md strong { font-weight: 700; }
.tt-stat__num--sm { font-size: 17px; }
.tt-secret__value--inline { display: inline-block; padding: 4px 8px; font-size: 12px; }
@media (max-width: 860px) {
  .tt-docpage { padding: 14px 16px 40px; }
  .tt-docpage__body { grid-template-columns: 1fr; gap: 16px; }
  .tt-docpage__toc { position: static; max-height: none; border: 1px solid var(--tt-line); border-radius: var(--tt-radius-s); padding: 10px 12px; background: var(--tt-surface); }
  .tt-docpage__toc-title { cursor: pointer; margin: 0; }
  .tt-docpage__toc[open] .tt-docpage__toc-title { margin-bottom: 8px; }
  .tt-docpage__toc-list { max-height: 220px; overflow: auto; }
  .tt-md pre { white-space: pre-wrap; word-break: break-all; }
  .tt-docpage__top .tt-actions { width: 100%; }
}
@media print { .tt-docpage__top, .tt-docpage__toc, .tt-alertbar { display: none !important; } .tt-docpage__body { display: block; } .tt-md pre { white-space: pre-wrap; } }

/* ── 연동 허브(포탈 연동 문서) ── */
.tt-quicknav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -6px 0 16px; }
.tt-quicknav__label { font-size: 12px; color: var(--tt-muted); margin-right: 4px; }
.tt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.tt-md__ep { font-family: var(--tt-mono); font-size: 12px; background: var(--tt-surface-2); border: 1px solid var(--tt-line); padding: 2px 8px; border-radius: 999px; }
.tt-md__ep--get { border-color: rgba(31, 122, 94, .35); color: var(--tt-ok); background: var(--tt-ok-bg); }
.tt-md__ep--post { border-color: rgba(216, 50, 43, .3); color: var(--tt-primary); background: var(--tt-primary-soft); }
.tt-md__ep--put { color: var(--tt-warn); background: var(--tt-warn-bg); }
.tt-md__ep--delete { color: var(--tt-bad); background: var(--tt-bad-bg); }
.tt-md h2 .tt-md__ep, .tt-md h3 .tt-md__ep { font-size: 13px; vertical-align: 2px; }
.tt-list { margin: 6px 0; padding-left: 20px; font-size: 13.5px; line-height: 1.7; }
.tt-rest .tt-h3 { margin: 0; }

/* ── 모달(팝업) 공통: <dialog class="tt-modal tt-modal--{sm|md|lg|xl} [tt-modal--danger]"> > .tt-modal__panel(form 가능) > __head · __body(스크롤) · __foot(고정)
   열기 = [data-modal-open="id"](data-fill-* 로 값 주입), 닫기 = [data-modal-close] 버튼만. 바깥 클릭·ESC 로는 안 닫힌다(tt.js). 폰(≤860px)에선 바텀시트. */
.tt-modal { position: fixed; inset: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; display: none; align-items: center; justify-content: center; z-index: 60; --tt-modal-w: 560px; }
.tt-modal[open] { display: flex; }
.tt-modal::backdrop { background: rgba(8, 10, 14, .55); }
.tt-modal--sm { --tt-modal-w: 420px; } .tt-modal--lg { --tt-modal-w: 760px; } .tt-modal--xl { --tt-modal-w: 960px; }
.tt-modal__panel { display: flex; flex-direction: column; width: min(var(--tt-modal-w), calc(100vw - 32px)); max-height: min(88vh, 920px); margin: 0; background: var(--tt-surface); color: var(--tt-text); border: 1px solid var(--tt-line); border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .28); overflow: hidden; }
.tt-modal__head { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--tt-line); background: var(--tt-surface); }
.tt-modal__title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-modal__title small { display: block; font-size: 12px; font-weight: 400; color: var(--tt-muted); margin-top: 1px; }
.tt-modal__x { flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: var(--tt-radius-s); background: transparent; color: var(--tt-muted); font-size: 20px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.tt-modal__x:hover { background: var(--tt-surface-2); color: var(--tt-text); }
.tt-modal__body { flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; padding: 16px 18px; overscroll-behavior: contain; }
.tt-modal__body > .tt-label:first-child, .tt-modal__body > .tt-h2:first-child { margin-top: 0; }
.tt-modal__body .tt-dl { gap: 8px 18px; }
.tt-modal__foot { flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--tt-line); background: var(--tt-surface); }
.tt-modal__foot .tt-btn, .tt-modal__foot .tt-btn--primary { width: auto; margin: 0; }
.tt-modal__foot .tt-note { margin: 0 auto 0 0; }
.tt-modal--danger .tt-btn--primary { background: var(--tt-bad); border-color: var(--tt-bad); }
.tt-modal--danger .tt-modal__title { color: var(--tt-bad); }
.tt-modal__msg { margin: 0 0 10px; font-size: 14px; line-height: 1.6; }
.tt-modal__warn { padding: 10px 12px; border-radius: var(--tt-radius-s); background: var(--tt-warn-bg); color: var(--tt-warn); font-size: 13px; margin: 0 0 12px; }
/* 상세형: 정보 dl + 작업 목록(한 줄 = 설명 + 버튼) */
.tt-modal__acts { display: flex; flex-direction: column; margin-top: 14px; border-top: 1px solid var(--tt-line); }
.tt-modal__act { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--tt-line-2); font-size: 13.5px; }
.tt-modal__act:last-child { border-bottom: 0; }
.tt-modal__act small { display: block; color: var(--tt-muted); font-size: 12px; }
.tt-modal__act form { margin: 0; display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.tt-modal__act .tt-btn { margin: 0; }
.tt-modal__act .tt-input--sm { width: 110px; }
[data-show], [data-hide] { }
.is-hidden { display: none !important; }
html:has(dialog.tt-modal[open]) { overflow: hidden; }
@media (max-width: 860px) {
  .tt-modal[open] { align-items: flex-end; }
  .tt-modal__panel { width: 100%; max-width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; border-left: 0; border-right: 0; border-bottom: 0; }
  .tt-modal__head { padding: 14px 16px; }
  .tt-modal__body { padding: 14px 16px; }
  .tt-modal__foot { padding: 10px 16px calc(10px + var(--tt-safe-b)); flex-wrap: wrap; }
  .tt-modal__foot .tt-btn, .tt-modal__foot .tt-btn--primary { flex: 1 1 auto; min-height: 44px; }
  .tt-modal__foot .tt-note { flex: 1 1 100%; margin: 0 0 4px; }
  .tt-modal__body .tt-dl { grid-template-columns: max-content 1fr; gap: 6px 14px; } .tt-modal__body .tt-dl dt { margin-top: 0; }
  .tt-modal__act { flex-wrap: wrap; }
  .tt-modal__act form { flex: 1 1 100%; justify-content: flex-end; }
}

/* ── 거래명세서 폰 폭 보정: 당사자 블록 1단, 표는 가로 스크롤, 날인 줄바꿈 (공통 .tt-doc__parties 보다 뒤에 둬야 이김) ── */
.tt-doc__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tt-doc__scroll .tt-table { min-width: 560px; }
@media (max-width: 860px) {
  .tt-doc .tt-doc__parties { grid-template-columns: 1fr; }
  .tt-doc__party dl { grid-template-columns: 84px 1fr; }
  .tt-doc__party dd { word-break: break-all; }
  .tt-doc__meta { gap: 8px 16px; }
  .tt-doc__sign-corp { display: flex; flex-wrap: wrap; justify-content: flex-end; }
  .tt-doc__foot { flex-wrap: wrap; gap: 4px 12px; }
}
@media print { .tt-doc__scroll { overflow: visible; } .tt-doc__scroll .tt-table { min-width: 0; } }

/* ── 행위 피드백: 상단 진행줄(.tt-topbar, tt.js 가 body 에 붙임) · 버튼 스피너(.tt-btn.is-loading) · 다운로드 진행(.tt-progress) */
.tt-topbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; pointer-events: none; opacity: 0; transition: opacity .15s; overflow: hidden; }
.tt-topbar.is-on { opacity: 1; }
.tt-topbar::before { content: ''; position: absolute; top: 0; bottom: 0; left: -45%; width: 45%; background: var(--tt-primary); border-radius: 0 3px 3px 0; animation: tt-slide 1.1s ease-in-out infinite; }
@keyframes tt-slide { 0% { left: -45%; } 60% { left: 100%; } 100% { left: 100%; } }
.tt-btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.tt-btn.is-loading::after { content: ''; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--tt-muted); border-right-color: transparent; animation: tt-spin .7s linear infinite; }
.tt-btn--primary.is-loading::after { border-color: var(--tt-primary-ink); border-right-color: transparent; }
@keyframes tt-spin { to { transform: rotate(360deg); } }
.tt-progress { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; font-size: 13px; color: var(--tt-muted); }
.tt-progress__bar { flex: 1 1 auto; height: 6px; border-radius: 999px; background: var(--tt-surface-2); border: 1px solid var(--tt-line); position: relative; overflow: hidden; }
.tt-progress__bar::before { content: ''; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: var(--tt-primary); border-radius: 999px; animation: tt-slide 1.1s ease-in-out infinite; }
.tt-progress__text { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .tt-topbar::before, .tt-progress__bar::before { animation-duration: 2.4s; } .tt-btn.is-loading::after { animation-duration: 1.4s; } }
