:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --surface-strong: #edf3fb;
  --line: #e6ebf3;
  --line-strong: #d4dce8;
  --text: #111827;
  --muted: #667085;
  --faint: #98a2b3;
  --blue: #e8f1ff;
  --blue-strong: #2f6fed;
  --green: #0b8f52;
  --yellow: #facc15;
  --red: #d92d20;
  --navy: #10233f;
  --shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.is-hidden {
  display: none !important;
}

html.activation-route body {
  background: #111111;
}

html.activation-route #loginView,
html.activation-route #appView,
html.activation-route #modalRoot,
html.activation-route #toastRoot {
  display: none !important;
}

html.activation-route #activationView {
  display: grid !important;
}

.login-view,
.activation-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(88, 204, 2, 0.16), transparent 24%),
    radial-gradient(circle at 82% 16%, rgba(47, 111, 237, 0.12), transparent 28%),
    linear-gradient(140deg, #f7fbff 0%, #f1f5fb 55%, #ebf2ff 100%);
}

html.activation-route .activation-view {
  align-items: stretch;
  justify-items: stretch;
  padding: 0;
  background: #111111;
}

.login-card,
.activation-card {
  width: min(500px, 100%);
  background: var(--surface);
  border: 1px solid rgba(212, 220, 232, 0.8);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 36px 36px 32px;
}

html.activation-route .activation-card {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: center;
  background: #111111;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #ffffff;
  padding: clamp(18px, 4.2dvh, 44px) 24px clamp(18px, 4dvh, 42px);
}

.login-brand,
.activation-brand {
  display: grid;
  justify-items: start;
  gap: 16px;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #58cc02;
  color: white;
  font-size: 26px;
  font-weight: 800;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.14);
}

.login-brand-copy {
  display: grid;
  gap: 6px;
}

.login-kicker {
  margin: 0;
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 700;
}

.login-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.activation-view .brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  font-size: 28px;
}

.login-brand h1,
.activation-brand h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 750;
  line-height: 1.15;
}

.login-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.login-highlight {
  display: grid;
  gap: 5px;
  padding: 14px 14px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fdfefe 0%, #f7fbff 100%);
}

.login-highlight strong {
  font-size: 14px;
}

.login-highlight span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.login-form,
.activation-form {
  display: grid;
  gap: 18px;
}

.activation-hero {
  display: grid;
  gap: 10px;
  text-align: center;
  margin-bottom: 6px;
}

.activation-hero-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.activation-hero-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.activation-badge {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eaf8e6;
  color: #1b7a31;
  font-weight: 600;
  font-size: 13px;
}

.login-form label,
.form-field {
  display: grid;
  gap: 7px;
  color: #262b35;
}

.login-form span,
.form-label {
  font-size: 14px;
  color: #303743;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: white;
  color: var(--text);
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

textarea {
  resize: vertical;
  min-height: 116px;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #82aefa;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
}

.primary-btn,
.secondary-btn,
.text-btn,
.danger-btn,
.icon-button,
.table-action,
.ghost-btn {
  border: 0;
  border-radius: 10px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.primary-btn {
  background: linear-gradient(180deg, #2f7dff 0%, #1f68f2 100%);
  color: white;
  padding: 0 16px;
  box-shadow: 0 10px 18px rgba(47, 111, 237, 0.2);
}

.primary-btn:hover {
  background: linear-gradient(180deg, #2a74ed 0%, #165edc 100%);
}

.login-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
}

.activation-message {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.activation-message strong {
  color: var(--text);
  font-size: 16px;
}

.activation-message.success,
.activation-message.error {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #f8fafc;
}

.activation-message.success {
  border-left: 4px solid var(--green);
}

.activation-message.error {
  border-left: 4px solid var(--red);
}

.activation-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.activation-field {
  display: grid;
  gap: 8px;
}

.activation-field input {
  min-height: 42px;
  border-radius: 10px;
  background: #fafdfa;
}

.activation-official {
  width: min(420px, 100%);
  min-height: 100%;
  margin: 0 auto;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(8px, 1.8dvh, 20px);
  text-align: center;
}

.activation-super-logo {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin-top: 2px;
}

.activation-super-logo img {
  display: block;
  width: min(79vw, 34dvh, 350px);
  height: auto;
}

.activation-family-art {
  width: min(82vw, 40dvh, 355px);
  margin: clamp(0px, 0.6dvh, 8px) auto 0;
}

.activation-family-art img {
  display: block;
  width: 100%;
  height: auto;
}

.activation-copy {
  display: grid;
  gap: clamp(8px, 1.6dvh, 18px);
  margin-top: clamp(0px, 0.4dvh, 8px);
}

.activation-copy h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(25px, min(7.2vw, 4.8dvh), 42px);
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: 0;
}

.activation-copy p {
  margin: 0;
  color: #ffffff;
  font-size: clamp(18px, min(4.8vw, 3.4dvh), 27px);
  line-height: 1.25;
  font-weight: 800;
}

.activation-join-btn {
  width: min(82vw, 350px);
  min-height: clamp(48px, 7.2dvh, 58px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 9px 0 #a8a9bb;
  color: #05083e;
  text-decoration: none;
  font-size: clamp(17px, min(4.7vw, 3.4dvh), 23px);
  font-weight: 900;
  letter-spacing: 0;
  padding: 0 22px;
  margin-top: clamp(4px, 1dvh, 12px);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  border: 0;
  cursor: pointer;
}

.activation-claim-form {
  width: min(82vw, 350px);
  display: grid;
  gap: 12px;
  justify-items: center;
  margin-top: clamp(4px, 1dvh, 12px);
}

.activation-claim-form label {
  width: 100%;
  display: grid;
  gap: 8px;
  color: #ffffff;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
}

.activation-claim-form input {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 16px;
  padding: 0 16px;
  color: #05083e;
  background: #ffffff;
  box-shadow: inset 0 0 0 2px rgba(5, 8, 62, 0.08);
  font-size: 15px;
  font-weight: 800;
  outline: none;
}

.activation-helper-text {
  width: 100%;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
}

.activation-claim-form .activation-join-btn {
  width: 100%;
  margin-top: 0;
}

.activation-inline-message {
  width: 100%;
  border-radius: 16px;
  padding: 12px 14px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  text-align: left;
}

.activation-inline-message.error {
  background: rgba(255, 82, 82, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.activation-confirm-card {
  width: min(82vw, 350px);
  display: grid;
  gap: 9px;
  justify-items: center;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.activation-confirm-card span {
  font-size: 14px;
  font-weight: 800;
}

.activation-confirm-card strong {
  font-size: 22px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.activation-confirm-card small {
  font-size: 12px;
  opacity: 0.9;
  overflow-wrap: anywhere;
}

.activation-confirm-card .activation-join-btn {
  width: 100%;
  margin-top: 8px;
}

.activation-secondary-btn {
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  text-decoration: underline;
  cursor: pointer;
}

.activation-join-btn:active,
.activation-join-btn.is-loading {
  transform: translateY(5px);
  box-shadow: 0 4px 0 #a8a9bb;
}

.activation-download-link {
  color: #ffffff;
  text-decoration: none;
  font-size: clamp(15px, min(4vw, 2.8dvh), 22px);
  line-height: 1.35;
  font-weight: 800;
  margin-top: 2px;
}

.activation-page-message {
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.5;
  padding: 22px;
}

@media (max-height: 760px) {
  html.activation-route .activation-card {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .activation-official {
    gap: 8px;
  }

  .activation-family-art {
    width: min(70vw, 34dvh, 285px);
  }

  .activation-copy {
    gap: 8px;
  }

  .activation-copy h1 {
    font-size: clamp(23px, min(6.7vw, 4.3dvh), 35px);
    line-height: 1.14;
  }

  .activation-copy p {
    font-size: clamp(16px, min(4.3vw, 3dvh), 23px);
  }

  .activation-join-btn {
    min-height: 48px;
    box-shadow: 0 6px 0 #a8a9bb;
    margin-top: 6px;
  }
}

@media (max-height: 640px) {
  .activation-family-art {
    width: min(64vw, 30dvh, 240px);
  }

  .activation-download-link {
    font-size: 14px;
  }
}

.secondary-btn,
.ghost-btn {
  background: white;
  color: #1f2937;
  border: 1px solid var(--line-strong);
  padding: 0 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.secondary-btn:hover,
.ghost-btn:hover {
  border-color: #9ebcf9;
  color: #1757bf;
}

.danger-btn {
  background: #fff2f0;
  color: var(--red);
  border: 1px solid #ffccc7;
  padding: 0 14px;
}

.text-btn {
  background: transparent;
  color: #1677ff;
  padding: 0 5px;
}

.text-btn:hover {
  color: #0958d9;
}

.table-action {
  background: #f7faff;
  color: #1f68f2;
  padding: 0 10px;
  min-height: 30px;
  border: 1px solid #dbe7ff;
  border-radius: 999px;
}

.table-action.warning {
  color: #d46b08;
}

.table-action.danger {
  color: #cf1322;
}

.icon-button {
  width: 38px;
  height: 38px;
  color: #111827;
  background: white;
  border: 1px solid var(--line);
  padding: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.icon-button:hover {
  background: #f3f7fd;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  width: 250px;
  height: 100vh;
  background: linear-gradient(180deg, #f7fbff 0%, #f1f5fb 100%);
  display: flex;
  flex-direction: column;
  justify-items: stretch;
  border-right: 1px solid rgba(230, 235, 243, 0.9);
  z-index: 8;
  transition: width 0.18s ease;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 18px 14px 20px;
}

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

.sidebar-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 22px;
}

.sidebar-brand-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.sidebar-brand-copy strong,
.sidebar-brand-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-brand-copy strong {
  font-size: 14px;
}

.sidebar-brand-copy span {
  color: var(--muted);
  font-size: 12px;
}

.sidebar.expanded {
  width: 250px;
  justify-items: stretch;
}

.nav-toggle {
  flex: 0 0 auto;
}

.nav-list {
  width: 100%;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 8px 14px 18px;
  overflow: auto;
}

.nav-group {
  display: grid;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid #e6edf5;
}

.nav-group:last-child {
  border-bottom: 0;
}

.nav-group-title {
  padding: 0 10px;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.nav-sub-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #101828;
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  text-align: left;
  border-radius: 12px;
  font-weight: 600;
}

.nav-sub-item {
  min-height: 40px;
  padding-left: 16px;
}

.nav-item:hover {
  background: #eaf1fb;
}

.nav-item.active {
  background: linear-gradient(180deg, #e8f1ff 0%, #dceaff 100%);
  color: var(--blue-strong);
  box-shadow: inset 0 0 0 1px #cfe0ff;
}

.nav-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.expanded .nav-text {
  display: block;
}

.workspace {
  min-width: 0;
  overflow: hidden;
}

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px 14px;
  border-bottom: 1px solid rgba(230, 235, 243, 0.92);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
}

.topbar-left,
.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 760;
  letter-spacing: 0;
}

.topbar-user {
  font-size: 14px;
  gap: 12px;
}

.topbar-copy {
  display: grid;
  gap: 4px;
}

.topbar-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.session-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.session-copy {
  display: grid;
  gap: 1px;
}

.session-copy small {
  color: var(--muted);
  font-size: 12px;
}

.mobile-menu {
  display: none;
}

.content-root {
  padding: 22px 24px 30px;
  min-width: 0;
  display: grid;
  gap: 18px;
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.page-hero-copy,
.hero-stat,
.toolbar-surface,
.page-section > .table-shell,
.admin-panel,
.admin-create,
.result-panel,
.link-tool {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

.page-hero-copy {
  padding: 22px 24px;
  display: grid;
  gap: 8px;
}

.page-hero-kicker {
  margin: 0;
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 700;
}

.page-hero-copy h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.page-hero-copy p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.page-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hero-stat {
  padding: 18px 18px 16px;
  display: grid;
  gap: 8px;
}

.hero-stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.hero-stat-value {
  font-size: 28px;
  line-height: 1;
}

.hero-stat-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.page-section {
  display: grid;
  gap: 14px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0;
}

.toolbar-surface {
  padding: 14px;
}

.toolbar .spacer {
  flex: 1;
}

.select-wrap {
  position: relative;
  width: auto;
  min-width: 140px;
  flex: 0 0 140px;
}

.toolbar select {
  width: 140px;
}

.filter-input {
  width: 310px;
  max-width: 310px;
  min-width: min(310px, 100%);
}

.search-wrap {
  display: flex;
  align-items: stretch;
  width: auto;
  flex: 0 0 auto;
}

.search-wrap input {
  border-radius: 10px 0 0 10px;
}

.search-wrap button {
  border-radius: 0 10px 10px 0;
  width: 44px;
  border-left: 0;
}

.sync-notice {
  margin: -4px 0 12px;
  padding: 10px 12px;
  border: 1px solid #b7eb8f;
  border-radius: 6px;
  background: #f6ffed;
  color: #237804;
  font-weight: 600;
}

.sync-notice.is-active {
  border-color: #91caff;
  background: #eef7ff;
  color: #0958d9;
}

.sync-progress {
  height: 7px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(9, 88, 217, 0.14);
}

.sync-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1677ff, #69b1ff);
  transition: width 0.2s ease;
}

.sync-notice small {
  display: block;
  margin-top: 5px;
  font-weight: 700;
  opacity: 0.86;
}

.table-shell {
  width: 100%;
  overflow: auto;
  border-radius: 14px;
  background: white;
}

.sticky-actions-table {
  position: relative;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1060px;
  background: white;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbff;
  color: #111827;
  font-weight: 650;
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 14px 12px;
  white-space: nowrap;
}

.sticky-action-col {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #ffffff;
  box-shadow: -8px 0 14px rgba(15, 23, 42, 0.08);
}

thead .sticky-action-col {
  z-index: 3;
  background: #fafafa;
}

tbody td {
  border-bottom: 1px solid var(--line);
  padding: 13px 12px;
  white-space: nowrap;
  vertical-align: middle;
}

tbody tr:hover {
  background: #fbfdff;
}

tbody tr:hover .sticky-action-col {
  background: #fbfdff;
}

tbody tr.row-highlight {
  background: #f6ffed;
}

tbody tr.key-row-copied {
  background: #f6ffed;
}

tbody tr.log-risk-row {
  background: #fff7f6;
}

.code-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.check-control {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  font-size: 14px;
  color: #1f2937;
}

.row-check,
.check-control input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.mini-progress {
  width: 96px;
  height: 6px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f7;
}

.mini-progress span {
  display: block;
  height: 100%;
  background: var(--green);
}

.import-template-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.import-preview {
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--muted);
  line-height: 1.6;
}

.preview-summary {
  color: var(--text);
  font-weight: 700;
}

.preview-list {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.preview-list div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.preview-list span {
  color: var(--muted);
}

.preview-list strong,
.preview-list em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

.copy-btn {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  border-radius: 4px;
  color: #303743;
}

.copy-btn:hover {
  background: #eef2f8;
}

.copy-btn.copied {
  background: #e4f8dd;
  color: var(--green);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
  border: 1px solid transparent;
}

.tag.green {
  color: white;
  background: var(--green);
}

.tag.gray {
  color: #313947;
  background: #eef0f4;
}

.tag.yellow {
  color: #2f3136;
  background: var(--yellow);
}

.tag.blue {
  color: #174ea6;
  background: #e8f1ff;
  border-color: #bfd6ff;
}

.tag.red {
  color: #b42318;
  background: #fff1f0;
  border-color: #ffd1cc;
}

.tag.orange {
  color: #a15c00;
  background: #fff7e6;
  border-color: #ffe1ad;
}

.tag.copied {
  color: #237804;
  background: #eaf8e6;
  border-color: #b7eb8f;
}

.note-muted {
  color: var(--muted);
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 54px 0;
  color: #9ca3af;
}

.empty-state svg {
  width: 72px;
  height: 52px;
  color: #c9ced7;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 0;
  color: #4b5563;
}

.page-pill {
  min-width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: white;
}

.page-pill.active {
  border-color: #1677ff;
  color: #1677ff;
}

.admin-layout {
  display: grid;
  gap: 16px;
}

.admin-panel {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 18px;
}

.admin-create {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: 92px repeat(3, minmax(120px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 18px;
}

.admin-create > strong {
  align-self: center;
}

.link-tool {
  width: min(960px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
}

.link-tool-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.risk-hint {
  padding: 10px 12px;
  border: 1px solid #ffe1ad;
  border-radius: 6px;
  background: #fff7e6;
  color: #8a4b00;
  font-weight: 600;
}

.risk-hint.ok {
  border-color: #b7eb8f;
  background: #f6ffed;
  color: #237804;
}

.risk-hint.blocked {
  border-color: #ffd1cc;
  background: #fff1f0;
  color: #b42318;
}

.result-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.result-panel > p {
  margin: 0;
  color: var(--muted);
}

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

.redeem-admin-card {
  align-content: start;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  text-decoration: none;
}

.redeem-record-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.redeem-record-head p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.new-link-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #b7eb8f;
  border-radius: 6px;
  background: #f6ffed;
}

.new-link-box strong {
  overflow-wrap: anywhere;
  font-weight: 600;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(17, 24, 39, 0.34);
  padding: 18px;
}

.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 42px);
  overflow: auto;
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.modal.small {
  width: min(460px, 100%);
}

.modal.wide {
  width: min(980px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.modal-body {
  padding: 20px 22px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
}

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

.form-grid .full {
  grid-column: 1 / -1;
}

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

.detail-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fbfdff;
}

.detail-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.detail-value {
  min-height: 22px;
  overflow-wrap: anywhere;
}

.section-title {
  font-size: 15px;
  margin: 18px 0 10px;
  font-weight: 650;
}

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

.progress-list {
  display: grid;
  gap: 10px;
}

.progress-item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.progress-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #1677ff;
  display: grid;
  place-items: center;
  color: white;
  background: white;
}

.progress-item.done .progress-dot {
  background: #1677ff;
}

.toast-root {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 60;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 220px;
  max-width: 360px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.15);
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.toast.success {
  border-left: 4px solid var(--green);
}

.toast.error {
  border-left: 4px solid var(--red);
}

[data-icon] {
  width: 18px;
  height: 18px;
  display: inline-flex;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

[data-icon="menu"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 7h16v2H4V7Zm0 4h16v2H4v-2Zm0 4h16v2H4v-2Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 7h16v2H4V7Zm0 4h16v2H4v-2Zm0 4h16v2H4v-2Z'/%3E%3C/svg%3E");
}

[data-icon="parents"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.5 11a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7Zm7-1a3 3 0 1 1 .01-6.01A3 3 0 0 1 15.5 10ZM2 19.2C2 15.8 4.7 13 8.5 13s6.5 2.8 6.5 6.2V20H2v-.8ZM14.5 20c.3-1.8-.2-3.9-1.5-5.5.7-.3 1.5-.5 2.5-.5 3 0 5.5 2.2 5.5 5v1h-6.5Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.5 11a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7Zm7-1a3 3 0 1 1 .01-6.01A3 3 0 0 1 15.5 10ZM2 19.2C2 15.8 4.7 13 8.5 13s6.5 2.8 6.5 6.2V20H2v-.8ZM14.5 20c.3-1.8-.2-3.9-1.5-5.5.7-.3 1.5-.5 2.5-.5 3 0 5.5 2.2 5.5 5v1h-6.5Z'/%3E%3C/svg%3E");
}

[data-icon="import"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13 3v8.17l2.59-2.58L17 10l-5 5-5-5 1.41-1.41L11 11.17V3h2ZM5 19h14v-4h2v6H3v-6h2v4Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13 3v8.17l2.59-2.58L17 10l-5 5-5-5 1.41-1.41L11 11.17V3h2ZM5 19h14v-4h2v6H3v-6h2v4Z'/%3E%3C/svg%3E");
}

[data-icon="members"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm0 2c-4.1 0-7 2.7-7 6v1h14v-1c0-3.3-2.9-6-7-6Zm7-7V4h-2v3h-3v2h3v3h2V9h3V7h-3Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm0 2c-4.1 0-7 2.7-7 6v1h14v-1c0-3.3-2.9-6-7-6Zm7-7V4h-2v3h-3v2h3v3h2V9h3V7h-3Z'/%3E%3C/svg%3E");
}

[data-icon="keys"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 14a5 5 0 1 1 4.58-7H22v4h-2v2h-3v2h-3.42A5 5 0 0 1 7 14Zm0-3a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 4c3.86 0 7 2.69 7 6v1H0v-1c0-3.31 3.14-6 7-6Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 14a5 5 0 1 1 4.58-7H22v4h-2v2h-3v2h-3.42A5 5 0 0 1 7 14Zm0-3a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 4c3.86 0 7 2.69 7 6v1H0v-1c0-3.31 3.14-6 7-6Z'/%3E%3C/svg%3E");
}

[data-icon="redeem"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 7h-2.18A3 3 0 0 0 12 5.76 3 3 0 0 0 6.18 7H4a2 2 0 0 0-2 2v3h20V9a2 2 0 0 0-2-2ZM9 7a1 1 0 1 1 1-1 1 1 0 0 1-1 1Zm6 0a1 1 0 1 1 1-1 1 1 0 0 1-1 1ZM3 14v6a2 2 0 0 0 2 2h6v-8H3Zm10 8h6a2 2 0 0 0 2-2v-6h-8v8Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 7h-2.18A3 3 0 0 0 12 5.76 3 3 0 0 0 6.18 7H4a2 2 0 0 0-2 2v3h20V9a2 2 0 0 0-2-2ZM9 7a1 1 0 1 1 1-1 1 1 0 0 1-1 1Zm6 0a1 1 0 1 1 1-1 1 1 0 0 1-1 1ZM3 14v6a2 2 0 0 0 2 2h6v-8H3Zm10 8h6a2 2 0 0 0 2-2v-6h-8v8Z'/%3E%3C/svg%3E");
}

[data-icon="logs"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 3h14a2 2 0 0 1 2 2v16l-4-2-4 2-4-2-4 2-4-2V5a2 2 0 0 1 2-2Zm1 5h12V6H6v2Zm0 5h12v-2H6v2Zm0 5h8v-2H6v2Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 3h14a2 2 0 0 1 2 2v16l-4-2-4 2-4-2-4 2-4-2V5a2 2 0 0 1 2-2Zm1 5h12V6H6v2Zm0 5h12v-2H6v2Zm0 5h8v-2H6v2Z'/%3E%3C/svg%3E");
}

[data-icon="link-tool"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.9 12a5 5 0 0 1 5-5h4v2h-4a3 3 0 1 0 0 6h4v2h-4a5 5 0 0 1-5-5Zm5.1 1h6v-2H9v2Zm2-6h4a5 5 0 0 1 0 10h-4v-2h4a3 3 0 1 0 0-6h-4V7Zm9.5 11.1 1.4 1.4-2.4 2.4-1.4-1.4 2.4-2.4Zm-4.2.7 1.9 3.2-1.7 1-1.9-3.2 1.7-1Zm5.7-4.2 1 1.7-3.2 1.9-1-1.7 3.2-1.9Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.9 12a5 5 0 0 1 5-5h4v2h-4a3 3 0 1 0 0 6h4v2h-4a5 5 0 0 1-5-5Zm5.1 1h6v-2H9v2Zm2-6h4a5 5 0 0 1 0 10h-4v-2h4a3 3 0 1 0 0-6h-4V7Zm9.5 11.1 1.4 1.4-2.4 2.4-1.4-1.4 2.4-2.4Zm-4.2.7 1.9 3.2-1.7 1-1.9-3.2 1.7-1Zm5.7-4.2 1 1.7-3.2 1.9-1-1.7 3.2-1.9Z'/%3E%3C/svg%3E");
}

[data-icon="admin"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2 4 5.5v5.7c0 5 3.4 9.7 8 10.8 4.6-1.1 8-5.8 8-10.8V5.5L12 2Zm0 4a3 3 0 1 1 0 6 3 3 0 0 1 0-6Zm5.2 11.2A7.2 7.2 0 0 1 12 20a7.2 7.2 0 0 1-5.2-2.8c.6-2 2.6-3.2 5.2-3.2s4.6 1.2 5.2 3.2Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2 4 5.5v5.7c0 5 3.4 9.7 8 10.8 4.6-1.1 8-5.8 8-10.8V5.5L12 2Zm0 4a3 3 0 1 1 0 6 3 3 0 0 1 0-6Zm5.2 11.2A7.2 7.2 0 0 1 12 20a7.2 7.2 0 0 1-5.2-2.8c.6-2 2.6-3.2 5.2-3.2s4.6 1.2 5.2 3.2Z'/%3E%3C/svg%3E");
}

[data-icon="user-check"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm0 2c-4 0-7 2.6-7 6v1h10.5a6.5 6.5 0 0 1-.5-2.5c0-1.5.5-2.9 1.4-4-1.2-.4-2.7-.5-4.4-.5Zm9.1 6.8-3.4-3.4 1.4-1.4 2 2 4.6-4.6 1.4 1.4-6 6Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm0 2c-4 0-7 2.6-7 6v1h10.5a6.5 6.5 0 0 1-.5-2.5c0-1.5.5-2.9 1.4-4-1.2-.4-2.7-.5-4.4-.5Zm9.1 6.8-3.4-3.4 1.4-1.4 2 2 4.6-4.6 1.4 1.4-6 6Z'/%3E%3C/svg%3E");
}

[data-icon="power"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13 3h-2v10h2V3Zm4.83 2.17-1.42 1.42A7 7 0 1 1 7.6 6.58L6.17 5.17a9 9 0 1 0 11.66 0Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13 3h-2v10h2V3Zm4.83 2.17-1.42 1.42A7 7 0 1 1 7.6 6.58L6.17 5.17a9 9 0 1 0 11.66 0Z'/%3E%3C/svg%3E");
}

[data-icon="search"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4a6 6 0 1 1 0 12 6 6 0 0 1 0-12Zm0-2a8 8 0 1 0 4.9 14.32l4.39 4.39 1.42-1.42-4.39-4.39A8 8 0 0 0 10 2Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4a6 6 0 1 1 0 12 6 6 0 0 1 0-12Zm0-2a8 8 0 1 0 4.9 14.32l4.39 4.39 1.42-1.42-4.39-4.39A8 8 0 0 0 10 2Z'/%3E%3C/svg%3E");
}

[data-icon="download"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13 3h-2v10.17L7.41 9.59 6 11l6 6 6-6-1.41-1.41L13 13.17V3ZM5 19h14v2H5v-2Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13 3h-2v10.17L7.41 9.59 6 11l6 6 6-6-1.41-1.41L13 13.17V3ZM5 19h14v2H5v-2Z'/%3E%3C/svg%3E");
}

[data-icon="copy"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 1H4a2 2 0 0 0-2 2v12h2V3h12V1Zm3 4H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2Zm0 16H8V7h11v14Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 1H4a2 2 0 0 0-2 2v12h2V3h12V1Zm3 4H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2Zm0 16H8V7h11v14Z'/%3E%3C/svg%3E");
}

[data-icon="close"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m18.3 5.71-1.41-1.42L12 9.17 7.11 4.29 5.7 5.71 10.59 10.6 5.7 15.49l1.41 1.42L12 12.03l4.89 4.88 1.41-1.42-4.89-4.89 4.89-4.89Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m18.3 5.71-1.41-1.42L12 9.17 7.11 4.29 5.7 5.71 10.59 10.6 5.7 15.49l1.41 1.42L12 12.03l4.89 4.88 1.41-1.42-4.89-4.89 4.89-4.89Z'/%3E%3C/svg%3E");
}

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

  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    width: 250px;
    justify-items: stretch;
    box-shadow: var(--shadow);
  }

  .sidebar.expanded {
    transform: translateX(0);
  }

  .nav-text {
    display: block;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .topbar {
    padding: 16px;
  }

  .content-root {
    padding: 12px;
  }

  .page-hero,
  .page-hero-stats,
  .sms-ip-grid,
  .redeem-admin-grid,
  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .sms-ip-head {
    flex-direction: column;
  }

  .toolbar {
    align-items: stretch;
  }

  .admin-panel,
  .admin-create,
  .link-tool-form,
  .new-link-box {
    grid-template-columns: 1fr;
  }

  .redeem-record-head {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar > * {
    width: 100%;
  }

  .search-wrap {
    width: 100%;
  }

  .login-card {
    padding: 28px 22px 24px;
  }

  .login-highlights {
    grid-template-columns: 1fr;
  }
}
