:root {
  --background: #f8f9ff;
  --surface: #ffffff;
  --surface-low: #eff4ff;
  --surface-mid: #e5eeff;
  --surface-high: #dce9ff;
  --primary: #4648d4;
  --primary-deep: #2e3192;
  --primary-soft: #e1e0ff;
  --accent: #0f766e;
  --accent-warm: #d97706;
  --text: #0b1c30;
  --muted: #5d6474;
  --outline: #c7c4d7;
  --outline-strong: #767586;
  --success: #16834a;
  --warning: #a56a00;
  --info: #2f62c4;
  --danger: #b42318;
  --shadow: 0 18px 42px rgba(20, 31, 55, 0.12);
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
  scrollbar-width: thin;
  scrollbar-color: rgba(70, 72, 212, 0.42) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(70, 72, 212, 0.58), rgba(15, 118, 110, 0.5));
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(70, 72, 212, 0.78), rgba(15, 118, 110, 0.68));
  background-clip: padding-box;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(70, 72, 212, 0.07) 0 240px, transparent 240px),
    radial-gradient(circle at top right, rgba(70, 72, 212, 0.08), transparent 330px),
    var(--background);
  font: 16px/1.5 Arial, Helvetica, sans-serif;
}

body.dark-mode {
  --background: #101827;
  --surface: #172235;
  --surface-low: #21314a;
  --surface-mid: #2b3b56;
  --surface-high: #354662;
  --primary: #9fa4ff;
  --primary-deep: #c8caff;
  --primary-soft: #303466;
  --text: #edf3ff;
  --muted: #bac5d8;
  --outline: #58667e;
  --outline-strong: #a7b2c8;
  background: var(--background);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: static;
  z-index: auto;
  flex: 0 0 64px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 18px;
  height: 64px;
  margin-bottom: 70px;
  padding: 0 clamp(16px, 4vw, 48px);
  background: var(--background);
  border-bottom: 1px solid rgba(118, 117, 134, 0.18);
  box-shadow: 0 8px 22px rgba(20, 31, 55, 0.04);
}

.category-view-active .topbar {
  margin-bottom: 16px;
}

.brand {
  grid-column: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--primary);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: inset 0 -8px 18px rgba(0, 0, 0, 0.16);
  font: 700 15px/1 "Courier New", monospace;
}

.desktop-nav {
  grid-column: 2;
  display: none;
  align-items: center;
  justify-self: end;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.desktop-nav a {
  transition: color 160ms ease;
}

.desktop-nav a:hover,
.desktop-nav .active {
  color: var(--primary);
}

.avatar-button {
  grid-column: 3;
  justify-self: end;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  background: var(--surface-high);
  font-size: 13px;
  font-weight: 700;
}

.avatar-icon {
  display: block;
}

.page-shell {
  flex: 1 0 auto;
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 34px clamp(16px, 4vw, 48px) 112px;
}

.toolbar {
  position: relative;
  z-index: 3;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  gap: 20px;
  padding: 0;
  margin-bottom: 64px;
  background: transparent;
  overflow: visible;
}

.result-meta {
  position: relative;
  z-index: 1;
  display: block;
  min-height: 18px;
  margin: 0 0 76px;
  color: var(--outline-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.search-field {
  position: relative;
  display: flex;
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.search-field span {
  position: absolute;
  top: 50%;
  left: 18px;
  color: var(--outline-strong);
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0;
}

.search-field span::before {
  display: block;
  width: 18px;
  height: 18px;
  content: "";
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-field span::after {
  position: absolute;
  right: -5px;
  bottom: 1px;
  width: 8px;
  height: 2px;
  content: "";
  background: currentColor;
  border-radius: 2px;
  transform: rotate(45deg);
  transform-origin: center;
}

.search-field input {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: none;
  inline-size: 100%;
  min-inline-size: 0;
  appearance: none;
  min-height: 56px;
  padding: 0 18px 0 52px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid rgba(118, 117, 134, 0.24);
  border-radius: 8px;
  outline: none;
  box-shadow: 0 10px 30px rgba(20, 31, 55, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

#searchInput {
  width: 100%;
}

.search-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(70, 72, 212, 0.11);
}

.category-tags,
.filter-row {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
  row-gap: 12px;
  width: 100%;
  min-height: 40px;
  padding-bottom: 0;
}

.chip,
.primary-button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.chip {
  gap: 8px;
  padding: 0 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(118, 117, 134, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.chip:hover {
  border-color: rgba(70, 72, 212, 0.45);
  background: var(--surface-low);
}

.chip.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  border-color: var(--primary);
}

.chip-dashed {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.55);
  border-style: dashed;
  border-color: rgba(70, 72, 212, 0.45);
}

.chip .svg-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.library-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-top: 4px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--outline-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
}

.primary-button {
  gap: 8px;
  min-width: max-content;
  padding: 0 20px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  border: 1px solid var(--primary);
  box-shadow: 0 8px 18px rgba(70, 72, 212, 0.18);
}

.primary-button:hover,
.copy-button:hover,
.fab:hover {
  background: #393bb9;
}

.primary-button:active,
.chip:active,
.copy-button:active,
.fab:active,
.icon-button:active,
.card-action:active {
  transform: scale(0.97);
}

.prompt-grid {
  position: relative;
  z-index: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  clear: both;
  margin-top: 0;
}

.prompt-card {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 18px;
  min-height: 176px;
  padding: 18px;
  text-align: left;
  color: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.96)),
    var(--surface);
  border: 1px solid rgba(118, 117, 134, 0.2);
  border-radius: 8px;
  box-shadow: none;
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.prompt-card::after {
  position: absolute;
  right: -50px;
  bottom: -80px;
  width: 180px;
  height: 180px;
  content: "";
  background: conic-gradient(from 210deg, rgba(70, 72, 212, 0.13), rgba(15, 118, 110, 0.08), transparent 52%);
  border-radius: 50%;
  pointer-events: none;
}

.prompt-card:hover {
  border-color: rgba(70, 72, 212, 0.32);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.visual-drop {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 104px;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: var(--outline-strong);
  background:
    linear-gradient(145deg, rgba(220, 233, 255, 0.92), rgba(225, 224, 255, 0.7)),
    var(--surface-high);
  border: 1px dashed rgba(70, 72, 212, 0.34);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.visual-drop strong {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  border-radius: 50%;
  font-size: 25px;
  line-height: 1;
}

.prompt-card-body {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.card-topline,
.card-actions,
.card-meta-line {
  display: flex;
  align-items: center;
}

.card-topline {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.tag {
  max-width: 100%;
  padding: 3px 8px;
  color: var(--primary-deep);
  background: rgba(225, 224, 255, 0.72);
  border: 1px solid rgba(70, 72, 212, 0.13);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-actions {
  gap: 4px;
  flex: none;
  padding: 3px;
  background: rgba(239, 244, 255, 0.82);
  border: 1px solid rgba(118, 117, 134, 0.16);
  border-radius: 999px;
}

.card-action,
.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.72);
  border: 0;
  border-radius: 50%;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  transition: background 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.card-action:hover,
.icon-button:hover {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(70, 72, 212, 0.2);
}

.card-action.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.card-action.copied {
  color: #ffffff;
  background: var(--success);
}

.svg-icon {
  display: block;
  width: 19px;
  height: 19px;
}

.svg-icon-filled {
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.12));
}

.prompt-card h3 {
  margin: 0 0 8px;
  font-size: 23px;
  line-height: 1.25;
}

.prompt-card:hover h3 {
  color: var(--primary);
}

.prompt-card p {
  display: -webkit-box;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta-line {
  gap: 10px;
  margin-top: 18px;
  color: var(--outline-strong);
  font-size: 12px;
  font-weight: 700;
  flex-wrap: wrap;
}

.visibility-badge,
.owner-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  color: var(--primary-deep);
  background: var(--primary-soft);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.owner-badge {
  color: var(--muted);
  background: var(--surface-low);
  text-transform: none;
}

.empty-state {
  padding: 64px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--outline);
  border-radius: 8px;
}

.empty-icon {
  display: block;
  margin: 0 auto 18px;
  color: var(--primary);
}

.empty-state h2 {
  color: var(--text);
}

.settings-view {
  display: grid;
  gap: 24px;
}

.settings-profile,
.settings-list-card,
.settings-storage {
  background: var(--surface);
  border: 1px solid rgba(118, 117, 134, 0.2);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(20, 31, 55, 0.05);
}

.settings-profile {
  display: grid;
  justify-items: center;
  padding: clamp(28px, 5vw, 40px);
  text-align: center;
}

.settings-avatar-wrap {
  position: relative;
  margin-bottom: 18px;
}

.settings-avatar {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(70, 72, 212, 0.18);
  font-size: 48px;
  font-weight: 700;
}

.settings-avatar-edit {
  position: absolute;
  right: -8px;
  bottom: -8px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  border: 2px solid var(--surface);
  border-radius: 50%;
}

.settings-profile h1 {
  margin: 0 0 4px;
  font-size: 28px;
}

.settings-profile p {
  margin: 0 0 18px;
  color: var(--muted);
}

.settings-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.settings-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  color: var(--text);
  background: var(--surface-low);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.settings-badges .active {
  color: #ffffff;
  background: var(--primary);
}

.settings-list-card {
  overflow: hidden;
}

.settings-list-card header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(118, 117, 134, 0.12);
}

.settings-list-card h2,
.settings-support h2,
.settings-storage h2 {
  margin: 0;
  font-size: 24px;
}

.settings-list {
  display: grid;
}

.settings-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px 24px;
  text-align: left;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(118, 117, 134, 0.1);
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row:hover {
  background: var(--surface-low);
}

.settings-row-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--primary);
  background: var(--surface-low);
  border-radius: 8px;
}

.settings-row-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.settings-row-text strong {
  font-size: 16px;
}

.settings-row-text span {
  color: var(--muted);
  font-size: 14px;
}

.settings-chevron {
  color: var(--outline-strong);
  font-size: 30px;
  transition: transform 140ms ease;
}

.settings-row:hover .settings-chevron {
  transform: translateX(3px);
}

.settings-switch {
  position: relative;
  width: 54px;
  height: 28px;
  padding: 4px;
  background: rgba(70, 72, 212, 0.18);
  border-radius: 999px;
}

.settings-switch span {
  display: block;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  transition: transform 180ms ease;
}

.settings-switch.on span {
  transform: translateX(26px);
}

.settings-support {
  position: relative;
  min-height: 210px;
  padding: 26px;
  overflow: hidden;
  color: #ffffff;
  background: var(--primary);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(70, 72, 212, 0.18);
}

.settings-support div {
  position: relative;
  z-index: 1;
}

.settings-support p {
  max-width: 420px;
  margin: 8px 0 22px;
  opacity: 0.9;
}

.settings-support button {
  min-height: 42px;
  padding: 0 18px;
  color: var(--primary);
  background: #ffffff;
  border: 0;
  border-radius: 8px;
  font-weight: 700;
}

.settings-support-icon {
  position: absolute;
  right: -14px;
  bottom: -20px;
  opacity: 0.2;
}

.settings-storage {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.settings-storage-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  background: var(--surface-high);
  border-radius: 999px;
}

.settings-storage-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
  transition: width 180ms ease;
}

.settings-storage p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.visibility-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--outline-strong);
  background: var(--surface-low);
  border: 1px solid rgba(118, 117, 134, 0.18);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.visibility-control select {
  min-height: 26px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
  font-weight: 700;
}

.category-manage-view {
  display: grid;
  align-content: start;
  gap: 12px;
  padding-top: 0;
  padding-bottom: 80px;
}

.category-manage-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  max-width: 720px;
  width: 100%;
  min-height: 44px;
  margin: 0 auto 6px;
}

.category-manage-header h1 {
  margin: 0;
  color: var(--primary);
  font-size: 26px;
  text-align: center;
}

.category-manage-controls,
.category-card-list {
  width: min(100%, 720px);
  margin: 0 auto;
}

.category-manage-controls {
  display: grid;
  gap: 8px;
  align-content: start;
}

.category-search-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  height: 48px;
  min-height: 0;
  padding: 0 16px;
  color: var(--outline-strong);
  background: var(--surface);
  border: 1px solid rgba(118, 117, 134, 0.24);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(20, 31, 55, 0.04);
}

.category-search-field input {
  width: 100%;
  min-width: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}

.category-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--surface-low);
  border: 1px solid rgba(118, 117, 134, 0.18);
  border-radius: 8px;
}

.category-checkline,
.category-card-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.category-checkline input,
.category-card-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.category-checkbox {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  background: var(--surface);
  border: 2px solid var(--outline);
  border-radius: 5px;
}

.category-checkline input:checked + .category-checkbox,
.category-card-check input:checked + .category-checkbox {
  background: var(--primary);
  border-color: var(--primary);
}

.category-checkline input:checked + .category-checkbox::after,
.category-card-check input:checked + .category-checkbox::after {
  width: 9px;
  height: 5px;
  content: "";
  border-bottom: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.category-checkline span:last-child {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.category-delete-selected {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  color: var(--danger);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.category-delete-selected:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.category-delete-selected:hover {
  background: rgba(180, 35, 24, 0.1);
}

.category-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid rgba(118, 117, 134, 0.2);
  border-radius: 8px;
}

.category-inline-form input {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface-low);
  border: 1px solid rgba(118, 117, 134, 0.22);
  border-radius: 8px;
  outline: none;
}

.category-inline-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(70, 72, 212, 0.1);
}

.category-card-list {
  display: grid;
  gap: 7px;
}

.category-manage-card {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid rgba(118, 117, 134, 0.22);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(20, 31, 55, 0.04);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.category-manage-card:hover {
  border-color: rgba(70, 72, 212, 0.34);
  box-shadow: 0 10px 26px rgba(20, 31, 55, 0.08);
}

.category-card-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--category-color, var(--primary));
  background: var(--surface-high);
  border-radius: 8px;
}

.category-card-body {
  min-width: 0;
}

.category-card-body h2 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
}

.category-card-body p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.category-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.72;
  transition: opacity 140ms ease;
}

.category-manage-card:hover .category-card-actions {
  opacity: 1;
}

.category-card-actions button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.category-card-actions button:hover {
  color: var(--primary);
  background: var(--surface-low);
}

.drag-handle {
  cursor: grab;
}

.category-empty {
  margin: 0;
  padding: 20px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed rgba(118, 117, 134, 0.28);
  border-radius: 8px;
  text-align: center;
}

.category-edit-view {
  display: grid;
  align-content: start;
  gap: 24px;
  padding-bottom: 112px;
}

.category-edit-heading,
.category-edit-form {
  width: min(100%, 720px);
  margin: 0 auto;
}

.category-edit-heading h1 {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  line-height: 1.2;
}

.category-edit-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

.category-edit-form {
  display: grid;
  gap: 26px;
}

.category-edit-field,
.category-edit-section {
  display: grid;
  gap: 12px;
}

.category-edit-field span,
.category-edit-section h2 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.category-edit-field input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid rgba(118, 117, 134, 0.22);
  border-radius: 8px;
  outline: none;
  box-shadow: 0 4px 20px rgba(20, 31, 55, 0.03);
}

.category-edit-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(70, 72, 212, 0.1);
}

.category-icon-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.category-icon-choice {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid rgba(118, 117, 134, 0.22);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(20, 31, 55, 0.03);
}

.category-icon-choice.selected {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

.category-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.category-color-choice {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #ffffff;
  background: var(--choice-color);
  border: 0;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(20, 31, 55, 0.12);
}

.category-color-choice.selected {
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--choice-color);
}

.category-delete-button {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  color: var(--danger);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-weight: 700;
}

.category-delete-button:hover {
  background: rgba(180, 35, 24, 0.08);
}

.category-edit-actions {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 12px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: var(--surface-mid);
  border-top: 1px solid rgba(118, 117, 134, 0.18);
}

.category-edit-actions button {
  min-height: 48px;
  border-radius: 8px;
}

.fab {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 25;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 14px 30px rgba(70, 72, 212, 0.28);
  font-size: 32px;
  line-height: 1;
}

.mobile-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 26;
  display: flex;
  align-items: center;
  justify-content: space-around;
  min-height: 76px;
  padding: 8px 16px 12px;
  background: rgba(248, 249, 255, 0.95);
  border-top: 1px solid rgba(118, 117, 134, 0.18);
  backdrop-filter: blur(16px);
}

.mobile-nav a {
  display: inline-grid;
  min-width: 92px;
  place-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mobile-nav .active {
  color: var(--primary);
}

.mobile-nav .active span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 18px;
  color: var(--text);
  background: var(--primary-soft);
  border-radius: 999px;
}

.nav-icon {
  display: block;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 31, 55, 0.42);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(100%, 680px);
  max-height: min(820px, calc(100vh - 36px));
  overflow: auto;
  padding: clamp(20px, 4vw, 32px);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(12, 18, 34, 0.28);
}

.prompt-full-view,
.prompt-form-view {
  display: block;
  padding-top: 0;
}

.prompt-full-card {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 28px);
  background: var(--surface);
  border: 1px solid rgba(118, 117, 134, 0.18);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(20, 31, 55, 0.08);
}

.prompt-form-view .prompt-full-card {
  width: min(100%, 720px);
}

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

.prompt-content-block {
  position: relative;
  padding: 22px;
  background: var(--surface-low);
  border: 1px solid rgba(118, 117, 134, 0.24);
  border-radius: 8px;
}

.copy-button {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 34px;
  padding: 0 13px;
  color: #ffffff;
  background: var(--primary);
  border: 0;
}

pre {
  margin: 0;
  padding-top: 32px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--primary);
  font: 500 15px/1.7 Arial, Helvetica, sans-serif;
}

#modalContent {
  font-family: Arial, Helvetica, sans-serif;
}

.variable-token {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  color: var(--primary-deep);
  background: rgba(225, 224, 255, 0.95);
  border: 1px solid rgba(70, 72, 212, 0.2);
  border-radius: 6px;
  font-weight: 700;
}

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

.detail-list div {
  padding: 14px;
  background: var(--surface-low);
  border-radius: 8px;
}

.detail-list dt {
  margin-bottom: 4px;
  color: var(--outline-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.form-card {
  display: grid;
  gap: 16px;
}

.form-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-card input,
.form-card textarea,
.form-card select {
  width: 100%;
  padding: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid rgba(118, 117, 134, 0.3);
  border-radius: 8px;
  outline: none;
}

.form-card textarea {
  resize: vertical;
}

.form-card input:focus,
.form-card textarea:focus,
.form-card select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(70, 72, 212, 0.1);
}

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

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid rgba(118, 117, 134, 0.3);
  border-radius: 8px;
  outline: none;
}

.custom-select-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-button .svg-icon {
  flex: 0 0 auto;
  color: var(--outline-strong);
  transition: transform 140ms ease;
}

.custom-select.open .custom-select-button .svg-icon {
  transform: rotate(180deg);
}

.custom-select-button:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(70, 72, 212, 0.1);
}

.custom-select-options {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 12;
  display: grid;
  max-height: 220px;
  padding: 6px;
  overflow: auto;
  background: #ffffff;
  border: 1px solid rgba(118, 117, 134, 0.24);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(20, 31, 55, 0.16);
}

.custom-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 14px;
}

.custom-select-option:hover,
.custom-select-option.selected {
  color: var(--primary-deep);
  background: var(--primary-soft);
}

.custom-select-option.selected {
  font-weight: 700;
}

.checkbox-line {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 10px !important;
}

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

.wide {
  width: 100%;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.text-button,
.secondary-button {
  min-height: 40px;
  border-radius: 999px;
  font-weight: 700;
}

.text-button {
  color: var(--primary);
  background: transparent;
  border: 0;
}

.secondary-button {
  padding: 0 18px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid rgba(70, 72, 212, 0.2);
}

.danger-button {
  background: var(--danger);
  box-shadow: 0 12px 26px rgba(190, 18, 60, 0.22);
}

.danger-button:hover {
  background: #9f1239;
}

.auth-card,
.account-card,
.wallet-card {
  border-top: 4px solid var(--primary);
}

.confirm-card {
  width: min(100%, 440px);
  border-top: 4px solid var(--danger);
}

.confirm-message {
  margin: 4px 0 22px;
  color: var(--muted);
  line-height: 1.55;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

#authModal {
  align-items: center;
  justify-items: center;
  overflow-y: auto;
  padding-block: 18px;
  background:
    radial-gradient(circle at 50% 18%, rgba(70, 72, 212, 0.28), transparent 360px),
    rgba(11, 18, 32, 0.66);
}

.auth-card {
  position: relative;
  width: min(100%, 470px);
  max-height: none;
  overflow: visible;
  padding: 34px;
  color: #f8f9ff;
  background:
    linear-gradient(145deg, rgba(15, 24, 42, 0.97), rgba(23, 30, 50, 0.94)),
    #111827;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

#authForm {
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (max-height: 720px) {
  #authModal,
  #forgotModal {
    align-items: start;
  }
}

.auth-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  content: "";
  background: linear-gradient(180deg, var(--primary), var(--accent), var(--accent-warm));
}

.auth-header {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  margin-bottom: 22px;
}

.auth-emblem {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(70, 72, 212, 0.24);
}

.auth-kicker {
  margin: 0 0 4px;
  color: #9ca3ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-header h2 {
  color: #ffffff;
  font-size: 34px;
}

.auth-subtitle {
  margin: 8px 0 0;
  color: rgba(248, 249, 255, 0.62);
  font-size: 14px;
}

.auth-card .icon-button {
  color: rgba(248, 249, 255, 0.75);
}

.auth-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 2px;
}

.auth-progress span {
  padding: 8px 10px;
  color: rgba(248, 249, 255, 0.58);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.auth-progress .active {
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.22);
}

.auth-field {
  color: rgba(248, 249, 255, 0.68) !important;
  font-size: 11px !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-field input {
  min-height: 50px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.12);
}

.auth-field input:focus {
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}

.password-input-wrap {
  position: relative;
  display: block;
  letter-spacing: 0;
  text-transform: none;
}

.password-input-wrap input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: rgba(248, 249, 255, 0.62);
  background: transparent;
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.password-meter {
  display: grid;
  gap: 8px;
  margin-top: -8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.password-strength-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.password-strength-bars span {
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.password-meter[data-score="1"] .password-strength-bars span:nth-child(-n+1) {
  background: #ef4444;
}

.password-meter[data-score="2"] .password-strength-bars span:nth-child(-n+2) {
  background: #f59e0b;
}

.password-meter[data-score="3"] .password-strength-bars span:nth-child(-n+3) {
  background: #60a5fa;
}

.password-meter[data-score="4"] .password-strength-bars span {
  background: #22c55e;
}

.password-strength-label {
  color: rgba(248, 249, 255, 0.72);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.password-requirements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: rgba(248, 249, 255, 0.46);
  font-size: 11px;
  font-weight: 700;
}

.password-requirements li::before {
  content: "x";
  margin-right: 5px;
}

.password-requirements li.valid {
  color: #86efac;
}

.password-requirements li.valid::before {
  content: "✓";
}

.auth-card .form-error {
  color: #fecaca;
  background: rgba(185, 28, 28, 0.22);
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 8px;
  padding: 10px 12px;
}

.auth-card .primary-button {
  min-height: 50px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 14px 30px rgba(70, 72, 212, 0.24);
}

.auth-card .secondary-button {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.auth-card .secondary-button:hover,
#sendRegisterCodeButton:hover {
  color: #ffffff;
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.45);
}

.auth-card .text-button {
  color: rgba(248, 249, 255, 0.72);
}

.auth-helper-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -12px;
}

.auth-switch-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: rgba(248, 249, 255, 0.54);
  font-size: 13px;
}

.auth-link {
  min-height: auto;
  padding: 0;
  color: rgba(248, 249, 255, 0.68);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.auth-link:hover {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.auth-link.strong {
  color: #a5b4fc;
}

.account-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.account-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  font-size: 22px;
  font-weight: 800;
}

.account-summary h3,
.account-summary p {
  margin: 0;
}

.account-summary p {
  color: var(--muted);
}

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

.account-stats div,
.wallet-balance,
.wallet-history-row,
.pricing-card {
  padding: 16px;
  background: var(--surface-low);
  border: 1px solid rgba(118, 117, 134, 0.18);
  border-radius: 8px;
}

.account-stats span,
.wallet-balance span {
  display: block;
  color: var(--outline-strong);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.account-stats strong,
.wallet-balance strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 22px;
}

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

.danger-text {
  color: var(--danger);
}

.admin-dashboard-view {
  display: grid;
  align-content: start;
  gap: 14px;
  padding-top: 0;
  padding-bottom: 86px;
}

.admin-dashboard-header,
.admin-tabs,
.admin-tab-panel,
.admin-dashboard-controls,
.admin-prompt-list {
  width: min(100%, 980px);
  margin: 0 auto;
}

.admin-dashboard-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.admin-dashboard-header h1 {
  margin: 0;
  color: var(--primary);
  font-size: 28px;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px;
  background: var(--surface-low);
  border: 1px solid rgba(118, 117, 134, 0.18);
  border-radius: 8px;
}

.admin-tabs button {
  min-height: 38px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-tabs button.active {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 8px 20px rgba(70, 72, 212, 0.18);
}

.admin-tab-panel {
  display: grid;
  gap: 12px;
}

.admin-dashboard-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.admin-search-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  color: var(--outline-strong);
  background: var(--surface);
  border: 1px solid rgba(118, 117, 134, 0.22);
  border-radius: 8px;
}

.admin-search-field input {
  min-width: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}

.admin-segmented {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--surface-low);
  border: 1px solid rgba(118, 117, 134, 0.18);
  border-radius: 999px;
}

.admin-segmented button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.admin-segmented button.active {
  color: #ffffff;
  background: var(--primary);
}

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

.admin-prompt-row,
.admin-empty {
  background: var(--surface);
  border: 1px solid rgba(118, 117, 134, 0.18);
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(20, 31, 55, 0.06);
}

.admin-prompt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 104px;
  padding: 16px;
}

.admin-prompt-titleline,
.admin-prompt-meta,
.admin-prompt-actions {
  display: flex;
  align-items: center;
}

.admin-prompt-titleline {
  gap: 10px;
  min-width: 0;
}

.admin-prompt-titleline h3 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-prompt-main p {
  display: -webkit-box;
  margin: 7px 0 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.admin-prompt-meta {
  flex-wrap: wrap;
  gap: 8px;
  color: var(--outline-strong);
  font-size: 12px;
  font-weight: 700;
}

.admin-prompt-meta span {
  padding: 3px 8px;
  background: var(--surface-low);
  border: 1px solid rgba(118, 117, 134, 0.14);
  border-radius: 999px;
}

.admin-prompt-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-visibility-dropdown {
  position: relative;
}

.admin-visibility-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 118px;
  min-height: 40px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface-low);
  border: 1px solid rgba(118, 117, 134, 0.22);
  border-radius: 999px;
  font-weight: 700;
}

.admin-visibility-button .svg-icon {
  width: 16px;
  height: 16px;
  color: var(--outline-strong);
  transition: transform 160ms ease;
}

.admin-visibility-button[aria-expanded="true"] .svg-icon {
  transform: rotate(180deg);
}

.admin-visibility-options {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  display: grid;
  min-width: 150px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid rgba(118, 117, 134, 0.24);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(20, 31, 55, 0.16);
}

.admin-visibility-option {
  min-height: 36px;
  padding: 0 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
  text-align: left;
}

.admin-visibility-option:hover,
.admin-visibility-option.selected {
  color: var(--primary-deep);
  background: var(--primary-soft);
}

.admin-empty {
  padding: 24px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.admin-empty strong,
.admin-empty span {
  display: block;
}

.admin-empty strong {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 17px;
}

.wallet-balance {
  margin-bottom: 18px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.pricing-card {
  display: grid;
  gap: 10px;
  text-align: left;
}

.pricing-card h3,
.wallet-subtitle {
  margin: 0;
}

.pricing-card-price {
  color: var(--primary);
  font-size: 24px;
  font-weight: 800;
}

.pricing-card ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.wallet-subtitle {
  margin-top: 22px;
  margin-bottom: 10px;
  font-size: 18px;
}

.wallet-history {
  display: grid;
  gap: 10px;
}

.wallet-history-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.advanced-editor-card {
  width: min(100%, 880px);
  padding: clamp(18px, 3vw, 28px);
}

.editor-header {
  align-items: center;
  margin-bottom: 18px;
}

.editor-title-field {
  flex: 1 1 auto;
  min-width: 0;
}

.editor-title-field input {
  width: 100%;
  padding: 3px 0 6px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  outline: none;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.15;
}

.editor-title-field input:focus {
  border-color: rgba(70, 72, 212, 0.35);
}

.visual-context {
  position: relative;
  display: grid;
  min-height: 180px;
  place-items: center;
  margin-bottom: 22px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(11, 28, 48, 0.3), rgba(70, 72, 212, 0.2)),
    linear-gradient(120deg, #dce9ff, #ffffff 45%, #dae2fd);
  border: 1px solid rgba(118, 117, 134, 0.2);
  border-radius: 8px;
}

.visual-context::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(120deg, transparent 0 24%, rgba(255, 255, 255, 0.42) 24% 26%, transparent 26% 100%),
    repeating-linear-gradient(135deg, rgba(70, 72, 212, 0.12) 0 2px, transparent 2px 18px);
  opacity: 0.85;
}

.visual-upload {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  box-shadow: 0 14px 32px rgba(20, 31, 55, 0.12);
  font-size: 13px;
  font-weight: 700;
}

.editor-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--surface-low);
  border: 1px solid rgba(118, 117, 134, 0.14);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.prompt-editor-panel,
.preview-panel {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(118, 117, 134, 0.24);
  border-radius: 8px;
}

.prompt-editor-panel:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(70, 72, 212, 0.09);
}

.editor-panel-header,
.editor-toolbar,
.preview-header,
.fullscreen-header,
.fullscreen-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-panel-header {
  min-height: 54px;
  padding: 0 14px;
  background: var(--surface-low);
  border-bottom: 1px solid rgba(118, 117, 134, 0.14);
}

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

.derived-variable {
  display: inline;
  padding: 2px 6px;
  margin: 0 1px;
  color: var(--accent);
  background: rgba(15, 118, 110, 0.08);
  border-bottom: 2px solid var(--accent);
  border-radius: 4px;
  font-weight: 600;
  transition: all 140ms ease;
}

.dark-mode .derived-variable {
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.12);
  border-bottom-color: #2dd4bf;
}

.editor-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.editor-toolbar {
  min-height: 48px;
  padding: 8px 14px;
  background: #ffffff;
  border-bottom: 1px solid rgba(118, 117, 134, 0.12);
}

.editor-toolbar-left {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.editor-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 4px;
  background: var(--surface-low);
  border: 1px solid rgba(118, 117, 134, 0.16);
  border-radius: 999px;
}

.editor-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.editor-tab:hover {
  color: var(--primary);
  background: rgba(225, 224, 255, 0.55);
}

.editor-tab.active {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 6px 14px rgba(70, 72, 212, 0.18);
}

.tool-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--primary);
  background: var(--surface-low);
  border: 1px solid rgba(118, 117, 134, 0.18);
  border-radius: 7px;
  font-size: 20px;
  font-weight: 700;
}

.variable-wrap-button {
  flex: 0 0 auto;
}

.inline-copy {
  position: static;
}

.editor-workspace {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 260px;
}

.line-numbers {
  min-width: 52px;
  padding: 16px 12px;
  color: rgba(118, 117, 134, 0.64);
  background: rgba(239, 244, 255, 0.55);
  border-right: 1px solid rgba(118, 117, 134, 0.12);
  font: 500 12px/1.7 "Courier New", monospace;
  text-align: right;
  user-select: none;
}

.editor-textarea-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 260px;
}

.highlight-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 16px;
  color: transparent;
  background: transparent;
  pointer-events: none;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: hidden;
  font: 500 14px/1.7 "Courier New", monospace;
  box-sizing: border-box;
}

.highlight-overlay .variable-token {
  display: inline !important;
  min-height: 0 !important;
  align-items: normal !important;
  color: transparent !important;
  background: rgba(70, 72, 212, 0.15) !important;
  border: 0 !important;
  padding: 0 !important;
  border-radius: 3px;
  line-height: 1.15;
  font-weight: inherit !important;
}

.dark-mode .highlight-overlay .variable-token {
  background: rgba(159, 164, 255, 0.22) !important;
}

#modalContent {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 16px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
  resize: none;
  font: 500 14px/1.7 "Courier New", monospace;
  box-sizing: border-box;
  overflow-y: auto;
  caret-color: var(--text);
}

.final-prompt-view {
  min-height: 260px;
  background: #ffffff;
}

.final-prompt-view pre {
  min-height: 260px;
  padding: 18px;
  color: var(--text);
  font: 500 14px/1.7 Arial, Helvetica, sans-serif;
}

.variables-panel {
  display: grid;
  gap: 12px;
  padding-top: 20px;
}

.tags-panel {
  display: grid;
  gap: 12px;
  padding-top: 20px;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tag-list {
  display: contents;
}

.editor-tag,
.add-tag-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.editor-tag {
  gap: 8px;
  padding: 0 8px 0 14px;
  color: var(--text);
  background: var(--surface-high);
  border: 1px solid rgba(118, 117, 134, 0.18);
}

.editor-tag button {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--outline-strong);
  background: rgba(255, 255, 255, 0.58);
  border: 0;
  border-radius: 50%;
  font-weight: 700;
}

.editor-tag button:hover {
  color: #ffffff;
  background: var(--danger);
}

.add-tag-button {
  justify-self: start;
  gap: 8px;
  padding: 0 14px;
  color: var(--primary);
  background: #ffffff;
  border: 1px dashed rgba(70, 72, 212, 0.48);
}

.add-tag-button:hover {
  background: var(--primary-soft);
}

.section-label {
  color: var(--outline-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.variable-list {
  display: grid;
  gap: 10px;
  overflow: visible;
}

.variable-row {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid rgba(118, 117, 134, 0.24);
  border-radius: 8px;
}

.variable-index {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--muted);
  background: var(--surface-high);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.variable-replacement {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  min-height: 34px;
  padding: 0 4px 0 10px;
  color: var(--text);
  background: var(--surface-low);
  border: 1px solid rgba(118, 117, 134, 0.2);
  border-radius: 6px;
  cursor: pointer;
}

.variable-replacement:hover,
.variable-replacement:focus {
  border-color: rgba(70, 72, 212, 0.38);
  background: var(--primary-soft);
  outline: none;
  box-shadow: 0 0 0 3px rgba(70, 72, 212, 0.08);
}

.variable-replacement-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.variable-edit-button {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--primary);
  background: #ffffff;
  border: 1px solid rgba(118, 117, 134, 0.22);
  border-radius: 6px;
}

.variable-edit-button:hover,
.variable-edit-button:focus {
  color: #ffffff;
  background: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(70, 72, 212, 0.1);
}

.empty-variables {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  background: var(--surface-low);
  border: 1px dashed rgba(118, 117, 134, 0.28);
  border-radius: 8px;
  font-size: 14px;
}

.variable-value-layer {
  z-index: 90;
}

.variable-value-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  width: min(100%, 640px);
  height: min(840px, calc(100vh - 36px));
  max-height: calc(100vh - 36px);
  padding: 0;
  overflow: hidden;
  background: var(--background);
}

.variable-value-header {
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 10px 16px;
  min-height: 64px;
  background: rgba(248, 249, 255, 0.94);
  border-bottom: 1px solid rgba(118, 117, 134, 0.16);
  backdrop-filter: blur(12px);
}

.variable-value-header > div {
  display: grid;
  gap: 2px;
  text-align: center;
}

.variable-value-header h2 {
  margin: 0;
  color: var(--primary);
  font-size: 14px;
  line-height: 1.2;
}

.variable-value-header p {
  margin: 0;
  color: var(--outline-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.variable-value-controls {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  box-shadow: 0 4px 20px rgba(20, 31, 55, 0.03);
}

.variable-value-search,
.variable-value-add {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
}

.variable-value-search {
  color: var(--outline-strong);
  background: var(--surface-low);
  border: 1px solid transparent;
}

.variable-value-add {
  grid-template-columns: 22px minmax(0, 1fr) auto;
  min-height: 56px;
  padding: 0 14px;
  color: var(--primary);
  background: #ffffff;
  border: 1px solid rgba(70, 72, 212, 0.2);
  box-shadow: 0 8px 18px rgba(70, 72, 212, 0.06);
}

.variable-value-add > .svg-icon {
  align-self: center;
}

.variable-value-search:focus-within,
.variable-value-add:focus-within {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(70, 72, 212, 0.1);
}

.variable-value-search input,
.variable-value-add textarea,
.variable-value-edit {
  width: 100%;
  min-width: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}

.variable-value-search input,
.variable-value-add textarea {
  min-height: 42px;
  padding: 0;
}

.variable-value-add textarea {
  display: block;
  height: 24px;
  min-height: 24px;
  max-height: 88px;
  padding: 0;
  resize: none;
  line-height: 1.45;
  overflow: auto;
  align-self: center;
}

.variable-value-add textarea::placeholder {
  color: rgba(70, 72, 212, 0.64);
}

.variable-value-search input::placeholder {
  color: rgba(70, 69, 84, 0.62);
}

.variable-value-add button {
  align-self: center;
  min-height: 36px;
  padding: 0 12px;
  color: #ffffff;
  background: var(--primary);
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.variable-value-add button:hover {
  background: var(--primary-deep);
}

#variableValueError {
  padding: 0 16px 8px;
  background: var(--surface);
}

.variable-value-list {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 0;
  padding: 16px 16px 104px;
  overflow: auto;
  background: var(--background);
}

.variable-value-row {
  position: relative;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  text-align: left;
  background: #ffffff;
  border: 1px solid rgba(118, 117, 134, 0.18);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(20, 31, 55, 0.03);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.variable-value-row.is-selected {
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(70, 72, 212, 0.1);
}

.variable-value-row.is-editing {
  grid-template-columns: minmax(0, 1fr) auto;
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(70, 72, 212, 0.1);
}

.variable-value-row:active {
  transform: scale(0.99);
}

.variable-value-strip {
  width: 6px;
  height: 26px;
  background: rgba(70, 72, 212, 0.16);
  border-radius: 999px;
}

.variable-value-row.is-selected .variable-value-strip {
  background: var(--primary);
}

.variable-value-row.is-editing .variable-value-strip {
  display: none;
}

.variable-value-main {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.variable-value-display {
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}

.variable-value-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.variable-value-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  color: var(--muted);
  background: var(--surface-high);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.variable-value-badge.default {
  color: var(--primary-deep);
  background: var(--primary-soft);
}

.variable-value-edit {
  min-height: 86px;
  padding: 8px 0 8px 8px;
  resize: vertical;
  font-size: 15px;
  line-height: 1.45;
}

.variable-value-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 4px;
}

.variable-value-icon-action {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--outline-strong);
  background: transparent;
  border: 0;
  border-radius: 50%;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.variable-value-icon-action:hover {
  color: var(--text);
  background: var(--surface-low);
}

.variable-value-icon-action.primary {
  color: var(--primary-deep);
  background: var(--primary-soft);
}

.variable-value-icon-action.primary:hover {
  color: #ffffff;
  background: var(--primary);
}

.variable-value-icon-action.danger {
  color: var(--danger);
}

.variable-value-icon-action.danger:hover {
  color: #ffffff;
  background: var(--danger);
}

.variable-value-empty {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  background: #ffffff;
  border: 1px dashed rgba(118, 117, 134, 0.28);
  border-radius: 8px;
  font-size: 14px;
}

.variable-value-footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  padding: 34px 16px 18px;
  background: linear-gradient(to top, var(--surface) 0 68%, rgba(248, 249, 255, 0));
  pointer-events: none;
}

.variable-value-footer .primary-button {
  width: 100%;
  min-height: 52px;
  pointer-events: auto;
  border-radius: 999px;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid rgba(118, 117, 134, 0.28);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.secondary-button:hover {
  background: var(--surface-low);
}

.preview-panel {
  margin-top: 18px;
}

.preview-header {
  padding: 14px 16px;
  background: var(--surface-low);
  border-bottom: 1px solid rgba(118, 117, 134, 0.14);
}

.preview-header h3 {
  margin: 0;
  font-size: 18px;
}

.preview-panel pre {
  padding: 18px;
  color: var(--text);
}

.preview-panel .primary-button {
  margin: 0 16px 16px auto;
}

.editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 22px;
}

.editor-actions .form-error {
  margin-right: auto;
}

.editor-actions button {
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
}

.editor-actions .secondary-button {
  color: var(--text);
  background: #ffffff;
  border-color: rgba(118, 117, 134, 0.28);
  box-shadow: 0 6px 16px rgba(20, 31, 55, 0.06);
}

.editor-actions .secondary-button:hover {
  color: var(--primary);
  background: var(--surface-low);
  border-color: rgba(70, 72, 212, 0.28);
}

.editor-actions .danger-text {
  color: #b42318;
  background: #fff7f6;
  border: 1px solid rgba(180, 35, 24, 0.16);
}

.editor-actions .danger-text:hover {
  color: #ffffff;
  background: var(--danger);
  border-color: var(--danger);
}

.editor-actions .primary-button {
  min-width: 170px;
  padding: 0 26px;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 10px 24px rgba(70, 72, 212, 0.18);
}

.editor-actions .primary-button:hover {
  background: var(--primary-deep);
  box-shadow: 0 12px 28px rgba(70, 72, 212, 0.22);
}

.fullscreen-editor {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  background: var(--surface);
}

.fullscreen-header,
.fullscreen-footer {
  padding: 12px clamp(16px, 4vw, 48px);
  background: #ffffff;
  border-bottom: 1px solid rgba(118, 117, 134, 0.18);
}

.fullscreen-footer {
  justify-content: center;
  border-top: 1px solid rgba(118, 117, 134, 0.18);
  border-bottom: 0;
}

.fullscreen-header h2 {
  font-size: 18px;
}

#fullscreenContent {
  width: min(100%, 1000px);
  min-height: 0;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 48px);
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
  resize: none;
  font: 500 17px/1.75 Arial, Helvetica, sans-serif;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 160;
  padding: 12px 18px;
  color: #ffffff;
  background: var(--text);
  border-radius: 999px;
  box-shadow: 0 18px 42px rgba(20, 31, 55, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 180ms ease, transform 180ms ease;
  font-size: 14px;
  font-weight: 700;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hidden {
  display: none !important;
}

@media (max-width: 1039px) {
  .prompt-grid {
    margin-top: 0;
  }
}

@media (max-width: 620px) {
  #libraryView {
    padding-top: 64px;
  }

  .library-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .library-heading .primary-button {
    display: none;
  }

  .prompt-card {
    grid-template-columns: 1fr;
  }

  .visual-drop {
    min-height: 116px;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  .advanced-editor-card {
    max-height: calc(100vh - 20px);
  }

  .editor-header {
    align-items: flex-start;
  }

  .visual-context {
    min-height: 138px;
  }

  .line-numbers {
    display: none;
  }

  .editor-workspace {
    grid-template-columns: 1fr;
  }

  .editor-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .editor-toolbar-left {
    order: 1;
    width: 100%;
    align-items: stretch;
  }

  .editor-tabs {
    flex: 1 1 auto;
    min-width: 0;
  }

  .editor-tab {
    flex: 1 1 0;
  }

  .tool-button {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
  }

  .inline-copy {
    order: 2;
    margin-left: auto;
  }

  .variable-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .variable-replacement {
    grid-column: 1 / -1;
  }

  .variable-value-row {
    grid-template-columns: 10px minmax(0, 1fr) auto;
  }

  .variable-value-row.is-editing {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .category-card-list {
    gap: 7px;
  }

  .category-manage-card {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 58px;
    padding: 9px 10px;
  }

  .category-card-actions {
    grid-column: 4;
    grid-row: 1;
    align-self: center;
    justify-content: flex-end;
    margin-top: 0;
  }

  .category-card-icon {
    width: 34px;
    height: 34px;
  }

  .category-card-body h2 {
    font-size: 16px;
  }

  .category-card-body p {
    font-size: 12px;
  }

  .category-card-actions button {
    width: 28px;
    height: 28px;
  }

  .category-search-field {
    height: 46px;
  }

  .category-bulk-bar {
    min-height: 42px;
    padding: 7px 10px;
  }

  .category-edit-view {
    gap: 20px;
    padding-bottom: 116px;
  }

  .category-icon-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
  }

  .category-edit-actions {
    grid-template-columns: 1fr 1.5fr;
    padding: 12px 16px;
  }

  .editor-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-dashboard-header,
  .admin-tab-panel,
  .admin-dashboard-controls,
  .admin-prompt-row {
    grid-template-columns: 1fr;
  }

  .admin-dashboard-header {
    align-items: start;
  }

  .admin-dashboard-header .icon-button,
  .admin-dashboard-header .secondary-button {
    justify-self: start;
  }

  .admin-segmented {
    width: 100%;
    overflow-x: auto;
  }

  .admin-prompt-actions {
    justify-content: flex-start;
  }

  .editor-actions .form-error {
    margin-right: 0;
  }
}

@media (min-width: 760px) {
  .desktop-nav {
    display: flex;
  }

  .mobile-nav {
    display: none;
  }

  .page-shell {
    padding-bottom: 48px;
  }

  .toolbar {
    margin-bottom: 76px;
  }

  .result-meta {
    margin-bottom: 0px;
  }

  .category-manage-view {
    padding-top: 0;
  }

  .fab {
    right: clamp(24px, 4vw, 48px);
    bottom: 36px;
  }

  .prompt-card {
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 24px;
    padding: 24px;
  }

  .visual-drop {
    min-height: 160px;
  }

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

@media (min-width: 1040px) {
  .prompt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Account Settings Dashboard Styles */
.account-settings-view {
  display: grid;
  align-content: start;
  gap: 24px;
  padding-bottom: 120px;
}

.account-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0 auto 12px;
}

.account-settings-header h1 {
  color: var(--primary);
  font-size: 26px;
  margin: 0;
  text-align: center;
  flex: 1;
}

.account-settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  width: 100%;
}

@media (min-width: 860px) {
  .account-settings-grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

.settings-profile-card,
.api-keys-card,
.danger-zone-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid rgba(118, 117, 134, 0.2);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(20, 31, 55, 0.05);
}

.settings-profile-card h2,
.api-keys-card h2,
.danger-zone-card h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.section-desc {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.account-right-col {
  display: grid;
  gap: 24px;
  align-content: start;
}

/* API Integration Row Design */
.api-key-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.api-key-row:last-child {
  margin-bottom: 0;
}

.api-provider-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.api-provider-brand.gemini {
  background: linear-gradient(135deg, #1a73e8, #1557b0);
  box-shadow: inset 0 -2px 6px rgba(0,0,0,0.18);
}

.api-provider-brand.claude {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: inset 0 -2px 6px rgba(0,0,0,0.18);
}

.api-provider-brand.openai {
  background: linear-gradient(135deg, #10a37f, #0d7f62);
  box-shadow: inset 0 -2px 6px rgba(0,0,0,0.18);
}

.api-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.api-input-wrap input {
  width: 100%;
  min-height: 42px;
  padding: 0 64px 0 12px;
  color: var(--text);
  background: var(--surface-low);
  border: 1px solid rgba(118, 117, 134, 0.24);
  border-radius: 6px;
  outline: none;
}

.api-input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(70, 72, 212, 0.1);
}

.api-toggle-btn {
  position: absolute;
  right: 8px;
  min-height: 28px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid rgba(70, 72, 212, 0.22);
  border-radius: 4px;
}

.api-toggle-btn:hover {
  background: var(--primary-soft);
}

/* Danger Zone Cards and Actions */
.danger-zone-card {
  border-color: rgba(180, 35, 24, 0.28);
}

.danger-zone-card h2 {
  color: var(--danger);
}

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

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, var(--danger), #9c1b12);
  border: 1px solid var(--danger);
  border-radius: 6px;
  transition: transform 140ms ease;
}

.danger-button.secondary {
  color: var(--danger);
  background: transparent;
  border-color: rgba(180, 35, 24, 0.35);
}

.danger-button.secondary:hover {
  background: rgba(180, 35, 24, 0.08);
}

.danger-button:active {
  transform: scale(0.97);
}

/* Account Footer actions bar */
.account-settings-actions {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 12px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: var(--surface-mid);
  border-top: 1px solid rgba(118, 117, 134, 0.18);
}

.account-settings-actions button {
  min-height: 48px;
  border-radius: 8px;
}

/* Custom styling for read-only input fields */
input[readonly],
textarea[readonly] {
  background: var(--surface-low) !important;
  color: var(--muted) !important;
  cursor: not-allowed;
  border-color: rgba(118, 117, 134, 0.15) !important;
}

/* Category Selection Modal */
#categorySelectModal .modal-card {
  width: min(100%, 380px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px;
}

#categorySelectModal .modal-header {
  margin-bottom: 16px;
}

#categorySelectModal .modal-header h2 {
  font-size: 18px;
  color: var(--primary);
  margin: 0;
}

.category-select-list {
  display: grid;
  gap: 8px;
}

.category-select-list .custom-select-option {
  border: 1px solid rgba(118, 117, 134, 0.16);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.category-select-list .custom-select-option:hover {
  border-color: rgba(70, 72, 212, 0.3);
  background: var(--primary-soft);
}

.category-select-list .custom-select-option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  font-weight: 700;
}

.category-select-list .category-card-icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  font-size: 11px;
  border-radius: 4px;
  place-items: center;
}
