
  /* Mayura back office. Colours from the app's Espresso theme (app/src/theme/tokens.ts). */
  :root {
    --bg: #2A221D; --card: #3A2F28; --text: #F3ECE3; --accent: #D9C3A5;
    --on-accent: #2A221D; --line: #56483E; --muted: #B3A393;
    --radius: 18px; --small: 12px;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Urbanist', system-ui, sans-serif; font-size: 15px; line-height: 1.45; }
  a { color: var(--accent); }
  button { font: inherit; cursor: pointer; }
  .wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px 64px; }

  /* top bar */
  header { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
  .bar { max-width: 1120px; margin: 0 auto; padding: 14px 28px; display: flex; align-items: center; gap: 20px; }
  .brand { font-weight: 500; letter-spacing: .32em; font-size: 15px; text-decoration: none; color: var(--text); }
  .brand small { letter-spacing: .08em; color: var(--muted); font-weight: 400; margin-left: 10px; }
  .spacer { flex: 1; }
  .who { color: var(--muted); font-size: 13px; }
  .ghost { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 7px 16px; }
  .ghost:hover { border-color: var(--accent); }

  /* the dashboards drop-down */
  .menu { position: relative; }
  .menu > button { background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 8px 18px; display: flex; gap: 10px; align-items: center; }
  .menu > button:hover, .menu.open > button { border-color: var(--accent); }
  .menu .caret { color: var(--accent); font-size: 11px; }
  .menu-list { display: none; position: absolute; top: calc(100% + 8px); left: 0; width: 290px; max-height: calc(100vh - 90px); overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; box-shadow: 0 18px 40px rgba(0,0,0,.35); }
  .menu.open .menu-list { display: block; }
  .menu-group { color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; padding: 10px 12px 4px; }
  .menu-list a { display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; border-radius: var(--small); text-decoration: none; color: var(--text); }
  .menu-list a:hover, .menu-list a.on { background: var(--bg); }
  .menu-list a span { color: var(--muted); font-size: 12px; }

  /* home */
  h1 { font-weight: 400; font-size: 34px; line-height: 1.15; margin: 40px 0 6px; }
  h2 { font-weight: 400; font-size: 22px; margin: 0; }
  .sub { color: var(--muted); margin: 0 0 32px; }
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
  .tile { background: var(--card); border: 1px solid transparent; border-radius: var(--radius); padding: 22px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 14px; transition: border-color .15s; }
  .tile:hover { border-color: var(--accent); }
  .tile .label { color: var(--muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
  .tile .stats { display: flex; gap: 28px; }
  .stat b { display: block; font-weight: 400; font-size: 30px; line-height: 1.1; }
  .stat small { color: var(--muted); font-size: 12px; }
  .tile .note { color: var(--muted); font-size: 13px; }
  .tile .flag { color: var(--accent); font-size: 13px; }
  .tile .open { color: var(--accent); font-size: 13px; margin-top: auto; }

  /* dashboard pages */
  .crumb { margin: 32px 0 0; font-size: 13px; }
  .page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 20px; flex-wrap: wrap; }
  .page-head h1 { margin: 0; }
  .viewonly { color: var(--muted); font-size: 13px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }
  .panel { background: var(--card); border-radius: var(--radius); padding: 6px 4px; overflow-x: auto; margin-bottom: 20px; }
  .panel h3 { font-weight: 500; font-size: 13px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin: 14px 16px 6px; }
  table { width: 100%; border-collapse: collapse; font-size: 14px; }
  th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
  td { padding: 10px 16px; border-bottom: 1px solid rgba(86,72,62,.5); vertical-align: top; }
  tr:last-child td { border-bottom: none; }
  td.wrap-text { max-width: 460px; }
  td.mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }
  .pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); }
  .pill.yes { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
  .empty { color: var(--muted); padding: 18px 16px; }
  .search { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 9px 16px; font: inherit; width: 280px; }
  .search:focus { outline: none; border-color: var(--accent); }

  /* sign in */
  .signin { max-width: 380px; margin: 14vh auto 0; padding: 0 24px; display: flex; flex-direction: column; gap: 14px; }
  .signin .brand { font-size: 18px; margin-bottom: 24px; }
  .signin input { background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: var(--small); padding: 14px 16px; font: inherit; font-size: 16px; }
  .signin input:focus { outline: none; border-color: var(--accent); }
  .primary { background: var(--accent); color: var(--on-accent); border: none; border-radius: 999px; padding: 14px 20px; font-weight: 500; font-size: 16px; }
  .primary[disabled] { opacity: .6; cursor: default; }
  .msg { color: var(--muted); font-size: 14px; min-height: 20px; }
  .error { color: var(--accent); }
  .center { text-align: center; color: var(--muted); margin-top: 20vh; }

  /* ---------- editing ---------- */
  .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
  .btn { background: var(--accent); color: var(--on-accent); border: none; border-radius: 999px; padding: 9px 18px; font-weight: 500; font-size: 14px; }
  .btn:hover { filter: brightness(1.05); }
  .btn[disabled] { opacity: .55; cursor: default; }
  .btn.line { background: none; color: var(--text); border: 1px solid var(--line); }
  .btn.line:hover { border-color: var(--accent); }
  .btn.danger { background: none; color: #E8A79A; border: 1px solid #6A4038; }
  .btn.small { padding: 5px 12px; font-size: 13px; }
  tr.click { cursor: pointer; }
  tr.click:hover td { background: rgba(217,195,165,.06); }
  .edit-hint { color: var(--muted); font-size: 13px; }

  /* modal */
  .scrim { position: fixed; inset: 0; background: rgba(20,15,12,.66); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
  .modal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); width: 100%; max-width: 640px; padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 30px 60px rgba(0,0,0,.4); }
  .modal.wide { max-width: 920px; }
  .modal h2 { margin: 0; }
  .field { display: flex; flex-direction: column; gap: 6px; }
  .field label { color: var(--muted); font-size: 13px; }
  .field .help { color: var(--muted); font-size: 12px; }
  .field input[type=text], .field input[type=number], .field input[type=url], .field select, .field textarea, .inline-input, .inline-select {
    background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: var(--small); padding: 10px 12px; font: inherit; font-size: 14px; width: 100%; }
  .field textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
  .field textarea.tall { min-height: 340px; }
  .field textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
  .field input:focus, .field select:focus, .field textarea:focus, .inline-input:focus, .inline-select:focus { outline: none; border-color: var(--accent); }
  .inline-input, .inline-select { padding: 6px 8px; font-size: 13px; }
  .field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
  .switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
  .switch input { display: none; }
  .switch .track { width: 42px; height: 24px; border-radius: 12px; background: var(--line); position: relative; transition: background .15s; flex: none; }
  .switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text); transition: left .15s; }
  .switch input:checked + .track { background: var(--accent); }
  .switch input:checked + .track::after { left: 21px; background: var(--on-accent); }
  .modal-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
  .form-error { color: #E8A79A; font-size: 14px; min-height: 0; }

  /* toast */
  .toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.35); display: flex; gap: 12px; align-items: center; }
  .toast.bad { background: #E8A79A; }
  .toast button { background: none; border: none; color: inherit; text-decoration: underline; padding: 0; }

  /* cards for reviewing prompts */
  .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; padding: 12px; }
  .pcard { background: var(--bg); border-radius: var(--small); padding: 16px; display: flex; flex-direction: column; gap: 8px; border: 1px solid transparent; }
  .pcard.yes { border-color: var(--accent); }
  .pcard.no { opacity: .7; }
  .pcard .t { font-size: 17px; }
  .pcard .q { font-size: 14px; }
  .pcard .f { font-size: 13px; color: var(--muted); }
  .pcard .meta { font-size: 12px; color: var(--muted); }
  .pcard textarea { background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 8px; font: inherit; font-size: 13px; min-height: 54px; resize: vertical; }

  /* breath map strip */
  .strip { display: flex; height: 44px; border-radius: 10px; overflow: hidden; position: relative; margin: 8px 0 4px; cursor: pointer; background: var(--bg); }
  .strip div.seg { height: 100%; border-right: 1px solid var(--bg); }
  .strip div.seg.sel { outline: 2px solid var(--text); outline-offset: -2px; }
  .seg.rest { background: #4A3F37; } .seg.in { background: #D9C3A5; } .seg.hold { background: #8F7A63; } .seg.out { background: #B98F6A; }
  .strip .playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); pointer-events: none; }
  .legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
  .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
  audio { width: 100%; }
  .section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px 6px; flex-wrap: wrap; }
  .section-head h3 { margin: 0 !important; }
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  @media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
  .box { background: var(--card); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
  .box h3 { font-weight: 500; font-size: 13px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin: 0; }
  .tick { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line); background: none; color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; }
  .tick.on { background: var(--accent); border-color: var(--accent); }

  /* ---------- programme grid (like Hidden PT Co's template editor) ---------- */
  .tabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-end; margin: 4px 0 0; }
  .tab { border: 1px solid var(--line); border-bottom: none; background: var(--bg); color: var(--muted); border-radius: 12px 12px 0 0; padding: 9px 16px; }
  .tab.on { background: var(--card); color: var(--text); border-color: var(--card); }
  .addtab { border: 1px dashed var(--line); background: none; color: var(--accent); border-radius: 12px; padding: 7px 14px; margin-bottom: 4px; }
  .grid-panel { border-top-left-radius: 0; overflow: visible; }
  .grid-scroll { overflow-x: auto; padding: 0 8px; }
  table.pgrid td { padding: 4px 4px; border-bottom: none; vertical-align: middle; }
  table.pgrid th { padding: 8px 4px; }
  table.pgrid { table-layout: fixed; width: max-content; min-width: 100%; }
  table.pgrid td input { width: 100%; box-sizing: border-box; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 7px 8px; font: inherit; font-size: 13px; }
  table.pgrid td input:focus { outline: none; border-color: var(--accent); }
  table.pgrid td input.bad { border-color: #E8A79A; }
  .x { background: none; border: 0; color: var(--muted); font-size: 15px; width: 26px; height: 30px; border-radius: 6px; }
  .x:hover { color: var(--text); background: var(--bg); }
