:root {
  --bg: #0b0b16;
  --panel: #121225;
  --panel-2: #181833;
  --border: rgba(168, 130, 255, 0.28);
  --text: #f2edff;
  --muted: #9d95b8;
  --accent: #c084fc;
  --accent-2: #fb7185;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --input: #0f0f1f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(192, 132, 252, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(251, 113, 133, 0.14), transparent 50%),
    var(--bg);
}

.app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

h1 {
  margin: 0 0 6px;
  font-size: 1.7rem;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #f5d0fe, #fda4af);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e9d5ff;
}

.sub, .hint, .muted { color: var(--muted); }
.hint { margin: 0 0 16px; font-size: 0.92rem; line-height: 1.45; }

.badge {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(24, 24, 51, 0.85);
  font-size: 0.82rem;
  white-space: nowrap;
}
.badge.ok { border-color: rgba(52, 211, 153, 0.45); color: var(--ok); }
.badge.warn { border-color: rgba(251, 191, 36, 0.45); color: var(--warn); }
.badge.err { border-color: rgba(248, 113, 113, 0.45); color: var(--danger); }

.grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
}

.panel {
  background: linear-gradient(180deg, rgba(24, 24, 51, 0.96), rgba(15, 15, 31, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: #d8cfff;
}

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

input, select, textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(168, 130, 255, 0.25);
  background: var(--input);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(192, 132, 252, 0.7);
  box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.12);
}

textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.45;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.actions.compact { margin-bottom: 12px; }
.actions.full { grid-column: 1 / -1; margin-top: 4px; }

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: #1a1025;
  background: linear-gradient(135deg, #f0abfc, #fb7185);
  transition: transform 0.12s ease, opacity 0.12s ease;
}
button:hover { transform: translateY(-1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
button.secondary {
  color: var(--text);
  background: #2a2150;
  border: 1px solid rgba(192, 132, 252, 0.3);
}
button.ghost {
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(157, 149, 184, 0.3);
}

.ws-box {
  margin-top: 16px;
  border: 1px solid rgba(168, 130, 255, 0.18);
  border-radius: 12px;
  background: rgba(10, 10, 22, 0.55);
  padding: 12px;
}

.ws-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.ws-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.ws-list {
  max-height: 320px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ws-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
  cursor: pointer;
}

.ws-item.free { border-color: rgba(52, 211, 153, 0.18); }
.ws-item.paid { border-color: rgba(251, 191, 36, 0.18); opacity: 0.92; }
.ws-item input { width: auto; margin-top: 3px; }
.ws-item .meta { color: var(--muted); font-size: 0.75rem; word-break: break-all; }
.ws-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
}
.pill-free { background: rgba(52, 211, 153, 0.15); color: #6ee7b7; }
.pill-paid { background: rgba(251, 191, 36, 0.15); color: #fcd34d; }
.pill-credits {
  background: rgba(125, 211, 252, 0.16);
  color: #7dd3fc;
  font-variant-numeric: tabular-nums;
}
.small { font-size: 0.78rem; margin-bottom: 8px; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8em;
  color: #f5d0fe;
}

.cookie-box {
  border: 1px solid rgba(168, 130, 255, 0.2);
  border-radius: 12px;
  background: rgba(10, 10, 22, 0.45);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  background: #2a2150;
  border: 1px solid rgba(192, 132, 252, 0.3);
  margin: 0;
}

.upload-btn:hover {
  transform: translateY(-1px);
}

#cookiesText {
  min-height: 150px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.4;
  /* Make the paste area unmistakable against the dark card. */
  border: 1.6px dashed rgba(192, 132, 252, 0.6);
  background: #17172f;
  box-shadow: inset 0 0 0 1px rgba(192, 132, 252, 0.08);
}
#cookiesText:focus {
  border-style: solid;
  border-color: rgba(192, 132, 252, 0.85);
}
#cookiesText::placeholder {
  color: #8b83ad;
}
.cookie-box label.full:first-of-type {
  font-weight: 700;
  color: #efe9ff;
}

.feedback {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(192, 132, 252, 0.08);
  border: 1px solid rgba(192, 132, 252, 0.18);
  font-size: 0.88rem;
  line-height: 1.4;
}
.feedback.error {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.25);
  color: #fecaca;
}
.feedback.ok {
  background: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.25);
  color: #bbf7d0;
}

.hidden { display: none !important; }

@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
  header { flex-direction: column; }
  .form { grid-template-columns: 1fr; }
}
