/* WSC Tools — black background, white text, green buttons & accents */

:root {
  --wsc-bg: #0a0a0a;
  --wsc-bg-elevated: #141414;
  --wsc-text: #f5f5f5;
  --wsc-text-muted: #a3a3a3;
  --wsc-green: #22c55e;
  --wsc-green-hover: #16a34a;
  --wsc-green-dim: #14532d;
  --wsc-green-glow: rgba(34, 197, 94, 0.35);
  --wsc-border: #22c55e;
  /* Grid tiles, header rule, and title — shared neutral gray */
  --wsc-surface-gray: #505050;
  /* Same column as .grid / .cat-div so .wsc-site-wh-bar lines up with the rightmost cat-div */
  --wsc-content-max: 900px;
  --wsc-content-padding-x: 1rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--wsc-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--wsc-bg);
  color: var(--wsc-text);
  text-align: center;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Header & title */
header {
  padding: 1rem 1rem 0.5rem;
  border-bottom: 1px solid var(--wsc-surface-gray);
}

h1.title,
h1.title a {
  color: var(--wsc-text);
  text-decoration: none;
  text-align: center;
  margin: 0.5rem 0;
}

h1.title a:hover {
  color: var(--wsc-green);
}

header h6 {
  color: var(--wsc-text-muted);
  font-weight: 600;
  margin: 0;
}

/* Status dots */
.green-dot {
  height: 10px;
  width: 10px;
  background-color: var(--wsc-green);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--wsc-green-glow);
  vertical-align: middle;
}

.yellow-dot {
  height: 10px;
  width: 10px;
  background-color: #f0d022;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
}

.red-dot {
  height: 10px;
  width: 10px;
  background-color: #ef4444;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
}

.top-right-absolute {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 100;
}

/* Generic links (override black from old inline styles) */
a {
  color: var(--wsc-text);
  text-decoration: none;
}

a:hover {
  color: var(--wsc-green);
}

/*
 * Top-right action row (Logout, Options, Get Site Info, etc.)
 * - Default: first child of div.login-link is fixed + flex row.
 * - Folder / tool pages: wrap auth + extra buttons in <div class="wsc-top-action-bar"> as the first child.
 */
.wsc-top-action-bar,
div.login-link > :first-child {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 200;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  max-width: min(calc(100vw - 24px), 560px);
  text-align: right;
}

/* Keep grid/errors full-width so tiles stay centered */
div.login-link .grid {
  width: 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* Login / Register / Logout (+ folder page actions in .wsc-top-action-bar) — green buttons */
.login-link .btn,
.logout-div .btn,
.wsc-top-action-bar .btn {
  background-color: var(--wsc-green) !important;
  border-color: var(--wsc-green) !important;
  color: var(--wsc-bg) !important;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  margin: 0;
  width: auto;
  min-height: 2.625rem;
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.login-link .btn:hover,
.logout-div .btn:hover,
.wsc-top-action-bar .btn:hover {
  background-color: var(--wsc-green-hover) !important;
  border-color: var(--wsc-green-hover) !important;
  color: #fff !important;
}

.login-link .btn a,
.logout-div .btn a,
.wsc-top-action-bar .btn a {
  color: inherit !important;
  text-decoration: none;
}

.login-link .btn a:hover,
.logout-div .btn a:hover,
.wsc-top-action-bar .btn a:hover {
  color: inherit !important;
}

.logout-div {
  font-weight: bold;
  margin-bottom: 0;
}

/*
 * Combined site + warhead info (getSiteDiv + whInfo):
 * Wrap both in one parent as the first row inside <main> (or .main):
 *   <div class="wsc-site-wh-bar">
 *     <div id="getSiteDiv">…</div>
 *     <div id="whInfo">…</div>
 *   </div>
 */
.wsc-site-wh-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  /* Same horizontal rhythm as .wsc-site-wh-bar > div (e.g. Get Site Info ↔ Generate) */
  gap: 0.5rem 0.75rem;
  width: 100%;
  max-width: var(--wsc-content-max);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1rem;
  box-sizing: border-box;
  padding: 0.5rem var(--wsc-content-padding-x);
  border-radius: 10px;
  background-color: var(--wsc-bg-elevated);
  border: none;
  text-align: center;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

/* One horizontal row of segments (e.g. CJ: whinfo, options, getSite / generate) */
.wsc-site-wh-bar > div {
  flex: 0 0 auto;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  min-width: 0;
}

.wsc-site-wh-bar .whinfo {
  float: none;
  width: auto;
  max-width: none;
}

/* CJ: wrapper around #optionsDiv — display:contents removes extra flex item so Options→Get Site Info isn’t double-spaced */
.wsc-site-wh-bar .whinfo + div {
  display: contents;
}

.wsc-site-wh-bar .getSiteDiv {
  margin-top: 0;
  padding-bottom: 0;
}

.wsc-site-wh-bar .getSiteDiv form {
  display: inline;
  margin: 0;
}

.wsc-site-wh-bar .whid {
  text-align: center;
  margin-bottom: 0;
}

.wsc-site-wh-bar .genbutton {
  margin-left: 0;
}

.wsc-site-wh-bar .optionsDiv {
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

/* Bar actions: same look as index grid tiles (grey fill, black label, white border + white text on hover) */
.wsc-site-wh-bar .wsc-bar-grid-btn,
.wsc-site-wh-bar #markupbutton,
.wsc-site-wh-bar button[name="getSiteInfo"] {
  background-color: var(--wsc-surface-gray) !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  color: #000000 !important;
  font-weight: 600 !important;
  padding: 0.5rem 1.25rem !important;
  margin: 0 !important;
  min-height: 2.625rem !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: none !important;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease !important;
}

.wsc-site-wh-bar .wsc-bar-grid-btn:hover,
.wsc-site-wh-bar #markupbutton:hover,
.wsc-site-wh-bar button[name="getSiteInfo"]:hover {
  background-color: var(--wsc-surface-gray) !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
}

.wsc-site-wh-bar .wsc-bar-grid-btn:focus-visible,
.wsc-site-wh-bar #markupbutton:focus-visible,
.wsc-site-wh-bar button[name="getSiteInfo"]:focus-visible {
  outline: 2px solid var(--wsc-green);
  outline-offset: 2px;
}

/* Generate Spreadsheet — same as logout / primary green .btn */
.wsc-site-wh-bar button.genbutton {
  background-color: var(--wsc-green) !important;
  border-color: var(--wsc-green) !important;
  color: var(--wsc-bg) !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  padding: 0.5rem 1.25rem !important;
  margin: 0 !important;
  min-height: 2.625rem !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: none !important;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease !important;
}

.wsc-site-wh-bar button.genbutton:hover {
  background-color: var(--wsc-green-hover) !important;
  border-color: var(--wsc-green-hover) !important;
  color: #ffffff !important;
}

.wsc-site-wh-bar button.genbutton:focus-visible {
  outline: 2px solid var(--wsc-green);
  outline-offset: 2px;
}

/* Category sections — share content column with .wsc-site-wh-bar (right edges align) */
.cat-div {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--wsc-content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--wsc-content-padding-x);
  padding-right: var(--wsc-content-padding-x);
}

.wsc-site-wh-bar #getSiteDiv,
.wsc-site-wh-bar #whInfo {
  margin: 0;
  padding: 0;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--wsc-text);
}

.wsc-site-wh-bar #whInfo {
  padding-left: 1rem;
  padding-right: 1rem;
  margin-left: 0;
  border-left: 1px solid var(--wsc-surface-gray);
}

.wsc-site-wh-bar #getSiteDiv a,
.wsc-site-wh-bar #whInfo a {
  color: var(--wsc-green);
}

.wsc-site-wh-bar #getSiteDiv a:hover,
.wsc-site-wh-bar #whInfo a:hover {
  color: var(--wsc-green-hover);
}

/* CJ Dropship (cjus): cat-div rows are % width of .cjus-main — bar must span same width, not --wsc-content-max */
.cjus-main .wsc-site-wh-bar {
  max-width: 100%;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
}

/*
 * Category cards: default 3 per row (wider than 4-up) for longer niche names.
 * Four columns only on very wide viewports.
 */
.cjus-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding-left: clamp(0.75rem, 3vw, 1.5rem);
  padding-right: clamp(0.75rem, 3vw, 1.5rem);
}

@media (min-width: 1400px) {
  .cjus-cat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .cjus-cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .cjus-cat-grid {
    grid-template-columns: 1fr;
  }
}

.cjus-main .cjus-cat-grid .cat-div {
  width: 100%;
  min-width: 0;
  display: block;
  margin: 0;
  padding-left: 0;
  padding-right: 0.35rem;
  box-sizing: border-box;
}

/* Page title (mockup-style) — CJ + formatter + calendars tools */
.cjus-page-title,
.formatter-page-title,
.calendars-page-title,
.training-page-title {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--wsc-text);
  text-align: center;
}

html:has(.training-viewport) {
  height: 100%;
}

/* Training sits under site chrome; fill remaining viewport instead of 100dvh + header */
body:has(.training-viewport) {
  height: 100%;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body:has(.training-viewport) > header {
  flex: 0 0 auto;
}

/* Stretch every wrapper between body and .training-viewport so the shell can shrink */
body:has(.training-viewport) *:has(.training-viewport) {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body:has(.training-viewport) > .training-viewport {
  flex: 1 1 auto;
  min-height: 0;
}

/* Formatter page — same column and card language as CJ */
.formatter-main {
  width: 100%;
  max-width: var(--wsc-content-max);
  margin: 0 auto;
  padding: 0 var(--wsc-content-padding-x) 2.5rem;
  box-sizing: border-box;
  text-align: left;
}

/* Training — same content column + formatter cards as calendars */
.training-viewport {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.training-viewport .training-page-title {
  flex: 0 0 auto;
  margin: 0 0 0.4rem;
}

.training-main {
  --training-sidebar-max-height: calc(100vh - 11rem);
  --training-sidebar-max-height: calc(100svh - 11rem);
  width: 100%;
  max-width: min(1480px, 100%);
  margin: 0 auto;
  padding: 0 var(--wsc-content-padding-x) 2.5rem;
  box-sizing: border-box;
  text-align: left;
}

.training-viewport > .training-main--viewport {
  flex: 1 1 auto;
  min-height: 0;
}

.training-main--viewport {
  display: flex;
  flex-direction: column;
  max-width: min(1480px, 100%);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--wsc-content-padding-x) 0.5rem;
  overflow: hidden;
}

.training-main--viewport .login-link {
  width: 100%;
  max-width: none;
  margin: 0 0 0.35rem;
  flex: 0 0 auto;
}

.training-main--viewport .logout-div {
  margin-bottom: 0.25rem;
}

.training-main--viewport .error-div,
.training-main--viewport .training-manifest-error {
  flex: 0 0 auto;
}

.training-intro {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--wsc-text-muted);
  text-align: center;
}

.training-shell {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: stretch;
  justify-content: center;
}

.training-main--viewport .training-shell {
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 0;
  width: 100%;
  gap: 1rem;
  overflow: hidden;
}

.training-sidebar {
  flex: 0 1 280px;
  width: 100%;
  max-width: 340px;
  min-width: 0;
  max-height: var(--training-sidebar-max-height);
  display: flex;
  flex-direction: column;
  align-self: flex-start;
}

.training-main--viewport .training-sidebar {
  align-self: stretch;
  max-height: none;
  height: 100%;
  min-height: 0;
}

.training-sidebar-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  flex: 1 1 auto;
  margin-bottom: 0;
}

.training-main--viewport .training-sidebar-card {
  height: 100%;
  max-height: none;
  flex: 1 1 auto;
}

.training-sidebar-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.45rem 0.55rem 0.6rem;
}

.training-sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-color: var(--wsc-surface-gray) var(--wsc-bg-elevated);
}

.training-search {
  padding: 0.15rem 0.1rem 0.55rem;
  border-bottom: 1px solid rgba(80, 80, 80, 0.35);
  margin-bottom: 0.4rem;
}

.training-search-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--wsc-text-muted);
  margin: 0 0 0.25rem;
}

.training-search-input {
  width: 100%;
  background: var(--wsc-bg);
  border: 1px solid var(--wsc-surface-gray);
  color: var(--wsc-text);
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  font-size: 0.9rem;
}

.training-search-input:focus-visible {
  outline: 2px solid var(--wsc-green);
  outline-offset: 2px;
}

.training-search-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.training-search-results {
  margin-top: 0.5rem;
}

.training-search-meta {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  color: var(--wsc-text-muted);
}

.training-search-results .training-item-row--sidebar {
  padding: 0.35rem 0;
}

.training-search-result-meta {
  margin-top: 0.1rem;
  font-size: 0.78rem;
  color: var(--wsc-text-muted);
  word-break: break-word;
}

.training-panel {
  flex: 1 1 520px;
  min-width: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.training-main--viewport .training-panel {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  align-self: stretch;
}

.training-preview-card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.training-main--viewport .training-preview-card {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.training-preview-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.training-preview-doc-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  word-break: break-word;
}

.training-main--viewport .formatter-card-header {
  text-align: center;
}

.training-preview-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.training-preview-frame-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 12rem;
  background: rgba(0, 0, 0, 0.2);
}

.training-main--viewport .training-preview-frame-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

.training-preview-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--wsc-text-muted);
  pointer-events: none;
}

.training-preview-placeholder p {
  margin: 0;
  max-width: 320px;
}

.training-preview-placeholder[hidden] {
  display: none !important;
}

.training-preview-iframe {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #141414;
}

.training-folder-details {
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.training-folder-details:last-child {
  border-bottom: none;
}

.training-folder-summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.25rem;
  cursor: pointer;
  list-style: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--wsc-text);
  user-select: none;
}

.training-folder-summary::-webkit-details-marker {
  display: none;
}

.training-folder-chevron {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  font-size: 0.55rem;
  line-height: 1;
  opacity: 0.75;
  transition: transform 0.15s ease;
}

.training-folder-chevron::before {
  content: "\25B8";
}

.training-folder-details[open] .training-folder-chevron {
  transform: rotate(90deg);
}

.training-folder-name {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  word-break: break-word;
}

.training-folder-count {
  flex: 0 0 auto;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--wsc-text-muted);
}

.training-folder-panel {
  padding: 0 0.15rem 0.65rem 1.5rem;
}

.training-folder-panel > .training-folder-details {
  margin-left: 0.15rem;
  border-bottom: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.training-folder-panel > .training-folder-details:first-of-type {
  border-top: none;
  margin-top: 0.15rem;
}

.training-item-list--sidebar {
  padding-top: 0.15rem;
}

.training-folder-panel > .training-item-list--sidebar:not(:first-child) {
  margin-top: 0.35rem;
}

.training-item-row--sidebar {
  padding: 0.4rem 0;
}

.training-sidebar-file {
  gap: 0.45rem;
}

.training-sidebar-file::before {
  content: "\2022";
  flex: 0 0 auto;
  color: var(--wsc-text-muted);
  font-size: 0.95rem;
  line-height: 1.35;
  margin-top: 0.08rem;
}

.training-empty-category--sidebar {
  margin: 0 0 0.35rem;
  padding-left: 1.5rem;
  font-size: 0.8rem;
}

@media (max-width: 720px) {
  html:has(.training-viewport) {
    height: auto;
    min-height: 100%;
  }

  body:has(.training-viewport) {
    display: block;
    height: auto;
    min-height: 100%;
    max-height: none;
    overflow: auto;
  }

  body:has(.training-viewport) *:has(.training-viewport) {
    display: block;
    flex: none;
    min-height: 0;
  }

  body:has(.training-viewport) > .training-viewport {
    flex: none;
  }

  .training-viewport {
    flex: none;
    height: auto;
    max-height: none;
    min-height: 100dvh;
    overflow: visible;
  }

  .training-main--viewport {
    flex: 1 1 auto;
    min-height: min(100dvh, 900px);
    overflow: visible;
  }

  .training-main--viewport .training-shell {
    flex-wrap: wrap;
    overflow: visible;
  }

  .training-sidebar {
    flex: 1 1 100%;
    max-width: none;
    align-self: stretch;
    max-height: min(420px, var(--training-sidebar-max-height));
    height: auto;
  }

  .training-main--viewport .training-sidebar {
    max-height: min(380px, 42dvh);
    height: auto;
  }

  .training-main--viewport .training-sidebar-card {
    height: auto;
    max-height: min(380px, 42dvh);
  }

  .training-panel {
    min-height: min(52dvh, 480px);
  }

  .training-main--viewport .training-panel {
    height: auto;
    min-height: min(52dvh, 480px);
  }

  .training-main--viewport .training-preview-card {
    height: auto;
    min-height: min(48dvh, 420px);
  }

  .training-main--viewport .training-preview-frame-wrap {
    min-height: min(44dvh, 400px);
  }
}

.training-item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.training-item-row {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.training-item-row:last-child {
  border-bottom: none;
}

.training-type-badge {
  flex: 0 0 auto;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  line-height: 1.2;
  max-width: 6.5rem;
  text-align: center;
}

.training-type-badge--google_doc {
  background-color: var(--wsc-green-dim);
  color: var(--wsc-green);
  border: 1px solid var(--wsc-green);
}

.training-type-badge--drive_video,
.training-type-badge--drive {
  background-color: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.5);
}

.training-item-text {
  flex: 1;
  min-width: 0;
}

.training-item-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--wsc-green);
  text-decoration: none;
  word-break: break-word;
}

.training-item-link:hover {
  color: var(--wsc-green-hover);
  text-decoration: underline;
}

.training-item-summary {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--wsc-text-muted);
}

.training-empty-category {
  margin: 0;
  font-size: 0.875rem;
  color: var(--wsc-text-muted);
  font-style: italic;
}

.training-empty-page-card {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.formatter-card {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--wsc-surface-gray);
  background-color: var(--wsc-bg-elevated);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  margin-bottom: 1.25rem;
}

.formatter-card-header {
  padding: 0.55rem 0.65rem;
  background-color: var(--wsc-surface-gray);
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 11px 11px 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--wsc-text);
  text-align: left;
}

.formatter-upload-card .formatter-card-header {
  text-align: center;
}

.formatter-card-body {
  padding: 1rem 0.85rem 1.15rem;
}

.formatter-form-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: stretch;
}

.formatter-form-stack .formatter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}

.formatter-form-stack .formatter-field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.formatter-main .form-control-sm,
.formatter-main .form-select-sm {
  background-color: var(--wsc-bg);
  border: 1px solid var(--wsc-surface-gray);
  color: var(--wsc-text);
  border-radius: 8px;
  max-width: 100%;
}

.formatter-main .form-control-sm:focus,
.formatter-main .form-select-sm:focus {
  border-color: var(--wsc-green);
  box-shadow: 0 0 0 2px var(--wsc-green-glow);
  outline: none;
}

.formatter-main input[type="file"] {
  width: 100%;
  max-width: 100%;
  font-size: 0.875rem;
  color: var(--wsc-text-muted);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* Native “Choose file” control — match primary green buttons */
.formatter-main input[type="file"]::file-selector-button,
.formatter-main input[type="file"]::-webkit-file-upload-button {
  margin-right: 0.75rem;
  padding: 0.5rem 1.25rem;
  min-height: 2.625rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--wsc-bg) !important;
  background-color: var(--wsc-green) !important;
  border: 1px solid var(--wsc-green) !important;
  border-radius: 8px;
  cursor: pointer;
  box-sizing: border-box;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.formatter-main input[type="file"]::file-selector-button:hover,
.formatter-main input[type="file"]::-webkit-file-upload-button:hover {
  background-color: var(--wsc-green-hover) !important;
  border-color: var(--wsc-green-hover) !important;
  color: #fff !important;
}

.formatter-main input[type="file"]::file-selector-button:focus-visible,
.formatter-main input[type="file"]::-webkit-file-upload-button:focus-visible {
  outline: 2px solid var(--wsc-green);
  outline-offset: 2px;
}

.formatter-main button[type="submit"] {
  margin-top: 0.35rem;
  background-color: var(--wsc-green) !important;
  border-color: var(--wsc-green) !important;
  color: var(--wsc-bg) !important;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  min-height: 2.625rem;
}

.formatter-main button[type="submit"]:hover {
  background-color: var(--wsc-green-hover) !important;
  border-color: var(--wsc-green-hover) !important;
  color: #fff !important;
}

.formatter-reqs-title {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--wsc-text);
  text-align: center;
}

/* Formatter: one requirements card, centered; options toggled in JS */
.formatter-reqs-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0 var(--wsc-content-padding-x);
  box-sizing: border-box;
}

.formatter-reqs-card {
  width: 100%;
  max-width: min(520px, 100%);
  margin: 0 auto;
}

.formatter-reqs-card .formatter-card-header {
  text-align: center;
}

.formatter-reqs-wrap .formatter-card-body ul {
  margin: 0;
  padding: 0 0 0 1.1rem;
  color: var(--wsc-text);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: left;
}

.formatter-reqs-wrap .formatter-card-body li {
  text-align: left;
  list-style: disc;
}

/* Calendars — same column + cards as formatter / CJ */
.calendars-main {
  --calendars-list-card-height: 560px;
  /* Sidebar cap: keep column within the visible viewport (tune offset for your header/title) */
  --calendars-sidebar-max-height: calc(100vh - 11rem);
  --calendars-sidebar-max-height: calc(100svh - 11rem);
  width: 100%;
  max-width: var(--wsc-content-max);
  margin: 0 auto;
  padding: 0 var(--wsc-content-padding-x) 2.5rem;
  box-sizing: border-box;
  text-align: left;
}

.calendars-shell {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: stretch;
  justify-content: center;
}

.calendars-sidebar {
  flex: 1 1 260px;
  max-width: 380px;
  max-height: var(--calendars-sidebar-max-height);
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.calendars-panel {
  flex: 2 1 360px;
  min-width: 0;
  max-width: 720px;
  display: flex;
  flex-direction: column;
}

.calendars-tech-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.65rem;
}

/* Panel column sets height; sidebar stretches to match; appt card fixed list height */
.calendars-tech-card,
.calendars-appt-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-sizing: border-box;
}

.calendars-appt-card {
  height: var(--calendars-list-card-height);
}

/* No `.cal-appt-block` → short body; shrink appt card so sidebar stretch matches panel */
.calendars-shell:not(:has(.cal-appt-block)) .calendars-appt-card {
  height: auto;
}

.calendars-tech-card {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

.calendars-tech-card .formatter-card-header,
.calendars-appt-card .formatter-card-header {
  flex: 0 0 auto;
}

.calendars-tech-card .formatter-card-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.calendars-appt-card .formatter-card-body.calendars-appt-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-color: var(--wsc-surface-gray) var(--wsc-bg-elevated);
}

.calendars-tech-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-color: var(--wsc-surface-gray) var(--wsc-bg-elevated);
}

@media (max-width: 720px) {
  .calendars-shell {
    align-items: flex-start;
  }

  .calendars-panel {
    display: block;
  }

  .calendars-sidebar {
    display: block;
  }

  .calendars-tech-card,
  .calendars-appt-card {
    height: auto;
    min-height: 0;
  }

  .calendars-tech-card {
    flex: none;
  }

  .calendars-tech-card .formatter-card-body {
    display: block;
    overflow: visible;
  }

  .calendars-tech-scroll,
  .calendars-appt-card .formatter-card-body.calendars-appt-scroll {
    flex: none;
    max-height: 480px;
  }
}

.calendars-tech-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.calendars-tech-row:last-child {
  border-bottom: 0;
}

.calendars-tech-row label {
  margin: 0;
  font-size: 0.9rem;
  color: var(--wsc-text);
  cursor: pointer;
  flex: 1;
  min-width: 0;
  text-align: left;
}

/* Secondary control — matches grey bar buttons */
.calendars-main .calendars-btn-secondary {
  background-color: var(--wsc-surface-gray) !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  color: #000000 !important;
  font-weight: 600 !important;
  padding: 0.5rem 1rem !important;
  min-height: 2.625rem !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition:
    border-color 0.2s ease,
    color 0.2s ease !important;
}

.calendars-main .calendars-btn-secondary:hover {
  border-color: #ffffff !important;
  color: #ffffff !important;
}

.calendars-notify-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: stretch;
  max-width: 320px;
  margin: 0 auto;
}

.calendars-notify-stack .form-select-sm,
.calendars-notify-stack select.form-select {
  background-color: var(--wsc-bg);
  border: 1px solid var(--wsc-surface-gray);
  color: var(--wsc-text);
  border-radius: 8px;
  width: 100%;
  padding: 0.35rem 0.5rem;
}

.calendars-notify-stack .form-select-sm:focus,
.calendars-notify-stack select.form-select:focus {
  border-color: var(--wsc-green);
  box-shadow: 0 0 0 2px var(--wsc-green-glow);
  outline: none;
}

.calendars-main button[type="submit"] {
  margin-top: 0;
  background-color: var(--wsc-green) !important;
  border-color: var(--wsc-green) !important;
  color: var(--wsc-bg) !important;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  min-height: 2.625rem;
}

.calendars-main button[type="submit"]:hover {
  background-color: var(--wsc-green-hover) !important;
  border-color: var(--wsc-green-hover) !important;
  color: #fff !important;
}

.cal-appt-stack {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.cal-appt-tech-btn {
  width: 100%;
  margin-bottom: 0.35rem;
}

.cal-appt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  table-layout: fixed;
}

.cal-appt-table th,
.cal-appt-table td {
  padding: 0.45rem 0.35rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--wsc-surface-gray);
  color: var(--wsc-text);
  word-wrap: break-word;
}

.cal-appt-table th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--wsc-text-muted);
}

.cal-appt-table th:last-child,
.cal-appt-table td:last-child {
  width: 4.5rem;
  text-align: center;
}

.cal-appt-table .form-check-input {
  float: none;
  margin: 0 auto;
  display: block;
}

.bold-label {
  font-weight: 700;
  color: var(--wsc-text);
}

/* Category cards: sticky header + scrollable file list (mockup layout) */
.cjus-main .cjus-cat-grid .cat-div.cjus-cat-card {
  height: auto;
  max-height: none;
  /* Clip header/body to one rounded shell (avoids square header on rounded card) */
  overflow: hidden;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--wsc-surface-gray);
  background-color: var(--wsc-bg-elevated);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  min-height: 0;
  text-align: left;
}

.cjus-cat-card-header {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: flex-start;
  flex: 0 0 auto;
  padding: 0.55rem 0.65rem;
  background-color: var(--wsc-surface-gray);
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  /* Match card top curve (inside the 1px border) */
  border-radius: 11px 11px 0 0;
}

.cjus-cat-card-title {
  position: relative;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--wsc-text);
  text-align: left;
  line-height: 1.25;
  min-width: 0;
  flex: 1 1 auto;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}

/* Full category name on hover (data-cjus-title mirrors template; title attr is fallback tooltip) */
.cjus-cat-card-title[data-cjus-title]:hover::after {
  content: attr(data-cjus-title);
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 250;
  margin-top: 6px;
  min-width: 100%;
  max-width: min(280px, 85vw);
  padding: 0.4rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  color: var(--wsc-text);
  background-color: var(--wsc-bg-elevated);
  border: 1px solid var(--wsc-surface-gray);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.cjus-cat-card-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 250px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.35rem 0.35rem 0.5rem 0.5rem;
  scrollbar-color: var(--wsc-surface-gray) var(--wsc-bg-elevated);
  /* Match card bottom curve */
  border-radius: 0 0 11px 11px;
}

.cjus-cat-thead th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--wsc-text-muted);
  text-align: left;
  padding: 0.35rem 0.25rem 0.45rem 0;
  border-bottom: 1px solid var(--wsc-surface-gray);
}

.cjus-cat-thead th:last-child {
  text-align: right;
  padding-right: 0;
}

.cjus-main .cat-div table.column-4 {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.cjus-main .cat-div table.column-4 .cjus-cat-thead th:first-child,
.cjus-main .cat-div table.column-4 td:first-child {
  width: 75%;
  text-align: left;
  vertical-align: middle;
}

.cjus-main .cat-div table.column-4 .cjus-cat-thead th:last-child,
.cjus-main .cat-div table.column-4 td:last-child {
  width: 25%;
  text-align: right;
  vertical-align: middle;
}

.cjus-main .cat-div td:first-child {
  padding: 0.35rem 0.5rem 0.35rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cjus-main .cat-div td:last-child {
  padding: 0.35rem 0 0.35rem 0.15rem;
}

.cjus-main .cat-div .form-check {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  margin: 0;
  min-height: 0;
}

.cjus-main .cat-div .form-check-input {
  float: none;
  margin: 0;
}

/* CJ: “Selected” sidebar — main area shifts right when open */
.cjus-shell {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.cjus-selected-sidebar {
  flex: 0 0 0;
  width: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    flex-basis 0.3s ease,
    max-width 0.3s ease,
    width 0.3s ease,
    opacity 0.25s ease,
    border-color 0.25s ease;
  border-right: 1px solid transparent;
  align-self: stretch;
  box-sizing: border-box;
}

.cjus-shell.cjus-sidebar-open .cjus-selected-sidebar {
  flex: 0 0 280px;
  width: 280px;
  max-width: 280px;
  opacity: 1;
  border-right-color: var(--wsc-surface-gray);
}

.cjus-selected-sidebar-inner {
  width: 280px;
  padding: 0.75rem 1rem 1rem;
  box-sizing: border-box;
  background-color: var(--wsc-bg-elevated);
  border-radius: 0 10px 10px 0;
  min-height: min(60vh, 480px);
  text-align: left;
}

.cjus-selected-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--wsc-text);
  letter-spacing: -0.02em;
  text-align: center;
}

.cjus-selected-remove-all-wrap {
  margin: 0 0 0.65rem;
}

.cjus-selected-remove-all-wrap[hidden] {
  display: none !important;
}

.cjus-remove-all-btn {
  width: 100%;
  padding: 0.45rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  border-radius: 8px;
  border: 1px solid var(--wsc-surface-gray);
  background-color: var(--wsc-surface-gray);
  color: #000000;
  cursor: pointer;
  box-sizing: border-box;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.cjus-remove-all-btn:hover {
  border-color: #ffffff;
  color: #ffffff;
}

.cjus-selected-list {
  margin: 0;
  padding: 0 0 0 1.15rem;
  color: var(--wsc-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  list-style: disc;
  max-height: calc(60vh - 5rem);
  overflow-y: auto;
  scrollbar-color: var(--wsc-surface-gray) var(--wsc-bg-elevated);
}

.cjus-selected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  word-break: break-word;
}

.cjus-selected-name {
  flex: 1;
  min-width: 0;
}

/* Sidebar remove control — × icon */
.cjus-unselect-btn {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 6px;
  border: 1px solid var(--wsc-green);
  background-color: var(--wsc-green);
  color: var(--wsc-bg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.cjus-unselect-btn:hover {
  background-color: var(--wsc-green-hover);
  border-color: var(--wsc-green-hover);
  color: #ffffff;
}

.cjus-unselect-btn:focus-visible {
  outline: 2px solid var(--wsc-green);
  outline-offset: 2px;
}

.cjus-main-area {
  flex: 1;
  min-width: 0;
  transition: flex 0.3s ease;
}

/* Index — staff “Manager Links” block (curved shell around second row) */
.wsc-manager-links {
  max-width: var(--wsc-content-max);
  margin: 1.5rem auto;
  padding: 1rem 1.25rem 1.35rem;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid var(--wsc-surface-gray);
  background-color: var(--wsc-bg-elevated);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.wsc-manager-links-title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.1rem, 2.5vw, 1.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--wsc-text);
  text-align: center;
}

.wsc-manager-links .grid {
  margin: 0 auto;
  padding: 0 var(--wsc-content-padding-x);
}

/* Grid tiles */
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--wsc-text);
  text-align: center;
  justify-content: center;
  align-items: stretch;
  margin: 1.5rem auto;
  max-width: var(--wsc-content-max);
  padding: 0 var(--wsc-content-padding-x);
}

.one,
.two,
.three,
.four {
  height: 90px;
  width: 200px;
  background-color: var(--wsc-surface-gray);
  border-radius: 15px;
  border: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.grid a:hover .one,
.grid a:hover .two,
.grid a:hover .three,
.grid a:hover .four {
  background-color: var(--wsc-surface-gray);
  border-color: #ffffff;
}

.link {
  line-height: 90px;
  height: 90px;
  margin: 0;
  text-decoration: none;
  font-weight: 600;
}

.grid .link {
  color: #000000;
}

.grid a:hover .link {
  color: #ffffff;
}

/* Messages / alerts — green accent */
.error-div {
  margin: 0 auto 1rem;
  max-width: 640px;
  padding: 0 1rem;
  background-color: transparent;
  text-align: center;
}

/* Success / error: container stays neutral; each alert supplies its own look (fixes green on red wrapper) */
.error-div .alert.alert-success {
  background-color: rgba(34, 197, 94, 0.18);
  border: 1px solid var(--wsc-green);
  color: var(--wsc-text);
}

.error-div .alert.alert-error,
.error-div .alert.alert-danger {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: var(--wsc-text);
}

.error-div .alert-warning {
  background-color: var(--wsc-bg-elevated);
  border: 1px solid var(--wsc-green);
  color: var(--wsc-text);
  border-radius: 10px;
}

.error-div .btn-close {
  filter: invert(1);
  opacity: 0.7;
}

.error-text {
  color: var(--wsc-text);
  list-style: none;
  text-align: center;
}

/* Bootstrap dismissible — message body centered */
.error-div .alert {
  text-align: center;
