/* algoprep.com: the look of pde.algoprep.com and math.algoprep.com. Paper, ink and the terracotta accent; Assistant
   for text and Heebo for headings (own copies in /assets/fonts, under the Open Font License). Light and dark are set
   on <html data-theme> by theme.js; Hebrew (rtl) and English (ltr) on <html dir> by site.js. */
@font-face { font-family: 'Assistant'; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/assets/fonts/assistant-hebrew.woff2") format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Assistant'; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/assets/fonts/assistant-latin.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Heebo'; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/assets/fonts/heebo-hebrew.woff2") format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/assets/fonts/heebo-latin.woff2") format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  color-scheme: light;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --shadow: 0 1px 2px rgba(48, 43, 39, .04), 0 8px 24px -8px rgba(48, 43, 39, .12);
  --header-bg: rgba(250, 249, 245, .82);
  --paper: #faf9f5;
  --paper-deep: #f1ece3;
  --card: #fffcf7;
  --ink: #302b27;
  --muted: #70665c;
  --accent: #a94d31;
  --accent-soft: #f4e5db;
  --line: #ded5c8;
  --serif: 'Heebo', Arial, sans-serif; /* headings */
  --sans: 'Assistant', Arial, sans-serif;
  --radius: 16px;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #262320;
  --paper-deep: #302b27;
  --card: #2d2824;
  --ink: #f3ece2;
  --muted: #c2b5a7;
  --accent: #e59c7e;
  --accent-soft: #493129;
  --line: #50453c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 10px 30px -10px rgba(0, 0, 0, .5);
  --header-bg: rgba(38, 35, 32, .82);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1.125rem/1.7 var(--sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
button { font: inherit; cursor: pointer; }
img, svg { max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-underline-offset: .23em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.18; margin: 0 0 1rem; text-wrap: balance; }
h1 { font-size: clamp(2.7rem, 6vw, 5.2rem); letter-spacing: -.025em; }
h2 { font-size: clamp(2rem, 3.4vw, 2.9rem); }
p { margin: 0 0 1rem; }
.small { font-size: .93rem; }
.muted { color: var(--muted); }
.eyebrow { color: var(--accent); font-weight: 700; font-size: .95rem; margin-bottom: 1rem; }
.container { width: min(1160px, calc(100% - 3rem)); margin-inline: auto; }
.section { padding-block: 4.5rem; }
.skip-link { position: fixed; top: -6rem; inset-inline-start: 1rem; z-index: 100; padding: .7rem 1rem; background: var(--card); border-radius: 8px; }
.skip-link:focus { top: 1rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); position: relative; z-index: 20; }
@media (min-width: 701px) {
  .site-header { position: sticky; top: 0; background: var(--header-bg); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); }
}
.nav { display: flex; align-items: center; gap: 1.6rem; min-height: 68px; flex-wrap: wrap; padding-block: .6rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font: 600 1.5rem var(--serif); white-space: nowrap; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand b { font-weight: inherit; color: var(--accent); }
.nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: 1.3rem; }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; font-size: 1rem; transition: color .2s; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.nav-new { color: var(--accent); font-weight: 700; }
.nav-tools { margin-inline-start: auto; display: flex; align-items: center; gap: .65rem; }
.icon-button, .text-button { border: 1px solid var(--line); background: transparent; color: var(--ink); transition: background-color .2s, border-color .2s, transform .15s var(--ease-out); }
.icon-button:hover, .text-button:hover { background: var(--paper-deep); }
.icon-button:active, .text-button:active { transform: scale(.97); }
.text-button { min-width: 44px; height: 44px; padding: 0 .8rem; border-radius: 999px; font-weight: 700; font-size: .95rem; }
[data-theme-toggle] { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; flex-shrink: 0; }
[data-theme-toggle] svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Buttons */
.button { display: inline-flex; justify-content: center; align-items: center; gap: .5rem; padding: .7rem 1.35rem; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent); color: var(--paper); text-decoration: none; font-weight: 700; line-height: 1.4; transition: transform .2s var(--ease-out), box-shadow .2s, filter .2s; }
.button:hover { filter: brightness(.95); text-decoration: none; box-shadow: 0 6px 18px -8px var(--accent); }
.button:active { transform: scale(.97); }
.button .arrow { display: inline-block; transition: transform .25s var(--ease-out); }
.button:hover .arrow { transform: translateY(3px); }
.button.secondary { background: color-mix(in srgb, var(--card) 80%, transparent); color: var(--ink); border-color: var(--line); }
.button-lg { padding: .95rem 1.7rem; font-size: 1.1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-block: 1.5rem; }

/* One continuous page: sections are separated by spacing and type only. */
.home { position: relative; } /* the backdrop below is sized to the whole page */
.home main { overflow-x: clip; }
.home .section { padding-block: clamp(4rem, 10vh, 7rem); }
.home h2 { font-size: clamp(2.1rem, 4.2vw, 3.4rem); letter-spacing: -.015em; }
.section-intro { max-width: 40rem; margin-bottom: clamp(2rem, 5vh, 3.25rem); }
.section-intro .muted { font-size: 1.2rem; margin: 0; }
.home .site-header { border-bottom: 0; background: linear-gradient(to bottom, var(--paper) 78%, color-mix(in srgb, var(--paper) 0%, transparent)); background-origin: border-box; background-repeat: no-repeat; -webkit-backdrop-filter: none; backdrop-filter: none; }
.home .site-footer { border-top: 0; background: linear-gradient(to bottom, transparent, var(--paper) 45%); }

/* Reveal on scroll. Content stays visible without JS. */
.motion-ready [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); transition-delay: var(--rd, 0ms); }
.motion-ready [data-reveal].in { opacity: 1; transform: none; }

/* The 3D ASCII backdrop (driven by /assets/ascii.js). Desktop: the canvas sits in the page and scrolls with the text.
   Mobile (.is-fixed): fixed to the viewport. The fade layer paints soft paper edges over the art. */
.ascii-backdrop { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; opacity: .9; contain: layout paint; }
.ascii-backdrop.is-fixed { position: fixed; }
.ascii-backdrop canvas { position: absolute; top: 0; left: 0; display: block; will-change: transform; }
.ascii-fade { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  --head: -1000px; --pa: color-mix(in srgb, var(--paper) 84%, transparent); --pb: color-mix(in srgb, var(--paper) 50%, transparent); --pc: color-mix(in srgb, var(--paper) 16%, transparent);
  background: linear-gradient(to bottom, var(--paper) calc(var(--head) - 10px), var(--pa) calc(var(--head) + 15px), var(--pb) calc(var(--head) + 40px), var(--pc) calc(var(--head) + 65px), transparent calc(var(--head) + 90px)),
    linear-gradient(to bottom, var(--paper) 0, transparent 18%, transparent 78%, var(--paper) 100%), linear-gradient(to right, var(--paper) 0, transparent 8%, transparent 92%, var(--paper) 100%); }
:root[data-theme='dark'] .ascii-backdrop { opacity: .72; }

/* Hero */
.hero { display: block; position: relative; padding-block: clamp(3.5rem, 11vh, 7.5rem) clamp(3.5rem, 9vh, 6rem); isolation: isolate; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -2; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 36px 36px; opacity: .45; --at: 30%; -webkit-mask-image: radial-gradient(ellipse 70% 75% at var(--at) 45%, #000 10%, transparent 72%); mask-image: radial-gradient(ellipse 70% 75% at var(--at) 45%, #000 10%, transparent 72%); }
:root[dir='ltr'] .hero::before { --at: 70%; }
.hero-curve { position: absolute; z-index: -1; inset: auto 0 -4% 0; width: 100%; height: 48%; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; opacity: .26; }
.hero-curve path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.8s var(--ease-out) .5s forwards; vector-effect: non-scaling-stroke; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 5.5rem); align-items: center; }
.hero h1 { font-size: clamp(2.9rem, 5.4vw, 4.6rem); line-height: 1.02; letter-spacing: -.03em; margin-bottom: 1.6rem; }
.hero h1 span, .hero h1 em { display: block; }
.hero h1 em { font-style: normal; color: var(--accent); }
:root[dir='ltr'] .hero h1 { font-size: clamp(2.6rem, 4.8vw, 4.1rem); line-height: 1.06; }
.hero .lead { font-size: clamp(1.15rem, 1.6vw, 1.35rem); color: var(--muted); max-width: 31rem; margin-bottom: 0; }
.hero .actions { margin-block: 2.2rem 0; }
.hero-note { margin: 1.1rem 0 0; color: var(--muted); font-size: .98rem; }
.hero-note b { color: var(--accent); }
.hero-art { height: clamp(15rem, 44vh, 25rem); } /* open space where the first drawing plays (ascii.js centres it here) */
.rise { animation: rise 1s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 110ms + 60ms); }
@keyframes rise { from { opacity: 0; transform: translateY(20px); filter: blur(6px); } }
/* A paper-coloured glow under each text block the art passes, so a stray tail of it can never cross a letter. */
.hero-copy, .section-intro { position: relative; }
.hero-copy::before, .section-intro::before { content: ''; position: absolute; z-index: -1; inset: -3.5rem -4rem; pointer-events: none; background: radial-gradient(closest-side, var(--paper) 55%, color-mix(in srgb, var(--paper) 0%, transparent)); }

/* The numbers */
.site-facts { padding-block: 0 clamp(1rem, 3vh, 2rem); }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); background: color-mix(in srgb, var(--card) 88%, transparent); border: 1px solid var(--line); border-radius: 20px; padding-block: 1.6rem; box-shadow: var(--shadow); }
.fact { padding-inline: 1.5rem; border-inline-end: 1px solid var(--line); text-align: center; }
.fact:last-child { border: 0; }
.fact strong { display: block; font: 500 clamp(2rem, 3.4vw, 2.7rem)/1.1 var(--serif); color: var(--accent); font-variant-numeric: tabular-nums; }
.fact span { display: block; color: var(--ink); font-weight: 600; font-size: 1.05rem; }
.fact small { display: block; color: var(--muted); font-size: .86rem; }

/* The sites: one card per site, in two groups. */
.site-groups { display: grid; gap: clamp(2rem, 5vh, 3rem); }
.site-group h3 { margin-bottom: .9rem; font: 700 1rem var(--sans); color: var(--muted); }
.site-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.site-grid > li { display: flex; min-width: 0; }
.site-grid > li.span-2 { grid-column: 1 / -1; }  /* a card two cards wide (Bagrut, on top) */
.site-card { position: relative; display: flex; flex-direction: column; flex: 1; min-width: 0; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .25s var(--ease-out), border-color .25s; }
.site-card:hover, .site-card:focus-within { transform: translateY(-2px); border-color: var(--accent); }
.thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-deep); border-bottom: 1px solid var(--line); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .5s var(--ease-out); }
.site-card:hover .thumb img { transform: scale(1.02); }
/* Each card has a light and a dark screenshot of its site; the one that matches the look is shown.
   The hidden one is lazy, so it is not downloaded until the look changes. */
.thumb img.shot-dark, :root[data-theme='dark'] .thumb img.shot-light { display: none; }
:root[data-theme='dark'] .thumb img.shot-dark { display: block; }
.site-body { display: flex; flex-direction: column; flex: 1; padding: 1.3rem 1.5rem 1.4rem; }
.site-tag { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 .5rem; font-size: .88rem; font-weight: 700; color: var(--muted); }
.badge { padding: .05rem .65rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .8rem; }
.badge.new { background: var(--accent); color: var(--paper); }
.site-name { font-size: 1.55rem; font-weight: 600; margin-bottom: .5rem; }
.site-name a { color: inherit; text-decoration: none; }
.site-name a::after { content: ''; position: absolute; inset: 0; } /* the whole card is the link */
.site-name a:focus-visible { outline: 0; }
.site-card:has(.site-name a:focus-visible) { outline: 3px solid var(--accent); outline-offset: 4px; }
.site-body > p:not(.site-tag) { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.site-url { margin-top: auto; padding-top: 1rem; color: var(--accent); font-weight: 700; font-size: .98rem; text-align: start; }
.site-url span { display: inline-block; transition: transform .25s var(--ease-out); }
.site-card:hover .site-url span { transform: translate(-3px, -3px); }
:root[dir='ltr'] .site-card:hover .site-url span { transform: translate(3px, -3px); }
.site-card.wide { flex-direction: row; }
.site-card.wide .thumb { flex: 0 0 46%; aspect-ratio: auto; min-height: 15rem; border-bottom: 0; border-inline-end: 1px solid var(--line); }
.site-card.wide .site-body { justify-content: center; padding: 1.8rem 2rem; }
.site-card.wide .site-url { margin-top: 1.2rem; }

/* Footer */
.site-footer { padding-block: 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; }
.footer-row a { color: var(--muted); text-decoration: none; }
.footer-row a:hover { color: var(--accent); }
.footer-row .footer-brand { color: var(--ink); font-family: var(--serif); font-weight: 600; margin-inline-end: auto; }
.site-footer p { margin-top: 1rem; margin-bottom: 0; }

/* The "not found" page */
.notfound { min-height: 62vh; display: grid; align-content: center; }
/* The sign-in page (signin/): one card, short points, one clear button. */
.signin { min-height: 70vh; display: grid; place-items: center; padding-block: 3rem; }
.signin-card { width: min(520px, 100%); padding: clamp(1.5rem, 4vw, 2.4rem); background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.signin-card h1 { font-size: clamp(1.9rem, 4vw, 2.4rem); margin-bottom: 1rem; }
.signin-card h2 { font-size: 1.1rem; margin: 1.6rem 0 .7rem; }
.signin-points { list-style: none; padding: 0; margin: 0 0 1.6rem; display: grid; gap: .55rem; }
.signin-points li { display: flex; gap: .6rem; align-items: baseline; color: var(--muted); font-size: 1.05rem; }
.signin-points li::before { content: '✓'; color: var(--ok, #3f7d4e); font-weight: 700; }
.signin-google { width: 100%; background: var(--card); color: var(--ink); border-color: var(--line); }
.signin-google:hover { border-color: var(--accent); box-shadow: 0 6px 18px -10px var(--accent); }
.signin-google svg { width: 1.25em; height: 1.25em; }
.signin-google[hidden] { display: none; }
.signin-note { margin: 1rem 0 0; color: var(--muted); font-size: .9rem; }
.signin-status { margin: 1rem 0 0; min-height: 1.4em; color: var(--accent); font-weight: 600; }
.signin-status:empty { display: none; }
.signin-dev { margin-top: 1rem; padding: 1rem; border: 1px dashed var(--line); border-radius: 12px; display: grid; gap: .6rem; font-size: .9rem; }
.signin-dev input { padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; }
.signin-who { display: flex; align-items: center; gap: 1rem; }
.signin-who h1 { margin: 0; font-size: clamp(1.5rem, 3.4vw, 1.9rem); overflow-wrap: anywhere; }
.signin-mail { margin: .15rem 0 0; color: var(--muted); text-align: start; overflow-wrap: anywhere; }
.signin-avatar { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: var(--accent-soft); color: var(--accent); font-size: 1.6rem; font-weight: 700; }
.signin-avatar img { width: 100%; height: 100%; object-fit: cover; }
.signin-bundles { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.signin-bundles li { display: grid; grid-template-columns: auto 1fr; gap: .1rem .8rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.signin-bundles b { color: var(--accent); }
.signin-bundles span { color: var(--muted); }
.signin-bundles small { grid-column: 1 / -1; color: var(--muted); font-size: .85rem; text-align: start; }
.signin-empty { color: var(--muted); padding: .8rem 1rem; border: 1px dashed var(--line); border-radius: 12px; }
.signin-actions { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: .7rem; }
.signin-actions .button { flex: 1 1 auto; }
.signin-actions [hidden] { display: none; }
/* The account button in the header (accounts.algoprep.com/account.js fills it). */
[data-algoprep-account]:empty { display: inline-block; width: 40px; height: 40px; }
.notfound .lead { color: var(--muted); font-size: 1.25rem; }

@media (max-width: 1000px) {
  .nav { gap: 1rem; }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 0; }
  .hero-art { display: none; }
  .site-card.wide { flex-direction: column; }
  .site-card.wide .thumb { flex: none; aspect-ratio: 16 / 10; min-height: 0; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .site-card.wide .site-body { padding: 1.3rem 1.5rem 1.4rem; }
}
@media (max-width: 700px) {
  html { scroll-padding-top: 1rem; }
  .container { width: calc(100% - 2rem); }
  .home .section { padding-block: 3.5rem; }
  .nav { gap: .3rem .8rem; }
  .brand { font-size: 1.4rem; }
  .nav-links { order: 3; width: 100%; gap: 1.4rem; border-top: 1px solid var(--line); }
  .nav-tools { gap: .4rem; }
  .hero { padding-block: 2.5rem 3rem; }
  .hero::before { -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 30%, #000 10%, transparent 75%); mask-image: radial-gradient(ellipse 90% 60% at 50% 30%, #000 10%, transparent 75%); }
  .hero-curve { display: none; }
  .button-lg { width: 100%; }
  .ascii-backdrop { opacity: .75; }
  .hero-copy::before, .section-intro::before { inset: -2rem -1.5rem; background: radial-gradient(closest-side, color-mix(in srgb, var(--paper) 85%, transparent) 60%, color-mix(in srgb, var(--paper) 0%, transparent)); }
  .facts { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 0; padding-inline: .5rem; }
  .fact:nth-child(2) { border: 0; }
  .site-grid { grid-template-columns: 1fr; }
  .site-body { padding: 1.15rem 1.2rem 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .rise, .hero-curve path { animation: none; }
  .hero-curve path { stroke-dashoffset: 0; }
  .motion-ready [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* The account (signin/ when signed in): a wider card with four tabs. Scannable: numbers, chips, one button each. */
.signin-card.is-account { width: min(980px, 100%); }
.acct-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.acct-who { flex: 1 1 14rem; min-width: 0; }
.acct-who .eyebrow { margin-bottom: .2rem; }
.acct-who h1 { margin: 0; font-size: clamp(1.5rem, 3.4vw, 1.9rem); overflow-wrap: anywhere; }
.acct-head .button[hidden] { display: none; }
.acct-tabs { display: flex; gap: .3rem; margin: 1.6rem 0 1.2rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.acct-tabs [role=tab] { flex: none; padding: .7rem 1rem; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; border-radius: 8px 8px 0 0; }
.acct-tabs [role=tab]:hover { color: var(--ink); background: var(--paper-deep); }
.acct-tabs [role=tab][aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); }
.acct-tabs [role=tab]:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.acct-panel[hidden] { display: none; }
.acct-courses, .acct-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.acct-course, .acct-product { display: flex; flex-direction: column; gap: .7rem; padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); min-width: 0; }
.acct-course.ended { opacity: .75; }
.acct-course-top, .acct-product-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.acct-course h3, .acct-product h3 { margin: 0; font-size: 1.15rem; }
.acct-chip { flex: none; padding: .1rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; border: 1px solid currentColor; }
.acct-chip.ok { color: var(--ok, #3f7d4e); }
.acct-chip.warn { color: #a06a12; }
.acct-chip.off { color: var(--muted); }
:root[data-theme='dark'] .acct-chip.ok { color: #8cc79a; }
:root[data-theme='dark'] .acct-chip.warn { color: #e2b45c; }
.acct-days { margin: 0; color: var(--muted); }
.acct-days strong { font: 600 2rem/1 var(--serif); color: var(--ink); margin-inline-end: .2rem; }
.acct-until { margin: .2rem 0 0; color: var(--muted); font-size: .92rem; }
.acct-bar { height: 8px; margin-top: .6rem; border-radius: 99px; background: var(--paper-deep); overflow: hidden; }
.acct-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.acct-ai { margin: 0; font-size: .92rem; color: var(--muted); }
.acct-ai b { color: var(--ink); }
.acct-ai.warn b { color: #a06a12; }
.acct-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: auto; }
.acct-site { display: inline-flex; align-items: center; min-height: 40px; padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; font-size: .92rem; }
.acct-site:hover { border-color: var(--accent); color: var(--accent); }
.acct-row .button { padding: .5rem 1rem; }
.acct-note { margin: 0; color: var(--muted); font-size: .88rem; }
.acct-empty { display: grid; justify-items: start; gap: .8rem; padding: 1.2rem; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); }
.acct-empty p { margin: 0; }
.acct-banner { margin: 0 0 1rem; padding: .8rem 1rem; border-radius: 12px; background: var(--accent-soft); color: var(--ink); }
.acct-price { margin: 0; color: var(--muted); }
.acct-price strong { font: 600 1.8rem/1 var(--serif); color: var(--ink); margin-inline-end: .15rem; }
.acct-save { margin: 0; color: var(--ok, #3f7d4e); font-weight: 700; font-size: .92rem; }
:root[data-theme='dark'] .acct-save { color: #8cc79a; }
.acct-opens { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.acct-opens li { display: flex; gap: .5rem; align-items: baseline; }
.acct-opens li::before { content: '✓'; color: var(--ok, #3f7d4e); font-weight: 700; }
.acct-buy { margin-top: auto; width: 100%; }
.acct-buy:disabled { background: var(--paper-deep); border-color: var(--line); color: var(--muted); cursor: default; box-shadow: none; transform: none; filter: none; }
.acct-bills { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
.acct-bills li { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.acct-bill-main { display: grid; gap: .15rem; min-width: 0; }
.acct-bill-main span { color: var(--muted); font-size: .9rem; }
.acct-bill-side { display: flex; align-items: center; gap: .6rem; }
.acct-bill-side strong { font: 600 1.2rem var(--serif); }
.acct-bill-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; }
.acct-receipt { display: inline-flex; align-items: center; min-height: 36px; padding: .2rem .8rem; border: 1px solid var(--line); border-radius: 10px; color: var(--accent); font-weight: 700; font-size: .9rem; text-decoration: none; }
.acct-receipt:hover { border-color: var(--accent); }
.acct-ref { color: var(--muted); font-size: .78rem; margin-inline-start: auto; }
.acct-details { display: grid; grid-template-columns: max-content 1fr; gap: .6rem 1.2rem; margin: 0 0 1rem; }
.acct-details dt { color: var(--muted); }
.acct-details dd { margin: 0; overflow-wrap: anywhere; text-align: start; }
@media (max-width: 560px) {
  .acct-bills li { grid-template-columns: 1fr; }
  .acct-tabs [role=tab] { padding: .6rem .7rem; }
}
.acct-who .signin-mail { width: fit-content; max-width: 100%; }
.signin { grid-template-columns: minmax(0, 1fr); }  /* the tabs scroll inside the card instead of widening the page */
@media (max-width: 560px) {  /* phones: the four tabs as a 2×2 grid, all in sight */
  .acct-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; border-bottom: 0; overflow: visible; }
  .acct-tabs [role=tab] { margin: 0; padding: .6rem .5rem; border: 1px solid var(--line); border-radius: 10px; text-align: center; white-space: normal; }
  .acct-tabs [role=tab][aria-selected=true] { border-color: var(--accent); background: var(--accent-soft); }
}

/* The shop by category (signin.js paintShop): a heading per category; a bundle is one card two cards wide. */
.acct-cat { margin: 1.6rem 0 .7rem; font-size: 1.05rem; color: var(--muted); font-weight: 700; }
.acct-panel > .acct-cat:first-child, .acct-banner + .acct-cat { margin-top: 0; }
.acct-product.wide { grid-column: 1 / -1; }
.acct-product.wide .acct-opens { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
@media (min-width: 720px) { .acct-product.wide .acct-buy { width: auto; min-width: 16rem; align-self: flex-start; } }
.acct-was { margin-inline: .2rem .1rem; color: var(--muted); font-size: 1rem; }

/* Partners (partners/): a partner's link, numbers and sales; for the owner, every partner and the payouts.
   Scannable: big numbers in tiles, one chip per sale, one button per action. */
.prt { width: min(1040px, 100%); margin: 2.5rem auto 4rem; display: grid; gap: 1.6rem; }
.prt[hidden], .prt [hidden] { display: none !important; }
.prt h1 { margin: 0; font-size: clamp(1.6rem, 3.6vw, 2.1rem); }
.prt h2 { margin: 0 0 .8rem; font-size: 1.25rem; font-weight: 700; }
.prt-card { padding: 1.3rem 1.4rem; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); min-width: 0; }
.prt-lead { margin: .4rem 0 0; color: var(--muted); }
.prt-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: .7rem; }
.prt-tile { padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.prt-tile b { display: block; font: 600 1.7rem/1.1 var(--serif); color: var(--ink); }
.prt-tile span { color: var(--muted); font-size: .88rem; }
.prt-tile.hot { border-color: var(--accent); background: var(--accent-soft); }
.prt-link { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.prt-link select, .prt-form input, .prt-form select { min-height: 42px; padding: .4rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; }
.prt-url { flex: 1 1 18rem; min-width: 0; padding: .55rem .8rem; border: 1px dashed var(--line); border-radius: 10px; background: var(--paper-deep); font-family: ui-monospace, monospace; font-size: .92rem; overflow-wrap: anywhere; direction: ltr; text-align: left; }
.prt-rules { margin: .8rem 0 0; padding: 0; list-style: none; display: grid; gap: .35rem; color: var(--muted); font-size: .92rem; }
.prt-rules li::before { content: '•'; color: var(--accent); margin-inline-end: .45rem; }
.prt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.prt-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.prt-list .grow { flex: 1 1 12rem; min-width: 0; display: grid; gap: .1rem; }
.prt-list .grow span { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.prt-list strong { font: 600 1.1rem var(--serif); }
.prt-empty { margin: 0; padding: 1rem; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }
.prt-partner { display: grid; gap: 1rem; }
.prt-partner-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.prt-partner-head h3 { margin: 0; font-size: 1.2rem; font-weight: 700; }
.prt-code { font-family: ui-monospace, monospace; color: var(--muted); direction: ltr; }
.prt-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.prt-actions .button, .prt-form .button { padding: .5rem 1rem; }
.prt-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .6rem; align-items: end; padding: 1rem; border-radius: 12px; background: var(--paper-deep); }
.prt-form label { display: grid; gap: .25rem; font-size: .88rem; color: var(--muted); }
.prt-form input[dir=ltr] { text-align: left; }
.prt-err { margin: 0; color: #b3412e; font-weight: 600; }
:root[data-theme='dark'] .prt-err { color: #f08a72; }
.prt details summary { cursor: pointer; color: var(--accent); font-weight: 700; }
.prt details[open] summary { margin-bottom: .7rem; }
.prt-mini { background: none; border: 1px solid var(--line); border-radius: 8px; padding: .2rem .6rem; color: var(--muted); font: inherit; font-size: .85rem; cursor: pointer; }
.prt-mini:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 560px) { .prt { margin-top: 1.4rem; } .prt-card { padding: 1rem; } .prt-tile b { font-size: 1.45rem; } }
.prt-steps { margin-top: 1.2rem; }
.prt-steps .prt-tile b { font-size: 1.5rem; }
.prt-agree { grid-column: 1 / -1; display: flex !important; align-items: center; gap: .5rem; color: var(--ink) !important; font-size: .95rem !important; }
.prt-agree input { width: 1.2rem; height: 1.2rem; min-height: 0; accent-color: var(--accent); }
#prt-join { margin-top: 1rem; }
.prt-preview { grid-column: 1 / -1; display: grid; gap: .3rem; }
.prt-preview-label { font-size: .88rem; color: var(--muted); }
.prt-preview .prt-url { border-style: solid; border-color: var(--accent); color: var(--ink); font-size: .84rem; }
.prt-preview.bad .prt-url { border-color: var(--line); color: var(--muted); }
.prt-preview.bad .prt-preview-label { color: #b3412e; }
:root[data-theme='dark'] .prt-preview.bad .prt-preview-label { color: #f08a72; }
.prt-form .button { white-space: nowrap; }
.acct-periods { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.acct-periods li { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .45rem .7rem; border-radius: 10px; background: var(--paper-deep); }
.acct-periods li span { display: grid; font-weight: 600; }
.acct-periods li small { color: var(--muted); font-weight: 400; font-size: .82rem; }
.acct-periods li b { font: 600 1.35rem/1 var(--serif); white-space: nowrap; }
.acct-periods li:first-child { background: var(--accent-soft); }

/* The owners' admin page (admin/): tiles, lists and forms of the partners page, the account page's tabs. */
.adm-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.adm .acct-tabs { margin: .2rem 0 0; }
.adm-tablink { flex: none; padding: .7rem 1rem; color: var(--muted); font-weight: 600; text-decoration: none; margin-inline-start: auto; }
.adm-tablink:hover { color: var(--accent); }
.adm .adm-h { margin: 1.6rem 0 .7rem; font-size: 1.05rem; color: var(--muted); font-weight: 700; }
.adm .acct-panel > .adm-h:first-child { margin-top: .4rem; }
#adm-status:empty { display: none; }
#adm-status { margin-bottom: -1rem; padding: .6rem 1rem; border-radius: 10px; background: var(--accent-soft); color: var(--ink); }
.adm-days { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.adm-day { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: .5rem; padding: .5rem .9rem; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.adm-day:first-child { border-top: 0; }
.adm-day-head { background: var(--paper-deep); color: var(--muted); font-size: .88rem; font-weight: 700; }
.adm-day.sold { background: var(--accent-soft); }
.adm-days.with-visitors .adm-day { grid-template-columns: 1.4fr 1fr 1fr 1fr 1.2fr; }
/* Visitors (Google Analytics): the tiles, one column a day for 30 days, a bar per site. One colour: the bars are one measure. */
.adm { --chart: #a94d31; }
:root[data-theme='dark'] .adm { --chart: #d98562; }
.adm .adm-sub { margin: 1.3rem 0 .6rem; font-size: .92rem; font-weight: 600; color: var(--muted); }
.adm-chart { padding-inline: 2.2rem .9rem; }
.adm-plot { position: relative; height: 11rem; margin-top: 1.2rem; }
.adm-grid { position: absolute; inset-inline: 0; height: 0; border-top: 1px solid var(--line); }
.adm-grid span { position: absolute; inset-inline-end: calc(100% + .5rem); top: -.65em; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.adm-cols { position: absolute; inset: 0; display: flex; align-items: stretch; }
.adm-col { flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0 1px; outline: 0; cursor: default; }
.adm-col i { position: relative; display: block; width: 100%; max-width: 24px; min-height: 0; border-radius: 4px 4px 0 0; background: var(--chart); }
.adm-col.now i { opacity: .55; }
.adm-col:hover i, .adm-col:focus-visible i { filter: brightness(1.18); opacity: 1; }
.adm-col:focus-visible { background: var(--paper-deep); }
.adm-col em { position: absolute; bottom: calc(100% + .2rem); left: 50%; transform: translateX(-50%); font: 600 .78rem/1 var(--sans, inherit); font-style: normal; color: var(--ink); font-variant-numeric: tabular-nums; }
.adm-tip { position: absolute; top: 0; z-index: 2; display: grid; gap: .1rem; width: max-content; max-width: 16rem; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-deep); color: var(--muted); font-size: .82rem; pointer-events: none; box-shadow: 0 6px 18px rgb(0 0 0 / .18); }
.adm-tip[hidden] { display: none; }
.adm-tip b { color: var(--ink); font-size: .98rem; }
.adm-axis { display: flex; margin-top: .35rem; color: var(--muted); font-size: .78rem; }
.adm-axis span { flex: 1 1 0; min-width: 0; display: flex; justify-content: center; white-space: nowrap; overflow: visible; }
.adm-sites { display: grid; gap: .55rem; }
.adm-site { display: grid; grid-template-columns: minmax(8.5rem, 13rem) 1fr 3rem; align-items: center; gap: .8rem; }
.adm-site-name { text-align: end; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-site-bar { display: block; height: 8px; border-radius: 4px; background: var(--paper-deep); overflow: hidden; }
.adm-site-bar i { display: block; height: 100%; border-radius: 4px; background: var(--chart); }
.adm-site b { font: 600 1rem var(--serif); font-variant-numeric: tabular-nums; }
.adm-vis > .acct-note { margin-top: 1rem; }
.adm-connect { display: grid; gap: .5rem; }
.adm-connect b { color: var(--ink); }
.adm-copy { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.adm-copy code { padding: .3rem .6rem; border-radius: 8px; background: var(--paper-deep); color: var(--ink); font-size: .85rem; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .adm-days.with-visitors .adm-day { grid-template-columns: 1.5fr .9fr .8fr .8fr 1fr; }
  .adm-plot { height: 9rem; }
  .adm-site { grid-template-columns: 1fr 3rem; gap: .2rem .8rem; }
  .adm-site-name { grid-column: 1 / -1; text-align: right; }
}
.adm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin: .3rem 0 .8rem; }
.adm-zoom-side { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.adm-zoom-side .button { min-height: 2.1rem; padding: 0 .8rem; font-size: .92rem; }
.adm-search { flex: 1 1 16rem; min-height: 42px; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; }
.adm-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.prt-mini.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.adm-add { padding: .9rem 1.1rem; margin-bottom: 1rem; }
.adm-add .prt-form { margin-top: .8rem; }
.adm-student { align-items: flex-start !important; }
.adm-student .grow b { overflow-wrap: anywhere; text-align: start; }
.adm-student .prt-form { flex-basis: 100%; }
.adm-courses { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.adm-courses .acct-chip { display: inline-flex; align-items: center; gap: .3rem; white-space: normal; }
.adm-x { border: 0; background: none; color: inherit; font: inherit; font-weight: 700; cursor: pointer; padding: 0 .1rem; line-height: 1; opacity: .7; }
.adm-x:hover { opacity: 1; }
.adm-side { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }
@media (max-width: 560px) { .adm-day { grid-template-columns: 1.3fr .8fr .8fr 1.1fr; padding: .45rem .6rem; font-size: .9rem; } .adm-side { flex-direction: row; align-items: center; } }
.adm-sort { min-height: 42px; padding: .4rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; }
.adm-use { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin-top: .45rem; padding: .45rem .7rem; border-radius: 10px; background: var(--paper-deep); font-size: .88rem; color: var(--muted); }
.adm-use b { color: var(--ink); }
