:root {
  --bg: #f3f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fbfd;
  --ink: #253247;
  --muted: #718096;
  --faint: #aebbd0;
  --line: #d9e3ef;
  --line-strong: #c6d4e4;
  --green: #4aa38f;
  --green-dark: #2f7f71;
  --green-soft: #dff3ee;
  --rose: #d1789a;
  --blue: #6c9ed6;
  --amber: #d5ab63;
  --violet: #9685d4;
  --shadow: 0 18px 54px rgba(87, 108, 132, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(209, 120, 154, 0.16), transparent 24rem),
    radial-gradient(circle at top right, rgba(108, 158, 214, 0.16), transparent 26rem),
    linear-gradient(135deg, #fbfdff 0%, var(--bg) 52%, #f6f0fb 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(560px, 1fr);
  min-height: 100vh;
  padding: 12px;
  gap: 12px;
}

.sidebar,
.library-panel,
.composer {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(217, 227, 239, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 24px);
  border-radius: 14px;
  padding: 16px 12px;
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 720;
}

.brand-mark {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 800;
}

.primary-action {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 8px;
  height: 38px;
  margin: 16px 4px 14px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(180deg, #5eb6a5 0%, var(--green-dark) 100%);
  box-shadow: 0 8px 22px rgba(74, 163, 143, 0.22);
  font-size: 13px;
  font-weight: 680;
  text-align: left;
}

.workspace-card {
  display: grid;
  gap: 11px;
  margin: 0 4px 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
}

.status-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #babdb5;
}

.status-dot.connected {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(20, 122, 75, 0.12);
}

.workspace-card-header {
  display: grid;
  grid-template-columns: 12px 1fr;
  align-items: start;
  gap: 8px;
}

.workspace-card-header strong,
.workspace-card-header small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-card-header strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
}

.workspace-card-header small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.linear-connect-button {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #3f5148;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.linear-connect-button.connected {
  color: var(--green);
  border-color: rgba(20, 122, 75, 0.25);
  background: var(--green-soft);
}

kbd {
  min-width: 22px;
  padding: 2px 5px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 5px;
  color: inherit;
  background: rgba(255, 255, 255, 0.3);
  font-size: 10px;
  font-weight: 650;
}

.nav-group,
.nav-section {
  display: grid;
  gap: 3px;
}

.nav-item,
.collection-button,
.tag-button {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  min-height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  color: #555851;
  background: transparent;
  font-size: 13px;
  text-align: left;
}

.tag-button {
  grid-template-columns: 1fr auto;
  padding: 0 5px 0 0;
}

.collection-button {
  grid-template-columns: 1fr auto;
  padding: 0 5px 0 0;
}

.collection-filter-button,
.tag-filter-button {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  min-width: 0;
  height: 100%;
  padding: 0 0 0 9px;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
  text-align: left;
}

.collection-filter-button span:last-child,
.tag-filter-button span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-tools,
.tag-tools {
  display: flex;
  align-items: center;
  gap: 3px;
}

.collection-edit-button,
.tag-edit-button {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #777a73;
  background: transparent;
  opacity: 0;
}

.collection-button:hover .collection-edit-button,
.collection-button:focus-within .collection-edit-button,
.collection-button.active .collection-edit-button,
.tag-button:hover .tag-edit-button,
.tag-button:focus-within .tag-edit-button,
.tag-button.active .tag-edit-button {
  opacity: 1;
}

.collection-edit-button:hover,
.tag-edit-button:hover {
  border-color: var(--line);
  color: var(--green);
  background: #fff;
}

.collection-edit-row,
.tag-edit-row {
  display: grid;
  grid-template-columns: 1fr 26px 26px;
  gap: 4px;
  align-items: center;
  min-height: 32px;
  padding: 0 4px;
}

.collection-edit-row {
  grid-template-columns: 20px minmax(0, 1fr) 26px 26px 26px;
}

.collection-edit-row input,
.tag-edit-row input {
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(20, 122, 75, 0.35);
  border-radius: 6px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
}

.collection-edit-row button,
.tag-edit-row button {
  display: grid;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #4f524c;
  background: #fff;
}

.collection-edit-row button:hover,
.tag-edit-row button:hover {
  color: var(--green);
  background: var(--green-soft);
}

.collection-edit-row .tooltip-wrap {
  width: 26px;
  height: 26px;
}

.collection-edit-row .inline-delete-button {
  color: #a2475b;
  font-size: 13px;
  line-height: 1;
}

.collection-edit-row .inline-delete-button:hover {
  color: #8f2f45;
  background: #f7e1e7;
}

.collection-edit-row .inline-delete-button:disabled,
.collection-edit-row .inline-delete-button:disabled:hover {
  cursor: not-allowed;
  color: #a6aaa2;
  background: #f2f5f3;
  opacity: 0.65;
}

.nav-item:hover,
.collection-button:hover,
.tag-button:hover {
  background: #edf4fb;
}

.nav-item.active,
.collection-button.active,
.tag-button.active {
  color: var(--ink);
  background: #e3edf7;
  font-weight: 660;
}

.nav-icon {
  color: #8b8e86;
  font-size: 13px;
}

.nav-item strong,
.collection-button strong,
.tag-button strong {
  color: #878a82;
  font-size: 11px;
  font-weight: 640;
}

.nav-section {
  margin-top: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  padding: 0 8px;
  color: #777a73;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.tooltip-wrap {
  display: grid;
  place-items: center;
}

.ghost-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #777a73;
  background: transparent;
}

.ghost-icon:hover {
  border-color: var(--line);
  background: #edf4fb;
}

.ghost-icon:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.ghost-icon.danger:not(:disabled):hover {
  color: #9c3047;
  border-color: rgba(204, 75, 107, 0.24);
  background: #f8e9ee;
}

.stack-list {
  display: grid;
  gap: 2px;
}

.collection-dot,
.tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.tag-dot {
  border-radius: 50%;
  border: 1px solid currentColor;
  background: transparent;
}

.library-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr);
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.search-box {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  min-width: 0;
  gap: 9px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #8f928a;
  background: #fff;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}

.header-actions select,
.view-toggle button,
.secondary,
.submit-button,
.primary-small,
.utility-button {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #4f524c;
  font-size: 13px;
  font-weight: 650;
}

.utility-button {
  padding: 0 12px;
  white-space: nowrap;
}

.library-header {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 20px 8px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.header-actions select {
  min-width: 124px;
  padding: 0 12px;
  outline: 0;
}

.view-toggle {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.view-toggle button {
  width: 30px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.view-toggle button.active {
  color: var(--green);
  background: var(--green-soft);
}

.result-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 12px;
  color: var(--muted);
  font-size: 13px;
}

.result-summary strong {
  color: var(--ink);
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 20px 20px;
  overflow: auto;
}

.prompt-grid.list-view {
  grid-template-columns: 1fr;
  gap: 8px;
}

.prompt-card {
  display: flex;
  min-height: 186px;
  flex-direction: column;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.prompt-card:hover,
.prompt-card.selected {
  border-color: var(--line-strong);
  box-shadow: 0 14px 36px rgba(39, 42, 35, 0.09);
}

.prompt-card:hover {
  transform: translateY(-1px);
}

.prompt-card.selected {
  border-color: rgba(74, 163, 143, 0.5);
  box-shadow:
    0 0 0 1px rgba(74, 163, 143, 0.18),
    0 12px 30px rgba(39, 42, 35, 0.08);
}

.card-top {
  display: grid;
  grid-template-columns: 1fr 28px;
  gap: 8px;
  align-items: start;
}

.card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.25;
}

.favorite-button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #94a3b8;
  background: transparent;
  font-size: 18px;
}

.favorite-button.active {
  color: var(--green);
  background: var(--green-soft);
}

.collection-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 660;
}

.status-badge {
  padding: 3px 6px;
  border-radius: 999px;
  color: #5f7087;
  background: #eef4fa;
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
}

.status-ready {
  color: #267667;
  background: var(--green-soft);
}

.status-needs-review {
  color: #8a641f;
  background: #f7ebd5;
}

.status-deprecated {
  color: #9a4255;
  background: #f7e1e7;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 4px 4px 4px 7px;
  border-radius: 6px;
  color: #5f7087;
  background: #e5eef8;
  font-size: 11px;
  line-height: 1;
}

.tag-pill-label {
  display: inline-block;
}

.tag-pill-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease, background-color 120ms ease;
}

.tag-pill:hover .tag-pill-remove,
.tag-pill:focus-within .tag-pill-remove {
  opacity: 1;
}

.tag-pill-remove:hover {
  background: rgba(0, 0, 0, 0.1);
}

.tag-pill-remove:focus-visible {
  opacity: 1;
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

.card-body {
  display: -webkit-box;
  margin: 12px 0 14px;
  overflow: hidden;
  color: #4b4e48;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.card-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  color: #868980;
  font-size: 11px;
}

.card-meta {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.card-actions button {
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #4f524c;
  background: #fff;
  font-size: 11px;
  font-weight: 680;
}

.card-actions button:hover {
  border-color: rgba(20, 122, 75, 0.28);
  color: var(--green);
  background: var(--green-soft);
}

.list-view .prompt-card {
  min-height: 122px;
}

.list-view .card-body {
  -webkit-line-clamp: 2;
}

.list-view .card-footer {
  justify-content: flex-start;
}

.list-view .card-actions {
  margin-left: auto;
}

.empty-state {
  margin: 28px auto;
  max-width: 420px;
  padding: 34px;
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 8px;
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.primary-small {
  padding: 0 14px;
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.composer {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 30;
  width: min(380px, calc(100vw - 32px));
  border-radius: 14px;
  overflow: hidden;
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.composer-open .composer {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.composer-open .library-panel {
  margin-right: 392px;
  transition: margin-right 180ms ease;
}

.composer-closed .library-panel {
  margin-right: 0;
  transition: margin-right 180ms ease;
}

#promptForm {
  display: flex;
  min-height: 100%;
  max-height: 100%;
  flex-direction: column;
  gap: 18px;
  overflow: auto;
  padding: 18px;
}

.composer-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 2px;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.favorite-composer-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #8c8f87;
  background: #fff;
  font-size: 18px;
  line-height: 1;
}

.favorite-composer-button:hover {
  border-color: var(--line-strong);
  background: #f6f4ef;
}

.favorite-composer-button.active {
  color: var(--green);
  border-color: rgba(20, 122, 75, 0.2);
  background: var(--green-soft);
}

.field {
  display: grid;
  gap: 7px;
}

.field > span {
  display: flex;
  justify-content: space-between;
  color: #494c47;
  font-size: 12px;
  font-weight: 720;
}

.field small {
  color: #9a9d95;
  font-weight: 620;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.field input,
.field select {
  height: 38px;
  padding: 0 11px;
}

.field textarea {
  min-height: 168px;
  resize: vertical;
  padding: 11px;
  line-height: 1.5;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-box:focus-within {
  border-color: rgba(20, 122, 75, 0.55);
  box-shadow: 0 0 0 3px rgba(20, 122, 75, 0.1);
}

.composer-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.composer-section-heading strong {
  font-size: 12px;
}

.composer-section-heading small {
  color: var(--muted);
  font-size: 11px;
}

.version-history {
  position: relative;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  overflow: visible;
}

.version-list {
  display: grid;
  gap: 7px;
  overflow: visible;
}

.version-list.expanded {
  max-height: 184px;
  overflow-y: auto;
  overflow-x: visible;
  padding-right: 2px;
}

.version-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.version-item:hover,
.version-item:focus-within,
.version-item:focus {
  border-color: rgba(74, 163, 143, 0.34);
  background: #fbfefd;
}

.version-item > div {
  min-width: 0;
}

.version-item strong,
.version-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-item strong {
  font-size: 12px;
}

.version-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.version-item button {
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #4f524c;
  background: #fff;
  font-size: 11px;
  font-weight: 680;
}

.version-item button:hover {
  border-color: rgba(74, 163, 143, 0.28);
  color: var(--green);
  background: var(--green-soft);
}

.version-detail {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 11px;
  border: 1px solid rgba(74, 163, 143, 0.28);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(39, 42, 35, 0.12);
  color: #5f7087;
  font-size: 11px;
  line-height: 1.45;
}

.version-detail::after {
  position: absolute;
  left: 22px;
  top: -6px;
  width: 10px;
  height: 10px;
  border-top: 1px solid rgba(74, 163, 143, 0.28);
  border-left: 1px solid rgba(74, 163, 143, 0.28);
  background: #fff;
  content: "";
  transform: rotate(45deg);
}

.version-detail strong {
  display: inline;
  color: var(--ink);
  font-size: inherit;
}

.version-diff {
  display: grid;
  gap: 7px;
}

.version-diff-meta {
  color: var(--muted);
}

.diff-line {
  display: grid;
  gap: 3px;
  padding: 7px 8px;
  border-radius: 7px;
}

.diff-line span {
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.diff-line.removed {
  color: #7d3b4a;
  background: #fbebef;
}

.diff-line.added {
  color: #276f61;
  background: #e7f6f1;
}

.version-item:hover .version-detail,
.version-item:focus-within .version-detail,
.version-item:focus .version-detail {
  display: block;
}

.version-toggle {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #4f524c;
  background: #fff;
  font-size: 11px;
  font-weight: 680;
}

.version-toggle:hover {
  color: var(--green);
  background: var(--green-soft);
}

.favorite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}

.favorite-row strong,
.favorite-row small {
  display: block;
}

.favorite-row strong {
  font-size: 12px;
}

.favorite-row small {
  color: var(--muted);
  font-size: 11px;
}

.favorite-row input {
  position: relative;
  width: 42px;
  height: 24px;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #e7e4dd;
  transition: background 150ms ease;
}

.favorite-row input::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
  content: "";
  transition: transform 150ms ease;
}

.favorite-row input:checked {
  border-color: var(--green);
  background: var(--green);
}

.favorite-row input:checked::before {
  transform: translateX(18px);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.secondary {
  padding: 0 14px;
}

.submit-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.submit-button:hover,
.primary-small:hover {
  background: var(--green-dark);
}

.app-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 14px;
  border: 1px solid rgba(20, 122, 75, 0.22);
  border-radius: 8px;
  color: #163d2b;
  background: #f4fbf7;
  box-shadow: 0 18px 42px rgba(39, 42, 35, 0.14);
  font-size: 13px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.app-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.copy-buffer {
  position: fixed;
  left: -9999px;
  top: 0;
}

.download-frame,
.download-link {
  display: none;
}

.modal-shell[hidden] {
  display: none;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(37, 50, 71, 0.28);
  backdrop-filter: blur(4px);
}

.starter-panel {
  position: relative;
  z-index: 1;
  width: min(860px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(87, 108, 132, 0.24);
}

.starter-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.starter-pack-list {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
}

.starter-pack {
  display: grid;
  gap: 12px;
}

.starter-pack-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 14px;
}

.starter-pack-heading h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.starter-pack-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.starter-pack-heading button,
.starter-template button {
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #4f524c;
  background: #fff;
  font-size: 12px;
  font-weight: 720;
}

.starter-pack-heading button:hover,
.starter-template button:hover {
  color: var(--green);
  border-color: rgba(74, 163, 143, 0.28);
  background: var(--green-soft);
}

.starter-template-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.starter-template {
  display: grid;
  min-height: 96px;
  grid-template-rows: 1fr auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.starter-template strong,
.starter-template small {
  display: block;
}

.starter-template strong {
  font-size: 13px;
}

.starter-template small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 230px minmax(480px, 1fr);
  }

  .library-header {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(124px, 0.8fr) auto;
    align-items: center;
  }

  .header-actions .utility-button,
  .header-actions select {
    width: 100%;
  }

  .composer {
    width: min(420px, calc(100vw - 28px));
  }

  .composer-open .library-panel {
    margin-right: 0;
  }

  #promptForm {
    min-height: auto;
  }
}

@media (max-width: 860px) {
  body {
    overflow-x: hidden;
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding: 8px;
    gap: 8px;
  }

  .composer {
    top: 8px;
    right: 8px;
    bottom: 8px;
    left: 12px;
    width: auto;
  }

  .sidebar {
    max-height: none;
    padding: 14px 10px;
  }

  .prompt-grid {
    grid-template-columns: 1fr;
    padding: 0 14px 16px;
  }

  .card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .card-actions {
    justify-content: flex-start;
  }

  .topbar,
  .library-header {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .library-header {
    align-items: stretch;
    padding: 18px 14px 8px;
  }

  .header-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .starter-template-list {
    grid-template-columns: 1fr;
  }

  .result-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding: 0 14px 10px;
  }

  .card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .card-actions {
    justify-content: flex-start;
  }

  .form-actions button {
    width: 100%;
  }

  .form-actions {
    flex-direction: column-reverse;
  }
}

@media (max-width: 560px) {
  .brand,
  .primary-action,
  .workspace-card,
  .nav-item,
  .collection-button,
  .tag-button {
    margin-inline: 0;
  }

  .header-actions {
    grid-template-columns: 1fr;
  }

  .view-toggle {
    justify-content: stretch;
  }

  .view-toggle button {
    width: 100%;
  }

  .starter-panel {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    border-radius: 12px;
  }

  .starter-pack-heading {
    grid-template-columns: 1fr;
  }

  .composer {
    left: 8px;
  }
}

@media (min-width: 861px) and (max-width: 1380px) {
  .prompt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
