/* Today as group tiles + the group side panel (js/ui-day-tiles.js, js/ui-day-panel.js). */
@layer views {
  /* top row: date, Day/Week, More */
  .datebar .more { position: relative; }
  .datebar .wkswitch + .more, .datebar .more:first-child { margin-left: 0; }
  .moremenu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }

  /* one-line headline with Fråga Kollen beside it */
  .summary.slim { padding: 12px 18px; gap: 12px 20px; }
  .summary.slim .sumtext { flex: 1 1 320px; }
  .summary.slim h1 { font-size: clamp(18px, 2vw, 22px); line-height: 1.25; margin: 0; }
  .summary.slim .sumsub { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
  .summary.slim .kcta { flex: 0 0 auto; }
  .summary.slim .kcta button.kollen { min-height: 46px; padding: 8px 22px; font-size: 16px; width: auto; }
  .summary.slim .kcta .small { display: none; }

  /* the round group picture */
  .glogo { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--disc); color: var(--navy-ink, #112d4e);
    display: inline-grid; place-items: center; box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--line); }
  .glogo svg { width: 70%; height: 70%; }
  .glogo b { font-size: 22px; font-weight: 650; color: var(--fvk-navy-ink); }
  .glogo.big { width: 84px; height: 84px; }
  .glogo.big b { font-size: 36px; }
  .logopick { display: flex; align-items: center; gap: 14px; margin: 4px 0 8px; }
  .logopick > label { flex: 1; min-width: 0; }

  /* tiles: equal width and height, names line up row by row */
  .thint { margin: 4px 0 10px; }
  .tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); grid-auto-rows: 1fr; margin-bottom: 24px; }
  .gtile { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px 16px 12px; }
  .gtile::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--gc); opacity: .85; }
  .gtile header { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
  .gtile .tlogo { all: unset; cursor: pointer; border-radius: 50%; }
  .gtile .tlogo:focus-visible, .gtile .tgname:focus-visible, .gtile .tfoot:focus-visible, .tname:focus-visible { outline: var(--focus-ring); outline-offset: 3px; }
  .gtile h2 { margin: 6px 0 0; font-size: 21px; line-height: 1.2; }
  .gtile .tgname { all: unset; cursor: pointer; color: var(--ink); font-weight: 650; }
  .gtile header small { color: var(--muted); font-size: 13px; }
  .tnames { list-style: none; margin: 10px 0 0; padding: 0; flex: 1; display: grid; grid-auto-rows: 58px; align-content: start; }
  .tnames li { display: grid; grid-template-rows: auto 18px; align-content: center; justify-items: center; row-gap: 2px; border-bottom: 1px dashed #ece7e1; min-width: 0; }
  .tname { all: unset; cursor: pointer; max-width: 100%; color: #8a94a0; font-size: 18px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 4px 6px; border-radius: 6px; }
  .tname:hover { color: var(--ink); background: var(--soft); }
  .tnames small { color: #a3abb5; font-size: 12px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tnames em.tabsent { font-style: normal; font-size: 12px; line-height: 18px; font-weight: 600; color: #7b6a4e; background: #f4ece0; border-radius: 6px; padding: 0 6px; white-space: nowrap; }
  .tnames li.gone .tname { text-decoration: line-through; color: #b6bcc4; }
  .tnone { flex: 1; text-align: center; margin: 18px 0; }
  .tfoot { all: unset; cursor: pointer; display: grid; gap: 8px; justify-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
  .tbar { position: relative; display: block; width: 100%; padding-bottom: 14px; }
  .ttrack { position: relative; display: block; height: 10px; border-radius: 5px; background: #e8e3dc; overflow: hidden; }
  .ttrack i { position: absolute; top: 0; bottom: 0; background: var(--red); }
  .thours { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; }
  .thours b, .sprow.axis b { position: absolute; transform: translateX(-50%); font-size: 11px; font-weight: 500; color: #98a1ac; line-height: 12px; }

  /* group side panel */
  .gpscrim { position: fixed; inset: 0; background: rgb(13 35 64 / .35); z-index: 36; }
  .gpanel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 37; width: min(500px, 100vw); box-sizing: border-box; overflow-y: auto;
    background: var(--page); border-left: 6px solid var(--gc); box-shadow: -12px 0 40px rgb(13 35 64 / .2); padding: 18px 20px 28px;
    display: flex; flex-direction: column; gap: 12px; }
  .gpanel > * { flex: none; }
  .gtile .pill.red, .gpanel .gphead .pill.red { background: var(--redbg); color: var(--red); }
  .gpanel.wide { width: min(1040px, 100vw); }
  .gphead { position: relative; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding-right: 52px; }
  .gptitle { flex: 1 1 150px; min-width: 0; display: grid; }
  .gptitle h2 { margin: 0; font-size: 22px; }
  .gptitle small { color: var(--muted); }
  .gpx { position: absolute; top: 0; right: 0; min-height: 44px; min-width: 44px; }
  .gpacts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .gpacts button { min-height: 46px; }
  .gpneed { margin: 0; padding: 12px 14px; border-radius: var(--radius); background: var(--redbg); color: var(--red); display: grid; gap: 8px; }
  .gpneed ul { margin: 0; padding-left: 18px; font-weight: 600; }
  .gpneed .kollen { justify-content: center; min-height: 46px; }
  .gpneed .small { color: #7a4a52; }
  .gpneed.ok { background: var(--greenbg); color: var(--green); font-weight: 600; }
  .spchart { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 8px; }
  .sprow { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 8px; min-height: 26px; }
  .sprow.axis { min-height: 14px; }
  .spname { all: unset; cursor: pointer; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  button.spname:hover { color: var(--ink); text-decoration: underline; }
  .sprow.miss .spname { color: var(--red); font-weight: 600; cursor: default; }
  .sprow.gone .spname { text-decoration: line-through; }
  .sptrack { position: relative; height: 14px; background: var(--soft); border-radius: 4px; }
  .sprow.axis .sptrack { background: none; }
  .sptrack i { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
  .sptrack s { position: absolute; top: 0; bottom: 0; border-radius: 3px; text-decoration: none; }
  .sptrack s.work { background: color-mix(in srgb, var(--gc) 55%, white); }
  .sptrack s.break { background: repeating-linear-gradient(45deg, #ddd8d1 0 3px, #fff 3px 6px); }
  .sptrack s.plan { background: var(--bg); outline: 1px dashed #9aa3ad; outline-offset: -1px; }
  .sptrack s.absent { background: repeating-linear-gradient(45deg, #e9e3da 0 3px, #f7f4ef 3px 6px); }
  .sptrack s.gap { background: var(--red); }
  .gptoggle { align-self: flex-start; }
  .gpfull .gcard { margin: 0; }
  .gpfull .gcard > header { display: none; }
  .gpanel.wide .gpacts { grid-template-columns: repeat(4, 1fr); }
  .gppanels { display: grid; gap: 12px; }
  .gppanels .panel { margin: 0; }
  .moredlg .panels { display: grid; gap: 12px; margin: 8px 0; }
  .moredlg textarea { width: 100%; box-sizing: border-box; }

  /* Leadership: the detail one press away */
  .lmorebtn { display: grid; justify-items: start; gap: 2px; width: 100%; text-align: left; padding: 14px 18px; min-height: 56px;
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); margin: 4px 0 16px; }
  .lmore { margin: 0 0 16px; }

  /* Staff page: everyone under their group, like the tiles */
  .stbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
  .stbar .search { flex: 1 1 240px; max-width: 360px; margin: 0; }
  .stgrid { grid-auto-rows: auto; }
  .stcard header { flex-direction: row; justify-content: flex-start; text-align: left; gap: 12px; }
  .stcard header > div { display: grid; min-width: 0; }
  .stcard header h2 { margin: 0; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .stcard .glogo { width: 44px; height: 44px; box-shadow: none; }
  .stnames { list-style: none; margin: 10px 0 0; padding: 0; display: grid; }
  .stnames li { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #ece7e1; min-width: 0; }
  .stnames .tname { padding: 4px 6px; margin-left: -6px; font-size: 16px; color: var(--ink); }
  .stnames small { color: var(--muted); font-size: 13px; white-space: nowrap; }

  /* have/need in a chart cell on one line: "3/4" (Baz, 29 Nov 2026) */
  .row.cov .cell { display: flex; align-items: center; justify-content: center; white-space: nowrap; }
  .row.cov .cell small { font-size: inherit; font-weight: 500; opacity: .75; }

  @media (max-width: 640px) {
    .tiles { grid-template-columns: 1fr; grid-auto-rows: auto; }
    .tnames { grid-template-columns: 1fr 1fr; column-gap: 10px; grid-auto-rows: 56px; }
    .tname { font-size: 17px; }
    .gpanel { border-left: 0; border-top: 6px solid var(--gc); padding: 14px 14px 90px; }
    .sprow { grid-template-columns: 84px 1fr; }
    .summary.slim .kcta, .summary.slim .kcta button.kollen { width: 100%; }
    /* date row on top, Day/Week and More share the second row */
    .datebar:has(.more) { flex-wrap: wrap; }
    .datebar:has(.more) .wkswitch { flex: 1 1 60%; order: 9; }
    .datebar .more { order: 10; }
    .datepick input { min-width: 0; }
  }
  @media print { .gpanel, .gpscrim, .thint, .tfoot { display: none !important; } .tiles { grid-template-columns: repeat(2, 1fr); } }
  /* Vikariepool card on the Staff page (js/ui-subpool.js): name + role, then when they can work + take out */
  .poolnames li { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: 0; }
  .poolnames .prow { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
  .poolnames .pav { white-space: normal; flex: 1 1 auto; min-width: 0; }
  .poolnames .link { white-space: nowrap; padding: 2px 0; flex: none; }
  .poolbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
  .poolbtns select { flex: 1 1 160px; min-width: 0; }
}
