:root {
  color-scheme: dark;
  --bg: #071013;
  --panel: #101b21;
  --panel-2: #14252c;
  --line: rgba(255, 255, 255, .1);
  --line-soft: rgba(255, 255, 255, .06);
  --text: #edf7f4;
  --muted: #9bb2ad;
  --dim: #60736f;
  --accent: #73f2c4;
  --accent-2: #8da7ff;
  --danger: #f08a72;
  --shadow: 0 18px 52px rgba(0, 0, 0, .34);
  --font: -apple-system, BlinkMacSystemFont, "Pretendard", "Noto Sans KR", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% -10%, rgba(115, 242, 196, .14), transparent 30%),
    linear-gradient(180deg, #071013 0%, #0a161a 44%, #071013 100%);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

body.modal-open {
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header,
.start-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 13px 24px;
  background: rgba(11, 11, 11, .86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.start-header {
  grid-template-columns: auto auto;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #04110d;
  background: var(--accent);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--accent);
  font-size: 16px;
  line-height: 1.05;
}

.brand small {
  overflow: hidden;
  max-width: 180px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-search input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, .055);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.header-search input:focus {
  border-color: rgba(115, 242, 196, .7);
  box-shadow: 0 0 0 3px rgba(115, 242, 196, .12);
}

.header-action,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 15px;
  color: #04110d;
  background: var(--accent);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.catalog-shell,
.start-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 70px;
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding: 28px 0 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.16;
  letter-spacing: 0;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.toolbar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}

.chip:hover,
.chip.is-active {
  color: #c8fff0;
  background: rgba(115, 242, 196, .13);
  border-color: rgba(115, 242, 196, .5);
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.sort-control select {
  min-height: 34px;
  padding: 0 32px 0 11px;
  color: var(--text);
  background: rgba(255, 255, 255, .055);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.sort-control select:focus {
  border-color: rgba(115, 242, 196, .7);
  box-shadow: 0 0 0 3px rgba(115, 242, 196, .12);
}

.status-strip {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 22px;
  padding: 14px 16px;
  background: rgba(141, 167, 255, .08);
  border: 1px solid rgba(141, 167, 255, .24);
  border-radius: 8px;
}

.maker-panel {
  display: grid;
  gap: 14px;
  margin: 0 0 22px;
  padding: 18px;
  background: rgba(21, 20, 18, .95);
  border: 1px solid rgba(115, 242, 196, .24);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.maker-panel[hidden] {
  display: none;
}

.maker-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.maker-head h2 {
  margin: 0;
  font-size: 20px;
}

.maker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.maker-grid textarea {
  min-height: 150px;
}

.maker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, .4fr);
  gap: 10px;
}

.maker-row input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--text);
  background: rgba(255, 255, 255, .055);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.maker-status {
  min-height: 20px;
  margin: 0;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 750;
}

.status-strip div {
  display: grid;
  gap: 2px;
}

.status-strip strong {
  color: var(--accent-2);
}

.status-strip span,
.status-strip a {
  color: var(--muted);
  font-size: 12px;
}

.status-strip a {
  color: var(--accent-2);
  font-weight: 750;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.ad-slot {
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  color: rgba(237, 247, 244, .42);
  background:
    linear-gradient(135deg, rgba(115, 242, 196, .08), transparent 54%),
    rgba(255, 255, 255, .035);
  border: 1px dashed rgba(255, 255, 255, .16);
  border-radius: 8px;
}

.ad-slot span {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 1;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

.ad-slot.has-ad > span {
  display: none;
}

.adfit-mount {
  display: grid;
  place-items: center;
  max-width: 100%;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 4px;
}

.adfit-mount[data-adfit-size="728x90"] {
  width: 728px;
  height: 90px;
}

.adfit-mount[data-adfit-size="320x100"] {
  width: 320px;
  height: 100px;
}

.adfit-mount[data-adfit-size="320x50"] {
  width: 320px;
  height: 50px;
}

.adfit-mount[data-adfit-size="300x250"] {
  width: 300px;
  height: 250px;
}

.adfit-mobile {
  display: none;
}

.ad-slot-top,
.ad-slot-bottom {
  min-height: 112px;
  margin-bottom: 18px;
}

.ad-slot-bottom {
  margin-top: 22px;
  margin-bottom: 0;
}

.ad-slot-feed {
  grid-column: span 2;
  min-height: 274px;
}

.prompt-card {
  display: grid;
  min-height: 420px;
  overflow: hidden;
  grid-template-rows: auto 1fr auto;
  background: rgba(21, 20, 18, .9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card-open {
  display: grid;
  grid-template-rows: auto 1fr;
  width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
}

.card-open:hover h2 {
  color: #c8fff0;
}

.prompt-card[hidden] {
  display: none;
}

.thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 172px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(115, 242, 196, .22), transparent 55%),
    linear-gradient(180deg, #152a31, #0a161a);
  border-bottom: 1px solid var(--line-soft);
}

.thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb img:not([hidden]) + span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: auto;
  height: auto;
  min-width: 38px;
  padding: 7px 9px;
  color: #04110d;
  background: rgba(115, 242, 196, .94);
  border-color: rgba(255, 255, 255, .32);
  border-radius: 999px;
  font-size: 11px;
}

.thumb span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  color: var(--accent);
  background: rgba(0, 0, 0, .2);
  border: 1px solid rgba(115, 242, 196, .28);
  border-radius: 50%;
  font-weight: 900;
}

.card-body {
  display: grid;
  gap: 9px;
  padding: 15px;
}

.category {
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
}

.prompt-card h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.prompt-card p {
  min-height: 42px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.prompt-card textarea {
  width: 100%;
  min-height: 108px;
  resize: none;
  padding: 10px;
  color: #e9e3d6;
  background: #050b0d;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  outline: none;
}

.card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px 15px;
}

.copy-button,
.favorite-button,
.detail-link {
  min-height: 36px;
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.copy-button {
  flex: 1;
  font-weight: 800;
}

.detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.detail-link:hover {
  color: var(--text);
  border-color: rgba(115, 242, 196, .42);
}

.favorite-button {
  width: 38px;
  color: var(--accent);
  font-size: 18px;
}

.favorite-button.is-active {
  color: #04110d;
  background: var(--accent);
  border-color: var(--accent);
}

.empty-state {
  display: grid;
  gap: 6px;
  justify-items: center;
  margin-top: 18px;
  padding: 36px 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, .035);
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state strong {
  color: var(--text);
  font-size: 16px;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding-top: 22px;
}

.load-more {
  min-width: 132px;
  min-height: 40px;
  color: #04110d;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  font-weight: 850;
}

.load-more:disabled {
  cursor: wait;
  opacity: .65;
}

.catalog-shell.is-loading .prompt-grid:empty::before {
  grid-column: 1 / -1;
  padding: 34px;
  color: var(--muted);
  content: "프롬프트를 불러오는 중입니다.";
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  text-align: center;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(10px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1120px, 100%);
  height: min(820px, calc(100vh - 44px));
  max-height: min(820px, calc(100vh - 44px));
  grid-template-columns: minmax(300px, .9fr) minmax(0, 1.1fr);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .58);
}

.modal-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 520px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(115, 242, 196, .2), transparent 55%),
    linear-gradient(180deg, #14252c, #050b0d);
}

.modal-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.modal-media span {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 92px;
  color: var(--accent);
  background: rgba(0, 0, 0, .28);
  border: 1px solid rgba(115, 242, 196, .28);
  border-radius: 50%;
  font-size: 18px;
  font-weight: 900;
}

.modal-media img + span {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: auto;
  height: auto;
  min-width: 42px;
  padding: 8px 10px;
  color: #04110d;
  background: rgba(115, 242, 196, .94);
  border-radius: 999px;
  font-size: 12px;
}

.modal-content {
  display: grid;
  height: 100%;
  grid-template-rows: auto auto minmax(120px, 1fr) auto auto;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
  padding: 22px;
}

.modal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.modal-head h2 {
  margin: 5px 0 8px;
  font-size: 25px;
  line-height: 1.25;
}

.modal-head p {
  margin: 0;
  color: var(--muted);
}

.source-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.source-line a {
  color: var(--accent);
  font-weight: 800;
}

.source-line[hidden] {
  display: none;
}

.modal-close {
  width: 36px;
  height: 36px;
  color: var(--muted);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 24px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
  border-color: rgba(115, 242, 196, .44);
}

.modal-args {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: min(260px, 30vh);
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.arg-field {
  display: grid;
  gap: 5px;
}

.arg-field span,
.prompt-editor span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.arg-field input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--text);
  background: rgba(255, 255, 255, .055);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.arg-field input:focus {
  border-color: rgba(115, 242, 196, .7);
  box-shadow: 0 0 0 3px rgba(115, 242, 196, .12);
}

.prompt-editor {
  display: grid;
  min-height: 0;
  gap: 7px;
}

.prompt-editor textarea {
  width: 100%;
  min-height: 0;
  height: 100%;
  resize: vertical;
  padding: 12px;
  color: #e9e3d6;
  background: #050b0d;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  outline: none;
  line-height: 1.55;
}

.modal-related {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.modal-related[hidden] {
  display: none;
}

.modal-related-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

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

.related-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  min-height: 62px;
  padding: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  text-align: left;
}

.related-card:hover {
  border-color: rgba(115, 242, 196, .38);
}

.related-thumb {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  overflow: hidden;
  color: var(--accent);
  background: #050b0d;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-name {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0;
  background: var(--panel);
  border-top: 0;
}

.modal-actions button,
.modal-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.modal-actions button:disabled {
  cursor: default;
  opacity: .42;
}

.modal-actions #modal-copy,
.modal-actions .chatgpt-link {
  color: #04110d;
  background: var(--accent);
  border-color: var(--accent);
}

.modal-actions .share-button {
  color: #d8fff8;
  border-color: rgba(141, 167, 255, .4);
}

.start-main {
  min-height: calc(100vh - 65px);
  display: grid;
  align-content: center;
  gap: 34px;
}

.start-hero {
  max-width: 760px;
}

.start-hero h1 {
  margin-bottom: 16px;
}

.start-hero p:not(.eyebrow) {
  max-width: 620px;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 16px;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.feature-list article {
  display: grid;
  gap: 6px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.feature-list strong {
  color: var(--text);
  font-size: 16px;
}

.feature-list span {
  color: var(--muted);
}

@media (max-width: 980px) {
  .prompt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ad-slot-feed {
    grid-column: 1 / -1;
  }

  .modal-panel {
    grid-template-columns: 1fr;
  }

  .modal-media {
    min-height: 260px;
  }
}

@media (max-width: 680px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .header-search {
    grid-column: 1 / -1;
  }

  .status-strip,
  .feature-list,
  .toolbar-row,
  .maker-grid,
  .maker-row {
    grid-template-columns: 1fr;
  }

  .status-strip {
    display: grid;
  }

  .prompt-grid {
    grid-template-columns: 1fr;
  }

  .ad-slot-top,
  .ad-slot-bottom {
    min-height: 122px;
  }

  .ad-slot-bottom {
    min-height: 72px;
  }

  .adfit-desktop {
    display: none;
  }

  .adfit-mobile {
    display: grid;
  }

  .ad-slot-feed {
    min-height: 274px;
  }

  .modal {
    padding: 10px;
    align-items: start;
    overflow-y: auto;
  }

  .modal-panel {
    display: block;
    height: auto;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-content {
    max-height: none;
    overflow: visible;
    padding: 16px;
  }

  .prompt-editor textarea {
    min-height: 250px;
    height: auto;
  }

  .modal-related-list {
    grid-template-columns: 1fr;
  }

  .modal-media {
    min-height: 0;
    height: min(260px, 42vh);
    height: min(260px, 42dvh);
  }

  .modal-args {
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .modal-actions button,
  .modal-actions a {
    flex: 1 1 calc(50% - 8px);
  }

  .modal-actions {
    position: relative;
    bottom: auto;
    margin: 0;
    padding: 2px 0 0;
    border-top: 0;
  }
}
