:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-soft: #fbfaf7;
  --text: #171717;
  --muted: #6f6b62;
  --line: #e6e0d6;
  --primary: #111111;
  --primary-text: #ffffff;
  --accent: #0f8b8d;
  --accent-soft: #dff4f1;
  --gold: #d49a28;
  --shadow: 0 18px 45px rgba(27, 24, 18, 0.12);
  --shadow-soft: 0 10px 24px rgba(27, 24, 18, 0.08);
  --radius: 8px;
  --max-width: 1180px;
}

[data-theme="dark"] {
  --bg: #10100f;
  --surface: #181817;
  --surface-soft: #20201e;
  --text: #f5f2eb;
  --muted: #aaa397;
  --line: #302e2a;
  --primary: #f5f2eb;
  --primary-text: #111111;
  --accent: #4fd1c5;
  --accent-soft: #173432;
  --gold: #f0b84a;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(15, 139, 141, 0.08), transparent 32%),
    linear-gradient(240deg, rgba(212, 154, 40, 0.10), transparent 30%),
    var(--bg);
  transition: background 220ms ease, color 220ms ease;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 18px;
  animation: pageEnter 520ms ease both;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--primary-text);
  background: var(--primary);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.header-actions,
.hero-actions,
.form-actions,
.drawer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  border: 0;
  border-radius: var(--radius);
  min-height: 42px;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font-weight: 700;
  text-decoration: none;
}

.primary-button {
  color: var(--primary-text);
  background: var(--primary);
  box-shadow: var(--shadow-soft);
}

.primary-button.large {
  min-height: 50px;
  padding: 0 20px;
}

.secondary-button,
.ghost-button {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
}

.icon-button {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover,
.prompt-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
  gap: 28px;
  align-items: center;
  min-height: 560px;
  padding: 48px 0 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 740px;
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
}

.hero-text {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.65;
}

.hero-visual {
  overflow: hidden;
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(15, 139, 141, 0.18), transparent 36%),
    linear-gradient(320deg, rgba(212, 154, 40, 0.20), transparent 30%),
    var(--surface);
  box-shadow: var(--shadow);
}

.visual-toolbar {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.visual-toolbar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.visual-content {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.visual-card {
  min-height: 100px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  box-shadow: var(--shadow-soft);
}

.visual-card.active {
  border-color: color-mix(in srgb, var(--gold) 54%, var(--line));
}

.visual-card small {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--accent);
  font-weight: 800;
}

.visual-card strong {
  display: block;
  margin-bottom: 8px;
}

.visual-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.visual-card.compact {
  min-height: 44px;
  background: linear-gradient(90deg, var(--accent-soft), transparent);
}

.visual-card.compact.muted {
  width: 72%;
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 26%, transparent), transparent);
}

.control-panel {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: var(--shadow-soft);
}

.search-wrap {
  position: relative;
}

.search-wrap input {
  width: 100%;
  min-height: 54px;
  padding: 0 18px 0 48px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: var(--surface);
}

.search-wrap input:focus,
.prompt-form input:focus,
.prompt-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.category-row,
.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip,
.tag {
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.chip {
  min-height: 34px;
  padding: 0 13px;
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--surface);
}

.chip.active {
  color: var(--primary-text);
  border-color: var(--primary);
  background: var(--primary);
}

.tag {
  padding: 6px 10px;
  color: var(--accent);
  background: var(--accent-soft);
}

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

.stats-row article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.stats-row span {
  display: block;
  margin-bottom: 6px;
  font-size: 32px;
  font-weight: 800;
}

.stats-row p {
  margin-bottom: 0;
  color: var(--muted);
}

.content-section {
  margin: 0 0 52px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

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

.prompt-card {
  position: relative;
  display: flex;
  min-height: 272px;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 4px 18px rgba(27, 24, 18, 0.04);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  animation: cardReveal 420ms ease both;
}

.prompt-card.favorite {
  border-color: color-mix(in srgb, var(--gold) 62%, var(--line));
}

.card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #161616;
  font-size: 12px;
  font-weight: 800;
  background: var(--category-color, #dff4f1);
}

.favorite-button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-soft);
}

.favorite-button.active {
  color: #161616;
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 34%, white);
}

.prompt-card h3 {
  font-size: 20px;
  line-height: 1.25;
}

.prompt-card p {
  color: var(--muted);
  line-height: 1.55;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.card-actions button {
  min-height: 38px;
  border-radius: var(--radius);
  font-weight: 800;
}

.empty-state {
  display: grid;
  place-items: center;
  padding: 48px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.empty-state p {
  max-width: 430px;
  color: var(--muted);
}

.empty-illustration {
  display: grid;
  width: 118px;
  gap: 8px;
  margin-bottom: 20px;
}

.empty-illustration span {
  display: block;
  height: 18px;
  border-radius: 999px;
  background: var(--accent-soft);
}

.empty-illustration span:nth-child(2) {
  width: 76%;
  background: color-mix(in srgb, var(--gold) 28%, transparent);
}

.empty-illustration span:nth-child(3) {
  width: 48%;
}


.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 0 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin-bottom: 0;
}

.modal-backdrop,
.detail-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  padding: 18px;
  background: rgba(12, 12, 12, 0.42);
  backdrop-filter: blur(12px);
}

.modal-backdrop {
  place-items: center;
}

.detail-drawer {
  justify-items: end;
}


.prompt-modal,
.drawer-card {
  width: min(100%, 620px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: modalEnter 220ms ease both;
}

.drawer-card {
  width: min(100%, 560px);
}

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

.prompt-form {
  display: grid;
  gap: 14px;
}

.prompt-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.prompt-form input,
.prompt-form textarea {
  width: 100%;
  padding: 13px 14px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: var(--surface-soft);
  resize: vertical;
}

#deletePrompt {
  margin-right: auto;
  color: #b64040;
}

.drawer-description {
  color: var(--muted);
  line-height: 1.7;
}

pre {
  overflow: auto;
  white-space: pre-wrap;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface-soft);
  line-height: 1.6;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 10px;
}

.toast {
  max-width: 340px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  animation: toastEnter 220ms ease both;
}

.plus-icon,
.search-icon,
.icon-sun,
.close-icon {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
}


.plus-icon::before,
.plus-icon::after,
.close-icon::before,
.close-icon::after {
  content: "";
  position: absolute;
  inset: 8px 2px auto;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.plus-icon::after {
  transform: rotate(90deg);
}

.close-icon::before {
  transform: rotate(45deg);
}

.close-icon::after {
  transform: rotate(-45deg);
}


.search-icon {
  position: absolute;
  left: 17px;
  top: 18px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--muted);
  transform: rotate(45deg);
}

.icon-sun {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.icon-sun::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 50%;
}

[data-theme="dark"] .icon-sun {
  border-color: transparent;
  box-shadow: inset -6px -2px 0 currentColor;
}

[hidden] {
  display: none !important;
}


@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


@keyframes modalEnter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .hero-section {
    grid-template-columns: 1fr;
    min-height: auto;
  }

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

@media (max-width: 680px) {
  .app-shell {
    padding: 14px;
  }

  .site-header,
  .section-heading,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 42px 1fr;
  }

  .hero-section {
    padding-top: 34px;
  }

  .hero-visual {
    min-height: 350px;
  }

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

  .modal-backdrop,
  .detail-drawer {
    padding: 10px;
  }

  .prompt-modal,
  .drawer-card {
    max-height: calc(100vh - 20px);
    padding: 18px;
  }

  .drawer-actions,
  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  #deletePrompt {
    margin-right: 0;
  }
}
