.kelly-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px 18px 56px;
}

.kelly-hero,
.kelly-toolbar,
.panel-card,
.control-card,
.summary-card,
.hero-callout {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.kelly-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 18px;
  padding: 26px;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255, 251, 244, 0.98), rgba(252, 247, 239, 0.92));
}

.kelly-hero-main {
  min-width: 0;
}

.hero-intro {
  max-width: 900px;
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 16px;
}

.kelly-hero-side {
  display: grid;
  align-content: start;
  gap: 12px;
}

.hero-callout {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
}

.hero-callout span {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-callout strong {
  font-size: 18px;
  line-height: 1.45;
}

.hero-primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 999px;
  background: #2f2112;
  color: #fff8ef;
  text-decoration: none;
  font-weight: 700;
}

.kelly-toolbar {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(160px, 1.1fr) minmax(140px, 0.9fr) minmax(160px, 1fr) minmax(140px, 1fr) minmax(180px, 0.9fr);
  gap: 12px;
  margin-top: 18px;
  padding: 12px;
  border-radius: 28px;
}

.control-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 22px;
}

.control-card span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.control-card input,
.control-card select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 10px 12px;
}

.toolbar-action {
  display: flex;
}

.kelly-refresh {
  width: 100%;
  min-height: 100%;
  border-radius: 22px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.summary-card {
  padding: 16px 18px;
  border-radius: 24px;
}

.summary-card span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.summary-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(24px, 2.2vw, 32px);
  line-height: 1.05;
}

.summary-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.kelly-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.9fr);
  gap: 16px;
  margin-top: 18px;
  align-items: start;
}

.kelly-main,
.kelly-side {
  display: grid;
  gap: 16px;
}

.kelly-side {
  position: sticky;
  top: 18px;
}

.panel-card {
  padding: 18px;
  border-radius: 28px;
}

.panel-card-emphasis {
  background: linear-gradient(180deg, rgba(255, 251, 244, 0.98), rgba(248, 240, 228, 0.96));
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
}

.panel-head-tight {
  align-items: start;
}

.section-copy {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.meta-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.meta-list-compact {
  grid-template-columns: 1fr 1fr;
}

.meta-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
}

.meta-item span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.meta-item strong {
  display: block;
  margin-top: 8px;
  font-size: 17px;
  line-height: 1.35;
  word-break: break-word;
}

.textarea-block {
  margin-top: 14px;
}

.textarea-block span {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.textarea-block textarea {
  width: 100%;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 14px;
  line-height: 1.55;
  resize: vertical;
}

.table-shell {
  overflow: auto;
  margin-top: 14px;
  border: 1px solid rgba(72, 56, 33, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.35);
}

.table-shell-short {
  max-height: 320px;
}

.table-shell-medium {
  max-height: 420px;
}

.table-shell-tall {
  max-height: 760px;
}

.table-shell table {
  min-width: 100%;
}

.table-shell thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #e7dcc7;
}

.badge-good {
  color: var(--positive);
  font-weight: 700;
}

.badge-bad {
  color: var(--negative);
  font-weight: 700;
}

.badge-mid {
  color: #8d6a22;
  font-weight: 700;
}

.pill-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 1320px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kelly-layout {
    grid-template-columns: 1fr;
  }

  .kelly-side {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1040px) {
  .kelly-hero {
    grid-template-columns: 1fr;
  }

  .kelly-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-grid,
  .kelly-side {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .kelly-shell {
    padding: 18px 12px 36px;
  }

  .kelly-hero,
  .panel-card {
    padding: 18px;
    border-radius: 24px;
  }

  .kelly-toolbar {
    grid-template-columns: 1fr;
  }

  .panel-head {
    flex-direction: column;
    align-items: start;
  }

  .meta-list,
  .meta-list-compact {
    grid-template-columns: 1fr;
  }
}
