 :root {
     --bg: #000;
     --fg: #fff;
     --muted: rgba(255, 255, 255, .85);
     --panel: #0b0b0b;
     --bd: rgba(255, 255, 255, .12);
     --input: #0f0f0f;
     --chip: #0f0f0f;
     --topbar-h: 72px
 }

 @media (max-width:640px) {
     :root {
         --topbar-h: 76px
     }
 }

 html,
 body {
     min-height: 100svh;
     margin: 0;
     background: var(--bg);
     color: var(--fg);
     font-family: Arial, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, "Apple Color Emoji", "Segoe UI Emoji";
     -webkit-text-size-adjust: 100%;
     overflow-x: hidden;
     overflow-y: auto;
     scrollbar-gutter: stable both-edges
 }

 * {
     box-sizing: border-box
 }

 .topbar {
     position: fixed;
     inset: 0 0 auto 0;
     height: var(--topbar-h);
     display: flex;
     align-items: center;
     padding: 0 16px;
     background: linear-gradient(180deg, rgba(10, 10, 10, .9), rgba(10, 10, 10, .75));
     border-bottom: 1px solid var(--bd);
     z-index: 100;
     backdrop-filter: blur(6px)
 }

 .topbar .brand {
     display: flex;
     align-items: center;
     gap: 10px;
     text-decoration: none;
     color: var(--fg)
 }

 .topbar .logo {
     width: 140px;
     height: auto;
     display: block;
     object-fit: contain
 }

 .shell {
     width: 100%;
     max-width: 760px;
     margin: 0 auto;
     padding: calc(var(--topbar-h) + 28px) 20px 60px;
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 28px;
     text-align: center;
     min-height: 100svh;
     justify-content: center
 }

 .hero {
     display: grid;
     gap: 8px
 }

 h1 {
     margin: 0;
     font-size: 34px;
     line-height: 1.2;
     letter-spacing: .2px
 }

 .tagline {
     margin: 0;
     font-size: 16px;
     color: var(--muted)
 }

 .panel {
     width: 100%;
     background: var(--panel);
     border: 1px solid var(--bd);
     border-radius: 16px;
     padding: 18px;
     display: grid;
     gap: 14px
 }

 .prompt-row {
     display: grid;
     grid-template-columns: 1fr auto auto;
     gap: 10px;
     align-items: center
 }

 #mood-input {
     width: 100%;
     padding: 14px 16px;
     background: var(--input);
     color: var(--fg);
     border: 1px solid rgba(255, 255, 255, .18);
     border-radius: 12px;
     outline: none
 }

 .cta {
     padding: 12px 16px;
     background: #fff;
     color: #000;
     border: none;
     border-radius: 12px;
     font-size: 14px;
     cursor: pointer;
     transition: background .2s ease, transform .06s ease;
     width: 90px
 }

 .ghost {
     padding: 12px 14px;
     background: #141414;
     color: #fff;
     border: 1px solid rgba(255, 255, 255, .18);
     border-radius: 12px;
     font-size: 16px;
     cursor: pointer;
     width: 54px
 }

 .control {
     display: grid;
     gap: 8px;
     text-align: left;
     font-size: 12px;
     color: var(--muted)
 }

 .control input[type="range"] {
     width: 100%
 }

 :root {
     --gap: 10px;
 }

 .chip-carousel {
     position: relative;
     width: 100%;
     display: grid;
     align-items: center;
     grid-template-columns: auto 1fr auto;
     gap: 0px;
 }

 .chip-viewport {
     overflow-x: auto;
     overflow-y: hidden;
     scroll-behavior: smooth;
     scroll-snap-type: x mandatory;
     -webkit-overflow-scrolling: touch;
     border-radius: 12px;
 }

 .chip-viewport::-webkit-scrollbar {
     display: none;
 }

 .chip-viewport {
     scrollbar-width: none;
 }

 .chip-track {
     display: grid;
     grid-auto-flow: column;
     grid-auto-columns: calc((100% - var(--gap)) / 2);
     gap: var(--gap);
     padding: 2px;
 }

 .chip {
     padding: 8px 8px;
     background: #111;
     border: 1px solid rgba(255, 255, 255, .18);
     border-radius: 10px;
     color: #fff;
     font-size: 13px;
     font-weight: 600;
     letter-spacing: .2px;
     display: grid;
     place-items: center;
     min-height: 58px;
     text-align: center;
     line-height: 1.2;
     cursor: pointer;
     scroll-snap-align: start;
     transition: transform .16s ease, background-color .2s ease, box-shadow .2s ease;
     scroll-snap-stop: always;
     white-space: nowrap;
 }

 @media (hover:hover) and (pointer:fine) {
     .chip:hover {
         background: #151515;
         transform: translateY(-1px);
         box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
     }
 }

 .chip-nav {
     background: none;
     border: none;
     color: #fff;
     font-size: 18px;
     cursor: pointer;
     display: flex;
     align-items: center;
     justify-content: center;
     line-height: 1;
     user-select: none;
     transition: opacity 0.2s ease, transform 0.1s ease;
 }

 .chip-nav:hover {
     opacity: 0.7;
 }

 .chip-nav:active {
     transform: translateY(1px);
 }

 .chip-nav[disabled] {
     opacity: 0.3;
     pointer-events: none;
 }


 @media (max-width: 400px) {
     .chip-track {
         grid-auto-columns: calc((100% - var(--gap)) / 2);
     }
 }

 .quick {
     display: grid;
     gap: 12px;
     width: 100%
 }

 .quick h2 {
     margin: 0;
     font-size: 18px;
     font-weight: 700
 }

 .mood-grid {
     display: grid;
     grid-template-columns: repeat(3, minmax(0, 1fr));
     gap: 14px;
     width: 100%;
     max-width: 520px;
     margin: 0 auto
 }

 .mood-btn {
     width: 100%;
     aspect-ratio: 1/1.1;
     background: #111;
     border: 1px solid rgba(255, 255, 255, .18);
     border-radius: 12px;
     cursor: pointer;
     display: grid;
     grid-template-rows: 1fr auto;
     place-items: center;
     gap: 8px;
     padding: 14px;
     transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease
 }

 .mood-btn img {
     width: 56px;
     height: 56px;
     object-fit: contain
 }

 .mood-btn span {
     font-size: 14px;
     color: var(--muted)
 }

 .results,
 .history-wrap {
     display: grid;
     gap: 10px;
     width: 100%;
     text-align: left
 }

 .results h3,
 .history-wrap h3 {
     margin: 0;
     font-size: 16px;
     color: var(--muted)
 }

 .gallery {
     display: grid;
     grid-template-columns: repeat(3, minmax(0, 1fr));
     gap: 14px;
     width: 100%
 }

 .card {
     background: #0f0f0f;
     border: 1px solid var(--bd);
     border-radius: 12px;
     overflow: hidden;
     display: grid;
     grid-template-rows: 180px auto
 }

 .thumb {
     width: 100%;
     height: 100%
 }

 .shimmer {
     position: relative;
     background: linear-gradient(90deg, #0c0c0c 25%, #141414 37%, #0c0c0c 63%);
     background-size: 400% 100%;
     animation: shimmer 1.2s infinite
 }

 .fake-thumb {
     background: radial-gradient(circle at 30% 30%, #1a1a1a, #0f0f0f 60%)
 }

 .card-info {
     padding: 10px 12px;
     display: grid;
     gap: 6px
 }

 .title {
     font-size: 14px;
     line-height: 1.3
 }

 .meta {
     font-size: 12px;
     color: var(--muted)
 }

 .line {
     height: 12px;
     border-radius: 6px
 }

 .line.short {
     width: 60%;
     height: 10px
 }

 @keyframes shimmer {
     0% {
         background-position: 100% 0
     }

     100% {
         background-position: -100% 0
     }
 }

 .history {
     display: flex;
     flex-wrap: wrap;
     gap: 10px;
     width: 100%
 }

 .history-chip {
     padding: 8px 10px;
     border: 1px solid rgba(255, 255, 255, .18);
     background: #0f0f0f;
     color: #fff;
     border-radius: 999px;
     font-size: 12px;
     cursor: pointer
 }

 @media (hover:hover) and (pointer:fine) {


     .mood-btn:hover {
         background: #151515;
         transform: translateY(-2px);
         box-shadow: 0 8px 22px rgba(0, 0, 0, .35)
     }

     .cta:hover {
         background: #eaeaea
     }

     .ghost:hover {
         background: #1a1a1a
     }

     .cta:active {
         transform: translateY(1px)
     }
 }

 @media (max-width:1024px) {
     .shell {
         max-width: 720px
     }

     .gallery {
         grid-template-columns: repeat(2, minmax(0, 1fr))
     }
 }

 @media (max-width:640px) {
     .topbar .logo {
         width: 150px
     }

     .shell {
         padding: calc(var(--topbar-h) + 18px) 16px 52px;
         justify-content: flex-start
     }

     h1 {
         font-size: 28px
     }

     .prompt-row {
         grid-template-columns: 1fr auto auto
     }

     .mood-grid {
         grid-template-columns: repeat(3, minmax(0, 1fr))
     }

     .gallery {
         grid-template-columns: 1fr
     }
 }

 .lightbox {
     position: fixed;
     inset: 0;
     display: flex;
     align-items: center;
     justify-content: center;
     background: rgba(0, 0, 0, .9);
     z-index: 9999
 }

 .lightbox[aria-hidden="true"] {
     display: none
 }

 .lightbox img {
     max-width: 90vw;
     max-height: 90vh;
     box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
     border-radius: 12px
 }

 .lightbox-close {
     position: absolute;
     top: 16px;
     right: 16px;
     font-size: 22px;
     line-height: 1;
     padding: 8px 12px;
     border-radius: 999px;
     border: none;
     background: rgba(255, 255, 255, .15);
     color: #fff;
     cursor: pointer
 }

 .lightbox-close:hover {
     background: rgba(255, 255, 255, .3)
 }