* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

.app-shell {
  width: 100%;
  max-width: 100%;
  padding: 14px;
}

main {
  width: 100%;
}

.grid.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.house-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 1024px) {
  .grid.two-col,
  .insights-layout {
    grid-template-columns: 1fr;
  }
}
:root {
  --bg: #113d6d;
  --bg-soft: #eaf0f7;
  --card: #ffffff;
  --text: #18324a;
  --muted: #5f7288;
  --border: #cfd8e3;
  --accent: #113d6d;
  --accent-2: #1e5a97;
  --success: #236b3b;
  --warn: #8a5b00;
  --danger: #8f2f2f;
  --shadow: 0 12px 28px rgba(13, 37, 64, 0.12);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

body {
  min-height: 100vh;
}

.app-shell {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 14px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 4px 26px;
  color: #fff;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.82;
  margin-bottom: 10px;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.05;
  font-weight: 800;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button,
select,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

#analyzeBtn,
.tab.active,
.secondary,
.danger {
  color: #fff;
  background: var(--accent);
}

.secondary {
  background: #2f5f94;
}

.danger {
  background: #8f2f2f;
}

.tabs {
  display: flex;
  gap: 10px;
  margin: 0 0 18px;
  flex-wrap: wrap;
}

.tab {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 12px 18px;
}

.tab-panel {
  display: none;
  width: 100%;
  max-width: 100%;
}

.tab-panel.active {
  display: block;
}

main,
.card {
  width: 100%;
  max-width: 100%;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.intro-card p,
.intro-card li {
  color: #31465e;
  line-height: 1.6;
}

.intro-card ul {
  margin: 10px 0 0 18px;
  padding: 0;
}

.grid.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.section-head.compact {
  align-items: center;
}

.section-head label,
.form-row label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  width: min(230px, 100%);
}

.card h2,
.section-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  border-radius: 12px;
  padding: 12px 14px;
  display: inline-block;
  width: 100%;
}

.chart-card .section-head h2 {
  flex: 1;
}

select,
input,
textarea {
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 12px 14px;
}

input,
select {
  color: #0b2f57;
  background: #f8fbff;
}

select {
  font-weight: 600;
}

textarea {
  min-height: 90px;
  resize: vertical;
  color: #0b2f57;
  font-weight: 700;
  background: #ffffff;
  border: 1px solid #9fb8d4;
}

textarea::placeholder {
  color: #8a97a8;
  font-style: italic;
  font-weight: 400;
}

.house-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.house-box {
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  border-radius: 14px;
  padding: 12px;
}

.house-box > div:first-child {
  margin-bottom: 8px;
  color: var(--accent);
}

.house-box label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(240px, 360px);
  gap: 16px;
  margin-top: 14px;
}

.validation-box,
.empty-state {
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: #f7faff;
  padding: 14px;
  color: var(--muted);
  line-height: 1.6;
}

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

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

.verdict-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.verdict-card {
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 16px;
  background: linear-gradient(180deg, #fafdff 0%, #edf4fb 100%);
}

.verdict-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--accent);
}

.verdict-value {
  font-weight: 800;
  font-size: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: #e9f1fb;
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

.comparison-table-wrap {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.comparison-table th {
  color: var(--accent);
  font-size: 14px;
  background: #f6f9fd;
}

.domain-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.domain-card {
  border: 1px solid var(--border);
  background: #fbfdff;
  border-radius: 16px;
  padding: 16px;
}

.domain-group-tag {
  display: inline-block;
  margin-bottom: 12px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #e7eef8;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
}

.status-stable {
  background: #e8f6ec;
  color: var(--success);
}

.status-developing {
  background: #fff4dc;
  color: var(--warn);
}

.status-vulnerable {
  background: #fdeaea;
  color: var(--danger);
}

.score-row {
  margin: 9px 0;
  color: #37506b;
  line-height: 1.55;
}

.status-list {
  margin: 8px 0 0 18px;
  padding: 0;
  color: #37506b;
  line-height: 1.55;
}

.accordion-wrap {
  display: grid;
  gap: 12px;
}

.accordion-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfdff;
  overflow: hidden;
}

.accordion-item summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
  color: var(--accent);
}

.accordion-item summary::-webkit-details-marker {
  display: none;
}

.accordion-content {
  padding: 0 16px 16px;
  color: #3b526a;
}

.accordion-content ul {
  margin: 0 0 0 18px;
  padding: 0;
  line-height: 1.6;
}

@media (max-width: 1024px) {
  .grid.two-col,
  .domain-cards,
  .verdict-grid,
  .house-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    flex-direction: column;
    gap: 12px;
  }

  .app-shell {
    padding: 10px;
  }

  .comparison-table {
    min-width: 640px;
  }
}
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.history-item:last-child {
  border-bottom: none;
}

.history-main {
  min-width: 0;
}

.history-name {
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}

.history-meta {
  color: #5d7086;
  font-size: 14px;
  line-height: 1.5;
}

.history-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.history-actions button {
  padding: 8px 12px;
  border-radius: 10px;
}