:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #111111;
  --muted: #6f6f6f;
  --line: #e7e7e7;
  --soft: #f5f5f5;
  --error: #b42318;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.recommendLayout {
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  background: var(--bg);
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

.recommendLayout.sidebarOpen {
  grid-template-columns: 180px minmax(0, 1fr);
}

.historySidebar {
  position: relative;
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  padding: 12px;
  border-right: 1px solid var(--line);
  background: #f7f7f7;
  overflow: hidden;
}

.sidebarControls {
  display: grid;
  gap: 8px;
  align-items: center;
}

.recommendLayout.sidebarOpen .sidebarControls {
  grid-template-columns: minmax(0, 1fr);
}

.iconButton,
.newRecommendButton {
  height: 44px;
  min-width: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.iconButton {
  display: grid;
  place-items: center;
  padding: 0;
}

.sidebarToggle {
  display: none;
}

.newRecommendButton {
  display: inline-flex;
  justify-content: flex-start;
  gap: 10px;
  align-items: center;
  padding: 0 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 850;
}

.recommendLayout.sidebarOpen .newRecommendButton {
  justify-content: flex-start;
  padding: 0 12px;
}

.hamburgerIcon {
  width: 18px;
  display: grid;
  gap: 4px;
}

.hamburgerIcon span {
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.newRecommendIcon {
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}

.sidebarLabel {
  display: inline;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommendLayout.sidebarOpen .sidebarLabel {
  display: inline;
}

.historySection {
  min-height: 0;
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.recommendLayout.sidebarOpen .historySection {
  display: none;
}

.historySection h2 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.historyList {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;
}

.historyRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 4px;
  align-items: stretch;
}

.historyItem {
  width: 100%;
  min-height: 48px;
  display: grid;
  gap: 3px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
}

.historyItem:hover,
.historyItem.active {
  background: #fff;
}

.historyShareButton,
.historyHideButton {
  align-self: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 7px;
  font-size: 11px;
  font-weight: 850;
}

.historyShareButton:hover,
.historyHideButton:hover {
  background: #fff;
  color: var(--ink);
}

.historyHideButton:hover {
  color: var(--error);
}

.historyItem span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 750;
}

.historyItem small,
.historyEmpty {
  color: var(--muted);
  font-size: 12px;
}

.historyItem small {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.historyMode {
  min-width: max-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 6px;
  color: var(--ink);
  font-style: normal;
  font-size: 10px;
  font-weight: 950;
  line-height: 1.35;
  text-transform: uppercase;
}

.historyMode.fast {
  background: #111;
  border-color: #111;
  color: #fff;
}

.historyMode.deep {
  background: #fff;
}

.recommendMain {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.recommendHeader {
  position: relative;
  z-index: 20;
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px clamp(16px, 3vw, 38px);
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(14px);
}

.headerActions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.languageToggle {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 2px;
}

.languageToggle button {
  width: 34px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.languageToggle button.active {
  background: var(--ink);
  color: #fff;
}

.conversation {
  width: 100%;
  max-width: 920px;
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 52px clamp(16px, 3vw, 34px) 150px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.emptyRecommendState {
  width: 100%;
  min-width: 0;
  min-height: 42vh;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.emptyRecommendState h1 {
  max-width: 100%;
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.emptyRecommendState p {
  max-width: 560px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.examplePrompts {
  width: 100%;
  max-width: 760px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 24px auto 0;
  text-align: left;
}

.examplePromptCard {
  min-height: 116px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 14px;
  text-align: left;
}

.examplePromptCard:hover {
  border-color: var(--ink);
  background: #fafafa;
}

.examplePromptCard strong {
  font-size: 14px;
  font-weight: 950;
}

.examplePromptCard span {
  color: var(--muted);
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.message {
  min-width: 0;
}

.userMessage {
  justify-self: end;
  max-width: min(680px, 88%);
  border-radius: 18px;
  background: var(--soft);
  padding: 12px 15px;
}

.userMessage p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.assistantMessage {
  display: grid;
  gap: 20px;
}

.composerWrap {
  position: relative;
  z-index: 30;
  padding: 14px clamp(16px, 3vw, 38px) 18px;
  background: linear-gradient(to top, #fff 72%, rgb(255 255 255 / 0));
}

.modeControl {
  width: 100%;
  max-width: 920px;
  min-height: 32px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 0 auto 8px;
  color: var(--muted);
  font-size: 12px;
}

.deepModeToggle {
  display: inline-flex;
  grid-template-columns: none;
  gap: 8px;
  align-items: center;
  min-width: max-content;
  cursor: pointer;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.deepModeToggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--ink);
}

.modeControl small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
}

.composerBox {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.composerInput {
  width: 100%;
  height: 46px;
  max-height: 130px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 12px 34px rgb(0 0 0 / 8%);
  padding: 12px 16px;
  outline: none;
  resize: none;
  line-height: 1.45;
  font-size: 14px;
  overflow: hidden;
}

.composerInput:focus {
  border-color: var(--ink);
}

.composerInput.running,
.recommendButton.running {
  cursor: wait;
  opacity: 0.6;
}

.recommendButton {
  min-width: 116px;
  height: 46px;
  border: 1px solid var(--ink);
  border-radius: 18px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 950;
  white-space: nowrap;
}

.recommendButton:hover {
  background: #2a2a2a;
}

.recommendButton:disabled {
  cursor: wait;
}

button,
input,
select,
textarea {
  font: inherit;
}

.appHeader {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px clamp(16px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(14px);
}

.brandMark {
  display: inline-block;
  font-size: 25px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.headerLinks {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
  min-width: 0;
}

.headerSearch {
  display: block;
  min-width: 0;
}

.headerRequestInput {
  width: 100%;
  height: 46px;
  max-height: 130px;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  padding: 12px 18px;
  outline: none;
  resize: none;
  line-height: 1.35;
  font-size: 14px;
  overflow: hidden;
}

.headerRequestInput:focus {
  border-color: var(--ink);
  background: #fff;
}

.headerRequestInput.running {
  cursor: wait;
  opacity: 0.6;
}

.headerStats {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

.headerStats span,
.headerLink {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.headerStats strong {
  margin-right: 4px;
  color: var(--ink);
  font-size: 15px;
}

.headerLink {
  color: var(--ink);
}

.recommendShell {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding: 24px clamp(14px, 2.6vw, 38px) 60px;
}

.inputPanel {
  display: none;
}

.fieldRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.creatorSearch {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  outline: none;
}

.creatorSearch {
  height: 44px;
  padding: 0 12px;
  font-weight: 850;
}

textarea {
  resize: vertical;
  min-height: 86px;
  padding: 12px;
  line-height: 1.55;
  font-size: 14px;
  overflow-wrap: anywhere;
}

select:focus,
textarea:focus,
.creatorSearch:focus {
  border-color: var(--ink);
  background: #fff;
}

.pickerActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.pickerActions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.creatorPicker {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.creatorPicker summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  font-weight: 950;
}

.creatorPicker summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.creatorPickerHint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}

.creatorPicker[open] {
  gap: 10px;
}

.pickerHead,
.lineHead,
.sectionHeader,
.runStatus {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
}

.pickerHead strong,
.lineHead strong {
  font-weight: 950;
}

.pickerHead span,
.lineHead span,
.mutedText,
.finalSummary {
  color: var(--muted);
}

.creatorList {
  max-height: 360px;
  display: grid;
  gap: 0;
  overflow: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.creatorRow {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.creatorRow:last-child {
  border-bottom: 0;
}

.creatorRow input {
  margin-top: 4px;
}

.creatorMain {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.creatorMain small,
.creatorTags,
.evidenceLines,
.errorText {
  font-size: 12px;
}

.creatorTags {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.creatorTags em {
  border-radius: 999px;
  background: var(--soft);
  padding: 3px 7px;
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.resultPanel {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 22px;
}

.progressPanel {
  display: grid;
  gap: 8px;
}

.progressTrack {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.progressFill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transition: width 240ms ease;
}

.progressMeta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.runStatus {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.runStatus #resultTitle {
  font-size: 13px;
  font-weight: 950;
}

.cachedTag {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  letter-spacing: 0.02em;
}

.runStatus span:last-child:not(:empty) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.shareButton {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.shareButton:hover {
  border-color: var(--ink);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2 {
  margin: 0 0 8px;
  font-size: 14px;
}

p {
  line-height: 1.55;
}

.finalSummary {
  max-width: 430px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.summaryBlock {
  display: grid;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.summaryText {
  margin: 0;
  font-size: 17px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.55;
}

.summaryNotes {
  display: grid;
  gap: 16px;
}

.summaryNote {
  display: grid;
  gap: 8px;
}

.summaryNote h2 {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

.summaryNote ul {
  display: grid;
  gap: 6px;
}

.summaryNote li {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.agentSection {
  display: grid;
  gap: 8px;
}

.agentResults,
.recommendationList,
.finalRecommendations,
.evidenceLines,
.selectorReasons,
.summaryNotes ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.agentResults,
.finalRecommendations {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.agentLine,
.finalLine,
.recommendationLine {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.finalLine,
.recommendationLine {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.resultMedia {
  width: 108px;
  aspect-ratio: 4 / 5;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: var(--soft);
}

.resultMedia img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.placeholderMedia {
  border: 1px solid var(--line);
}

.lineContent {
  min-width: 0;
}

.agentLine.running .lineHead span,
.agentLine.queued .lineHead span {
  color: var(--muted);
}

.agentLine.error .lineHead span,
.errorText {
  color: var(--error);
}

.recommendationList {
  margin-top: 8px;
}

.recommendationLine p,
.finalLine p,
.agentLine p {
  margin: 7px 0 0;
}

.resultActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.searchButton {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.evidenceLines {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.evidenceLines li {
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.evidenceLines a {
  color: var(--ink);
  font-weight: 850;
}

.evidenceLines p,
.mutedText {
  margin: 4px 0 0;
  line-height: 1.45;
}

.selectorReasons {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.selectorReasons li {
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.selectorReasons p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 760px) {
  .recommendLayout {
    grid-template-columns: 116px minmax(0, 1fr);
  }

  .recommendLayout.sidebarOpen {
    grid-template-columns: 116px minmax(0, 1fr);
  }

  .historySidebar {
    position: sticky;
    height: 100vh;
    max-height: none;
    padding: 10px 7px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .recommendHeader {
    position: static;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .headerActions {
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
    order: 2;
    flex-wrap: wrap;
    justify-content: flex-start;
    overflow: visible;
  }

  .headerStats,
  .headerLinks {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    overflow: visible;
    white-space: normal;
  }

  .headerStats span,
  .headerLink {
    min-height: 32px;
    padding: 0 10px;
    font-size: 11px;
  }

  .headerStats strong {
    font-size: 13px;
  }

  .headerStats {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 6px;
  }

  .emptyRecommendState {
    align-content: start;
    justify-items: stretch;
    min-height: auto;
    text-align: left;
  }

  .emptyRecommendState p {
    margin-left: 0;
    margin-right: 0;
  }

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

  .conversation {
    padding: 28px 20px 150px 12px;
  }

  .modeControl {
    display: grid;
    gap: 4px;
  }

  .modeControl small {
    white-space: normal;
  }

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

  .recommendButton {
    width: 100%;
  }

  .appHeader {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .brandMark {
    flex: 1 1 auto;
  }

  .headerSearch {
    flex: 1 1 100%;
    order: 3;
  }

  .headerStats {
    flex: 1 1 100%;
    order: 4;
    overflow-x: auto;
  }

  .headerLink {
    flex: 0 0 auto;
  }

  .headerLinks {
    flex: 1 1 100%;
    order: 5;
    justify-content: flex-start;
    overflow-x: auto;
  }

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

  .finalLine,
  .recommendationLine {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
  }

  .resultMedia {
    width: 82px;
  }

  .runStatus {
    display: grid;
  }
}
