:root {
  color-scheme: dark;
  --bg: #101315;
  --panel: #181e21;
  --panel-2: #20272c;
  --line: #334249;
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: #f5f1e8;
  --muted: #aeb9bd;
  --accent: #4fd1b3;
  --amber: #e5c365;
  --rose: #ee7d89;
  --blue: #83a8ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(79, 209, 179, 0.12), transparent 30%),
    linear-gradient(315deg, rgba(131, 168, 255, 0.1), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button,
.file-action {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
  cursor: pointer;
}

button:hover,
.file-action:hover {
  border-color: var(--accent);
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
}

.toolbar,
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.layout {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.editor,
.library {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(24, 30, 33, 0.88);
}

.editor {
  display: grid;
  gap: 16px;
  padding: 18px;
  position: sticky;
  top: 18px;
}

.row.two,
.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
}

label span,
.summary span,
.meta {
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1113;
  color: var(--text);
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 280px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 209, 179, 0.12);
}

.primary {
  min-width: 112px;
  border: 0;
  background: var(--accent);
  color: #061210;
  font-weight: 800;
}

.ghost,
.file-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
}

.file-action input {
  display: none;
}

.library {
  min-height: 70vh;
  overflow: hidden;
}

.filters {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(16, 19, 21, 0.36);
}

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

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.toggle {
  grid-template-columns: 18px auto;
  gap: 9px;
  align-items: center;
  align-content: end;
  min-height: 42px;
  padding-top: 20px;
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 30px;
}

.tag-chip,
.priority,
.category {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(32, 39, 44, 0.8);
  font-size: 13px;
}

.tag-chip.active {
  border-color: var(--accent);
  color: var(--accent);
}

.summary {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 14px 18px;
}

.summary strong {
  font-size: 24px;
}

.list {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.prompt {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(32, 39, 44, 0.72);
  padding: 16px;
}

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

.prompt h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.prompt-preview {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
  white-space: pre-wrap;
}

.chips,
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.priority.high {
  color: var(--rose);
  border-color: rgba(238, 125, 137, 0.6);
}

.priority.medium {
  color: var(--amber);
  border-color: rgba(229, 195, 101, 0.6);
}

.priority.low {
  color: var(--blue);
  border-color: rgba(131, 168, 255, 0.6);
}

.actions button {
  min-height: 34px;
  padding: 0 10px;
}

.favorite {
  min-width: 40px;
  color: var(--amber);
}

.empty {
  min-height: 240px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1113;
  color: var(--text);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .layout,
  .filter-grid,
  .row.two {
    grid-template-columns: 1fr;
  }

  .editor {
    position: static;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 560px);
    padding-top: 18px;
  }

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

  h1 {
    font-size: 28px;
  }
}
