/* Egen kod, ingen gemensam ram med crm. Byråns egen färg är oxblod. Mönster från gr8r (Dentme Kliniken, ingen licens, ingen kod tagen), yurygok Lexra 005 till 008, beautifului Approval Card och Task Rows, tremor Tracker och tabell, cmdk, interfaces.rauno.me */

/* Tokens: varmt off-white, tunna linjer, en accent, 4 px-skala */
.byr {
  --b-win: #FBFAF7;
  --b-chrome: #EDEAE3;
  --b-chrome-2: #E6E2DA;
  --b-side: #F6F4F0;
  --b-field: #FFFFFF;
  --b-ink: #1D1B17;
  --b-ink-2: rgba(29, 27, 23, 0.78);
  --b-mut: rgba(29, 27, 23, 0.68);
  --b-line: rgba(29, 27, 23, 0.09);
  --b-line-2: rgba(29, 27, 23, 0.15);
  --b-line-3: rgba(29, 27, 23, 0.24);
  --b-hover: rgba(29, 27, 23, 0.045);
  --b-sel: rgba(29, 27, 23, 0.075);
  --b-row-sel: rgba(29, 27, 23, 0.05);
  --b-acc: #8C2F3C;
  --b-acc-t: #8C2F3C;
  --b-acc-tint: rgba(140, 47, 60, 0.07);
  --b-badge: #8C2F3C;
  --b-on-badge: #FFFFFF;
  --b-ok: #1E7A4C;
  --b-ok-tint: rgba(30, 122, 76, 0.08);
  --b-warn: #8A5300;
  --b-warn-tint: rgba(178, 106, 0, 0.09);
  --b-solid: #1D1B17;
  --b-solid-h: #35322C;
  --b-on-solid: #FBFAF7;
  --b-shadow: 0 0 0 1px rgba(29, 27, 23, 0.14), 0 2px 4px rgba(29, 27, 23, 0.04), 0 24px 48px -20px rgba(29, 27, 23, 0.28);
  --b-pop: 0 0 0 1px rgba(29, 27, 23, 0.14), 0 16px 40px -8px rgba(29, 27, 23, 0.26);
  --b-focus: rgba(140, 47, 60, 0.45);
  --b-ease: cubic-bezier(0.22, 1, 0.36, 1);
  container-type: inline-size;
  box-sizing: border-box;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 18px;
  font-weight: 400;
  letter-spacing: -0.003em;
  color: var(--b-ink);
  text-align: left;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
:where(.dark, [data-theme="dark"]) .byr {
  --b-win: #1B1A18;
  --b-chrome: #262522;
  --b-chrome-2: #2E2C29;
  --b-side: #201F1C;
  --b-field: #151412;
  --b-ink: rgba(255, 255, 255, 0.92);
  --b-ink-2: rgba(255, 255, 255, 0.78);
  --b-mut: rgba(255, 255, 255, 0.62);
  --b-line: rgba(255, 255, 255, 0.08);
  --b-line-2: rgba(255, 255, 255, 0.13);
  --b-line-3: rgba(255, 255, 255, 0.22);
  --b-hover: rgba(255, 255, 255, 0.05);
  --b-sel: rgba(255, 255, 255, 0.085);
  --b-row-sel: rgba(232, 146, 158, 0.09);
  --b-acc: #E8929E;
  --b-acc-t: #EDA0AB;
  --b-acc-tint: rgba(232, 146, 158, 0.12);
  --b-badge: #EDA0AB;
  --b-focus: rgba(232, 146, 158, 0.5);
  --b-on-badge: #1B1A18;
  --b-ok: #4CC487;
  --b-ok-tint: rgba(76, 196, 135, 0.12);
  --b-warn: #E3A64A;
  --b-warn-tint: rgba(227, 166, 74, 0.12);
  --b-solid: #F2F0EB;
  --b-solid-h: #FFFFFF;
  --b-on-solid: #1B1A18;
  --b-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 0 2px rgba(0, 0, 0, 0.5), 0 28px 56px -20px rgba(0, 0, 0, 0.8);
  --b-pop: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 20px 48px -8px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}
.byr :where(*, *::before, *::after) { box-sizing: border-box; }
:where(.byr) :where(button, input, textarea) { font: inherit; color: inherit; letter-spacing: inherit; }
:where(.byr) :where(button) { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
:where(.byr) :where(button:disabled) { cursor: default; }
:where(.byr) :where(h2, h3, h4, p, ul, ol, dl, dd) { margin: 0; padding: 0; }
:where(.byr) :where(ul, ol) { list-style: none; }
.byr :focus-visible { outline: 2px solid var(--b-focus); outline-offset: 1px; border-radius: 4px; }
.byr .byr-m { font-family: var(--mono); font-size: 12px; letter-spacing: 0; }
.byr .byr-mut { color: var(--b-mut); }
.byr .byr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.byr .byr-clip { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.byr .byr-i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.byr svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Fönstret: titelrad, verktygsfält, kropp, statusrad. Ett installerat program, inte en webbsida */
.byr-win {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 700px;
  border-radius: 10px;
  background: var(--b-win);
  box-shadow: var(--b-shadow);
  overflow: hidden;
}
.byr-title {
  position: relative;
  display: flex;
  align-items: center;
  height: 32px;
  flex: none;
  padding: 0 12px;
  background: var(--b-chrome);
  user-select: none;
}
.byr-lights { display: flex; gap: 8px; }
.byr-lights i { width: 12px; height: 12px; border-radius: 50%; background: #EC6A5E; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18); }
.byr-lights i:nth-child(2) { background: #F4BF4F; }
.byr-lights i:nth-child(3) { background: #61C554; }
.byr-title-t { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; align-items: baseline; white-space: nowrap; font-size: 13px; }
.byr-title-t b { font-weight: 600; }
.byr-title-t span { color: var(--b-mut); }
.byr-title-r { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--b-mut); font-size: 12px; }
.byr-sync { width: 8px; height: 8px; border-radius: 50%; background: var(--b-ok); }

/* Verktygsfältet: bakåt, framåt, vytitel, sök med ⌘K, rollväxel (macOS unified toolbar som förlaga) */
.byr-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  flex: none;
  padding: 0 12px;
  background: var(--b-chrome);
  border-bottom: 1px solid var(--b-line-2);
}
.byr-tgrp { display: flex; gap: 2px; }
.byr-tb { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; color: var(--b-ink-2); transition: background-color 120ms var(--b-ease); }
.byr-tb svg { width: 20px; height: 20px; }
.byr-tb:hover:not(:disabled) { background: var(--b-hover); }
.byr-tb:disabled { color: var(--b-line-3); }
.byr-tb[aria-pressed="false"] { color: var(--b-mut); }
.byr-tview { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 14px; }
.byr-vt { font-weight: 600; white-space: nowrap; }
.byr-vs { font-family: var(--mono); font-size: 12px; color: var(--b-mut); }
.byr-search {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto; width: 248px; height: 28px; padding: 0 4px 0 8px;
  border-radius: 6px; background: var(--b-chrome-2); color: var(--b-mut);
  box-shadow: inset 0 0 0 1px var(--b-line);
}
.byr-search svg { width: 16px; height: 16px; flex: none; }
.byr-search span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.byr kbd { font-family: var(--sans); font-size: 12px; line-height: 18px; padding: 0 5px; border-radius: 4px; background: var(--b-win); color: var(--b-mut); box-shadow: 0 0 0 1px var(--b-line-2); }
.byr-search:hover { color: var(--b-ink-2); }
.byr-seg { display: flex; padding: 2px; border-radius: 7px; background: var(--b-chrome-2); box-shadow: inset 0 0 0 1px var(--b-line); }
.byr-seg button { height: 24px; padding: 0 10px; border-radius: 5px; font-size: 12px; font-weight: 500; color: var(--b-mut); transition: background-color 120ms var(--b-ease), color 120ms var(--b-ease); }
.byr-seg button[aria-pressed="true"] { background: var(--b-win); color: var(--b-ink); box-shadow: 0 0 0 0.5px var(--b-line-2), 0 1px 2px rgba(0, 0, 0, 0.08); }

/* Kroppen */
.byr-body { display: flex; flex: 1; min-height: 0; }

/* Sidopanel med arbetsytor och räknare (gr8r) */
.byr-side {
  display: flex; flex-direction: column;
  width: 208px; flex: none;
  padding: 12px 8px 8px;
  background: var(--b-side);
  border-right: 1px solid var(--b-line-2);
  overflow-y: auto;
}
.byr.is-noside .byr-side { display: none; }
.byr-sh { padding: 0 8px 4px; font-size: 12px; font-weight: 600; color: var(--b-mut); }
.byr-sh2 { margin-top: 16px; }
.byr-nav {
  display: flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 8px; border-radius: 6px;
  color: var(--b-ink-2);
}
.byr-nav svg { width: 16px; height: 16px; flex: none; color: var(--b-mut); }
.byr-nav span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.byr-nav em { font-style: normal; font-size: 12px; color: var(--b-mut); font-variant-numeric: tabular-nums; }
.byr-nav em.byr-hot { min-width: 20px; padding: 0 6px; border-radius: 9px; text-align: center; line-height: 18px; background: var(--b-badge); color: var(--b-on-badge); font-weight: 600; }
.byr-nav em[hidden] { display: none; }
.byr-nav:hover { background: var(--b-hover); }
.byr-nav[aria-current="page"] { background: var(--b-sel); color: var(--b-ink); font-weight: 500; }
.byr-nav[aria-current="page"] svg { color: var(--b-acc-t); }
.byr-lk { display: none; color: var(--b-mut); }
.byr-lk svg { width: 16px; height: 16px; }
.byr[data-role="ass"] .byr-nav[data-v="jav"] .byr-lk { display: grid; }
.byr[data-role="ass"] .byr-nav[data-v="jav"] span { color: var(--b-mut); }
.byr-pins { display: flex; flex-direction: column; }
.byr-pin { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: baseline; height: 26px; padding: 4px 8px; border-radius: 6px; color: var(--b-ink-2); font-size: 12px; }
.byr-pin .byr-m { color: var(--b-mut); }
.byr-pin:hover { background: var(--b-hover); }
.byr-me { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 8px; border-top: 1px solid var(--b-line); }
.byr-me-t { display: flex; flex-direction: column; min-width: 0; font-size: 12px; line-height: 16px; }
.byr-me-t span { color: var(--b-mut); }

/* Innehållsytan */
.byr-main { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; }
.byr-v { min-height: 100%; display: flex; flex-direction: column; }
.byr-v[hidden] { display: none; }
.byr-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 20px 24px 16px; }
.byr-hd h2 { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.015em; }
.byr-hd p { margin-top: 2px; color: var(--b-mut); max-width: 62ch; }
.byr-hd--bar { align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--b-line); background: var(--b-win); position: sticky; top: 0; z-index: 2; }
.byr-ph { display: flex; align-items: center; gap: 12px; min-height: 32px; padding: 0 0 8px; }
.byr-ph h3, .byr-glist h3 { font-size: 13px; font-weight: 600; }
.byr-ph2 { margin-top: 20px; }
.byr-cnt { font-style: normal; font-size: 12px; color: var(--b-mut); }
.byr-empty { padding: 16px 0; color: var(--b-mut); }
.byr-empty--big { padding: 48px 24px; text-align: center; }
.byr-lnk { color: var(--b-acc-t); font-size: 12px; font-weight: 500; }
.byr-lnk:hover { text-decoration: underline; text-underline-offset: 2px; }
.byr-ph .byr-lnk { margin-left: auto; }

/* Flikar med räknare (gr8r) */
.byr-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.byr-tabs button { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 6px; color: var(--b-mut); font-size: 12px; font-weight: 500; }
.byr-tabs button em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--b-mut); }
.byr-tabs button:hover { background: var(--b-hover); color: var(--b-ink-2); }
.byr-tabs button[aria-selected="true"] { background: var(--b-sel); color: var(--b-ink); }
.byr-tabs button[aria-selected="true"] em { color: var(--b-ink); font-weight: 600; }
.byr-tabs--seg { padding: 2px; border-radius: 7px; background: var(--b-hover); box-shadow: inset 0 0 0 1px var(--b-line); gap: 0; margin-bottom: 8px; }
.byr-tabs--seg button { flex: 1 1 auto; justify-content: center; height: 24px; padding: 0 6px; }
.byr-tabs--seg button[aria-selected="true"] { background: var(--b-win); box-shadow: 0 0 0 0.5px var(--b-line-2), 0 1px 2px rgba(0, 0, 0, 0.06); }

/* Hem: en rad värde / mål (yurygok 041, rubriksiffra i mono), resten är frister */
.byr-goal { display: flex; align-items: center; gap: 20px; margin: 0 24px; padding: 4px 0 16px; border-bottom: 1px solid var(--b-line-2); }
.byr-gv { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 4px 8px; margin-left: -8px; border-radius: 6px; transition: background-color 120ms var(--b-ease); }
.byr-gv:hover { background: var(--b-hover); }
.byr-gl { font-size: 12px; color: var(--b-mut); }
.byr-gn.byr-m { font-size: 28px; line-height: 36px; font-weight: 500; letter-spacing: -0.03em; white-space: nowrap; }
.byr-gn.byr-m small { font-size: 16px; letter-spacing: -0.01em; color: var(--b-mut); }
.byr-gbar { display: block; width: 100%; min-width: 220px; height: 4px; margin-top: 6px; border-radius: 2px; background: var(--b-line-2); overflow: hidden; }
.byr-gbar i { display: block; height: 100%; background: var(--b-acc); }
.byr-gx { display: flex; gap: 16px; margin-left: auto; font-size: 12px; color: var(--b-mut); }
.byr-gx .byr-lnk { font-size: 13px; }
.byr-hgrid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0; margin: 16px 24px 24px; flex: 1; border: 1px solid var(--b-line-2); border-radius: 8px; background: var(--b-field); }
.byr-pane { padding: 12px 16px 16px; min-width: 0; }
.byr-pane + .byr-pane { border-left: 1px solid var(--b-line); }

/* Uppgifter (beautifului Task Rows) */
.byr-trows li + li { border-top: 1px solid var(--b-line); }
.byr-task { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; min-height: 36px; padding: 6px 0; cursor: pointer; }
.byr-task input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.byr-cb { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; box-shadow: inset 0 0 0 1.5px var(--b-line-3); color: transparent; transition: background-color 120ms var(--b-ease); }
.byr-cb svg { width: 16px; height: 16px; stroke-width: 1.5; }
.byr-task input:focus-visible + .byr-cb { outline: 2px solid var(--b-focus); outline-offset: 2px; }
.byr-task input:checked + .byr-cb { background: var(--b-ink); box-shadow: none; color: var(--b-win); }
.byr-task.is-done .byr-tt { color: var(--b-mut); text-decoration: line-through; text-decoration-color: var(--b-line-3); }
.byr-tt { min-width: 0; }
.byr-case { font-family: var(--mono); font-size: 12px; color: var(--b-mut); padding: 0 2px; border-radius: 3px; white-space: nowrap; line-height: 18px; text-decoration: underline; text-decoration-color: var(--b-line-2); text-underline-offset: 3px; }
.byr-case:hover { color: var(--b-acc-t); text-decoration-color: currentColor; }
.byr-due { font-size: 12px; color: var(--b-mut); white-space: nowrap; min-width: 64px; text-align: right; }
.byr-due.is-hot { color: var(--b-acc-t); font-weight: 600; }

/* Frister: I dag / I morgon / Denna vecka */
.byr-frows li + li { border-top: 1px solid var(--b-line); }
.byr-frows li { display: flex; align-items: center; gap: 8px; }
.byr-frow { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 2px 12px; flex: 1; min-width: 0; padding: 10px 4px; border-radius: 6px; }
.byr-fok { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 30px; padding: 0 12px 0 10px; border-radius: 6px; background: var(--b-solid); color: var(--b-on-solid); font-size: 13px; font-weight: 500; white-space: nowrap; transition: transform 140ms var(--b-ease), background-color 160ms var(--b-ease); }
.byr-fok:hover { background: var(--b-solid-h); }
.byr-fok:active { transform: scale(0.97); }
.byr-fok svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.byr-fok.is-done { background: var(--b-ok-tint); color: var(--b-ok); font-family: var(--mono); font-size: 12px; }
.byr-frows li.is-done .byr-fw { color: var(--b-mut); text-decoration: line-through; text-decoration-color: var(--b-line-3); }
.byr-fr { grid-row: 1 / span 2; grid-column: 3; align-self: center; font-size: 12px; color: var(--b-mut); }
.byr-frows .byr-fw { font-size: 14px; }
.byr-frow:hover { background: var(--b-hover); }
.byr-fd { grid-row: span 2; font-size: 12px; color: var(--b-mut); padding-top: 1px; }
.byr-fd.is-hot { color: var(--b-acc-t); font-weight: 600; }
.byr-fw { font-weight: 500; }
.byr-fc { display: block; font-size: 12px; color: var(--b-mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Aktivitetslogg som tidslinje */
.byr-tl { position: relative; }
.byr-tli { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 4px 0 8px; }
.byr-tli::before { content: ""; position: absolute; left: 55px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--b-win); box-shadow: inset 0 0 0 1.5px var(--b-line-3); }
.byr-tli::after { content: ""; position: absolute; left: 58px; top: 18px; bottom: -4px; width: 1px; background: var(--b-line-2); }
.byr-tli:last-child::after { display: none; }
.byr-tli .byr-tlx { padding-left: 16px; color: var(--b-ink-2); }
.byr-tli .byr-tlx b { color: var(--b-ink); font-weight: 600; }
.byr-tli .byr-tlx .byr-case { margin-left: 4px; }
.byr-tlt { color: var(--b-mut); padding-top: 1px; white-space: nowrap; }
.byr-tli.is-agent::before { box-shadow: inset 0 0 0 1.5px var(--b-acc); }
.byr-tli.is-fresh::before { background: var(--b-acc); box-shadow: none; }
.byr-tl--p .byr-tli { grid-template-columns: 76px minmax(0, 1fr); }
.byr-tl--p .byr-tli::before { left: 87px; }
.byr-tl--p .byr-tli::after { left: 90px; }

/* Ärenden: tabell med statuschip och tunna förloppsstaplar (tremor tabell, reui Data Grid) */
.byr-filter input, .byr-jform input, .byr-desc, .byr-ed, .byr-inv input {
  height: 28px; padding: 0 8px; border: 0; border-radius: 6px;
  background: var(--b-field); box-shadow: inset 0 0 0 1px var(--b-line-2);
  outline: none; transition: box-shadow 120ms var(--b-ease);
}
.byr-filter { margin-left: auto; }
.byr-filter input { width: 200px; }
.byr-filter input:focus, .byr-jform input:focus, .byr-desc:focus, .byr-ed:focus, .byr-inv input:focus { box-shadow: inset 0 0 0 1px var(--b-acc), 0 0 0 3px var(--b-acc-tint); }
.byr ::placeholder { color: var(--b-mut); opacity: 1; }
.byr-split { display: flex; flex: 1; min-height: 0; }
.byr-tw { flex: 1; min-width: 0; }
.byr-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.byr-tbl th { height: 30px; padding: 0 8px; font-size: 12px; font-weight: 500; color: var(--b-mut); text-align: left; border-bottom: 1px solid var(--b-line-2); white-space: nowrap; background: var(--b-win); }
.byr-tbl th button { display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 4px; margin-left: -4px; border-radius: 4px; color: inherit; font-weight: inherit; }
.byr-tbl th button:hover { background: var(--b-hover); color: var(--b-ink); }
.byr-tbl th .byr-i { width: 16px; height: 16px; opacity: 0.55; }
.byr-tbl th .byr-i.is-on { opacity: 1; color: var(--b-acc-t); }
.byr-tbl th[aria-sort="ascending"], .byr-tbl th[aria-sort="descending"] { color: var(--b-ink); }
.byr-tbl td { height: 36px; padding: 0 8px; border-bottom: 1px solid var(--b-line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.byr-tbl th:first-child, .byr-tbl td:first-child { padding-left: 16px; }
.byr-tbl th:last-child, .byr-tbl td:last-child { padding-right: 16px; }
.byr-tbl tbody tr { cursor: pointer; transition: background-color 100ms var(--b-ease); }
.byr-tbl tbody tr:hover { background: var(--b-hover); }
.byr-tbl tbody tr.is-sel { background: var(--b-row-sel); box-shadow: inset 2px 0 0 var(--b-acc); }
.byr-tbl tbody tr:focus-visible { outline: 2px solid var(--b-focus); outline-offset: -2px; }
.byr-c-id { width: 96px; }
.byr-c-type { width: 18%; color: var(--b-ink-2); }
.byr-c-resp { width: 72px; }
.byr-c-st { width: 132px; }
.byr-c-prog { width: 116px; }
.byr-c-off { width: 104px; }
.byr-tbl td.byr-c-off { color: var(--b-ink-2); }
.byr-tbl td.byr-c-off.is-hot { color: var(--b-acc-t); font-weight: 600; }
.byr-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--b-hover); color: var(--b-ink-2); box-shadow: inset 0 0 0 1px var(--b-line); }
.byr-chip[data-t="acc"] { background: transparent; color: var(--b-acc-t); box-shadow: inset 0 0 0 1px var(--b-acc); }
.byr-chip[data-t="acc"] { background-color: var(--b-win); }
.byr-chip[data-t="warn"] { background: var(--b-warn-tint); color: var(--b-warn); box-shadow: none; }
.byr-chip[data-t="ok"] { background: var(--b-ok-tint); color: var(--b-ok); box-shadow: none; }
.byr-bar { display: inline-block; vertical-align: middle; width: 44px; height: 4px; border-radius: 2px; background: var(--b-line-2); overflow: hidden; }
.byr-bar i { display: block; height: 100%; background: var(--b-ink-2); border-radius: 2px; }
.byr-pct { display: inline-block; vertical-align: middle; margin-left: 8px; font-family: var(--mono); font-size: 12px; color: var(--b-mut); }

/* Ärendepanel till höger: parter, dokument, tidslinje (yurygok Lexra 005 till 008, två paneler) */
.byr-panel { display: flex; flex-direction: column; width: 340px; flex: none; border-left: 1px solid var(--b-line-2); background: var(--b-side); position: sticky; top: 45px; align-self: flex-start; max-height: calc(700px - 32px - 44px - 26px - 45px); }
.byr-pnh { display: flex; gap: 12px; align-items: flex-start; padding: 16px 12px 12px 16px; border-bottom: 1px solid var(--b-line); }
.byr-pnh > div { flex: 1; min-width: 0; }
.byr-pnid { margin-right: 8px; color: var(--b-mut); }
.byr-pnh h3 { margin-top: 8px; font-size: 16px; line-height: 22px; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.byr-pnh p { color: var(--b-mut); font-size: 12px; }
.byr-pnb { flex: 1; overflow-y: auto; padding: 12px 16px 16px; }
.byr-pnb h4, .byr-gdet h4 { margin: 16px 0 6px; font-size: 12px; font-weight: 600; color: var(--b-mut); }
.byr-pnb h4 em { font-style: normal; font-weight: 400; }
.byr-pnf { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; padding: 8px 12px; border-radius: 6px; background: var(--b-field); box-shadow: inset 2px 0 0 var(--b-acc), inset 0 0 0 1px var(--b-line); }
.byr-pnf span:first-child { grid-row: span 2; font-size: 12px; color: var(--b-acc-t); }
.byr-pnf b { font-weight: 600; color: var(--b-acc-t); }
.byr-pnf span:last-child { font-size: 12px; color: var(--b-ink-2); }
.byr-dl { display: grid; grid-template-columns: 112px minmax(0, 1fr); }
.byr-dl dt, .byr-dl dd { padding: 6px 0; border-top: 1px solid var(--b-line); }
.byr-dl dt { color: var(--b-mut); font-size: 12px; }
.byr-dl dd { overflow-wrap: anywhere; }
.byr-docs li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; height: 30px; border-top: 1px solid var(--b-line); font-size: 12px; }
.byr-docs .byr-i { color: var(--b-mut); }
.byr-ext { color: var(--b-mut); }
.byr-pnfoot { padding: 12px 16px; border-top: 1px solid var(--b-line); }
.byr-pnfoot .byr-btn { width: 100%; justify-content: center; }

/* Knappar */
.byr-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 6px; font-size: 13px; font-weight: 500; background: var(--b-field); box-shadow: inset 0 0 0 1px var(--b-line-2), 0 1px 1px rgba(0, 0, 0, 0.03); white-space: nowrap; transition: background-color 120ms var(--b-ease), box-shadow 120ms var(--b-ease); }
.byr-btn:hover:not(:disabled) { background: var(--b-hover); box-shadow: inset 0 0 0 1px var(--b-line-3); }
.byr-btn:disabled { color: var(--b-mut); opacity: 0.7; }
.byr-btn--solid { background: var(--b-solid); color: var(--b-on-solid); box-shadow: none; }
.byr-btn--solid:hover:not(:disabled) { background: var(--b-solid-h); box-shadow: none; }
.byr-btn--sm { height: 26px; padding: 0 8px; font-size: 12px; }
.byr-btn--sm .byr-i { width: 16px; height: 16px; }
.byr-btn.is-on { background: var(--b-acc-tint); color: var(--b-acc-t); box-shadow: inset 0 0 0 1px var(--b-acc); }
.byr-btn:active:not(:disabled) { transform: translateY(0.5px); }
.byr-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--b-ok); font-weight: 500; }

/* Jävskontroll */
.byr-jform { display: flex; gap: 8px; margin: 0 24px; }
.byr-jform input { flex: 1; min-width: 0; height: 36px; font-size: 14px; padding: 0 12px; }
.byr-jform .byr-btn { height: 36px; }
.byr-try { margin: 8px 24px 0; font-size: 12px; color: var(--b-mut); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.byr-jres { margin: 16px 24px 0; padding: 16px; border-radius: 8px; border: 1px solid var(--b-line-2); background: var(--b-field); }
.byr-jres > p, .byr-jh p { margin-top: 2px; color: var(--b-ink-2); }
.byr-jres[data-t="ok"] { display: flex; gap: 12px; }
.byr-jres[data-t="ok"] > .byr-i { color: var(--b-ok); margin-top: 1px; }
.byr-jres[data-t="ok"] b { color: var(--b-ok); }
.byr-jres[data-t="err"] b { color: var(--b-acc-t); }
.byr-jres[data-t="hit"] { border-color: var(--b-acc); box-shadow: inset 3px 0 0 var(--b-acc); }
.byr-jres[data-t="hit"] .byr-jh b { color: var(--b-acc-t); }
.byr-jres--idle { border-style: dashed; color: var(--b-mut); }
.byr-jres--idle p { color: var(--b-mut); }
.byr-dl--row { margin-top: 12px; grid-template-columns: 96px minmax(0, 1fr); }
.byr-jact { margin-top: 12px; }

/* Låst vy */
.byr-lock { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 32px auto; max-width: 360px; padding: 24px; text-align: center; color: var(--b-mut); }
.byr-lock .byr-i { width: 24px; height: 24px; color: var(--b-ink-2); }
.byr-lock b { color: var(--b-ink); font-size: 14px; }

/* Godkännanden (beautifului Approval Card) */
.byr-split--g { flex: 1; }
.byr-glist { width: 300px; flex: none; padding: 12px 8px 16px; border-right: 1px solid var(--b-line-2); background: var(--b-side); }
.byr-glist .byr-ph { padding: 0 8px 4px; }
.byr-grow { display: grid; gap: 1px; width: 100%; padding: 8px; border-radius: 6px; }
.byr-grow:hover { background: var(--b-hover); }
.byr-grow.is-sel { background: var(--b-sel); box-shadow: inset 2px 0 0 var(--b-acc); }
.byr-gk { font-size: 12px; color: var(--b-mut); font-weight: 500; }
.byr-grow b { font-weight: 500; }
.byr-gm { font-size: 12px; color: var(--b-mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.byr-grow.is-done .byr-gk { color: var(--b-ok); }
.byr-grow.is-done b { color: var(--b-ink-2); }
.byr-note { display: flex; gap: 6px; align-items: center; margin: 8px; font-size: 12px; color: var(--b-mut); }
.byr-note .byr-i { width: 16px; height: 16px; }
.byr-gdet { flex: 1; min-width: 0; padding: 20px 24px 24px; }
.byr-gh h3 { margin-top: 8px; font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -0.012em; }
.byr-gh p { margin-top: 2px; color: var(--b-mut); }
.byr-agent { margin: 12px 0; padding: 8px 12px; border-radius: 6px; font-size: 12px; color: var(--b-ink-2); background: var(--b-acc-tint); }
.byr-letter { max-width: 62ch; padding: 16px; border-radius: 6px; border: 1px solid var(--b-line-2); background: var(--b-field); color: var(--b-ink); }
.byr-letter p + p { margin-top: 10px; }
.byr-ed { display: block; width: 100%; max-width: 62ch; height: auto; padding: 12px; line-height: 20px; resize: vertical; }
.byr-inv { width: 100%; max-width: 440px; border-collapse: collapse; border: 1px solid var(--b-line-2); border-radius: 6px; background: var(--b-field); }
.byr-inv th, .byr-inv td { padding: 8px 12px; border-top: 1px solid var(--b-line); text-align: left; font-weight: 400; }
.byr-inv tr:first-child th, .byr-inv tr:first-child td { border-top: 0; }
.byr-inv td { text-align: right; white-space: nowrap; }
.byr-inv-s th, .byr-inv-s td { font-weight: 600; border-top: 1px solid var(--b-line-3); }
.byr-inv-s td.byr-m { font-size: 13px; }
.byr-inv input { width: 56px; height: 24px; text-align: right; font-family: var(--mono); font-size: 12px; }
.byr-src li { display: grid; grid-template-columns: 16px 16px auto minmax(0, 1fr); gap: 8px; align-items: center; min-height: 30px; border-top: 1px solid var(--b-line); font-size: 12px; }
.byr-src .byr-m { color: var(--b-mut); text-align: right; }
.byr-src .byr-i { color: var(--b-mut); width: 16px; height: 16px; }
.byr-src b { font-weight: 500; }
.byr-src .byr-mut { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.byr-trail { margin-top: 8px; font-size: 12px; color: var(--b-mut); }
.byr-gact { display: flex; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--b-line); }

/* Tid (tremor Tracker, en stapel per dag) */
.byr-hd--tid { align-items: flex-end; }
.byr-wk { display: flex; align-items: flex-end; gap: 6px; height: 56px; flex: none; }
.byr-wd { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; width: 28px; height: 100%; }
.byr-wd i { display: block; width: 100%; min-height: 2px; border-radius: 3px; background: var(--b-line-3); }
.byr-wd b { font-size: 12px; font-weight: 400; color: var(--b-mut); line-height: 14px; }
.byr-wd.is-today i { background: var(--b-acc); }
.byr-wd.is-today b { color: var(--b-acc-t); font-weight: 600; }
.byr-wd.is-future i { background: var(--b-line); }
.byr-wks { align-self: center; margin-left: 8px; font-size: 12px; color: var(--b-mut); white-space: nowrap; }
.byr-wks .byr-m { color: var(--b-ink); font-size: 13px; }
.byr-tbl--tid { border-top: 1px solid var(--b-line-2); }
.byr-tbl--tid tbody tr { cursor: default; }
.byr-tbl--tid th:nth-child(1), .byr-tbl--tid td:nth-child(1) { width: 112px; }
.byr-tbl--tid th:nth-child(2) { width: 26%; }
.byr-tbl--tid th:nth-child(4) { width: 96px; }
.byr-tbl--tid th:nth-child(5) { width: 116px; }
.byr-tbl--tid td { height: 44px; }
.byr-tbl--tid tr.is-run { background: var(--b-row-sel); }
.byr-tbl--tid tr.is-run td[data-el] { color: var(--b-acc-t); }
.byr-tbl--tid tfoot th, .byr-tbl--tid tfoot td { height: 40px; padding: 0 8px; font-weight: 600; color: var(--b-ink); border-bottom: 0; text-align: left; }
.byr-tbl--tid tfoot th { padding-left: 16px; }
.byr-tbl--tid tfoot td.byr-m { font-size: 13px; }
.byr .byr-r, .byr-tbl th.byr-r { text-align: right; }
.byr-desc { width: 100%; height: 28px; background: transparent; box-shadow: none; padding: 0 6px; margin-left: -6px; }
.byr-desc:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--b-line-2); }
.byr-desc:disabled { color: var(--b-mut); }
.byr-tfoot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px 24px; border-top: 1px solid var(--b-line-2); font-size: 12px; }

/* Aktivitet: revisionslogg */
.byr-hint { margin-left: auto; font-size: 12px; white-space: nowrap; }
.byr-tbl--akt tbody tr { cursor: default; }
.byr-tbl--akt th:nth-child(1) { width: 96px; }
.byr-tbl--akt th:nth-child(2) { width: 112px; }
.byr-tbl--akt th:nth-child(4) { width: 112px; }
.byr-tsum { padding: 10px 16px; font-size: 12px; color: var(--b-mut); }
.byr-tbl tr.is-fresh td:first-child { box-shadow: inset 2px 0 0 var(--b-acc); }

/* Statusraden längst ned */
.byr-status { display: flex; align-items: center; gap: 16px; height: 26px; flex: none; padding: 0 12px; border-top: 1px solid var(--b-line-2); background: var(--b-chrome); font-size: 12px; color: var(--b-mut); white-space: nowrap; }
.byr-st-ex { color: var(--b-ink-2); font-weight: 500; }
.byr-st-msg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.byr-st-r { font-variant-numeric: tabular-nums; }

/* ⌘K-paletten (cmdk) */
.byr-cmd { position: absolute; inset: 0; z-index: 20; display: flex; justify-content: center; align-items: flex-start; padding-top: 96px; background: rgba(20, 18, 15, 0.18); }
.byr-cmd[hidden] { display: none; }
.byr-cmd-box { width: min(520px, calc(100% - 24px)); border-radius: 10px; background: var(--b-win); box-shadow: var(--b-pop); overflow: hidden; animation: byr-pop 140ms var(--b-ease); }
.byr-cmd-in { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px; border-bottom: 1px solid var(--b-line-2); }
.byr-cmd-in svg { width: 20px; height: 20px; color: var(--b-mut); flex: none; }
.byr-cmd-in input:focus-visible { outline: none; }
.byr-cmd-in input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 15px; }
.byr-cmd-l { max-height: 320px; overflow-y: auto; padding: 4px 6px 6px; }
.byr-cmd-l li { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 34px; padding: 0 10px; border-radius: 6px; cursor: pointer; }
.byr-cmd-l li > span:last-child { flex: none; white-space: nowrap; }
.byr-cmd-l li[aria-selected="true"] { background: var(--b-sel); }
.byr-cmd-l li[aria-selected="true"] > .byr-clip { color: var(--b-ink); font-weight: 500; }
.byr-cmd-l li.byr-cmd-g { height: 28px; padding-top: 6px; font-size: 12px; font-weight: 600; color: var(--b-mut); cursor: default; }
.byr-cmd-l li.byr-cmd-none { justify-content: center; color: var(--b-mut); cursor: default; height: 56px; }
@keyframes byr-pop { from { opacity: 0; transform: translateY(-4px) scale(0.99); } }
.byr.is-reduced .byr-cmd-box { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .byr *, .byr *::before, .byr *::after { transition: none !important; animation: none !important; }
}

/* Mellanbredd: smalare panel */
@container (max-width: 1000px) {
  .byr-side { width: 184px; }
  .byr-search { width: 200px; }
  .byr-c-type { display: none; }
  .byr-tbl th.byr-c-type, .byr-tbl td.byr-c-type { display: none; }
  .byr-split.has-panel .byr-c-prog, .byr-split.has-panel .byr-c-resp { display: none; }
  .byr-panel { width: 300px; }
  .byr-glist { width: 248px; }
}

/* Under 760 px: sidomenyn blir en rad, paneler staplas */
@container (max-width: 759px) {
  .byr-win { height: auto; border-radius: 8px; }
  .byr-title-t span, .byr-title-r .byr-sync-t { display: none; }
  .byr-tools { flex-wrap: wrap; height: auto; padding: 8px; gap: 8px; }
  .byr-tview { display: none; }
  .byr-tgrp .byr-tb[data-act="side"] { display: none; }
  .byr-search { order: 3; width: 100%; margin: 0; height: 32px; }
  .byr-search kbd { display: none; }
  .byr-seg { margin-left: auto; }
  .byr-body { flex-direction: column; }
  .byr.is-noside .byr-side { display: grid; }
  .byr-side { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; width: auto; padding: 6px; border-right: 0; border-bottom: 1px solid var(--b-line-2); overflow: visible; }
  .byr-sh, .byr-pins, .byr-me { display: none; }
  .byr-nav { height: 32px; padding: 0 6px; gap: 6px; font-size: 12px; }
  .byr-nav svg { width: 16px; height: 16px; }
  .byr-main { overflow: visible; }
  .byr-hd { padding: 16px 12px 12px; flex-wrap: wrap; }
  .byr-hd--bar { position: static; padding: 8px 12px; }
  .byr-filter { width: 100%; margin: 0; }
  .byr-filter input { width: 100%; }
  .byr-hint { display: none; }
  .byr-goal { margin: 0 12px; flex-wrap: wrap; gap: 8px 16px; }
  .byr-gn.byr-m { font-size: 24px; line-height: 32px; }
  .byr-gv { width: 100%; }
  .byr-gx { margin-left: 0; }
  .byr-hgrid { grid-template-columns: 1fr; margin: 12px; }
  .byr-pane + .byr-pane { border-left: 0; border-top: 1px solid var(--b-line); }
  .byr-frow { grid-template-columns: 64px minmax(0, 1fr); }
  .byr-frows li { flex-wrap: wrap; gap: 0 8px; }
  .byr-frows li .byr-frow { flex-basis: 100%; }
  .byr-frows .byr-fc { white-space: normal; }
  .byr-frows li .byr-fok { margin-bottom: 10px; }
  .byr-fok { margin-left: 72px; }
  .byr-hgrid .byr-tasks { display: none; }
  .byr-fr { display: none; }
  .byr-pane { padding: 12px; }
  .byr-task { grid-template-columns: 16px minmax(0, 1fr) auto; }
  .byr-task .byr-case { grid-column: 2; justify-self: start; }
  .byr-task .byr-due { grid-column: 3; grid-row: 1; }
  .byr-split, .byr-split--g { flex-direction: column; }
  .byr-panel { order: -1; width: auto; position: static; max-height: none; border-left: 0; border-bottom: 1px solid var(--b-line-2); }
  .byr-pnb { overflow: visible; }
  /* tabellen blir rader i två nivåer */
  .byr-tbl, .byr-tbl tbody, .byr-tbl tfoot { display: block; }
  .byr-tbl thead { display: none; }
  .byr-tbl tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 12px; border-bottom: 1px solid var(--b-line); }
  .byr-tbl td, .byr-tbl th { display: block; height: auto; padding: 0 !important; border: 0; }
  .byr-tbl td.byr-c-type, .byr-tbl td.byr-c-resp { display: none; }
  .byr-tbl td.byr-c-id { grid-column: 1; }
  .byr-tbl td.byr-c-st { grid-column: 2; grid-row: 1; justify-self: end; width: auto; }
  .byr-tbl td.byr-c-client { grid-column: 1 / -1; font-weight: 500; white-space: normal; }
  .byr-tbl td.byr-c-client .byr-clip { white-space: normal; }
  .byr-tbl td.byr-c-prog { display: block !important; grid-column: 1; }
  .byr-tbl td.byr-c-off { grid-column: 2; text-align: right; font-size: 12px; }
  .byr-tbl--tid tr { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
  .byr-tbl--tid tbody td:nth-child(1) { grid-column: 1; }
  .byr-tbl--tid tbody td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; color: var(--b-mut); font-size: 12px; }
  .byr-tbl--tid tbody td:nth-child(3) { grid-column: 1 / -1; grid-row: 3; }
  .byr-tbl--tid tbody td:nth-child(4) { grid-column: 2; grid-row: 1; }
  .byr-tbl--tid tbody td:nth-child(5) { grid-column: 3; grid-row: 1; }
  .byr-tbl--tid tbody td:nth-child(1), .byr-tbl--tid tbody td:nth-child(4), .byr-tbl--tid tbody td:nth-child(5) { width: auto; }
  .byr-tbl--tid tfoot tr { grid-template-columns: 1fr auto; align-items: center; }
  .byr-tbl--tid tfoot td:last-child { display: none; }
  .byr-desc { margin-left: 0; box-shadow: inset 0 0 0 1px var(--b-line); }
  .byr-tbl--akt tr { grid-template-columns: auto minmax(0, 1fr) auto; }
  .byr-tbl--akt td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
  .byr-tbl--akt td:nth-child(1), .byr-tbl--akt td:nth-child(2), .byr-tbl--akt td:nth-child(4) { width: auto; }
  .byr-tbl--akt td:nth-child(2) { font-weight: 500; }
  .byr-wk { width: 100%; }
  .byr-tfoot { flex-direction: column; align-items: stretch; padding: 12px; }
  .byr-tfoot .byr-btn { justify-content: center; }
  .byr-glist { width: auto; border-right: 0; border-bottom: 1px solid var(--b-line-2); }
  .byr-gdet { padding: 16px 12px; }
  .byr-gact .byr-btn { flex: 1; justify-content: center; }
  .byr-jform { margin: 0 12px; flex-direction: column; }
  .byr-jform input { flex: none; height: 40px; }
  .byr-jform .byr-btn { justify-content: center; }
  .byr-try, .byr-jres { margin-left: 12px; margin-right: 12px; }
  .byr-dl { grid-template-columns: 104px minmax(0, 1fr); }
  .byr-status .byr-st-msg { display: none; }
  .byr-status { flex-wrap: wrap; justify-content: space-between; height: auto; padding: 4px 12px; gap: 0 12px; white-space: normal; }
  .byr-cmd { padding-top: 64px; }
}
@container (max-width: 380px) {
  .byr-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .byr-seg button { padding: 0 8px; }
}

/* Ikoner: kontur 1,5 px oavsett skala (BRIEF7) */
.byr svg :is(path, circle, rect, line, polyline, polygon) { vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
