:root {
  color-scheme: light;
  --ink: #182126;
  --muted: #65727b;
  --line: #d6e1ea;
  --panel: #ffffff;
  --page: #eef3f7;
  --soft: #edf4fb;
  --green: #26735d;
  --amber: #b36a12;
  --red: #b94335;
  --brand: #012353;
  --brand-2: #0b4a8f;
  --blue: #012353;
  --teal: #176d8a;
  --shadow: 0 18px 54px rgba(1, 35, 83, 0.12);
  --focus: rgba(1, 35, 83, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #eaf1f7 0, #f7fafc 320px),
    var(--page);
  color: var(--ink);
}

body.auth-locked .topbar,
body.auth-locked .app-shell {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

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

a {
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(18px, 4vw, 40px);
  background: var(--brand);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 76px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 210px;
  max-width: 38vw;
  height: 42px;
  object-fit: contain;
  object-position: left center;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 5px;
  color: #b9d8ff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

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

.icon-button,
.text-button,
.top-action {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.primary-button {
  min-height: 42px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.primary-button:hover {
  background: var(--brand-2);
  transform: translateY(-1px);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.text-button {
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 700;
}

.top-action {
  min-height: 38px;
  border-color: rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--brand);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.top-action.ghost {
  background: transparent;
  color: #fff;
}

.icon-button:hover,
.text-button:hover,
.top-action:hover {
  border-color: #9fb0ba;
  transform: translateY(-1px);
}

.login-screen {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 100;
  background:
    linear-gradient(145deg, rgba(1, 35, 83, 0.96), rgba(7, 78, 130, 0.92)),
    #012353;
  padding: 24px;
}

body.auth-locked .login-screen {
  display: grid;
}

.login-panel {
  width: min(460px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.login-logo {
  width: 100%;
  max-height: 82px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 20px;
}

.login-panel .field span,
.login-panel .microcopy {
  color: rgba(255, 255, 255, 0.76);
}

.login-panel input {
  background: rgba(255, 255, 255, 0.98);
}

.login-message {
  min-height: 22px;
  margin: 10px 0 0;
  color: #ffd6d1;
  font-weight: 800;
}

.admin-drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: start end;
  background: rgba(1, 35, 83, 0.38);
  padding: 18px;
}

.admin-drawer[hidden] {
  display: none;
}

.admin-panel {
  width: min(720px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 18px;
  box-shadow: 0 24px 80px rgba(1, 35, 83, 0.22);
}

.settings-stack {
  display: grid;
  gap: 14px;
}

.settings-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 14px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: #34434b;
  font-weight: 700;
}

.action-field {
  align-self: end;
}

.user-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.user-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfc;
}

.user-row strong {
  display: block;
}

.user-row span {
  color: var(--muted);
  font-size: 12px;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(340px, 0.72fr) minmax(520px, 1fr);
  gap: 20px;
  padding: 20px clamp(18px, 4vw, 40px) 42px;
}

.input-panel,
.report-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 44px rgba(1, 35, 83, 0.09);
}

.input-panel {
  padding: 20px;
  align-self: start;
}

.report-panel {
  min-height: 640px;
  overflow: hidden;
}

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

.spacing {
  margin-top: 24px;
}

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

.field,
.range-field {
  display: grid;
  gap: 7px;
}

.wide {
  margin-top: 14px;
}

.field span,
.range-field span,
.check-list legend {
  color: #33424a;
  font-size: 13px;
  font-weight: 800;
}

input[type="text"],
input[type="number"],
input[type="file"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 74px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus);
}

.range-field {
  margin-top: 16px;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.range-field input {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--teal);
}

.range-field output {
  color: var(--muted);
  font-weight: 800;
}

.check-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #34434b;
  font-size: 14px;
}

.check-list input {
  width: 17px;
  height: 17px;
  accent-color: var(--teal);
}

.chip-panel,
.tool-panel,
.archive-panel,
.logo-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.chip-panel strong,
.tool-panel strong,
.archive-panel strong {
  color: #33424a;
  font-size: 13px;
}

.chip-row,
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip,
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #2d3a41;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.chip:hover,
.text-link:hover {
  border-color: #9fb0ba;
}

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

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

.logo-preview {
  display: grid;
  place-items: center;
  min-height: 120px;
  color: var(--muted);
  overflow: hidden;
}

.logo-preview img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.archive-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.archive-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px;
}

.archive-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.archive-item span {
  color: var(--muted);
  font-size: 12px;
}

.mini-button {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.domain-check {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfc;
}

.domain-check-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.domain-check-head span {
  color: #33424a;
  font-size: 13px;
  font-weight: 800;
}

.domain-check-head p,
.microcopy {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.domain-result {
  display: grid;
  gap: 5px;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fff;
}

.domain-result strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.domain-result span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.domain-result.available {
  border-color: rgba(38, 115, 93, 0.45);
  background: rgba(38, 115, 93, 0.08);
}

.domain-result.taken {
  border-color: rgba(185, 67, 53, 0.45);
  background: rgba(185, 67, 53, 0.08);
}

.domain-result.unknown,
.domain-result.loading {
  border-color: rgba(179, 106, 18, 0.45);
  background: rgba(179, 106, 18, 0.09);
}

.domain-result.muted {
  color: var(--muted);
}

.score-strip {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 20px;
  align-items: center;
  padding: 22px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(120deg, #ffffff, #eef5ff),
    radial-gradient(circle at 95% 0, rgba(1, 35, 83, 0.08), transparent 280px);
}

.score-ring {
  --score: 0;
  --score-color: var(--green);
  position: relative;
  width: 112px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #fff 58%, transparent 59%),
    conic-gradient(var(--score-color) calc(var(--score) * 1%), #dfe7eb 0);
  box-shadow: inset 0 0 0 1px rgba(1, 35, 83, 0.06), 0 12px 24px rgba(1, 35, 83, 0.1);
}

.score-ring strong {
  font-size: 30px;
  line-height: 1;
}

.score-ring span {
  margin-top: 36px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  position: absolute;
}

#riskSummary {
  color: var(--muted);
  line-height: 1.55;
  margin: 8px 0 0;
}

.risk-bars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}

.risk-bar {
  display: grid;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f7fbff);
}

.risk-bar div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.risk-bar strong,
.risk-bar span {
  font-size: 13px;
}

.risk-bar span {
  color: var(--muted);
  font-weight: 800;
}

meter {
  width: 100%;
  height: 10px;
}

meter::-webkit-meter-bar {
  border: 0;
  border-radius: 999px;
  background: #dfe7eb;
}

meter::-webkit-meter-optimum-value,
meter::-webkit-meter-suboptimum-value,
meter::-webkit-meter-even-less-good-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--teal));
}

.report-body {
  padding: 18px 22px 26px;
}

.empty-state {
  display: grid;
  align-content: center;
  min-height: 300px;
  text-align: center;
  color: var(--muted);
}

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

.report-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
}

.report-block.full {
  grid-column: 1 / -1;
}

.report-block p,
.report-block li {
  color: #42515a;
  line-height: 1.55;
}

.report-block ul,
.report-block ol {
  margin: 10px 0 0;
  padding-left: 20px;
}

.report-cover {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--brand), #0b4a8f);
  color: #fff;
  padding: 18px 20px;
  grid-column: 1 / -1;
}

.report-cover .eyebrow,
.report-cover p {
  color: rgba(255, 255, 255, 0.82);
}

.report-cover .badge {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

.report-cover h2 {
  font-size: 26px;
}

.comparison-table,
.score-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

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

.comparison-table th,
.score-table th {
  color: var(--muted);
  font-size: 12px;
}

.score-delta {
  font-weight: 800;
}

.score-delta.positive {
  color: var(--red);
}

.score-delta.negative {
  color: var(--green);
}

.logo-report {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  align-items: center;
}

.logo-report img {
  width: 120px;
  max-height: 120px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.badge {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 6px 9px;
  color: #34434b;
  background: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.matrix-cell {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f9fbfb;
}

.matrix-cell.active-low {
  border-color: rgba(38, 115, 93, 0.55);
  background: rgba(38, 115, 93, 0.1);
}

.matrix-cell.active-medium {
  border-color: rgba(179, 106, 18, 0.55);
  background: rgba(179, 106, 18, 0.11);
}

.matrix-cell.active-high {
  border-color: rgba(185, 67, 53, 0.55);
  background: rgba(185, 67, 53, 0.1);
}

.matrix-cell strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.matrix-cell span {
  color: var(--muted);
  font-size: 12px;
}

.meta-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.meta-table th,
.meta-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  text-align: left;
  vertical-align: top;
}

.meta-table th {
  width: 34%;
  color: var(--muted);
  font-size: 13px;
}

.meta-table td {
  color: #2d3a41;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .report-panel {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .button-row,
  .tool-head,
  .domain-check-head {
    width: 100%;
    flex-wrap: wrap;
  }

  .brand-logo {
    width: min(100%, 320px);
  }

  .field-grid,
  .domain-results,
  .check-grid,
  .risk-bars,
  .report-grid,
  .score-strip,
  .logo-report {
    grid-template-columns: 1fr;
  }

  .archive-item {
    grid-template-columns: 1fr;
  }

  .user-row {
    grid-template-columns: 1fr;
  }

  .score-ring {
    width: 108px;
  }

  .matrix {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar-actions,
  .input-panel {
    display: none;
  }

  .topbar,
  .app-shell {
    display: block;
    padding: 0;
  }

  .report-panel,
  .topbar {
    border: 0;
    box-shadow: none;
  }

  .report-cover {
    min-height: 210px;
    align-content: center;
    page-break-after: avoid;
  }

  .report-block {
    break-inside: avoid;
  }
}
