:root {
  color-scheme: dark;
  --bg: #0e0f12;
  --panel: #15161a;
  --panel-2: #191b20;
  --panel-3: #20232a;
  --line: #2a2d35;
  --line-soft: #20232a;
  --text: #f4f4f5;
  --muted: #9aa0aa;
  --dim: #6f7683;
  --accent: #7c9cff;
  --accent-2: #9fd6b5;
  --danger: #f09a9a;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(124, 156, 255, 0.12), transparent 28rem),
    linear-gradient(135deg, #0d0e11 0%, #111318 46%, #0f1114 100%);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(360px, 0.95fr) minmax(430px, 1.15fr);
  width: min(1480px, calc(100vw - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(17, 18, 22, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar,
.prompt-list-pane,
.detail-pane {
  min-width: 0;
}

.sidebar {
  padding: 18px 14px;
  border-right: 1px solid var(--line-soft);
  background: rgba(15, 16, 19, 0.82);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 6px 18px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
}

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

.brand strong {
  font-size: 14px;
  letter-spacing: 0;
}

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

.new-prompt,
.primary-button,
.secondary-button,
.nav-item,
.icon-button,
.tag-pill {
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
}

.new-prompt {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  margin-bottom: 22px;
  background: #f4f4f5;
  color: #101114;
  font-weight: 650;
}

.nav-section {
  margin-top: 18px;
}

.nav-section p {
  margin: 0 6px 8px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  height: 34px;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.nav-item span {
  margin-left: auto;
  color: var(--dim);
  font-size: 12px;
}

.prompt-list-pane {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line-soft);
  background: rgba(19, 20, 24, 0.72);
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 22px 12px;
}

.eyebrow {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
}

h1 {
  margin: 3px 0 0;
  font-size: 25px;
  font-weight: 720;
  letter-spacing: 0;
}

.view-actions,
.form-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.icon-button:hover,
.icon-button.active,
.favorite-detail.is-favorite {
  border-color: rgba(124, 156, 255, 0.35);
  background: rgba(124, 156, 255, 0.12);
  color: var(--accent);
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  margin: 0 22px 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--dim);
}

.search input,
.detail-pane input,
.detail-pane select,
.detail-pane textarea {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.search input::placeholder,
.detail-pane input::placeholder,
.detail-pane textarea::placeholder {
  color: var(--dim);
}

.tag-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 22px 14px;
}

.tag-pill {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
}

.tag-pill.active,
.tag-pill:hover {
  border-color: rgba(159, 214, 181, 0.32);
  color: var(--accent-2);
}

.prompt-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding: 0 14px 18px;
}

.prompt-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.prompt-card:hover,
.prompt-card.active {
  border-color: rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.045);
}

.prompt-card.active {
  box-shadow: inset 2px 0 0 var(--accent);
}

.prompt-card h2 {
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font-size: 11px;
}

.card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  color: var(--dim);
  font-size: 11px;
}

.mini-star {
  color: var(--dim);
}

.mini-star.is-favorite {
  color: var(--accent);
}

.detail-pane {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 32%),
    rgba(20, 21, 25, 0.86);
}

#promptForm {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 25px;
}

.detail-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}

.detail-pane label {
  display: block;
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
}

#promptTitle {
  margin-top: 7px;
  color: var(--text);
  font-size: 28px;
  font-weight: 740;
  letter-spacing: 0;
}

.meta-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 12px;
  margin-top: 24px;
}

.meta-grid label,
.prompt-body-label {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.detail-pane select,
.detail-pane input {
  margin-top: 8px;
  min-height: 28px;
}

.detail-pane select {
  appearance: none;
}

.prompt-body-label {
  display: flex;
  flex: 1;
  flex-direction: column;
  margin-top: 12px;
}

.prompt-body-label textarea {
  flex: 1;
  min-height: 360px;
  margin-top: 12px;
  resize: none;
  color: #e8eaee;
  font-size: 15px;
  line-height: 1.65;
}

.detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
}

.saved-note {
  color: var(--dim);
  font-size: 12px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 96px;
  height: 38px;
  padding: 0 13px;
  font-weight: 650;
}

.primary-button {
  background: #f4f4f5;
  color: #101114;
}

.secondary-button {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.empty-state {
  margin: 36px 8px;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 218px minmax(330px, 0.9fr) minmax(360px, 1fr);
    width: calc(100vw - 20px);
    min-height: calc(100vh - 20px);
    margin: 10px;
  }
}

@media (max-width: 880px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .prompt-list-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .sidebar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .nav-section {
    margin-top: 12px;
  }

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

  #promptTitle {
    font-size: 24px;
  }
}
