/* ARFAON resident experience / review-only. Independent of auth, API and billing. */
body.arfaon-light #arfaonGuide[data-resident-enabled="true"] #arfaonGuidePanel {
  width:min(1050px,calc(100vw - 52px));height:min(750px,calc(100dvh - 36px));
  border-radius:26px;background:#fff!important;
  box-shadow:0 35px 125px rgba(20,49,68,.24);
}
body.arfaon-light #residentChat {height:100%;min-height:0;display:flex;flex-direction:column;}
body.arfaon-light #residentChat .resident-header {
  background:linear-gradient(110deg,#fff 60%,#f5fafc);min-height:76px;
  padding:12px 75px 12px 26px;box-sizing:border-box;
}
body.arfaon-light #residentChat .resident-new {
  border-radius:999px;padding:10px 16px;background:#fff;
  box-shadow:0 2px 10px rgba(33,79,101,.05);
}
body.arfaon-light #residentChat .resident-workspace {
  flex:1;min-height:0;display:grid;grid-template-columns:270px minmax(0,1fr);
}
body.arfaon-light #residentChat .resident-world {
  display:flex;flex-direction:column;min-height:0;
  background:linear-gradient(155deg,#eaf2f6,#f4f9fb 70%,#fff);
  border-right:1px solid #dce8ed;overflow:hidden;
}
body.arfaon-light #residentChat .resident-world__photo {
  position:relative;flex:0 0 35%;min-height:150px;overflow:hidden;
  background:#bdd2df;
}
body.arfaon-light #residentChat .resident-world__photo img {
  display:block;width:100%;height:100%;object-fit:cover;object-position:62% 43%;
}
body.arfaon-light #residentChat .resident-world__photo:after {
  content:"";position:absolute;inset:60% 0 0;
  background:linear-gradient(transparent,rgba(10,30,43,.65));pointer-events:none;
}
body.arfaon-light #residentChat .resident-world__photo-mark {
  position:absolute;bottom:17px;left:20px;z-index:1;color:white;
  font-size:10px;font-weight:750;letter-spacing:.18em;text-shadow:0 2px 12px #102938;
}
body.arfaon-light #residentChat .resident-world__content {
  padding:22px 21px;min-height:0;overflow-y:auto;
}
body.arfaon-light #residentChat .resident-world__eyebrow {
  display:block;color:#26758c;font-size:10px;font-weight:800;letter-spacing:.12em;
}
body.arfaon-light #residentChat .resident-world h3 {
  font-size:21px;line-height:1.18;letter-spacing:-.035em;
  margin:9px 0 20px;font-weight:700;
}
body.arfaon-light #residentChat .resident-world__steps {
  padding:0;margin:0;list-style:none;display:grid;gap:17px;
}
body.arfaon-light #residentChat .resident-world__steps li {
  display:flex;gap:12px;align-items:flex-start;
}
body.arfaon-light #residentChat .resident-world__steps li>span {
  flex-shrink:0;display:grid;place-items:center;width:29px;height:29px;
  border-radius:10px;background:#fff;color:#26758c;
  border:1px solid #d3e4eb;font-weight:750;font-size:10px;
}
body.arfaon-light #residentChat .resident-world__steps b {
  display:block;font-size:13px;color:#203d50;line-height:1.3;
}
body.arfaon-light #residentChat .resident-world__steps small {
  display:block;margin-top:3px;font-size:11px;color:#607989;line-height:1.35;
}
body.arfaon-light #residentChat .resident-main {
  display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;
}
body.arfaon-light #residentChat .resident-tabs {
  justify-content:flex-start;gap:10px;padding:13px 24px;
  background:#fff;flex-shrink:0;
}
body.arfaon-light #residentChat .resident-tab {
  flex:1;min-width:0;max-width:270px;gap:12px;
  background:#f6fafb!important;border:1px solid #dbe8ee!important;
  border-radius:16px;padding:7px 10px;min-height:58px;
  transition:background .15s,border-color .15s,box-shadow .15s;
}
body.arfaon-light #residentChat .resident-tab[aria-pressed="true"] {
  background:#e8f4f7!important;border-color:#75b2c6!important;
  box-shadow:0 0 0 2px rgba(35,112,141,.10);
}
body.arfaon-light #residentChat .resident-avatar {
  display:block;width:44px;height:44px;flex-shrink:0;
  overflow:hidden;border-radius:13px;background:#d1e2ea;
  border:1px solid #c7dfe7;
}
body.arfaon-light #residentChat .resident-avatar img {
  display:block;width:100%;height:100%;object-fit:cover;object-position:50% 30%;
}
body.arfaon-light #residentChat .resident-tab b {font-size:14px;color:#213f50}
body.arfaon-light #residentChat .resident-tab small {font-size:11px;color:#647b89}
body.arfaon-light #residentChat #residentTimeline {
  flex:1;min-height:0;padding:15px 24px;overflow-y:auto;background:
  radial-gradient(circle at 50% 0,rgba(229,242,247,.6),transparent 45%),#fff;
}
body.arfaon-light #residentChat .resident-welcome {
  max-width:550px;margin:4px auto 0;text-align:center;
}
body.arfaon-light #residentChat .resident-welcome__people {
  display:flex;justify-content:center;align-items:center;height:80px;
  margin:0 auto 7px;
}
body.arfaon-light #residentChat .resident-welcome__people img {
  width:70px;height:70px;object-fit:cover;object-position:center 27%;
  border:4px solid white;border-radius:23px;background:#dae8ee;
  box-shadow:0 9px 25px rgba(34,84,105,.14);
}
body.arfaon-light #residentChat .resident-welcome__people img+img {
  margin-left:-12px;transform:rotate(5deg);
}
body.arfaon-light #residentChat .resident-welcome__mark {
  color:#26758c;font-size:10px;font-weight:800;letter-spacing:.12em;
  margin:0 0 8px;
}
body.arfaon-light #residentChat .resident-welcome h3 {
  font-size:clamp(20px,2vw,27px);font-weight:730;line-height:1.15;
  margin:0 0 8px;
}
body.arfaon-light #residentChat .resident-welcome p {
  color:#5b7483;font-size:13px;line-height:1.45;
  max-width:425px;margin:0 auto;
}
body.arfaon-light #residentChat .resident-suggestions {
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;max-width:480px;margin:18px auto 0;
}
body.arfaon-light #residentChat .resident-suggestions button {
  display:flex;align-items:center;text-align:left;gap:10px;
  padding:11px 12px;min-width:0;min-height:62px;
  border:1px solid #dce9ee;border-radius:15px;background:#f7fbfc;
  color:#23465a;box-shadow:0 3px 12px rgba(27,74,94,.035);
}
body.arfaon-light #residentChat .resident-suggestions button:first-child {
  grid-column:span 2;background:linear-gradient(95deg,#e9f4f7,#f8fbfc);
  border-color:#bad6e0;
}
body.arfaon-light #residentChat .resident-suggestions button:hover {
  background:#eaf4f8;border-color:#7fb4c9;color:#114b62;
}
body.arfaon-light #residentChat .resident-suggestions button>span:nth-child(2) {
  min-width:0;flex:1;
}
body.arfaon-light #residentChat .resident-suggestions b {
  display:block;color:#244b5d;font-size:12px;font-weight:750;
  white-space:normal;line-height:1.2;
}
body.arfaon-light #residentChat .resident-suggestions small {
  display:block;margin-top:3px;color:#668090;font-size:10px;line-height:1.2;
}
body.arfaon-light #residentChat .resident-suggestion-icon {
  flex-shrink:0;display:grid;place-items:center;
  width:35px;height:35px;border-radius:11px;
  background:#e3f0f5;color:#176783;font-size:21px;
}
body.arfaon-light #residentChat .resident-suggestion-arrow {
  margin-left:auto;font-size:18px;color:#26758c;
}
body.arfaon-light #residentChat .resident-composer-area {
  width:100%;max-width:none;padding:12px 24px 18px;background:#fff;
  border-top:1px solid #e2eaee;
}
body.arfaon-light #residentChat #residentForm {
  width:100%;max-width:none;box-sizing:border-box;border-radius:16px;
  box-shadow:0 3px 18px rgba(32,76,96,.055);
}
body.arfaon-light #residentChat .resident-footer {
  margin:11px 0 0;gap:12px;
}
body.arfaon-light #residentChat #residentDiagnose {
  border:1px solid #c6e0e9;border-radius:11px;
  padding:8px 12px;background:#edf7fa;color:#145c73;
  font-weight:700;font-size:12px;white-space:nowrap;
  min-height:36px;
}
body.arfaon-light #residentChat #residentDiagnose:hover {
  background:#dff0f6;
}
body.arfaon-light #residentChat .resident-memory-note {
  margin-top:7px;color:#738795;
}
@media(max-width:800px) {
  body.arfaon-light #arfaonGuide[data-resident-enabled="true"] #arfaonGuidePanel {
    width:100vw;height:100dvh;top:0;left:0;transform:none;border:0;
    border-radius:0;max-width:none;
  }
  body.arfaon-light #residentChat .resident-workspace {display:flex;flex-direction:column}
  body.arfaon-light #residentChat .resident-world {display:none}
  body.arfaon-light #residentChat .resident-header {
    min-height:64px;padding:10px 64px 10px 14px!important;
  }
  body.arfaon-light #residentChat .resident-tabs {padding:9px 12px;gap:8px}
  body.arfaon-light #residentChat .resident-tab {padding:6px 8px;min-height:54px;gap:8px}
  body.arfaon-light #residentChat .resident-avatar {width:39px;height:39px;border-radius:11px}
  body.arfaon-light #residentChat #residentTimeline {padding:14px 15px}
  body.arfaon-light #residentChat .resident-composer-area {
    padding:9px 12px max(12px,env(safe-area-inset-bottom));
  }
  body.arfaon-light #residentChat .resident-footer {justify-content:space-between}
}
@media(max-width:410px) {
  body.arfaon-light #residentChat .resident-tab small {font-size:9px}
  body.arfaon-light #residentChat .resident-tab b {font-size:12px}
  body.arfaon-light #residentChat .resident-avatar {width:35px;height:35px}
  body.arfaon-light #residentChat .resident-suggestions {gap:7px;margin-top:13px}
  body.arfaon-light #residentChat .resident-suggestions button {padding:8px;gap:7px;min-height:53px}
  body.arfaon-light #residentChat .resident-suggestion-icon {width:28px;height:28px;font-size:17px}
  body.arfaon-light #residentChat .resident-suggestions b {font-size:11px}
  body.arfaon-light #residentChat .resident-suggestions small {font-size:9px}
  body.arfaon-light #residentChat .resident-welcome__people {height:67px}
  body.arfaon-light #residentChat .resident-welcome__people img {width:57px;height:57px;border-radius:16px}
}
@media(max-height:660px) {
  body.arfaon-light #residentChat .resident-world__photo {min-height:105px;flex-basis:29%}
  body.arfaon-light #residentChat .resident-world__content {padding:13px 18px}
  body.arfaon-light #residentChat .resident-world h3 {font-size:17px;margin:5px 0 11px}
  body.arfaon-light #residentChat .resident-world__steps {gap:9px}
  body.arfaon-light #residentChat .resident-welcome__people {height:54px;margin-bottom:4px}
  body.arfaon-light #residentChat .resident-welcome__people img {width:46px;height:46px;border-radius:14px}
  body.arfaon-light #residentChat .resident-welcome__mark {margin:0 0 5px;font-size:9px}
  body.arfaon-light #residentChat .resident-welcome h3 {font-size:20px;margin-bottom:5px}
  body.arfaon-light #residentChat .resident-welcome p {font-size:11px;line-height:1.3}
  body.arfaon-light #residentChat .resident-suggestions {margin-top:9px;gap:6px}
  body.arfaon-light #residentChat .resident-suggestions button {padding:7px 9px;min-height:45px}
  body.arfaon-light #residentChat .resident-composer-area {padding-top:6px;padding-bottom:8px}
}
@media(max-height:430px) {
  body.arfaon-light #residentChat .resident-welcome__people,
  body.arfaon-light #residentChat .resident-welcome__mark,
  body.arfaon-light #residentChat .resident-welcome p {display:none}
}
@media(prefers-reduced-motion:reduce) {
  body.arfaon-light #residentChat .resident-tab {transition:none}
}


/* Keep first-view actions visible on laptop-height windows and mobile keyboards. */
@media(max-height:700px) {
  body.arfaon-light #residentChat .resident-welcome__people,
  body.arfaon-light #residentChat .resident-welcome__mark { display:none; }
  body.arfaon-light #residentChat .resident-welcome { margin:0 auto; }
  body.arfaon-light #residentChat .resident-welcome h3 { margin:0 0 5px;font-size:19px; }
  body.arfaon-light #residentChat .resident-welcome p { font-size:11px;line-height:1.25; }
  body.arfaon-light #residentChat .resident-suggestions { margin-top:8px;gap:6px; }
  body.arfaon-light #residentChat .resident-suggestions button { min-height:41px;padding:5px 9px; }
  body.arfaon-light #residentChat .resident-suggestion-icon { width:27px;height:27px;font-size:17px; }
  body.arfaon-light #residentChat .resident-suggestions small { display:none; }
  body.arfaon-light #residentChat .resident-composer-area { padding-top:5px;padding-bottom:7px; }
}
@media(min-width:801px) and (max-height:700px) {
  body.arfaon-light #residentChat .resident-suggestions {
    grid-template-columns:repeat(3,minmax(0,1fr));max-width:100%;
  }
  body.arfaon-light #residentChat .resident-suggestions button:first-child { grid-column:auto; }
  body.arfaon-light #residentChat .resident-suggestions b { font-size:10px; }
}

/* Answers are useful workspaces, not plain paragraphs. The portrait is decorative;
   speaker name remains real text, and AI content stays textContent-only. */
body.arfaon-light #residentMessages .resident-turn--assistant {
  position:relative;margin:0 40px 20px 0;padding:15px 16px 15px 65px;
  border:1px solid #dae9ef;border-radius:18px 18px 18px 6px;
  background:linear-gradient(135deg,#f4fafc,#ffffff);
  box-shadow:0 6px 20px rgba(31,81,104,.045);
  color:#243e50;
}
body.arfaon-light #residentMessages .resident-turn--assistant::before {
  content:"";position:absolute;left:14px;top:14px;width:36px;height:36px;
  border-radius:12px;background:#d7e8ee url('/assets/arfaon-mira-first-contact-mobile.webp') center 28%/cover no-repeat;
  box-shadow:0 2px 8px rgba(33,83,104,.12);
}
body.arfaon-light #residentMessages .resident-turn--rian::before {
  background-image:url('/assets/arfaon-rian-diagnostics-mobile.webp');
}
body.arfaon-light #residentMessages .resident-turn--assistant strong {
  margin-bottom:7px;color:#176783;font-size:12px;letter-spacing:.025em;
}
body.arfaon-light #residentMessages .resident-next-action {
  display:block;width:fit-content;max-width:100%;min-height:36px;
  margin:14px 0 0;padding:8px 14px;white-space:normal;
  background:#e2f2f7;color:#125a74;
  border:1px solid #b5d8e4;border-radius:11px;
  font:inherit;font-size:12px;font-weight:750;line-height:1.3;
  cursor:pointer;
}
body.arfaon-light #residentMessages .resident-next-action:hover {
  background:#cfeaf3;border-color:#81b5c9;
}
body.arfaon-light #residentMessages .resident-next-action:focus-visible {
  outline:3px solid #16708f;outline-offset:3px;
}
@media(max-width:600px) {
  body.arfaon-light #residentMessages .resident-turn--assistant {
    margin-right:4px;padding:12px 12px 12px 52px;font-size:13px;
  }
  body.arfaon-light #residentMessages .resident-turn--assistant::before {
    left:9px;top:11px;width:33px;height:33px;border-radius:10px;
  }
}
