/* ============================================================
   ui/pages.css — 화면별 규칙 (v5). 공통은 ui.css, 색은 tokens.css.
   JS 가 만들어 넣는 마크업(표 행 · 모달 내용)의 클래스는 여기서 받는다.
   ============================================================ */

/* ── 슬롯 등록 ────────────────────────────────────────── */
.slot-table { min-width: 1280px; }
.item-name-cell { max-width: 0; }
.item-name-cell > span, .item-name-cell .item-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-name-cell { min-width: 320px; }
.target_link { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; color: var(--ink); font-weight: 600; }
.target_link:hover .item-name { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; }
.keyword-cell span { color: var(--ink-2); }
.slot-status-content { display: inline-flex; align-items: center; white-space: nowrap; font-weight: 600; }
.table_number { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; white-space: nowrap; font-weight: 600; color: var(--ink); }
.rank-action-btn, .btn-rank { height: 28px; padding: 0 10px; font-size: var(--fs-xs); background: var(--brand-soft); border-color: var(--brand-soft-2); color: var(--brand-ink); }
.rank-action-btn:hover, .btn-rank:hover { background: var(--brand-soft-2); border-color: var(--brand); color: var(--brand-ink); }
.slot-category-bar { display: inline-flex; }

/* ── 리뷰 등록 ────────────────────────────────────────── */
.purchase-table { min-width: 1240px; }
.purchase-product-cell { max-width: 0; min-width: 300px; }
.purchase-link { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; color: var(--ink); font-weight: 600; }
.purchase-link:hover { color: var(--brand-ink); }
.purchase-rank-cell { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.purchase-rank-label { color: var(--ink); font-weight: 600; }
.purchase-action-buttons { display: inline-flex; align-items: center; gap: 4px; }
.purchase-link-action-btn { height: 28px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius-xs); background: var(--surface); color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; cursor: pointer; white-space: nowrap; }
.purchase-link-action-btn:hover { background: var(--surface-3); color: var(--ink); }
.purchase-link-action-btn.review { color: var(--brand-ink); border-color: var(--brand-soft-2); background: var(--brand-soft); }
.purchase-link-action-btn.invoice { color: var(--st-warn); }
.purchase-link-action-btn.detail { color: var(--st-wait); }
.purchase-deposit-floating-btn { position: fixed; right: 24px; bottom: 24px; z-index: 1000; height: 42px; padding: 0 18px; border: 1px solid var(--brand); border-radius: var(--radius-pill); background: var(--brand); color: var(--brand-on); font-size: var(--fs-sm); font-weight: 700; box-shadow: var(--shadow-lg); cursor: pointer; }
.purchase-deposit-floating-btn:hover { background: var(--brand-deep); }
.purchase-deposit-modal-card { width: min(440px, calc(100vw - 32px)); }
.purchase-deposit-message { display: none; margin-bottom: 12px; padding: 11px 13px; border: 1px solid var(--st-warn-bg); border-radius: var(--radius-sm); background: var(--st-warn-bg); color: var(--st-warn); font-size: var(--fs-sm); font-weight: 600; line-height: 1.5; }
.purchase-deposit-message.is-visible { display: block; }
.purchase-deposit-message strong { display: block; margin-top: 8px; color: var(--ink); font-size: var(--fs-md); }
.purchase-deposit-message span { display: block; margin-top: 2px; color: var(--ink-2); font-size: var(--fs-sm); }
.purchase-deposit-box { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); line-height: 1.55; }
.purchase-deposit-bank { font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
.purchase-deposit-note { color: var(--ink-3); font-size: var(--fs-sm); }
.purchase-deposit-holder { margin-top: 8px; font-size: var(--fs-md); font-weight: 700; }
/* 리뷰 상세 · 송장 모달 */
.purchase-detail-modal-card { width: min(1040px, calc(100vw - 32px)); }
.purchase-invoice-modal-card { width: min(1180px, calc(100vw - 32px)); }
.purchase-detail-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin-bottom: 14px; }
.purchase-detail-meta-item.is-wide { grid-column: 1 / -1; }
.purchase-detail-label { margin-bottom: 4px; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; }
.purchase-detail-value { color: var(--ink); font-size: var(--fs); font-weight: 600; line-height: 1.45; white-space: pre-wrap; word-break: break-all; }
.purchase-detail-section-title { margin: 8px 0 8px; color: var(--ink); font-size: var(--fs); font-weight: 700; }
.purchase-detail-form { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); margin-bottom: 12px; }
.purchase-detail-business-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.purchase-detail-business-form .purchase-detail-field.is-email { grid-column: span 2; }
.purchase-detail-field { min-width: 0; }
.purchase-detail-field.is-keyword { grid-column: span 2; } .purchase-detail-field.is-link { grid-column: span 4; } .purchase-detail-field.is-wide { grid-column: 1 / -1; }
.purchase-detail-readonly { display: flex; align-items: center; min-height: 36px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-size: var(--fs-sm); font-weight: 600; line-height: 1.35; white-space: pre-wrap; word-break: break-all; }
.purchase-detail-readonly.is-nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.purchase-detail-readonly.is-right { justify-content: flex-end; }
.purchase-detail-readonly a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; }
.purchase-detail-readonly.is-nowrap a { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.purchase-invoice-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.purchase-invoice-summary-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.purchase-invoice-summary-label { margin-bottom: 4px; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; }
.purchase-invoice-summary-value { color: var(--ink); font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.purchase-invoice-toolbar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.purchase-invoice-table-wrap { max-height: min(58vh, 560px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.purchase-invoice-table { min-width: 1360px; table-layout: fixed; }
.purchase-invoice-table th, .purchase-invoice-table td { text-align: center; }
.purchase-invoice-table td.is-code, .purchase-invoice-table td.is-nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.purchase-invoice-table td.is-left { text-align: left; white-space: normal; }
.purchase-invoice-loading, .purchase-invoice-empty { padding: 26px 12px; color: var(--muted); text-align: center; }
/* 리뷰 등록 모달 */
#purchase-order-modal .modal-content { width: min(1080px, calc(100vw - 32px)); }
#purchase_order_item_list { display: flex; flex-direction: column; gap: 8px; }
.purchase-order-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; grid-template-areas: "main remove" "amounts remove" "options remove"; gap: 10px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.purchase-order-main { grid-area: main; display: grid; grid-template-columns: minmax(150px, .8fr) minmax(260px, 1.4fr); gap: 10px; align-items: end; }
.purchase-order-amounts { grid-area: amounts; display: grid; grid-template-columns: minmax(170px, .78fr) minmax(220px, .92fr) minmax(270px, 1fr); gap: 10px; align-items: end; }
.purchase-order-options { grid-area: options; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-items: end; }
.purchase-order-field { min-width: 0; }
.purchase-order-field label, .purchase-business-field label, .purchase-sub-label { display: block; margin-bottom: 4px; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; }
.purchase-order-field.is-grouped > label { display: none; }
.purchase-order-field input, .purchase-order-field select, .purchase-business-field input { width: 100%; }
.purchase-business-info-row { align-items: flex-start; }
.purchase-business-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.purchase-business-field:has([data-business-field="depositor_name"]) { order: 4; }
.purchase-business-field:has([data-business-field="business_type"]) { order: 5; }
.purchase-business-field:has([data-business-field="business_item"]) { order: 6; }
.purchase-business-field:has([data-business-field="tax_invoice_email"]) { grid-column: span 2; order: 7; }
.purchase-inline-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: end; }
.purchase-date-fields { grid-template-columns: minmax(158px, 1fr) 12px minmax(92px, .58fr); align-items: center; }
.purchase-field-separator { display: flex; align-items: center; justify-content: center; height: 36px; color: var(--muted); font-weight: 700; }
.purchase-daily, .purchase-total, .purchase-unit-price, .purchase-total-price-preview { text-align: right; }
.purchase-end-preview, .purchase-total-price-preview { background: var(--surface-3); color: var(--ink); font-weight: 600; }
.purchase-asset-field.is-hidden { display: none; }
.purchase-asset-input-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.purchase-asset-input-line .purchase-asset-file { flex: 1 1 auto; min-width: 0; height: auto; padding: 6px 10px; }
.purchase-asset-status { display: inline-flex; align-items: center; height: 30px; padding: 0 9px; border-radius: var(--radius-xs); background: var(--surface-3); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.purchase-asset-status:empty { display: none; }
.purchase-asset-status.is-checking { background: var(--brand-soft); color: var(--brand-ink); }
.purchase-asset-status.is-valid { background: var(--st-run-bg); color: var(--st-run); }
.purchase-asset-status.is-invalid { background: var(--st-stop-bg); color: var(--st-stop); }
.purchase-asset-help { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 4px; border-radius: 50%; background: var(--ink-3); color: var(--surface); font-size: 10px; font-weight: 700; cursor: help; }
.purchase-asset-help::after { content: "review-assets.zip\A|-- manuscript.xlsx\A|-- photos/\A    |-- A01-01.jpg\A    |-- A01-02.jpg\A    |-- A02-01.jpg"; position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 20; min-width: 240px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--ink); color: var(--surface); font-size: var(--fs-xs); line-height: 1.45; font-family: var(--mono); white-space: pre; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transform: translate(-50%, 4px); transition: opacity .15s, transform .15s; }
.purchase-asset-help:hover::after { opacity: 1; transform: translate(-50%, 0); }
.purchase-asset-alert-pre { margin: 14px 0 0; font-family: var(--mono); font-size: var(--fs-sm); line-height: 1.55; white-space: pre; text-align: left; }
.purchase-order-remove { grid-area: remove; align-self: stretch; width: 40px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--st-stop); font-size: var(--fs-xs); font-weight: 700; cursor: pointer; }
.purchase-order-remove:hover { background: var(--st-stop-bg); border-color: var(--st-stop-bg); }
.purchase-order-add-row { width: 100%; height: 38px; margin-top: 8px; border-style: dashed; }
.purchase-order-notice { margin-top: 4px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.55; }
/* 슬롯에 없는 상품·키워드 안내(순위 수집 안 됨) — 색만이 아니라 아이콘·글자로 알린다 */
.purchase-rank-notice { display: none; grid-column: 1 / -1; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--st-warn-bg); border-radius: var(--radius-xs); background: var(--st-warn-bg); color: var(--st-warn); font-size: var(--fs-xs); font-weight: 600; line-height: 1.45; }
.purchase-rank-notice.is-visible { display: flex; }
/* 순위 칸(고정 128px)에 긴 안내와 버튼이 나란히 안 들어간다 — 안내를 괄호 앞에서 두 줄로 나누고(화면) 버튼은 그 아래로 */
.purchase-rank-cell.is-untracked { flex-direction: column; align-items: flex-end; gap: 4px; }
.purchase-rank-label.is-untracked { color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; line-height: 1.3; text-align: right; }
.purchase-asset-download { margin-left: 8px; flex: 0 0 auto; }
@media (max-width: 860px) {
  .purchase-order-row { grid-template-columns: 1fr; grid-template-areas: "main" "amounts" "options" "remove"; }
  .purchase-order-main, .purchase-order-amounts, .purchase-order-options { grid-template-columns: 1fr; }
  .purchase-business-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .purchase-business-field:has([data-business-field="tax_invoice_email"]) { grid-column: span 1; }
  .purchase-order-remove { width: 100%; height: 36px; }
  .purchase-detail-form, .purchase-detail-business-form, .purchase-detail-meta, .purchase-invoice-summary { grid-template-columns: 1fr; }
  .purchase-detail-field.is-keyword, .purchase-detail-field.is-link, .purchase-detail-business-form .purchase-detail-field.is-email { grid-column: 1; }
}

/* ── 순위 모달 · 시간별 순위 ──────────────────────────── */
.rank-modal { width: min(1120px, calc(100vw - 32px)); }
.rank-modal .modal-body { background: var(--ground); }
.rank-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rank-summary-left { min-width: 0; }
.rank-item-name { color: var(--ink); font-size: var(--fs); font-weight: 700; line-height: 1.4; word-break: break-word; cursor: pointer; user-select: none; }
.rank-item-name.is-mosaic { color: var(--ink-3); }
.rank-keyword-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.rank-keyword-label { padding: 2px 8px; border-radius: var(--radius-pill); background: var(--brand-soft); color: var(--brand-ink); font-size: var(--fs-xs); font-weight: 700; }
.rank-keyword { color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; }
.rank-summary-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.rank-summary-right .form-input { width: 200px; text-align: center; font-weight: 600; }
.rank-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rank-meta { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border-radius: var(--radius-pill); background: var(--surface-3); color: var(--ink-3); font-size: var(--fs-xs); white-space: nowrap; }
.rank-meta strong { color: var(--ink); }
.rank-tab { height: 32px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.rank-tab.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.rank-related-keywords { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rank-related-label { padding: 3px 8px; border-radius: var(--radius-pill); background: var(--brand-soft); color: var(--brand-ink); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.rank-related-list { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.rank-chip-wrap { position: relative; display: inline-flex; align-items: center; }
.rank-related-chip { display: inline-flex; align-items: center; max-width: min(220px, 100%); min-height: 28px; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; cursor: pointer; overflow-wrap: anywhere; }
.rank-related-chip:hover { background: var(--surface-3); }
.rank-related-chip.active { background: var(--brand); border-color: var(--brand); color: var(--brand-on); }
.rank-related-chip.rank-related-main { border-style: dashed; }
.rank-related-empty { color: var(--muted); font-size: var(--fs-xs); }
.rank-chip-remove { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: -6px; padding: 0; border: 1px solid var(--line-2); border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 12px; line-height: 1; cursor: pointer; }
.rank-chip-remove:hover { background: var(--st-stop-bg); border-color: var(--st-stop-bg); color: var(--st-stop); }
.rank-keyword-add { display: flex; align-items: center; gap: 6px; }
.rank-keyword-add input { width: 160px; height: 30px; border-radius: var(--radius-pill); font-size: var(--fs-xs); }
.rank-keyword-add-btn { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border: 1px solid var(--brand); border-radius: var(--radius-pill); background: var(--brand); color: var(--brand-on); font-size: var(--fs-xs); font-weight: 700; cursor: pointer; white-space: nowrap; }
.rank-keyword-add-btn:hover { background: var(--brand-deep); }
.rank-flex-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rank-chart-section { height: 300px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rank-table-section { min-width: 0; }
.rank-table-scroll { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.hourly-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; color: var(--ink-2); font-size: var(--fs-sm); }
.hourly-summary > * { padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.hourly-scroll { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.hourly-table { width: 100%; }
@media (max-width: 1023px) { .rank-flex-wrap { grid-template-columns: 1fr; } .rank-summary { grid-template-columns: 1fr; } .rank-summary-right { justify-content: flex-start; } .rank-related-keywords { grid-template-columns: auto minmax(0, 1fr); } .rank-keyword-add { grid-column: 1 / -1; } .rank-keyword-add input { width: 100%; } }

/* ── 상품 분석 ────────────────────────────────────────── */
.analysis-table { min-width: 1100px; }
.analysis-table th[data-sort-key] { cursor: pointer; user-select: none; }
.analysis-table th[data-sort-key]::after { content: attr(data-sort-indicator); margin-left: 5px; color: var(--brand); font-size: 10px; }
.analysis-table td > small { display: block; margin-top: 4px; color: var(--muted); font-size: var(--fs-xs); }
.analysis-table code { display: block; color: var(--ink-2); font-family: var(--mono); font-size: var(--fs-xs); }
.analysis-table td.col-detail, .analysis-table th.col-detail { width: 96px; }
/* 쪽 번호 줄 — '페이지당 행' 칸을 뺐으므로 오른쪽에 붙이고, display:flex 가 hidden 속성을 이기지 않게 한다 */
#analysis-page-bottom { justify-content: flex-end; }
#analysis-page-bottom[hidden] { display: none; }
.product-cell { display: flex; align-items: center; gap: 12px; min-width: 300px; }
.product-cell strong { display: block; max-width: 300px; overflow: hidden; color: var(--ink); font-size: var(--fs); text-overflow: ellipsis; white-space: nowrap; }
.product-cell small { display: block; margin-top: 4px; color: var(--muted); font-size: var(--fs-xs); }
.product-link:hover strong { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; }
.table-score { display: inline-flex; align-items: center; gap: 8px; }
.table-score b { min-width: 30px; color: var(--ink); font-weight: 700; }
.table-score i { width: 56px; height: 5px; overflow: hidden; border-radius: 99px; background: var(--surface-sunk); }
.table-score span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.positive { color: var(--st-run); } .danger { color: var(--st-stop); }
.analysis-tools { display: inline-flex; gap: 8px; }
/* 분석 상세 모달 (hidden 속성으로 열고 닫는다) */
.analysis-modal[hidden], .analysis-panel[hidden] { display: none; }
.analysis-modal { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(15, 20, 30, .5); backdrop-filter: blur(2px); }
.analysis-modal-card { display: flex; flex-direction: column; width: min(1200px, calc(100vw - 36px)); height: min(860px, calc(100vh - 36px)); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--ground); box-shadow: var(--shadow-lg); }
.analysis-modal-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.analysis-modal-label { color: var(--brand-ink); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; }
.analysis-modal-top h2 { margin: 3px 0 4px; font-size: var(--fs-lg); font-weight: 700; line-height: 1.3; }
.analysis-modal-top p { color: var(--ink-3); font-size: var(--fs-xs); }
.analysis-modal-actions { display: flex; align-items: center; gap: 8px; }
.analysis-modal-actions button { width: 36px; height: 36px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-3); font-size: 22px; line-height: 1; cursor: pointer; }
.analysis-modal-actions button:hover { background: var(--surface-3); color: var(--ink); }
.analysis-mobile-close { display: none; }
.analysis-tabs { display: flex; padding: 0 12px; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--surface); }
.analysis-tabs button { min-width: 110px; padding: 13px 14px 11px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--ink-3); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.analysis-tabs button:hover { color: var(--ink); }
.analysis-tabs button.active { border-bottom-color: var(--brand); color: var(--brand-ink); }
.analysis-modal-body { flex: 1; min-height: 0; padding: 20px; overflow-y: auto; }
.detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.detail-heading h3 { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
.detail-heading p, .detail-card > p { color: var(--ink-3); font-size: var(--fs-sm); line-height: 1.6; }
.attention-pill, .result-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.attention-pill { background: var(--st-warn-bg); color: var(--st-warn); }
.attention-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.result-pill { background: var(--brand-soft); color: var(--brand-ink); }
.detail-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.detail-metrics article, .detail-card, .position-cards article, .review-summary-grid article, .strategy-priority article { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.detail-metrics span, .position-cards span, .review-summary-grid span, .strategy-priority span { display: block; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; }
.detail-metrics strong { display: block; margin: 8px 0 4px; font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.detail-metrics small { color: var(--muted); font-size: var(--fs-xs); }
.detail-metrics em { color: var(--st-run); font-size: var(--fs-xs); font-style: normal; font-weight: 600; }
.analysis-insight-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.analysis-insight-strip article { padding: 14px 16px; border: 1px solid var(--st-run-bg); border-radius: var(--radius); background: var(--st-run-bg); }
.analysis-insight-strip article.warning { border-color: var(--st-warn-bg); background: var(--st-warn-bg); }
.analysis-insight-strip span { color: var(--ink-3); font-size: var(--fs-xs); font-weight: 700; }
.analysis-insight-strip strong { display: block; margin: 5px 0 3px; font-size: var(--fs); color: var(--ink); }
.analysis-insight-strip p { color: var(--ink-2); font-size: var(--fs-xs); line-height: 1.6; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 12px; }
.detail-grid.wide-left { grid-template-columns: 1.65fr 1fr; }
.detail-card h4 { margin: 0 0 4px; color: var(--ink); font-size: var(--fs-md); font-weight: 700; }
.detail-card h4 em { float: right; color: var(--st-run); font-size: var(--fs-xs); font-style: normal; }
.detail-card > small { display: block; margin: 12px 0 6px; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; }
.mini-table { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: var(--fs-sm); }
.mini-table th, .mini-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.mini-table th { color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; }
.mini-table th:first-child, .mini-table td:first-child { text-align: left; }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table .selected td { background: var(--brand-soft); }
.similar-product { display: flex; align-items: center; gap: 9px; min-width: 240px; color: var(--ink); }
.similar-product img { flex: 0 0 40px; width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--line); }
.similar-product span { display: -webkit-box; overflow: hidden; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.similar-ids { min-width: 160px; } .similar-ids code, .similar-ids small { display: block; white-space: nowrap; } .similar-ids small { margin-top: 3px; color: var(--muted); }
.similar-analysis-table th, .similar-analysis-table td { text-align: left; vertical-align: middle; }
.similar-analysis-table td > small { display: block; margin-top: 4px; color: var(--muted); }
.similarity-score { margin-bottom: 6px; color: var(--brand-ink); font-size: var(--fs-xs); font-weight: 700; }
.similar-keywords { display: flex; flex-wrap: wrap; gap: 4px; font-size: var(--fs-xs); }
.similar-keywords i { padding: 3px 7px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-ink); font-style: normal; }
.competition-badge { display: inline-flex; padding: 5px 9px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-ink); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.competition-badge.low { background: var(--st-warn-bg); color: var(--st-warn); } .competition-badge.strong { background: var(--st-stop-bg); color: var(--st-stop); }
.competition-badge.premium { background: var(--st-done-bg); color: var(--st-done); } .competition-badge.partial { background: var(--st-idle-bg); color: var(--st-idle); }
.score-row { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 12px; }
.score-row b { font-size: var(--fs-2xl); font-weight: 700; }
.progress { height: 8px; margin: 10px 0 14px; overflow: hidden; border-radius: 99px; background: var(--surface-sunk); }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips i { padding: 5px 10px; border-radius: var(--radius-pill); background: var(--st-run-bg); color: var(--st-run); font-size: var(--fs-xs); font-style: normal; font-weight: 600; }
.chips.warning i { background: var(--st-warn-bg); color: var(--st-warn); } .chips.muted i { background: var(--st-idle-bg); color: var(--st-idle); }
.position-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.position-cards strong { display: block; margin: 8px 0 6px; font-size: var(--fs-md); color: var(--ink); }
.position-cards p { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.6; }
.position-cards .primary { border-color: var(--brand-soft-2); background: var(--brand-soft); }
.title-box, .recommend-box, .data-note { margin: 8px 0 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.6; }
.title-box.recommended { background: var(--brand-soft); color: var(--brand-ink); }
.data-note { margin-top: 12px; }
.step-list { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: step; }
.step-list li { position: relative; min-height: 40px; padding: 3px 0 12px 36px; font-size: var(--fs-sm); }
.step-list li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 2px; display: grid; width: 26px; height: 26px; place-items: center; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: var(--fs-xs); }
.step-list b, .step-list span { display: block; } .step-list span { margin-top: 3px; color: var(--ink-3); line-height: 1.55; }
.keyword-status { margin: 8px 0 0; padding: 0; list-style: none; }
.keyword-status li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.keyword-status li:last-child { border-bottom: 0; } .keyword-status b { color: var(--st-run); } .keyword-status .warn { color: var(--st-warn); }
.seo-score { display: flex; align-items: flex-end; gap: 8px; margin: 12px 0 14px; }
.seo-score strong { font-size: 44px; line-height: 1; font-weight: 700; letter-spacing: -0.03em; } .seo-score span { color: var(--ink-3); font-size: var(--fs-xs); }
.score-breakdown div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.score-breakdown div:last-child { border-bottom: 0; } .score-breakdown span { color: var(--ink-3); } .score-breakdown b { color: var(--ink); }
.review-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.review-summary-grid strong { display: block; margin: 8px 0 4px; font-size: var(--fs-xl); font-weight: 700; } .review-summary-grid p { color: var(--muted); font-size: var(--fs-xs); }
.review-compare { display: grid; gap: 12px; margin-top: 12px; }
.review-compare label { display: flex; justify-content: space-between; margin-bottom: 4px; color: var(--ink-3); font-size: var(--fs-xs); }
.review-compare i { display: block; height: 7px; overflow: hidden; border-radius: 99px; background: var(--surface-sunk); }
.review-compare i span { display: block; height: 100%; border-radius: inherit; background: var(--ink-3); }
.review-compare .current label { color: var(--brand-ink); font-weight: 700; } .review-compare .current i span { background: var(--brand); }
.decision-box { padding: 14px; border-radius: var(--radius-sm); } .decision-box b { display: block; margin-bottom: 6px; font-size: var(--fs); } .decision-box p { font-size: var(--fs-sm); line-height: 1.6; }
.positive-box { background: var(--st-run-bg); color: var(--st-run); } .neutral-box { background: var(--st-warn-bg); color: var(--st-warn); } .warning-box { background: var(--st-stop-bg); color: var(--st-stop); }
.strategy-priority { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.strategy-priority article { display: grid; grid-template-columns: 32px minmax(0, 1fr); grid-template-rows: 1fr auto; align-items: start; gap: 10px; }
.strategy-priority article > b { display: grid; width: 30px; height: 30px; place-items: center; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand-ink); }
.strategy-priority strong { display: block; margin: 3px 0 8px; font-size: var(--fs); color: var(--ink); } .strategy-priority p { color: var(--ink-3); font-size: var(--fs-xs); line-height: 1.55; }
.strategy-priority .priority-detail { margin-top: 8px; } .strategy-priority .priority-detail b { display: block; margin-bottom: 2px; color: var(--ink); font-size: var(--fs-xs); }
.strategy-priority em { grid-column: 1 / -1; justify-self: start; padding: 5px 9px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-ink); font-size: var(--fs-xs); font-style: normal; font-weight: 700; }
.analysis-explanation { margin-bottom: 12px; }
.analysis-explain-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.analysis-explain-grid article { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.analysis-explain-grid strong { display: block; margin-bottom: 8px; color: var(--ink); font-size: var(--fs); }
.analysis-explain-grid p { margin: 8px 0 0; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.6; }
.analysis-explain-grid p b { display: block; margin-bottom: 2px; color: var(--brand-ink); font-size: var(--fs-xs); }
.kpi-list { margin: 8px 0 0; }
.kpi-list div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.kpi-list div:last-child { border-bottom: 0; } .kpi-list dt { color: var(--ink-3); } .kpi-list dd { margin: 0; font-weight: 700; }
@media (max-width: 900px) {
  .analysis-modal { padding: 0; } .analysis-modal-card { width: 100vw; height: 100vh; border-radius: 0; }
  .detail-grid, .detail-grid.wide-left { grid-template-columns: 1fr; }
  .detail-metrics, .position-cards, .analysis-insight-strip, .review-summary-grid, .strategy-priority, .analysis-explain-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .detail-metrics, .position-cards, .analysis-insight-strip, .review-summary-grid, .strategy-priority, .analysis-explain-grid { grid-template-columns: 1fr; }
  .analysis-modal-actions { display: none; }
  .analysis-mobile-close { position: fixed; top: 14px; right: 14px; z-index: 3100; display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--ink); font-size: 24px; cursor: pointer; }
}

/* ── 유저 관리 ────────────────────────────────────────── */
.user-manage-actions { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.user-manage-actions .btn { height: 30px; padding: 0 10px; font-size: var(--fs-xs); }
/* 거르기(2026-09-15): 검색어 칸은 사업자 정보까지 찾아서 넓게, 소속·상태 칸은 내용만큼 */
.user-search input { width: 320px; }
.user-filter { width: auto; min-width: 120px; max-width: 300px; }
.user-company-cell { display: inline-flex; align-items: center; gap: 6px; }
.user-parent-cell { display: inline-flex; align-items: center; gap: 2px; max-width: 300px; }
.user-parent-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-parent-cell .btn-children { width: 28px; height: 28px; padding: 0; justify-content: center; color: var(--muted); }
#user-tbody tr.is-suspended td { color: var(--muted); }
#user-tbody .btn-access-log { height: 28px; padding: 0 8px; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); }
.user-log-heading { margin: 18px 0 8px; font-size: var(--fs-md); font-weight: 700; }
.user-log-heading .muted { margin-left: 6px; font-size: var(--fs-xs); font-weight: 500; }
.user-log-wrap { max-height: 300px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
#user-log-foot { margin-top: 10px; }
@media (max-width: 900px) { .user-search, .user-search input, .user-filter { width: 100%; max-width: none; } }
/* 계정별 현황(2026-09-15): 전체 수 + 상태 칩. 둘 다 그 계정으로 거른 슬롯·리뷰 화면으로 가는 링크 — 색만이 아니라 글자로 구분한다 */
.user-stat-cell { display: inline-flex; align-items: center; gap: 4px; }
.user-stat-total { min-width: 16px; margin-right: 2px; color: var(--ink); font-weight: 700; text-decoration: none; }
.user-stat { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; text-decoration: none; white-space: nowrap; }
.user-stat.is-run { background: var(--st-run-bg); color: var(--st-run); }
.user-stat.is-wait { background: var(--st-wait-bg); color: var(--st-wait); }
.user-stat.is-warn { background: var(--st-warn-bg); color: var(--st-warn); }
.user-stat:hover, .user-stat-total:hover { text-decoration: underline; }
.user-manage-actions .btn-delete { color: var(--st-stop); }
#user-modal .modal-content, #edit-user-modal .modal-content { width: min(880px, calc(100vw - 32px)); }
#user-form > div:first-child, #edit-user-form > div:first-child { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; row-gap: 0; }
#user-form > div:first-child > input[type="hidden"], #edit-user-form > div:first-child > input[type="hidden"] { display: none; }
#user-form .form-row:has(input[name="company_name"]), #user-form .form-row:has(input[name="user_id"]), #user-form .form-row:has(input[name="password"]), #user-form .form-row:has(select[name="user_grade"]),
#edit-user-form .form-row:has(input[name="company_name"]), #edit-user-form .form-row:has(input[name="user_id"]), #edit-user-form .form-row:has(input[name="password"]), #edit-user-form .form-row:has(select[name="user_grade"]) { grid-column: 1; }
#user-form .form-row:has(input[name="business_registration_number"]), #user-form .form-row:has(input[name="business_company_name"]), #user-form .form-row:has(input[name="business_representative_name"]), #user-form .form-row:has(input[name="business_type"]), #user-form .form-row:has(input[name="business_item"]), #user-form .form-row:has(input[name="tax_invoice_email"]), #user-form .form-row:has(input[name="depositor_name"]),
#edit-user-form .form-row:has(input[name="business_registration_number"]), #edit-user-form .form-row:has(input[name="business_company_name"]), #edit-user-form .form-row:has(input[name="business_representative_name"]), #edit-user-form .form-row:has(input[name="business_type"]), #edit-user-form .form-row:has(input[name="business_item"]), #edit-user-form .form-row:has(input[name="tax_invoice_email"]), #edit-user-form .form-row:has(input[name="depositor_name"]) { grid-column: 2; }
#user-form .form-row:has(input[name="company_name"]), #edit-user-form .form-row:has(input[name="company_name"]), #user-form .form-row:has(input[name="business_registration_number"]), #edit-user-form .form-row:has(input[name="business_registration_number"]) { grid-row: 1; }
#user-form .form-row:has(input[name="user_id"]), #edit-user-form .form-row:has(input[name="user_id"]), #user-form .form-row:has(input[name="business_company_name"]), #edit-user-form .form-row:has(input[name="business_company_name"]) { grid-row: 2; }
#user-form .form-row:has(input[name="password"]), #edit-user-form .form-row:has(input[name="password"]), #user-form .form-row:has(input[name="business_representative_name"]), #edit-user-form .form-row:has(input[name="business_representative_name"]) { grid-row: 3; }
#user-form .form-row:has(select[name="user_grade"]), #edit-user-form .form-row:has(select[name="user_grade"]), #user-form .form-row:has(input[name="business_type"]), #edit-user-form .form-row:has(input[name="business_type"]) { grid-row: 4; }
#user-form .form-row:has(input[name="business_item"]), #edit-user-form .form-row:has(input[name="business_item"]) { grid-row: 5; }
#user-form .form-row:has(input[name="tax_invoice_email"]), #edit-user-form .form-row:has(input[name="tax_invoice_email"]) { grid-row: 6; }
#user-form .form-row:has(input[name="depositor_name"]), #edit-user-form .form-row:has(input[name="depositor_name"]) { grid-row: 7; }
.form-col-title { grid-column: 1 / -1; margin: 4px 0 10px; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; }
.user-tree ul { list-style: none; margin: 0; padding-left: 22px; }
.user-tree li { position: relative; margin: 4px 0; }
.user-tree ul > li::before { content: ""; position: absolute; top: -6px; left: -12px; width: 1px; height: 100%; background: var(--line-2); }
.user-tree ul > li::after { content: ""; position: absolute; top: 14px; left: -12px; width: 12px; height: 1px; background: var(--line-2); }
.user-tree ul > li:last-child::before { height: 14px; }
.node-row { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: var(--radius-xs); line-height: 1.6; cursor: pointer; white-space: nowrap; }
.node-row:hover { background: var(--surface-3); }
.node-row.selected { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.node-row .toggle { color: var(--muted); font-size: 11px; }
.tree-root { max-height: 65vh; overflow: auto; }
@media (max-width: 760px) { #user-form > div:first-child, #edit-user-form > div:first-child { grid-template-columns: 1fr; } #user-form .form-row, #edit-user-form .form-row { grid-column: 1 !important; grid-row: auto !important; } }

/* ── 슬롯 로그 · 정산 · 리뷰 로그 ─────────────────────── */
.log-table { min-width: 1180px; }
.dealer-select-grid { display: inline-flex; gap: 6px; }
.dealer-select-grid select { width: 140px; }
.dealer-select-grid select:empty { display: none; }
.desc-cell, .company-cell, .dealer-cell, .actor-cell { max-width: 0; min-width: 140px; }
.desc-cell { min-width: 220px; }

/* ── 슬롯 통계 (트리 표) ───────────────────────────────── */
.stat-table { min-width: 900px; }
.stat-table tbody td:first-child { text-align: left; }
.tree-cell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tree-indent { display: inline-block; width: 18px; }
.tree-toggle { width: 22px; height: 22px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink-3); font-size: 11px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.tree-toggle:hover { background: var(--surface-3); color: var(--ink); }
.tree-label { font-weight: 600; color: var(--ink); }
.stat-table tr[data-depth="0"] > td { background: var(--surface-2); }

/* ── 일별 통계 ────────────────────────────────────────── */
.daily-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 14px; }
.daily-chart-wrap { position: relative; height: 380px; padding: 16px; }
.daily-table-wrap { max-height: 480px; overflow: auto; }
.daily-gap-col { width: 14px; padding: 0; background: var(--surface-2); }
.today-row td { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.todayText { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; margin-right: 6px; border-radius: var(--radius-pill); background: var(--brand); color: var(--brand-on); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.value-strong { font-weight: 700; color: var(--ink); }
@media (max-width: 1100px) { .daily-grid { grid-template-columns: 1fr; } }

/* ── 공지사항 ─────────────────────────────────────────── */
.board-row { cursor: pointer; }
.board-row td:nth-child(2) { color: var(--ink); font-weight: 600; }
.board-row:hover td:nth-child(2) { color: var(--brand-ink); }
#detail-content { white-space: pre-wrap; line-height: 1.7; color: var(--ink-2); }

/* ── 내 정보 ──────────────────────────────────────────── */
.me-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.me-name { font-size: var(--fs-lg); font-weight: 700; color: var(--ink); }
.me-sub { margin-top: 3px; font-size: var(--fs-sm); color: var(--ink-3); }
.kv { display: grid; grid-template-columns: 150px 1fr; row-gap: 10px; column-gap: 12px; margin: 0; font-size: var(--fs); }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; color: var(--ink); font-weight: 500; word-break: break-all; }

/* ── 로그인 (v15) — 카드도 사진도 분할 패널도 없다 ────────
   전면 차콜 캔버스 위에 브랜드 이름 그대로 "우상향" 하는 선 하나가 그려진다.
   폼은 상자 대신 밑줄만. 앱 안쪽과 달리 항상 어두운 화면이다(현관이니까). */
.login {
  position: relative; min-height: 100vh; overflow: hidden;
  background: #0e0e10; color: #f5f6f7;
  display: flex; align-items: center;
  padding: 40px clamp(24px, 9vw, 140px);
}
.login::before {                       /* 아주 옅은 격자 */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(120% 90% at 30% 40%, #000 45%, transparent 100%);
}
.login-canvas { position: absolute; inset: 0; color: var(--brand, #94dba6); pointer-events: none; }
.login-chart { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 78%; overflow: visible; }
.login-area { fill: url(#wshFill); }
.login-line {
  fill: none; stroke: currentColor; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round;
  filter: drop-shadow(0 0 18px rgba(148, 219, 166, .45));
  stroke-dasharray: 2400; stroke-dashoffset: 2400;
  animation: wsh-draw 1.9s cubic-bezier(.3, .7, .3, 1) .15s forwards;
}
@keyframes wsh-draw { to { stroke-dashoffset: 0; } }
.login-spark {                          /* 선 끝의 빛 */
  position: absolute; right: 0; top: 22%; width: 46vw; height: 46vw; max-width: 620px; max-height: 620px;
  transform: translate(28%, -30%); border-radius: 50%;
  background: radial-gradient(circle, rgba(148, 219, 166, .22) 0%, rgba(148, 219, 166, 0) 62%);
}

.login-panel { position: relative; z-index: 1; width: min(420px, 100%); }
.login-brand { display: inline-flex; align-items: center; gap: 11px; margin-bottom: clamp(28px, 6vh, 54px); color: #f5f6f7; }
.login-brand:hover { color: #f5f6f7; }
.login-brand svg { width: 34px; height: 34px; }
.login-brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.login-brand-copy strong { font-size: 17px; font-weight: 700; letter-spacing: -0.03em; }
.login-brand-copy small { margin-top: 3px; font-size: 9.5px; font-weight: 600; letter-spacing: .16em; color: rgba(245, 246, 247, .45); }

.login-headline {
  margin: 0 0 clamp(28px, 5vh, 46px);
  font-size: clamp(34px, 4.4vw, 52px); font-weight: 700; line-height: 1.18; letter-spacing: -0.045em;
  word-break: keep-all;
}
.login-headline span { display: block; }
.login-headline span:last-child { color: var(--brand, #94dba6); }

.login-form { display: flex; flex-direction: column; gap: 26px; }
.lf-field { display: flex; flex-direction: column; gap: 9px; }
.lf-field label { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: rgba(245, 246, 247, .42); }
.lf-field input {
  width: 100%; height: 44px; padding: 0 2px; border: 0; border-bottom: 1px solid rgba(245, 246, 247, .18);
  border-radius: 0; background: transparent; color: #f5f6f7; font-size: 17px; font-weight: 500;
  transition: border-color .16s ease;
}
.lf-field input::placeholder { color: rgba(245, 246, 247, .26); font-weight: 400; }
.lf-field input:focus { outline: none; box-shadow: none; border-bottom-color: var(--brand, #94dba6); }
.lf-field input:-webkit-autofill { -webkit-text-fill-color: #f5f6f7; transition: background-color 9999s ease-out; }
.lf-secret { position: relative; display: flex; align-items: center; }
.lf-secret input { padding-right: 40px; }
.toggle-password {
  position: absolute; right: 0; bottom: 6px; display: grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: 8px; background: transparent; color: rgba(245, 246, 247, .38); cursor: pointer;
}
.toggle-password:hover { color: #f5f6f7; }
.eye-icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.eye-icon.eye-hide { display: none; }
.toggle-password.is-visible .eye-show { display: none; }
.toggle-password.is-visible .eye-hide { display: block; }

.login-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 54px; margin-top: 6px; border: 0; border-radius: 999px;
  background: var(--brand, #94dba6); color: #0f2a1a; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.login-submit i { font-size: 13px; transition: transform .16s ease; }
.login-submit:hover { background: #a6e3b5; box-shadow: 0 14px 34px rgba(148, 219, 166, .26); }
.login-submit:hover i { transform: translateX(3px); }
.login-submit:active { transform: translateY(1px); }
.login-submit:disabled { opacity: .55; cursor: progress; }

.login-note { margin-top: 26px; font-size: 12.5px; color: rgba(245, 246, 247, .34); }

@media (max-width: 640px) {
  .login { align-items: flex-start; padding: 56px 22px; }
  .login-spark { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .login-line { animation: none; stroke-dashoffset: 0; }
}

/* ── 소속 변경 모달 (user_parent_change.js 가 자체 <style> 을 넣지만 토큰으로 덮는다) ── */
#change-parent-modal .parent-change-summary { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); line-height: 1.6; }
#change-parent-modal .parent-change-summary strong { color: var(--ink); }
#change-parent-modal .parent-option-list { max-height: 260px; margin-top: 6px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); }
#change-parent-modal .parent-option-item { display: block; width: 100%; padding: 10px 13px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-align: left; font-size: var(--fs-sm); cursor: pointer; }
#change-parent-modal .parent-option-item:hover { background: var(--surface-3); color: var(--ink); }
#change-parent-modal .parent-option-item.is-selected { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
#change-parent-modal .parent-option-empty { padding: 18px 12px; color: var(--muted); text-align: center; }
#change-parent-modal .parent-selected-text { min-height: 24px; margin-top: 10px; color: var(--brand-ink); font-weight: 600; font-size: var(--fs-sm); }


/* ══════════════════════════════════════════════════════════
   v6 (2026-09-02) — 상품 중심 표 행
   열 10개를 6~7개로 줄이고, 상품을 주인공으로 세운다.
   썸네일 + 상품명 + (키워드 · ID) 한 덩어리, 나머지는 오른쪽에 짧게.
   ══════════════════════════════════════════════════════════ */
.slot-table, .purchase-table { table-layout: fixed; min-width: 1020px; }
.slot-table .col-select, .purchase-table .col-select { width: 44px; }
.slot-table .col-owner,  .purchase-table .col-owner  { width: 152px; }
.slot-table .col-status, .purchase-table .col-status { width: 100px; }
.slot-table .col-rank,   .purchase-table .col-rank   { width: 128px; }
.slot-table .col-period, .purchase-table .col-period { width: 132px; }
.purchase-table .col-act { width: 168px; }

.cell-product { min-width: 0; }
.prod { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; color: var(--ink); }
.prod-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.prod-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }
.prod:hover .prod-name { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; }
.prod-meta { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: var(--fs-xs); }
.prod-meta .kw { flex: 0 0 auto; max-width: 45%; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--surface-3); color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-meta .ids { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-family: var(--mono); }
.tag-test { padding: 1px 5px; border-radius: 4px; background: var(--st-done-bg); color: var(--st-done); font-size: 10px; font-weight: 700; }

.cell-owner .owner-name { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-weight: 600; }
.cell-owner .owner-id { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: var(--fs-xs); font-family: var(--mono); }
.cell-period .period-start { display: block; color: var(--ink-2); }
.cell-period .period-end { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-xs); }
.cell-period .period-left { display: inline-block; margin-top: 4px; padding: 1px 7px; border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: 600; background: var(--st-run-bg); color: var(--st-run); }
.cell-period .period-left.soon { background: var(--st-warn-bg); color: var(--st-warn); }
.cell-period .period-left.over { background: var(--st-stop-bg); color: var(--st-stop); }
/* 오늘 시작한 슬롯 — 잔여일 옆에 따로 붙는다. 글자로 읽히는 꼬리표라 색만으로 구분하지 않는다 */
.cell-period .period-today { display: inline-block; margin: 4px 0 0 4px; padding: 1px 7px; border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: 600; background: var(--st-wait-bg); color: var(--st-wait); }
.cell-rank .table_number { justify-content: flex-end; gap: 8px; }
.cell-rank .rank-value { color: var(--ink); }
.cell-act .purchase-action-buttons { justify-content: center; }

/* ══ v6 — 오른쪽 드로어 (순위 · 시간별 순위 · 상품 분석 상세) ══
   표를 덮는 가운데 모달 대신 옆에서 밀려나온다. 목록이 그대로 보여서
   여러 건을 연달아 확인할 때 눈이 덜 움직인다. */
#rank-modal, #hourly-rank-modal, .analysis-modal { justify-content: flex-end; padding: 0; }
#rank-modal .modal-content,
#hourly-rank-modal .modal-content,
.analysis-modal-card {
  width: min(1120px, 94vw); height: 100vh; max-height: 100vh;
  border-radius: 0; border-top: 0; border-right: 0; border-bottom: 0;
  animation: wsh-drawer .22s cubic-bezier(.22, .7, .3, 1) both;
}
#hourly-rank-modal { z-index: 3050; }
#hourly-rank-modal .modal-content { width: min(520px, 94vw); }
.analysis-modal-card { width: min(1040px, 94vw); }
@keyframes wsh-drawer { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
#rank-modal .modal-body, .analysis-modal-body { overscroll-behavior: contain; }
.rank-flex-wrap { grid-template-columns: 1fr; }
.rank-chart-section { height: 260px; }
.rank-table-scroll { max-height: none; }

/* 드로어가 열린 행을 목록에서 표시 */
#analysis-product-list tr.is-open > td,
#slot-table-body tr.is-open > td,
#purchase-body tr.is-open > td { background: var(--brand-soft); }
#analysis-product-list tr.is-open > td:first-child,
#slot-table-body tr.is-open > td:first-child,
#purchase-body tr.is-open > td:first-child { box-shadow: inset 3px 0 0 var(--brand); }

/* v6 보정 — 드로어는 뒤쪽 목록을 가리지도, 막지도 않는다 */
.analysis-modal { background: transparent; backdrop-filter: none; pointer-events: none; }
.analysis-modal-card { pointer-events: auto; box-shadow: -18px 0 48px rgba(15, 20, 30, .14); }
html[data-theme="dark"] .analysis-modal-card { box-shadow: -18px 0 48px rgba(0, 0, 0, .5); }
#rank-modal .modal-content, #hourly-rank-modal .modal-content { box-shadow: -18px 0 48px rgba(15, 20, 30, .14); }
html[data-theme="dark"] #rank-modal .modal-content,
html[data-theme="dark"] #hourly-rank-modal .modal-content { box-shadow: -18px 0 48px rgba(0, 0, 0, .5); }

/* v6 — 드로어 머리의 행 이동 */
.drawer-nav { display: inline-flex; align-items: center; gap: 6px; }
.drawer-nav .btn.sm { width: 30px; padding: 0; }
.drawer-nav .drawer-pos { min-width: 54px; text-align: center; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
/* 순위 드로어는 차트·표를 위아래로 쌓으므로 폭을 줄여 목록을 더 남긴다 */
#rank-modal .modal-content { width: min(880px, 94vw); }

/* 슬롯 등록·리뷰 등록 — 유저 관리에서 계정으로 들어왔을 때 검색 칸 옆 '계정: 업체명 (아이디) ×' (static/js/owner_filter.js) */
.owner-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 4px 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.owner-chip[hidden] { display: none; }
.owner-chip-clear { width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.owner-chip-clear:hover { background: var(--surface-3); }

/* 표 칸 툴팁(.text-hover-wrap)은 글자가 **실제로 잘린 칸에만** 띄운다 — 각 화면의 markTruncated() 가 is-truncated 를 붙인다
   (슬롯 로그·슬롯 정산·리뷰 로그·리뷰 정산). ui.css 는 늘 띄워서, 다 보이는 총판·대행·업체명 칸에도 같은 글자가 한 번 더 떴다(2026-09-15 용자님 지적). */
.text-hover-wrap:not(.is-truncated):hover .text-hover-tooltip,
.text-hover-wrap:not(.is-truncated):focus-within .text-hover-tooltip { display: none; }
