html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background: #f5f7f9;
  color: #18202a;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.dashboard-header {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin: 28px 0;
}

.header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.header-actions form {
  margin: 0;
}

.dashboard-header h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  margin: 0;
}

.eyebrow {
  color: #586b7f;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.lead {
  color: #52606d;
  max-width: 760px;
}

.section-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  margin-bottom: 24px;
}

.panel,
.news-item {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 20px;
}

.panel-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel h2,
.panel-heading h2 {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
}

.keyword-form {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
}

.keyword-form label span {
  color: #52606d;
  display: block;
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.keyword-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.keyword-row {
  align-items: center;
  border-top: 1px solid #edf1f5;
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
}

.keyword-row span {
  color: #6a7785;
  display: block;
  font-size: .9rem;
}

.metric-grid,
.assessment-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
}

.metric-grid div,
.assessment-grid div {
  background: #f5f7f9;
  border-radius: 8px;
  padding: 12px;
}

.metric-grid span,
.assessment-grid span {
  color: #6a7785;
  display: block;
  font-size: .82rem;
  font-weight: 700;
}

.metric-grid strong,
.assessment-grid strong {
  display: block;
  font-size: 1.5rem;
}

.line-group-list {
  border-top: 1px solid #edf1f5;
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
}

.line-group-list h3 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}

.line-group-row {
  align-items: center;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 36px minmax(0, 1fr);
  margin: 0;
  padding: 10px;
}

.line-group-row form {
  margin: 0;
}

.line-check {
  background: #fff;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  font-size: 1.1rem;
  height: 32px;
  line-height: 1;
  width: 32px;
}

.line-group-row strong,
.line-group-row span,
.line-group-row em {
  display: block;
}

.line-group-row span {
  color: #667789;
  font-size: .78rem;
  overflow-wrap: anywhere;
}

.line-group-row em {
  color: #52606d;
  font-size: .8rem;
  font-style: normal;
  margin-top: 2px;
}

.line-name-form {
  display: flex;
  gap: 6px;
  grid-column: 1 / -1;
}

.line-event-list {
  border-top: 1px solid #edf1f5;
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 18px;
}

.line-event-list h3 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}

.line-event-row {
  background: #f5f7f9;
  border-radius: 8px;
  padding: 10px;
}

.line-event-row strong,
.line-event-row span,
.line-event-row em {
  display: block;
}

.line-event-row span,
.line-event-row em {
  color: #667789;
  font-size: .78rem;
  overflow-wrap: anywhere;
}

.news-section {
  margin-bottom: 40px;
}

.news-list {
  display: grid;
  gap: 14px;
}

.news-item h3 {
  font-size: 1.1rem;
  line-height: 1.45;
}

.news-item h3 a {
  color: #18202a;
  text-decoration: none;
}

.news-item h3 a:hover {
  text-decoration: underline;
}

.news-meta {
  color: #667789;
  display: flex;
  font-size: .86rem;
  font-weight: 700;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.summary {
  color: #52606d;
}

.recommendations {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

.recommendations dt {
  color: #394758;
  font-weight: 800;
}

.recommendations dd {
  color: #3e4d5f;
  margin: 0 0 6px;
}

.sentiment-risk {
  color: #b3261e;
}

.sentiment-opportunity {
  color: #176b4d;
}

.sentiment-neutral {
  color: #586b7f;
}

.empty-state {
  color: #667789;
  margin: 0;
}

@media (max-width: 900px) {
  .dashboard-header,
  .keyword-row {
    align-items: stretch;
    flex-direction: column;
  }

  .section-grid,
  .keyword-form {
    grid-template-columns: 1fr;
  }
}
