/* ============================================================
   See Play Dream OS — Brand Design System
   ============================================================ */

:root {
  /* Brand colours — values tracked against
     /Learning/documentation/archive/brand-design-guidelines-2026-01-10.md */
  --color-text:       #111214;                    /* Off-Black */
  --color-text-light: rgba(17, 18, 20, 0.72);     /* brand muted text */
  --color-bg:         #F7F8FA;                    /* Off-White */
  --color-card:       #ffffff;
  --color-border:     rgba(17, 18, 20, 0.10);     /* brand subtle divider */
  --color-blue:       #00acff;
  --color-green:      #1bad5a;
  --color-red:        #ff3c41;
  --color-yellow:     #ffd200;                    /* brand Yellow */
  --color-orange:     #FF7A00;                    /* brand Orange */
  --color-purple:     #6742fd;
  --color-pink:       #ff2199;
  --color-light-blue: #8FD3FF;
  --color-dark-blue:  #0B1F3B;
  --color-off-black:  #111214;
  --text-muted:       rgba(17, 18, 20, 0.72);

  /* Pillar accent colours */
  --pillar-0: #00acff;   /* Brand and Vision */
  --pillar-1: #7c5cfc;   /* Compliance */
  --pillar-2: #1bad5a;   /* Finance */
  --pillar-3: #FF7A00;   /* Marketing */
  --pillar-4: #ff3c7e;   /* Clients */
  --pillar-5: #00c9a7;   /* People and Culture */

  /* Spacing */
  --sp-xs: .25rem;
  --sp-sm: .5rem;
  --sp-md: 1rem;
  --sp-lg: 1.5rem;
  --sp-xl: 2.5rem;
  --sp-2xl: 4rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Instrument Sans', 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
}
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h3 { font-size: clamp(1.05rem, 2.5vw, 1.35rem); }

/* ---- Layout ---- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-lg) var(--sp-lg);
}

/* ---- Nav ---- */
.site-nav {
  background: var(--color-orange);
  padding: var(--sp-sm) var(--sp-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}
.site-nav .logo { display: inline-flex; align-items: center; }
.site-nav .logo img { height: 64px; width: auto; max-width: 220px; display: block; object-fit: contain; }
@media (max-width: 720px) {
  .site-nav .logo img { height: 48px; max-width: 160px; }
}
.site-nav .nav-primary {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  margin-left: var(--sp-md);
  flex-wrap: wrap;
}
.site-nav .nav-link,
.site-nav .nav-dropdown__trigger {
  color: #fff;
  font-weight: 500;
  font-size: .875rem;
  font-family: inherit;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  transition: background .15s;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}
.site-nav .nav-link:hover,
.site-nav .nav-link.is-active,
.site-nav .nav-dropdown__trigger:hover,
.site-nav .nav-dropdown.is-active > .nav-dropdown__trigger,
.site-nav .nav-dropdown.is-open > .nav-dropdown__trigger {
  background: rgba(255,255,255,.18);
  text-decoration: none;
  color: #fff;
}
.site-nav .nav-user {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  color: #fff;
  margin-left: auto;
}
.site-nav .caret {
  font-size: .65rem;
  opacity: .85;
  transform: translateY(1px);
}

/* Dropdowns */
.nav-dropdown { position: relative; }
.nav-dropdown__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px 0;
  z-index: 1000;
  display: none;
  color: var(--color-text);
}
.nav-dropdown__panel--right { left: auto; right: 0; }
.nav-dropdown.is-open > .nav-dropdown__panel { display: block; }
.nav-dropdown__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: .88rem;
  color: var(--color-text);
  text-decoration: none;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.3;
}
.nav-dropdown__item:hover {
  background: var(--color-bg);
  text-decoration: none;
  color: var(--color-text);
}
.nav-dropdown__item.is-current { font-weight: 600; background: var(--color-bg); cursor: default; }
.nav-dropdown__item--accent { color: var(--color-blue); font-weight: 600; }
.nav-dropdown__item--accent:hover { color: #009ae6; }
.nav-dropdown__item .check { display: inline-block; width: 14px; text-align: center; color: var(--color-blue); font-weight: 700; }
.nav-dropdown__form { margin: 0; padding: 0; }
.nav-dropdown__divider {
  height: 1px;
  background: var(--color-border);
  margin: 6px 0;
}
.nav-dropdown__section-title {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-light);
  padding: 6px 14px 4px;
}
.nav-dropdown__email {
  padding: 8px 14px;
  font-size: .8rem;
  color: var(--color-text-light);
  word-break: break-all;
}
.nav-dropdown__label {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  color: #fff;
  font-weight: 600;
  font-size: .85rem;
}

/* Mobile: collapse the primary links (hide; could become a burger later) */
@media (max-width: 720px) {
  .site-nav { flex-wrap: wrap; gap: var(--sp-sm); }
  .site-nav .nav-primary { order: 3; width: 100%; margin-left: 0; justify-content: flex-start; }
  .nav-dropdown__label { max-width: 100px; }
  .nav-dropdown__panel { min-width: 200px; }
  .nav-dropdown__panel--right { right: 0; left: auto; }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- Messages / Toasts ---- */
.messages { list-style: none; margin-bottom: var(--sp-lg); }
.messages li {
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: .9rem;
  margin-bottom: var(--sp-xs);
}
.messages .success, .messages .info { background: #e6f9ee; color: #0d7a3a; }
.messages .error   { background: #ffeaea; color: #c9202e; }
.messages .warning { background: #fff7e0; color: #8a6900; }

/* ---- Cards ---- */
.card {
  background: var(--color-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-lg);
}
.card-header {
  margin-bottom: var(--sp-md);
  padding-bottom: var(--sp-sm);
  border-bottom: 1px solid var(--color-border);
}
.card-header h2, .card-header h3 { margin: 0; }

/* ---- Pillar Cards ---- */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-lg);
}
.pillar-card {
  background: var(--color-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
}
.pillar-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.pillar-card .pillar-accent {
  height: 8px;
  width: 100%;
}
.pillar-card .pillar-body {
  padding: var(--sp-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.pillar-card .pillar-name {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: var(--sp-sm);
}
.pillar-card .pillar-meta {
  font-size: .85rem;
  color: var(--color-text-light);
  margin-bottom: var(--sp-md);
  flex: 1;
}
.pillar-progress-row {
  margin-bottom: var(--sp-sm);
}
.pillar-progress-label {
  font-size: .85rem;
  color: var(--color-text);
  display: block;
  margin-bottom: 4px;
}
.pillar-progress-label strong {
  font-size: 1rem;
}
.pillar-progress-bar {
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}
.pillar-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .3s;
}

/* Pillar accent colours — per-card via inline `--accent` custom property. */
.pillar-card { --accent: var(--color-blue); }
.pillar-card .pillar-accent { background: var(--accent); }
.pillar-card .pillar-progress-fill { background: var(--accent); }
.pillar-card:hover .pillar-view-btn { color: var(--accent); }
.pillar-card .pillar-name { color: var(--accent); }

.pillar-view-btn {
  display: inline-block;
  margin-top: auto;
  padding-top: var(--sp-md);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .02em;
  color: var(--color-text-light);
  transition: color .15s;
}

/* ---- Summary Cards Row ---- */
.summary-row {
  display: flex;
  gap: var(--sp-lg);
  flex-wrap: wrap;
  margin-bottom: var(--sp-lg);
}
.summary-card {
  flex: 1;
  min-width: 180px;
  background: var(--color-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-lg);
  text-align: center;
}
.summary-card .big-number {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1;
  display: block;
  margin-bottom: var(--sp-xs);
}
.summary-card .label {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-light);
}
.summary-card.blue   { border-top: 4px solid var(--color-blue); }
.summary-card.green  { border-top: 4px solid var(--color-green); }
.summary-card.red    { border-top: 4px solid var(--color-red); }
.summary-card.yellow { border-top: 4px solid var(--color-yellow); }
.summary-card.blue   .big-number { color: var(--color-blue); }
.summary-card.green  .big-number { color: var(--color-green); }
.summary-card.red    .big-number { color: var(--color-red); }
.summary-card.yellow .big-number { color: var(--color-yellow); }

/* ---- Tables ---- */
.table-wrap {
  overflow-x: visible;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
thead th {
  text-align: left;
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-text-light);
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 2px solid var(--color-border);
}
tbody td {
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f0f4fb; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  font-family: inherit;
  font-weight: 600;
  font-size: .95rem;
  padding: 10px 28px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  text-align: center;
  transition: background .2s, transform .1s;
  text-decoration: none;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary   { background: var(--color-blue); color: #fff; }
.btn-primary:hover { background: #009ae6; }
.btn-secondary { background: transparent; color: var(--color-blue); border: 2px solid var(--color-blue); }
.btn-secondary:hover { background: rgba(0,172,255,.08); }
.btn-danger    { background: var(--color-red); color: #fff; }
.btn-danger:hover { background: #e0333a; }
.btn-success   { background: var(--color-green); color: #fff; }
.btn-success:hover { background: #169a4f; }
.btn-sm {
  padding: 6px 18px;
  font-size: .8rem;
}

.btn-row {
  display: flex;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  align-items: center;
}

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.6;
}
.badge-red     { background: var(--color-red); color: #fff; }
.badge-green   { background: var(--color-green); color: #fff; }
.badge-blue    { background: var(--color-blue); color: #fff; }
.badge-yellow  { background: var(--color-yellow); color: #111; }

/* ---- Status pills (recommendation runs) ---- */
.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.6;
  background: #eee;
  color: #333;
  vertical-align: middle;
}
.status-pill--fresh   { background: var(--color-green);  color: #fff; }
.status-pill--stale   { background: var(--color-yellow); color: #111; }
.status-pill--failed  { background: var(--color-red);    color: #fff; }
.status-pill--running { background: var(--color-blue);   color: #fff; animation: pulse 1.6s ease-in-out infinite; }
.status-pill--never   { background: #e1e4e8; color: #555; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* ---- Score circle ---- */
.score-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}
.score-circle.good   { background: var(--color-green); }
.score-circle.medium { background: var(--color-yellow); color: #111; }
.score-circle.low    { background: var(--color-red); }

/* ---- Forms ---- */
form p { margin-bottom: var(--sp-md); }
form label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: var(--sp-xs);
}
input[type="text"],
input[type="url"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  font-family: inherit;
  font-size: .95rem;
  padding: 10px 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color .2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-blue);
}
textarea { min-height: 160px; resize: vertical; }

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: var(--sp-2xl) var(--sp-lg);
}
.hero .logo-hero { height: 96px; margin: 0 auto var(--sp-lg); }
.hero h1 { margin-bottom: var(--sp-sm); }
.hero p {
  font-size: 1.15rem;
  color: var(--color-text-light);
  margin-bottom: var(--sp-xl);
}
.hero .btn-row { justify-content: center; }

/* ---- Status bar ---- */
.status-bar {
  display: flex;
  gap: var(--sp-lg);
  flex-wrap: wrap;
  align-items: center;
  padding: var(--sp-md) 0;
  margin-bottom: var(--sp-md);
  border-bottom: 1px solid var(--color-border);
  font-size: .9rem;
}
.status-bar .status-item { display: flex; align-items: center; gap: var(--sp-xs); }

/* ---- Content preview (rendered Markdown) ---- */
.content-preview {
  background: #f4f5f7;
  border-radius: var(--radius-sm);
  padding: var(--sp-lg);
  font-size: .9rem;
  line-height: 1.7;
  max-height: 600px;
  overflow-y: auto;
}
.content-preview h1 { font-size: 1.5rem; margin: 1rem 0 .5rem; }
.content-preview h2 { font-size: 1.25rem; margin: 1rem 0 .5rem; }
.content-preview h3 { font-size: 1.1rem; margin: .75rem 0 .4rem; }
.content-preview p { margin: 0 0 .75rem; }
.content-preview ul, .content-preview ol { margin: 0 0 .75rem; padding-left: 1.5rem; }
.content-preview li { margin-bottom: .25rem; }
.content-preview table { width: 100%; border-collapse: collapse; margin: .75rem 0; }
.content-preview th, .content-preview td { border: 1px solid var(--color-border); padding: .4rem .6rem; text-align: left; }
.content-preview th { background: #ebedf0; font-weight: 600; }
.content-preview code { background: #ebedf0; padding: .15rem .35rem; border-radius: 3px; font-size: .85em; }
.content-preview pre { background: #ebedf0; padding: var(--sp-md); border-radius: var(--radius-sm); overflow-x: auto; margin: .75rem 0; }
.content-preview pre code { background: none; padding: 0; }
.content-preview blockquote { border-left: 3px solid var(--color-blue); margin: .75rem 0; padding: .5rem 1rem; color: #555; }

/* ---- Section accent header ---- */
.accent-header {
  padding: var(--sp-xl) var(--sp-lg);
  border-radius: var(--radius-md);
  color: #fff;
  margin-bottom: var(--sp-lg);
}
.accent-header h1 { color: #fff; }
.accent-header p  { color: rgba(255,255,255,.85); }
.accent-header a  { color: #fff; text-decoration: underline; }

/* ---- Document detail hero ---- */
.doc-hero {
  position: relative;
  border-radius: var(--radius-md);
  padding: var(--sp-xl) var(--sp-lg) var(--sp-lg);
  padding-right: calc(var(--sp-lg) + 48px);
  margin-bottom: var(--sp-lg);
  color: #fff;
}
.doc-hero-breadcrumb {
  color: rgba(255,255,255,.8);
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
}
.doc-hero-breadcrumb:hover { color: #fff; text-decoration: underline; }
.doc-hero-breadcrumb-sep {
  color: rgba(255,255,255,.5);
  font-size: .85rem;
  margin: 0 .25rem;
}
.doc-hero-title {
  color: #fff;
  margin-top: var(--sp-sm);
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
}
.doc-hero-desc {
  color: rgba(255,255,255,.85);
  margin-top: var(--sp-xs);
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.doc-hero-desc-hint {
  font-style: italic;
  opacity: .7;
}
.doc-hero-desc-hint:hover {
  opacity: 1;
  cursor: pointer;
}
.doc-hero-desc-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,.5);
  font-size: .85rem;
  padding: 0 2px;
  opacity: 0;
  transition: opacity .15s;
}
.doc-hero-desc:hover .doc-hero-desc-edit-btn,
.doc-hero-desc-edit-btn-visible {
  opacity: 1;
}
.doc-hero-desc-edit-btn:hover {
  color: #fff;
}
.doc-hero-desc-wrap {
  position: relative;
}
.doc-hero-desc-input {
  width: 100%;
  max-width: 600px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: var(--radius);
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: .95rem;
  font-family: inherit;
  resize: vertical;
}
.doc-hero-desc-input::placeholder {
  color: rgba(255,255,255,.5);
}

/* ---- Document status strip ---- */
.doc-status-strip {
  display: flex;
  gap: var(--sp-md);
  flex-wrap: wrap;
  align-items: center;
  background: var(--color-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-md) var(--sp-lg);
  margin-bottom: var(--sp-lg);
}
.doc-status-chip {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  font-size: .88rem;
}
.doc-status-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-text-light);
}
.doc-status-select {
  width: auto;
  padding: .2rem .4rem;
  font-size: .85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

/* ---- Toggle switch (Approved) ---- */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  margin: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--color-border);
  border-radius: var(--radius-full);
  transition: background .25s;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .25s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--color-green);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* ---- Download links (table inline) ---- */
.dl-links {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}
.dl-links a {
  color: var(--color-blue);
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background .15s;
}
.dl-links a:hover {
  background: rgba(0,172,255,.1);
  text-decoration: none;
}
.dl-sep {
  color: var(--color-border);
  font-size: .7rem;
}

/* ---- Pillar hero ---- */
.pillar-hero {
  background: var(--color-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-xl);
  margin-bottom: var(--sp-lg);
  border-top: 5px solid var(--ph-accent, var(--color-blue));
}
.pillar-hero h1 {
  color: var(--ph-accent, var(--color-text));
}

/* ---- Guideline grid cards ---- */
.guideline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
}
.guideline-card {
  display: flex;
  text-decoration: none;
  color: inherit;
  background: var(--color-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s, transform .15s;
}
.guideline-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.guideline-card-accent {
  width: 6px;
  flex-shrink: 0;
  background: var(--gc-accent, var(--color-blue));
}
.guideline-card-body {
  padding: var(--sp-md) var(--sp-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}
.guideline-card-name {
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.4;
  color: var(--color-text);
}
.guideline-card:hover .guideline-card-name {
  color: var(--gc-accent, var(--color-blue));
}
.guideline-card-progress {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}
.guideline-card-stat {
  font-size: .75rem;
  color: var(--color-text-light);
  white-space: nowrap;
}
.guideline-card-badge {
  font-size: .75rem;
  color: var(--color-text-light);
  font-style: italic;
}

/* ---- Inline CRUD (pillar detail) ---- */
.guideline-card-wrap {
  position: relative;
}
.guideline-card-wrap .inline-card-actions {
  position: absolute;
  top: var(--sp-sm);
  right: var(--sp-sm);
  display: none;
  gap: 2px;
  z-index: 2;
}
.guideline-card-wrap:hover .inline-card-actions {
  display: flex;
}
.inline-btn-edit,
.inline-btn-delete {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .85rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  transition: background .15s, color .15s;
}
.inline-btn-edit:hover {
  background: var(--color-blue);
  color: #fff;
  border-color: var(--color-blue);
}
.inline-btn-delete:hover {
  background: var(--color-red);
  color: #fff;
  border-color: var(--color-red);
}
.inline-rename-input {
  font-size: .95rem;
  font-weight: 600;
  padding: 4px 8px;
  border: 2px solid var(--color-blue);
  border-radius: var(--radius-sm);
  outline: none;
  width: 100%;
  max-width: 280px;
  font-family: inherit;
}
.inline-cadence-select {
  font-size: .85rem;
  padding: 4px 6px;
  border: 2px solid var(--color-blue);
  border-radius: var(--radius-sm);
  outline: none;
  font-family: inherit;
  background: #fff;
  cursor: pointer;
  width: 130px;
  flex-shrink: 0;
}
.inline-row-actions {
  white-space: nowrap;
  text-align: right;
}
.inline-row-actions .inline-btn-edit,
.inline-row-actions .inline-btn-delete {
  opacity: 0;
  transition: opacity .15s, background .15s, color .15s;
}
tr:hover .inline-row-actions .inline-btn-edit,
tr:hover .inline-row-actions .inline-btn-delete {
  opacity: 1;
}
.inline-row-actions {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
}
.guideline-card-add {
  display: flex;
  align-items: center;
  background: var(--color-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-md) var(--sp-lg);
  border: 2px dashed var(--color-border);
}
.guideline-card-add:hover {
  border-color: var(--gc-accent, var(--color-blue));
}
.inline-add-form {
  display: flex;
  gap: var(--sp-sm);
  align-items: center;
  width: 100%;
}
.inline-add-input {
  flex: 1;
  font-size: .88rem;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
  font-family: inherit;
}
.inline-add-input:focus {
  border-color: var(--color-blue);
}
.inline-add-form-row {
  padding: var(--sp-xs) 0;
}
.doc-add-row td {
  border-top: 1px dashed var(--color-border);
  padding-top: var(--sp-sm);
}

/* ---- Adequacy feedback card ---- */
.adequacy-feedback-card {
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-blue);
  border-radius: var(--radius);
  background: #f0f8ff;
}
.adequacy-feedback-header,
details.adequacy-feedback-card > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem .8rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
details.adequacy-feedback-card > summary::-webkit-details-marker { display: none; }
.adequacy-feedback-header {
  border-bottom: 1px solid var(--color-border);
}
details.adequacy-feedback-card[open] > summary {
  border-bottom: 1px solid var(--color-border);
}
.adequacy-feedback-body {
  padding: .6rem .8rem;
  font-size: .82rem;
  line-height: 1.6;
  white-space: pre-line;
  color: var(--color-text);
}

/* ---- Score popover ---- */
.score-popover-wrap {
  position: relative;
  display: inline-block;
}
.score-badge-btn {
  cursor: pointer;
  border: none;
  font: inherit;
}
.score-badge-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 0 2px rgba(0,0,0,.12);
}
.score-popover {
  display: none;
  position: absolute;
  z-index: 100;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
}
.score-popover.visible {
  display: block;
}
.score-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--color-border);
  font-size: .85rem;
}
.score-popover-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--color-muted);
  line-height: 1;
}
.score-popover-close:hover {
  color: var(--color-text);
}
.score-popover-body {
  padding: .6rem .8rem;
  font-size: .8rem;
  line-height: 1.5;
  color: var(--color-text);
  white-space: pre-line;
  max-height: 280px;
  overflow-y: auto;
}

/* ---- Doc description inline ---- */
.doc-desc-line {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 2px;
}
.doc-desc-text {
  font-size: 0.8rem;
  line-height: 1.3;
  min-height: 1em;
}
.doc-desc-text:empty::after {
  content: "No description";
  opacity: 0.4;
  font-style: italic;
}
.doc-desc-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity .15s;
  padding: 0 2px;
  color: var(--color-muted);
}
.doc-desc-line:hover .doc-desc-edit-btn {
  opacity: .7;
}
.doc-desc-edit-btn:hover {
  opacity: 1 !important;
  color: var(--color-blue);
}
.doc-desc-input {
  font-size: 0.8rem;
  padding: 2px 6px;
  width: 100%;
  max-width: 400px;
}

/* ---- Checklist styles ---- */
.checklist-progress-bar {
  height: 10px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.checklist-progress-bar.checklist-progress-sm {
  width: 80px;
  height: 6px;
}
.checklist-progress-fill {
  height: 100%;
  background: var(--color-green);
  border-radius: var(--radius-full);
  transition: width .3s ease;
}
.checklist-category {
  margin-bottom: var(--sp-lg);
}
.checklist-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.checklist-item {
  padding: var(--sp-sm) 0;
  border-bottom: 1px solid var(--color-border);
  transition: opacity .2s;
}
.checklist-item:last-child {
  border-bottom: none;
}
.checklist-label {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-sm);
  cursor: pointer;
  font-weight: 400;
  font-size: .92rem;
  margin: 0;
}
.checklist-check {
  width: 20px;
  height: 20px;
  min-width: 20px;
  accent-color: var(--color-green);
  cursor: pointer;
  margin-top: 2px;
}
.checklist-text {
  line-height: 1.5;
}
.checklist-done .checklist-text {
  text-decoration: line-through;
  color: var(--color-text-light);
}
.checklist-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.checklist-actions {
  display: none;
  gap: 2px;
  flex-shrink: 0;
  margin-left: var(--sp-sm);
}
.checklist-item:hover .checklist-actions {
  display: flex;
}
.checklist-btn-edit,
.checklist-btn-delete {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .85rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  transition: background .15s, color .15s;
}
.checklist-btn-edit:hover {
  background: var(--color-blue);
  color: #fff;
  border-color: var(--color-blue);
}
.checklist-btn-delete:hover {
  background: var(--color-red);
  color: #fff;
  border-color: var(--color-red);
}
.checklist-edit-input {
  flex: 1;
  font-size: .92rem;
  padding: 4px 8px;
  border: 2px solid var(--color-blue);
  border-radius: var(--radius-sm);
  outline: none;
  margin-left: var(--sp-sm);
}
.checklist-add-row {
  padding: var(--sp-sm) 0 0;
  border-top: 1px solid var(--color-border);
  margin-top: var(--sp-xs);
}
.checklist-add-form {
  display: flex;
  gap: var(--sp-sm);
  align-items: center;
}
.checklist-add-input {
  flex: 1;
  font-size: .88rem;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
}
.checklist-add-input:focus {
  border-color: var(--color-blue);
}

/* ---- AI Actions card tint ---- */
.card-ai {
  background: #f0f9ff;
  border-left: 4px solid var(--color-blue);
}

/* ---- Prefill banner ---- */
.prefill-banner {
  background: #e8f7ff;
  border: 1px solid var(--color-blue);
  border-left: 4px solid var(--color-blue);
  border-radius: var(--radius);
  padding: .6rem .8rem;
  font-size: .85rem;
  color: var(--color-text);
}

/* ---- AI loading overlay ---- */
.ai-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.75);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.ai-loading-msg {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-blue);
}
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(0,172,255,.25);
  border-top-color: var(--color-blue);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
}
.spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Steps indicator ---- */
.steps {
  display: flex;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-lg);
  flex-wrap: wrap;
}
.step {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  background: var(--color-border);
  color: var(--color-text-light);
}
.step.active { background: var(--color-blue); color: #fff; }
.step.done   { background: var(--color-green); color: #fff; }
.step-link { text-decoration: none; color: inherit; }
.step:hover { transform: scale(1.15); transition: transform .15s; cursor: pointer; }

/* ---- AI Credit card ---- */
.ai-credit-card {
  border-left: 4px solid var(--color-blue);
  background: linear-gradient(135deg, #f0f9ff 0%, var(--color-card) 100%);
}
.ai-credit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-md);
}
.ai-credit-header h3 {
  margin: 0;
  font-size: 1.1rem;
}
.ai-credit-body {
  display: flex;
  gap: var(--sp-xl);
  align-items: center;
  flex-wrap: wrap;
}
.ai-credit-meter {
  flex: 1;
  min-width: 200px;
}
.ai-credit-bar {
  height: 10px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.ai-credit-fill {
  height: 100%;
  background: var(--color-blue);
  border-radius: var(--radius-full);
  transition: width .4s ease;
}
.ai-credit-fill.warning {
  background: var(--color-yellow);
}
.ai-credit-fill.depleted {
  background: var(--color-red);
}
.ai-credit-labels {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  color: var(--color-text-light);
  margin-top: var(--sp-xs);
}
.ai-credit-remaining {
  text-align: center;
  min-width: 120px;
}
.ai-credit-remaining .big-number {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  display: block;
  margin-bottom: var(--sp-xs);
}
.ai-credit-remaining .label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-text-light);
}

/* ---- Overdue card ---- */
.overdue-card {
  background: #fff0f0;
  border-left: 4px solid var(--color-red);
}

/* ---- Scope page ---- */
.scope-wrap {
  max-width: 500px;
  margin: var(--sp-xl) auto;
}

/* ---- Pillar swatch picker (pillar create/edit form) ---- */
.swatch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 var(--sp-md);
}
.swatch-grid .swatch-option {
  position: relative;
  display: inline-block;
  line-height: 0;
}
.swatch-grid input[type="radio"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.swatch {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-block;
  border: 2px solid transparent;
  box-shadow: 0 0 0 1px var(--color-border) inset;
  transition: transform .1s, border-color .1s, box-shadow .1s;
}
.swatch:hover { transform: scale(1.08); }
.swatch-grid input[type="radio"]:checked + .swatch {
  border-color: var(--color-text);
  box-shadow: 0 0 0 2px var(--color-bg) inset, 0 0 0 1px var(--color-text);
}
.swatch-grid input[type="radio"]:focus-visible + .swatch {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}

/* ---- Generic dropdown menu (pillar cards, doc/guideline header, Download split button) ---- */
.pillar-card-wrap { position: relative; }

.dropdown-menu {
  position: relative;
  display: inline-block;
}
.dropdown-menu__trigger {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--color-text);
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s, box-shadow .15s;
}
.dropdown-menu__trigger:hover,
.dropdown-menu__trigger[aria-expanded="true"] {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.dropdown-menu__panel {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  min-width: 200px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  padding: 6px;
  display: none;
  z-index: 40;
}
.dropdown-menu.is-open .dropdown-menu__panel { display: block; }
.dropdown-menu__item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--color-text);
  text-decoration: none;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}
.dropdown-menu__item:hover { background: var(--color-bg); }
.dropdown-menu__item--danger { color: var(--color-red); }
.dropdown-menu__item--danger:hover { background: rgba(255, 60, 65, 0.08); }
.dropdown-menu__divider {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 6px 4px;
}

/* --pillar-card: absolutely positioned over the card's top-right corner. */
.dropdown-menu--pillar-card {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

/* --header: floats to the right of a doc/guideline hero. */
.dropdown-menu--header {
  position: absolute;
  top: 14px;
  right: 14px;
}
.dropdown-menu--header .dropdown-menu__trigger {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
.dropdown-menu--header .dropdown-menu__trigger:hover,
.dropdown-menu--header .dropdown-menu__trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* --split: trigger is a regular button, panel drops below it. */
.dropdown-menu--split .dropdown-menu__trigger {
  width: auto;
  height: auto;
  border-radius: 6px;
  padding: .5rem .9rem;
  font-size: .95rem;
  background: var(--color-card);
}
.dropdown-menu--split .dropdown-menu__panel {
  min-width: 180px;
}

/* Pillars page header */
.pillar-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
  flex-wrap: wrap;
}
.pillar-page-header h1 { margin: 0; }

/* ---- Site footer ---- */
.site-footer-wrap {
  background: var(--color-dark-blue);
  color: rgba(255, 255, 255, 0.78);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 52px 0 36px;
  margin-top: var(--sp-xl);
}
.site-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}
.site-footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: var(--sp-lg);
  align-items: start;
}
.site-footer-col {
  min-width: 0;
}
.site-footer-col--brand {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}
.site-footer-logo {
  display: inline-flex;
  align-items: center;
}
.site-footer-logo img {
  height: 88px;
  width: auto;
  max-width: 320px;
  display: block;
  object-fit: contain;
  filter: invert(1);
}
@media (max-width: 560px) {
  .site-footer-logo img {
    height: 72px;
    max-width: 260px;
  }
}
.site-footer-copy {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}
.site-footer-heading {
  margin: 0 0 12px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.site-footer-links a {
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  font-size: 15px;
  line-height: 1.5;
}
.site-footer-links a:hover,
.site-footer-links a:focus {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: #fff;
}
.site-footer-muted {
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .site-footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .site-footer-wrap {
    padding: 40px 0 28px;
  }
  .site-footer-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-md);
  }
}

/* ---- Back link ---- */
.back-link {
  display: inline-block;
  margin-top: var(--sp-md);
  font-size: .9rem;
}

/* ---- Wizard button loading ---- */
.btn-wizard.is-loading {
  pointer-events: none;
  opacity: .7;
  position: relative;
}
.btn-wizard.is-loading::after {
  content: '';
  display: inline-block;
  width: .85em;
  height: .85em;
  margin-left: .45em;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: middle;
  animation: wizard-spin .6s linear infinite;
}
@keyframes wizard-spin {
  to { transform: rotate(360deg); }
}

/* ---- Utility ---- */
.text-muted { color: var(--color-text-light); }
.text-red   { color: var(--color-red); }
.text-green { color: var(--color-green); }
.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mt-lg { margin-top: var(--sp-lg); }
.mb-md { margin-bottom: var(--sp-md); }
.mb-lg { margin-bottom: var(--sp-lg); }
.gap-sm { gap: var(--sp-sm); }

/* ---- Phase 2: Folders ---- */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-md);
  margin-bottom: var(--sp-md);
}
.folder-card-wrap {
  position: relative;
}
.folder-card {
  position: relative;
  display: flex;
  text-decoration: none;
  color: inherit;
  background: var(--color-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s, transform .15s;
}
.folder-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  transform: translateY(-2px);
  text-decoration: none;
}
.folder-card-accent {
  width: 6px;
  flex-shrink: 0;
  background: var(--gc-accent, var(--color-blue));
}
.folder-card-body {
  padding: var(--sp-md) var(--sp-lg);
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}
.folder-card-icon {
  color: var(--gc-accent, var(--color-blue));
  display: flex;
  align-items: center;
  justify-content: center;
}
.folder-card-text { min-width: 0; }
.folder-card-name {
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.3;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.folder-card:hover .folder-card-name { color: var(--gc-accent, var(--color-blue)); }
.folder-card-count {
  font-size: .75rem;
  color: var(--color-text-light);
  margin-top: 2px;
}
.folder-card-wrap .inline-card-actions {
  position: absolute;
  top: var(--sp-sm);
  right: var(--sp-sm);
  display: none;
  gap: 2px;
  z-index: 2;
}
.folder-card-wrap:hover .inline-card-actions { display: flex; }

.folder-drop-zone {
  position: absolute;
  inset: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  pointer-events: none;
  opacity: 0;
  border-radius: var(--radius-md);
  border: 2px dashed transparent;
  background: transparent;
  transition: opacity .15s, background .15s, border-color .15s;
  z-index: 3;
}
body.dnd-dragging-guideline .folder-drop-zone {
  pointer-events: auto;
  opacity: 1;
  border-color: var(--gc-accent, var(--color-blue));
  background: rgba(0, 172, 255, 0.08);
}
.folder-drop-zone > * { display: none; }

.folder-card-add {
  display: flex;
  align-items: center;
  background: var(--color-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-md) var(--sp-lg);
  border: 2px dashed var(--color-border);
  grid-column: span 2;
  min-width: 0;
}
.folder-card-add:hover { border-color: var(--gc-accent, var(--color-blue)); }
.folder-card-add .inline-add-input { min-width: 0; }
@media (max-width: 520px) {
  .folder-card-add { grid-column: auto; }
}

/* Folder detail page */
.folder-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: .85rem;
  color: var(--color-text-light);
  margin-bottom: var(--sp-sm);
}
.folder-breadcrumb a { color: var(--color-text-light); }
.folder-breadcrumb .crumb-sep { opacity: .5; }
.folder-breadcrumb .crumb-current { color: var(--color-text); font-weight: 500; }
.folder-title-icon {
  display: inline-flex;
  vertical-align: middle;
  margin-right: var(--sp-sm);
  color: var(--ph-accent, var(--color-blue));
}
.folder-header-actions { gap: var(--sp-sm); }
.root-drop-zone {
  list-style: none;
  margin: 0 0 var(--sp-lg);
  padding: var(--sp-xl) var(--sp-md);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-card);
  min-height: 80px;
  text-align: center;
  color: var(--color-text-light);
  transition: border-color .15s, background .15s;
}
.root-drop-zone::before {
  content: 'Drop a to-do here to move it to the pillar root';
  font-size: .85rem;
}
body.dnd-dragging-guideline .root-drop-zone {
  border-color: var(--color-blue);
  background: rgba(0, 172, 255, 0.04);
}
.root-drop-zone > * { display: none; }

/* ---- Phase 2: Collapsible sections ---- */
.sections-list { display: flex; flex-direction: column; }
.section-card { position: relative; }
.section-toggle {
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  color: var(--color-text);
  text-align: left;
}
.section-toggle:focus-visible { outline: 2px solid var(--color-blue); outline-offset: 2px; }
.section-chevron {
  display: inline-block;
  font-size: 1rem;
  line-height: 1;
  transition: transform .15s;
  color: var(--color-text-light);
}
.section-card.is-collapsed .section-chevron { transform: rotate(-90deg); }
.section-name { font-weight: 700; font-size: 1.15rem; }
.section-header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  flex-wrap: wrap;
}
.section-header-actions .inline-btn-edit,
.section-header-actions .inline-btn-delete {
  opacity: 0;
  transition: opacity .15s, background .15s, color .15s;
}
.section-card:hover .section-header-actions .inline-btn-edit,
.section-card:hover .section-header-actions .inline-btn-delete {
  opacity: 1;
}
.section-body {
  transition: max-height .2s ease, opacity .15s ease;
  overflow: hidden;
}
.section-card.is-collapsed .section-body {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
}
.section-add-card {
  border: 2px dashed var(--color-border);
  box-shadow: none;
  padding: var(--sp-md) var(--sp-lg);
}
.section-add-card:hover { border-color: var(--gc-accent, var(--color-blue)); }
.section-add-card .inline-add-form { width: 100%; }

/* ---- Phase 2: DnD chrome ---- */
.dnd-ghost {
  opacity: .4;
  background: rgba(0, 172, 255, 0.12) !important;
}
.folder-card-wrap.sortable-chosen,
.guideline-card-wrap.sortable-chosen,
.section-card.sortable-chosen {
  cursor: grabbing;
}
.dnd-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--color-text);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: .85rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 9999;
}
.dnd-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 640px) {
  .container { padding: var(--sp-md); }
  .site-nav { padding: var(--sp-sm); }
  .site-nav .nav-links a { padding: 4px 10px; font-size: .8rem; }
  .summary-row { flex-direction: column; }
  .pillar-grid { grid-template-columns: 1fr; }
}

/* ── Phase 3: inline AI refinement box ── */
.ai-inline-box {
  background: rgba(0,0,0,.03);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: var(--sp-md);
}
.ai-inline-box label {
  display: block;
  font-weight: 600;
  margin-bottom: .35rem;
}
.ai-inline-box textarea {
  width: 100%;
  padding: .5rem .65rem;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px;
  font: inherit;
  resize: vertical;
}
.ai-inline-help strong { font-weight: 600; color: var(--text, #111); }

/* ── Phase 3: pillar scaffold review list ── */
.scaffold-list { display: flex; flex-direction: column; gap: var(--sp-sm); }
.scaffold-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .6rem;
  background: rgba(0,0,0,.02);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
}
.scaffold-row-stack { flex-direction: column; align-items: stretch; }
.scaffold-row-main {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.scaffold-check { display: inline-flex; align-items: center; }
.scaffold-name-input { flex: 2; min-width: 180px; }
.scaffold-meta-input { flex: 1; min-width: 120px; }
.scaffold-desc-input {
  margin-top: .4rem;
  width: 100%;
  resize: vertical;
}

/* ------- Phase 4: AI summary + config ------- */
.ai-summary-box { border: 1px solid #e2e8f0; border-radius: 6px; background: #fafbfc; margin-bottom: 1rem; }
.ai-summary-box > summary { padding: .5rem .75rem; cursor: pointer; user-select: none; }
.ai-summary-box[open] > summary { border-bottom: 1px solid #e2e8f0; }
.ai-summary-body { padding: .75rem; }
.ai-summary-content { white-space: pre-wrap; font-family: 'SF Mono', Consolas, monospace; font-size: .85em; background: #fff; border: 1px solid #eee; border-radius: 4px; padding: .6rem .75rem; margin: 0 0 .6rem 0; line-height: 1.35; }
.ai-summary-actions { display: flex; align-items: center; gap: .5rem; }

.breakdown-table { width: 100%; border-collapse: collapse; }
.breakdown-table td { padding: .4rem .6rem; border-bottom: 1px solid #eef1f4; vertical-align: top; }
.breakdown-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.breakdown-table tr.totals-row td { border-top: 2px solid #cbd5e0; border-bottom: none; padding-top: .6rem; }
.full-read-table { width: 100%; border-collapse: collapse; font-size: .92em; }
.full-read-table th, .full-read-table td { padding: .4rem .5rem; border-bottom: 1px solid #eef1f4; text-align: left; }
.full-read-table th.num, .full-read-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.full-read-table tr.row-flagged { background: #f3f7ff; }
.alert-warning { background: #fff4e5; border: 1px solid #f4b000; color: #7a4b00; padding: .75rem 1rem; border-radius: 6px; }
.text-warning { color: #b34600; }

/* ---- /orgs/new/ form ---- */
.org-new-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding-top: var(--sp-xl);
}
.org-new-card { padding: var(--sp-xl); }
.org-new-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--sp-sm);
}
.org-new-sub {
  color: var(--color-text-light);
  margin-bottom: var(--sp-lg);
  line-height: 1.6;
}
.org-new-form .org-new-field { margin-bottom: var(--sp-md); }
.org-new-form label {
  display: block;
  font-weight: 500;
  font-size: .9rem;
  margin-bottom: 6px;
}
.org-new-form input[type="text"],
.org-new-form input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
}
.org-new-form input:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(0,172,255,.15);
}
.org-new-help {
  font-size: .8rem;
  color: var(--color-text-light);
  margin-top: 4px;
}
.org-new-error {
  color: var(--color-red);
  font-size: .85rem;
  margin-top: 4px;
}
.org-new-optional {
  color: var(--color-text-light);
  font-weight: 400;
}
.org-new-actions {
  display: flex;
  gap: var(--sp-sm);
  align-items: center;
  margin-top: var(--sp-lg);
}

/* ============================================================
   Document read view: toolbar, body typography, empty state
   Mirrors document_download_pdf inline styles so on-screen
   preview and PDF export look the same.
   ============================================================ */
.doc-toolbar {
  display: flex;
  gap: var(--sp-sm);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--sp-md);
}
.doc-toolbar .btn-wizard { margin-left: auto; }

.doc-body {
  background: var(--color-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-xl) var(--sp-lg);
  color: #111;
  line-height: 1.6;
  font-size: 1rem;
  max-width: 800px;
  margin: 0 auto var(--sp-lg);
}
.doc-body h1 { font-size: 1.6rem; margin: .25rem 0 .75rem; }
.doc-body h2 { font-size: 1.3rem; margin: 1.5rem 0 .5rem; }
.doc-body h3 { font-size: 1.1rem; margin: 1.2rem 0 .4rem; }
.doc-body p  { margin: .6rem 0; }
.doc-body ul, .doc-body ol { margin: .5rem 0 .5rem 1.4rem; }
.doc-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.doc-body th, .doc-body td { border: 1px solid #ccc; padding: 6px 10px; text-align: left; }
.doc-body th { background: #f0f0f0; }
.doc-body code { background: #f0f0f0; padding: 2px 5px; border-radius: 3px; font-size: .9em; }
.doc-body pre { background: #f0f0f0; padding: 12px; border-radius: 6px; overflow-x: auto; }
.doc-body pre code { background: transparent; padding: 0; }
.doc-body blockquote {
  border-left: 3px solid var(--accent, #00acff);
  margin: 1rem 0;
  padding: .5rem 1rem;
  color: #555;
}
.doc-body img { max-width: 100%; height: auto; }

.doc-empty {
  text-align: center;
  padding: var(--sp-xl) var(--sp-lg);
}
.doc-empty h2 { margin-top: 0; }
.doc-empty .btn-row { justify-content: center; }

/* ============================================================
   Document edit view: Toast UI host, settings, sticky save bar
   ============================================================ */
.toast-editor-host {
  background: var(--color-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.toast-editor-host .toastui-editor-defaultUI {
  border: none;
  border-radius: var(--radius-md);
}

.doc-settings {
  background: var(--color-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-sm) var(--sp-md);
}
.doc-settings > summary {
  cursor: pointer;
  font-weight: 600;
  padding: var(--sp-xs) 0;
  user-select: none;
}
.doc-settings > summary:hover { color: var(--color-blue); }
.doc-settings .doc-settings-body {
  padding: var(--sp-sm) 0 var(--sp-xs);
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}
.doc-settings .form-row label {
  display: block;
  font-weight: 500;
  margin-bottom: .25rem;
}
.doc-settings .form-row input[type="text"],
.doc-settings .form-row input[type="url"] {
  width: 100%;
  max-width: 560px;
}
.doc-settings .form-row-toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.sticky-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  margin-top: var(--sp-lg);
  padding: var(--sp-sm) var(--sp-md);
  background: var(--color-card);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 12px rgba(0,0,0,.05);
  display: flex;
  gap: var(--sp-md);
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border-radius: var(--radius-md);
}
.sticky-save-bar__info { font-size: .85rem; }
.sticky-save-bar__actions {
  display: flex;
  gap: var(--sp-sm);
  align-items: center;
}

@media (max-width: 640px) {
  .doc-toolbar .btn-wizard { margin-left: 0; }
  .sticky-save-bar { flex-direction: column; align-items: stretch; }
  .sticky-save-bar__actions { justify-content: flex-end; }
}

/* ============================================================
   Guideline checklist: read vs. edit mode
   Read mode hides the per-item Edit/Delete buttons and the
   "Add a task" row, so the page reads as a checklist to work
   through rather than a management surface.
   ============================================================ */
.checklist-root:not(.is-editing) .checklist-actions,
.checklist-root:not(.is-editing) .checklist-add-row {
  display: none !important;
}
