/* Shared chat: a readable thread, one composer, and optional details. */
.ranch-coach-chat,.ranch-coach-opportunities{--chat-base:#080a0b;--chat-panel:#131619;--chat-raised:#202429;--chat-ink:#f7f3eb;--chat-muted:#c9ccd0;--chat-gold:#dfbe7b;--chat-line:#5d646b;--chat-control:#7b838a;color:var(--chat-ink);min-width:0}
.ranch-coach-chat,.ranch-coach-chat *, .ranch-coach-chat *::before,.ranch-coach-chat *::after{box-sizing:border-box}
.ranch-coach-chat{width:100%;max-width:880px;padding:20px;margin:0 0 24px;border:2px solid var(--chat-line);border-radius:16px;background:var(--chat-panel)}
.ranch-chat-heading{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.ranch-chat-heading>div{min-width:0}
.ranch-chat-heading h2{font-size:22px!important;line-height:1.3;letter-spacing:-.025em;margin:0;color:var(--chat-ink)}
.ranch-chat-heading p{font-size:14px!important;line-height:1.5;color:var(--chat-muted);margin:4px 0 0}
.ranch-chat-sample{margin-left:auto;border:1px solid var(--chat-line);border-radius:6px;padding:4px 8px;font-size:12px;color:var(--chat-gold)}
.ranch-chat-log{display:flex;flex-direction:column;gap:12px;max-height:480px;overflow-y:auto;overscroll-behavior:contain;padding:4px 4px 16px;scrollbar-width:thin;scrollbar-color:var(--chat-control) var(--chat-base)}
.ranch-chat-message{max-width:min(94%,680px);min-width:0;padding:12px;border-radius:12px;border:2px solid var(--chat-line);background:var(--chat-raised);align-self:flex-start}
.ranch-chat-message.from-you{align-self:flex-end;background:var(--chat-ink);border-color:var(--chat-ink);color:var(--chat-base);border-bottom-right-radius:4px}
.ranch-chat-message.from-coach{border-bottom-left-radius:4px}
.ranch-chat-message p{font-size:16px!important;line-height:1.5;color:inherit!important;white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0 0}
.ranch-chat-speaker{display:block;font-size:12px;line-height:1.5;font-weight:650;color:inherit}
.ranch-chat-image-note{display:block;font-size:12px;line-height:1.6;margin-top:4px}
.ranch-chat-options{border-block:1px solid var(--chat-line);margin:0 0 12px;color:var(--chat-muted);font-size:14px}
.ranch-chat-options-summary{display:flex;align-items:center;gap:12px;min-height:44px;cursor:pointer;list-style:none;font-weight:600;color:var(--chat-ink)}
.ranch-chat-options-summary::-webkit-details-marker{display:none}
.ranch-chat-options-summary::before{content:'+';width:16px;color:var(--chat-gold);font-size:20px;flex-shrink:0}
.ranch-chat-options[open]>.ranch-chat-options-summary::before{content:'−'}
.ranch-chat-options-status{margin-left:auto;color:var(--chat-muted);font-size:12px;font-weight:400;text-align:right}
.ranch-chat-options-body{padding:0 0 16px;display:grid;gap:16px;min-width:0}
.ranch-chat-setup-note{font-size:14px!important;line-height:1.6;color:var(--chat-muted);margin:0}
.ranch-chat-ai,.ranch-chat-storage{padding:16px;border:2px solid var(--chat-line);border-radius:8px;background:var(--chat-base);min-width:0}
.ranch-chat-consent{display:flex;align-items:center;gap:12px;min-height:44px;cursor:pointer;font-size:14px;font-weight:600;color:var(--chat-ink);margin:0}
.ranch-chat-consent input{flex:0 0 20px;width:20px;height:20px;margin:0;accent-color:var(--chat-gold)}
.ranch-chat-consent span{min-width:0;overflow-wrap:anywhere}
.ranch-chat-consent small{display:inline-block;margin-left:8px;font-size:12px;font-weight:400;color:var(--chat-muted)}
.ranch-chat-ai>p,.ranch-chat-storage>p,.ranch-chat-delete-confirm>p{font-size:13px!important;line-height:1.7;color:var(--chat-muted);margin:8px 0 0;overflow-wrap:anywhere}
.ranch-chat-storage a{color:var(--chat-gold);text-decoration:underline;text-underline-offset:3px}
.ranch-chat-history:empty{display:none}.ranch-chat-history-actions,.ranch-chat-prompts{display:flex;flex-wrap:wrap;gap:8px}
body .ranch-coach-chat :is(.ranch-chat-history-actions button,.ranch-chat-prompts button),body .ranch-coach-opportunities button{min-height:44px;padding:8px 12px;border:2px solid var(--chat-control);border-radius:8px;background:var(--chat-base);color:var(--chat-ink);font-size:13px;line-height:1.5;white-space:normal;cursor:pointer}
.ranch-chat-quota-details{font-size:12px!important;line-height:1.7;color:var(--chat-muted);margin:0;overflow-wrap:anywhere}
.ranch-chat-composer{min-width:0}
.ranch-chat-composer-tools{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 12px;margin-bottom:8px}
.ranch-chat-attachments{display:flex;align-items:center;gap:8px;min-width:0}
body .ranch-coach-chat :is([data-chat-add-chart],[data-chat-remove-chart]){display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:8px 12px;border:2px solid var(--chat-control);border-radius:8px;background:var(--chat-base);color:var(--chat-ink);font-size:14px;line-height:1.5;cursor:pointer}
.ranch-chat-quota{font-size:12px!important;line-height:1.6;color:var(--chat-muted);margin:0;overflow-wrap:anywhere}
.ranch-chat-quota strong{font-weight:500;color:var(--chat-muted)}
.ranch-chat-photo-preview{display:flex;align-items:center;gap:16px;margin:0 0 16px;padding:16px;border:2px solid var(--chat-line);border-radius:8px;background:var(--chat-base);min-width:0}
.ranch-chat-photo-preview>img{display:block;width:120px;height:88px;object-fit:contain;flex-shrink:0;border:1px solid var(--chat-line);border-radius:4px;background:var(--chat-raised)}
.ranch-chat-photo-preview>div{min-width:0}.ranch-chat-photo-preview strong{display:block;font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.ranch-chat-photo-preview p{font-size:12px!important;line-height:1.6;color:var(--chat-muted);margin:4px 0 8px}
.ranch-chat-message-photo{display:block;max-width:100%;width:260px;max-height:220px;object-fit:contain;border-radius:8px;margin:8px 0;background:var(--chat-base)}
.ranch-chat-form{display:flex;align-items:flex-end;gap:12px;margin:0}
body .ranch-coach-chat .ranch-chat-form[data-chat-form] textarea{flex:1;min-width:0;width:100%;min-height:64px;max-height:180px;resize:vertical;border:2px solid var(--chat-control);border-radius:12px;padding:10px 12px;background:var(--chat-base);color:var(--chat-ink);font-size:16px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;overflow-x:hidden}
body .ranch-coach-chat .ranch-chat-form button{display:inline-flex;align-items:center;justify-content:center;gap:8px;flex-shrink:0;min-height:48px;min-width:80px;padding:12px 16px;border:2px solid var(--chat-gold);border-radius:12px;background:var(--chat-gold);color:var(--chat-base);font-size:14px;font-weight:700;cursor:pointer}
.ranch-chat-note,.ranch-chat-help,.ranch-chat-status,.ranch-chat-photo-status,body .ranch-coach-chat :is(.ranch-chat-help,.ranch-chat-status,.ranch-chat-photo-status){font-size:12px!important;line-height:1.5;color:var(--chat-muted);margin:8px 0 0}
.ranch-chat-status:empty{display:none}
.ranch-chat-basis{font-size:12px;color:var(--chat-muted);line-height:1.7;margin:0}
.ranch-chat-basis summary,.ranch-opportunity summary{display:flex;align-items:center;min-height:44px;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.ranch-chat-basis p,.ranch-opportunity details p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.75;margin:8px 0 0}
.ranch-chat-error,.ranch-chat-delete-confirm{padding:16px;border:2px solid #9b6556;border-radius:8px;background:#30211b;color:#ffb9a6;font-size:14px;line-height:1.7;overflow-wrap:anywhere;margin-top:16px}
.ranch-chat-delete-confirm .ranch-chat-history-actions{margin-top:16px}
body .ranch-coach-chat [data-chat-delete-confirm]{color:#ffb9a6;border-color:#9b6556}
.ranch-coach-chat :is(button,input,textarea,summary,[tabindex]):focus-visible,.ranch-coach-opportunities :is(button,summary):focus-visible{outline:3px solid var(--chat-gold);outline-offset:4px}
.ranch-coach-chat button:not(:disabled):hover{filter:brightness(1.12)}
.ranch-coach-chat button:not(:disabled):active{filter:brightness(.88)}
.ranch-coach-chat button:disabled,.ranch-coach-chat textarea:disabled{opacity:.65;cursor:not-allowed}
.ranch-coach-opportunities:empty{display:none}
.ranch-coach-opportunities{margin:0 0 24px;max-width:1000px}
.ranch-opportunities-heading h2{font-size:20px;line-height:1.4;margin:0 0 8px}
.ranch-opportunities-heading>p{font-size:14px;line-height:1.75;color:var(--chat-muted);margin-bottom:16px}
.ranch-opportunities-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.ranch-opportunity{min-width:0;border:2px solid var(--chat-line);border-radius:12px;background:var(--chat-panel);padding:24px}
.ranch-opportunity.attention{border-left:4px solid var(--chat-gold)}
.ranch-opportunity.positive{border-left:4px solid #b6dabf;color:var(--chat-ink)!important}
.ranch-opportunity h3{font-size:17px;line-height:1.4;margin:0 0 8px}
.ranch-opportunity>p{font-size:14px;line-height:1.75;color:var(--chat-muted);margin:0 0 8px}
.ranch-opportunity details{font-size:13px;line-height:1.7;color:var(--chat-muted)}
@media(max-width:720px){
  .ranch-coach-chat{padding:12px;border-radius:12px}
  .ranch-chat-heading h2{font-size:20px!important}
  .ranch-chat-log{max-height:clamp(220px,48dvh,520px);padding-inline:0;padding-bottom:12px}
  .ranch-chat-message{max-width:100%;padding:10px}
  .ranch-chat-message.from-you{max-width:94%}
  .ranch-chat-form{gap:8px}body .ranch-coach-chat .ranch-chat-form button{min-width:64px;padding:12px}
  .ranch-chat-ai,.ranch-chat-storage{padding:12px}
  .ranch-chat-photo-preview{align-items:flex-start;gap:12px;padding:10px;margin-bottom:12px}.ranch-chat-photo-preview>img{width:80px;height:72px}
  .ranch-opportunities-grid{grid-template-columns:minmax(0,1fr)}.ranch-opportunity{padding:16px}
}

/* Progressive VIP records and editors also render inside the unified admin. */
.vip-advanced,.vip-editor-details{border:1px solid var(--line);border-radius:12px;background:var(--white,var(--panel));padding:16px;margin:0 0 24px;min-width:0}
.vip-advanced>summary,.vip-editor-details>summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-size:14px;font-weight:600;color:var(--ink);gap:12px}
.vip-advanced>summary::before,.vip-editor-details>summary::before{content:'+';font-size:20px;color:var(--gold,var(--accent));width:20px;flex-shrink:0}
.vip-advanced[open]>summary::before,.vip-editor-details[open]>summary::before{content:'−'}
.vip-advanced[open]>summary,.vip-editor-details[open]>summary{margin-bottom:16px}
.vip-advanced :is(.filters,.metrics){margin-top:16px}
.vip-editor-details .form-grid{margin-top:16px}
.vip-editor-details .coach-guide{margin-top:0}
.vip-editor-details #entry-coach{margin-top:0;border:0}
.vip-editor-details .coach-review,#vip-admin-editor .vip-editor-details .coach-review{padding:16px 0}
@media(max-width:720px){.vip-advanced .overview-grid{grid-template-columns:minmax(0,1fr)}.vip-editor-details .form-grid,#vip-admin-editor .vip-editor-details .form-grid{grid-template-columns:minmax(0,1fr)}}
.vip-workspace-actions{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:0 0 24px}
.vip-workspace-actions>.button{min-height:44px}
.vip-sample-note{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:8px 0;margin:0 0 16px;border-bottom:1px solid #88764e;color:#f0d59c}
.vip-sample-note p{font-size:12px!important;line-height:1.7;margin:0;color:inherit!important}
.vip-sample-note .text-button{min-height:44px;flex-shrink:0;font-size:12px}
@media(max-width:720px){.vip-workspace-actions{gap:8px}.vip-sample-note{gap:8px}.vip-sample-note p{font-size:12px!important}}

/* Owner-only private conversation review. */
.coach-history-review{min-width:0;max-width:1200px}.coach-history-review p{line-height:1.75}
.coach-history-toolbar{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px;margin:24px 0 12px}
.coach-history-toolbar label{display:grid;gap:8px;flex:1;min-width:200px;font-size:14px}
.coach-history-toolbar select{width:100%;min-width:0;min-height:44px;font-size:16px;padding:10px;background:#080a0b;color:#f7f3eb;border:2px solid #7b838a;border-radius:8px}
.coach-history-toolbar .button{min-height:44px;white-space:normal}
.coach-history-grid{display:grid;grid-template-columns:minmax(240px,.9fr) minmax(0,1.5fr);gap:24px;margin-top:24px}
.coach-history-list,.coach-history-detail{min-width:0;padding:20px;border:2px solid #5d646b;border-radius:12px;background:#131619;color:#f7f3eb}
.coach-history-list{display:flex;flex-direction:column;align-self:start;gap:12px;max-height:720px;overflow-y:auto}
.coach-history-list>button{display:grid;gap:8px;text-align:left;min-height:44px;border:2px solid #7b838a;border-radius:8px;padding:12px;background:#080a0b;color:#f7f3eb;cursor:pointer;overflow-wrap:anywhere}
.coach-history-list>button[aria-pressed=true]{border:2px solid #dfbe7b;padding:11px;background:#202429}
.coach-history-list strong{font-size:15px}.coach-history-list small{font-size:12px;color:#c9ccd0}.coach-history-list span{font-size:14px;line-height:1.6}
.coach-history-detail h2{font-size:22px}.coach-history-detail h3{font-size:14px;color:#dfbe7b;margin:24px 0 8px}.coach-history-detail p{font-size:15px;overflow-wrap:anywhere}.coach-history-text{white-space:pre-wrap}
.coach-history-review :is(button,select):focus-visible{outline:3px solid #dfbe7b;outline-offset:4px}.coach-history-review button:disabled{opacity:.65;cursor:not-allowed}
@media(max-width:720px){.coach-history-grid{grid-template-columns:minmax(0,1fr);gap:16px}.coach-history-list{max-height:350px}.coach-history-list,.coach-history-detail{padding:16px}.coach-history-toolbar{align-items:stretch;gap:8px}.coach-history-toolbar label{flex-basis:100%;min-width:0}.coach-history-toolbar .button{flex:1;font-size:13px;padding:12px}}
