:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b151b;
  color: #f3f7f8;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% 0%, rgba(59, 179, 168, 0.12), transparent 34rem),
    #0b151b;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 18px 12px;
  border-bottom: 1px solid #25353e;
  background: rgba(11, 21, 27, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #4b5f69;
  border-radius: 11px;
  background: linear-gradient(145deg, #f9fbfc, #7e9199);
  color: #071015;
  font-size: 21px;
  font-weight: 900;
  transform: skew(-5deg);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  line-height: 1.05;
}

.brand small {
  color: #70d4ca;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

main {
  width: min(100%, 780px);
  margin: 0 auto;
  padding: 22px 16px calc(40px + env(safe-area-inset-bottom));
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(27px, 8vw, 40px);
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin-bottom: 5px;
  color: #75d4cb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.muted,
.status-message {
  color: #98aab2;
}

.text-button,
.icon-button,
.tabs button,
.chips button {
  border: 1px solid #30434d;
  color: #c9d5da;
  background: #132129;
  cursor: pointer;
}

.text-button {
  padding: 8px 10px;
  border: 0;
  background: transparent;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  font-size: 23px;
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.45;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 5px;
  border: 1px solid #263842;
  border-radius: 15px;
  background: #0f1c23;
}

.tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
}

.tabs button.active,
.chips button.active {
  border-color: #53bcb2;
  background: #1d4b4c;
  color: #f5ffff;
}

.chips {
  display: flex;
  gap: 8px;
  margin: 14px -16px 0;
  padding: 0 16px 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chips button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-message {
  min-height: 24px;
  margin: 15px 2px 8px;
  font-size: 13px;
}

.content-list {
  display: grid;
  gap: 12px;
}

.card {
  padding: 17px;
  border: 1px solid #263a44;
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(27, 43, 52, 0.98), rgba(17, 31, 38, 0.98));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

.card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.score {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(117, 212, 203, 0.32);
  border-radius: 999px;
  background: rgba(43, 155, 148, 0.13);
  color: #8fe1da;
  font-size: 13px;
  font-weight: 800;
}

.metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 0;
  border-top: 1px solid rgba(62, 82, 91, 0.52);
  color: #91a5ad;
  font-size: 13px;
}

.metric strong {
  max-width: 66%;
  color: #eef6f8;
  font-size: 13px;
  font-weight: 650;
  text-align: right;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
}

.card-actions a,
.favorite-button {
  color: #80ddd4;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.direct-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
}

.direct-links a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
}

.compact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.favorite-button,
.secondary-button {
  min-height: 38px;
  border: 1px solid #38505b;
  border-radius: 10px;
  background: #111f27;
  color: #d7e3e7;
  font-weight: 750;
  cursor: pointer;
}

.favorite-button {
  width: 42px;
  padding: 0;
  color: #f0c970;
  font-size: 20px;
}

.secondary-button {
  padding: 0 12px;
}

.won-button {
  width: 100%;
  margin-top: 12px;
  border-color: rgba(89, 201, 139, 0.58);
  color: #9ee6b8;
}

.favorite-button:disabled,
.secondary-button:disabled,
.primary-button:disabled {
  cursor: wait;
  opacity: 0.5;
}

.status-card.good {
  border-left: 3px solid #59c98b;
}

.status-card.warning {
  border-left: 3px solid #d8ad59;
}

.demo-visit-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 13px;
}

.visit-list {
  display: grid;
  gap: 8px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid rgba(62, 82, 91, 0.52);
}

.visit-card {
  padding: 12px;
  border: 1px solid #30434d;
  border-radius: 12px;
  background: rgba(7, 18, 24, 0.48);
}

.visit-card p {
  margin-bottom: 7px;
  font-size: 12px;
}

.visit-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-size: 13px;
}

.visit-heading span {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.visit-internal {
  background: rgba(126, 145, 153, 0.18);
  color: #bdcbd0;
}

.visit-external {
  background: rgba(89, 201, 139, 0.15);
  color: #86ddb0;
}

.visit-detail {
  color: #cfdbdf;
}

.login-shell {
  display: grid;
  min-height: calc(100vh - 130px);
  place-items: center;
}

.login-card {
  width: min(100%, 460px);
  padding: 24px;
  border: 1px solid #2a3e48;
  border-radius: 22px;
  background: #122029;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
}

.login-card form {
  display: grid;
  gap: 9px;
  margin-top: 24px;
}

.login-card label {
  margin-top: 7px;
  color: #bdcbd0;
  font-size: 13px;
  font-weight: 700;
}

.login-card input {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid #38505b;
  border-radius: 12px;
  outline: none;
  background: #0a161c;
  color: #f4f8fa;
}

.login-card input:focus {
  border-color: #65cfc5;
  box-shadow: 0 0 0 3px rgba(101, 207, 197, 0.12);
}

.primary-button {
  min-height: 49px;
  margin-top: 13px;
  border: 0;
  border-radius: 12px;
  background: #63c9c0;
  color: #071114;
  font-weight: 850;
  cursor: pointer;
}

.error-text {
  min-height: 20px;
  margin: 5px 0 0;
  color: #ff9b9b;
  font-size: 13px;
}

dialog {
  width: min(calc(100% - 24px), 620px);
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid #314751;
  border-radius: 20px;
  background: #112029;
  color: #f3f7f8;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
}

dialog::backdrop {
  background: rgba(3, 9, 12, 0.78);
  backdrop-filter: blur(5px);
}

dialog form {
  padding: 21px;
}

.dialog-heading,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dialog-heading h2 {
  margin-bottom: 0;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.dialog-actions .primary-button {
  min-height: 42px;
  margin-top: 0;
  padding: 0 15px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

dialog label {
  display: grid;
  gap: 7px;
  margin-top: 13px;
  color: #bdcbd0;
  font-size: 13px;
  font-weight: 700;
}

dialog input,
dialog select,
dialog textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #38505b;
  border-radius: 11px;
  outline: none;
  background: #0a161c;
  color: #f4f8fa;
}

dialog textarea {
  min-height: 105px;
  resize: vertical;
}

dialog input:focus,
dialog select:focus,
dialog textarea:focus {
  border-color: #65cfc5;
  box-shadow: 0 0 0 3px rgba(101, 207, 197, 0.12);
}

@media (min-width: 700px) {
  main {
    padding-top: 34px;
  }

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

  .status-card:first-child {
    grid-column: 1 / -1;
  }

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

@media (max-width: 520px) {
  .card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-actions {
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
