@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #e8eaf6;
  --card: #ffffff;
  --ink: #1c1844;
  --muted: #8b90a8;
  --line: #e6e8f2;
  --indigo: #2b2766;
  --violet: #6d5efc;
  --green: #17a34a;
  --pink: #ff3b6b;
  --shadow: 0 12px 34px rgba(40, 36, 92, 0.06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { max-width: 100%; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 "Plus Jakarta Sans", "Segoe UI", sans-serif;
}
button, input { font: inherit; }
.shell { width: 100%; max-width: 1160px; margin: 0 auto; padding: 22px 22px 48px; }
.brand { display: flex; align-items: center; margin-bottom: 18px; }
.logo { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.logo-mark {
  width: 46px; height: 46px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #8d7cff 0%, #2b2766 100%);
  box-shadow: 0 10px 22px rgba(109, 94, 252, 0.32);
}
.logo-mark svg { width: 26px; height: 26px; }
.logo-words b { display: block; font-size: 20px; letter-spacing: -0.04em; line-height: 1.1; }
.logo-tag { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 600; }
.shine {
  background: linear-gradient(100deg, #2b2766 0%, #2b2766 35%, #8d7cff 50%, #ff3b6b 58%, #2b2766 72%, #2b2766 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 4.8s linear infinite;
}
@keyframes shine { to { background-position: -220% 0; } }
.swap-title { display: flex; flex-wrap: wrap; gap: 0 0.35em; align-items: baseline; }
.swap { display: inline-grid; }
.swap i {
  grid-area: 1 / 1;
  font-style: normal;
  color: #6d5efc;
  opacity: 0;
  animation: phrase 9s linear infinite;
}
.swap i:nth-child(2) { animation-delay: 3s; }
.swap i:nth-child(3) { animation-delay: 6s; }
@keyframes phrase {
  0%, 27% { opacity: 1; }
  33%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .shine, .swap i { animation: none; }
  .swap i { opacity: 0; transform: none; }
  .swap i:first-child { opacity: 1; }
}

.login-wrap { min-height: 70vh; display: grid; place-items: center; }
.text-btn { border: 0; background: transparent; color: #5c617c; font-weight: 800; cursor: pointer; }
.admin-panel { margin-bottom: 16px; }
.admin-panel h2 { margin: 8px 0; }
.user-list { display: grid; gap: 8px; margin-top: 8px; }
.user-row, .domain-card { background: #f7f8fc; border-radius: 14px; padding: 12px; margin-top: 10px; }
.user-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.user-id { min-width: 140px; flex: 1; }
.user-pass { display: flex; gap: 8px; align-items: center; }
.user-pass .field { width: 180px; height: 40px; margin: 0; }
.section-gap { margin-top: 22px; }
.domain-result { margin-top: 16px; }
.domain-result h2 { margin: 8px 0; letter-spacing: -0.03em; }
.key-field { font-family: Consolas, ui-monospace, monospace; font-size: 13px; }
.dns-box { margin-top: 16px; background: #f7f8fc; border-radius: 16px; padding: 14px; }
.dns-head, .dns-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.status-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pill { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 10px; background: #eef0f6; color: #5c6178; }
.pill.good { background: #e5f8ee; color: #128a45; }
.pill.bad { background: #fde8ea; color: #d1263d; }
.dns-row { margin-top: 8px; background: #fff; border-radius: 10px; padding: 10px 12px; font-weight: 700; }
.setup-box { margin: 14px 0; background: #f7f8fc; border-radius: 16px; padding: 14px; }
.setup-box > b { display: block; margin-bottom: 6px; }
.setup-note { margin-top: 10px; }
.dns-box .status { cursor: default; }
.dns-box .create-btn { margin-top: 12px; }
.login-card { width: min(440px, 100%); }
.login-card h1 { margin: 8px 0 6px; font-size: 30px; letter-spacing: -0.04em; }
.login-card label { display: block; margin-top: 14px; font-size: 13px; font-weight: 700; color: #3d3a66; }
.login-card .field { margin-top: 7px; border-radius: 14px; }
.login-card .create-btn { margin-top: 18px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet); }
.muted { color: var(--muted); margin: 0 0 6px; }

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.topmeta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #9aa0b8;
  font-size: 13px;
  margin-bottom: 16px;
}
.topmeta b { color: #5c617c; }
.top-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.view-switch { background: #fff; border-radius: 999px; padding: 3px; box-shadow: var(--shadow); }
.logout-btn {
  height: 36px; border: 0; border-radius: 999px; padding: 0 14px;
  background: #fff; color: var(--pink); font-weight: 800; cursor: pointer;
  box-shadow: var(--shadow);
}
.logout-btn:hover { background: #fff1f4; }

.analytics { display: grid; gap: 22px; }
#analyticsBody { display: grid; gap: 22px; }
.analytics h2, .analytics h3 { margin: 0; letter-spacing: -0.04em; }
.filter-bar { display: grid; gap: 16px; background: linear-gradient(135deg, #ffffff 0%, #f4f2ff 55%, #fff 100%); }
.filter-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filter-controls label { display: grid; gap: 6px; color: #5c617c; font-size: 12px; font-weight: 800; }
.date-field { width: 168px; height: 42px; border-radius: 14px; }
.stat-grid, .split { display: grid; gap: 22px; }
.stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card, .split > .card, .chart-card {
  min-width: 0;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.stat-card:hover, .split > .card:hover, .chart-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 44px rgba(40, 36, 92, 0.14);
}
.stat-card { position: relative; overflow: hidden; animation: rise 0.55s ease both; }
.stat-card::after { content: ""; position: absolute; right: -20px; top: -24px; width: 90px; height: 90px; border-radius: 50%; background: rgba(109, 94, 252, 0.08); }
.stat-card.accent { background: linear-gradient(160deg, #2b2766, #4b43b5); color: #fff; }
.stat-card.accent span, .stat-card.accent p { color: rgba(255,255,255,0.75); }
.stat-card span, .stat-card p { color: var(--muted); font-weight: 700; overflow-wrap: anywhere; }
.stat-card strong { display: block; margin: 8px 0 2px; font-size: 36px; letter-spacing: -0.05em; line-height: 1; }
.stat-name { font-size: 26px !important; }
.stat-card:nth-child(2) { animation-delay: 70ms; }
.stat-card:nth-child(3) { animation-delay: 140ms; }
.stat-card:nth-child(4) { animation-delay: 210ms; }
.panel-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 14px; }
.panel-head span { color: var(--muted); font-size: 12px; font-weight: 800; }
.chart-card { overflow: hidden; }
.day-chart { height: 230px; display: flex; align-items: flex-end; gap: 12px; padding-top: 8px; }
.day-col {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px;
  height: 100%; justify-content: flex-end;
  background: #f7f8fc; border-radius: 16px; padding: 10px 4px 8px;
}
.day-col b { color: #6d728c; font-size: 10px; min-height: 12px; }
.day-col i {
  display: block; width: 100%; max-width: 28px; border-radius: 10px 10px 5px 5px;
  background: linear-gradient(180deg, #b7adff, #6d5efc 45%, #2b2766);
  box-shadow: 0 8px 16px rgba(43, 39, 102, 0.16);
  transform-origin: bottom; animation: grow 0.7s cubic-bezier(.2,.8,.2,1) both;
}
.day-col i.peak { background: linear-gradient(180deg, #ffd0dc, #ff3b6b); }
.day-col span { color: var(--muted); font-size: 10px; font-weight: 700; }
.chip { justify-self: start; background: #efeaff; color: #5146c9 !important; border-radius: 999px; padding: 3px 8px; }
.meter { margin-top: 10px; animation: rise 0.5s ease both; }
.meter-label { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; }
.meter-track { height: 8px; margin-top: 5px; background: #eef0f8; border-radius: 99px; overflow: hidden; }
.meter-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6d5efc, #8d7dff); transform-origin: left; animation: fill 0.8s ease both; }
.recent { display: grid; gap: 12px; }
.recent-row {
  display: grid; grid-template-columns: 110px 1.3fr 1fr 0.8fr 0.7fr; gap: 8px; align-items: center;
  background: #f7f8fc; border-radius: 12px; padding: 10px 12px; animation: rise 0.45s ease both;
}
.recent-row span { color: #5c617c; font-weight: 700; }
.slug { font-family: Consolas, ui-monospace, monospace; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.hero-grid { display: grid; grid-template-columns: 1.7fr 0.75fr; gap: 16px; }
.hero-head { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.hero-head > div { min-width: 0; flex: 1; }
.hero-icon {
  width: 38px; height: 38px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 12px;
  background: #f4f5fb;
  color: #5b57c6;
}
.hero h1 { margin: 0; font-size: 28px; letter-spacing: -0.04em; }
.hero p { margin: 4px 0 0; color: var(--muted); }
.create-row { display: flex; gap: 10px; margin-top: 22px; align-items: center; }
.create-row .field:not(.alias) { flex: 1 1 260px; width: auto; min-width: 180px; }
.field {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 48px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0 16px;
  outline: none;
}
.field:focus { border-color: #b9b3f5; box-shadow: 0 0 0 4px rgba(109, 94, 252, 0.12); }
.field::placeholder { color: #b0b4c8; }
.alias { flex: 0 1 200px; width: 200px; max-width: 200px; }
.create-btn {
  height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  background: var(--indigo);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.create-btn:hover { background: #221e58; }
.create-btn:disabled { opacity: 0.7; cursor: wait; }
.create-btn.wide { width: 100%; }
.error { min-height: 18px; margin: 8px 4px 0; color: var(--pink); font-size: 13px; font-weight: 600; }

.workspace { display: flex; flex-direction: column; }
.ws-top { display: flex; justify-content: space-between; align-items: center; color: #6f748e; font-weight: 700; }
.pro { background: #efeaff; color: #6d5efc; border-radius: 999px; padding: 3px 9px; font-size: 12px; }
.workspace strong { display: block; margin-top: 18px; font-size: 48px; letter-spacing: -0.05em; line-height: 1; }
.workspace p { margin: 4px 0 0; color: var(--muted); font-weight: 600; }
.bar { height: 7px; margin: 16px 0; background: #ece9ff; border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #6a5cff, #8a7dff); }
.menu-wrap { position: relative; margin-top: auto; }
.manage {
  width: 100%;
  border: 0;
  background: transparent;
  color: #5c617c;
  font-weight: 700;
  text-align: left;
  padding: 6px 0;
  cursor: pointer;
}
.menu {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 5;
}
.menu-label { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.menu-domain { margin: 6px 0 10px; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.api-box { display: block; margin-top: 4px; font-size: 12px; font-weight: 800; color: #6f748e; }
.api-box .field { height: 40px; margin-top: 6px; border-radius: 12px; font-family: Consolas, ui-monospace, monospace; font-size: 12px; font-weight: 600; }
.api-copy { width: 100%; margin-top: 8px; height: 40px; }
.menu button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: #f4f5fb;
  color: var(--ink);
  font-weight: 700;
  padding: 10px;
  cursor: pointer;
}

.pulse { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.pulse-card { padding: 16px 18px; animation: rise 0.5s ease both; }
.pulse-card:nth-child(2) { animation-delay: 60ms; }
.pulse-card:nth-child(3) { animation-delay: 120ms; }
.pulse-card:nth-child(4) { animation-delay: 180ms; }
.pulse-card span, .pulse-card p { color: var(--muted); font-weight: 700; font-size: 13px; }
.pulse-card strong { display: block; margin: 6px 0 2px; font-size: 32px; letter-spacing: -0.04em; line-height: 1; }
.pulse-card.hot { background: linear-gradient(160deg, #2b2766, #6d5efc); color: #fff; }
.pulse-card.hot span, .pulse-card.hot p { color: rgba(255,255,255,0.78); }
.pulse-name { font-size: 18px !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-tools { display: flex; gap: 8px; align-items: center; }
.sort-field { width: 150px; border-radius: 999px; padding: 10px 14px; }
.export-btn { border: 0; background: #fff; color: var(--indigo); font-weight: 800; border-radius: 999px; padding: 10px 14px; cursor: pointer; box-shadow: var(--shadow); }
.export-btn:hover { transform: translateY(-2px); }
.click-meter { height: 6px; border-radius: 99px; background: #f1f2f8; margin: 10px 0 4px; overflow: hidden; }
.click-meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #6d5efc, #ff3b6b); transform-origin: left; animation: fill 0.7s ease both; }
.hot-badge { margin-left: 6px; background: #fff1f6; color: var(--pink); border-radius: 999px; padding: 2px 7px; letter-spacing: 0; font-size: 10px; }
.ok { color: var(--green); font-weight: 700; min-height: 1.2em; }
.library-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 22px 0 14px; flex-wrap: wrap; }
.library-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.library-title h2 { margin: 0; font-size: 20px; letter-spacing: -0.03em; }
.library-title h2 span { color: #8b90a8; font-weight: 700; margin-left: 6px; }
.tabs { display: flex; gap: 4px; background: transparent; }
.tab { border: 0; background: transparent; color: #6d728c; font-weight: 700; border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.tab.on { background: #1c1844; color: #fff; }
.search-wrap { position: relative; width: min(280px, 100%); }
.search-wrap svg { position: absolute; left: 14px; top: 16px; color: #a0a5bb; }
.search { padding-left: 38px; }

.library { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; min-width: 0; }
.link-card { min-width: 0; max-width: 100%; padding: 16px 16px 12px; overflow: hidden; }
.card-top, .card-foot, .google-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; max-width: 100%; }
.kind { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; color: #9aa0b5; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; }
.kind-icon, .hero-icon { color: #f08ab0; }
.kind-icon {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: #fff1f6;
}
.status {
  border: 0; background: transparent; cursor: pointer;
  color: var(--green); font-weight: 800; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: var(--green); }
.status.off { color: #a0a5bb; }
.status.off::before { background: #c5c8d6; }
.short {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 10px 0 4px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--ink);
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dest {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  color: #9aa0b5;
  font-size: 13px;
  text-decoration: none;
  margin-bottom: 12px;
}
.dest span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.google-row {
  background: #f7f8fc;
  border-radius: 12px;
  padding: 8px;
  justify-content: flex-start;
  overflow: hidden;
}
.g {
  width: 22px; height: 22px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 99px;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.g-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #7d8298; font-size: 13px; }
.copy {
  border: 0;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 7px 12px;
  cursor: pointer;
}
.copy.done { background: #128a3e; }
.card-foot { margin-top: 12px; color: #8b90a8; font-size: 13px; }
.card-foot b { color: #4b516c; font-weight: 800; }
.delete { border: 0; background: transparent; color: var(--pink); font-weight: 800; cursor: pointer; padding: 4px; }
.empty {
  grid-column: 1 / -1;
  background: #fff;
  border-radius: 18px;
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero-grid, .library { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace { grid-column: 1 / -1; }
  .stat-grid, .split, .pulse { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .shell { padding: 14px 12px 32px; }
  .topmeta, .library-head, .create-row, .user-pass { flex-direction: column; align-items: stretch; }
  .card-top, .card-foot, .dns-head, .dns-row { flex-wrap: wrap; }
  .user-pass .field, .create-row .field, .create-row .field:not(.alias), .create-row .alias, .create-row .create-btn, .user-pass .create-btn {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 48px;
  }
  .hero-grid, .library, .stat-grid, .split, .pulse { grid-template-columns: minmax(0, 1fr); }
  .hero, .workspace, .pulse-card, .link-card { min-width: 0; max-width: 100%; }
  .library-tools, .sort-field, .export-btn, .search-wrap, .view-switch, .logout-btn, .library-title, .tabs { width: 100%; max-width: 100%; }
  .tabs { flex-wrap: wrap; }
  .view-switch { display: flex; }
  .view-switch .tab { flex: 1 1 0; min-width: 0; text-align: center; padding: 8px 6px; }
  .recent-row { grid-template-columns: minmax(0, 1fr); }
  .recent-row span { overflow-wrap: anywhere; }
  .day-chart { overflow-x: auto; max-width: 100%; }
  .day-col { flex: 0 0 42px; }
  .date-field { width: 100%; max-width: 100%; }
  .filter-controls, .filter-controls .create-btn { width: 100%; max-width: 100%; }
  .top-actions { justify-content: flex-start; width: 100%; }
  .hero h1, .swap-title { font-size: 22px; max-width: 100%; }
  .logo-words b { font-size: 18px; }
  .pulse-card strong { font-size: 28px; }
  .pulse-name { white-space: normal; overflow-wrap: anywhere; }
  .stat-card strong { font-size: 30px; }
  .card { padding: 16px; }
  .key-field { width: 100%; }
}
