/* /icd search page. Builds on referensi.css (rx-* tokens and components). */
.icd-hero { padding: 36px 0 28px; }
.icd-hero h1 { font-size: clamp(30px, 3.8vw, 48px); margin-bottom: 12px; }
.icd-hero .rx-lead { margin-bottom: 22px; }

/* Search console */
.icd-console { max-width: 820px; }
.icd-console .rx-systems button { display: inline-flex; align-items: center; gap: 6px; }
/* Link-style tabs on single-system pages (/icd-9-cm): same look as the buttons. */
.icd-console .rx-systems .system-tab:not(button) { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 9px; color: #3a5577; font-size: 13.5px; font-weight: 650; text-decoration: none; transition: background-color .2s ease, color .2s ease; }
.icd-console .rx-systems a.system-tab:hover { background: #eaf1fa; }
.icd-console .rx-systems .system-tab[aria-selected="true"]:not(button) { background: var(--rx-navy); color: white; }
.icd-console .rx-systems small { font-size: 11.5px; font-weight: 500; opacity: .75; }
.icd-box { position: relative; display: flex; align-items: center; background: white; border: 1px solid #cddcee; border-radius: 18px; padding: 6px 10px 6px 6px; box-shadow: 0 24px 60px -32px #00196580; transition: border-color .2s ease, box-shadow .2s ease; }
.icd-box:focus-within { border-color: var(--rx-blue); box-shadow: 0 0 0 4px #4075aa22, 0 24px 60px -32px #00196580; }
.icd-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 17px; color: var(--rx-ink); padding: 16px 4px; }
.icd-box input::-webkit-search-cancel-button { display: none; }
.icd-kbd, .icd-keys kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border: 1px solid #d6e1ee; border-bottom-width: 2px; border-radius: 6px; background: #f8fafd; font: 600 11.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: #64748b; }
.icd-box:focus-within .icd-kbd { display: none; }
.icd-clear { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: #f1f5f9; color: #475569; cursor: pointer; }
.icd-clear:hover { background: #e2e8f0; }
.icd-spinner { width: 18px; height: 18px; margin-left: 8px; border: 2px solid #d6e1ee; border-top-color: var(--rx-navy); border-radius: 50%; animation: icd-spin .7s linear infinite; }
.icd-console .rx-examples button { padding: 6px 12px; background: white; border: 1px solid #d6e4f4; border-radius: 999px; color: var(--rx-ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .2s ease, transform .2s ease; }
.icd-console .rx-examples button:hover { border-color: var(--rx-blue); transform: translateY(-1px); }

/* Results panel */
.icd-results-section { padding: 28px 0 56px; background: white; }
.icd-panel { max-width: 920px; }
.icd-status-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 28px; margin-bottom: 12px; }
.icd-status { font-size: 14px; color: var(--rx-muted); }
.icd-status strong { color: var(--rx-ink); }
.icd-keys { font-size: 12px; color: #94a3b8; white-space: nowrap; }
.icd-keys kbd { min-width: 20px; height: 20px; font-size: 10.5px; }
.icd-hint { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: #fff8e6; border: 1px solid #fde7a8; font-size: 13.5px; line-height: 1.6; color: #7a5a00; }
.icd-hint button { padding: 1px 8px; margin: 0 2px; border: 1px solid #f3d27a; border-radius: 999px; background: white; font: inherit; font-weight: 650; color: #7a5a00; cursor: pointer; }

.icd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.icd-item { position: relative; display: flex; align-items: stretch; background: white; border: 1px solid var(--rx-line); border-radius: 14px; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; animation: icd-in .35s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 25ms); }
.icd-item:hover { border-color: #bcd3ec; box-shadow: 0 12px 28px -18px #0019654d; }
.icd-item.is-active { border-color: var(--rx-blue); box-shadow: 0 0 0 3px #4075aa26; }
.icd-main { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 14px; padding: 14px 8px 14px 14px; color: inherit; cursor: pointer; }
.icd-code { flex-shrink: 0; min-width: 64px; padding: 5px 8px; border-radius: 9px; background: var(--rx-tint); color: var(--rx-navy); font: 750 14px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-align: center; }
.icd-code.is-cat { background: var(--rx-navy); color: white; }
.icd-text { flex: 1; min-width: 0; }
.icd-text strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--rx-ink); }
.icd-text small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: var(--rx-muted); }
.icd-text em { display: inline-block; margin-top: 6px; font-style: normal; font-size: 11px; font-weight: 650; letter-spacing: .02em; color: #7b8ca3; }
.icd-text mark { background: #fff1b8; color: inherit; border-radius: 3px; padding: 0 1px; }
.icd-go { align-self: center; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #94a3b8; transition: background-color .2s ease, color .2s ease, transform .2s ease; }
.icd-item:hover .icd-go, .icd-item.is-active .icd-go { background: var(--rx-tint); color: var(--rx-navy); transform: translateX(2px); }
.icd-copy { flex-shrink: 0; align-self: center; display: inline-flex; align-items: center; gap: 6px; height: 36px; margin-right: 12px; padding: 0 12px; border: 1px solid var(--rx-line); border-radius: 10px; background: white; color: #52657b; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .2s ease, color .2s ease, background-color .2s ease; }
.icd-copy:hover { border-color: var(--rx-blue); color: var(--rx-navy); }
.icd-copy.is-copied { border-color: #16a34a; background: #f0fdf4; color: #15803d; }

/* Idle / states */
.icd-idle { display: grid; gap: 28px; }
.icd-idle-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.icd-idle-head h2 { margin: 0; font-size: 16px; font-weight: 750; color: var(--rx-ink); }
.icd-idle-head a, .icd-idle-head button { border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 650; color: var(--rx-blue); cursor: pointer; }
.icd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.icd-chips button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--rx-line); border-radius: 999px; background: white; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--rx-ink); cursor: pointer; transition: border-color .2s ease; }
.icd-chips button:hover { border-color: var(--rx-blue); }
.icd-chips small { font-size: 11px; font-weight: 600; color: #94a3b8; }
.icd-skeleton { display: grid; gap: 8px; }
.icd-skeleton i { display: block; height: 72px; border-radius: 14px; background: linear-gradient(90deg, #f1f5f9 25%, #e8eef5 37%, #f1f5f9 63%); background-size: 400% 100%; animation: icd-shimmer 1.4s ease infinite; }
.icd-state { padding: 40px 20px; text-align: center; border: 1px dashed #d6e1ee; border-radius: 18px; background: #fafcff; }
.icd-state-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; margin-bottom: 12px; border-radius: 14px; background: var(--rx-tint); color: var(--rx-navy); }
.icd-state-icon.is-error { background: #fef2f2; color: #dc2626; }
.icd-state-title { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--rx-ink); }
.icd-state-sub { margin: 0; font-size: 14px; color: var(--rx-muted); }
.icd-state-sub a { color: var(--rx-blue); font-weight: 600; }
.icd-tips { display: inline-grid; gap: 6px; margin: 10px 0 18px; padding: 0; list-style: none; text-align: left; font-size: 14px; color: #52657b; }
.icd-tips li::before { content: "•"; margin-right: 8px; color: var(--rx-blue); }
.icd-state-link { display: flex; width: fit-content; margin: 0 auto; align-items: center; gap: 8px; font-weight: 650; font-size: 14px; color: var(--rx-blue); }
.icd-retry { margin-top: 16px; min-height: 40px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--rx-navy); color: white; font: inherit; font-weight: 650; cursor: pointer; }

[hidden] { display: none !important; }

@keyframes icd-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes icd-spin { to { transform: rotate(360deg); } }
@keyframes icd-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (max-width: 767px) {
    .icd-hero { padding: 24px 0 20px; }
    .icd-box input { font-size: 16px; padding: 13px 4px; }
    .icd-kbd, .icd-keys { display: none; }
    .icd-main { gap: 10px; padding: 12px 4px 12px 12px; }
    .icd-code { min-width: 54px; font-size: 13px; }
    .icd-text strong { font-size: 14.5px; }
    .icd-go { display: none; }
    .icd-copy { margin-right: 8px; padding: 0 10px; }
    .icd-copy span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .icd-item, .icd-spinner, .icd-skeleton i { animation: none; }
}
.icd-panel:has(#icd-results:empty) .icd-keys { display: none; }
.icd-panel .rx-popular { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 767px) { .icd-panel .rx-popular { grid-template-columns: minmax(0, 1fr); } }

/* Iklan afiliasi kini melayang via assets/css/ad-rail.css (lihat assets/js/ad-rail.js). */
@media (max-width: 767px) { .icd-console .rx-systems .system-tab:not(button) { flex: 1 0 auto; justify-content: center; } }
