:root {
  --bg: #010409;
  --navy: #08142d;
  --navy-soft: #0c1937;
  --ink: #ecf0f8;
  --muted: #b8c2d6;
  --blue: #2268f2;
  --blue-soft: #92a4bc;
  --chat: #aeb8c6;
  --edge: #1f376f;
  --topbar-h: 112px;
  --chat-h: 122px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: #000;
  color: var(--ink);
  font-family: "Source Sans 3", sans-serif;
  display: grid;
  place-items: center;
}

.app-shell {
  width: min(100vw, 430px);
  height: 100dvh;
  background: radial-gradient(circle at 58% 54%, #15306d 0%, #07112a 28%, #040913 54%, #01050a 100%);
  position: relative;
  overflow: hidden;
}

.topbar {
  min-height: var(--topbar-h);
  background: linear-gradient(90deg, #0a1430 0%, #09142d 100%);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 14px 12px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
}

.logo-wrap {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.logo-wrap img {
  width: 66px;
  height: auto;
  display: block;
}

.mode-nav {
  display: flex;
  gap: 12px;
  padding-top: 4px;
}

.mode-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: #a3b6c8;
  color: #f2f6fc;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.mode-btn .mode-icon {
  width: 31px;
  height: 31px;
  display: block;
}

.mode-btn:nth-child(3) {
 /* color: #73d29c; */
}

.mode-btn.active {
  background: #2268f2;
  outline: 3px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 4px rgba(34, 104, 242, 0.23);
}

.screen {
  position: absolute;
  inset: var(--topbar-h) 0 var(--chat-h) 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.hero-image {
  width: 100%;
  height: auto;
  display: block;
}

.section-pane {
  padding: 18px 18px 10px;
}

.title-xl {
  margin: 0;
  font-size: clamp(34px, 7.6vw, 48px);
  line-height: 0.95;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.4px;
}

.title-xl .light {
  font-weight: 500;
  opacity: 0.96;
}

.title-xl .bold {
  font-weight: 700;
}

.text-lg {
  margin: 14px 0 0;
  font-size: clamp(18px, 4.9vw, 28px);
  line-height: 1.08;
}

.life-card {
  background: linear-gradient(90deg, #06102a 0%, #0b1d4e 54%, #051129 100%);
  padding: 20px 18px;
  margin-top: 16px;
  font-size: clamp(20px, 5.8vw, 32px);
  line-height: 1.06;
}

.intro-copy {
  text-align: center;
  padding: 18px;
  background: radial-gradient(circle at 56% 18%, #1b397f 0%, #0b1632 45%, #071026 100%);
}

.intro-copy .headline {
  margin: 0;
  font-size: clamp(34px, 8.4vw, 46px);
  line-height: 0.9;
  font-style: italic;
}

.intro-copy .subhead {
  margin: 6px 0 0;
  font-size: clamp(24px, 6vw, 34px);
  line-height: 0.95;
  font-style: italic;
}

.intro-cta {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 20px 10px 26px;
}

.big-cam {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: radial-gradient(circle at 34% 30%, #3d8fff 0%, #1b5de7 65%, #1140a8 100%);
  color: #ebf2ff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.big-cam svg {
  width: 54px;
  height: 54px;
  color: #ebf2ff;
}

.intro-cta p {
  margin: 0;
  text-transform: uppercase;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 17px;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-align: center;
}

.search-wrap {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  padding: 16px 16px 8px;
  gap: 8px;
}

.search-wrap .icon {
  color: rgba(233, 237, 243, 0.8);
  text-align: center;
}

.search-wrap .icon svg {
  width: 35px;
  height: 35px;
  display: block;
}

.search-wrap input {
  height: 52px;
  border: 3px solid #1f62ea;
  background: #d9d9db;
  color: #171922;
  font-size: 24px;
  padding: 0 14px;
  font-family: "Source Sans 3", sans-serif;
}

.list-artist {
  list-style: none;
  padding: 10px 14px 4px;
  margin: 0;
  display: grid;
  gap: 10px;
}

.artist-row {
  display: grid;
  grid-template-columns: 68px 1fr;
  align-items: center;
  gap: 14px;
  padding: 4px 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.artist-row img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  filter: grayscale(100%);
}

.artist-row span {
  font-size: clamp(24px, 6.2vw, 40px);
  line-height: 0.92;
}

.artist-row strong {
  font-weight: 700;
}

.artwork-panel {
  padding: 0 18px 16px;
}

.artwork-title {
  margin: 10px 0 0;
  font-size: clamp(36px, 8vw, 52px);
  line-height: 0.9;
  font-family: "Barlow Condensed", sans-serif;
}

.artwork-meta {
  margin: 10px 0 0;
  font-size: clamp(18px, 4.4vw, 24px);
  line-height: 1.1;
  font-weight: 700;
}

.artwork-body {
  margin: 14px 0 0;
  font-size: clamp(17px, 4.2vw, 22px);
  line-height: 1.12;
}

.link-more {
  margin-top: 12px;
  color: #1f62ea;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
}

.extras-head {
  margin: 16px 0 8px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #6d7a95;
  font-size: 18px;
  font-family: "Barlow Condensed", sans-serif;
}

.extra-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.extra-chip {
  border-radius: 42px;
  border: 2px solid #1b53c4;
  background: #0f264f;
  color: #e8efff;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 16px;
  min-height: 72px;
}

.extra-chip .dot {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #2268f2;
  display: grid;
  place-items: center;
  color: #e8efff;
}

.extra-chip .dot svg {
  width: 23px;
  height: 23px;
  display: block;
}

.prompt {
  margin-top: 10px;
  border-radius: 999px;
  border: 2px solid rgba(173, 187, 212, 0.35);
  background: rgba(77, 100, 142, 0.28);
  color: #d8e0ee;
  font-size: 16px;
  padding: 8px 12px;
  text-align: center;
}

.grid-search {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px 20px 10px;
}

.mosaic {
  columns: 2;
  column-gap: 10px;
  padding: 8px 20px 16px;
}

.mosaic button {
  width: 100%;
  margin: 0 0 10px;
  border: 0;
  background: transparent;
  padding: 0;
  break-inside: avoid;
  cursor: pointer;
}

.mosaic img {
  width: 100%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  display: block;
}

.scan-stage {
  background: #a6a6a8;
  background-image: radial-gradient(circle at 40% 30%, rgba(255, 255, 255, 0.38), rgba(0, 0, 0, 0.18));
  min-height: 100%;
  position: relative;
  padding: 70px 14px 24px;
}

.scan-pill {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #2268f2;
  color: #eff4ff;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 16px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  padding: 10px 24px;
  text-align: center;
}

.scan-frame {
  border: 16px solid transparent;
  position: relative;
  margin: 0 auto;
  width: min(100%, 380px);
  background: #07112a;
  overflow: hidden;
}

.scan-frame::before,
.scan-frame::after {
  content: "";
  position: absolute;
  inset: -10px;
  pointer-events: none;
  background:
    linear-gradient(#2268f2, #2268f2) 0 0 / 52px 9px no-repeat,
    linear-gradient(#2268f2, #2268f2) 0 0 / 9px 52px no-repeat,
    linear-gradient(#2268f2, #2268f2) 100% 0 / 52px 9px no-repeat,
    linear-gradient(#2268f2, #2268f2) 100% 0 / 9px 52px no-repeat,
    linear-gradient(#2268f2, #2268f2) 0 100% / 52px 9px no-repeat,
    linear-gradient(#2268f2, #2268f2) 0 100% / 9px 52px no-repeat,
    linear-gradient(#2268f2, #2268f2) 100% 100% / 52px 9px no-repeat,
    linear-gradient(#2268f2, #2268f2) 100% 100% / 9px 52px no-repeat;
}

.scan-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  border: 5px solid rgba(255, 255, 255, 0.44);
  z-index: 3;
}

.scan-frame.has-preview img {
  display: block;
}

.scan-frame video {
  width: 100%;
  display: block;
  border: 5px solid rgba(255, 255, 255, 0.44);
  min-height: 240px;
  object-fit: cover;
  background: #050a17;
  z-index: 1;
}

.scan-frame.has-preview video {
  filter: brightness(0.52);
}

.scan-frame.has-preview img {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.scan-line {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 76%;
  transform: translateX(-50%);
  height: 5px;
  background: #2268f2;
  box-shadow: 0 0 12px rgba(34, 104, 242, 0.5);
  z-index: 2;
}

.scan-frame.has-preview .scan-line {
  opacity: 0.25;
}

.scan-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.scan-actions[hidden] {
  display: none !important;
}

.scan-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 0 10px;
  pointer-events: none;
}

.scan-overlay .scan-actions,
.scan-overlay .shutter {
  pointer-events: auto;
}

.scan-overlay .scan-actions {
  width: 100%;
}

.scan-btn {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(11, 27, 63, 0.82);
  backdrop-filter: blur(3px);
  color: #eff4ff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 8px 14px;
  cursor: pointer;
}

.scan-btn.upload-btn {
  position: relative;
  overflow: hidden;
}

.scan-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.shutter {
  margin: 0 auto;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 6px solid #3a6ed0;
  box-shadow: inset 0 0 0 11px #d7d7da;
  background: #f1f3f6;
  display: block;
  cursor: pointer;
}

.shutter:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.scan-status {
  margin: 14px auto 0;
  max-width: 380px;
  text-align: center;
  color: #102147;
  font-size: 14px;
  font-weight: 700;
}

.chat-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 10px 8px;
  z-index: 20;
  min-height: var(--chat-h);
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

.chat-main {
  width: 100%;
  min-height: 60px;
  border-radius: 999px;
  border: 0;
  background: var(--chat);
  color: #11171f;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 10px;
}

.spark {
  color: #1f62ea;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.spark svg {
  width: 100%;
  height: 100%;
  display: block;
}

#chatInput {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 20px;
  color: #11171f;
  outline: none;
  padding: 6px 0;
}

#chatInput::placeholder {
  color: rgba(22, 28, 39, 0.75);
}

.chat-send {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: #2268f2;
  color: #eff4ff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chat-send svg {
  width: 18px;
  height: 18px;
  display: block;
}

.chat-status {
  margin: -6px 0 0 auto;
  width: fit-content;
  min-width: 172px;
  border-radius: 999px;
  background: rgba(150, 162, 178, 0.88);
  color: #1f62ea;
  font-size: clamp(16px, 3.2vw, 20px);
  padding: 7px 16px;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 6px;
}

.spark-mini {
  width: 14px;
  height: 14px;
  color: #1f62ea;
}

.spark-mini svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chat-ping {
  position: absolute;
  left: 10px;
  bottom: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1f62ea;
}

.v2-toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 16px);
  transform: translateX(-50%);
  background: rgba(8, 19, 44, 0.94);
  color: #ecf0f8;
  border: 1px solid rgba(125, 158, 228, 0.45);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  z-index: 999;
}

.lw-btn {
  display: none !important;
}

.lw-input {
  display: flex !important;
  align-items: center;
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(8, 19, 44, 0.98) 0%, rgba(5, 12, 28, 0.98) 100%) !important;
  border-top: 1px solid rgba(115, 146, 211, 0.28) !important;
  padding: 10px 10px calc(env(safe-area-inset-bottom) + 10px) !important;
  gap: 8px;
}

.lw-panel {
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  top: 0 !important;
  height: auto !important;
  max-height: none !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  border-top: 1px solid rgba(115, 146, 211, 0.32) !important;
  border-bottom: 1px solid rgba(115, 146, 211, 0.28) !important;
  background: linear-gradient(180deg, rgba(8, 19, 44, 0.98) 0%, rgba(5, 12, 28, 0.98) 100%) !important;
  color: #e9f0ff !important;
  box-shadow: 0 -12px 40px rgba(2, 8, 20, 0.5) !important;
  backdrop-filter: blur(8px);
  z-index: 60 !important;
}

.lw-header {
  background: transparent !important;
  border-bottom: 1px solid rgba(115, 146, 211, 0.28) !important;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 10px !important;
}

.lw-title {
  color: #eaf2ff !important;
  font-family: "Barlow Condensed", sans-serif !important;
  font-size: 24px !important;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.lw-close,
.lw-expand {
  color: #d8e7ff !important;
}

.lw-body {
  background: transparent !important;
  padding: 12px !important;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-content: flex-start;
  gap: 8px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 90px) !important;
}

.lw-msg {
  margin: 0 !important;
  max-width: min(90%, 680px);
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.4 !important;
  border: 1px solid rgba(126, 159, 226, 0.25);
}

.lw-msg.me {
  align-self: flex-end;
  background: rgba(34, 104, 242, 0.28) !important;
  border-color: rgba(109, 152, 245, 0.48);
  color: #eef4ff !important;
}

.lw-msg.ai {
  align-self: flex-start;
  background: rgba(15, 33, 73, 0.78) !important;
  color: #d9e6ff !important;
}

.lw-msg strong {
  color: #f1f6ff !important;
}

.lw-msg pre {
  background: rgba(7, 19, 43, 0.8);
  border: 1px solid rgba(115, 146, 211, 0.28);
  border-radius: 10px;
  padding: 8px;
}

.lw-msg a {
  color: #9bc0ff !important;
}

.lw-input input {
  flex: 1;
  border: 1px solid rgba(120, 153, 220, 0.32) !important;
  border-radius: 999px;
  background: rgba(14, 33, 73, 0.8) !important;
  color: #eaf1ff !important;
  padding: 10px 14px !important;
}

.lw-input input::placeholder {
  color: rgba(200, 217, 247, 0.7) !important;
}

.lw-input button {
  width: 40px;
  height: 40px;
  border: 0 !important;
  border-radius: 999px !important;
  background: #2268f2 !important;
  color: #eff4ff !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center;
  font-weight: 700;
}

.lw-input button svg {
  width: 18px;
  height: 18px;
  display: block;
}

.lw-composer-spark {
  color: #1f62ea;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
}

.lw-composer-spark svg {
  width: 100%;
  height: 100%;
  display: block;
}

@media (min-width: 580px) {
  :root {
    --topbar-h: 88px;
    --chat-h: 112px;
  }

  .app-shell {
    margin: 18px auto;
    border: 1px solid #0d1d3f;
    height: calc(100dvh - 36px);
  }

  .topbar {
    min-height: var(--topbar-h);
  }

  .search-wrap input {
    font-size: 22px;
  }

  .artist-row span {
    font-size: 32px;
  }

  .title-xl {
    font-size: 48px;
  }

  .text-lg {
    font-size: 24px;
  }

  .life-card {
    font-size: 28px;
  }

  .artwork-title {
    font-size: 50px;
  }

  .artwork-meta,
  .artwork-body {
    font-size: 20px;
  }

  .chat-status {
    font-size: 18px;
  }

  #chatInput {
    font-size: 18px;
  }
}

@media (max-width: 430px) {
  .mode-nav {
    gap: 8px;
  }

  .mode-btn {
    width: 50px;
    height: 50px;
  }

  .mode-btn .mode-icon {
    width: 27px;
    height: 27px;
  }

  #chatInput {
    font-size: clamp(16px, 4.8vw, 20px);
  }
}
