@font-face {
  /* Ceraso: headers 32px and up only (docs/ceraso-headers.md in delta-design-system).
   * Licensed for deltadesign.studio; never copy it to a client's own domain.
   * @license
   * MyFonts Webfont Build ID 3867246
   * The fonts listed in this notice are subject to the End User License
   * Agreement(s) entered into by the website owner. All other parties are
   * explicitly restricted from using the Licensed Webfonts(s).
   * Webfont: Ceraso by Jafar07
   * URL: https://www.myfonts.com/collections/jafar07-foundry
   * © 2026 MyFonts Inc. */
  font-family: 'Ceraso';
  src:
    url(/_shared/ceraso.woff2) format('woff2'),
    url(/_shared/ceraso.woff) format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Cormorant;
  src: url(/_shared/cormorant.woff2) format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: Montserrat;
  src: url(/_shared/montserrat.woff2) format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
* {
  box-sizing: border-box;
}
html {
  color-scheme: light dark;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    1rem/1.55 Montserrat,
    Arial,
    sans-serif;
}
.sign {
  max-width: 32rem;
  margin: clamp(2rem, 9vh, 6rem) auto;
  padding: 0 1.5rem 3rem;
}
h1,
h2,
h3 {
  font-family: Cormorant, Georgia, serif;
  font-weight: 500;
  line-height: 1.08;
}
/* Ceraso has one weight and no italic; h3 (24px) stays Cormorant. */
h1,
h2 {
  font-family: 'Ceraso', Cormorant, Georgia, serif;
  font-weight: 400;
  font-synthesis: none;
}
h1 {
  font-size: clamp(2.7rem, 8vw, 4rem);
  margin: 0.55rem 0 0.25rem;
}
h2 {
  font-size: 2rem;
}
h3 {
  font-size: 1.5rem;
}
.credit {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}
.welcome {
  margin: 1.5rem 0;
}
.sign section {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.sign form {
  display: grid;
  gap: 0.6rem;
}
.sign label {
  font-size: 0.88rem;
  font-weight: 600;
}
.sign input,
button,
.secondary {
  font: inherit;
  border-radius: 4px;
  padding: 0.8rem 0.95rem;
}
.sign input {
  width: 100%;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--muted);
}
button,
.secondary {
  cursor: pointer;
}
button {
  border: 0;
  background: var(--accent);
  color: var(--accentInk);
  font-weight: 600;
}
.sign button {
  margin-top: 0.4rem;
}
.secondary {
  text-align: center;
  text-decoration: none;
  display: block;
  margin-top: 0.75rem;
  border: 1px solid var(--muted);
  color: var(--ink);
}
a,
summary {
  color: var(--accent);
}
details {
  margin-top: 1rem;
}
summary {
  cursor: pointer;
}
details form {
  padding-top: 1rem;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* Google button: the multicolor G mark before the words, per Google's sign in button rules. */
.secondary.google,
.secondary.apple {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}
.secondary.google svg,
.secondary.apple svg {
  flex: none;
}
/* Apple button: black with white words and logo on light pages, per Apple's button rules. */
.sign section .secondary.apple {
  background: #000000;
  border-color: #000000;
  color: #ffffff;
}
[data-theme="dark"] .sign section .secondary.apple {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
}
.small {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}
.sign input[readonly] {
  opacity: 0.75;
}

/* Sign in page (Rik, 2026-11-28): a large faint watermark of the client logo behind everything,
   a big mark at the top, and a translucent card. */
.watermark {
  /* Rik, 2026-11-28: more prominent, filling the right two thirds of the page, centred there. */
  position: fixed;
  z-index: 0;
  right: 2vw;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  width: min(62vw, 92vh, 1100px);
  height: auto;
  opacity: 0.2;
  pointer-events: none;
  user-select: none;
}
.sign {
  position: relative;
  z-index: 1;
}
.brand-mark {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: contain;
}
.sign section {
  /* Apple style glass: more see through, strong blur, a bright hairline edge and a soft lift. */
  background: color-mix(in srgb, var(--surface) 52%, transparent);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid color-mix(in srgb, #ffffff 65%, transparent);
  border-radius: 22px;
  box-shadow:
    0 1px 0 color-mix(in srgb, #ffffff 70%, transparent) inset,
    0 24px 60px color-mix(in srgb, var(--ink) 12%, transparent),
    0 2px 8px color-mix(in srgb, var(--ink) 6%, transparent);
}
.sign section input {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border-color: color-mix(in srgb, var(--muted) 55%, transparent);
  border-radius: 12px;
}
.sign section button,
.sign section .secondary {
  border-radius: 12px;
}
.sign section .secondary {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
@media (max-width: 520px) {
  .watermark { right: -18vw; top: 60%; width: 105vw; opacity: 0.14; }
  .brand-mark { width: 80px; height: 80px; }
}

/* Tight sign in (Rik, 2026-11-29): provider buttons, an "or" line, then email and password. */
.providers .secondary:first-child {
  margin-top: 0;
}
.or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.1rem 0 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.or::before,
.or::after {
  content: "";
  flex: 1;
  border-top: 1px solid color-mix(in srgb, var(--muted) 40%, transparent);
}
.links {
  margin: 0.8rem 0 0;
  font-size: 0.9rem;
  text-align: center;
}

/* L frame app shell for the signed in portal (skill /l-frame, thumbnail app-shell-l-frame,
   the same frame as the Client CRM). Top bar and rail are one surface, --frame; the page
   sits in a panel with a rounded top left corner. Colours come only from the brand tokens. */
:root {
  --frame: color-mix(in srgb, var(--bg) 93%, var(--ink));
  --sel: color-mix(in srgb, var(--ink) 9%, transparent);
  --rail-open: 216px;
  --rail-closed: 60px;
  --topbar-h: 48px;
}
:root[data-theme='dark'] {
  --frame: color-mix(in srgb, var(--bg) 72%, #000);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] {
    --frame: color-mix(in srgb, var(--bg) 72%, #000);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] { color-scheme: dark; }
body.has-shell {
  background: var(--frame);
  overflow: hidden;
}
.shell {
  --rail: var(--rail-open);
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  padding-top: env(safe-area-inset-top, 0px);
  transition: grid-template-columns 0.22s ease;
}
:root[data-rail='closed'] .shell { --rail: var(--rail-closed); }
.shell button { width: auto; }
.topbar {
  grid-column: 1 / 3;
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 0 max(10px, env(safe-area-inset-right, 0px)) 0 max(13px, env(safe-area-inset-left, 0px));
}
.top-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.crumb { font-size: 0.8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  list-style: none;
  transition: color 0.18s ease, background-color 0.18s ease;
}
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn::marker { content: ''; }
.icon-btn:hover, details[open] > .icon-btn { color: var(--ink); background: var(--sel); }
.shell .ic { width: 19px; height: 19px; flex: none; }
.cluster { display: flex; align-items: center; gap: 2px; flex: none; }
.menu-wrap { position: relative; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 200px;
  max-width: min(300px, calc(100vw - 16px));
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.18);
}
.menu-head { display: grid; gap: 2px; padding: 8px 10px 6px; font-size: 0.85rem; color: var(--muted); overflow-wrap: anywhere; }
.menu-head b { color: var(--ink); font-weight: 600; }
.shell .menu form { display: block; margin: 0; padding: 0; gap: 0; }
.shell .menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.shell .menu button:hover { background: var(--sel); }
.menu .ic { width: 17px; height: 17px; color: var(--muted); }
.menu button[aria-checked='true']::after { content: '\2713'; margin-left: auto; color: var(--accent); }
.menu hr, .side-rule { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.side {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden auto;
  padding: 2px 10px calc(12px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
}
.rail-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 7px;
  margin-bottom: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  white-space: nowrap;
  min-width: 0;
}
.rail-mark { flex: none; width: 26px; height: 26px; object-fit: contain; }
.rail-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.side-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.side-gap { flex: 1; min-height: 12px; }
.side-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 10.5px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.side-link > span:not(.tip) { font-size: 0.9rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.side-link:hover, .side-link[aria-current='page'] { background: var(--sel); color: var(--ink); }
.side-link[aria-current='page'] > span:not(.tip) { font-weight: 600; }
.side-link[aria-current='page'] .ic { color: var(--accent); }
.shell :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tip {
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  translate: -4px -50%;
  z-index: 20;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 9px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.16);
  transition: opacity 0.15s ease, translate 0.15s ease, visibility 0.15s;
}
:root[data-rail='closed'] .side { overflow: visible; }
:root[data-rail='closed'] .side-link > span:not(.tip),
:root[data-rail='closed'] .rail-name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  margin: 0;
}
:root[data-rail='closed'] .side-link:hover .tip,
:root[data-rail='closed'] .side-link:focus-visible .tip { opacity: 1; visibility: visible; translate: 0 -50%; }
.panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-top-left-radius: 16px;
}
.panel main {
  padding: clamp(16px, 3vw, 32px) max(clamp(16px, 4vw, 48px), env(safe-area-inset-right, 0px)) calc(48px + env(safe-area-inset-bottom, 0px)) clamp(16px, 4vw, 48px);
}
@media (pointer: coarse) {
  :root { --topbar-h: 54px; }
  .icon-btn { width: 42px; height: 42px; }
  .side-link { height: 44px; }
}
@media (max-width: 719px) {
  .shell { --rail: var(--rail-closed); }
  #railToggle { display: none; }
  .side { overflow: visible; }
  .side-link > span:not(.tip), .rail-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    margin: 0;
  }
  .side-link:focus-visible .tip { opacity: 1; visibility: visible; translate: 0 -50%; }
}
@media (prefers-reduced-motion: reduce) {
  .shell, .side-link, .icon-btn, .tip { transition: none; }
}
