/* 3813 client phone page, mockup v4. Self-only CSP: every style lives here, none inline. */
:root {
  --ink: #1d211d;
  --deep: #2f5d33;      /* deep green: Send to Jim fill (white 17px bold passes), links, headings */
  --green: #339933;     /* rules and filled stars only */
  --tint: #eef4e9;      /* picked / open */
  --pick: #7fb04a;      /* picked / open border */
  --rule: #d4dcd0;
  --muted: #4a544a;
  --foot: #6b756b;
  --err: #a12a1f;
  --ground: #ffffff;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
}
a { color: var(--deep); }
a:hover { color: var(--ink); }
input, textarea, button { font-family: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--deep); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible { outline-offset: 0; }

.page { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--ground); }
.loading, .ended { margin: 0; padding: 40px 16px; font-size: 17px; text-align: center; color: var(--ink); }
.vh { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }

/* sticky top line */
.top { position: sticky; top: 0; z-index: 2; background: var(--ground); border-bottom: 1px solid var(--rule); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.from { font-size: 13px; color: var(--muted); }
.hi { font-size: 22px; font-weight: 700; overflow-wrap: anywhere; }
.send {
  flex: none; height: 48px; padding: 0 18px; border: 0; border-radius: 10px;
  background: var(--deep); color: #ffffff; font-size: 17px; font-weight: 700; cursor: pointer;
}
.send:disabled { opacity: 0.7; cursor: default; }
.send:focus-visible { outline-color: var(--ink); }
.sent { flex: none; font-size: 16px; font-weight: 700; color: var(--deep); text-align: right; }
.status { margin: 0; padding: 0 16px 10px; font-size: 15px; font-weight: 600; color: var(--err); }

/* body */
.body { padding: 20px 16px 40px; display: flex; flex-direction: column; gap: 28px; }
.sec { display: flex; flex-direction: column; gap: 10px; }
.sec h2 {
  margin: 0; padding-bottom: 6px; border-bottom: 2px solid var(--green); color: var(--deep);
  font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.empty { font-size: 15px; color: var(--muted); }

/* house cards */
.card { border: 1px solid var(--rule); border-radius: 12px; background: #ffffff; }
.card.open { border-color: var(--pick); background: var(--tint); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  min-height: 60px; padding: 10px 14px; border: 0; border-radius: 12px; background: transparent;
  color: var(--ink); text-align: left; cursor: pointer;
}
.card-id { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.addr { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.when { font-size: 14px; color: var(--muted); }
.summary { font-size: 15px; font-weight: 700; color: var(--deep); white-space: nowrap; }
.card-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.crit { display: flex; flex-direction: column; gap: 0; padding: 6px 0; border-top: 1px solid var(--rule); }
.crit-label { font-size: 15px; font-weight: 600; }
.stars { display: flex; gap: 2px; }
.star { width: 48px; height: 48px; border: 0; border-radius: 8px; background: transparent; padding: 7px; cursor: pointer; flex: none; }
.star svg { display: block; width: 34px; height: 34px; }
.star path { fill: #ffffff; stroke: var(--foot); stroke-width: 1.4; stroke-linejoin: round; }
.star.on path { fill: var(--green); stroke: var(--deep); }
.note {
  display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--rule);
  font-size: 15px; font-weight: 600;
}
.note.plain { padding-top: 0; border-top: 0; }
textarea {
  font-size: 16px; font-weight: 400; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px;
  color: var(--ink); resize: none; background: #ffffff; width: 100%; line-height: 1.4;
}

/* needs */
.need { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 12px; }
.need-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.need-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.need-label { font-size: 13px; color: var(--muted); }
.need-value { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.edit {
  flex: none; height: 44px; min-width: 44px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent;
  color: var(--deep); font-size: 15px; font-weight: 600; cursor: pointer;
}
.need-edit { display: flex; }
.need-edit input {
  flex: 1; width: 100%; height: 44px; font-size: 16px; padding: 0 12px; border: 1px solid var(--pick);
  border-radius: 10px; color: var(--ink); background: #ffffff;
}
.need-err { margin: 0; font-size: 14px; font-weight: 600; color: var(--err); }
.chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.chip {
  min-height: 44px; padding: 4px 4px; border: 1px solid var(--rule); border-radius: 10px; background: #ffffff;
  color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; line-height: 1.2;
}
.chip[aria-pressed="true"] { border-color: var(--pick); background: var(--tint); color: var(--deep); font-weight: 700; }

/* review */
.review { display: flex; justify-content: center; }
.review a {
  display: flex; align-items: center; justify-content: center; height: 48px; padding: 0 20px;
  border: 1px solid var(--green); border-radius: 10px; background: #ffffff; color: var(--deep);
  font-size: 16px; font-weight: 600; text-decoration: none;
}

/* footer */
.foot {
  display: flex; flex-direction: column; gap: 6px; padding-top: 16px; border-top: 1px solid var(--rule);
  font-size: 12px; line-height: 1.5; color: var(--foot); text-align: center;
}

@media (max-width: 359px) {
  .top-row { padding: 10px 12px; }
  .hi { font-size: 20px; }
  .send { padding: 0 14px; }
  .body { padding-left: 12px; padding-right: 12px; }
}
