/* Underhållsplan · avgränsad läs- och arbetsyta. Inga motor-/utskriftsregler ändras.
   Semantiska tokens följer appens ljusa och mörka tema. */
@media screen {
  .up-workspace { min-width:0; }
  .up-workspace .page-head { margin-bottom:20px; align-items:flex-start; }
  .up-workspace .page-head h1 { overflow-wrap:anywhere; }
  .up-workspace .page-head .sub { line-height:1.65; }
  .up-workspace .page-head .toolbar { align-items:center; }
  .up-workspace .up-context { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; color:var(--ink-2); font-size:14px; line-height:1.6; overflow-wrap:anywhere; }
  .up-workspace .up-context strong { color:var(--ink); font-weight:600; }
  .up-workspace .up-context > span { color:var(--muted); font-size:13px; }
  .up-workspace :is(.btn,.seg button,select,.plan-notice-details summary) { min-height:44px; }
  .up-workspace :is(button,select,input,summary,[tabindex]):focus-visible { outline:2px solid var(--brand); outline-offset:3px; border-radius:8px; }
  .up-workspace .up-summary { gap:16px; margin-bottom:20px; }
  .up-workspace .up-summary .card.stat { padding:20px; min-width:0; min-height:0; }
  .up-workspace .up-summary .val { font-size:clamp(25px,2.5vw,32px); margin-top:12px; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
  .up-workspace .up-summary .label { line-height:1.5; }
  .up-workspace .up-summary .meta { margin-top:8px; line-height:1.65; font-size:12px; }
  .up-workspace .plan-notice-lead { line-height:1.65; }
  .up-workspace .plan-notice-scope { font-size:13px; line-height:1.65; }
  .up-workspace .plan-notice-details summary { padding-block:12px; box-sizing:border-box; font-size:13px; }
  .up-workspace .up-filters {
    display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px 16px;
    margin:20px 0 12px; padding:16px; border:1px solid var(--line);
    border-radius:var(--radius); background:var(--card);
  }
  .up-workspace .up-filters .seg { flex:0 1 auto; }
  .up-workspace .up-filters .seg button { padding:10px 12px; font-size:13px; white-space:normal; }
  .up-workspace .up-filters .plan-filt-f { display:flex; flex-direction:column; align-items:flex-start; gap:6px; flex:1 1 180px; min-width:0; }
  .up-workspace .up-filters .plan-filt-f > .t-cat { font-size:12px; line-height:1.5; color:var(--ink-2); }
  .up-workspace .up-filters select {
    width:100%; max-width:100%; min-width:0; box-sizing:border-box; padding:10px 12px;
    border:1px solid var(--line); border-radius:var(--radius-sm); color:var(--ink);
    background:var(--field); font:inherit; font-size:13px; line-height:1.4;
  }
  .up-workspace .up-year-toggle { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin:16px 0 12px; }
  .up-workspace .up-year-toggle .seg { max-width:100%; flex-wrap:wrap; }
  .up-workspace .up-year-toggle .seg button { padding:10px 12px; white-space:normal; }
  .up-workspace #upResultStatus { color:var(--muted); font-size:13px; line-height:1.6; font-variant-numeric:tabular-nums; }
  .up-workspace .up-table-wrap { min-width:0; margin-bottom:20px; }
  .up-workspace .up-table { width:100%; }
  .up-workspace .up-table :is(th,td) { padding:16px 12px; vertical-align:top; }
  .up-workspace .up-table th { line-height:1.5; white-space:normal; }
  .up-workspace .up-table .num { font-variant-numeric:tabular-nums; }
  .up-workspace .up-table tr[id^=py] > td:first-child { min-width:88px; white-space:nowrap; }
  .up-workspace .up-table tr[id^=py] > td:first-child b { font-size:17px; font-weight:600; }
  .up-workspace .up-table tr[id^=py] > td:first-child .t-cat { display:block; margin-top:4px; font-size:12px; }
  .up-workspace .up-table tr[id^=py] { scroll-margin-top:88px; }
  .up-workspace .up-table tr[id^=py]:focus-visible { outline-offset:-2px; box-shadow:inset 0 0 0 2px var(--brand); }
  .up-workspace .up-table .t-group td { padding-block:12px; background:var(--soft); color:var(--ink-2); font-size:13px; font-weight:550; }
  .up-workspace .up-table .t-sum td { padding-block:20px; border-top:1px solid var(--line); background:var(--soft); }
  .up-workspace .up-item {
    display:flex; align-items:center; justify-content:space-between; gap:8px 16px;
    width:100%; min-width:0; min-height:44px; box-sizing:border-box; margin:0 0 8px;
    padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius-sm);
    background:var(--card); color:var(--ink); font:inherit; font-size:13px; line-height:1.5;
    text-align:left; cursor:pointer;
  }
  .up-workspace .up-item:last-child { margin-bottom:0; }
  .up-workspace .up-item:hover { background:var(--field); border-color:var(--brand-kant,var(--line)); }
  .up-workspace .up-item-name { flex:1 1 auto; min-width:0; overflow-wrap:anywhere; font-weight:500; }
  .up-workspace .up-item-cost { flex-shrink:0; color:var(--ink-2); font-weight:500; font-variant-numeric:tabular-nums; white-space:nowrap; }
  .up-workspace .up-readonly { padding:24px; line-height:1.65; }
  .up-workspace .up-readonly h2 { margin:0 0 8px; font-size:21px; line-height:1.35; }
  .up-workspace .up-readonly p { max-width:76ch; margin:0 0 16px; }
  .up-workspace [hidden] { display:none!important; }

  @media (max-width:1180px) and (min-width:861px) {
    .up-workspace .up-table :is(th,td) { padding-inline:10px; }
    .up-workspace .up-item { flex-wrap:wrap; gap:4px 12px; }
  }
  @media (max-width:860px) {
    .up-workspace .page-head .toolbar { flex-wrap:wrap; gap:8px; }
    .up-workspace .page-head .toolbar .btn { white-space:normal; }
    .up-workspace .up-filters { align-items:stretch; padding:12px; gap:12px; }
    .up-workspace .up-filters > .seg { flex:1 1 100%; display:flex; }
    .up-workspace .up-filters > .seg button { flex:1 1 auto; }
    .up-workspace .up-filters .plan-filt-f { flex:1 1 180px; }
    .up-workspace .up-filters select { font-size:16px; }
    .up-workspace .up-year-toggle .seg { width:100%; }
    .up-workspace .up-year-toggle .seg button { flex:1 1 auto; }
    .up-workspace .up-table-wrap { overflow:visible; }
    .up-workspace .up-table[data-stack] { width:100%; min-width:0!important; }
    .up-workspace .up-table[data-stack] tr { margin-bottom:12px; padding:16px; }
    .up-workspace .up-table[data-stack] td { padding:10px 0; font-size:14px; }
    .up-workspace .up-table[data-stack] td::before { font-size:12px; font-weight:500; line-height:1.5; }
    .up-workspace .up-table[data-stack] tr[id^=py] > td:first-child { min-width:0; }
    .up-workspace .up-table[data-stack] tr[id^=py] > td:first-child b { font-size:21px; }
    .up-workspace .up-table[data-stack] tr[id^=py] > td:first-child .t-cat { display:inline; margin:0 0 0 8px; }
    .up-workspace .up-table[data-stack] .stack-block { padding-block:12px; }
    .up-workspace .up-table[data-stack] .stack-block::before { margin-bottom:8px; }
    .up-workspace .up-table[data-stack] .t-group { background:var(--soft); border:1px solid var(--line); }
    .up-workspace .up-table[data-stack] .t-group td { background:transparent; border:0; padding:6px 0; }
    .up-workspace .up-table[data-stack] .t-group td:first-child { display:block; padding-top:0; text-align:left; }
    .up-workspace .up-table[data-stack] .t-sum { background:var(--soft); }
    .up-workspace .up-table[data-stack] .t-sum td { padding-block:8px; border:0; background:transparent; }
    .up-workspace .up-item { flex-wrap:wrap; gap:4px 12px; padding:12px; min-height:44px; }
    .up-workspace .up-item-name { flex-basis:100%; }
    .up-workspace .up-item-cost { margin-left:auto; }
    .up-workspace .plan-notice-controls { align-items:center; gap:8px 12px; }
  }
  @media (max-width:380px) {
    .up-workspace .up-filters .plan-filt-f { flex-basis:100%; }
    .up-workspace .up-filters > .btn { width:100%; }
    .up-workspace .up-table[data-stack] tr { padding-inline:12px; }
    .up-workspace .up-item { padding:10px; }
  }
  @media (prefers-reduced-motion:reduce) {
    .up-workspace .up-item { transition:none; }
    .up-workspace .up-table tr { scroll-behavior:auto; }
  }
}
