:root {
  --primary: #1a4fa0;
  --primary-dark: #123a78;
  --accent: #e8711a;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --border: #dde3ed;
  --text: #1e2433;
  --muted: #6b7a99;
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  overflow-x: hidden;
}

.partner-banner {
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.partner-banner-inner {
  min-height: 58px;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.partner-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.partner-logo img {
  display: block;
  width: 192px;
  height: 42px;
}
.partner-message {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
  line-height: 1.35;
}
.partner-message strong {
  color: #172033;
  font-size: 14px;
  letter-spacing: 0;
}
.partner-message span {
  color: var(--muted);
  font-size: 12px;
}
.partner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.contact-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--radius);
  background: #172033;
  border: 1px solid #172033;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
}
.contact-pill:hover {
  background: #25324a;
  border-color: #25324a;
}
.kakao-contact {
  background: #fee500;
  border-color: #fee500;
  color: #191919;
}
.kakao-contact:hover {
  background: #f2d900;
  border-color: #f2d900;
}
.profile-download {
  background: #fff;
  border-color: #cfd6e3;
  color: #172033;
}
.profile-download:hover {
  background: #f4f7fb;
  border-color: #aeb8c9;
}
.app-home-link {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.app-home-link:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}
.service-link {
  min-width: 176px;
  padding: 4px 12px;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 118, 110, .18);
}
.service-link:hover {
  background: #115e59;
  border-color: #115e59;
}
.service-link span {
  font-size: 12.5px;
  line-height: 1.1;
  font-weight: 900;
}
.service-link small {
  font-size: 10px;
  line-height: 1.1;
  font-weight: 700;
  color: rgba(255,255,255,.78);
}

/* Header */
header {
  background: var(--primary);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.header-inner { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
header h1 { color: #fff; font-size: 20px; font-weight: 700; letter-spacing: 0; white-space: nowrap; }
.app-title-link {
  color: inherit;
  text-decoration: none;
}
.app-title-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.sub { color: rgba(255,255,255,.7); font-size: 13px; }

/* Main */
main { max-width: 1480px; margin: 0 auto; padding: 24px 16px; }

/* Search */
.search-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Boolean search rows */
.search-mode-tabs {
  display: inline-flex;
  align-self: flex-start;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
}
.search-mode-btn {
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
}
.search-mode-btn:hover { color: var(--primary); background: #eef4ff; }
.search-mode-btn.active {
  background: var(--primary);
  color: #fff;
}

.bool-search { display: flex; flex-direction: column; gap: 8px; }
.bool-row    { display: flex; align-items: flex-start; gap: 8px; }

.bool-badge {
  min-width: 72px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
  margin-top: 6px;
  flex-shrink: 0;
}
.badge-and  { background: #e8f0fe; color: var(--primary); }
.badge-or   { background: #fff3e8; color: var(--accent);  }
.badge-not  { background: #fde8e8; color: #c0392b;        }
.badge-instt { background: #e6f7f2; color: #0d7b6a;       }
.badge-corp      { background: #f0eeff; color: #5b21b6; }
.badge-brn       { background: #fff7ed; color: #92400e; }
.badge-brn-spacer { margin-left: 12px; }
.instt-wrap-brn  { max-width: 180px; }
.badge-file  { background: #fdf4ff; color: #7c3aed;       }

.instt-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 8px 5px 10px;
  min-height: 38px;
  gap: 4px;
  transition: border-color .2s;
}
.instt-wrap:focus-within { border-color: #0d7b6a; }
.instt-input {
  border: none; outline: none; font-size: 13px;
  flex: 1; background: transparent; color: var(--text); padding: 2px 0;
}
.btn-clear-instt {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 16px; line-height: 1;
  padding: 0 4px; display: none;
}
.btn-clear-instt.visible { display: block; }
.btn-clear-instt:hover { color: #c0392b; }

.tag-wrap {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  min-height: 38px;
  cursor: text;
  transition: border-color .2s;
}
.tag-wrap:focus-within { border-color: var(--primary); }

.tag-zone { display: contents; }

.qtag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.qtag-and  { background: #dce8fd; color: var(--primary); }
.qtag-or   { background: #ffe8d6; color: var(--accent);  }
.qtag-not  { background: #fdd;    color: #c0392b;        }
.qtag-file { background: #f3e8ff; color: #7c3aed;        }
.qtag button {
  background: none; border: none; cursor: pointer;
  padding: 0 2px; line-height: 1; font-size: 14px; opacity: .5;
}
.qtag button:hover { opacity: 1; }

.tag-text {
  border: none; outline: none; font-size: 13px;
  min-width: 180px; flex: 1; background: transparent;
  color: var(--text); padding: 2px 0;
}

/* Search footer: date row + 검색 button */
.search-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
#btn-search {
  padding: 9px 28px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
  flex-shrink: 0;
}
#btn-search:hover { background: var(--primary-dark); }

.date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.date-row input[type="date"] {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  outline: none;
}
.date-row input[type="date"]:focus { border-color: var(--primary); }

.quick-dates {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}
.quick-date {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.quick-date:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f7faff;
}
.quick-date.active {
  border-color: var(--primary);
  background: #e8f0fe;
  color: var(--primary);
}

.btn-text {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  padding: 0;
}
.btn-text:hover { color: var(--primary); }

/* 즐겨찾기 프리셋 바 */
.preset-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  min-height: 44px;
}
.preset-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  align-items: center;
}
.preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px 5px 12px;
  background: #e8f0fe;
  border: 1px solid #c5d8fb;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
  -webkit-user-select: none;
  user-select: none;
}
.preset-chip:hover { background: #d0e4fd; border-color: var(--primary); }
.preset-chip-name { pointer-events: none; }
.preset-chip-tags {
  font-size: 11px;
  font-weight: 400;
  opacity: .7;
  margin-left: 4px;
  pointer-events: none;
}
.preset-del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
  opacity: .45;
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
}
.preset-del:hover { opacity: 1; color: #c0392b; }
.preset-empty { font-size: 12px; color: var(--muted); font-style: italic; }
.btn-save-preset {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  background: #f0f3f8;
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-save-preset:not(:disabled):hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-save-preset:disabled { opacity: .35; cursor: not-allowed; }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 8px 8px 0;
}
.tab {
  padding: 10px 22px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color .15s, background .15s;
  position: relative;
  bottom: -1px;
}
.tab:hover { color: var(--primary); background: var(--bg); }
.tab.active {
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--surface);
  color: var(--primary);
  font-weight: 700;
}

/* Result area */
.result-area {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  min-height: 200px;
  padding: 16px;
}

/* Result topbar (status + filter + CSV button) */
.result-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.topbar-left { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.view-nav-controls {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  gap: 0;
  margin-right: 6px;
  border: 1px solid #b9cef3;
  border-radius: 6px 6px 0 0;
  background: #f5f8ff;
  overflow: hidden;
  position: relative;
  bottom: -1px;
}
.btn-view-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 41px;
  padding: 10px 13px;
  border: none;
  border-right: 1px solid #d2ddf0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.btn-view-nav:last-child {
  border-right: none;
}
.btn-view-nav:hover:not(:disabled) {
  background: #e8f0fe;
}
.btn-view-nav:disabled,
.btn-view-nav.disabled {
  background: #f7f9fc;
  color: #9aa9bd;
  cursor: not-allowed;
}
.result-topbar .status-bar {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.filter-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.filter-check input[type="checkbox"] {
  width: 15px; height: 15px; cursor: pointer;
  accent-color: var(--primary);
}
.type-filter {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 30px;
}
.type-filter-label {
  margin-right: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.type-filter-btn {
  min-width: 44px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
}
.type-filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f7faff;
}
.type-filter-btn.active {
  border-color: var(--primary);
  background: #e8f0fe;
  color: var(--primary);
}

/* Status bar */
.status-bar {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.status-bar.error { color: #c0392b; }

.trend-panel {
  padding-top: 12px;
}
.trend-loading,
.trend-empty {
  padding: 30px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.trend-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.trend-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
  min-height: 92px;
}
.trend-card span,
.trend-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.trend-card strong {
  display: block;
  margin: 8px 0 4px;
  color: #172033;
  font-size: 24px;
  line-height: 1.1;
}
.trend-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.trend-keyword-btn {
  border: 1px solid #c5d8fb;
  background: #e8f0fe;
  color: var(--primary);
  border-radius: 16px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.trend-keyword-btn:hover {
  border-color: var(--primary);
  background: #dce8fd;
}
.trend-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.trend-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
  min-width: 0;
}
.trend-section h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: #172033;
  font-size: 14px;
}
.trend-section h3 small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.trend-wide {
  grid-column: span 2;
}
.trend-bar-row {
  display: grid;
  grid-template-columns: 92px minmax(80px, 1fr) 86px;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  font-size: 12px;
}
.trend-bar-label {
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.trend-bar-track {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #edf2f8;
  overflow: hidden;
}
.trend-bar-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
}
.trend-bar-row strong {
  text-align: right;
  font-size: 12px;
}
.trend-bar-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  line-height: 1.25;
}
.trend-bar-value span {
  color: var(--primary);
  font-weight: 800;
}
.trend-bar-value em {
  max-width: 86px;
  overflow: hidden;
  color: #e8711a;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trend-day-table-wrap {
  margin-top: 12px;
  padding-top: 10px;
  overflow-x: auto;
  border-top: 1px solid #edf2f8;
}
.trend-day-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid #dbe7f6;
  border-radius: 8px;
  background: #f8fbff;
}
.trend-day-toolbar-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
}
.trend-day-toolbar-title strong {
  color: #172033;
  font-size: 12px;
}
.trend-day-toolbar-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.trend-day-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.trend-day-control {
  height: 30px;
  min-width: 122px;
  padding: 0 28px 0 10px;
  border: 1px solid #bfd2ef;
  border-radius: 7px;
  background: #fff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.trend-day-control:focus {
  outline: 2px solid #b7cff9;
  outline-offset: 1px;
}
.trend-day-table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 12px;
}
.trend-day-table th,
.trend-day-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #edf2f8;
  text-align: right;
  white-space: nowrap;
}
.trend-day-table th:first-child,
.trend-day-table td:first-child {
  text-align: left;
}
.trend-day-table th {
  color: #51617a;
  background: #f8fafd;
  font-weight: 800;
}
.trend-day-table td:first-child {
  color: var(--muted);
  font-weight: 700;
}
.trend-day-table td strong {
  display: block;
  color: #172033;
  font-size: 12px;
}
.trend-day-table td small {
  display: block;
  margin-top: 2px;
  color: #e8711a;
  font-weight: 800;
}
.trend-day-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  max-width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: right;
}
.trend-day-toggle:hover,
.trend-day-toggle[aria-expanded="true"] {
  background: #e8f0fe;
}
.trend-day-amount {
  margin-left: auto;
  padding: 3px 6px;
  color: #172033;
}
.trend-day-detail td {
  padding: 0 8px 10px;
  background: #fbfdff;
  text-align: left;
}
.trend-day-notices {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  border: 1px solid #edf2f8;
  border-radius: 8px;
  background: #fff;
}
.trend-day-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px;
  align-items: start;
  padding-bottom: 7px;
  border-bottom: 1px solid #edf2f8;
}
.trend-day-notice:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.trend-day-notice p,
.trend-day-more {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}
.trend-day-dup {
  border-radius: 999px;
  background: #fff4e8;
  color: #c95d00;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  white-space: nowrap;
}
.trend-day-empty {
  padding: 12px;
}
.trend-rank-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.trend-rank-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.trend-rank-list li > span,
.trend-rank-list li > button {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trend-rank-list strong {
  flex-shrink: 0;
  color: var(--primary);
}
.trend-notice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trend-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid #edf2f8;
  padding-top: 8px;
}
.trend-notice:first-child {
  border-top: none;
  padding-top: 0;
}
.trend-open-btn {
  max-width: 100%;
  border: none;
  background: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trend-open-btn:hover {
  text-decoration: underline;
}
.trend-notice p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trend-notice > span {
  color: #e8711a;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

/* CSV button */
.btn-csv {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: #e8f0fe;
  border: 1px solid var(--primary);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
  flex-shrink: 0;
}
.btn-csv:hover { background: var(--primary); color: #fff; }

.hidden { display: none !important; }

/* Table */
#table-wrap { overflow-x: auto; }
#result-table {
  width: 100%;
  min-width: 1580px;
  border-collapse: collapse;
  font-size: 13px;
}
#result-table th {
  background: #f0f3f8;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--primary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.th-sortable { cursor: pointer; -webkit-user-select: none; user-select: none; }
.th-sortable:hover { background: #e4ebf7; }
.sort-icon { margin-left: 4px; font-size: 11px; color: #b0b8cc; }
.sort-icon.active { color: var(--primary); font-size: 10px; }
#result-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}
#result-table .col-bidNtceNm {
  min-width: 480px;
  width: 38%;
}
#result-table .col-_requirementSummary {
  min-width: 110px;
  width: 9%;
}
#result-table .col-_contractSummary {
  min-width: 110px;
  width: 9%;
}
#result-table .col-bidNtceNo {
  min-width: 108px;
  width: 8%;
}
#result-table .col-_opportunitySummary {
  min-width: 112px;
  width: 8%;
}
#result-table .col-_sourceLabel,
#result-table .col-_noticeStatus {
  min-width: 78px;
  width: 5%;
}
#result-table .col-ntceInsttNm,
#result-table .col-dminsttNm {
  min-width: 108px;
  width: 8%;
}
#result-table .col-presmptPrce,
#result-table .col-bidNtceDt,
#result-table .col-bidClseDt {
  min-width: 88px;
}
#result-table .col-prdctClsfcNo {
  min-width: 96px;
  white-space: nowrap;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
#result-table .col-bidNtceNm .bid-link {
  display: inline;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-height: 1.55;
}
#result-table tbody tr:last-child td { border-bottom: none; }
#result-table tbody tr:hover { background: #f7f9fd; }
#result-table a { color: var(--primary); text-decoration: none; }
#result-table a:hover { text-decoration: underline; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: #e8f0fe;
  color: var(--primary);
}
.amt { font-weight: 600; color: var(--accent); }

.method-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 92px;
  max-width: 150px;
}
.method-stack span {
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}
.method-stack span:first-child {
  color: var(--primary);
  font-weight: 700;
}
.req-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-width: 0;
  max-width: 150px;
}
.req-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 9px;
  background: #eef6f1;
  color: #0f6b45;
  border: 1px solid #cbe8d5;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.3;
  white-space: normal;
  word-break: keep-all;
}

.opp-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 78px;
  padding: 5px 7px;
  border-radius: 7px;
  border: 1px solid #d8e1ef;
  background: #f8fafc;
  color: #334155;
  line-height: 1.15;
}
.opp-cell strong { font-size: 13px; font-weight: 900; }
.opp-cell span { font-size: 11px; font-weight: 800; }
.opp-cell em { font-size: 10px; font-style: normal; color: #5b6b84; white-space: nowrap; }
.spec-lock-badge {
  margin-top: 3px;
  padding: 2px 5px;
  border-radius: 5px;
  background: #fff1f2;
  border: 1px solid #fb7185;
  color: #9f1239;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
  word-break: keep-all;
}
.opp-s { background: #fff7ed; border-color: #fdba74; color: #c2410c; }
.opp-a { background: #ecfdf5; border-color: #86efac; color: #047857; }
.opp-b { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.opp-c { background: #f8fafc; border-color: #cbd5e1; color: #475569; }
.opp-d { background: #f3f4f6; border-color: #d1d5db; color: #6b7280; }

/* 공고명 클릭 링크 */
.bid-link {
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px dashed var(--primary);
}
.bid-link:hover { border-bottom-style: solid; }

/* D-DAY 마감 배지 */
.dday-expired {
  color: #999;
  font-size: 11px;
  background: #f0f0f0;
  border-radius: 8px;
  padding: 1px 7px;
}

/* Empty */
.empty-msg {
  text-align: center;
  padding: 60px 0;
  color: var(--muted);
  font-size: 15px;
}

/* 파일 내 키워드 스캔 결과 */
tr.file-match-row td { border-left: 3px solid #a855f7; }
.file-excerpt-row td {
  background: #fdf4ff;
  border-top: none;
  border-left: 3px solid #a855f7;
  padding: 4px 12px 8px 28px;
  font-size: 12px;
  color: #4b5563;
  line-height: 1.6;
  white-space: normal;
}
mark.file-kw-mark {
  background: #e9d5ff;
  color: #5b21b6;
  border-radius: 3px;
  padding: 0 3px;
  font-weight: 700;
}

/* Loading skeleton */
.loading-row td {
  background: linear-gradient(90deg, #f0f3f8 25%, #e4e8f0 50%, #f0f3f8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  color: transparent;
  border-radius: 4px;
  height: 36px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Pending state (inside #empty-msg) */
.pending-icon { font-size: 40px; line-height: 1; display: block; margin-bottom: 4px; }
.pending-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}
.pending-msg {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}
.pending-link {
  display: inline-block;
  margin-top: 8px;
  padding: 9px 22px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.pending-link:hover { background: var(--primary-dark); }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: all .15s;
}
.pagination button:hover { border-color: var(--primary); color: var(--primary); }
.pagination button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}
.pagination button:disabled { opacity: .4; cursor: default; }

/* ─── 헤더 설정 버튼 ────────────────────────────────────────────────────────── */
header { justify-content: space-between; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.btn-settings {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.btn-settings:hover { background: rgba(255,255,255,.28); }
.btn-full-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.42);
  background: rgba(255,255,255,.10);
  color: #fff7ed;
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-full-reset:hover {
  background: #fff1f2;
  border-color: #fff1f2;
  color: #be123c;
}
.btn-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.46);
  background: #fff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-home:hover {
  background: #eaf2ff;
  border-color: #eaf2ff;
  color: var(--primary-dark);
}

.business-contact {
  margin-top: 18px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: #143765;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 8px 24px rgba(20,55,101,.16);
}
.business-contact-copy {
  min-width: 0;
}
.contact-eyebrow {
  margin-bottom: 5px;
  color: #8ee0c8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}
.business-contact h2 {
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0;
  margin-bottom: 5px;
}
.business-contact p {
  color: rgba(255,255,255,.82);
  line-height: 1.6;
}
.business-contact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.contact-primary,
.contact-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
}
.contact-primary {
  border: 0;
  background: #8ee0c8;
  color: #073f36;
}
.contact-primary:hover { background: #a8ead9; }
.contact-secondary {
  background: transparent;
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
}
.contact-secondary:hover { background: rgba(255,255,255,.12); }
.service-footer-link {
  background: #d7fff6;
  color: #102033;
  border-color: #d7fff6;
}
.service-footer-link:hover {
  background: #bdf5e8;
  color: #102033;
}

/* ─── 우리 회사 설정 모달 ───────────────────────────────────────────────────── */
.settings-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, 92vw);
  background: var(--surface);
  border-radius: var(--radius);
  z-index: 201;
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
}
.settings-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.settings-header h3 { font-size: 15px; font-weight: 700; color: var(--text); }
.settings-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.settings-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }
.company-profile-area {
  width: 100%; height: 180px;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; font-size: 13px;
  color: var(--text); resize: vertical; outline: none;
  font-family: inherit; line-height: 1.7;
}
.company-profile-area:focus { border-color: var(--primary); }
.settings-footer { padding: 12px 20px; border-top: 1px solid var(--border); text-align: right; }

/* ─── PDF 파일 선택 버튼 (폴백) ─────────────────────────────────────────────── */
.source-label {
  font-size: 11px; color: var(--muted); margin-bottom: 8px;
  padding: 3px 8px; background: #f0f3f8; border-radius: 4px;
  display: inline-block;
}
.btn-upload-inline {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 14px;
  font-size: 12px; font-weight: 600;
  color: var(--primary);
  background: #e8f0fe;
  border: 1px dashed var(--primary);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s;
}
.btn-upload-inline:hover { background: #d0e2ff; }

/* ─── 공고 상세 드로어 ─────────────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  cursor: pointer;
}
.bid-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(540px, 100vw);
  height: 100vh;
  background: var(--surface);
  z-index: 201;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 32px rgba(0,0,0,.2);
  overflow: hidden;
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-badge {
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 10px;
}
.drawer-close {
  background: none; border: none; font-size: 24px;
  cursor: pointer; color: var(--muted); line-height: 1; padding: 0 4px;
}
.drawer-close:hover { color: var(--text); }
.drawer-title {
  font-size: 14px; font-weight: 700; line-height: 1.5;
  padding: 12px 20px 8px;
  color: var(--text);
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.drawer-meta {
  padding: 12px 20px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 6px 10px;
  flex-shrink: 0;
  overflow-y: auto;
  max-height: 36vh;
  border-bottom: 1px solid var(--border);
}
.meta-key {
  color: var(--muted); font-size: 11px; font-weight: 600;
  white-space: nowrap; padding-top: 1px;
}
.meta-val { font-size: 13px; word-break: break-word; }
.meta-val a { color: var(--primary); }
.drawer-section {
  padding: 14px 20px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.drawer-section-label {
  font-size: 12px; font-weight: 700; color: var(--primary);
}
.drawer-summary { font-size: 13px; line-height: 1.8; }
.summary-text strong { color: var(--primary); }
.summary-error { color: #c0392b; font-size: 12px; margin-bottom: 8px; }
.detail-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}
.detail-block h4 {
  margin: 12px 0 4px;
  font-size: 12px;
  color: var(--primary);
}
.detail-block h4:first-child { margin-top: 0; }
.raw-details {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 10px 12px;
}
.raw-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--primary);
  font-size: 12px;
}
.raw-grid {
  display: grid;
  grid-template-columns: 124px 1fr;
  gap: 6px 10px;
  margin-top: 10px;
}
.raw-key {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  word-break: break-all;
}
.raw-val {
  font-size: 12px;
  word-break: break-all;
}
.product-detail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.product-detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #e8f0fe;
  color: var(--primary);
  font-size: 12px;
  line-height: 1.3;
}
.product-detail-chip strong {
  font-variant-numeric: tabular-nums;
}
.btn-ai {
  padding: 8px 20px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius); font-size: 13px;
  font-weight: 600; cursor: pointer; transition: background .15s;
}
.btn-ai:hover:not(:disabled) { background: var(--primary-dark); }
.btn-ai:disabled { opacity: .6; cursor: default; }
.drawer-footer {
  padding: 12px 20px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.btn-g2b-link {
  display: inline-block; padding: 8px 18px;
  background: #f0f3f8; color: var(--primary);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; font-weight: 600; text-decoration: none;
  transition: background .15s;
}
.btn-g2b-link:hover { background: #e8f0fe; }

@media (max-width: 760px) {
  body {
    font-size: 13px;
  }
  .partner-banner-inner {
    padding: 10px 12px;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }
  .partner-logo img {
    width: 156px;
    height: auto;
  }
  .partner-message {
    gap: 2px;
  }
  .partner-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .contact-pill {
    width: 100%;
  }
  .service-link {
    min-width: 0;
    align-items: center;
  }
  header {
    height: auto;
    min-height: 56px;
    padding: 10px 14px;
    align-items: flex-start;
    flex-direction: column;
  }
  .header-inner {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .sub {
    flex-basis: 100%;
  }
  .header-actions {
    width: 100%;
    margin-left: 0;
  }
  .btn-home {
    flex: 1;
  }
  .btn-full-reset {
    flex: 1;
  }
  .btn-settings {
    flex: 1;
    justify-content: center;
  }
  main {
    width: 100%;
    max-width: 100%;
    padding: 12px 10px 20px;
    overflow-x: hidden;
  }
  .search-box {
    padding: 12px 10px;
    gap: 10px;
  }
  .search-mode-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .search-mode-btn {
    padding: 8px 4px;
    font-size: 12px;
    line-height: 1.2;
  }
  .bool-search {
    gap: 9px;
  }
  .bool-row {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 7px;
    align-items: start;
  }
  .bool-badge {
    min-width: 0;
    width: 74px;
    margin-top: 4px;
    padding: 6px 4px;
    white-space: normal;
  }
  .tag-wrap,
  .instt-wrap {
    min-width: 0;
    width: 100%;
    padding: 8px 9px;
  }
  .tag-zone {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
  .tag-text,
  .instt-input {
    min-width: 0;
    width: 100%;
    flex-basis: 120px;
    font-size: 16px;
  }
  .search-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .date-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 12px minmax(0, 1fr);
    gap: 7px;
    align-items: center;
  }
  .date-row input[type="date"] {
    width: 100%;
    min-width: 0;
    padding: 8px 7px;
    font-size: 12px;
  }
  .quick-dates {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-left: 0;
  }
  .quick-date {
    padding: 8px 4px;
  }
  .btn-text {
    grid-column: 1 / -1;
    justify-self: start;
    padding: 4px 0;
  }
  #btn-search {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
  }
  .preset-bar-wrap {
    padding: 10px;
    align-items: flex-start;
  }
  .preset-bar {
    min-width: 0;
  }
  .btn-save-preset {
    width: 100%;
    padding: 8px 12px;
  }
  .tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 6px 6px 0;
  }
  .tabs .view-nav-controls {
    grid-column: 1 / -1;
    margin-right: 0;
    margin-bottom: 4px;
    border-radius: 6px;
    bottom: 0;
  }
  .tabs .btn-view-nav {
    flex: 1;
    min-height: 38px;
    padding: 9px 8px;
  }
  .tab {
    padding: 10px 4px;
    font-size: 13px;
    line-height: 1.25;
    text-align: center;
    word-break: keep-all;
  }
  .result-area {
    padding: 10px;
    min-height: 180px;
  }
  .result-topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-csv {
    width: 100%;
    padding: 8px 12px;
  }
  #table-wrap {
    width: 100%;
    overflow-x: auto;
  }
  #result-table {
    min-width: 720px;
    font-size: 12px;
  }
  #result-table th,
  #result-table td {
    padding: 8px 7px;
  }
  #result-table .col-bidNtceNm,
  #result-table .col-bizNm {
    min-width: 280px;
    width: 38%;
  }
  #result-table .col-orderInsttNm,
  #result-table .col-ntceInsttNm,
  #result-table .col-dminsttNm {
    min-width: 160px;
  }
  #result-table .col-prdctClsfcNoNm {
    min-width: 96px;
  }
  #result-table .col-prdctClsfcNo {
    min-width: 92px;
  }
  .status-bar {
    font-size: 12px;
    line-height: 1.5;
  }
  .trend-summary-grid,
  .trend-layout {
    grid-template-columns: 1fr;
  }
  .trend-wide {
    grid-column: span 1;
  }
  .trend-card {
    min-height: 78px;
  }
  .trend-card strong {
    font-size: 21px;
  }
  .trend-bar-row {
    grid-template-columns: 78px minmax(70px, 1fr) 68px;
  }
  .trend-bar-value em {
    max-width: 68px;
  }
  .trend-day-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .trend-day-toolbar label {
    justify-content: space-between;
    width: 100%;
  }
  .trend-day-control {
    min-width: 170px;
  }
  .trend-notice {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .business-contact {
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }
  .business-contact-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
.source-badge,
.notice-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.source-g2b {
  color: #174ea6;
  background: #e8f0fe;
  border: 1px solid #c7d8f7;
}
.source-d2b {
  color: #7c2d12;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}
.status-active {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}
.status-completed {
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}
.status-cancelled {
  color: #b42318;
  background: #fff1f2;
  border: 1px solid #fda4af;
}
.coverage-note {
  color: #8a5a00;
  font-size: 11px;
}

/* ─── 발주기관 담당자 조회 ─────────────────────────────────────────── */
#officer-panel {
  padding: 12px 0 20px;
}

.officer-panel-inner {
  border-top: 1px solid var(--border);
}

.officer-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px;
  color: var(--primary-dark);
  font-weight: 700;
}

.officer-count {
  padding: 3px 9px;
  border: 1px solid #b9d4f8;
  border-radius: 6px;
  background: #eef6ff;
  color: var(--primary);
  font-size: 12px;
}

.officer-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.officer-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.ofc-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ofc-name {
  color: var(--primary-dark);
  font-size: 16px;
  font-weight: 700;
}

.ofc-instt {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ofc-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  margin-bottom: 10px;
}

.ofc-contact {
  padding: 4px 8px;
  border: 1px solid #cad9ef;
  border-radius: 5px;
  background: #f7faff;
  color: var(--primary);
  font-size: 12px;
  text-decoration: none;
}

.ofc-bids-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 11px;
}

.ofc-bids-table th,
.ofc-bids-table td {
  padding: 6px 5px;
  border-top: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.ofc-bids-table th:first-child,
.ofc-bids-table td:first-child {
  width: 55%;
}

.ofc-bid-nm {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ofc-more,
.officer-empty-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.officer-empty {
  padding: 44px 16px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .officer-cards {
    grid-template-columns: 1fr;
  }

  .officer-card {
    padding: 12px;
  }

  .ofc-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .ofc-instt {
    width: 100%;
    text-align: left;
  }

  .ofc-bids-table th:nth-child(3),
  .ofc-bids-table td:nth-child(3) {
    display: none;
  }
}

/* ─── 낙찰자 조회 — 업체 프로파일 ────────────────────────────────────── */
:root {
  --corp-grid: #dde3ed;
  --corp-axis: #8896b3;
  --corp-dot-stroke: #fff;
  --corp-surface: #fff;
  --corp-border: #e2e8f0;
  --corp-won-bg: #f0fdf4;
}

#corp-history-panel {
  padding: 12px 0 20px;
}

.corp-profile {
  background: var(--corp-surface);
  border: 1px solid var(--corp-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.corp-profile-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--corp-border);
  background: linear-gradient(135deg, #f0eeff 0%, #eff6ff 100%);
}

.corp-profile-name {
  font-size: 20px;
  font-weight: 700;
  color: #1e1b4b;
  margin-bottom: 12px;
}

.corp-profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.corp-stat {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 8px 16px;
  min-width: 90px;
  text-align: center;
}

.corp-stat-label {
  font-size: 11px;
  color: #5b21b6;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.corp-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: #312e81;
  font-variant-numeric: tabular-nums;
}

.corp-profile-note {
  font-size: 11px;
  color: #6b7a99;
  margin-top: 4px;
}

/* 성향 그래프 */
.corp-chart-wrap {
  padding: 16px 24px 4px;
  border-bottom: 1px solid var(--corp-border);
}

.corp-chart-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.corp-trend-svg {
  width: 100%;
  max-width: 620px;
  height: auto;
  display: block;
}

.corp-chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  margin-bottom: 8px;
}

.corp-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #60a5fa;
  margin-right: 3px;
}

.corp-legend-dot.won {
  background: #22c55e;
}

/* 탭 */
.corp-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--corp-border);
  padding: 0 24px;
}

.corp-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.corp-tab:hover { color: var(--primary); }

.corp-tab.active {
  color: #5b21b6;
  border-bottom-color: #5b21b6;
}

/* 탭 패널 */
.corp-tab-panel {
  overflow-x: auto;
}

/* 업체 이력 테이블 */
.corp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.corp-table th {
  background: #f8f9fc;
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--corp-border);
  white-space: nowrap;
}

.corp-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  color: var(--text);
}

.corp-table tr:last-child td { border-bottom: none; }
.corp-table tr:hover td { background: #fafbff; }
.corp-table .row-won td { background: var(--corp-won-bg); }
.corp-table .row-won:hover td { background: #dcfce7; }

.corp-table .td-nm { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.corp-table .td-amt { font-variant-numeric: tabular-nums; text-align: right; }
.corp-table .td-empty { text-align: center; color: var(--muted); padding: 24px; }

.won-badge {
  display: inline-block;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
}

/* ─── 담당자 조회 패널 ───────────────────────────────────────────────────────── */
.badge-officer {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #86efac;
}

.officer-panel-inner {
  padding: 16px 0 32px;
}
.officer-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--muted);
}
.officer-summary-label { font-weight: 600; color: var(--text); }
.officer-count {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
}

.officer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.officer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: box-shadow .15s;
}
.officer-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.10); }

.ofc-header { margin-bottom: 10px; }
.ofc-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.ofc-instt {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.ofc-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.ofc-contact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid;
  transition: opacity .15s;
}
.ofc-contact:hover { opacity: .75; }
.ofc-tel   { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.ofc-email { color: #7c3aed; border-color: #ddd6fe; background: #f5f3ff; }
.ofc-tel::before   { content: '📞'; font-size: 12px; }
.ofc-email::before { content: '✉'; font-size: 12px; }

.ofc-bids-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 4px;
}
.ofc-bids-table th {
  text-align: left;
  padding: 5px 6px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.ofc-bids-table td {
  padding: 5px 6px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text);
  vertical-align: middle;
}
.ofc-bids-table tr:last-child td { border-bottom: none; }
.ofc-bid-nm {
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ofc-bid-type {
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}
.ofc-type-물품 { background: #eff6ff; color: #1d4ed8; }
.ofc-type-용역 { background: #f0fdf4; color: #15803d; }
.ofc-type-공사 { background: #fff7ed; color: #c2410c; }
.ofc-bid-amt { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ofc-bid-dt  { white-space: nowrap; color: var(--muted); font-size: 11px; }
.ofc-more { font-size: 11px; color: var(--muted); margin: 6px 0 0; text-align: right; }

.officer-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.officer-empty-icon { font-size: 48px; margin-bottom: 12px; }
.officer-empty p    { margin: 6px 0; }
.officer-empty-sub  { font-size: 13px; }

@media (prefers-color-scheme: dark) {
  .officer-card { background: #1e2533; border-color: #2d3748; }
  .ofc-tel    { color: #93c5fd; border-color: #1e3a5f; background: #0f1d38; }
  .ofc-email  { color: #c4b5fd; border-color: #3b2d6e; background: #1a0f38; }
  .ofc-type-물품 { background: #1e3a5f; color: #93c5fd; }
  .ofc-type-용역 { background: #14532d; color: #86efac; }
  .ofc-type-공사 { background: #431407; color: #fdba74; }
  .ofc-bids-table td { border-bottom-color: #2d3748; }
  .officer-count { background: #14532d; border-color: #166534; color: #86efac; }
  .corp-table tr:hover td { background: #1a2035; }
}
:root[data-theme="dark"] .officer-card { background: #1e2533; border-color: #2d3748; }
:root[data-theme="dark"] .ofc-tel    { color: #93c5fd; border-color: #1e3a5f; background: #0f1d38; }
:root[data-theme="dark"] .ofc-email  { color: #c4b5fd; border-color: #3b2d6e; background: #1a0f38; }
:root[data-theme="dark"] .ofc-type-물품 { background: #1e3a5f; color: #93c5fd; }
:root[data-theme="dark"] .ofc-type-용역 { background: #14532d; color: #86efac; }
:root[data-theme="dark"] .ofc-type-공사 { background: #431407; color: #fdba74; }
:root[data-theme="dark"] .ofc-bids-table td { border-bottom-color: #2d3748; }
:root[data-theme="dark"] .officer-count { background: #14532d; border-color: #166534; color: #86efac; }
:root[data-theme="light"] .officer-card { background: var(--surface); border-color: var(--border); }
