:root {
  --bg: #f5f6fb;
  --card: #ffffff;
  --ink: #23233a;
  --muted: #6b7086;
  --brand: #7f8ff4;
  --brand-dark: #5f6fe0;
  --border: #e9eaf5;
  --ok: #1fa971;
  --warn: #e0a300;
  --bad: #e0505f;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "PT Sans", Arial, sans-serif;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { color: var(--brand); }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: linear-gradient(120deg, #23233a, #34345f);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
}
.topbar .brand img { height: 28px; width: auto; }
.topbar .user-area {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
  color: #d6d8f5;
}
.topbar .user-area b { color: #fff; }
.topbar .btn-link {
  color: #d6d8f5;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
}
.topbar .btn-link:hover { color: #fff; border-color: #fff; }

.content {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 18px 60px;
}

.hero {
  text-align: center;
  margin-bottom: 26px;
}
.hero img.logo { max-width: 130px; height: auto; margin-bottom: 14px; }
.hero h1 {
  font-size: 1.7rem;
  margin: 0 0 8px;
}
.hero p { color: var(--muted); margin: 0; font-size: 0.95rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: 0 6px 20px rgba(30, 30, 60, 0.06);
}
.card h2 { margin-top: 0; font-size: 1.15rem; }
.card.center { text-align: center; }

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--muted);
}
input[type="text"], input[type="email"], input[type="password"], input[type="url"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 0.98rem;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
}
input:focus { outline: 2px solid var(--brand); border-color: var(--brand); }

.field { margin-bottom: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  border: 0;
  padding: 12px 28px;
  border-radius: 9px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background 150ms ease, transform 150ms ease;
}
.btn:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.full { width: 100%; }
.btn.secondary {
  background: #eef0fb;
  color: var(--brand-dark);
}
.btn.secondary:hover { background: #e2e5fa; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.alert {
  padding: 12px 16px;
  border-radius: 9px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.alert.error { background: #fbe6e8; color: var(--bad); }
.alert.success { background: #e4f8ef; color: var(--ok); }

.switch-link { text-align: center; margin-top: 14px; font-size: 0.9rem; color: var(--muted); }

.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}
.badge.ok { background: #e4f8ef; color: var(--ok); }
.badge.warn { background: #fdf3dd; color: var(--warn); }
.badge.bad { background: #fbe6e8; color: var(--bad); }

.license-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.license-head .plan-name { font-size: 1.1rem; font-weight: 700; }
.license-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.license-grid .item {
  background: #f7f8ff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.license-grid .item b { display: block; font-size: 1.15rem; color: var(--brand-dark); }
.license-grid .item span { color: var(--muted); font-size: 0.78rem; }

.progress {
  background: var(--border);
  border-radius: 20px;
  overflow: hidden;
  height: 10px;
  margin-bottom: 6px;
}
.progress > div {
  height: 100%;
  background: var(--brand);
  border-radius: 20px;
  transition: width 300ms ease;
}
.progress-label { font-size: 0.78rem; color: var(--muted); text-align: right; }

.result-box {
  background: #f7f8ff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  word-break: break-all;
  font-size: 0.92rem;
}
.result-box .label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.result-box a { display: block; margin-bottom: 8px; }

.url-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.url-form input[type="url"] { flex: 1; min-width: 200px; }

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 20px 16px 30px;
}
.footer b { color: var(--ink); }

/* Utility classes (replace inline style="" attributes, which this host's
   Content-Security-Policy blocks) */
.hint { color: var(--muted); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

/* License summary table */
.license-table-wrap { overflow-x: auto; margin-top: 16px; }
.license-table { width: 100%; border-collapse: collapse; min-width: 420px; font-size: 0.85rem; }
.license-table th, .license-table td { padding: 7px 6px; }
.license-table thead tr { text-align: left; color: var(--muted); font-size: 0.8rem; }
.license-table tbody tr { border-top: 1px solid var(--border); }

/* Progress bar width buckets (0-100 in steps of 5), used instead of an
   inline style="width:X%" attribute */
.progress > div.w-0   { width: 0%; }
.progress > div.w-5   { width: 5%; }
.progress > div.w-10  { width: 10%; }
.progress > div.w-15  { width: 15%; }
.progress > div.w-20  { width: 20%; }
.progress > div.w-25  { width: 25%; }
.progress > div.w-30  { width: 30%; }
.progress > div.w-35  { width: 35%; }
.progress > div.w-40  { width: 40%; }
.progress > div.w-45  { width: 45%; }
.progress > div.w-50  { width: 50%; }
.progress > div.w-55  { width: 55%; }
.progress > div.w-60  { width: 60%; }
.progress > div.w-65  { width: 65%; }
.progress > div.w-70  { width: 70%; }
.progress > div.w-75  { width: 75%; }
.progress > div.w-80  { width: 80%; }
.progress > div.w-85  { width: 85%; }
.progress > div.w-90  { width: 90%; }
.progress > div.w-95  { width: 95%; }
.progress > div.w-100 { width: 100%; }

@media (max-width: 600px) {
  .topbar { padding: 12px 16px; }
  .content { padding: 22px 12px 40px; }
  .card { padding: 18px; border-radius: 12px; }
  .hero h1 { font-size: 1.4rem; }
  .url-form { flex-direction: column; }
}
