/*
 * Mín síða (templates/subscription/user_profile/base.html and the pages on it): the reader's own pages in the new
 * purchase pages' family (site/styrkja/styrkja.css, its sp- tokens; the owner, 2026-10-23). A menu beside the pages
 * on a computer and pills to swipe on a phone; cards on a light surface. Each outlet in its own look: the headline
 * face from the site's --h-font-headline (Heimildin's Tiempos, Heimilisblaðið's Feature) or Mannlíf's theme, the
 * corners and the surface from the theme's --base-* where it has them. No rounded box with a border down one side.
 */
.ms {
    --ms-display: var(--h-font-headline, "tiemposheadline_web", serif);
    --ms-heading: var(--base-font-heading, inherit);
    --ms-surface: var(--base-surface, #f5f4f0);
    --ms-radius: var(--base-radius, 14px);
    --ms-btn-radius: var(--base-radius, 10px);
    --ms-primary: var(--sp-ink);
    --ms-primary-ink: #fff;
    --ms-ok: #116634;
    --ms-ok-bg: #e3f1e8;
    --ms-wait: #7a5300;
    --ms-wait-bg: #fff1d1;
    --ms-bad: #b00020;
    --ms-bad-bg: #fde8eb;
    --ms-tint: rgba(0, 0, 0, .06);
    background: var(--ms-surface);
    padding: 40px 0 72px;
    font-size: 16px;
    overflow-x: clip;
}
.ms--heimilisbladid { --ms-surface: var(--h-bg, #f3f3ed); }
.ms--mannlif { --ms-display: var(--font-primary, var(--base-font-heading, serif)); --ms-surface: #f4f4f4; --ms-primary: var(--base-accent); }
[data-theme="dark"] .ms {
    --ms-surface: var(--base-surface, #161615);
    --ms-primary-ink: #121212;
    --ms-ok: #6fd796; --ms-ok-bg: rgba(111, 215, 150, .14);
    --ms-wait: #ffcf6e; --ms-wait-bg: rgba(255, 200, 80, .14);
    --ms-bad: #ff8a8a; --ms-bad-bg: rgba(255, 120, 120, .14);
    --ms-tint: rgba(255, 255, 255, .08);
}
[data-theme="dark"] .ms--mannlif { --ms-primary-ink: #fff; }
.ms-body #footer:not(:has(.footer__subscription-box)) { margin-top: 0; }
.ms h1, .ms h2, .ms h3 { margin: 0; }
.ms a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ms-wrap { max-width: 1120px; }

/* The page's head: whose page, and the reader's standing */
.ms-head { margin: 0 0 28px; }
.ms-head .sp-kicker { margin: 0 0 6px; color: var(--sp-accent); }
.ms-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--sp-ink); text-decoration: none; }
.sp .ms-title { margin: 0; font-family: var(--ms-display); font-weight: 500; font-size: 40px; line-height: 1.1; letter-spacing: -.01em; text-wrap: balance; }
.ms--mannlif .ms-title, .ms--mannlif .ms-auth__card h1 { font-weight: normal; font-variation-settings: "wdth" 87, "wght" 700; letter-spacing: 0; }
.ms-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 12px 0 0; color: var(--sp-muted); font-size: 16px; }
.ms-status a { color: inherit; }
.ms-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 32px; align-items: start; }
.ms-grid--wide { grid-template-columns: minmax(0, 1fr); }

/* The menu: a column on a computer, pills on a phone */
.ms-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; }
.ms-nav form { margin: 0; }
.ms-nav a, .ms-nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--ms-btn-radius); background: none; color: var(--sp-ink); font: inherit; font-size: 15px; font-weight: 600; text-align: left; text-decoration: none !important; cursor: pointer; }
.ms-nav a:hover, .ms-nav button:hover { background: var(--ms-tint); }
.ms-nav a.is-on { background: var(--sp-card); box-shadow: 0 0 0 1px var(--sp-line); font-weight: 800; }
.ms-nav a:focus-visible, .ms-nav button:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 2px; }
.ms-nav svg { flex: none; width: 18px; height: 18px; color: var(--sp-muted); }
.ms-nav a.is-on svg { color: var(--sp-ink); }
.ms-nav hr { margin: 10px 12px; border: 0; border-top: 1px solid var(--sp-line); }
.ms-nav .ms-out { color: var(--sp-muted); }
.ms-badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--sp-ink); color: var(--sp-card); font-size: 12px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }

/* Messages: in the page's colours, one line each */
.ms-messages { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.ms-messages li { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border: 1px solid var(--sp-line); border-radius: var(--ms-btn-radius); background: var(--sp-card); font-size: 15px; }
.ms-messages li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--sp-muted); }
.ms-messages .success::before { background: var(--ms-ok); }
.ms-messages .warning::before { background: var(--ms-wait); }
.ms-messages .error { border-color: var(--ms-bad); }
.ms-messages .error::before { background: var(--ms-bad); }

/* Cards */
.ms-main { display: grid; gap: 18px; min-width: 0; }
.ms-card { background: var(--sp-card); border: 1px solid var(--sp-line); border-radius: var(--ms-radius); padding: 24px 26px; min-width: 0; }
.ms-card__head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin: 0 0 16px; }
.ms-card__head h2 { font-family: var(--ms-heading); font-size: 19px; font-weight: 800; }
.ms-card__head a { font-size: 15px; }
.ms-card > p { margin: 0 0 12px; }
.ms-card > p:last-child { margin-bottom: 0; }
.ms-card--alert { border-color: var(--ms-wait); }
.ms-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ms-hint { margin: 4px 0 0; font-size: 14px; color: var(--sp-muted); }
.ms-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: var(--ms-tint); color: var(--sp-ink); font-size: 13px; font-weight: 700; white-space: nowrap; }
.ms-chip--ok { background: var(--ms-ok-bg); color: var(--ms-ok); }
.ms-chip--ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ms-chip--wait { background: var(--ms-wait-bg); color: var(--ms-wait); }
.ms-chip--bad { background: var(--ms-bad-bg); color: var(--ms-bad); }
.ms-link { color: var(--sp-ink); font-weight: 700; text-decoration: underline; }
.ms-quiet { color: var(--sp-muted); font-size: 15px; text-decoration: underline; }
button.ms-link, button.ms-quiet { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
button.ms-quiet { font-size: 15px; }
.ms-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: var(--ms-btn-radius); border: 2px solid var(--ms-primary); background: var(--ms-primary); color: var(--ms-primary-ink); font: inherit; font-size: 15px; font-weight: 800; text-decoration: none !important; cursor: pointer; white-space: nowrap; }
.ms-btn:hover { filter: brightness(1.12); }
.ms-btn:focus-visible, .ms-link:focus-visible, .ms-quiet:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 2px; }
.ms-btn[disabled] { opacity: .5; cursor: default; }
.ms-btn--line { background: transparent; color: var(--sp-ink); border-color: var(--sp-ink); }
.ms-btn--danger { background: transparent; color: var(--ms-bad); border-color: var(--ms-bad); }
.ms-btn--small { padding: 7px 12px; font-size: 14px; }
.ms-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 20px 0 0; padding: 18px 0 0; border-top: 1px solid var(--sp-line); }
.ms-actions form { margin: 0; }
.ms-actions > .ms-end { margin-left: auto; }

/* A subscription */
.ms-sub + .ms-sub { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--sp-line); }
.ms-sub__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.ms-sub__name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0; font-size: 22px; font-weight: 800; }
.ms-sub__meta { margin: 6px 0 0; color: var(--sp-muted); font-size: 15px; }
.ms-sub__price { margin: 0; text-align: right; color: var(--sp-muted); font-size: 14px; white-space: nowrap; }
.ms-sub__price b { display: block; color: var(--sp-ink); font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ms-perks { list-style: none; display: grid; gap: 6px; margin: 16px 0 0; padding: 0; font-size: 15px; }
.ms-perks li { display: flex; gap: 8px; }
.ms-perks svg { flex: none; margin-top: 3px; color: var(--ms-ok); }

/* Rows: a list of things to open */
.ms-rows { display: grid; }
.ms-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--sp-line); color: inherit; text-decoration: none !important; }
.ms-row:first-child { border-top: 0; padding-top: 0; }
.ms-row b { display: block; font-size: 16px; }
.ms-row span { color: var(--sp-muted); font-size: 14px; }
.ms-row__go { color: var(--sp-muted); }
.ms-meter { height: 8px; border-radius: 99px; background: var(--ms-tint); overflow: hidden; }
.ms-meter i { display: block; height: 100%; border-radius: 99px; background: var(--sp-ink); }

/* Switches (a form each: one press turns it on or off) */
.ms-switch { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin: 0; padding: 10px 0; border-top: 1px solid var(--sp-line); }
.ms-switch:first-of-type { border-top: 0; padding-top: 0; }
.ms-switch b { display: block; font-size: 16px; }
.ms-switch button { flex: none; position: relative; width: 44px; height: 26px; padding: 0; border: 0; border-radius: 99px; background: rgba(0, 0, 0, .2); cursor: pointer; transition: background .15s; }
.ms-switch button::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.ms-switch button[aria-pressed="true"] { background: var(--ms-ok); }
.ms-switch button[aria-pressed="true"]::after { transform: translateX(18px); }
.ms-switch button:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 2px; }
.ms-switch button[disabled] { opacity: .45; cursor: default; }
[data-theme="dark"] .ms-switch button { background: rgba(255, 255, 255, .22); }
[data-theme="dark"] .ms-switch button[aria-pressed="true"] { background: #2f9c5c; }
.ms-big { margin: 0; font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Facts */
.ms-dl { display: grid; grid-template-columns: 200px minmax(0, 1fr); margin: 0; }
.ms-dl dt, .ms-dl dd { margin: 0; padding: 12px 0; border-top: 1px solid var(--sp-line); }
.ms-dl dt { color: var(--sp-muted); font-size: 15px; }
.ms-dl dd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.ms-dl dt:first-of-type, .ms-dl dd:first-of-type { border-top: 0; padding-top: 0; }
.ms-dl dd form { margin: 0; }
.ms-more { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 22px; margin: 6px 4px 0; font-size: 15px; }

/* Lists of payments and such */
.ms-list { list-style: none; margin: 0; padding: 0; }
.ms-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 6px 18px; padding: 12px 0; border-top: 1px solid var(--sp-line); font-size: 15px; }
.ms-list li:first-child { border-top: 0; padding-top: 0; }
.ms-list b { font-variant-numeric: tabular-nums; }
.ms-list li > span, .ms-list li > div > span { color: var(--sp-muted); font-size: 14px; }

/* Forms on the pages (crispy's fields and allauth's, as they come) */
.ms form p, .ms .form-group, .ms .mb-3 { margin: 0 0 14px; }
.ms form p.ms-hint { margin: 4px 0 14px; }
.ms label { display: block; margin: 0 0 6px; font-weight: 800; font-size: 15px; }
.ms .form-check label, .ms label.ms-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.ms input[type="text"], .ms input[type="email"], .ms input[type="password"], .ms input[type="tel"], .ms input[type="number"], .ms input[type="url"], .ms input[type="search"], .ms select, .ms textarea {
    width: 100%; max-width: 100%; padding: 11px 13px; border: 1px solid var(--sp-line); border-radius: var(--ms-btn-radius); background: var(--sp-card); color: var(--sp-ink); font: inherit; font-size: 16px; box-shadow: none;
}
.ms input:focus, .ms select:focus, .ms textarea:focus { outline: 2px solid var(--sp-accent); outline-offset: 1px; border-color: transparent; }
.ms .helptext, .ms .form-text, .ms small.text-muted { display: block; margin: 6px 0 0; color: var(--sp-muted); font-size: 14px; }
.ms .errorlist, .ms .invalid-feedback { margin: 6px 0 0; padding: 0; list-style: none; color: var(--ms-bad); font-size: 14px; display: block; }
.ms .asteriskField { color: var(--sp-muted); }

/* Older parts of the pages, until each is drawn anew: in the cards' look */
.ms .userprofile-block { background: var(--sp-card); border: 1px solid var(--sp-line); border-radius: var(--ms-radius); padding: 24px 26px; margin: 0; }
.ms .userprofile-heading { margin: 0 0 16px; padding: 0; border: 0; font-family: var(--ms-heading); font-size: 19px; font-weight: 800; }
.ms .userprofile-field { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--sp-line); color: inherit; text-decoration: none; }
.ms .userprofile-heading + .userprofile-field, .ms .userprofile-field:first-child { border-top: 0; padding-top: 0; }
.ms .userprofile-field__name { font-weight: 700; }
.ms .userprofile-field__value { color: var(--sp-muted); font-size: 15px; }
.ms .button, .ms .btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: var(--ms-btn-radius); border: 2px solid var(--ms-primary); background: var(--ms-primary); color: var(--ms-primary-ink); font-size: 15px; font-weight: 800; text-decoration: none; cursor: pointer; }
.ms .button-outline, .ms .button-black.button-outline, .ms .btn-secondary { background: transparent; color: var(--sp-ink); border-color: var(--sp-ink); }
.ms .button-green, .ms .button-submit { background: var(--ms-primary); border-color: var(--ms-primary); color: var(--ms-primary-ink); }
.ms table { width: 100%; border-collapse: collapse; font-size: 15px; }
.ms th, .ms td { padding: 10px 8px 10px 0; border-top: 1px solid var(--sp-line); text-align: left; }
.ms .alert_message, .ms .error_message { padding: 12px 16px; border: 1px solid var(--ms-wait); border-radius: var(--ms-btn-radius); background: var(--sp-card); }

/* A workplace's own page (subscription/workplace/manage.html) */
.ms-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ms-stat { background: var(--sp-card); border: 1px solid var(--sp-line); border-radius: var(--ms-radius); padding: 16px 18px; min-width: 0; }
.ms-stat p { margin: 0; }
.ms-stat__l { color: var(--sp-muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ms-stat__v { margin-top: 4px !important; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ms-stat__v small { font-size: 14px; font-weight: 600; color: var(--sp-muted); }
.ms-stat .ms-meter { margin-top: 10px; }
.ms-fold { padding: 0; }
.ms-fold > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 26px; list-style: none; cursor: pointer; }
.ms-fold > summary::-webkit-details-marker { display: none; }
.ms-fold > summary b { font-size: 17px; }
.ms-fold > summary > span:not([class]) { color: var(--sp-muted); font-size: 15px; }
.ms-fold > summary::after { content: "+"; color: var(--sp-muted); font-size: 22px; line-height: 1; }
.ms-fold[open] > summary::after { content: "–"; }
.ms-fold__body { padding: 0 26px 24px; }

@media (max-width: 760px) {
    .ms { padding: 22px 0 56px; }
    .sp .ms-title { font-size: 30px; }
    .ms-grid { grid-template-columns: 1fr; gap: 18px; }
    .ms-nav { position: static; flex-direction: row; gap: 8px; overflow-x: auto; margin: 0 -20px; padding: 0 20px 4px; scrollbar-width: none; }
    .ms-nav::-webkit-scrollbar { display: none; }
    .ms-nav form { flex: none; }
    .ms-nav a, .ms-nav button { flex: none; width: auto; padding: 8px 14px; border: 1px solid var(--sp-line); border-radius: calc(var(--ms-btn-radius) * 99); background: var(--sp-card); font-size: 14px; white-space: nowrap; }
    .ms-nav a.is-on { background: var(--sp-ink); color: var(--sp-card); box-shadow: none; }
    .ms-nav svg, .ms-nav hr { display: none; }
    .ms-nav .ms-badge { margin-left: 2px; }
    .ms-nav a.is-on .ms-badge { background: var(--sp-card); color: var(--sp-ink); }
    .ms-card, .ms .userprofile-block { padding: 20px 18px; }
    .ms-fold { padding: 0; }
    .ms-two { grid-template-columns: 1fr; }
    .ms-stats { grid-template-columns: 1fr 1fr; }
    .ms-dl { grid-template-columns: 1fr; }
    .ms-dl dt { padding-bottom: 0; border-top: 1px solid var(--sp-line); }
    .ms-dl dd { padding-top: 4px; border-top: 0; }
    .ms-sub__top { flex-direction: column; gap: 6px; }
    .ms-sub__price { text-align: left; }
    .ms-sub__price b { display: inline; margin-right: 6px; }
    .ms-row { grid-template-columns: minmax(0, 1fr) auto; }
    .ms-row .ms-meter { display: none; }
    .ms-actions > .ms-end { margin-left: 0; }
    .ms-list li { grid-template-columns: minmax(0, 1fr) auto; }
    .ms-list li > :last-child { grid-column: 1 / -1; }
    .ms-fold > summary { flex-wrap: wrap; padding: 16px 18px; }
    .ms-fold__body { padding: 0 18px 20px; }
}
