/* ==========================================================================
   LimePortal redesign · variant A «Lime Night»
   One stylesheet for the staff portal and the patient portal.

   1. Tokens (dark default, light override)
   2. Base
   3. Layout: app shell, page header, stacks, grids, splits
   4. Components
   5. Page sections (staff)
   6. Patient portal
   7. Utilities
   8. Responsive
   ========================================================================== */


/* 1. Tokens ---------------------------------------------------------------
   Dark is the default. lime-redesign.js sets [data-theme] from the stored
   choice or the OS preference before first paint.
   --accent is the lime fill (buttons, active states); --lime is lime used
   as text/icon colour, which turns olive in the light theme to stay legible. */
:root {
  color-scheme: dark;

  --bg: #161819;
  --side: #1D2022;
  --card: #202325;
  --card-2: #24282A;
  --raised: #2A2E31;
  --line: #2C3134;
  --line-2: #262A2D;
  --input: #1B1E20;
  --input-line: #33383C;
  --hover-line: #454C51;

  --text: #F2F4F0;
  --text-2: #D5DAD6;
  --text-3: #C9CFCB;
  --muted: #A3AAA6;
  --subtle: #8F9792;
  --placeholder: #6F7773;

  --accent: #D9FB19;
  --accent-hover: #EAFF6B;
  --accent-line: #D9FB19;
  --on-accent: #161819;
  --lime: #D9FB19;
  --lime-hover: #EAFF6B;
  --lime-dark: #7FA00E;
  --lime-soft: rgba(217, 251, 25, .14);
  --teal: #1F4F58;
  --teal-2: #2E7784;

  --blue: #8BC8F3;      --blue-soft: rgba(139, 200, 243, .16);  --blue-ink: #CFE6F8;
  --amber: #F5B46B;     --amber-soft: rgba(245, 180, 107, .16); --amber-ink: #F8DDBC; --amber-line: #6B5A33;
  --red: #FF9C8F;       --red-soft: rgba(232, 113, 98, .16);    --red-line: #E87162;
  --violet: #C7A6FF;    --violet-soft: rgba(199, 166, 255, .16);
  --green: #B9D84A;     --green-soft: rgba(127, 160, 14, .22);  --green-ink: #D6EC8A;
  --cyan: #A0EAFF;      --cyan-soft: rgba(160, 234, 255, .14);

  --accent-bg: #24291C;
  --accent-bg-2: #22271A;
  --accent-border: #5C6B12;
  --warn-bg: #2B2120;
  --warn-border: #6B3A33;
  --photo: #3A3F42;
  --th-band: #232A2E;
  --topbar: rgba(29, 32, 34, .92);
  --pt-topbar: rgba(22, 24, 25, .82);
  --scrim: rgba(10, 11, 12, .6);
  --shadow: rgba(0, 0, 0, .45);

  --r: 16px;
  --r-sm: 10px;
  --font-head: Urbanist, Inter, "Lime Inter", sans-serif;
  --font-body: Inter, "Lime Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #F4F6F2;
  --side: #FFFFFF;
  --card: #FFFFFF;
  --card-2: #F6F8F4;
  --raised: #EDF0EA;
  --line: #E2E6DF;
  --line-2: #EDF0EA;
  --input: #FFFFFF;
  --input-line: #D3D9D0;
  --hover-line: #B9C1B6;

  --text: #16201E;
  --text-2: #36423F;
  --text-3: #4A5552;
  --muted: #5E6A66;
  --subtle: #7B8682;
  --placeholder: #9AA39F;

  --accent-hover: #CBEF0A;
  --accent-line: #9DBB00;
  --lime: #4E6B00;
  --lime-hover: #3A5000;
  --lime-dark: #9DBB00;
  --lime-soft: rgba(190, 225, 0, .22);

  --blue: #1C6EA4;      --blue-soft: rgba(28, 110, 164, .1);    --blue-ink: #164E73;
  --amber: #9A5B0C;     --amber-soft: rgba(214, 140, 30, .14);  --amber-ink: #7A4708; --amber-line: #EAD2A6;
  --red: #B3392B;       --red-soft: rgba(208, 80, 63, .1);      --red-line: #D0503F;
  --violet: #6A43B8;    --violet-soft: rgba(106, 67, 184, .1);
  --green: #4E6B00;     --green-soft: rgba(127, 160, 14, .16);  --green-ink: #3F5600;
  --cyan: #0E7490;      --cyan-soft: rgba(14, 116, 144, .1);

  --accent-bg: #F7FBE3;
  --accent-bg-2: #F7FBE3;
  --accent-border: #C9DE6B;
  --warn-bg: #FDF2F0;
  --warn-border: #F0C2BB;
  --photo: #DCE1D9;
  --th-band: #EDF0EA;
  --topbar: rgba(255, 255, 255, .92);
  --pt-topbar: rgba(255, 255, 255, .85);
  --scrim: rgba(22, 32, 30, .35);
  --shadow: rgba(22, 32, 30, .14);
}


/* 2. Base ----------------------------------------------------------------- */
@font-face {
  font-family: "Lime Inter";
  src: url("/fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Lime Inter";
  src: url("/fonts/Inter-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Lime Inter";
  src: url("/fonts/Inter-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--lime); text-decoration: none; }
a:hover { color: var(--lime-hover); }

h1, h2, h3 { margin: 0; font-family: var(--font-head); letter-spacing: -.01em; overflow-wrap: anywhere; }
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; font-family: var(--font-body); }
p, figure { margin: 0; }
button { font: inherit; }

/* Icons: <i class="ico i-name">. The shape comes from lime-icons.css (--icon),
   the colour from the current text colour. */
.lp-ico {
  display: inline-block;
  width: 18px; height: 18px; flex: none;
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}


/* 3. Layout ---------------------------------------------------------------- */

/* App shell: sidebar + main; below 1024px the sidebar becomes a drawer */
.lp-app { display: flex; min-height: 100vh; }

.lp-side {
  flex: 0 0 252px;
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px 14px;
  background: var(--side);
  border-right: 1px solid var(--line);
}

.lp-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font: 600 20px var(--font-head); color: var(--text); }
.lp-logo { flex: none; width: 40px; height: 40px; background: var(--lime); -webkit-mask: url("/patient-assets/img/logo.png") center / contain no-repeat; mask: url("/patient-assets/img/logo.png") center / contain no-repeat; }
:root[data-theme="light"] .lp-logo { background: var(--text); }
.lp-brand--lg { padding: 0; font-size: 24px; }
.lp-brand--lg .lp-logo { width: 56px; height: 56px; }

.lp-me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--card-2); color: var(--text); }
.lp-me small { display: block; font-size: 12px; color: var(--muted); }

.lp-nav { display: flex; flex-direction: column; gap: 2px; }
.lp-nav-label { padding: 0 12px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); }
.lp-nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--text-2); font-size: 14px; }
.lp-nav a:hover { background: var(--card-2); color: var(--text); }
.lp-nav a.lp-active { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.lp-nav .lp-count { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--red-line); color: #fff; font-size: 12px; font-weight: 600; }

.lp-side-foot { display: flex; align-items: center; gap: 8px; padding: 0 8px; }

.lp-lang { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; background: var(--card-2); }
.lp-lang .lp-ico { width: 16px; height: 16px; margin: 0 4px 0 6px; color: var(--muted); }
.lp-lang span, .lp-lang a { padding: 4px 8px; border-radius: 8px; font-size: 12px; color: var(--muted); }
.lp-lang a:hover { color: var(--text); }
.lp-lang .lp-on { background: var(--raised); color: var(--text); }

.lp-mtop, .lp-nav-scrim, .lp-nav-toggle { display: none; }

.lp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 22px; padding: 28px 40px 48px; }

/* Page header */
.lp-crumbs { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.lp-crumbs a { color: var(--lime); }
.lp-crumbs a:hover { color: var(--lime-hover); text-decoration: underline; }
.lp-crumbs b { color: var(--text-2); font-weight: 500; }

.lp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.lp-head .lp-title { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lp-head .lp-title p { color: var(--muted); }

.lp-section-title { font: 600 13px var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); }

/* Stacks and clusters */
.lp-stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.lp-stack--sm { gap: 12px; }
.lp-stack--xs { gap: 6px; }

.lp-cluster, .lp-btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lp-cluster--sm { gap: 6px; }
.lp-cluster--end { justify-content: flex-end; }
.lp-spacer { flex: 1; }

/* Grids */
.lp-grid { display: grid; gap: 16px; }
.lp-g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lp-g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lp-g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lp-grid--lg { gap: 20px; }
.lp-grid--top { align-items: start; }
.lp-span-all { grid-column: 1 / -1; }

/* Splits: main column + fixed side column */
.lp-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.lp-split--360 { grid-template-columns: minmax(0, 1fr) 360px; }
.lp-split--420 { grid-template-columns: minmax(0, 1fr) 420px; }
.lp-split--left-240 { grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
.lp-split--left-300 { grid-template-columns: 300px minmax(0, 1fr); }
.lp-split--left-340 { grid-template-columns: 340px minmax(0, 1fr); }
.lp-split--left-380 { grid-template-columns: 380px minmax(0, 1fr); }
.lp-sticky { position: sticky; top: 20px; }

/* Max widths for forms and documents */
.lp-narrow { max-width: 920px; }
.lp-narrow--sm { max-width: 820px; }
.lp-narrow--lg { max-width: 1040px; }
.lp-narrow--xl { max-width: 1120px; }


/* 4. Components ------------------------------------------------------------ */

/* Buttons */
.lp-btn {
  height: 40px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--input-line);
  background: var(--card); color: var(--text-2);
  font: 500 14px var(--font-body);
  white-space: nowrap; cursor: pointer;
}
.lp-btn:hover { color: var(--text); border-color: var(--hover-line); }
.lp-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.lp-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.lp-btn-danger { background: transparent; border-color: var(--red-line); color: var(--red); }
.lp-btn-ghost { background: transparent; border-color: transparent; }
.lp-btn-outline { border-color: var(--accent-line); color: var(--lime); }
.lp-btn-done { background: var(--green-soft); border-color: transparent; color: var(--green); }
.lp-btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.lp-btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.lp-btn-xl { height: 54px; padding: 0 22px; font-size: 15px; border-radius: 16px; }
.lp-btn-block { width: 100%; justify-content: center; }
.lp-btn-tall { height: 48px; border-radius: 14px; }
.lp-btn-pill { border-radius: 999px; }
.lp-btn[disabled], .lp-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.lp-icon-btn { width: 32px; height: 32px; padding: 0; justify-content: center; }
.lp-icon-btn--round { width: 40px; height: 40px; border-radius: 50%; }
.lp-icon-btn--xs { width: 20px; height: 20px; }

/* Chips and tags */
.lp-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--raised); color: var(--text-2);
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.lp-chip.lp-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.lp-chip.lp-lime { background: var(--lime-soft); color: var(--lime); }
.lp-chip.lp-blue { background: var(--blue-soft); color: var(--blue); }
.lp-chip.lp-amber { background: var(--amber-soft); color: var(--amber); }
.lp-chip.lp-red { background: var(--red-soft); color: var(--red); }
.lp-chip.lp-violet { background: var(--violet-soft); color: var(--violet); }
.lp-chip.lp-green { background: var(--green-soft); color: var(--green); }
.lp-chip.lp-cyan { background: var(--cyan-soft); color: var(--cyan); }
.lp-chip--lg { padding: 6px 12px; font-size: 13px; }
.lp-chip--removable { box-sizing: border-box; min-width: 0; max-width: 100%; padding: 6px 8px 6px 12px; border-radius: 14px; white-space: normal; overflow-wrap: anywhere; }
.lp-chip--removable > .lp-btn { flex: none; }
.lp-tag { display: inline-block; padding: 2px 7px; border-radius: 6px; background: var(--raised); color: var(--text-2); font-size: 12px; }
.lp-count-pill { padding: 2px 10px; border-radius: 999px; background: var(--line); font-size: 13px; font-weight: 600; }

/* Cards */
.lp-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); }
.lp-card--lg { padding: 24px; gap: 18px; }
.lp-card--row { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 16px; }
.lp-card--row > .lp-grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lp-text-lime { color: var(--lime); }
.lp-card--center { align-items: center; text-align: center; }
.lp-card.lp-flush { padding: 0; gap: 0; overflow: hidden; }
.lp-card.lp-accent { background: var(--accent-bg); border-color: var(--accent-border); }
.lp-card.lp-warn { background: var(--warn-bg); border-color: var(--warn-border); }
.lp-card.lp-nested { padding: 16px; gap: 12px; background: var(--card-2); }
a.lp-card:hover { border-color: var(--hover-line); color: var(--text); }
.lp-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.lp-card-head h2, .lp-card-head .lp-grow { flex: 1; }
.lp-card.lp-flush .lp-card-head { padding: 16px 20px; border-bottom: 1px solid var(--line); }
/* Light theme lifts surfaces with a hairline shadow instead of contrast */
:root[data-theme="light"] .lp-card,
:root[data-theme="light"] .lp-kpi,
:root[data-theme="light"] .lp-table-wrap,
:root[data-theme="light"] .lp-pt-card { box-shadow: 0 1px 2px rgba(22, 32, 30, .05); }
.lp-card-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }

/* KPI tiles */
.lp-kpi { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); }
.lp-kpi .lp-label { font-size: 13px; color: var(--muted); }
.lp-kpi .lp-value { font: 700 34px/1 var(--font-head); font-variant-numeric: tabular-nums; }
.lp-kpi .lp-sub { font-size: 12px; color: var(--subtle); }
/* A tile without .sub is the plain variant; tiles in a row stretch to the same height */
.lp-kpi.lp-hl { background: var(--accent-bg-2); border-color: var(--accent-border); }
.lp-kpi.lp-hl .lp-value { color: var(--lime); }
.lp-kpi.lp-alert { border-color: var(--warn-border); }
.lp-kpi.lp-alert .lp-value { color: var(--red); }
a.lp-kpi:hover { border-color: var(--hover-line); color: var(--text); }

/* Count card: big number + title, followed by a list of rows */
.lp-count-card .lp-card-head { align-items: center; }
.lp-count-card__num { font: 700 30px var(--font-head); font-variant-numeric: tabular-nums; }
.lp-count-card.lp-is-alert { border-color: var(--warn-border); }
.lp-count-card.lp-is-alert .lp-count-card__num { color: var(--red); }

/* Row lists */
.lp-rows a, .lp-rows .lp-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-2); color: var(--text); }
.lp-rows a:hover { background: var(--card-2); color: var(--text); }
.lp-rows .lp-id { width: 52px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lp-rows .lp-grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lp-rows .lp-grow small { font-size: 12px; color: var(--muted); }
.lp-rows .lp-when { flex: none; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lp-rows .lp-is-current { background: var(--card-2); box-shadow: inset 3px 0 0 var(--accent-line); }
.lp-rows .lp-is-unread { background: var(--accent-bg); }
.lp-unread-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; }
.lp-is-unread .lp-unread-dot { background: var(--accent-line); }
.lp-rows--inset { margin: 0 -24px; }
.lp-card-body .lp-rows--inset { margin: 0 -22px; }
.lp-more { display: block; padding: 12px 20px; font-size: 13px; }

/* Tables */
.server-table-scroll { position: relative; }
.lp-table-wrap { position: relative; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.lp-table-wrap--inset { border: 0; border-radius: 0; }
table.lp-t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lp-t th { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 11.5px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.lp-t thead th { vertical-align: bottom; }
.lp-t td { padding: 11px 12px; border-top: 1px solid var(--line-2); color: var(--text-2); vertical-align: middle; overflow-wrap: break-word; }
.lp-t th:first-child, .lp-t td:first-child { padding-left: 20px; }
.lp-t th:last-child, .lp-t td:last-child { padding-right: 20px; }
.lp-t tbody tr:hover td { background: var(--card-2); }
.lp-t td.lp-strong, .lp-t .lp-strong { color: var(--text); font-weight: 500; }
.lp-t td.lp-wrap { min-width: 160px; overflow-wrap: anywhere; }
.lp-t tfoot td { border-top: 1px solid var(--line); color: var(--text); font-weight: 600; }
.lp-t .lp-band { background: var(--th-band); }
.lp-t .lp-col-progress { width: 220px; }
.lp-t .lp-col-name { min-width: 110px; }
.lp-t.lp-compact { font-size: 12.5px; }
.lp-t.lp-compact th, .lp-t.lp-compact td { padding: 9px 8px; }
.lp-t.lp-compact td.lp-wrap { min-width: 110px; }
.lp-t td.lp-long, .lp-t.lp-compact td.lp-long { min-width: 240px; overflow-wrap: anywhere; }
@media (min-width: 821px) {
  .lp-table-wrap > .lp-t.lp-compact th { letter-spacing: .01em; }
  .lp-table-wrap > .lp-t.lp-compact th:not(:first-child, :last-child),
  .lp-table-wrap > .lp-t.lp-compact td:not(:first-child, :last-child) { padding-inline: 6px; }
  .lp-table-wrap > .lp-t.lp-compact .lp-th-sort { gap: 3px; }
  .lp-table-wrap > .lp-t.lp-compact td.lp-col-name { min-width: 90px; }
}
.lp-t.lp-mini { font-size: 13px; }
.lp-table-foot { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.lp-table-wrap > .lp-table-foot { position: sticky; left: 0; }
.lp-pager { margin-left: auto; display: flex; flex-wrap: wrap; gap: 4px; }
.lp-pager span { min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--text-2); }
.lp-pager .lp-on { background: var(--raised); color: var(--text); }
.lp-cell-lines { display: flex; flex-direction: column; gap: 2px; }
.lp-cell-lines small { font-size: 12px; color: var(--muted); }

/* People */
.lp-person { display: flex; align-items: center; gap: 10px; color: var(--text); }
.lp-person small { display: block; font-size: 12px; color: var(--muted); }
.lp-person__title { font: 600 18px var(--font-head); }
.lp-av { width: 32px; height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--raised); color: var(--lime); font-size: 12px; font-weight: 600; }
.lp-av.lp-md { width: 44px; height: 44px; font-size: 15px; background: var(--teal); color: var(--accent); }
.lp-av.lp-lg { width: 72px; height: 72px; font: 700 26px var(--font-head); background: var(--teal); color: var(--accent); border: 2px solid var(--accent-line); }
.lp-av.lp-xl { width: 96px; height: 96px; font: 700 32px var(--font-head); background: var(--teal); color: var(--accent); border: 2px solid var(--accent-line); }
.lp-av-wrap { position: relative; display: inline-flex; }
.lp-av-wrap .lp-btn { position: absolute; right: -4px; bottom: -4px; border-radius: 50%; }

/* Toolbar, pills, tabs, search */
.lp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lp-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.lp-pill { height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--input-line); background: var(--card); color: var(--text-2); font: 500 13px var(--font-body); white-space: nowrap; cursor: pointer; }
.lp-pill:hover { color: var(--text); border-color: var(--hover-line); }
.lp-pill .lp-n { opacity: .65; }
.lp-pill.lp-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.lp-pill.lp-on:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.lp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.lp-tabs span, .lp-tabs a { margin-bottom: -1px; padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500; white-space: nowrap; }
.lp-tabs .lp-on { color: var(--text); border-color: var(--accent-line); }
.lp-tabs--card { padding: 0 12px; }
.lp-search { flex: 0 1 300px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--input-line); background: var(--card); color: var(--muted); }
.lp-search--period { flex: 0 0 240px; }
.lp-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: 14px var(--font-body); outline: none; }

/* Filter dropdown: <details class="filter"> with autocomplete search and checkbox list */
.lp-filter { position: relative; }
.lp-filter > summary { list-style: none; }
.lp-filter > summary::-webkit-details-marker { display: none; }
.lp-filter > summary .lp-i-chevron { width: 14px; height: 14px; opacity: .7; }
.lp-filter[open] > summary { border-color: var(--accent-line); color: var(--text); }
.lp-filter__count { min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; }
.lp-filter__panel { position: absolute; z-index: 10; top: calc(100% + 6px); right: 0; width: 320px; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); box-shadow: 0 18px 50px var(--shadow); }
.lp-filter__panel--left { right: auto; left: 0; }
.lp-filter__panel.lp-filter__panel--to-left { right: 0; left: auto; }
.lp-filter__panel.lp-filter__panel--to-right { right: auto; left: 0; }
.lp-filter__options { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow: auto; }
.lp-filter__options .lp-check { align-items: center; padding: 8px; border-radius: 8px; font-size: 13.5px; }
.lp-filter__options .lp-check:hover { background: var(--card-2); }
.lp-filter__options mark { background: var(--lime-soft); color: var(--text); border-radius: 3px; }
.lp-filter__actions { display: flex; justify-content: flex-end; gap: 6px; }
.lp-search--sm { flex: none; height: 36px; }

/* Collapsible blocks and dropdown menus */
.lp-reports > summary { list-style: none; }
.lp-reports > summary::-webkit-details-marker { display: none; }
.lp-reports[open] > summary { border-color: var(--accent-line); color: var(--text); }
.lp-filter.lp-filter--menu[open] { flex-basis: auto; }
.lp-filter--menu > .lp-filter__panel { position: absolute; width: max-content; margin-top: 0; box-shadow: 0 18px 50px var(--shadow); }
.lp-card.lp-flush:has(.lp-filter--menu[open]) { overflow: visible; }
.lp-t .lp-cell-name { color: var(--text); font-weight: 500; }

/* Forms */
.lp-form { display: flex; flex-direction: column; gap: 18px; }
.lp-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.lp-field > label, .lp-field > .lp-label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.lp-field__row { display: flex; justify-content: space-between; gap: 8px; }
.lp-req::after { content: " *"; color: var(--red); }
.lp-input, .lp-select, .lp-textarea { width: 100%; height: 42px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--input-line); background: var(--input); color: var(--text); font: 14px var(--font-body); outline: none; }
.lp-input--lg { height: 52px; }
input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; }
@media (min-width: 641px) {
  .lp-app .lp-grid.lp-date-filter { display: flex; flex-wrap: wrap; align-items: flex-end; }
  .lp-date-filter > .lp-field { flex: 0 0 220px; }
  .lp-date-filter > .lp-field--action { flex: 0 0 auto; }
}
@supports (-webkit-touch-callout: none) {
  input.lp-input[type="date"], input.lp-input[type="month"], input.lp-input[type="datetime-local"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; line-height: 40px; }
  input.lp-input::-webkit-date-and-time-value { margin: 0; text-align: left; }
}
.lp-input--code { height: 52px; font-family: var(--font-mono); font-size: 17px; letter-spacing: .12em; text-transform: uppercase; }
.lp-input--sm { height: 34px; }
.lp-textarea { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.lp-select {
  appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.lp-input::placeholder, .lp-textarea::placeholder { color: var(--placeholder); }
.lp-input:focus, .lp-select:focus, .lp-textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--lime-soft); }
.lp-input:disabled, .lp-select:disabled { opacity: .6; }
.lp-input-icon { position: relative; display: block; }
.lp-input-icon > .lp-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.lp-input-icon > .lp-input { padding-left: 40px; }
.lp-input-icon > .lp-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.lp-input-icon--action > .lp-input { padding-left: 12px; padding-right: 44px; }
.lp-input-group { display: flex; align-items: flex-end; gap: 8px; }
.lp-input-group .lp-btn { flex: none; }
.lp-help { font-size: 12px; color: var(--subtle); }
a.lp-help { display: inline-flex; align-items: center; align-self: flex-start; gap: 6px; }
a.lp-help .lp-ico { flex: none; width: 16px; height: 16px; }
.lp-help strong, .lp-help b { color: var(--text); }

.lp-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-2); }
.lp-check input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent-line); }
.lp-check--box { align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--input-line); }
.lp-check--box.lp-is-selected { border-color: var(--accent-line); background: var(--lime-soft); }
.lp-check--box > span { flex: 1; }
.lp-check--panel { padding: 14px; border-radius: 14px; border: 1px solid var(--input-line); background: var(--input); }

.lp-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.lp-choice label { height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--input-line); background: var(--input); color: var(--text-2); font-size: 14px; }
.lp-choice label.lp-on { border-color: var(--accent-line); background: var(--lime-soft); color: var(--text); }
.lp-choice input { margin: 0; accent-color: var(--accent-line); }

.lp-segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 4px; border-radius: 14px; border: 1px solid var(--input-line); background: var(--input); }
.lp-segmented .lp-btn { justify-content: center; }

.lp-drop { display: flex; align-items: center; gap: 16px; padding: 22px; border-radius: 14px; border: 1.5px dashed var(--hover-line); background: var(--card-2); color: var(--muted); }
.lp-drop .lp-ico { flex: none; width: 28px; height: 28px; color: var(--lime); }
.lp-drop b { color: var(--text); font-weight: 500; }

.lp-form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.lp-form-actions--start { justify-content: flex-start; }
.lp-form-actions--between { justify-content: space-between; }

.lp-autocomplete { position: relative; display: block; }
.lp-autocomplete__list { position: absolute; z-index: 2; top: 46px; left: 0; right: 0; display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); box-shadow: 0 16px 40px var(--shadow); }
.lp-autocomplete__list span { padding: 8px 10px; border-radius: 8px; }
.lp-autocomplete__list .lp-on { background: var(--raised); }

/* Key-value lists */
.lp-dl { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.lp-dl dt { color: var(--muted); }
.lp-dl dd { margin: 0; min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.lp-dl dd.lp-num { white-space: nowrap; }
.lp-dl--stack { grid-template-columns: 1fr; gap: 2px; }
.lp-dl--stack dd { margin-bottom: 10px; }

/* Timeline */
.lp-tl { display: flex; flex-direction: column; }
.lp-tl article { display: flex; gap: 14px; }
.lp-tl .lp-rail { display: flex; flex-direction: column; align-items: center; }
.lp-tl .lp-dot { width: 12px; height: 12px; flex: none; margin-top: 5px; border-radius: 50%; background: var(--subtle); }
.lp-tl .lp-dot--accent { background: var(--accent-line); }
.lp-tl .lp-dot--red { background: var(--red-line); }
.lp-tl .lp-dot--blue { background: var(--blue); }
.lp-tl .lp-line { flex: 1; width: 2px; margin-top: 6px; background: var(--line); }
.lp-tl .lp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; padding-bottom: 22px; }
.lp-tl article:last-child .lp-body { padding-bottom: 0; }
.lp-tl .lp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lp-tl .lp-meta span, .lp-tl .lp-meta a { font-size: 12px; }
.lp-tl .lp-meta span { color: var(--muted); }
.lp-tl p { color: var(--text-3); line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }

/* Files and thumbnails */
.lp-files { display: flex; flex-wrap: wrap; gap: 8px; }
.lp-file { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--r-sm); background: var(--raised); color: var(--text); font-size: 13px; }
.lp-file .lp-ico { width: 16px; height: 16px; color: var(--lime); }
.lp-file.lp-is-locked { opacity: .5; }
.lp-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.lp-thumb { aspect-ratio: 4 / 3; display: flex; align-items: flex-end; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(135deg, var(--raised), var(--card)); color: var(--muted); font-size: 12px; }


/* Progress: native <progress> keeps data out of style attributes */
.lp-progress { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 6px; overflow: hidden; background: var(--line); }
.lp-progress::-webkit-progress-bar { background: var(--line); }
.lp-progress::-webkit-progress-value { background: var(--accent-line); border-radius: 6px; }
.lp-progress::-moz-progress-bar { background: var(--accent-line); border-radius: 6px; }
.lp-progress--amber::-webkit-progress-value { background: var(--amber); }
.lp-progress--amber::-moz-progress-bar { background: var(--amber); }
.lp-progress--lg { height: 8px; }
.lp-progress-row { display: flex; align-items: center; gap: 10px; max-width: 360px; }
.lp-progress-row .lp-progress { flex: 1; }

/* Lifeline (post_preview): produced · to print · additional · grey tail.
   One <i> per aligner so segment widths follow the counts; .lifeline__sep marks print batches. */
.lp-lifeline { display: flex; align-items: stretch; height: 10px; }
.lp-lifeline__bar { flex: 1; display: flex; overflow: hidden; border-radius: 6px 0 0 6px; }
.lp-lifeline__bar i { flex: 1 1 0; min-width: 0; }
.lp-lifeline__bar .lp-made { background: var(--accent-line); }
.lp-lifeline__bar .lp-left { background: var(--blue); }
.lp-lifeline__bar .lp-extra { background: var(--red-line); }
.lp-lifeline__sep { flex: 0 0 2px; background: var(--card); }
.lp-lifeline__tail { flex: 0 0 14%; border-radius: 0 6px 6px 0; background: repeating-linear-gradient(135deg, var(--raised) 0 4px, var(--hover-line) 4px 8px); }
.lp-ll-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.lp-ll-stat { display: flex; flex-direction: column; gap: 2px; }
.lp-ll-stat small { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.lp-ll-stat small::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--hover-line); }
.lp-ll-stat--made small::before { background: var(--accent-line); }
.lp-ll-stat--left small::before { background: var(--blue); }
.lp-ll-stat--extra small::before { background: var(--red-line); }
.lp-ll-stat--plan small::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.lp-ll-stat b { font: 700 22px var(--font-head); font-variant-numeric: tabular-nums; }
.lp-ll-stat .lp-jaws { font-size: 12px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.lp-ll-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.lp-ll-foot b { color: var(--text); font-weight: 600; }

/* Charts and legends */
/* Line chart: <canvas data-chart> drawn by lime-redesign.js with theme colours */
.lp-chart { display: block; width: 100%; height: 220px; }
.lp-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.lp-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; background: var(--hover-line); }
.lp-legend .lp-l-blue::before { background: var(--blue); }
.lp-legend .lp-l-accent::before { background: var(--accent-line); }
.lp-legend .lp-l-violet::before { background: var(--violet); }
.lp-legend .lp-l-amber::before { background: var(--amber); }
.lp-legend .lp-l-red::before { background: var(--red-line); }
.lp-legend .lp-l-tail::before { background: repeating-linear-gradient(135deg, var(--raised) 0 2px, var(--hover-line) 2px 4px); }

/* Notices */
.lp-notice { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--blue-soft); color: var(--blue-ink); font-size: 13.5px; line-height: 1.5; }
.lp-notice .lp-ico { margin-top: 1px; color: var(--blue); }
.lp-notice.lp-warn { background: var(--amber-soft); color: var(--amber-ink); }
.lp-notice.lp-warn .lp-ico { color: var(--amber); }
.lp-notice.lp-success { background: var(--green-soft); color: var(--green-ink); }
.lp-notice.lp-success .lp-ico { color: var(--green); }

/* Icon tile: square tinted icon */
.lp-icon-tile { width: 52px; height: 52px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 16px; background: var(--lime-soft); color: var(--lime); }
.lp-icon-tile--blue { background: var(--blue-soft); color: var(--blue); }

/* Modal */
.lp-modal-layer { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--scrim); }
.lp-modal-layer:not(:target) { display: none; }
.lp-modal { width: 440px; max-width: calc(100% - 32px); padding: 24px; gap: 18px; box-shadow: 0 30px 80px var(--shadow); }
.lp-elevated { box-shadow: 0 30px 80px var(--shadow); }

/* Shell additions: collapsible nav group, toasts, error notice, back-to-top, side footer */
.lp-nav-group > summary { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--text-2); font-size: 14px; list-style: none; cursor: pointer; }
.lp-nav-group > summary::-webkit-details-marker { display: none; }
.lp-nav-group > summary:hover { background: var(--card-2); color: var(--text); }
.lp-nav-group > summary .lp-i-chevron { margin-left: auto; width: 14px; height: 14px; opacity: .7; transition: transform .15s ease; }
.lp-nav-group[open] > summary .lp-i-chevron { transform: rotate(90deg); }
.lp-nav-group__items { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 4px 20px; }
.lp-nav-group__items a { padding: 7px 12px; font-size: 13.5px; }
.lp-brand__badge { margin-left: 4px; padding: 2px 8px; border-radius: 999px; background: var(--red-soft); color: var(--red); font: 600 11px var(--font-body); letter-spacing: .06em; }
.lp-side-copy { padding: 0 8px; font-size: 12px; line-height: 1.5; color: var(--subtle); }

.lp-toasts { position: fixed; z-index: 60; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100% - 32px)); }
.lp-toast { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); box-shadow: 0 18px 50px var(--shadow); font-size: 13.5px; line-height: 1.5; }
.lp-toast .lp-ico { margin-top: 1px; color: var(--green); }
.lp-toast--warn .lp-ico { color: var(--amber); }
.lp-toast__text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lp-toast__close { flex: none; display: inline-flex; padding: 2px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.lp-toast__close:hover { color: var(--text); }
.lp-toast[hidden] { display: none; }

.lp-notice.lp-danger { background: var(--red-soft); color: var(--text); }
.lp-notice.lp-danger .lp-ico { color: var(--red); }
.lp-notice__list { margin: 0; padding-left: 18px; }
.lp-notice__body { flex: 1; min-width: 0; }
.lp-notice--banner { align-items: center; }
.lp-notice--banner .lp-btn { margin-left: auto; flex: none; }

.lp-back-top { position: fixed; z-index: 50; right: 24px; bottom: 24px; width: 44px; height: 44px; display: none; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--input-line); background: var(--card); color: var(--text-2); box-shadow: 0 8px 24px var(--shadow); cursor: pointer; }
.lp-back-top:hover { color: var(--text); border-color: var(--hover-line); }
.lp-back-top.lp-show { display: inline-flex; }
.lp-back-top .lp-ico { transform: rotate(-90deg); }
.lp-back-bottom { bottom: 80px; }
.lp-back-bottom .lp-ico { transform: rotate(90deg); }

/* Server data table: sortable headers, row states, pager buttons, export menu */
.lp-data-table { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lp-data-table.lp-loading .lp-t tbody { opacity: .5; transition: opacity .15s ease; }
.lp-th-sort { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: left; cursor: pointer; }
.lp-th-sort::after { content: "\2195"; opacity: .35; }
.lp-t th[aria-sort="ascending"] .lp-th-sort, .lp-t th[aria-sort="descending"] .lp-th-sort { color: var(--text); }
.lp-t th[aria-sort="ascending"] .lp-th-sort::after { content: "\2191"; opacity: 1; }
.lp-t th[aria-sort="descending"] .lp-th-sort::after { content: "\2193"; opacity: 1; }
[data-table-sort-menu] .lp-th-sort[data-sort-direction="asc"]::after { content: "\2191"; opacity: 1; }
[data-table-sort-menu] .lp-th-sort[data-sort-direction="desc"]::after { content: "\2193"; opacity: 1; }
.lp-case-list { gap: 22px; }
.lp-case-list [data-table-filter] > summary > .lp-i-chevron { display: none; }
.lp-t td a:not(.lp-person) { color: inherit; }
.lp-t tbody tr[data-href] { cursor: pointer; }
.lp-t tbody tr[data-state~="is_closed"] td { color: var(--muted); }
.lp-t tbody tr[data-state~="new"] td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
.lp-t td.lp-empty { padding: 28px 20px; text-align: center; color: var(--muted); }
.lp-pager button, .lp-pager a { min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; }
.lp-pager button:hover:not(:disabled), .lp-pager a:hover { background: var(--card-2); color: var(--text); }
.lp-pager button:disabled, .lp-pager .lp-off { opacity: .4; cursor: default; }
.lp-pager button.lp-on { background: var(--raised); color: var(--text); }
.lp-filter__panel--sm { width: auto; min-width: 170px; gap: 2px; padding: 6px; }
.lp-filter__panel--sm .lp-btn { justify-content: flex-start; width: 100%; }
.lp-filter__empty { padding: 8px; font-size: 13px; color: var(--muted); }
.lp-filter__count[hidden] { display: none; }
.lp-filter__options .lp-grow { flex: 1; }

/* Legacy Bootstrap gives every label a bottom margin; lime labels are laid out by flex gaps */
label.lp-btn, .lp-mtop label, .lp-side label, .lp-search, .lp-check, .lp-choice label, .lp-field > label, .lp-filter label { margin-bottom: 0; }

/* Upload wizard: stepper buttons, slot states */
.lp-upload-step { width: 100%; height: 100%; text-align: left; cursor: pointer; font: inherit; }
.lp-upload-step.lp-on:hover { color: var(--text); }
.lp-slot__example { width: 48%; max-width: 120px; border-radius: 8px; object-fit: cover; }
.lp-slot__preview--done .lp-slot__example { display: none; }
.lp-slot .ucu-drop-zone { cursor: pointer; border: 1.5px dashed var(--hover-line); background: var(--card-2); }
.lp-slot .ucu-drop-zone:hover, .lp-slot .ucu-drop-zone.lp-dragover, .lp-slot .ucu-drop-zone:focus-visible { border-color: var(--accent-line); color: var(--text); outline: none; }
.lp-slot .ucu-uploading { background: var(--card-2); color: var(--lime); }
.lp-slot .ucu-preview-img { max-width: 100%; max-height: 120px; border-radius: 8px; object-fit: cover; }
.lp-desktop-only { display: inline-flex; }
@media (max-width: 820px) { .lp-desktop-only { display: none; } }

/* 3D share links */
.lp-vis-share__create { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label label" "expiry submit"; align-items: end; gap: 12px; padding: 14px; border-radius: 12px; background: var(--card-2); }
.lp-vis-share__create > .lp-field { grid-area: label; }
.lp-vis-share__create > fieldset { grid-area: expiry; }
.lp-vis-share__create > .lp-btn { grid-area: submit; }
.lp-vis-share__expiry { min-width: 0; margin: 0; padding: 0; border: 0; }
.lp-vis-share__expiry legend { margin-bottom: 4px; padding: 0; font-size: 13px; font-weight: 500; color: var(--text-2); }
.lp-vis-share__links { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.lp-vis-share__empty { padding: 20px; border: 1px dashed var(--hover-line); border-radius: 12px; text-align: center; color: var(--muted); }
.lp-vis-link { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); }
.lp-vis-link.lp-is-fresh { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--lime-soft); }
.lp-vis-link.lp-is-inactive { opacity: .7; }
.lp-vis-link__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.lp-vis-link__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.lp-vis-link__ready { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 500; color: var(--lime); }
.lp-vis-link__url { font: 13px var(--font-mono); }
.lp-vis-link__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lp-vis-link__actions .lp-vis-link__revoke { margin-left: auto; }
.lp-vis-link .lp-btn.lp-is-done { border-color: var(--green); color: var(--green); }
.lp-vis-link__confirm { display: none; flex-direction: column; gap: 10px; padding: 12px; border-radius: 10px; background: var(--red-soft); }
.lp-vis-link__confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.lp-vis-link.lp-is-confirming .lp-vis-link__actions { display: none; }
.lp-vis-link.lp-is-confirming .lp-vis-link__confirm { display: flex; }
.lp-vis-link__meta { margin: 0; font-size: 12px; color: var(--muted); }
.lp-vis-link__opens { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; border: 0; background: none; font-size: 13px; color: var(--muted); text-align: left; }
.lp-vis-link__toggle { color: var(--lime); font-weight: 500; cursor: pointer; }
.lp-vis-link__toggle .lp-ico { width: 12px; height: 12px; transition: transform .15s; }
.lp-vis-link__toggle[aria-expanded="true"] .lp-ico { transform: rotate(180deg); }
.lp-vis-link__visits { padding-top: 10px; border-top: 1px solid var(--line); }
.lp-vis-link__visits ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.lp-vis-link__visits-title, .lp-vis-link__loading { margin: 0 0 8px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.lp-vis-visit { display: flex; flex-direction: column; gap: 2px; }
.lp-vis-visit__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lp-vis-visit.lp-is-bot { opacity: .6; }
@media (max-width: 575.98px) { .lp-vis-share__create { grid-template-columns: minmax(0, 1fr); grid-template-areas: "label" "expiry" "submit"; } .lp-vis-link__actions .lp-btn { flex: 1 1 auto; } .lp-vis-link__actions .lp-vis-link__revoke { flex-basis: 100%; margin-left: 0; } }

/* Edit pages */
.lp-step-file { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lp-step-file__thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.lp-logo-preview { max-height: 80px; max-width: 200px; object-fit: contain; border-radius: 8px; }

/* Case action forms: tabs, quantities, upload field, guides */
[hidden] { display: none !important; }
.lp-tab-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.lp-tab-buttons .lp-btn.lp-is-active { box-shadow: 0 0 0 2px var(--accent-line); }
.lp-qty-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; }
.lp-qty-row .lp-input { width: 96px; flex: none; }
.lp-qty-row > label, .lp-qty-row > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lp-qty-row > .lp-field { flex: 0 0 96px; }
.lp-pack-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.lp-pack-grid > .lp-qty-row { align-items: flex-start; min-height: 64px; padding: 10px 12px; border-radius: 10px; background: var(--card-2); }
.lp-pack-grid > .lp-qty-row > label { padding-top: 8px; line-height: 1.35; }
.lp-pack-grid .lp-input { background: var(--input); }
.lp-upload-field { display: flex; flex-direction: column; gap: 8px; }
.lp-upload-field .lp-progress { width: 180px; }
.lp-guide { display: flex; flex-direction: column; gap: 10px; line-height: 1.55; color: var(--text-2); }
.lp-guide ul, .lp-guide ol { margin: 0; padding-left: 20px; }
.lp-notice h3 { color: var(--text); }
.lp-notice.lp-stack { align-items: stretch; }

/* Case card: file tiles with real previews, viewer, closed steps, collapsible blocks */
.lp-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
.lp-small { font-size: 12.5px; color: var(--lime); cursor: pointer; }
.lp-more { display: flex; flex-direction: column; gap: 12px; }
.lp-more > summary { list-style: none; cursor: pointer; }
.lp-more > summary::-webkit-details-marker { display: none; }
.lp-more[open] > summary { margin-bottom: 4px; }
.lp-card-head > .lp-more { gap: 0; padding: 0; }
.lp-card-head > .lp-more[open] { flex-basis: 100%; gap: 12px; }
.lp-card-head > .lp-more > summary { align-self: flex-end; }
.lp-is-closed { opacity: .55; }
.lp-file-tile { position: relative; overflow: hidden; }
.lp-file-tile__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lp-file-tile--photo span { position: relative; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .6); color: #F2F4F0; }
.lp-file-tile-wrap { position: relative; display: flex; }
.lp-file-tile-wrap > .lp-file-tile { flex: 1; }
.lp-file-tile__share { position: absolute; top: 6px; right: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 8px; background: rgba(0, 0, 0, .45); color: #F2F4F0; }
.lp-file-tile__share:hover { color: var(--accent); }
.lp-modal--wide { width: min(1100px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto; }
.lp-file-viewer__img { display: block; max-width: 100%; max-height: calc(100vh - 150px); margin: 0 auto; border-radius: 10px; object-fit: contain; }
.lp-tl article.lp-is-closed .lp-body { opacity: .6; }
.lp-tl article.lp-is-closed { opacity: 1; }

.lp-field__error { font-size: 12.5px; color: var(--red); }
/* Form validation states, autocomplete, case cards */
.lp-input[aria-invalid="true"], .lp-select[aria-invalid="true"], .lp-textarea[aria-invalid="true"] { border-color: var(--red-line); }
.lp-check input[aria-invalid="true"] { outline: 2px solid var(--red-line); outline-offset: 1px; }
.lp-choice:has(input[aria-invalid="true"]) label { border-color: var(--red-line); }
.lp-field__error[hidden] { display: none; }
.lp-choice label { cursor: pointer; }
.lp-autocomplete__list[hidden] { display: none; }
.lp-autocomplete__list span { cursor: pointer; }
.lp-autocomplete__list span:hover { background: var(--card-2); }
.lp-av { overflow: hidden; }
.lp-av img { width: 100%; height: 100%; object-fit: cover; }
.lp-case-timeline-author { display: inline-flex; align-items: center; gap: 6px; }
.lp-case-timeline-author img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.lp-person .lp-grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lp-case-card { gap: 14px; }
.lp-case-card__hint { color: var(--muted); }
.lp-case-card .lp-person { gap: 12px; }

.lp-hidden { display: none; }

/* Misc */
.lp-divider { height: 1px; margin: 4px 0; background: var(--line); }
.lp-or { display: flex; align-items: center; gap: 12px; color: var(--subtle); font-size: 13px; }
.lp-or::before, .lp-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.lp-swatch { width: 14px; height: 14px; flex: none; border-radius: 4px; }
.lp-swatch--upcoming { background: var(--lime-soft); box-shadow: inset 0 0 0 2px var(--accent-line); }
.lp-swatch--missed { background: var(--red-soft); box-shadow: inset 0 0 0 2px var(--red-line); }
.lp-swatch--confirmed { background: var(--raised); box-shadow: inset 0 0 0 1px var(--hover-line); }
.lp-legend-item { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.lp-theme-btn .lp-i-moon { display: none; }
:root[data-theme="light"] .lp-theme-btn .lp-i-sun { display: none; }
:root[data-theme="light"] .lp-theme-btn .lp-i-moon { display: inline-block; }
.lp-floating-tools { position: absolute; top: 20px; right: 20px; display: flex; align-items: center; gap: 8px; }


/* 5. Page sections (staff) -------------------------------------------------- */

/* Staff login */
.lp-login { min-height: 100vh; display: flex; }
.lp-login__aside { position: relative; isolation: isolate; overflow: hidden; flex: 1 1 560px; display: flex; flex-direction: column; justify-content: space-between; padding: 56px 64px; background: #101213; color: #F2F4F0; }
.lp-login__aside .lp-brand, .lp-login__aside .lp-pt-logo { color: #F2F4F0; }
:root .lp-login__aside .lp-logo { background: #D9FB19; }
/* Video fills the panel; the gradient keeps the white text readable in both themes */
.lp-login__video { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.lp-login__aside::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(16, 18, 19, .55), rgba(16, 18, 19, .1) 45%, rgba(16, 18, 19, .75)); }
.lp-login__headline { font-size: 56px; line-height: 1.05; }
.lp-login__main { position: relative; flex: 1 1 480px; display: flex; align-items: center; justify-content: center; padding: 56px 32px; }
.lp-login__form { width: 100%; max-width: 400px; gap: 20px; }
.lp-login__title { font-size: 32px; font-weight: 700; }
.lp-login__brand, .lp-pt-logo.lp-login__brand { display: none; }
.lp-login__copy { margin: 0; font-size: 13px; opacity: .8; }
.lp-login__text { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.lp-field__row a { font-size: 13px; color: var(--lime); }
.lp-login__links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.lp-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.lp-or::before, .lp-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Case header */
.lp-case-hero__top { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.lp-case-hero__info { flex: 1 1 300px; display: flex; flex-direction: column; gap: 8px; }

/* Case hero: identity + lifeline on the left, case modules on the right */
.lp-case-hero { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 24px; }
.lp-case-hero__main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lp-modules { display: flex; flex-direction: column; gap: 8px; }
.lp-module { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--input-line); background: var(--card-2); color: var(--text); font-weight: 500; }
.lp-module small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.lp-module .lp-ico { color: var(--lime); }
.lp-module:hover { border-color: var(--accent-line); color: var(--text); }

/* Case information */
.lp-case-info__list { display: grid; gap: 12px; margin: 0; font-size: 14px; }
.lp-case-info__row { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); gap: 3px 12px; align-items: baseline; }
.lp-case-info__row dt { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.lp-case-info__row dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.lp-case-info__row dd > * { min-width: 0; }
.lp-case-info__row--wide { grid-template-columns: minmax(0, 1fr); }
.lp-case-info__row--wide dd > span { white-space: pre-wrap; line-height: 1.55; }
.lp-case-info__details { border-top: 1px solid var(--line); padding: 12px 0 0; }
.lp-case-info__details > summary { display: flex; align-items: center; gap: 6px; width: fit-content; }
.lp-case-info__details > summary .lp-ico { width: 14px; height: 14px; }
.lp-case-info__details[open] > summary { margin-bottom: 12px; }
.lp-case-info__details[open] > summary .lp-ico { transform: rotate(180deg); }
@media (max-width: 380px) { .lp-case-info__row { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 768px) { .lp-case-split > aside, .lp-case-split #case-info { order: -1; } }

/* Timeline file previews (file/index): photos, documents, 3D, locked Maestro viewer */
.lp-file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.lp-file-tile { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); color: var(--text-2); font-size: 12px; text-align: center; overflow-wrap: anywhere; }
.lp-file-tile .lp-ico { width: 28px; height: 28px; color: var(--lime); }
.lp-file-tile:hover { border-color: var(--hover-line); color: var(--text); }
.lp-file-tile--photo { justify-content: flex-end; background: radial-gradient(circle at 50% 40%, var(--photo), var(--card-2) 75%); }
.lp-file-tile--3d { background: linear-gradient(135deg, var(--teal), var(--teal-2)); color: #F2F4F0; }
.lp-file-tile--3d .lp-ico { color: var(--accent); }
.lp-file-tile.lp-is-locked { opacity: .5; }

/* Approval choice: decide yes/no first, then the matching form opens */
.lp-decision { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lp-decision__opt { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--input-line); background: var(--card); color: var(--text-2); font-weight: 600; }
.lp-decision__opt small { display: block; font-weight: 400; color: var(--muted); }
.lp-decision__opt .lp-ico { width: 24px; height: 24px; }
.lp-decision__opt { cursor: pointer; font: inherit; text-align: left; }
.lp-decision__opt.lp-on, .lp-decision__opt.lp-is-active { border-color: var(--accent-line); background: var(--lime-soft); color: var(--text); }
.lp-decision__opt.lp-on .lp-ico, .lp-decision__opt.lp-is-active .lp-ico { color: var(--lime); }
.lp-decision__opt--no.lp-is-active { border-color: var(--red-line); background: var(--red-soft); }
.lp-decision__opt--no.lp-is-active .lp-ico { color: var(--red); }
.lp-decision__opt--no .lp-ico { color: var(--red); }

/* Profile header: avatar, name and key facts in one row */
.lp-profile-head { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 20px 28px; }
.lp-profile-head__name { display: flex; flex-direction: column; gap: 4px; }
.lp-profile-head__facts { flex: 1 1 520px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 24px; margin: 0; }
.lp-profile-head__facts dt { font-size: 12px; color: var(--muted); }
.lp-profile-head__facts dd { margin: 4px 0 0; color: var(--text); overflow-wrap: anywhere; }

/* Doctor case cards */
.lp-case-card { color: var(--text); }
.lp-case-card.lp-is-action { background: var(--accent-bg-2); border-color: var(--accent-border); }
.lp-case-card.lp-is-waiting { border-color: var(--amber-line); }

.lp-stat__value { font: 700 22px var(--font-head); font-variant-numeric: tabular-nums; }
/* Stock group: each material is a collapsible row with its own type and comment */
.lp-move-item { border-bottom: 1px solid var(--line-2); }
.lp-move-item__head { display: flex; align-items: center; gap: 12px; padding: 12px 20px; list-style: none; cursor: pointer; }
.lp-move-item__head::-webkit-details-marker { display: none; }
.lp-move-item__head small { display: block; font-size: 12px; color: var(--muted); }
.lp-move-item__head .lp-i-chevron { color: var(--muted); transition: transform .15s; }
.lp-move-item[open] .lp-move-item__head .lp-i-chevron { transform: rotate(180deg); }
.lp-move-item__num { width: 26px; height: 26px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--raised); font-size: 12px; font-weight: 600; }
.lp-move-item__body { padding: 4px 20px 18px 58px; }
.lp-span-2 { grid-column: span 2; }

/* File picker (upl_draft_edit): steps with counters and labelled upload slots */
.lp-upload-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 10px; margin: 0; padding: 0; list-style: none; }
.lp-upload-steps > li { min-width: 0; }
.lp-upload-step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text-2); font-weight: 500; }
.lp-upload-step small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.lp-upload-step > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.lp-upload-step__num { width: 30px; height: 30px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--raised); font-weight: 700; }
.lp-upload-step.lp-on { border-color: var(--accent-line); background: var(--accent-bg); color: var(--text); }
.lp-upload-step.lp-on .lp-upload-step__num { background: var(--accent); color: var(--on-accent); }
.lp-upload-total { flex: 0 0 160px; }
.lp-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.lp-slot { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lp-slot__label { font-size: 13px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.lp-slot__preview { width: 100%; min-width: 0; margin-top: auto; aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: radial-gradient(circle at 50% 45%, var(--photo), var(--card-2) 75%); color: var(--muted); font-size: 12px; text-align: center; }
@media (min-width: 769px) {
  .lp-step-panel[data-step="1"] .lp-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lp-step-panel[data-step="1"] .lp-slot__preview { aspect-ratio: auto; height: 190px; }
  .lp-step-panel[data-step="1"] .lp-slot__example { max-width: 110px; }
}
.lp-slot__preview .lp-ico { width: 26px; height: 26px; }
.lp-slot__preview .lp-progress { width: 70%; }
.lp-slot__meta { font-size: 12px; color: var(--muted); }
.lp-slot--empty { cursor: pointer; }
.lp-slot--empty .lp-slot__preview { border: 1.5px dashed var(--hover-line); background: var(--card-2); }
.lp-slot--empty:hover .lp-slot__preview { border-color: var(--accent-line); color: var(--text); }
.lp-slot--done .lp-slot__preview { align-items: flex-end; justify-content: flex-start; }
.lp-slot--done .lp-slot__preview .lp-ico { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.lp-slot--uploading .lp-slot__preview { background: var(--card-2); color: var(--lime); }
.lp-slot--error .lp-slot__preview { border-color: var(--red-line); background: var(--red-soft); color: var(--red); }
.lp-qr-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 820px) { .lp-qr-layout { grid-template-columns: minmax(0, 1fr); } }
#qrcode.lp-qr-box { width: 260px; height: 260px; }
#qrcode.lp-qr-box svg { width: 100%; height: 100%; border-radius: 12px; }
.lp-qr-box { width: 200px; height: 200px; display: flex; align-items: center; justify-content: center; border-radius: 16px; background: #fff; color: #161819; }
.lp-qr-box .lp-ico { width: 150px; height: 150px; }


/* Production */
.lp-prod-head { display: flex; flex-direction: column; gap: 12px; padding: 18px 22px; }
.lp-prod-head__title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lp-prod-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.lp-prod-stats > div { display: flex; align-items: baseline; gap: 8px; padding: 6px 12px; border-radius: 10px; background: var(--card-2); }
.lp-prod-stats dt { font-size: 12px; color: var(--muted); }
.lp-prod-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.lp-prod-stats small { font-weight: 400; color: var(--subtle); }
.lp-prod-tasks { display: flex; flex-direction: column; gap: 14px; padding: 18px 22px; border-top: 1px solid var(--line); }
.lp-stage { display: flex; flex-direction: column; gap: 6px; }
.lp-stage .lp-btn { justify-content: center; }

/* Payments */
.lp-tabs button { margin-bottom: -1px; padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 500 14px var(--font-body); white-space: nowrap; cursor: pointer; }
.lp-tabs button:hover { color: var(--text); }
.lp-tabs button.lp-is-active { color: var(--text); border-color: var(--accent-line); }
.lp-order-wrap { overflow-x: auto; }
.lp-order { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--text); }
.lp-order td { padding: 6px 12px; border: 0; vertical-align: top; }
.lp-order td[colspan] { overflow-wrap: anywhere; }
.lp-order h3 { margin: 0; }
.lp-order thead td, .lp-order tfoot td { color: var(--text-2); }
.lp-file small { display: block; color: var(--muted); }
.lp-drop { cursor: pointer; }
.lp-file-pick > .lp-drop [data-file-name] { min-width: 0; overflow-wrap: anywhere; }
.lp-file-pick > input:focus-visible + .lp-drop { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.lp-file-pick > input[aria-invalid="true"] + .lp-drop { border-color: var(--red-line); }

/* Production forms */
.lp-t.lp-mini { font-size: 13px; }
.lp-t.lp-mini th, .lp-t.lp-mini td { padding: 6px 8px; }
.lp-input.lp-is-preset { border-color: var(--amber); background: var(--amber-soft); }
.lp-prod-tasks > .lp-card-head { padding: 0; border: 0; }
.lp-card.lp-nested > .lp-card-head { padding: 0; border: 0; flex-wrap: wrap; }
.lp-queue-filters .lp-select { width: auto; max-width: 100%; }
.lp-queue-filters .lp-search { min-width: min(220px, 100%); }

/* Stock and reports */
.lp-stock-form { max-width: 760px; }
.lp-stock-facts th { width: 28%; }
.lp-stock-facts td { overflow-wrap: anywhere; }
.lp-stock .lp-stock-incoming { color: var(--green); }
.lp-stock .lp-stock-outgoing { color: var(--blue); }
.lp-stock-preview-toggle { align-self: center; margin: 8px; }
.lp-stock-preview-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.lp-stock-report-filters, .lp-report-date-fields { align-items: end; }
.lp-report-date-fields .lp-search { flex: auto; }
.lp-report-date-fields .lp-field { flex: 0 1 215px; }
.lp-report-period-form { padding-top: 10px; }
.lp-stock-group-row {
  display: grid; grid-template-columns: minmax(160px, 3fr) repeat(2, minmax(85px, 1fr)) auto; align-items: end; gap: 12px;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card-2);
}
.lp-stock-group-row > .lp-btn { height: 42px; }
.lp-stock .lp-field .select2-container { width: 100% !important; }
.lp-stock-report-filters .lp-field:first-child { flex: 1 1 230px; max-width: 420px; }
.lp-stock-menu { position: fixed; top: 0; left: 0; z-index: 30; min-width: 200px; display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); box-shadow: 0 16px 40px var(--shadow); }
.lp-stock-menu a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; }
.lp-stock-menu a:hover, .lp-stock-menu a:focus-visible { background: var(--card-2); color: var(--text); }
.lp-stock-menu a.lp-danger { color: var(--red); }
.lp-stock-menu .lp-ico { width: 16px; height: 16px; }
.lp-stock td > .lp-cluster { min-width: 145px; }
.lp-chip.movement-type-incoming { background: var(--green-soft); color: var(--green); }
.lp-chip.movement-type-prod_use { background: var(--blue-soft); color: var(--blue); }
.lp-chip.movement-type-transfer { background: var(--cyan-soft); color: var(--cyan); }
.lp-chip.movement-type-sale { background: var(--lime-soft); color: var(--lime); }
.lp-chip.movement-type-gift { background: var(--violet-soft); color: var(--violet); }
.lp-chip.movement-type-write_off { background: var(--red-soft); color: var(--red); }
.movement-qty-incoming { color: var(--green); font-weight: 500; }
.movement-qty-prod_use { color: var(--blue); font-weight: 500; }
.lp-field--action { justify-content: flex-end; align-items: center; }
.lp-field--action > .lp-btn { height: 42px; }
.lp-stock-conduct { max-width: 440px; margin-top: 8px; }
.lp-bulk-item { padding: 0; }
.lp-bulk-item__head {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; list-style: none; font-weight: 600;
}
.lp-bulk-item__head::-webkit-details-marker { display: none; }
.lp-bulk-item__head .removeRow { margin-left: auto; }
.lp-bulk-item__head .lp-ico { transition: transform .2s ease; }
.lp-bulk-item:not([open]) .lp-bulk-item__head .lp-ico { transform: rotate(-90deg); }
.lp-bulk-item__body { padding: 0 16px 16px; }

.lp-report-kpis { padding: 16px 20px 0; }
.lp-report-note, .lp-report-period { margin: 0; color: var(--muted); font-size: 14px; }
.lp-report-legend { margin-bottom: 14px; }
.lp-report-legend > .lp-card { margin-top: 8px; }
.lp-report-chart { position: relative; min-width: 0; height: 290px; }
.server-table.lp-data-table { min-width: 0; border-radius: var(--r); color: var(--text); background: var(--card); }
.lp-report .lp-data-table { border: 1px solid var(--line); }
.lp-report .lp-data-table .lp-t { font-size: inherit; }
.lp-report .lp-t thead th.lp-report-total { background: var(--blue-soft); }
.lp-report .lp-t td.lp-report-period-even { background: var(--card-2); }
.lp-report .lp-t td.lp-report-period-odd { background: var(--violet-soft); }
.lp-report .lp-data-toolbar [data-options-key="status"] + .select2-container {
  width: min(300px, 100%) !important;
}
.lp-data-table .lp-data-toolbar { align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.lp-data-table .server-table-scroll > table th,
.lp-data-table .server-table-scroll > table td { padding: 9px 12px; }
.lp-data-table .server-table-scroll > table th[data-sort] { padding-right: 25px; }
.lp-data-table .server-table-scroll > table td { white-space: normal; }
.lp-data-table .lp-table-foot { justify-content: space-between; flex-wrap: wrap; }
.lp-data-table .select2-container { width: 170px !important; max-width: 100%; }
.lp-data-table .lp-data-toolbar .lp-search { height: 42px; border-radius: var(--r-sm); background: var(--input); }
.lp-data-table .lp-data-toolbar > .lp-btn, .lp-data-table .lp-data-toolbar > details > summary { height: 42px; }
.lp-stock-report-filters .select2-container { width: 100% !important; }
.lp-stock .select2-container .select2-selection,
.lp-report .select2-container .select2-selection,
body:has(.lp-stock, .lp-report) .select2-dropdown {
  background: var(--input); color: var(--text); border-color: var(--input-line); border-radius: var(--r-sm);
}
.lp-stock .select2-container .select2-selection--multiple,
.lp-report .select2-container .select2-selection--multiple { display: flex; align-items: center; min-height: 42px; padding: 0 8px; font: 14px var(--font-body); }
.lp-stock .select2-container--default .select2-selection--multiple .select2-selection__rendered,
.lp-report .select2-container--default .select2-selection--multiple .select2-selection__rendered { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; margin: 0; padding: 4px 0; white-space: normal; }
.lp-stock .select2-container--default .select2-selection--multiple .select2-selection__choice,
.lp-report .select2-container--default .select2-selection--multiple .select2-selection__choice { display: inline-flex; align-items: flex-start; box-sizing: border-box; min-width: 0; max-width: 100%; min-height: 26px; float: none; margin: 0; padding: 3px 6px; line-height: 18px; overflow-wrap: anywhere; }
.lp-stock .select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
.lp-report .select2-container--default .select2-selection--multiple .select2-selection__choice__remove { flex: none; }
.lp-stock .select2-container .select2-search--inline,
.lp-report .select2-container .select2-search--inline { flex: 1 1 40px; min-width: 0; float: none; margin: 0; }
.lp-stock .select2-container .select2-search--inline .select2-search__field,
.lp-report .select2-container .select2-search--inline .select2-search__field { width: 100% !important; height: 26px; margin: 0; padding: 0 4px; line-height: 26px; font: 14px var(--font-body); }
.lp-stock .select2-container--default .select2-selection--single,
.lp-report .select2-container--default .select2-selection--single {
  display: flex; align-items: center; height: 42px; padding: 0 34px 0 12px; font: 14px var(--font-body);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.lp-stock .select2-container--default .select2-selection--single .select2-selection__rendered,
.lp-report .select2-container--default .select2-selection--single .select2-selection__rendered {
  width: 100%; padding: 0; line-height: 1.4; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lp-stock .select2-container--default .select2-selection--single .select2-selection__arrow,
.lp-report .select2-container--default .select2-selection--single .select2-selection__arrow { display: none; }
.lp-stock .select2-container--default.select2-container--focus .select2-selection,
.lp-stock .select2-container--default.select2-container--open .select2-selection,
.lp-report .select2-container--default.select2-container--focus .select2-selection,
.lp-report .select2-container--default.select2-container--open .select2-selection {
  border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--lime-soft); outline: none;
}
.lp-stock .select2-container .select2-selection__rendered,
.lp-report .select2-container .select2-selection__rendered { color: var(--text); }
.lp-stock .select2-container .select2-selection__choice,
.lp-report .select2-container .select2-selection__choice {
  background: var(--raised); color: var(--text); border-color: var(--line);
}
.lp-stock .select2-container .select2-search__field,
.lp-report .select2-container .select2-search__field,
body:has(.lp-stock, .lp-report) .select2-search--dropdown .select2-search__field {
  color: var(--text); background: var(--input); border-color: var(--input-line);
}
body:has(.lp-stock, .lp-report) .select2-results__option { color: var(--text-2); }
body:has(.lp-stock, .lp-report) .select2-results__option[aria-selected="true"] { background: var(--raised); }
body:has(.lp-stock, .lp-report) .select2-results__option--highlighted[aria-selected] { background: var(--accent); color: var(--on-accent); }
body:has(.lp-report) .select2-results__option {
  padding: 7px 12px; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere;
}
body:has(.lp-report) .select2-results__option--highlighted[aria-selected] {
  color: var(--text); background: var(--lime-soft);
}

@media (max-width: 640px) {
  .lp-data-table .lp-data-toolbar .lp-spacer { display: none; }
  .lp-data-table .server-table-body td[colspan] { text-align: left; }
  .lp-stock-report-filters .lp-field, .lp-stock-report-filters .lp-field:first-child { flex: 1 1 100%; max-width: none; }
  .lp-stock-report-filters > .lp-btn { flex: 1 1 100%; justify-content: center; }
  .lp-stock form .lp-g4 { grid-template-columns: minmax(0, 1fr); }
  .lp-data-table .lp-data-toolbar .select2-container { flex: 1 1 140px; width: auto !important; }
  .lp-report .lp-data-toolbar [data-options-key="status"] + .select2-container { flex: 1 1 100%; }
  .lp-report-chart { height: 230px; }
  .lp-stock-group-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .lp-stock-group-row > :first-child { grid-column: 1 / -1; }
}

/* Reports hub */
.lp-report-card .lp-tag { align-self: flex-start; }
.lp-report-card p { font-size: 13px; color: var(--muted); }

/* Permission matrix */
.lp-perm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 20px; }

/* Index page */
.lp-index { max-width: 1200px; margin: 0 auto; }
.lp-index .lp-t td.lp-wrap { max-width: 260px; }
.lp-index .lp-t td.lp-mono { font-size: 12px; overflow-wrap: anywhere; }
.lp-index .lp-section-row td { padding-top: 22px; }


/* 6. Patient portal ---------------------------------------------------------- */
.lp-pt-top { position: sticky; top: 0; z-index: 5; height: 64px; background: var(--pt-topbar); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.lp-pt-top-in { max-width: 1140px; height: 100%; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 10px; }
.lp-pt-logo { display: inline-flex; align-items: center; gap: 8px; font: 700 19px var(--font-head); color: var(--text); }
.lp-pt-logo--lg { font-size: 24px; }
.lp-pt-logo--lg .lp-logo { width: 56px; height: 56px; }
.lp-wordmark { display: inline-flex; }
.lp-wordmark b { color: var(--lime); font-weight: inherit; }
.lp-pt-lang { height: 32px; display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--input-line); background: var(--card); color: var(--text-2); font: 600 13px var(--font-body); }
.lp-pt-lang .lp-ico { width: 14px; height: 14px; }
.lp-pt-body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.lp-pt-main { flex: 1 0 auto; width: 100%; max-width: 1140px; margin: 0 auto; padding: 32px 24px 48px; display: flex; flex-direction: column; gap: 24px; }
.lp-pt-foot { width: 100%; max-width: 1140px; margin: 0 auto; padding: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.lp-pt-foot .lp-pt-logo { font-size: 16px; }
.lp-pt-foot .lp-pt-logo .lp-logo { width: 32px; height: 32px; }

.lp-pt-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.lp-pt-title-row h1 { flex: 1 1 180px; }
.lp-pt-hello h1 { font-size: 40px; }
.lp-pt-steps { display: flex; flex-wrap: wrap; gap: 20px; font-size: 15px; color: var(--muted); }
.lp-pt-steps b { color: var(--text); }

.lp-pt-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px; align-items: start; }
.lp-pt-grid > .lp-pt-left { grid-row: 1; }
.lp-pt-grid > .lp-pt-right { grid-column: 2; grid-row: 1 / span 2; }
.lp-pt-grid > .lp-pt-rec { grid-row: 2; }

.lp-pt-card { display: flex; flex-direction: column; gap: 14px; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; }
.lp-pt-card--muted { background: var(--card-2); border-color: transparent; }
.lp-pt-card--center { align-items: center; text-align: center; }
.lp-pt-card h2 { font-size: 22px; }
.lp-pt-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lp-pt-big { font: 700 26px/1.15 var(--font-head); }
.lp-pt-fact { display: flex; align-items: center; gap: 14px; }
.lp-pt-clinic-logo { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--line); background: #F2F4F0; color: var(--teal); font: 800 13px var(--font-head); }
.lp-pt-section-title { font-size: 20px; letter-spacing: .04em; }

/* Progress ring: value class .p-0 … .p-100 in 5% steps */
.lp-pt-ring { --p: 0%; width: 72px; height: 72px; flex: none; position: relative; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: conic-gradient(var(--accent-line) var(--p), var(--line) 0); font: 700 18px var(--font-head); }
.lp-pt-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--card); }
.lp-pt-card--muted .lp-pt-ring::before { background: var(--card-2); }
.lp-pt-ring > span { position: relative; }
.lp-pt-ring.lp-p-0 { --p: 0%; } .lp-pt-ring.lp-p-5 { --p: 5%; } .lp-pt-ring.lp-p-10 { --p: 10%; } .lp-pt-ring.lp-p-15 { --p: 15%; } .lp-pt-ring.lp-p-20 { --p: 20%; }
.lp-pt-ring.lp-p-25 { --p: 25%; } .lp-pt-ring.lp-p-30 { --p: 30%; } .lp-pt-ring.lp-p-35 { --p: 35%; } .lp-pt-ring.lp-p-40 { --p: 40%; } .lp-pt-ring.lp-p-45 { --p: 45%; }
.lp-pt-ring.lp-p-50 { --p: 50%; } .lp-pt-ring.lp-p-55 { --p: 55%; } .lp-pt-ring.lp-p-60 { --p: 60%; } .lp-pt-ring.lp-p-65 { --p: 65%; } .lp-pt-ring.lp-p-70 { --p: 70%; }
.lp-pt-ring.lp-p-75 { --p: 75%; } .lp-pt-ring.lp-p-80 { --p: 80%; } .lp-pt-ring.lp-p-85 { --p: 85%; } .lp-pt-ring.lp-p-90 { --p: 90%; } .lp-pt-ring.lp-p-95 { --p: 95%; }
.lp-pt-ring.lp-p-100 { --p: 100%; }

.lp-pt-figure { display: flex; flex-direction: column; gap: 8px; }
.lp-pt-figure__head { display: flex; flex-direction: column; gap: 2px; }
.lp-pt-photo { aspect-ratio: 4 / 3; display: flex; align-items: flex-end; justify-content: center; padding: 10px; border-radius: 16px; border: 1px solid var(--line); background: radial-gradient(circle at 50% 60%, var(--photo), var(--card) 70%); color: var(--muted); font-size: 12px; }

.lp-pt-3d { display: flex; align-items: center; gap: 18px; }
.lp-pt-3d__art { width: 120px; height: 96px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 16px; background: radial-gradient(circle at 40% 40%, var(--teal-2), var(--teal) 60%, var(--card)); color: var(--accent); }
.lp-pt-3d__text { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.lp-pt-3d__text b { font-size: 16px; }

.lp-pt-instr { display: flex; align-items: center; gap: 18px; }
.lp-pt-instr__doc { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lp-pt-pdf { width: 150px; aspect-ratio: 1 / 1.41; flex: none; display: flex; flex-direction: column; gap: 6px; padding: 14px 12px; border-radius: 10px; border: 1px solid var(--line); background: linear-gradient(#F2F4F0, #DDE2DB); color: #161819; font: 700 13px var(--font-head); }
.lp-pt-pdf i { display: block; height: 5px; border-radius: 3px; background: #B9C0B6; }
.lp-pt-pdf i:nth-of-type(2n) { width: 70%; }
.lp-pt-video { flex: 1; min-width: 0; width: 100%; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; border-radius: 16px; background: linear-gradient(135deg, var(--teal), var(--teal-2)); }
.lp-pt-video span { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent); }
.lp-pt-video span::before { content: ""; margin-left: 4px; border-left: 16px solid var(--on-accent); border-top: 10px solid transparent; border-bottom: 10px solid transparent; }


.lp-pt-modals { display: flex; align-items: flex-start; justify-content: center; gap: 24px; padding: 24px 0; }
.lp-pt-modals > .lp-pt-card { flex: 1 1 440px; max-width: 480px; gap: 18px; }

.lp-pt-with-aside { display: flex; align-items: flex-start; gap: 24px; }
.lp-pt-with-aside > :first-child { flex: 1; min-width: 0; }
.lp-pt-with-aside--left > :first-child { flex: none; }
.lp-pt-with-aside--left > :last-child { flex: 1; min-width: 0; }
.lp-pt-aside { flex: none; width: 260px; }

.lp-faq details { border-bottom: 1px solid var(--line); }
.lp-faq summary { display: flex; align-items: center; gap: 12px; padding: 16px 0; list-style: none; font-weight: 500; color: var(--text); cursor: pointer; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: "+"; width: 28px; height: 28px; flex: none; margin-left: auto; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--raised); color: var(--lime); font-size: 18px; }
.lp-faq details[open] summary::after { content: "−"; }
.lp-faq details p { padding: 0 40px 16px 0; color: var(--text-3); line-height: 1.6; }
.lp-faq--page { padding: 28px; }

.lp-cal-head { display: flex; align-items: center; gap: 12px; }
.lp-cal-head h2 { flex: 1; text-align: center; }
.lp-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.lp-cal .lp-wd { padding-bottom: 4px; text-align: center; font-size: 12px; text-transform: uppercase; color: var(--muted); }
.lp-cal .lp-d { position: relative; aspect-ratio: 1.3; display: flex; flex-direction: column; justify-content: space-between; padding: 8px; border-radius: 12px; background: var(--card-2); color: var(--text-2); font-size: 14px; }
.lp-cal .lp-d.lp-blank { background: transparent; }
.lp-cal .lp-d.lp-past { background: var(--card-2); color: var(--subtle); }
.lp-cal .lp-d.lp-today b { width: 28px; height: 28px; margin: -4px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.lp-cal .lp-d.lp-upcoming { background: var(--lime-soft); box-shadow: inset 0 0 0 2px var(--accent-line); color: var(--text); font-weight: 700; }
.lp-cal .lp-d.lp-missed { background: var(--red-soft); color: var(--red); }
.lp-cal .lp-d.lp-key { box-shadow: inset 0 0 0 2px var(--red-line); }
.lp-cal .lp-d.lp-confirmed { background: var(--raised); box-shadow: inset 0 0 0 1px var(--hover-line); color: var(--muted); }
.lp-cal .lp-d.lp-selected { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.lp-cal .lp-d .lp-ico { width: 26px; height: 26px; align-self: flex-end; opacity: .8; }

.lp-doc-toc { position: sticky; top: 84px; gap: 2px; padding: 14px; }
.lp-doc-toc__title { padding: 4px 12px 8px; }
.lp-doc-toc a { display: block; padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-size: 13.5px; }
.lp-doc-toc a:hover { background: var(--card-2); }
.lp-doc { gap: 0; padding: 32px; color: var(--text-2); font-size: 15px; line-height: 1.65; }
.lp-doc h2 { margin: 28px 0 10px; scroll-margin-top: 84px; font-size: 20px; color: var(--text); }
.lp-doc h3 { margin: 18px 0 8px; color: var(--text); }
.lp-doc p { margin: 0 0 10px; }
.lp-doc ul { margin: 0 0 12px; padding-left: 20px; }
.lp-doc li { margin: 4px 0; }
.lp-doc strong { color: var(--text); }
.lp-doc > p:first-child { margin-bottom: 16px; font: 700 17px/1.4 var(--font-head); color: var(--lime); }


/* 7. Utilities ---------------------------------------------------------------- */
.lp-muted { color: var(--muted); }
.lp-subtle { color: var(--subtle); }
.lp-text-strong { color: var(--text); }
.lp-text-2 { color: var(--text-2); }
.lp-text-red { color: var(--red); }
.lp-text-green { color: var(--green); }
.lp-text-lime { color: var(--lime); }
.lp-num { font-variant-numeric: tabular-nums; }
.lp-mono { font-family: var(--font-mono); }
.lp-right { text-align: right; }
.lp-t.lp-prod-progress th:not(:first-child), .lp-t.lp-prod-progress td:not(:first-child) { text-align: center; }
.lp-center { text-align: center; }
.lp-small { font-size: 13px; }
.lp-xsmall { font-size: 12px; }
.lp-strong { font-weight: 500; color: var(--text); }
.lp-grow { flex: 1; min-width: 0; }
.lp-self-start { align-self: flex-start; }
.lp-self-end { align-self: flex-end; }
.lp-self-center { align-self: center; }
.lp-lh { line-height: 1.55; }
.lp-gap-4 { gap: 4px; } .lp-gap-6 { gap: 6px; } .lp-gap-8 { gap: 8px; } .lp-gap-10 { gap: 10px; } .lp-gap-12 { gap: 12px; }
.lp-gap-14 { gap: 14px; } .lp-gap-16 { gap: 16px; } .lp-gap-18 { gap: 18px; } .lp-gap-20 { gap: 20px; } .lp-gap-22 { gap: 22px; } .lp-gap-24 { gap: 24px; }


/* 8. Responsive ---------------------------------------------------------------- */
.lp-t td.lp-num, .lp-t .lp-chip, .lp-t .lp-tag { white-space: nowrap; }

@media (max-width: 1200px) {
  .lp-app .lp-g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-move-item__body { padding-left: 20px; }
  .lp-app [class*="lp-split"] { grid-template-columns: minmax(0, 1fr); }
  .lp-app .lp-sticky { position: static; }
  .lp-app .lp-case-hero { grid-template-columns: minmax(0, 1fr); }
  .lp-app .lp-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

@media (max-width: 1024px) {
  .lp-app { flex-direction: column; }
  .lp-mtop { position: sticky; top: 0; z-index: 20; height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: var(--topbar); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .lp-mtop .lp-brand { padding: 0; font-size: 18px; }
  .lp-mtop .lp-brand .lp-logo { width: 32px; height: 32px; }
  .lp-nav-toggle { display: block; }
  .lp-nav-toggle:focus-visible ~ .lp-mtop .lp-menu-btn { outline: 2px solid var(--accent-line); outline-offset: 2px; }
  .lp-side { position: fixed; inset: 0 auto 0 0; z-index: 40; width: 280px; max-width: 86vw; overflow-y: auto; visibility: hidden; transform: translateX(-100%); transition: transform .22s ease, box-shadow .22s ease, visibility .22s; box-shadow: none; }
  .lp-nav-toggle:checked ~ .lp-side { visibility: visible; transform: none; box-shadow: 20px 0 60px var(--shadow); }
  .lp-nav-toggle:checked ~ .lp-nav-scrim { display: block; position: fixed; inset: 0; z-index: 30; background: var(--scrim); }
  .lp-main { padding: 22px 24px 40px; }
  .lp-app .lp-g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
  .lp-pt-grid { grid-template-columns: 1fr; }
  .lp-pt-grid > .lp-pt-left, .lp-pt-grid > .lp-pt-right, .lp-pt-grid > .lp-pt-rec { grid-column: auto; grid-row: auto; }
}

@media (max-width: 820px) {
  /* data tables become stacked cards; labels come from data-label (lime-redesign.js) */
  .lp-table-wrap:not(.lp-scroll) { overflow: visible; background: transparent; border: 0; }
  .lp-table-wrap:not(.lp-scroll) .lp-t thead { display: none; }
  .lp-table-wrap:not(.lp-scroll) .lp-t,
  .lp-table-wrap:not(.lp-scroll) .lp-t tbody,
  .lp-table-wrap:not(.lp-scroll) .lp-t tfoot,
  .lp-table-wrap:not(.lp-scroll) .lp-t tr { display: block; }
  .lp-table-wrap:not(.lp-scroll) .lp-t tr { margin-bottom: 10px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
  .lp-table-wrap:not(.lp-scroll) .lp-t td { display: block; min-width: 0; overflow: hidden; padding: 5px 0; border: 0; text-align: right; white-space: normal; overflow-wrap: anywhere; }
  .lp-table-wrap:not(.lp-scroll) .lp-t td::before { content: attr(data-label); float: left; max-width: 45%; margin-right: 12px; color: var(--muted); font-size: 12px; text-align: left; }
  .lp-table-wrap:not(.lp-scroll) .lp-t td:first-child { margin-bottom: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); text-align: left; }
  .lp-table-wrap:not(.lp-scroll) .lp-t td:first-child::before { display: none; }
  .lp-table-wrap:not(.lp-scroll) .lp-t td:empty { display: none; }
  .lp-table-wrap:not(.lp-scroll) .lp-t td > .lp-input, .lp-table-wrap:not(.lp-scroll) .lp-t td > .lp-select { width: 55%; }
  .lp-table-wrap:not(.lp-scroll) .lp-t tbody tr:hover td { background: transparent; }
  .lp-table-wrap:not(.lp-scroll) .lp-t tbody tr[data-state~="new"] { box-shadow: inset 3px 0 0 var(--blue); }
  .lp-table-wrap:not(.lp-scroll) .lp-t tbody tr[data-state~="new"] td:first-child { box-shadow: none; }
  .lp-table-wrap:not(.lp-scroll) .lp-table-foot { flex-wrap: wrap; padding: 4px 2px; border: 0; }
}

@media (min-width: 641px) and (max-width: 820px) {
  .lp-table-wrap:not(.lp-scroll) .lp-t tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lp-table-wrap:not(.lp-scroll) .lp-t tbody tr { margin: 0; }
}

@media (max-width: 768px) {
  .lp-login__aside { display: none; }
  .lp-login__brand, .lp-pt-logo.lp-login__brand { display: flex; }
  .lp-app .lp-g2, .lp-app .lp-g3, .lp-app .lp-perm-grid, .lp-app .lp-decision { grid-template-columns: minmax(0, 1fr); }
  .lp-upload-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-app .lp-upload-step { gap: 8px; padding: 12px 10px; font-size: 13px; }
  .lp-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-app .lp-span-2 { grid-column: auto; }
  .lp-app .lp-g4.lp-move-item__body { grid-template-columns: minmax(0, 1fr); }
  .lp-head .lp-title { flex-basis: 100%; }
  .lp-toolbar .lp-search, .lp-head .lp-search { flex: 1 1 100%; }
  .lp-tabs { overflow-x: auto; scrollbar-width: none; }
  .lp-card-head { row-gap: 8px; }
  .lp-pt-with-aside, .lp-pt-modals, .lp-pt-instr { flex-direction: column; align-items: stretch; }
  .lp-pt-modals > .lp-pt-card { flex: 0 0 auto; max-width: none; }
  .lp-pt-aside, .lp-doc-toc { width: auto; position: static; }
  .lp-cal .lp-d .lp-ico { display: none; }
  .lp-cal .lp-d { aspect-ratio: 1; padding: 6px; font-size: 13px; }
}

@media (max-width: 640px) {
  .lp-main { gap: 16px; padding: 16px 14px 32px; }
  h1 { font-size: 24px; }
  h2 { font-size: 17px; }
  .lp-card, .lp-kpi { padding: 16px; }
  .lp-card--lg { padding: 18px; }
  .lp-kpi .lp-value { font-size: 28px; }
  .lp-av.lp-lg { width: 56px; height: 56px; font-size: 20px; }
  .lp-btn-lg { height: 46px; padding: 0 18px; }
  .lp-form-actions { flex-wrap: wrap; }
  .lp-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .lp-dl dd { margin-bottom: 8px; overflow-wrap: anywhere; }
  .lp-rows a, .lp-rows .lp-row { flex-wrap: wrap; padding: 12px 16px; }
  .lp-rows .lp-grow { flex: 1 1 140px; }
  .lp-rows .lp-when { width: 100%; padding-left: 72px; text-align: left; font-size: 12px; }
  .lp-card.lp-flush .lp-card-head { padding: 14px 16px; }
  .lp-pager { margin-left: 0; }
  .lp-filter[open] { flex-basis: 100%; }
  .lp-filter__panel { position: static; width: auto; margin-top: 8px; box-shadow: none; }
}

@media (max-width: 575.98px) {
  .lp-file-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .lp-pt-main { padding: 20px 16px 32px; }
  .lp-pt-top-in { padding: 0 16px; }
  .lp-pt-card { padding: 18px; border-radius: 18px; }
  .lp-pt-hide-xs { display: none; }
  .lp-pt-3d { flex-direction: column; align-items: stretch; text-align: center; }
  .lp-pt-3d__art { margin: 0 auto; }
  .lp-pt-big { font-size: 22px; }
  .lp-pt-hello h1, h1 { font-size: 26px; }
  .lp-cal { gap: 4px; }
  .lp-cal .lp-d { border-radius: 9px; }
}

/* Accounts */
.lp-field-error { margin: 0; color: var(--red); font-size: 13px; }
.lp-field [aria-invalid="true"] { border-color: var(--red-line); }
.lp-password-actions { align-items: center; flex-wrap: wrap; }
.lp-password-actions > input { flex: 1 1 140px; min-width: 0; }
.lp-password-actions > [role="status"] { flex-basis: 100%; }
.lp-chip-list { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lp-cell-badge { margin-inline-start: 6px; }
.lp-account-details { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 10px 16px; margin: 0; }
.lp-account-details dt { color: var(--muted); font-weight: 500; }
.lp-account-details dd { margin: 0; overflow-wrap: anywhere; }
.lp-clinic-logo { display: block; object-fit: contain; object-position: left center; width: fit-content; max-width: 100%; max-height: 90px; }
.lp-doctor-picker { position: relative; }
.lp-doctor-picker-results { position: absolute; z-index: 10; top: calc(100% + 4px); inset-inline: 0; max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); box-shadow: 0 12px 36px var(--shadow); }
.lp-doctor-picker-results button { display: block; width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; color: var(--text); text-align: start; }
.lp-doctor-picker-results button:hover, .lp-doctor-picker-results button:focus-visible { background: var(--card-2); }
.lp-rows .lp-role-row { flex-wrap: wrap; }
.lp-rows a.lp-role-name, .lp-rows a.lp-role-action { display: inline-flex; border-bottom: 0; }
.lp-rows a.lp-role-name { padding: 0; }
.lp-rows a.lp-role-action { padding: 0 10px; }
.lp-profile-photo { object-fit: cover; }
.lp-profile-fields fieldset, .lp-card fieldset { min-width: 0; margin: 0; border: 0; }
.lp-card fieldset legend { float: none; width: auto; margin: 0 0 7px; font-size: 14px; font-weight: 600; }
.lp-profile-summary { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.lp-profile-summary > .lp-grow { flex: 1 1 300px; min-width: 0; }
.lp-profile-photo-form { flex: 0 1 270px; }
.lp-entry-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.lp-entry-form { margin-top: 10px; }
.lp-entry-text:has(+ [data-edit-entry][open]) { display: none; }
.lp-profile-summary [hidden] { display: none; }
[data-step-results][aria-busy="true"] { opacity: .5; transition: opacity .15s ease; }
.lp-panel-note { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-panel-more > summary { padding: 10px 20px; color: var(--lime); cursor: pointer; }
.lp-kpi:hover { border-color: var(--accent-line); color: var(--text); }
.lp-rows .lp-grow { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 600px) {
    .lp-account-details { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    .lp-account-details dd { margin-bottom: 8px; }
    .lp-profile-photo-form { flex-basis: 100%; }
}

.lp-error-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 24px 16px; }
.lp-error { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 520px; width: 100%; margin: 0 auto; padding: 40px 32px; text-align: center; }
.lp-error__code { font: 700 64px/1 var(--font-head); color: var(--lime); letter-spacing: -.02em; }
.lp-error h1 { margin: 0; }
.lp-error p { margin: 0; color: var(--muted); }
.lp-error__actions { justify-content: center; margin-top: 12px; }

.lp-prose { max-width: 880px; padding: 28px 32px; line-height: 1.65; color: var(--text-2); overflow-wrap: anywhere; }
.lp-prose h1 { margin: 0 0 16px; color: var(--text); }
.lp-prose h2, .lp-prose h3, .lp-prose h4 { margin: 22px 0 8px; color: var(--text); }
.lp-prose p { margin: 0 0 12px; }
.lp-prose ul, .lp-prose ol { margin: 0 0 12px; padding-left: 22px; }
.lp-prose a { color: var(--lime); text-decoration: underline; }
.lp-prose table { width: 100%; border-collapse: collapse; }
.lp-prose td, .lp-prose th { padding: 8px 10px; border: 1px solid var(--line); vertical-align: top; }
@media (max-width: 640px) { .lp-prose { padding: 20px 16px; } }

.lp-smile__head, .lp-smile__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lp-smile__shot { position: relative; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.lp-smile__shot figcaption { font-size: 13px; color: var(--muted); }
.lp-smile__shot img { width: 100%; height: auto; border-radius: var(--r-sm); }
.lp-smile__none { position: absolute; inset: 28px 0 0; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); background: rgba(16, 18, 19, .8); color: #F2F4F0; text-align: center; }
@media (max-width: 640px) { .lp-smile__head, .lp-smile__row { gap: 8px; } }

.lp-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.lp-no-scroll, body:has(.lp-modal-layer.lp-is-open) { overflow: hidden; }
.lp-modal-layer.lp-is-open { display: flex; }
.lp-pt-dialog { width: 480px; max-width: calc(100% - 32px); max-height: calc(100% - 32px); overflow: auto; gap: 18px; }
.lp-pt-lang-menu { position: relative; }
.lp-pt-lang-menu > summary { list-style: none; cursor: pointer; }
.lp-pt-lang-menu > summary::-webkit-details-marker { display: none; }
.lp-pt-lang-menu[open] > summary .lp-ico { transform: rotate(180deg); }
.lp-pt-lang-list { position: absolute; top: calc(100% + 6px); right: 0; z-index: 10; min-width: 96px; display: flex; flex-direction: column; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); box-shadow: 0 12px 32px var(--shadow); }
.lp-pt-lang-list a { padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.lp-pt-lang-list a:hover { background: var(--card-2); }
.lp-pt-lang-list a.lp-on { background: var(--lime-soft); color: var(--lime); }
.lp-pt-back { align-self: flex-start; color: var(--text-2); font-size: 14px; }
.lp-pt-back:hover { color: var(--text); }
.lp-pt-clinic-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lp-pt-big.lp-is-late { color: var(--red); }
.lp-pt-photo--btn { width: 100%; padding: 0; overflow: hidden; cursor: zoom-in; font: inherit; }
.lp-pt-photo--btn img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lp-pt-photo--empty { align-items: center; padding: 16px; text-align: center; font-size: 13px; color: var(--muted); }
.lp-pt-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 0; text-align: center; }
.lp-pt-video iframe { width: 100%; height: 100%; border: 0; border-radius: inherit; }
.lp-pt-pdf.lp-is-live { aspect-ratio: auto; padding: 0; overflow: hidden; }
.lp-pt-pdf canvas { display: block; width: 100%; height: auto; }
.lp-pt-photo-modal { position: relative; width: min(960px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 12px; overflow: auto; }
.lp-pt-photo-modal img { display: block; max-width: 100%; max-height: calc(100vh - 80px); margin: 0 auto; border-radius: 10px; object-fit: contain; }
.lp-pt-photo-modal__close { position: absolute; top: 12px; right: 12px; z-index: 1; }
.lp-pt-viewer { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--scrim); }
.lp-pt-viewer__bar { display: flex; justify-content: flex-end; padding: 12px 16px; }
.lp-pt-viewer__pages { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 16px 24px; overflow: auto; }
.lp-pt-viewer__page { max-width: 100%; border-radius: 6px; background: #fff; box-shadow: 0 8px 28px var(--shadow); }
.lp-cal button.lp-d { border: 0; font: inherit; text-align: left; cursor: pointer; }
.lp-cal button.lp-d:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.lp-doc .patient-consent-doc-signatures { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.lp-faq__list { display: flex; flex-direction: column; }
