:root {
  --bg: #0f0e17;
  --surface: #1a1825;
  --surface-2: #241f38;
  --primary: #8b5cf6;
  --primary-dark: #6d28d9;
  --text: #f2f2f7;
  --text-dim: #a5a3b8;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(160deg, #0f0e17 0%, #1a1330 100%);
  color: var(--text);
  font-family: "Segoe UI", Assistant, Arial, sans-serif;
  min-height: 100vh;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  min-height: 100vh;
}

h1, h2, h3 {
  margin: 0 0 8px;
}

.brand {
  text-align: center;
  margin-bottom: 28px;
}

.brand .logo {
  font-size: 40px;
  margin-bottom: 6px;
}

.brand h1 {
  font-size: 24px;
  background: linear-gradient(90deg, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand p {
  color: var(--text-dim);
  margin: 0;
  font-size: 14px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.25);
}

.menu-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: var(--surface);
  border: 1px solid #2c2740;
  color: var(--text);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  font-size: 16px;
  cursor: pointer;
  text-align: right;
  transition: transform 0.12s ease, background 0.12s ease;
}

.menu-btn:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
}

.menu-btn .icon {
  font-size: 26px;
}

.menu-btn .label {
  font-weight: 600;
  font-size: 16px;
}

.menu-btn .desc {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 2px;
}

button, input, select {
  font-family: inherit;
}

.btn {
  display: inline-block;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

.btn.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid #34304a;
}

.btn.danger {
  background: var(--danger);
}

.btn.small {
  width: auto;
  padding: 8px 14px;
  font-size: 13px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.back-btn {
  background: var(--surface-2);
  border: none;
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="url"],
.field input[type="search"] {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #34304a;
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
}

.link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

.link-row input {
  flex: 1;
}

.link-row .remove-link {
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 18px;
}

.switch {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 46px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: #3a3552;
  border-radius: 26px;
  cursor: pointer;
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background: var(--primary);
}

.switch input:checked + .slider::before {
  transform: translateX(-20px);
}

.msg {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 14px;
}

.msg.error {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.3);
}

.msg.success {
  background: rgba(34,197,94,0.15);
  color: #86efac;
  border: 1px solid rgba(34,197,94,0.3);
}

.share-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
}

.share-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  direction: ltr;
  text-align: left;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
}

.list-item .title {
  font-weight: 600;
}

.list-item .sub {
  color: var(--text-dim);
  font-size: 12px;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 30px 10px;
}

.public-page .brand-icon {
  font-size: 30px;
}

.link-btn {
  display: block;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  text-align: center;
  font-weight: 600;
  border: 1px solid #34304a;
}

.link-btn:active {
  transform: scale(0.98);
}

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text-dim);
  margin-inline-start: 8px;
}
