/* ═══════════════════════════════════════════════════════════════
   Patent Portal — Public Stylesheet v2
   Government style: #003366 dark blue, #c9a227 gold
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset & base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-dark:  #003366;
  --blue-mid:   #1a3c6e;
  --blue-light: #e8eef6;
  --gold:       #c9a227;
  --gold-light: #f5e8b0;
  --white:      #ffffff;
  --gray-bg:    #f5f5f5;
  --gray-light: #e0e3e8;
  --gray-mid:   #888;
  --gray-text:  #333;
  --red:        #c0392b;
  --green:      #1a7a3c;
  --radius:     2px;
  --shadow:     0 1px 4px rgba(0,0,0,.1);
  --shadow-md:  0 3px 12px rgba(0,0,0,.15);
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'PT Sans', 'Open Sans', 'Segoe UI', Arial, sans-serif;
  color: var(--gray-text);
  background: var(--gray-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--blue-dark); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--blue-mid); }
img { max-width: 100%; }
ul { list-style: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-block; padding: .5rem 1.2rem; font-size: .9rem;
  font-weight: 600; border: 2px solid transparent; cursor: pointer;
  border-radius: var(--radius); transition: background .15s, color .15s, border-color .15s;
  text-align: center; line-height: 1.4; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue-dark); color: var(--white); border-color: var(--blue-dark); }
.btn-primary:hover { background: var(--blue-mid); border-color: var(--blue-mid); color: var(--white); }
.btn-outline { background: transparent; color: var(--blue-dark); border-color: var(--blue-dark); }
.btn-outline:hover { background: var(--blue-dark); color: var(--white); }
.btn-sm { padding: .3rem .75rem; font-size: .82rem; }
.btn-block { display: block; width: 100%; }

/* ── Badges / Status ─────────────────────────────────────────── */
.badge {
  display: inline-block; padding: .2em .65em; font-size: .73rem;
  font-weight: 700; border-radius: 2px; letter-spacing: .02em; white-space: nowrap;
}
.badge-sm { font-size: .68rem; padding: .15em .5em; }
.badge-lg { font-size: .8rem; padding: .25em .8em; }

/* Distinct status colors */
.status-active      { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.status-nodata      { background: #e9ecef; color: #495057; border: 1px solid #ced4da; }
.status-warn        { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.status-restorable  { background: #cce5ff; color: #004085; border: 1px solid #b8daff; }
.status-expired     { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.badge-warn         { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert { padding: .85rem 1.1rem; border-left: 4px solid; margin-bottom: 1.25rem; border-radius: var(--radius); font-size: .93rem; }
.alert-success { background: #d4edda; border-color: var(--green); color: #155724; }
.alert-error   { background: #f8d7da; border-color: var(--red);   color: #721c24; }
.alert-info    { background: #d1ecf1; border-color: #0c7090;      color: #0c5460; }
.alert ul { padding-left: 1.2em; list-style: disc; }

/* ═══════════════════════════════════════════════════════════════
   SITE HEADER
   ═══════════════════════════════════════════════════════════════ */
.site-header {
  background: var(--blue-dark); color: var(--white);
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; padding-top: .7rem; padding-bottom: .7rem; }
.header-brand { display: flex; align-items: center; gap: .85rem; flex: 1; min-width: 0; }
.header-title { display: flex; flex-direction: column; min-width: 0; }

/* ── ЛОГОТИП — УВЕЛИЧЕН ── */
.header-emblem img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* ── ГЛАВНЫЙ ЗАГОЛОВОК — УВЕЛИЧЕН ── */
.site-name {
  color: var(--white); font-size: 1.55rem; font-weight: 700; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none;
}
.site-name:hover { color: var(--gold); text-decoration: none; }

/* ── ПОДЗАГОЛОВКИ — УМЕНЬШЕНЫ ── */
.site-subtitle {
  font-size: .62rem;
  color: rgba(255,255,255,.72);
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.5;
}

.header-search { display: flex; gap: 0; flex-shrink: 0; }
.header-search input {
  padding: .42rem .85rem; border: none; border-radius: var(--radius) 0 0 var(--radius);
  font-size: .88rem; width: 250px; outline: none; background: rgba(255,255,255,.95); color: var(--gray-text);
}
.header-search button {
  padding: .42rem .9rem; background: var(--gold); color: var(--blue-dark);
  border: none; border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer; font-size: 1rem; font-weight: bold; transition: background .15s;
}
.header-search button:hover { background: #b8901f; }

.main-nav { background: var(--blue-mid); border-top: 1px solid rgba(255,255,255,.1); }
.main-nav .container { padding-top: 0; padding-bottom: 0; }
.main-nav ul { display: flex; }
.main-nav ul li a {
  display: block; padding: .6rem 1.25rem; color: rgba(255,255,255,.85);
  font-size: .88rem; font-weight: 600; text-decoration: none;
  border-bottom: 3px solid transparent; transition: color .15s, border-color .15s, background .15s;
}
.main-nav ul li a:hover,
.main-nav ul li a.active { color: var(--white); border-bottom-color: var(--gold); background: rgba(255,255,255,.06); }

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════ */
.main-content { flex: 1; }
/* Homepage: banner is full-width, other content gets padding */
.main-content > .container { padding-top: 1.5rem; padding-bottom: 2rem; }

.breadcrumb {
  display: flex; align-items: center; gap: .5rem; font-size: .82rem;
  color: var(--gray-mid); margin-bottom: 1.5rem; flex-wrap: wrap;
}
.breadcrumb a { color: var(--blue-dark); }
.breadcrumb span:last-child { color: var(--gray-text); }

/* ═══════════════════════════════════════════════════════════════
   PATENT CAROUSEL  (homepage «Ихтирооти ҷолиб»)
   ═══════════════════════════════════════════════════════════════ */

/* ── Section wrapper ─────────────────────────────────────────── */
.patent-carousel-section {
  background: var(--blue-dark);
  color: var(--white);
  border: 3px solid #003366
}

/* ── Header bar (title + CTA button) ────────────────────────── */
.carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-wrap: wrap;
  gap: .5rem;
}
.carousel-heading { display: flex; align-items: baseline; gap: .65rem; }
.carousel-heading-tj {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
}
.carousel-heading-ru {
  font-size: .8rem;
  color: rgba(255,255,255,.5);
}
.carousel-search-btn {
  display: inline-block;
  padding: .45rem 1.2rem;
  background: var(--gold);
  color: var(--blue-dark);
  font-weight: 700;
  font-size: .85rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background .15s;
  white-space: nowrap;
}
.carousel-search-btn:hover {
  background: #e0b430;
  text-decoration: none;
  color: var(--blue-dark);
}

/* ── Carousel container ──────────────────────────────────────── */
.patent-carousel {
  position: relative;
  overflow: hidden;
}

.pc-track {
  display: flex;
  transition: transform .45s cubic-bezier(.4,0,.2,1);
}

/* Default: only active slide visible */
.pc-slide {
  display: none;
  min-width: 100%;
}
.pc-slide--active { display: block; }
/* After JS initialises: all slides in flex row, transform scrolls */
.pc-track.pc--ready .pc-slide {
  display: block;
  min-width: 100%;
}

/* ── Slide inner: horizontal two-column ──────────────────────── */
.pc-inner {
  display: flex;
  height: 340px;        /* Поставь ту высоту, которая тебе кажется идеальной (например, от 320px до 360px) */
  min-height: 340px;
  max-height: 340px;
  overflow: hidden;     /* Гарантия безопасности размера слайда */
}

/* Left column — image (~42%) */
.pc-photo {
  width: 40%;           /* Установи нужную тебе ширину в процентах (например, 40% или 42%) */
  flex-shrink: 0;       /* КРИТИЧЕСКИ ВАЖНО: запрещает большой картинке растягивать этот блок */
  min-width: 40%;       /* Дублируем, чтобы флекс-бокс не игнорировал ширину */
  position: relative;
  background: #ffffff;  /* Белый фон, чтобы под чертежами больших патентов не было пустоты */
  overflow: hidden;     /* Если что-то пойдет не так, картинка просто обрежется, но не сломает слайд */
}

.pc-photo img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  /* ГЛАВНОЕ СВОЙСТВО: картинка пропорционально сжимается и вписывается в блок,
     не растягивая и не деформируя сам слайд */
  object-fit: contain;
  display: block;
}

.pc-photo--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0,0,0,.2), rgba(0,51,102,.3));
}
.pc-photo-icon {
  font-size: 5rem;
  opacity: .3;
}

/* Right column — patent info (~58%) */
.pc-info {
  flex: 1;
  padding: 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .7rem;
  overflow: hidden;
}
.pc-doc-num {
  display: inline-block;
  align-self: flex-start;
  font-family: 'Courier New', monospace;
  font-size: .78rem;
  color: var(--gold);
  background: rgba(201,162,39,.15);
  border: 1px solid rgba(201,162,39,.3);
  padding: .15em .65em;
  border-radius: 2px;
  letter-spacing: .04em;
}
.pc-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.35;
  margin: 0;
}
.pc-abstract {
  font-size: .87rem;
  color: rgba(255,255,255,.75);
  line-height: 1.65;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}
.pc-more-link {
  display: inline-block;
  align-self: flex-start;
  font-size: .87rem;
  font-weight: 600;
  color: var(--gold);
  border-bottom: 1px solid rgba(201,162,39,.4);
  padding-bottom: .1rem;
  text-decoration: none;
  transition: color .12s, border-color .12s;
}
.pc-more-link:hover {
  color: #f0c040;
  border-color: #f0c040;
  text-decoration: none;
}

/* ── Navigation buttons ──────────────────────────────────────── */
.pc-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(0,0,0,.4);
  color: var(--white);
  border: 2px solid rgba(255,255,255,.2);
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background .15s, border-color .15s;
}
.pc-btn:hover {
  background: rgba(201,162,39,.7);
  border-color: var(--gold);
}
.pc-btn--prev { left: .75rem; }
.pc-btn--next { right: .75rem; }

/* ── Dot indicators ──────────────────────────────────────────── */
.pc-dots {
  position: absolute;
  bottom: .65rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .4rem;
  z-index: 10;
}
.pc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  border: none;
  cursor: pointer;
  transition: background .15s, transform .15s;
  padding: 0;
}
.pc-dot--active {
  background: var(--gold);
  transform: scale(1.35);
}

/* ── Fallback (no slides) ────────────────────────────────────── */
.pc-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 2rem;
  background: rgba(0,0,0,.15);
}
.pc-fallback-inner { text-align: center; }
.pc-fallback-icon  { font-size: 2.5rem; opacity: .5; margin-bottom: .5rem; }
.pc-fallback-text  { font-size: .9rem; color: rgba(255,255,255,.6); }
.pc-fallback-text a { color: var(--gold); }

/* ─── Stats / Info / Recent ──────────────────────────────────── */
.stats-strip {
  margin: 24px 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--white); border-bottom: 1px solid var(--gray-light);
  box-shadow: var(--shadow);
}
.stat-item   { flex: 1; text-align: center; padding: 1.1rem 1rem; }
.stat-number { display: block; font-size: 1.9rem; font-weight: 700; color: var(--blue-dark); line-height: 1.1; }
.stat-label  { font-size: .72rem; color: var(--gray-mid); text-transform: uppercase; letter-spacing: .04em; }
.stat-divider{ width: 1px; background: var(--gray-light); align-self: stretch; }

.home-info-grid {
  max-width: 1200px; margin: 1.75rem auto; padding: 0 1.25rem;
  display: grid; grid-template-columns: repeat(3,1fr); gap: 1.25rem;
}
.info-card {
  background: var(--white); border: 1px solid var(--gray-light);
  border-top: 3px solid var(--blue-dark); padding: 1.4rem;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.info-icon { font-size: 1.6rem; margin-bottom: .5rem; }
.info-card h3 { font-size: .95rem; color: var(--blue-dark); font-weight: 700; margin-bottom: .4rem; }
.info-card p  { font-size: .85rem; color: var(--gray-text); margin-bottom: .85rem; }
.info-link    { font-size: .83rem; font-weight: 600; color: var(--blue-dark); }
.info-link:hover { color: var(--gold); }

.home-recent  { max-width: 1200px; margin: 0 auto 2rem; padding: 0 1.25rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.1rem; }
.section-header h2 { font-size: 1.1rem; color: var(--blue-dark); font-weight: 700; }

/* Admin: form-section-label */
.form-section-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--blue-dark);
  padding: .6rem 0 .25rem;
  border-bottom: 1px solid var(--gray-light);
  margin-bottom: .75rem;
  margin-top: .5rem;
}

/* ═══════════════════════════════════════════════════════════════
   PATENT CARDS — grid view
   ═══════════════════════════════════════════════════════════════ */
.patents-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1.1rem;
}
.patent-card {
  background: var(--white); border: 1px solid var(--gray-light); border-left: 4px solid var(--blue-dark);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column; transition: box-shadow .15s, border-color .15s;
}
.patent-card:hover { box-shadow: var(--shadow-md); border-left-color: var(--gold); }

.card-img-wrap  { height: 140px; overflow: hidden; background: var(--blue-light); }
.card-img       { width: 100%; height: 100%; object-fit: cover; }
.card-body      { padding: .9rem 1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.card-num       { font-size: .74rem; color: var(--gray-mid); font-family: monospace; }
.card-header    { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.card-title     { font-size: .9rem; font-weight: 700; line-height: 1.35; }
.card-title a   { color: var(--blue-dark); }
.card-title a:hover { color: var(--gold); text-decoration: none; }
.card-meta      { font-size: .78rem; color: var(--gray-text); }
.card-date      { font-size: .75rem; color: var(--gray-mid); }
.card-abstract  { font-size: .8rem; color: var(--gray-text); line-height: 1.5; flex: 1; }
.card-more      { font-size: .8rem; font-weight: 600; color: var(--blue-dark); margin-top: .3rem; align-self: flex-start; }
.card-more:hover { color: var(--gold); }
.card-mpk       { font-family: monospace; background: var(--blue-light); padding: .1em .4em; border-radius: 2px; font-size: .75rem; }
.card-dates     { font-size: .75rem; color: var(--gray-mid); display: flex; gap: .6rem; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════
   SEARCH PAGE — list view (default)
   ═══════════════════════════════════════════════════════════════ */
.search-page {
  display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; align-items: start;
  max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem;
}
.search-sidebar {
  background: var(--white); border: 1px solid var(--gray-light);
  border-top: 3px solid var(--blue-dark); padding: 1.1rem;
  border-radius: var(--radius); box-shadow: var(--shadow);
  position: sticky; top: 80px;
}
.sidebar-title { font-size: .95rem; font-weight: 700; color: var(--blue-dark); margin-bottom: .85rem; padding-bottom: .45rem; border-bottom: 1px solid var(--gray-light); }

.filter-group { border: none; margin-bottom: .35rem; }
.filter-group summary {
  font-size: .82rem; font-weight: 700; color: var(--blue-mid);
  cursor: pointer; padding: .35rem 0; list-style: none;
  display: flex; align-items: center; gap: .35rem; user-select: none;
}
.filter-group summary::-webkit-details-marker { display: none; }
.filter-group summary::before { content: '▶'; font-size: .6rem; transition: transform .15s; }
.filter-group[open] summary::before { transform: rotate(90deg); }
.filter-group > div { padding-top: .3rem; }

.search-actions { display: flex; flex-direction: column; gap: .5rem; margin-top: .85rem; }

.form-group { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .6rem; }
.form-group label { font-size: .78rem; font-weight: 600; color: var(--gray-text); }
.form-group input, .form-group select, .form-group textarea {
  padding: .38rem .6rem; border: 1px solid #ccc; border-radius: var(--radius);
  font-size: .85rem; font-family: inherit; background: var(--white); color: var(--gray-text);
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--blue-dark); box-shadow: 0 0 0 2px rgba(0,51,102,.1);
}
.form-group textarea { resize: vertical; }
.form-row { display: flex; gap: .65rem; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 110px; }

/* Search results header */
.results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .85rem; }
.results-count { font-size: .88rem; color: var(--gray-text); }
.results-count strong { color: var(--blue-dark); font-size: 1rem; }
.results-view-toggle { display: flex; gap: .2rem; }
.view-btn {
  background: none; border: 1px solid var(--gray-light); padding: .28rem .55rem;
  cursor: pointer; border-radius: var(--radius); font-size: .95rem; color: var(--gray-mid);
  transition: background .12s, color .12s;
}
.view-btn.active { background: var(--blue-dark); color: var(--white); border-color: var(--blue-dark); }

/* Patent list (default search view) */
.patents-list { display: flex; flex-direction: column; gap: .85rem; }
/* Grid override via JS */
.patents-list.grid-view {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1rem;
}

.patent-list-item {
  background: var(--white); border: 1px solid var(--gray-light); border-left: 4px solid var(--blue-dark);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  display: flex; gap: 0; transition: box-shadow .15s, border-color .15s;
}
.patent-list-item:hover { box-shadow: var(--shadow-md); border-left-color: var(--gold); }

.list-item-img-wrap {
  width: 110px; min-height: 100px; flex-shrink: 0; overflow: hidden;
  background: var(--blue-light); display: flex; align-items: center; justify-content: center;
}
.list-item-img     { width: 100%; height: 100%; object-fit: cover; }
.list-item-no-img  { font-size: 2rem; color: rgba(0,51,102,.25); }

.list-item-body    { flex: 1; padding: .85rem 1rem; display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.list-item-meta    { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .75rem; }
.list-item-title   { font-size: .95rem; font-weight: 700; line-height: 1.3; }
.list-item-title a { color: var(--blue-dark); }
.list-item-title a:hover { color: var(--gold); text-decoration: none; }
.list-item-details { display: flex; flex-direction: column; gap: .15rem; }
.detail-field      { font-size: .78rem; color: var(--gray-text); }
.field-code        { color: var(--gray-mid); font-family: monospace; margin-right: .25rem; }
.list-item-abstract{ font-size: .82rem; color: var(--gray-text); line-height: 1.5; }
.card-date         { font-size: .75rem; color: var(--gray-mid); }

/* Grid mode for list items */
.patents-list.grid-view .patent-list-item { flex-direction: column; }
.patents-list.grid-view .list-item-img-wrap { width: 100%; height: 140px; min-height: 140px; }

/* Placeholder */
.results-placeholder { text-align: center; padding: 3.5rem 2rem; background: var(--white); border: 1px solid var(--gray-light); border-radius: var(--radius); }
.placeholder-icon { font-size: 2.75rem; margin-bottom: .85rem; }
.results-placeholder h3 { font-size: 1.05rem; color: var(--blue-dark); margin-bottom: .4rem; }
.results-placeholder p  { color: var(--gray-mid); font-size: .88rem; margin-bottom: 1rem; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: .25rem; margin-top: 1.5rem; flex-wrap: wrap; }
.page-link {
  display: inline-block; padding: .32rem .65rem; font-size: .83rem;
  border: 1px solid var(--gray-light); color: var(--blue-dark); border-radius: var(--radius);
  transition: background .12s, color .12s; text-decoration: none; min-width: 2rem; text-align: center;
}
.page-link:hover { background: var(--blue-dark); color: var(--white); text-decoration: none; }
.page-link.active { background: var(--blue-dark); color: var(--white); border-color: var(--blue-dark); pointer-events: none; }
.page-ellipsis { color: var(--gray-mid); padding: .32rem .3rem; font-size: .83rem; }

/* ═══════════════════════════════════════════════════════════════
   PATENT DETAIL PAGE
   ═══════════════════════════════════════════════════════════════ */
.patent-detail {
  background: var(--white); border: 1px solid var(--gray-light);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}

.patent-detail-header { background: var(--blue-dark); color: var(--white); padding: 1.5rem 2rem; }
.patent-header-meta { display: flex; align-items: center; gap: .6rem; margin-bottom: .65rem; flex-wrap: wrap; }
.doc-number { font-family: monospace; font-size: .85rem; background: rgba(255,255,255,.15); padding: .15em .6em; border-radius: 2px; color: var(--white); }
.doc-type-badge { font-family: monospace; font-size: .82rem; background: rgba(201,162,39,.25); color: var(--gold); padding: .15em .6em; border-radius: 2px; border: 1px solid rgba(201,162,39,.4); }
.patent-detail-header h1 { font-size: 1.35rem; font-weight: 700; line-height: 1.35; color: var(--white); }
.header-mpk { font-size: .82rem; color: rgba(255,255,255,.65); margin-top: .4rem; }

.patent-body { padding: 1.5rem 2rem; }

/* Top layout: image + fields */
.patent-top-layout { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; align-items: flex-start; }
.patent-main-image { flex-shrink: 0; }
.patent-main-image img {
  max-width: 280px; max-height: 210px; object-fit: contain;
  border: 1px solid var(--gray-light); border-radius: var(--radius); box-shadow: var(--shadow);
}

.fields-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 1rem; flex: 1; }
.fields-with-image { grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); }

.field-group { background: var(--gray-bg); border: 1px solid var(--gray-light); border-radius: var(--radius); padding: .85rem 1rem; }
.field-group-title {
  font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--blue-dark); margin-bottom: .5rem; padding-bottom: .35rem; border-bottom: 1px solid var(--gray-light);
}
.field-list { display: flex; flex-direction: column; gap: .25rem; }
.field-row { display: flex; gap: .5rem; font-size: .83rem; }
.field-row dt { min-width: 175px; color: var(--gray-mid); flex-shrink: 0; font-size: .8rem; }
.field-row dd { color: var(--gray-text); font-weight: 500; word-break: break-word; }

/* Other priorities table */
.table-wrap-inline { overflow-x: auto; margin-top: .5rem; }
.priorities-table { border-collapse: collapse; font-size: .85rem; width: auto; min-width: 400px; }
.priorities-table th { background: var(--blue-light); color: var(--blue-dark); font-size: .78rem; padding: .5rem .85rem; text-align: left; border: 1px solid var(--gray-light); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.priorities-table td { padding: .45rem .85rem; border: 1px solid var(--gray-light); font-size: .84rem; }
.priorities-table tr:nth-child(even) td { background: var(--gray-bg); }

/* Text sections */
.text-section { margin-bottom: 1.5rem; border-top: 1px solid var(--gray-light); padding-top: 1.1rem; }
.text-section h2 { font-size: .88rem; font-weight: 700; color: var(--blue-dark); margin-bottom: .6rem; text-transform: uppercase; letter-spacing: .05em; }
.text-content { font-size: .9rem; line-height: 1.75; color: var(--gray-text); }
.text-content.formula { font-family: 'Courier New', monospace; background: var(--gray-bg); padding: .85rem 1rem; border-radius: var(--radius); border: 1px solid var(--gray-light); font-size: .84rem; }

/* Files */
.files-section { margin-bottom: 1.25rem; border-top: 1px solid var(--gray-light); padding-top: 1.1rem; }
.files-section h2 { font-size: .88rem; font-weight: 700; color: var(--blue-dark); margin-bottom: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.files-list { display: flex; flex-direction: column; gap: .45rem; }
.file-item { display: flex; align-items: center; gap: .75rem; padding: .6rem .9rem; background: var(--gray-bg); border: 1px solid var(--gray-light); border-radius: var(--radius); }
.file-icon { font-size: 1.3rem; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { display: block; font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: .73rem; color: var(--gray-mid); }

.patent-detail-footer {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  padding: .95rem 2rem; background: var(--gray-bg); border-top: 1px solid var(--gray-light);
  font-size: .78rem; color: var(--gray-mid);
}
.not-found { padding: 3rem 0; text-align: center; }
.not-found h2 { color: var(--blue-dark); margin-bottom: 1rem; }

/* ═══════════════════════════════════════════════════════════════
   ABOUT PAGE
   ═══════════════════════════════════════════════════════════════ */
.about-page { max-width: 800px; }
.about-page h1 { font-size: 1.5rem; color: var(--blue-dark); margin-bottom: 1.4rem; padding-bottom: .65rem; border-bottom: 2px solid var(--blue-dark); }
.about-content section { margin-bottom: 1.6rem; }
.about-content h2 { font-size: .9rem; font-weight: 700; color: var(--blue-dark); margin-bottom: .5rem; text-transform: uppercase; letter-spacing: .04em; }
.about-content p { margin-bottom: .55rem; font-size: .91rem; line-height: 1.7; }
.about-content ul { padding-left: 1.25rem; list-style: disc; }
.about-content ul li { font-size: .91rem; margin-bottom: .4rem; line-height: 1.6; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; font-size: .88rem; }
.contact-item { background: var(--gray-bg); padding: .8rem 1rem; border-radius: var(--radius); border: 1px solid var(--gray-light); }
.about-actions { display: flex; gap: 1rem; margin-top: 2rem; }

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.site-footer { background: var(--blue-dark); color: rgba(255,255,255,.75); padding: 1.5rem 0; margin-top: auto; font-size: .83rem; }
.footer-inner { display: flex; align-items: flex-start; gap: 2rem; flex-wrap: wrap; }
.footer-brand { flex: 1; min-width: 200px; }
.footer-brand strong { display: block; color: var(--white); margin-bottom: .2rem; }
.footer-brand small  { color: rgba(255,255,255,.5); font-size: .74rem; }
.footer-nav { display: flex; flex-direction: column; gap: .3rem; }
.footer-nav a { color: rgba(255,255,255,.7); }
.footer-nav a:hover { color: var(--gold); text-decoration: none; }
.footer-copy { width: 100%; color: rgba(255,255,255,.4); font-size: .74rem; padding-top: .85rem; border-top: 1px solid rgba(255,255,255,.1); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .search-page { grid-template-columns: 1fr; padding: 1rem; }
  .search-sidebar { position: static; }
  .home-info-grid { grid-template-columns: 1fr 1fr; }
  .pc-inner  { flex-direction: column; max-height: none; }
  .pc-photo  { width: 100%; height: 200px; }
  .pc-info   { padding: 1.25rem 1.5rem; }
  .patent-top-layout { flex-direction: column; }
  .patent-main-image img { max-width: 100%; }
}
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; }
  .header-search input { width: 150px; }
  .home-info-grid { grid-template-columns: 1fr; }
  .patents-grid { grid-template-columns: 1fr; }
  .stats-strip {
  margin: 24px 0; flex-direction: column; }
  .stat-divider { width: 100%; height: 1px; }
  .carousel-header { flex-direction: column; align-items: flex-start; }
  .pc-photo  { height: 160px; }
  .pc-info   { padding: 1rem 1.25rem; }
  .pc-title  { font-size: 1rem; }
  .pc-btn    { width: 36px; height: 36px; font-size: 1.3rem; }
  .patent-detail-header { padding: 1.1rem; }
  .patent-body { padding: 1.1rem; }
  .field-row { flex-direction: column; gap: .1rem; }
  .field-row dt { min-width: unset; }
  .contact-grid { grid-template-columns: 1fr; }
  .patent-detail-footer { flex-direction: column; }
}

/* ── Vertical patent list (homepage «Ихтирооти ҷолиб») ─────────── */
.pc-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 0 8px;
}

.pc-item {
    background: #fff;
    border: 2px solid #e8edf5;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s;
}

.pc-item:hover {
    box-shadow: 0 4px 20px rgba(0,51,102,.12);
    border-color: #c9a227;
}

.pc-item .pc-inner {
    display: flex;
    flex-direction: row;
    min-height: 180px;
}

.pc-item .pc-photo {
    width: 42%;
    flex-shrink: 0;
    overflow: hidden;
    background: #f0f4fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pc-item .pc-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pc-item .pc-photo--empty {
    color: #bbb;
    font-size: 3rem;
}

.pc-item .pc-info {
    width: 58%;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.pc-item .pc-doc-num {
    font-size: .8rem;
    font-weight: 700;
    color: #c9a227;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.pc-item .pc-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #003366;
    margin: 0;
    line-height: 1.35;
}

.pc-item .pc-abstract {
    font-size: .88rem;
    color: #444;
    line-height: 1.55;
    margin: 0;
}

.pc-item .pc-more-link {
    display: inline-block;
    margin-top: 4px;
    font-size: .85rem;
    font-weight: 600;
    color: #003366;
    text-decoration: none;
    border-bottom: 1px solid #c9a227;
}

.pc-item .pc-more-link:hover {
    color: #c9a227;
}

@media (max-width: 600px) {
    .pc-item .pc-inner { flex-direction: column; }
    .pc-item .pc-photo { width: 100%; height: 180px; }
    .pc-item .pc-info  { width: 100%; padding: 14px 16px; }
}

/* ── Vertical patent list (homepage «Ихтирооти ҷолиб») ─────────── */
.pc-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 0 4px;
}

.pc-item {
    background: #fff;
    border: 1px solid #dce4f0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s;
}

.pc-item:hover {
    box-shadow: 0 3px 14px rgba(0,51,102,.10);
    border-color: #c9a227;
}

.pc-item .pc-inner {
    display: flex;
    flex-direction: row;
    min-height: 130px;
    max-height: 160px;
}

.pc-item .pc-photo {
    width: 35%;
    order: 2;
    flex-shrink: 0;
    overflow: hidden;
    background: #f0f4fa;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 160px;
}

.pc-item .pc-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pc-item .pc-photo--empty {
    color: #bbb;
    font-size: 2rem;
}

.pc-item .pc-info {
    width: 65%;
    order: 1;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.pc-item .pc-doc-num {
    font-size: .72rem;
    font-weight: 700;
    color: #c9a227;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.pc-item .pc-title {
    font-size: .92rem;
    font-weight: 700;
    color: #003366;
    margin: 0;
    line-height: 1.3;
}

.pc-item .pc-abstract {
    font-size: .78rem;
    color: #555;
    line-height: 1.45;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pc-item .pc-more-link {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    color: #003366;
    text-decoration: none;
    border-bottom: 1px solid #c9a227;
}

.pc-item .pc-more-link:hover {
    color: #c9a227;
}

@media (max-width: 600px) {
    .pc-item .pc-inner { flex-direction: column; max-height: none; }
    .pc-item .pc-photo { width: 100%; order: 2; height: 140px; max-height: 140px; }
    .pc-item .pc-info  { width: 100%; order: 1; padding: 10px 12px; }
}
