/* ------------------------------------------------------------------------
 * IP-NAVI 포털 테마 — IP-NAVI-RAG-PoC.html 전용.
 *
 * Loaded after app.css and scoped entirely under `body.ipnavi`, so the
 * attachment sample and the admin console keep rendering exactly as they do
 * today. That scoping is not tidiness: app.css is shared by all three screens,
 * and .pill / .messages / .field-* / .card-shadow are used by every one of them.
 *
 * Every value here was measured from the live portal's own stylesheets
 * (naviDefaultLayout.css, naviResponse.css) rather than eyeballed:
 *
 *   .board_srch     background #064F8B                    → .ipn-srch
 *   .tit_wrap       32px/800 #333 + border-bottom 1px #ccc → .ipn-tit-wrap
 *   h3.tit          border-left 5px, #12b6c3 → #619bff     → .ipn-tit
 *   h4.tit::before  8px square, 65deg gradient             → .ipn-tit-sm
 *   .sub_nav        #f5f5f5 / 1px #e5e5e5 top+bottom       → .ipn-subnav
 *   .page_total     14px #555, count in #0081E4            → .ipn-total
 *   #footer         #111 background, #888 text             → .ipn-footer
 *
 * The portal's grammar is square corners, strong horizontal rules and almost no
 * shadow. Overrides below exist to undo app.css's opposite defaults (9999px
 * pills, 0.5rem radii, layered drop shadows), not to decorate.
 * ---------------------------------------------------------------------- */

/* 팔레트는 style/palette.css 로 옮겼다 — 관리자 콘솔이 같은 값을 읽어야 하고,
   같은 hex 를 두 파일에 적으면 갈라지기 때문이다. 이 파일은 그 토큰을 쓰기만
   한다. palette.css 를 먼저 읽지 않으면 여기 모든 색이 빈 값이 된다. */


body.ipnavi {
    font-family: var(--ipn-body-font);
    color: var(--ipn-text);
    background-color: #fff;
    letter-spacing: -0.3px;
}

/* ------------------------------------------------------------------------
 * Header
 * ---------------------------------------------------------------------- */

.ipn-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: #fff;
    border-bottom: 1px solid var(--ipn-bar-border);
}

.ipn-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* A text wordmark, not the portal's ipnavi_logo.png — this is our PoC screen
   standing next to their site, not a copy of it. */
.ipn-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    white-space: nowrap;
}

.ipn-logo-mark {
    flex: none;
    display: block;
}

.ipn-logo-text {
    font-family: var(--ipn-head-font);
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--ipn-navy);
    line-height: 1;
}

.ipn-logo-sub {
    padding: 3px 8px;
    border: 1px solid var(--ipn-blue);
    border-radius: 2px;
    font-size: 12px;
    font-weight: 500;
    color: var(--ipn-blue);
    line-height: 1;
}

.ipn-util {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* 상태 배지는 사용자 화면에서 숨긴다 — `display: flex` 가 `hidden` 속성을 이기므로 여기서 다시 끈다. */
.ipn-util[hidden] {
    display: none;
}

/* 관리자 버튼. 포털의 문법대로 각진 모서리 · 그림자 없음 — 평소엔 남색 테두리, hover 에 남색으로 채운다. */
.ipn-admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--ipn-navy);
    border-radius: 2px;
    background-color: #fff;
    color: var(--ipn-navy);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s;
}

.ipn-admin-btn:hover {
    background-color: var(--ipn-navy);
    color: #fff;
}

.ipn-admin-btn:focus-visible {
    outline: 2px solid var(--ipn-blue);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------------
 * Breadcrumb bar (.sub_nav)
 * ---------------------------------------------------------------------- */

.ipn-subnav {
    background-color: var(--ipn-bar-bg);
    border-top: 1px solid var(--ipn-bar-border);
    border-bottom: 1px solid var(--ipn-bar-border);
}

.ipn-crumb {
    max-width: 1280px;
    margin: 0 auto;
    padding: 11px 24px;
    font-size: 13px;
    color: var(--ipn-faint);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ipn-crumb-sep {
    color: #bbb;
}

.ipn-crumb-current {
    color: var(--ipn-navy);
    font-weight: 500;
}

/* 두 서비스 화면 전환.
 *
 * .ipn-crumb 안에 산다 — 그쪽이 이미 flex 행이고 1280 폭과 모바일 줄바꿈을
 * 갖고 있어서, 여기서 다시 잡으면 두 곳이 어긋날 수 있다. margin-left:auto 가
 * 이 묶음만 오른쪽 끝으로 민다. */
.ipn-dataset {
    margin-left: auto;
    display: inline-flex;
    border: 1px solid var(--ipn-bar-border);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.ipn-dataset-btn {
    padding: 5px 12px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--ipn-faint);
    text-decoration: none;
    white-space: nowrap;
}

.ipn-dataset-btn + .ipn-dataset-btn {
    border-left: 1px solid var(--ipn-bar-border);
}

.ipn-dataset-btn:hover {
    background: #eef2f7;
}

/* 지금 보고 있는 화면. navi.js 가 붙인다. 색만이 아니라 굵기까지 바꾸는 이유:
 * 두 색인은 **다른 해의 사실**을 담고 있어서, 어느 쪽을 보고 있는지 헷갈린 채
 * 읽은 답은 그럴듯하면서 틀렸다. */
.ipn-dataset-btn.is-current {
    background: var(--ipn-navy);
    color: #fff;
    font-weight: 600;
}

/* ------------------------------------------------------------------------
 * Page body
 * ---------------------------------------------------------------------- */

.ipn-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

/* .tit_wrap — title left, meta right, hairline underneath. */
.ipn-tit-wrap {
    width: 100%;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--ipn-line);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
}

.ipn-sub-tit {
    font-family: var(--ipn-head-font);
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--ipn-text);
    line-height: 1.2;
}

/* Where the portal puts the desk officer's name and mail link, we put the two
   facts that decide whether an answer is trustworthy: what is indexed, and what
   the service is doing right now. */
.ipn-meta {
    text-align: right;
    font-size: 12px;
    color: var(--ipn-faint);
    line-height: 1.6;
}

.ipn-meta strong {
    color: var(--ipn-muted);
    font-weight: 500;
}

.ipn-meta-status {
    color: var(--ipn-blue);
}

/* Title + "?" — the wrapper exists because .ipn-tit-wrap is space-between:
   without it the icon would be flung to the far side, away from the heading it
   annotates. position:relative is what the popover anchors to. */
.ipn-tit-main {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    min-width: 0;
}

.ipn-help {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--ipn-line);
    border-radius: 50%;
    background: transparent;
    color: var(--ipn-faint);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    transition: color 0.15s, border-color 0.15s;
}

.ipn-help:hover,
.ipn-help:focus-visible {
    color: var(--ipn-blue);
    border-color: var(--ipn-blue);
}

/* What .top_box used to be — same #edf2fb ground, same hairline, same 1.65
   line-height — now floated under the "?" instead of occupying a full-width
   band above the query box. */
.ipn-help-pop {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 20;
    width: max-content;
    max-width: 520px;
    margin-top: 8px;
    background-color: var(--ipn-box-bg);
    border: 1px solid var(--ipn-box-border);
    border-radius: 6px;
    padding: 16px 20px;
    color: var(--ipn-muted);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.65;
    letter-spacing: normal;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s, visibility 0.15s;
}

.ipn-help-pop strong {
    font-weight: 500;
    color: var(--ipn-navy);
}

/* :focus-visible as well as :hover — the icon is a real button, so Tab and
   touch reach the same text a mouse does. Keeping it open while the pointer is
   over the popover itself lets the text be selected and copied. */
.ipn-help:hover + .ipn-help-pop,
.ipn-help:focus-visible + .ipn-help-pop,
.ipn-help-pop:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* No .sr-only in app.css, and Tailwind 2's is not guaranteed here. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* One column, and now a single panel inside it: 검색 설정 moved into the 질의
   panel and 관련 문서 was removed outright. Kept because it carries the page's
   top spacing; the @media rule that used to collapse two columns at 1024px is
   long gone, because leaving it would tell the next reader there are still
   two. */
.ipn-grid {
    margin-top: 36px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    align-items: start;
}

.ipn-col-main {
    display: flex;
    flex-direction: column;
    gap: 36px;
    min-width: 0;
}

/* 검색 설정 — the rail, laid on its side. Lives inside the 질의 panel, between
   .ipn-panel-body and the .ipn-srch bar that holds its 설정 보기 toggle, so
   expanding it opens immediately above the button rather than a screen away.
   Each field is a label/slider/value triple on one line so the bar is one row
   tall instead of two, and the groups grow to share the full width rather than
   bunching at the left. Wraps rather than scrolling, so a narrow window drops
   fields to the next line instead of hiding them. */
.ipn-settings-bar {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 28px;
    padding: 14px 20px;
    border: 1px solid var(--ipn-line, #d8dee6);
    border-radius: 4px;
    background: var(--ipn-panel-bg, #fbfcfd);
}

/* Required, not belt-and-braces: `display: flex` above is an author rule and
   would beat both the UA sheet's `[hidden] { display: none }` and Tailwind
   preflight's (same specificity, loaded earlier), so the bar would render
   fully expanded on load despite the `hidden` attribute. */
.ipn-settings-bar[hidden] {
    display: none;
}

.ipn-settings-bar .ipn-setting {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    /* grow to take up the slack on the right, shrink before wrapping */
    flex: 1 1 auto;
    min-width: 0;
}

.ipn-settings-bar .field-label {
    margin: 0;
    flex: 0 0 auto;
    white-space: nowrap;
}

.ipn-settings-bar .field-range {
    width: auto;
    flex: 1 1 120px;
    min-width: 90px;
    margin: 0;
    accent-color: var(--ipn-blue);
    cursor: pointer;
}

/* tabular-nums so the row does not twitch sideways as digits change while the
   thumb is being dragged; min-width holds the widest value ("4096"). */
.ipn-setting-value {
    flex: 0 0 auto;
    min-width: 44px;
    text-align: right;
    font-size: 13px;
    font-weight: 500;
    color: var(--ipn-navy);
    font-variant-numeric: tabular-nums;
}

/* 체크박스 묶음 — left-aligned inside its own slot, on the same single row. */
.ipn-setting-checks {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    flex: 1 1 auto;
    min-width: 0;
}

.ipn-setting-checks .check-row {
    white-space: nowrap;
}

.ipn-settings-hint {
    flex-basis: 100%;
    margin: 0;
    font-size: 12px;
    color: var(--ipn-muted, #6b7684);
}

/* ------------------------------------------------------------------------
 * Section headings — h3.tit and h4.tit
 * ---------------------------------------------------------------------- */

.ipn-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* The retrieval mode badge annotates the 질의 heading, so it has to sit next to
   it — .ipn-panel-head is space-between, which would otherwise strand it in the
   middle of the row. The auto margin absorbs the slack instead, keeping the
   badge against the title and pushing the spinner to the far edge. */
#retrievalMode {
    margin-right: auto;
}

/* h3.tit: 5px left rule filled with the teal→blue gradient. Only border-left is
   set, because border-image paints every side it is given a width for. */
.ipn-tit {
    font-family: var(--ipn-head-font);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--ipn-heading);
    padding-left: 12px;
    border-left: 5px solid;
    border-image: linear-gradient(to bottom, var(--ipn-teal), var(--ipn-sky));
    border-image-slice: 1;
    line-height: 1.3;
}

/* h4.tit: an 8px rounded square instead of a rule. */
.ipn-tit-sm {
    position: relative;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -0.5px;
    color: var(--ipn-heading);
    padding-left: 16px;
}

.ipn-tit-sm::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: linear-gradient(65deg, rgba(73, 105, 173, 1) 34%, rgba(104, 195, 213, 1) 100%);
}

/* A panel is a flat bordered block, not a floating card. */
.ipn-panel {
    background-color: #fff;
}

.ipn-panel-body {
    border: 1px solid var(--ipn-bar-border);
    border-radius: 2px;
    padding: 20px;
}

.ipn-panel-body.is-plain {
    border: 0;
    padding: 0;
}

/* .page_total — "총 N건", count in blue. */
.ipn-total {
    font-size: 14px;
    font-weight: 300;
    color: var(--ipn-muted);
}

.ipn-total strong {
    color: var(--ipn-blue);
    font-weight: 500;
}

/* ------------------------------------------------------------------------
 * The navy action bar (.board_srch)
 *
 * On the portal this holds the search controls and the submit button; here it
 * holds the streaming toggle and the three query buttons. Same role, so it gets
 * the same treatment — it is the one solid block of colour on the page.
 * ---------------------------------------------------------------------- */

.ipn-srch {
    margin-top: 18px;
    width: 100%;
    background-color: var(--ipn-navy);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.ipn-srch-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    white-space: nowrap;
}

.ipn-srch-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #fff;
    cursor: pointer;
}

.ipn-srch-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* .link_btn — 4px radius, 15px/500. */
.ipn-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 9px 20px;
    font-family: var(--ipn-body-font);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.5px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

/* White on navy: the strongest contrast available inside the bar. */
.ipn-btn-primary {
    background-color: #fff;
    color: var(--ipn-navy);
}

.ipn-btn-primary:hover:not(:disabled) {
    background-color: #dbe9f7;
}

.ipn-btn-ghost {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
}

.ipn-btn-ghost:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.14);
    border-color: #fff;
}

.ipn-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ------------------------------------------------------------------------
 * Footer
 * ---------------------------------------------------------------------- */

.ipn-footer {
    background-color: var(--ipn-footer-bg);
    padding: 44px 0 56px;
}

.ipn-footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    color: var(--ipn-footer-text);
    font-size: 13px;
    line-height: 1.8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.ipn-footer-name {
    font-family: var(--ipn-head-font);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ddd;
    margin-bottom: 10px;
}

.ipn-footer-note {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #333;
    color: #666;
    font-size: 12px;
}

/* IP-NAVI 포털 푸터에서 옮긴 주소 · 기관 링크. 값은 포털의 naviDefaultLayout.css(footer#footer) 그대로 —
   주소 #777 14px/20px, 로고 높이 39px · 간격 40px. 좌: 서비스 정보 + 주소, 우: 기관 로고. */
.ipn-footer-address {
    margin-top: 14px;
    color: #777;
    font-size: 14px;
    line-height: 20px;
    font-style: normal;
}

.ipn-footer-address span {
    padding: 0 5px;
}

.ipn-footer-site {
    flex: none;
    display: flex;
    align-items: center;
    gap: 40px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ipn-footer-site a {
    display: block;
    height: 39px;
    font-size: 0;
    text-indent: -99999px;
    overflow: hidden;
    background: no-repeat center / contain;
}

.ipn-footer-site a.kipo {
    width: 98px;
    background-image: url(img/kipo_logo.png);
}

.ipn-footer-site a.koipa {
    width: 164px;
    background-image: url(img/koipa_logo.png);
}

/* ========================================================================
 * Overrides of app.css, all scoped to this page.
 *
 * These do not rename anything: navi.js and feedback.js build these exact class
 * names at runtime (navi.js:67, 167, 290, 319; feedback.js:47-98), so the names
 * are a contract and only the appearance moves.
 * ==================================================================== */

/* Pills — app.css makes them 9999px capsules in indigo. Square them and move
   them onto the portal's blues. setPill() overwrites className wholesale, so
   these must be reachable from `.pill` alone. */
.ipnavi .pill {
    border-radius: 2px;
    padding: 0.3rem 0.55rem;
    font-weight: 500;
    letter-spacing: -0.3px;
}

.ipnavi .pill-on {
    background-color: #e6f2fc;
    color: var(--ipn-navy);
}

.ipnavi .pill-off {
    background-color: #f0f0f0;
    color: var(--ipn-faint);
}

.ipnavi .pill-warn {
    background-color: #fdf3e3;
    color: #a06520;
}

.ipnavi .pill-error {
    background-color: #fdeaea;
    color: var(--ipn-danger);
}

/* 배지 위의 나라 목록(navi.js setTooltip). body 에 하나만 두고 배지 아래로 옮겨 띄운다. */
.ipn-tooltip {
    position: absolute;
    z-index: 1000;
    max-width: min(420px, calc(100vw - 16px));
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--ipn-bar-border);
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(16, 32, 64, 0.14);
    color: var(--ipn-text);
    font-size: 12.5px;
    line-height: 1.6;
}

.ipn-tooltip strong {
    display: block;
    margin-bottom: 4px;
    color: var(--ipn-navy);
}

.ipn-tooltip p {
    margin: 0;
}

.ipn-tooltip p + p {
    margin-top: 6px;
    color: #a06520;
}

/* Transcript. The flex column, the overflow and the scroll geometry all stay —
   .message.user aligns to flex-end, .feedback-row to flex-start, and both
   navi.js:171 and feedback.js:112 drive scrollTop from real measurements. */
.ipnavi .messages {
    min-height: 200px;
    padding-right: 0.375rem;
}

.ipnavi .message {
    border-radius: 2px;
    font-size: 15px;
    line-height: 1.7;
}

.ipnavi .message.user {
    background-color: var(--ipn-box-bg);
    color: var(--ipn-text);
}

.ipnavi .message.assistant {
    background-color: #f8f9fa;
    border: 1px solid var(--ipn-bar-border);
    color: var(--ipn-text);
}

/* 대기 줄. 포털 톤으로 — 답변 말풍선과 같은 바탕에 점선만 다르다. */
.ipnavi .message.thinking {
    background-color: #f8f9fa;
    border: 1px dashed var(--ipn-bar-border);
    color: var(--ipn-muted);
    font-size: 14px;
}

.ipnavi .message.error {
    background-color: #fdeaea;
    color: var(--ipn-danger);
}

.ipnavi .message-empty {
    color: #999;
}

.ipnavi .messages::-webkit-scrollbar-thumb,
.ipnavi .pane-scroll::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 0;
}

/* Suggested queries — solid border, not dashed: the portal has no dashed edge
   anywhere. */
.ipnavi .suggestions {
    border: 1px solid var(--ipn-bar-border);
    border-radius: 2px;
    background-color: var(--ipn-bar-bg);
}

.ipnavi .suggestions-title {
    color: var(--ipn-navy);
    font-weight: 500;
}

.ipnavi .suggestion-btn {
    border-radius: 2px;
    border-color: #cbd8e8;
    color: var(--ipn-navy);
    font-weight: 400;
}

.ipnavi .suggestion-btn:hover {
    background-color: var(--ipn-navy);
    border-color: var(--ipn-navy);
    /* The base .suggestion-btn colour is navy too, and this file loads last —
       so the hover text has to be flipped here or it vanishes into the fill. */
    color: #fff;
}

.ipnavi .suggestion-btn:focus {
    box-shadow: 0 0 0 3px rgba(0, 129, 228, 0.35);
}

/* 가이드북이 없는 나라 안내 — 음영, 눌리지 않음. 위 hover 를 이겨야 한다. */
.ipnavi .suggestion-btn.is-disabled,
.ipnavi .suggestion-btn.is-disabled:hover {
    border-color: #d1d5db;
    background-color: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

.ipnavi .suggestion-empty {
    color: var(--ipn-faint);
}

/* The document the answer came from. Same gradient rule as h3.tit, because it
   is the same idea: this is the thing the section is about. */
.ipnavi .doc-primary {
    background-color: var(--ipn-box-bg);
    border: 0;
    border-left: 5px solid;
    border-image: linear-gradient(to bottom, var(--ipn-teal), var(--ipn-sky));
    border-image-slice: 1;
    border-radius: 0;
    padding: 16px 18px;
}

.ipnavi .doc-meta {
    color: var(--ipn-faint);
    font-size: 12px;
    line-height: 1.5;
}

/* One target of a comparison. Stacked rather than laid out in columns: the
   cards carry passages of arbitrary length, and side-by-side columns would
   either clip them or force every column to the height of the longest. The
   numbering carries the correspondence with the answer's table instead. */
.ipnavi .compare-target {
    margin-top: 14px;
}

.ipnavi .compare-target > p:first-child {
    margin-bottom: 6px;
}

/* A target with no evidence still occupies its slot. Muted, but present —
   an empty column is information, a missing column is a silent omission. */
.ipnavi .compare-target .message-empty {
    background-color: var(--ipn-box-bg);
    border-left: 5px solid var(--ipn-line);
    padding: 14px 18px;
}

.ipnavi .result-snippet {
    color: var(--ipn-muted);
    font-size: 13px;
}

.ipnavi .score-track {
    height: 4px;
    border-radius: 0;
    background-color: #e5e5e5;
}

.ipnavi .score-bar {
    border-radius: 0;
    background-color: var(--ipn-blue);
}

/* Form controls */
.ipnavi .field-input,
.ipnavi .field-textarea {
    border-radius: 2px;
    border-color: var(--ipn-line);
    font-family: var(--ipn-body-font);
    font-size: 15px;
}

.ipnavi .field-input:hover,
.ipnavi .field-textarea:hover {
    border-color: #999;
}

.ipnavi .field-input:focus,
.ipnavi .field-textarea:focus {
    border-color: var(--ipn-blue);
    box-shadow: 0 0 0 3px rgba(0, 129, 228, 0.18);
}

.ipnavi .field-textarea {
    min-height: 104px;
}

.ipnavi .field-label {
    color: var(--ipn-muted);
    font-size: 13px;
    font-weight: 500;
}

.ipnavi .field-hint {
    color: var(--ipn-faint);
}

.ipnavi .check-row {
    color: var(--ipn-muted);
    font-size: 14px;
}

.ipnavi .check-row input[type="checkbox"] {
    accent-color: var(--ipn-navy);
}

.ipnavi .spinner {
    border-color: rgba(6, 79, 139, 0.25);
    border-top-color: var(--ipn-blue);
}

/* Feedback row */
.ipnavi .feedback-btn,
.ipnavi .feedback-reason {
    border-radius: 2px;
    border-color: var(--ipn-line);
}

.ipnavi .feedback-btn:hover:not(:disabled) {
    border-color: var(--ipn-blue);
    background-color: #e6f2fc;
}

.ipnavi .feedback-reason:hover {
    border-color: var(--ipn-blue);
    color: var(--ipn-blue);
}

.ipnavi .feedback-note {
    color: var(--ipn-blue);
}

/* ------------------------------------------------------------------------
 * Responsive — the portal collapses the same two joints (naviResponse.css).
 * ---------------------------------------------------------------------- */

@media (max-width: 1024px) {
    .ipn-grid {
        gap: 28px;
    }
}

@media (max-width: 768px) {
    .ipn-settings-bar {
        flex-direction: column;
        align-items: stretch;
    }

    /* keep label left / slider right, but let the pair span the row */
    .ipn-settings-bar .ipn-setting {
        justify-content: space-between;
    }

    .ipn-settings-bar .field-range {
        flex: 1 1 auto;
        min-width: 0;
    }

    .ipn-setting-checks {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .ipn-header-inner {
        height: auto;
        padding: 14px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .ipn-util {
        justify-content: flex-start;
    }

    .ipn-crumb,
    .ipn-container,
    .ipn-footer-inner {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* 좁은 화면: 기관 로고는 주소 아래 제 줄로. */
    .ipn-footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .ipn-footer-address {
        font-size: 12px;
    }

    /* 좁은 화면에서는 줄을 바꿔 제 줄을 갖는다. margin-left:auto 를 유지하면
     * 빵부스러기를 밀어내며 한 줄에 끼려 한다. */
    .ipn-dataset {
        margin-left: 0;
    }

    .ipn-container {
        padding-top: 32px;
    }

    .ipn-sub-tit {
        font-size: 25px;
    }

    /* Meta moves under the title rather than fighting it for the same line. */
    .ipn-tit-wrap {
        align-items: flex-start;
        gap: 12px;
    }

    .ipn-meta {
        text-align: left;
    }

    /* The popover is anchored to the title, so on a narrow screen cap it to
       the viewport rather than letting it run off the right edge. */
    .ipn-help-pop {
        width: auto;
        max-width: calc(100vw - 48px);
        padding: 14px 16px;
        font-size: 13px;
    }

    /* The action bar stacks: the buttons stay reachable with one thumb instead
       of being squeezed onto the toggle's line. */
    .ipn-srch {
        align-items: stretch;
        gap: 12px;
    }

    .ipn-srch-actions {
        justify-content: flex-end;
        order: 2;
    }

    /* Stacked, the toggle reads better above the actions: it belongs to the
       settings section, not to the row of things that run the query. The 100%
       basis is what gives it its own row — sharing one with the wrapped action
       buttons, `align-items: stretch` above would draw it as a tall block the
       full height of that column. */
    #toggleSettings {
        order: 1;
        flex: 0 0 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .ipn-srch-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ipn-btn {
        justify-content: center;
    }
}

/* ------------------------------------------------------------------------
 * Matching passages, the portal's way: square corners, its blue, its type
 * scale. Same rules as app.css, restated with the theme's values — which is
 * how every other block in this file relates to its counterpart.
 * ---------------------------------------------------------------------- */

.ipnavi .chunk-item {
    border-radius: 0;
    border-left: 3px solid var(--ipn-blue);
    background-color: #fff;
    padding: 10px 12px;
}

.ipnavi .chunk-item.is-unused {
    border-left-color: var(--ipn-line);
    background-color: var(--ipn-bar-bg);
}

.ipnavi .chunk-where {
    color: var(--ipn-heading);
    font-size: 12px;
}

.ipnavi .chunk-badge {
    border-radius: 0;
    border-color: var(--ipn-line);
    color: var(--ipn-faint);
    font-size: 11px;
}

/* Dialog — the portal has no rounded panels anywhere, and its one solid block
   of colour is the navy bar, so that is what the header becomes. */
.ipnavi .modal {
    border-radius: 0;
    box-shadow: 0 12px 32px rgba(6, 79, 139, 0.28);
}

.ipnavi .modal-head {
    background-color: var(--ipn-navy);
    border-bottom: 0;
}

.ipnavi .modal-title {
    color: #fff;
    font-family: var(--ipn-head-font);
}

.ipnavi .modal-subtitle {
    color: rgba(255, 255, 255, 0.78);
}

.ipnavi .modal-close {
    color: rgba(255, 255, 255, 0.85);
}

.ipnavi .modal-close:hover,
.ipnavi .modal-close:focus-visible {
    color: #fff;
}

/* Rendered Markdown picks up the portal's body face and rule colours. The
   size stays on `.message`: a reply is 15px, and a 근거 문서 passage keeps the
   smaller `.result-snippet` scale it shares with the rest of the panel. */
.ipnavi .message.is-markdown {
    font-size: 15px;
}

.ipnavi .is-markdown h1,
.ipnavi .is-markdown h2,
.ipnavi .is-markdown h3,
.ipnavi .is-markdown h4 {
    color: var(--ipn-heading);
    font-family: var(--ipn-head-font);
}

.ipnavi .is-markdown a {
    color: var(--ipn-blue);
}

.ipnavi .is-markdown th,
.ipnavi .is-markdown td {
    border-color: var(--ipn-bar-border);
}

.ipnavi .is-markdown th {
    background-color: var(--ipn-bar-bg);
    color: var(--ipn-heading);
}

.ipnavi .is-markdown caption {
    color: var(--ipn-heading);
    font-family: var(--ipn-head-font);
}

.ipnavi .is-markdown blockquote {
    border-left-color: var(--ipn-line);
    color: var(--ipn-muted);
}

/* Answer sentence ↔ source sentence, in the portal's idiom: square corners,
   its blue, its heading face. */

.ipnavi .evidence-item {
    border-left: 3px solid var(--ipn-blue);
}

.ipnavi .evidence-claim {
    color: var(--ipn-text);
    font-size: 14px;
}

.ipnavi .evidence-source {
    border-left-color: var(--ipn-line);
}

.ipnavi .evidence-cite {
    color: var(--ipn-heading);
    font-family: var(--ipn-head-font);
    font-size: 12px;
    text-decoration-color: var(--ipn-line);
}

.ipnavi .evidence-cite:hover,
.ipnavi .evidence-cite:focus-visible {
    color: var(--ipn-blue);
    text-decoration-color: var(--ipn-blue);
}

.ipnavi .evidence-item mark:not(.term-hit),
.ipnavi .modal-body mark:not(.term-hit) {
    border-radius: 0;
    background-color: #ffec8b;
}

/* Square corners for the query-term mark too, and its own colour kept — see
   the `:not(.term-hit)` note in app.css. */
.ipnavi mark.term-hit {
    border-radius: 0;
}

.ipnavi .evidence-note,
.ipnavi .evidence-details > summary {
    color: var(--ipn-faint);
    font-size: 12px;
}

.ipnavi .evidence-details > summary:hover,
.ipnavi .evidence-details > summary:focus-visible {
    color: var(--ipn-blue);
}
