/* =====================================================================
   DesignFxPro Marketing SOP — interface styles

   Brand: red #DE1C26, ink #0F1115, section gray #E8EBF0
   Type:  Poppins for headings, Inter for everything else
   Change --red below to re-brand the whole interface.
   ===================================================================*/

:root {
  --red: #de1c26;
  --red-dark: #b4141d;
  --red-soft: #fdecee;
  --red-line: #f4c9cd;

  --ink: #0f1115;
  --ink-2: #5a616e;
  --ink-3: #868d9b;

  --line: #e4e7ec;
  --line-2: #cfd4dd;

  --panel: #ffffff;
  --canvas: #f6f7f9;
  --hover: #f4f5f8;

  --ok: #1a7f5a;
  --ok-soft: #e7f5ef;
  --warn-soft: #fdf4e3;
  --warn-ink: #8a5a00;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;

  --sans: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --head: "Poppins", var(--sans);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --side-w: 248px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --red: #f4383e;
    --red-dark: #ff5a5f;
    --red-soft: #2a1417;
    --red-line: #4a2126;

    --ink: #e9ecf1;
    --ink-2: #99a1b0;
    --ink-3: #79818f;

    --line: #242932;
    --line-2: #333a45;

    --panel: #161920;
    --canvas: #0f1115;
    --hover: #1c2029;

    --ok: #4ec59a;
    --ok-soft: #12271f;
    --warn-soft: #2b2312;
    --warn-ink: #e3bd77;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--head); font-weight: 600; letter-spacing: -0.015em; }

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); }

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--hover);
  border: 1px solid var(--line);
  padding: 0.1em 0.4em;
  border-radius: var(--r-sm);
  overflow-wrap: anywhere;
}

:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
[hidden] { display: none !important; }

.ico { width: 20px; height: 20px; flex: none; }

/* =====================================================================
   App shell
   ===================================================================*/

.nav-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; }

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--side-w);
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 14px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 18px;
  color: var(--ink);
}
.logo:hover { color: var(--ink); }

.logo-tile {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-family: var(--head);
  font-weight: 700;
  font-size: 15px;
}

.logo-text { display: grid; gap: 1px; min-width: 0; }
.logo-word {
  font-family: var(--head);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.mark-red { color: var(--red); }
.logo-sub { font-size: 11.5px; color: var(--ink-3); letter-spacing: 0.02em; }

.sidenav { display: grid; gap: 2px; }
.sidenav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 14.5px;
}
.sidenav a:hover { background: var(--hover); color: var(--ink); }
.sidenav a.on { background: var(--red-soft); color: var(--red); font-weight: 600; }

.sidefoot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 4px;
  border-top: 1px solid var(--line);
}
.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 600;
  font-size: 14px;
}
.sf-text { display: grid; gap: 0; min-width: 0; flex: 1; }
.sf-name {
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sf-role { font-size: 11.5px; color: var(--ink-3); }
.sf-out { color: var(--ink-3); display: flex; padding: 6px; border-radius: var(--r-sm); }
.sf-out:hover { background: var(--hover); color: var(--red); }

.nav-scrim { display: none; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.apptop { display: none; }

.iconbtn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r);
  color: var(--ink-2);
  cursor: pointer;
  border: 1px solid transparent;
}
.iconbtn:hover { background: var(--hover); color: var(--ink); }

.main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 30px 80px;
}

/* One centred column. A grid here gave the flash message its own row,
   which pushed the card into the lower half of the screen. */
.shell-bare {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 20px;
}
.shell-bare > .note {
  width: 100%;
  max-width: 400px;
  margin: 0;
}
.shell-bare:has(.signin-wide) > .note { max-width: 620px; }

/* =====================================================================
   Page headers and toolbars
   ===================================================================*/

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-title { font-size: 24px; margin: 0; }
.page-sub { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.page-head-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.crumbs { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.crumbs a { color: var(--ink-2); }
.crumbs a:last-child { color: var(--ink); font-weight: 600; }
.crumbs a:hover { color: var(--red); }
.crumb-sep { color: var(--line-2); padding: 0 7px; }

.crumbs-block {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 11px 14px;
  margin-bottom: 18px;
}

.filter {
  font: inherit;
  font-size: 14px;
  padding: 9px 13px;
  min-width: 230px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
}
.filter::placeholder { color: var(--ink-3); }
.filter:focus { border-color: var(--red); }

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--hover);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.segmented a {
  padding: 6px 13px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 7px;
}
.segmented a:hover { color: var(--ink); }
.segmented a.on { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 17, 21, 0.08); }

.toolbar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  font-size: 13.5px;
  color: var(--ink-2);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
}
.toolbar-toggle .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.toolbar-toggle.on { color: var(--red); border-color: var(--red-line); background: var(--red-soft); }
.toolbar-toggle.on .dot { background: var(--red); }

/* =====================================================================
   File list: one CSS grid, so every column lines up on every row
   ===================================================================*/

.filelist {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.fl-row,
.fl-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 124px 44px;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  position: relative;
}

.fl-head {
  border-top: 0;
  padding-top: 11px;
  padding-bottom: 11px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-3);
  background: transparent;
  border-bottom: 1px solid var(--line);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.fl-row:first-child { border-top: 0; }
.fl-row:hover { background: var(--hover); }
.fl-row:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); }

.fl-main {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 11px 0;
  color: var(--ink);
}
.fl-main:hover { color: var(--ink); }

.fl-icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--hover);
  border: 1px solid var(--line);
}
.fl-icon-folder { background: var(--red-soft); border-color: var(--red-line); color: var(--red); }
.fl-icon-folder svg { width: 19px; height: 19px; }
.fl-icon-up { font-size: 15px; font-family: var(--sans); }

.fl-text { display: grid; gap: 1px; min-width: 0; }
.fl-name {
  font-weight: 600;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fl-sub {
  font-size: 12.5px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fl-col { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.fl-col-date { color: var(--ink-3); }

/* Kebab menu */
.fl-menu { justify-self: end; position: relative; }
.fl-menu > summary {
  list-style: none;
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ink-3);
  font-size: 17px;
  line-height: 1;
  border: 1px solid transparent;
}
.fl-menu > summary::-webkit-details-marker { display: none; }
.fl-menu > summary:hover { background: var(--panel); border-color: var(--line-2); color: var(--ink); }
.fl-menu[open] > summary { background: var(--panel); border-color: var(--line-2); color: var(--ink); }

.fl-menu-body {
  position: absolute;
  right: 0;
  top: 38px;
  z-index: 30;
  min-width: 208px;
  display: grid;
  gap: 2px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  box-shadow: 0 12px 28px -8px rgba(15, 17, 21, 0.28);
}
.fl-menu-body a,
.fl-menu-body button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.fl-menu-body a:hover,
.fl-menu-body button:hover { background: var(--hover); color: var(--ink); }
.fl-menu-body form { margin: 0; }
.fl-menu-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.fl-menu-danger { color: var(--red) !important; }
.fl-menu-danger:hover { background: var(--red-soft) !important; }

/* The inline rename panel sits under its row */
.fl-edit {
  grid-column: 1 / -1;
  padding: 2px 0 18px;
  border-top: 1px dashed var(--line);
  margin-top: -1px;
}
.fl-edit .grid-form { padding-top: 14px; }

/* =====================================================================
   Card view
   ===================================================================*/

.cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(206px, 1fr));
}

.card {
  display: grid;
  gap: 7px;
  align-content: start;
  padding: 18px;
  min-height: 158px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--ink);
}
.card:hover { border-color: var(--line-2); box-shadow: 0 8px 20px -12px rgba(15, 17, 21, 0.3); color: var(--ink); }
.card .fl-icon { width: 42px; height: 42px; margin-bottom: 5px; font-size: 11px; }
.card-title { font-weight: 600; font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.card-desc { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.card-foot {
  margin-top: auto;
  padding-top: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}
.card-up { align-content: center; justify-items: center; text-align: center; min-height: 0; padding: 26px 18px; }

/* =====================================================================
   Panels, forms, buttons
   ===================================================================*/

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.panel-title { margin: 0 0 4px; font-size: 17px; }
.panel-title + .panel-sub { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }
.panel > .panel-title:only-child { margin-bottom: 0; }
.panel-slim { padding: 16px 18px; }

.stack { display: grid; gap: 15px; }

.grid-form {
  display: grid;
  gap: 14px 18px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  align-items: end;
}

.field { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field-action { align-self: end; }

.field input,
.field select {
  font: inherit;
  font-size: 14.5px;
  font-weight: 400;
  color: var(--ink);
  padding: 10px 12px;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
}
.field input::placeholder { color: var(--ink-3); }
.field input:focus,
.field select:focus { border-color: var(--red); }

.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 88px; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 11px;
  color: var(--red);
  background: var(--red-soft);
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}
.pw-toggle:hover { background: var(--red-line); }

/* Chrome and Safari repaint autofilled fields with their own pale blue.
   This keeps them on the site's own colours in both light and dark mode. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--panel) inset;
  box-shadow: 0 0 0 1000px var(--panel) inset;
  caret-color: var(--ink);
  transition: background-color 100000s ease-in-out 0s;
}

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.check input { margin-top: 3px; flex: none; accent-color: var(--red); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  padding: 10px 16px;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn .ico { width: 17px; height: 17px; }

.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }

.btn-quiet { background: var(--panel); color: var(--ink); border-color: var(--line-2); }
.btn-quiet:hover { background: var(--hover); color: var(--ink); border-color: var(--ink-3); }

.btn-danger { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.btn-danger:hover { background: var(--red-line); color: var(--red-dark); }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13.5px; }

/* =====================================================================
   Tables (people page), notes, pills
   ===================================================================*/

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th,
.table td { padding: 13px 10px; text-align: left; vertical-align: middle; border-top: 1px solid var(--line); }
.table thead th {
  border-top: 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-3);
}
.table .right { text-align: right; }
.table .right > * { vertical-align: middle; }

.u-name { display: block; font-weight: 600; }
.u-handle { display: block; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.u-when { color: var(--ink-2); font-size: 13.5px; white-space: nowrap; }

.paths { width: 100%; border-collapse: collapse; font-size: 14px; }
.paths th {
  text-align: left;
  width: 185px;
  vertical-align: top;
  padding: 11px 14px 11px 0;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-2);
}
.paths td { padding: 11px 0; border-bottom: 1px solid var(--line); }
.paths tr:last-child td { border-bottom: 0; }

.pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
}
.pill-on { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.pill-off { background: var(--hover); }
.pill-you { background: var(--red-soft); border-color: var(--red-line); color: var(--red); margin-left: 6px; }

.note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-2);
  border-radius: var(--r);
  background: var(--panel);
  padding: 13px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}
.note p { margin: 0; }
.note p + p { margin-top: 6px; }
.note-ok { border-left-color: var(--ok); background: var(--ok-soft); }
.note-error { border-left-color: var(--red); background: var(--red-soft); color: var(--red); }
.note-warn { border-left-color: #c48a00; background: var(--warn-soft); color: var(--warn-ink); }

.note-code { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px !important; }
.note-code code { background: var(--panel); font-size: 14px; padding: 6px 10px; }

.hint { color: var(--ink-3); font-size: 13px; margin: 12px 2px 0; }

.empty {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 52px 28px;
  text-align: center;
}
.empty h2 { margin: 0 0 8px; font-size: 18px; }
.empty p { margin: 0 0 8px; color: var(--ink-2); }

/* Admin row menu on the people page */
.rowmenu { display: inline-block; text-align: left; position: relative; }
.rowmenu > summary {
  cursor: pointer;
  list-style: none;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  color: var(--ink);
  display: inline-block;
}
.rowmenu > summary::-webkit-details-marker { display: none; }
.rowmenu[open] > summary { border-color: var(--ink-3); }
.rowmenu-body { display: grid; gap: 10px; padding: 14px 0 4px; min-width: 268px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form .pw-wrap { flex: 1; min-width: 190px; }
.inline-form input {
  font: inherit;
  font-size: 13.5px;
  padding: 8px 88px 8px 10px;
  width: 100%;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
}

/* =====================================================================
   Upload area
   ===================================================================*/

.dropzone {
  display: grid;
  gap: 6px;
  place-items: center;
  text-align: center;
  padding: 30px 20px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r);
  background: var(--canvas);
  cursor: pointer;
}
.dropzone.is-over { border-color: var(--red); background: var(--red-soft); }
.dropzone input[type="file"] { max-width: 100%; font-size: 13px; }
.dropzone-main { font-size: 14.5px; font-weight: 600; }
.dropzone-sub { font-size: 12.5px; color: var(--ink-3); }

/* =====================================================================
   Sign in / setup
   ===================================================================*/

.signin { width: 100%; max-width: 400px; }
.signin-wide { max-width: 620px; }
.signin-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 34px 30px;
  box-shadow: 0 1px 2px rgba(15, 17, 21, 0.04), 0 18px 40px -20px rgba(15, 17, 21, 0.3);
}
.signin-card-wide { max-width: none; }
.signin-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.signin-title { margin: 0; font-size: 21px; }
.signin-sub { margin: 6px 0 22px; color: var(--ink-2); font-size: 14px; }
.signin-foot { text-align: center; color: var(--ink-3); font-size: 12.5px; margin: 18px 0 0; }

.checks { list-style: none; margin: 0 0 20px; padding: 0; font-size: 13.5px; }
.checks li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}
.checks li span { font-weight: 600; }
.checks .pass span { color: var(--ok); }
.checks .fail span { color: var(--red); }

/* =====================================================================
   Small screens
   ===================================================================*/

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    transform: translateX(-102%);
    transition: transform 0.18s ease;
    box-shadow: 0 0 40px rgba(15, 17, 21, 0.2);
  }
  .nav-toggle:checked ~ .app .sidebar { transform: translateX(0); }
  .nav-toggle:checked ~ .app .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(15, 17, 21, 0.4);
  }

  .apptop {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .apptop-word { font-family: var(--head); font-weight: 700; font-size: 15px; }

  .main { padding: 20px 16px 72px; }

  .fl-row,
  .fl-head { grid-template-columns: minmax(0, 1fr) 44px; }
  .fl-col { display: none; }
  .fl-head { font-size: 11.5px; }

  .toolbar-tools { width: 100%; }
  .toolbar-tools .filter { flex: 1 1 100%; min-width: 0; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .page-head-tools { width: 100%; }
  .page-head-tools .btn { flex: 1; }
  .paths th { width: auto; display: block; padding-bottom: 0; }
  .paths td { display: block; padding-top: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* =====================================================================
   Training: badges, quizzes, worksheets, progress grid
   ===================================================================*/

.tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 5px;
  vertical-align: 2px;
  margin-left: 7px;
  white-space: nowrap;
}
.tag-req { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-line); }
.tag-read { background: var(--ok-soft); color: var(--ok); }
.tag-check { background: var(--hover); color: var(--ink-2); border: 1px solid var(--line-2); }

.req { color: var(--red); font-weight: 600; font-size: 11.5px; }

/* ---------------------------------------------------------- quizzes */

.qblock {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  margin: 0 0 14px;
}
.qtext { font-weight: 600; font-size: 15px; padding: 0 6px; }

.qopt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14.5px;
}
.qopt:hover { background: var(--hover); }
.qopt input { margin-top: 3px; flex: none; accent-color: var(--red); }

.score {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
  border-radius: var(--r);
  margin-bottom: 18px;
}
.score-pass { background: var(--ok-soft); }
.score-fail { background: var(--red-soft); }
.score-num { font-family: var(--head); font-size: 34px; font-weight: 700; line-height: 1; }
.score-pass .score-num { color: var(--ok); }
.score-fail .score-num { color: var(--red); }
.score-text { display: grid; gap: 2px; font-size: 14px; color: var(--ink-2); }
.score-text strong { font-size: 15.5px; color: var(--ink); }

.review { margin: 0; padding-left: 20px; display: grid; gap: 14px; }
.review li { padding-left: 6px; }
.review li.right { border-left: 3px solid var(--ok); }
.review li.wrong { border-left: 3px solid var(--red); }
.review-q { display: block; font-weight: 600; }
.review-a { display: block; font-size: 13.5px; color: var(--ink-2); }
.review-fix { display: block; font-size: 13.5px; color: var(--red); }

.field textarea {
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  padding: 10px 12px;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  resize: vertical;
}
.field textarea:focus { border-color: var(--red); }

/* --------------------------------------------------- template editors */

.editor { margin-top: 4px; }
.editor > summary { list-style: none; cursor: pointer; display: inline-flex; }
.editor > summary::-webkit-details-marker { display: none; }
.editor-body { padding-top: 18px; }

.qedit,
.wsedit {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  margin: 0;
}
.qedit legend { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 6px; }
.wsedit { display: grid; gap: 12px 16px; grid-template-columns: 2fr 1fr auto; align-items: end; }

.qopts { display: grid; gap: 8px; margin-top: 10px; }
.qopt-edit { display: flex; align-items: center; gap: 10px; }
.qopt-edit input[type="radio"] { flex: none; accent-color: var(--red); }
.qopt-edit input[type="text"] {
  font: inherit;
  font-size: 14px;
  padding: 8px 11px;
  width: 100%;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 8px;
}
.qopt-edit input[type="text"]:focus { border-color: var(--red); }

/* ---------------------------------------------------- progress grid */

.grid-table th.rot {
  font-size: 11.5px;
  font-weight: 600;
  max-width: 110px;
  white-space: normal;
  line-height: 1.25;
  vertical-align: bottom;
}
.grid-table .tick { text-align: center; font-size: 16px; }
.grid-table .tick .yes { color: var(--ok); }
.grid-table .tick .no { color: var(--line-2); }

.sub-line { margin: 0 0 10px; font-size: 13.5px; line-height: 1.45; }
.sub-line.right { color: var(--ink-2); }
.sub-line.wrong { color: var(--red); }

@media (max-width: 640px) {
  .wsedit { grid-template-columns: 1fr; }
  .score { flex-direction: column; align-items: flex-start; gap: 10px; }
}

.slots { display: grid; gap: 14px; }
.slots > [hidden] { display: none !important; }

/* =====================================================================
   Stacked form pieces. These do not rely on an auto-fitting grid, so
   nothing can collapse into a narrow column or overlap a button.
   ===================================================================*/

/* Two controls side by side, stacking on a narrow screen. */
.pair {
  display: grid;
  gap: 14px 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
}

/* A checkbox with a title and a line of explanation, full width. */
.optbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  cursor: pointer;
}
.optbox:hover { border-color: var(--line-2); }
.optbox > input {
  flex: none;
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--red);
}
.optbox-text { display: grid; gap: 2px; min-width: 0; }
.optbox-title { font-weight: 600; font-size: 14px; color: var(--ink); }
.optbox-note { font-size: 13px; color: var(--ink-2); line-height: 1.45; }

/* A button row, with any note beside it wrapping instead of overlapping. */
.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.form-actions .btn { flex: none; }
.form-actions .hint { flex: 1 1 240px; min-width: 0; }

/* =====================================================================
   Training overview: stat strip and progress bars
   ===================================================================*/

.stats {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 18px;
}
.stat {
  display: grid;
  gap: 3px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.stat-num {
  font-family: var(--head);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--red);
}
.stat-label { font-size: 13px; color: var(--ink-2); line-height: 1.35; }

.bar {
  display: block;
  height: 7px;
  width: 100%;
  max-width: 200px;
  border-radius: 999px;
  background: var(--hover);
  border: 1px solid var(--line);
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  background: var(--red);
  border-radius: 999px;
  min-width: 0;
}
.bar-done { background: var(--ok); }
.bar-text { display: block; margin-top: 5px; font-size: 12.5px; color: var(--ink-2); }

.rowmenu-body .sub-line:last-child { margin-bottom: 0; }

/* =====================================================================
   Lessons
   ===================================================================*/

.fl-icon-lesson {
  background: var(--red-soft);
  border-color: var(--red-line);
  color: var(--red);
  font-size: 13px;
}
.fl-icon-lesson svg { width: 20px; height: 20px; }

/* A video that keeps its shape at any width. */
.videoframe {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
}
.videoframe iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Fallback for browsers without aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
  .videoframe { height: 0; padding-bottom: 56.25%; }
}

/* =====================================================================
   Training module steps
   ===================================================================*/

.step { border-left: 3px solid var(--line-2); }
.step-done { border-left-color: var(--ok); }

.step-head { display: flex; align-items: center; gap: 14px; }

.step-num {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--head);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-2);
  background: var(--hover);
  border: 1px solid var(--line-2);
}
.step-done .step-num { background: var(--ok-soft); border-color: transparent; color: var(--ok); }

.step-title { display: grid; gap: 1px; min-width: 0; }
.step-name { font-family: var(--head); font-weight: 600; font-size: 17px; letter-spacing: -0.015em; }
.step-kind { font-size: 12.5px; color: var(--ink-3); }

.step .videoframe { margin-top: 14px; }

/* the step editor */
.stepedit {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  margin: 0;
  display: grid;
  gap: 12px;
}
.stepedit legend { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 6px; }

.steprow {
  display: grid;
  gap: 12px 16px;
  grid-template-columns: 90px minmax(160px, 1fr) minmax(160px, 2fr);
  align-items: end;
}
.field-pos input { text-align: center; }

@media (max-width: 640px) {
  .steprow { grid-template-columns: 90px 1fr; }
}

/* =====================================================================
   Assigning: who a module is for
   ===================================================================*/

.tag-who {
  background: var(--hover);
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.picker {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--canvas);
}
.picker-block { display: grid; gap: 9px; }
.picker-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.picker-grid {
  display: grid;
  gap: 8px 16px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.picker-grid .check { align-items: center; color: var(--ink); }
.picker-count {
  display: inline-block;
  margin-left: 6px;
  font-size: 11.5px;
  color: var(--ink-3);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 7px;
}

/* =====================================================================
   My training
   ===================================================================*/

.fl-icon-ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); font-size: 14px; }

/* Rows that end in a button rather than a menu need a wider last column. */
.filelist-actions .fl-row,
.filelist-actions .fl-head { grid-template-columns: minmax(0, 1fr) 130px auto; }

.fl-go { justify-self: end; display: flex; align-items: center; gap: 8px; padding-left: 6px; }
.fl-go .btn { white-space: nowrap; }

.done-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}
.done-summary::-webkit-details-marker { display: none; }
.done-summary::after {
  content: "Show";
  font-size: 13px;
  color: var(--ink-3);
  margin-left: auto;
}
details[open] > .done-summary::after { content: "Hide"; }

@media (max-width: 900px) {
  .fl-go .btn { padding: 7px 11px; font-size: 13px; }
  .filelist-actions .fl-row,
  .filelist-actions .fl-head { grid-template-columns: minmax(0, 1fr) auto; }
}

/* =====================================================================
   Backup link in the sidebar
   ===================================================================*/

.sidetool {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--canvas);
  color: var(--ink-2);
}
.sidetool:hover { border-color: var(--line-2); color: var(--ink); background: var(--hover); }
.sidetool .ico { color: var(--red); }
.sidetool-text { display: grid; gap: 1px; min-width: 0; }
.sidetool-text > span:first-child { font-size: 13.5px; font-weight: 600; }
.sidetool-note { font-size: 11.5px; color: var(--ink-3); }

/* the account block no longer needs to push itself down */
.sidetool + .sidefoot { margin-top: 12px; }

/* =====================================================================
   Quiz editor: question types
   ===================================================================*/

.qhead {
  display: grid;
  gap: 12px 16px;
  grid-template-columns: minmax(0, 1fr) 210px;
  align-items: end;
}
.qopt-edit.is-off { display: none; }
.qopt-edit input[type="text"][readonly] { background: var(--hover); color: var(--ink-2); }

.qtype-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-left: 8px;
}

@media (max-width: 640px) {
  .qhead { grid-template-columns: 1fr; }
}

/* The answer rows follow the question's type, with or without scripting. */
.qedit[data-type="truefalse"] .qopt-edit:nth-child(n+3) { display: none; }
.qedit[data-type="truefalse"] .qopt-edit input[type="text"] { background: var(--hover); color: var(--ink-2); }

.qtype-hint::before { content: ""; }
.qedit[data-type="truefalse"] .qtype-hint::before { content: " · two answers, fixed"; color: var(--ink-3); font-weight: 400; }
.qedit[data-type="multi"] .qtype-hint::before { content: " · tick every correct answer"; color: var(--ink-3); font-weight: 400; }
.qedit[data-type="single"] .qtype-hint::before { content: " · one correct answer"; color: var(--ink-3); font-weight: 400; }

/* A plain list of problems, readable without decoration. */
.plain-list { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.plain-list li { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.plain-list code { font-size: 13px; }
