.prompt-library-root { max-width: 1100px; margin: 0 auto; padding: 0 24px 48px; display: grid; gap: 18px; }
.prompt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 8px 24px rgba(24, 36, 47, .04); }
.prompt-search-field { flex: 1 1 220px; min-width: 0; }
.prompt-filter-field { flex: 0 1 160px; min-width: 132px; margin: 0; }
.prompt-type-tabs, .prompt-toolbar-check { flex: none; }
#prompt-create { flex: none; margin-left: auto; }
.prompt-search-field input, .prompt-filter-field select { display: block; width: 100%; min-height: 42px; margin: 0; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; color: var(--deep-sea-ink); background: var(--wash); }
.prompt-search-field input:focus, .prompt-filter-field select:focus { border-color: var(--deep-sea); background: var(--surface); box-shadow: 0 0 0 3px rgba(23, 63, 99, .12); outline: none; }
.prompt-type-tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--wash); }
.prompt-type-tabs button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; color: var(--ink-soft); background: transparent; font-size: 13px; font-weight: 650; }
.prompt-type-tabs button[aria-selected="true"], .prompt-type-tabs button[aria-pressed="true"] { color: #fff; background: var(--deep-sea); }
.prompt-toolbar-check, .prompt-share-check { display: inline-flex; min-height: 42px; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 650; white-space: nowrap; }
.prompt-toolbar-check input, .prompt-share-check input { width: 16px; height: 16px; min-width: 16px; min-height: 16px; margin: 0; accent-color: var(--deep-sea); }
.prompt-toolbar .primary-button { min-height: 42px; padding: 0 16px; white-space: nowrap; }
.prompt-result-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; color: var(--muted); font-size: 12px; }
.prompt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.prompt-card { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-composer); }
.prompt-card-media { display: block; width: 100%; aspect-ratio: 16 / 10; padding: 0; border: 0; background: #e7edf2; overflow: hidden; }
.prompt-card-media img, .prompt-detail-images img { display: block; width: 100%; height: 100%; object-fit: cover; }
.prompt-detail-images img { object-fit: contain; background: #06192b; }
.prompt-image-fallback { display: grid; place-items: center; width: 100%; height: 100%; min-height: 140px; color: var(--muted); background: var(--chip); font-size: 12px; }
.prompt-card-body { display: grid; gap: 10px; padding: 14px 14px 16px; }
.prompt-card-body h3 { margin: 0; color: var(--deep-sea-ink); font-size: 15px; line-height: 1.4; }
.prompt-card-body p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prompt-card-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 650; }
.prompt-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; color: var(--deep-sea); background: var(--chip); }
.prompt-card-actions { display: flex; gap: 8px; }
.prompt-attribution { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.prompt-attribution a { color: var(--deep-sea); text-underline-offset: 3px; }
.prompt-detail-panel { width: min(1080px, 96vw); height: min(760px, calc(100vh - 48px)); overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-float); }
.prompt-detail-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .8fr); grid-template-rows: minmax(0, 1fr); height: 100%; }
.prompt-detail-images { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #06192b; }
.prompt-detail-copy { min-width: 0; min-height: 0; display: grid; gap: 12px; padding: 28px 24px; align-content: start; overflow-y: auto; overscroll-behavior: contain; }
.prompt-detail-copy h2 { margin: 0; font-size: 20px; }
.prompt-detail-copy pre, #prompt-detail-text { margin: 0; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; color: var(--deep-sea-ink); font: inherit; line-height: 1.7; }
.prompt-detail-chips, .prompt-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.prompt-create-panel { width: min(720px, 94vw); max-height: calc(100vh - 48px); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; padding: 28px 28px 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-float); }
.prompt-create-heading { margin-bottom: 18px; }
.prompt-create-heading h2 { margin: 0; font-size: 22px; }
.prompt-create-heading p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.prompt-create-form { min-height: 0; display: grid; align-content: start; gap: 14px; overflow-y: auto; padding-bottom: 18px; }
.prompt-create-form label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 13px; font-weight: 650; }
.prompt-create-form input, .prompt-create-form select, .prompt-create-form textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--deep-sea-ink); background: var(--surface); font: inherit; }
.prompt-create-form textarea { resize: vertical; line-height: 1.6; }
.prompt-create-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.prompt-type-picker { margin: 0; padding: 0; border: 0; display: grid; gap: 6px; }
.prompt-type-picker legend { padding: 0; color: var(--ink-soft); font-size: 13px; font-weight: 650; }
.prompt-media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.prompt-media-field { display: grid; gap: 8px; align-content: start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--wash); }
.prompt-media-field span { color: var(--ink-soft); font-size: 13px; font-weight: 650; }
.prompt-media-hint { margin: 0; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.5; }
.prompt-media-field .ghost-button { justify-self: start; min-height: 36px; }
.prompt-media-thumb { min-height: 112px; display: grid; place-items: center; overflow: hidden; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); background: var(--surface); font-size: 12px; }
.prompt-media-thumb img, .prompt-media-thumb video { width: 100%; height: 112px; object-fit: cover; }
.prompt-create-footer { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 -28px; padding: 14px 28px 22px; border-top: 1px solid var(--line); background: var(--surface); }
.prompt-create-actions { display: flex; gap: 8px; }
.prompt-create-form .prompt-share-check { min-height: 36px; font-weight: 500; }
.prompt-create-form .prompt-share-check input { width: 16px; height: 16px; min-width: 16px; min-height: 16px; padding: 0; border: 0; }
.prompt-card-media video { width: 100%; height: 100%; object-fit: cover; background: #06192b; pointer-events: none; }
.prompt-detail-images video { width: 100%; height: 100%; object-fit: contain; background: #06192b; }
.prompt-copy-fallback { display: grid; gap: 8px; }
.prompt-copy-fallback textarea { width: 100%; min-height: 120px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.prompt-library-status { min-height: 1.2em; margin: 0; color: var(--danger); font-size: 12px; }

@media (max-width: 900px) {
  #prompt-create { margin-left: 0; }
  .prompt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prompt-detail-panel { height: min(92vh, 820px); }
  .prompt-detail-layout { grid-template-columns: 1fr; grid-template-rows: minmax(240px, 1.15fr) minmax(0, .85fr); }
  .prompt-media-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .prompt-library-root { padding: 0 12px calc(24px + var(--mobile-nav-height) + env(safe-area-inset-bottom)); }
  .prompt-toolbar { display: flex; }
  .prompt-toolbar { padding: 8px; gap: 8px; }
  .prompt-search-field { flex: 1 1 160px; }
  .prompt-filter-field { flex: 1 1 130px; min-width: 0; }
  #prompt-create { flex: 0 0 auto; margin-left: 0; }
  .prompt-type-tabs { flex: 1 1 100%; justify-content: space-between; }
  .prompt-type-tabs button { flex: 1; min-height: 44px; }
  .prompt-toolbar-check { flex: 0 0 auto; min-height: 44px; }
  .prompt-search-field input, .prompt-filter-field select, .prompt-toolbar .primary-button { min-height: 44px; }
  .prompt-attribution a { display: inline-block; padding: 12px 2px; }
  .prompt-grid { grid-template-columns: 1fr; }
  .prompt-detail-panel { width: 100%; height: min(92vh, 820px); max-height: none; border-radius: 14px 14px 0 0; }
  .prompt-detail-layout { grid-template-rows: minmax(220px, 1.1fr) minmax(0, .9fr); }
  .prompt-detail-copy { padding: 20px 17px calc(22px + env(safe-area-inset-bottom)); }
  .prompt-create-panel { width: 100%; max-height: 92vh; padding: 22px 16px 0; border-radius: 14px 14px 0 0; }
  .prompt-create-row { grid-template-columns: 1fr; }
  .prompt-create-footer { margin: 0 -16px; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .prompt-card-actions .ghost-button, .prompt-detail-actions .primary-button, .prompt-detail-actions .ghost-button { min-height: 44px; }
}
