:root { color-scheme: light; font-family: Pretendard, "Noto Sans KR", system-ui, sans-serif; color: #173f37; background: #eaf0ed; }
* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; max-width: 100vw; height: 100%; margin: 0; overflow: hidden; }
body { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.viewer-header, .viewer-tabs, .viewer-main, .viewer-notice { min-width: 0; max-width: 100vw; }
button, select { font: inherit; }
.viewer-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; min-height: 76px; padding: 10px 18px; border-bottom: 1px solid #d7e2dc; background: #fffefa; }
.viewer-brand { display: flex; align-items: center; gap: 8px; color: #174b3d; font-size: 14px; text-decoration: none; white-space: nowrap; }
.viewer-brand span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; background: #16735a; color: #fff; font-size: 12px; }
.viewer-title { min-width: 0; }
.viewer-title small { color: #16735a; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.viewer-title h1 { display: inline; margin: 0 0 0 8px; font-size: 18px; letter-spacing: -.04em; }
.viewer-title p { margin: 4px 0 0; overflow: hidden; color: #6b7d76; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.viewer-actions { display: flex; align-items: center; gap: 7px; }
.viewer-actions button { min-height: 38px; padding: 0 13px; border: 1px solid #c8d7d0; border-radius: 10px; background: #fff; color: #31594d; font-size: 11px; font-weight: 800; cursor: pointer; }
.viewer-actions button:hover, .viewer-actions button:focus-visible { border-color: #16735a; outline: none; }
.viewer-actions button:disabled { cursor: not-allowed; opacity: .52; }
.viewer-actions .viewer-close { width: 38px; padding: 0; color: #9c3f3b; font-size: 20px; }
.viewer-tabs { width: 100%; display: flex; gap: 6px; overflow-x: auto; padding: 9px 18px; border-bottom: 1px solid #d7e2dc; background: #f8fbf9; scrollbar-width: thin; }
.viewer-tabs button { flex: 0 0 auto; min-height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #5c7169; font-size: 11px; font-weight: 800; cursor: pointer; }
.viewer-tabs button:hover, .viewer-tabs button:focus-visible { border-color: #bad0c6; outline: none; color: #155a47; }
.viewer-tabs button.active { border-color: #16735a; background: #16735a; color: #fff; }
.viewer-tabs button[hidden] { display: none; }
.viewer-main { min-height: 0; padding: 10px; overflow: hidden; }
.document-panel { width: 100%; height: 100%; min-height: 0; }
.document-panel[hidden] { display: none; }
.document-panel.active { display: grid; }
#panelEum.active { grid-template-rows: auto minmax(0, 1fr); gap: 8px; }
#panelLandRegister.active { grid-template-rows: auto minmax(0, 1fr); gap: 8px; }
#panelCadastralMap.active, #panelCoOwnerRegister.active, #panelRegistry.active { overflow: auto; }
.eum-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border: 1px solid #d2ded8; border-radius: 12px; background: #fff; }
.eum-toolbar p { margin: 0; color: #63766f; font-size: 10px; line-height: 1.5; }
.eum-toolbar a { flex: 0 0 auto; min-height: 36px; padding: 0 12px; border-radius: 9px; background: #16735a; color: #fff; font-size: 10px; font-weight: 850; line-height: 36px; text-decoration: none; }
.eum-toolbar a:hover, .eum-toolbar a:focus-visible { background: #105d48; outline: 2px solid #9bc7b6; outline-offset: 2px; }
.document-source-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border: 1px solid #d2ded8; border-radius: 12px; background: #fff; }
.document-source-bar p { margin: 0; color: #536b62; font-size: 10px; line-height: 1.5; }
.document-source-bar a { flex: 0 0 auto; min-height: 34px; padding: 0 12px; border-radius: 9px; background: #edf7f2; color: #126148; font-size: 10px; font-weight: 850; line-height: 34px; text-decoration: none; }
.document-source-bar a:hover, .document-source-bar a:focus-visible { background: #dceee5; outline: 2px solid #9bc7b6; outline-offset: 2px; }
.official-document-card { width: min(850px, 100%); align-self: start; justify-self: center; display: grid; gap: 18px; margin: auto; padding: clamp(24px, 5vw, 48px); border: 1px solid #d2ded8; border-radius: 20px; background: #fffefa; box-shadow: 0 18px 55px rgba(14,54,43,.08); }
.official-document-card header small { color: #16735a; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.official-document-card header h2 { margin: 5px 0 8px; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.05em; }
.official-document-card header p { max-width: 720px; margin: 0; color: #61766e; font-size: 12px; line-height: 1.7; }
.official-document-data { overflow: hidden; border: 1px solid #d8e3dd; border-radius: 14px; background: #f7faf8; }
.official-document-data > p { margin: 0; padding: 24px; color: #687b74; font-size: 12px; text-align: center; }
.official-document-data dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.official-document-data dl div { min-width: 0; padding: 15px; border-left: 1px solid #dde7e2; }
.official-document-data dl div:first-child { border-left: 0; }
.official-document-data dt { color: #71847c; font-size: 9px; }
.official-document-data dd { margin: 4px 0 0; overflow-wrap: anywhere; color: #173f37; font-size: 13px; font-weight: 850; }
.official-document-action, .official-document-actions button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 1px solid #16735a; border-radius: 11px; background: #16735a; color: #fff; font-size: 11px; font-weight: 850; text-decoration: none; cursor: pointer; }
.official-document-action:hover, .official-document-action:focus-visible, .official-document-actions button:hover, .official-document-actions button:focus-visible { background: #105d48; outline: 2px solid #9bc7b6; outline-offset: 2px; }
.official-document-actions { display: flex; gap: 9px; }
.official-document-actions > * { flex: 1; }
.official-document-actions button { background: #fff; color: #126148; }
.official-document-actions button:hover, .official-document-actions button:focus-visible { background: #edf7f2; }
.official-document-notice { margin: 0; padding: 13px 15px; border-radius: 11px; background: #f6f1e7; color: #75694f; font-size: 10px; line-height: 1.65; }
.registry-address { display: grid; gap: 5px; padding: 18px; border: 1px solid #d8e3dd; border-radius: 14px; background: #f7faf8; }
.registry-address span { color: #71847c; font-size: 9px; }
.registry-address strong { font-size: 16px; letter-spacing: -.025em; }
.registry-address small { color: #687b74; font-size: 10px; }
.frame-shell { position: relative; width: 100%; height: 100%; min-height: 0; overflow: hidden; border: 1px solid #d2ded8; border-radius: 14px; background: #fff; }
.frame-shell[hidden] { display: none; }
.frame-shell iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.frame-status { position: absolute; z-index: 2; left: 50%; top: 50%; padding: 12px 16px; border: 1px solid #d7e2dc; border-radius: 12px; background: #fff; color: #50675f; box-shadow: 0 12px 35px rgba(14,54,43,.13); font-size: 12px; transform: translate(-50%, -50%); }
.frame-status[hidden] { display: none; }
#panelBuilding.active { grid-template-rows: auto minmax(0, 1fr); gap: 9px; }
.building-toolbar { display: grid; grid-template-columns: auto minmax(200px, 360px) minmax(0, 1fr); align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid #d2ded8; border-radius: 13px; background: #fff; }
.building-toolbar label { font-size: 11px; font-weight: 850; }
.building-toolbar select { width: 100%; min-height: 39px; padding: 0 34px 0 11px; border: 1px solid #cad9d2; border-radius: 9px; background: #fff; color: #1d453a; font-size: 11px; }
.building-toolbar p { margin: 0; color: #6a7c75; font-size: 10px; line-height: 1.5; }
.building-overview { min-height: 0; overflow: auto; padding: 14px; border: 1px solid #d2ded8; border-radius: 14px; background: #f7faf8; }
.building-overview[hidden] { display: none; }
.building-overview__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.building-overview__head h2 { margin: 0; font-size: 16px; }
.building-overview__head span { padding: 5px 9px; border-radius: 999px; background: #dff1e8; color: #16735a; font-size: 9px; font-weight: 850; }
.building-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.building-item { padding: 14px; border: 1px solid #d6e2dc; border-radius: 13px; background: #fff; }
.building-item header { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.building-item h3 { margin: 0; font-size: 13px; }
.building-item header span { flex: 0 0 auto; color: #16735a; font-size: 9px; font-weight: 850; }
.building-item p { margin: 5px 0 0; color: #6b7c75; font-size: 10px; }
.building-item dl { display: grid; grid-template-columns: 1fr 1fr; margin: 11px 0; border-top: 1px solid #e3eae6; }
.building-item dl div { padding: 8px 4px 0; }
.building-item dt { color: #75857f; font-size: 8px; }
.building-item dd { margin: 2px 0 0; font-size: 10px; font-weight: 800; }
.building-item button { width: 100%; min-height: 37px; border: 1px solid #b9d1c6; border-radius: 9px; background: #edf7f2; color: #126148; font-size: 10px; font-weight: 850; cursor: pointer; }
.panel-empty { display: grid; place-items: center; min-height: 180px; padding: 30px; color: #697c75; font-size: 12px; line-height: 1.7; text-align: center; }
.panel-empty[hidden] { display: none; }
.viewer-error { height: 100%; display: grid; place-content: center; justify-items: center; gap: 8px; border: 1px solid #d2ded8; border-radius: 14px; background: #fff; text-align: center; }
.viewer-error[hidden] { display: none; }
.viewer-error p { margin: 0 0 8px; color: #687b75; font-size: 12px; }
.viewer-error a { min-height: 38px; padding: 0 14px; border-radius: 10px; background: #16735a; color: #fff; font-size: 11px; font-weight: 800; line-height: 38px; text-decoration: none; }
.viewer-notice { display: flex; gap: 10px; padding: 9px 18px max(9px, env(safe-area-inset-bottom)); border-top: 1px solid #d7e2dc; background: #fffefa; color: #6a756d; font-size: 9px; line-height: 1.5; }
.viewer-notice strong { flex: 0 0 auto; color: #8d6728; }
@media (max-width: 700px) {
  .viewer-header { grid-template-columns: 1fr auto; gap: 8px; padding: max(8px, env(safe-area-inset-top)) 10px 8px; }
  .viewer-brand { display: none; }
  .viewer-title h1 { display: block; margin: 2px 0 0; font-size: 16px; }
  .viewer-title p { max-width: 60vw; }
  .viewer-actions button:first-child { display: none; }
  .viewer-tabs { padding: 8px 10px; }
  .viewer-tabs button { min-height: 36px; padding: 0 11px; }
  .viewer-main { padding: 7px; }
  .eum-toolbar { padding: 8px 9px; }
  .eum-toolbar p { font-size: 9px; }
  .eum-toolbar a { min-height: 34px; padding: 0 10px; line-height: 34px; }
  .document-source-bar { align-items: stretch; flex-direction: column; padding: 8px 9px; }
  .document-source-bar a { text-align: center; }
  .official-document-card { gap: 14px; margin: 0; padding: 20px 16px; border-radius: 15px; }
  .official-document-data dl { grid-template-columns: 1fr; }
  .official-document-data dl div { border-top: 1px solid #dde7e2; border-left: 0; }
  .official-document-data dl div:first-child { border-top: 0; }
  .official-document-actions { flex-direction: column; }
  .building-toolbar { grid-template-columns: 1fr; gap: 6px; padding: 9px; }
  .building-toolbar p { display: none; }
  .building-grid { grid-template-columns: 1fr; }
  .viewer-notice { padding-inline: 10px; }
  .viewer-notice span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
