/* The same question form is used on the home screen and in active research. */
body:not([data-screen='start'])
  :is(#homeIntro, #homeCases, #walkthrough, #attachStart, #startFiles, .start-send-label),
body:not([data-screen='build']) #buildHost,
body:not([data-screen='case']) #caseSummary,
body[data-screen='start']
  :is(
    .project-bar,
    .tabbar,
    #graphSpace,
    #recordSpace,
    .compose-heading,
    .composer-options,
    .workspace-send-label
  ),
body[data-screen='build'] :is(.tabbar, #graphSpace, #recordSpace, .compose-zone, #newSession),
#caseSummary:empty,
#startFiles:empty {
  display: none;
}

body[data-screen] {
  min-height: 100vh;
  min-height: 100svh;
}
body[data-screen='start'] .studio > :not(#homeIntro, .compose-zone, #homeCases),
body[data-screen='build'] .studio > :not(.project-bar, #buildHost) {
  display: none;
}

.mast {
  background: #fcfdfa;
}
.header-end button {
  min-height: 40px;
  padding: 0 6px;
  border-radius: 6px;
  color: #54645c;
  font-size: 14px;
}
.header-end button:hover,
.drawer-actions button:hover {
  background: #edf2ed;
}
.drawer-actions {
  display: grid;
  gap: 2px;
}
.drawer-actions button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 7px 8px;
  border-radius: 6px;
  text-align: left;
  color: #4b5e55;
  --icon: 16px;
}
body[data-screen='start'] {
  background: #fafbf8;
}
body[data-screen='start'] .studio {
  width: min(760px, calc(100% - 48px));
  min-height: calc(100vh - 62px);
  min-height: calc(100svh - 62px);
  margin-inline: auto;
  padding: clamp(44px, 8vh, 84px) 0 clamp(88px, 21vh, 205px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#homeIntro {
  text-align: center;
  margin-bottom: clamp(27px, 3.5vh, 39px);
}
#homeTitle {
  margin: 0;
  font-family: 'Songti SC', 'STSong', 'Noto Serif CJK SC', 'Source Han Serif SC', serif;
  font-size: clamp(40px, 4.2vw, 60px);
  font-weight: 630;
  line-height: 1.32;
  letter-spacing: 0.015em;
  color: #173a30;
}
#homeIntro .intro-phrase {
  display: inline-block;
}
#homeIntro p {
  margin: 16px 0 0;
  color: #626e65;
  font-size: 16px;
  line-height: 1.8;
  text-wrap: balance;
}
body[data-screen='start'] .compose-zone {
  border: 1px solid #cdd6cb;
  border-radius: 17px;
  margin: 0;
  padding: 21px 20px 16px;
  background: white;
  box-shadow:
    0 2px 4px #29453706,
    0 8px 30px #2d4b3608;
}
body[data-screen='start'] .compose-zone:focus-within {
  border-color: #88a99b;
  box-shadow:
    0 0 0 3px #1f725111,
    0 5px 20px #2d4b3609;
}
body[data-screen='start'] #composer:focus-within {
  box-shadow: none;
}
body[data-screen='start'] #prompt {
  display: block;
  width: 100%;
  min-height: 70px;
  height: 70px;
  max-height: 26vh;
  padding: 0 2px;
  resize: none;
  color: #1d3229;
  font-size: 17px;
  line-height: 1.7;
}
body[data-screen='start'] #prompt::placeholder {
  color: #879189;
}
body[data-screen='start'] .composer-tools {
  gap: 14px;
  margin-top: 12px;
  justify-content: space-between;
}
#attachStart,
#walkthrough {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 7px;
  color: #587064;
  font-size: 14px;
  font-weight: 490;
  --icon: 16px;
}
#attachStart {
  min-height: 38px;
  padding: 0 9px;
  margin-left: -4px;
}
#walkthrough {
  align-self: center;
  margin-top: 18px;
  min-height: 42px;
  padding: 0 11px;
  color: #5d6d61;
}
#attachStart:hover,
#walkthrough:hover {
  color: #145247;
  background: #edf3ec;
}
#startFiles {
  margin: 9px 0 5px;
  color: #426050;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.5;
  font-size: 13px;
  overflow-wrap: anywhere;
}
#startFiles > :is(span, button) {
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 5px;
  background: #eff4ee;
}
body[data-screen='start'] #send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 40px;
  padding: 0 19px;
  background: #135c50;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 590;
  color: #fff;
}
body[data-screen='start'] #send:hover:not(:disabled),
.build-primary:hover:not(:disabled) {
  background: #0c493f;
}
body[data-screen='start'] #send i {
  display: none;
}
.workspace-send-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.composer-options,
.graph-options {
  position: relative;
}
.composer-options summary,
.graph-options summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 5px 8px;
  color: #607067;
  border: 1px solid #d7ded4;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  --icon: 14px;
}
.composer-options summary::-webkit-details-marker,
.graph-options summary::-webkit-details-marker {
  display: none;
}
.composer-options summary:focus-visible,
.graph-options summary:focus-visible {
  outline: 2px solid #49826e;
  outline-offset: 2px;
}
.composer-panel,
.graph-options > div {
  position: absolute;
  z-index: 8;
  padding: 9px;
  border: 1px solid #ced9d0;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 5px 20px #12322216;
}
.composer-panel {
  bottom: calc(100% + 5px);
  left: 0;
  display: grid;
  gap: 5px;
}
.composer-panel #settingsMenu {
  top: auto;
  bottom: calc(100% + 6px);
  left: 0;
  right: auto;
}
.graph-options > div {
  top: calc(100% + 4px);
  right: 0;
  white-space: nowrap;
}
.graph-options #graphTools {
  margin: 0;
  padding: 8px 9px;
}
body[data-screen='build'] {
  background: #f8faf6;
}
body[data-screen='build'] .studio {
  width: min(920px, 100%);
  padding: 0 clamp(16px, 4vw, 48px) 50px;
}
body[data-screen='build'] .project-bar {
  align-items: center;
  padding: clamp(28px, 6vh, 66px) 0 16px;
}
body[data-screen='build'] .crumb {
  display: none;
}
body[data-screen='build'] #projectTitle {
  margin: 0;
  color: #1d372c;
  font-size: clamp(26px, 3vw, 36px);
  overflow-wrap: anywhere;
}
#buildHost {
  min-width: 0;
}
.build-stepper {
  list-style: none;
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin: 8px 0 18px;
  padding: 0;
}
.build-stepper > * {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 8px 2px 10px;
  border-bottom: 2px solid #dce3d9;
  color: #758177;
  line-height: 1.4;
  text-align: left;
  font-size: 14px;
}
.build-stepper > :is([aria-current='step'], .active, .current) {
  border-color: #277465;
  color: #1d6253;
  font-weight: 620;
}
.build-stepper .done {
  border-color: #a1b9a5;
  color: #546c57;
}
.build-card,
.case-overview {
  border: 1px solid #d8e1d6;
  border-radius: 12px;
  background: #fff;
  color: #263c2e;
  overflow-wrap: anywhere;
}
.build-card {
  padding: clamp(20px, 4.5vw, 38px);
}
.build-card :is(h2, h3),
.case-overview :is(h2, h3) {
  font-weight: 620;
  line-height: 1.45;
  color: #253e31;
  margin: 0 0 10px;
}
.build-card h2 {
  font-size: clamp(21px, 2vw, 26px);
}
.build-card h3,
.case-overview h3 {
  font-size: 17px;
}
.build-card p,
.case-overview p,
.build-note {
  line-height: 1.7;
}
.build-card > p {
  margin: 6px 0 16px;
}
.build-field {
  display: block;
  margin: 16px 0 0;
  font-size: 15px;
  color: #394b3f;
}
.build-field > :is(span, strong, label) {
  display: block;
  margin-bottom: 5px;
}
#buildHost :is(textarea, input:not([type='checkbox']):not([type='radio']), select) {
  border: 1px solid #cad7cd;
  border-radius: 7px;
  padding: 9px 11px;
  width: 100%;
  max-width: 100%;
  background: #fdfefc;
  color: #24392b;
  font: inherit;
  line-height: 1.65;
}
#buildHost textarea {
  resize: vertical;
  min-height: 90px;
}
#buildHost :is(textarea, input, select):focus-visible {
  outline: 2px solid #76a391;
  outline-offset: 2px;
}
.build-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 25px;
}
.build-actions button,
.build-primary,
.build-back {
  min-height: 39px;
  padding: 8px 15px;
  border: 1px solid #cedace;
  border-radius: 7px;
  background: white;
  color: #344f40;
  font-size: 14px;
}
.build-actions .build-primary,
.build-primary {
  background: #145e50;
  color: white;
  border-color: #145e50;
}
.build-note {
  margin: 10px 0;
  color: #617367;
  font-size: 14px;
}
.case-overview {
  padding: 16px clamp(17px, 2vw, 27px);
  margin: 8px 0 14px;
  background: #fcfefa;
}
.case-overview :is(ol, ul),
.build-card :is(ol, ul) {
  padding-left: 1.6em;
  line-height: 1.65;
}
.case-overview h2 {
  font-size: 19px;
}
@media (max-width: 720px) {
  .header-end button span {
    display: inline;
  }
  .mast {
    padding-inline: 16px;
  }
  body[data-screen='start'] .studio {
    width: min(600px, calc(100% - 36px));
    min-height: calc(100svh - 53px);
    padding: clamp(38px, 7vh, 75px) 0 clamp(65px, 18vh, 130px);
  }
  #homeIntro {
    margin-bottom: 24px;
  }
  #homeTitle {
    font-size: clamp(35px, 7.4vw, 48px);
  }
  #homeIntro p {
    max-width: 28em;
    margin: 11px auto 0;
    font-size: 15px;
  }
  body[data-screen='start'] .compose-zone {
    padding: 16px 15px 12px;
    border-radius: 13px;
  }
  body[data-screen='start'] #prompt {
    font-size: 16px;
    min-height: 80px;
  }
  #attachStart,
  #walkthrough,
  body[data-screen='start'] #send {
    min-height: 44px;
  }
  #walkthrough {
    margin-top: 10px;
  }
  body[data-screen='build'] .project-bar {
    display: block;
    padding-top: 24px;
  }
  body[data-screen='build'] .project-actions {
    margin-top: 10px;
  }
  body[data-screen='build'] .project-actions .file-toggle {
    font-size: 13px;
  }
  .build-stepper {
    gap: 4px;
  }
  .build-stepper > * {
    font-size: 13px;
  }
  .build-actions button {
    min-height: 43px;
  }
  .build-actions {
    row-gap: 8px;
  }
}
@media (max-height: 580px) and (orientation: landscape) {
  body[data-screen='start'] .studio {
    padding-block: 28px;
  }
}
.studio #caseSummary.case-overview {
  padding: 12px 16px;
  background: #fbfcf8;
}
.case-orientation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
}
.case-orientation p {
  font-size: 14px;
  line-height: 1.65;
  color: #43564b;
  margin: 0;
}
.case-orientation .build-back {
  white-space: nowrap;
  min-height: auto;
}
.graph-options [data-case-export] {
  text-align: left;
  width: 100%;
  margin: 0;
  white-space: nowrap;
  border: 0;
}
@media (max-width: 640px) {
  .studio #caseSummary.case-overview {
    padding: 9px;
  }
  .case-orientation {
    align-items: flex-start;
  }
  .case-orientation p {
    font-size: 13px;
  }
}
body:is([data-screen='case'], [data-screen='chat']) #workHome {
  display: none;
}
.build-routes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.route-choice {
  background: #fff;
  color: #32473e;
  border: 1px solid #bac8bf;
  border-radius: 100px;
  padding: 8px 16px;
  font: inherit;
  cursor: pointer;
}
.route-choice[aria-pressed='true'] {
  background: #e7f2eb;
  border-color: #47765f;
  color: #174c36;
  box-shadow: inset 0 0 0 1px #47765f;
}
.build-primary:disabled {
  opacity: 0.56;
  cursor: wait;
}
.case-orientation .next-observation {
  margin-top: 5px;
  color: #25624b;
}
@media (max-width: 640px) {
  .case-orientation:has(.build-back) {
    flex-wrap: wrap;
  }
}

#homeCases { display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:0 12px; margin-top:14px; }
#homeCases #walkthrough {margin-top:0;}
#homeCases a {padding:10px; color:#245e50; font-size:14px; text-underline-offset:4px;}
