@font-face {
  font-family: Roboto;
  src: url("/static/fonts/roboto-400.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Roboto;
  src: url("/static/fonts/roboto-500.woff") format("woff");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: Roboto;
  src: url("/static/fonts/roboto-700.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}
:root {
  --blue: #126aee;
  --dark: #1b3388;
  --light: #79bbff;
  --bg: #f9f9f9;
  --text: #222;
  --muted: #555;
  --border: #b5bdc8;
  --white: #fff;
  --soft: #e5effe;
  --error: #a51621;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --vh: 100dvh;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font:
    16px/1.5 Roboto,
    Arial,
    sans-serif;
  color: var(--text);
  background: var(--bg);
}
::selection {
  color: var(--white);
  background: var(--dark);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  padding: 10px 14px;
  min-height: 46px;
  line-height: 1.35;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 140ms var(--ease-out);
}
button:active {
  transform: scale(0.98);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
button[aria-pressed="true"] {
  color: var(--dark);
  background: var(--soft);
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
button.primary,
.primary {
  color: var(--white);
  background: var(--blue);
  border: 1px solid var(--blue);
  min-height: 52px;
  font-weight: 500;
}
.secondary {
  color: var(--dark);
  background: var(--white);
}
a {
  color: var(--dark);
  text-underline-offset: 4px;
}
h1,
h2,
h3 {
  font-weight: 700;
}
h1 {
  font-size: 28px;
  line-height: 1.14;
  letter-spacing: -0.02em;
  margin: 20px 0 8px;
}
h2 {
  font-size: 22px;
  line-height: 1.25;
  margin: 16px 0 8px;
}
h3 {
  font-size: 18px;
  line-height: 1.3;
}
p {
  margin: 8px 0;
}
.hint,
.muted {
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.hint {
  margin: 0 0 16px;
}
.shell {
  max-width: 680px;
  margin: auto;
  height: var(--vh);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
}
.top {
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.top button {
  border: 0;
  background: transparent;
  padding: 6px 0;
}
.top .progress-label {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.logo {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
}
.menu-button {
  width: 44px;
  display: grid;
  place-content: center;
  gap: 5px;
}
.menu-button::before,
.menu-button::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--dark);
}
.back-button {
  color: var(--dark);
}
.progress {
  height: 3px;
  width: 100%;
  flex-shrink: 0;
  background: var(--soft);
  overflow: hidden;
}
.progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--blue);
  transform-origin: left;
  transition: transform 260ms var(--ease-out);
}
.body {
  flex: 0 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  padding: 0 2px 24px;
}
.screen-heading {
  margin-bottom: 18px;
}
.screen-heading .hint {
  max-width: 52ch;
  margin-bottom: 0;
}
.footer {
  flex-shrink: 0;
  padding: 12px 0 max(16px, env(safe-area-inset-bottom));
  background: var(--bg);
}
.footer > .primary {
  width: 100%;
}
.field {
  margin: 0 0 20px;
  border: 0;
  padding: 0;
  min-width: 0;
}
.field > legend,
.field > label {
  display: block;
  margin-bottom: 10px;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 500;
}
.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.choices.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.choices.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.choices.one {
  grid-template-columns: 1fr;
}
.choices button {
  padding: 10px 8px;
  font-size: 14px;
  overflow-wrap: normal;
}
.choices.one button {
  font-size: 16px;
  text-align: left;
  min-height: 52px;
}
.source {
  font-size: 12px;
  color: var(--dark);
  margin: 3px 0 8px;
}
.input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  padding: 10px 12px;
  min-height: 46px;
  max-width: 100%;
  width: 100%;
  caret-color: var(--blue);
}
textarea {
  min-height: 90px;
  resize: vertical;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.row > * {
  flex: 1;
}
.link-button {
  border: 0;
  background: transparent;
  color: var(--dark);
  text-align: left;
  padding: 6px 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  min-height: 44px;
}
.body > .link-button {
  display: block;
  margin: 2px 0 8px;
}
.reply,
.answer-feedback {
  font-size: 14px;
  line-height: 1.4;
  color: var(--dark);
}
.answer-feedback {
  margin: 8px 0 0;
  animation: reply-in 180ms var(--ease-out);
}
.just-selected {
  animation: selection-in 160ms var(--ease-out);
}
.summary-lines {
  min-width: 0;
  grid-column: 1 / -1;
  padding: 8px 0 6px;
}
.summary-lines[hidden] {
  display: none;
}
.understood-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 16px;
}
.understood-chips {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 4px;
}
.understood-chip {
  display: inline-flex;
  background: var(--soft);
  color: var(--dark);
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 13px;
  line-height: 20px;
}
.understood-chip.is-new {
  animation: chip-in 220ms var(--ease-out);
}
.halfway {
  color: var(--dark);
  font-size: 14px;
  font-weight: 500;
  margin: -6px 0 18px;
  animation: reply-in 200ms var(--ease-out);
}
.saved-status {
  font-size: 11px;
  color: var(--muted);
  min-height: 16px;
  flex-shrink: 0;
}
.ready-slot {
  flex-shrink: 0;
}
.ready {
  width: 100%;
  margin: 10px 0 0;
  background: var(--dark);
  color: var(--white);
  border: 0;
  text-align: left;
  font-size: 14px;
  min-height: 44px;
  animation: reply-in 220ms var(--ease-out);
}
.feed-screen .body {
  flex: 1;
}
.feed-screen .screen-heading {
  margin-bottom: 12px;
}
.feed-screen h1 {
  font-size: 25px;
  margin-top: 16px;
}
.feed-layout {
  position: relative;
  display: grid;
  gap: 12px;
}
.image-button {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  touch-action: pan-y;
}
.feed-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 12px;
  background: var(--soft);
}
.feed-controls {
  min-width: 0;
}
.feed-counter {
  font-size: 13px;
  color: var(--dark);
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.feed-name {
  font-size: 20px;
  margin: 4px 0 14px;
}
.reaction-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.reaction-buttons button {
  min-height: 54px;
  padding: 8px;
  font-size: 13px;
}
.feed-feedback {
  color: var(--dark);
  font-size: 14px;
  min-height: 20px;
  margin: 10px 0 2px;
}
.feed-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
  align-items: center;
}
.feed-actions button {
  font-size: 13px;
}
.swipe-hint {
  color: var(--muted);
  font-size: 12px;
  margin: 2px 0;
}
.feed-screen .footer {
  padding-top: 8px;
}
.feed-screen .summary-lines {
  padding-top: 6px;
}
.error {
  color: var(--error);
  font-size: 14px;
}
.tag {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.card {
  padding: 16px;
  margin: 12px 0;
}
.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.sheet-header h2 {
  margin: 4px 0 16px;
}
.sheet-header button {
  border: 0;
  background: transparent;
  font-size: 26px;
}
dialog {
  border: 0;
  padding: 20px 16px;
  width: min(640px, 100%);
  max-width: 100%;
  max-height: 94dvh;
  border-radius: 16px 16px 0 0;
  position: fixed;
  top: auto;
  bottom: 0;
  margin: 0 auto;
  background: var(--bg);
  color: var(--text);
  overflow: auto;
  scrollbar-width: thin;
}
dialog::backdrop {
  background: #0007;
}
.sheet-actions {
  position: sticky;
  bottom: -20px;
  padding: 12px 0 16px;
  background: var(--bg);
}
.sheet-actions button {
  width: 100%;
}
.image-layout {
  display: grid;
  gap: 16px;
}
.image-visual {
  margin: 0;
}
.image-view {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}
.image-visual figcaption {
  margin-top: 8px;
}
.image-decisions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0 18px;
}
.image-hint {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 500;
  margin: 0;
}
.image-controls .link-button {
  display: block;
  margin: 8px 0;
}
.image-controls .row {
  margin-top: 18px;
}
.image-large {
  width: 100%;
  max-height: 75dvh;
  object-fit: contain;
}
.tabs {
  display: flex;
  gap: 4px;
}
.tabs button {
  flex: 1;
}
.edit-choices {
  margin: 16px 0;
}
.upload-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}
.upload-card img {
  width: 72px;
  height: 90px;
  object-fit: contain;
  flex-shrink: 0;
}
.upload-card a {
  overflow-wrap: anywhere;
  min-width: 0;
}
.upload-card button {
  font-size: 14px;
}
.wait-collage {
  display: flex;
  overflow: hidden;
  height: 180px;
  gap: 8px;
  margin: 20px 0;
}
.wait-collage img {
  max-width: 32%;
  object-fit: cover;
}
.detail-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.detail-nav button {
  font-size: 14px;
}
.result-screen .body {
  flex: 1;
}
.result-layout {
  display: grid;
  gap: 24px;
}
.result-image-button {
  padding: 0;
  border: 0;
  background: transparent;
  width: 100%;
}
.result-image {
  display: block;
  width: 100%;
  border-radius: 12px;
}
.result-placeholder {
  padding: 28px;
  background: var(--soft);
  border-radius: 12px;
}
.result-details {
  min-width: 0;
}
.result-facts {
  margin: 0 0 24px;
}
.result-facts > div {
  margin-bottom: 18px;
}
.result-facts dt {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}
.result-facts dd {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
}
.matching-button {
  width: 100%;
}
.matching-note {
  margin: 8px 0 22px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.matching-confirmed {
  padding: 16px;
  color: var(--dark);
  background: var(--soft);
}
.summary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.summary-actions button {
  font-size: 14px;
}
.summary-footer:empty {
  display: none;
}
.result-screen .summary-lines {
  display: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.hidden {
  display: none !important;
}
.no-script {
  padding: 24px;
}
.deadline {
  color: var(--error);
}
h1:focus,
h2:focus {
  outline: none;
}
@keyframes chip-in {
  from {
    opacity: 0.3;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes reply-in {
  from {
    opacity: 0.3;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes selection-in {
  from {
    transform: scale(0.98);
  }
  to {
    transform: scale(1);
  }
}
@media (min-width: 900px) {
  body {
    font-size: 18px;
  }
  .shell {
    max-width: 880px;
    padding: 28px 24px 0;
  }
  .top {
    height: 54px;
  }
  h1 {
    font-size: 36px;
    line-height: 1.1;
    margin-top: 30px;
  }
  .screen-heading {
    margin-bottom: 30px;
    grid-column: 1 / -1;
  }
  .screen-heading .hint {
    font-size: 17px;
    line-height: 1.5;
  }
  .shell:not(.feed-screen):not(.result-screen) .body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 32px;
    align-content: start;
    align-items: start;
  }
  .halfway {
    grid-column: 1 / -1;
  }
  .field {
    margin-bottom: 28px;
  }
  .field > legend {
    font-size: 17px;
    margin-bottom: 12px;
  }
  .choices.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .input {
    font-size: 18px;
  }
  .choices button {
    min-height: 52px;
    padding: 12px;
    font-size: 17px;
  }
  .footer {
    max-width: none;
    width: 100%;
    padding-top: 18px;
  }
  .summary-lines {
    margin-top: 8px;
  }
  .feed-screen,
  .result-screen {
    max-width: 1180px;
  }
  .feed-layout {
    grid-template-columns: minmax(360px, 560px) minmax(0, 1fr);
    gap: 40px;
  }
  .feed-screen .screen-heading {
    margin-bottom: 20px;
  }
  .feed-screen h1 {
    font-size: 36px;
    margin-top: 24px;
  }
  .feed-controls {
    align-self: center;
    padding-right: 24px;
  }
  .feed-counter {
    font-size: 15px;
  }
  .feed-name {
    font-size: 30px;
    line-height: 1.2;
    margin: 10px 0 26px;
  }
  .reaction-buttons {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .reaction-buttons button {
    font-size: 17px;
    text-align: left;
    padding: 14px 20px;
  }
  .feed-feedback {
    margin-top: 20px;
    min-height: 42px;
    font-size: 16px;
  }
  .feed-actions {
    margin-top: 12px;
  }
  .swipe-hint {
    display: none;
  }
  .feed-screen .footer {
    align-self: flex-end;
    max-width: calc(100% - 600px);
  }
  .feed-screen .summary-lines {
    padding-top: 6px;
  }
  dialog {
    border-radius: 16px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
  .image-sheet {
    width: min(1180px, 96vw);
    padding: 24px;
  }
  .image-layout {
    grid-template-columns: minmax(300px, 560px) minmax(0, 1fr);
    gap: 36px;
  }
  .image-view {
    max-height: 72vh;
    object-fit: contain;
    object-position: left top;
  }
  .image-controls {
    align-self: center;
    padding: 0 12px;
  }
  .image-hint {
    font-size: 28px;
  }
  .image-decisions {
    margin: 24px 0;
  }
  .result-layout {
    grid-template-columns: minmax(320px, 480px) minmax(0, 1fr);
    gap: 48px;
  }
  .result-image {
    max-height: 650px;
    object-fit: contain;
    object-position: top;
  }
  .result-image-button {
    align-self: start;
  }
  .result-details {
    padding: 4px 0 24px;
  }
  .result-facts dd {
    font-size: 18px;
  }
  .result-facts > div {
    margin-bottom: 22px;
  }
}
@media (max-width: 359px) {
  .choices.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .shell {
    padding: 0 12px;
  }
  h1 {
    font-size: 25px;
  }
}
@media (hover: hover) and (pointer: fine) {
  button:hover {
    border-color: var(--blue);
  }
  button.primary:hover {
    background: var(--dark);
    border-color: var(--dark);
  }
  .link-button:hover {
    color: var(--blue);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
body.no-motion * {
  animation: none !important;
  transition: none !important;
}

@media (max-width: 899px) {
  [data-field="new_home_feeling"] .choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .feed-counter {
    position: absolute;
    top: 12px;
    left: 12px;
    color: var(--dark);
    background: var(--white);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
  }
}

.header-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  column-gap: 12px;
  min-width: 0;
}
.header-status .saved-status {
  max-width: 170px;
  text-align: center;
  line-height: 1.3;
}
@media (max-width: 899px) {
  .result-image {
    max-height: 45dvh;
    object-fit: contain;
    object-position: center;
  }
  .summary-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: 12px 0 max(12px, env(safe-area-inset-bottom));
  }
  .summary-footer .matching-note {
    margin: 6px 0 0;
  }
  .summary-footer .matching-confirmed {
    margin: 0;
  }
}

.dislike-divider {
  flex: 0 0 auto;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}
.apartment-line {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}
