:root {
  color-scheme: dark;
  --bg: #0b1220;
  --card: rgba(15, 23, 42, 0.86);
  --line: rgba(148, 163, 184, 0.18);
  --text: #e5eefc;
  --muted: #9fb0cb;
  --accent: #60a5fa;
  --accent-2: #34d399;
  --warning: #f59e0b;
  --danger: #f87171;
  --shadow: 0 18px 60px rgba(2, 6, 23, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(52, 211, 153, 0.12), transparent 30%),
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.18), transparent 26%),
    linear-gradient(180deg, #08101e 0%, #0b1220 100%);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 40px auto 56px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 24px;
  padding: 28px;
  margin-bottom: 24px;
}

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

.hero h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 0;
}

.hero-note {
  padding: 18px;
  border-radius: 16px;
  background: rgba(15, 118, 110, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.18);
  align-self: start;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-2);
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.grid {
  display: grid;
  gap: 24px;
}

.two-col {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
}

.compact {
  gap: 16px;
  align-items: end;
}

.stack-lg > * + * {
  margin-top: 18px;
}

.stack-md > * + * {
  margin-top: 14px;
}

form.card,
.tips,
#resultSection {
  padding: 24px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

textarea,
input[type="text"],
input[readonly] {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  padding: 14px 16px;
  font-size: 0.96rem;
  line-height: 1.6;
  outline: none;
}

textarea:focus,
input[type="text"]:focus,
input[readonly]:focus {
  border-color: rgba(96, 165, 250, 0.72);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.12);
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 8px;
  line-height: 1.6;
}

.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.76);
}

.checkbox-wrap label {
  margin: 0;
  font-weight: 500;
}

.checkbox-wrap input {
  width: 18px;
  height: 18px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: white;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.66;
  cursor: not-allowed;
  transform: none;
}

button.secondary {
  background: rgba(30, 41, 59, 0.92);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

button.small {
  min-width: 74px;
  padding: 12px 14px;
}

.tips ul,
.client-box ul {
  padding-left: 18px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.client-box {
  padding: 16px;
  border-radius: 16px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.14);
}

.hidden {
  display: none !important;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.counts span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.16);
  color: #bbf7d0;
  font-size: 0.92rem;
}

.warning {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.18);
  color: #fde68a;
  line-height: 1.75;
  white-space: pre-wrap;
}

.url-row label {
  margin-bottom: 10px;
}

.copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.table-wrap th,
.table-wrap td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 0.92rem;
}

.table-wrap th {
  color: #bfdbfe;
  background: rgba(30, 41, 59, 0.68);
}

.table-wrap tr:last-child td {
  border-bottom: none;
}

@media (max-width: 920px) {
  .hero,
  .two-col {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 20px, 1120px);
    margin-top: 20px;
    margin-bottom: 36px;
  }

  .card,
  form.card,
  .tips,
  #resultSection {
    border-radius: 16px;
  }

  .hero,
  form.card,
  .tips,
  #resultSection {
    padding: 18px;
  }

  .copy-row {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .sub-grid {
    grid-template-columns: 1fr;
  }

  .sub-card-wide {
    grid-column: auto;
  }

  .sub-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: stretch;
  }

  .sub-actions input {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .sub-actions button {
    width: 100%;
    min-width: 0;
    justify-self: stretch;
  }

  .sub-actions .small {
    padding-left: 0;
    padding-right: 0;
    white-space: nowrap;
  }
}

.empty-state {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.14);
  color: var(--muted);
  line-height: 1.8;
}

#resultSection {
  margin-top: 24px;
}

.section-desc {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
}

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

.stat-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(120, 140, 180, 0.16);
  background: rgba(255, 255, 255, 0.02);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 28px;
  line-height: 1;
}

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

.sub-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(120, 140, 180, 0.16);
  background: rgba(255, 255, 255, 0.025);
}

.sub-card-head {
  margin-bottom: 14px;
}

.client-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.client-icon{
  width:42px;
  height:42px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(59,130,246,.15);
  border:1px solid rgba(96,165,250,.22);
}

.client-meta h3 {
  margin: 0;
  font-size: 18px;
}

.client-meta p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.sub-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
}

.sub-actions input {
  min-width: 0;
}

.preview-wrap {
  margin-top: 8px;
}

.sub-card-wide {
  grid-column: 1 / -1;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(6px);
}

.modal-dialog {
  position: relative;
  width: min(92vw, 420px);
  margin: 8vh auto 0;
  padding: 20px;
  border-radius: 20px;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  z-index: 1;
}

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

.modal-body {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.qr-box {
  width: 240px;
  min-height: 240px;
  padding: 10px;
  border-radius: 18px;
  background: #fff;
  display: grid;
  place-items: center;
}

.qr-text {
  word-break: break-all;
  text-align: center;
}

.client-icon img{
  width:22px;
  height:22px;
  display:block;
}

.hero-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-logo {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .hero-title {
    gap: 10px;
  }
}