/* Kazus sahifasi (cases_detail.html + cases_detail/*). Umumiy komponentlar: static/css/ui.css */

.cd { background: var(--ui-bg); }

/* ---------- tergov dosyesi (ixcham sarlavha) ---------- */
.cd-hero { position: relative; overflow: hidden; }
.cd-hero__ambient { position: absolute; inset: -30%; background: center / cover no-repeat; filter: blur(90px) saturate(1.3); opacity: .3; pointer-events: none; }
html[data-theme="light"] .cd-hero__ambient { opacity: .14; filter: blur(90px) saturate(1.6); }
.cd-hero__wrap { position: relative; z-index: 1; padding-top: 22px; padding-bottom: 28px; }

.cd-file { margin-top: 18px; display: grid; grid-template-columns: 300px minmax(0, 1fr) 260px; gap: 32px; align-items: center; }

/* kuzatuv kadri */
.cd-cam { position: relative; margin: 0; aspect-ratio: 16 / 11; border-radius: 16px; overflow: hidden; background: #0d1015; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 30px 60px -30px rgba(0,0,0,.9); }
html[data-theme="light"] .cd-cam { box-shadow: 0 24px 44px -26px rgba(15,23,42,.6); }
.cd-cam img { width: 100%; height: 100%; object-fit: cover; filter: contrast(1.08) saturate(.9); }
.cd-cam video { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; filter: contrast(1.08) saturate(.9); opacity: 0; transition: opacity .8s; }
.cd-cam video.is-on { opacity: 1; }
.cd-cam::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px); }
.cd-cam::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(0deg, rgba(7,8,11,.75) 0%, rgba(7,8,11,0) 40%, rgba(7,8,11,0) 75%, rgba(7,8,11,.45) 100%); }
.cd-cam__scan { position: absolute; z-index: 2; left: 0; right: 0; top: -30%; height: 30%; background: linear-gradient(180deg, rgba(229,50,45,0), rgba(229,50,45,.18), rgba(229,50,45,0)); animation: cd-scan 4.5s linear infinite; pointer-events: none; }
@keyframes cd-scan { from { top: -30%; } to { top: 100%; } }
.cd-cam__c { position: absolute; z-index: 2; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.7); }
.cd-cam__c--1 { left: 10px; top: 10px; border-right: 0; border-bottom: 0; }
.cd-cam__c--2 { right: 10px; top: 10px; border-left: 0; border-bottom: 0; }
.cd-cam__c--3 { left: 10px; bottom: 10px; border-right: 0; border-top: 0; }
.cd-cam__c--4 { right: 10px; bottom: 10px; border-left: 0; border-top: 0; }
.cd-cam__rec { position: absolute; z-index: 3; left: 34px; top: 13px; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .12em; color: #ff6b63; }
.cd-cam__rec::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #ff3b30; animation: ui-blink 1s infinite; }
.cd-cam__id { position: absolute; z-index: 3; left: 34px; bottom: 14px; font-size: 11px; letter-spacing: .14em; color: rgba(255,255,255,.88); }
.cd-cam__tag { position: absolute; z-index: 3; right: 34px; top: 11px; height: 22px; padding: 0 8px; border-radius: 6px; display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.cd-cam__tag.is-free { background: #3fb96b; color: #04130a; }
.cd-cam__tag.is-soon { background: #2563eb; }

/* ish ma‘lumoti */
.cd-file__code { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 11px; letter-spacing: .16em; color: var(--ui-dim); }
.cd-file__status { margin-left: 4px; display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--ui-chip); color: var(--ui-text-2); letter-spacing: .1em; }
.cd-file__status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cd-file__status.is-live { color: var(--ui-free-text); background: var(--ui-free-soft); }
.cd-file__status.is-live::before { animation: ui-blink 1.6s infinite; }
.cd-file__status.is-soon { color: #3b82f6; background: rgba(37,99,235,.14); }
.cd-file__status.is-done { color: var(--ui-gold); background: var(--ui-gold-soft); }
.cd-file__title { margin: 10px 0 0; font-family: Oswald, sans-serif; font-weight: 700; font-size: clamp(32px, 3.6vw, 50px); line-height: 1; text-transform: uppercase; color: var(--ui-heading); }
.cd-file__lead { margin: 10px 0 0; max-width: 560px; font-size: 15px; line-height: 1.6; color: var(--ui-muted); }
.cd-file__pills { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.cd-file__pills .ui-pill { background: var(--ui-panel); border: 1px solid var(--ui-line); }

/* narx va harakat */
.cd-file__act { display: grid; gap: 10px; padding-left: 28px; border-left: 1px solid var(--ui-line); }
.cd-file__act form { display: contents; }
.cd-file__label { margin: 0; font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ui-dim); }
.cd-file__sum { margin: -4px 0 4px; font-family: Oswald, sans-serif; font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--ui-gold); }
.cd-file__sum s { font-family: Inter, sans-serif; font-size: 13px; font-weight: 400; color: var(--ui-dim); margin-left: 4px; }
.cd-file__state { margin: -4px 0 4px; font-size: 18px; font-weight: 700; color: var(--ui-heading); }
.cd-file__state.is-free { color: var(--ui-free-text); }
.cd-file__note { margin: 0; font-size: 12px; line-height: 1.5; color: var(--ui-muted); }
.cd-file__note.is-gold { color: var(--ui-gold); font-weight: 600; }
.cd-file__note a { color: var(--ui-heading); font-weight: 600; text-decoration: none; }
.cd-soon { display: flex; align-items: center; justify-content: center; height: 46px; border-radius: 12px; background: rgba(37,99,235,.14); color: #3b82f6; font-size: 14px; font-weight: 700; }
html:not([data-theme="light"]) .cd-soon { color: #7aa7ff; }
.cd-disabled { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 46px; padding: 8px 14px; border-radius: 12px; border: 1px dashed var(--ui-line-strong); color: var(--ui-muted); font-size: 13px; font-weight: 600; }
.cd-notify.is-on { border-color: var(--ui-free-text); color: var(--ui-free-text); background: var(--ui-free-soft); }

/* ish ko‘rsatkichlari – terminal qatori */
.cd-stats { position: relative; z-index: 1; border-top: 1px solid var(--ui-line); background: color-mix(in srgb, var(--ui-panel) 55%, transparent); }
.cd-stats__row { margin: 0; display: flex; overflow-x: auto; scrollbar-width: none; }
.cd-stats__row::-webkit-scrollbar { display: none; }
.cd-stats__row > div { flex: 1 0 auto; display: flex; align-items: baseline; gap: 10px; padding: 14px 22px; border-right: 1px solid var(--ui-line); }
.cd-stats__row > div:first-child { padding-left: 0; }
.cd-stats__row > div:last-child { border-right: 0; }
.cd-stats dt { font-size: 10px; letter-spacing: .16em; color: var(--ui-dim); }
.cd-stats dd { margin: 0; font-size: 18px; font-weight: 700; color: var(--ui-heading); }

/* ---------- tablar (yopishqoq) ---------- */
.cd-tabs { position: sticky; top: 72px; z-index: 30; background: var(--ui-nav-bg); border-bottom: 1px solid var(--ui-line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.cd-tabs__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cd-tabs .ui-tabs { min-width: 0; margin-left: -14px; }
.cd-tabs__law { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--ui-line-strong); background: var(--ui-chip); color: var(--ui-text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.cd-tabs__law:hover { background: var(--ui-chip-hover); color: var(--ui-heading); }

/* ---------- maket ---------- */
.cd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; padding-top: 36px; padding-bottom: 80px; }
.cd-main { min-width: 0; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: cd-tab-in .4s ease both; }
@keyframes cd-tab-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.cd-h { margin: 0; font-family: Oswald, sans-serif; font-size: 30px; font-weight: 700; line-height: 1.1; text-transform: uppercase; color: var(--ui-heading); }
.cd-intro { margin: 12px 0 0; max-width: 680px; font-size: 15px; line-height: 1.7; color: var(--ui-muted); }
.cd-empty { margin: 0; color: var(--ui-dim); font-size: 14px; grid-column: 1 / -1; }
.cd-more { margin-top: 18px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ui-red); text-decoration: none; }
.cd-more:hover { color: var(--ui-heading); }

/* umumiy ma‘lumot */
.cd-h--spaced { margin-top: 36px; }
.cd-story { margin-top: 14px; max-width: 760px; font-size: 16px; line-height: 1.85; color: var(--ui-text-2); }
.cd-story p + p { margin-top: 12px; }
.cd-facts { border-radius: 18px; overflow: hidden; border: 1px solid var(--ui-line); background: var(--ui-panel); }
.cd-facts__head { margin: 0; display: flex; justify-content: space-between; padding: 11px 18px; border-bottom: 1px solid var(--ui-line); font-size: 11px; letter-spacing: .14em; color: var(--ui-dim); }
.cd-facts__head span:last-child { color: var(--ui-dim); }
.cd-facts dl { margin: 0; display: flex; flex-wrap: wrap; }
.cd-facts dl > div { flex: 1 1 170px; display: grid; align-content: start; gap: 4px; padding: 14px 18px; border-right: 1px solid var(--ui-line); border-bottom: 1px solid var(--ui-line); margin: 0 -1px -1px 0; }
.cd-facts dt { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ui-dim); }
.cd-facts dd { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--ui-heading); }

.cd-note { margin-top: 16px; display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 16px; background: var(--ui-panel); border: 1px solid var(--ui-line); color: var(--ui-muted); font-size: 14px; line-height: 1.65; }
.cd-note > svg { flex-shrink: 0; margin-top: 1px; color: var(--ui-dim); }
.cd-note p { margin: 0; }
.cd-note--accent { border-color: color-mix(in srgb, var(--ui-red) 35%, transparent); background: var(--ui-red-soft); color: var(--ui-text-2); }
.cd-note--accent > svg { color: var(--ui-red); }
.cd-note__title { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ui-heading); }
.cd-note__text { margin: 6px 0 0 !important; color: var(--ui-text-2); }
.cd-rich b, .cd-rich strong { color: var(--ui-heading); }
.cd-rich p + p { margin-top: 6px; }

/* dalillar */
.cd-ev-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cd-ev { padding: 14px; border-radius: 16px; background: var(--ui-panel); border: 1px solid var(--ui-line); transition: border-color .2s, transform .2s; }
.cd-ev:hover { border-color: var(--ui-line-strong); transform: translateY(-2px); }
.cd-ev__top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; letter-spacing: .1em; color: var(--ui-dim); }
.cd-ev__ic { margin-top: 14px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--ui-chip); color: var(--ui-text-2); }
.cd-ev__title { margin: 14px 0 0; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ui-heading); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cd-ev__type { margin: 6px 0 0; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ui-dim); }

/* ro‘yxat qatorlari (hujjatlar, ekspertiza, yo‘nalishlar, qonunlar) */
.cd-rows { margin-top: 24px; display: grid; gap: 10px; }
.cd-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--ui-panel); border: 1px solid var(--ui-line); text-decoration: none; }
.cd-row--top { align-items: flex-start; }
.cd-row--link:hover { border-color: var(--ui-line-strong); }
.cd-row__ic { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--ui-chip); color: var(--ui-text-2); }
.cd-row__num { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--ui-chip); color: var(--ui-text-2); font-size: 13px; font-weight: 700; }
.cd-row__body { flex: 1; min-width: 0; }
.cd-row__title { margin: 0; font-size: 15px; font-weight: 600; color: var(--ui-heading); }
.cd-row__meta { margin: 4px 0 0; font-size: 13px; line-height: 1.55; color: var(--ui-muted); }
.cd-row__lock, .cd-row__go { flex-shrink: 0; color: var(--ui-dim); }
.cd-row__tag { flex-shrink: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ui-dim); }

/* guvoh / gumondor */
.cd-people { margin-top: 24px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cd-person { position: relative; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; background: #12141a; border: 1px solid rgba(255,255,255,.1); }
.cd-person img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; transition: transform .8s ease; }
.cd-person:hover img { transform: scale(1.05); }
.cd-person::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(7,8,11,.95) 0%, rgba(7,8,11,.2) 50%, rgba(7,8,11,0) 70%); }
.cd-person__empty { position: absolute; inset: 0; display: grid; place-items: center; color: #6c7380; font-size: 13px; }
.cd-person__body { position: absolute; z-index: 1; left: 14px; right: 14px; bottom: 14px; }
.cd-person__name { margin: 0; font-size: 15px; font-weight: 700; color: #fff; }
.cd-person__role { margin: 2px 0 0; font-size: 12px; color: #aab0bb; }
.cd-person__tag { margin-top: 8px; display: inline-flex; height: 22px; padding: 0 8px; align-items: center; border-radius: 6px; background: rgba(255,255,255,.12); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #cfd3da; }

/* qoidalar */
.cd-rules { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cd-rule { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 16px; background: var(--ui-panel); border: 1px solid var(--ui-line); }
.cd-rule__ic { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--ui-chip); color: var(--ui-text-2); }
.cd-rule__label { margin: 0; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ui-dim); }
.cd-rule__value { margin: 4px 0 0; font-size: 16px; font-weight: 700; color: var(--ui-heading); }
.cd-rule__note { margin: 4px 0 0; font-size: 13px; line-height: 1.55; color: var(--ui-muted); }

/* o‘z xulosangiz */
.cd-guess { margin-top: 24px; display: grid; gap: 12px; max-width: 720px; }
.cd-guess__label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ui-dim); }
.cd-guess .ui-btn { justify-self: start; }
.cd-guess__saved { margin: 0; font-size: 13px; color: var(--ui-free-text); }
.cd-guess.hidden, .cd-guess__saved.hidden { display: none; }
.cd-guess .cd-note { margin-top: 0; }

/* ---------- o‘ng panel ---------- */
.cd-side { position: sticky; top: 140px; display: grid; gap: 14px; }
.cd-card { padding: 20px; border-radius: 20px; background: var(--ui-panel); border: 1px solid var(--ui-line); }
.cd-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cd-card__head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ui-heading); }
.cd-card__head h2 svg { color: var(--ui-gold); }
.cd-card__head > span { font-size: 14px; color: var(--ui-red); font-weight: 700; }
.cd-card__sub { margin: 6px 0 0; font-size: 13px; color: var(--ui-muted); }
.cd-card__text { margin: 10px 0 0; font-size: 13px; line-height: 1.6; color: var(--ui-muted); }
.cd-bar { margin-top: 10px; height: 6px; border-radius: 3px; background: var(--ui-chip-hover); overflow: hidden; }
.cd-bar > div { height: 100%; border-radius: 3px; background: var(--ui-red); transition: width .5s ease; }
.cd-steps { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.cd-steps li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: 13px; color: var(--ui-dim); }
.cd-steps .step-num { font-size: 11px; width: 20px; }
.cd-steps .step-text { flex: 1; line-height: 1.35; }
.cd-steps li.is-done { color: var(--ui-text-2); }
.cd-steps li.is-done .step-num, .cd-steps li.is-done .step-check { color: var(--ui-red); }
.cd-steps li.is-current { background: var(--ui-red-soft); color: var(--ui-heading); font-weight: 600; }
.cd-steps li.is-current .step-num { color: var(--ui-red); }
.cd-side__cta .ui-btn { width: 100%; }

/* ---------- qonunchilik oynasi ---------- */
.cd-modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cd-modal.hidden { display: none; }
.cd-modal__box { width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto; padding: 26px; border-radius: 22px; background: var(--ui-bg); border: 1px solid var(--ui-line-strong); box-shadow: var(--ui-shadow); }
.cd-modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.cd-modal__head .ui-h3 { margin-top: 6px; }
.cd-modal__foot { margin: 18px 0 0; font-size: 12px; font-style: italic; line-height: 1.6; color: var(--ui-dim); }

/* ---------- moslashuvchanlik ---------- */
@media (max-width: 1100px) {
  .cd-layout { grid-template-columns: 1fr; }
  .cd-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .cd-side__cta { display: none; }
  .cd-ev-grid, .cd-people { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .cd-file { grid-template-columns: 240px minmax(0, 1fr); }
  .cd-file__act { grid-column: 1 / -1; padding-left: 0; border-left: 0; padding-top: 18px; border-top: 1px solid var(--ui-line); grid-template-columns: auto auto 1fr; align-items: center; column-gap: 16px; }
  .cd-file__act .ui-btn { grid-column: -2 / -1; justify-self: end; width: auto; }
}
@media (max-width: 700px) {
  .cd-file { grid-template-columns: 1fr; gap: 18px; }
  .cd-cam { aspect-ratio: 16 / 8; }
  .cd-file__act { display: grid; grid-template-columns: 1fr; }
  .cd-file__act .ui-btn { justify-self: stretch; width: 100%; }
  .cd-stats__row > div { padding: 12px 16px; }
}
@media (max-width: 640px) {
  .cd-tabs { top: 72px; }
  .cd-tabs__law { width: 38px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  .cd-layout { padding-top: 28px; padding-bottom: 56px; }
  .cd-h { font-size: 24px; }
  .cd-ev-grid, .cd-people { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cd-rules { grid-template-columns: 1fr; }
  .cd-side { grid-template-columns: 1fr; }
  .cd-row__tag { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tab-panel.active { animation: none; }
  .cd-cam__scan, .cd-cam__rec::before, .cd-file__status::before { animation: none; }
  .cd-person img, .cd-ev { transition: none; }
}
