@charset "UTF-8";
:root {
  --paper:#f7f6f0;
  --card:#fffefa;
  --ink:#203d31;
  --muted:#6e786d;
  --green:#214c3d;
  --sage:#e8ede2;
  --border:#dce1d5;
  --accent:#a58458;
  --error:#8f3931;
  --error-bg:#fcf0e9;
  --radius:20px;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  color:var(--ink);
  background:var(--paper);
  font-synthesis:none;
  line-height:1.6;
  font-weight:400
}

* {
  box-sizing:border-box
}

body {
  margin:0;
  padding-bottom:calc(95px + env(safe-area-inset-bottom))
}

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

button,a,input,select,textarea {
  -webkit-tap-highlight-color:transparent
}

a {
  color:var(--green);
  text-decoration:none
}

button {
  cursor:pointer
}

button:disabled {
  opacity:.55;
  cursor:wait
}

button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible {
  outline:3px solid #b69461;
  outline-offset:3px
}

button,input,select {
  min-height:46px
}

input,select,textarea {
  width:100%;
  min-width:0;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fffefa;
  color:var(--ink);
  padding:11px 13px;
  font-size:16px
}

textarea {
  min-height:108px;
  resize:vertical
}

input[type=checkbox] {
  width:22px;
  min-height:22px;
  height:22px;
  accent-color:var(--green);
  flex-shrink:0
}

input[type=file] {
  width:1px;
  height:1px;
  opacity:0;
  position:absolute;
  overflow:hidden;
  padding:0;
  border:0
}

button {
  border:0;
  border-radius:12px;
  padding:10px 17px;
  color:var(--green);
  background:var(--sage);
  font-weight:600
}

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

h1 {
  font-size:28px;
  line-height:1.3;
  letter-spacing:-.5px;
  margin-bottom:10px
}

h2 {
  font-size:21px;
  line-height:1.4;
  letter-spacing:-.3px;
  margin-bottom:12px
}

h1,h2,h3 {
  overflow-wrap:anywhere
}

h3 {
  font-size:17px;
  line-height:1.5;
  margin-bottom:8px
}

p {
  margin-bottom:12px
}

small,.small {
  font-size:12px
}

svg {
  width:22px;
  height:22px;
  display:block;
  stroke:currentColor;
  stroke-width:1.6;
  stroke-linecap:round;
  stroke-linejoin:round
}

.site-header {
  max-width:860px;
  margin:auto;
  padding:24px 24px 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px
}

.brand {
  display:flex;
  align-items:center;
  gap:12px;
  font-size:20px;
  font-weight:650;
  letter-spacing:.3px
}

.brand small {
  display:block;
  font-size:10px;
  font-weight:400;
  letter-spacing:1px;
  color:var(--muted);
  margin-top:2px
}

.brand-mark {
  width:43px;
  height:43px;
  border-radius:14px;
  background:var(--green);
  color:#faf9ef;
  display:grid;
  place-items:center
}

.brand-mark svg {
  width:27px;
  height:27px
}

.quiet-button {
  background:transparent;
  padding:10px 7px;
  font-size:13px;
  font-weight:500
}

.page-footer {
  max-width:820px;
  margin:25px auto 10px;
  padding:0 24px;
  font-size:11px;
  line-height:1.7;
  color:var(--muted);
  display:flex;
  justify-content:space-between;
  gap:12px
}

.page-footer details {
  max-width:340px;
  text-align:right
}

.page-footer summary {
  cursor:pointer;
  min-height:44px
}

.page-footer p {
  margin:5px 0 0
}

#app {
  max-width:820px;
  margin:0 auto;
  padding:0 24px
}

.page-title {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:15px;
  margin:22px 0
}

.eyebrow {
  font-size:10px;
  letter-spacing:2px;
  color:var(--accent);
  font-weight:600;
  text-transform:uppercase;
  margin:0 0 10px
}

.lead {
  color:var(--muted);
  font-size:14px;
  line-height:1.8;
  margin-bottom:0
}

.primary {
  background:var(--green);
  color:#fffefa;
  min-height:48px
}

.secondary {
  background:transparent;
  border:1px solid var(--border)
}

.full-width {
  width:100%
}

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

.action-row>* {
  flex:1;
  white-space:nowrap
}

.back-link {
  display:inline-flex;
  align-items:center;
  min-height:44px;
  font-size:13px;
  gap:8px
}

.back-link:before {
  content:'←';
  font-size:20px
}

.card {
  padding:22px;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  margin-bottom:16px
}

.hero {
  background:var(--sage);
  border:0;
  padding:26px
}

.hero .eyebrow {
  color:var(--green)
}

.hero h1 {
  font-size:30px
}

.hero p {
  max-width:480px
}

.hero .action-row {
  margin-top:20px
}

.hero .action-row>* {
  flex:0 1 auto
}

.count-label {
  font-size:13px;
  color:var(--muted);
  margin-bottom:12px
}

.house-list {
  display:grid;
  gap:14px
}

.house-card {
  display:block;
  padding:23px 24px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--card);
  position:relative
}

.house-card:after {
  content:'↗';
  position:absolute;
  right:22px;
  top:22px;
  color:var(--accent);
  font-size:20px
}

.house-card h2 {
  padding-right:25px;
  font-size:20px;
  margin-bottom:6px
}

.house-card p {
  font-size:13px;
  color:var(--muted);
  margin-bottom:14px
}

.house-facts {
  display:flex;
  gap:8px;
  flex-wrap:wrap
}

.fact,.tag {
  font-size:11px;
  border-radius:7px;
  padding:4px 9px;
  background:var(--sage);
  display:inline-block;
  line-height:1.5
}

.fact {
  background:#f1f2ea;
  color:#526452
}

.house-id {
  font-size:10px;
  color:#7e887b;
  margin-top:13px;
  letter-spacing:.4px
}

.empty-card {
  border:1px dashed #c5cebf;
  background:transparent;
  text-align:center;
  padding:35px 22px;
  border-radius:var(--radius)
}

.empty-symbol {
  font-size:30px;
  display:block;
  color:var(--accent);
  margin-bottom:12px
}

.empty-card h2 {
  font-size:18px
}

.empty-card p {
  font-size:13px;
  color:var(--muted);
  margin:0 auto 18px;
  max-width:380px
}

.search {
  position:relative;
  margin:20px 0
}

.search input {
  background:var(--card);
  border-radius:14px;
  padding-left:42px
}

.search:before {
  content:'⌕';
  position:absolute;
  left:15px;
  top:5px;
  font-size:27px;
  color:var(--muted)
}

.section-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:30px 0 14px
}

.section-heading h2 {
  margin:0
}

.section-heading button {
  font-size:12px
}

.muted {
  color:var(--muted)
}

.notice,.error-box {
  font-size:13px;
  line-height:1.8;
  border-radius:12px;
  padding:13px 15px;
  margin:14px 0
}

.notice {
  background:var(--sage);
  color:#526452
}

.error-box {
  background:var(--error-bg);
  color:var(--error);
  border:1px solid #ead5c7
}

.error-box p:last-child {
  margin-bottom:0
}

.error-box button {
  margin-top:10px;
  background:#efded1;
  color:var(--error);
  font-size:13px
}

.loading-card {
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
  padding:45px 20px;
  color:var(--muted);
  font-size:14px
}

.spinner {
  display:inline-block;
  width:17px;
  height:17px;
  border:2px solid #c7d0c0;
  border-top-color:var(--green);
  border-radius:50%;
  animation:spin .8s linear infinite
}

@keyframes spin {
  to {
    transform:rotate(360deg)
  }
}

.bottom-nav {
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  z-index:10;
  background:#fffefaf5;
  border-top:1px solid var(--border);
  backdrop-filter:blur(16px);
  padding:7px max(20px,calc((100vw - 700px)/2)) calc(7px + env(safe-area-inset-bottom));
  display:flex;
  justify-content:space-around;
  gap:5px
}

.bottom-nav[hidden] {
  display:none
}

.bottom-nav a {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  min-height:56px;
  flex:1;
  border-radius:12px;
  font-size:11px;
  color:var(--muted)
}

.bottom-nav a.active {
  background:var(--sage);
  color:var(--green);
  font-weight:650
}

.bottom-nav svg {
  width:23px;
  height:23px
}

.login-layout {
  max-width:500px;
  margin:30px auto
}

.login-layout .hero {
  padding:30px;
  margin-bottom:18px
}

.login-layout .hero h1 {
  font-size:29px
}

.login-layout .card {
  padding:26px
}

.login-icon {
  border:1px solid #b9c8b0;
  width:50px;
  height:50px;
  border-radius:15px;
  display:grid;
  place-items:center;
  margin-bottom:30px
}

.login-icon svg {
  width:26px;
  height:26px
}

label.field {
  display:block;
  margin-bottom:18px
}

label.field>span,.field-label {
  display:block;
  font-size:13px;
  font-weight:550;
  margin-bottom:7px
}

label.field small {
  display:block;
  font-size:11px;
  color:var(--muted);
  font-weight:400;
  margin-top:5px
}

.form-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0 15px
}

.form-grid .wide {
  grid-column:1/-1
}

.form-hint {
  font-size:12px;
  color:var(--muted);
  margin-bottom:16px
}

.field-optional {
  font-size:11px!important;
  color:var(--muted);
  font-weight:400!important;
  display:inline!important;
  margin-left:4px
}

.submit-area {
  margin-top:26px;
  padding-top:19px;
  border-top:1px solid var(--border)
}

.submit-area p {
  font-size:11px;
  margin-top:10px;
  margin-bottom:0;
  color:var(--muted)
}

.file-picker {
  position:relative;
  border:1px dashed #bcc9b3;
  border-radius:14px;
  background:#f1f4eb;
  text-align:center;
  padding:22px 13px;
  cursor:pointer;
  display:block;
  min-height:90px;
  margin-bottom:15px
}

.file-picker>strong {
  display:block;
  font-size:15px
}

.file-picker>span {
  display:block;
  font-size:11px;
  color:var(--muted);
  margin-top:4px
}

.file-picker:focus-within {
  outline:3px solid #b69461;
  outline-offset:3px
}

.preview-list {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;
  margin:15px 0
}

.preview-item {
  position:relative;
  min-width:0
}

.preview-item img {
  width:100%;
  aspect-ratio:1;
  object-fit:cover;
  border-radius:11px;
  border:1px solid var(--border)
}

.preview-item button {
  position:absolute;
  right:4px;
  top:4px;
  width:44px;
  height:44px;
  min-height:44px;
  padding:0;
  background:#fffefae6;
  border-radius:50%;
  font-size:19px
}

.preview-item span {
  font-size:10px;
  display:block;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  margin-top:3px
}

.upload-status {
  padding:14px;
  border-radius:12px;
  background:var(--sage);
  margin:12px 0;
  font-size:13px
}

.upload-status progress {
  display:block;
  width:100%;
  height:7px;
  accent-color:var(--green);
  margin-top:9px
}

.details-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:17px
}

.details-grid dt {
  font-size:11px;
  color:var(--muted);
  margin-bottom:3px
}

.details-grid dd {
  font-size:14px;
  margin:0;
  word-break:break-word
}

.details-grid .wide {
  grid-column:1/-1
}

.house-detail-head {
  background:var(--sage);
  padding:24px;
  border-radius:var(--radius)
}

.house-detail-head h1 {
  font-size:27px
}

.house-detail-head p {
  font-size:13px;
  color:var(--muted)
}

.house-detail-head .action-row {
  margin-top:20px
}

.filter-row {
  display:flex;
  gap:7px;
  overflow-x:auto;
  padding-bottom:6px;
  margin:0 -2px 14px;
  scrollbar-width:none
}

.filter-row button {
  font-size:12px;
  padding:10px 14px;
  background:transparent;
  border:1px solid var(--border);
  white-space:nowrap;
  min-height:44px
}

.filter-row button.active {
  background:var(--green);
  border-color:var(--green);
  color:var(--card)
}

.material-card {
  position:relative;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:17px;
  margin-bottom:12px
}

.material-card.selected {
  border-color:var(--green);
  box-shadow:0 0 0 1px var(--green)
}

.material-header {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px
}

.material-header h3 {
  font-size:15px;
  font-weight:550;
  margin:0 0 4px
}

.material-date {
  font-size:10px;
  color:var(--muted)
}

.material-note {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  font-size:13px;
  margin:13px 0 8px;
  line-height:1.8
}

.material-original {
  background:#f2f3ec;
  border-radius:10px;
  padding:12px;
  font-size:12px;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  max-height:210px;
  overflow:auto;
  margin:10px 0
}

.material-images {
  display:flex;
  gap:8px;
  overflow:auto;
  margin:13px 0 5px
}

.image-button {
  padding:0;
  background:#eef0e7;
  border:1px solid var(--border);
  border-radius:10px;
  flex:0 0 105px;
  overflow:hidden
}

.image-button img {
  display:block;
  width:105px;
  height:110px;
  object-fit:cover
}

.image-button span {
  display:block;
  max-width:105px;
  font-size:9px;
  padding:5px 5px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}

.material-footer {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-top:11px
}

.material-footer .quiet-button {
  font-size:11px
}

.selection-label {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:11px;
  min-height:44px
}

.assignment-panel {
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--border)
}

.assignment-panel .action-row {
  margin-top:10px
}

.assignment-panel label {
  font-size:12px;
  display:block;
  margin-bottom:7px
}

.batch-bar {
  background:var(--sage);
  padding:16px;
  border-radius:16px;
  margin:15px 0;
  position:sticky;
  top:8px;
  z-index:4;
  box-shadow:0 4px 15px #214c3d0b
}

.batch-bar strong {
  font-size:13px
}

.batch-bar .action-row {
  margin-top:10px
}

.batch-toolbar {
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center
}

.timeline {
  margin-top:10px
}

.quote-card {
  border-left:2px solid #c4d0bc;
  margin-left:7px;
  padding:0 0 26px 21px;
  position:relative
}

.quote-card:before {
  content:'';
  position:absolute;
  left:-6px;
  top:7px;
  width:10px;
  height:10px;
  border-radius:50%;
  background:var(--green);
  border:2px solid var(--paper)
}

.quote-card .quote-date {
  font-size:11px;
  color:var(--muted);
  margin-bottom:6px
}

.quote-card h3 {
  font-size:22px;
  margin:0 0 8px;
  font-weight:550
}

.quote-card .quote-source {
  font-size:11px;
  color:var(--muted)
}

.quote-card blockquote {
  font-size:13px;
  line-height:1.8;
  margin:12px 0;
  padding:12px 14px;
  border-radius:12px;
  background:var(--card);
  white-space:pre-wrap;
  overflow-wrap:anywhere
}

.quote-note {
  font-size:12px;
  white-space:pre-wrap
}

.reference-list {
  display:grid;
  gap:7px;
  margin-top:12px
}

.reference-button {
  font-size:12px;
  line-height:1.5;
  text-align:left;
  width:100%;
  font-weight:450;
  background:var(--sage);
  padding:11px 13px
}

.reference-button small {
  display:block;
  margin-top:4px;
  color:#876c43
}

.reference-picker {
  display:grid;
  gap:8px;
  max-height:350px;
  overflow:auto
}

.reference-choice {
  display:flex;
  gap:11px;
  align-items:center;
  padding:12px;
  border:1px solid var(--border);
  border-radius:12px;
  font-size:12px;
  cursor:pointer;
  min-height:50px
}

.reference-choice img {
  width:40px;
  height:40px;
  object-fit:cover;
  border-radius:6px
}

.reference-choice span {
  min-width:0;
  overflow-wrap:anywhere
}

.reference-choice small {
  display:block;
  color:var(--muted);
  margin-top:3px
}

.reference-choice input {
  margin-left:auto
}

.image-viewer {
  position:fixed;
  inset:0;
  width:100vw;
  height:100dvh;
  max-width:none;
  max-height:none;
  padding:0;
  border:0;
  border-radius:0;
  background:#15221f;
  color:#fafbf7;
  overflow:hidden
}

.image-viewer[open] {
  display:flex;
  flex-direction:column
}

.image-viewer::backdrop {
  background:#15221f
}

.viewer-header {
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  padding:12px 16px;
  flex-shrink:0
}

.viewer-header>span {
  font-size:12px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}

.viewer-button {
  background:#34443d;
  color:#fafbf7;
  font-size:13px;
  padding:10px 16px;
  min-height:44px
}

.image-stage {
  flex:1;
  overflow:auto;
  padding:8px;
  touch-action:pan-x pan-y pinch-zoom;
  display:block
}

.image-stage img {
  display:block;
  height:auto;
  max-width:none;
  min-width:0;
  transform-origin:top left;
  margin:0 auto
}

.viewer-toolbar {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  padding:12px
}

.viewer-toolbar output {
  font-size:12px;
  min-width:44px;
  text-align:center
}

.viewer-hint {
  font-size:10px;
  color:#bac6bd;
  text-align:center;
  padding:0 10px calc(8px + env(safe-area-inset-bottom));
  margin:0
}

.toast {
  position:fixed;
  left:50%;
  bottom:calc(95px + env(safe-area-inset-bottom));
  transform:translateX(-50%);
  z-index:25;
  background:var(--green);
  color:var(--card);
  padding:12px 19px;
  border-radius:13px;
  font-size:13px;
  box-shadow:0 5px 20px #214c3d22;
  max-width:calc(100vw - 35px);
  white-space:nowrap
}

.toast[hidden] {
  display:none
}

[hidden] {
  display:none!important
}

@media(min-width:700px) {
  .site-header {
    padding-top:35px;
    padding-bottom:28px
  }
  #app {
    padding-top:3px
  }
  .house-list {
    grid-template-columns:repeat(2,minmax(0,1fr))
  }
  .hero {
    padding:32px
  }
  .hero h1 {
    font-size:35px
  }
  .page-title {
    margin-top:25px
  }
  .card {
    padding:27px
  }
  .preview-list {
    grid-template-columns:repeat(4,minmax(0,1fr))
  }
  .login-layout {
    margin:42px auto
  }
  .bottom-nav {
    max-width:800px;
    margin:0 auto;
    border-radius:20px 20px 0 0;
    border:1px solid var(--border);
    padding:7px 45px calc(7px + env(safe-area-inset-bottom))
  }
  .page-footer {
    margin-top:35px
  }
}

@media(max-width:380px) {
  .site-header {
    padding:19px 17px
  }
  #app {
    padding:0 17px
  }
  .page-footer {
    padding:0 17px
  }
  .hero {
    padding:22px
  }
  .page-title h1 {
    font-size:25px
  }
  .page-title>.primary {
    padding:10px 13px;
    font-size:12px
  }
  .card {
    padding:18px
  }
  .form-grid {
    grid-template-columns:1fr
  }
  .form-grid .wide {
    grid-column:auto
  }
  .action-row>* {
    white-space:normal
  }
  .preview-list {
    grid-template-columns:repeat(2,minmax(0,1fr))
  }
  .page-footer {
    font-size:10px
  }
  .brand small {
    font-size:9px;
    letter-spacing:.3px
  }
  .details-grid {
    gap:15px 10px
  }
}

.button-link {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
  padding:11px 17px;
  min-height:48px;
  font-size:14px;
  font-weight:550;
  text-align:center
}

.quiet-link {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  font-size:12px;
  padding:0 9px;
  flex-shrink:0
}

@media(prefers-reduced-motion:reduce) {
  .spinner {
    animation:none
  }
}
