/* ==========================================================================
   VALSTR: Global Styles + Page Structure (Responsive)
   ========================================================================== */

/* ========== Theme Tokens ==========
   The Hub's colour roles (docs/design/tokens.md) are the platform's one source of colour (Camelot CM2). The legacy
   names below and the module sets (--bud-*, --app04-*) are aliases of them; hub.css keeps its own tokens.
   One deliberate difference from the Hub: muted text (--fg-3) is #6E6B74, which passes WCAG AA on the page background
   (4.6:1), where the Hub's #76737C does not (decided 30 Oct 2026). */
:root{
  --bg: #F2F0EF;
  --surface: #FFFFFF;
  --sunk: #E9E6E4;
  --line: #DEDAD7;
  --line-strong: #C9C4C0;
  --fg: #141318;
  --fg-2: #4B4952;
  --fg-3: #6E6B74;
  --brand: #0618F5;
  --brand-text: #0618F5;
  --brand-soft: #E2E4FE;
  --rail: #E7E4E2;
  --data: #0618F5;
  --track: #E2DFDC;
  --ok: #12795A;
  --warn: #B24A0A;
  --risk: #BF3328;
  --c1: #0618F5;
  --c2: #4F5CFA;
  --c3: #9198FB;
  --c4: #C2BEBA;
  /* Status tints, mixed from the surface so they follow dark mode; status text on them is 4.7:1 or more */
  --ok-soft: color-mix(in srgb, var(--ok) 10%, var(--surface));
  --warn-soft: color-mix(in srgb, var(--warn) 10%, var(--surface));
  --risk-soft: color-mix(in srgb, var(--risk) 10%, var(--surface));
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20,19,24,.05), 0 3px 10px rgba(20,19,24,.04);
  --shadow-lift: 0 18px 44px rgba(20,19,24,.16);
  --ease: cubic-bezier(.2,.8,.2,1);

  /* Legacy names, kept so existing rules follow the roles */
  --panel: var(--surface);
  --ink: var(--fg);
  --muted: var(--fg-3);
  --primary: var(--brand);
  --accent: var(--brand);
  --ring: var(--line);
  --tile: var(--brand-soft);
  --danger: var(--risk);
  /* Imported use case cards: white on brand blue (8.6:1 and 6.6:1 contrast, WCAG AA); decided 12 Oct, blue 30 Oct 2026 */
  --imported-bg: var(--brand);
  --imported-ink: #ffffff;
  /* Text on a brand fill: white in both themes, since the brand blue stays #0618F5 in dark (Camelot CM9) */
  --on-brand: #ffffff;
  /* Library spaces (docs/specs/library-redesign.md): the Artifact Store is --brand; Uploads teal (white text 5.8:1);
     the Vault the ink grey. Same in dark, where their text tints mix with white. */
  --s-uploads: #0E6E8C;
  --s-vault: #4B4952;
  --imported-muted: #d6e2ff;
}

/* Dark values (tokens.md), on every page since Camelot CM9: header.php sets data-theme from this browser's choice or
   the device setting. The Hub keeps its own tokens. */
:root[data-theme="dark"]:not([data-page="hub"]){
  color-scheme: dark;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  --shadow-lift: 0 20px 50px rgba(0,0,0,.55);
  --bg: #141318;
  --surface: #1D1C23;
  --sunk: #18171D;
  --line: #2C2B33;
  --line-strong: #3B3A44;
  --fg: #F2F0EF;
  --fg-2: #BDBAC2;
  --fg-3: #8C8994;
  --brand: #0618F5;
  --brand-text: #929BFF;
  --brand-soft: #1A1D4C;
  --rail: #0D0C10;
  --data: #4352FF;
  --track: #2D2C35;
  --ok: #4FC79B;
  --warn: #F2A25C;
  --risk: #FF7B6F;
  --c1: #3443FF;
  --c2: #6A75FF;
  --c3: #A4AAFF;
  --c4: #57555F;
}

/* Reset + Base */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:'Public Sans',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif !important;
  font-size:14px;
  line-height:1.5;
  color:var(--ink);
  background:var(--bg);
}
/* Links in the brand text, off the Hub (the browser's blue and visited purple were unreadable on dark). :where keeps
   it at the weakest specificity, so every link's own colour still wins. */
:where(:root:not([data-page="hub"])) a{color:var(--brand-text);}
/* Quirks mode (no doctype) stops tables inheriting the body's type; the Hub's scale is body 14px / 1.5 (Camelot CM3) */
table{font-size:inherit;line-height:inherit;}


.embed-box * {
	font-family: 'Public Sans',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif !important;
}

.input, input, select, textarea {
  font-family: 'Public Sans',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

/* ========== Utilities ========== */
.hidden{display:none !important;}
.center{text-align:center}
.muted{color:var(--muted)}
.small{font-size:.92rem}
.rounded{border-radius:var(--radius)}
.shadow{box-shadow:var(--shadow)}
.ring{border:1px solid var(--ring)}
.grid{display:grid}
.gap-xl{gap:10px}


/* ========== Cards ========== */

.flex-col{display:flex;flex-flow:row;align-items:stretch;gap:16px;}

@media (max-width:1200px){
  .flex-col{display:flex;flex-flow:row wrap;align-items:stretch;gap:16px;}
}

.card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px;
}
.card-title{
  margin:0 0 12px 4px;
  font-size:18px;
  font-weight:700;
  letter-spacing:-0.01em;
  color:var(--fg);
}

.card-col{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:14px;
  min-width: 25%;
  flex-grow: 1;
  display:flex;
  flex-direction:column;
}

/* Profile pages: read-only label and value list */
.profile-details{display:grid;grid-template-columns:max-content 1fr;gap:10px 24px;margin:0 0 0 4px;}
.profile-details dt{color:var(--muted);font-weight:600;}
.profile-details dd{margin:0;color:var(--ink);overflow-wrap:anywhere;}
.profile-reset-last{color:var(--muted);font-weight:600;}
.profile-overview{margin-top:16px;}
.profile-contact{display:flex;flex-wrap:wrap;align-items:center;gap:14px 18px;margin:0 0 0 4px;}
.profile-contact-photo{width:64px;height:64px;border-radius:50%;object-fit:cover;border:2px solid var(--ring);background:var(--panel);flex:0 0 auto;}
.profile-contact-text{display:flex;flex-direction:column;gap:2px;min-width:0;}
.profile-contact-text strong{color:var(--ink);font-size:17px;}
.profile-contact-text span{color:var(--muted);font-weight:600;}
.profile-overview .profile-details{margin:4px 0 0;gap:6px 16px;}
.profile-overview-note{margin:0;color:var(--muted);font-weight:600;}
.profile-overview-list{margin:4px 0 0;padding-left:18px;color:var(--muted);font-size:13px;line-height:1.6;}
.profile-overview-link{margin-top:auto;color:var(--brand-text);font-weight:700;text-decoration:none;}
.profile-overview-link:hover{text-decoration:underline;}
.profile-form{display:flex;flex-direction:column;gap:6px;margin:0 0 0 4px;max-width:640px;}
.profile-form h4{margin:14px 0 4px;color:var(--ink);font-size:17px;}
.profile-form h4:first-of-type{margin-top:0;}
.profile-form label{margin-top:8px;color:var(--muted);font-weight:600;}
.profile-form-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px;}
.profile-form-row{display:flex;gap:10px;}
.profile-form-row input{flex:2 1 0;min-width:0;}
.profile-form-row select{flex:1 1 0;min-width:0;}
.profile-form-check{display:flex;align-items:center;gap:8px;margin-top:4px;color:var(--ink);font-weight:500;}
.profile-form-check input{width:auto;}
/* The profile form's messages are banners (Camelot CM8): the status tint with the status colour as text. */
.profile-form-error{margin:0 0 12px 4px;padding:10px 14px 10px 30px;border:0;border-radius:12px;background:var(--risk-soft);color:var(--risk);font-size:13px;font-weight:500;}
.profile-form-notice{margin:0;padding:10px 14px;border:0;border-radius:12px;background:var(--ok-soft);color:var(--ok);font-size:13px;font-weight:500;}
@media (max-width:520px){
  .profile-details{grid-template-columns:1fr;gap:2px;}
  .profile-form-row{flex-direction:column;}
  .profile-details dd{margin-bottom:10px;}
}

/* The page header (Camelot CM6): the Hub's crumb, 30/700 title in ink and lede, on the page rather than in a panel.
   .card-description is every module's header; .page-crumb is the crumb, and the modules' own crumbs share its look. */
.card-description {
  background:none;
  border:0;
  border-radius:0;
  box-shadow:none;
  padding:4px 0 6px;
  min-width:280px;
  flex-grow:1;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.card-description p,
.card-description li,
.card-description label,
.card-description .small{
  margin:0;
  line-height:1.5;
  color:var(--fg-2);
  max-width:90ch;
}

.card-description p b{
  color:var(--fg);
  font-weight:600;
}

.card-description > * + *{
  margin-top:0;
}

.card-description h1{
  margin:0 0 4px;
  font-size:30px;
  font-weight:700;
  letter-spacing:-.02em;
  line-height:1.15;
  color:var(--fg);
}

.page-crumb{
  margin:0;
  font-size:13px;
  font-weight:600;
  color:var(--fg-3);
}
.card-description .page-crumb{ color:var(--fg-3); }
  
  .card-divider{
  background:var(--sunk);
  border:1px solid var(--ring);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:8px;
  height: 100%;
  max-width: 100px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  opacity: 0.6;
  cursor: pointer;
  transition: 0.3s;
  justify-content: start;
  align-items: center;
  overflow: hidden;
  }
  
  .small-col { 
	max-width: 30%;
	opacity: 0.6;
  }
  
  .card-divider:hover {
	  opacity: 1;
  }
  
  #large-left {
    transition: opacity 250ms ease, transform 350ms ease, visibility 0s linear 250ms;
  }
	#large-left.is-hidden {
	  opacity: 0;
	  transform: translateX(-8px);
	  visibility: hidden;           /* delayed via transition above */
	  transition: opacity 250ms ease, transform 350ms ease, visibility 0s;
	}
  


/* ========== Buttons ========== */
/* text-decoration: a link styled as a button (<a class="btn">) otherwise keeps the browser's underline (register C26). */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none;
  padding:10px 18px;border-radius:999px;border:1px solid transparent;cursor:pointer;font-size:14px;font-weight:600;line-height:1.4;
  transition:filter .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);}
/* Buttons (Camelot CM5): the Hub's flat brand pill for the main action, which brightens and lifts 1px on hover; a quiet
   secondary; destructive actions as a quiet outline in the risk red (open question 10). No gradient, no glow. */
.btn-primary{background:var(--brand);color:#fff;}
.btn-primary:hover:not(:disabled){filter:brightness(1.1);transform:translateY(-1px);box-shadow:0 8px 20px color-mix(in srgb, var(--brand) 25%, transparent);}
.btn-primary:active:not(:disabled){transform:none;box-shadow:none;}
.btn-ghost,.btn-secondary{background:var(--surface);color:var(--fg-2);border-color:var(--line);}
.btn-ghost:hover:not(:disabled),.btn-secondary:hover:not(:disabled){background:var(--sunk);color:var(--fg);border-color:var(--line-strong);}
.btn-danger{background:var(--surface);color:var(--risk);border-color:var(--risk);}
.btn-danger:hover:not(:disabled){background:var(--risk-soft);}
/* A disabled button looks disabled (CM5 review): faded, and no hover lift (the hover rules carry :not(:disabled)). */
.btn:disabled,.btn-wide:disabled{opacity:.55;cursor:not-allowed;}
.btn-danger:disabled{opacity:.45;cursor:not-allowed;}

/* ========== Inputs ========== */
.input,input,select,textarea{
  width:100%;padding:12px;border:1px solid var(--ring);border-radius:12px;background:var(--surface);color:var(--fg);
  font-size:1rem;outline:none;transition:box-shadow .15s,border-color .15s;
}
input:focus,select:focus,textarea:focus{
  border-color:var(--accent);box-shadow:0 0 0 4px rgba(43,107,255,.18);background:var(--surface);
}

button {
	font-family: 'Public Sans',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}



/* ==========================================================================
   Page Structure
   ========================================================================== */

/* Content */
.content{padding:10px;display:grid;gap:24px;}


.key-stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px;}
/* Stat tiles, the Hub's (Camelot CM7): a 13/600 label with a small muted icon, and the big number in ink. They open
   nothing, so they do not lift. */
.key-stat-tile{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:18px;
  min-height:130px;
  display:flex;
  flex-direction:column;
  gap:10px;
  box-shadow:var(--shadow);
}
.key-stat-head{display:flex;align-items:center;gap:8px;}
.key-stat-icon{display:inline-flex;flex-shrink:0;color:var(--fg-3);font-size:13px;}
.key-stat-label{font-size:13px;color:var(--fg-2);font-weight:600;line-height:1.3;}
.key-stat-value{margin-top:auto;font-size:32px;font-weight:700;line-height:1.1;letter-spacing:-.025em;font-variant-numeric:tabular-nums;color:var(--fg);}

/* ==========================================================================
   Embed Containers
   ========================================================================== */
.embed-box{
  border-radius:14px;
  min-height:200px;
  display:flex;align-items:center;justify-content:center;
  color:var(--muted);
  height: 100%;
  align-items: flex-start;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Large tablets / smaller desktops */
@media (max-width:1200px){
  .content{padding:16px}
}

/* Mobile */
@media (max-width:720px){
  .content{padding:14px}
  .card{padding:12px}
}

/* ==========================================================================
   Modules (modern card-style buttons)
   ========================================================================== */
.modules{
  display:flex;
  flex-direction:column;
  gap:16px;
  padding:20px;
}
.modules .card-title{
  margin:0 0 12px 4px;
}

.module-row{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  width:100%;
}

.module-row > .module-btn{
  max-width:300px;
}

/* Module tiles (Camelot CM7): white cards with the module's colour (--mod) on the icon and the progress bar. They open
   a page, so they lift on hover or focus as the Hub's tiles do; Reduce Motion keeps them still. */
.module-btn{
  --mod:var(--brand);
  display:grid;
  grid-template-rows:auto 1fr;
  align-items:start;
  gap:12px;
  min-height:188px;
  width:100%;
  padding:18px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  text-decoration:none;
  color:var(--fg);
  background:var(--surface);
  box-shadow:var(--shadow);
  transition:transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.module-btn:hover,
.module-btn:focus-visible,
.module-btn:focus-within{
  transform:translateY(-2px);
  box-shadow:var(--shadow-lift);
  border-color:var(--line-strong);
}
@media (prefers-reduced-motion:reduce){
  .module-btn{transition:none;}
  .module-btn:hover,.module-btn:focus-visible,.module-btn:focus-within{transform:none;}
}

.module-head{
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.module-icon{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  background: color-mix(in srgb, var(--mod) 12%, var(--surface));
}

.module-icon img{
  width: 26px;
  height: 26px;
  object-fit: contain;
}

/* A module drawn with a Font Awesome icon instead of an image (Strategy's knight). */
.module-icon i{
  font-size: 22px;
  color: var(--mod);
}

.module-title{
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.module-description{
  font-size: 13px;
  line-height: 1.45;
  color: var(--fg-2);
}

@media (max-width: 720px){
  .module-row > .module-btn{max-width:100%;}
  .module-btn{min-height:auto;}
}

/* ==========================================================================
   Main content: flexible column layout
   ========================================================================== */
/* Generic column: grows, but won’t get narrower than 280px */
.col{
  flex: 1 1 320px;              /* grow | shrink | preferred width */
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}


/* Column items often are cards; these keep a consistent look */
.col .card{ padding: 16px; }

/* Responsive tweaks */
@media (max-width: 980px){
  /* Columns naturally wrap; no extra rules required */
}
@media (max-width: 720px){
  .col{ min-width: 100%; }      /* stack to a single column on narrow screens */
}


/* ==========================================================================
   Progress Tracker / Flow Chart
   ========================================================================== */
:root{
  --circle: 36px;
  --tracker-line: 3px;
  --gap: 12px;
}

/* layout: the light tracker (Camelot CM6), modelled on Strategy's .app04-steps: a white panel, numbered dots joined by
   lines, done steps tinted brand and the current step filled brand. No gradient. */
.progress-tracker{
  display:flex;
  align-items:flex-start;
  gap:var(--gap);
  margin:0;
  padding:16px 18px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:none;
}

/* steps */
.progress-step{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.progress-circle{
  width: var(--circle);
  height: var(--circle);
  border-radius: 50%;
  background:var(--surface);
  border:2px solid var(--line);
  color:var(--fg-3);
  display:grid;
  place-items:center;
  font-weight:700;
  transition:background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}

.progress-label{
  margin-top:6px;
  font-size:13px;
  font-weight:600;
  color:var(--fg-3) !important;
  line-height:1.3;
  max-width:16ch;
  text-wrap:balance;
}

.progress-label > a {
  color:var(--fg-3) !important;
  text-decoration:none;
  border-radius:4px;
}
.progress-label > a:hover { text-decoration:underline; }
.progress-label > a:focus-visible { outline:2px solid var(--brand-text); outline-offset:2px; }

.completed > .progress-label > a {
  color:var(--fg-2) !important;
}

.active > .progress-label > a {
  color:var(--fg) !important;
  font-weight:700;
}

/* connectors between steps: a line through the dots' centres */
.progress-connector{
  flex:1 1 auto;          /* this makes the line stretch between circles */
  height:var(--tracker-line);
  margin-top:calc(var(--circle) / 2 - var(--tracker-line) / 2);
  background:var(--line);
  border-radius:999px;
}

/* states */
.progress-step.completed .progress-circle{ background:var(--brand-soft); color:var(--brand-text); border-color:var(--brand); }
.progress-step.active .progress-circle{
  background:var(--brand);
  color:#fff;
  border-color:var(--brand);
  box-shadow:none;
  transform:none;
}

.progress-step.completed .progress-label{ color:var(--fg-2) !important; }
.progress-step.active .progress-label{ color:var(--fg) !important; }
.progress-connector.completed{ background:var(--brand); }

/* stack on narrow screens */
@media (max-width: 720px){
  .progress-tracker{
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .progress-connector{ display: none; }
  .progress-step{
    flex-direction: row;
    align-items: center;
    gap: 12px;
    text-align: left;
  }
  .progress-label{ margin-top: 0; max-width: none; }
}
/* ==========================================================================
   Right-aligned Button Menu
   ========================================================================== */
.button-menu{
  display: flex;
  justify-content: flex-end;  /* push buttons to the right */
  gap: 16px;
  margin: 20px 0;
  flex-wrap: wrap;             /* allows wrap on smaller screens */
}

.button-menu .btn-wide, #goals-assistant button{
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  text-decoration: none;
  transition: filter .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}

.button-menu .btn-wide:hover:not(:disabled), #goals-assistant button:hover:not(:disabled){
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 25%, transparent);
}

.btn-wide{
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  text-decoration: none;
  transition: filter .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}

.btn-wide:hover:not(:disabled){
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 25%, transparent);
}

.btn-wide:active:not(:disabled), .button-menu .btn-wide:active:not(:disabled), #goals-assistant button:active:not(:disabled){
  transform: none;
  box-shadow: none;
}

/* Help is a secondary action: the quiet style, not the old cyan gradient. !important because it sits on .btn-wide in
   page action rows that set their own background. */
.help-btn {
  background: var(--surface) !important;
  color: var(--fg-2) !important;
  border: 1px solid var(--line) !important;
}
.help-btn:hover:not(:disabled) {
  background: var(--sunk) !important;
  color: var(--fg) !important;
  border-color: var(--line-strong) !important;
  filter: none !important;
  transform: none !important;
  box-shadow: none !important;
}

@media (prefers-reduced-motion: reduce){
  .btn, .btn-wide, .button-menu .btn-wide, #goals-assistant button, .help-btn{ transition: none; }
  .btn-primary:hover:not(:disabled), .btn-wide:hover:not(:disabled), .button-menu .btn-wide:hover:not(:disabled), #goals-assistant button:hover:not(:disabled){ transform: none; }
}



/* Mobile: stack buttons full width */
@media (max-width: 720px){
  .button-menu{
    justify-content: center;
  }
  .button-menu .btn-wide{
    flex: 1 1 100%;
    min-width: unset;
  }
}

/* RAG TABLE */

.rag-table {
	width: 100%;
	margin: 10px;
	font-style: normal;
}

.rag-row {
  display: flex;
  border: 1px solid #262626;
  margin-bottom: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.rag-number {
  font-weight: bold;
  padding: 12px 20px;
  min-width: 60px;
  text-align: center;
  color: black;
}

/* Levels with RAG colors */
.level-1 {
  background-color: #e53935; /* red */
}

.level-2 {
  background-color: #fb8c00; /* orange */
}

.level-3 {
  background-color: #fdd835; /* yellow */
}

.level-4 {
  background-color: #43a047; /* light green */
}

.level-5 {
  background-color: #2e7d32; /* dark green */
}

.rag-text {
  padding: 12px;
  flex: 1;
  color: var(--fg);
}
/* In dark the statement rows keep a visible edge: the near-black border vanishes on the dark card (CM9 beta check). */
:root[data-theme="dark"]:not([data-page="hub"]) .rag-row{border-color:var(--line-strong);}

/* CHECKBOXES */

:root {
  --form-control-color: green;
  --form-control-disabled: #959495;
}

input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 0.82rem;
  height: 0.82rem;
  margin: 2px 0 2px 0;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface);
  display: inline-grid;
  place-content: center;
  transform: none;
  transition: background-color 120ms ease, border-color 120ms ease;
}

input[type="checkbox"]::before {
  content: "";
  width: 0.8em;
  height: 0.8em;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  transform: scale(0);
  transform-origin: bottom left;
  transition: 120ms transform ease-in-out;
  /* Windows High Contrast Mode */
  background-color: var(--brand);
}

input[type="checkbox"]:checked::before {
  transform: scale(1);
}

input[type="checkbox"]:focus {
  outline: max(2px, 0.15em) solid currentColor;
  outline-offset: max(2px, 0.15em);
}

input[type="checkbox"]:disabled {
  --form-control-color: var(--form-control-disabled);

  color: var(--form-control-disabled);
  cursor: not-allowed;
}


/* baseline */
.sticky-box {
  position: sticky;
  top: 90px;              /* or e.g. 16px */
  z-index: 1;          /* stay above content */
  background: var(--surface);    /* avoid see-through when fixed at top */
  /* optional: width: fit-content; or a fixed width if layout shifts */
}

/* ==========================================================================
   Help Modal
   ========================================================================== */

.help-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  cursor:pointer;
  font-family: 'Public Sans',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif !important;
}

.help-modal{
  position:fixed;
  inset:0;
  z-index:9999;
  display:grid;
  place-items:center;
}

/* Backdrop: the Hub's scrim (Camelot CM8) */
.help-backdrop{
  position:absolute;
  inset:0;
  background:rgba(10,9,14,.5);
  -webkit-backdrop-filter:blur(4px);
  backdrop-filter:blur(4px);
}

/* Dialog: the Hub's pop-up (20px corners, lifted shadow, no tinted header) */
.help-dialog{
  position:relative;
  width:min(720px, calc(100vw - 24px));
  max-height:calc(100vh - 24px);
  background:var(--surface);
  border:0;
  border-radius:20px;
  box-shadow:var(--shadow-lift);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

/* Header */
.help-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:20px 20px 8px 24px;
}

.help-title{
  margin:0;
  font-size:21px;
  font-weight:700;
  letter-spacing:-.01em;
}

.help-close{
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  border-radius:50%;
  border:1px solid var(--line);
  background:var(--surface);
  color:var(--fg-2);
  cursor:pointer;
  font-size:20px;
  line-height:1;
  transition:background-color .2s, color .2s;
}
.help-close:hover{ background:var(--sunk); color:var(--fg); }

/* Body */
.help-body{
  padding:8px 24px 16px;
  overflow:auto;
  color:var(--ink);
}
.help-body p{ margin:0 0 12px; color:var(--ink); }
.help-body .muted{ color:var(--muted); }

/* Footer */
.help-footer{
  padding:14px 20px;
  border-top:1px solid var(--line);
  display:flex;
  justify-content:flex-end;
  gap:10px;
  background:var(--surface);
}

/* The shared confirm and alert dialog (scripts/valstr-dialog.js), in place of the browser's own boxes (Camelot CM8). */
.valstr-dialog{
  width:min(440px, calc(100vw - 32px));
  border:0;
  border-radius:20px;
  padding:24px;
  background:var(--surface);
  color:var(--fg);
  box-shadow:var(--shadow-lift);
}
.valstr-dialog::backdrop{ background:rgba(10,9,14,.5); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); }
.valstr-dialog-msg{ margin:0 0 20px; font-size:15px; line-height:1.5; white-space:pre-line; overflow-wrap:anywhere; }
.valstr-dialog-acts{ display:flex; justify-content:flex-end; flex-wrap:wrap; gap:10px; }
.valstr-dialog-acts [hidden]{ display:none; }

/* Dialogs move as the Hub's (Camelot CM8): the box grows and fades in over 450ms and the scrim fades in; a drawer slides
   in from the right; the full-screen viewer fades. The inner box moves, never the dialog holding a fixed close button,
   and every fill is backwards only (P70). Closing stays instant: Safari cannot animate a native dialog's close. */
@keyframes valstr-dialog-in{ from{ opacity:0; transform:translateY(8px) scale(.97); } }
@keyframes valstr-fade-in{ from{ opacity:0; } }
@keyframes valstr-drawer-in{ from{ transform:translateX(100%); } }
/* A toast rises and fades in over 220ms; its resting transform centres it (translateX(-50%)). */
@keyframes valstr-toast-in{ from{ opacity:0; transform:translate(-50%, 12px); } }
.help-modal:not(.hidden) .help-dialog,
.valstr-dialog[open],
.app05-modal[open] .app05-modal-scroll,
.bud-modal[open],
.files_qv[open]{ animation:valstr-dialog-in .45s var(--ease) backwards; }
.help-modal:not(.hidden) .help-backdrop,
.valstr-dialog[open]::backdrop,
.app05-modal[open]::backdrop,
.bud-modal[open]::backdrop,
.bud-drawer[open]::backdrop,
.dv[open]{ animation:valstr-fade-in .35s ease backwards; }
.bud-drawer[open]{ animation:valstr-drawer-in .45s var(--ease) backwards; }
@media (prefers-reduced-motion:reduce){
  .help-modal:not(.hidden) .help-dialog, .valstr-dialog[open], .app05-modal[open] .app05-modal-scroll, .bud-modal[open], .files_qv[open],
  .help-modal:not(.hidden) .help-backdrop, .valstr-dialog[open]::backdrop, .app05-modal[open]::backdrop, .bud-modal[open]::backdrop,
  .bud-drawer[open]::backdrop, .dv[open], .bud-drawer[open]{ animation:none; }
}

/* One empty state, the quiet panel (Camelot CM8): a soft well with a small muted icon, a 14/600 title in ink and a 13px
   line. Never styled as an error: a failure is a banner. The module families (.app05-empty, .app04-empty,
   .file-checklist-empty) carry the same values. */
.empty-state{
  position:relative;
  margin:0;
  padding:14px 16px 14px 42px;
  border:0;
  border-radius:12px;
  background:var(--sunk);
  color:var(--fg-2);
  font-size:13px;
}
.empty-state::before{
  content:"\f01c";
  content:"\f01c" / "";
  position:absolute;
  left:16px;
  top:16px;
  font:normal 900 13px/1 "Font Awesome 7 Free";
  color:var(--fg-3);
}
.empty-state strong{ display:block; margin:0 0 2px; color:var(--fg); font-size:14px; font-weight:600; }
.empty-state p{ margin:0; }

/* Settings (Camelot CM10): the Default theme toggle is the Hub's Light | Dark pill, and choosing cross-fades the page
   through the browser's view transition (scripts/settings.js), 350ms, never under Reduce Motion. */
.settings-card{display:flex;flex-direction:column;gap:12px;align-items:flex-start;}
.settings-lede,.settings-note{margin:0 0 0 4px;color:var(--fg-2);font-size:13px;}
.settings-theme{margin:0 0 0 4px;}
.theme-toggle{display:inline-flex;padding:3px;border:1px solid var(--line);border-radius:999px;background:var(--surface);}
.theme-toggle button{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border:0;border-radius:999px;background:transparent;color:var(--fg-3);font:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:background-color .25s,color .25s;}
.theme-toggle button:hover{color:var(--fg);}
.theme-toggle button[aria-pressed="true"]{background:var(--fg);color:var(--bg);}
.theme-toggle button:focus-visible{outline:2px solid var(--brand);outline-offset:2px;}
:where(:root:not([data-page="hub"]))::view-transition-group(root),
:where(:root:not([data-page="hub"]))::view-transition-old(root),
:where(:root:not([data-page="hub"]))::view-transition-new(root){animation-duration:.35s;}
@media (prefers-reduced-motion:reduce){
  .theme-toggle button{transition:none;}
  :where(:root:not([data-page="hub"]))::view-transition-group(*),
  :where(:root:not([data-page="hub"]))::view-transition-old(*),
  :where(:root:not([data-page="hub"]))::view-transition-new(*){animation:none !important;}
}

/* Profile (profile/edit_profile.php; docs/specs/profile-redesign.md, PR1), from the design canvas's Profile artboard. The
   Organisation profile owns .profile-*, so these are .account-*. The summary card, the section nav, cards with a
   ruled head, 44px fields with 10px corners and a 1px brand focus ring, and the save bar: a pill that grows in from
   the bottom (450ms) once a field changes, amber while unsaved, green once saved. Without script (scripts/profile.js
   adds .is-enhanced) the bar sits under the form, always shown. The nav and cards rise after the header and summary,
   continuing CM6's 90ms steps; every fill is backwards only (P70). */
.account-summary{display:flex;flex-wrap:wrap;align-items:center;gap:20px;padding:24px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);}
.account-avatar{display:flex;align-items:center;justify-content:center;flex:none;width:88px;height:88px;border-radius:999px;background:var(--brand-soft);color:var(--brand-text);font-size:30px;font-weight:700;}
.account-who{flex:1 1 260px;min-width:0;}
.account-who p{margin:0;}
.account-name{color:var(--fg);font-size:18px;font-weight:700;line-height:1.3;}
.account-job{color:var(--fg-2);}
.account-email{color:var(--fg-3);overflow-wrap:anywhere;}
.account-name.is-empty,.account-job.is-empty{color:var(--fg-3);}
.account-layout{display:flex;flex-wrap:wrap;align-items:flex-start;gap:28px;}
.account-nav{display:flex;flex-direction:column;gap:2px;flex:1 1 210px;max-width:100%;}
.account-nav a{display:flex;align-items:center;gap:10px;min-height:40px;padding:8px 12px;border-radius:10px;color:var(--fg-2);font-weight:500;text-decoration:none;transition:background-color .2s var(--ease),color .2s var(--ease);}
.account-nav a:hover{background:var(--sunk);color:var(--fg);}
.account-nav a[aria-current="true"]{background:var(--brand-soft);color:var(--brand-text);font-weight:600;}
.account-nav a:focus-visible{outline:2px solid var(--brand-text);outline-offset:2px;}
.account-nav i{width:17px;font-size:15px;text-align:center;}
.account-form{display:flex;flex-direction:column;gap:20px;flex:999 1 560px;min-width:0;}
.account-form.is-enhanced{padding-bottom:88px;}
.account-card{scroll-margin-top:20px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);}
.account-card-head{padding:20px 24px 16px;border-bottom:1px solid var(--line);}
.account-card-head h2{margin:0;color:var(--fg);font-size:18px;font-weight:700;}
.account-card-head p{margin:2px 0 0;color:var(--fg-3);font-size:13px;}
/* At most three to a row, as on the canvas (First, Last, Job title; then Team and Work email), on wide pages too. */
.account-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,max(240px,calc((100% - 40px) / 3))),1fr));gap:16px 20px;padding:20px 24px 24px;}
.account-field{display:flex;flex-direction:column;gap:6px;min-width:0;}
.account-field label{color:var(--fg-2);font-size:13px;font-weight:600;}
.account-field input{height:44px;box-sizing:border-box;padding:0 14px;border:1px solid var(--line-strong);border-radius:10px;background:var(--surface);color:var(--fg);font:inherit;transition:border-color .2s var(--ease);}
.account-field input:hover{border-color:var(--fg-3);}
.account-field input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 1px var(--brand);background:var(--surface);}
.account-field input[aria-invalid="true"]{border-color:var(--risk);}
.account-field input[readonly],.account-field input[readonly]:hover,.account-field input[readonly]:focus{border-color:var(--line);background:var(--sunk);color:var(--fg-2);}
.account-field input[readonly]:focus{box-shadow:0 0 0 1px var(--fg-3);}
.account-field-error,.account-field-help{margin:0;font-size:13px;}
.account-field-error{color:var(--risk);}
.account-field-help{color:var(--fg-3);}
.account-rows{padding:8px 24px 20px;}
.account-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 16px;padding:14px 0 0;}
.account-row-main{display:flex;align-items:center;gap:12px;flex:1 1 260px;min-width:0;}
.account-row-icon{display:flex;align-items:center;justify-content:center;flex:none;width:40px;height:40px;border:1px solid var(--line);border-radius:10px;background:var(--sunk);color:var(--fg-2);}
.account-row-title,.account-row-text{margin:0;}
.account-row-title{color:var(--fg);font-weight:600;}
.account-row-text{color:var(--fg-3);font-size:13px;}
.account-savebar{display:flex;flex-wrap:wrap;align-items:center;gap:12px 16px;align-self:flex-end;max-width:100%;box-sizing:border-box;padding:10px 10px 10px 20px;background:var(--surface);border:1px solid var(--line-strong);border-radius:999px;box-shadow:var(--shadow);}
.account-savebar-status{margin:0;}
.account-savebar[data-state="idle"]{padding-left:10px;}
.account-savebar[data-state="idle"] .account-savebar-status{display:none;}
.account-savebar-status span{display:none;align-items:center;gap:6px;font-weight:600;}
.account-savebar[data-state="dirty"] .is-dirty{display:inline-flex;color:var(--warn);}
.account-savebar[data-state="saving"] .is-saving{display:inline-flex;color:var(--fg-2);}
.account-savebar[data-state="saved"] .is-saved{display:inline-flex;color:var(--ok);}
.account-savebar .is-saving i{animation:valstr-gear-spin .9s linear infinite;}
.account-savebar-acts{display:inline-flex;gap:8px;}
.account-form.is-enhanced .account-savebar{position:fixed;z-index:50;left:var(--valstr-nav-w);right:0;bottom:24px;width:fit-content;max-width:calc(100% - var(--valstr-nav-w) - 32px);margin:0 auto;transform-origin:50% 100%;animation:valstr-grow .45s var(--ease) backwards;transition:opacity .3s ease;}
.account-form.is-enhanced .account-savebar[data-state="idle"]{display:none;}
.account-form.is-enhanced .account-savebar[data-state="saved"]{padding-right:20px;}
.account-form.is-enhanced .account-savebar[data-state="saved"] .account-savebar-acts{display:none;}
.account-form.is-enhanced .account-savebar.is-leaving{opacity:0;}
@keyframes valstr-grow{from{opacity:0;transform:scale(.88);}}
.account-layout > .account-nav{animation:valstr-rise .6s var(--ease) 180ms backwards;}
.account-form > .account-card:nth-of-type(1){animation:valstr-rise .6s var(--ease) 270ms backwards;}
.account-form > .account-card:nth-of-type(2){animation:valstr-rise .6s var(--ease) 360ms backwards;}
@media (min-width:981px) and (hover:hover){
  .account-form.is-enhanced .account-savebar{left:var(--valstr-rail-w);max-width:calc(100% - var(--valstr-rail-w) - 32px);}
}
@media (max-width:980px){
  .account-card{scroll-margin-top:72px;}
  .account-form.is-enhanced .account-savebar{left:0;bottom:16px;max-width:calc(100% - 32px);}
}
@media (max-width:720px){
  .account-nav{flex-direction:row;flex-wrap:wrap;gap:4px;}
}
@media (max-width:520px){
  .account-summary{padding:20px;}
  .account-card-head{padding:16px 20px 14px;}
  .account-fields{padding:16px 20px 20px;}
  .account-rows{padding:4px 20px 18px;}
  .account-savebar{border-radius:20px;}
}
@media (prefers-reduced-motion:reduce){
  .account-layout > .account-nav,.account-form > .account-card,.account-form.is-enhanced .account-savebar,.account-savebar .is-saving i{animation:none !important;}
  .account-nav a,.account-field input,.account-form.is-enhanced .account-savebar{transition:none;}
}

/* Organisation settings on Settings, for administrators only (docs/specs/profile-redesign.md, PR2), from the canvas's
   Organisation settings artboard: a collapsible "Irreversible actions" card (a native details element, so it opens
   without script; the chevron turns and the body fades in), the reset row with a risk-red outline button, and the
   confirmation dialog on CM8's dialog (what is removed in --risk, what is kept in --ok, the typed name). The profile
   summary's "Admin" chip is on --brand-soft. */
.account-who .account-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;}
.account-chip{display:inline-flex;align-items:center;padding:3px 10px;border-radius:999px;background:var(--brand-soft);color:var(--brand-text);font-size:12px;font-weight:600;}
.settings-org{display:flex;flex-direction:column;gap:16px;}
.settings-org-head h2{margin:0;color:var(--fg);font-size:18px;font-weight:700;}
.settings-org-head p{margin:2px 0 0;color:var(--fg-2);}
.settings-irreversible{padding:4px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);}
.settings-irreversible summary{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;padding:16px 20px 12px;border-radius:12px;color:var(--fg);list-style:none;cursor:pointer;}
.settings-irreversible summary::-webkit-details-marker{display:none;}
.settings-irreversible summary:focus-visible{outline:2px solid var(--brand-text);outline-offset:2px;}
.settings-irreversible-title{display:block;font-size:18px;font-weight:700;}
.settings-irreversible-sub{display:block;margin-top:2px;color:var(--fg-3);font-size:13px;}
.settings-irreversible summary i{flex:none;color:var(--fg-2);transition:transform .3s var(--ease);}
.settings-irreversible[open] summary i{transform:rotate(180deg);}
.settings-irreversible-body{margin:4px 12px 12px;padding:20px;border:1px solid var(--line);border-radius:12px;}
.settings-irreversible[open] .settings-irreversible-body{animation:valstr-fade-in .3s var(--ease) backwards;}
.settings-reset-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;}
.settings-reset-main{flex:1 1 360px;min-width:0;}
.settings-reset-main p{margin:0;color:var(--fg-2);}
.settings-reset-main .settings-reset-title{color:var(--fg);font-weight:600;}
.settings-reset-main .settings-reset-last{margin-top:4px;color:var(--fg-3);font-size:13px;}
.settings-reset-done{display:flex;align-items:center;gap:6px;margin:0;color:var(--ok);font-size:13px;font-weight:600;}
.settings-reset-done:not(:empty)::before{content:"\f058";content:"\f058" / "";font:normal 900 14px/1 "Font Awesome 7 Free";}
/* The Organisation Profile's quiet link to the reset, for administrators. */
.profile-reset-link{margin:0;color:var(--fg-3);font-size:13px;}
.profile-reset-link a{color:var(--brand-text);font-weight:600;}
/* Two rows in the card (Reset the organisation; Reset the Vault), ruled apart. */
.settings-reset-row + .settings-reset-row{margin-top:20px;padding-top:20px;border-top:1px solid var(--line);}
/* The reset dialogs (docs/specs/org-reset-v2.md, R3): the typed-confirmation dialog's box, a head with a round close
   button, banners in the spec's order, the contact line, and the typed name. The panel is wider for its option cards;
   the browser scrolls a dialog taller than the window. */
.settings-reset-dialog{width:min(540px, calc(100vw - 32px));padding:28px;}
.settings-reset-panel{width:min(680px, calc(100vw - 32px));}
.settings-reset-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin:0 0 16px;}
.settings-reset-dialog h2{margin:0;color:var(--fg);font-size:18px;font-weight:700;overflow-wrap:anywhere;}
.settings-reset-head h2:focus{outline:none;}
.settings-reset-close{flex:none;display:grid;place-items:center;width:36px;height:36px;padding:0;border:1px solid var(--line);border-radius:999px;background:var(--surface);color:var(--fg-2);font-size:15px;cursor:pointer;transition:background-color .2s var(--ease);}
.settings-reset-close:hover{background:var(--sunk);}
.settings-reset-close:focus-visible{outline:2px solid var(--brand-text);outline-offset:2px;}
.settings-reset-dialog .banner{margin:0 0 12px;}
.settings-reset-dialog .banner a{color:inherit;font-weight:600;text-decoration:underline;}
.settings-reset-contact{margin:0 0 20px;color:var(--fg-2);font-size:13px;}
.settings-reset-contact a{color:var(--brand-text);font-weight:600;}
.settings-reset-dialog label[for]{display:block;margin-top:20px;color:var(--fg);font-size:13px;font-weight:600;}
.settings-reset-dialog input[type="text"]{width:100%;height:44px;box-sizing:border-box;margin-top:6px;padding:0 14px;border:1px solid var(--line-strong);border-radius:10px;background:var(--surface);color:var(--fg);font:inherit;transition:border-color .2s var(--ease);}
.settings-reset-dialog input[type="text"]:hover{border-color:var(--fg-3);}
.settings-reset-dialog input[type="text"]:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 1px var(--brand);}
.settings-reset-error{margin:8px 0 0;color:var(--risk);font-size:13px;}
.settings-reset-dialog .valstr-dialog-acts{margin-top:24px;}
/* Option cards: a native tick box in a card with its name and a line, two to a row (one on a phone); a ticked card takes
   the brand ring and tint, as a selected use case card does. Everything and All modules span the row. */
.settings-reset-options{min-width:0;margin:0 0 16px;padding:0;border:0;}
.settings-reset-options legend{margin:0 0 8px;padding:0;color:var(--fg);font-size:13px;font-weight:600;}
.settings-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
.settings-option{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:10px;row-gap:2px;align-items:start;align-content:start;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--surface);cursor:pointer;transition:border-color .2s var(--ease),background-color .2s var(--ease);}
.settings-option.is-wide{grid-column:1 / -1;}
.settings-option:hover{border-color:var(--line-strong);}
.settings-option:has(input:checked){border-color:var(--brand);background:var(--brand-soft);}
/* Everything or All modules with only some parts ticked: the ring without the tint, so it does not read as chosen. */
.settings-option:has(input:indeterminate){border-color:var(--brand);}
.settings-option:has(input:focus-visible){outline:2px solid var(--brand-text);outline-offset:2px;}
.settings-option input{grid-row:span 2;width:18px;height:18px;margin:1px 0 0;accent-color:var(--brand);cursor:pointer;}
.settings-option-name{color:var(--fg);font-size:14px;font-weight:600;}
.settings-option-hint{color:var(--fg-2);font-size:13px;}
.settings-reset-note{margin:8px 0 0;color:var(--fg-3);font-size:13px;}
/* The preview banner: what goes, what stays and what else changes, updated as the ticks change and read out. */
.settings-reset-preview p{margin:0;}
.settings-reset-preview p + ul{margin:4px 0 10px;padding-left:18px;}
.settings-reset-preview ul:last-child{margin-bottom:0;}
.settings-reset-preview li + li{margin-top:2px;}
@media (max-width:540px){
  .settings-reset-dialog{padding:20px;}
  .settings-options{grid-template-columns:1fr;}
}
@media (prefers-reduced-motion:reduce){
  .settings-irreversible summary i,.settings-reset-dialog input[type="text"],.settings-reset-close,.settings-option{transition:none;}
  .settings-irreversible[open] .settings-irreversible-body{animation:none;}
}

/* The Library (files.php; docs/specs/library-redesign.md, L2), from Mukund's design. Three space cards act as tabs:
   each has its colour and the Hub's wipe (550ms), held on the selected space, a recorded exception to "the wipe stays
   the Hub's". Tables as CM7 (hairline rows, no header fill). A row opens the details drawer (slides in over 450ms and
   swaps its content); "Upload file" opens a pop-up that grows from the button (450ms, content after 220ms). Counts tick
   up. Every fill is backwards only (P70); Reduce Motion stops all of it. */
.library-org{display:inline-flex;align-items:center;padding:1px 10px;border-radius:999px;background:var(--brand-soft);color:var(--brand-text);font-weight:600;font-size:12.5px;}
.library-banners{display:grid;gap:8px;}
/* Grid children of .content: without this a wide table stretches the page instead of scrolling in its frame. */
.library-spaces,.library-panels,.library-panel{min-width:0;}
.library-banners:empty{display:none;}
.library-space-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:16px;}
.library-space{--sc:var(--brand);--sci:var(--sc);position:relative;isolation:isolate;overflow:hidden;display:flex;flex-direction:column;gap:10px;min-width:0;padding:20px;
  background:var(--surface);color:var(--fg);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);text-decoration:none;
  transition:transform .35s var(--ease),box-shadow .35s var(--ease),color .3s,border-color .3s;}
.library-space[data-space="uploads"]{--sc:var(--s-uploads);}
.library-space[data-space="vault"]{--sc:var(--s-vault);}
:root[data-theme="dark"]:not([data-page="hub"]) .library-space{--sci:color-mix(in srgb,var(--sc) 55%,var(--on-brand));}
.library-space::before{content:"";position:absolute;inset:0;z-index:-1;background:var(--sc);clip-path:inset(0 100% 0 0);transition:clip-path .55s cubic-bezier(.65,0,.35,1);}
.library-space-top{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.library-space-badge{display:grid;place-items:center;width:44px;height:44px;border-radius:13px;background:color-mix(in srgb,var(--sc) 12%,var(--surface));color:var(--sci);font-size:19px;transition:transform .5s var(--ease),background-color .3s,color .3s;}
.library-space-title{font-size:18px;font-weight:700;letter-spacing:-.01em;}
.library-space-text{color:var(--fg-2);font-size:13px;transition:color .3s;}
.library-space-meta{display:flex;flex-wrap:wrap;align-items:center;gap:16px;margin-top:auto;color:var(--fg-3);font-size:12.5px;font-variant-numeric:tabular-nums;transition:color .3s;}
.library-space-meta b{color:var(--fg);font-size:14px;font-weight:700;transition:color .3s;}
.library-showing{display:none;align-items:center;gap:4px;margin-left:auto;font-size:12px;font-weight:600;}
.library-space[aria-selected="true"] .library-showing{display:inline-flex;}
.library-space:hover,.library-space:focus-visible{transform:translateY(-4px);box-shadow:var(--shadow-lift);}
.library-space:hover,.library-space:focus-visible,.library-space[aria-selected="true"]{color:var(--on-brand);border-color:transparent;}
.library-space:hover::before,.library-space:focus-visible::before,.library-space[aria-selected="true"]::before{clip-path:inset(0 0 0 0);}
.library-space:hover .library-space-badge,.library-space:focus-visible .library-space-badge,.library-space[aria-selected="true"] .library-space-badge{background:color-mix(in srgb,var(--on-brand) 18%,transparent);color:var(--on-brand);}
.library-space:hover .library-space-badge,.library-space:focus-visible .library-space-badge{transform:translateX(6px);}
.library-space:hover .library-space-text,.library-space:focus-visible .library-space-text,.library-space[aria-selected="true"] .library-space-text,
.library-space:hover .library-space-meta,.library-space:focus-visible .library-space-meta,.library-space[aria-selected="true"] .library-space-meta{color:color-mix(in srgb,var(--on-brand) 86%,transparent);}
.library-space:hover .library-space-meta b,.library-space:focus-visible .library-space-meta b,.library-space[aria-selected="true"] .library-space-meta b,.library-space[aria-selected="true"] .library-showing{color:var(--on-brand);}
.library-space:hover .library-pill,.library-space:focus-visible .library-pill,.library-space[aria-selected="true"] .library-pill{color:var(--on-brand);background:color-mix(in srgb,var(--on-brand) 18%,transparent);border-color:transparent;}
.library-space:focus-visible{outline:2px solid var(--brand-text);outline-offset:3px;}
.library-pill{display:inline-flex;align-items:center;gap:5px;flex:none;padding:1px 9px;border:1px solid var(--line);border-radius:999px;background:var(--sunk);color:var(--fg-2);font-size:12px;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap;transition:background-color .3s,color .3s,border-color .3s;}
.library-pill.is-brand{border-color:transparent;background:var(--brand-soft);color:var(--brand-text);}
.library-pill.is-ok{border-color:transparent;background:var(--ok-soft);color:var(--ok);}
.library-pill.is-warn{border-color:transparent;background:var(--warn-soft);color:var(--warn);}
.library-pill.is-risk{border-color:transparent;background:var(--risk-soft);color:var(--risk);}
.library-panel-intro{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:16px;}
.library-panel-intro h2{margin:0;color:var(--fg);font-size:18px;font-weight:700;letter-spacing:-.01em;}
.library-panel-intro p{margin:4px 0 0;max-width:70ch;color:var(--fg-2);}
.library-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:14px;}
.library-search{position:relative;flex:1 1 260px;min-width:0;max-width:380px;}
.library-search i{position:absolute;left:13px;top:50%;transform:translateY(-50%);color:var(--fg-3);font-size:13px;}
.library-search input{height:38px;box-sizing:border-box;padding:0 14px 0 36px;border:1px solid var(--line-strong);border-radius:999px;background:var(--surface);color:var(--fg);font:inherit;font-size:13px;}
.library-search input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 1px var(--brand);}
.library-chips{display:flex;flex-wrap:wrap;gap:6px;}
.library-chip{display:inline-flex;align-items:center;gap:7px;padding:5px 12px;border:1px solid var(--line);border-radius:999px;background:var(--surface);color:var(--fg-2);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer;transition:background-color .25s,color .25s,border-color .25s;}
.library-chip:hover{border-color:var(--line-strong);color:var(--fg);}
.library-chip[aria-pressed="true"]{border-color:var(--fg);background:var(--fg);color:var(--bg);}
.library-chip:focus-visible{outline:2px solid var(--brand-text);outline-offset:2px;}
.library-sort{display:inline-flex;align-items:center;gap:8px;margin-left:auto;color:var(--fg-3);font-size:12.5px;font-weight:600;}
.library-sort select{width:auto;height:34px;padding:0 10px;border:1px solid var(--line-strong);border-radius:10px;background:var(--surface);color:var(--fg);font:inherit;font-size:13px;}
.library-dot{display:inline-block;flex:none;width:8px;height:8px;border-radius:50%;background:var(--fg-3);}
.library-dot--app01{background:var(--brand);}
.library-dot--app02{background:#0B8278;}
.library-dot--budget{background:#17804A;}
.library-dot--app03{background:#6A2FDF;}
.library-dot--app04{background:#B42C72;}
.library-table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:12px;background:var(--surface);}
.library-table{width:100%;min-width:720px;border-collapse:collapse;font-size:13px;}
.library-table th{padding:11px 16px;border-bottom:1px solid var(--line);background:none;color:var(--fg-3);font-size:12px;font-weight:600;text-align:left;white-space:nowrap;}
.library-table td{padding:12px 16px;border-bottom:1px solid var(--line);vertical-align:middle;}
.library-table tbody tr:last-child td{border-bottom:0;}
.library-table tbody tr{cursor:pointer;transition:background-color .15s;}
.library-table tbody tr:hover{background:var(--brand-soft);}
.library-table tbody tr:hover .library-name,.library-table tbody tr.is-current .library-name{color:var(--brand-text);}
.library-table tbody tr.is-current{background:var(--brand-soft);box-shadow:inset 3px 0 0 var(--brand);}
.library-table tbody tr:focus-visible{outline:2px solid var(--brand-text);outline-offset:-2px;}
.library-table tbody tr:hover .library-pill.is-brand,.library-table tbody tr.is-current .library-pill.is-brand{background:var(--surface);}
.library-file{display:flex;align-items:center;gap:12px;min-width:0;}
.library-file-text{display:flex;flex-direction:column;min-width:0;}
.library-icon{display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:10px;background:var(--fg-3);color:var(--on-brand);font-size:15px;}
.library-icon.is-file{border:1px solid var(--line);background:var(--sunk);color:var(--fg-2);font-size:9.5px;font-weight:700;letter-spacing:.02em;}
.library-icon.is-large{width:44px;height:44px;border-radius:13px;font-size:19px;}
.library-icon--app01{background:var(--brand);}
.library-icon--app02{background:#0B8278;}
.library-icon--budget{background:#17804A;}
.library-icon--app03{background:#6A2FDF;}
.library-icon--app04{background:#B42C72;}
.library-name{color:var(--fg);font-weight:600;line-height:1.3;text-decoration:none;overflow-wrap:anywhere;transition:color .15s;}
.library-sub{color:var(--fg-3);font-size:12px;}
.library-muted{color:var(--fg-3);font-variant-numeric:tabular-nums;white-space:nowrap;}
.library-muted.is-wrap{white-space:normal;}
.library-mchip{display:inline-flex;align-items:center;gap:7px;color:var(--fg);font-size:12.5px;font-weight:600;white-space:nowrap;}
.library-version{display:inline-flex;align-items:center;gap:8px;}
.library-used{display:flex;flex-direction:column;gap:4px;}
.library-empty{margin:0;padding:28px;color:var(--fg-3);text-align:center;}
.library-more{display:flex;justify-content:center;margin-top:14px;}
/* These set their own display, which would otherwise override the hidden attribute the script and server use. */
.library-more[hidden],.library-drawer[hidden],.library-banners [hidden]{display:none;}
.library-foot{display:flex;justify-content:flex-end;margin:12px 0 0;}
.library-delete-all{padding:4px 2px;border:0;background:none;color:var(--risk);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer;}
.library-delete-all:hover{text-decoration:underline;}
.library-link{padding:0;border:0;background:none;color:var(--brand-text);font:inherit;font-size:13px;font-weight:600;text-decoration:none;cursor:pointer;display:inline-flex;align-items:center;gap:5px;}
.library-link:hover{text-decoration:underline;}
.library-link i{font-size:11px;}
.library-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}
.library-drawer{position:fixed;top:0;right:0;bottom:0;z-index:45;display:flex;flex-direction:column;width:min(440px,100%);background:var(--surface);border-left:1px solid var(--line);box-shadow:var(--shadow-lift);
  transform:translateX(100%);transition:transform .45s var(--ease);padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px);}
.library-drawer.is-open{transform:none;}
.library-drawer-content{display:flex;flex-direction:column;flex:1;min-height:0;transition:opacity .2s;}
.library-drawer-content.is-swapping{opacity:0;}
.library-drawer-head{display:flex;flex-direction:column;gap:12px;padding:20px 22px 16px;border-bottom:1px solid var(--line);}
.library-drawer-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;}
.library-drawer-head h2{margin:0;color:var(--fg);font-size:18px;font-weight:700;line-height:1.3;overflow-wrap:anywhere;}
.library-drawer-head p{margin:2px 0 0;color:var(--fg-3);font-size:13px;}
.library-drawer-close{display:grid;place-items:center;flex:none;width:36px;height:36px;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--fg-2);cursor:pointer;}
.library-drawer-close:hover{background:var(--sunk);color:var(--fg);}
.library-trail{display:flex;flex-wrap:wrap;align-items:center;gap:8px;color:var(--fg-2);font-size:12.5px;}
.library-sep{color:var(--line-strong);}
.library-drawer-body{display:flex;flex-direction:column;gap:22px;flex:1;overflow-y:auto;padding:18px 22px;}
.library-drawer-foot{display:flex;flex-wrap:wrap;gap:8px;padding:14px 22px;border-top:1px solid var(--line);}
.library-drawer-foot .btn-danger{margin-left:auto;}
.library-mini-h{margin:0 0 10px;color:var(--fg);font-size:13px;font-weight:600;}
.library-kv{display:grid;grid-template-columns:130px 1fr;gap:8px 12px;margin:0;font-size:13px;}
.library-kv dt{color:var(--fg-3);}
.library-kv dd{margin:0;min-width:0;color:var(--fg);font-weight:500;overflow-wrap:anywhere;}
.library-timeline{display:flex;flex-direction:column;margin:0;padding:0;list-style:none;}
.library-timeline li{position:relative;padding:0 0 16px 26px;}
.library-timeline li::before{content:"";position:absolute;left:5px;top:18px;bottom:0;width:2px;background:var(--line);}
.library-timeline li:last-child::before{display:none;}
.library-node{position:absolute;left:0;top:4px;width:12px;height:12px;box-sizing:border-box;border:2px solid var(--line-strong);border-radius:50%;background:var(--surface);}
.library-timeline li.is-current .library-node{border-color:var(--brand);background:var(--brand);}
.library-tl-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px;}
.library-tl-head b{font-size:13.5px;font-weight:600;}
.library-tl-text{margin-top:2px;color:var(--fg-2);font-size:12.5px;}
.library-tl-acts{display:flex;flex-wrap:wrap;gap:4px 12px;margin-top:4px;}
.library-used-line{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin:0 0 6px;}
.library-scrim{position:fixed;inset:0;z-index:1000;background:rgba(10,9,14,.5);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);opacity:0;transition:opacity .35s;}
.library-scrim.is-open{opacity:1;}
.library-pop{position:fixed;left:0;top:0;z-index:1001;overflow:auto;overscroll-behavior:contain;border-radius:20px;background:var(--surface);color:var(--fg);box-shadow:var(--shadow-lift);transform-origin:0 0;}
.library-pop.is-animating{transition:transform .45s var(--ease),opacity .3s,border-radius .45s;}
.library-pop-inner{opacity:0;transition:opacity .25s;}
.library-pop.is-open .library-pop-inner{opacity:1;transition-delay:.22s;}
.library-pop-close{position:sticky;top:14px;float:right;z-index:2;display:grid;place-items:center;width:36px;height:36px;margin:14px 14px 0 0;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--fg-2);cursor:pointer;}
.library-pop-close:hover{background:var(--sunk);color:var(--fg);}
.library-pop-body{padding:26px 28px 28px;}
.library-pop-body > * + *{margin-top:18px;}
.library-pop-head{display:flex;align-items:center;gap:14px;padding-right:40px;}
.library-pop-head h2{margin:0;font-size:21px;font-weight:700;line-height:1.25;}
.library-pop-head p{margin:2px 0 0;color:var(--fg-3);font-size:13px;}
.library-pop-icon{display:grid;place-items:center;flex:none;width:44px;height:44px;border-radius:13px;background:color-mix(in srgb,var(--s-vault) 12%,var(--surface));color:var(--fg-2);font-size:19px;}
.library-pop-icon.is-uploads{background:color-mix(in srgb,var(--s-uploads) 12%,var(--surface));color:var(--s-uploads);}
.library-pop-icon.is-store{background:var(--brand-soft);color:var(--brand-text);}
.library-pop-foot{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;padding-top:6px;}
.library-drop{display:flex;flex-direction:column;align-items:center;gap:6px;padding:24px;border:2px dashed var(--line-strong);border-radius:16px;color:var(--fg-2);text-align:center;cursor:pointer;transition:border-color .2s,background-color .2s;}
.library-drop.is-over,.library-drop:focus-within{border-color:var(--brand-text);background:var(--brand-soft);}
.library-drop i{color:var(--fg-3);font-size:24px;}
.library-drop small{color:var(--fg-3);}
.library-progress{height:6px;overflow:hidden;border-radius:999px;background:var(--track);}
.library-progress span{display:block;width:0;height:100%;background:var(--brand);transition:width .2s;}
@media (min-width:1280px){
  body.library-drawer-open .content{padding-right:456px;transition:padding-right .45s var(--ease);}
}
@media (max-width:720px){
  .library-sort{margin-left:0;}
  .library-kv{grid-template-columns:1fr;}
  .library-pop-body{padding:22px 18px;}
}
@media (prefers-reduced-motion:reduce){
  .library-space,.library-space::before,.library-space-badge,.library-space-text,.library-space-meta,.library-space-meta b,.library-pill,.library-chip,.library-table tbody tr,.library-name,
  .library-drawer,.library-drawer-content,.library-scrim,.library-pop,.library-pop-inner,.library-drop,.library-progress span,body.library-drawer-open .content{transition:none !important;}
  .library-space:hover,.library-space:focus-visible{transform:none;}
  .library-space:hover .library-space-badge,.library-space:focus-visible .library-space-badge{transform:none;}
}

/* The Vault (docs/specs/library-redesign.md, L3): folder cards that lift, the folder pop-up (tools, drop area, uploads,
   the selection bar, the table, a file's details), tags, and the recycle bin. */
.vault-folders{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;}
.vault-folders[hidden],.vault-results[hidden],.vault-select-bar[hidden],.vault-list[hidden],.vault-file[hidden],.vault-form[hidden],.vault-pop-foot[hidden],.vault-field[hidden]{display:none;}
.vault-folder{position:relative;display:flex;flex-direction:column;gap:8px;min-width:0;padding:16px;border:1px solid var(--line);border-radius:16px;background:var(--surface);color:var(--fg);font:inherit;text-align:left;text-decoration:none;cursor:pointer;box-shadow:var(--shadow);transition:transform .25s var(--ease),box-shadow .25s var(--ease),border-color .25s;}
.vault-folder:hover,.vault-folder:focus-visible{transform:translateY(-2px);border-color:var(--line-strong);box-shadow:var(--shadow-lift);}
.vault-folder:focus-visible{outline:2px solid var(--brand-text);outline-offset:2px;}
.vault-folder.is-empty{border-style:dashed;box-shadow:none;}
.vault-folder.is-new{align-items:center;justify-content:center;min-height:150px;border-style:dashed;background:transparent;box-shadow:none;color:var(--fg-2);text-align:center;}
.vault-folder.is-new:hover,.vault-folder.is-new:focus-visible{border-color:var(--brand-text);color:var(--brand-text);}
.vault-folder-top{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.vault-folder-icon{display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:10px;background:color-mix(in srgb,var(--s-vault) 12%,var(--surface));color:var(--fg-2);font-size:15px;}
.vault-folder-name{font-size:13px;font-weight:600;line-height:1.3;overflow-wrap:anywhere;}
.vault-folder-hint{color:var(--fg-3);font-size:12.5px;line-height:1.45;}
.vault-empty-tag{color:var(--warn);font-size:12px;font-weight:600;}
.vault-own{color:var(--fg-3);font-size:12px;font-weight:600;}
.vault-open-hint{display:inline-flex;align-items:center;gap:4px;margin-top:auto;padding-top:4px;color:var(--brand-text);font-size:12.5px;font-weight:600;opacity:0;transform:translateX(-4px);transition:opacity .25s,transform .35s var(--ease);}
.vault-open-hint i{font-size:11px;}
.vault-folder:hover .vault-open-hint,.vault-folder:focus-visible .vault-open-hint{opacity:1;transform:none;}
.vault-results,.vault-pop{min-width:0;}
.vault-folder-view{margin-top:24px;}
.vault-folder-view h3{margin:0 0 12px;font-size:16px;font-weight:700;}
.vault-pop .library-pop-head{align-items:flex-start;}
.vault-pop-titles{min-width:0;}
.vault-pop-titles h2{overflow-wrap:anywhere;}
.vault-edit{display:inline-flex;align-items:center;gap:6px;margin-top:6px;font-size:12.5px;}
.vault-banners:empty{display:none;}
.vault-banner{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;}
.vault-banner-actions{display:inline-flex;flex-wrap:wrap;gap:14px;}
.vault-banner .library-link{color:inherit;font-size:13px;text-decoration:underline;}
.vault-list > * + *{margin-top:14px;}
.vault-tools{display:flex;flex-wrap:wrap;align-items:center;gap:10px;}
.library-drop.is-compact{flex-direction:row;flex-wrap:wrap;justify-content:center;gap:6px 10px;padding:16px;}
.library-drop.is-compact i{font-size:18px;}
.vault-uploads{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;}
.vault-uploads:empty{display:none;}
.vault-upload{display:grid;grid-template-columns:auto minmax(0,1fr) minmax(80px,180px);align-items:center;gap:12px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;}
.vault-upload-text{display:flex;flex-direction:column;min-width:0;}
.vault-upload-text b{overflow:hidden;font-size:13px;font-weight:600;text-overflow:ellipsis;white-space:nowrap;}
.vault-upload-state{color:var(--fg-3);font-size:12px;}
.vault-upload.is-failed .vault-upload-state{color:var(--risk);}
.vault-upload.is-done .vault-upload-state{color:var(--ok);}
.vault-upload .library-progress[hidden]{display:none;}
.vault-select-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;padding:10px 12px;border-radius:12px;background:var(--brand-soft);color:var(--brand-text);}
.vault-select-bar b{margin-right:auto;font-size:13px;}
.vault-field{display:flex;flex-direction:column;gap:6px;}
.vault-field > span{color:var(--fg-2);font-size:12.5px;font-weight:600;}
.vault-field input,.vault-field select,.vault-tag-form input,.vault-select-bar select{box-sizing:border-box;width:100%;min-width:0;height:38px;padding:0 12px;border:1px solid var(--line-strong);border-radius:10px;background:var(--surface);color:var(--fg);font:inherit;font-size:13px;}
.vault-select-bar select{width:auto;max-width:220px;height:34px;}
.vault-field input:focus,.vault-field select:focus,.vault-tag-form input:focus,.vault-select-bar select:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 1px var(--brand);}
.vault-form{display:flex;flex-direction:column;gap:12px;padding:16px;border:1px solid var(--line);border-radius:12px;}
.vault-form .library-pop-foot{padding-top:0;}
.vault-pop .library-table-wrap{position:relative;}
.vault-table th.vault-check,.vault-table td.vault-check{width:20px;padding-right:0;}
.vault-check input{width:16px;height:16px;margin:0;accent-color:var(--brand);cursor:pointer;}
.vault-table tbody tr.is-chosen{background:var(--brand-soft);}
.vault-table .library-empty{cursor:default;}
.vault-row-x{display:grid;place-items:center;width:32px;height:32px;border:0;border-radius:8px;background:none;color:var(--fg-3);cursor:pointer;opacity:0;transition:opacity .15s;}
.vault-table tbody tr:hover .vault-row-x,.vault-table tbody tr:focus-within .vault-row-x,.vault-row-x:focus-visible{opacity:1;}
.vault-row-x:hover{background:var(--sunk);color:var(--risk);}
.vault-tag{display:inline-flex;align-items:center;gap:4px;margin:2px 4px 0 0;padding:1px 8px;border:1px solid var(--line);border-radius:999px;background:var(--sunk);color:var(--fg-2);font-size:11.5px;font-weight:600;}
.vault-tag-x{display:grid;place-items:center;width:16px;height:16px;margin-right:-4px;padding:0;border:0;border-radius:50%;background:none;color:var(--fg-3);font-size:10px;cursor:pointer;}
.vault-tag-x:hover{background:var(--line);color:var(--fg);}
.vault-tags{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:10px;}
.vault-tag-form{display:flex;gap:8px;max-width:360px;}
.vault-used{display:flex;flex-wrap:wrap;gap:4px 12px;margin-top:4px;}
.vault-pop-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;padding-top:14px;border-top:1px solid var(--line);color:var(--fg-3);font-size:12.5px;}
.vault-file > * + *{margin-top:16px;}
.vault-back{display:inline-flex;align-items:center;gap:6px;}
.vault-file-head{display:flex;align-items:center;gap:14px;}
.vault-file-titles{min-width:0;}
.vault-file-head .library-icon.is-file{font-size:11px;}
.vault-file-head h3{margin:0;font-size:18px;font-weight:700;line-height:1.3;overflow-wrap:anywhere;}
.vault-file-head p{margin:2px 0 0;color:var(--fg-3);font-size:13px;}
.vault-actions{display:flex;flex-wrap:wrap;gap:8px;}
.vault-actions .btn-danger{margin-left:auto;}
.vault-file-body{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px 28px;}
.vault-activity{max-height:260px;overflow-y:auto;}
/* L4: a file's versions, a new version's upload, and Compare (two versions side by side, changed lines marked). */
.vault-new-version{cursor:pointer;}
.vault-new-version:focus-within{outline:2px solid var(--brand-text);outline-offset:2px;}
.vault-versions .vault-uploads{margin-bottom:10px;}
.vault-compare-title{margin:0;font-size:16px;font-weight:700;line-height:1.3;}
.vault-compare{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);max-height:min(60vh,560px);overflow:auto;border:1px solid var(--line);border-radius:12px;background:var(--surface);font-size:12.5px;line-height:1.5;}
.vault-compare-row{display:contents;}
.library-compare-wait{height:min(60vh,560px);border:1px solid var(--line);border-radius:12px;background:var(--sunk);}
.vault-compare-cell{min-width:0;padding:2px 12px;color:var(--fg);white-space:pre-wrap;overflow-wrap:anywhere;}
.vault-compare-cell + .vault-compare-cell{border-left:1px solid var(--line);}
.vault-compare-row.is-head .vault-compare-cell{position:sticky;top:0;z-index:1;padding:8px 12px;border-bottom:1px solid var(--line);background:var(--surface);color:var(--fg-3);font-size:12px;font-weight:600;}
.vault-compare-cell.is-removed{background:var(--risk-soft);}
.vault-compare-cell.is-added{background:var(--ok-soft);}
.vault-compare-cell.is-empty{background:var(--sunk);}
.vault-compare-row.is-fold{display:block;grid-column:1 / -1;padding:6px 12px;border-block:1px solid var(--line);background:var(--sunk);text-align:center;}
.vault-compare-more{grid-column:1 / -1;margin:0;padding:10px 12px;}
/* L5: "Include files from the Vault", the button beside each module's upload and its small panel. */
.vault-include-toggle{display:inline-flex;align-items:center;gap:8px;}
.vault-include{margin-top:12px;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:var(--shadow);text-align:left;}
.vault-include[hidden]{display:none;}
.vault-include-head{display:flex;flex-direction:column;gap:2px;margin-bottom:10px;}
.vault-include-head b{color:var(--fg);font-size:13px;font-weight:600;}
.vault-include-rule{color:var(--fg-3);font-size:12px;}
.vault-include-tools{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px;}
.vault-include-tools input,.vault-include-tools select{flex:1 1 160px;box-sizing:border-box;min-width:0;height:34px;padding:0 10px;border:1px solid var(--line-strong);border-radius:10px;background:var(--surface);color:var(--fg);font:inherit;font-size:13px;}
.vault-include-tools select{flex:0 1 200px;}
.vault-include-tools input:focus,.vault-include-tools select:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 1px var(--brand);}
.vault-include-list{display:flex;flex-direction:column;max-height:280px;margin:0;padding:0;overflow-y:auto;list-style:none;}
.vault-include-item{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:8px 4px;border-top:1px solid var(--line);}
.vault-include-item:first-child{border-top:0;}
.vault-include-item.is-off .vault-include-ext,.vault-include-item.is-off .vault-include-name{opacity:.55;}
.vault-include-ext{display:grid;place-items:center;flex:none;width:30px;height:30px;border:1px solid var(--line);border-radius:8px;background:var(--sunk);color:var(--fg-2);font-size:9px;font-weight:700;letter-spacing:.02em;}
.vault-include-text{display:flex;flex-direction:column;min-width:0;}
.vault-include-name{overflow:hidden;color:var(--fg);font-size:13px;font-weight:600;text-overflow:ellipsis;white-space:nowrap;}
.vault-include-sub{color:var(--fg-3);font-size:12px;}
.vault-include-pick{padding:5px 12px;font-size:12.5px;}
.vault-include-empty,.vault-include-note{margin:0;padding:10px 4px;color:var(--fg-3);font-size:13px;}
.vault-include-note.is-error{color:var(--risk);}
.vault-bin-list{display:flex;flex-direction:column;margin:0;padding:0;border:1px solid var(--line);border-radius:12px;list-style:none;}
.vault-bin-item{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:12px;padding:12px 14px;border-bottom:1px solid var(--line);}
.vault-bin-item:last-child{border-bottom:0;}
@media (max-width:1180px){
  .vault-folders{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:720px){
  .vault-file-body{grid-template-columns:1fr;}
  .vault-actions .btn-danger{margin-left:0;}
  .vault-upload{grid-template-columns:auto minmax(0,1fr);}
  .vault-upload .library-progress{grid-column:1 / -1;}
  .vault-bin-item{grid-template-columns:auto minmax(0,1fr) auto;}
  .vault-bin-item .btn{grid-column:2 / -1;justify-self:start;}
}
@media (max-width:540px){
  .vault-folders{grid-template-columns:1fr;}
}
@media (prefers-reduced-motion:reduce){
  .vault-folder,.vault-open-hint,.vault-row-x{transition:none !important;}
  .vault-folder:hover,.vault-folder:focus-visible,.vault-open-hint{transform:none;}
}

/* One banner (Camelot CM8): the status tint with the status colour as text, no border, 12px corners. */
.banner{ margin:0; padding:10px 14px; border:0; border-radius:12px; font-size:13px; font-weight:500; }
.banner.is-error{ background:var(--risk-soft); color:var(--risk); }
.banner.is-ok{ background:var(--ok-soft); color:var(--ok); }
.banner.is-warn{ background:var(--warn-soft); color:var(--warn); }
.banner.is-info{ background:var(--brand-soft); color:var(--brand-text); }
.banner small{ display:block; margin-top:4px; }


/* ==========================================================================
   Tabs
   ========================================================================== */

/* Root tabs container */
.tabs{
  display: grid;
  grid-template-columns: 1fr 360px; /* content | tabs (wider rail) */
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  width: 100%;
}

.tabs > * {
	  font-family: 'Public Sans',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif !important;
}

/* --------------------------------------------------------------------------
   Tabs header (RIGHT SIDE)
   -------------------------------------------------------------------------- */
.tabs-head{
  order: 2;
  padding: 18px;
  background: var(--sunk);
  border-left: 1px solid var(--ring);
  display: flex;
  align-items: flex-start;
}

/* Vertical tab list */
.tablist{
  display: flex;
  flex-direction: column;
  gap: 16px; /* increased spacing */
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

/* Individual tab button */
.tab{
  appearance: none;
  width: 100%;
  text-align: left;

  padding: 14px 18px;       /* larger click target */
  border-radius: 16px;      /* heavier pill shape */
  border: 1px solid var(--ring);

  background: var(--surface);
  color: var(--ink);

  font-size: 0.95rem;
  font-weight: 700;

  cursor: pointer;

  box-shadow: 0 8px 20px rgba(16,24,40,.06);
  transition:
    background .12s ease,
    box-shadow .12s ease,
    transform .12s ease,
    filter .12s ease;
}



/* Active tab: the flat brand fill (Camelot CM5) */
.tab[aria-selected="true"]{
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
  box-shadow: none;
}

/* Keyboard focus */
.tab:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 4px rgba(43,107,255,.18),
    0 10px 26px rgba(16,24,40,.10);
}

/* --------------------------------------------------------------------------
   Tabs body (LEFT SIDE)
   -------------------------------------------------------------------------- */
.tabs-body{
  order: 1;
  padding: 18px;
}

/* Individual tab panel */
.tabpanel{
  min-height: 200px;
}

/* Hidden panels */
.tabpanel.hidden{
  display: none !important;
}

/* Optional inner wrapper to match embed-box / card aesthetic */
.tabpanel-inner{
  background: var(--surface);
  border-radius: 16px;
  padding: 14px;
}

/* --------------------------------------------------------------------------
   Responsive fallback (stack tabs on top on small screens)
   -------------------------------------------------------------------------- */
@media (max-width: 900px){
  .tabs{
    grid-template-columns: 1fr;
  }

  .tabs-head{
    order: 1;
    border-left: 0;
    border-bottom: 1px solid var(--ring);
  }

  .tablist{
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }

  .tab{
    width: auto;
  }

  .tabs-body{
    order: 2;
  }
}




/* ==========================================================================
   Responsive hardening (global)
   ========================================================================== */


html, body {
  max-width: 100%;
}

.flex-col > * {
  min-width: 0;
}
img, svg, video, canvas {
  max-width: 100%;
  height: auto;
}

.content,
.card,
.card-col,
.card-description,
.embed-box,
.tabs,
.help-dialog,
.progress-tracker {
  min-width: 25%;
}

.rag-table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 980px) {
  .card-divider {
    max-width: none;
    min-height: 82px;
  }

  .small-col {
    max-width: none;
  }

  .tabs {
    grid-template-columns: 1fr;
  }

  .flex-col > .card-col,
  .flex-col > .card-description,
  .flex-col > .card-divider {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    flex: 1 1 100%;
  }
}

@media (max-width: 720px) {
  .flex-col{ flex-flow: column nowrap; }
  .content {
    gap: 8px;
    padding: 2px;
  }

  .card-col,
  .card-description {
    min-width: 100%;
  }

  .card-col {
    padding: 2px;
    border-radius: 8px;
  }

  .embed-box {
    border: 0;
    padding: 0;
    border-radius: 8px;
  }

  .module-btn,
  .button-menu .btn-wide {
    min-width: 100% !important;
    width: 100% !important;
  }

  .sticky-box {
    position: static;
  }
}

@media (max-width: 520px) {
  .progress-tracker {
    padding: 12px;
  }
}


/* ==========================================================================
   APP01/APP02 mobile maturity statements bottom sheet
   ========================================================================== */
@media (max-width: 980px) {
  .app-assessment-layout .card-col {
    width: 100% !important;
    max-width: 100% !important;
  }

  .has-mobile-bottom-sheet {
    padding-bottom: 0;
  }

  .has-mobile-bottom-sheet > .card-col:nth-child(2) {
    display: none;
  }

  .has-mobile-bottom-sheet.show-maturity-sheet > .card-col:nth-child(2) {
    display: flex;
  }

  .mobile-bottom-sheet {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: env(safe-area-inset-bottom, 0);
    z-index: 80;
    margin: 0 !important;
    border-radius: 14px 14px 0 0;
    border: 1px solid var(--ring);
    border-bottom: 0;
    background: var(--surface);
    box-shadow: 0 -10px 30px rgba(16,24,40,.18);
    max-height: 40vh;
    min-height: 140px;
    overflow-y: auto;
    padding: 8px;
    font-size: 0.88rem;
  }

  .mobile-bottom-sheet .rag-row { margin-bottom: 6px; }
  .mobile-bottom-sheet .rag-number { min-width: 42px; padding: 7px 9px; font-size: 0.82rem; }
  .mobile-bottom-sheet .rag-text { padding: 7px; font-size: 0.82rem; line-height: 1.2; }
  .mobile-bottom-sheet .rag-question { position: sticky; top: 0; background: var(--surface); margin: 0; padding: 0 0 6px; font-size: 0.95rem; z-index: 2; }

  .maturity-sheet-close {
    position: absolute;
    right: 8px;
    top: 8px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid var(--ring);
    background: var(--surface);
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
  }
}


@media (max-width: 768px){
  .key-stats-grid{grid-template-columns:repeat(auto-fit,minmax(170px,1fr));}
}

/* ==========================================================================
   APP02 Assessments modernisation
   ========================================================================== */
.app02-summary-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:14px;
}

.app02-assessments-card{
  margin-top:2px;
}

.app02-assessment-grid{
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
}

/* Maturity Assessment's tiles take the module's teal (tokens.md, open question 9). */
.app02-assessment-btn{
  --mod:#0B8278;
  min-height:210px;
}

.app02-assessment-btn .module-icon i{
  font-size:20px;
}

/* Each tile's progress: a teal bar that fills from empty on load, as the Hub's do, over the count in words. The page
   sets each width inline; with none (a stricter style policy), the bar shows empty rather than falsely full. */
.app02-progress{
  margin-top:auto;
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:12px;
  color:var(--fg-3);
}
.app02-bar{display:block;height:6px;border-radius:999px;background:var(--track);overflow:hidden;}
.app02-bar i{display:block;width:0;height:100%;border-radius:inherit;background:var(--mod);animation:valstr-fill 1.1s var(--ease) .45s backwards;}
@keyframes valstr-fill{from{width:0;}}
@media (prefers-reduced-motion:reduce){
  .app02-bar i{animation:none;}
}


@media (max-width:720px){
  .app02-assessment-grid{grid-template-columns:1fr;}
  .app02-assessment-btn{min-height:auto;}
}
/* Temporary placeholder used while report tabs are being implemented */
.report-placeholder {
  min-height: 140px;
}

/* ==========================================================================
   APP09 Operating Model
   ========================================================================== */
.app09-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
.app09-summary-card{margin-top:12px;}
.app09-kpi-card{
  background:var(--surface);
  border:1px solid #cfe0ff;
  border-radius:12px;
  padding:12px 14px;
}
.app09-kpi-card__title{margin:0;font-size:12px;font-weight:700;color:#6a7593;}
.app09-kpi-card__value{margin:6px 0 2px;font-size:24px;font-weight:700;color:#2348d8;line-height:1;}
.app09-kpi-card__sub{margin:0;font-size:12px;color:#6a7593;}

.app09-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.app09-actions{margin-top:8px;display:flex;gap:8px;}
.app09-modules-card{margin-top:12px;}
.app09-module-grid{
  grid-template-columns:repeat(4,minmax(0,1fr));
  justify-items:start;
}
.app09-module-btn{
  width:100%;
  min-height:0px;
}
.app09-table-wrap{
  width:100%;
  overflow-x:auto;
  border:1px solid var(--line);
  border-radius:12px;
  margin-top:6px;
}
/* The hairline table (Camelot CM7): no header fill, a 12px muted header over a hairline, hairline rows. */
.app09-table{
  width:100%;
  min-width:100%;
  border-collapse:collapse;
  font-size:14px;
  table-layout:fixed;
}
.app09-table thead th{
  white-space:normal;
  word-break:normal;
  overflow-wrap:normal;
  background:transparent;
  color:var(--fg-3);
  text-align:left;
  padding:10px 14px;
  font-size:12px;
  font-weight:600;
  border-bottom:1px solid var(--line);
}
.app09-table td{
  white-space:normal;
  overflow-wrap:anywhere;
  padding:4px 12px;
  border-top:1px solid var(--line);
  background:var(--surface);
  vertical-align:middle;
  font-size:13px;
}
.app09-table tbody tr.app09-s2-function-row td{
  background:var(--brand-soft);
  font-weight:700;
  color:var(--fg);
}
.app09-table tbody tr.app09-s2-dirty td{
  background:var(--warn-soft);
}
.app09-table tfoot th{
  background:var(--sunk);
  color:var(--fg);
  font-weight:700;
  border-top:1px solid var(--line);
  padding:10px 14px;
}
.app09-table select,.app09-table input{
  width:100%;
  max-width:100%;
  padding:4px 6px;
  border:1px solid transparent;
  border-radius:4px;
  font-size:13px;
  background:transparent;
  box-shadow:none;
}
.s4-capability-cell{
  font-weight:700;
  color:var(--fg);
}
.s4-role-cell{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:center;
}
.s4-role-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 8px;
  border-radius:999px;
  background:#eef3ff;
  color:var(--fg);
  font-size:12px;
  line-height:1;
}
.s4-role-pill__name{
  font-weight:700;
}
.s4-role-pill input.s4-role-headcount{
  width:48px;
  min-width:48px;
  height:22px;
  border:1px solid var(--line);
  border-radius:5px;
  background:var(--surface);
  text-align:center;
  padding:0 4px;
  font-size:12px;
}
.s4-role-pill .app09-del{
  border-radius:999px;
  padding:0 7px;
  min-height:20px;
  line-height:1;
}
.s4-add-role{
  padding:3px 9px;
  min-height:24px;
  font-size:12px;
  font-weight:400;
  border-radius:999px;
  background:#1a46d6;
  color:#fff;
  border:1px solid rgba(18,49,207,.85);
}
.s4-headcount-cell{
  text-align:right;
}
.s4-headcount-value{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:38px;
  padding:3px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#f6f8ff;
  font-weight:700;
  color:var(--fg);
}
.s4-add-role-wrap{
  margin-top:6px;
  display:flex;
  justify-content:flex-end;
}
.app09-role-modal{
  position:fixed;
  inset:0;
  z-index:9999;
  display:grid;
  place-items:center;
}
.app09-role-modal[hidden]{
  display:none !important;
}
.app09-role-modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(10,9,14,.5);
}
.app09-role-modal__dialog{
  position:relative;
  width:min(460px, calc(100vw - 24px));
  background:var(--surface);
  border:0;
  border-radius:20px;
  box-shadow:var(--shadow-lift);
  padding:16px;
}
.app09-role-modal__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}
.app09-role-modal__header h4{
  margin:0;
}
.app09-role-modal__close{
  border:1px solid var(--line);
  border-radius:8px;
  width:34px;
  height:34px;
  font-size:20px;
  line-height:1;
  color:var(--fg);
  background:var(--surface);
}
.app09-role-modal__actions{
  justify-content:flex-end;
  margin-top:12px;
}
#s4-core-table tfoot .s4-core-subtotal-label{
  text-align:left;
}
#s4-core-table tfoot .s4-core-subtotal-value{
  text-align:right;
}
.app09-report-signals{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:10px 0 14px;
}
.app09-report-signal{
  display:inline-flex;
  align-items:center;
  padding:5px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
}
.app09-report-signal--positive{background:#e8faef;color:#18633a;}
.app09-report-signal--warning{background:#fff3dd;color:#8c5a00;}
.app09-report-signal--risk{background:#ffe6e6;color:#a12828;}
.app09-report-signal--neutral{background:#eff2f8;color:#465474;}
.app09-report-inline-summary{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin:6px 0 8px;
  font-size:12px;
  color:#4a5575;
}

@media (max-width:980px){
  .app09-kpis{grid-template-columns:repeat(2,minmax(0,1fr));}
  .app09-module-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .app09-grid{grid-template-columns:1fr;}
  .s4-headcount-cell{text-align:left;}
  .s4-add-role-wrap{justify-content:flex-start;}
  .s4-headcount-value{margin-bottom:4px;}
}
@media (max-width:640px){
  .app09-kpis{grid-template-columns:1fr;}
  .app09-module-grid{grid-template-columns:1fr;}
  .s4-role-pill{
    width:100%;
    justify-content:space-between;
  }
  .app09-role-modal__dialog{
    width:min(96vw, 420px);
    padding:14px;
  }
  .app09-role-modal__actions{
    flex-wrap:wrap;
  }
}
.app09-form-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-bottom:8px;
}
.app09-form-grid--wide{
  grid-template-columns:repeat(6,minmax(0,1fr));
}
.app09-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.app09-field label{
  margin:0;
  font-size:12px;
  font-weight:700;
  color:var(--fg);
}
.app09-form-grid .input,
.app09-form-grid--wide .input{
  min-height:36px;
  padding:7px 10px;
  font-size:13px;
}
.app09-del{
  padding:6px 10px;
  border-radius:8px;
  border:1px solid #cfdaf7;
  background:#f7faff;
  cursor:pointer;
}
.app09-dashboard-bars{
  display:grid;
  gap:10px;
}
.app09-dashboard-bar{
  border:1px solid #d8e3ff;
  border-radius:10px;
  padding:10px 12px;
  background:var(--surface);
}
.app09-dashboard-bar__meta{
  display:flex;
  justify-content:space-between;
  gap:12px;
  font-size:13px;
  color:var(--fg);
  margin-bottom:8px;
}
.app09-dashboard-bar__track{
  width:100%;
  height:10px;
  border-radius:999px;
  background:#edf2ff;
  overflow:hidden;
}
.app09-dashboard-bar__track span{
  display:block;
  height:100%;
  border-radius:999px;
  background:var(--brand);
}
.app09-rag{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:66px;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
}
.app09-rag--red{background:#ffe8e8;color:#a12828;}
.app09-rag--amber{background:#fff4dc;color:#8a5b00;}
.app09-rag--green{background:#e6f7ea;color:#1e7d3f;}
.app09-heat{
  display:inline-flex;
  min-width:58px;
  justify-content:center;
  border-radius:999px;
  padding:3px 10px;
  font-weight:700;
  font-size:12px;
}
.app09-score-cell{
  text-align:center;
}
.app09-heat--low{background:#ffe8e8;color:#a12828;}
.app09-heat--mid{background:#fff4dc;color:#8a5b00;}
.app09-heat--high{background:#e6f7ea;color:#1e7d3f;}
@media (max-width:1200px){
  .app09-form-grid,
  .app09-form-grid--wide{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:720px){
  .app09-form-grid,
  .app09-form-grid--wide{grid-template-columns:1fr;}
}
.app09-tools-groups{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.app09-capability-group{
  border:1px solid #dfe5fb;
  border-radius:8px;
  padding:12px;
  background:#fcfdff;
}
.app09-capability-group__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.app09-capability-group__header h5{
  margin:0;
  color:var(--fg);
  font-size:15px;
}
.app09-output-columns{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.app09-output-box{
  border:1px solid #d8deef;
  border-radius:12px;
  padding:12px;
  background:#f7f9ff;
}
.app09-output-list{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:8px;
}
.app09-output-item{
  display:block;
  padding:10px 12px;
  border:1px solid #d1daf5;
  border-radius:10px;
  text-decoration:none;
  color:var(--fg);
  font-weight:600;
  background:var(--surface);
}
.app09-output-item:hover{
  border-color:#5f7cf1;
  background:#edf2ff;
}
.app09-dashboard-shell{margin-top:12px;}
.app09-dashboard-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:12px;
}
.app09-dashboard-tab{
  border:1px solid #d1daf5;
  background:var(--surface);
  color:#2742b7;
  border-radius:999px;
  padding:8px 14px;
  font-weight:700;
  cursor:pointer;
}
.app09-dashboard-tab.is-active{
  background:#1f4de3;
  color:#fff;
  border-color:#1f4de3;
}
.app09-dashboard-panel{display:none;}
.app09-dashboard-panel.is-active{display:block;}
.app09-dashboard-inner-card{margin-bottom:12px;}
@media (max-width:760px){
  .app09-output-columns{grid-template-columns:1fr;}
}

.app02-assessment-output {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.app02-assessment-link {
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
}

.app02-report-form {
  margin: auto 0 0;
}

.app02-report-btn {
  border: 0;
  cursor: pointer;
  width: 100%;
}

.app02-report-progress {
  margin: 16px 0 4px;
}

.app02-report-progress[hidden] {
  display: none;
}

.app02-report-progress-meta {
  color: var(--fg-2);
  display: flex;
  font-size: .9rem;
  font-weight: 600;
  justify-content: space-between;
  margin-bottom: 8px;
}

.app02-report-progress-wrapper {
  background: var(--track);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.app02-report-progress-bar {
  background: var(--brand);
  height: 100%;
  transition: width 0.2s ease;
  width: 0%;
}

.app02-report-loading {
  align-items: center;
  color: var(--fg-2);
  display: flex;
  font-size: 0.9rem;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* The statements panel's close button only works when the panel is a slide-up sheet on small screens. */
@media (min-width: 981px) {
  .maturity-sheet-close { display: none !important; }
}

/* Goals: tick-box file list, Upload button and upload progress */
.file-checklist{display:grid;gap:6px;max-height:220px;overflow-y:auto;margin:6px 0 4px;padding:6px;border:1px solid var(--line);border-radius:10px;background:var(--surface);}
.file-checklist-item{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:8px;cursor:pointer;color:var(--fg);font-size:.92rem;transition:background-color .15s ease;}
.file-checklist-item:hover{background:var(--sunk);}
.file-checklist-item.is-selected{background:var(--brand-soft);font-weight:600;}
.file-checklist-item input{width:18px;height:18px;flex:0 0 auto;}
/* The goals file list's empty state: the quiet panel (.empty-state, Camelot CM8). */
.file-checklist-empty{position:relative;margin:0;padding:12px 14px 12px 40px;border-radius:12px;background:var(--sunk);color:var(--fg-2);font-size:13px;}
.file-checklist-empty::before{content:"\f01c";content:"\f01c" / "";position:absolute;left:16px;top:14px;font:normal 900 13px/1 "Font Awesome 7 Free";color:var(--fg-3);}
.file-checklist-summary{margin-top:6px;font-size:.88rem;color:var(--fg);}
.file-upload-btn{margin-top:8px;}
.file-upload-progress{height:10px;margin-top:10px;background:var(--track);border-radius:999px;overflow:hidden;}
.file-upload-bar{height:100%;width:0;background:var(--brand);border-radius:999px;transition:width .3s ease,background-color .3s ease;}
.file-upload-progress.is-done .file-upload-bar{background:var(--ok);}
.file-upload-progress.is-error .file-upload-bar{background:var(--risk);}
.file-upload-status{margin-top:6px;font-size:.9rem;min-height:1.2em;}
.file-upload-status.is-done{color:var(--ok);font-weight:600;}
.file-upload-status.is-error{color:var(--risk);font-weight:600;}

/* Page transitions, in every browser: the content fades out when you follow a link and rises in when
   the next page arrives. The sidebar, logo and top bar sit in the same place on every page, so they stay still. */
html{background:var(--bg);}
/* backwards, never both or forwards: an animation still applied after it ends keeps .content the containing block of
   every fixed element inside it (Help, toasts, bottom sheets), so they sat on the page, not the window (P70). */
html[data-page="hub"] .content{animation:valstr-page-in .32s cubic-bezier(.2,.8,.2,1) backwards;}
html.valstr-leaving .content{opacity:0;transform:translateY(4px);transition:opacity .14s ease,transform .14s ease;}
@keyframes valstr-page-in{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:none;}}
/* Every other page (Camelot CM6): the Hub's page entry, the header, tracker and sections fading and rising in turn, 600ms
   each and 90ms apart (tokens.md, Motion). Only these blocks move, never Help, toasts or scripts beside them; single
   containers (Budget, Strategy, Library) rise as one. Backwards fill only, as above (P70). */
html:not([data-page="hub"]) .content > :is(.progress-tracker,.card-description,section,header,nav,.bud-page,.app04-page,.files_shell){animation:valstr-rise .6s var(--ease) backwards;}
html:not([data-page="hub"]) .content > :nth-child(2 of :is(.progress-tracker,.card-description,section,header,nav,.bud-page,.app04-page,.files_shell)){animation-delay:90ms;}
html:not([data-page="hub"]) .content > :nth-child(3 of :is(.progress-tracker,.card-description,section,header,nav,.bud-page,.app04-page,.files_shell)){animation-delay:180ms;}
html:not([data-page="hub"]) .content > :nth-child(4 of :is(.progress-tracker,.card-description,section,header,nav,.bud-page,.app04-page,.files_shell)){animation-delay:270ms;}
html:not([data-page="hub"]) .content > :nth-child(5 of :is(.progress-tracker,.card-description,section,header,nav,.bud-page,.app04-page,.files_shell)){animation-delay:360ms;}
html:not([data-page="hub"]) .content > :nth-child(n+6 of :is(.progress-tracker,.card-description,section,header,nav,.bud-page,.app04-page,.files_shell)){animation-delay:450ms;}
@keyframes valstr-rise{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:none;}}
@media (prefers-reduced-motion:reduce){
  .content{animation:none !important;}
  html:not([data-page="hub"]) .content > :is(.progress-tracker,.card-description,section,header,nav,.bud-page,.app04-page,.files_shell){animation:none !important;}
  html.valstr-leaving .content{opacity:1 !important;transform:none !important;transition:none !important;}
}

/* The way back to a strategy from a "Fix in" link (scripts/strategy-return.js, Strategy CH6). */
.valstr-return{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;margin:0 0 14px;padding:10px 14px;border-radius:12px;background:var(--tile);color:var(--ink);font-size:14px}
.valstr-return p{margin:0;flex:1 1 320px}
.valstr-return-back{font-weight:600;color:var(--brand-text)}
.valstr-return-dismiss{border:0;background:none;color:var(--muted);text-decoration:underline;cursor:pointer;font:inherit}

/* ==========================================================================
   Frame: the sidebar tray and the phone bar (Hub redesign Phase 2, docs/specs/hub-redesign.md; values from
   docs/design/tokens.md). Desktop with a mouse (981px and up): a light tray BEHIND the page; pointing at it or tabbing
   into it slides the page right to show the labels. The page moves with left, never a transform: a transform would make
   it the containing block of every fixed element inside it (lesson P70). Desktop without a mouse: the tray stays open
   beside the page. Phones and tablets (980px and below): a bar with the menu button and the logo, and the tray slides
   out over the page (footer.php's script). The desktop top bar is gone: its controls are in the tray.
   ========================================================================== */
:root{
  --tray-bg:#E7E4E2;
  --tray-surface:#FFFFFF;
  --tray-fg:#3B3942;
  --tray-fg-strong:#141318;
  --tray-fg-soft:#4B4952;
  --tray-line:#DEDAD7;
  --tray-brand:#0618F5;
  --tray-brand-text:#0618F5;
  --tray-soon:#6E6B74;
  --tray-shadow:0 1px 2px rgba(20,19,24,.05),0 3px 10px rgba(20,19,24,.04);
  --tray-page-shadow:-22px 0 44px rgba(20,19,24,.14);
  --tray-ease:cubic-bezier(.2,.8,.2,1);
  --valstr-rail-w:76px;
  --valstr-nav-w:264px;
}
/* The tray in dark on every page (Camelot CM9): the Hub's own dark values (assets/hub/hub.css), and the light wordmark. */
:root[data-theme="dark"]:not([data-page="hub"]){
  --tray-bg:#0D0C10;
  --tray-surface:#1D1C23;
  --tray-fg:#C8C5CD;
  --tray-fg-strong:#F2F0EF;
  --tray-fg-soft:#BDBAC2;
  --tray-line:#2C2B33;
  --tray-brand-text:#929BFF;
  --tray-soon:#8C8994;
  --tray-shadow:0 1px 2px rgba(0,0,0,.4);
  --tray-page-shadow:-22px 0 50px rgba(0,0,0,.6);
}
:root[data-theme="dark"]:not([data-page="hub"]) .brand-word{content:url("/assets/branding/valstr-wordmark-light.png");}

/* The tray. DM Sans in the sidebar, Public Sans everywhere else. */
.sidebar{position:fixed;inset:0 auto 0 0;z-index:30;width:var(--valstr-nav-w);display:flex;flex-direction:column;
  padding:env(safe-area-inset-top,0px) 0 env(safe-area-inset-bottom,0px);background:var(--tray-bg);color:var(--tray-fg);
  font-family:'DM Sans',system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif;font-size:14px;line-height:1.4;}
.sidebar select,.sidebar button{font-family:inherit;}
.sidebar :focus-visible{outline:2px solid var(--tray-brand-text);outline-offset:2px;}

.brand{display:flex;align-items:center;flex:none;height:68px;padding:0 12px 0 28px;}
.brand-link{display:flex;align-items:center;gap:5px;text-decoration:none;}
.brand-mark{height:30px;width:auto;}
.brand-word{height:19px;width:auto;}
.sidebar-close{display:none;margin-left:auto;width:34px;height:34px;align-items:center;justify-content:center;border:1px solid var(--tray-line);border-radius:10px;background:var(--tray-surface);color:var(--tray-fg);cursor:pointer;}

/* Organisation: badge, list and Switch View */
.tray-org{display:grid;gap:6px;flex:none;margin:2px 10px 12px;}
.tray-org-link{display:grid;grid-template-columns:28px minmax(0,1fr);gap:12px;align-items:center;padding:8px 10px 8px 14px;border-radius:12px;color:var(--tray-fg-strong);text-decoration:none;}
.tray-org-link:hover,.tray-org-link:focus-visible{background:var(--tray-surface);}
.tray-org-name{display:flex;align-items:center;gap:6px;min-width:0;font-size:13px;font-weight:600;}
.tray-org-name span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.tray-org-name i{flex:none;font-size:10px;color:var(--tray-fg-soft);}
.tray-org-badge{width:28px;height:28px;border-radius:8px;display:grid;place-items:center;background:var(--tray-brand);color:#fff;font-size:10.5px;font-weight:700;letter-spacing:.02em;}
.tray-org-meta{display:grid;gap:6px;min-width:0;padding:0 10px 0 54px;}
.tray-org-meta[hidden]{display:none;}
.tray-org-label{font-size:11px;font-weight:500;color:var(--tray-fg-soft);}
.sidebar .top-org-select{width:100%;margin:0;padding:5px 8px;border:1px solid var(--tray-line);border-radius:8px;background:var(--tray-surface);color:var(--tray-fg-strong);font-size:13px;font-weight:600;}
.sidebar .top-org-select:focus{border-color:var(--tray-brand);box-shadow:0 0 0 3px rgba(6,24,245,.18);}
.tray-org-switch{justify-self:start;border:0;border-radius:999px;padding:5px 12px;background:var(--tray-brand);color:#fff;font-size:12.5px;font-weight:600;cursor:pointer;}
.tray-org-switch:hover{filter:brightness(1.12);}

/* Navigation. The current page is highlighted; Soon modules are listed, not linked. */
.side-nav{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;gap:2px;padding:2px 10px;}
.side-link,.side-toggle{display:flex;align-items:center;gap:14px;padding:9px 10px 9px 18px;border-radius:10px;color:var(--tray-fg);text-decoration:none;font-weight:500;white-space:nowrap;transition:background-color .15s ease,color .15s ease;}
.side-link i,.side-toggle i{width:20px;flex:none;text-align:center;font-size:16px;}
.side-link:hover,.side-toggle:hover{background:var(--tray-surface);color:var(--tray-fg-strong);}
.side-link.active,.side-toggle.active{background:var(--tray-surface);color:var(--tray-brand-text);font-weight:600;box-shadow:var(--tray-shadow);}
.side-toggle{list-style:none;cursor:pointer;}
.side-toggle::-webkit-details-marker{display:none;}
.side-toggle .side-chevron{width:auto;margin-left:auto;font-size:11px;transition:transform .2s ease;}
.side-group:not([open]) .side-chevron{transform:rotate(-90deg);}
.side-group{display:flex;flex-direction:column;gap:2px;}
.side-group[open] > .side-sub{margin-top:2px;}
.side-sub{display:flex;flex-direction:column;gap:1px;margin:0 0 6px 46px;}
.side-sublink{display:flex;align-items:center;gap:10px;padding:6px 10px;border-radius:10px;color:var(--tray-fg);text-decoration:none;font-size:13px;font-weight:500;line-height:1.3;transition:background-color .15s ease,color .15s ease;}
a.side-sublink:hover{background:var(--tray-surface);color:var(--tray-fg-strong);}
.side-sublink.active{background:var(--tray-surface);color:var(--tray-brand-text);font-weight:600;}
.side-sublink.is-soon{color:var(--tray-fg-soft);cursor:default;}
.side-soon{margin-left:auto;padding-left:6px;font-size:10.5px;font-weight:600;color:var(--tray-fg-soft);}
.side-dot{width:8px;height:8px;border-radius:50%;flex:none;background:var(--tray-soon);}
.side-dot--app01{background:#0618F5;}
.side-dot--app02{background:#0B8278;}
.side-dot--budget{background:#17804A;}
/* The Library's spaces in the tray (docs/specs/library-redesign.md): the Artifact Store in brand, Uploads in teal. */
.side-dot--store{background:var(--brand);}
.side-dot--uploads{background:var(--s-uploads);}
.side-dot--vault{background:var(--s-vault);}
.side-dot--app03{background:#6A2FDF;}
.side-dot--app04{background:#B42C72;}
.side-sep{display:block;flex:none;height:1px;margin:10px 8px 10px 18px;background:var(--tray-line);}

/* You: profile, organisation profile and Logout */
.tray-account{display:flex;align-items:center;gap:6px;flex:none;padding:12px 10px 12px 22px;border-top:1px solid var(--tray-line);}
.sidebar .avatar{display:flex;align-items:center;gap:10px;flex:1;min-width:0;border-radius:10px;color:var(--tray-fg-strong);text-decoration:none;}
.sidebar .avatar img{width:32px;height:32px;flex:none;border-radius:50%;object-fit:cover;}
.tray-who{display:flex;flex-direction:column;min-width:0;line-height:1.25;}
.tray-who b{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.tray-who span{font-size:11.5px;color:var(--tray-fg-soft);}
.top-logout-form{flex:none;margin:0;}
.top-logout-btn{width:32px;height:32px;flex:none;display:grid;place-items:center;border:0;border-radius:8px;background:transparent;color:var(--tray-fg-soft);text-decoration:none;cursor:pointer;}
.top-logout-btn:hover{background:var(--tray-surface);color:var(--tray-fg-strong);}
/* Settings (Camelot CM10): a gear before Logout, the same size and quiet look; on hover it spins once clockwise. */
.tray-settings{width:32px;height:32px;flex:none;display:grid;place-items:center;border-radius:8px;color:var(--tray-fg-soft);text-decoration:none;}
.tray-settings:hover,.tray-settings.active{background:var(--tray-surface);color:var(--tray-fg-strong);}
.tray-settings:hover i{animation:valstr-gear-spin .6s var(--tray-ease);}
@keyframes valstr-gear-spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}

/* The page beside the tray */
.shell{min-height:100%;display:flex;flex-direction:column;margin-left:var(--valstr-nav-w);background:var(--bg);}
.topbar{display:none;}
.content{padding-top:24px;}
.sidebar-backdrop{display:none;position:fixed;inset:0;z-index:45;border:0;background:rgba(10,9,14,.5);}

/* Desktop with a mouse: the tray sits behind the page and opens on hover or focus. */
@media (min-width:981px) and (hover:hover){
  body{overflow-x:hidden;}
  .shell{position:relative;z-index:40;left:0;margin-left:var(--valstr-rail-w);border-radius:22px 0 0 22px;box-shadow:-1px 0 0 var(--tray-line);
    transition:left .42s var(--tray-ease),box-shadow .42s var(--tray-ease);}
  .sidebar:hover ~ .shell,.sidebar:focus-within ~ .shell{left:calc(var(--valstr-nav-w) - var(--valstr-rail-w));box-shadow:var(--tray-page-shadow);}
  /* will-change: Safari otherwise keeps painting the labels after they fade to 0, so a strip of each one stays visible
     in the rail once the tray closes (register X31). */
  .brand-word,.tray-org-meta,.side-link span,.side-toggle span,.side-chevron,.side-sub,.tray-who,.tray-org-name,.top-logout-form{opacity:0;transition:opacity .2s ease;will-change:opacity;}
  .sidebar:hover .brand-word,.sidebar:hover .tray-org-meta,.sidebar:hover .side-link span,.sidebar:hover .side-toggle span,.sidebar:hover .side-chevron,.sidebar:hover .side-sub,.sidebar:hover .tray-who,.sidebar:hover .tray-org-name,.sidebar:hover .top-logout-form,
  .sidebar:focus-within .brand-word,.sidebar:focus-within .tray-org-meta,.sidebar:focus-within .side-link span,.sidebar:focus-within .side-toggle span,.sidebar:focus-within .side-chevron,.sidebar:focus-within .side-sub,.sidebar:focus-within .tray-who,.sidebar:focus-within .tray-org-name,.sidebar:focus-within .top-logout-form{opacity:1;transition-delay:.12s;}
  /* The gear shows with the tray, as Logout does. */
  .tray-settings{opacity:0;transition:opacity .2s ease;will-change:opacity;}
  .sidebar:hover .tray-settings,.sidebar:focus-within .tray-settings{opacity:1;transition-delay:.12s;}
}

/* Phones and tablets: the bar with the menu button and logo; the tray slides out over the page. */
@media (max-width:980px){
  body.sidebar-open{overflow:hidden;}
  .shell{margin-left:0;}
  .content{padding-top:16px;}
  .topbar{display:flex;align-items:center;gap:10px;position:sticky;top:0;z-index:40;min-height:56px;padding:8px 14px;padding-top:max(8px,env(safe-area-inset-top,0px));background:inherit;border-bottom:1px solid var(--tray-line);}
  .nav-toggle{display:inline-flex;align-items:center;justify-content:center;min-width:40px;min-height:40px;border:0;border-radius:10px;background:transparent;color:var(--tray-fg-strong);font-size:20px;line-height:1;cursor:pointer;}
  .topbar-brand{display:flex;align-items:center;gap:4px;text-decoration:none;}
  .topbar-brand .brand-mark{height:24px;}
  .topbar-brand .brand-word{height:15px;}
  /* The open menu scrolls on a short screen, and sits above page panels such as APP02's statements sheet (z-index 80),
     which would otherwise cover Logout; dialogs and toasts (1000 and up) stay above it. */
  .sidebar{z-index:90;width:min(var(--valstr-nav-w),86vw);overflow-y:auto;transform:translateX(-100%);transition:transform .3s var(--tray-ease),box-shadow .3s ease;}
  .sidebar.open{transform:none;box-shadow:0 18px 44px rgba(20,19,24,.16);}
  .sidebar-close{display:inline-flex;}
  .sidebar-backdrop{z-index:85;}
  .sidebar-backdrop.open{display:block;}
}

/* Reduce motion: the tray and page still open and close, without sliding or fading. */
@media (prefers-reduced-motion:reduce){
  .shell,.sidebar,.side-link,.side-toggle,.side-sublink,.brand-word,.tray-org-meta,.side-link span,.side-toggle span,.side-chevron,.side-sub,.tray-who,.tray-org-name,.top-logout-form{transition:none !important;}
  .tray-settings{transition:none !important;}
  .tray-settings:hover i{animation:none;}
}
