:root {
  /* HMG Driving Experience inspired: monochrome, spacious, premium */
  --bg: #f5f5f5;
  --sidebar: #ffffff;
  --sidebar-text: #333333;
  --sidebar-muted: #888888;
  --accent: #111111;
  --accent-hover: #333333;
  --link: #111111;
  --card: #ffffff;
  --border: #e0e0e0;
  --border-strong: #cccccc;
  --text: #111111;
  --muted: #666666;
  --error: #c8102e;
  --ok: #2d6a4f;
  --warn: #b45309;
  --radius: 2px;
  --radius-lg: 4px;
  --font: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

.layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}
.sidebar {
  width: 248px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.sidebar-top .brand {
  flex: 1;
  min-width: 0;
}
.sidebar-close,
.nav-menu-toggle,
.sidebar-backdrop {
  display: none;
}
.brand {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.35;
  letter-spacing: -0.03em;
}
.brand-eyebrow {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  margin-bottom: 6px;
}
.brand span {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 4px;
  letter-spacing: 0;
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar a {
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar a:hover {
  background: #f5f5f5;
  color: var(--text);
}
.sidebar a.active {
  background: #f0f0f0;
  color: var(--text);
  font-weight: 600;
}
.logout {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--sidebar-muted);
  font-size: 0.85rem;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  width: 100%;
  padding: 0 clamp(20px, 2vw, 40px) 20px;
  background: var(--bg);
}
.workspace-chrome {
  flex-shrink: 0;
  margin: 0 calc(-1 * clamp(20px, 2vw, 40px));
  padding: 0 clamp(20px, 2vw, 40px);
  background: var(--bg);
}
.content-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.35;
}
.nav-menu-toggle {
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-menu-toggle:hover {
  background: #fafafa;
  border-color: var(--text);
}
.nav-menu-toggle-bars,
.nav-menu-toggle-bars::before,
.nav-menu-toggle-bars::after {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}
.nav-menu-toggle-bars {
  position: relative;
}
.nav-menu-toggle-bars::before,
.nav-menu-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-menu-toggle-bars::before { top: -5px; }
.nav-menu-toggle-bars::after { top: 5px; }
.sidebar-close {
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.workspace-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 16px;
}
.topbar-user {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-right: auto;
}
.btn-logout {
  display: inline-block;
  padding: 1px 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: background 0.15s ease;
}
.btn-topbar {
  display: inline-block;
  padding: 1px 10px;
  margin-right: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: background 0.15s ease;
}
.btn-topbar:hover,
.btn-logout:hover {
  background: #fafafa;
  border-color: var(--text);
}
h1 {
  margin: 0 0 10px;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
h2 {
  margin: 36px 0 14px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.muted { color: var(--muted); margin: 0 0 16px; font-size: 0.95rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card .label { color: var(--muted); font-size: 0.82rem; margin-bottom: 10px; letter-spacing: 0.02em; }
.card .value { font-size: 2rem; font-weight: 600; letter-spacing: -0.03em; }
.card .value.sm { font-size: 1rem; font-weight: 500; word-break: break-all; }
.card .sub { color: var(--muted); font-size: 0.85rem; margin-top: 10px; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  table-layout: auto;
}
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { background: #fafafa; font-weight: 600; color: var(--text); }
tr:last-child td { border-bottom: none; }
code { font-size: 0.85rem; background: #f5f5f5; padding: 2px 6px; border-radius: var(--radius); }

.search { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.search select {
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
  font-family: inherit;
}
.search input {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: inherit;
}
button, .search button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 11px 20px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}
button:hover, .search button:hover {
  background: var(--accent-hover);
}

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge.ok { background: #dcfce7; color: var(--ok); }
.badge.off { background: #f1f5f9; color: var(--muted); }
.badge.warn { background: #fef3c7; color: var(--warn); }

.pager { display: flex; gap: 12px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.pager a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.pager-status { color: var(--muted); font-size: 0.88rem; white-space: nowrap; }
.pager-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.pager-jump-label {
  font-size: 0.85rem;
  color: var(--muted);
}
.pager-jump-input {
  width: 4.5rem;
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.85rem;
}
.pager-jump-btn {
  padding: 4px 10px;
  font-size: 0.82rem;
}

.log-box {
  background: #1a1a1a;
  color: #e8e8e8;
  padding: 20px;
  border-radius: var(--radius-lg);
  overflow: auto;
  max-height: 420px;
  font-size: 0.8rem;
  line-height: 1.55;
  font-family: Consolas, "Noto Sans KR", monospace;
}

.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-size: 0.92rem; }
.alert.error { background: #fef2f2; color: var(--error); border: 1px solid #fecaca; }
.alert.info { background: #f5f5f5; color: var(--text); border: 1px solid var(--border); }

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 24px;
}
.login-card {
  background: #fff;
  padding: 48px 40px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}
.login-eyebrow {
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.login-card h1 {
  margin-bottom: 12px;
  font-size: 1.65rem;
}
.login-card label {
  display: block;
  margin: 18px 0 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}
.login-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
}
.login-card input:focus {
  outline: none;
  border-color: var(--text);
}
.login-card button { width: 100%; margin-top: 28px; padding: 14px; font-size: 0.95rem; }
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.login-remember input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--text);
}
.login-footer { margin-top: 28px; text-align: center; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.login-footer a, .btn-secondary {
  display: inline-block;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 0.92rem;
}
.btn-secondary {
  padding: 11px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
  text-decoration: none;
}
.login-footer .btn-secondary {
  flex: 1 1 0;
  min-width: 148px;
  max-width: 200px;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  color: var(--text);
}
.btn-secondary:hover {
  border-color: var(--text);
}
.hint { font-size: 0.82rem; color: var(--muted); margin: 4px 0 0; }
.settings-section { max-width: 420px; }
.settings-form label {
  display: block;
  margin: 18px 0 8px;
  font-size: 0.88rem;
  font-weight: 500;
}
.settings-form input {
  width: 100%;
  max-width: 420px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
}
.settings-form button { margin-top: 24px; padding: 12px 18px; }
.sidebar-user { font-size: 0.78rem; margin: 12px 0 0; word-break: break-all; }
.btn-sm {
  padding: 4px 10px;
  font-size: 0.82rem;
  border: none;
  border-radius: var(--radius);
  background: #1a1a1a;
  color: #fff;
  cursor: pointer;
}
.btn-sm:hover {
  background: #000;
}
.users-table td.table-actions {
  vertical-align: middle;
  white-space: nowrap;
}
.users-table td.table-actions form {
  display: inline-block;
  margin: 0 6px 0 0;
  vertical-align: middle;
}
.users-table td.table-actions .btn-sm {
  background: #1a1a1a;
  color: #fff;
  border: none;
}
.users-table td.table-actions .btn-sm:hover {
  background: #000;
}
.alert.ok { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

.hash-form { display: flex; gap: 8px; max-width: 480px; }
.hash-form input { flex: 1; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); font-family: inherit; }
.hash-result { margin-top: 16px; background: #fafafa; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); }
.hash-result code { display: block; margin-top: 8px; word-break: break-all; }

a { color: var(--link); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }
.actions form { margin: 0; }
.button-link {
  display: inline-block;
  padding: 11px 18px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--border-strong);
  text-decoration: none;
  color: var(--text);
  font-size: 0.92rem;
}
.button-link:hover {
  border-color: var(--text);
}
.notice { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; }
.notice.ok { background: #f0faf4; color: var(--ok); border: 1px solid #bbf7d0; }
.notice.warn { background: #fffbeb; color: var(--warn); border: 1px solid #fde68a; }
.notice.error { background: #fef2f2; color: var(--error); border: 1px solid #fecaca; }

.crawl-status-banner {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #92400e;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  text-align: center;
}
.crawl-status-banner[hidden] { display: none; }
.review-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.review-head { margin-bottom: 12px; }
.review-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.review-form label { width: 100%; font-size: 0.9rem; color: var(--muted); }
.review-form select {
  min-width: 320px;
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: inherit;
}

.nav-group { margin: 8px 0 4px; }
.nav-group-title {
  display: block;
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.92rem;
}
.nav-group-title:hover, .nav-group-title.active {
  background: #f0f0f0;
  color: var(--text);
}
.nav-sub {
  display: block;
  color: var(--sidebar-muted);
  text-decoration: none;
  padding: 8px 14px 8px 28px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 400;
}
.nav-sub:hover, .nav-sub.active {
  background: #f5f5f5;
  color: var(--text);
}

.muted-link { color: var(--muted); font-size: 0.9rem; font-weight: 400; margin-left: 8px; }

.lookup-scope .scope-foot { margin: 0; font-size: 0.88rem; }
.scope-intro-inline {
  margin: 0 0 20px;
  line-height: 1.6;
}

.lookup-result-panel {
  margin-top: 24px;
  padding: 16px 20px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.lookup-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.lookup-result-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.lookup-result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.lookup-result-actions .btn-export {
  border: none;
  cursor: pointer;
}
.lookup-result-actions .btn-export:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.lookup-result-panel .btn-export {
  padding: 7px 14px;
  font-size: 0.84rem;
  line-height: 1.25;
}
.lookup-result-customer {
  margin: 0 0 12px;
}
.lookup-result-subtitle {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.lookup-result-price-type {
  margin: 8px 0 4px;
}
.lookup-result-note {
  margin: 0 0 12px;
}
.btn-export-outline {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-export-outline:hover {
  background: #fafafa;
  border-color: var(--text);
}
.inline-notice {
  margin: 0;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.product-test-form {
  margin-bottom: 8px;
}
.product-test-form-header {
  margin-bottom: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.product-test-form-actions {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}
.lookup-quote-mode {
  display: inline-flex;
  align-items: baseline;
  gap: 20px; /* 완판·렌탈 간격 약 2배 */
  margin-right: 20px; /* 초기화까지 합쳐 약 3배(10+20) */
}
.lookup-quote-mode-option {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 0.84rem;
  line-height: 1.25;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.lookup-quote-mode-option input {
  margin: 0;
}
.lookup-result-panel[data-quote-mode="purchase"] .col-rental-only,
.lookup-result-panel[data-quote-mode="purchase"] .export-rental-only {
  display: none;
}
.lookup-result-panel[data-quote-mode="rental"] .col-purchase-only,
.lookup-result-panel[data-quote-mode="rental"] .export-purchase-only {
  display: none;
}
.lookup-result-panel[data-quote-mode="purchase"] .lookup-rental-subheader {
  display: none;
}
.product-lookup-table .lookup-rental-subheader th {
  font-size: 0.78rem;
  font-weight: 500;
  padding-top: 4px;
  padding-bottom: 4px;
}
.product-lookup-table .col-contract,
.product-lookup-table .col-mono-pages,
.product-lookup-table .col-color-pages,
.product-lookup-table .col-base-fee,
.product-lookup-table .col-extra-mono,
.product-lookup-table .col-extra-color {
  width: 64px;
  min-width: 52px;
  text-align: center;
}
.product-lookup-table .col-contract {
  width: 72px;
}
.product-lookup-table .col-base-fee {
  text-align: right;
}
.product-lookup-table .lookup-row-contract,
.product-lookup-table .lookup-row-mono-pages,
.product-lookup-table .lookup-row-color-pages,
.product-lookup-table .lookup-row-base-fee,
.product-lookup-table .lookup-row-extra-mono,
.product-lookup-table .lookup-row-extra-color {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 3px 4px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  background: #fff;
}
.product-lookup-table .lookup-row-mono-pages,
.product-lookup-table .lookup-row-color-pages,
.product-lookup-table .lookup-row-contract {
  text-align: center;
}
.product-lookup-table .lookup-row-contract:disabled,
.product-lookup-table .lookup-row-contract[readonly] {
  background: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
}
.product-lookup-table .lookup-row-base-fee,
.product-lookup-table .lookup-row-extra-mono,
.product-lookup-table .lookup-row-extra-color {
  text-align: right;
}
.lookup-rental-terms-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 4px;
}
.lookup-rental-terms-fields[hidden] {
  display: none !important;
}
.lookup-rental-term-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 500;
}
.lookup-rental-term-field input,
.lookup-rental-term-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font: inherit;
  font-weight: 400;
}
.lookup-search-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--muted);
}
.lookup-search-status[hidden] {
  display: none !important;
}
.lookup-paste-status {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--muted);
}
.lookup-paste-status[hidden] {
  display: none !important;
}
.lookup-paste-hint {
  margin: 8px 0 10px;
  font-size: 0.82rem;
}
.lookup-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #d4d4d4;
  border-top-color: var(--accent, #2563eb);
  border-radius: 50%;
  animation: lookup-spin 0.75s linear infinite;
  flex-shrink: 0;
}
@keyframes lookup-spin {
  to { transform: rotate(360deg); }
}
.product-test-form-body {
  position: relative;
}
.lookup-request-editor {
  display: block;
  width: 100%;
  height: 240px;
  min-height: 240px;
  max-height: 240px;
  overflow-x: hidden;
  overflow-y: auto;
  resize: none;
  margin-top: 0;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.02em;
  background: #fff;
  box-sizing: border-box;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}
.lookup-request-editor:focus {
  outline: none;
  border-color: var(--text);
}
.lookup-request-editor.is-locked {
  background: #f5f5f5;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.92;
  pointer-events: none;
}
.lookup-request-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}
.lookup-request-editor img.lookup-pasted-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 10px 0;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.lookup-request-editor img.lookup-pasted-image--pending {
  opacity: 0.88;
  outline: 2px dashed var(--border-strong);
  outline-offset: 2px;
}
.lookup-request-editor img.lookup-pasted-image--done {
  outline: none;
}
.lookup-request-editor table {
  border-collapse: collapse;
  margin: 10px 0;
  max-width: 100%;
}
.lookup-request-editor th,
.lookup-request-editor td {
  border: 1px solid var(--border-strong);
  padding: 4px 8px;
  font-size: 0.9rem;
  vertical-align: top;
}
.product-test-form .btn-search-submit,
.product-test-form .btn-search-reset {
  padding: 7px 14px;
  font-size: 0.84rem;
  line-height: 1.25;
  font-weight: 500;
}
.product-test-form .btn-search-submit:disabled,
.product-test-form .btn-search-reset:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.product-test-form label { display: block; margin-bottom: 18px; font-size: 0.88rem; font-weight: 500; color: var(--text); }
.lookup-scope {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 28px;
}
.lookup-scope .scope-intro { margin: 0 0 12px; line-height: 1.5; }
.lookup-scope .scope-intro-simple { margin: 0; }
.lookup-scope .scope-list {
  margin: 0 0 12px;
  padding-left: 20px;
  line-height: 1.55;
  font-size: 0.9rem;
}
.lookup-scope .scope-list li { margin-bottom: 8px; }
.lookup-scope .scope-id { color: var(--muted); font-size: 0.85rem; font-weight: 400; }
.lookup-scope .scope-note {
  display: block;
  color: var(--warn);
  font-size: 0.85rem;
  margin-top: 2px;
}
.lookup-scope .scope-foot { margin: 0; font-size: 0.88rem; }
.verify-timer { font-size: 1rem; margin: 8px 0 16px; }
.verify-timer.expired { color: var(--error); font-weight: 600; }
.verify-timer.expired span { color: var(--error); }
td.related-screen { text-align: center; width: 72px; }
a.icon-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 1.1rem;
  background: #f5f5f5;
  border: 1px solid var(--border);
}
a.icon-search:hover { background: #ebebeb; border-color: var(--border-strong); }
.result-actions { margin: 0 0 24px; }
.btn-export {
  display: inline-block;
  padding: 11px 20px;
  font-size: 0.92rem;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  background: var(--accent);
  border-radius: var(--radius);
  transition: background 0.15s ease;
}
.btn-export:hover { background: var(--accent-hover); }
.product-lookup-wrap {
  margin-top: 16px;
}
.product-lookup-wrap .lookup-result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}
.product-lookup-table {
  table-layout: fixed;
  width: 100%;
}
.product-lookup-table.compact th,
.product-lookup-table.compact td {
  padding: 7px 10px;
  vertical-align: middle;
}
.product-lookup-table .col-check {
  width: 28px;
  text-align: center;
}
.product-lookup-table .col-no {
  width: 32px;
  text-align: center;
}
.product-lookup-table .col-request-spec {
  width: 12%;
  min-width: 88px;
}
.product-lookup-table .col-search-spec {
  width: 14%;
}
.product-lookup-table .col-category {
  width: 52px;
}
.product-lookup-table .col-product-name,
.product-lookup-table .col-match-method {
  width: 110px;
  max-width: 110px;
  word-break: break-word;
}
.product-lookup-table .col-quantity {
  width: 56px;
  min-width: 56px;
  text-align: center;
}
.product-lookup-table .col-unit-price {
  width: 72px;
  min-width: 72px;
  text-align: right;
}
.product-lookup-table .col-line-total {
  width: 80px;
  min-width: 80px;
  text-align: right;
}
.product-lookup-table .lookup-row-quantity,
.product-lookup-table .lookup-row-unit-price {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  background: #fff;
}
.product-lookup-table .lookup-row-quantity {
  text-align: center;
}
.product-lookup-table .lookup-row-unit-price {
  text-align: right;
}
.product-lookup-table .lookup-row-line-total {
  display: inline-block;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.product-lookup-table .col-related-screen {
  width: 88px;
  text-align: center;
}
.btn-research-open {
  padding: 7px 14px;
  font-size: 0.84rem;
  line-height: 1.25;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
}
.btn-research-open:hover {
  background: #fafafa;
}
.lookup-research-modal[hidden] { display: none !important; }
.lookup-research-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lookup-research-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.lookup-research-modal-panel {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}
.lookup-research-modal-panel-wide {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
}
.lookup-research-modal-panel h3 {
  margin: 0 0 16px;
}
.lookup-research-request {
  margin: 0 0 12px;
  line-height: 1.5;
}
.lookup-research-request strong {
  display: inline-block;
  min-width: 4.5em;
  margin-right: 8px;
}
.lookup-research-note-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
}
.lookup-research-and-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.lookup-research-and-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: inherit;
}
.lookup-research-message {
  margin: 10px 0 0;
  min-height: 1.2em;
}
.lookup-research-list-wrap {
  margin-top: 12px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.lookup-research-table {
  margin: 0;
}
.lookup-research-table .col-open-date {
  width: 110px;
  white-space: nowrap;
}
.lookup-research-table .col-category-path {
  font-size: 0.82rem;
  color: var(--muted, #666);
}
.lookup-research-note-label textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: inherit;
  resize: vertical;
}
.lookup-research-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.lookup-intro-modal[hidden] { display: none !important; }
.lookup-intro-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lookup-intro-modal-panel {
  position: relative;
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}
.lookup-intro-modal-panel h3 {
  margin: 0 0 0.5rem;
}

.lookup-proposal-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}
.lookup-proposal-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.92rem;
}
.lookup-proposal-field > span {
  color: #334155;
  font-weight: 600;
}
.lookup-proposal-field .req {
  color: #b91c1c;
  font-style: normal;
  font-weight: 700;
  margin-left: 0.25rem;
}
.lookup-proposal-field input[type="text"],
.lookup-proposal-field input[type="url"] {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
}
.lookup-proposal-nowrap-input {
  white-space: nowrap;
  overflow-x: auto;
}
.lookup-proposal-cover-company {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lookup-proposal-cover-body h4 {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lookup-proposal-color-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.lookup-proposal-color-inputs input[type="color"] {
  width: 2.5rem;
  height: 2rem;
  padding: 0;
  border: 1px solid #cbd5e1;
  background: #fff;
}
.lookup-proposal-color-inputs input[type="text"] {
  flex: 1;
}
.lookup-proposal-ci-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.35rem;
}
.lookup-proposal-ci-preview img {
  max-height: 40px;
  max-width: 140px;
  object-fit: contain;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 4px;
}
.lookup-proposal-preview-panel {
  margin: 0 0 1rem;
}
.lookup-proposal-cover {
  border: 1px solid #e2e8f0;
  overflow: hidden;
  background: #fff;
}
.lookup-proposal-cover-bar {
  height: 10px;
  background: #5f7493;
}
.lookup-proposal-cover-body {
  padding: 1rem 1.1rem 1.15rem;
}
.lookup-proposal-cover-body img {
  max-height: 36px;
  max-width: 120px;
  object-fit: contain;
  margin-bottom: 0.6rem;
}
.lookup-proposal-cover-badge {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  color: #64748b;
}
.lookup-proposal-cover-body ul {
  margin: 0;
  padding-left: 1.1rem;
  color: #334155;
  font-size: 0.88rem;
}
.lookup-proposal-modal-panel {
  max-width: 520px;
}
.lookup-proposal-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.9rem;
  font-size: 0.92rem;
  color: #334155;
  cursor: pointer;
  user-select: none;
}
.lookup-proposal-check input {
  width: 1rem;
  height: 1rem;
}
.lookup-intro-notice {
  margin: 0 0 14px;
  font-size: 0.86rem;
}
.lookup-intro-table-wrap {
  overflow-x: auto;
}
.lookup-intro-table .col-category {
  width: 52px;
  min-width: 52px;
  text-align: center;
}
.lookup-intro-table .col-intro-rep,
.lookup-intro-table .col-intro-output {
  width: 52px;
  min-width: 52px;
  text-align: center;
}
.lookup-intro-table .col-intro-custom {
  width: 168px;
  min-width: 140px;
}
.lookup-intro-custom-field {
  display: flex;
  align-items: center;
  gap: 6px;
}
.lookup-intro-custom-text {
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  font-size: 0.84rem;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
}
.lookup-intro-custom-text:disabled {
  background: #f5f5f5;
  color: var(--muted);
  cursor: not-allowed;
}
.lookup-intro-custom-text:focus {
  outline: none;
  border-color: var(--text);
}
.lookup-research-modal-actions .btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 16px;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 10px 16px;
  cursor: pointer;
}
.lookup-history-wrap {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  min-width: 0;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.lookup-history-page {
  flex: 1;
  min-height: 0;
}
.lookup-history-search select {
  min-width: 10rem;
}
.unified-table-scroll .lookup-history-line-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}
.unified-table-scroll .lookup-history-line-table th,
.unified-table-scroll .lookup-history-line-table td {
  overflow: visible;
  white-space: nowrap;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.unified-table-scroll .lookup-history-line-table .col-request-spec,
.unified-table-scroll .lookup-history-line-table .col-product-name,
.unified-table-scroll .lookup-history-line-table .col-output-product,
.unified-table-scroll .lookup-history-line-table .col-customer,
.unified-table-scroll .lookup-history-line-table .col-run-purpose {
  white-space: normal;
}
.unified-table-scroll .lookup-history-line-table .col-product-name,
.unified-table-scroll .lookup-history-line-table .col-output-product {
  overflow: hidden;
}
.lookup-history-line-table .col-run-number {
  min-width: 148px;
  width: 148px;
  white-space: nowrap;
}
.lookup-history-line-table .col-run-user {
  min-width: 72px;
  width: 80px;
  max-width: 96px;
  white-space: nowrap;
  text-align: center;
}
.lookup-history-line-table .col-run-purpose {
  min-width: 156px;
  width: 156px;
  max-width: 200px;
  word-break: break-word;
}
.lookup-history-line-table .col-run-date {
  min-width: 132px;
  width: 132px;
  white-space: nowrap;
}
.lookup-history-line-table .col-customer {
  width: 200px;
  min-width: 200px;
  max-width: 280px;
  word-break: break-word;
}
.lookup-history-line-table .col-request-spec {
  width: 240px;
  min-width: 240px;
  max-width: 320px;
  word-break: break-word;
}
.lookup-history-line-table .group-end {
  border-right: 2px solid #b8b8b8;
}
.lookup-history-line-table thead .lh-col-basic,
.lookup-history-line-table tbody .lh-col-basic {
  background: #fcfcfc;
}
.lookup-history-line-table thead .lh-col-request,
.lookup-history-line-table tbody .lh-col-request {
  background: #f8fbff;
}
.lookup-history-line-table thead .lh-col-result,
.lookup-history-line-table tbody .lh-col-result {
  background: #fafcff;
}
.lookup-history-line-table thead .lh-col-output,
.lookup-history-line-table tbody .lh-col-output {
  background: #fffdfa;
}
.lookup-history-line-table thead .lh-col-action,
.lookup-history-line-table tbody .lh-col-action {
  background: #fafafa;
  border-left: 2px solid #b8b8b8;
}
.lookup-history-line-table thead .lh-col-remark,
.lookup-history-line-table tbody .lh-col-remark {
  background: #f7f7f7;
  border-left: 2px solid #b8b8b8;
}
.lookup-history-line-table .col-remark {
  min-width: 56px;
  max-width: 72px;
  width: 64px;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}
.lookup-history-line-table .lookup-note-detail-btn {
  border: none;
  background: none;
  padding: 0 2px;
  font: inherit;
  font-size: 0.78rem;
  color: var(--link);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.lookup-history-line-table a.lookup-history-run-detail-link {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.lookup-history-line-table a.lookup-history-run-detail-link:hover {
  color: var(--accent-hover);
}
.lookup-history-line-table button.lookup-history-run-load-link {
  display: inline-block;
  border: none;
  background: none;
  padding: 0 2px;
  font: inherit;
  font-size: 0.78rem;
  color: var(--link);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.lookup-history-line-table button.lookup-history-run-load-link:hover {
  color: var(--accent-hover);
}
.lookup-history-line-table .col-output-type {
  min-width: 108px;
  max-width: 140px;
  white-space: normal;
  word-break: keep-all;
  font-size: 0.78rem;
  line-height: 1.25;
}
.lookup-history-line-table .col-output-no {
  min-width: 2.75rem;
  text-align: center;
}
.lookup-history-line-table .lookup-output-count-btn {
  border: none;
  background: none;
  color: var(--link);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.lookup-history-line-table .lookup-output-count-btn:hover {
  color: var(--accent-hover);
}
.lookup-history-line-table .lookup-output-count-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.lookup-history-line-table .col-output-customer {
  min-width: 6rem;
  max-width: 10rem;
}
.lookup-history-output-modal .lookup-history-output-card {
  max-width: min(96vw, 72rem);
  width: 100%;
}
.lookup-history-output-scroll {
  overflow: auto;
  max-height: min(70vh, 28rem);
  margin-bottom: 1rem;
}
.lookup-history-output-table {
  width: max-content;
  min-width: 100%;
}
.lookup-history-output-table th,
.lookup-history-output-table td {
  white-space: nowrap;
  font-size: 0.8125rem;
}
.lookup-history-line-table .lookup-note-detail-btn:hover {
  color: var(--accent-hover);
}
.lookup-history-note-card {
  width: min(560px, calc(100vw - 32px));
}
.lookup-history-note-value {
  max-height: min(60vh, 480px);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Noto Sans KR", Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.45;
}
.lookup-history-line-table.grouped .lookup-history-group-row th.group-head {
  text-align: center;
  background: #f5f5f5;
  font-weight: 600;
  font-size: 0.8rem;
  border-bottom: 2px solid var(--border-strong);
  color: var(--text);
}
.lookup-history-line-table.grouped thead tr:last-child th {
  background: #f8fafc;
  font-size: 0.8rem;
}
.lookup-history-detail-panel .lookup-history-scroll-wrap {
  max-height: calc(100vh - 360px);
}
.embed-content .lookup-history-page,
.embed-content .lookup-history-detail-panel {
  flex: 1;
  min-height: 0;
}
.embed-content .lookup-history-page .lookup-history-scroll-wrap {
  flex: 1;
  min-height: 0;
}
.lookup-history-scroll-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
}
.lookup-history-scroll-body.unified-table-scroll {
  flex: 1;
  min-height: 0;
  max-height: none;
  border: none;
  border-radius: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.lookup-history-scroll-bar {
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  height: 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.lookup-history-scroll-inner {
  height: 1px;
}
html.iframe-embed .sidebar,
html.iframe-embed .workspace-chrome {
  display: none !important;
}
html.iframe-embed .layout {
  display: block;
  min-height: 100vh;
}
html.iframe-embed .content,
html.iframe-embed .primary-content {
  padding: 12px 16px;
  max-width: none;
}
html.iframe-embed .tab-panels,
html.iframe-embed .workspace-main {
  display: none !important;
}
.result-block { margin-bottom: 24px; }
tr.row-unmatched td { background: #fffbeb; }
.product-lookup-table .badge.category-본체 { background: #dbeafe; color: #1e40af; }
.product-lookup-table .badge.category-옵션 { background: #fef3c7; color: #92400e; }
.product-lookup-table .badge.category-소모품 { background: #dcfce7; color: #166534; }

.combined-table { display: block; overflow-x: auto; }
.combined-table th.group-head {
  text-align: center;
  background: #f5f5f5;
  color: var(--text);
  border-bottom: 2px solid var(--border-strong);
}
.combined-table .attach-cell { min-width: 160px; max-width: 240px; vertical-align: top; }
.combined-table .attach-line {
  font-size: 0.82rem;
  line-height: 1.35;
  padding: 2px 0;
  word-break: break-word;
}

/* 통합 제품 매핑 — 결과만 스크롤, 페이지네이션은 항상 고정 노출 */
.layout:has(.unified-page),
.content:has(.unified-page) {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}
.content:has(.unified-page) {
  min-height: 0;
}
.workspace-main:has(.unified-page),
.primary-content:has(.unified-page) {
  overflow: hidden;
}
.unified-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.unified-page-header {
  flex-shrink: 0;
}
.unified-page-header h1 {
  margin-bottom: 6px;
}
.unified-page-header .muted {
  margin-bottom: 8px;
}
.unified-page-header .actions {
  margin-bottom: 8px;
}
.users-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.users-header-line .muted {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.users-header-line .btn-sm {
  flex-shrink: 0;
}
.user-create-card label {
  display: block;
  margin: 12px 0 6px;
  font-size: 0.9rem;
  font-weight: 500;
}
.user-create-card label:first-of-type {
  margin-top: 0;
}
.user-create-card input[type="text"],
.user-create-card input[type="password"],
.user-create-card input[type="email"] {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
}
.user-create-hint {
  margin: 0 0 14px;
  font-size: 0.9rem;
}
.user-create-card .hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.user-create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.btn-danger-sm {
  background: #1a1a1a;
  color: #fff;
  border: none;
}
.btn-danger-sm:hover {
  background: #000;
}
.unified-search {
  margin-bottom: 10px;
}
.unified-results-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.unified-table-scroll {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.embed-content:has(.unified-page) {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.embed-content .unified-table-scroll {
  max-height: none;
}
.unified-page-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.unified-table-scroll > table.page-data-table,
.unified-table-scroll > table.users-table {
  display: table;
  width: 100%;
  border: none;
  border-radius: 0;
  overflow: visible;
}
.unified-table-scroll .page-data-table th,
.unified-table-scroll .page-data-table td,
.unified-table-scroll .users-table th,
.unified-table-scroll .users-table td {
  padding: 8px 12px;
}
.unified-table-scroll .combined-table {
  display: table;
  width: 100%;
  table-layout: fixed;
  overflow: visible;
  border: none;
  border-radius: 0;
}
.unified-table-scroll .combined-table .attach-cell {
  width: 10%;
  max-width: none;
  min-width: 0;
}
.unified-table-scroll .combined-table th,
.unified-table-scroll .combined-table td {
  padding: 3px 8px;
  font-size: 0.9rem;
  line-height: 1.35;
  overflow: hidden;
  vertical-align: top;
}
.unified-table-scroll .combined-table .cell-fit,
.unified-table-scroll .combined-table .attach-line.cell-fit,
.unified-table-scroll .combined-table td > code.cell-fit {
  white-space: nowrap;
  overflow: hidden;
  word-break: normal;
  max-width: 100%;
}
.unified-table-scroll .combined-table .cell-fit[data-cell-tip] {
  text-overflow: ellipsis;
  cursor: default;
}
.cell-fit-tooltip {
  position: fixed;
  z-index: 10000;
  max-width: min(420px, calc(100vw - 16px));
  padding: 8px 10px;
  border-radius: 6px;
  background: #1f2937;
  color: #f9fafb;
  font-size: 0.82rem;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  white-space: pre-wrap;
  word-break: break-word;
}
.cell-fit-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}
.unified-table-scroll .combined-table .attach-line {
  font-size: 0.9rem;
  line-height: 1.3;
  padding: 0;
  word-break: normal;
}
.unified-table-scroll .combined-table th.group-head {
  padding: 2.5px 6px;
  font-size: 0.88rem;
}
.unified-table-scroll .combined-table th.subgroup-head {
  padding: 2px 6px;
  font-size: 0.82rem;
  background: #f0f0f0;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}
.unified-table-scroll .combined-table thead tr:first-child th {
  position: sticky;
  top: 0;
  z-index: 4;
}
.unified-table-scroll .combined-table thead tr:nth-child(2) th {
  position: sticky;
  top: var(--unified-head-row1-h, 28px);
  z-index: 3;
  box-shadow: 0 1px 0 var(--border);
}
.unified-table-scroll .combined-table thead th.group-head {
  background: #f5f5f5;
}
.unified-table-scroll .combined-table code {
  padding: 1px 4px;
  font-size: 0.78rem;
}
.unified-table-scroll col.col-u-item-name { width: 10%; }
.unified-table-scroll col.col-u-kind { width: 6%; }
.unified-table-scroll col.col-u-spec-name { width: 10%; }
.unified-table-scroll col.col-u-spec-body { width: 8%; }
.unified-table-scroll col.col-u-spec-cat { width: 10%; }
.unified-table-scroll col.col-u-spec-key { width: 9%; }
.unified-table-scroll col.col-u-manual-name { width: 10%; }
.unified-table-scroll col.col-u-manual-body { width: 8%; }
.unified-table-scroll col.col-u-manual-cat { width: 8%; }
.unified-table-scroll col.col-u-status { width: 6%; }

/* 제품 찾기 이력 — 통합 매핑 table-layout 덮어쓰기 */
.unified-table-scroll .combined-table.lookup-history-line-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
.unified-table-scroll .combined-table.lookup-history-line-table th,
.unified-table-scroll .combined-table.lookup-history-line-table td {
  overflow: visible;
}
.unified-table-scroll .lookup-history-line-table thead th {
  background-clip: padding-box;
}
.unified-table-scroll .lookup-history-line-table thead tr:first-child th {
  top: 0;
  z-index: 6;
  box-shadow: 0 1px 0 var(--border);
}
.unified-table-scroll .lookup-history-line-table thead tr:nth-child(2) th {
  top: var(--unified-head-row1-h, 28px);
  z-index: 5;
  box-shadow: 0 2px 0 var(--border), 0 2px 6px rgba(15, 23, 42, 0.08);
}
.unified-table-scroll .lookup-history-line-table thead tr:first-child th.lh-col-action {
  z-index: 7;
}
.unified-table-scroll .lookup-history-line-table thead tr:first-child th.lh-col-basic,
.unified-table-scroll .lookup-history-line-table thead tr:nth-child(2) th.lh-col-basic {
  background-color: #fcfcfc;
}
.unified-table-scroll .lookup-history-line-table thead tr:first-child th.lh-col-request,
.unified-table-scroll .lookup-history-line-table thead tr:nth-child(2) th.lh-col-request {
  background-color: #f8fbff;
}
.unified-table-scroll .lookup-history-line-table thead tr:first-child th.lh-col-result,
.unified-table-scroll .lookup-history-line-table thead tr:nth-child(2) th.lh-col-result {
  background-color: #fafcff;
}
.unified-table-scroll .lookup-history-line-table thead tr:first-child th.lh-col-output,
.unified-table-scroll .lookup-history-line-table thead tr:nth-child(2) th.lh-col-output {
  background-color: #fffdfa;
}
.unified-table-scroll .lookup-history-line-table thead tr:first-child th.lh-col-action,
.unified-table-scroll .lookup-history-line-table thead tr:nth-child(2) th.lh-col-action {
  background-color: #fafafa;
}
.unified-table-scroll .lookup-history-line-table thead tr:first-child th.lh-col-remark,
.unified-table-scroll .lookup-history-line-table thead tr:nth-child(2) th.lh-col-remark {
  background-color: #f7f7f7;
}
.lookup-history-line-table .col-product-name,
.lookup-history-line-table .col-output-product {
  width: 200px;
  min-width: 200px;
  max-width: 200px;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  overflow: hidden;
}

/* 통합 매핑 — 그룹/필드 구분선 */
.unified-line-table {
  border-collapse: separate;
  border-spacing: 0;
}
.unified-line-table th,
.unified-line-table td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.unified-line-table .u-sep-sub {
  border-right: 1px solid var(--border-strong);
}
.unified-line-table .u-sep-group {
  border-right: 2px solid #b8b8b8;
}
.unified-line-table .u-group-rep {
  border-right: 2px solid #b8b8b8;
}
.unified-line-table .u-group-man {
  border-right: 2px solid #b8b8b8;
}
.unified-line-table .u-group-match,
.unified-line-table .u-col-match {
  border-left: 2px solid #b8b8b8;
}
.unified-line-table .u-sub-hp-body,
.unified-line-table .u-sub-man-body {
  border-right: 1px solid var(--border-strong);
}
.unified-line-table thead .u-col-rep,
.unified-line-table tbody .u-col-rep {
  background: #fcfcfc;
}
.unified-line-table thead .u-col-hp,
.unified-line-table tbody .u-col-hp {
  background: #fafcff;
}
.unified-line-table thead .u-col-man,
.unified-line-table tbody .u-col-man {
  background: #fffdfa;
}
.unified-line-table thead .u-col-match,
.unified-line-table tbody .u-col-match {
  background: #fafafa;
}
.unified-pager {
  flex-shrink: 0;
  margin-top: 10px;
  margin-bottom: 0;
  padding-bottom: 2px;
}

.table-scroll { overflow-x: auto; margin-top: 12px; }

.manual-report-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: 0;
  font-size: 10pt;
  line-height: 1.2;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.manual-report-scroll-top {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-width: thin;
}
.manual-report-scroll-top::-webkit-scrollbar:horizontal {
  height: 0;
}

.manual-report-scroll-bar {
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  position: static;
  z-index: 20;
  height: 16px;
  margin-top: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
}
.manual-report-scroll-inner {
  height: 1px;
}

.manual-report-table {
  display: table;
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 10pt;
}
.manual-report-table th,
.manual-report-table td {
  padding: 0 5px;
  margin: 0;
  vertical-align: top;
  font-size: 10pt;
  line-height: 1.2;
}
.manual-report-table th {
  white-space: nowrap;
  font-weight: 600;
  text-align: left;
  padding-bottom: 2px;
}
.manual-report-table tbody tr {
  border-top: 1px solid var(--border);
}
.manual-report-table .desc-cell {
  width: 320px;
  min-width: 320px;
  max-width: 320px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.manual-report-table .related-cell {
  width: 200px;
  min-width: 200px;
  max-width: 200px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.manual-report-table .url-cell {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  word-break: break-all;
  font-size: 9pt;
}
.manual-report-table .url-cell a {
  color: var(--link, #2563eb);
  text-decoration: none;
}
.manual-report-table .url-cell a:hover {
  text-decoration: underline;
}

/* embed (탭 iframe) */
.embed-body {
  margin: 0;
  background: var(--bg);
}
.embed-content {
  padding: 12px 16px;
  max-width: none;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.embed-content .unified-page {
  flex: 1;
  min-height: 0;
}
.primary-content > .unified-page {
  flex: 1;
  min-height: 0;
}

/* 대시보드 탭 */
.tab-bar-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 6px 0;
  min-width: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.tab-bar-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tab-bar-scroll::-webkit-scrollbar {
  display: none;
}
.tab-bar {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  min-height: 0;
  vertical-align: top;
}
.tab-bar:empty {
  display: none;
}
.tab-scroll {
  flex: 0 0 22px;
  width: 22px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0;
}
.tab-scroll:not(:disabled):hover {
  background: var(--card);
  color: var(--text);
}
.tab-scroll:disabled {
  opacity: 0.35;
  cursor: default;
}
.tab-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 2px 8px;
  font-size: 0.8125rem;
  line-height: 1.35;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  max-width: 200px;
}
.tab-chip.active {
  background: var(--card);
  border-color: var(--border-strong);
  font-weight: 600;
}
.tab-chip .tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tab-close {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1;
  padding: 0 1px;
}
.tab-close:hover {
  color: var(--error);
}
.tab-panels {
  display: none;
  flex: 1;
  min-height: 0;
}
.tab-panels.visible {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.tab-panel {
  display: none;
  flex: 1;
  min-height: 0;
  background: var(--card);
}
.tab-panel.active {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.tab-panel iframe {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 420px;
  border: 0;
  background: var(--bg);
}
.primary-content {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.primary-content.hidden {
  display: none;
}

/* 계정 목록 이메일 마스킹 */
.email-mask-btn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--link);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.email-mask-btn:hover {
  color: var(--accent-hover);
}
.email-reveal-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.email-reveal-modal[hidden] {
  display: none !important;
}
.email-reveal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.email-reveal-card {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 32px));
  padding: 28px;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}
.email-reveal-card h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}
.email-reveal-value {
  margin: 0 0 20px;
  padding: 12px 14px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: Consolas, "Noto Sans KR", monospace;
  word-break: break-all;
}
.crawl-running-message {
  margin: 0 0 20px;
  line-height: 1.6;
  color: var(--muted);
}

/* 모바일: 사이드바 오버레이(덮기) */
@media (max-width: 768px) {
  .nav-menu-toggle {
    display: inline-flex;
  }
  .sidebar-close {
    display: inline-flex;
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1190;
    background: rgba(17, 17, 17, 0.42);
    border: 0;
    padding: 0;
    margin: 0;
  }
  .sidebar-backdrop[hidden] {
    display: none !important;
  }
  .layout > .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1200;
    width: min(280px, 86vw);
    height: 100%;
    max-height: 100dvh;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 8px 0 28px rgba(15, 23, 42, 0.18);
    border-right: 1px solid var(--border);
  }
  body.nav-open .layout > .sidebar {
    transform: translateX(0);
  }
  body.nav-open {
    overflow: hidden;
  }
  .content {
    padding-left: 12px;
    padding-right: 12px;
  }
  .workspace-chrome {
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .topbar-user {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
}
