:root {
  color-scheme: dark;
  font-family: "Malgun Gothic", "맑은 고딕", Arial, sans-serif;
  font-synthesis: none;
  font-size: 14px;
  color: #e8edf5;
  background: #0b1017;
  --bg: #0b1017;
  --panel: #121b27;
  --panel-raised: #172332;
  --panel-soft: #101823;
  --line: #283647;
  --line-soft: #202c3a;
  --text: #e8edf5;
  --muted: #9aa8ba;
  --subtle: #748397;
  --blue: #68a6ff;
  --blue-soft: #182e48;
  --gold: #e9be6d;
  --green: #83d1b2;
  --shadow: 0 12px 30px rgb(0 0 0 / 18%);
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; }
body { min-width: 980px; overflow: hidden; background: var(--bg); }
button, input, select { font: inherit; }
button, select { color: inherit; }

.app-shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 244px minmax(470px, .98fr) minmax(430px, 1.02fr);
  background: var(--bg);
}

/* Library */
.library {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #0e151f;
  border-right: 1px solid var(--line);
}
.brand {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  border: 0;
  background: #0e151f;
  cursor: pointer;
  text-align: left;
  height: 70px;
  flex: 0 0 70px;
  display: flex;
  align-items: center;
  padding: 0 19px;
  border-bottom: 1px solid var(--line);
  color: #f3f0e7;
  gap: 11px;
}
.brand:hover { background: #121d2a; }
.brand:focus-visible { outline: 2px solid #d4b56d; outline-offset: -3px; }
.catalog-insurer { color: #e9be6d; font-size: .9em; margin-right: 6px; }
.brand-mark {
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  display: grid;
  place-items: center;
  border: 1px solid #d4b56d;
  border-radius: 9px 9px 9px 3px;
  background: linear-gradient(145deg, #31506a 0%, #172636 68%);
  box-shadow: inset 0 0 0 2px rgb(11 16 23 / 72%), 0 2px 10px rgb(0 0 0 / 22%);
  color: #edcf87;
  font-size: 16px;
  line-height: 1;
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-title {
  color: #e9d4a5;
  font-family: "Gowun Batang", "Noto Serif KR", "Malgun Gothic", "맑은 고딕", serif;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -.055em;
  text-shadow: 0 1px 10px rgb(233 190 109 / 12%);
}
#insurerList { flex: 1; min-height: 0; overflow: auto; padding: 12px 11px 18px; }
.library-group { margin: 4px 0 16px; padding-bottom: 15px; border-bottom: 1px solid #283647; }
.group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 2px 11px;
  padding: 14px 12px;
  border: 1px solid #314155;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: linear-gradient(110deg, #1b2b3f, #151f2c);
  color: #f0f4fa;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.025em;
}
.nonlife-group .group-title { border-color: #e9a24d; background: linear-gradient(105deg, #3b2b1d, #1d2028 78%); }
.life-group .group-title { border-color: #62c6a3; background: linear-gradient(105deg, #19382f, #1a2229 78%); }
.group-title small {
  padding: 3px 7px;
  border: 1px solid #3b4c61;
  border-radius: 12px;
  color: #a9bdd7;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
}
.insurer-button {
  width: calc(100% - 8px);
  margin-left: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid #263445;
  border-radius: 7px;
  background: #121b25;
  color: #c4cfdd;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.insurer-button:hover { border-color: #435a74; background: #192536; color: #fff; }
.insurer-button.active {
  border-color: #46658a;
  background: linear-gradient(100deg, #203d5d, #182a3d);
  box-shadow: inset 3px 0 var(--blue), 0 3px 12px rgb(0 0 0 / 14%);
  color: #f3f7fc;
  font-weight: 700;
}
.insurer-button small { color: #91bfff; font-size: 10px; }
.library-coming {
  margin-left: 8px;
  padding: 13px 12px;
  border: 1px dashed #344254;
  border-radius: 7px;
  color: #7f8da0;
  font-size: 11px;
}
.library-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  margin: 8px 12px 12px;
  padding: 9px 10px;
  border: 1px solid #8a744d;
  border-radius: 8px;
  color: #b9a57c;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .12em;
  background: linear-gradient(90deg, #0e151f, #192230 50%, #0e151f);
  line-height: 1.55;
}
.foot-ornament { color: #d1af70; font-size: 10px; letter-spacing: 0; }

/* Main workspace */
.workspace {
  min-height: 0;
  overflow: auto;
  overflow-anchor: none;
  padding: 23px 22px 30px;
  scrollbar-color: #394a5e #101823;
}
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
}
.page-heading { flex: 1 1 100%; }
.month-controls { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.eyebrow {
  color: #86a0bd;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
}
.topbar h1 {
  margin: 5px 0 0;
  color: #f2f5f9;
  font-size: 23px;
  letter-spacing: -.045em;
}
.month-control {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.month-control select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #35465b;
  border-radius: 7px;
  outline: none;
  background: #172231;
  color: #e5edf7;
  cursor: pointer;
}
.month-control select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(104 166 255 / 13%); }
.search-panel, .popular-panel, .catalog-panel, .detail-panel {
  margin-bottom: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.search-panel {
  display: grid;
  grid-template-columns: 82px minmax(100px, 1fr);
  align-items: center;
  gap: 8px 11px;
  padding: 13px 15px;
}
.search-panel label { color: #dce5ef; font-size: 12px; font-weight: 700; }
.search-panel input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #34465b;
  border-radius: 7px;
  outline: none;
  background: #0d151f;
  color: #eff4fa;
}
.search-panel input::placeholder { color: #68798d; }
.search-panel input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(104 166 255 / 13%); }
.hint { grid-column: 2; color: #8291a4; font-size: 10px; line-height: 1.4; }
.popular-panel, .catalog-panel, .detail-panel { padding: 15px; }
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}
.section-head h2, .source-head h2 { margin: 0; color: #edf2f8; font-size: 15px; letter-spacing: -.025em; }
.popular-panel .section-head h2 { color: #e4bd8b; }
.catalog-panel .section-head h2 { color: #a9c9ee; }
.detail-panel .section-head h2 { color: #d9a0a3; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.count-badge, .month-badge, .source-page {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid #345375;
  border-radius: 20px;
  background: #172b41;
  color: #a7cdfb;
  font-size: 10px;
  white-space: nowrap;
}
.table-scroll { max-height: 265px; overflow: auto; overflow-anchor: none; border: 1px solid var(--line-soft); border-radius: 7px; }
.rank-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.rank-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #1b2939;
  color: #aebdd0;
  font-size: 10px;
  font-weight: 700;
  text-align: left;
}
.rank-table th, .rank-table td { padding: 8px 9px; border-bottom: 1px solid #202d3b; }
.rank-table tr:last-child td { border-bottom: 0; }
.rank-table tbody tr:hover td { background: #172434; }
.rank-table td:nth-child(1), .rank-table td:nth-child(4) { color: #aebbd0; white-space: nowrap; }
.rank-table td:nth-child(2) { color: #9eacbf; white-space: nowrap; }
.product-pick {
  padding: 0;
  border: 0;
  background: none;
  color: #d6e3f1;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}
.product-pick:hover { color: #8ebfff; text-decoration: underline; text-underline-offset: 3px; }
.product-pick.selected { color: #9dc6ff; font-weight: 700; }
.catalog-panel { margin-bottom: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.catalog-scroll { max-height: 270px; overflow: auto; overflow-anchor: none; border: 1px solid var(--line-soft); border-radius: 7px; }
.catalog-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.catalog-table th { position: sticky; z-index: 1; top: 0; padding: 9px 10px; background: #203044; color: #b8c9dc; text-align: left; font-size: 10px; }
.catalog-table th:last-child, .catalog-table td:last-child { width: 92px; text-align: center; white-space: nowrap; }
.catalog-table td { padding: 8px 10px; border-bottom: 1px solid #202d3b; }
.catalog-table tr:last-child td { border-bottom: 0; }
.catalog-table tbody tr:hover td { background: #172434; }
.catalog-pick { width: 100%; padding: 1px 0; border: 0; background: none; color: #d9e4f1; text-align: left; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.45; }
.catalog-pick:hover { color: #95c2ff; text-decoration: underline; text-underline-offset: 3px; }
.catalog-pick.selected { color: #9dc6ff; }
.variant-count { display: inline-block; padding: 4px 7px; border: 1px solid #35495f; border-radius: 20px; background: #172435; color: #aabbd0; font-size: 9px; }
.variant-caption { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 7px; color: #c1cfdf; font-size: 12px; font-weight: 700; }
.variant-caption small { color: #91a4ba; font-size: 10px; font-weight: 500; }
.variant-list { display: flex; flex-direction: column; gap: 5px; max-height: 150px; overflow: auto; overflow-anchor: none; margin-bottom: 11px; }
.variant-button {
  padding: 7px 9px;
  border: 1px solid #314154;
  border-radius: 6px;
  background: #101923;
  color: #b8c6d6;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}
.variant-button:hover { border-color: #5278a4; }
.variant-button.active { border-color: #4b84c2; background: #182e46; color: #e3efff; font-weight: 700; }
.detail-content { min-height: 100px; }
.detail-name { margin: 0 0 10px; color: #edf3fa; font-size: 13px; font-weight: 700; line-height: 1.55; overflow-wrap: anywhere; }
.rate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px; border: 1px solid #8b4b53; border-radius: 9px; background: linear-gradient(135deg, rgb(139 75 83 / 14%), rgb(16 25 35 / 35%)); }
.rate-card { min-width: 0; padding: 12px; border: 1px solid #2b3b4e; border-radius: 7px; background: #101923; }
.rate-label { margin-bottom: 6px; color: #a8b8cb; font-size: 11px; font-weight: 700; letter-spacing: .01em; }
.rate-value { color: #e1eaf5; font-size: 14px; font-weight: 700; line-height: 1.55; overflow-wrap: anywhere; }
.rate-card:first-child .rate-value { color: #a9ceff; }
.rate-card:nth-child(3) .rate-value { color: #f0c97d; }
.rate-card:nth-child(4) .rate-value { color: #8fd4b5; }
.rate-card.wide { grid-column: 1 / -1; }
.product-info-card { margin-top: 12px; padding: 15px 16px; border: 1px solid #354a60; border-radius: 8px; background: linear-gradient(135deg, rgb(37 57 76 / 35%), #101923 70%); }
.product-info-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.product-info-head h3 { display: inline-block; margin: 0 9px 0 0; color: #e3eaf2; font-size: 15px; font-weight: 800; }
.product-category { color: #a9c9ee; font-size: 11px; font-weight: 700; }
.product-source { flex: 0 0 auto; color: #99adbf; font-size: 10px; }
.product-info-card p { margin: 0 0 10px; color: #bdc9d6; font-size: 13px; line-height: 1.65; }
.product-info-link { display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; color: #91bded; font-size: 13px; font-weight: 700; text-decoration: none; }
.product-info-link:hover { color: #c3ddfb; text-decoration: underline; text-underline-offset: 3px; }
.product-info-card small { display: block; margin-top: 9px; color: #788a9e; font-size: 10px; line-height: 1.55; }
.conditions { color: #b4c0ce; font-size: 10px; line-height: 1.6; white-space: pre-wrap; }
.empty-state { padding: 18px 5px; color: #8493a6; text-align: center; font-size: 11px; line-height: 1.6; }
.prototype-note { padding: 0 2px; color: #748296; font-size: 9px; line-height: 1.5; }
.source-review-note { margin: 9px 2px 0; color: #e9bd71; font-size: 11px; line-height: 1.5; }

/* Original documents */
.source-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: #101721;
}
.source-head {
  min-height: 70px;
  flex: 0 0 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #111a25;
}
.source-head h2 { margin-top: 4px; }
.source-viewer { min-height: 0; flex: 1; display: flex; flex-direction: column; padding: 9px 11px 10px; }
.source-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 1px 2px 8px; color: #9eacbd; font-size: 9px; }
.source-meta strong { overflow-wrap: anywhere; font-weight: 600; }
.source-meta-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.source-meta-actions span { white-space: nowrap; }
.source-pdf-link,
.source-meta-actions a {
  color: #a9c9f5;
  font-size: 9px;
  white-space: nowrap;
  text-decoration: none;
}
.source-meta-actions a:hover { color: #e3efff; text-decoration: underline; }
.source-scroll {
  min-height: 0;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 6px 8px;
  border: 1px solid #2c3948;
  border-radius: 8px;
  background: #090d12;
  scrollbar-color: #46566a #111923;
}
.source-page-card { margin: 0 auto 12px; max-width: 100%; border: 1px solid #354252; border-radius: 6px; overflow: hidden; background: #e9e9e9; box-shadow: 0 5px 18px rgb(0 0 0 / 25%); }
.source-page-label {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  background: #182536;
  color: #dce7f4;
  font-size: 9px;
}
.source-page-label span { color: #9eb1c8; white-space: nowrap; }
.source-page-card a { display: block; cursor: zoom-in; }
.source-page-card img { display: block; width: 100%; height: auto; }
.source-tip { flex: 0 0 auto; margin: 7px 2px 0; color: #8492a4; font-size: 9px; }
.source-empty { max-width: 280px; margin: auto; padding: 24px; color: #8795a7; text-align: center; font-size: 11px; line-height: 1.65; }
.source-panel [hidden] { display: none !important; }

@media (max-width: 1220px) {
  body { min-width: 900px; }
  .app-shell { grid-template-columns: 210px minmax(410px, .98fr) minmax(360px, 1.02fr); }
  .workspace { padding: 18px 16px 24px; }
  .source-head { padding-right: 12px; padding-left: 12px; }
}
@media (max-width: 1020px) {
  .app-shell { grid-template-columns: 190px minmax(390px, 1fr) minmax(320px, .9fr); }
  .brand { padding: 0 13px; font-size: 15px; }
  .rate-grid { grid-template-columns: 1fr; }
  .rate-card.wide { grid-column: auto; }
}
