.insights-panel { margin: 0 0 24px; padding: 0; overflow: hidden; }
.insights-panel > summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 24px; list-style: none; cursor: pointer; color: var(--plum-dark); }
.insights-panel > summary::-webkit-details-marker { display: none; }
.insights-panel > summary strong { display: block; font-size: 20px; }
.insights-panel > summary small { display: block; margin-top: 5px; color: var(--muted); font-size: 14px; font-weight: 400; }
.insights-panel[open] > summary > span:last-child { transform: rotate(45deg); }
.insights-panel > summary > span:last-child { font-size: 28px; }
.insights-content { padding: 0 24px 24px; }
.insights-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.insights-heading h2 { margin: 0 0 5px; font-size: 22px; }
.insights-heading p, .insights-link-tools p, .marketing-intro, .marketing-setup p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.insights-heading button { flex-shrink: 0; min-height: 44px; }
.insights-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin: 20px 0; }
.insights-summary > div { padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: #faf8fc; }
.insights-summary span { display: block; color: var(--muted); font-size: 14px; }
.insights-summary strong { display: block; margin-top: 6px; color: var(--plum); font-size: 32px; }
.insights-toolbar { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; }
.insights-toolbar > label { display: grid; gap: 6px; color: var(--plum-dark); font-size: 14px; }
.insights-toolbar select, .insights-toolbar input[type=date] { min-width: 150px; min-height: 44px; padding: 10px; }
.insights-toolbar > .insights-exclude { display: flex; align-items: center; margin-left: auto; min-height: 44px; font-size: 14px; color: var(--muted); }
.insights-exclude input { width: 18px; height: 18px; margin: 0 4px 0 0; }
.insights-status { color: var(--muted); font-size: 13px; margin: 14px 0; }
.insights-period-summary { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 20px 0 14px; font-size: 16px; }
.insights-period-summary span { color: var(--muted); }
.insights-period-summary b { color: var(--plum); }
.insights-chart-card { padding: 20px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.insights-chart-card h3 { margin: 0 0 9px; font-size: 18px; }
.insights-chart-card > p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.insights-bars { --bar-count:24; display: grid; grid-template-columns: repeat(var(--bar-count), minmax(0,1fr)); gap: 5px; height: 170px; padding-top: 6px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top,transparent 0,transparent 41px,#ede8f0 42px,transparent 43px); }
.insights-bar-slot { position: relative; display: flex; align-items: flex-end; height: 100%; min-width: 0; }
.insights-bar { width: 100%; background: #c2afd7; border-radius: 4px 4px 0 0; min-height: 0; }
.insights-bar.peak { background: var(--plum); }
.insights-hour-axis { display: grid; grid-template-columns: repeat(24,minmax(0,1fr)); margin-top: 8px; font-size: 12px; color: var(--muted); }
.insights-hour-axis span:nth-child(1) { grid-column: 1 / 3; }
.insights-hour-axis span:nth-child(2) { grid-column: 7 / 10; }
.insights-hour-axis span:nth-child(3) { grid-column: 13 / 16; }
.insights-hour-axis span:nth-child(4) { grid-column: 19 / 22; }
.insights-hour-axis span:nth-child(5) { grid-column: 23 / 25; text-align: right; }
.insights-detail-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; margin-top: 16px; }
.insights-daily-bars { height: 140px; }
.insights-chart-card > .insights-chart-axis { margin-top: 8px; margin-bottom: 0; font-size: 12px; text-align: center; }
.insights-data { margin-top: 16px; font-size: 14px; }
.insights-data summary, .insights-link-tools > summary { cursor: pointer; color: var(--plum); font-weight: 700; min-height: 30px; }
.insights-data > div { max-height: 240px; overflow: auto; }
.insights-data table { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 14px; }
.insights-data th, .insights-data td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.insights-data th:last-child, .insights-data td:last-child { text-align: right; }
.insights-source-list { margin: 0; padding: 0; list-style: none; }
.insights-source-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }
.insights-source-list strong { flex-shrink: 0; }
.insights-source-list small { color: var(--muted); font-size: 12px; font-weight: 400; }
#trafficCampaigns h4 { margin-bottom: 0; font-size: 14px; }
.insights-footnote { color: var(--muted); font-size: 13px; line-height: 1.65; margin: 14px 0 24px; }
.insights-link-tools { padding: 16px; border: 1px solid var(--line); border-radius: 10px; margin-top: 18px; }
.insights-link-tools p { margin: 10px 0; }
#trafficShareLinks > div { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; margin-top: 10px; }
#trafficShareLinks span { font-size: 14px; }
#trafficShareLinks input { min-width: 0; width: 100%; padding: 10px; font-size: 13px; }
#trafficShareLinks button { min-height: 44px; }
.marketing-panel { margin-top: 20px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.marketing-panel > summary { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 18px; cursor: pointer; background: #f4eff9; list-style: none; }
.marketing-panel > summary strong { font-size: 18px; color: var(--plum-dark); }
.marketing-panel > summary span { flex-shrink: 0; font-size: 13px; color: var(--muted); }
.marketing-content { padding: 18px; }
.marketing-setup { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.marketing-setup > summary { cursor: pointer; color: var(--plum); font-size: 14px; font-weight: 700; }
.marketing-setup p { margin: 10px 0; }
.marketing-setup form { display: flex; gap: 10px; align-items: end; }
.marketing-setup label { flex: 1; min-width: 0; font-size: 14px; }
.marketing-setup input { margin-top: 6px; min-width: 0; width: 100%; }
.marketing-setup button { min-height: 44px; }
#marketingDisconnect { margin-top: 10px; }
.marketing-prompts { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.marketing-prompts button { padding: 10px 13px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--plum); font: inherit; font-size: 14px; min-height: 44px; cursor: pointer; }
.marketing-chat-log { max-height: 460px; min-height: 130px; overflow-y: auto; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fcfbfd; }
.marketing-welcome { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.marketing-message { margin: 0 0 16px; padding: 14px; background: white; border: 1px solid var(--line); border-radius: 9px; }
.marketing-message.user { margin-left: 10%; background: #f1ebf8; }
.marketing-message > b { font-size: 13px; color: var(--plum); }
.marketing-message > p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; font-size: 16px; margin: 8px 0 0; }
.marketing-chat-form { margin-top: 16px; }
.marketing-chat-form > label { display: block; margin-bottom: 7px; font-size: 14px; }
.marketing-chat-form textarea { width: 100%; resize: vertical; font-size: 16px; }
.marketing-chat-form > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; }
.marketing-chat-form small { color: var(--muted); font-size: 13px; }
.marketing-chat-form button { min-height: 44px; flex-shrink: 0; }
.marketing-chat-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.marketing-chat-bottom p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.marketing-chat-bottom button { flex-shrink: 0; min-height: 44px; }
.insights-panel button:disabled { opacity: .55; cursor: default; }
@media (max-width: 700px) {
  .insights-panel > summary { padding: 18px 16px; }
  .insights-panel > summary strong { font-size: 18px; }
  .insights-content { padding: 0 14px 18px; }
  .insights-heading { align-items: start; flex-direction: column; }
  .insights-heading h2 { font-size: 20px; }
  .insights-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .insights-summary > div { padding: 14px; }
  .insights-summary strong { font-size: 28px; }
  .insights-toolbar { gap: 10px; }
  .insights-toolbar > .insights-exclude { width: 100%; margin-left: 0; }
  .insights-detail-grid { grid-template-columns: 1fr; }
  .insights-chart-card { padding: 14px; }
  .insights-bars { gap: 3px; }
  #trafficShareLinks > div { grid-template-columns: 1fr auto; }
  #trafficShareLinks span { grid-column: 1 / -1; }
  .marketing-panel > summary { flex-wrap: wrap; }
  .marketing-panel > summary strong { font-size: 17px; }
  .marketing-content { padding: 14px; }
  .marketing-setup form { flex-direction: column; align-items: stretch; }
  .marketing-setup label { width: 100%; }
  .marketing-chat-form > div { flex-direction: column; align-items: stretch; }
  .marketing-chat-bottom { flex-wrap: wrap; }
  .marketing-chat-bottom p { margin-bottom: 0; }
}
