:root {
  --bg: #040a14;
  --panel: rgba(13, 21, 35, 0.92);
  --panel-2: rgba(8, 14, 24, 0.96);
  --stroke: rgba(125, 146, 179, 0.24);
  --stroke-strong: rgba(166, 188, 222, 0.34);
  --text: #f4f7fb;
  --muted: #a4b0c1;
  --muted-2: #7b8798;
  --pill: rgba(6, 12, 22, 0.9);
  --pill-border: rgba(150, 171, 203, 0.22);
  --green: #4ade80;
  --green-bg: rgba(24, 58, 35, 0.82);
  --blue: #37b4ff;
  --blue-2: #6cc8ff;
  --red: #f97373;
  --amber: #fbbf24;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 999px;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(35, 76, 146, 0.2), transparent 34%),
    radial-gradient(circle at top right, rgba(10, 73, 130, 0.16), transparent 28%),
    linear-gradient(180deg, #06111f 0%, #030810 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body { padding: 16px; }

a { color: inherit; }

h1, h2, h3, h4, p { margin: 0; }

[hidden] { display: none !important; }

.shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 22px;
}

.panel {
  background: linear-gradient(180deg, rgba(14, 23, 38, 0.96), rgba(8, 14, 24, 0.98));
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.045), transparent 28%);
}

.hero {
  min-height: 260px;
  padding: 40px 40px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.hero h1 {
  font-size: clamp(44px, 6vw, 74px);
  line-height: 0.94;
  letter-spacing: -0.05em;
  max-width: 8ch;
}

.hero p,
.workspace-head p,
.stage-copy,
.helper-copy,
.status-copy,
.admin-copy,
.card-copy,
.table-note,
.flash {
  color: var(--muted);
  line-height: 1.48;
  font-size: 16px;
}

.chips,
.stage-meta,
.token-row,
.toolbar,
.flash-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chip,
.badge,
.code-pill,
.meta-pill,
.token,
.table-pill,
.flash {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--pill);
  border: 1px solid var(--pill-border);
  border-radius: var(--radius-sm);
  color: #e6edf8;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
}

.badge {
  padding: 10px 14px;
  color: var(--green);
  background: linear-gradient(180deg, rgba(17, 58, 34, 0.9), rgba(10, 35, 21, 0.96));
  border-color: rgba(74, 222, 128, 0.26);
}

.badge::before,
.table-pill.active::before,
.flash.success::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
  flex: 0 0 auto;
}

.badge.warn,
.table-pill.inactive,
.flash.error {
  color: var(--red);
  background: linear-gradient(180deg, rgba(52, 18, 22, 0.92), rgba(28, 11, 14, 0.96));
  border-color: rgba(249, 115, 115, 0.24);
}

.table-pill.inactive::before,
.flash.error::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
  flex: 0 0 auto;
}

.workspace,
.admin-grid {
  padding: 24px 24px 30px;
}

.workspace-head,
.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 20px;
  padding: 6px 10px 0;
}

.workspace-head h2,
.admin-head h2 {
  margin-bottom: 6px;
  font-size: clamp(28px, 2.8vw, 44px);
  letter-spacing: -0.04em;
  line-height: 1;
}

.stage,
.card,
.table-card {
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(11, 18, 30, 0.92), rgba(7, 12, 21, 0.98));
  border: 1px solid rgba(116, 136, 169, 0.26);
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.stage::after,
.card::after,
.table-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(103, 147, 224, 0.05), transparent 32%, transparent 70%, rgba(0,0,0,0.14));
}

.stage-inner,
.card-inner,
.table-card-inner {
  border-radius: 18px;
  border: 2px dashed rgba(220, 226, 236, 0.18);
  padding: 38px 26px 32px;
  background: linear-gradient(180deg, rgba(22, 21, 24, 0.88), rgba(18, 18, 22, 0.92));
  position: relative;
}

.stage-inner {
  min-height: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 24px;
}

.download-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(10, 18, 31, 0.94), rgba(4, 9, 15, 0.98));
  border: 1px solid rgba(141, 164, 200, 0.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 12px 32px rgba(0,0,0,0.28);
  font-size: 28px;
}

.stage-title {
  font-size: clamp(36px, 4vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  max-width: 14ch;
}

.entry-panel,
.form-panel {
  width: min(760px, 100%);
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(150, 171, 203, 0.18);
  background: rgba(6, 12, 22, 0.78);
  display: grid;
  gap: 14px;
}

.entry-row,
.form-grid,
.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
}

.form-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.file-row {
  grid-template-columns: 1.1fr 1.6fr 0.6fr 0.6fr 1fr;
}

.code-input,
.text-input,
.text-area,
.select-input {
  width: 100%;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(153, 176, 210, 0.24);
  background: rgba(8, 14, 24, 0.96);
  color: var(--text);
  font-size: 16px;
  outline: none;
}

.code-input {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.text-area {
  min-height: 108px;
  resize: vertical;
}

.code-input:focus,
.text-input:focus,
.text-area:focus,
.select-input:focus {
  border-color: rgba(95, 208, 255, 0.54);
  box-shadow: 0 0 0 3px rgba(55, 180, 255, 0.12);
}

.primary-btn,
.download-btn,
.secondary-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
  transition: transform 140ms ease, filter 140ms ease, border-color 140ms ease;
  cursor: pointer;
}

.primary-btn,
.download-btn {
  color: #07111c;
  background: linear-gradient(180deg, #5fd0ff, #28b0ff);
  border-color: rgba(130, 217, 255, 0.62);
  box-shadow: 0 10px 28px rgba(40, 176, 255, 0.24);
}

.secondary-btn {
  color: #dce7f4;
  background: rgba(10, 15, 24, 0.92);
  border-color: rgba(153, 176, 210, 0.22);
}

.danger-btn {
  color: #fff2f2;
  background: rgba(52, 18, 22, 0.94);
  border-color: rgba(249, 115, 115, 0.28);
}

.primary-btn:hover,
.download-btn:hover,
.secondary-btn:hover,
.danger-btn:hover { transform: translateY(-1px); filter: brightness(1.04); }

.helper-row,
.inline-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  text-align: left;
}

.helper-copy,
.table-note,
.admin-copy { font-size: 14px; }

.code-pill {
  padding: 9px 14px;
  font-size: 13px;
  color: #dce7f4;
}

.status-box,
.notice-box {
  width: min(760px, 100%);
  padding: 20px 18px;
  border-radius: 18px;
  border: 1px solid rgba(150, 171, 203, 0.18);
  background: rgba(6, 12, 22, 0.72);
  text-align: center;
}

.status-box.error,
.notice-box.error {
  border-color: rgba(249, 115, 115, 0.22);
  background: linear-gradient(180deg, rgba(40, 14, 18, 0.78), rgba(19, 10, 12, 0.92));
}

.status-title {
  font-size: 22px;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(0, 1fr);
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #e6edf8;
}

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

.table-scroll {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(153, 176, 210, 0.14);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.table th {
  color: #dce7f4;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table td { color: var(--muted); }

.table strong { color: var(--text); }

.table code,
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #eef4fb;
}

.table-pill.active {
  color: var(--green);
  background: linear-gradient(180deg, rgba(17, 58, 34, 0.9), rgba(10, 35, 21, 0.96));
  border-color: rgba(74, 222, 128, 0.26);
}

.flash-stack {
  margin-top: 12px;
  gap: 10px;
}

.flash.success {
  color: var(--green);
  background: linear-gradient(180deg, rgba(17, 58, 34, 0.9), rgba(10, 35, 21, 0.96));
  border-color: rgba(74, 222, 128, 0.26);
}

.flash.error {
  background: linear-gradient(180deg, rgba(52, 18, 22, 0.92), rgba(28, 11, 14, 0.96));
  border-color: rgba(249, 115, 115, 0.24);
}

.admin-copy-list {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.helper-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(153, 176, 210, 0.18);
  background: rgba(6, 12, 22, 0.6);
  display: grid;
  gap: 10px;
}

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

/* --- URL List Adjustments --- */
.url-list-container {
  width: min(760px, 100%);
  background: rgba(6, 12, 22, 0.78);
  border: 1px solid rgba(150, 171, 203, 0.18);
  border-radius: 18px;
  padding: 24px;
  text-align: left;
  margin-top: 10px;
}

.url-line {
  padding: 12px 0;
  border-bottom: 1px dashed rgba(150, 171, 203, 0.2);
}

.url-line:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.url-line:first-child {
  padding-top: 0;
}

.url-line a {
  color: var(--blue-2);
  text-decoration: none;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  transition: opacity 140ms ease;
}

.url-line a:hover {
  text-decoration: underline;
  opacity: 0.8;
}

@media (max-width: 1180px) {
  .stage-inner { min-height: 560px; }
  .admin-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { padding: 10px; }
  .hero,
  .workspace,
  .admin-grid { padding: 16px; }
  .workspace-head,
  .admin-head {
    flex-direction: column;
    align-items: stretch;
  }
  .stage-inner,
  .card-inner,
  .table-card-inner {
    min-height: 500px;
    padding: 28px 18px 24px;
  }
  .entry-row,
  .form-grid.two-col {
    grid-template-columns: 1fr;
  }
  .hero h1 { font-size: 42px; }
  .stage-title { font-size: 34px; }
}