:root {
  color-scheme: light;
  --prompt-bg: #f1fbf7;
  --prompt-surface: #ffffff;
  --prompt-surface-soft: #e8f8f2;
  --prompt-ink: #062414;
  --prompt-muted: #536c65;
  --prompt-line: #cfe8df;
  --prompt-line-strong: #a9d9cb;
  --prompt-emerald: #16a46f;
  --prompt-emerald-dark: #06351f;
  --prompt-green: #24c75a;
  --prompt-teal: #149f9d;
  --prompt-lime: #55e943;
  --prompt-amber: #c9821c;
  --prompt-blue: #149f9d;
  --prompt-red: #b33830;
  --prompt-shadow: 0 16px 42px rgba(6, 36, 20, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

.prompt-page {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, #fbfffd 0%, var(--prompt-bg) 42%, #e6f7f1 100%);
  color: var(--prompt-ink);
  font-family: "Noto Sans Thai", "Leelawadee UI", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.prompt-page button,
.prompt-page input,
.prompt-page select,
.prompt-page textarea {
  font: inherit;
}

.prompt-page button,
.prompt-page select {
  cursor: pointer;
}

.prompt-page [hidden] {
  display: none !important;
}

.prompt-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.prompt-topbar,
.workbench-head,
.category-rail,
.prompt-list-panel,
.detail-panel,
.submit-dialog {
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--prompt-shadow);
}

.prompt-topbar {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 12px;
  backdrop-filter: blur(16px);
}

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

.brand-mark span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--prompt-ink);
  color: white;
  font-size: 14px;
  font-weight: 950;
}

.brand-logo {
  display: block;
  width: 168px;
  height: 56px;
  object-fit: contain;
}

.brand-mark strong {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.top-nav {
  display: flex;
  gap: 6px;
  justify-content: center;
  min-width: 0;
}

.nav-button,
.clear-button,
.tag-chip,
.category-button,
.copy-button,
.submit-button,
.icon-button {
  border-radius: 8px;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.nav-button {
  min-height: 38px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--prompt-muted);
  padding: 0 12px;
  font-size: 14px;
  font-weight: 850;
}

.nav-button:hover,
.nav-button.active {
  border-color: var(--prompt-line);
  background: var(--prompt-surface-soft);
  color: var(--prompt-emerald-dark);
}

.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  background: linear-gradient(135deg, var(--prompt-emerald), var(--prompt-teal));
  color: white;
  padding: 0 14px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(22, 164, 111, 0.2);
}

.action-link {
  text-decoration: none;
}

.top-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
}

.auth-button.active {
  border-color: #b9d9cf;
  background: #ecf8f4;
  color: var(--prompt-emerald-dark);
}

.auth-logout {
  color: #8d4b2f;
}

.submit-button:hover {
  background: linear-gradient(135deg, var(--prompt-emerald-dark), #0b7f7d);
}

.submit-button.full {
  width: 100%;
  min-height: 48px;
}

.workbench-head {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(360px, 1.25fr) minmax(260px, 0.7fr);
  gap: 16px;
  align-items: stretch;
  margin-top: 14px;
  padding: 16px;
}

.title-block {
  display: grid;
  align-content: center;
  gap: 4px;
}

.title-block h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

.title-block p {
  margin: 0;
  color: var(--prompt-muted);
  line-height: 1.5;
}

.search-card {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.search-box {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  min-height: 54px;
  border: 1px solid var(--prompt-line-strong);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 0 12px 0 4px;
}

.search-box:focus-within {
  border-color: var(--prompt-emerald);
  box-shadow: 0 0 0 3px rgba(22, 164, 111, 0.16);
}

.search-box span {
  display: grid;
  place-items: center;
  color: var(--prompt-emerald);
}

.search-box svg,
.icon-button svg,
.copy-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--prompt-ink);
  font-size: 18px;
  outline: 0;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.filter-row label,
.submit-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--prompt-muted);
  font-size: 13px;
  font-weight: 850;
}

.filter-row select,
.submit-form input,
.submit-form select,
.submit-form textarea {
  width: 100%;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--prompt-ink);
  outline: 0;
}

.filter-row select {
  min-height: 42px;
  padding: 0 10px;
}

.submit-form input,
.submit-form select {
  min-height: 44px;
  padding: 8px 10px;
}

.submit-form textarea {
  min-height: 180px;
  padding: 10px;
  resize: vertical;
}

.auth-dialog {
  width: min(520px, calc(100vw - 28px));
}

.auth-dialog .submit-form {
  display: flex;
  flex-direction: column;
}

.auth-dialog .dialog-head {
  order: -20;
}

.auth-tabs {
  order: -19;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #f5faf8;
}

.auth-tabs .clear-button {
  justify-content: center;
  min-height: 38px;
  border-color: transparent;
  background: transparent;
}

.auth-tabs .clear-button.active {
  background: #ffffff;
  border-color: var(--prompt-line);
  box-shadow: 0 8px 20px rgba(8, 74, 65, 0.08);
}

.google-auth-button {
  order: -18;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--prompt-ink);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.google-auth-button span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  color: #0f9d58;
  border: 1px solid var(--prompt-line);
}

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

.auth-panel[hidden] {
  display: none;
}

.auth-panel p,
.password-rules {
  margin: 0;
  color: var(--prompt-muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.text-button {
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--prompt-accent);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.auth-dialog .submit-form > label {
  display: none;
}

.auth-dialog-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.auth-dialog-actions .full {
  min-height: 46px;
}

.auth-form-status {
  min-height: 20px;
  margin: 0;
  color: #b42318;
  font-size: 13px;
  font-weight: 750;
}

.auth-helper {
  margin: 0;
  color: var(--prompt-muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

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

.stats-strip div {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 92px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f2f7f6 100%);
  padding: 12px;
}

.stats-strip span {
  color: var(--prompt-muted);
  font-size: 13px;
  font-weight: 850;
}

.stats-strip strong {
  color: var(--prompt-ink);
  font-size: 28px;
  line-height: 1;
}

.prompt-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 390px;
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.category-rail,
.prompt-list-panel,
.detail-panel {
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.category-rail::-webkit-scrollbar,
.prompt-list-panel::-webkit-scrollbar,
.detail-panel::-webkit-scrollbar {
  width: 9px;
}

.category-rail::-webkit-scrollbar-thumb,
.prompt-list-panel::-webkit-scrollbar-thumb,
.detail-panel::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(20, 159, 157, 0.34);
  background-clip: padding-box;
}

.category-rail::-webkit-scrollbar-thumb:hover,
.prompt-list-panel::-webkit-scrollbar-thumb:hover,
.detail-panel::-webkit-scrollbar-thumb:hover {
  background-color: rgba(22, 164, 111, 0.58);
}

.category-rail,
.detail-panel {
  position: sticky;
  top: 88px;
}

.category-rail {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.rail-heading,
.panel-toolbar,
.detail-head,
.block-title,
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rail-heading span,
.block-title span {
  color: var(--prompt-ink);
  font-size: 15px;
  font-weight: 950;
}

.clear-button {
  min-height: 30px;
  border: 1px solid var(--prompt-line);
  background: #fbfcfd;
  color: var(--prompt-blue);
  padding: 0 8px;
  font-size: 13px;
  font-weight: 850;
}

.clear-button:disabled,
.copy-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.clear-button.active {
  border-color: #b9d9cf;
  background: #ecf8f4;
  color: var(--prompt-emerald-dark);
}

.clear-button.premium-action {
  border-color: #d7c8a2;
  background: #fff7df;
  color: #7a5300;
}

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

.category-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--prompt-muted);
  padding: 0 10px;
  text-align: left;
  font-weight: 850;
}

.category-button span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-button span:last-child {
  color: #7c8b96;
  font-size: 12px;
}

.category-button:hover,
.category-button.active {
  border-color: #cfe0db;
  background: var(--prompt-surface-soft);
  color: var(--prompt-emerald-dark);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid var(--prompt-line);
}

.prompt-collection-box,
.recent-box {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--prompt-line);
  padding-top: 12px;
}

.prompt-collection-box {
  border: 1px solid #cfe0db;
  border-radius: 8px;
  background: #f6fbf9;
  padding: 12px;
}

.prompt-collection-box .rail-heading strong {
  color: var(--prompt-emerald-dark);
  font-size: 12px;
  font-weight: 950;
}

.prompt-pack-list {
  display: grid;
  gap: 8px;
}

.collection-empty {
  margin: 0;
  color: var(--prompt-muted);
  font-size: 12px;
  line-height: 1.45;
}

.collection-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.collection-item a {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--prompt-ink);
  text-decoration: none;
}

.collection-item strong,
.collection-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-item strong {
  font-size: 12px;
}

.collection-item span {
  color: var(--prompt-muted);
  font-size: 11px;
}

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

.goal-assistant {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbfc);
  padding: 14px;
}

.goal-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.goal-chip {
  min-height: 34px;
  border: 1px solid var(--prompt-line);
  border-radius: 999px;
  background: #fbfcfd;
  color: var(--prompt-muted);
  padding: 0 12px;
  font-weight: 900;
}

.goal-chip:hover,
.goal-chip.active {
  border-color: #b9d9cf;
  background: #ecf8f4;
  color: var(--prompt-emerald-dark);
}

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

.recommended-prompts[hidden] {
  display: none;
}

.recommendation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.recommendation-card div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.recommendation-card strong,
.recommendation-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommendation-card strong {
  color: var(--prompt-ink);
  font-size: 13px;
}

.recommendation-card span {
  color: var(--prompt-muted);
  font-size: 11px;
  font-weight: 800;
}

.recent-list,
.related-list {
  display: grid;
  gap: 8px;
}

.mini-prompt-link {
  display: grid;
  gap: 3px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--prompt-ink);
  padding: 9px 10px;
  text-decoration: none;
}

.mini-prompt-link:hover,
.mini-prompt-link:focus-visible {
  border-color: #afcbc3;
  background: var(--prompt-surface-soft);
}

.mini-prompt-link strong {
  font-size: 13px;
  line-height: 1.35;
}

.mini-prompt-link span {
  color: var(--prompt-muted);
  font-size: 12px;
  line-height: 1.35;
}

.tag-chip {
  min-height: 30px;
  border: 1px solid var(--prompt-line);
  background: #fbfcfd;
  color: var(--prompt-muted);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 850;
}

.tag-chip:hover,
.tag-chip.active {
  border-color: #d2a354;
  background: #fff7e8;
  color: #8b5a14;
}

.prompt-list-panel {
  min-width: 0;
  padding: 14px;
}

.panel-toolbar {
  align-items: center;
  margin-bottom: 12px;
}

.panel-toolbar h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.panel-toolbar span {
  color: var(--prompt-muted);
  font-size: 14px;
  font-weight: 750;
}

.view-switch {
  display: inline-grid;
  grid-template-columns: 38px 38px;
  gap: 6px;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--prompt-line);
  background: #fbfcfd;
  color: var(--prompt-muted);
}

.icon-button:hover,
.icon-button.active,
.icon-button.is-favorite,
.icon-button.is-collected {
  border-color: #cfe0db;
  background: var(--prompt-surface-soft);
  color: var(--prompt-emerald-dark);
}

.icon-button.is-favorite svg {
  fill: currentColor;
}

.category-group {
  display: grid;
  gap: 6px;
}

.subcategory-list {
  display: grid;
  gap: 4px;
  padding: 0 0 4px 12px;
}

.subcategory-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 0;
  border-left: 2px solid var(--prompt-line);
  background: transparent;
  padding: 7px 8px 7px 10px;
  color: var(--prompt-muted);
  text-align: left;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.subcategory-button:hover,
.subcategory-button.active {
  border-left-color: var(--prompt-emerald);
  color: var(--prompt-emerald-dark);
  background: var(--prompt-surface-soft);
}

.subcategory-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #eef4f2;
  padding: 4px 9px;
  color: var(--prompt-emerald-dark);
  font-size: 0.76rem;
  font-weight: 700;
}

.language-pill,
.reference-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.76rem;
  font-weight: 700;
}

.language-pill {
  background: #edf3fb;
  color: #215d9c;
}

.reference-pill {
  background: #fff4df;
  color: #996510;
}

.icon-button.compact {
  width: 30px;
  height: 30px;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

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

.prompt-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: var(--prompt-surface);
}

.prompt-pagination[hidden] {
  display: none;
}

.prompt-page-info {
  min-width: 210px;
  text-align: center;
  color: var(--prompt-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.prompt-card {
  display: grid;
  gap: 12px;
  min-height: 230px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: var(--prompt-surface);
  padding: 14px;
  text-align: left;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.prompt-card:hover,
.prompt-card.active {
  border-color: #afcbc3;
  box-shadow: 0 14px 32px rgba(23, 33, 43, 0.11);
  transform: translateY(-1px);
}

.prompt-card.list-card {
  grid-template-columns: 180px minmax(0, 1fr) auto;
  min-height: 0;
  align-items: start;
}

.prompt-card-preview {
  aspect-ratio: 16 / 10;
  margin: -14px -14px 0;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background: var(--prompt-surface-soft);
}

.prompt-card-preview-link {
  display: block;
  width: 100%;
  height: 100%;
}

.prompt-card-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prompt-card.list-card .prompt-card-preview {
  width: 180px;
  height: 116px;
  margin: 0;
  border-radius: 8px;
}

.card-main {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.card-topline,
.card-actions,
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.category-pill,
.model-pill,
.status-pill,
.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.category-pill {
  background: #e7f4f0;
  color: var(--prompt-emerald-dark);
}

.model-pill {
  background: #eef4fb;
  color: var(--prompt-blue);
}

.status-pill {
  background: #fff7df;
  color: #8b5e00;
}

.meta-pill {
  border: 1px solid var(--prompt-line);
  background: #fbfcfd;
  color: var(--prompt-muted);
}

.prompt-card h3 {
  margin: 0;
  color: var(--prompt-ink);
  font-size: 20px;
  line-height: 1.25;
}

.prompt-card-title {
  color: inherit;
  text-decoration: none;
}

.prompt-card-title:hover,
.prompt-card-title:focus-visible {
  color: var(--prompt-emerald-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-tags span {
  color: #687985;
  font-size: 12px;
  font-weight: 800;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.card-count {
  color: var(--prompt-muted);
  font-size: 13px;
  font-weight: 800;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border: 0;
  background: var(--prompt-emerald);
  color: white;
  padding: 0 12px;
  font-weight: 900;
}

.copy-button:hover {
  background: var(--prompt-emerald-dark);
}

.detail-panel {
  min-width: 0;
  padding: 14px;
}

.detail-empty {
  display: grid;
  min-height: 420px;
  place-content: center;
  gap: 6px;
  color: var(--prompt-muted);
  text-align: center;
}

.detail-empty strong {
  color: var(--prompt-ink);
  font-size: 20px;
}

.detail-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  max-width: 100%;
}

.detail-content > * {
  min-width: 0;
  max-width: 100%;
}

.detail-head {
  align-items: start;
}

.detail-head > div {
  min-width: 0;
}

.detail-head span {
  color: var(--prompt-emerald);
  font-size: 13px;
  font-weight: 950;
}

.detail-head h2 {
  margin: 2px 0 0;
  font-size: 26px;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

#detail-summary {
  margin: 0;
  color: var(--prompt-muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.detail-preview-frame {
  height: clamp(280px, 64vh, 760px);
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbfb, #eef4f3);
}

.detail-preview-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.prompt-block {
  overflow: hidden;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #101820;
}

.block-title {
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px;
}

.block-title span {
  color: #e9f2f0;
}

.prompt-block pre {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  overflow-wrap: anywhere;
  color: #eaf4f2;
  padding: 14px;
  font-family: "Cascadia Mono", "Consolas", "Noto Sans Thai", monospace;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.example-block {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--prompt-line);
  padding-top: 12px;
}

.example-block h3 {
  margin: 0;
  font-size: 16px;
}

.example-block p {
  margin: 0;
  color: var(--prompt-muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.prompt-note-box {
  display: grid;
  gap: 10px;
  border: 1px solid #b9d9cf;
  border-radius: 8px;
  background: #f4fbf8;
  padding: 12px;
}

.prompt-note-box h3 {
  margin: 0;
  font-size: 16px;
}

.prompt-status-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.prompt-status-controls .clear-button {
  min-height: 38px;
  white-space: normal;
}

.prompt-note-box span {
  display: block;
  margin-top: 2px;
  color: var(--prompt-muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.prompt-note-box textarea {
  width: 100%;
  min-height: 96px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: white;
  color: var(--prompt-ink);
  outline: 0;
  padding: 10px;
  resize: vertical;
}

.prompt-note-box textarea:focus {
  border-color: var(--prompt-emerald);
  box-shadow: 0 0 0 3px rgba(22, 164, 111, 0.16);
}

.prompt-customizer {
  display: grid;
  gap: 12px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.prompt-customizer h3 {
  margin: 0;
  font-size: 16px;
}

.prompt-customizer p {
  margin: 2px 0 0;
  color: var(--prompt-muted);
  font-size: 13px;
  line-height: 1.45;
}

.prompt-variable-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.prompt-variable-fields label {
  display: grid;
  gap: 6px;
  color: var(--prompt-muted);
  font-size: 13px;
  font-weight: 850;
}

.prompt-variable-fields input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: white;
  color: var(--prompt-ink);
  outline: 0;
  padding: 8px 10px;
}

.prompt-variable-fields input:focus {
  border-color: var(--prompt-emerald);
  box-shadow: 0 0 0 3px rgba(22, 164, 111, 0.16);
}

.usage-guide-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #f7fcfa;
  padding: 12px;
}

.usage-guide-box h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.usage-guide-box span {
  color: var(--prompt-muted);
  line-height: 1.45;
}

.usage-guide-list {
  display: grid;
  gap: 8px;
}

.usage-guide-item {
  display: grid;
  grid-template-columns: minmax(92px, 0.72fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}

.usage-guide-item span {
  color: var(--prompt-muted);
  font-size: 12px;
  font-weight: 850;
}

.usage-guide-item strong {
  overflow-wrap: anywhere;
  color: var(--prompt-ink);
  font-size: 13px;
}

.usage-guide-item.good {
  border-color: #bfe3d0;
  background: #f0fbf5;
}

.usage-guide-item.warn {
  border-color: #ead08b;
  background: #fff9e8;
}

.usage-guide-item.bad {
  border-color: #e4b4ae;
  background: #fff3f1;
}

.usage-guide-item.info {
  border-color: var(--prompt-line);
  background: #f8fbff;
}

.feedback-box {
  display: grid;
  gap: 12px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: var(--prompt-surface-soft);
  padding: 12px;
}

.feedback-box h2,
.feedback-box h3 {
  margin: 0;
  font-size: 16px;
}

.feedback-box p {
  margin: 2px 0 0;
  color: var(--prompt-muted);
  font-size: 13px;
  line-height: 1.45;
}

.feedback-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.detail-action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.detail-action-row .clear-button {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  text-align: center;
}

.copy-mode-select {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #182632;
  color: #eaf4f2;
  padding: 0 10px;
  font-weight: 850;
}

.copy-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
}

.copy-mode-row .clear-button.active {
  border-color: #b9d9cf;
  background: #ecf8f4;
  color: var(--prompt-emerald-dark);
}

.related-box {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--prompt-line);
  padding-top: 12px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-heading h3 {
  margin: 0;
  font-size: 16px;
}

.section-heading a {
  color: var(--prompt-blue);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.empty-state {
  display: grid;
  min-height: 280px;
  place-content: center;
  gap: 6px;
  border: 1px dashed var(--prompt-line-strong);
  border-radius: 8px;
  color: var(--prompt-muted);
  text-align: center;
}

.empty-state strong {
  color: var(--prompt-ink);
  font-size: 20px;
}

.submit-dialog {
  width: min(620px, calc(100vw - 28px));
  border: 1px solid var(--prompt-line);
  padding: 0;
}

.submit-dialog::backdrop {
  background: rgba(14, 24, 32, 0.42);
  backdrop-filter: blur(4px);
}

.submit-form {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
}

.dialog-head {
  align-items: center;
}

.dialog-head h2 {
  margin: 0;
  font-size: 24px;
}

.dialog-head span {
  color: var(--prompt-muted);
  font-size: 14px;
  font-weight: 750;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 36px));
  border: 1px solid #b9d9cf;
  border-radius: 8px;
  background: #ecf8f4;
  color: var(--prompt-emerald-dark);
  padding: 12px 14px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.admin-link {
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--prompt-muted);
  padding: 0 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 850;
}

.admin-link:hover,
.admin-link.active {
  border-color: var(--prompt-line);
  background: var(--prompt-surface-soft);
  color: var(--prompt-emerald-dark);
}

.prompt-admin-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(320px, 0.78fr) minmax(380px, 1fr);
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.prompt-admin-layout > * {
  min-width: 0;
}

.admin-editor,
.admin-import,
.admin-library {
  min-width: 0;
}

.admin-editor h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

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

.admin-form-grid:has(textarea) {
  grid-template-columns: 1fr 1fr;
}

.admin-help {
  margin: 0 0 10px;
  color: var(--prompt-muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.admin-stats {
  grid-column: span 2;
}

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

.admin-stat-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: var(--prompt-surface-soft);
  padding: 12px;
}

.admin-stat-card span {
  color: var(--prompt-muted);
  font-size: 12px;
  font-weight: 850;
}

.admin-stat-card strong {
  color: var(--prompt-ink);
  font-size: 24px;
  line-height: 1;
}

.translation-progress-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #f7fcfa;
  padding: 14px;
}

.translation-progress-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.translation-progress-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.translation-progress-head span {
  color: var(--prompt-muted);
  font-size: 13px;
  line-height: 1.4;
}

.translation-progress-head strong {
  color: var(--prompt-emerald-dark);
  font-size: 28px;
  line-height: 1;
}

.translation-progress-bar {
  display: grid;
  grid-template-columns: var(--reviewed-width, 0%) var(--draft-width, 0%) var(--missing-width, 100%);
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8f1ee;
}

.translation-progress-bar span {
  min-width: 0;
}

.translation-progress-reviewed {
  background: var(--prompt-green);
}

.translation-progress-draft {
  background: #f2b84b;
}

.translation-progress-missing {
  background: #dbe5e2;
}

.translation-progress-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.translation-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  color: var(--prompt-ink);
  text-align: left;
  cursor: pointer;
}

.translation-metric:hover {
  border-color: rgba(15, 129, 97, 0.4);
  background: #f2fbf8;
}

.translation-metric span {
  color: var(--prompt-muted);
  font-size: 12px;
  font-weight: 850;
}

.translation-metric strong {
  color: var(--prompt-ink);
  font-size: 20px;
}

.admin-insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.admin-insight-grid > div {
  min-width: 0;
  border-top: 1px solid var(--prompt-line);
  padding-top: 12px;
}

.admin-insight-grid h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.admin-insight-grid ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.admin-insight-grid li,
.admin-insight-grid p {
  margin: 0;
  color: var(--prompt-muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.quality-issue-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.quality-issue-item > div:first-child {
  display: grid;
  gap: 6px;
}

.quality-issue-meta {
  color: var(--prompt-muted);
  font-size: 12px;
  font-weight: 750;
}

.quality-issue-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.quality-issue-actions .clear-button,
.quality-issue-actions .submit-button {
  min-height: 34px;
  padding: 0 8px;
  font-size: 12px;
}

.admin-download-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.csv-box {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 260px;
  margin-bottom: 12px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #101820;
  color: #eaf4f2;
  padding: 12px;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
}

.admin-prompt-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 160px);
  overflow: auto;
  padding-right: 4px;
}

.admin-load-more {
  width: 100%;
  margin-top: 10px;
  justify-content: center;
}

.admin-library-controls,
.admin-bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.admin-library-controls input,
.admin-library-controls select {
  min-height: 38px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  color: var(--prompt-ink);
}

.admin-library-controls input {
  flex: 1 1 220px;
}

.admin-bulk-toolbar {
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #f7faf9;
  padding: 10px;
}

.admin-bulk-toolbar strong {
  margin-right: auto;
}

.admin-prompt-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.admin-row-check {
  display: grid;
  gap: 4px;
  justify-items: center;
  color: var(--prompt-muted);
  font-size: 12px;
}

.admin-row-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--prompt-green);
}

.admin-row-actions {
  display: grid;
  gap: 7px;
  min-width: 74px;
}

.translation-preview {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  border-left: 3px solid var(--prompt-green);
  border-radius: 8px;
  background: #f2fbf7;
  padding: 8px 10px;
}

.translation-preview strong {
  color: var(--prompt-ink);
  font-size: 14px;
  line-height: 1.35;
}

.translation-preview span {
  color: var(--prompt-muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.translation-draft {
  border-color: #edd38b;
  background: #fff7db;
  color: #8a5a00;
}

.translation-reviewed {
  border-color: #bfe3d0;
  background: #eaf7f0;
  color: var(--prompt-green);
}

.translation-missing {
  background: #f4f6f8;
  color: var(--prompt-muted);
}

.quality-score-pill.good {
  border-color: #bfe3d0;
  background: #eafbf3;
  color: var(--prompt-emerald-dark);
}

.quality-score-pill.warn {
  border-color: #ead08b;
  background: #fff8df;
  color: #8a5a00;
}

.quality-score-pill.bad,
.quality-issue-pill,
.quality-missing-pill {
  border-color: #e4b4ae;
  background: #fff1ee;
  color: #9a322b;
}

.quality-preview-pill {
  border-color: #b9d9cf;
  background: #f0fbf7;
  color: var(--prompt-emerald-dark);
}

.translation-quality-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.translation-quality-ready {
  border-color: #bfe3d0;
  background: #eafbf3;
  color: var(--prompt-emerald-dark);
}

.translation-quality-review {
  border-color: #ead08b;
  background: #fff8df;
  color: #8a5a00;
}

.translation-quality-blocked {
  border-color: #e4b4ae;
  background: #fff1ee;
  color: #9a322b;
}

.translation-review-panel {
  grid-column: span 2;
}

.translation-batch-box {
  display: grid;
  gap: 12px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #f7fcfa;
  padding: 12px;
}

.translation-batch-box h3 {
  margin: 0;
  font-size: 16px;
}

.translation-batch-box p,
.translation-batch-box > span {
  margin: 2px 0 0;
  color: var(--prompt-muted);
  font-size: 13px;
  line-height: 1.45;
}

.translation-batch-controls {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(160px, 1fr) minmax(160px, 0.9fr);
  gap: 10px;
  align-items: end;
}

.translation-batch-controls label {
  display: grid;
  gap: 6px;
  color: var(--prompt-muted);
  font-size: 13px;
  font-weight: 850;
}

.translation-batch-controls select {
  min-height: 40px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: white;
  color: var(--prompt-ink);
  padding: 0 10px;
  font-weight: 850;
}

.translation-check-option {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: white;
  padding: 8px 10px;
}

.translation-check-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--prompt-green);
}

.translation-original-box {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #f7faf9;
  padding: 12px;
}

.translation-original-box span {
  color: var(--prompt-muted);
  font-size: 12px;
  font-weight: 850;
}

.translation-original-box strong {
  color: var(--prompt-ink);
  font-size: 18px;
  line-height: 1.35;
}

.translation-original-box p {
  margin: 0;
  color: var(--prompt-muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.translation-original-box pre {
  max-height: 220px;
  overflow: auto;
  margin: 4px 0 0;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  color: var(--prompt-ink);
  font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
}

.translation-quality-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #f7faf9;
  padding: 12px;
}

.translation-quality-summary-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.translation-quality-score {
  color: var(--prompt-ink);
  font-size: 15px;
  line-height: 1.3;
}

.translation-quality-level,
.translation-quality-note {
  margin: 0;
  color: var(--prompt-muted);
  font-size: 13px;
  line-height: 1.45;
}

.translation-quality-reasons {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  color: var(--prompt-muted);
  font-size: 13px;
  line-height: 1.45;
}

.translation-review-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.translation-review-toolbar span {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--prompt-line);
  border-radius: 999px;
  background: #f2fbf8;
  color: var(--prompt-emerald-dark);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 850;
}

.translation-review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-mini-link {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.danger-button {
  border-color: #f0c3bf;
  color: var(--prompt-red);
}

.admin-prompt-row h3 {
  margin: 8px 0 4px;
  font-size: 18px;
  line-height: 1.25;
}

.admin-prompt-row p {
  margin: 0 0 8px;
  color: var(--prompt-muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.prompt-detail-page {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 18px;
  overflow-x: hidden;
}

.prompt-detail-article {
  display: grid;
  gap: 16px;
  margin-top: 14px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--prompt-shadow);
  padding: 18px;
}

.prompt-detail-article h1 {
  margin: 2px 0 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
}

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

.prompt-detail-summary {
  margin: 0;
  color: var(--prompt-muted);
  font-size: 18px;
  line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .prompt-page *,
  .prompt-page *::before,
  .prompt-page *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 1180px) {
  .workbench-head {
    grid-template-columns: 1fr;
  }

  .prompt-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .detail-panel {
    position: static;
    grid-column: 1 / -1;
  }

  .category-rail,
  .prompt-list-panel,
  .detail-panel {
    max-height: calc(100vh - 112px);
  }

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

  .admin-stats,
  .translation-review-panel {
    grid-column: auto;
  }

  .admin-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-prompt-list {
    max-height: none;
  }
}

@media (max-width: 820px) {
  .prompt-shell {
    padding: 12px;
  }

  .prompt-topbar {
    position: static;
    grid-template-columns: 1fr;
  }

  .top-nav {
    justify-content: stretch;
    overflow-x: auto;
  }

  .nav-button {
    flex: 1 0 auto;
  }

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

  .category-rail {
    position: static;
    max-height: none;
    overflow-y: visible;
  }

  .prompt-list-panel,
  .detail-panel {
    max-height: none;
    overflow-y: visible;
    overscroll-behavior: auto;
  }

  .translation-batch-controls {
    grid-template-columns: 1fr;
  }

  .usage-guide-item {
    grid-template-columns: 1fr;
  }

  .category-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .category-button {
    flex: 0 0 auto;
    min-width: 150px;
  }

  .stats-strip,
  .filter-row,
  .prompt-variable-fields,
  .recommended-prompts,
  .feedback-actions,
  .admin-stats-grid,
  .admin-insight-grid,
  .translation-progress-metrics,
  .admin-form-grid,
  .admin-form-grid:has(textarea) {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .prompt-detail-page {
    width: 100%;
    max-width: 100vw;
    padding: 10px;
  }

  .prompt-detail-article {
    min-width: 0;
    padding: 12px;
  }

  .prompt-detail-article h1,
  .prompt-detail-summary,
  .meta-row,
  .detail-action-row,
  .detail-preview-frame,
  .prompt-block,
  .example-block {
    min-width: 0;
    max-width: 100%;
  }

  .prompt-detail-article h1,
  .prompt-detail-summary,
  .detail-action-row .clear-button {
    overflow-wrap: anywhere;
  }

  .detail-preview-frame {
    height: clamp(260px, 58vh, 560px);
  }

  .block-title {
    gap: 8px;
  }

  .copy-mode-row {
    min-width: 0;
    flex-wrap: wrap;
  }

  .prompt-block pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .prompt-topbar,
  .workbench-head,
  .category-rail,
  .prompt-list-panel,
  .detail-panel {
    padding: 12px;
  }

  .brand-mark strong {
    font-size: 18px;
  }

  .brand-logo {
    width: 138px;
    height: 46px;
  }

  .search-box {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .search-box input {
    font-size: 16px;
  }

  .panel-toolbar,
  .card-footer,
  .rail-heading,
  .detail-head,
  .dialog-head,
  .admin-prompt-row {
    display: grid;
  }

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

  .view-switch {
    justify-self: start;
  }

  .prompt-grid,
  .prompt-grid.list-mode {
    grid-template-columns: 1fr;
  }

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

  .prompt-card.list-card .prompt-card-preview {
    width: auto;
    height: auto;
    margin: -14px -14px 0;
    border-radius: 8px 8px 0 0;
  }

  .copy-button {
    width: 100%;
  }

  .collection-actions,
  .recommendation-card {
    grid-template-columns: 1fr;
  }

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

.collection-hero {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--prompt-shadow);
  padding: 18px;
}

.collection-hero h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
}

.collection-hero p {
  margin: 0;
  color: var(--prompt-muted);
  font-size: 18px;
  line-height: 1.6;
}

.collection-hero span {
  color: var(--prompt-emerald);
  font-weight: 950;
}

.collection-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.collection-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  overflow: hidden;
  padding: 14px;
}

.collection-card .prompt-card-preview {
  margin: -14px -14px 4px;
}

.collection-card h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.collection-card h2 a {
  color: var(--prompt-ink);
  text-decoration: none;
}

.collection-card h2 a:hover {
  color: var(--prompt-emerald-dark);
}

.collection-card p {
  margin: 0;
  color: var(--prompt-muted);
  line-height: 1.5;
}

.prompt-generator-page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.generator-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.generator-form,
.generator-result {
  display: grid;
  gap: 14px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--prompt-shadow);
  padding: 16px;
}

.generator-form h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

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

.generator-form input,
.generator-form select,
.generator-form textarea {
  width: 100%;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--prompt-ink);
  outline: 0;
}

.generator-form input,
.generator-form select {
  min-height: 44px;
  padding: 8px 10px;
}

.generator-form textarea {
  min-height: 120px;
  padding: 10px;
  resize: vertical;
}

.generator-result {
  position: sticky;
  top: 88px;
  overflow: hidden;
  background: #101820;
}

.generator-result .block-title {
  margin: -16px -16px 0;
  padding: 12px 14px;
}

.generator-result pre {
  min-height: 560px;
  max-height: calc(100vh - 190px);
  margin: 0;
  overflow: auto;
  color: #eaf4f2;
  font-family: "Cascadia Mono", "Consolas", "Noto Sans Thai", monospace;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

@media (max-width: 820px) {
  .top-actions,
  .admin-download-actions,
  .generator-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .generator-result {
    position: static;
  }

  .generator-result pre {
    min-height: 420px;
    max-height: none;
  }
}

.image-prompt-page {
  background:
    linear-gradient(120deg, rgba(236, 253, 245, 0.78), rgba(239, 246, 255, 0.86)),
    #f6faf9;
}

.image-prompt-shell {
  max-width: 1440px;
}

.image-prompt-workbench {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.image-prompt-control,
.image-prompt-results {
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--prompt-shadow);
  padding: 16px;
}

.image-prompt-control {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(320px, 1fr) minmax(260px, 0.55fr);
  gap: 14px;
  align-items: end;
}

.eyebrow {
  color: var(--prompt-emerald-dark);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.image-prompt-search {
  display: grid;
  gap: 10px;
}

.image-prompt-stats {
  margin: 0;
}

.image-prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.image-prompt-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(14, 23, 33, 0.08);
}

.image-prompt-media {
  position: relative;
  display: block;
  min-height: 210px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #eaf3f2;
  color: #ffffff;
  text-decoration: none;
}

.image-prompt-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 180ms ease;
}

.image-prompt-card:hover .image-prompt-media img {
  transform: scale(1.025);
}

.image-prompt-media span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  border-radius: 999px;
  background: rgba(10, 20, 30, 0.72);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
}

.image-prompt-card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.image-prompt-card h3 {
  margin: 0;
  color: var(--prompt-ink);
  font-size: 20px;
  line-height: 1.3;
}

.image-prompt-card p {
  margin: 0;
  color: var(--prompt-muted);
  font-size: 14px;
  line-height: 1.55;
}

.image-prompt-card pre {
  min-height: 130px;
  max-height: 180px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #f7faf9;
  color: #23323f;
  padding: 10px;
  font-family: "Cascadia Mono", "Consolas", "Noto Sans Thai", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.prompt-chip.warn {
  background: #fff7ed;
  color: #b45309;
}

@media (max-width: 1040px) {
  .image-prompt-control {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

@media (max-width: 620px) {
  .image-prompt-control,
  .image-prompt-results {
    padding: 12px;
  }

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

.admin-image-import {
  display: grid;
  gap: 14px;
}

.admin-image-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #f7faf9;
  padding: 10px;
}

.admin-import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
  color: var(--prompt-muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-import-summary[hidden] {
  display: none;
}

.admin-import-summary strong {
  color: var(--prompt-ink);
  font-size: 14px;
}

.admin-image-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.admin-image-card {
  position: relative;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-image-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  object-fit: cover;
  background: #eef5f4;
}

.admin-image-card-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.admin-image-card h3 {
  margin: 0;
  color: var(--prompt-ink);
  font-size: 16px;
  line-height: 1.35;
}

.admin-image-card p {
  margin: 0;
  color: var(--prompt-muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-image-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 18px rgba(14, 23, 33, 0.16);
  padding: 6px 9px;
  color: var(--prompt-ink);
  font-size: 12px;
  font-weight: 900;
}

.admin-image-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--prompt-emerald);
}

@media (max-width: 620px) {
  .admin-image-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }
}

.billing-shell {
  max-width: 1120px;
}

.billing-layout {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.billing-status-panel,
.billing-note {
  display: grid;
  gap: 14px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--prompt-shadow);
  padding: 18px;
}

.billing-status-panel {
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: center;
}

.billing-status-panel h1,
.billing-note h2,
.billing-plan-card h2 {
  margin: 0;
}

.billing-status-panel p,
.billing-note p,
.billing-plan-card p {
  margin: 0;
  color: var(--prompt-muted);
  line-height: 1.6;
}

.billing-status-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #f7faf9;
  padding: 16px;
}

.billing-status-card.is-pro {
  border-color: rgba(22, 164, 111, 0.38);
  background: #eafbf3;
}

.billing-status-card span,
.billing-status-card small {
  color: var(--prompt-muted);
  font-weight: 800;
}

.billing-status-card strong {
  color: var(--prompt-ink);
  font-size: 28px;
}

.billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.billing-plan-card {
  display: grid;
  gap: 14px;
  align-content: start;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--prompt-shadow);
  padding: 18px;
}

.billing-plan-card.featured {
  border-color: rgba(22, 164, 111, 0.42);
}

.billing-plan-card strong {
  color: var(--prompt-ink);
  font-size: 30px;
}

.billing-plan-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--prompt-muted);
}

.creator-workspace {
  width: 100%;
  max-width: 1180px;
  margin: 16px auto 0;
  padding: 0 16px 28px;
}

.creator-workspace-head,
.creator-prompt-card {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--prompt-line);
  padding: 18px 0;
}

.creator-workspace-head h2,
.creator-prompt-card h3 {
  margin: 0;
}

.creator-workspace-head p,
.creator-prompt-card p {
  margin: 6px 0 0;
  color: var(--prompt-muted);
}

.creator-eyebrow {
  color: var(--prompt-emerald);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.creator-head-actions,
.creator-prompt-actions,
.creator-form-actions,
.public-metrics,
.creator-prompt-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.creator-quota,
.creator-status,
.creator-prompt-topline span,
.public-metrics span {
  border: 1px solid var(--prompt-line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--prompt-muted);
  font-size: 12px;
  font-weight: 800;
}

.creator-line {
  margin-top: 8px;
  color: var(--prompt-emerald);
  font-size: 13px;
  font-weight: 800;
}

.public-metrics {
  margin-top: 8px;
}

.icon-button.is-liked {
  border-color: #e05b68;
  background: #fff1f3;
  color: #b42336;
}

.creator-prompt-list,
.creator-prompt-main {
  display: grid;
  gap: 8px;
}

.creator-prompt-main {
  min-width: 0;
}

.creator-prompt-actions {
  justify-content: flex-end;
}

.creator-rejection {
  border-left: 3px solid #d64545;
  background: #fff4f3;
  padding: 9px 12px;
  color: #8e2d2d;
  font-size: 13px;
}

.creator-status.status-pending { color: #8a5a00; background: #fff7df; }
.creator-status.status-rejected { color: #a43131; background: #fff0ef; }
.creator-status.status-published { color: #0b7650; background: #e9f9f2; }

.creator-empty {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 40px 0;
  color: var(--prompt-muted);
}

.creator-form-actions > * {
  flex: 1 1 180px;
}

.creator-form-status {
  min-height: 20px;
  margin: 0;
  color: #a43131;
  font-size: 13px;
}

.creator-review-panel,
.creator-review-content {
  display: grid;
  gap: 14px;
}

.creator-review-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.creator-review-summary > div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  padding: 10px;
}

.creator-review-summary span {
  color: var(--prompt-muted);
  font-size: 12px;
}

.creator-review-preview {
  width: min(100%, 720px);
  max-height: 420px;
  object-fit: contain;
  object-position: center;
  border: 1px solid var(--prompt-line);
  border-radius: 8px;
  background: #f7faf9;
}

.creator-review-prompt {
  overflow: auto;
  max-height: 360px;
  margin: 0;
  border-radius: 8px;
  background: #101a22;
  padding: 14px;
  color: #f4fbf8;
  white-space: pre-wrap;
}

.creator-review-badge {
  border-color: rgba(22, 164, 111, 0.35);
  background: #eaf9f3;
  color: #0b7650;
}

@media (max-width: 1180px) {
  .creator-workspace-head,
  .creator-prompt-card {
    align-items: stretch;
    flex-direction: column;
  }

  .creator-head-actions,
  .creator-prompt-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .creator-workspace {
    padding-inline: 12px;
  }

  .creator-head-actions > *,
  .creator-prompt-actions > * {
    max-width: 100%;
    white-space: normal;
  }

  .public-metrics span {
    min-width: 0;
  }

  .creator-review-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .billing-status-panel,
  .billing-plan-grid {
    grid-template-columns: 1fr;
  }
}
