/* Company Full Description Styles */
/* Extracted from original database content */

:root {
  --bg: #0f172a;
  --card: #111827;
  --panel: #0b1220;
  --border: #1f2937;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --text-primary: #fff;
  --text-dim: #94a3b8;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  background: radial-gradient(circle at 20% 20%, #1e293b 0%, #0b1220 60%);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
}

a {
  color: #7dd3fc;
  text-decoration: none;
}

a:hover {
  opacity: 0.9;
}

.wrap {
  max-width: 1120px;
  margin: 24px auto;
  padding: 0 16px;
}

.header {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(135deg, #0b1220 0%, #1e293b 60%);
  padding: 20px;
  gap: 16px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  padding: 6px 10px;
  color: var(--muted);
}

.verdict-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .verdict-grid {
    grid-template-columns: 1fr 320px;
    align-items: start;
  }
}

h1 {
  margin: 0;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 600;
}

@media (min-width: 480px) {
  h1 {
    font-size: 1.35rem;
  }
}

@media (min-width: 900px) {
  h1 {
    font-size: 1.45rem;
  }
}

.tag {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 6px;
}

.tag p {
  margin: 0.35rem 0;
}

.kpi-box {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 16px;
  padding: 14px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 14px;
}

.kpi-grid b {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.risk-medium {
  color: var(--warn);
  font-weight: 600;
}

.risk-high {
  color: var(--bad);
  font-weight: 600;
}

.risk-low {
  color: var(--good);
  font-weight: 600;
}

.score-wrap {
  margin-bottom: 12px;
}

.score-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.scorebar {
  height: 10px;
  border-radius: 999px;
  background: #0b1220;
  border: 1px solid var(--border);
  overflow: hidden;
}

.scorebar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #22c55e 0%, #facc15 50%, #ef4444 100%);
}

section.block {
  margin-top: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  margin-top: 12px;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}

@media (min-width: 768px) {
  h2 {
    font-size: 1.12rem;
  }
}

.table-wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.45;
  background: var(--panel);
  color: var(--text);
}

th,
td {
  padding: 10px 12px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

th {
  text-align: left;
  background: #0f1a2f;
  color: #cbd5e1;
  font-weight: 500;
}

tr:last-child td {
  border-bottom: 0;
}

.note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 8px;
}

@media (min-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }

  .grid-2 {
    display: grid;
    gap: 12px;
  }
}

.timeline {
  display: grid;
  gap: 14px;
  font-size: 14px;
}

.tl-item {
  position: relative;
  border-left: 2px solid var(--border);
  padding-left: 14px;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #0b1220;
}

.tl-date {
  font-weight: 600;
  color: #fff;
}

.tl-body {
  color: var(--text);
}

.tl-src {
  display: inline-block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  color: #cbd5e1;
  margin-top: 4px;
}

/* Chart cards - support both .tb-report__chart-card and .chart-card */
.tb-report__chart-card,
.chart-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  position: relative;
  margin: 16px 0;
  height: auto;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.tb-report__chart-card canvas,
.chart-card canvas {
  width: 100% !important;
  height: 260px !important;
  max-width: 100% !important;
  max-height: 260px !important;
  display: block !important;
  position: relative !important;
  z-index: 1 !important;
  flex-shrink: 0;
}

/* Larger canvas height on desktop */
@media (min-width: 480px) {
  .company-full-desc .chart-card canvas,
  .company-full-desc .tb-report__chart-card canvas {
    height: 350px !important;
    max-height: 350px !important;
  }
}

/* Mobile adaptations - VERY AGGRESSIVE */
@media (max-width: 479px) {
  .page-wrapper,
  body .page-wrapper {
    padding: 0 8px !important;
    max-width: 100% !important;
    width: 100vw !important;
    overflow: visible !important;
    margin: 0 !important;
  }
  
  .company-full-desc,
  body .company-full-desc,
  .company-full-desc.prose-block {
    padding: 0 8px !important;
    max-width: 100vw !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }
  
  .company-full-desc *,
  .company-full-desc.prose-block * {
    box-sizing: border-box !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    hyphens: auto !important;
  }
  
  .company-full-desc .tb-report__block,
  .company-full-desc.prose-block .tb-report__block {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 4px !important;
    margin: 12px 0 !important;
  }
  
  .company-full-desc .tb-report__header,
  .company-full-desc .header {
    padding: 12px !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  
  .company-full-desc .tb-report__chips,
  .company-full-desc .chips {
    gap: 6px !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .company-full-desc .tb-report__chip,
  .company-full-desc .chip {
    font-size: 11px !important;
    padding: 5px 8px !important;
    white-space: normal !important;
    max-width: 100% !important;
  }
  
  .company-full-desc .tb-report__card,
  .company-full-desc .card {
    padding: 10px !important;
    margin-top: 10px !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow: visible !important;
  }
  
  .company-full-desc h1,
  .company-full-desc.prose-block h1 {
    font-size: 1.1rem !important;
    line-height: 1.3 !important;
    margin: 10px 0 !important;
    font-weight: 600 !important;
  }
  
  .company-full-desc h2,
  .company-full-desc.prose-block h2 {
    font-size: 1rem !important;
    line-height: 1.3 !important;
    margin: 8px 0 !important;
    font-weight: 600 !important;
  }
  
  .company-full-desc .tb-report__grid-2,
  .company-full-desc .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  
  .company-full-desc .tb-report__kpi-grid,
  .company-full-desc .kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    font-size: 11px !important;
  }
  
  .company-full-desc .table-wrap,
  .company-full-desc .tb-report__table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 8px;
  }
  
  .company-full-desc table,
  .company-full-desc.prose-block table {
    font-size: 11px !important;
    width: 100% !important;
    max-width: 100% !important;
    display: table !important;
    table-layout: fixed !important;
    word-break: break-word !important;
    margin: 0 !important;
  }
  
  .company-full-desc th,
  .company-full-desc td {
    padding: 6px 8px !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    vertical-align: top !important;
    line-height: 1.35 !important;
  }
  
  .company-full-desc th {
    width: 38% !important;
    min-width: 80px !important;
    font-weight: 600 !important;
  }
  
  .company-full-desc td {
    width: 62% !important;
  }
  
  .company-full-desc p,
  .company-full-desc .tag,
  .company-full-desc .tb-report__tag {
    font-size: 13px !important;
    line-height: 1.5 !important;
    margin: 6px 0 !important;
  }
  
  .company-full-desc .tb-report__verdict-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  
  .company-full-desc .tb-report__kpi-box {
    padding: 10px !important;
  }
  
  .company-full-desc .tb-report__note,
  .company-full-desc .note {
    font-size: 11px !important;
    padding: 8px !important;
    line-height: 1.4 !important;
    margin-top: 8px !important;
  }
  
  .company-full-desc .tb-report__chart-card,
  .company-full-desc .chart-card {
    height: auto !important;
    min-height: 280px !important;
    padding: 10px !important;
  }
  
  .company-full-desc .tb-report__chart-card canvas,
  .company-full-desc .chart-card canvas {
    height: 240px !important;
    max-height: 240px !important;
  }
  
  .company-full-desc .tb-report__chart-legend,
  .company-full-desc .chart-legend {
    font-size: 11px !important;
    gap: 6px !important;
    padding: 6px !important;
  }
  
  .company-full-desc .tb-report__swatch,
  .company-full-desc .chart-legend span.swatch {
    width: 12px !important;
    height: 12px !important;
  }
}

.tb-report__chart-legend,
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
  padding: 8px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
}

.tb-report__chart-legend div,
.chart-legend div {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.tb-report__swatch,
.chart-legend span.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.tb-report__no-data-label,
.no-data-label {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
  padding: 10px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  font-size: 13px;
  color: #cbd5e1;
}

.chart-legend span.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: #334155;
  margin-right: 4px;
}

.chart-legend .ok {
  background: var(--good);
}

.chart-legend .warn {
  background: var(--warn);
}

.chart-legend .bad {
  background: var(--bad);
}

.no-data-label {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

.sources-list {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
}

.sources-list li {
  margin-bottom: 8px;
}

.footnote {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 16px;
}

/* ===== Chart widgets styles (from show.html.twig) ===== */
.tb-charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  margin-top: 0.5rem;
  min-width: 0;
}

@media (min-width: 900px) {
  .tb-charts-grid {
    grid-template-columns: 70% 30%;
  }
}

.tb-charts-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0.85rem 0.9rem;
  width: 100%;
  overflow: hidden;
}

.tb-charts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.tb-charts-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
  max-width: 100%;
}

.tb-pill {
  font-size: 0.75rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 20, 35, 0.9);
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.tb-chart-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 280px !important;
  min-width: 0;
  min-height: 280px !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.tb-chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-height: 280px !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 1 !important;
}

.widget-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

/* ===== TB Report styles (for werty and similar) ===== */
.tb-report {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial;
  line-height: 1.5;
  color: var(--text);
}

.tb-report__header {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(135deg, #0b1220 0%, #1e293b 60%);
  padding: 20px;
  margin-bottom: 24px;
}

.tb-report__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tb-report__chip {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  padding: 6px 10px;
  color: var(--muted);
  white-space: nowrap;
}

.tb-report__verdict-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .tb-report__verdict-grid {
    grid-template-columns: 1fr 320px;
    align-items: start;
  }
}

.tb-report__tag {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 6px;
}

.tb-report__tag p {
  margin: 0.35rem 0;
}

.tb-report__kpi-box {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 16px;
  padding: 14px;
}

.tb-report__score-wrap {
  margin-bottom: 12px;
}

.tb-report__score-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.tb-report__scorebar {
  height: 10px;
  border-radius: 999px;
  background: #0b1220;
  border: 1px solid var(--border);
  overflow: hidden;
}

.tb-report__scorebar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #22c55e 0%, #facc15 50%, #ef4444 100%);
}

.tb-report__kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 14px;
}

.tb-report__kpi-grid b {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.tb-report__risk-low {
  color: var(--good);
  font-weight: 600;
}

.tb-report__risk-medium {
  color: var(--warn);
  font-weight: 600;
}

.tb-report__risk-high {
  color: var(--bad);
  font-weight: 600;
}

.tb-report__block {
  margin-top: 24px;
}

.tb-report__card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  margin-top: 12px;
}

.tb-report__card h2,
.tb-report h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .tb-report__card h2,
  .tb-report h2 {
    font-size: 1.12rem;
  }
}

.tb-report__table-wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.tb-report table,
.tb-report__card table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.45;
  background: var(--panel);
  color: var(--text);
}

.tb-report th,
.tb-report__card th {
  text-align: left;
  background: #0f1a2f;
  color: #cbd5e1;
  font-weight: 500;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.tb-report td,
.tb-report__card td {
  padding: 10px 12px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.tb-report tr:last-child td,
.tb-report__card tr:last-child td {
  border-bottom: 0;
}

.tb-report__note,
.tb-report__footnote {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 8px;
}

.tb-report__grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 900px) {
  .tb-report__grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.tb-report__timeline {
  display: grid;
  gap: 14px;
  font-size: 14px;
}

.tb-report__tl-item {
  position: relative;
  border-left: 2px solid var(--border);
  padding-left: 14px;
}

.tb-report__tl-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #0b1220;
}

.tb-report__tl-date {
  font-weight: 600;
  color: #fff;
}

.tb-report__tl-body {
  color: var(--text);
}

.tb-report__tl-src {
  display: inline-block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  color: #cbd5e1;
  margin-top: 4px;
}

.tb-report__chart-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  position: relative;
  margin: 16px 0;
}

.tb-report__chart-card canvas {
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
  display: block;
}

.tb-report__chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  font-size: 13px;
  color: #cbd5e1;
}

.tb-report__swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: #334155;
  margin-right: 4px;
}

.tb-report__swatch.ok {
  background: var(--good);
}

.tb-report__swatch.warn {
  background: var(--warn);
}

.tb-report__swatch.bad {
  background: var(--bad);
}

.tb-report__no-data-label {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

.tb-report__sources-list {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
}

.tb-report__sources-list li {
  margin-bottom: 8px;
}
