/* Стили страницы /portal. Извлечены из inline <style> в index.html без изменений. */

/* Тема и переменные: Variables + base */
:root {
  --bg-0:#0f0f0f; --bg-1:#161616; --bg-2:#262626; --bg-3:#2e2e2e;
  --txt:#f4f4f4; --mut:#c7c7c7; --link:#78a9ff;
}
body { background: var(--bg-0); color: var(--txt); }
.navbar { background: #121212; }
.brand-strong { font-weight: 800; letter-spacing: .2px; }

/* Hero-секция: Top hero block */
.hero {
  background: linear-gradient(180deg, rgba(38,38,38,.96), rgba(27,27,27,.92));
  padding: 26px 0 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.hero h2 { font-weight: 400; font-size: 24px; margin: 0 0 18px 0; }
.hero h2 strong { font-weight: 800; }
.muted { color: var(--mut); }
.hero-shell{
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.11);
  background:
    radial-gradient(1100px 320px at 0% 0%, rgba(120,169,255,.12), rgba(0,0,0,0) 56%),
    radial-gradient(900px 260px at 100% 0%, rgba(180,120,255,.08), rgba(0,0,0,0) 58%),
    rgba(24,24,24,.72);
  box-shadow: 0 16px 44px rgba(0,0,0,.44), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 18px;
}
.hero-shell.row{
  margin-left: 0;
  margin-right: 0;
}
.hero-search-card{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  padding: 14px;
}

/* searchbox: Single/Bulk search UI */
.searchbox .form-control {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--txt);
  padding: 1.05rem 1.1rem;
  border-radius: 12px;
}
.searchbox .form-control:focus{
  background: rgba(255,255,255,.10);
  border-color: rgba(120,169,255,.55);
  box-shadow: 0 0 0 .2rem rgba(120,169,255,.16);
}
.searchbox .btn {
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
  color: var(--txt);
}
.searchbox .btn:hover { background: rgba(255,255,255,.14); }
.searchbox .hint { font-size: 12px; color: var(--mut); }
.searchbox textarea.form-control { min-height: 120px; resize: vertical; }
.searchbox #bulkInput{
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.14) rgba(255,255,255,.06);
}
.searchbox #bulkInput::-webkit-scrollbar{ width: 10px; }
.searchbox #bulkInput::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.14);
  border-radius: 999px;
}
.searchbox #bulkInput::-webkit-scrollbar-track{
  background: rgba(255,255,255,.06);
  border-radius: 999px;
}

.searchbox .mode-pill {
  display:inline-flex; align-items:center; gap:8px;
  font-size:12px; color:#eaeaea;
  border:1px solid rgba(255,255,255,.12);
  border-radius:999px; padding:.18rem .55rem;
}
.searchbox .mode-pill i { color:#9dd1ff; }

/* trending: Right column */
.trending h5 {
  font-size: 14px; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding-bottom: .35rem;
}
.trending a {
  color: var(--link);
  font-weight: 700;
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trending a:hover { color: #a6c8ff; text-decoration: underline; }

/* hero video: Small embedded intro */
.hero-video {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.hero-video .tile-head { padding-bottom: 10px; }
.hero-video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
}
.hero-video-wrap video{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* no cropping */
  background: #000;
}

/* Раскладка: Dashboard containers */
.dashboard-wrap { padding: 22px 0 40px; }
.dash-head { display:flex; align-items:center; gap:12px; margin-bottom: 14px; }
.dash-head h3 { margin:0; font-size: 20px; font-weight: 700; }

/* tiles: Cards/tiles with equal height */
/* IMPORTANT:
   - For equal height in a row: column uses `d-flex`, tile uses `height:100%`
   - tile-body uses flex:1 to stretch and align bottoms */
.tile {
  background:
    linear-gradient(180deg, rgba(255,255,255,.026), rgba(255,255,255,.012)),
    rgba(34,34,34,.78);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.05);
  display:flex; flex-direction:column;
  height:100%;
}
.tile:hover {
  box-shadow: 0 14px 34px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.14);
}
.tile .tile-head {
  display:flex; gap:10px; align-items:flex-start; padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.015);
}
.tile .tile-head i { font-size: 18px; margin-top: 2px; color: #9dd1ff; }
.tile .tile-title { margin:0; font-size: 15px; font-weight: 700; }
.tile .tile-sub { margin:0; font-size: 12px; color: var(--mut); }
.tile .tile-body { padding: 12px 14px 14px; flex:1; }

.tile-collapse-btn {
  background: none; border: none; color: var(--mut); cursor: pointer;
  padding: 2px 6px; margin-left: 8px; font-size: 14px;
  transition: transform .2s; flex-shrink: 0; align-self: center;
}
.tile-head > .tile-collapse-btn,
.map-head > .tile-collapse-btn { margin-left: auto; }
.tile-collapse-btn:hover { color: #fff; }
.tile-collapse-btn.collapsed { transform: rotate(-90deg); }
.tile-collapse-btn i { color: var(--mut) !important; font-size: 14px !important; }
.tile-collapse-btn:hover i { color: #fff !important; }

.tile .list-group-item { background: transparent; border-color: rgba(255,255,255,.06); color: var(--txt); padding: .55rem .25rem; }

/* kpi: KPI blocks inside tiles */
.kpi { display:flex; gap:10px; align-items:center; }
.kpi .num { font-size: 22px; font-weight: 800; line-height: 1; }
.kpi .lbl { font-size: 12px; color: var(--mut); }

/* coverage: IOC coverage widget */
.coverage-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.coverage-item {
  grid-column: span 2;
  display:flex;
  gap:12px;
  align-items:center;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--bg-3);
  border: 1px solid rgba(255,255,255,.06);
}
.coverage-grid .coverage-item:nth-child(-n+2) {
  grid-column: span 3;
}
@media (max-width: 991.98px){
  .coverage-grid {
    grid-template-columns: 1fr;
  }
  .coverage-grid .coverage-item,
  .coverage-grid .coverage-item:nth-child(-n+2) {
    grid-column: span 1;
  }
}
.coverage-item .num { font-size: 20px; font-weight: 800; line-height: 1; }
.coverage-item .sub { font-size: 12px; color: var(--mut); }
.coverage-item i { font-size: 20px; color: #9dd1ff; }

/* spikes: Daily activity spike cards */
.spike-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 991.98px) {
  .spike-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px) {
  .spike-cards { grid-template-columns: 1fr; }
}
.spike-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-3);
  border: 1px solid rgba(255,255,255,.06);
  transition: border-color .15s;
}
.spike-card:hover { border-color: rgba(255,255,255,.15); }
.spike-card .spike-icon { font-size: 22px; margin-top: 2px; }
.spike-card .spike-entity { font-size: 15px; font-weight: 700; line-height: 1.2; word-break: break-word; }
.spike-card .spike-type { font-size: 11px; color: var(--mut); margin-top: 2px; }
.spike-card .spike-growth { font-size: 18px; font-weight: 800; line-height: 1; margin-top: 6px; }
.spike-card .spike-counts { font-size: 12px; color: var(--mut); margin-top: 2px; }
.spike-card-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-3);
  border: 1px solid rgba(255,255,255,.04);
  opacity: .4;
  font-size: 12px;
  color: var(--mut);
  text-align: center;
}

/* tables: Dark table style */
.table-darkish { background: var(--bg-2); border: 1px solid rgba(255,255,255,.06); }
.table-darkish thead th { border-color: rgba(255,255,255,.08); color: #eaeaea; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.table-darkish td, .table-darkish th { border-color: rgba(255,255,255,.06); }
.row-hover tbody tr:hover { background: rgba(255,255,255,.03); cursor: pointer; }

/* table wrap: Apple-ish rounded table container */
.table-wrap-apple {
  border-radius: 16px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.02);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 8px 24px rgba(0,0,0,.22);
}
.table-wrap-apple .table-darkish { border: 0; }
.keys-table tbody tr:hover { cursor: default; }
.keys-table td { vertical-align: middle; }
.keys-table .btn { padding: .15rem .45rem; }


/* friends of the project: Bottom widget — top contributors this month */
#friendsOfProjectWidget .friends-of-project-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
#friendsOfProjectWidget .friends-of-project-sub { font-size: 13px; color: var(--mut); margin-bottom: 12px; }
#friendsOfProjectWidget .friends-of-project-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 16px;
  margin-bottom: 12px;
}
@media (max-width: 767.98px) {
  #friendsOfProjectWidget .friends-of-project-grid { grid-template-columns: repeat(2, 1fr); }
}
#friendsOfProjectWidget .friends-of-project-item {
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
#friendsOfProjectWidget .friends-of-project-item .nick { font-weight: 600; color: var(--txt); }
#friendsOfProjectWidget .friends-of-project-item .amount { color: #28a745; font-weight: 600; }
#friendsOfProjectWidget .tile-head i.widget-icon { color: #28a745; }
#friendsOfProjectWidget .friends-of-project-goal { font-size: 12px; color: var(--mut); margin-bottom: 12px; }
#friendsOfProjectWidget .friends-of-project-more { font-size: 12px; margin-bottom: 12px; }
#friendsOfProjectWidget .friends-of-project-more a { color: var(--link); cursor: pointer; }

/* Подвал */
footer { background: var(--bg-1); border-top: 1px solid rgba(255,255,255,.06); padding: 18px 0; color: var(--mut); }
.pill { display:inline-block; padding: .18rem .5rem; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; font-size: 12px; color: #eaeaea; }

/* chips: Small status chips */
.chip { display:inline-block; font-size: 12px; padding: .18rem .45rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); color: #eaeaea; }
.chip.good { border-color: rgba(0,172,70,.55); }
.chip.bad  { border-color: rgba(255,99,99,.55); }
.chip.warn { border-color: rgba(255,196,0,.65); color: #f6e7a6; }

/* Модальное окно: IOC Details */
.modal-content { background: #1b1b1b; border: 1px solid rgba(255,255,255,.08); }
.modal-header, .modal-footer { border-color: rgba(255,255,255,.08); }
.kv { display:flex; gap:10px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.kv .k { width: 220px; color: var(--mut); font-size: 12px; }
.kv .v { flex:1; font-size: 13px; overflow-wrap:anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }


/* Модальное окно: Global Apple-like style (all modals) */
.modal-dialog{ max-width: 920px; }
.modal-content{
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(1200px 400px at 20% 0%, rgba(120,169,255,.10), rgba(0,0,0,0) 60%),
    radial-gradient(900px 320px at 100% 0%, rgba(180,120,255,.08), rgba(0,0,0,0) 60%),
    rgba(27,27,27,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 70px rgba(0,0,0,.60);
}
.modal-header{
  padding: 16px 18px;
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid rgba(255,255,255,.08);
  align-items: center;
}
.modal-title{ font-weight: 800; letter-spacing: .2px; }
.modal-body{ padding: 18px; }
.modal-footer{
  padding: 10px 18px;
  background: rgba(255,255,255,.02);
  border-top: 1px solid rgba(255,255,255,.08);
}
.modal-backdrop.show{ opacity: .72; }

/* Close button (same for all modals) */
.modal-header .close{
  width: 34px; height: 34px;
  margin: 0; padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  text-shadow: none;
}
.modal-header .close span{ font-size: 24px; line-height: 1; margin-top: -2px; }
.modal-header .close:hover{ background: rgba(255,255,255,.08); }
.modal-header .close:focus{ outline: none; box-shadow: 0 0 0 .2rem rgba(120,169,255,.20); }


/* Модальное окно: IOC Details — поверх Account при открытии из закладок */
#iocModal.modal { z-index: 1060 !important; }
#iocModalSpinner{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--mut);
  font-size: 12px;
}
#iocModalSpinner .fa-spinner{ font-size: 18px; color: #9dd1ff; }

/* Модальное окно: Auth / Личный кабинет */
#authModal .modal-dialog { max-width: 920px; }
#authModal .auth-modal {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
  background:
    radial-gradient(1200px 400px at 20% 0%, rgba(120,169,255,.14), rgba(0,0,0,0) 60%),
    radial-gradient(900px 300px at 100% 0%, rgba(180,120,255,.10), rgba(0,0,0,0) 60%),
    #1b1b1b;
}
#authModal .modal-header {
  padding: 16px 18px;
  background: rgba(255,255,255,.02);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#authModal .modal-title { font-weight: 800; letter-spacing: .2px; }
#authModal .modal-body { padding: 18px 18px 8px; }
#authModal .modal-footer { padding: 10px 18px; background: rgba(255,255,255,.02); }
#authModal .auth-close {
  width: 34px; height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  text-shadow: none;
}
#authModal .auth-close span { font-size: 24px; line-height: 1; margin-top: -2px; }
#authModal .auth-close:hover { background: rgba(255,255,255,.08); }

/* Fix Bootstrap .close negative margins (keeps X button from sticking to the edge) */
#authModal .modal-header{ align-items:center; }
#authModal .modal-header .auth-close{ margin:0; padding:0; flex:0 0 auto; }


#authModal .auth-intro{
  margin: 10px 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
}

/* Segmented control (Apple-like) */
#authModal .auth-seg,
#digestSubTabs{
  padding: 6px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  gap: 6px;
}
#authModal .auth-seg .nav-link,
#digestSubTabs .nav-link{
  border: 0 !important;
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--mut);
  font-weight: 700;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
#authModal .auth-seg .nav-link:hover,
#digestSubTabs .nav-link:hover{ color: var(--txt); background: rgba(255,255,255,.05); }
#authModal .auth-seg .nav-link.active,
#digestSubTabs .nav-link.active{
  color: var(--txt);
  background: rgba(255,255,255,.09);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
}

#digestSectorsSelect,
#wdSectorsSelect{
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.14) rgba(255,255,255,.06);
  border-radius: 10px;
}
#digestSectorsSelect::-webkit-scrollbar,
#wdSectorsSelect::-webkit-scrollbar{ width: 10px; }
#digestSectorsSelect::-webkit-scrollbar-thumb,
#wdSectorsSelect::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.14);
  border-radius: 999px;
}
#digestSectorsSelect::-webkit-scrollbar-track,
#wdSectorsSelect::-webkit-scrollbar-track{
  background: rgba(255,255,255,.06);
  border-radius: 999px;
}

#authModal .tab-content { padding-top: 14px !important; }
#authModal .form-control{
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.10);
  color: var(--txt);
  border-radius: 12px;
}
#authModal .form-control:focus{
  background: rgba(0,0,0,.45);
  border-color: rgba(120,169,255,.55);
  box-shadow: 0 0 0 .2rem rgba(120,169,255,.18);
  color: var(--txt);
}
#authModal label { color: var(--mut); font-size: 12px; font-weight: 700; letter-spacing: .2px; }

#authModal hr{
  border-top: 1px solid rgba(255,255,255,.08);
  margin: 14px 0;
}
#authModal .card{
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
}
#authModal .card .card-body{ padding: 14px 14px 12px; }
#authModal .btn { border-radius: 12px; }
#authModal .btn-outline-secondary,
#authModal .btn-outline-light{
  border-color: rgba(255,255,255,.18);
  color: var(--txt);
}
#authModal .btn-outline-secondary:hover,
#authModal .btn-outline-light:hover{
  border-color: rgba(255,255,255,.28);
  background: rgba(255,255,255,.06);
}
#supportModal .modal-dialog { max-width: 760px; }
#supportModal .modal-content{
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(1200px 400px at 20% 0%, rgba(120,169,255,.14), rgba(0,0,0,0) 60%),
    radial-gradient(900px 300px at 100% 0%, rgba(180,120,255,.10), rgba(0,0,0,0) 60%),
    #1b1b1b;
}
#supportModal .modal-header{
  padding: 16px 18px;
  background: rgba(255,255,255,.02);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
#supportModal .modal-title { font-weight: 800; letter-spacing: .2px; }
#supportModal .modal-body { padding: 18px 18px 8px; }
#supportModal .modal-footer { padding: 10px 18px; background: rgba(255,255,255,.02); }
#supportModal .form-control{
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.10);
  color: var(--txt);
  border-radius: 12px;
}
#supportModal .form-control[readonly]{
  opacity: .95;
  cursor: default;
  background: rgba(255,255,255,.04);
}
#supportModal label { color: var(--mut); font-size: 12px; font-weight: 700; letter-spacing: .2px; }
/* fixes: Color force */
.table-darkish, .table-darkish td, .table-darkish th { color: var(--txt) !important; }
.table-darkish a { color: var(--link) !important; }
.mono { color: var(--txt) !important; }

/* Карта: Full-width IOC map */
.map-section { padding: 0 0 18px; }
.map-card {
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.11);
  background:
    radial-gradient(900px 280px at 0% 0%, rgba(120,169,255,.08), rgba(0,0,0,0) 58%),
    rgba(30,30,30,.74);
  box-shadow: 0 14px 38px rgba(0,0,0,.40), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}
.map-head {
  display:flex; align-items:center; gap:10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
}
.map-head .title { font-size: 14px; font-weight: 800; margin:0; }
.map-head .sub { font-size: 12px; color: var(--mut); margin:0; }
#iocMap { width: 100%; height: 420px; }
.jqvmap-label {
  background: #111;
  border: 1px solid rgba(255,255,255,12);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--txt);
}
.map-card .jqvmap-zoomin,
.map-card .jqvmap-zoomout{
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-align: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(20,20,20,.68);
  color: #f4f4f4;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 22px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.08);
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease;
}
.map-card .jqvmap-zoomin{
  top: 12px;
  right: 12px;
  left: auto;
}
.map-card .jqvmap-zoomout{
  top: 52px;
  right: 12px;
  left: auto;
}
.map-card .jqvmap-zoomin:hover,
.map-card .jqvmap-zoomout:hover{
  transform: translateY(-1px);
  background: rgba(34,34,34,.78);
  border-color: rgba(120,169,255,.52);
}
.map-card .jqvmap-zoomin:focus,
.map-card .jqvmap-zoomout:focus{
  outline: none;
  box-shadow: 0 0 0 3px rgba(120,169,255,.22), 0 8px 22px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.08);
}
.map-period-btn{
  color:#e9f2ff;
  border:1px solid rgba(255,255,255,.2);
  background:rgba(255,255,255,.06);
  line-height:1.2;
  padding:.2rem .52rem;
}
.map-period-btn:hover{
  color:#fff;
  border-color:rgba(120,169,255,.55);
  background:rgba(120,169,255,.18);
}
.map-period-btn.active{
  color:#fff;
  border-color:rgba(120,169,255,.75);
  background:rgba(120,169,255,.35);
}
@media (max-width: 575.98px){
  #iocMap { height: 300px; }
}


/* SEARCH-RESULTS PANEL: hidden by default + slide-in on demand */
.search-results-panel{
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-12px);
  transition: max-height .45s ease, opacity .25s ease, transform .45s ease;
  will-change: max-height, opacity, transform;
  padding: 0;
  margin: 0 0 14px 0; /* spacing before map */
}
.search-results-panel.open{
  max-height: 1600px; /* enough for table + filters */
  opacity: 1;
  transform: translateY(0);
}
.search-results-panel .tile{ margin-bottom: 0; }

.search-results-panel .btn-hide-search{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--txt);
  padding: 4px 8px;
  line-height: 1;
  border-radius: 8px;
}
.search-results-panel .btn-hide-search:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.18);
}
.search-results-panel .btn-hide-search:focus{
  box-shadow: none;
  outline: none;
}
.search-results-panel .btn-hide-search i{
  font-size: 14px;
}


select.period-select option,
#filterType option,
#expType option,
#expSector option,
#expSort option,
#expLimit option{
  color:#111 !important;
  background:#fff !important;
}
#expQ, #expType, #expSector, #expSort{
  background:#393939;
  color:#f4f4f4;
  border:1px solid rgba(255,255,255,.14);
  border-radius:10px;
}
.dashboard-wrap .btn-outline-light{
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
  border-radius: 10px;
}
.dashboard-wrap .btn-outline-light:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(120,169,255,.48);
}
.stat-item{
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.stat-head{
  font-size: 13px;
  margin-bottom: 6px;
  gap: 8px;
  align-items: center;
}
.stat-label{
  max-width: 75%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-count{
  font-size: 12px;
  color: var(--mut);
}
.stat-link{
  color: #dce9ff !important;
  text-decoration: none !important;
  transition: color .16s ease;
}
.stat-link:hover{
  color: #9dd1ff !important;
  text-decoration: none !important;
}
.stat-progress{
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  margin-bottom: 0;
}
.stat-progress .progress-bar{
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(120,169,255,.92), rgba(157,209,255,.92));
  box-shadow: 0 0 0 1px rgba(255,255,255,.10) inset;
}

/* kpi link: clickable KPI */
.kpi-link:hover .num{ text-decoration: underline; }
.kpi-link:hover{ opacity:.95; }

/* sparkline */
.spark-svg{ width:100%; height:86px; display:block; }
.spark-grid line{ opacity:.18; }
.spark-line{ fill:none; stroke: rgba(120,169,255,.95); stroke-width:2; }
.spark-fill{ fill: rgba(120,169,255,.18); }
.spark-dot{ fill: rgba(255,255,255,.95); }

.spark-hit{ fill: transparent; cursor: crosshair; }
.spark-hover-dot{ fill: rgba(255,255,255,.98); filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
.spark-hover-line{ stroke: rgba(255,255,255,.25); stroke-dasharray: 4 4; }
.spark-tip{
  position:absolute;
  pointer-events:none;
  z-index:3;
  padding:6px 8px;
  border-radius:10px;
  font-size:12px;
  line-height:1.1;
  background: rgba(20,20,20,.92);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translate(-50%, -110%);
  white-space: nowrap;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  opacity:0;
  transition: opacity .12s ease, transform .12s ease;
}
.spark-tip.show{ opacity:1; transform: translate(-50%, -120%); }

/* Pie chart: C3 donut tweaks for dark theme */
.c3 text{ fill: #d7e2f0; }
.c3 .c3-legend-item text{ fill: #d7e2f0; }
.c3 .c3-chart-arcs-title{ fill: #f4f4f4; }
.c3-chart-arc path{ stroke: #262626; }
.c3-chart-arc text{ fill: #262626; }
.c3-tooltip-container{ background: #262626 !important; }
.c3-tooltip{
  background: #262626 !important;
  color: #f4f4f4;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 8px 20px rgba(0,0,0,1) !important;
}
.c3-tooltip tr, .c3-tooltip th, .c3-tooltip td{ background: #262626 !important; color: #f4f4f4; }
.c3-tooltip td.name{ color: #d7e2f0; }

@media (max-width: 768px){
  .spark-range{
    display:flex;
    flex-wrap:wrap;
    justify-content:flex-end;
    gap:6px;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    overflow: visible !important;
  }
  .spark-range.btn-group > .btn,
  .spark-range .btn{
    border-radius: .35rem !important;
    margin-left: 0 !important; /* отключаем "склейку" Bootstrap btn-group при переносе */
    border: 1px solid rgba(255,255,255,.18) !important;
    flex: 0 0 auto;
  }
  #modePill{ display: none !important; }
}

/* apple scroll: smooth + reveal + glassy navbar */
html{ scroll-behavior:smooth; }

/* Reveal on scroll */
.reveal{
  opacity: 0;
  transform: translateY(14px);
  filter: blur(2px);
  transition: opacity .55s cubic-bezier(.2,.8,.2,1),
              transform .55s cubic-bezier(.2,.8,.2,1),
              filter .55s cubic-bezier(.2,.8,.2,1);
  will-change: opacity, transform, filter;
}
.reveal.is-visible{
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
/* Slight stagger using transition-delay via CSS variable */
.reveal{ transition-delay: var(--reveal-delay, 0ms); }

/* Apple-like navbar on scroll (glassy) */
.navbar{
  transition: background-color .35s ease, box-shadow .35s ease, backdrop-filter .35s ease;
}
.navbar.scrolled{
  background: rgba(18,18,18,.72) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

/* Smooth momentum scrolling in webkit */
.tile, .card{ -webkit-transform: translateZ(0); }


/* cratu feed: Latest Telegram posts */
.cratu-feed-tile{
  overflow: hidden;
}
.cratu-feed-tile .tile-body{ padding: 0; }
.cratu-feed-head{
  display:flex; align-items:center; gap:10px; padding: 14px 14px 8px;
}
.cratu-feed-head .meta{
  margin-left:auto; font-size:12px; color: var(--mut);
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}
.cratu-feed-head .meta a{ color: var(--link); font-weight:700; text-decoration:none; }
.cratu-feed-head .meta a:hover{ color:#a6c8ff; text-decoration:underline; }

.cratu-scroll{
  display:flex;
  gap:14px;
  overflow-x:auto;
  padding: 10px 14px 14px;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border-radius: 0 0 16px 16px;
  clip-path: inset(0 round 0 0 16px 16px);
}
.cratu-scroll::-webkit-scrollbar{ height: 10px; }
.cratu-scroll::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.14);
  border-radius: 999px;
}
.cratu-scroll::-webkit-scrollbar-track{
  background: rgba(255,255,255,.06);
  border-radius: 999px;
}
.cratu-scroll::-webkit-scrollbar-corner{
  background: transparent;
}

.cratu-post{
  flex: 0 0 calc((100% - 28px)/3);
  min-width: 260px;
  scroll-snap-align:start;
  border-radius: 10px;
  overflow:hidden;
}
@media (max-width: 991.98px){
  .cratu-post{ flex-basis: calc((100% - 14px)/2); }
}
@media (max-width: 575.98px){
  .cratu-post{ flex-basis: 86%; min-width: 260px; }
}

.cratu-media{
  height: 150px;
  background:#000;
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: relative;
}
.cratu-media img,
.cratu-media video{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
  background:#000;
}
.cratu-media .badge{
  position:absolute;
  left:10px; top:10px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.18);
  color:#fff;
  border-radius:999px;
  padding: 3px 8px;
  font-size:12px;
}

.cratu-media .play-overlay{
  position:absolute;
  left:50%; top:50%;
  transform: translate(-50%, -50%);
  width:46px; height:46px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.40);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
  pointer-events:none;
}
.cratu-media .play-overlay i{
  font-size: 18px;
  margin-left: 2px;
}

.cratu-post .tile-body{
  padding: 12px 14px 14px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.cratu-post .post-text{
  font-size: 13px;
  line-height: 1.35;
  color: var(--txt);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 72px;
}
.cratu-post .post-date{
  font-size:12px;
  color: var(--mut);
  margin-top:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.cratu-post a.post-link{
  color: inherit;
  text-decoration: none;
  display:block;
}
.cratu-post a.post-link:hover .post-text{
  text-decoration: underline;
  text-decoration-color: rgba(120,169,255,.55);
}
.cratu-skel{
  opacity:.7;
  animation: cratuPulse 1.15s ease-in-out infinite alternate;
}
@keyframes cratuPulse{
  from{ opacity:.55; }
  to{ opacity:.95; }
}


/* cratu feed: Apple-like carousel controls (arrows + edge fade) */
.cratu-carousel{
  position: relative;
}
.cratu-fade{
  position:absolute;
  top: 0;
  bottom: 0;
  width: 56px;
  z-index: 3;
  pointer-events: none;
}
.cratu-fade.left{
  left: 0;
  background: linear-gradient(to right, var(--bg-2) 0%, rgba(0,0,0,0) 100%);
}
.cratu-fade.right{
  right: 0;
  background: linear-gradient(to left, var(--bg-2) 0%, rgba(0,0,0,0) 100%);
}
.cratu-nav{
  position:absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 4;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(18,18,18,.72);
  color: #fff;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  transition: transform .18s ease, background-color .18s ease, opacity .18s ease;
}
.cratu-nav:hover{
  background: rgba(35,35,35,.78);
  transform: translateY(-50%) scale(1.04);
}
.cratu-nav:focus{ outline: none; box-shadow: 0 0 0 3px rgba(120,169,255,.18); }
.cratu-nav:disabled{
  opacity: .25;
  cursor: default;
  transform: translateY(-50%);
}
.cratu-nav.left{ left: 10px; }
.cratu-nav.right{ right: 10px; }

/* Give scroll container side padding so arrows/fade don't cover cards */
.cratu-scroll{ padding-left: 58px; padding-right: 58px; }

@media (max-width: 575.98px){
  .cratu-nav{ display:none; }
  .cratu-fade{ width: 28px; }
  .cratu-scroll{ padding-left: 14px; padding-right: 14px; }
}
