/* Partner portal - self contained, no external resources (strict CSP).
   The colour of the portal comes from index.php?view=themecss (--accent, --on-accent, --accent-strong, --accent-soft, --accent-ring).
   Font: Noto Sans (SIL Open Font License, fonts/OFL.txt), served from the module. */
@font-face { font-family: "Noto Sans"; font-style: normal; font-weight: 100 900; font-stretch: 62.5% 100%; font-display: swap; src: url("../fonts/noto-sans-latin-wght-normal.woff2") format("woff2-variations"), url("../fonts/noto-sans-latin-wght-normal.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: "Noto Sans"; font-style: normal; font-weight: 100 900; font-stretch: 62.5% 100%; font-display: swap; src: url("../fonts/noto-sans-latin-ext-wght-normal.woff2") format("woff2-variations"), url("../fonts/noto-sans-latin-ext-wght-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
	--accent: #5b3df5; --on-accent: #ffffff; --accent-strong: #382698; --accent-soft: rgba(91,61,245,.10); --accent-ring: rgba(91,61,245,.35); --accent-2: #9b3df5;
	--navy: #21263c;
	--bg: #f5f4fb; --surface: #ffffff; --surface-2: #f8f7fd; --tint: #f6f4ff;
	--text: #21263c; --muted: #6e7191; --border: #e8e6f3; --line: #f0eef8;
	--ok: #1f8a5b; --warn: #b26a12; --err: #c93c3c; --info: #2f6fc4;
	--ok-soft: rgba(46,158,107,.11); --warn-soft: rgba(217,138,28,.12); --err-soft: rgba(214,69,69,.10); --info-soft: rgba(61,127,214,.10);
	--shadow: 0 1px 4px rgba(33,38,60,.05);
	--shadow-lg: 0 6px 16px rgba(33,38,60,.10);
	--focus: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
	--radius: 20px; --radius-sm: 12px;
	--sidebar: 256px; --sidebar-compact: 80px; --topbar: 64px;
	color-scheme: light;
}
[data-theme="dark"] {
	--bg: #12131c; --surface: #1a1b27; --surface-2: #212233; --tint: #232339;
	--text: #eceaf7; --muted: #9c9bb5; --border: #2b2c40; --line: #24253a;
	--ok: #5cc994; --warn: #e9a94a; --err: #ef7a7a; --info: #78a9ef;
	--ok-soft: rgba(92,201,148,.13); --warn-soft: rgba(233,169,74,.13); --err-soft: rgba(239,122,122,.13); --info-soft: rgba(120,169,239,.13);
	--shadow: 0 1px 4px rgba(0,0,0,.3);
	--shadow-lg: 0 6px 16px rgba(0,0,0,.45);
	color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.is-app { background: radial-gradient(color-mix(in srgb, var(--accent) 16%, transparent) 1px, transparent 1.4px) 0 0 / 22px 22px, var(--bg); background-attachment: fixed; }
body { margin: 0; font: 15px/1.6 "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }

a { color: var(--accent-strong); }
.sprite { display: none; }
.ico { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }

/* ---------- App layout: sidebar + top bar ---------- */
.navdrawer-toggle { position: absolute; opacity: 0; pointer-events: none; }
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
[data-nav="compact"] .app { grid-template-columns: var(--sidebar-compact) minmax(0, 1fr); }
.sidebar { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); margin: 12px 0 12px 12px; border-radius: var(--radius); padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; color: var(--text); text-decoration: none; min-width: 0; }
.brand-logo { width: 38px; height: 38px; border-radius: 11px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; letter-spacing: .5px; flex: none; font-size: .9rem; }
.brand-logo.has-img { display: flex; align-items: center; justify-content: center; box-sizing: border-box; background: #fff; padding: 3px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.brand-logo.has-img img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; display: block; }
.brand-name { font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-name small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; }
/* Brand chosen in the setup: logo only (name kept for screen readers) or name only (initials only in the collapsed menu) */
.brandmode-logo .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.brand-logo.only-compact { display: none; }
[data-nav="compact"] .sidebar .brand-logo.only-compact { display: grid; }
.brandmode-logo .brand-logo.has-img { width: auto; height: 46px; max-width: 200px; padding: 0; background: transparent; box-shadow: none; border-radius: 0; }
.sidebar .brand { padding: 8px 8px 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { display: block; padding: 16px 12px 6px; color: var(--muted); font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; opacity: .8; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; transition: background .15s ease, color .15s ease; text-decoration: none; white-space: nowrap; position: relative; }
.nav a .ico { width: 18px; height: 18px; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; }
.nav a.active .ico { color: var(--accent); }
/* Dark theme: a solid tint of the brand with white text, never the translucent one (it looks muddy) */
[data-theme="dark"] .nav a.active { background: color-mix(in srgb, var(--accent) 28%, var(--surface)); color: #fff; }
[data-theme="dark"] .nav a.active .ico { color: color-mix(in srgb, var(--accent) 45%, #fff); }
.nav .count { margin-left: auto; background: var(--accent); color: var(--on-accent); font-size: .7rem; font-weight: 700; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 99px; }
.nav-sep { display: block; height: 1px; background: var(--line); margin: 10px 8px; }
.sidebar-foot { margin-top: auto; padding-top: 10px; flex: none; }
/* The list of the menu scrolls when it does not fit: the account of the user always stays visible at the bottom */
.sidebar { overflow: hidden; top: 12px; height: calc(100vh - 24px); height: calc(100dvh - 24px); }
.nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.usercard { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 8px; border-radius: 14px; background: var(--surface-2); min-width: 0; }
.usercard .who { font-size: .85rem; line-height: 1.2; min-width: 0; flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usercard .who small { color: var(--muted); display: block; font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.usercard form { margin: 0; }
.usercard-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--text); text-decoration: none; border-radius: 8px; }
.usercard:hover, .usercard.active { background: var(--tint); }
.usercard.active .who { color: var(--accent-strong); }
.usercard .avatar.xs { background: var(--accent); color: var(--on-accent); width: 32px; height: 32px; border-radius: 10px; }
/* Compact menu: icons only */
[data-nav="compact"] .sidebar { padding: 14px 10px; }
[data-nav="compact"] .sidebar .brand { justify-content: center; padding: 4px 0 16px; }
[data-nav="compact"] .sidebar .brand-name, [data-nav="compact"] .nav .label, [data-nav="compact"] .usercard .who { display: none; }
[data-nav="compact"] .nav-label { height: 1px; padding: 0; margin: 10px 8px; background: var(--line); font-size: 0; }
[data-nav="compact"] .nav a { justify-content: center; padding: 11px 0; }
[data-nav="compact"] .nav .count { position: absolute; top: 4px; right: 6px; min-width: 16px; padding: 0 4px; font-size: .62rem; }
[data-nav="compact"] .usercard { flex-direction: column; padding: 8px 4px; gap: 6px; }
[data-nav="compact"] .usercard-link { justify-content: center; }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar); display: flex; align-items: center; gap: 10px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.topbar-sep { width: 1px; height: 22px; background: var(--border); }
.topbar-title { font-weight: 600; font-size: .9rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .brand { padding: 0; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.iconbtn { position: relative; width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text); display: inline-grid; place-items: center; cursor: pointer; padding: 0; font: inherit; flex: none; }
.iconbtn:hover { background: var(--surface); box-shadow: var(--shadow); }
.iconbtn.ghost { color: var(--muted); }
.themebtn .when-dark, [data-theme="dark"] .themebtn .when-light { display: none; }
[data-theme="dark"] .themebtn .when-dark { display: inline-grid; }
.themebtn .when-light { display: inline-grid; }
.only-mobile { display: none !important; }
.main { padding: 22px 36px 64px; width: 100%; max-width: 1260px; margin: 0 auto; }

/* Notifications (details/summary works without JavaScript) */
details.notif { position: relative; }
details.notif > summary { list-style: none; }
details.notif > summary::-webkit-details-marker { display: none; }
details.notif[open] > summary { background: var(--surface); box-shadow: var(--shadow); }
.notif-dot { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--err); color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 330px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px; z-index: 40; }
.notif-head { font-weight: 700; padding: 8px 10px 10px; font-size: .9rem; }
.notif-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: .9rem; }
.notif-item:hover { background: var(--surface-2); }
.notif-item > span:nth-child(2) { flex: 1; }
.notif-item > .ico { color: var(--muted); width: 16px; height: 16px; }
.notif-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.notif-icon .ico { width: 18px; height: 18px; }
.tone-info { background: var(--info-soft); color: var(--info); } .tone-warn { background: var(--warn-soft); color: var(--warn); } .tone-err { background: var(--err-soft); color: var(--err); } .tone-ok { background: var(--ok-soft); color: var(--ok); }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.notif-head form { margin: 0; }
.notif-head .linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: .8rem; font-weight: 600; color: var(--accent-strong); cursor: pointer; }
.notif-head .linkbtn:hover { text-decoration: underline; }
.notif-group { padding: 10px 10px 4px; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.notif-list { max-height: min(420px, 60vh); overflow-y: auto; }
.notif-item.notice { align-items: flex-start; padding: 0; gap: 0; }
.notice-link { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 12px; padding: 10px; color: inherit; text-decoration: none; border-radius: var(--radius-sm); }
.notif-item.notice form { margin: 0; padding: 8px 6px 0 0; }
.notice-close { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; padding: 0; }
.notice-close:hover { background: var(--surface); color: var(--text); }
.notice-close .ico { width: 15px; height: 15px; }
.notif-item.notice .notif-icon { background: var(--surface-2); color: var(--muted); }
.notif-item.notice.unread .notif-icon { background: var(--accent-soft); color: var(--accent-strong); }
.notice-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notice-text b { font-weight: 500; line-height: 1.35; }
.notif-item.notice:not(.unread) .notice-text b { color: var(--muted); }
.notif-item.unread .notice-text b { font-weight: 700; }
.notice-text small { color: var(--muted); font-size: .8rem; line-height: 1.4; overflow-wrap: anywhere; }
.notice-text time { color: var(--muted); font-size: .72rem; }
.notif-empty { display: flex; align-items: center; gap: 10px; padding: 14px 10px; color: var(--muted); }
.notif-empty .ico { color: var(--ok); }

.scrim { display: none; }

/* ---------- Login / registration ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(1000px 500px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.auth-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; max-width: 1100px; width: 100%; margin: 0 auto; }
.auth-top .brand { padding: 0; }
.auth-main { width: 100%; max-width: 760px; margin: 0 auto; padding: 12px 16px 48px; }
.login-box { max-width: 420px; margin: 24px auto; }
.login-box.card { padding: 28px; }
.login-box form .btn[type=submit], .login-box > form > .btn { width: 100%; padding: 12px 18px; }

/* ---------- Typography and page head ---------- */
h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; margin: 0 0 18px; line-height: 1.15; }
h2 { font-size: 1.05rem; font-weight: 700; letter-spacing: -.005em; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.pagehead h1 { margin: 0; }
.pagehead p { margin: 10px 0 0; color: var(--muted); }
/* Small pill above the title, with a dot of the colour of the brand */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 4px 12px 4px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: .8rem; font-weight: 600; box-shadow: var(--shadow); }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.eyebrow::first-letter { text-transform: uppercase; }
/* A word of the title on a block of the colour of the brand */
h1 .hl { display: inline-block; padding: 0 .3em .04em; border-radius: .28em; background: var(--accent); color: var(--on-accent); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.right { text-align: right; }
.center { text-align: center; }
.inline { display: inline; }
.margintop { margin-top: 14px; }
.hidden { display: none !important; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card > h2:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 18px; }
.grid > .card { margin-bottom: 0; }
.grid.products { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.kpi { font-size: 1.7rem; font-weight: 700; letter-spacing: -.3px; }

/* Dashboard */
/* Figures of the dashboard: one strip, four values separated by thin lines */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.figure { display: flex; flex-direction: column; gap: 6px; padding: 20px 24px; color: var(--text); text-decoration: none; min-width: 0; border-left: 1px solid var(--line); transition: background .15s ease; }
.figure:first-child { border-left: 0; }
a.figure:hover { background: var(--tint); }
.figure-label { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.figure-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.figure-sub { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 10px; }
.panel-title { flex: 1; min-width: 0; }
.panel-head h2 { margin: 0; font-size: 1rem; }
.panel-head a { font-size: .84rem; font-weight: 600; text-decoration: none; white-space: nowrap; color: var(--accent-strong); }
.panel-head a:hover { text-decoration: underline; text-underline-offset: 3px; }
.panel-sub { margin: 3px 0 0; color: var(--muted); font-size: .9rem; }
.list { list-style: none; margin: 0; padding: 10px 12px; }
.list li > a, .list li > .row-in { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.list li > a:hover { background: var(--tint); }
.list-empty { padding: 8px 24px 22px; color: var(--muted); font-size: .9rem; }
.day { width: 46px; text-align: center; border-radius: 10px; background: var(--surface-2); padding: 5px 0; flex: none; }
.day b { display: block; font-size: 1.05rem; line-height: 1.1; }
.day span { font-size: .66rem; text-transform: uppercase; color: var(--muted); font-weight: 600; letter-spacing: .5px; }
.day.today { background: var(--accent); color: var(--on-accent); }
.day.today span { color: inherit; opacity: .85; }
.li-main { flex: 1; min-width: 0; }
.li-main b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-main small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.dot.read { background: transparent; }

/* Disclosure inside the pages (e.g. "Notify an absence") */
.main details:not(.pop):not(.planfold):not(.pop-inline) > summary { cursor: pointer; color: var(--accent-strong); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.main details:not(.pop):not(.planfold):not(.pop-inline) > summary::-webkit-details-marker { display: none; }
.main details:not(.pop):not(.planfold):not(.pop-inline) > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s ease; margin-right: 2px; }
.main details[open]:not(.pop):not(.planfold):not(.pop-inline) > summary::before { transform: rotate(45deg); }
.main details[open]:not(.pop):not(.planfold):not(.pop-inline) > summary { margin-bottom: 10px; }

/* ---------- Badges / pills ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .74rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; line-height: 1.5; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.new { background: var(--accent); color: var(--on-accent); }

/* ---------- Alerts ---------- */
.alert { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 12px 16px 12px 44px; border-radius: 14px; margin-bottom: 16px; border: 1px solid transparent; font-weight: 500; font-size: .92rem; position: relative; }
.alert::before { content: ""; position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px; background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat; }
.alert a { color: inherit; font-weight: 700; text-underline-offset: 3px; }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 14%, transparent); }
.alert-error { background: var(--err-soft); color: var(--err); border-color: color-mix(in srgb, var(--err) 14%, transparent); }
.alert-warning { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 16%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 14%, transparent); }

/* ---------- Buttons ---------- */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 30%, transparent); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; transition: filter .15s ease, background .15s ease; }
.btn .ico { width: 18px; height: 18px; }
.btn:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.danger { background: transparent; color: var(--err); border-color: var(--err); }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-strong); cursor: pointer; }

/* ---------- Forms ---------- */
form .field { margin-bottom: 16px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
label.check { font-weight: normal; display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
button, input, select, textarea { font-family: inherit; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=number], input[type=search], select, textarea {
	width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; transition: border-color .15s ease, box-shadow .15s ease; }
input:focus, select:focus, textarea:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: var(--focus); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 17px; height: 17px; margin-top: 2px; }
input[type=file] { font: inherit; color: var(--muted); }
.row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Styled select of portal.js (desktop browsers without customizable select): same look as the native one */
.fsel { position: relative; }
.fsel-native { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; pointer-events: none; }
.fsel-btn { display: block; width: 100%; text-align: left; padding: 10px 40px 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 42px; transition: border-color .15s ease, box-shadow .15s ease; }
.fsel-btn::after { content: ""; position: absolute; right: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px; background: var(--muted); transition: transform .15s ease;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; }
.fsel-btn:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: var(--focus); }
.fsel-btn:disabled { opacity: .6; cursor: default; }
.fsel.open .fsel-btn { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: var(--focus); }
.fsel.open .fsel-btn::after { transform: rotate(180deg); }
.fsel-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; max-height: 280px; overflow-y: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.fsel.up .fsel-list { top: auto; bottom: calc(100% + 6px); }
.fsel-list li { padding: 9px 12px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fsel-list li.active { background: var(--surface-2); }
.fsel-list li[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.fsel-list li[aria-selected="true"]::after { content: ""; width: 16px; height: 16px; flex: none; background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat; }
.fsel-list li[aria-disabled="true"] { opacity: .5; cursor: default; }
.fsel.sortselect { display: inline-block; width: auto; }
.fsel.sortselect .fsel-btn { height: 44px; border-radius: 12px; min-width: 180px; }

/* Selects: own chevron; the list itself is styled where the browser allows it (customizable select) */
select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7a75' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
select[multiple], select[size] { background-image: none; padding-right: 12px; }
@supports (appearance: base-select) {
	select:not([multiple]):not([size]) { appearance: base-select; background-image: none; display: flex; align-items: center; }
	select:not([multiple]):not([size])::picker-icon { content: ""; width: 18px; height: 18px; margin-left: auto; background: currentColor; color: var(--muted);
		-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
		mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
		transition: transform .15s ease; }
	select:open::picker-icon { transform: rotate(180deg); }
	select:not([multiple]):not([size])::picker(select) { appearance: base-select; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); padding: 6px; margin-top: 6px; }
	select option { padding: 9px 12px; border-radius: 8px; }
	select option:hover, select option:focus-visible { background: var(--surface-2); outline: none; }
	select option:checked { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
	select option::checkmark { display: none; }
}

/* ---------- Tables ---------- */
.table-wrap { margin: 0 -4px; }
@media (max-width: 1100px) and (min-width: 861px) { .table-wrap { overflow-x: auto; } }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--tint); }
/* Buttons of a row always at the end of the line: the column takes only the width of its buttons */
td.actions { width: 1%; white-space: nowrap; }
.rowactions { display: flex; flex-wrap: nowrap; justify-content: flex-end; align-items: center; gap: 8px; }
.rowactions form { margin: 0; display: block; }
td.actions .btn { vertical-align: middle; }
td.actions .btn .ico { width: 16px; height: 16px; }
th { font-size: .78rem; color: var(--muted); font-weight: 700; background: var(--surface-2); }
th:first-child { border-top-left-radius: 10px; border-bottom-left-radius: 10px; } th:last-child { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
thead th { border-bottom: 0; }

/* ---------- Members switcher (chips) ---------- */
.switcher { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); font-size: .88rem; font-weight: 500; }
.chip:has(.avatar) { padding-left: 5px; }
.chip:hover { background: var(--tint); }
.chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.switcher.sub { margin-top: -8px; }
.switcher.sub .chip { font-size: .85rem; padding: 4px 12px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--accent-soft); color: var(--accent-strong); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.avatar.xs { width: 26px; height: 26px; font-size: .68rem; }
.student-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.student-head h1 { margin: 0 0 12px; line-height: 1.2; }
.h1-note { font-size: .9rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.student-info { flex: 1; min-width: 0; padding-top: 8px; }
.student-info dl.data { margin: 0; }
.panel-head.nopad { padding: 0; margin-bottom: 14px; }
div.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.student-head h2 { margin: 0; }
dl.data { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; align-items: baseline; }
dl.data dt { color: var(--muted); }
dl.data dd { margin: 0; }
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 14px; }

/* Billing summary (payments) */
.card.billing-summary { display: flex; align-items: center; gap: 14px; }
.card.billing-summary .li-main small:first-child { text-transform: uppercase; letter-spacing: .5px; font-weight: 600; font-size: .72rem; }

/* Photos always fit inside the frame of fixed size, whatever their proportions */
.thumb img, .mini img, .gallery .big img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gthumbs img { object-fit: contain !important; background: var(--surface-2); }
.noimg { display: grid !important; place-items: center; color: var(--accent-strong); background: radial-gradient(circle at 30% 20%, var(--accent-soft), transparent 60%), var(--surface-2); }
.thumb.noimg .ico { width: 52px; height: 52px; stroke-width: 1.3; opacity: .8; }
.ptag { position: absolute; top: 10px; left: 10px; background: rgba(14,19,18,.66); color: #fff; backdrop-filter: blur(6px); font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.pbody { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pbody h3 { margin: 0; font-size: 1rem; }
.pbody h3 a { color: var(--text); text-decoration: none; }
.pbody h3 a:hover { color: var(--accent-strong); }
.pdesc { margin: 0; color: var(--muted); font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pvals { display: flex; gap: 5px; flex-wrap: wrap; }
.pvals span { font-size: .7rem; font-weight: 700; border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; color: var(--muted); }
.pfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; }
.pfoot form { margin: 0; }
.price { font-size: 1.2rem; font-weight: 800; letter-spacing: -.3px; line-height: 1.2; }
.price small { display: block; font-size: .7rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.price small.from { text-transform: uppercase; font-weight: 600; letter-spacing: .4px; }
.price.big { font-size: 1.6rem; }
.btn.block { width: 100%; padding: 12px 18px; }
/* ---------- Confirmation modal (native <dialog>) ---------- */
dialog.modal { border: 0; padding: 0; background: transparent; max-width: 480px; width: calc(100% - 32px); color: var(--text); }
dialog.modal::backdrop { background: rgba(10, 14, 22, .55); backdrop-filter: blur(3px); }
dialog.modal article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
dialog.modal header { padding: 18px 22px 0; }
dialog.modal header h3 { margin: 0; font-size: 1.05rem; }
dialog.modal p { margin: 0; padding: 12px 22px 20px; color: var(--muted); }
dialog.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; background: var(--surface-2); }
dialog.modal .btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
dialog.modal[open] article { animation: commodalin .18s ease-out; }
@keyframes commodalin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.modal[open] article { animation: none; } .app { transition: none; } }

/* ---------- Tablet / phone ---------- */
@media (max-width: 1100px) {
	.figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.figure:nth-child(3) { border-left: 0; }
	.figure:nth-child(n+3) { border-top: 1px solid var(--line); }
	.shop-layout { grid-template-columns: minmax(0, 1fr); }
	.shop-layout > .cart { display: none; }
	.cartbar { display: flex; position: sticky; bottom: 16px; z-index: 15; margin-top: 18px; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; box-shadow: var(--shadow-lg); }
	.cartbar span { flex: 1; }
	.pdetail { grid-template-columns: minmax(0, 1fr); }
	.gallery .big { aspect-ratio: 4 / 3; }
}
@media (max-width: 860px) {
	.app, [data-nav="compact"] .app { grid-template-columns: minmax(0, 1fr); }
	.only-mobile { display: inline-flex !important; }
	.only-desktop { display: none !important; }
	/* Sidebar becomes a drawer, opened from the top bar or "More" */
	.sidebar, [data-nav="compact"] .sidebar { background: var(--surface); margin: 0; border-radius: 0 var(--radius) var(--radius) 0; position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); padding: 14px 12px; }
	[data-nav="compact"] .sidebar .brand-name, [data-nav="compact"] .nav .label, [data-nav="compact"] .usercard .who { display: block; }
	[data-nav="compact"] .nav a { justify-content: flex-start; padding: 10px 12px; }
	[data-nav="compact"] .nav-label { height: auto; padding: 16px 12px 6px; margin: 0; background: none; font-size: .7rem; }
	[data-nav="compact"] .nav .count { position: static; }
	[data-nav="compact"] .usercard { flex-direction: row; }
	[data-nav="compact"] .usercard-link { justify-content: flex-start; }
	[data-nav="compact"] .sidebar .brand { justify-content: flex-start; }
	.navdrawer-toggle:checked ~ .app .sidebar { transform: none; }
	.scrim { display: none; position: fixed; inset: 0; background: rgba(8,12,11,.45); z-index: 25; }
	.navdrawer-toggle:checked ~ .app .scrim { display: block; }
	.topbar { padding: 0 12px; }
	.topbar .brand-name { font-size: .95rem; }
	.topbar .brand-logo { width: 32px; height: 32px; font-size: .8rem; border-radius: 9px; }
	.main { padding: 18px 16px calc(28px + env(safe-area-inset-bottom)); }
	.cols { grid-template-columns: minmax(0, 1fr); }
	.figure { padding: 14px 16px; }
	.figure-value { font-size: 1.3rem; }
	.row { grid-template-columns: 1fr; }
	th.hide-sm, td.hide-sm { display: none; }
	h1 { font-size: 1.6rem; }
	.pagehead { margin-bottom: 20px; }
	.pagehead > .btn { width: 100%; }
	.card.announcement { gap: 12px; }
	.chat .msg { max-width: 92%; }
	.cartbar { bottom: calc(14px + env(safe-area-inset-bottom)); }
	.grid.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.pbody { padding: 10px 12px 12px; }
	.pdesc { display: none; }
	.pfoot { flex-direction: column; align-items: stretch; }
	.pfoot .btn, .pfoot form .btn { width: 100%; }
	.price { font-size: 1.05rem; }
	.pinfo { padding: 18px; }
}

/* ---------- Cards of data (member, account) ---------- */
.sectiontitle { margin: 28px 0 14px; font-size: 1.15rem; }
.cardfoot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.photoedit { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.photoedit form { margin: 0; }
.photoedit div.actions { margin-top: 14px; flex-wrap: nowrap; }
.photoedit div.actions .btn { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; white-space: nowrap; }
.login-box div.actions { gap: 10px; margin-top: 6px; }
.login-box div.actions > .btn { flex: 1 1 100%; text-align: center; }
dl.data dd { overflow-wrap: anywhere; min-width: 0; }
dl.data dd.alertval { color: var(--err); font-weight: 600; }

@media (max-width: 860px) {
	/* Drawer: full visible height of the phone, the account of the user at the top */
	.sidebar, [data-nav="compact"] .sidebar { height: 100vh; height: 100dvh; }
	/* The menu scrolls; the account of the user stays visible at the bottom */
	.sidebar, [data-nav="compact"] .sidebar { overflow: hidden; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
	.sidebar .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
	.sidebar .sidebar-foot { flex: none; margin-top: 0; padding-top: 10px; }
	/* Head of a member / of the account: photo and name on a line, the data below on the whole width */
	.student-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; align-items: center; }
	.student-info { display: contents; }
	.student-head h1 { margin: 0; font-size: 1.25rem; }
	.h1-note { display: block; margin-top: 2px; }
	.student-info dl.data { grid-column: 1 / -1; }
	dl.data { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); gap: 8px 14px; }
	.avatar { width: 52px; height: 52px; }
	.avatar.xs { width: 26px; height: 26px; }
	/* Tables as cards: one block per row, the title of the column before each value */
	table.cardtable, table.cardtable tbody, table.cardtable tr, table.cardtable td { display: block; width: 100%; }
	table.cardtable thead { display: none; }
	.table-wrap { overflow: visible; margin: 0; }
	table.cardtable tr { padding: 16px 0; border-bottom: 1px solid var(--border); }
	table.cardtable tr:last-child { border-bottom: 0; }
	table.cardtable td { border: 0; padding: 6px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
	table.cardtable td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; text-align: left; flex: none; max-width: 45%; }
	table.cardtable td:not([data-label])::before, table.cardtable td[data-label=""]::before { display: none; }
	/* The first cell is the title of the card (no label) */
	table.cardtable td:first-child { font-weight: 700; font-size: 1rem; justify-content: flex-start; text-align: left; padding-bottom: 6px; }
	table.cardtable td:first-child::before { display: none; }
	table.cardtable td.cellstack { flex-direction: column; align-items: flex-start; text-align: left; gap: 4px; }
	table.cardtable .cellval { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 6px; }
	table.cardtable td.cellstack .cellval { display: block; width: 100%; }
	table.cardtable td:first-child .cellval { justify-content: flex-start; }
	table.cardtable td.cellstack::before { max-width: none; }
	table.cardtable td:empty, table.cardtable td.isempty { display: none !important; }
	table.cardtable td.hide-sm { display: flex; }
	tbody tr:hover td { background: transparent; }
	table.cardtable td.actions { width: 100%; padding-top: 10px; justify-content: flex-end; }
	table.cardtable td.actions::before { display: none; }
	.rowactions { flex-wrap: wrap; }
	table.cardtable td details { text-align: left; }
}

/* Sections reached with an anchor are not hidden under the sticky top bar */
.card[id] { scroll-margin-top: calc(var(--topbar) + 16px); }

@media (max-width: 560px) {
	ul.people li { grid-template-columns: auto 1fr; padding: 12px 14px; }
	.people-action { grid-column: 1 / -1; justify-self: stretch; text-align: center; }
}
ul.people .avatar.xs { width: 38px; height: 38px; font-size: .8rem; }
@media (max-width: 560px) {
	#m-contacts .panel-head { flex-wrap: wrap; gap: 10px; }
	#m-contacts .panel-head .btn { width: 100%; justify-content: center; }
}

/* Section title inside a card, after a data list or another block */
.card h2.section { margin: 26px 0 12px; padding-top: 18px; border-top: 1px solid var(--border); }
.scoreval { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
/* Attachments of a message or a request */
.field.attach { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.attach-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.attach-btn .ico { width: 16px; height: 16px; margin-right: 6px; }
.attach-input:focus-visible + .attach-list, .attach-btn:focus-within { outline: 2px solid var(--accent); }
.attach-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.attach-list:empty { display: none; }
.attach-list li { padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface-2); word-break: break-all; }
.msg-files { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.filechip { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.filechip:hover { border-color: var(--accent); }
.filechip-icon { width: 32px; height: 32px; flex: none; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-strong); }
.filechip-icon .ico { width: 16px; height: 16px; }
.filechip-text { display: flex; flex-direction: column; min-width: 0; }
.filechip-text b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filechip-text small { color: var(--muted); font-size: .78rem; }
/* The company sees the portal as a partner (read only) */
.viewas-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; border: 1px dashed var(--accent); }
.viewas-banner .ico { width: 18px; height: 18px; flex: none; }
.auth-top .brand-logo.has-img { width: 52px; height: 52px; border-radius: 14px; }

/* Password with the eye button to show it */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 46px; }
.pwd-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.pwd-toggle:hover, .pwd-toggle:focus-visible { color: var(--text); background: var(--surface-2); outline: none; }
.pwd-toggle .ico { width: 20px; height: 20px; }


.iconbtn.active { background: var(--accent-soft); color: var(--accent-strong); }

/* Partner portal additions */
.amount-pos { color: var(--ok, #1a8754); font-weight: 700; }
.amount-neg { color: var(--err, #c0392b); font-weight: 700; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.tl li:last-child { border-bottom: 0; }
.tl time { color: var(--muted); min-width: 100px; }
.condok { color: var(--ok, #1a8754); }
.condko { color: var(--muted); }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.formgrid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .formgrid { grid-template-columns: minmax(0, 1fr); } }
.apply-box { max-width: 720px; margin: 0 auto; }
.tlwrap { padding: 0 18px 12px; }

/* ---------- Access pages: brand panel on the left, the form on the right ---------- */
:root { --ink: #1c1a27; --primary: #4938f5; --secondary: #9a3cf0; }
.split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--surface); border-top: 4px solid transparent; border-image: linear-gradient(90deg, var(--accent), var(--accent-2)) 1; }
.split-side { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 56px 48px; background: #f7f6fd; color: var(--ink); }
.split-side::before, .split-side::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.split-side::before { width: 520px; height: 520px; right: -180px; top: -160px; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 20%, transparent) 0%, transparent 65%); }
.split-side::after { width: 460px; height: 460px; left: -160px; bottom: -200px; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 12%, transparent) 0%, transparent 65%); }
.split-side-in { position: relative; z-index: 1; max-width: 460px; width: 100%; }
.split-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1rem; }
.split-brand .brand-logo:not(.has-img) { background: var(--accent); color: var(--on-accent); }
.split-badge { display: table; margin-top: 36px; padding: 6px 16px; border-radius: 999px; background: var(--accent); background-image: linear-gradient(to right, var(--accent), var(--accent-2)); color: var(--on-accent); font-size: .82rem; font-weight: 600; letter-spacing: .2px; }
.split-title { margin: 18px 0 16px; font-size: 2.6rem; line-height: 1.1; font-weight: 800; letter-spacing: -1.2px; color: var(--ink); }
.split-title span { background: linear-gradient(transparent 68%, color-mix(in srgb, var(--accent) 30%, transparent) 68%, color-mix(in srgb, var(--accent) 30%, transparent) 94%, transparent 94%); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.split-text { margin: 0 0 26px; color: #55536a; font-size: 1.02rem; line-height: 1.6; }
.split-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.split-points li { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--ink); }
.split-points li::before { content: "\2713"; flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--accent); font-weight: 800; box-shadow: 0 2px 10px rgba(40,30,90,.10); }
.split-main { position: relative; display: flex; align-items: center; justify-content: center; padding: 56px 24px; background: var(--surface); }
.split-theme { position: absolute; top: 16px; right: 16px; }
.split-content { width: 100%; max-width: 380px; }
.split-content .alert { margin-bottom: 16px; border-radius: 12px; }
.authbox h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.4px; margin: 0 0 22px; color: var(--text); }
.authbox form .field { margin-bottom: 14px; }
.authbox input[type=text], .authbox input[type=email], .authbox input[type=password], .authbox input[type=tel], .authbox textarea { border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.authbox input:focus, .authbox textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); outline: none; }
.authbox .muted { margin: -14px 0 22px; }
.btn.ink { width: 100%; margin-top: 4px; padding: 14px 24px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--ink); border-color: var(--ink); color: #fff; border-radius: 999px; font-weight: 600; transition: box-shadow .2s ease, transform .2s ease; }
.btn.ink .ico { width: 18px; height: 18px; stroke-width: 2.2; transition: transform .2s ease; }
.btn.ink:hover { background: var(--ink); color: #fff; box-shadow: 0 10px 22px -6px rgba(0, 0, 0, .55); transform: translateY(-1px); }
.btn.ink:hover .ico { transform: translate(2px, -2px); }
.authlink { margin: 16px 0 0; font-size: .9rem; text-align: center; }
.authfoot { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--border); font-size: .9rem; color: var(--muted); }
.authbox a { color: var(--accent-strong); font-weight: 600; text-decoration: none; }
.authbox a:hover { text-decoration: underline; }
.split-content:has(.authbox.wide) { max-width: 560px; }
.authbox .formgrid { gap: 0 12px; }
.checkline { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[data-theme="dark"] .split-side { background: #13121c; color: #ecebf5; border-right: 1px solid var(--border); }
[data-theme="dark"] .split, [data-theme="dark"] .split-main { background: #17161f; }
[data-theme="dark"] .split-main input { background: #1e1d29; }
[data-theme="dark"] .split-brand, [data-theme="dark"] .split-title, [data-theme="dark"] .split-points li { color: #f4f3fa; }
[data-theme="dark"] .split-text { color: #b4b2c6; }
[data-theme="dark"] .split-points li::before { background: #201e2d; box-shadow: none; }
[data-theme="dark"] .btn.ink { background: #f4f3fa; border-color: #f4f3fa; color: var(--ink); }
[data-theme="dark"] .btn.ink:hover { background: #f4f3fa; color: var(--ink); box-shadow: 0 10px 22px -6px rgba(255, 255, 255, .45); }
@media (max-width: 860px) {
	.split { grid-template-columns: minmax(0, 1fr); }
	.split-side { padding: 28px 20px 32px; }
	.split-badge { margin-top: 22px; }
	.split-title { font-size: 1.75rem; letter-spacing: -.6px; margin: 12px 0 8px; }
	.split-text { margin: 0; font-size: .95rem; }
	.split-points { display: none; }
	.split-main { align-items: flex-start; padding: 56px 16px 48px; }
	[data-theme="dark"] .split-side { border-right: 0; border-bottom: 1px solid var(--border); }
}
.brandmode-logo .brand-logo.has-img img { width: auto; max-width: 100%; height: 100%; }
[data-nav="compact"] .sidebar .brandmode-logo .brand-logo.has-img { max-width: 48px; height: 38px; }

/* ---------- Referral link: share box, progress, honeypot ---------- */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.row-in.col { flex-direction: column; align-items: stretch; gap: 6px; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.progress .w0 { width: 0; } .progress .w5 { width: 5%; } .progress .w10 { width: 10%; } .progress .w15 { width: 15%; } .progress .w20 { width: 20%; }
.progress .w25 { width: 25%; } .progress .w30 { width: 30%; } .progress .w35 { width: 35%; } .progress .w40 { width: 40%; } .progress .w45 { width: 45%; }
.progress .w50 { width: 50%; } .progress .w55 { width: 55%; } .progress .w60 { width: 60%; } .progress .w65 { width: 65%; } .progress .w70 { width: 70%; }
.progress .w75 { width: 75%; } .progress .w80 { width: 80%; } .progress .w85 { width: 85%; } .progress .w90 { width: 90%; } .progress .w95 { width: 95%; } .progress .w100 { width: 100%; }
.agreement-text { line-height: 1.6; }
.agreement-text h3 { margin-top: 0; }
.plannote { margin-top: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .9rem; }
.plannote p { margin: 4px 0; }
.richtext p { margin: 0 0 .6em; }
.richtext p:last-child { margin-bottom: 0; }
.richtext ul, .richtext ol { margin: .4em 0 .6em 1.2em; padding: 0; }

/* ---------- Switch (yes/no fields) ---------- */
.switchline { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
input.switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 40px; height: 22px; margin: 0; border-radius: 999px; background: var(--border); cursor: pointer; transition: background .15s; }
input.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
input.switch:checked { background: var(--accent); }
input.switch:checked::after { transform: translateX(18px); }
input.switch:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
#billing .panel-head { padding: 0; margin-bottom: 4px; }
#billing div.actions { margin-top: 16px; }
.field[hidden] { display: none; }
.pre { white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- Progress of the periods in progress ---------- */
.progress-list { padding: 4px 26px 20px; text-align: left; }
.progress-item { padding: 14px 0; border-top: 1px solid var(--border); }
.progress-item:first-child { border-top: 0; }
.progress-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.progress-top b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-figure { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.progress-big { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; }
.progress-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: .85rem; color: var(--muted); }
.progress-foot b { color: var(--text); }
.progress-pct { font-weight: 600; color: var(--text); }
.progress-item p.small { margin: 8px 0 0; }
.progress.done > span { background: var(--ok, #16a34a); }
.progress { height: 10px; }
.list li > .row-in .li-link { flex: 1; min-width: 0; display: flex; color: inherit; text-decoration: none; }
.list li > .row-in .li-link:hover b { text-decoration: underline; }
.list li > .row-in > .btn.small { flex: none; padding: 6px 9px; }

/* ---------- Conversation of a request ---------- */
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 82%; padding: 12px 14px; border-radius: var(--radius-sm, 10px); background: var(--surface-2); align-self: flex-start; }
.msg.mine { align-self: flex-end; background: var(--info-soft); }
.msg-meta { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.msg-meta b { color: var(--text); font-weight: 600; }
@media (max-width: 640px) { .msg { max-width: 100%; } }

/* ---------- Preview of a document ---------- */
.preview-dialog { width: min(1000px, 94vw); height: min(88vh, 1200px); padding: 0; border: 1px solid var(--border); border-radius: var(--radius, 14px); background: var(--surface); color: var(--text); box-shadow: 0 10px 40px rgba(0,0,0,.18); overflow: hidden; }
.preview-dialog[open] { display: flex; flex-direction: column; }
.preview-dialog::backdrop { background: rgba(15,18,25,.55); }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.preview-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: var(--surface-2); }
.preview-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.preview-tools { display: inline-flex; gap: 6px; flex: none; }

/* ---------- Panel in the colour of the brand, for contrast (progress of the dashboard) ---------- */
.panel.inverse { position: relative; color: #fff; border-color: transparent; background: linear-gradient(150deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 70%, var(--navy)) 100%); box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--accent) 55%, transparent); }
.panel.inverse > * { position: relative; z-index: 1; }
.panel.inverse .panel-head a { color: #fff; opacity: .85; }
.panel.inverse .muted, .panel.inverse .progress-foot { color: rgba(255,255,255,.75); }
.panel.inverse .progress-foot b, .panel.inverse .progress-pct { color: #fff; }
.panel.inverse .progress-item { padding: 16px 18px; margin-bottom: 10px; border: 0; border-radius: 14px; background: rgba(255,255,255,.10); }
.panel.inverse .progress { background: rgba(255,255,255,.18); }
.panel.inverse .progress > span { background: #fff; }
.panel.inverse .chip { background: rgba(255,255,255,.14); border-color: transparent; color: #fff; }

/* ---------- Referral links: one row per brand ---------- */
.share { overflow: visible; }
.share-list { padding: 0 12px 12px; }
.share-row { display: flex; align-items: center; gap: 12px; padding: 12px; }
.share-row + .share-row { border-top: 1px solid var(--line); }
.share-mark { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-size: .85rem; }
.share-mark.has-img { background: #fff; padding: 3px; box-shadow: inset 0 0 0 1px var(--border); }
.share-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.share-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.share-info b { font-weight: 600; font-size: .95rem; }
input.share-url { padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: .82rem; text-overflow: ellipsis; box-shadow: none; cursor: text; }
input.share-url:focus { box-shadow: none; color: var(--text); }
.share-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.share-actions .btn.small { padding: 7px 12px; }
.share-actions .btn .ico { width: 16px; height: 16px; }
.btn.is-done, .btn.secondary.is-done { background: var(--ok); border-color: var(--ok); color: #fff; }
.iconbtn.outline { width: 34px; height: 34px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.iconbtn.outline .ico { width: 17px; height: 17px; }
.iconbtn.outline:hover, details.pop[open] > .iconbtn.outline { color: var(--accent-strong); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: none; background: var(--surface); }
/* Drop-downs made with details */
details.pop { position: relative; }
details.pop > summary { list-style: none; cursor: pointer; }
details.pop > summary::-webkit-details-marker { display: none; }
.pop-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); }
.pop-menu { min-width: 190px; padding: 6px; }
.pop-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text); text-decoration: none; font-size: .9rem; }
.pop-item .ico { width: 17px; height: 17px; color: var(--muted); }
.pop-item:hover { background: var(--tint); }
.pop-item.sb-whatsapp .ico { color: #1faa55; } .pop-item.sb-linkedin .ico { color: #0a66c2; } .pop-item.sb-facebook .ico { color: #1877f2; } .pop-item.sb-email .ico { color: var(--accent); }
.pop-qr { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px; }
.pop-qr img { width: 168px; height: 168px; background: #fff; border-radius: 10px; padding: 6px; display: block; }
.pop-qr .btn { width: 100%; }
.pop-qr .btn .ico { width: 16px; height: 16px; }
@media (max-width: 860px) {
	.share-list { padding: 0 6px 8px; }
	.share-row { flex-wrap: wrap; }
	.share-actions { width: 100%; padding-left: 46px; }
	.panel-head { padding: 18px 18px 8px; }
	.progress-list { padding: 4px 18px 18px; }
}

/* ---------- Follow-up of a referral: timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 4px 4px 0; }
.timeline li { --tl: var(--info); position: relative; display: flex; gap: 16px; padding-bottom: 22px; }
.timeline li:last-child { padding-bottom: 4px; }
/* The line joining the dots */
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--line); }
.timeline .tl-ok { --tl: var(--ok); } .timeline .tl-err { --tl: var(--err); } .timeline .tl-warn { --tl: var(--warn); } .timeline .tl-start { --tl: var(--accent); }
.tl-dot { position: relative; flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--tl) 14%, var(--surface)); }
.tl-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--tl); }
.tl-start .tl-dot::after { display: none; }
.tl-dot .ico { width: 15px; height: 15px; color: var(--tl); stroke-width: 2.4; }
/* The newest change stands out */
.timeline li:first-child:not(.tl-start) .tl-dot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--tl) 10%, transparent); }
.tl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 3px; }
.tl-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 500; }
.tl-body time { color: var(--muted); font-size: .82rem; }

/* ---------- Documents: preview before the name ---------- */
.row-in.filerow .li-link, .row-in.filerow { align-items: center; gap: 14px; }
.row-in.filerow .li-link { gap: 14px; align-items: center; }
.file-thumb { flex: none; width: 46px; height: 46px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .04em; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-thumb.ext-pdf { background: color-mix(in srgb, #e5484d 10%, var(--surface)); color: #d13b40; border-color: transparent; }
.file-thumb.ext-doc, .file-thumb.ext-docx { background: color-mix(in srgb, #2b6cd9 10%, var(--surface)); color: #2b6cd9; border-color: transparent; }
.file-thumb.ext-xls, .file-thumb.ext-xlsx { background: color-mix(in srgb, #1f9a5b 11%, var(--surface)); color: #1f8a52; border-color: transparent; }

/* Zoom of an image in the preview */
.preview-zoom { display: none; min-width: 34px; font-size: 1.05rem; }
.preview-dialog.is-img .preview-zoom { display: inline-flex; }
.preview-dialog.is-img .preview-body img { cursor: zoom-in; }
.preview-body.zoomed { display: block; overflow: auto; cursor: grab; touch-action: none; }
.preview-body.zoomed:active { cursor: grabbing; }
.preview-body.zoomed img { max-width: none; max-height: none; margin: auto; cursor: zoom-out; }

/* ---------- Head of a referral ---------- */
.oppcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 8px; }
/* Not clipped (the help of its figures goes out of it): its first and last parts round their own corners */
.oppcard > :first-child { border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.oppcard > :last-child { border-bottom-left-radius: calc(var(--radius) - 1px); border-bottom-right-radius: calc(var(--radius) - 1px); }
.opp-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 24px; background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface) 70%); }
.opp-avatar { width: 56px; height: 56px; flex: none; border-radius: 16px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; box-shadow: 0 6px 16px -8px var(--accent); }
.opp-name { flex: 1; min-width: 0; }
.opp-name h1 { margin: 0; font-size: 1.6rem; overflow-wrap: anywhere; }
.opp-name p { margin: 4px 0 0; color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: .9rem; }
.opp-hero form { margin: 0; }
.opp-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.opp-fact { display: flex; align-items: center; gap: 12px; padding: 16px 24px; min-width: 0; }
.opp-fact + .opp-fact { border-left: 1px solid var(--line); }
.opp-fact-icon { width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.opp-fact-icon .ico { width: 18px; height: 18px; }
.opp-fact small { display: block; color: var(--muted); font-size: .8rem; }
.opp-fact b { display: block; font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Steps of the sales process */
.opp-steps { list-style: none; margin: 0; padding: 22px 24px 18px; display: flex; }
.opp-steps li { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.opp-steps li::before { content: ""; position: absolute; top: 8px; right: 50%; width: 100%; height: 3px; border-radius: 3px; background: var(--line); z-index: 0; }
.opp-steps li:first-child::before { display: none; }
.opp-steps li.done::before, .opp-steps li.current::before { background: var(--accent); }
.opp-step-dot { position: relative; z-index: 1; width: 19px; height: 19px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); }
.opp-steps li.done .opp-step-dot { background: var(--accent); border-color: var(--accent); }
.opp-steps li.current .opp-step-dot { border-color: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 15%, transparent); }
.opp-steps li.current.won .opp-step-dot { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 5px var(--ok-soft); }
.opp-steps.is-lost li.current .opp-step-dot { background: var(--err); border-color: var(--err); box-shadow: 0 0 0 5px var(--err-soft); }
.opp-steps.is-lost li::before { background: var(--line); }
.opp-steps.is-lost li .opp-step-dot { background: var(--surface); border-color: var(--line); }
.opp-step-label { font-size: .8rem; color: var(--muted); line-height: 1.25; padding: 0 4px; }
.opp-steps li.current .opp-step-label { color: var(--text); font-weight: 700; }
.opp-steps li.done .opp-step-label { color: var(--text); }
/* Details from the description */
.opp-details { padding: 6px 24px 22px; border-top: 1px solid var(--line); }
.opp-details h2 { font-size: .8rem; color: var(--muted); font-weight: 600; margin: 16px 0 8px; }
.opp-detail-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.opp-detail-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "icon label" "icon value"; column-gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.opp-detail-icon { grid-area: icon; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); color: var(--accent); }
.opp-detail-icon .ico { width: 16px; height: 16px; }
.opp-detail-label { grid-area: label; color: var(--muted); font-size: .76rem; }
.opp-detail-value { grid-area: value; font-weight: 600; overflow-wrap: anywhere; }
.opp-detail-value a { color: var(--accent-strong); text-decoration: none; }
.opp-detail-value a:hover { text-decoration: underline; }
.opp-note { margin: 10px 0 0; color: var(--text); }
@media (max-width: 860px) {
	.opp-hero { padding: 18px; }
	.opp-avatar { width: 46px; height: 46px; border-radius: 13px; font-size: 1rem; }
	.opp-name h1 { font-size: 1.3rem; }
	.opp-hero form, .opp-hero form .btn { width: 100%; }
	.opp-facts { grid-template-columns: minmax(0, 1fr); }
	.opp-fact { padding: 12px 18px; }
	.opp-fact + .opp-fact { border-left: 0; border-top: 1px solid var(--line); }
	.opp-steps { padding: 18px 10px 14px; }
	/* Little room: only the name of the current step */
	.opp-steps li:not(.current) .opp-step-label { visibility: hidden; }
	.opp-step-label { font-size: .78rem; white-space: nowrap; }
	.opp-details { padding: 4px 18px 18px; }
}

/* ---------- Referral: back link, count, tip, history, drop zone ---------- */
.backlink { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; padding: 6px 12px 6px 8px; border-radius: 99px; color: var(--muted); font-size: .88rem; font-weight: 600; text-decoration: none; background: var(--surface); border: 1px solid var(--border); }
.backlink .ico { width: 16px; height: 16px; transform: rotate(180deg); }
.backlink:hover { color: var(--accent-strong); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.h1-count { display: inline-grid; place-items: center; min-width: 36px; height: 30px; padding: 0 10px; margin-left: 6px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); font-size: 1rem; font-weight: 700; letter-spacing: 0; vertical-align: middle; }
.tip { position: relative; display: inline-flex; vertical-align: middle; color: var(--muted); cursor: help; }
.tip .ico { width: 15px; height: 15px; }
.tip:hover, .tip:focus { color: var(--accent); outline: none; }
.tip::after { content: attr(data-tip); position: absolute; z-index: 40; bottom: calc(100% + 8px); right: -10px; width: 260px; padding: 10px 12px; border-radius: 10px; background: var(--navy); color: #fff; font-size: .8rem; font-weight: 400; line-height: 1.45; text-transform: none; letter-spacing: 0; text-align: left; white-space: normal; box-shadow: var(--shadow-lg); display: none; pointer-events: none; }
.opp-fact .tip::after { right: auto; left: -10px; }
.tip:hover::after, .tip:focus::after { display: block; animation: comtipin .15s ease-out; }
@keyframes comtipin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
[data-theme="dark"] .tip::after { background: #2b2c40; }
/* Steps: the date each one was reached */
.opp-step-date { font-size: .72rem; color: var(--muted); margin-top: -4px; }
/* History of changes, folded in the card */
.opp-history { border-top: 1px solid var(--line); padding: 14px 24px; }
.opp-history > summary { font-size: .88rem; }
.opp-history[open] > summary { margin-bottom: 16px; }
/* Drop zone of documents */
.dropform { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.acc-form .dropzone-list { margin-bottom: 4px; }
.acc-form-actions { margin-top: 18px; }
.acc-form-actions .btn .ico { width: 17px; height: 17px; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0; padding: 24px 16px; border: 2px dashed color-mix(in srgb, var(--accent) 28%, var(--border)); border-radius: 16px; background: var(--surface-2); text-align: center; font-weight: 400; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.dropzone:hover, .dropzone.is-over, .dropzone:focus-within { background: var(--tint); border-color: var(--accent); }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-icon { width: 44px; height: 44px; margin-bottom: 8px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.dropzone b { font-weight: 600; }
.dropzone span:not(.dropzone-icon) { color: var(--accent-strong); font-size: .9rem; }
.dropzone small { margin-top: 6px; color: var(--muted); font-size: .78rem; }
.dropzone-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dropzone-list:empty { display: none; }
.dropzone-list li { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: .88rem; overflow-wrap: anywhere; }
.dropform-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.dropform-actions .btn:disabled { opacity: .45; cursor: default; }
@media (max-width: 860px) {
	.opp-history { padding: 12px 18px; }
	.opp-step-date { display: none; }
	.opp-steps li.current .opp-step-date { display: block; }
	.dropform-actions .btn { width: 100%; }
}
/* In a table head the explanation opens downwards (the table may scroll sideways and would cut it above) */
th .tip::after { bottom: auto; top: calc(100% + 8px); }
/* Reason of a lost referral, under its entry of the history */
.tl-note { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--err-soft); color: var(--text); font-size: .88rem; }
.tl-note b { color: var(--err); font-weight: 600; }
/* Settlement of the commission of an invoice: its period and the state */
.settle { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.settle small { color: var(--muted); font-size: .82rem; }

/* ---------- Plans of the partner as cards ---------- */
.plancards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 24px; align-items: stretch; }
.plancards > :only-child, .periodcards > :only-child { grid-column: 1 / -1; }
.plancard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.plancard-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface) 75%); border-bottom: 1px solid var(--line); }
.plancard-icon { width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center; background: var(--surface); color: var(--accent-strong); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent); }
.plancard-title { flex: 1; min-width: 0; }
.plancard-title small { display: block; color: var(--muted); font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.plancard-title b { display: block; font-size: 1.1rem; color: var(--accent-strong); overflow-wrap: anywhere; }
.plancard-body { padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 18px; }
.plancard-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); background: var(--surface-2); border-radius: 14px; overflow: hidden; }
.plancard-facts > div { padding: 12px 16px; min-width: 0; }
.plancard-facts > div + div { border-left: 1px solid var(--line); }
.plancard-facts dt { color: var(--muted); font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.plancard-facts dd { margin: 0; font-weight: 700; font-size: 1rem; }
.plancard-facts dd small { color: var(--muted); font-weight: 500; font-size: .8rem; }
.plancard-section h3 { margin: 0 0 10px; color: var(--muted); font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.planrules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.planrules li { display: flex; align-items: center; gap: 14px; margin: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); }
.rule-value { flex: none; min-width: 74px; padding: 6px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 800; text-align: center; white-space: nowrap; }
.rule-text { min-width: 0; line-height: 1.35; }
.rule-text small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.ladder { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
/* Each level: the % reached in a small pill, the commission below; all the same size */
.ladder li { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.ladder li small { padding: 2px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); font-size: .75rem; font-weight: 600; }
.ladder li b { font-size: 1.1rem; }
.ladder li b span { font-size: .78rem; font-weight: 500; color: var(--muted); }
.ladder li.bonus { background: color-mix(in srgb, var(--ok) 8%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.ladder li.bonus small { background: var(--ok-soft); color: var(--ok); }
.ladder li.bonus b { color: var(--ok); }
.plancard-excluded { margin: 0; display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: .86rem; }
.plancard-excluded .ico { width: 16px; height: 16px; margin-top: 2px; }
.plancard .plannote { margin: 0; }
@media (max-width: 860px) {
	.plancards { grid-template-columns: minmax(0, 1fr); }
	.plancard-head, .plancard-body { padding-left: 16px; padding-right: 16px; }
	.plancard-facts { grid-template-columns: minmax(0, 1fr); }
	.plancard-facts > div + div { border-left: 0; border-top: 1px solid var(--line); }
	/* Levels as equal rows: the % on the left, the commission on the right */
	.ladder { grid-template-columns: minmax(0, 1fr); }
	.ladder li { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---------- Commissions: periods in progress as cards, what counts now as rows ---------- */
.periodcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.periodcard { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.periodcard .progress-item { padding: 0; border: 0; }
.periodcard .progress-top b { font-size: 1.02rem; }
.periodcard .periodcard .progress-big { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; }
.periodcard .progress-foot b { color: var(--accent-strong); font-size: 1rem; }
.periodcard .progress-item p.small { margin-top: 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.periodcard-closing { position: absolute; top: -10px; right: 18px; }
.periodnote { margin: 10px 4px 26px; }
.countlist { list-style: none; margin: 0; padding: 10px 12px; }
.countlist li { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 12px; }
.countlist li + li { border-top: 1px solid var(--line); border-radius: 0; }
.countlist li:hover { background: var(--tint); }
.count-avatar { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-size: .82rem; }
.count-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.count-amount b { font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.doclink { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; font-size: .85rem; text-decoration: none; white-space: nowrap; }
.doclink .ico { width: 15px; height: 15px; }
.doclink:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
@media (max-width: 860px) {
	.periodcards { grid-template-columns: minmax(0, 1fr); }
	.periodcard { padding: 16px; }
	.countlist { padding: 2px 6px 8px; }
	.countlist li { padding: 10px 8px; gap: 10px; }
}

/* ---------- Titles of the sections: always outside their box ---------- */
.sectionhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.main > .sectionhead:first-child, .cols > div > .sectionhead:first-child { margin-top: 0; }
.sectionhead-text { min-width: 0; }
.sectionhead h2 { margin: 0; font-size: 1.12rem; display: flex; align-items: center; gap: 8px; }
.sectionhead p { margin: 3px 0 0; color: var(--muted); font-size: .9rem; }
.sectionhead-aside { flex: none; display: flex; align-items: center; gap: 8px; }
.sectionhead-aside > a:not(.btn) { font-size: .86rem; font-weight: 600; color: var(--accent-strong); text-decoration: none; }
.sectionhead-aside > a:not(.btn):hover { text-decoration: underline; text-underline-offset: 3px; }
.sectionhead + .panel, .sectionhead + .card, .sectionhead + section { margin-top: 0; }
/* Boxes whose title is now outside: their content starts at the top */
.panel.share .share-list { padding-top: 10px; }
.panel.inverse .progress-list { padding-top: 18px; }

/* ---------- Phones: what counts now shows all its lines; the (i) opens as a sheet at the bottom of the screen ---------- */
@media (max-width: 860px) {
	.countlist .li-main b, .countlist .li-main small { white-space: normal; overflow: visible; }
	.countlist li { align-items: flex-start; }
	.tip::after { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); top: auto !important; width: auto; z-index: 90; padding: 14px 16px; font-size: .88rem; border-radius: 14px; }
	.tip:hover::after, .tip:focus::after { animation: none; }
	.sectionhead { margin-top: 22px; }
}
/* What it earned in a previous plan */
.plancard-facts.is-result { background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }
.plancard-facts.is-result dd { color: var(--text); }
.chip-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); font-size: .72rem; font-weight: 700; }
@media (max-width: 1100px) { .plancards, .periodcards { grid-template-columns: minmax(0, 1fr); } }
/* What each customer gave, inside the card of a previous plan */
.countlist.in-card { padding: 0; border: 1px solid var(--line); border-radius: 12px; }
.countlist.in-card li { padding: 10px 12px; }
.countlist .li-main b a { color: inherit; text-decoration: none; }
.countlist .li-main b a:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.plancard-section > p.small { margin: -4px 0 10px; }

/* Plan and period of a progress card: the period as plain text, as everywhere */
.progress-plan { display: flex; flex-direction: column; min-width: 0; }
.progress-plan b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-plan small { color: var(--muted); font-size: .82rem; }
.panel.inverse .progress-plan small { color: rgba(255,255,255,.75); }
/* Previous plans: one folded row each */
.planfolds { display: flex; flex-direction: column; gap: 12px; }
details.planfold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin: 0; }
details.planfold > summary::-webkit-details-marker { display: none; }
details.planfold > summary:hover { background: var(--tint); }
details.planfold > summary > .ico { width: 18px; height: 18px; color: var(--muted); transition: transform .15s ease; flex: none; }
details.planfold[open] > summary > .ico { transform: rotate(90deg); }
details.planfold[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: var(--line); }
details.planfold > .plancard { border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
details.planfold > .plancard > .plancard-head { display: none; }
.planfold-title { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--text); font-weight: 400; }
.planfold-title small { color: var(--muted); font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.planfold-title b { color: var(--accent-strong); font-size: 1.02rem; }
.planfold-total { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.planfold-total small { color: var(--muted); font-size: .76rem; font-weight: 400; }
.planfold-total b { font-size: 1.02rem; color: var(--text); }
@media (max-width: 860px) { details.planfold > summary { padding: 12px 14px; gap: 10px; } .planfold-total small { display: none; } }

/* ---------- Collections (self-billing invoices of the partner) ---------- */
.figures.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.figures.three .figure:nth-child(3) { border-left: 1px solid var(--line); border-top: 0; }
.invlist li > a { gap: 14px; }
.invlist .file-thumb .ico { width: 20px; height: 20px; }
.inv-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; min-width: 120px; }
.inv-amount b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.progress.mini { width: 100%; height: 5px; }
.invlist li > a > .ico { width: 16px; height: 16px; color: var(--muted); flex: none; }
.opp-avatar .ico { width: 26px; height: 26px; }
.inv-collect { padding: 16px 24px 4px; }
.inv-collect-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: .9rem; color: var(--muted); }
.inv-collect-top b { color: var(--warn); font-weight: 600; }
@media (max-width: 860px) {
	.figures.three { grid-template-columns: minmax(0, 1fr); }
	.figures.three .figure + .figure { border-left: 0; border-top: 1px solid var(--line); }
	.inv-amount { min-width: 0; }
	.inv-collect { padding: 14px 18px 2px; }
	}

/* Requests about an invoice */
.reqlist li > a { gap: 14px; }
.reqlist li > a > .ico { width: 16px; height: 16px; color: var(--muted); flex: none; }
.req-state { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.claimcard-actions { display: flex; justify-content: flex-end; }
.claimcard-actions .btn .ico { width: 17px; height: 17px; }

/* ---------- Approval of a self-billing invoice by the partner ---------- */
.inv-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.approve { margin: 16px 24px 22px; padding: 16px 18px; border-radius: 14px; background: var(--surface-2); }
.approve-pending { background: color-mix(in srgb, var(--warn) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent); }
.approve-review { background: var(--info-soft); }
.approve-accepted, .approve-tacit { background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }
.approve-text { display: flex; gap: 12px; align-items: flex-start; }
.approve-text b { display: block; }
.approve-text p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.approve-icon { width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--surface); color: var(--accent-strong); }
.approve-pending .approve-icon { color: var(--warn); }
.approve-accepted .approve-icon, .approve-tacit .approve-icon { color: var(--ok); }
.approve-review .approve-icon { color: var(--info); }
.approve-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin: 14px 0 0 48px; }
.approve-actions form { margin: 0; }
.approve-actions .btn .ico { width: 17px; height: 17px; }
details.pop-inline > summary { list-style: none; }
details.pop-inline > summary::-webkit-details-marker { display: none; }
details.pop-inline[open] { flex-basis: 100%; }
details.pop-inline[open] > summary { margin-bottom: 10px; }
.claimbox form { padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.claimbox form p { margin: 0 0 10px; }
.approve-note { margin: 12px 0 0 48px; font-size: .8rem; color: var(--muted); }
@media (max-width: 860px) {
	.approve { margin: 14px 16px 18px; }
	.approve-actions, .approve-note { margin-left: 0; }
	.approve-actions > form, .approve-actions > form .btn, .approve-actions > details, .approve-actions > details > summary { width: 100%; }
}
.claimcard-actions { display: flex; justify-content: flex-end; }
@media (max-width: 860px) { .claimcard-actions .btn { width: 100%; } }

/* ---------- Requests ---------- */
.typepick { border: 0; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.typepick legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: .9rem; }
.typepick-item { margin: 0; font-weight: 500; cursor: pointer; }
.typepick-item input { position: absolute; opacity: 0; pointer-events: none; }
.typepick-item span { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); transition: border-color .15s ease, background .15s ease; }
.typepick-item span .ico { width: 18px; height: 18px; color: var(--muted); }
.typepick-item:hover span { background: var(--tint); }
.typepick-item input:checked + span { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.typepick-item input:checked + span .ico { color: var(--accent); }
.typepick-item input:focus-visible + span { box-shadow: var(--focus); }
.req-related { padding: 12px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.oppcard .thread { padding: 20px 24px; border-top: 1px solid var(--line); background: var(--surface-2); }
.msg-row { display: flex; align-items: flex-end; gap: 10px; max-width: 86%; }
.msg-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--muted); font-size: .72rem; font-weight: 700; box-shadow: var(--shadow); }
.msg-row.mine .msg-avatar { background: var(--accent); color: var(--on-accent); }
.msg-row .msg { max-width: none; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; box-shadow: var(--shadow); }
.msg-row.mine .msg { background: var(--accent-soft); border-color: transparent; border-radius: 16px 16px 4px 16px; }
.composer { display: flex; gap: 10px; align-items: flex-end; padding: 16px 24px 20px; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; min-height: 52px; resize: vertical; }
.composer .btn .ico, .claimcard-actions .btn .ico { width: 17px; height: 17px; }
.req-closed { display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.req-closed .ico { width: 16px; height: 16px; }
@media (max-width: 860px) {
	.typepick { grid-template-columns: minmax(0, 1fr); }
	.oppcard .thread { padding: 16px 14px; }
	.msg-row { max-width: 100%; }
	.composer { flex-direction: column; align-items: stretch; padding: 14px; }
	.req-related, .req-closed { padding: 12px 16px; }
}
.reqform { max-width: 760px; }

/* ---------- Filters and the main button of a list, on the same line ---------- */
.listbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.listbar .switcher { margin: 0; }

/* ---------- Phones: no text of a card, row or figure is cut with "…"; what does not fit goes to the next line ---------- */
@media (max-width: 860px) {
	.listbar { flex-direction: column-reverse; align-items: stretch; }
	.listbar .btn { width: 100%; }
	.li-main b, .li-main small, .figure-label, .figure-value, .figure-sub, .opp-fact b, .progress-plan b, .progress-top b, .share-brand, .plancard-title b, .planfold-title b, .stat-value, .filechip-text b, .preview-title, .topbar-title { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
	.list li > a, .list li > .row-in, .countlist li { flex-wrap: wrap; align-items: flex-start; }
	.list li > a > .li-main, .list li > .row-in > .li-main, .countlist li > .li-main, .list li > .row-in .li-link { flex: 1 1 0; min-width: 0; }
	/* States and amounts under the text, aligned with it (after the icon) */
	.req-state, .inv-amount, .count-amount { flex: 1 0 100%; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; max-width: none; min-width: 0; padding-left: 52px; gap: 6px 10px; }
	.invlist .inv-amount { padding-left: 60px; }
	.inv-amount .progress.mini { flex: 1 0 100%; }
	.inv-badges { justify-content: flex-start; }
	/* The whole row opens it: the arrow is not needed */
	.list li > a > .ico:last-child { display: none; }
}

/* ---------- Self-billing agreement ---------- */
.agr-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.agr-actions .btn .ico { width: 16px; height: 16px; }
.agr-how { list-style: none; margin: 0; padding: 16px 24px 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; border-top: 1px solid var(--line); }
.agr-how li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: .9rem; line-height: 1.45; }
.agr-how-icon { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.agr-how-icon .ico { width: 16px; height: 16px; }
.agreement-text { max-width: 820px; line-height: 1.7; }
.agreement-text h3 { margin: 0 0 12px; font-size: 1.1rem; }
.agreement-text p { margin: 0 0 12px; }
.agr-accept { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.agr-accept .switchline { margin: 0; font-weight: 600; }
.agr-accept .btn .ico { width: 17px; height: 17px; }
.agr-fold { margin-top: 24px; }
.agr-fold > .card { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }
@media (max-width: 860px) {
	.agr-how { grid-template-columns: minmax(0, 1fr); padding: 14px 16px 16px; }
	.agr-actions, .agr-actions .btn { width: 100%; }
	.agr-accept .btn { width: 100%; }
}
.opp-fact b { white-space: normal; overflow-wrap: anywhere; }
.agr-ok .opp-avatar { background: var(--ok); box-shadow: 0 6px 16px -8px var(--ok); }
.agr-warn .opp-avatar { background: var(--warn); box-shadow: 0 6px 16px -8px var(--warn); }
.row-actions { display: flex; gap: 8px; flex: none; }
.row-actions .btn .ico { width: 16px; height: 16px; }
@media (max-width: 860px) { .agrlist .row-actions { flex: 1 0 100%; padding-left: 52px; } }

/* ---------- My account ---------- */
.acc-head { margin-bottom: 4px; }
.acc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.acc-grid > .card { margin: 0; }
.acc-card h3, .acc-form-title { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 1rem; }
.acc-form-title { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.acc-form form > .acc-form-title:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.acc-icon { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.acc-icon .ico { width: 17px; height: 17px; }
.acc-list { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.acc-list dt { color: var(--muted); font-size: .8rem; margin-bottom: 2px; }
.acc-list dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; line-height: 1.45; }
.acc-access { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.acc-access-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.acc-access-text small { color: var(--muted); font-size: .8rem; }
.acc-access-text b { overflow-wrap: anywhere; }
.acc-access form { margin: 0; }
/* The portal as an app and the notices: an icon like the one of the home screen, switches with their explanation under */
.acc-app-icon { width: 52px; height: 52px; flex: none; border-radius: 13px; box-shadow: 0 1px 4px rgba(33, 38, 60, .12); }
.acc-app [hidden], .acc-push-msg[hidden] { display: none; }
.acc-grid.acc-grid-top { align-items: start; }
.acc-notif { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.acc-switch { display: flex; align-items: flex-start; gap: 12px; font-weight: 400; }
.acc-switch input.switch { margin-top: 1px; }
.acc-switch > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acc-switch > span b { font-weight: 600; }
.acc-switch > span small { font-size: .82rem; line-height: 1.4; }
.acc-card > .acc-switch b, .acc-card > .acc-switch > span { font-weight: 600; }
.acc-note { margin: 12px 0 0; line-height: 1.5; }
.acc-push-msg { color: var(--warn); }
.acc-notif .acc-form-actions { margin-top: 4px; }
@media (max-width: 860px) {
	.acc-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
	.acc-access form, .acc-access .btn { width: 100%; }
	.acc-notif .btn { width: 100%; }
}
/* Phones: a button next to the title of a section goes under its text, on the whole width (short links stay beside it) */
@media (max-width: 860px) {
	.sectionhead { flex-wrap: wrap; }
	.sectionhead:has(.sectionhead-aside .btn) { flex-direction: column; align-items: stretch; }
	.sectionhead-aside:has(.btn), .sectionhead-aside .btn { width: 100%; }
	/* Same size as the other buttons of the portal on phones (not the small one) */
	.sectionhead-aside .btn.small, .agr-actions .btn.small, .opp-hero form .btn.small { padding: 12px 18px; font-size: 1rem; }
}
/* Figures of a strip, all the same size */
.figures { grid-auto-rows: 1fr; }
@media (max-width: 860px) { .pagehead > div + .btn, .pagehead > .btn { margin-top: 6px; } }

/* ---------- Tabs of a page (underlined) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: -8px 0 20px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--accent-strong); border-bottom-color: var(--accent); }

/* ---------- Performance: channels (ring), funnel, what was earned (line) ---------- */
/* Each channel keeps its colour (validated categorical palette, light and dark) */
.perf-channels { --ch-direct: #2a78d6; --ch-whatsapp: #eb6834; --ch-email: #1baf7a; --ch-linkedin: #eda100; --ch-facebook: #e87ba4; --ch-x: #008300; --ch-qr: #6250d6; }
[data-theme="dark"] .perf-channels { --ch-direct: #3987e5; --ch-whatsapp: #d95926; --ch-email: #199e70; --ch-linkedin: #c98500; --ch-facebook: #d55181; --ch-x: #0ca30c; --ch-qr: #9085e9; }
.perf-channels .ch-direct { --c: var(--ch-direct); } .perf-channels .ch-whatsapp { --c: var(--ch-whatsapp); } .perf-channels .ch-email { --c: var(--ch-email); }
.perf-channels .ch-linkedin { --c: var(--ch-linkedin); } .perf-channels .ch-facebook { --c: var(--ch-facebook); } .perf-channels .ch-x { --c: var(--ch-x); } .perf-channels .ch-qr { --c: var(--ch-qr); }
.perf-channels { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.ring { width: 180px; height: 180px; flex: none; }
.ring-track { fill: none; stroke: var(--surface-2); stroke-width: 22; }
.ring-seg { fill: none; stroke: var(--c); stroke-width: 22; }
.ring-seg:hover { stroke-width: 26; }
.ring-total { text-anchor: middle; font-size: 28px; font-weight: 700; fill: var(--text); }
.ring-sub { text-anchor: middle; font-size: 12px; fill: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; flex: 0 1 380px; min-width: 220px; display: flex; flex-direction: column; gap: 10px; }
.legend li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 64px; align-items: center; gap: 10px; }
.legend .swatch { width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.legend b { font-variant-numeric: tabular-nums; }
.legend .muted { text-align: right; font-size: .85rem; font-variant-numeric: tabular-nums; }
.funnel { display: flex; align-items: stretch; gap: 10px; }
.funnel-step { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 14px; background: var(--surface-2); }
.funnel-step.is-last { background: color-mix(in srgb, var(--ok) 9%, var(--surface)); }
.funnel-step small { color: var(--muted); }
.funnel-step b { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.funnel-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); color: var(--accent-strong); margin-bottom: 4px; }
.funnel-step.is-last .funnel-icon { color: var(--ok); }
.funnel-icon .ico { width: 16px; height: 16px; }
.funnel-arrow { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 110px; text-align: center; color: var(--muted); font-size: .8rem; }
.funnel-arrow .ico { width: 20px; height: 20px; color: var(--accent); }
.earned-head { margin-bottom: 8px; }
@media (max-width: 860px) {
	.perf-channels { flex-direction: column; align-items: stretch; gap: 18px; }
	.ring { align-self: center; }
	.legend { min-width: 0; flex: none; }
	.funnel { flex-direction: column; }
	.funnel-arrow { width: auto; flex-direction: row; justify-content: flex-start; padding-left: 16px; }
	.funnel-arrow .ico { transform: rotate(90deg); }
}
/* Charts of the performance (Chart.js) */
.chartbox { position: relative; height: 280px; }
@media (max-width: 860px) { .chartbox { height: 240px; } }
/* Custom dates of the performance */
.rangeform { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: -6px 0 20px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.rangeform .field { margin: 0; }
.rangeform label { font-size: .82rem; }
.rangeform input[type=date] { width: auto; min-width: 170px; }
@media (max-width: 860px) { .rangeform .field, .rangeform input[type=date], .rangeform .btn { width: 100%; } }

/* ---------- Install the app: a card at the bottom, once per device ---------- */
.installbar { position: fixed; z-index: 60; right: 24px; bottom: 24px; width: min(520px, calc(100vw - 32px)); display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.installbar[hidden] { display: none; }
.installbar-icon { width: 44px; height: 44px; flex: none; border-radius: 11px; box-shadow: 0 1px 4px rgba(33, 38, 60, .12); }
.installbar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: .85rem; color: var(--muted); line-height: 1.4; }
.installbar-text b { color: var(--text); font-size: .92rem; }
.installbar-text [hidden] { display: none; }
.installbar-actions { display: flex; gap: 8px; flex: none; }
.installbar-actions .btn[hidden] { display: none; }
body.has-installbar .main { padding-bottom: 120px; }
[data-install-open][hidden] { display: none; }
@media (max-width: 860px) {
	.installbar { right: 16px; bottom: calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
	.installbar-text { flex: 1 1 calc(100% - 60px); }
	.installbar-actions { width: 100%; }
	.installbar-actions .btn { flex: 1; }
}
body:has(details.notif[open]) .installbar { display: none; }
.notif-empty[hidden], .notif-head form[hidden] { display: none; }
.notif-item.notice.is-leaving { opacity: 0; transition: opacity .15s ease; }

/* ---------- New lead: a company or a person, and the products that interest it ---------- */
.kindpick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.kindpick-option{ margin: 0; cursor: pointer; position: relative; }
.kindpick-option input{ position: absolute; opacity: 0; pointer-events: none; }
.kindpick-option span{ display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); transition: border-color .15s ease, background .15s ease; }
.kindpick-option b{ font-weight: 600; font-size: .92rem; }
.kindpick-option small{ color: var(--muted); font-size: .8rem; font-weight: 400; line-height: 1.4; }
.kindpick-option:hover span{ background: var(--tint); }
.kindpick-option input:checked + span{ border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: var(--accent-soft); }
.kindpick-option input:checked + span b{ color: var(--accent-strong); }
.kindpick-option input:focus-visible + span{ box-shadow: var(--focus); }
.prodpick-lead { margin: 0 0 12px; }
.oppform .req { color: var(--err); }
/* What shows depends on the choice (without JavaScript too) */
.oppform:has(#kind_company:checked) .only-person, .oppform:has(#kind_person:checked) .only-company, .oppform:not(:has(#f_products option[value="other"]:checked)) .only-other { display: none; }
/* Products: a list to choose from and a label for each one chosen */
.prodselect select.is-enhanced { display: none; }
.chips { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 10px; padding: 7px 8px 7px 12px; border-radius: 12px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); max-width: 100%; }
.chip span { display: flex; flex-direction: column; min-width: 0; }
.chip b { font-weight: 600; font-size: .88rem; color: var(--accent-strong); overflow-wrap: anywhere; }
.chip small { font-size: .76rem; color: var(--muted); }
.chip-remove { flex: none; width: 24px; height: 24px; border: 0; border-radius: 8px; background: transparent; color: var(--accent-strong); font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0; }
.chip-remove:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
@media (max-width: 860px) {
	.kindpick { grid-template-columns: minmax(0, 1fr); }
}
.prodsum { margin: 12px 0 2px; font-weight: 600; color: var(--accent-strong); }
.prodsum[hidden] { display: none; }
.btn.is-sending { opacity: .6; cursor: progress; }
/* Search of a list, between its filters and its button */
.listsearch { flex: 1 1 220px; max-width: 360px; position: relative; margin: 0; }
.listsearch .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.listsearch input { width: 100%; padding-left: 36px; }
@media (max-width: 860px) { .listsearch { max-width: none; flex-basis: 100%; order: 3; } }
/* Fixed data of the account (changed through a request) */
input.is-readonly { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.acc-fixed-note { margin: -4px 0 4px; }
.acc-fixed-note a { color: var(--accent-strong); font-weight: 600; }
/* Documents with a request or an answer: a small drop zone, and the files of each message under its text */
.dropzone.dropzone-compact { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 14px; border-width: 1.5px; border-radius: 12px; text-align: left; }
.dropzone-compact .dropzone-icon { width: 32px; height: 32px; margin: 0; border-radius: 10px; flex: none; }
.dropzone-compact .dropzone-icon .ico { width: 16px; height: 16px; }
.dropzone-compact small { margin: 0 0 0 auto; }
/* Answer: as the form of a new request, the text, the documents on the whole width and the send button under them on the right */
.composer { flex-wrap: wrap; align-items: stretch; gap: 12px; }
.composer textarea { flex: 1 1 100%; }
.composer-attach { flex: 1 1 100%; min-width: 0; }
.composer-attach .dropzone-list { margin-top: 6px; }
.composer > .btn { margin-left: auto; }
@media (max-width: 860px) { .composer { gap: 10px; } .composer > .btn { width: 100%; margin-left: 0; } }
.msg-files { margin: 10px 0 0; }
.msg-files .row-in { padding: 6px 0; }
@media (max-width: 860px) { .dropzone-compact small { display: none; } }
/* A document inside a message: its name on the free width, the buttons under it when there is no room */
.msg-files .filerow { flex-wrap: wrap; gap: 8px 10px; }
.list.msg-files li > .row-in.filerow .li-link, .list.msg-files li > .row-in.filerow > .li-main { flex: 1 1 160px; min-width: 0; }
.msg-files .li-main b { overflow-wrap: anywhere; word-break: normal; }
@media (max-width: 860px) {
	.list.msg-files li > .row-in.filerow .li-link { flex: 1 1 100%; }
	.msg-files .filerow > .btn { margin-left: auto; }
	.msg-files .filerow > .btn ~ .btn { margin-left: 0; }
	.msg-files .file-thumb { width: 36px; height: 36px; }
}
