:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --ink: #202124;
  --muted: #686f76;
  --panel: #ffffff;
  --line: #d9ded8;
  --brand: #d7373f;
  --brand-dark: #a8202a;
  --mint: #dff1e8;
  --sky: #dcebf7;
  --gold: #f3df9e;
  --shadow: 0 18px 40px rgba(42, 47, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(130deg, rgba(223, 241, 232, 0.95), rgba(246, 247, 243, 0.8) 38%),
    linear-gradient(25deg, rgba(243, 223, 158, 0.65), rgba(220, 235, 247, 0.7));
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 18px 14px 92px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 128px;
  align-items: center;
  gap: 16px;
  min-height: 210px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 11vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.lead {
  max-width: 34rem;
  margin-bottom: 0;
  color: #3f464c;
  line-height: 1.7;
}

.phone-preview {
  display: flex;
  justify-content: center;
}

.preview-card {
  width: 112px;
  min-height: 166px;
  padding: 12px;
  border: 6px solid #2b2f33;
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.preview-top,
.preview-button,
.preview-line {
  border-radius: 6px;
}

.preview-top {
  height: 50px;
  margin-bottom: 13px;
  background: linear-gradient(135deg, var(--brand), #f0826c);
}

.preview-line {
  width: 78%;
  height: 8px;
  margin-bottom: 9px;
  background: #cfd7dc;
}

.preview-line.wide {
  width: 100%;
}

.preview-line.short {
  width: 56%;
}

.preview-button {
  width: 68px;
  height: 24px;
  margin-top: 16px;
  background: var(--brand);
}

.notice,
.tabs,
.tab-panel,
.result-area {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(42, 47, 51, 0.08);
}

.notice {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.6;
}

.notice strong {
  color: var(--brand-dark);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  position: fixed;
  right: 14px;
  bottom: 12px;
  left: 14px;
  z-index: 10;
  width: min(calc(100% - 28px), 732px);
  margin: 0 auto;
  padding: 5px;
  border-radius: 8px;
  backdrop-filter: blur(16px);
}

.tab-button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab-button.active {
  background: var(--ink);
  color: #ffffff;
}

.tab-panel {
  display: none;
  padding: 14px;
  border-radius: 8px;
}

.tab-panel.active {
  display: block;
}

.form-grid {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: #343a40;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cbd3d1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  min-height: 118px;
  resize: vertical;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(215, 55, 63, 0.13);
}

.toggle-row {
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.length-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.length-picker legend {
  grid-column: 1 / -1;
  margin-bottom: 7px;
  color: #343a40;
  font-weight: 750;
}

.length-picker label {
  display: block;
  min-height: 46px;
}

.length-picker input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
  pointer-events: none;
}

.length-picker span {
  display: grid;
  place-items: center;
  min-height: 46px;
  border: 1px solid #cbd3d1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 850;
}

.length-picker input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.length-picker input:focus-visible + span {
  box-shadow: 0 0 0 4px rgba(215, 55, 63, 0.13);
}

.toggle-row input,
.checklist input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--brand);
}

.primary-action,
.secondary-action,
.quiet-action,
.icon-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  font-weight: 850;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-action {
  background: var(--brand);
  color: #ffffff;
}

.secondary-action {
  flex: 1;
  background: var(--ink);
  color: #ffffff;
  padding: 0 14px;
}

.quiet-action,
.icon-button {
  background: #eef1ed;
  color: var(--ink);
}

.result-area {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.result-header h2,
.checklist h2,
.memo-tools h2 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

.icon-button {
  width: 48px;
  padding: 0;
}

.action-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.quiet-action {
  min-width: 96px;
}

.checklist,
.memo-tools {
  display: grid;
  gap: 14px;
}

.checklist label {
  grid-template-columns: 22px 1fr;
  align-items: start;
  min-height: 42px;
  padding: 10px 0;
  border-bottom: 1px solid #edf0ed;
  font-weight: 700;
  line-height: 1.5;
}

.fee-text {
  margin-bottom: 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--sky);
  color: #23313d;
  line-height: 1.6;
}

.price-guide {
  display: grid;
  gap: 13px;
  padding: 13px;
  border: 1px solid #cbd3d1;
  border-radius: 8px;
  background: #f8faf7;
}

.section-heading,
.market-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2,
.market-check h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.section-heading p,
.market-check p,
.helper-note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.6;
}

.estimate-result,
.sold-range-result {
  padding: 12px;
  border-radius: 8px;
  background: var(--mint);
  color: #263b31;
  font-weight: 750;
  line-height: 1.7;
}

.sold-range-result {
  background: var(--sky);
  color: #23313d;
}

.small-action {
  flex: 0 0 auto;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  padding: 0 13px;
  font-weight: 850;
}

.small-action.dark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--ink);
}

.sold-price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sold-price-grid input {
  min-height: 44px;
}

.photo-list {
  padding: 12px;
  border-radius: 8px;
  background: var(--mint);
}

.photo-list h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.photo-list ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.8;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  width: min(calc(100% - 28px), 460px);
  min-height: 44px;
  transform: translateX(-50%) translateY(90px);
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  display: grid;
  place-items: center;
  padding: 10px 14px;
  text-align: center;
  opacity: 0;
  transition: 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.icon-pencil,
.icon-copy,
.icon-search {
  display: inline-block;
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: var(--icon) center / contain no-repeat;
}

.icon-pencil {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E");
}

.icon-copy {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E");
}

.icon-search {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
}

@media (min-width: 680px) {
  .app-shell {
    padding-top: 28px;
  }

  .form-grid,
  .memo-tools {
    grid-template-columns: repeat(2, 1fr);
  }

  .full,
  .result-area,
  .checklist,
  .memo-tools h2,
  .fee-text,
  .photo-list {
    grid-column: 1 / -1;
  }

  .hero {
    grid-template-columns: 1fr 180px;
  }

  .preview-card {
    width: 138px;
    min-height: 202px;
  }
}

@media (max-width: 390px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .phone-preview {
    display: none;
  }

  .action-row {
    flex-direction: column;
  }

  .quiet-action {
    width: 100%;
  }

  .section-heading,
  .market-check {
    display: grid;
  }

  .small-action {
    width: 100%;
  }

  .sold-price-grid {
    grid-template-columns: 1fr;
  }
}
