:root {
  --bg: #f5f5f7;
  --card-bg: #ffffff;
  --accent: #111827;
  --accent-soft: #f3f4f6;
  --accent-border: #d1d5db;
  --accent-success: #16a34a;
  --accent-error: #dc2626;
  --text-main: #111827;
  --text-muted: #6b7280;
  --shadow-soft: 0 14px 30px rgba(15, 23, 42, 0.12);
  --radius-xl: 18px;
  --anna-pink: #fce7f3;
  --anna-pink-strong: #db2777;
  --anna-warm: #b45309;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, #ffe4f1, #fdf2f8 45%, #f9fafb 100%);
  color: var(--text-main);
  font-family: Arial, Helvetica, sans-serif;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.15;
  font-weight: 700;
}

h2 {
  font-size: 19px;
}

h3 {
  font-size: 15px;
}

.topbar,
.scan-form,
main {
  width: min(100% - 32px, 1160px);
  margin-inline: auto;
}

.topbar {
  margin-top: 32px;
}

.scan-form,
.status-row,
.panel,
.kpi {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--radius-xl);
  background: var(--card-bg);
  box-shadow: var(--shadow-soft);
}

.brand-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.anna-logo {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  color: var(--accent);
  font-size: 30px;
  font-weight: 800;
}

.anna-logo img {
  display: block;
  width: 48px;
  height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
}

.subtitle {
  max-width: 520px;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}

.module-pill,
.connector-strip span,
.rec-meta span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 12px;
  padding: 5px 10px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
}

.scan-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 92px auto;
  gap: 12px;
  margin-top: 38px;
  padding: 18px;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: var(--text-main);
  font-size: 14px;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  background: #9ca3af;
  cursor: progress;
}

main {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  padding-bottom: 40px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  color: var(--text-muted);
  font-size: 14px;
}

.connector-strip,
.filters,
.rec-meta,
.view-switcher,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.view-switcher {
  position: sticky;
  top: 10px;
  z-index: 2;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.view-tab,
.link-button,
.filter {
  width: auto;
  min-height: 36px;
  border: 1px solid var(--accent-border);
  background: #fff;
  color: var(--text-main);
}

.view-tab.active,
.filter.active,
.link-button {
  border-color: #f9a8d4;
  background: var(--anna-pink);
  color: var(--accent);
}

.hidden {
  display: none !important;
}

.panel {
  min-width: 0;
  padding: 20px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.muted {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}

.kpis,
.action-grid,
.summary-grid {
  display: grid;
  gap: 14px;
}

.kpis {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.action-grid,
.summary-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.action-grid .anna-note {
  grid-column: 1 / -1;
  color: var(--text-muted);
  line-height: 1.45;
}

.action-card,
.group-row,
.recommendation,
.finding-card,
.empty-state {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--radius-xl);
  padding: 16px;
  background: #fff;
}

.kpi {
  padding: 16px;
}

.kpi span,
.tag,
.finding-top span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 25px;
}

.kpi p {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
}

.kpi em,
.status,
.pill {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.action-card,
.group-row,
.work-plan,
.plan-step div:last-child,
.recommendations,
.finding-list,
.details-lists,
.breakdown,
.explain {
  display: grid;
  gap: 10px;
}

.tag {
  color: var(--anna-pink-strong);
}

.action-card p,
.recommendation p,
.group-row p,
.explain p,
.finding-card p {
  color: var(--text-muted);
  line-height: 1.45;
}

.analysis-grid,
.columns {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(420px, 1.05fr);
  gap: 18px;
}

.score-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 16px;
  align-items: center;
}

canvas {
  display: block;
  width: 100%;
  max-width: 100%;
}

.breakdown-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  overflow: hidden;
  grid-column: 1 / -1;
}

.bar span {
  display: block;
  height: 100%;
}

.plan-step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--radius-xl);
  background: #fff;
}

.step-no {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.risk-list {
  display: grid;
  gap: 8px;
}

.risk-note {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}

.risk-row {
  display: grid;
  grid-template-columns: 1fr auto minmax(170px, 1.2fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  background: #fff;
}

.risk-row.highest {
  border-color: #f9a8d4;
  background: #fdf2f8;
}

.risk-row span {
  font-weight: 700;
}

.risk-row strong {
  color: var(--anna-warm);
  white-space: nowrap;
}

.risk-row em {
  color: var(--text-muted);
  font-style: normal;
}

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

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

th,
td {
  padding: 12px 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
}

.url-cell {
  max-width: 340px;
}

.url-cell a {
  display: block;
  overflow: hidden;
  color: var(--accent);
  text-overflow: ellipsis;
  white-space: nowrap;
}

td:nth-child(4),
td:nth-child(5) {
  max-width: 240px;
}

.url-cell a,
.finding-top a,
summary {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

details {
  margin-top: 8px;
}

code {
  display: inline-block;
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--accent-soft);
}

details code {
  display: block;
  margin-top: 6px;
  padding: 8px;
  overflow-x: auto;
  white-space: pre-wrap;
}

.finding-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.good { background: var(--accent-success); }
.ok { background: #2563eb; }
.warn { background: var(--anna-warm); }
.bad { background: var(--accent-error); }

@media (max-width: 1100px) {
  .kpis,
  .action-grid,
  .summary-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar,
  .analysis-grid,
  .columns,
  .score-layout {
    grid-template-columns: 1fr;
  }
  .status-row { flex-direction: column; }
}

@media (max-width: 620px) {
  .topbar,
  main {
    width: min(100% - 24px, 1160px);
  }
  .brand-row,
  .status-row {
    flex-direction: column;
  }
  .scan-form,
  .kpis,
  .action-grid,
  .summary-grid,
  .risk-row {
    grid-template-columns: 1fr;
  }
}

.back-to-anna {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  background: #ffffff;
  color: #111827;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  white-space: nowrap;
}

.back-to-anna:hover {
  background: #fce7f3;
}

.back-to-anna {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 1000;
}

.back-to-anna {
  right: max(24px, calc((100vw - 1180px) / 2 + 16px));
}
