:root {
  --ai-bg: linear-gradient(135deg, #09111f 0%, #111e32 45%, #172d3f 100%);
  --ai-panel: rgba(11, 20, 36, 0.86);
  --ai-panel-strong: rgba(16, 28, 48, 0.96);
  --ai-border: rgba(120, 154, 198, 0.18);
  --ai-accent: #42c49b;
  --ai-accent-soft: rgba(66, 196, 155, 0.16);
  --ai-warm: #f7b955;
  --ai-text: #edf4ff;
  --ai-muted: #8ea3c0;
  --ai-danger: #ff7b7b;
}

body {
  background: var(--ai-bg);
  color: var(--ai-text);
}

.ai-main {
  min-height: 100vh;
}

.ai-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ai-page-head h3 {
  margin-bottom: 0.35rem;
}

.ai-page-note {
  color: var(--ai-muted);
  max-width: 760px;
}

.ai-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ai-summary-card,
.ai-panel {
  border: 1px solid var(--ai-border);
  background: var(--ai-panel);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.ai-summary-card {
  border-radius: 22px;
  padding: 1rem 1.1rem;
}

.ai-summary-label {
  color: var(--ai-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}

.ai-summary-value {
  font-size: 1.9rem;
  font-weight: 800;
  margin-top: 0.4rem;
}

.ai-summary-meta {
  color: var(--ai-muted);
  font-size: 0.86rem;
  margin-top: 0.25rem;
}

.ai-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.ai-layout:last-child {
  margin-bottom: 0;
}

.ai-panel {
  border-radius: 26px;
  padding: 1.2rem;
}

.ai-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ai-panel-head h5 {
  margin: 0;
}

.ai-subnote {
  color: var(--ai-muted);
  font-size: 0.92rem;
}

.ai-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.ai-form-grid .span-2 {
  grid-column: span 2;
}

.ai-field {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.ai-field span,
.ai-inline-title {
  color: #c8d7ee;
  font-size: 0.86rem;
  font-weight: 600;
}

.ai-panel .form-control,
.ai-panel .form-select {
  background: rgba(8, 16, 29, 0.9);
  color: var(--ai-text);
  border: 1px solid rgba(124, 151, 184, 0.16);
  min-height: 44px;
}

.ai-panel .form-control:focus,
.ai-panel .form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(66, 196, 155, 0.18);
  border-color: rgba(66, 196, 155, 0.5);
  background: rgba(8, 16, 29, 0.95);
  color: var(--ai-text);
}

.ai-panel textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.ai-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.ai-columns-wrap,
.ai-result-box,
.ai-list {
  border: 1px solid rgba(120, 154, 198, 0.14);
  border-radius: 20px;
  background: rgba(5, 11, 22, 0.56);
}

.ai-columns-wrap {
  margin-top: 1rem;
  overflow: hidden;
}

.ai-columns-table {
  width: 100%;
  border-collapse: collapse;
}

.ai-columns-table th,
.ai-columns-table td {
  padding: 0.78rem 0.9rem;
  border-bottom: 1px solid rgba(120, 154, 198, 0.1);
  font-size: 0.9rem;
  vertical-align: middle;
}

.ai-columns-table th {
  color: #bcd0ea;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ai-columns-table tr:last-child td {
  border-bottom: 0;
}

.ai-empty {
  padding: 1rem;
  color: var(--ai-muted);
  text-align: center;
}

.ai-list {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ai-list-item {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(120, 154, 198, 0.1);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ai-list-item:hover {
  background: rgba(66, 196, 155, 0.08);
}

.ai-list-item.active {
  background: rgba(66, 196, 155, 0.14);
}

.ai-list-item:last-child {
  border-bottom: 0;
}

.ai-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.ai-list-title {
  font-weight: 700;
}

.ai-list-meta,
.ai-tagline {
  color: var(--ai-muted);
  font-size: 0.86rem;
  margin-top: 0.35rem;
}

.ai-chip-row,
.ai-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.ai-check-grid {
  margin-top: 0.35rem;
}

.ai-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  border: 1px solid rgba(120, 154, 198, 0.12);
  background: rgba(6, 13, 23, 0.64);
  color: #dbe7f6;
}

.ai-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ai-chip.active {
  background: var(--ai-accent-soft);
  color: #8ef0cb;
}

.ai-chip.warning {
  background: rgba(247, 185, 85, 0.16);
  color: #ffd284;
}

.ai-chip.muted {
  background: rgba(120, 154, 198, 0.12);
  color: #b5c7df;
}

.ai-result-box {
  margin-top: 1rem;
  padding: 1rem;
}

.ai-result-box pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ai-text);
  font-size: 0.92rem;
}

.ai-raw {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(120, 154, 198, 0.12);
}

.ai-helper {
  color: var(--ai-muted);
  font-size: 0.83rem;
}

.ai-banner {
  margin-bottom: 1rem;
  border-radius: 18px;
}

@media (max-width: 1120px) {
  .ai-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .ai-form-grid {
    grid-template-columns: 1fr;
  }

  .ai-form-grid .span-2 {
    grid-column: span 1;
  }

  .ai-panel {
    padding: 1rem;
  }
}
