/* The frame and the grid: the rail, the bar, the page and its regions. */
/* ------------------------------------------------------------------ the frame of a working page */
.frame { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--s-7); padding: var(--s-6) var(--s-6) var(--s-6) var(--s-7); border-right: 1px solid var(--line); }
.rail .where { display: block; margin-top: var(--s-1); font-size: var(--t-small); color: var(--soft); }
.rail nav a { display: flex; align-items: center; gap: var(--s-3); min-height: 40px; border-radius: var(--radius-ctl); color: var(--n-7); text-decoration: none; }   /* the kind's square and the word */   /* the kind's square, the word, and where you are */
.rail nav a[aria-current] { color: var(--ink); background: var(--n-1); box-shadow: calc(-1 * var(--s-2)) 0 0 var(--n-1), var(--s-2) 0 0 var(--n-1); }   /* the ground reaches past the square and the word on both sides without moving them or widening the rail */   /* where you are: the row as one, not a dot at its far end (Bishop, round 7) */
.rail .you { margin: auto calc(-1 * var(--s-2)) 0; font-size: var(--t-small); color: var(--soft); display: grid; gap: var(--s-1); }   /* off-grid: wider than the menu's text by the row's own padding, so the hover reaches the menu's edge and the block holds its rows (pixel-audit: the row hung 8px out of it) */
.rail .you > form { padding-inline: var(--s-2); }
.rail .you a { color: var(--ink); margin-top: var(--s-2); justify-self: start; }
/* the name leads to one's own settings (2026-11-19): a row like the menu's, its second line saying where it goes */
.rail .you .you__me { margin: 0; padding: var(--s-2); border-radius: var(--radius); text-decoration: none; align-self: stretch; justify-self: stretch; }   /* off-grid: the row's hover reaches the menu's own edge */
.rail .you .you__me > span { min-width: 0; }
.rail .you .you__me small { display: block; color: var(--soft); font-size: var(--t-small); white-space: nowrap; }
.rail .you .you__me:hover, .rail .you .you__me[aria-current="page"] { background: var(--n-1); }
.bar__me { display: inline-flex; border-radius: 50%; }
.bar { display: flex; align-items: center; gap: var(--s-4); min-height: 72px; padding: var(--s-3) var(--gut); border-bottom: 1px solid var(--line); }
.bar__top { display: none; }
.find { flex: none; width: calc((min(100%, var(--content)) - 11 * var(--gutter)) / 12 * 8 + 7 * var(--gutter)); display: flex;   /* the work column's width: the bar and the page share its right edge (Bishop) */
   align-items: center; gap: var(--s-3); min-height: calc(var(--ctl-sm) + 8px); padding: 0 var(--s-3); border: 1px solid var(--line); border-radius: var(--radius-ctl); background: var(--white); color: var(--quiet); padding-right: var(--s-2); }
.find .short { display: none; }
.find kbd { margin-left: auto; font: var(--t-label)/1 var(--text); letter-spacing: .04em; padding: var(--s-1) var(--pad-chip-tight); border: 1px solid var(--line); border-radius: var(--radius); }
.page { padding: var(--s-8) var(--gut) var(--s-9); display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: var(--gutter); row-gap: var(--gap-section); align-content: start; max-width: calc(var(--content) + 2 * var(--gut)); }
/* the work column: eight of twelve, the same x and width on every page; a wide page (lists, the schedule) uses all twelve */
.page > * { grid-column: 1 / span 8; min-width: 0; }
.page.wide > * { grid-column: 1 / -1; }
.page.wide > .in-work, .page.wide > .form { grid-column: 1 / span 8; max-width: none; }   /* on a wide page, what is read or filled in goes in the work column; a form ends on its grid line, not at a width of its own */
.page header { display: grid; gap: var(--s-3); }
.page h1 { font: 400 var(--t-head)/1.15 var(--display); letter-spacing: -0.015em; }
.page .lead { font-size: var(--t-lead); line-height: 1.45; max-width: 34em; text-wrap: balance; }
.block { display: grid; gap: var(--s-3); }
@media (max-width: 899px) {
  .frame { grid-template-columns: 1fr; }
  .rail { display: none; }
  .bar { flex-wrap: wrap; min-height: 0; padding-block: var(--s-4); gap: var(--s-3); }
  .bar__top { display: flex; align-items: center; justify-content: space-between; width: 100%; }
  .bar__top .where { display: block; font-size: var(--t-small); color: var(--soft); margin-top: 2px; }
  .find { flex-basis: 100%; width: auto; }
  .find kbd, .find .long { display: none; }
  .find .short { display: inline; }
  .page { padding-top: var(--s-6); }
}
.find input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--ink); align-self: stretch; min-height: 0; outline-offset: 6px; }

/* ------------------------------------------------------------------ the case: what it is, and what you can do */
.head { display: grid; gap: var(--s-3); }
.head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); }
/* work and what supports it: eight columns and four, on the page's own column lines (subgrid), so every side column on
   every page has the same width and edge; or six and six where two things are compared */
.two { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: var(--gutter); row-gap: var(--gap-section); align-items: start; }
.page > .two { grid-column: 1 / -1; grid-template-columns: subgrid; }
.two > :first-child { grid-column: 1 / span 8; min-width: 0; }
.two > :last-child { grid-column: 9 / -1; min-width: 0; }
.two--even > :first-child { grid-column: 1 / span 6; }
.two--even > :last-child { grid-column: 7 / -1; }
.stack { display: grid; gap: var(--gap-section); }
.tabs { display: none; }
/* `.page header` is a grid; a header with a button beside it has to say that it is a row. */
/* a page's head and its one action: the action stands level with the title on every page, the kicker above and the
   lead below run in the title's column (Bishop, round 3: the button sat at a different height on each page) */
.page header.top { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--gutter); row-gap: var(--s-3); align-items: center; }
.top .head { display: contents; }
.top .head > * { grid-column: 1; }
.top > .btn, .top > form, .top > .top__do { grid-column: 2; grid-row: 1; justify-self: end; }
.top__do { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--s-3); }   /* a head's actions, together by its title */
.top:has(.head > .label:first-child) > .btn, .top:has(.head > .label:first-child) > form, .top:has(.head > .label:first-child) > .top__do { grid-row: 2; }
.demoband { position: sticky; top: 0; z-index: 5; display: flex; justify-content: center; gap: var(--s-3); padding: var(--s-2) var(--s-4); background: var(--band); color: var(--on-band); font-size: var(--t-small); text-align: center; }
.demoband a { color: inherit; }
.demoband ~ .frame .rail { top: 37px; height: calc(100vh - 37px); }
@media (max-width: 899px) {
  /* The rail is gone on a phone, so the same four places and the way out sit in a row under the name. */
  .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--s-4); width: 100%; }
  .tabs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--n-7); text-decoration: none; }
  .tabs a[aria-current] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--kind); }   /* a phone has no room for the squares: where you are is underlined in its kind's dark */
  .tabs form { margin-left: auto; }
  .tabs .linkish { min-height: 44px; }
  .page, .two, .page > .two { grid-template-columns: minmax(0, 1fr); }
  .page header.top { grid-template-columns: minmax(0, 1fr); }
  .top > .btn, .top > form, .top > .top__do, .top:has(.head > .label:first-child) > .btn, .top:has(.head > .label:first-child) > form, .top:has(.head > .label:first-child) > .top__do { grid-column: 1; grid-row: auto; justify-self: start; }
  .top__do { justify-content: flex-start; }
  .page > *, .page.wide > *, .page.wide > .in-work, .page.wide > .form, .two > :first-child, .two > :last-child, .two--even > :first-child, .two--even > :last-child { grid-column: 1 / -1; }   /* one column: nothing may ask for column 8, or the browser makes seven more (Bishop, round 3) */
}

/* ------------------------------------------------------------------ the order: rows with numbers, and what they come to */
/* The order is mostly its rows, so its page gives them the room and keeps the facts narrow. */
@media (max-width: 899px) {
}
.rail__more { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.rail__more a { font-size: var(--t-small); }
.tabs__daily { display: contents; }
@media (max-width: 899px) {                 /* a phone is too narrow for time across; the list under it says the same */
  .tabs { grid-template-columns: repeat(4, auto); justify-content: space-between; }
  /* what is set up now and then waits behind Mer, so the work starts higher on a phone (Bishop, 2026-11-18) */
  .tabs { position: relative; }
  .tabs__more { grid-column: auto; }   /* Mer keeps the eighth place in the menu, open or not (Bishop, round 5: it took a row of its own) */
  .tabs:has(> .tabs__more[open]) { padding-bottom: calc(2 * var(--ctl) + 1px); }   /* the room for what Mer opens, two rows under the menu */
  .tabs:has(> .tabs__more[open] > div > a:nth-child(7)) { padding-bottom: calc(3 * var(--ctl) + 1px); }   /* an admin's Mer has seven places, Personer and Kopplingar too: three rows (2026-11-19) */
  .tabs__more > summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--n-7); cursor: pointer; }
  .tabs__more > div { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--s-4); border-top: 1px solid var(--line); }   /* six places in two rows of three, all of them seen: a row that scrolled hid the last (Bishop, Veckan 2026-11-19) */
  .tabs__more[open] > summary { color: var(--ink); }
  .tabs__more a { font-size: var(--t-small); min-height: 44px; white-space: nowrap; display: flex; align-items: center; }
}

/* ---------------------------------------------- working hours and call times: a weekly pattern, and its day in the schedule */
@media (max-width: 899px) {
}

/* -------------------------------------------------------------- the week: days in columns, time downwards, where is room */
.views { flex: none; }
@media (max-width: 899px) {
  .views { order: -1; }
}
.find input:not([type=checkbox]) { border-radius: 0; }

/* a phone: the bar is the menu and a way to search, not a search field on every page (Bishop: the work started too low) */
.bar__seek, .find--page { display: none; }
@media (max-width: 899px) {
  .bar > .find { display: none; }
  .find--page { display: flex; }
  .bar__seek { display: inline-flex; align-items: center; min-height: 44px; margin-right: var(--s-4); }
  .demoband__more { display: none; }
}
