:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --brand: #0f172a;
  --brand-hover: #1e293b;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

* {
  box-sizing: border-box;
}

html,
body {
  padding: 0;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

.app {
  padding: 24px;
  max-width: 1120px;
  margin: 0 auto;
}

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

.topbar-left {
  min-width: 0;
}

.title {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.subtitle {
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
}

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

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 6px 12px;
  font-size: 13px;
  color: var(--muted);
}

.tag-free {
  background: #f8fafc;
}

.tag-pro {
  background: #f1f5f9;
  color: var(--text);
}

.planline {
  margin: -2px 0 12px 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 920px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 14px;
  font-weight: 750;
  margin: 0 0 10px 0;
}

details.card > summary.card-title {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

details.card > summary.card-title::-webkit-details-marker {
  display: none;
}

details.card > summary.card-title::after {
  content: "▾";
  color: var(--muted);
  font-weight: 650;
}

details.card[open] > summary.card-title::after {
  content: "▴";
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.meta {
  font-size: 13px;
  color: var(--muted);
}

.mono {
  font-family: var(--mono);
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.btn:visited {
  color: var(--text);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.btn.primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn.primary:visited {
  color: #ffffff;
}

.btn:focus-visible,
.seg-btn:focus-visible,
.drop:focus-visible,
.select:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

.select {
  appearance: none;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  min-width: min(420px, 100%);
}

.select:hover {
  border-color: #cbd5e1;
}

.notice {
  border: 1px solid #c7ddff;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}

.picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drop {
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
  cursor: pointer;
}

.drop:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.drop-filled {
  border-style: solid;
}

.drop-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.drop-title {
  font-size: 13px;
  font-weight: 650;
}

.drop-sub {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

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

.seg-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.seg-btn:hover {
  border-color: #cbd5e1;
  color: var(--text);
}

.seg-btn.active {
  border-color: var(--text);
  color: var(--text);
}

.kpi {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
}

.k {
  font-size: 11px;
  color: var(--muted);
}

.v {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.issues {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

.table th {
  color: var(--muted);
  font-weight: 650;
}

.footer {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.gate-card {
  width: min(520px, 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  text-align: center;
  background: var(--panel);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.gate-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--brand);
  background-image: url("./app-icon.svg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin: 0 auto 12px auto;
}

.gate-card h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.gate-card p {
  margin: 10px 0 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.gate-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
