:root{
  --cs-navy:#0B1F3A;
  --cs-gold:#C8A96A;
  --cs-bg-light:#F4F6F9;
  --cs-slate:#8A9BB0;
  --cs-text-primary:#1A1A1A;
  --cs-success:#10B981;
  --cs-warning:#F59E0BFF;
  --cs-danger:#DC2626;
  --cs-info:#7C3AED;
  --cs-success-deep:#27AE60;
  --cs-m1:#0B1F3A;
  --cs-m2:#1A3454;
  --cs-m3:#2A4A6E;
  --cs-m4:#3D5F88;
  --cs-m5:#5478A3;
  --cs-status-not-started:#8A9BB0;
  --cs-status-in-progress:#7C3AED;
  --cs-status-review:#F59E0B;
  --cs-status-complete:#10B981;
}
*{box-sizing:border-box;margin:0;padding:0;}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;background:var(--cs-bg-light);color:var(--cs-text-primary);min-height:100vh;display:flex;flex-direction:column;}
.cs-shell{display:flex;flex-direction:column;min-height:100vh;}
.cs-ribbon{background:var(--cs-navy);padding:0 2rem;height:64px;display:flex;align-items:center;gap:1.5rem;position:sticky;top:0;z-index:100;}
.cs-ribbon-admin{display:flex;align-items:center;position:relative;}
.cs-ribbon-admin-trigger{background:rgba(200,169,106,0.12);border:1px solid rgba(200,169,106,0.3);color:var(--cs-gold);padding:0.4rem 0.9rem;border-radius:4px;font-size:0.78rem;font-weight:600;cursor:pointer;display:flex;align-items:center;gap:0.4rem;letter-spacing:0.05em;text-transform:uppercase;}
.cs-ribbon-admin-trigger:hover{background:rgba(200,169,106,0.22);}
.cs-ribbon-admin-menu{display:none;position:absolute;top:48px;left:0;background:#fff;border:1px solid #DEE3EA;border-radius:6px;min-width:240px;box-shadow:0 4px 16px rgba(0,0,0,0.12);z-index:200;padding:0.4rem 0;}
.cs-ribbon-admin-menu.open{display:block;}
.cs-ribbon-admin-menu a{display:block;padding:0.55rem 1rem;color:var(--cs-text-primary);text-decoration:none;font-size:0.85rem;}
.cs-ribbon-admin-menu a:hover{background:var(--cs-bg-light);}
.cs-ribbon-admin-menu .stub-marker{display:inline-block;font-size:0.65rem;color:var(--cs-slate);margin-left:0.5rem;font-style:italic;}
.cs-ribbon-divider{width:1px;height:28px;background:rgba(200,169,106,0.3);}
.cs-ribbon-logo a{display:flex;align-items:center;text-decoration:none;}
.cs-ribbon-logo img{height:38px;}
.cs-ribbon-dashboard{color:rgba(255,255,255,0.78);text-decoration:none;font-size:0.85rem;font-weight:500;padding:0.4rem 0.7rem;border-radius:4px;}
.cs-ribbon-dashboard:hover{background:rgba(255,255,255,0.08);color:#fff;}
.cs-ribbon-projects{position:relative;}
.cs-ribbon-projects-trigger{background:transparent;border:1px solid rgba(200,169,106,0.3);color:var(--cs-gold);padding:0.4rem 0.9rem;border-radius:4px;font-size:0.82rem;font-weight:500;cursor:pointer;display:flex;align-items:center;gap:0.4rem;}
.cs-ribbon-projects-trigger:hover{background:rgba(200,169,106,0.12);}
.cs-ribbon-projects-menu{display:none;position:absolute;top:48px;left:0;background:#fff;border:1px solid #DEE3EA;border-radius:6px;min-width:320px;max-width:420px;box-shadow:0 4px 16px rgba(0,0,0,0.12);z-index:200;padding:0.4rem 0;max-height:480px;overflow-y:auto;}
.cs-ribbon-projects-menu.open{display:block;}
.cs-ribbon-projects-menu a{display:flex;justify-content:space-between;align-items:center;padding:0.55rem 1rem;color:var(--cs-text-primary);text-decoration:none;font-size:0.85rem;gap:0.8rem;}
.cs-ribbon-projects-menu a:hover{background:var(--cs-bg-light);}
.cs-ribbon-projects-menu .empty{padding:0.8rem 1rem;color:var(--cs-slate);font-size:0.82rem;font-style:italic;}
.cs-ribbon-projects-menu .all-link{border-top:1px solid #DEE3EA;margin-top:0.3rem;padding-top:0.6rem;color:var(--cs-navy);font-weight:600;}
.cs-ribbon-spacer{flex:1;}
.cs-ribbon-user{position:relative;}
.cs-ribbon-user-trigger{color:var(--cs-gold);font-size:0.85rem;font-weight:600;background:transparent;border:none;cursor:pointer;display:flex;align-items:center;gap:0.4rem;padding:0.4rem 0.7rem;border-radius:4px;}
.cs-ribbon-user-trigger:hover{background:rgba(200,169,106,0.08);}
.cs-ribbon-user-menu{display:none;position:absolute;top:48px;right:0;background:#fff;border:1px solid #DEE3EA;border-radius:6px;min-width:200px;box-shadow:0 4px 16px rgba(0,0,0,0.12);z-index:200;padding:0.4rem 0;}
.cs-ribbon-user-menu.open{display:block;}
.cs-ribbon-user-menu a{display:block;padding:0.55rem 1rem;color:var(--cs-text-primary);text-decoration:none;font-size:0.85rem;}
.cs-ribbon-user-menu a:hover{background:var(--cs-bg-light);}
.cs-ribbon-logout{color:rgba(255,255,255,0.78);text-decoration:none;font-size:0.85rem;padding:0.4rem 0.7rem;border-radius:4px;}
.cs-ribbon-logout:hover{background:rgba(255,255,255,0.08);color:#fff;}
.cs-status-badge{display:inline-block;padding:0.15rem 0.55rem;border-radius:10px;font-size:0.7rem;font-weight:600;letter-spacing:0.02em;}
.cs-status-not-started{background:rgba(138,155,176,0.18);color:var(--cs-status-not-started);}
.cs-status-in-progress{background:rgba(124,58,237,0.15);color:var(--cs-status-in-progress);}
.cs-status-review{background:rgba(245,158,11,0.15);color:var(--cs-status-review);}
.cs-status-complete{background:rgba(16,185,129,0.15);color:var(--cs-status-complete);}
.cs-breadcrumb{background:#fff;border-bottom:1px solid #DEE3EA;padding:0.55rem 2rem;font-size:0.78rem;color:var(--cs-slate);}
.cs-breadcrumb a{color:var(--cs-navy);text-decoration:none;font-weight:500;}
.cs-breadcrumb a:hover{text-decoration:underline;}
.cs-breadcrumb .sep{margin:0 0.4rem;color:var(--cs-slate);}
.cs-breadcrumb .current{color:var(--cs-text-primary);font-weight:500;}
.cs-page-header{background:var(--cs-navy);padding:1.5rem 2rem;border-bottom:3px solid var(--cs-gold);}
.cs-page-header.module-m1{border-bottom-color:var(--cs-gold);}
.cs-page-header.module-m2{border-bottom-color:var(--cs-gold);}
.cs-page-header.module-m3{border-bottom-color:var(--cs-gold);}
.cs-page-header.module-m4{border-bottom-color:var(--cs-gold);}
.cs-page-header.module-m5{border-bottom-color:var(--cs-gold);}
.cs-flash-container{max-width:1300px;margin:1rem auto;padding:0 1.2rem;}
.cs-flash{padding:0.7rem 1rem;border-radius:6px;margin-bottom:0.8rem;font-size:0.85rem;font-weight:500;display:flex;justify-content:space-between;align-items:center;}
.cs-flash.alert-success{background:rgba(16,185,129,0.1);border:1px solid rgba(16,185,129,0.3);color:#065F46;}
.cs-flash.alert-info{background:rgba(124,58,237,0.08);border:1px solid rgba(124,58,237,0.25);color:#5B21B6;}
.cs-flash.alert-warning{background:rgba(245,158,11,0.1);border:1px solid rgba(245,158,11,0.3);color:#92400E;}
.cs-flash.alert-danger{background:rgba(220,38,38,0.08);border:1px solid rgba(220,38,38,0.25);color:#991B1B;}
.cs-flash-close{background:none;border:none;color:inherit;cursor:pointer;font-size:1.1rem;opacity:0.6;padding:0 0.3rem;}
.cs-flash-close:hover{opacity:1;}
.cs-content{flex:1;width:100%;}
.cs-footer{background:#fff;border-top:1px solid #DEE3EA;padding:1rem 2rem;text-align:center;font-size:0.72rem;color:var(--cs-slate);}
.cs-footer .copyright{font-weight:500;color:var(--cs-text-primary);}
.cs-footer .disclosure{margin-top:0.3rem;max-width:780px;margin-left:auto;margin-right:auto;line-height:1.5;}
.cs-mobile-toggle{display:none;background:transparent;border:1px solid rgba(200,169,106,0.3);color:var(--cs-gold);padding:0.4rem 0.6rem;border-radius:4px;cursor:pointer;font-size:1rem;}
@media (max-width:1279px){
  .cs-ribbon{gap:1rem;padding:0 1.2rem;}
}
@media (max-width:1023px){
  .cs-ribbon{gap:0.6rem;}
  .cs-ribbon-admin-trigger,.cs-ribbon-projects-trigger,.cs-ribbon-user-trigger{padding:0.4rem 0.6rem;font-size:0.78rem;}
}
@media (max-width:767px){
  .cs-mobile-toggle{display:flex;}
  .cs-ribbon-admin,.cs-ribbon-dashboard,.cs-ribbon-projects,.cs-ribbon-user{display:none;}
  .cs-ribbon.mobile-open .cs-ribbon-admin,.cs-ribbon.mobile-open .cs-ribbon-dashboard,.cs-ribbon.mobile-open .cs-ribbon-projects,.cs-ribbon.mobile-open .cs-ribbon-user{display:flex;}
  .cs-ribbon.mobile-open{flex-direction:column;height:auto;padding:0.6rem 1.2rem;align-items:stretch;}
  .cs-breadcrumb{padding:0.55rem 1.2rem;font-size:0.72rem;}
  .cs-status-badge{font-size:0.65rem;padding:0.1rem 0.4rem;}
}
button,a{font-family:inherit;}
button:focus-visible,a:focus-visible{outline:2px solid var(--cs-gold);outline-offset:2px;}


/* ════════════════════════════════════════════════════════════════════════
   CentraSolver floating dock (B3.13.5.A.flow-2 - bottom-right persistent)
   Auth-gated by markup in base_shell.html via current_user.is_authenticated
   ════════════════════════════════════════════════════════════════════════ */
.cs-solver-dock {
  position: fixed; right: 28px; bottom: 28px; z-index: 900;
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,23,46,0.85);
  border: 1px solid rgba(200,169,106,0.32);
  border-radius: 50%;
  backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 8px 28px rgba(0,0,0,0.32), 0 0 24px rgba(200,169,106,0.18);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.25s, border-color 0.2s;
}
.cs-solver-dock:hover {
  transform: translateY(-2px);
  border-color: rgba(200,169,106,0.6);
  box-shadow: 0 10px 32px rgba(0,0,0,0.36), 0 0 36px rgba(200,169,106,0.32);
}
.cs-solver-dock img { width: 44px; height: 44px; display: block; object-fit: contain; }
.cs-solver-dock::after {
  content: ""; position: absolute; inset: -6px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(200,169,106,0.18) 0%, transparent 70%);
  animation: cs-dock-breath 5s ease-in-out infinite;
  z-index: -1;
}
@keyframes cs-dock-breath {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 1.0;  transform: scale(1.08); }
}
.cs-solver-dock-label {
  position: absolute; right: 78px; top: 50%; transform: translateY(-50%);
  background: rgba(8,23,46,0.78);
  color: rgba(240,235,220,0.82);
  border: 1px solid rgba(200,169,106,0.22);
  padding: 7px 13px; border-radius: 3px;
  font-family: 'Inter', sans-serif; font-size: 10.5px;
  letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  pointer-events: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.cs-solver-dock:hover .cs-solver-dock-label {
  color: #C8A96A;
  border-color: rgba(200,169,106,0.55);
  background: rgba(8,23,46,0.92);
}
/* Hide the label on mobile to save horizontal space */
@media (max-width: 720px) {
  .cs-solver-dock-label { display: none; }
}

/* Home link in the ribbon (B3.13.5.A.flow-2) */
.cs-ribbon-home {
  color: rgba(240,235,220,0.72);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none;
  padding: 0 14px;
  margin-left: 4px;
  line-height: 64px;
  transition: color 0.2s;
}
.cs-ribbon-home:hover { color: #C8A96A; }

@media (prefers-reduced-motion: reduce) {
  .cs-solver-dock::after { animation: none !important; }
}
@media (max-width: 720px) {
  .cs-solver-dock { width: 52px; height: 52px; right: 16px; bottom: 16px; }
  .cs-solver-dock img { width: 36px; height: 36px; }
  .cs-ribbon-home { padding: 0 8px; font-size: 10px; }
}


/* ════════════════════════════════════════════════════════════════════════
   Feedback link + modal (B3.13.5.A.flow-3 - quiet practitioner feedback)
   ════════════════════════════════════════════════════════════════════════ */
.cs-ribbon-feedback {
  background: transparent; border: none; cursor: pointer;
  color: rgba(240,235,220,0.62);
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.10em; text-transform: uppercase;
  padding: 0 12px;
  line-height: 64px;
  transition: color 0.2s;
}
.cs-ribbon-feedback:hover { color: #C8A96A; }

.cs-feedback-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.cs-feedback-modal[hidden] { display: none; }
.cs-feedback-backdrop {
  position: absolute; inset: 0;
  background: rgba(8,23,46,0.62);
  backdrop-filter: blur(8px);
}
.cs-feedback-panel {
  position: relative; z-index: 1;
  width: min(560px, 92vw);
  max-height: 92vh; overflow-y: auto;
  background: #FAF8F2;
  border: 1px solid rgba(11,31,58,0.10);
  border-radius: 4px;
  padding: 44px 48px 36px;
  box-shadow: 0 24px 72px rgba(0,0,0,0.32);
  animation: cs-feedback-rise 0.32s ease;
}
@keyframes cs-feedback-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cs-feedback-eyebrow {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 18px;
}
.cs-feedback-rule { width: 36px; height: 1.5px; background: #C8A96A; }
.cs-feedback-eyebrow span {
  font-size: 11px; letter-spacing: 0.20em;
  text-transform: uppercase; color: #C8A96A; font-weight: 700;
}
.cs-feedback-title {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: 26px; font-weight: 500;
  color: #0B1F3A; line-height: 1.25;
  margin-bottom: 10px; letter-spacing: -0.005em;
}
.cs-feedback-sub {
  font-size: 13px; line-height: 1.6;
  color: #3A4456; margin-bottom: 26px;
}
.cs-feedback-form {
  display: flex; flex-direction: column; gap: 22px;
}
.cs-feedback-categories { border: none; padding: 0; margin: 0; }
.cs-feedback-legend {
  font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: #6B7280; font-weight: 600;
  margin-bottom: 10px;
}
.cs-feedback-cat {
  display: inline-flex; align-items: center; gap: 6px;
  margin-right: 16px; cursor: pointer;
  font-size: 13px; color: #0B1F3A;
}
.cs-feedback-cat input[type="radio"] { accent-color: #C8A96A; }
.cs-feedback-field { display: flex; flex-direction: column; gap: 8px; }
.cs-feedback-label {
  font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: #6B7280; font-weight: 600;
}
.cs-feedback-form textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: 'Inter', sans-serif; font-size: 14px; line-height: 1.55;
  color: #0B1F3A;
  background: #FFFFFF;
  border: 1px solid rgba(11,31,58,0.18);
  border-radius: 2px;
  resize: vertical; min-height: 120px;
  transition: border-color 0.2s;
}
.cs-feedback-form textarea:focus {
  outline: none; border-color: #C8A96A;
}
.cs-feedback-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 4px;
}
.cs-feedback-cancel, .cs-feedback-submit {
  font-family: 'Inter', sans-serif;
  font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 600;
  padding: 11px 22px; cursor: pointer;
  border-radius: 2px; transition: all 0.2s;
}
.cs-feedback-cancel {
  background: transparent;
  color: #6B7280;
  border: 1px solid rgba(11,31,58,0.18);
}
.cs-feedback-cancel:hover { color: #0B1F3A; border-color: rgba(11,31,58,0.35); }
.cs-feedback-submit {
  background: #C8A96A; color: #0B1F3A; border: 1px solid #C8A96A;
}
.cs-feedback-submit:hover { background: #B8995A; border-color: #B8995A; }
.cs-feedback-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.cs-feedback-status {
  font-size: 12px; min-height: 18px;
  text-align: right; line-height: 1.5;
}
.cs-feedback-status.s-success { color: #2D6E4F; }
.cs-feedback-status.s-error   { color: #B14242; }

@media (max-width: 720px) {
  .cs-feedback-panel { padding: 32px 24px; }
  .cs-feedback-title { font-size: 22px; }
}


/* ════════════════════════════════════════════════════════════════════════
   CentraSolver chat panel (Phase 3 - expanding from dock)
   ════════════════════════════════════════════════════════════════════════ */
.cs-solver-panel {
  position: fixed; right: 28px; bottom: 108px; z-index: 950;
  width: 420px; max-width: calc(100vw - 56px);
  height: min(620px, calc(100vh - 156px));
  background: rgba(250,248,242,0.99);
  border: 1px solid rgba(11,31,58,0.18);
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(11,31,58,0.28), 0 0 32px rgba(200,169,106,0.10);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  transition: transform 0.22s ease-out, opacity 0.22s ease-out;
}
.cs-solver-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.cs-solver-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px;
  background: #0B1F3A;
  border-bottom: 1px solid rgba(200,169,106,0.30);
}
.cs-solver-panel-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: #C8A96A;
  margin-bottom: 4px;
}
.cs-solver-panel-title {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: 19px; font-weight: 500;
  color: white; letter-spacing: -0.005em;
  line-height: 1.2;
}
.cs-solver-panel-close {
  background: transparent; border: none; cursor: pointer;
  color: rgba(240,235,220,0.68);
  font-size: 26px; line-height: 1; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 2px;
  transition: color 0.2s, background 0.2s;
}
.cs-solver-panel-close:hover {
  color: #C8A96A;
  background: rgba(200,169,106,0.10);
}

.cs-solver-panel-scroll {
  flex: 1; overflow-y: auto;
  padding: 18px 20px 4px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(11,31,58,0.25) transparent;
}
.cs-solver-panel-scroll::-webkit-scrollbar { width: 6px; }
.cs-solver-panel-scroll::-webkit-scrollbar-thumb {
  background: rgba(11,31,58,0.25); border-radius: 3px;
}

.cs-solver-msg {
  font-size: 13.5px;
  line-height: 1.55;
  padding: 11px 14px;
  border-radius: 3px;
  max-width: 92%;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.cs-solver-msg-user {
  background: #0B1F3A;
  color: rgba(240,235,220,0.96);
  align-self: flex-end;
  border-bottom-right-radius: 1px;
}
.cs-solver-msg-assistant {
  background: white;
  color: #0B1F3A;
  border: 1px solid rgba(11,31,58,0.10);
  border-left: 3px solid #C8A96A;
  align-self: flex-start;
  border-bottom-left-radius: 1px;
}
.cs-solver-msg-welcome {
  background: rgba(200,169,106,0.08);
  border: 1px solid rgba(200,169,106,0.30);
  border-left-width: 3px;
  color: #3A4456;
  font-style: normal;
}

.cs-solver-panel-status {
  padding: 8px 22px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #6B7280;
  background: rgba(11,31,58,0.03);
  border-top: 1px solid rgba(11,31,58,0.06);
}
.cs-solver-panel-status.s-info::before {
  content: '· · ·  ';
  color: #C8A96A;
  font-weight: 700;
  letter-spacing: 0.2em;
}
.cs-solver-panel-status.s-error {
  color: #B14242;
  background: rgba(177,66,66,0.06);
}

.cs-solver-panel-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 18px 16px;
  background: white;
  border-top: 1px solid rgba(11,31,58,0.08);
}
.cs-solver-panel-input {
  flex: 1;
  resize: none;
  border: 1px solid rgba(11,31,58,0.18);
  border-radius: 3px;
  padding: 10px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
  color: #0B1F3A;
  background: #FAF8F2;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 44px;
  max-height: 120px;
}
.cs-solver-panel-input:focus {
  outline: none;
  border-color: #C8A96A;
  box-shadow: 0 0 0 3px rgba(200,169,106,0.14);
  background: white;
}
.cs-solver-panel-input:disabled {
  opacity: 0.6;
}
.cs-solver-panel-send {
  background: #C8A96A;
  color: #0B1F3A;
  border: none;
  border-radius: 3px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.cs-solver-panel-send:hover:not(:disabled) {
  background: #B8995A;
}
.cs-solver-panel-send:disabled {
  opacity: 0.5;
  cursor: wait;
}

@media (max-width: 720px) {
  .cs-solver-panel {
    right: 16px;
    bottom: 84px;
    width: calc(100vw - 32px);
    height: calc(100vh - 116px);
    max-width: none;
  }
}
