/* Flow Standards: the reading site (standards.flow.globatics.com) and Flow Admin > Standards.
   Built on app.css and frame.css; the Flow palette and the organisation's own colours carry through. */

/* ---------- shared pieces */
.modal { border: 0; border-radius: var(--r-lg); padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 30px 80px -20px oklch(15% 0.05 225 / 0.55); color: var(--ink); }
.modal::backdrop { background: oklch(20% 0.04 225 / 0.45); }
.modal form { display: grid; gap: 16px; padding: 22px; }
.modal h2 { font-size: 1.2rem; font-weight: 600; }
.modal .sub { color: var(--muted); font-size: 0.86rem; margin-top: 2px; }
.modal .actions { justify-content: flex-end; flex-wrap: wrap; }

.std-cat { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.std-cat::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--c); }
.std-kind { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.std-back { margin: 0 0 10px; font-size: 0.88rem; }
.std-back a { color: var(--ink-2); text-decoration: none; }
.std-back a:hover { color: var(--ink); text-decoration: underline; }
.std-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.std-three { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; }
.std-ext { flex: none; width: 40px; height: 46px; border-radius: 6px; display: grid; place-items: center; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em; color: #fff; background: var(--ink-2); }
.std-ext--pdf { background: oklch(55% 0.19 27); }
.std-ext--doc, .std-ext--docx, .std-ext--rtf, .std-ext--odt { background: oklch(50% 0.15 255); }
.std-ext--xls, .std-ext--xlsx, .std-ext--csv { background: oklch(52% 0.13 150); }
.std-ext--ppt, .std-ext--pptx { background: oklch(60% 0.16 45); }
.std-ext--text { background: var(--sunk); color: var(--ink-2); }
.std-file__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.std-file__row b { display: block; word-break: break-word; }
.std-file__row small { color: var(--muted); }

/* Text written in Flow Standards (mdlite.js) */
.std-prose { font-size: 1rem; line-height: 1.65; color: var(--ink); max-width: 72ch; }
.std-prose > * + * { margin-top: 0.85em; }
.std-prose h2 { font-size: 1.3rem; line-height: 1.25; margin-top: 1.6em; scroll-margin-top: 80px; }
.std-prose h3 { font-size: 1.1rem; margin-top: 1.4em; scroll-margin-top: 80px; }
.std-prose h4 { font-size: 1rem; margin-top: 1.2em; scroll-margin-top: 80px; }
.std-prose ul, .std-prose ol { padding-left: 1.4em; }
.std-prose li + li { margin-top: 0.3em; }
.std-prose blockquote { margin-left: 0; padding: 10px 14px; border-left: 3px solid var(--pink-line); background: var(--pink-soft); border-radius: 0 var(--r) var(--r) 0; }
.std-prose code { background: var(--sunk); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
.std-prose a { color: var(--medium); }
.std-prose hr { border: 0; border-top: 1px solid var(--rule); margin: 1.6em 0; }

/* ---------- the reading site */
.std-hero { margin: -16px -20px 0; background: var(--burgundy); color: var(--on-burgundy); padding: 44px 20px 52px; }
.std-hero__in { max-width: 760px; margin: 0 auto; display: grid; gap: 18px; }
.std-hero h1 { font: 800 clamp(1.6rem, 3.2vw, 2.3rem)/1.1 var(--font-display); letter-spacing: -0.01em; text-align: center; text-wrap: balance; }
.std-search { position: relative; display: flex; align-items: center; }
.std-search svg { position: absolute; left: 18px; color: var(--muted); pointer-events: none; }
.std-search input { width: 100%; height: 58px; border: 0; border-radius: 999px; padding: 0 22px 0 50px; font-size: 1.05rem; background: var(--card); color: var(--ink); box-shadow: 0 14px 40px -18px oklch(10% 0.05 225 / 0.7); }
.std-search input:focus { outline: none; box-shadow: 0 0 0 4px color-mix(in oklch, var(--pink) 55%, transparent), 0 14px 40px -18px oklch(10% 0.05 225 / 0.7); }
.std-home { padding-top: 8px !important; }

.std-must { display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; margin-top: 22px; padding: 14px 18px; border: 1px solid var(--note-line); background: var(--note-bg); border-radius: var(--r-lg); }
.std-must b { display: block; }
.std-must span { color: var(--ink-2); font-size: 0.88rem; }
.std-must--top { margin: 0 0 20px; }

.std-list { display: grid; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; }
.std-row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; text-decoration: none; color: inherit; border-top: 1px solid var(--rule); transition: background-color 120ms var(--ease); }
.std-row:first-child { border-top: 0; }
.std-row:hover { background: var(--paper); }
.std-row .std-ext { width: 34px; height: 40px; font-size: 0.6rem; }
.std-row__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.std-row__main b { font-weight: 600; }
.std-row__main span { color: var(--muted); font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.std-row__main .std-snip { font-style: italic; }
.std-row__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.std-row__meta small { color: var(--muted); font-size: 0.76rem; }

.std-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.std-catcard { display: grid; gap: 4px; align-content: start; padding: 16px 18px 14px; background: var(--card); border: 1px solid var(--rule); border-top: 4px solid var(--c); border-radius: var(--r-lg); text-decoration: none; color: inherit; transition: border-color 140ms var(--ease), transform 140ms var(--ease), box-shadow 140ms var(--ease); }
.std-catcard:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -20px oklch(20% 0.05 225 / 0.45); }
.std-catcard b { font-size: 1rem; }
.std-catcard span { color: var(--muted); font-size: 0.86rem; }
.std-catcard small { color: var(--ink-2); font-size: 0.78rem; font-weight: 600; margin-top: 6px; }
.std-cathead { border-left: 4px solid var(--c); padding-left: 14px; }
.std-cathead h1 { display: block !important; font-size: 1.6rem !important; }

.std-doc { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 28px 32px 32px; }
.std-doc__head { display: grid; gap: 10px; padding-bottom: 20px; margin-bottom: 22px; border-bottom: 1px solid var(--rule); }
.std-doc__tags { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.std-doc .head { margin: 0; }
.std-doc .head h1 { display: block; font: 700 clamp(1.5rem, 2.6vw, 2rem)/1.15 var(--font-display); text-transform: none; letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
.std-doc__summary { font-size: 1.05rem; color: var(--ink-2); max-width: 70ch; }
.std-doc__meta { display: flex; gap: 28px; flex-wrap: wrap; margin: 4px 0 0; }
.std-doc__meta dt { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.std-doc__meta dd { margin: 0; font-size: 0.9rem; }
.std-doc__grid.has-toc { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; }
.std-toc { position: sticky; top: 80px; align-self: start; display: grid; gap: 2px; font-size: 0.85rem; }
.std-toc b { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 6px; }
.std-toc a { color: var(--ink-2); text-decoration: none; padding: 4px 8px; border-radius: 6px; border-left: 2px solid var(--rule); }
.std-toc a:hover { background: var(--sunk); color: var(--ink); }
.std-toc a.l3 { padding-left: 18px; }
.std-toc a.l4 { padding-left: 28px; }
.std-attach { margin-top: 24px; border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 14px; display: grid; gap: 14px; background: var(--paper); }
.std-attach__frame { width: 100%; height: min(80vh, 900px); border: 1px solid var(--rule); border-radius: var(--r); background: #fff; }
.std-attach__frame.is-text { height: 420px; }
.std-attach__img { max-width: 100%; border-radius: var(--r); border: 1px solid var(--rule); }
.std-ack { margin-top: 28px; display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; padding: 18px 20px; border-radius: var(--r-lg); border: 1px solid var(--note-line); background: var(--note-bg); }
.std-ack b { display: block; }
.std-ack span { color: var(--ink-2); font-size: 0.88rem; }
.std-ack.is-done { justify-content: flex-start; border-color: color-mix(in oklch, var(--ok) 35%, white); background: var(--ok-bg); color: var(--ok); }
.std-ack.is-done b { color: var(--ink); }
.std-done { color: var(--ok); }
.std-contact { text-align: center; color: var(--muted); font-size: 0.88rem; padding: 0 20px 24px; max-width: 70ch; margin: 0 auto; }

/* ---------- Flow Admin > Standards */
.std-setup { display: grid; grid-template-columns: auto 1fr; gap: 16px 20px; align-items: start; }
.std-setup h2 { font-size: 1.2rem; margin-bottom: 6px; }
.std-setup .actions { grid-column: 2; }
.std-setup__ic { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--pink-soft); color: var(--burgundy); }
.std-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.std-stats div { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 14px 16px; display: grid; }
.std-stats b { font-size: 1.5rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.std-stats span { color: var(--muted); font-size: 0.82rem; }
.std-stats .is-warn { border-color: var(--note-line); background: var(--note-bg); }
.std-edit { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.std-side { display: grid; gap: 14px; position: sticky; top: 76px; }
.std-side h2 { font-size: 1rem; margin-bottom: 10px; }
.std-side .panel { padding: 18px; }
.std-bodyhead { display: flex !important; align-items: center; justify-content: space-between; }
.std-body { min-height: 320px; font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: 0.88rem; }
.std-preview { border: 1px solid var(--rule-strong); border-radius: var(--r); padding: 14px 18px; min-height: 320px; background: var(--card); }
.std-file { display: grid; gap: 12px; }
.std-file h2 { margin: 0; }
.std-file .actions { flex-wrap: wrap; gap: 6px; }
.std-drop { display: grid; gap: 4px; text-align: center; padding: 18px 14px; border: 1.5px dashed var(--rule-strong); border-radius: var(--r-lg); cursor: pointer; transition: border-color 140ms var(--ease), background-color 140ms var(--ease); }
.std-drop:hover, .std-drop.is-over { border-color: var(--burgundy); background: var(--pink-soft); }
.std-drop small { color: var(--muted); font-size: 0.78rem; }
.std-progress, .std-meter { height: 6px; border-radius: 999px; background: var(--sunk); overflow: hidden; }
.std-progress span, .std-meter span { display: block; height: 100%; width: 0; background: var(--ok); transition: width 200ms var(--ease); }
.std-progress span { background: var(--burgundy); }
.std-reads details { margin-top: 12px; }
.std-reads summary { cursor: pointer; font-size: 0.86rem; font-weight: 600; color: var(--ink-2); }
.std-reads ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; max-height: 320px; overflow: auto; }
.std-reads li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--rule); font-size: 0.85rem; }
.std-reads li small { color: var(--muted); white-space: nowrap; }
.std-reads li.is-read small { color: var(--ok); }
.std-meta dl { margin: 0; display: grid; gap: 10px; }
.std-meta dt { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.std-meta dd { margin: 0; font-size: 0.9rem; }
.std-catlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.std-catlist li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 16px; }
.std-catlist li small { display: block; color: var(--muted); font-size: 0.84rem; }
.std-catlist__acts { display: flex; gap: 6px; }
.std-dot { width: 14px; height: 14px; border-radius: 4px; background: var(--c); }
.std-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.std-swatches input { position: absolute; opacity: 0; pointer-events: none; }
.std-swatches span { display: block; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; box-shadow: inset 0 0 0 2px transparent; outline: 2px solid transparent; outline-offset: 2px; }
.std-swatches input:checked + span { outline-color: var(--ink); }
.std-swatches input:focus-visible + span { outline-color: var(--focus); }
.std-mock { padding: 0 !important; overflow: hidden; font-size: 0.8rem; }
.std-mock__bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.std-mock__bar img { height: 18px; }
.std-mock__bar small { color: var(--muted); }
.std-mock__hero { background: var(--burgundy); color: var(--on-burgundy); padding: 20px 14px; display: grid; gap: 10px; text-align: center; }
.std-mock__hero b { font-size: 1rem; }
.std-mock__search { background: var(--card); color: var(--muted); border-radius: 999px; padding: 7px 12px; text-align: left; }
.std-mock__cats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px; }
.std-mock__cats span { border: 1px solid var(--rule); border-top: 3px solid var(--c); border-radius: 6px; padding: 6px 8px; font-weight: 600; }
.std-mock__foot { color: var(--muted); padding: 0 12px 12px; text-align: center; }
.std-mock__foot:empty { display: none; }

@media (max-width: 900px) {
  .std-edit { grid-template-columns: 1fr; }
  .std-side { position: static; }
  .std-doc__grid.has-toc { grid-template-columns: 1fr; }
  .std-toc { position: static; }
}
@media (max-width: 640px) {
  .std-hero { margin: -16px -12px 0; padding: 30px 14px 36px; }
  .std-stats { grid-template-columns: 1fr 1fr; }
  .std-two, .std-three { grid-template-columns: 1fr; }
  .std-doc { padding: 20px 18px; }
  .std-row__meta { display: none; }
  .std-catlist li { grid-template-columns: auto minmax(0, 1fr); }
  .std-catlist li > .muted, .std-catlist__acts { grid-column: 2; }
  .std-setup { grid-template-columns: 1fr; }
  .std-setup .actions { grid-column: 1; }
}
.std-admin .badge:not([class*="badge--"]) { background: var(--sunk); color: var(--ink-2); }
