/* Travel UI — 컴포넌트 스타일. 값은 tokens.css의 변수만 참조한다. */

/* ===== base ===== */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-sans); font-size: 14px; line-height: 22px; color: var(--color-text); background: var(--color-bg); -webkit-font-smoothing: antialiased; }
a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-primary-hover); text-decoration: underline; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--color-text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:where(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* ===== scrollbar (평소 6px로 아주 옅게, 스크롤 영역에 마우스를 올리면 진하게 — 색은 글자 토큰을 섞어 라이트·다크 모두 맞춘다.
   Chrome·Edge·Safari는 ::-webkit-scrollbar, Firefox는 표준 속성(폭은 thin까지만)) ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { border-radius: var(--radius-full); background: color-mix(in srgb, var(--color-text-4) 22%, transparent); }
:hover::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--color-text-4) 60%, transparent); }
::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active { background: var(--color-text-3); }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--color-text-4) 22%, transparent) transparent; }
  *:hover { scrollbar-color: color-mix(in srgb, var(--color-text-4) 60%, transparent) transparent; }
}

/* ===== app shell ===== */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar { flex: 1 1 var(--sidebar-width); max-width: 100%; background: var(--color-surface); border-right: 1px solid var(--color-border); display: flex; flex-direction: column; }
@media (min-width: 800px) { .sidebar { flex: 0 0 var(--sidebar-width); position: sticky; top: 0; height: 100vh; } }
.sidebar__brand { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 12px 20px; border-bottom: 1px solid var(--color-border-sub); }
.brand-mark { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--color-primary); color: var(--color-on-primary); font-size: 15px; font-weight: 800; }
.brand-mark--crm { background: none; border-radius: 0; }
.brand-mark--crm svg { display: block; width: 28px; height: 28px; }
.brand-mark--crm .brand-lens { fill: var(--color-logo-lens); }
.brand-mark--crm .brand-ring-a { fill: none; stroke: var(--color-primary); }
.brand-mark--crm .brand-ring-b { fill: none; stroke: var(--color-logo-ring); }
.brand-mark--admin { background: none; border-radius: 0; }
.brand-mark--admin svg { display: block; width: 28px; height: 28px; }
.brand-mark--admin .brand-lens { fill: var(--color-primary-soft); }
.brand-mark--admin .brand-ring-a { fill: none; stroke: var(--color-text); }
.brand-mark--admin .brand-ring-b { fill: none; stroke: var(--color-primary); }
.brand-name { font-size: 15px; font-weight: 700; line-height: 20px; color: var(--color-text); }
.brand-sub { display: block; font-size: 12.5px; font-weight: 400; line-height: 18px; color: var(--color-text-3); }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; }
.nav-link { display: flex; align-items: center; gap: 10px; height: var(--control); padding: 0 12px; border-radius: var(--radius-sm); color: var(--color-text-2); font-size: 14px; font-weight: 500; text-decoration: none; }
.nav-link:hover { background: var(--color-nav-hover); color: var(--color-text); text-decoration: none; }
.nav-link[aria-current="page"] { background: var(--color-primary-soft); color: var(--color-primary); font-weight: 700; }
.nav-link svg { width: 18px; height: 18px; flex: none; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-full); background: var(--color-primary); color: var(--color-on-primary); font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.sidebar__user { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--color-border-sub); font-size: 13.5px; font-weight: 600; }
.sidebar__role { display: block; font-size: 12.5px; font-weight: 400; color: var(--color-text-3); }

.main { flex: 999 1 560px; min-width: 0; }
.main__inner { max-width: var(--page-max); margin: 0 auto; padding: var(--space-8) var(--space-6) var(--space-12); display: flex; flex-direction: column; gap: var(--space-6); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); }
.page-title { margin: 0; font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: -0.3px; }
.page-sub { margin-top: var(--space-1); font-size: 14px; color: var(--color-text-3); }
.page-actions { display: flex; gap: var(--space-2); }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--color-text-3); }
.back-link:hover { color: var(--color-primary); text-decoration: none; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--color-text-3); }
.breadcrumb a { color: var(--color-text-3); }
.breadcrumb [aria-current="page"] { color: var(--color-text); font-weight: 600; }

/* ===== card ===== */
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.card__toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 67px; padding: 14px var(--space-4); border-bottom: 1px solid var(--color-border-sub); }
.card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-5) var(--space-6); }
.card__title { margin: 0; font-size: 16px; line-height: 24px; font-weight: 700; }
.card__count { margin-left: 6px; font-size: 14px; font-weight: 500; color: var(--color-text-3); }
.card__body { padding: var(--space-6); }
.card__foot { padding: 14px var(--space-6); font-size: 13px; line-height: 1.6; color: var(--color-text-3); background: var(--color-surface-sub); border-top: 1px solid var(--color-border-sub); }
.card--attention { border-color: var(--color-warning-line); }
.card--attention > .card__head, .card--attention > .card__toolbar { background: var(--color-warning-tint); border-bottom: 1px solid var(--color-warning-line); }

/* description list */
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-4) var(--space-6); margin: 0; }
.dl > div { min-width: 0; }
.dl dt { font-size: 12.5px; line-height: 18px; color: var(--color-text-4); margin-bottom: 4px; }
.dl dd { margin: 0; font-size: 15px; line-height: 24px; color: var(--color-text); overflow-wrap: anywhere; }
.dl .full { grid-column: 1 / -1; }
.dl .pre { white-space: pre-line; }
.dl .empty { color: var(--color-text-disabled); }

/* ===== button ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--control); padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--color-border-input); background: var(--color-surface); color: var(--color-text-2); font: inherit; font-size: 14px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer; }
.btn:hover { background: var(--color-bg); color: var(--color-text); text-decoration: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); }
.btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: var(--color-on-primary); }
.btn-danger { color: var(--color-danger); border-color: var(--color-danger-line); }
.btn-danger:hover { background: var(--color-danger-soft); color: var(--color-danger); }
.btn-danger-solid { background: var(--color-danger); border-color: var(--color-danger); color: var(--color-on-danger); }
.btn-danger-solid:hover { background: var(--color-danger-strong); border-color: var(--color-danger-strong); color: var(--color-on-danger); }
.btn-success { color: var(--color-success); border-color: var(--color-success-line); }
.btn-success:hover { background: var(--color-success-soft); color: var(--color-success); }
.btn-md { height: var(--control-md); padding: 0 14px; }
.btn-sm { height: var(--control-sm); padding: 0 12px; font-size: 13px; border-radius: var(--radius-xs); }
.btn-xs { height: var(--control-xs); padding: 0 10px; font-size: 12.5px; border-radius: var(--radius-xs); }
.btn-text { height: auto; padding: 0; border: 0; background: none; color: var(--color-link); font-size: 13.5px; font-weight: 600; }
.btn-text:hover { background: none; color: var(--color-primary-hover); text-decoration: underline; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--color-bg); border-color: var(--color-border); color: var(--color-text-disabled); cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-group { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.btn-group--tight { gap: 6px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: var(--control-sm); height: var(--control-sm); border-radius: var(--radius-xs); border: 0; background: transparent; color: var(--color-text-3); cursor: pointer; }
.icon-btn:hover { background: var(--color-border-sub); color: var(--color-text); }
.icon-btn svg { width: 18px; height: 18px; }
.modal .icon-btn--close { width: var(--control); height: var(--control); }
.modal .btn, .modal .input, .modal .select { height: var(--control-modal); }
.auth .btn:not(.btn-text), .auth .input { height: var(--control-auth); }

/* ===== form ===== */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--color-text-2); }
.req { color: var(--color-danger); margin-left: 2px; }
.help { font-size: 12.5px; line-height: 18px; color: var(--color-text-3); }
.field-error { font-size: 12.5px; line-height: 18px; font-weight: 500; color: var(--color-danger); }
.field-ok { font-size: 12.5px; line-height: 18px; font-weight: 600; color: var(--color-success); }
.input, .select { width: 100%; height: var(--control); padding: 0 12px; border: 1px solid var(--color-border-input); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-text); font: inherit; font-size: 14px; }
.input::placeholder { color: var(--color-text-4); }
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--color-text-3) 50%), linear-gradient(135deg, var(--color-text-3) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-focus-halo); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--color-danger); box-shadow: 0 0 0 3px var(--color-danger-soft); }
.input:disabled, .select:disabled { background: var(--color-bg); color: var(--color-text-3); cursor: not-allowed; }
.input--md, .select--md { height: var(--control-md); }
textarea.input { height: auto; min-height: 88px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.input-affix { position: relative; }
.input-affix .input { padding-right: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.input-affix__unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--color-text-3); pointer-events: none; }
.input-row { display: flex; gap: var(--space-2); }
.input-row .input { flex: 1; min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5) var(--space-4); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

/* choice: radio buttons as segmented options */
.seg-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.seg-group legend { padding: 0; margin-bottom: 8px; }
.seg { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.seg-opt { display: inline-flex; align-items: center; gap: 8px; height: var(--control); padding: 0 14px; border: 1px solid var(--color-border-input); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-text-2); font-size: 14px; cursor: pointer; }
.seg-opt input { margin: 0; accent-color: var(--color-primary); }
.seg-opt:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary-soft); color: var(--color-primary); font-weight: 600; }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* choice cards (권한 선택) */
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3); }
.choice-card { display: flex; gap: 10px; padding: 14px 16px; border: 1px solid var(--color-border-input); border-radius: var(--radius-sm); background: var(--color-surface); cursor: pointer; }
.choice-card input { margin: 3px 0 0; accent-color: var(--color-primary); }
.choice-card__title { display: block; font-size: 14px; font-weight: 600; color: var(--color-text); }
.choice-card__desc { display: block; margin-top: 2px; font-size: 12.5px; line-height: 18px; color: var(--color-text-3); }
.choice-card:has(input:checked) { border-color: var(--color-primary); box-shadow: inset 0 0 0 0.5px var(--color-primary); background: var(--color-primary-tint); }
.choice-card:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.choice-card:has(input:focus-visible) { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* segmented filter (목록 필터 탭) */
.seg-filter { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 9px; background: var(--color-chip-neutral); }
.seg-filter__item { display: inline-flex; align-items: center; gap: 4px; height: var(--control-sm); padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--color-text-3); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.seg-filter__item:hover { color: var(--color-text); }
.seg-filter__item[aria-pressed="true"], .seg-filter__item[aria-selected="true"] { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-seg); }
.seg-filter__count { font-weight: 500; color: var(--color-text-4); font-variant-numeric: tabular-nums; }

/* combobox */
.combo { position: relative; }
.combo-list { list-style: none; margin: 4px 0 0; padding: 4px 0; position: absolute; left: 0; right: 0; z-index: 10; max-height: 280px; overflow-y: auto; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); box-shadow: var(--shadow-pop); }
.combo-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; font-size: 14px; cursor: pointer; }
.combo-list li span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--color-text-3); }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--color-primary-soft); }
.combo-list__empty { padding: 10px 14px; font-size: 13px; color: var(--color-text-4); }

/* select (셀렉트 버튼 + 펼친 목록 — 기본 셀렉트의 목록은 꾸밀 수 없어 직접 그린다. 버튼은 .select 모양 그대로, 목록 모양은 combobox 목록과 같다) */
.select--button { display: flex; align-items: center; text-align: left; cursor: pointer; }
.select--button > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select--button[aria-expanded="true"] { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-focus-halo); }
.select-list { list-style: none; margin: 0; padding: 4px 0; position: fixed; z-index: 150; min-width: 120px; max-width: calc(100vw - 16px); max-height: 280px; overflow-y: auto; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); box-shadow: var(--shadow-pop); }
.select-list__option { position: relative; padding: 9px 14px 9px 34px; font-size: 14px; line-height: 20px; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.select-list__option.is-active { background: var(--color-row-hover); }
.select-list__option[aria-selected="true"] { font-weight: 600; color: var(--color-primary); }
.select-list__option[aria-selected="true"]::before { content: ""; position: absolute; left: 14px; top: 50%; width: 9px; height: 5px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-75%) rotate(-45deg); }
.select-list__option[aria-disabled="true"] { color: var(--color-text-3); cursor: not-allowed; }
.select-list__option[aria-disabled="true"].is-active { background: none; }

/* date picker (날짜 입력칸 + 달력 팝업 — 팝업 모양은 combobox 목록과 같다) */
.datepicker { position: relative; }
.datepicker .input { padding-right: 40px; }
.datepicker__toggle { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); }
.datepicker__pop { position: absolute; top: 100%; left: 0; z-index: 20; width: 288px; margin-top: 4px; padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); box-shadow: var(--shadow-pop); }
.datepicker__pop--end { left: auto; right: 0; }
.datepicker__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.datepicker__title { font-size: 14px; font-weight: 700; color: var(--color-text); font-variant-numeric: tabular-nums; }
.datepicker__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.datepicker__dow { height: 28px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--color-text-4); }
.datepicker__dow.is-sun { color: var(--color-danger); }
.datepicker__dow.is-sat { color: var(--color-primary); }
.datepicker__day { height: 34px; padding: 0; border: 1px solid transparent; border-radius: var(--radius-xs); background: transparent; color: var(--color-text); font: inherit; font-size: 13.5px; font-variant-numeric: tabular-nums; cursor: pointer; }
.datepicker__day:hover { background: var(--color-row-hover); }
.datepicker__day.is-outside { color: var(--color-text-4); }
.datepicker__day.is-today { border-color: var(--color-primary); color: var(--color-primary); font-weight: 600; }
.datepicker__day[aria-selected="true"] { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); font-weight: 600; }
.datepicker__day:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.datepicker__foot { display: flex; justify-content: space-between; margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--color-border-sub); }

/* ===== chip ===== */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-full); font-size: 12px; line-height: 18px; font-weight: 600; white-space: nowrap; background: var(--color-chip-neutral); color: var(--color-text-2); }
.chip:empty { display: none; }
.chip--sm { padding: 1px 7px; font-size: 11.5px; line-height: 16px; }
.chip-neutral { background: var(--color-chip-neutral); color: var(--color-text-2); }
.chip-info { background: var(--color-primary-soft); color: var(--color-primary); }
.chip-success { background: var(--color-success-soft); color: var(--color-success); }
.chip-warning { background: var(--color-warning-soft); color: var(--color-warning); }
.chip-danger { background: var(--color-danger-soft); color: var(--color-danger); }
/* 도메인 별칭 — CRM 기존 클래스 그대로 사용 가능 */
.s-consult, .v-prep { background: var(--color-chip-neutral); color: var(--color-text-2); }
.s-booked, .v-applied { background: var(--color-primary-soft); color: var(--color-primary); }
.s-depart { background: var(--color-warning-soft); color: var(--color-warning); }
.s-done, .v-approved, .u-active { background: var(--color-success-soft); color: var(--color-success); }
.s-cancel, .v-rejected, .u-locked { background: var(--color-danger-soft); color: var(--color-danger); }

/* ===== alert ===== */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.55; }
.alert svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.alert strong { font-weight: 700; }
.alert-info { background: var(--color-primary-tint); color: var(--color-text-2); }
.alert-neutral { background: var(--color-surface-sub); border: 1px solid var(--color-border); color: var(--color-text-3); }
.alert-danger { background: var(--color-danger-soft); color: var(--color-danger-strong); }
.alert-danger a { color: var(--color-danger-strong); font-weight: 600; text-decoration: underline; }
.alert-success { background: var(--color-success-soft); color: var(--color-success); }

/* ===== table (CSS grid — 머리와 행이 같은 grid-template-columns) ===== */
.table-wrap { overflow-x: auto; }
.tbl { min-width: 1100px; font-size: 14px; }
.tbl--auto { min-width: 0; }
.tbl__head, .tbl__row { display: grid; grid-template-columns: var(--cols); align-items: center; }
.tbl__head { height: var(--table-head); background: var(--color-surface-sub); border-bottom: 1px solid var(--color-border); font-size: 12.5px; font-weight: 600; color: var(--color-text-3); }
.tbl__row { height: var(--table-row); border-bottom: 1px solid var(--color-border-sub); }
.tbl--compact .tbl__row { height: var(--table-row-compact); }
.tbl__head > *, .tbl__row > * { padding: 0 var(--space-4); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl__row--link { cursor: pointer; }
.tbl__row--link:hover { background: var(--color-row-hover); }
.tbl__body--fixed { min-height: calc(var(--table-row) * 10); }
.tbl .cell-strong { font-weight: 600; }
.tbl .cell-2line { display: flex; flex-direction: column; gap: 2px; line-height: 18px; }
.tbl .cell-2line small { font-size: 12.5px; color: var(--color-text-4); }
.tbl .cell-num, .tbl .cell-amount { font-variant-numeric: tabular-nums; }
.tbl .cell-amount { text-align: right; }
.tbl .cell-actions { display: flex; justify-content: flex-end; gap: 6px; overflow: visible; }
.tbl .cell-empty { color: var(--color-text-disabled); }
.tbl__empty { padding-top: 120px; text-align: center; font-size: 14px; color: var(--color-text-4); display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.skeleton { height: 12px; border-radius: var(--radius-full); background: var(--color-border-sub); }

/* pagination */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--color-border-sub); }
.pager__info { font-size: 12.5px; color: var(--color-text-4); font-variant-numeric: tabular-nums; }
.pager__nav { display: flex; gap: 4px; }
.pg { display: inline-flex; align-items: center; justify-content: center; min-width: var(--control-sm); height: var(--control-sm); padding: 0 6px; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--color-text-2); font: inherit; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; text-decoration: none; }
.pg:hover { background: var(--color-nav-hover); text-decoration: none; }
.pg[aria-current="page"] { background: var(--color-primary); color: var(--color-on-primary); }
.pg--arrow { border: 1px solid var(--color-border-input); }
.pg--arrow:disabled, .pg--arrow[aria-disabled="true"] { opacity: .35; cursor: default; }
.pg svg { width: 14px; height: 14px; }

/* ===== modal ===== */
.overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px; overflow-y: auto; background: var(--color-overlay); }
.modal { width: 100%; max-width: var(--modal-md); background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-modal); display: flex; flex-direction: column; }
.modal--sm { max-width: var(--modal-sm); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); padding: var(--space-6) var(--space-7) 0; }
.modal__title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 700; }
.modal__desc { margin: 4px 0 0; font-size: 13.5px; color: var(--color-text-3); }
.modal__body { padding: var(--space-6) var(--space-7); display: flex; flex-direction: column; gap: var(--space-5); }
.modal__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-7) var(--space-6); border-top: 1px solid var(--color-border-sub); }
.modal__foot-actions { display: flex; gap: var(--space-2); margin-left: auto; }
.modal ul.consequences { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--color-text-2); line-height: 1.7; }

/* ===== toast ===== */
.toast-region { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.toast { padding: 12px 18px; border-radius: 10px; background: var(--color-toast); color: var(--color-on-toast); font-size: 14px; line-height: 20px; box-shadow: var(--shadow-toast); max-width: min(560px, calc(100vw - 32px)); }

/* ===== auth ===== */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 48px 16px; background: var(--color-bg); }
.auth__inner { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: var(--space-6); }
.auth__inner--md { max-width: 460px; }
.auth__inner--lg { max-width: 560px; }
.auth__logo { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 17px; font-weight: 700; }
.auth__card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-8); display: flex; flex-direction: column; gap: var(--space-5); }
.auth__title { margin: 0; font-size: 22px; line-height: 30px; font-weight: 700; letter-spacing: -0.2px; }
.auth__desc { margin: 4px 0 0; font-size: 14px; color: var(--color-text-3); }
.auth__links { display: flex; justify-content: space-between; gap: 12px; }
.auth__note { text-align: center; font-size: 13px; color: var(--color-text-3); }

/* password rules */
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.rule { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--color-text-3); }
.rule::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--color-border-input); }
.rule.is-ok { color: var(--color-success); font-weight: 600; }
.rule.is-ok::before { border-color: var(--color-success); background: var(--color-success); box-shadow: inset 0 0 0 2px var(--color-surface); }

/* stepper */
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-2); }
.step { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; font-size: 12.5px; color: var(--color-text-3); }
.step::before { content: ""; height: 4px; border-radius: var(--radius-full); background: var(--color-border); }
.step__label { display: flex; align-items: center; gap: 6px; }
.step-dot { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--color-border-input); background: var(--color-surface); font-size: 11.5px; font-weight: 700; color: var(--color-text-3); }
.step.is-done::before, .step.is-current::before { background: var(--color-primary); }
.step.is-current { color: var(--color-text); font-weight: 600; }
.step.is-current .step-dot { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); }
.step.is-done .step-dot { background: var(--color-success); border-color: var(--color-success); color: var(--color-surface); }
