/* WindWatch AI Operations Brief - premium dashboard table/card styling */

.ww-ai-markdown {
  color: #102a46;
  font-size: 13.5px;
  line-height: 1.62;
}

.ww-ai-markdown h2 {
  margin: 0 0 18px;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 950;
  letter-spacing: -0.03em;
  color: #102a46;
}

.ww-ai-markdown h3 {
  margin: 24px 0 12px;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #14365d;
}

.ww-ai-markdown strong {
  font-weight: 900;
  color: #0e2949;
}

.ww-ai-markdown code {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9px;
  background: linear-gradient(180deg, #eef8ff, #dbeeff);
  border: 1px solid rgba(67, 130, 198, 0.22);
  color: #113961;
  font-family: inherit;
  font-size: 0.9em;
  font-weight: 850;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

/* Generic table shell */
.ww-ai-table-wrap {
  margin: 12px 0 20px !important;
  border-radius: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(96, 162, 226, 0.22);
  background:
    radial-gradient(circle at 10% 0%, rgba(255,255,255,.82), rgba(255,255,255,.34) 42%, rgba(218,241,255,.28)),
    linear-gradient(135deg, rgba(255,255,255,.66), rgba(224,244,255,.40));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.75),
    0 18px 42px rgba(36, 92, 150, 0.08);
}

.ww-ai-markdown table {
  width: 100%;
  min-width: 680px;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}

.ww-ai-markdown thead th {
  padding: 11px 13px;
  text-align: left;
  color: #f8fbff;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .045em;
  text-transform: uppercase;
  border: 0;
  background: linear-gradient(135deg, #173b66 0%, #225f99 58%, #2f88c9 100%);
}

.ww-ai-markdown thead th:first-child {
  border-top-left-radius: 19px;
}

.ww-ai-markdown thead th:last-child {
  border-top-right-radius: 19px;
}

.ww-ai-markdown tbody td {
  padding: 12px 13px;
  vertical-align: top;
  color: #102a46;
  font-size: 12.5px;
  border-top: 1px solid rgba(88, 151, 215, 0.13);
}

.ww-ai-markdown tbody tr:nth-child(odd) td {
  background: rgba(255,255,255,.48);
}

.ww-ai-markdown tbody tr:nth-child(even) td {
  background: rgba(227,244,255,.54);
}

.ww-ai-markdown tbody tr:hover td {
  background: rgba(207,234,255,.72);
}

.ww-ai-markdown tbody td:first-child {
  font-weight: 850;
  color: #153b62;
}

/* FIRST TABLE = KPI DASHBOARD CARDS */
.ww-ai-markdown table:first-of-type {
  min-width: 0;
  border-spacing: 0;
}

.ww-ai-markdown table:first-of-type thead {
  display: none;
}

.ww-ai-markdown table:first-of-type tbody {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  padding: 12px;
}

.ww-ai-markdown table:first-of-type tr {
  display: block;
  min-height: 92px;
  padding: 14px 14px 12px;
  border-radius: 18px;
  border: 1px solid rgba(82, 150, 218, 0.18);
  background:
    linear-gradient(145deg, rgba(255,255,255,.82), rgba(229,246,255,.58));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.85),
    0 12px 28px rgba(41, 94, 150, 0.07);
}

.ww-ai-markdown table:first-of-type td {
  display: block;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.ww-ai-markdown table:first-of-type td:first-child {
  margin-bottom: 8px;
  color: #607894;
  font-size: 10.5px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.ww-ai-markdown table:first-of-type td:nth-child(2) {
  color: #0d2948;
  font-size: 21px;
  line-height: 1.15;
  font-weight: 950;
  letter-spacing: -0.03em;
}

/* Make status card more expressive */
.ww-ai-markdown table:first-of-type tr:first-child {
  background:
    linear-gradient(145deg, rgba(255,245,241,.90), rgba(255,232,228,.62));
  border-color: rgba(242, 116, 92, 0.20);
}

.ww-ai-markdown table:first-of-type tr:first-child td:nth-child(2) {
  color: #b42318;
}

/* SECOND TABLE = TOP PRIORITY SUMMARY */
.ww-ai-markdown table:nth-of-type(2) {
  min-width: 0;
}

.ww-ai-markdown table:nth-of-type(2) thead {
  display: none;
}

.ww-ai-markdown table:nth-of-type(2) tbody {
  display: block;
  padding: 12px;
}

.ww-ai-markdown table:nth-of-type(2) tr {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  align-items: center;
  padding: 11px 13px;
  border-bottom: 1px solid rgba(82, 150, 218, 0.12);
}

.ww-ai-markdown table:nth-of-type(2) tr:last-child {
  border-bottom: 0;
}

.ww-ai-markdown table:nth-of-type(2) td {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.ww-ai-markdown table:nth-of-type(2) td:first-child {
  color: #607894;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .055em;
}

.ww-ai-markdown table:nth-of-type(2) td:nth-child(2) {
  color: #0d2948;
  font-size: 13.5px;
  font-weight: 850;
}

/* Remaining technical tables */
.ww-ai-markdown table:nth-of-type(n+3) tbody td:nth-child(1),
.ww-ai-markdown table:nth-of-type(n+3) tbody td:nth-child(2) {
  font-weight: 850;
}

.ww-ai-markdown table:nth-of-type(n+3) tbody td:last-child {
  color: #17314e;
}

/* Recommended actions */
.ww-ai-markdown ol {
  margin: 10px 0 20px;
  padding-left: 22px;
}

.ww-ai-markdown ol li {
  margin: 8px 0;
  padding-left: 4px;
}

.ww-ai-markdown ol li::marker {
  font-weight: 950;
  color: #237ed8;
}

/* Suggested next step badge */
.ww-ai-markdown h3:last-of-type + p code,
.ww-ai-markdown p:last-child code {
  padding: 5px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e7f4ff, #d3e9ff);
  border-color: rgba(56, 130, 210, .30);
}

/* Mobile: KPI cards stay readable, technical tables scroll inside */
@media (max-width: 760px) {
  .ww-ai-markdown {
    font-size: 12.8px;
    line-height: 1.55;
  }

  .ww-ai-markdown h2 {
    font-size: 18px;
    margin-bottom: 14px;
  }

  .ww-ai-markdown h3 {
    font-size: 14.5px;
    margin-top: 20px;
  }

  .ww-ai-table-wrap {
    border-radius: 17px;
    margin: 10px 0 16px !important;
  }

  .ww-ai-markdown table:first-of-type tbody {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 10px;
  }

  .ww-ai-markdown table:first-of-type tr {
    min-height: 82px;
    padding: 12px;
  }

  .ww-ai-markdown table:first-of-type td:first-child {
    font-size: 9.5px;
  }

  .ww-ai-markdown table:first-of-type td:nth-child(2) {
    font-size: 17px;
  }

  .ww-ai-markdown table:nth-of-type(2) tr {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 12px;
  }

  .ww-ai-markdown table:nth-of-type(n+3) {
    min-width: 640px;
  }

  .ww-ai-markdown thead th,
  .ww-ai-markdown tbody td {
    padding: 10px 11px;
    font-size: 11.5px;
  }
}

/* WindWatch AI Operations Brief - compact premium refinement */

/* Overall answer card spacing */
.ww-ai-markdown {
  max-width: 100%;
}

/* KPI cards: keep premium, reduce vertical heaviness */
.ww-ai-markdown table:first-of-type tbody {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  padding: 14px;
}

.ww-ai-markdown table:first-of-type tr {
  min-height: 78px;
  padding: 13px 14px;
}

.ww-ai-markdown table:first-of-type td:first-child {
  margin-bottom: 6px;
}

.ww-ai-markdown table:first-of-type td:nth-child(2) {
  font-size: 19px;
}

/* Top priority should be a compact details panel, not giant cards */
.ww-ai-markdown table:nth-of-type(2) {
  min-width: 0 !important;
}

.ww-ai-markdown table:nth-of-type(2) tbody {
  display: block;
  padding: 10px 12px;
}

.ww-ai-markdown table:nth-of-type(2) tr {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(83, 151, 215, 0.12);
  background: transparent !important;
  box-shadow: none !important;
}

.ww-ai-markdown table:nth-of-type(2) tr:last-child {
  border-bottom: 0;
}

.ww-ai-markdown table:nth-of-type(2) td {
  display: block;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.ww-ai-markdown table:nth-of-type(2) td:first-child {
  color: #607894;
  font-size: 10.5px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.ww-ai-markdown table:nth-of-type(2) td:nth-child(2) {
  color: #0d2948;
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 850;
  overflow-wrap: anywhere;
}

/* Technical tables: cleaner header and less black-box look */
.ww-ai-markdown table:nth-of-type(n+3) thead th {
  background: linear-gradient(135deg, #1b4f82 0%, #2878ba 100%);
  color: #ffffff;
}

.ww-ai-markdown table:nth-of-type(n+3) tbody td {
  font-size: 12.2px;
  line-height: 1.45;
}

.ww-ai-markdown table:nth-of-type(n+3) tbody tr:nth-child(odd) td {
  background: rgba(255,255,255,.58);
}

.ww-ai-markdown table:nth-of-type(n+3) tbody tr:nth-child(even) td {
  background: rgba(231,246,255,.58);
}

/* Better section rhythm */
.ww-ai-markdown h3 {
  margin-top: 24px;
  margin-bottom: 12px;
  padding-left: 2px;
}

/* Recommended actions look cleaner */
.ww-ai-markdown ol {
  margin-top: 8px;
  padding-left: 24px;
}

.ww-ai-markdown ol li {
  margin: 7px 0;
  line-height: 1.5;
}

/* Mobile refinement */
@media (max-width: 760px) {
  .ww-ai-markdown table:first-of-type tbody {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ww-ai-markdown table:first-of-type tr {
    min-height: 74px;
  }

  .ww-ai-markdown table:nth-of-type(2) tr {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 9px 6px;
  }

  .ww-ai-markdown table:nth-of-type(2) td:nth-child(2) {
    font-size: 12.8px;
  }

  .ww-ai-markdown table:nth-of-type(n+3) {
    min-width: 620px;
  }
}
