/* Page layout (build 40): four-page menu, grouped Set-up tabs, one day-page button row with "More",
   a tab per group on the day page, and calm group charts (strong red stays in the headline and whole-day strip).
   Own file so it can change without touching app.css. Same layers and tokens as app.css. */
@layer views {

  /* menu: section labels "Every day" / "Set-up" */
  .sidebar .nav .sb-label { margin: 14px 0 4px var(--space-2); }
  .sidebar .nav .sb-label:first-child { margin-top: 0; }
  .bottomnav .sb-label { display: none; }

  /* Set-up: tabs in three labelled sets, all on one line at laptop width */
  .tabsets { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
  .tabset { display: grid; gap: 4px; }
  .tabset > small { font-size: 12px; color: var(--muted); padding-left: 4px; }
  .tabset .tabs { margin: 0; }
  .subhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
  .subhead h2 { margin: 0; }
  .pagetabs { margin-bottom: 14px; }

  /* Groups list: Edit buttons line up along the bottom of each row */
  .gitem { grid-template-rows: auto auto 1fr auto; }

  /* day page: one row of buttons, "More" at the right */
  .dayactions { align-items: center; }
  .dayactions .more { margin-left: auto; position: relative; }
  .more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); box-shadow: var(--shadow); font-weight: 500; user-select: none; }
  .more > summary::-webkit-details-marker { display: none; }
  .more[open] > summary { border-color: var(--blue); }
  .moremenu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 230px; display: grid; gap: 2px; padding: 6px;
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 28px rgb(0 0 0 / .14); }
  .moremenu button { justify-content: flex-start; text-align: left; border: 0; box-shadow: none; background: transparent; white-space: nowrap; }
  .moremenu button:hover { background: var(--soft); transform: none; }

  /* day page: a tab per group */
  .gtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0 0; }
  .gtabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--radius);
    background: var(--soft); border: 1px solid var(--line); box-shadow: none; color: var(--muted); font-weight: 600; }
  .gtabs button:hover { background: var(--bg); color: var(--ink); transform: none; }
  .gtabs button.on { background: var(--bg); color: var(--ink); border-color: var(--gc, var(--navy)); box-shadow: inset 0 -3px 0 var(--gc, var(--navy)), var(--shadow); }
  .gtabs .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gc); display: inline-block; }
  .gtabs .gb { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
  .gtabs .gb.short { background: var(--redbg); color: var(--red); }
  .gtabs .gb.ok { background: var(--greenbg); color: var(--green); }
  .gtabs .gb.norule { background: var(--red); color: #fff; }
  .gtabs + .timeline { margin-top: 10px; }
  .gcard.gtab-off { display: none; }
  @media print { .gtabs, .more { display: none !important; } .gcard.gtab-off { display: block; } }

  /* the three boxes under the groups: equal height, in a row */
  .panels { align-items: stretch; }
  .panels > * { height: 100%; box-sizing: border-box; }

  /* calm group charts: the group's own pastel colour, with only a soft red/green for short vs covered */
  .gcard { border-top-color: var(--gc); }
  .gcard .seg.work:not(.ext):not(.in) { background: color-mix(in srgb, var(--gc, #999) 55%, var(--bg)); color: var(--ink); }
  .timeline .cell.red { background: var(--redbg); color: var(--red); box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--red) 55%, transparent); }
  .timeline .cell.red.q { box-shadow: inset 0 -3px 0 var(--navy-deep); }
  .timeline .cell.amber { background: #f1ece4; color: var(--ink); }
  .timeline .cell.green { background: color-mix(in srgb, var(--greenbg) 80%, var(--bg)); }
  .gcard header .pill.red { background: var(--redbg); color: var(--red); }

  /* phone: group tabs scroll sideways in one row instead of wrapping */
  @media (max-width: 640px) {
    .gtabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
    .gtabs button { flex: none; }
    .tabsets { gap: 8px; }
    .tabset, .tabset .tabs { width: 100%; }
  }
}
