/* Rapport workspace. Root rules are scoped to .uwapp-root.uwapp-rapport (the body carries the app class too).
   Light and dark tokens follow html[data-theme] / prefers-color-scheme. CSP: no inline styles (CSSOM only). */
.uwapp-root.uwapp-rapport {
  --rp-bg: #eef2f5; --rp-surface: #ffffff; --rp-surface-2: #eef2f6; --rp-col: #f3f5f8; --rp-ink: #15202b; --rp-muted: #4a5666;
  --rp-line: #d3dae3; --rp-control: #6b7787; --rp-accent: #0e7490; --rp-accent-ink: #155e75; --rp-on-accent: #ffffff;
  --rp-warn: #a3271b; --rp-warn-bg: #fde4e1; --rp-good: #0d5a2e; --rp-good-bg: #dcf5e6; --rp-focus: #b45309;
  --rp-todo-bg: #e2e8f0; --rp-todo-ink: #1e293b; --rp-prog-bg: #dbeafe; --rp-prog-ink: #1e3a8a; --rp-done-bg: #dcfce7; --rp-done-ink: #14532d;
  --rp-chip: #e8edf3; --rp-sel: #e0f2fe;
  background: var(--rp-bg); color: var(--rp-ink); color-scheme: light;
}
:root[data-theme="dark"] .uwapp-root.uwapp-rapport {
  --rp-bg: #0f141a; --rp-surface: #19212b; --rp-surface-2: #243040; --rp-col: #141b24; --rp-ink: #edf2f7; --rp-muted: #b4bfcc;
  --rp-line: #344255; --rp-control: #8a97a8; --rp-accent: #67e8f9; --rp-accent-ink: #a5f3fc; --rp-on-accent: #083344;
  --rp-warn: #ffb3a8; --rp-warn-bg: #4a1d19; --rp-good: #9be3b5; --rp-good-bg: #143823; --rp-focus: #fbbf24;
  --rp-todo-bg: #334155; --rp-todo-ink: #f1f5f9; --rp-prog-bg: #1e3a8a; --rp-prog-ink: #dbeafe; --rp-done-bg: #14532d; --rp-done-ink: #dcfce7;
  --rp-chip: #2a3646; --rp-sel: #12403b;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .uwapp-root.uwapp-rapport {
    --rp-bg: #0f141a; --rp-surface: #19212b; --rp-surface-2: #243040; --rp-col: #141b24; --rp-ink: #edf2f7; --rp-muted: #b4bfcc;
    --rp-line: #344255; --rp-control: #8a97a8; --rp-accent: #67e8f9; --rp-accent-ink: #a5f3fc; --rp-on-accent: #083344;
    --rp-warn: #ffb3a8; --rp-warn-bg: #4a1d19; --rp-good: #9be3b5; --rp-good-bg: #143823; --rp-focus: #fbbf24;
    --rp-todo-bg: #334155; --rp-todo-ink: #f1f5f9; --rp-prog-bg: #1e3a8a; --rp-prog-ink: #dbeafe; --rp-done-bg: #14532d; --rp-done-ink: #dcfce7;
    --rp-chip: #2a3646; --rp-sel: #12403b;
    color-scheme: dark;
  }
}

/* Platform element defaults leak into app workspaces: reset them at zero specificity. */
:where(.rp-app, .rp-dialog) button { font: inherit; font-size: .9rem; font-weight: 600; padding: 0; border: 0; border-radius: 8px; background: none; color: inherit; cursor: pointer; width: auto; min-height: 0; margin: 0; }
:where(.rp-app, .rp-dialog) button:hover { background: none; }
:where(.rp-app, .rp-dialog) :is(input, select, textarea) { font: inherit; color: var(--rp-ink); background: var(--rp-surface); border: 1px solid var(--rp-control); border-radius: 8px; width: auto; margin: 0; }
:where(.rp-app, .rp-dialog) table { border-collapse: collapse; width: 100%; margin: 0; font-size: .88rem; }
:where(.rp-app, .rp-dialog) :is(th, td) { text-align: start; padding: 6px 8px; border-bottom: 1px solid var(--rp-line); vertical-align: middle; }
:where(.rp-app, .rp-dialog) thead th { background: var(--rp-surface-2); color: var(--rp-ink); }
:where(.rp-app, .rp-dialog) kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; padding: 1px 6px; border: 1px solid var(--rp-control); border-bottom-width: 2px; border-radius: 5px; background: var(--rp-surface-2); color: var(--rp-ink); white-space: nowrap; }
:where(.rp-app, .rp-dialog) a { color: var(--rp-accent-ink); }
:where(.rp-app, .rp-dialog) :is(code, pre) { background: var(--rp-surface-2); color: var(--rp-ink); border-radius: 5px; }
:where(.rp-app, .rp-dialog) code { padding: 0 .25em; font-size: .9em; }
:where(.rp-app, .rp-dialog) pre { padding: .5rem .6rem; overflow: auto; max-width: 100%; }
:where(.rp-app, .rp-dialog) fieldset { border: 1px solid var(--rp-line); border-radius: 10px; padding: .4rem .7rem; margin: 0 0 .6rem; min-width: 0; }
:where(.rp-app, .rp-dialog) legend { font-weight: 700; font-size: .85rem; padding: 0 .3rem; }
:where(.rp-app, .rp-dialog) :is(h2, h3, h4) { color: var(--rp-ink); }
:where(.rp-app, .rp-dialog) caption { text-align: start; font-weight: 700; padding: .4rem .5rem; color: var(--rp-ink); }

.rp-app { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; background: var(--rp-bg); color: var(--rp-ink); }
.rp-app :focus-visible, .rp-dialog :focus-visible { outline: 3px solid var(--rp-focus); outline-offset: 2px; }
.rp-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
/* scroll containers must contain their absolutely positioned .rp-sr children, or those widen the page */
.rp-columns, .rp-table-wrap, .rp-tabs, .rp-wf-diagram, .rp-main, .rp-dialog-body { position: relative; }
.rp-spacer { flex: 1; min-width: 0; }
.rp-app [hidden], .rp-dialog [hidden] { display: none !important; }
.rp-portal-bar > .rp-title, .rp-portal-bar .rp-menus > :not(:last-child), .rp-portal-bar > .rp-icon-btn { display: none; }
.rp-hint { color: var(--rp-muted); font-size: .84rem; margin: .25rem 0 .5rem; }
.rp-muted { color: var(--rp-muted); font-size: .86rem; }
.rp-sub { color: var(--rp-muted); font-size: .84rem; }
.rp-error { color: var(--rp-warn); font-weight: 600; font-size: .88rem; margin: .2rem 0; }
.rp-error:empty { display: none; }
.rp-note, .rp-callout { font-size: .9rem; color: var(--rp-ink); background: var(--rp-surface-2); border-radius: 8px; padding: .5rem .75rem; margin: .5rem 0; display: flex; gap: .4rem; align-items: flex-start; flex-wrap: wrap; }
ul.rp-callout { display: block; padding-inline-start: 1.6rem; }
.rp-callout-warn { background: var(--rp-warn-bg); color: var(--rp-ink); }
.rp-callout-good { background: var(--rp-good-bg); color: var(--rp-ink); }
.rp-plain { list-style: none; margin: 0; padding: 0; }
.rp-empty { padding: 2rem 1rem; text-align: center; color: var(--rp-muted); }
.rp-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--rp-surface-2); padding: .4rem .6rem; border-radius: 6px; overflow-wrap: anywhere; }
.rp-inline { display: inline-flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: center; }
.rp-num { text-align: end; font-variant-numeric: tabular-nums; }

/* ---------- buttons and inputs */
.rp-btn { display: inline-flex; align-items: center; gap: .35rem; min-height: 34px; padding: .3rem .75rem; border: 1px solid var(--rp-control); border-radius: 8px; background: var(--rp-surface); color: var(--rp-ink); font-size: .86rem; white-space: nowrap; }
.rp-btn:hover:not([disabled]) { background: var(--rp-surface-2); }
.rp-btn[disabled], .rp-icon-btn[disabled] { opacity: .5; cursor: not-allowed; }
.rp-btn-small { min-height: 28px; padding: .15rem .5rem; font-size: .8rem; }
.rp-btn-primary, :is(.rp-app, .rp-dialog) button[type=submit].rp-btn-primary { background: var(--rp-accent); border-color: var(--rp-accent); color: var(--rp-on-accent); }
.rp-btn-primary:hover:not([disabled]), :is(.rp-app, .rp-dialog) button[type=submit].rp-btn-primary:hover:not([disabled]) { background: var(--rp-accent-ink); border-color: var(--rp-accent-ink); color: var(--rp-on-accent); }
:is(.rp-app, .rp-dialog) button[type=submit].rp-btn:not(.rp-btn-primary) { background: var(--rp-surface); color: var(--rp-ink); border: 1px solid var(--rp-control); }
.rp-btn-danger { color: var(--rp-warn); border-color: var(--rp-warn); }
.rp-icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid transparent; border-radius: 8px; color: var(--rp-ink); flex: none; position: relative; }
.rp-icon-btn:hover:not([disabled]) { background: var(--rp-surface-2); border-color: var(--rp-line); }
.rp-link-btn { color: var(--rp-accent-ink); text-align: start; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.rp-input { min-height: 34px; padding: .25rem .5rem; box-sizing: border-box; max-width: 100%; }
textarea.rp-input { width: 100%; resize: vertical; }
.rp-num-in { width: 6.5rem; }
.rp-check { display: inline-flex; align-items: center; gap: .45rem; font-size: .88rem; min-height: 28px; }
.rp-check > input[type=checkbox], .rp-check > input[type=radio] { width: 20px; height: 20px; margin: 2px; flex: none; }
.rp-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rp-file:focus-visible + *, .rp-file-btn:focus-within { outline: 3px solid var(--rp-focus); }
.rp-file-btn { cursor: pointer; }

/* ---------- toolbar, tabs, status */
.rp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; padding: .4rem .75rem; background: var(--rp-surface); border-bottom: 1px solid var(--rp-line); }
.rp-title { display: inline-flex; align-items: center; gap: .5rem; max-width: min(40ch, 60vw); padding: .25rem .4rem; border-radius: 8px; }
.rp-title:hover { background: var(--rp-surface-2); }
.rp-title-text { font-weight: 700; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-key-chip { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; font-weight: 700; padding: .1rem .4rem; border-radius: 6px; background: var(--rp-accent); color: var(--rp-on-accent); }
.rp-menus { display: flex; flex-wrap: wrap; gap: .15rem; }
.rp-menu-wrap { position: relative; }
.rp-menu-btn { display: inline-flex; align-items: center; gap: .2rem; min-height: 34px; padding: .2rem .55rem; border-radius: 8px; }
.rp-menu-btn:hover, .rp-menu-btn[aria-expanded="true"] { background: var(--rp-surface-2); }
.rp-menu { position: fixed; z-index: 50; min-width: 240px; max-height: calc(100vh - 8px); overflow: auto; padding: .3rem; background: var(--rp-surface); color: var(--rp-ink); border: 1px solid var(--rp-line); border-radius: 10px; box-shadow: 0 10px 30px rgb(0 0 0 / .18); }
.rp-menu-item { display: flex; justify-content: space-between; gap: 1rem; width: 100%; padding: .4rem .6rem; text-align: start; font-weight: 500; }
.rp-menu-item:hover, .rp-menu-item:focus { background: var(--rp-surface-2); }
.rp-menu-item[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.rp-menu-key { color: var(--rp-muted); font-size: .8rem; }
.rp-menu-sep { height: 1px; background: var(--rp-line); margin: .25rem 0; }
.rp-bell .rp-badge { position: absolute; top: 1px; inset-inline-end: 1px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: #b91c1c; color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.rp-create { font-weight: 700; }
.rp-tabs { background: var(--rp-surface); border-bottom: 1px solid var(--rp-line); padding: 0 .75rem; overflow-x: auto; }
.rp-tablist { display: flex; gap: .2rem; list-style: none; margin: 0; padding: 0; }
.rp-tab { display: inline-flex; align-items: center; gap: .35rem; padding: .5rem .7rem; color: var(--rp-ink); text-decoration: none; border-bottom: 3px solid transparent; font-weight: 600; font-size: .9rem; white-space: nowrap; }
:where(.rp-app) .rp-tab { color: var(--rp-ink); }
.rp-tab:hover { background: var(--rp-surface-2); }
.rp-tab-on { border-bottom-color: var(--rp-accent); color: var(--rp-accent-ink); }
:where(.rp-app) .rp-tab.rp-tab-on { color: var(--rp-accent-ink); }
.rp-tab-key { font-size: .7rem; padding: 0 4px; border-width: 1px; opacity: .8; }
.rp-main { flex: 1; min-height: 0; overflow: auto; padding: .75rem 1rem 1.5rem; }
.rp-main:focus { outline: none; }
.rp-status { display: flex; flex-wrap: wrap; gap: .3rem .75rem; align-items: center; padding: .3rem .75rem; font-size: .82rem; background: var(--rp-surface); border-top: 1px solid var(--rp-line); color: var(--rp-muted); }
.rp-status-text { color: var(--rp-ink); }
.rp-view-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; margin-bottom: .5rem; }
.rp-view-head h2 { font-size: 1.25rem; margin: 0; }
.rp-view-head h2:focus { outline: none; }
.rp-filterbar { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; margin: .3rem 0 .7rem; }

/* ---------- type, priority, status, avatars, chips */
.rp-type { display: inline-flex; align-items: center; gap: .25rem; font-size: .8rem; color: var(--tc); }
.rp-type svg { flex: none; }
.rp-type-task { --tc: #1d4ed8; } .rp-type-bug { --tc: #b91c1c; } .rp-type-story { --tc: #15803d; } .rp-type-epic { --tc: #7e22ce; }
.rp-type-subtask { --tc: #0e7490; } .rp-type-incident { --tc: #c2410c; } .rp-type-request { --tc: #4338ca; }
:root[data-theme="dark"] :is(.rp-app, .rp-dialog) .rp-type { filter: brightness(1.9) saturate(.8); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.rp-app, .rp-dialog) .rp-type { filter: brightness(1.9) saturate(.8); } }
.rp-type span:not(.rp-sr) { color: var(--rp-ink); }
.rp-prio { display: inline-flex; align-items: center; gap: .25rem; font-size: .82rem; }
.rp-prio-highest, .rp-prio-high { color: #b91c1c; } .rp-prio-medium { color: #b45309; } .rp-prio-low, .rp-prio-lowest { color: #1d4ed8; }
:root[data-theme="dark"] :is(.rp-app, .rp-dialog) :is(.rp-prio-highest, .rp-prio-high) { color: #fca5a5; }
:root[data-theme="dark"] :is(.rp-app, .rp-dialog) .rp-prio-medium { color: #fcd34d; }
:root[data-theme="dark"] :is(.rp-app, .rp-dialog) :is(.rp-prio-low, .rp-prio-lowest) { color: #93c5fd; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.rp-app, .rp-dialog) :is(.rp-prio-highest, .rp-prio-high) { color: #fca5a5; }
  :root:not([data-theme="light"]) :is(.rp-app, .rp-dialog) .rp-prio-medium { color: #fcd34d; }
  :root:not([data-theme="light"]) :is(.rp-app, .rp-dialog) :is(.rp-prio-low, .rp-prio-lowest) { color: #93c5fd; }
}
.rp-prio span:not(.rp-sr) { color: var(--rp-ink); }
.rp-lozenge { display: inline-block; padding: .05rem .45rem; border-radius: 5px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; background: var(--rp-todo-bg); color: var(--rp-todo-ink); }
.rp-lozenge.rp-cat-inprogress { background: var(--rp-prog-bg); color: var(--rp-prog-ink); }
.rp-lozenge.rp-cat-done { background: var(--rp-done-bg); color: var(--rp-done-ink); }
.rp-avatar-wrap { display: inline-flex; }
.rp-avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; font-size: .7rem; width: 26px; height: 26px; flex: none; }
.rp-avatar-s { width: 22px; height: 22px; font-size: .62rem; }
.rp-avatar-none { background: var(--rp-surface-2); color: var(--rp-muted); border: 1px dashed var(--rp-control); }
.rp-avatars { display: flex; flex-wrap: wrap; gap: .2rem; }
.rp-chip { display: inline-flex; align-items: center; gap: .2rem; padding: 0 .4rem; border-radius: 5px; background: var(--rp-chip); color: var(--rp-ink); font-size: .74rem; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-chip-epic { background: #ede9fe; color: #4c1d95; }
:root[data-theme="dark"] :is(.rp-app, .rp-dialog) .rp-chip-epic { background: #3b2a63; color: #ede9fe; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.rp-app, .rp-dialog) .rp-chip-epic { background: #3b2a63; color: #ede9fe; } }
.rp-key { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; font-weight: 700; color: var(--rp-muted); }
.rp-link-btn.rp-key { color: var(--rp-accent-ink); }
.rp-points { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 .3rem; border-radius: 10px; background: var(--rp-surface-2); font-size: .74rem; font-weight: 700; }
.rp-due { display: inline-flex; align-items: center; gap: .2rem; font-size: .74rem; padding: 0 .35rem; border-radius: 5px; background: var(--rp-surface-2); }
.rp-due-overdue { background: var(--rp-warn-bg); color: var(--rp-warn); font-weight: 700; }
.rp-due-done { background: var(--rp-good-bg); color: var(--rp-good); }
.rp-flag { display: inline-flex; align-items: center; gap: .2rem; font-size: .74rem; font-weight: 700; color: var(--rp-warn); }
.rp-progress { display: inline-block; width: 6rem; height: 8px; border-radius: 4px; background: var(--rp-surface-2); overflow: hidden; vertical-align: middle; }
.rp-progress-bar { display: block; height: 100%; background: var(--rp-accent); }

/* ---------- board */
.rp-columns { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; align-items: start; }
.rp-col { background: var(--rp-col); border: 1px solid var(--rp-line); border-radius: 12px; padding: .5rem; min-width: 0; }
.rp-col-over { border-color: var(--rp-warn); box-shadow: inset 0 3px 0 var(--rp-warn); }
.rp-col-head { display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: center; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; margin: .1rem .2rem .5rem; color: var(--rp-muted); }
.rp-col-count { font-weight: 700; color: var(--rp-ink); }
.rp-wip-warn { display: inline-flex; align-items: center; gap: .2rem; color: var(--rp-warn); text-transform: none; letter-spacing: 0; }
.rp-col-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; min-height: 2.5rem; border-radius: 8px; }
.rp-drop { outline: 2px dashed var(--rp-accent); outline-offset: 2px; }
.rp-col-empty { color: var(--rp-muted); font-size: .84rem; margin: .4rem .2rem; }
.rp-card { background: var(--rp-surface); border: 1px solid var(--rp-line); border-radius: 10px; padding: .5rem .55rem; box-shadow: 0 1px 2px rgb(0 0 0 / .06); cursor: grab; }
.rp-card-done .rp-card-sum { text-decoration: line-through; text-decoration-color: var(--rp-muted); }
.rp-dragging { opacity: .5; }
.rp-card-btn { display: block; width: 100%; text-align: start; font-weight: 600; font-size: .9rem; line-height: 1.35; color: var(--rp-ink); padding: .1rem; overflow-wrap: anywhere; }
.rp-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-top: .4rem; }

/* ---------- backlog */
.rp-backlog-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 280px); gap: 1rem; align-items: start; }
.rp-backlog-main { display: grid; gap: .9rem; min-width: 0; }
.rp-section { background: var(--rp-surface); border: 1px solid var(--rp-line); border-radius: 12px; padding: .6rem .75rem; min-width: 0; }
.rp-section-active { border-color: var(--rp-accent); }
.rp-section-head { display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: center; }
.rp-section-head h3 { margin: 0; font-size: 1rem; }
.rp-goal { margin: .2rem 0 .4rem; font-size: .88rem; }
.rp-rows { list-style: none; margin: .4rem 0; padding: 0; border-radius: 8px; }
.rp-row { display: grid; grid-template-columns: auto auto auto minmax(0, 1fr) auto auto auto auto auto; gap: .45rem; align-items: center; padding: .3rem .35rem; border-bottom: 1px solid var(--rp-line); }
.rp-row:last-child { border-bottom: 0; }
.rp-row:hover { background: var(--rp-surface-2); }
.rp-grip { color: var(--rp-muted); cursor: grab; }
.rp-row-btn { text-align: start; font-weight: 500; overflow-wrap: anywhere; color: var(--rp-ink); }
.rp-row-sprint { max-width: 10rem; font-size: .8rem; min-height: 28px; }
.rp-quick { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .4rem 0; }
.rp-quick .rp-input:not(select) { flex: 1; min-width: 10rem; }
.rp-epics { background: var(--rp-surface); border: 1px solid var(--rp-line); border-radius: 12px; padding: .6rem .75rem; }
.rp-epics h3 { margin: 0 0 .4rem; font-size: 1rem; }
.rp-epics ul { list-style: none; margin: 0; padding: 0; }
.rp-epics li { display: grid; gap: .2rem; padding: .4rem 0; border-bottom: 1px solid var(--rp-line); }

/* ---------- list */
.rp-querybar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.rp-querybar label { font-weight: 700; }
.rp-query { flex: 1; min-width: min(28rem, 100%); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; }
.rp-table-wrap { overflow: auto; max-width: 100%; background: var(--rp-surface); border: 1px solid var(--rp-line); border-radius: 10px; margin: .4rem 0; }
.rp-issue-table { min-width: 860px; }
.rp-issue-table td { white-space: nowrap; }
.rp-issue-table .rp-td-sum { white-space: normal; min-width: 16rem; }
.rp-sort { font-weight: 700; text-decoration: underline dotted; text-underline-offset: 3px; }
tr.rp-selected td { background: var(--rp-sel); }

/* ---------- dashboard */
.rp-dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: .9rem; }
.rp-card-box { background: var(--rp-surface); border: 1px solid var(--rp-line); border-radius: 12px; padding: .7rem .85rem; min-width: 0; }
.rp-card-box h3 { margin: 0 0 .3rem; font-size: 1rem; }
.rp-wide { grid-column: 1 / -1; }
.rp-box-head { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; justify-content: space-between; }
.rp-fig { margin: .3rem 0 0; }
.rp-fig figcaption { font-weight: 600; font-size: .86rem; margin-bottom: .2rem; }
.rp-svg { width: 100%; height: auto; max-height: 340px; display: block; }
.rp-fig-table summary { cursor: pointer; font-size: .86rem; color: var(--rp-accent-ink); font-weight: 600; margin: .3rem 0; }
:root[data-theme="dark"] .rp-chart :is(.rp-ax, text) { fill: #d4dbe5; }
:root[data-theme="dark"] .rp-chart .rp-grid { stroke: #3b4a5e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rp-chart :is(.rp-ax, text) { fill: #d4dbe5; } :root:not([data-theme="light"]) .rp-chart .rp-grid { stroke: #3b4a5e; } }

/* ---------- requests, portal */
.rp-portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: .9rem; }
.rp-intro { font-size: 1rem; max-width: 60ch; }
.rp-req { border-bottom: 1px solid var(--rp-line); padding: .5rem 0; }
.rp-req-head { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; justify-content: space-between; }
.rp-msgs { margin: .3rem 0; display: grid; gap: .3rem; }
.rp-msgs li { padding: .3rem .5rem; border-radius: 8px; background: var(--rp-surface-2); font-size: .88rem; }
.rp-msgs p { margin: .2rem 0 0; }
.rp-msg-team { border-inline-start: 3px solid var(--rp-accent); }
.rp-reply { display: flex; gap: .4rem; align-items: flex-end; margin-top: .3rem; }
.rp-reply textarea { flex: 1; }

/* ---------- dialogs */
.rp-dialog { width: min(560px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 1px solid var(--rp-line); border-radius: 14px; background: var(--rp-surface); color: var(--rp-ink); box-shadow: 0 20px 60px rgb(0 0 0 / .3); }
.rp-dialog::backdrop { background: rgb(10 15 25 / .55); }
.rp-dialog-wide { width: min(1100px, calc(100vw - 2rem)); }
.rp-dialog-head { position: sticky; top: 0; z-index: 2; display: flex; gap: .5rem; align-items: center; justify-content: space-between; padding: .6rem .9rem; background: var(--rp-surface); border-bottom: 1px solid var(--rp-line); }
.rp-dialog-head h2 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.rp-dialog-head h2:focus { outline: none; }
.rp-dialog-lede { margin: .5rem .9rem 0; color: var(--rp-muted); font-size: .9rem; }
.rp-dialog-body { padding: .7rem .9rem 1rem; }
.rp-dialog-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.rp-form { display: grid; gap: .55rem; grid-template-columns: minmax(0, 1fr); }
.rp-form > *, .rp-map, .rp-map > * { min-width: 0; }
.rp-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: .55rem .8rem; }
.rp-span2 { grid-column: 1 / -1; }
.rp-field { display: grid; gap: .2rem; min-width: 0; }
.rp-field > label, .rp-field-label { font-weight: 700; font-size: .82rem; color: var(--rp-muted); }
.rp-field .rp-input { width: 100%; }
.rp-checks { display: flex; flex-wrap: wrap; gap: .3rem .8rem; }
.rp-seg { display: inline-flex; flex-wrap: wrap; gap: .2rem; padding: .2rem; border-radius: 10px; background: var(--rp-surface-2); margin: .3rem 0 .6rem; }
.rp-seg-btn { padding: .3rem .7rem; border-radius: 8px; font-size: .85rem; }
.rp-seg-btn[aria-pressed="true"] { background: var(--rp-surface); box-shadow: 0 1px 3px rgb(0 0 0 / .15); color: var(--rp-accent-ink); }

/* issue dialog */
.rp-issue { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 1.2rem; }
.rp-issue-main h3 { font-size: .95rem; margin: 1rem 0 .35rem; }
.rp-issue-head { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; margin-bottom: .4rem; }
.rp-summary-input { font-size: 1.05rem; font-weight: 700; }
.rp-issue-side { display: grid; gap: .55rem; align-content: start; background: var(--rp-surface-2); border-radius: 12px; padding: .7rem; }
.rp-issue-side .rp-field-value { font-size: .9rem; }
.rp-transitions { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .25rem; }
.rp-transitions .rp-btn { white-space: normal; text-align: start; max-width: 100%; }
.rp-md { overflow-wrap: anywhere; font-size: .92rem; line-height: 1.5; }
.rp-md :is(h3, h4, h5, h6) { margin: .7rem 0 .3rem; font-size: .95rem; }
.rp-md blockquote { margin: .4rem 0; padding: .2rem .7rem; border-inline-start: 3px solid var(--rp-line); color: var(--rp-muted); }
.rp-md-table { overflow: auto; }
.rp-md-box { display: inline-grid; place-items: center; width: 1em; height: 1em; border: 1px solid var(--rp-control); border-radius: 3px; font-size: .8em; }
.rp-md-task { list-style: none; }
.rp-md-preview { border: 1px dashed var(--rp-line); border-radius: 8px; padding: .3rem .6rem; }
.rp-md-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; }
.rp-kids li, .rp-links li { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .25rem 0; border-bottom: 1px solid var(--rp-line); }
.rp-link-type { font-size: .8rem; color: var(--rp-muted); min-width: 7rem; }
.rp-attach li { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; padding: .2rem 0; }
.rp-comment { padding: .5rem 0; border-bottom: 1px solid var(--rp-line); }
.rp-comment-head { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.rp-comment-form { display: grid; gap: .3rem; margin-top: .5rem; position: relative; }
.rp-comment-form > label { font-weight: 700; font-size: .85rem; }
.rp-mentions { list-style: none; margin: 0; padding: .2rem; border: 1px solid var(--rp-line); border-radius: 8px; background: var(--rp-surface); max-width: 20rem; }
.rp-mentions li { padding: .3rem .5rem; border-radius: 6px; cursor: pointer; }
.rp-mentions .rp-men-on { background: var(--rp-sel); }
.rp-mention-pick { max-width: 14rem; justify-self: start; }
.rp-history li { padding: .3rem 0; border-bottom: 1px solid var(--rp-line); font-size: .88rem; }
.rp-sla { font-size: .86rem; padding: .15rem 0; }
.rp-sla-breached { color: var(--rp-warn); font-weight: 700; }
.rp-sla-met { color: var(--rp-good); }
.rp-dates { line-height: 1.6; }

/* settings */
.rp-settings-tabs { position: sticky; top: 3.1rem; z-index: 1; }
.rp-subsection { margin-bottom: 1rem; }
.rp-subsection h3, .rp-wf h3, .rp-form h3 { font-size: 1rem; margin: .8rem 0 .3rem; }
.rp-edit-list li, .rp-status-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .3rem 0; border-bottom: 1px solid var(--rp-line); }
.rp-cf { border: 1px solid var(--rp-line); border-radius: 10px; padding: .5rem .6rem; margin-bottom: .5rem; display: grid; gap: .3rem; }
.rp-cf-head { display: flex; gap: .5rem; align-items: center; }
.rp-matrix td { text-align: center; }
.rp-matrix input { width: 18px; height: 18px; }
.rp-tr { border: 1px solid var(--rp-line); border-radius: 10px; padding: .5rem .6rem; margin-bottom: .5rem; display: grid; gap: .35rem; }
.rp-tr-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.rp-colset { border: 1px solid var(--rp-line); border-radius: 10px; padding: .5rem .6rem; margin-bottom: .5rem; }
.rp-wf-diagram { background: var(--rp-col); border: 1px solid var(--rp-line); border-radius: 10px; overflow-x: auto; }
.rp-wf-svg { width: 100%; min-width: 600px; height: auto; display: block; font-family: system-ui, sans-serif; font-size: 13px; }
.rp-wf-band { fill: var(--rp-muted); font-weight: 700; font-size: 12px; }
.rp-wf-edge { fill: none; stroke: var(--rp-control); stroke-width: 1.6; }
.rp-wf-dim { opacity: .2; }
.rp-wf-arrowhead { fill: var(--rp-control); }
.rp-wf-any { fill: var(--rp-muted); font-size: 11px; }
.rp-wf-node { cursor: pointer; }
.rp-wf-node rect { fill: var(--rp-todo-bg); stroke: var(--rp-control); stroke-width: 1.2; }
.rp-wf-node text { fill: var(--rp-todo-ink); font-weight: 700; }
.rp-wf-node.rp-cat-inprogress rect { fill: var(--rp-prog-bg); } .rp-wf-node.rp-cat-inprogress text { fill: var(--rp-prog-ink); }
.rp-wf-node.rp-cat-done rect { fill: var(--rp-done-bg); } .rp-wf-node.rp-cat-done text { fill: var(--rp-done-ink); }
.rp-wf-node.rp-wf-sel rect { stroke: var(--rp-accent); stroke-width: 3; }
.rp-wf-node:focus { outline: none; }
.rp-wf-node:focus-visible rect { stroke: var(--rp-focus); stroke-width: 4; }
.rp-tpl-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: .6rem; }
.rp-tpl { display: grid; gap: .3rem; width: 100%; text-align: start; padding: .7rem .8rem; border: 1px solid var(--rp-line); border-radius: 12px; background: var(--rp-surface); font-weight: 400; }
.rp-tpl:hover { border-color: var(--rp-accent); }
.rp-tpl strong { color: var(--rp-accent-ink); }
.rp-recent li, .rp-notices li { padding: .4rem 0; border-bottom: 1px solid var(--rp-line); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

/* teams read-only notice inside the app */
.rp-app > .uwt-readonly { margin: 0; border-radius: 0; }

@media (forced-colors: active) {
  .rp-lozenge, .rp-chip, .rp-points, .rp-due { border: 1px solid CanvasText; }
  .rp-wf-node rect { stroke: CanvasText; }
}
@media (prefers-reduced-motion: reduce) { .rp-app *, .rp-dialog * { transition: none !important; animation: none !important; } }
@media (max-width: 900px) {
  .rp-backlog-grid, .rp-issue { grid-template-columns: minmax(0, 1fr); }
  .rp-row { grid-template-columns: auto auto minmax(0, 1fr) auto auto; }
  .rp-row .rp-grip, .rp-row .rp-chip-epic, .rp-row .rp-prio { display: none; }
  .rp-row .rp-row-sprint { grid-column: 3 / -1; }
}
@media (max-width: 640px) {
  .rp-toolbar { padding: .35rem .5rem; }
  .rp-title { max-width: 100%; }
  .rp-main { padding: .5rem .5rem 1rem; }
  .rp-tab span:not(.rp-sr) { font-size: .82rem; }
  .rp-tab-key { display: none; }
  .rp-columns { grid-auto-columns: minmax(78vw, 1fr); }
  .rp-query { min-width: 100%; }
  .rp-dialog, .rp-dialog-wide { width: calc(100vw - 1rem); max-height: calc(100vh - 1rem); }
  .rp-settings-tabs { position: static; }
}
@media print {
  .rp-toolbar, .rp-tabs, .rp-status, .rp-filterbar, .rp-quick, .rp-row-sprint { display: none !important; }
  .rp-main { overflow: visible; }
  .rp-columns { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); }
}

/* ================================================================ Rapport-specific parts */
.rp-col-head h3 { margin: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--rp-ink); }
.rp-col-sum, .rp-col-w { text-transform: none; letter-spacing: 0; font-size: .78rem; }
.rp-col-w { flex-basis: 100%; color: var(--rp-muted); }
.rp-col-won { border-top: 3px solid var(--rp-good); }
.rp-col-lost { border-top: 3px solid var(--rp-control); }
.rp-col-open { border-top: 3px solid var(--rp-accent); }
.rp-columns { grid-auto-columns: minmax(230px, 1fr); }
.rp-card-closed { background: var(--rp-surface-2); }
.rp-card-co { color: var(--rp-muted); font-size: .8rem; flex-basis: 100%; overflow-wrap: anywhere; }
.rp-money { font-weight: 700; font-size: .84rem; font-variant-numeric: tabular-nums; }
.rp-avatar[data-c="0"] { background: #0e7490; } .rp-avatar[data-c="1"] { background: #7c3aed; } .rp-avatar[data-c="2"] { background: #b45309; } .rp-avatar[data-c="3"] { background: #15803d; }
.rp-avatar[data-c="4"] { background: #be123c; } .rp-avatar[data-c="5"] { background: #1d4ed8; } .rp-avatar[data-c="6"] { background: #4d7c0f; } .rp-avatar[data-c="7"] { background: #a21caf; }
.rp-avatar { margin-inline-start: auto; }
.rp-tags { display: inline-flex; flex-wrap: wrap; gap: .2rem; }
.rp-stage { display: inline-block; padding: .05rem .45rem; border-radius: 5px; font-size: .78rem; font-weight: 700; background: var(--rp-prog-bg); color: var(--rp-prog-ink); white-space: nowrap; }
.rp-stage-won, .rp-q-accepted { background: var(--rp-done-bg); color: var(--rp-done-ink); }
.rp-stage-lost, .rp-q-declined { background: var(--rp-todo-bg); color: var(--rp-todo-ink); }
.rp-q-draft { background: var(--rp-chip); color: var(--rp-ink); }
.rp-wide-table { min-width: 860px; }
.rp-table td, .rp-table th { white-space: nowrap; }
.rp-table td:has(.rp-link-btn) { white-space: normal; min-width: 10rem; }
.rp-quiet { font-weight: 500; }
.rp-check-in { width: 18px; height: 18px; }
.rp-selected td { background: var(--rp-sel); }
.rp-bulk { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .4rem .6rem; margin: .3rem 0; border-radius: 10px; background: var(--rp-sel); }
.rp-search { min-width: min(16rem, 100%); }
.rp-sort { font-weight: 700; color: var(--rp-ink); }
.rp-section { margin-bottom: .8rem; }
.rp-section h3 { margin: 0 0 .3rem; font-size: 1rem; }
.rp-acts { display: grid; gap: .1rem; }
.rp-act { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .55rem; padding: .35rem .2rem; border-bottom: 1px solid var(--rp-line); }
.rp-act input[type=checkbox] { width: 18px; height: 18px; }
.rp-act-type { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--rp-surface-2); color: var(--rp-accent-ink); }
.rp-act-subj { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.rp-act-done .rp-act-subj { text-decoration: line-through; text-decoration-color: var(--rp-muted); }
.rp-act .rp-avatar { margin-inline-start: 0; }
.rp-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: .6rem; margin: .4rem 0 .9rem; }
.rp-metric { background: var(--rp-surface); border: 1px solid var(--rp-line); border-radius: 12px; padding: .55rem .75rem; min-width: 0; }
.rp-metric-label { color: var(--rp-muted); font-size: .8rem; font-weight: 600; }
.rp-metric-value { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rp-svg-holder { overflow-x: auto; position: relative; }
.rp-svg { width: 100%; height: auto; max-height: 320px; display: block; min-width: 0; }
:root[data-theme="dark"] .rp-chart :is(.rp-ax, text) { fill: #d4dbe5; }
:root[data-theme="dark"] .rp-chart .rp-grid { stroke: #3b4a5e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rp-chart :is(.rp-ax, text) { fill: #d4dbe5; } :root:not([data-theme="light"]) .rp-chart .rp-grid { stroke: #3b4a5e; } }
.rp-seglist { display: grid; gap: .5rem; }
.rp-segrow { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; padding: .6rem .75rem; background: var(--rp-surface); border: 1px solid var(--rp-line); border-radius: 12px; }
.rp-segrow > div { flex: 1 1 18rem; min-width: 0; overflow-wrap: anywhere; }
.rp-rules { display: grid; gap: .4rem; }
.rp-rules > .rp-btn { justify-self: start; }
.rp-rule { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.rp-rule .rp-input:last-of-type { flex: 1; min-width: 8rem; }
.rp-record { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, 1fr); gap: 1.2rem; }
.rp-record-side { display: grid; gap: .35rem; align-content: start; background: var(--rp-surface-2); border-radius: 12px; padding: .7rem; min-width: 0; }
.rp-record-side h3 { font-size: .95rem; margin: .7rem 0 .1rem; }
.rp-record-side h3:first-of-type { margin-top: .2rem; }
.rp-record-side .rp-plain li { padding: .2rem 0; overflow-wrap: anywhere; }
.rp-timeline { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--rp-line); }
.rp-timeline li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .45rem; align-items: start; padding: .3rem 0 .3rem .1rem; margin-inline-start: -11px; font-size: .88rem; }
.rp-tl-dot { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--rp-surface); border: 1px solid var(--rp-line); color: var(--rp-accent-ink); }
.rp-tl-text { overflow-wrap: anywhere; }
.rp-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.rp-chips .rp-chip { font-size: .82rem; padding: .1rem .2rem .1rem .5rem; max-width: 100%; }
.rp-chips .rp-icon-btn { width: 24px; height: 24px; }
.rp-rels .rp-plain li { display: flex; gap: .3rem; align-items: center; justify-content: space-between; }
.rp-btn-good { border-color: var(--rp-good); color: var(--rp-good); }
.rp-dl { display: grid; grid-template-columns: auto auto; justify-content: end; gap: .2rem 1.2rem; margin: .4rem 0; font-variant-numeric: tabular-nums; }
.rp-dl dt { text-align: end; color: var(--rp-muted); }
.rp-dl dd { margin: 0; text-align: end; }
.rp-dl .rp-total { font-weight: 800; color: var(--rp-ink); font-size: 1.05rem; border-top: 1px solid var(--rp-line); padding-top: .2rem; }
.rp-lines { min-width: 820px; }
.rp-lines td { white-space: normal; }
.rp-lines td:nth-child(2) .rp-input { min-width: 12rem; width: 100%; }
.rp-num-in { width: 6rem; }
.rp-dupgroup { display: grid; gap: .3rem; }
.rp-dupgroup > .rp-btn { justify-self: start; }
.rp-dupgroup .rp-check { overflow-wrap: anywhere; align-items: flex-start; }
.rp-export li { padding: .25rem 0; }
.rp-map .rp-form-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.rp-plset { margin-bottom: .8rem; }
.rp-settings-tabs { position: static; }
.rp-ws-chip:empty { display: none; }
.rp-dialog-wide { width: min(1180px, calc(100vw - 2rem)); }
@media (max-width: 900px) { .rp-record { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .rp-columns { grid-auto-columns: minmax(80vw, 1fr); } .rp-metric-value { font-size: 1.15rem; } .rp-search { min-width: 100%; } }
@media print { .rp-bulk, .rp-seg, .rp-search { display: none !important; } }
.rp-filterbar .rp-input { font-size: .88rem; min-height: 34px; padding: .2rem .45rem; max-width: 100%; }
.rp-filterbar select.rp-input { max-width: 15rem; }
.rp-seg-btn { display: inline-flex; align-items: center; gap: .3rem; }
.rp-view-head .rp-filterbar { flex: 1 1 100%; margin: .2rem 0 0; }
.rp-form-grid { align-items: start; }
.rp-dash { grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); }
.rp-form > .rp-btn, .rp-record-side > .rp-btn { justify-self: start; }
