/*
  What the design system's reference pages wrote inline (style="…"), as
  classes, so pages need no inline styles (the page policy allows none).
  Only the design system's tokens; nothing new is invented here.
*/

/* Without JavaScript, content that would fade in is simply shown. */
html:not(.js) .is-reveal { opacity: 1; transform: none; }

/* Skip link: hidden until it gets keyboard focus. */
.is-skip-link {
  position: absolute; left: var(--space-4); top: calc(-1 * var(--space-9)); z-index: calc(var(--z-header) + 1);
  padding: var(--space-3) var(--space-5);
  background: var(--is-signal); color: var(--is-dusk);
  font-weight: var(--weight-semibold); text-decoration: none;
}
.is-skip-link:focus { top: var(--space-4); }

/* Footer: the current page underlined. */
.is-site-footer .is-nav__link[aria-current="page"] { text-decoration: underline; text-underline-offset: .3em; }

/* The language link uses the language select's look. */
a.is-lang { text-decoration: none; }

/* Stack gaps the reference sets inline. */
.is-stack--4 { --stack-gap: var(--space-4); }
.is-stack--6 { --stack-gap: var(--space-6); }
.is-stack--7 { --stack-gap: var(--space-7); }
.is-stack--8 { --stack-gap: var(--space-8); }

/* Vertical spacers between blocks. */
.is-spacer-section { height: var(--space-section); }
.is-spacer-9 { height: var(--space-9); }

/* A heading kept to a readable width. */
.is-measure-wide { max-width: 20em; }

/* Body text at the regular weight and body size where the reference sets it. */
.is-weight-regular { font-weight: var(--weight-regular); }
.is-copy--body, .is-caption--body { font-size: var(--text-body); }
.is-caption--body { color: var(--color-text); }
.is-strong-lg { font-weight: var(--weight-bold); font-size: var(--text-body-lg); }

/* The header's account link (Logga in) sits with the language link and, like
   it, moves into the mobile menu under 1024px. */
.is-site-header__account { margin-right: var(--space-3); }
@media (max-width: 1023px) { .is-site-header .is-site-header__account { display: none; } }

/* The contact form's spam trap: off screen, out of the tab order. */
.is-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* The contact form's message: a field across both columns (a new pattern,
   composed from .is-field; the reference form has four one-line fields). */
.is-contact-form .is-field--wide { grid-column: 1 / -1; }
.is-contact-form textarea.is-field__control { min-height: calc(var(--space-9) + var(--space-6)); resize: vertical; }
.is-contact-form .is-callout { grid-column: 1 / -1; }

/* A list of short items between hairlines (a new pattern, composed from the
   hairline rule; the reference pages have no lists). */
.is-list > li { padding: var(--space-3) 0; border-top: var(--border-width) solid var(--color-border); }
.is-list > li:last-child { border-bottom: var(--border-width) solid var(--color-border); }

/* Long values (an e-mail address) may break rather than widen the page on a
   phone. */
.is-contact-item__value { overflow-wrap: anywhere; }

/* The hero mirrored (user decision 2026-11-13): text left, the full-bleed
   image right, as interstate.se's hero the other way round. On a phone the
   image stays on top, as in the reference. */
.is-hero--mirrored { grid-template-columns: 46fr 54fr; min-height: min(32rem, 70svh); }
.is-hero--mirrored .is-hero__title { font-size: var(--text-h1); }
.is-hero--mirrored .is-hero__copy { padding: var(--space-8) var(--space-6) var(--space-8) var(--gutter); }
@media (max-width: 1023px) {
  .is-hero--mirrored { grid-template-columns: 1fr; }
  .is-hero--mirrored .is-hero__media { order: -1; }
  .is-hero--mirrored .is-hero__copy { padding: var(--space-7) var(--gutter-mobile); }
}
.is-list > li strong { margin-right: var(--space-3); }

/* A row of buttons. */
.is-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* Logga in and Registrera: one narrow column. */
.is-auth { max-width: 28rem; }

/* The sign-up popup: the design system's modal on the browser's own dialog,
   which gives focus handling and Escape. */
dialog.is-modal { padding: 0; border: 0; border-top: var(--accent-bar) solid var(--is-signal); color: var(--color-text); }
dialog.is-modal::backdrop { background: color-mix(in srgb, var(--is-void) 55%, transparent); }
.is-modal__head { position: relative; padding-right: calc(var(--space-6) + var(--space-8)); }
.is-signup__close { position: absolute; top: var(--space-4); right: var(--space-4); }
.is-modal__body .is-stack { margin-top: var(--space-5); }

/* The client portal (layout "app"). The menu button shows on narrow screens only. */
.is-app__menu { display: none; }
@media (max-width: 1023px) { .is-app__menu { display: inline-grid; } }
.is-app__company { font-weight: var(--weight-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-app__user { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-text-muted); }
@media (max-width: 767px) { .is-app__user, span.is-app__company { display: none; } .is-app__switch-menu { min-width: 14rem; } }
.is-sidenav__button { width: 100%; padding: 0; border: 0; background: none; font-family: inherit; cursor: pointer; text-align: left; }
.is-sidenav__link .is-icon { flex: none; }
/* A value to copy: the value, then its copy button. */
.is-copyval { display: inline-flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.is-copyval code { font-family: var(--font-mono); word-break: break-all; }
button[data-copy][data-copied="true"] { color: var(--color-success); }
.is-qr svg { width: 200px; height: 200px; }
.is-app__main .is-panel + .is-panel { margin-top: var(--space-6); }
.is-app__main > .is-alert { margin-bottom: var(--space-6); }
/* The app layout without a side menu (login pages). */
.is-app--bare { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
a.is-app__user { text-decoration: none; }
a.is-app__user:hover { color: var(--color-text); }
/* The top bar's company switcher (a person in several companies). */
.is-app__switch { position: relative; min-width: 0; flex: 0 1 auto; }
.is-app__switch-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-app__switch summary { max-width: 100%; }
.is-app__top-actions { flex: none; }
.is-app__switch summary { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; list-style: none; }
.is-app__switch summary::-webkit-details-marker { display: none; }
.is-app__switch-menu {
  position: absolute; top: calc(100% + var(--space-3)); left: 0; z-index: var(--z-dropdown); min-width: 18rem;
  display: grid; background: var(--color-surface); border: var(--border-width) solid var(--color-hairline);
}
.is-app__switch-menu button {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border: 0; background: none; font-family: inherit; font-size: var(--text-ui);
  text-align: left; cursor: pointer; color: var(--color-text);
}
.is-app__switch-menu button:hover { background: var(--color-bg-subtle); }
.is-app__switch-menu button[aria-current="true"] { font-weight: var(--weight-semibold); }
/* Narrow screens: the column never grows past the screen for a long company name. */
@media (max-width: 1023px) {
  .is-app { grid-template-columns: minmax(0, 1fr); }
  .is-app__top { min-width: 0; }
}
/* Inställningar: the person's companies (the chosen one, then the others with Choose). */
.is-settings-company { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.is-settings-others { display: grid; border-top: var(--border-width) solid var(--color-hairline); }
.is-settings-others .is-settings-company { padding: var(--space-4) 0; border-bottom: var(--border-width) solid var(--color-hairline); }
/* What a pressed button did, next to the button. */
.is-form-done { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-ui); color: var(--color-success); }
.is-form-done--error { color: var(--color-danger); }
.is-form-actions { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
/* Admin Customers: a person's companies under them, indented. */
.is-row-person td { background: var(--color-bg-subtle); }
.is-row-company td:first-child { padding-left: var(--space-7); }
.is-actions--center { align-items: center; }
.is-search { min-width: min(100%, 24rem); }
/* Tables fit the window (user request 2026-11-17): text wraps, long words
   (errors, ids, browser names) break, buttons wrap under each other. Only
   report tables and data previews (is-table-wrap--scroll) may scroll. */
.is-table td { overflow-wrap: break-word; }
.is-table .is-caption, .is-table .is-mono { overflow-wrap: anywhere; }
.is-table .is-actions .is-btn { white-space: nowrap; }
/* On a phone a row's cells stack, one under the other. */
@media (max-width: 640px) {
  .is-table-wrap:not(.is-table-wrap--scroll) .is-table:not(.is-report) thead { display: none; }
  .is-table-wrap:not(.is-table-wrap--scroll) .is-table:not(.is-report) tr { display: block; border-bottom: var(--border-width) solid var(--color-hairline); padding: var(--space-3) 0; }
  .is-table-wrap:not(.is-table-wrap--scroll) .is-table:not(.is-report) tbody tr:last-child { border-bottom: 0; }
  .is-table-wrap:not(.is-table-wrap--scroll) .is-table:not(.is-report) td { display: block; height: auto; border-bottom: 0; padding: var(--space-1) var(--space-4); }
  .is-table-wrap:not(.is-table-wrap--scroll) .is-table:not(.is-report) td:empty { display: none; }
}
/* Admin company Reports tab: report tables, the month and period choice. */
.is-report td.num, .is-report .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.is-report tr.total td, .is-report tr.subtotal td { font-weight: var(--weight-semibold); }
.is-report tr.account td:first-child { padding-left: var(--space-6); color: var(--color-text-muted); }
.is-report td a { color: inherit; text-decoration: none; }
.is-inline-label { display: inline-flex; align-items: center; gap: var(--space-3); font-size: var(--text-ui); }
.is-columns { columns: 2 18rem; column-gap: var(--space-7); }
.is-table-wrap--scroll { overflow-x: auto; }
.is-reports > h2 { margin: var(--space-7) 0 var(--space-4); }
.is-reports > p { margin-bottom: var(--space-4); }

/* A number field next to its unit (admin Settings, Login times). */
.is-time-input { display: flex; gap: var(--space-3); align-items: center; }
.is-time-input .is-select { width: auto; min-width: 140px; }
.is-input--short { width: 7rem; flex: none; }
