:root {
  --bg:#0B1012;
  --panel:#121A1C;
  --panel2:#182224;
  --line:#273638;
  --line2:#3A4B4C;
  --text:#DCE5E3;
  --muted:#A8B3B1;
  --dim:#75817F;
  --accent:#35C6C3;
  --accent2:#70DCD5;
  --success:#83d6a2;
  --danger:#ff9696;
  --radius:18px;
}

* {
  box-sizing:border-box;
  margin:0;
  padding:0;
}

html {
  scroll-behavior:smooth;
}

body {
  min-height:100vh;
  background:var(--bg);
  color:var(--text);
  font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  overflow-x:hidden;
}

a {
  color:inherit;
  text-decoration:none;
}

button {
  font:inherit;
}

.bg-light {
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  background:
    radial-gradient(circle at 50% -10%,rgba(97,218,213,.14),transparent 34%),
    radial-gradient(circle at 0% 58%,rgba(76,103,102,.10),transparent 28%),
    radial-gradient(circle at 100% 70%,rgba(65,130,127,.10),transparent 28%);
}

.header {
  position:sticky;
  top:0;
  z-index:30;
  min-height:68px;
  padding:13px 32px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  background:rgba(9,10,10,.82);
  border-bottom:1px solid rgba(255,255,255,.06);
  backdrop-filter:blur(18px);
}

.logo {
  display:flex;
  align-items:center;
  gap:10px;
  font-size:19px;
  font-weight:800;
}

.brand-logo {
  height: 34px;
  width: auto;
  display: block;
}

.header-actions {
  display:flex;
  gap:9px;
}

.primary-btn,
.ghost-btn,
.copy-btn,
.ai-btn {
  min-height:40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  padding:9px 14px;
  font-weight:700;
  cursor:pointer;
  transition:.2s;
}

.primary-btn {
  color:#0D0F0F;
  background:#F5F7F6;
  border:1px solid #fff;
}

.primary-btn:hover {
  transform:translateY(-1px);
  filter:brightness(.95);
}

.ghost-btn,
.ai-btn {
  color:#D5DBDB;
  background:#171A1A;
  border:1px solid #2F3635;
}

.ghost-btn:hover,
.ai-btn:hover {
  border-color:#505C5C;
  color:#fff;
  background:#1C2121;
}

.page-shell {
  position:relative;
  z-index:1;
  width:min(1180px,calc(100% - 48px));
  min-height:calc(100vh - 180px);
  margin:0 auto;
  padding:42px 0 76px;
}

.breadcrumbs {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:9px;
  color:#768C8B;
  font-size:12px;
  margin-bottom:28px;
}

.breadcrumbs a:hover {
  color:#DCE5E3;
}

.section-kicker {
  text-transform:uppercase;
  letter-spacing:.12em;
  font-size:11px;
  font-weight:800;
  color:#73B4B1;
}

.prompt-hero {
  padding:34px 34px 32px;
  border:1px solid #303A39;
  border-radius:22px;
  background:linear-gradient(120deg,rgba(37,48,47,.92),rgba(17,20,20,.96));
  box-shadow:0 24px 70px rgba(0,0,0,.22);
}

.prompt-hero h1 {
  max-width:900px;
  margin:8px 0 12px;
  font-size:clamp(34px,5vw,58px);
  line-height:1.04;
  letter-spacing:-.045em;
}

.prompt-hero p {
  max-width:820px;
  color:#A8B3B1;
  font-size:16px;
  line-height:1.7;
}

.hero-meta {
  margin-top:19px;
  display:flex;
  align-items:center;
  gap:10px;
  color:#798E8D;
  font-size:12px;
}

.meta-dot {
  width:4px;
  height:4px;
  background:#5B6C6C;
  border-radius:50%;
}

.rating {
  position:relative;
  z-index:20;
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:5px 9px;
  border-radius:999px;
  border:1px solid #353C3C;
  background:#1B1E1E;
  color:#C6CFCE;
  font-size:11px;
  cursor:help;
  outline:none;
}

.rating::before {
  content:"";
  position:absolute;
  top:calc(100% + 6px);
  left:15px;
  width:9px;
  height:9px;
  z-index:101;
  border-top:1px solid #647776;
  border-left:1px solid #647776;
  background:#0D1111;
  opacity:0;
  pointer-events:none;
  transform:rotate(45deg);
  transition:opacity .16s ease;
}

.rating::after {
  content:attr(data-rating-info);
  position:absolute;
  top:calc(100% + 10px);
  left:0;
  width:max-content;
  max-width:min(270px,78vw);
  padding:10px 12px;
  z-index:100;
  border:1px solid #647776;
  border-radius:11px;
  background:#0D1111;
  color:#DCE5E3;
  box-shadow:0 18px 45px rgba(0,0,0,.72),0 0 0 1px rgba(255,255,255,.025),0 0 28px rgba(85,215,210,.17);
  font-size:11px;
  font-weight:600;
  line-height:1.5;
  white-space:normal;
  opacity:0;
  pointer-events:none;
  transform:translateY(-5px) scale(.97);
  transform-origin:top left;
  transition:opacity .16s ease,transform .16s ease;
}

.rating:hover::before,
.rating:hover::after,
.rating:focus-visible::before,
.rating:focus-visible::after {
  opacity:1;
}

.rating:hover::after,
.rating:focus-visible::after {
  transform:translateY(0) scale(1);
}

.rating:focus-visible {
  box-shadow:0 0 0 3px rgba(106,220,215,.2);
}

.rating.hot {
  color:#ffd698;
  border-color:#59462d;
  background:#211b13;
}

.rating.needs-fix {
  color:#ffb2b8;
  border-color:rgba(255,91,105,.48);
  background:rgba(104,24,34,.28);
}

.rating.untested {
  color:#7C9190;
}

.tags {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:17px;
}

.tag {
  font-size:10px;
  color:#A6B4B3;
  background:#1B1E1E;
  border:1px solid #2D3333;
  padding:5px 9px;
  border-radius:999px;
}

.prompt-layout {
  display:grid;
  grid-template-columns:minmax(0,1fr) 300px;
  gap:18px;
  margin-top:22px;
}

.left-column {
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:18px;
}

.result-card,
.prompt-box,
.side-card {
  border:1px solid #282E2E;
  border-radius:18px;
  background:#121A1C;
}

.result-card,
.prompt-box {
  padding:20px;
}

.card-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}

.card-heading h2 {
  margin-top:5px;
  font-size:19px;
}

.result-frame {
  min-height:370px;
  border:1px solid #2D3333;
  border-radius:14px;
  background:#0C0F0F;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}

.result-frame img {
  width:100%;
  max-height:680px;
  object-fit:contain;
  display:block;
}

.image-placeholder {
  min-height:370px;
  padding:30px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:9px;
  text-align:center;
  color:#7A8F8E;
}

.image-placeholder > span {
  font-size:35px;
  color:#35C6C3;
}

.image-placeholder p {
  max-width:420px;
  font-size:12px;
  line-height:1.55;
}

.copy-btn {
  color:#0D0F0F;
  background:#F5F7F6;
  border:1px solid #fff;
}

.copy-btn:hover {
  transform:translateY(-1px);
}

.prompt-text {
  width:100%;
  max-height:620px;
  overflow:auto;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  user-select:text;
  padding:20px;
  border:1px solid #2D3333;
  border-radius:14px;
  background:#0C0F0F;
  color:#DCE5E3;
  font:12px/1.7 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}

.use-actions {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}

.ai-btn {
  min-height:38px;
  font-size:12px;
}

.recommended-ai {
  gap:9px;
  border-color:rgba(113,222,217,.42);
  background:linear-gradient(135deg,rgba(72,212,206,.16),rgba(19,22,22,.95));
}

.platform-badge {
  padding:3px 6px;
  border:1px solid rgba(128,225,221,.24);
  border-radius:999px;
  background:rgba(93,217,212,.14);
  color:#DCE5E3;
  font-size:8px;
  font-weight:800;
  letter-spacing:.07em;
  line-height:1;
  text-transform:uppercase;
}

.free-badge {
  border-color:rgba(104,211,151,.22);
  background:rgba(58,164,108,.12);
  color:#a8e7c4;
}

.sidebar {
  display:flex;
  flex-direction:column;
  gap:18px;
}

.side-card {
  padding:20px;
}

.side-card h2 {
  margin:7px 0 9px;
  font-size:19px;
}

.side-card > p {
  color:#8C9E9E;
  font-size:12px;
  line-height:1.6;
}

.side-link {
  display:inline-block;
  margin-top:15px;
  color:#7AB9B6;
  font-size:12px;
  font-weight:700;
}

.steps {
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:14px;
  margin-top:15px;
}

.steps li {
  display:flex;
  gap:11px;
  align-items:flex-start;
}

.steps span {
  width:25px;
  height:25px;
  flex:0 0 25px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:8px;
  background:#1D2525;
  border:1px solid #405251;
  color:#82E2DE;
  font-size:10px;
  font-weight:800;
}

.steps p {
  color:#8C9E9E;
  font-size:12px;
  line-height:1.5;
  padding-top:3px;
}

.related-section {
  margin-top:54px;
}

.section-heading {
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:18px;
  margin-bottom:20px;
}

.section-heading h2 {
  margin-top:5px;
  font-size:25px;
}

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

.related-card {
  min-height:190px;
  padding:18px;
  display:flex;
  flex-direction:column;
  border:1px solid #282E2E;
  border-radius:16px;
  background:#121A1C;
  transition:.2s;
}

.related-card:hover {
  transform:translateY(-2px);
  border-color:#4A5555;
}

.related-card h3 {
  font-size:16px;
  margin-bottom:8px;
}

.related-card p {
  color:#8C9E9E;
  font-size:12px;
  line-height:1.55;
  flex:1;
}

.related-card span {
  margin-top:16px;
  color:#7AB9B6;
  font-size:12px;
  font-weight:700;
}

.loading-card {
  grid-column:1/-1;
  min-height:170px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:14px;
  color:#839695;
  border:1px dashed #2E3535;
  border-radius:17px;
  background:rgba(19,22,22,.55);
}

.loader {
  width:26px;
  height:26px;
  border-radius:50%;
  border:2px solid #353D3D;
  border-top-color:#73DEDA;
  animation:spin .8s linear infinite;
}

@keyframes spin {
  to { transform:rotate(360deg); }
}

.empty-state {
  text-align:center;
  max-width:620px;
  margin:80px auto;
  padding:40px 28px;
  border:1px solid #2B3231;
  border-radius:20px;
  background:#121A1C;
}

.empty-icon {
  width:50px;
  height:50px;
  border-radius:15px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin:0 auto 18px;
  background:#21191c;
  border:1px solid #4a343b;
  color:var(--danger);
  font-size:23px;
  font-weight:800;
}

.empty-state h2 {
  font-size:26px;
  margin-bottom:10px;
}

.empty-state p {
  color:#8C9E9E;
  line-height:1.6;
  margin-bottom:22px;
}

.toast {
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:80;
  display:flex;
  align-items:center;
  gap:8px;
  padding:11px 14px;
  border-radius:11px;
  border:1px solid #31413a;
  background:#121914;
  color:#bce2c7;
  font-size:12px;
  opacity:0;
  transform:translateY(10px);
  pointer-events:none;
  transition:.2s;
}

.toast.show {
  opacity:1;
  transform:none;
}

.footer {
  position:relative;
  z-index:1;
  border-top:1px solid #202525;
  background:#060606;
  padding:34px max(24px,calc((100vw - 1180px)/2));
}

.footer-brand {
  display:flex;
  align-items:center;
  gap:12px;
}

.footer-brand strong {
  display:block;
}

.footer-brand p,
.footer-text {
  color:#6D8180;
  font-size:12px;
}

.footer-links {
  display:flex;
  flex-wrap:wrap;
  gap:9px;
  margin:22px 0;
  color:#8C9E9E;
  font-size:12px;
}

.footer-links a:hover {
  color:#fff;
}

@media (max-width:920px) {
  .prompt-layout {
    grid-template-columns:1fr;
  }

  .sidebar {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

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

@media (max-width:680px) {
  .header {
    padding:12px 16px;
  }

  .header-actions .ghost-btn {
    display:none;
  }

  .page-shell {
    width:min(100% - 28px,1180px);
    padding-top:28px;
  }

  .prompt-hero {
    padding:24px;
  }

  .prompt-hero h1 {
    font-size:clamp(31px,10vw,44px);
  }

  .result-card,
  .prompt-box,
  .side-card {
    padding:16px;
  }

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

  .copy-btn {
    width:100%;
  }

  .result-frame,
  .image-placeholder {
    min-height:260px;
  }

  .sidebar {
    grid-template-columns:1fr;
  }

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

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

  .section-heading .ghost-btn {
    width:100%;
  }

  .use-actions {
    display:grid;
    grid-template-columns:1fr;
  }

  .footer {
    padding:30px 18px;
  }
}

.empty-actions {
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:9px;
}

.empty-actions [hidden] {
  display:none;
}

/* ===== V1.1 CALM RESPONSIVE REFINEMENT ===== */
:root {
  --bg:#0B1012;
  --panel:#121A1C;
  --panel-soft:#182224;
  --line:#273638;
  --line-strong:#3A4B4C;
  --text:#DCE5E3;
  --muted:#A8B3B1;
  --accent:#35C6C3;
}

body {
  padding-bottom:0;
  background:
    radial-gradient(circle at 50% -12%,rgba(92,177,174,.11),transparent 34rem),
    #0A0C0C;
  -webkit-font-smoothing:antialiased;
}

.bg-light {
  opacity:.72;
  background:
    radial-gradient(circle at 16% 24%,rgba(83,154,151,.07),transparent 28rem),
    radial-gradient(circle at 84% 62%,rgba(76,142,139,.065),transparent 30rem);
}

.header {
  min-height:72px;
  background:rgba(10,12,12,.78);
  border-color:rgba(255,255,255,.055);
  box-shadow:0 8px 32px rgba(0,0,0,.12);
}

.logo { letter-spacing:-.025em; }
.brand-logo { width:36px; height:36px; object-fit:contain; }
.short-label { display:none; }

.page-shell {
  width:min(1160px,calc(100% - 48px));
  padding-top:34px;
}

.breadcrumbs {
  min-width:0;
  flex-wrap:nowrap;
  margin-bottom:22px;
  white-space:nowrap;
  overflow:hidden;
}

.breadcrumbs > * { flex:0 0 auto; }
.breadcrumbs > *:last-child {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}

.prompt-hero {
  padding:35px;
  border-color:var(--line-strong);
  border-radius:24px;
  background:linear-gradient(135deg,rgba(31,39,38,.96),rgba(17,20,20,.98));
  box-shadow:0 22px 64px rgba(0,0,0,.22),inset 0 1px rgba(255,255,255,.025);
}

.prompt-hero h1 {
  max-width:960px;
  overflow-wrap:anywhere;
  text-wrap:balance;
}

.prompt-hero p {
  max-width:76ch;
  text-wrap:pretty;
}

.tags {
  max-height:34px;
  overflow:hidden;
}

.tag {
  max-width:170px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.prompt-layout { gap:20px; }

.result-card,
.prompt-box,
.side-card,
.related-card {
  border-color:var(--line);
  background:linear-gradient(155deg,rgba(22,26,26,.98),rgba(17,20,20,.98));
  box-shadow:0 12px 34px rgba(0,0,0,.11);
}

.result-card,
.prompt-box { padding:22px; }

.result-frame {
  min-height:360px;
  background:#0D0F0F;
  border-color:rgba(255,255,255,.07);
}

.result-frame img {
  max-height:min(680px,72vh);
}

.prompt-text-wrap {
  position:relative;
  overflow:hidden;
  border-radius:14px;
}

.prompt-personalizer {
  position:relative;
  margin:2px 0 16px;
  padding:18px;
  overflow:hidden;
  border:1px solid rgba(106,190,187,.22);
  border-radius:16px;
  background:radial-gradient(circle at 0 0,rgba(74,184,179,.12),transparent 38%),linear-gradient(145deg,rgba(22,28,27,.97),rgba(15,19,19,.98));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}
.prompt-personalizer[hidden]{display:none}
.personalizer-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.prompt-personalizer h3{margin:5px 0 0;font-size:18px;letter-spacing:-.025em}
.personalizer-copy{max-width:650px;margin:9px 0 15px;color:#A8B3B1;font-size:13px;line-height:1.55}
.personalizer-fields{display:grid;gap:11px}
.personalizer-field{display:grid;gap:10px;min-width:0;padding:14px;border:1px solid rgba(255,255,255,.07);border-radius:14px;background:rgba(10,12,12,.55);transition:border-color .2s ease,box-shadow .2s ease}
.personalizer-field.is-complete{border-color:rgba(83,211,158,.22)}
.personalizer-field.needs-attention{border-color:rgba(255,105,120,.48);box-shadow:0 0 0 3px rgba(255,90,110,.07)}
.personalizer-field-heading{display:flex;align-items:center;justify-content:space-between;gap:14px}
.personalizer-field-heading>div{display:flex;align-items:center;min-width:0;gap:9px}
.personalizer-number{flex:0 0 25px;width:25px;height:25px;display:grid;place-items:center;border:1px solid rgba(116,206,202,.26);border-radius:8px;background:rgba(89,165,161,.1);color:#DCE5E3;font-size:10px;font-weight:900}
.personalizer-label{overflow:hidden;color:#DCE5E3;font-size:13px;font-weight:800;text-overflow:ellipsis;white-space:nowrap}
.personalizer-description{margin:0;color:#8EA09F;font-size:11px;line-height:1.55}
.personalizer-input{width:100%;height:44px;padding:0 13px;border:1px solid rgba(255,255,255,.1);border-radius:11px;outline:0;background:#0D1010;color:#DCE5E3;font-size:13px;transition:border-color .18s ease,box-shadow .18s ease}
.personalizer-input::placeholder{color:#677A7A}
.personalizer-input:focus{border-color:rgba(117,209,206,.48);box-shadow:0 0 0 3px rgba(98,195,191,.08)}
.suggestions-refresh{flex:0 0 auto;padding:6px 8px;border:0;background:transparent;color:#7DCFCC;font-size:10px;font-weight:800;cursor:pointer}
.suggestions-refresh:hover{color:#fff}
.personalizer-suggestions{display:flex;flex-wrap:wrap;gap:7px}
.personalizer-suggestion{max-width:100%;min-height:31px;padding:6px 10px;overflow:hidden;border:1px solid rgba(118,188,185,.16);border-radius:999px;background:rgba(89,166,162,.07);color:#86C0BE;font-size:10px;font-weight:700;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease}
.personalizer-suggestion:hover{border-color:rgba(121,213,209,.38);background:rgba(99,175,172,.14);color:#DCE5E3;transform:translateY(-1px)}

.color-customizer {
  position:relative;
  margin:2px 0 16px;
  padding:18px;
  overflow:hidden;
  border:1px solid rgba(106,220,215,.24);
  border-radius:16px;
  background:radial-gradient(circle at 100% 0,rgba(77,213,208,.15),transparent 42%),linear-gradient(145deg,rgba(26,33,33,.96),rgba(17,21,21,.98));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}

.color-customizer[hidden] { display:none; }

.color-customizer-heading {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}

.color-customizer h3 {
  margin:5px 0 0;
  font-size:18px;
  letter-spacing:-.025em;
}

.color-customizer-copy {
  max-width:620px;
  margin:9px 0 15px;
  color:#A8B3B1;
  font-size:13px;
  line-height:1.55;
}

.live-prompt-badge {
  display:inline-flex;
  align-items:center;
  flex:0 0 auto;
  gap:7px;
  padding:7px 9px;
  border:1px solid rgba(110,231,183,.18);
  border-radius:999px;
  background:rgba(52,211,153,.065);
  color:#a7e7cd;
  font-size:10px;
  font-weight:800;
  letter-spacing:.035em;
  text-transform:uppercase;
}

.live-prompt-badge > span {
  width:6px;
  height:6px;
  border-radius:50%;
  background:#54dba5;
  box-shadow:0 0 0 4px rgba(84,219,165,.1),0 0 14px rgba(84,219,165,.65);
}

.color-controls { display:grid; gap:11px; }

.color-field {
  display:grid;
  grid-template-columns:minmax(220px,.72fr) minmax(280px,1.28fr);
  grid-template-areas:"label quick-label" "control palette";
  align-items:center;
  column-gap:22px;
  row-gap:8px;
  min-width:0;
  padding:13px;
  border:1px solid rgba(255,255,255,.065);
  border-radius:13px;
  background:rgba(10,12,12,.5);
}

.color-field-label { grid-area:label; display:block; color:#DCE5E3; font-size:11px; font-weight:800; }
.color-input-group { grid-area:control; display:flex; align-items:center; min-width:0; gap:9px; }

.color-picker-shell {
  --selected-color:#35C6C3;
  position:relative;
  flex:0 0 42px;
  width:42px;
  height:42px;
  border:1px solid rgba(255,255,255,.16);
  border-radius:11px;
  background:var(--selected-color);
  box-shadow:0 0 22px color-mix(in srgb,var(--selected-color) 28%,transparent);
  cursor:pointer;
}

.color-picker { position:absolute; inset:0; width:100%; height:100%; border:0; opacity:0; cursor:pointer; }

.hex-input-shell {
  display:flex;
  align-items:center;
  flex:0 1 132px;
  min-width:0;
  height:42px;
  padding:0 11px;
  border:1px solid rgba(255,255,255,.09);
  border-radius:11px;
  background:#0E1111;
  color:#7C9190;
  transition:border-color .18s ease,box-shadow .18s ease;
}

.hex-input-shell:focus-within { border-color:rgba(120,206,202,.5); box-shadow:0 0 0 3px rgba(110,190,187,.08); }
.hex-input-shell.is-invalid { border-color:rgba(255,101,115,.55); }

.hex-input {
  width:100%;
  min-width:0;
  padding:0 0 0 2px;
  border:0;
  outline:0;
  background:transparent;
  color:#DCE5E3;
  font:750 13px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  letter-spacing:.035em;
  text-transform:uppercase;
}

.color-placeholder-name { min-width:0; overflow:hidden; color:#718685; font-size:10px; text-overflow:ellipsis; white-space:nowrap; }

.quick-color-label {
  grid-area:quick-label;
  color:#A9B6B6;
  font-size:10px;
  font-weight:800;
  letter-spacing:.07em;
  text-transform:uppercase;
}

.quick-color-palette {
  grid-area:palette;
  display:grid;
  grid-template-columns:repeat(12,minmax(24px,1fr));
  gap:7px;
}

.quick-color-swatch {
  --swatch-color:#35C6C3;
  position:relative;
  aspect-ratio:1;
  min-width:0;
  max-width:34px;
  padding:0;
  border:2px solid rgba(255,255,255,.12);
  border-radius:9px;
  background:var(--swatch-color);
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);
  cursor:pointer;
  transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease;
}

.quick-color-swatch:hover {
  z-index:2;
  transform:translateY(-3px) scale(1.08);
  border-color:rgba(255,255,255,.72);
  box-shadow:0 8px 18px rgba(0,0,0,.36),0 0 16px color-mix(in srgb,var(--swatch-color) 42%,transparent);
}

.quick-color-swatch.is-selected {
  border-color:#fff;
  box-shadow:0 0 0 3px rgba(113,222,217,.25),0 7px 18px rgba(0,0,0,.4);
  transform:translateY(-2px);
}

.quick-color-swatch.is-selected::after {
  content:'✓';
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  color:#fff;
  font-size:11px;
  font-weight:900;
  text-shadow:0 1px 4px #000,0 0 3px #000;
}

@media (max-width:560px) {
  .prompt-personalizer{padding:14px}
  .personalizer-heading{align-items:center}
  .personalizer-field{padding:12px}
  .personalizer-field-heading{align-items:flex-start}
  .personalizer-suggestions{display:grid;grid-template-columns:1fr}
  .personalizer-suggestion{width:100%;text-align:left}
  .color-customizer { padding:14px; }
  .color-customizer-heading { align-items:center; }
  .live-prompt-badge { padding:6px 8px; font-size:9px; }
  .color-placeholder-name { display:none; }
  .hex-input-shell { flex:1 1 auto; }
}

@media (max-width:760px) {
  .color-field {
    grid-template-columns:1fr;
    grid-template-areas:"label" "control" "quick-label" "palette";
    gap:9px;
  }
  .quick-color-label { margin-top:5px; }
  .quick-color-palette { grid-template-columns:repeat(6,minmax(28px,1fr)); }
  .quick-color-swatch { width:100%; max-width:38px; }
}

.prompt-text-wrap.is-collapsed { max-height:330px; }

.prompt-text-wrap.is-collapsed::after {
  content:'';
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:92px;
  pointer-events:none;
  background:linear-gradient(transparent,#0C0F0F 82%);
}

.prompt-text {
  max-height:none;
  overflow:visible;
  padding:21px;
  line-height:1.75;
  border-color:rgba(255,255,255,.075);
}

.prompt-toggle {
  width:100%;
  min-height:42px;
  margin-top:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#171A1A;
  color:#C5CECE;
  font:700 12px/1 Inter,ui-sans-serif,sans-serif;
  cursor:pointer;
}

.prompt-toggle[hidden] { display:none; }
.prompt-toggle:hover { color:#fff; border-color:var(--line-strong); }

.ai-btn { flex:1 1 150px; }

.side-card { overflow:hidden; }
.side-card h2,
.side-card p,
.side-link { overflow-wrap:anywhere; }

.tutorial-link {
  display:flex;
  margin-top:20px;
  padding-top:16px;
  border-top:1px solid var(--line);
}

.related-card:hover,
.related-card:focus-visible {
  transform:translateY(-3px);
  border-color:rgba(120,206,202,.3);
  box-shadow:0 18px 42px rgba(0,0,0,.2);
  outline:none;
}

.related-card h3 {
  display:-webkit-box;
  overflow:hidden;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  text-wrap:balance;
}

.related-card p {
  display:-webkit-box;
  overflow:hidden;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  overflow-wrap:anywhere;
}

.mobile-action-bar { display:none; }

.mobile-action-bar.is-past-prompt {
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translateY(18px) scale(.98);
}

@media (max-width:920px) {
  .sidebar { align-items:stretch; }
  .side-card { min-width:0; }
}

@media (max-width:680px) {
  body { padding-bottom:0; }

  .header {
    min-height:62px;
    padding:10px 14px;
  }

  .logo { font-size:17px; }
  .brand-logo { width:32px; height:32px; }
  .header-actions { min-width:0; gap:7px; }
  .header-actions .ghost-btn {
    display:inline-flex;
    max-width:112px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    min-height:38px;
    padding:8px 10px;
    font-size:11px;
  }
  .header-actions .primary-btn { min-height:38px; padding:8px 11px; font-size:12px; }
  .wide-label { display:none; }
  .short-label { display:inline; }

  .page-shell {
    width:min(100% - 24px,1160px);
    padding:22px 0 48px;
  }

  .breadcrumbs { margin-bottom:16px; }

  .prompt-hero {
    padding:20px;
    border-radius:20px;
  }

  .prompt-hero h1 {
    margin:7px 0 9px;
    font-size:clamp(28px,9vw,40px);
    line-height:1.08;
    letter-spacing:-.035em;
    display:-webkit-box;
    overflow:hidden;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:3;
  }

  .prompt-hero p {
    font-size:13px;
    line-height:1.6;
    display:-webkit-box;
    overflow:hidden;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:4;
  }

  .hero-meta {
    min-width:0;
    overflow:hidden;
    white-space:nowrap;
  }

  #categoryName {
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .tags .tag:nth-child(n+5) { display:none; }

  .prompt-layout { margin-top:14px; gap:12px; }
  .left-column { gap:12px; }

  .result-card,
  .prompt-box,
  .side-card { padding:15px; border-radius:16px; }

  .card-heading {
    margin-bottom:13px;
    flex-direction:row;
    align-items:center;
  }

  .copy-btn { width:auto; min-height:38px; padding:8px 12px; font-size:12px; }

  .result-frame,
  .image-placeholder { min-height:220px; }

  .result-frame img { max-height:72vh; }

  .prompt-text-wrap.is-collapsed { max-height:260px; }
  .prompt-text { padding:16px; font-size:11.5px; line-height:1.7; }

  .use-actions {
    display:flex;
    flex-wrap:nowrap;
    gap:7px;
    overflow-x:auto;
    padding-bottom:3px;
    scrollbar-width:none;
  }

  .use-actions::-webkit-scrollbar { display:none; }
  .ai-btn { flex:0 0 auto; min-height:38px; padding:8px 11px; white-space:nowrap; }

  .sidebar { gap:12px; }
  .steps { gap:11px; }

  .related-section { margin-top:38px; }
  .related-grid { gap:11px; }
  .related-card { min-height:165px; padding:16px; }
  .related-card p { -webkit-line-clamp:2; }

  .mobile-action-bar {
    position:fixed;
    z-index:60;
    left:10px;
    right:10px;
    bottom:max(10px,env(safe-area-inset-bottom));
    min-width:0;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
    padding:8px;
    border:1px solid rgba(129,200,197,.18);
    border-radius:15px;
    background:rgba(16,19,19,.9);
    box-shadow:0 16px 45px rgba(0,0,0,.42);
    backdrop-filter:blur(18px);
    transition:opacity .24s ease,transform .24s ease,visibility .24s ease;
  }

  .mobile-action-bar[hidden] { display:none; }

  .mobile-action-bar a {
    min-width:0;
    display:flex;
    align-items:center;
    padding:0 10px;
    color:#A9B7B6;
    font-size:11px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .mobile-action-bar button {
    min-height:42px;
    padding:9px 16px;
    border:1px solid #fff;
    border-radius:11px;
    background:#F5F7F6;
    color:#0D0F0F;
    font-weight:800;
  }

  .toast {
    left:50%;
    right:auto;
    bottom:82px;
    max-width:calc(100% - 28px);
    transform:translate(-50%,10px);
    white-space:nowrap;
  }

  .toast.show { transform:translate(-50%,0); }
}

@media (max-width:380px) {
  .logo span { display:none; }
  .header-actions .ghost-btn { max-width:98px; }
  .prompt-hero h1 { font-size:27px; }
  .card-heading h2 { font-size:17px; }

  body {
    padding-bottom:0;
  }

  .prompt-personalizer {
    padding:11px;
  }

  .personalizer-fields,
  .personalizer-field,
  .personalizer-suggestions {
    width:100%;
    min-width:0;
    max-width:100%;
  }

  .personalizer-field {
    overflow:hidden;
    padding:11px;
  }

  .personalizer-field-heading {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:7px;
  }

  .personalizer-label {
    font-size:12px;
  }

  .suggestions-refresh {
    max-width:88px;
    padding:5px 2px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .personalizer-input,
  .personalizer-suggestion {
    min-width:0;
    max-width:100%;
  }

  .personalizer-suggestion {
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .mobile-action-bar {
    left:7px;
    right:7px;
    gap:6px;
    padding:7px;
  }

  .mobile-action-bar button {
    padding-inline:13px;
  }
}

@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; animation:none!important; transition:none!important; }
}

/* ===== V1.1.1 RESULT STATE + RELATED PROMPT RAIL ===== */
.result-frame img[hidden],
.image-placeholder[hidden] {
  display:none!important;
}

.related-grid {
  display:flex;
  gap:14px;
  overflow-x:auto;
  overflow-y:hidden;
  padding:2px 2px 14px;
  overscroll-behavior-inline:contain;
  scrollbar-width:thin;
  scrollbar-color:rgba(116,195,192,.35) rgba(255,255,255,.045);
  cursor:grab;
  user-select:none;
  touch-action:auto;
}

.related-grid.is-dragging {
  cursor:grabbing;
}

.related-grid.is-dragging .related-card {
  pointer-events:none;
}

.related-grid::-webkit-scrollbar { height:6px; }
.related-grid::-webkit-scrollbar-track {
  background:rgba(255,255,255,.045);
  border-radius:999px;
}
.related-grid::-webkit-scrollbar-thumb {
  background:rgba(116,195,192,.35);
  border-radius:999px;
}

.related-card {
  flex:0 0 calc((100% - 28px)/3);
  min-width:260px;
}

.related-grid .loading-card {
  flex:0 0 100%;
}

@media (max-width:920px) {
  .related-grid {
    display:flex;
    grid-template-columns:none;
  }

  .related-card {
    flex-basis:min(340px,72vw);
  }
}

@media (max-width:680px) {
  .related-grid {
    display:flex;
    grid-template-columns:none;
    gap:11px;
    margin-right:-12px;
    padding-right:12px;
    padding-bottom:12px;
    scroll-padding-inline:0 12px;
  }

  .related-card {
    flex:0 0 min(310px,84vw);
    min-width:0;
  }
}


/* =========================================================
   V1.0.4 — INDEXED PAGE LOADING / RECOVERY STATE
   ========================================================= */
body:not([data-page-state="ready"]) #promptHero,
body:not([data-page-state="ready"]) #promptLayout,
body:not([data-page-state="ready"]) #relatedSection,
body:not([data-page-state="ready"]) #mobileActionBar {
  display:none!important;
}

body[data-page-state="ready"] .page-status {
  display:none;
}

.page-status {
  min-height:430px;
  display:grid;
  place-items:center;
  padding:36px 0 72px;
}

.page-status-card {
  position:relative;
  width:min(100%,590px);
  overflow:hidden;
  padding:42px 34px;
  border:1px solid rgba(125,225,220,.16);
  border-radius:22px;
  background:linear-gradient(145deg,rgba(25,30,30,.8),rgba(14,17,17,.72));
  box-shadow:0 24px 80px rgba(0,0,0,.24);
  text-align:center;
  backdrop-filter:blur(14px);
}

.page-status-card::after {
  position:absolute;
  width:190px;
  height:190px;
  right:-105px;
  bottom:-125px;
  border:1px solid rgba(125,225,220,.1);
  border-radius:50%;
  box-shadow:0 0 0 28px rgba(125,225,220,.018),0 0 0 58px rgba(125,225,220,.01);
  content:"";
  pointer-events:none;
}

.page-status-icon {
  width:56px;
  height:56px;
  margin:0 auto 21px;
  display:grid;
  place-items:center;
  border:1px solid rgba(125,225,220,.18);
  border-radius:17px;
  background:rgba(100,219,214,.08);
  color:#A8E8E3;
}

.page-status-icon span {
  width:22px;
  height:22px;
  border:2px solid rgba(220,229,227,.2);
  border-top-color:#DCE5E3;
  border-radius:50%;
  animation:pageStatusSpin .8s linear infinite;
}

.page-status[data-state="error"] .page-status-icon,
.page-status[data-state="not-found"] .page-status-icon {
  border-color:rgba(255,129,139,.22);
  background:rgba(151,50,61,.11);
  color:#ff9ba4;
  font-size:22px;
  font-weight:900;
}

.page-status[data-state="not-found"] .page-status-icon {
  border-color:rgba(125,225,220,.18);
  background:rgba(100,219,214,.08);
  color:#A8E8E3;
}

.page-status[data-state="error"] .page-status-icon span,
.page-status[data-state="not-found"] .page-status-icon span {
  display:none;
}

.page-status[data-state="error"] .page-status-icon::before { content:"!"; }
.page-status[data-state="not-found"] .page-status-icon::before { content:"?"; }

.page-status h1 {
  margin:9px 0 12px;
  color:var(--text);
  font-size:clamp(28px,5vw,40px);
  line-height:1.08;
  letter-spacing:-.04em;
  text-wrap:balance;
}

.page-status p {
  max-width:450px;
  margin:0 auto;
  color:var(--muted);
  font-size:16px;
  line-height:1.65;
}

.page-status .empty-actions {
  position:relative;
  z-index:1;
  justify-content:center;
  margin-top:24px;
}

.page-status .empty-actions[hidden] {
  display:none;
}

.page-status .primary-btn {
  gap:8px;
}

.page-status .primary-btn > span:last-child {
  display:inline-block;
  transition:transform .2s ease;
}

.page-status .primary-btn:hover > span:last-child {
  transform:rotate(45deg);
}

@keyframes pageStatusSpin {
  to { transform:rotate(360deg); }
}

@media (max-width:600px) {
  .page-status {
    min-height:350px;
    padding:20px 0 52px;
  }

  .page-status-card {
    padding:32px 20px;
    border-radius:18px;
  }

  .page-status h1 { font-size:29px; }
  .page-status p { font-size:15px; }
  .page-status .empty-actions { display:grid; }
  .page-status .empty-actions > * { width:100%; }
}

@media (prefers-reduced-motion:reduce) {
  .page-status-icon span { animation:none; }
}


/* =========================================================
   V1.0.5 — DESKTOP + MOBILE SCROLL CUE
   ========================================================= */
.page-scroll-hint {
  position:fixed;
  z-index:58;
  left:50%;
  bottom:28px;
  isolation:isolate;
  overflow:hidden;
  min-height:52px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:17px;
  padding:10px 21px;
  border:1px solid rgba(134,205,202,.24);
  border-radius:999px;
  background:linear-gradient(120deg,rgba(11,14,14,.92),rgba(29,39,38,.91));
  color:#DCE5E3;
  box-shadow:0 16px 46px rgba(0,0,0,.46),0 0 36px rgba(77,213,208,.16),inset 0 1px rgba(255,255,255,.05);
  font-size:12px;
  font-weight:850;
  letter-spacing:.09em;
  text-transform:uppercase;
  cursor:pointer;
  backdrop-filter:blur(18px);
  transform:translateX(-50%);
  transition:opacity .36s ease,transform .36s cubic-bezier(.2,.8,.2,1),filter .36s ease;
}

.page-scroll-hint::before {
  content:"";
  position:absolute;
  inset:-1px;
  z-index:-1;
  border-radius:inherit;
  background:linear-gradient(105deg,transparent 20%,rgba(106,220,215,.22) 48%,transparent 75%);
  background-size:220% 100%;
  animation:scrollHintShimmer 2.7s linear infinite;
}

.page-scroll-hint:hover {
  border-color:rgba(128,225,221,.42);
  filter:brightness(1.09);
  transform:translateX(-50%) translateY(-3px);
}

.page-scroll-hint[hidden] { display:none; }

.page-scroll-hint.is-leaving {
  opacity:0;
  filter:blur(3px);
  pointer-events:none;
  transform:translateX(-50%) translateY(-30px) scale(.93);
}

.scroll-hint-label {
  position:relative;
  white-space:nowrap;
  text-shadow:0 0 16px rgba(130,226,222,.32);
}

.scroll-hint-arrows {
  position:relative;
  width:22px;
  height:23px;
  flex:0 0 22px;
  filter:drop-shadow(0 0 7px rgba(107,220,216,.75));
}

.scroll-hint-arrows i {
  position:absolute;
  left:6px;
  width:9px;
  height:9px;
  border-right:2px solid #85E2DE;
  border-bottom:2px solid #85E2DE;
  transform:rotate(45deg);
  animation:scrollHintArrow 1.4s ease-in-out infinite;
}

.scroll-hint-arrows i:first-child { top:0; }
.scroll-hint-arrows i:last-child { top:8px; animation-delay:.17s; }

@keyframes scrollHintArrow {
  0%,100% { opacity:.24; transform:translateY(-2px) rotate(45deg) scale(.82); }
  48% { opacity:1; transform:translateY(4px) rotate(45deg) scale(1); }
}

@keyframes scrollHintShimmer {
  from { background-position:180% 0; }
  to { background-position:-80% 0; }
}

@media (max-width:680px) {
  .page-scroll-hint {
    bottom:88px;
    width:min(294px,calc(100vw - 32px));
    gap:14px;
    padding:10px 16px;
    font-size:11px;
  }
}

@media (prefers-reduced-motion:reduce) {
  .page-scroll-hint::before,
  .scroll-hint-arrows i { animation:none; }

  .page-scroll-hint { transition:opacity .15s ease; }
}

/* Editable choices: inline, static highlights with safe mobile wrapping. */
.prompt-text .prompt-choice-highlight {
  color: #DCE5E3;
  background: rgba(72,212,206,.18);
  border-bottom: 1px solid rgba(109,221,216,.65);
  border-radius: 3px;
  padding: 1px 0;
  font: inherit;
  white-space: inherit;
  overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.prompt-text .prompt-choice-highlight.is-placeholder {
  color: #DCE5E3;
  border-bottom-style: dashed;
}
.prompt-text .prompt-choice-highlight.is-filled {
  background: rgba(72,212,206,.24);
}
.prompt-text .prompt-choice-highlight.is-color {
  color: #DCE5E3;
  background: rgba(77,213,207,.18);
  border-bottom-color: #6ADCD7;
}
.prompt-highlight-legend {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 12px;
  color: #BAC5C4;
  font-size: 12px;
  line-height: 1.6;
}
.prompt-highlight-legend[hidden] { display: none; }
.prompt-highlight-key {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6ADBD6;
}

/* Native label: both the swatch and its hint activate the color input. */
.color-input-group { flex-wrap: wrap; }
.color-picker-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 155px;
  min-width: 0;
  min-height: 48px;
  padding: 5px 9px 5px 5px;
  border: 1px solid rgba(109,221,216,.2);
  border-radius: 13px;
  background: rgba(72,212,206,.06);
  cursor: pointer;
}
.color-picker-trigger:hover,
.color-picker-trigger:focus-within {
  border-color: rgba(109,221,216,.65);
  background: rgba(72,212,206,.12);
}
.color-picker-trigger:focus-within {
  outline: 2px solid #6ADBD6;
  outline-offset: 3px;
}
.color-picker-hint {
  min-width: 0;
  color: #94D1CE;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}
.color-hint-tap { display: none; }
@media (hover: none), (pointer: coarse) {
  .color-hint-click { display: none; }
  .color-hint-tap { display: inline; }
}
@media (max-width: 420px) {
  .color-picker-trigger { flex-basis: 100%; }
  .color-input-group > .hex-input-shell { flex: 1 1 100%; }
}

/* Copy destination chooser */
.prompt-copy-action {
  display: grid;
  gap: 8px;
  margin: 18px 0 20px;
}

.prompt-copy-primary {
  position: relative;
  width: 100%;
  min-height: 60px;
  justify-content: flex-start;
  gap: 10px;
  padding: 14px 18px;
  color: #0D0F0F;
  background: linear-gradient(180deg, #ffffff 0%, #DCE5E3 100%);
  border: 1px solid rgba(255, 255, 255, .92);
  border-bottom-color: #D0D8D7;
  border-radius: 16px;
  box-shadow:
    0 9px 24px rgba(0, 0, 0, .22),
    inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 -1px 0 rgba(0, 0, 0, .08);
  font-weight: 850;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

@media (hover: hover) and (pointer: fine) {
  .prompt-copy-primary:hover {
    color: #ffffff;
    background: rgba(21,26,26,.68);
    border-color: rgba(220,229,227,.55);
    -webkit-backdrop-filter: blur(16px) saturate(145%);
    backdrop-filter: blur(16px) saturate(145%);
    transform: translateY(-2px);
    box-shadow:
      0 14px 34px rgba(0, 0, 0, .32),
      inset 0 1px 0 rgba(255, 255, 255, .16),
      0 0 0 1px rgba(72,191,186,.12);
  }

  .prompt-copy-primary:hover > span:first-child {
    color: #151B1B;
    background: rgba(255, 255, 255, .92);
  }

  .prompt-copy-primary:hover .copy-choice-label {
    color: #90CFCC;
  }
}

.prompt-copy-primary:active {
  transform: translateY(1px) scale(.995);
  background: linear-gradient(180deg, #DCE5E3 0%, #DCE5E3 100%);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, .2),
    inset 0 2px 4px rgba(0, 0, 0, .11);
}

.prompt-copy-primary:focus-visible {
  outline: 3px solid rgba(108,221,216,.72);
  outline-offset: 3px;
}

.prompt-copy-primary > span:first-child {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: -4px;
  border-radius: 10px;
  color: #ffffff;
  background: #141717;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.copy-choice-label {
  margin-left: auto;
  color: #5D6E6D;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.prompt-copy-action > p {
  margin: 0;
  color: #8FA09F;
  font-size: 11px;
  line-height: 1.5;
}

body.provider-dialog-open {
  overflow: hidden;
}

.provider-dialog[hidden] {
  display: none;
}

.provider-dialog {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.provider-dialog-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(5,7,7,.78);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity .18s ease;
}

.provider-dialog-panel {
  position: relative;
  width: min(580px, 100%);
  max-height: min(760px, calc(100dvh - 48px));
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(112,221,217,.28);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(59,192,187,.18), transparent 38%),
    #141717;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .58);
  opacity: 0;
  transform: translateY(12px) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
}

.provider-dialog.is-open .provider-dialog-backdrop,
.provider-dialog.is-open .provider-dialog-panel {
  opacity: 1;
}

.provider-dialog.is-open .provider-dialog-panel {
  transform: translateY(0) scale(1);
}

.provider-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.provider-dialog-heading h2 {
  max-width: 440px;
  margin: 8px 0 0;
  color: #DCE5E3;
  font-size: clamp(25px, 4vw, 34px);
  line-height: 1.08;
  letter-spacing: -.04em;
}

.provider-dialog-close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #353C3C;
  border-radius: 13px;
  color: #DCE5E3;
  background: #1B2020;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

#providerDialogDescription {
  margin: 16px 0 20px;
  color: #A0AFAE;
  font-size: 14px;
  line-height: 1.65;
}

.provider-copy-only,
.provider-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.provider-copy-only {
  min-height: 66px;
  padding: 11px 15px;
  border: 1px solid #ffffff;
  border-radius: 17px;
  color: #0A0D0D;
  background: #ffffff;
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.provider-option {
  min-height: 68px;
  padding: 11px 13px;
  border: 1px solid #2F3636;
  border-radius: 17px;
  color: #DCE5E3;
  background: rgba(26,30,30,.92);
}

.provider-option:hover,
.provider-option:focus-visible {
  border-color: rgba(108,221,216,.7);
  background: rgba(71,152,148,.14);
  transform: translateY(-1px);
}

.provider-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(108,221,216,.28);
  border-radius: 12px;
  color: #DCE5E3;
  background: rgba(66,189,184,.14);
  font-size: 14px;
  font-weight: 900;
}

.provider-mark svg {
  width: 22px;
  height: 22px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.provider-gemini .provider-mark svg,
.provider-firefly .provider-mark svg,
.provider-kimi .provider-mark svg,
.provider-copilot .provider-mark svg {
  stroke:none;
}

.provider-chatgpt .provider-mark {
  color: #ffffff;
  background: #111313;
  border-color: rgba(255, 255, 255, .2);
}

.provider-chatgpt .provider-mark svg {
  fill:currentColor;
  stroke:none;
}

.provider-gemini .provider-mark {
  color: #ffffff;
  background: #141919;
  border-color: rgba(117,223,218,.45);
}

.provider-firefly .provider-mark {
  color: #ffffff;
  background: #160405;
  border-color: rgba(255, 184, 89, .5);
}

.provider-kimi .provider-mark {
  color: #ffffff;
  background: #172120;
  border-color: rgba(104,219,215,.4);
}

.provider-copilot .provider-mark {
  color: #ffffff;
  background: #141717;
  border-color: rgba(92,217,211,.42);
}

.provider-mark-copy {
  color: #ffffff;
  background: #141717;
  border-color: #141717;
}

.provider-copy-only strong,
.provider-option strong,
.provider-copy-only small,
.provider-option small {
  display: block;
}

.provider-copy-only strong,
.provider-option strong {
  font-size: 14px;
  line-height: 1.35;
}

.provider-copy-only small,
.provider-option small {
  margin-top: 3px;
  color: #92A3A2;
  font-size: 10px;
  font-weight: 650;
}

.provider-copy-only small {
  color: #657877;
}

.provider-mobile-note {
  margin: 14px 0 0;
  color: #7E9292;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 620px) {
  .prompt-copy-primary {
    min-height: 58px;
    padding: 12px 14px;
    border: 2px solid #141717;
    border-bottom-color: #141717;
    border-radius: 15px;
    background: #ffffff;
    box-shadow:
      0 6px 0 #258F9A,
      0 11px 22px rgba(0, 0, 0, .3),
      inset 0 1px 0 rgba(255, 255, 255, .9);
    font-size: 14px;
  }

  .prompt-copy-primary::after {
    content: '→';
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-left: auto;
    border-radius: 10px;
    color: #ffffff;
    background: #141717;
    font-size: 15px;
    font-weight: 900;
  }

  .prompt-copy-primary:active {
    transform: translateY(5px);
    background: #DCE5E3;
    box-shadow:
      0 1px 0 #258F9A,
      0 5px 12px rgba(0, 0, 0, .24),
      inset 0 2px 4px rgba(0, 0, 0, .1);
  }

  .copy-choice-label {
    display: none;
  }

  .provider-dialog {
    place-items: center;
    padding: 14px;
  }

  .provider-dialog-panel {
    width: min(100%, 430px);
    max-height: calc(100dvh - 28px);
    padding: 18px;
    border: 1px solid rgba(112,221,217,.3);
    border-radius: 22px;
    transform: translateY(12px) scale(.985);
  }

  .provider-dialog-heading h2 {
    max-width: 270px;
    font-size: 23px;
  }

  .provider-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #providerDialogDescription {
    margin: 12px 0 14px;
    font-size: 12px;
    line-height: 1.55;
  }

  .provider-dialog-close {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 22px;
  }

  .provider-copy-only {
    min-height: 58px;
    padding: 8px 12px;
    border-radius: 15px;
    box-shadow: 0 7px 18px rgba(0, 0, 0, .22);
  }

  .provider-option {
    min-height: 60px;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 15px;
  }

  .provider-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .provider-option > span:last-child {
    display: none;
  }

  .provider-copy-only strong,
  .provider-option strong {
    font-size: 13px;
  }

  .provider-mobile-note {
    margin-top: 10px;
  }
}

@media (max-width: 360px) {
  .provider-dialog {
    padding: 9px;
  }

  .provider-dialog-panel {
    max-height: calc(100dvh - 18px);
    padding: 15px;
  }

  .provider-option {
    grid-template-columns: auto minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .provider-dialog-backdrop,
  .provider-dialog-panel,
  .prompt-copy-primary,
  .provider-option {
    transition: none;
  }
}

/* Persistent prompt action bar on tablet and desktop. */
@media (min-width:681px) {
  body.is-ready {
    padding-bottom:0;
  }

  .mobile-action-bar {
    position:fixed;
    z-index:60;
    left:50%;
    right:auto;
    bottom:max(18px,env(safe-area-inset-bottom));
    width:min(640px,calc(100vw - 40px));
    min-width:0;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
    padding:9px;
    border:1px solid rgba(129,225,221,.27);
    border-radius:19px;
    background:
      radial-gradient(circle at 82% 0,rgba(67,181,176,.16),transparent 42%),
      rgba(14,18,18,.8);
    box-shadow:
      0 20px 56px rgba(0,0,0,.5),
      0 0 0 1px rgba(74,148,145,.08),
      inset 0 1px 0 rgba(255,255,255,.075);
    -webkit-backdrop-filter:blur(20px) saturate(140%);
    backdrop-filter:blur(20px) saturate(140%);
    transform:translateX(-50%);
    transition:opacity .24s ease,transform .24s ease,visibility .24s ease;
  }

  .mobile-action-bar.is-past-prompt {
    transform:translateX(-50%) translateY(18px) scale(.98);
  }

  .mobile-action-bar[hidden] {
    display:none;
  }

  .mobile-action-bar a {
    min-width:0;
    display:flex;
    align-items:center;
    gap:11px;
    padding:0 16px;
    overflow:hidden;
    color:#BBC6C5;
    font-size:13px;
    font-weight:750;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .mobile-action-bar a::before {
    content:'✦';
    flex:0 0 auto;
    display:grid;
    place-items:center;
    width:34px;
    height:34px;
    border:1px solid rgba(113,222,217,.32);
    border-radius:11px;
    color:#DCE5E3;
    background:linear-gradient(145deg,rgba(68,206,201,.28),rgba(60,128,126,.13));
    box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 6px 18px rgba(56,95,93,.2);
    font-size:13px;
  }

  .mobile-action-bar a:hover {
    color:#ffffff;
  }

  .mobile-action-bar button {
    min-width:172px;
    min-height:50px;
    padding:11px 24px;
    border:1px solid #ffffff;
    border-radius:13px;
    color:#0A0D0D;
    background:linear-gradient(180deg,#ffffff,#DCE5E3);
    box-shadow:0 5px 14px rgba(0,0,0,.24);
    font-size:14px;
    font-weight:850;
    cursor:pointer;
    transition:transform .16s ease,box-shadow .16s ease,background .16s ease;
  }

  .mobile-action-bar button:hover {
    color:#ffffff;
    background:rgba(27,32,32,.82);
    border-color:rgba(130,226,222,.62);
    -webkit-backdrop-filter:blur(14px);
    backdrop-filter:blur(14px);
    transform:translateY(-1px);
    box-shadow:0 8px 22px rgba(0,0,0,.32);
  }

  .mobile-action-bar button:active {
    transform:translateY(1px);
    box-shadow:0 3px 9px rgba(0,0,0,.25);
  }

  .toast {
    bottom:88px;
  }
}

@media (min-width:1100px) {
  body.is-ready {
    padding-bottom:0;
  }

  .mobile-action-bar {
    bottom:22px;
    width:min(760px,calc(100vw - 64px));
    min-height:74px;
    padding:10px;
    border-radius:21px;
  }

  .mobile-action-bar a {
    padding-inline:19px;
    font-size:14px;
  }

  .mobile-action-bar a::before {
    width:40px;
    height:40px;
    border-radius:13px;
    font-size:15px;
  }

  .mobile-action-bar button {
    min-width:205px;
    min-height:54px;
    padding-inline:30px;
    border-radius:14px;
    font-size:15px;
  }

  .toast {
    bottom:108px;
  }
}

/* Let the real category name use the available narrow-header space. */
@media (max-width:420px) {
  .header {
    gap:8px;
    padding-inline:10px;
  }

  .header-actions {
    flex:1 1 auto;
    justify-content:flex-end;
    gap:6px;
  }

  .header-actions .ghost-btn {
    flex:0 1 auto;
    width:fit-content;
    max-width:calc(100vw - 148px);
    min-height:42px;
    height:auto;
    padding:7px 9px;
    overflow:visible;
    border-radius:12px;
    color:#D8DEDE;
    font-size:10px;
    line-height:1.15;
    text-align:center;
    text-overflow:unset;
    white-space:normal;
  }

  .header-actions .primary-btn {
    flex:0 0 auto;
    min-height:42px;
    padding-inline:12px;
  }
}

/* ===== PROMPTBX VECTOR RATING ICONS ===== */
.promptbx-svg-icon {
  display:block;
  width:1em;
  height:1em;
  flex:0 0 auto;
  overflow:visible;
}

.rating .rating-icon {
  width:14px;
  height:14px;
}

.rating.hot .rating-icon {
  color:#ffad52;
  filter:drop-shadow(0 0 5px rgba(255,143,45,.38));
}

.rating.needs-fix .rating-icon {
  color:#ff939d;
}
