/* The new front end's look, on the pages Django keeps drawing (hello/look.py): signing in and up, the password
   links, an invitation, two-factor, the client portal's sign-in, the account pages that hold a password, and the
   assistant's consent page, Connected apps and approvals (agents/templates/agents/). Linked
   after app.css (and the portal's portal-app.css) by templates/look/firm.html and portal/templates/portal/look.html
   (and by the portal's offline page), and by nothing else: it is on only where the new front end is in front
   (settings.NEW_FRONT_END). A firm's own colour, linked after this sheet on its portal (portal_tags.portal_theme),
   still wins: it sets --primary, --primary-hover, --on-primary and --link, which the rules below draw with.

   Every value is Cloudscape's own, read from its design tokens as installed
   (frontend/node_modules/@cloudscape-design/components/internal/generated/theming/index.js, the visual-refresh
   theme) and from its components' own rules (…/components/<name>/styles.scoped.css): the token is named beside
   each. Nothing is added to Cloudscape's stock look: no gradient, no picture, no shadow on a surface at rest.

   1. The values, light and dark   2. The page   3. A card on its own   4. Words and links   5. Fields
   6. Buttons   7. Alerts   8. A page under the top bar   9. What those pages hold   10. The client portal
   11. What Django says when something went wrong */

@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/open-sans-400.d65113b6da7b.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/open-sans-700.875ba54801f7.woff2") format("woff2"); }

/* --- 1. The values ----------------------------------------------------------------------------------------------
   app.css draws from custom properties, so the first step is to give them Cloudscape's values. The --look-… ones are
   Cloudscape's values that app.css has no name for. */
:root {
  color-scheme: light;
  --font: "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif;  /* fontFamilyBase */
  --font-wordmark: var(--font);
  --bg: #ffffff;  /* colorBackgroundLayoutMain */
  --surface: #ffffff;  /* colorBackgroundContainerContent */
  --surface-2: #f3f3f7;  /* colorBackgroundDropdownItemHover */
  --surface-3: #ebebf0;  /* colorBackgroundInputDisabled */
  --text: #0f141a;  /* colorTextBodyDefault */
  --text-2: #424650;  /* colorTextBodySecondary */
  --muted: #656871;  /* colorTextFormSecondary */
  --border: #c6c6cd;  /* colorBorderDividerDefault */
  --border-strong: #c6c6cd;
  --control-border: #8c8c94;  /* colorBorderInputDefault */
  --control-off: #424650;  /* colorBackgroundToggleDefault */
  --primary: #006ce0;  /* colorBackgroundButtonPrimaryDefault */
  --primary-hover: #002b66;  /* colorBackgroundButtonPrimaryHover */
  --primary-soft: #f0fbff;  /* colorBackgroundItemSelected */
  --on-primary: #ffffff;  /* colorTextButtonPrimaryDefault */
  --link: #006ce0;  /* colorTextLinkDefault, colorTextButtonNormalDefault, colorBorderItemFocused */
  --focus-ring: #006ce0;
  --danger: #db0000;  /* colorTextStatusError */
  --danger-solid: #db0000;
  --danger-bg: #fff5f5;  /* colorBackgroundAlertError */
  --danger-border: #db0000;  /* colorBorderStatusError */
  --warning: #855900;  /* colorTextStatusWarning */
  --warning-text: #855900;
  --warning-bg: #fffef0;  /* colorBackgroundAlertWarning */
  --warning-bg-soft: #fffef0;
  --warning-border: #855900;  /* colorBorderStatusWarning */
  --warning-border-soft: #855900;
  --success: #00802f;  /* colorTextStatusSuccess */
  --success-text: #00802f;
  --success-bg: #effff1;  /* colorBackgroundAlertSuccess */
  --success-border: #00802f;  /* colorBorderStatusSuccess */
  --info-text: #006ce0;  /* colorTextStatusInfo */
  --info-bg: #f0fbff;  /* colorBackgroundAlertInfo */
  --info-border: #006ce0;  /* colorBorderStatusInfo */
  --radius-sm: 4px;  /* borderRadiusBadge, borderRadiusControlDefaultFocusRing */
  --radius-md: 8px;  /* borderRadiusInput, borderRadiusItem */
  --radius: 8px;  /* borderRadiusPopover, borderRadiusDropdown */
  --radius-lg: 12px;  /* borderRadiusAlert */
  --control-height: 32px;  /* sizeVerticalInput */
  --control-height-sm: 32px;  /* Cloudscape has one height of button */
  --stack-gap: 20px;  /* spaceScaledL: SpaceBetween size "l" */
  --shadow-xs: none;  /* a container has a border and no shadow */
  --shadow-sm: none;
  --shadow-md: 0px 4px 20px 1px rgba(0, 7, 22, 0.10);  /* shadowDropdown, shadowModal */
  --shadow-lg: 0px 4px 20px 1px rgba(0, 7, 22, 0.10);
  --backdrop: rgba(35, 43, 55, 0.7);  /* colorBackgroundModalOverlay */
  --tooltip-bg: #ffffff;  /* colorBackgroundPopover */
  --tooltip-text: #0f141a;
  --look-heading: #0f141a;  /* colorTextHeadingDefault */
  --look-heading-2: #424650;  /* colorTextHeadingSecondary: a header's description */
  --look-label: #0f141a;  /* colorTextFormLabel */
  --look-link-hover: #002b66;  /* colorTextLinkHover, colorTextButtonNormalHover */
  --look-button-hover: #f0fbff;  /* colorBackgroundButtonNormalHover */
  --look-button-active: #d1f1ff;  /* colorBackgroundButtonNormalActive */
  --look-off: #ebebf0;  /* colorBackgroundButtonPrimaryDisabled */
  --look-off-border: #b4b4bb;  /* colorBorderButtonNormalDisabled */
  --look-off-text: #8c8c94;  /* colorTextButtonNormalDisabled */
  --look-rule: #ebebf0;  /* colorBorderDividerSecondary: between a list's rows */
  --look-column: #424650;  /* colorTextColumnHeader */
  --look-popover-border: #b4b4bb;  /* colorBorderPopover */
  --look-handle: #ffffff;  /* colorForegroundControlDefault */
  --look-badge-grey: #424650;  /* colorBackgroundBadgeGrey */
  --look-control-border: #8c8c94;  /* colorBorderControlDefault: a tick box's and a radio's edge, in both themes */
  --look-input-off: #b4b4bb;  /* colorTextInputDisabled */
}
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #161d26; --surface: #161d26; --surface-2: #131920; --surface-3: #1b232d;
    --text: #c6c6cd; --text-2: #c6c6cd; --muted: #a4a4ad; --border: #424650; --border-strong: #424650;
    --control-border: #656871; --control-off: #8c8c94;
    --primary: #42b4ff; --primary-hover: #75cfff; --primary-soft: #001129; --on-primary: #0f141a; --link: #42b4ff;
    --focus-ring: #42b4ff;
    --danger: #ff7a7a; --danger-solid: #ff7a7a; --danger-bg: #1f0000; --danger-border: #ff7a7a;
    --warning: #fbd332; --warning-text: #fbd332; --warning-bg: #191100; --warning-bg-soft: #191100;
    --warning-border: #fbd332; --warning-border-soft: #fbd332;
    --success: #2bb534; --success-text: #2bb534; --success-bg: #001401; --success-border: #2bb534;
    --info-text: #42b4ff; --info-bg: #001129; --info-border: #42b4ff;
    --shadow-xs: none; --shadow-sm: none;
    --shadow-md: 0px 4px 20px 1px rgba(0, 4, 12, 1); --shadow-lg: 0px 4px 20px 1px rgba(0, 4, 12, 1);
    --backdrop: rgba(15, 20, 26, 0.7);
    --tooltip-bg: #1b232d; --tooltip-text: #c6c6cd;
    --look-heading: #ebebf0; --look-heading-2: #a4a4ad; --look-label: #dedee3; --look-link-hover: #75cfff;
    --look-button-hover: #1b232d; --look-button-active: #333843;
    --look-off: #232b37; --look-off-border: #656871; --look-off-text: #8c8c94;
    --look-rule: #232b37; --look-column: #b4b4bb; --look-popover-border: #656871; --look-handle: #0f141a;
    --look-badge-grey: #656871;
    --look-control-border: #8c8c94; --look-input-off: #656871;
  }
}
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #161d26; --surface: #161d26; --surface-2: #131920; --surface-3: #1b232d;
    --text: #c6c6cd; --text-2: #c6c6cd; --muted: #a4a4ad; --border: #424650; --border-strong: #424650;
    --control-border: #656871; --control-off: #8c8c94;
    --primary: #42b4ff; --primary-hover: #75cfff; --primary-soft: #001129; --on-primary: #0f141a; --link: #42b4ff;
    --focus-ring: #42b4ff;
    --danger: #ff7a7a; --danger-solid: #ff7a7a; --danger-bg: #1f0000; --danger-border: #ff7a7a;
    --warning: #fbd332; --warning-text: #fbd332; --warning-bg: #191100; --warning-bg-soft: #191100;
    --warning-border: #fbd332; --warning-border-soft: #fbd332;
    --success: #2bb534; --success-text: #2bb534; --success-bg: #001401; --success-border: #2bb534;
    --info-text: #42b4ff; --info-bg: #001129; --info-border: #42b4ff;
    --shadow-xs: none; --shadow-sm: none;
    --shadow-md: 0px 4px 20px 1px rgba(0, 4, 12, 1); --shadow-lg: 0px 4px 20px 1px rgba(0, 4, 12, 1);
    --backdrop: rgba(15, 20, 26, 0.7);
    --tooltip-bg: #1b232d; --tooltip-text: #c6c6cd;
    --look-heading: #ebebf0; --look-heading-2: #a4a4ad; --look-label: #dedee3; --look-link-hover: #75cfff;
    --look-button-hover: #1b232d; --look-button-active: #333843;
    --look-off: #232b37; --look-off-border: #656871; --look-off-text: #8c8c94;
    --look-rule: #232b37; --look-column: #b4b4bb; --look-popover-border: #656871; --look-handle: #0f141a;
    --look-badge-grey: #656871;
    --look-control-border: #8c8c94; --look-input-off: #656871;
  }
}
/* A firm's colour on its portal (portal/branding.py sets --link to a shade of it that reads): what Cloudscape darkens
   or lightens under the pointer is that shade a step further, or, in a browser that can't mix colours, the shade
   the firm's buttons take under the pointer. */
:root[data-look="portal"] { --look-link-hover: var(--primary-hover); --look-button-hover: var(--primary-soft); --look-button-active: var(--primary-soft); }
@supports (color: color-mix(in srgb, red 50%, blue)) {
  :root[data-look="portal"] { --look-link-hover: color-mix(in srgb, var(--link) 62%, #000); }
  @media screen and (prefers-color-scheme: dark) {
    :root[data-look="portal"] { --look-link-hover: color-mix(in srgb, var(--link) 70%, #fff); }
  }
}

/* --- 2. The page ------------------------------------------------------------------------------------------------ */
body.look, [data-look] body {
  font: 400 14px/20px var(--font);  /* fontSizeBodyM, lineHeightBodyM */
  font-feature-settings: normal;  /* Inter's alternates mean nothing to Open Sans */
  -webkit-font-smoothing: auto;
  background: var(--bg);
  color: var(--text);
}
[data-look] h1, [data-look] h2, [data-look] h3, [data-look] h4 { color: var(--look-heading); font-weight: 700; margin: 0; }
[data-look] h1 { font-size: 24px; line-height: 30px; letter-spacing: -0.02em; }  /* heading-xl: a page's title */
[data-look] h2 { font-size: 20px; line-height: 24px; letter-spacing: -0.015em; }  /* heading-l: a container's */
[data-look] h3 { font-size: 18px; line-height: 22px; letter-spacing: -0.01em; }  /* heading-m */
[data-look] h4 { font-size: 16px; line-height: 20px; letter-spacing: -0.005em; }  /* heading-s */
[data-look] p { margin: 0; }
[data-look] strong { font-weight: 700; }
[data-look] .muted { color: var(--text-2); }
[data-look] .small { font-size: 12px; line-height: 16px; letter-spacing: 0.005em; }  /* body-s */
[data-look] .illustration { display: none; }  /* no picture */
[data-look] ::selection { background: var(--primary-soft); color: var(--text); }

/* --- 3. A card on its own: Firmdesk's name (or the firm's), a container, the policies under it ------------------- */
[data-look] .auth-page { box-sizing: border-box; display: flex; flex-direction: column; gap: var(--stack-gap); max-width: 448px; min-height: 100vh; margin: 0 auto; padding: 48px 16px 32px; }
[data-look] #messages:not(:has(*)) { display: none; }  /* nothing said: no room taken in the stack */
[data-look] .auth-brand { gap: 10px; margin: 0 0 4px; font-size: 20px; line-height: 24px; font-weight: 700; letter-spacing: 0; color: var(--look-heading); }
[data-look] .auth-brand img { border-radius: 0; }
[data-look] .portal-auth-brand { margin: 0 0 4px; }
[data-look] .portal-auth-brand .auth-brand { margin: 0; }
/* Cloudscape's container (container/styles.scoped.css, the refresh): a 1px border in the divider's colour, 16px
   corners (borderRadiusContainer), 20px inside (spaceContainerHorizontal, spaceScaledL), no shadow. What it holds
   is 20px apart (SpaceBetween, size "l"), as a form's fields are. */
[data-look] .card { box-sizing: border-box; margin: 0; padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: none; }
[data-look] .auth-card, [data-look] .auth-card > form.form, [data-look] .look-content, [data-look] .look-content .card, [data-look] .look-content .card > form.form {
  display: flex; flex-direction: column; gap: var(--stack-gap);
}
[data-look] .auth-card > *, [data-look] .auth-card > form.form > *, [data-look] .look-content > *, [data-look] .look-content .card > * { margin-top: 0; margin-bottom: 0; }
[data-look] .auth-card h1 { margin-bottom: 0; font-size: 24px; line-height: 30px; }
[data-look] .auth-card > h1 + p { margin-top: -16px; }  /* a header's description sits 4px under it */
[data-look] .auth-card > p.small + p.small, [data-look] .auth-card > p.small + form.small, [data-look] .auth-card > form.small + form.small,
[data-look] .auth-card > form.small + p.small, [data-look] .auth-card > form.form + form.small ~ form.small { margin-top: -12px; }  /* spaceScaledXs: the lines under a form, 8px apart */
[data-look] .auth-links { margin-top: 0; gap: 4px 16px; font-size: 12px; line-height: 16px; letter-spacing: 0.005em; color: var(--text-2); }
[data-look] .auth-links a { color: var(--link); }
[data-look] .auth-links .auth-powered { color: var(--text-2); }
[data-look] .signed-in-as { margin: 0; color: var(--text-2); text-align: center; }
[data-look] .auth-card .actions { gap: 8px; }  /* spaceXs between buttons */

/* --- 4. Words and links -----------------------------------------------------------------------------------------
   Cloudscape's link (link/styles.scoped.css, the secondary variant, the one its pages use in a sentence): the
   colour alone, underlined under the pointer and when it has the keyboard. */
[data-look] a:not(.btn) { color: var(--link); text-decoration: none; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
[data-look] a:not(.btn):hover, [data-look] a:not(.btn):active { color: var(--look-link-hover); text-decoration: underline; }
[data-look] a:not(.btn):focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; text-decoration: underline; }
/* A button that reads as a link (button/styles.scoped.css, the inline-link variant): the link's colour, in bold. */
[data-look] .link-action, [data-look] .link-button { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; letter-spacing: 0.005em; color: var(--link); cursor: pointer; text-decoration: none; }
[data-look] .link-action:hover, [data-look] .link-button:hover { color: var(--look-link-hover); text-decoration: none; }
[data-look] .link-action:focus-visible, [data-look] .link-button:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
[data-look] p .link-action, [data-look] form.small .link-action, [data-look] .signed-in-as .link-button { min-height: 0; }  /* in a sentence: the line keeps its height */
[data-look] .auth-links .link-button { font-weight: 400; }  /* the other language, among the links under the card */
[data-look] code, [data-look] .secret-key { font-family: Monaco, Menlo, Consolas, "Courier Prime", Courier, "Courier New", monospace; font-size: 14px; }  /* fontFamilyMonospace */
/* What can be opened (expandable-section, the default variant): its words in the text colour, a filled caret. */
[data-look] details > summary { color: var(--text); cursor: pointer; }
[data-look] details > summary:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }

/* --- 5. Fields (form-field and input) ----------------------------------------------------------------------------
   A label in bold over its box (fontWeightFormLabel), then what's wrong and the help under the box in small
   (body-s), 4px apart (spaceXxs). The box: 32px tall, 8px corners, a 1px border; with the keyboard, the border in
   the focus colour and a 1px ring outside it (borderControlFocusRingShadowSpread). */
[data-look] .form .field { gap: 4px; margin: 0; }
[data-look] .form-grid { gap: var(--stack-gap); margin: 0; }
[data-look] .field label, [data-look] .field fieldset legend, [data-look] .field-head label { font-size: 14px; line-height: 20px; font-weight: 700; color: var(--look-label); }
[data-look] .field fieldset legend { margin-bottom: 4px; }
[data-look] .field fieldset label, [data-look] .field label.check, [data-look] label.check { font-weight: 400; color: var(--text); gap: 8px; }
[data-look] .field .helptext, [data-look] .field > .muted.small, [data-look] .toggle-help { font-size: 12px; line-height: 16px; letter-spacing: 0.005em; color: var(--muted); }
[data-look] .helptext ul { margin: 0; padding-left: 16px; }
[data-look] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not(.switch), [data-look] select, [data-look] textarea {
  box-sizing: border-box; min-height: 32px; padding: 5px 12px;  /* spaceFieldVertical, spaceFieldHorizontal */
  border: 1px solid var(--control-border); border-radius: 8px;
  background-color: var(--surface); color: var(--text);
  font: 400 14px/20px var(--font); box-shadow: none; transition: none;
}
/* A list to choose from (select): Cloudscape's filled caret at its end, in colorTextInteractiveDefault. */
[data-look] select {
  padding-right: 36px; background-position: right 10px center; background-size: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23424650' stroke='%23424650' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='m8 11 4-6H4l4 6Z'/%3E%3C/svg%3E");
}
[data-look][data-theme="dark"] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23dedee3' stroke='%23dedee3' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='m8 11 4-6H4l4 6Z'/%3E%3C/svg%3E"); }
@media screen and (prefers-color-scheme: dark) {
  [data-look]:not([data-theme="light"]) select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23dedee3' stroke='%23dedee3' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='m8 11 4-6H4l4 6Z'/%3E%3C/svg%3E"); }
}
/* A file to choose (file-upload): Cloudscape's normal button, then the file's name. */
[data-look] input[type="file"] { min-height: 32px; padding: 0; border: 0; border-radius: 0; background: none; color: var(--text-2); font: 400 14px/20px var(--font); }
[data-look] input[type="file"]::file-selector-button {
  box-sizing: border-box; min-height: 32px; margin: 0 12px 0 0; padding: 4px 20px; border: 2px solid var(--link); border-radius: 20px;
  background: var(--surface); color: var(--link); font: 700 14px/20px var(--font); letter-spacing: 0.005em; cursor: pointer;
}
[data-look] input[type="file"]::file-selector-button:hover { background: var(--look-button-hover); border-color: var(--look-link-hover); color: var(--look-link-hover); }
[data-look] input[type="file"]:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
[data-look] input::placeholder, [data-look] textarea::placeholder { color: var(--muted); opacity: 1; }  /* colorTextInputPlaceholder */
[data-look] input:not([type="checkbox"]):not([type="radio"]):not(.switch):hover, [data-look] select:hover, [data-look] textarea:hover { border-color: var(--control-border); }
[data-look] input:not([type="checkbox"]):not([type="radio"]):not(.switch):focus, [data-look] select:focus, [data-look] textarea:focus {
  outline: 2px dotted transparent; border-color: var(--link); box-shadow: 0 0 0 1px var(--link);
}
[data-look] input:disabled, [data-look] select:disabled, [data-look] textarea:disabled { background: var(--surface-3); border-color: var(--surface-3); color: var(--look-input-off); }
/* Wrong: the border in the error's colour, 1px all round. Cloudscape's own thickens the left edge to 8px round the
   box's corner; an accent edge never follows a rounded corner here (docs/design.md), so the border alone says it. */
[data-look] .has-error input:not([type="checkbox"]):not([type="radio"]):not(.switch), [data-look] .has-error select, [data-look] .has-error textarea { border-color: var(--danger); }
[data-look] .has-error input:not([type="checkbox"]):not([type="radio"]):not(.switch):focus { border-color: var(--danger); box-shadow: 0 0 0 2px var(--link); }  /* borderControlInvalidFocusRingShadowSpread */
[data-look] .errorlist { margin: 0; padding: 0; list-style: none; color: var(--danger); font-size: 12px; line-height: 16px; letter-spacing: 0.005em; }
[data-look] .field .errorlist, [data-look] .toggle-row + .errorlist { padding: 0; border: 0; border-radius: 0; background: none; color: var(--danger); font-size: 12px; line-height: 16px; }
[data-look] .field .errorlist li, [data-look] .toggle-row + .errorlist li { position: relative; padding-left: 20px; }
/* Cloudscape's status-negative icon (icon/generated/icons.js), before what's wrong. */
[data-look] .field .errorlist li::before, [data-look] .toggle-row + .errorlist li::before {
  content: ""; position: absolute; left: 0; top: 0; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='7'/%3E%3Cpath d='m5.5 5.5 5 5M10.5 5.5l-5 5'/%3E%3C/svg%3E") center / 16px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='7'/%3E%3Cpath d='m5.5 5.5 5 5M10.5 5.5l-5 5'/%3E%3C/svg%3E") center / 16px no-repeat;
}
/* A tick box (checkbox): 16px (sizeControl), a 1px border in colorBorderControlDefault, 4px corners ticked or not;
   ticked, the accent with the tick in colorForegroundControlDefault, white in the light theme and dark in the dark
   one. The ring with the keyboard is 2px, 2px away. (app.css gives an unticked box 2px corners by a longer
   selector: the first rule here is as long.) */
[data-look] input[type="checkbox"]:not(.switch), [data-look] input[type="checkbox"]:not(:checked):not(:indeterminate):not(.switch) {
  -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0;
  border: 1px solid var(--look-control-border); border-radius: 4px; background: var(--surface) center / 12px no-repeat; box-shadow: none; cursor: pointer;
}
[data-look] input[type="checkbox"]:not(.switch):checked {
  border-color: var(--link); background-color: var(--link);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2.5 8.5 3.5 3.5 7.5-8'/%3E%3C/svg%3E");
}
[data-look][data-theme="dark"] input[type="checkbox"]:not(.switch):checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%230f141a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2.5 8.5 3.5 3.5 7.5-8'/%3E%3C/svg%3E");
}
@media screen and (prefers-color-scheme: dark) {
  [data-look]:not([data-theme="light"]) input[type="checkbox"]:not(.switch):checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%230f141a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2.5 8.5 3.5 3.5 7.5-8'/%3E%3C/svg%3E");
  }
}
/* One of a few (radio-group): a 16px circle; chosen, the accent round a dot in the colour of what's on it. */
[data-look] input[type="radio"] {
  -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0;
  border: 1px solid var(--look-control-border); border-radius: 50%; background: var(--surface); box-shadow: none; cursor: pointer;
}
[data-look] input[type="radio"]:checked { border: 5px solid var(--link); background: var(--look-handle); }
[data-look] input[type="checkbox"]:focus-visible, [data-look] input[type="radio"]:focus-visible, [data-look] input.switch:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; box-shadow: none; }
/* A switch (toggle): a 24 by 16 track, its 12px handle; off in colorBackgroundToggleDefault, on in the accent. */
[data-look] input.switch { width: 24px; height: 16px; min-height: 0; border: 0; border-radius: 8px; background: var(--control-off); box-shadow: none; }
[data-look] input.switch::before { top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 6px; background: var(--look-handle); box-shadow: 1px 1px rgba(0, 0, 0, 0.25); }
[data-look] input.switch:checked { background: var(--link); }
[data-look] input.switch:checked::before { transform: translateX(8px); }
/* Its row: the switch, then what it does and the help under that, as Cloudscape lays a toggle out. */
[data-look] .toggle-row { flex-direction: row-reverse; justify-content: flex-end; align-items: flex-start; gap: 8px; margin: 0; padding: 0; border: 0; }
[data-look] .toggle-row + .toggle-row { border-top: 0; }
[data-look] .toggle-row input.switch { margin-top: 2px; }
[data-look] .toggle-label { font-weight: 400; color: var(--text); }
[data-look] .sub-fields { margin: 0 0 0 32px; padding: 0; border: 0; }  /* under the switch it depends on: set in, with no line beside it */
/* A field with something of its own inside it keeps room for it: the eye that shows a password, a phone's +1. */
[data-look] .password-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not(.switch) { padding-right: 44px; }
[data-look] .phone-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not(.switch) { padding-left: 52px; }
[data-look] .password-toggle { color: var(--text-2); border-radius: 4px; }
[data-look] .password-toggle:hover { color: var(--look-heading); background: none; }
[data-look] .phone-prefix { color: var(--muted); }

/* --- 6. Buttons (button/styles.scoped.css) -----------------------------------------------------------------------
   Round ends (borderRadiusButton), a 2px border, bold words, 4px by 20px inside: 32px tall. The normal one is
   outlined in the accent; the primary one is filled with it. Cloudscape has one size of button and no red one: a
   small button and a destructive one are drawn as its normal and its primary. With the keyboard, a 2px ring 4px
   outside the button, with 4px corners (spaceButtonFocusOutlineGutter, borderRadiusControlDefaultFocusRing). */
[data-look] .btn {
  position: relative; box-sizing: border-box; min-height: 32px; padding: 4px 20px;
  border: 2px solid var(--link); border-radius: 20px; background: var(--surface); color: var(--link);
  font: 700 14px/20px var(--font); letter-spacing: 0.005em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  box-shadow: none; transition: none; white-space: normal; text-align: center; text-decoration: none;
}
[data-look] .btn:hover { background: var(--look-button-hover); border-color: var(--look-link-hover); color: var(--look-link-hover); text-decoration: none; }
[data-look] .btn:active { background: var(--look-button-active); border-color: var(--look-link-hover); color: var(--look-link-hover); }
[data-look] .btn-primary, [data-look] .btn-danger { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
[data-look] .btn-primary:hover, [data-look] .btn-primary:active, [data-look] .btn-danger:hover, [data-look] .btn-danger:active { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
[data-look] .btn-small { min-height: 32px; padding: 4px 20px; font-size: 14px; }
[data-look] .btn-ghost { border-color: transparent; background: none; }
[data-look] .btn:disabled, [data-look] .btn[aria-disabled="true"] { opacity: 1; background: var(--surface); border-color: var(--look-off-border); color: var(--look-off-text); cursor: auto; }
[data-look] .btn-primary:disabled, [data-look] .btn-primary[aria-disabled="true"] { background: var(--look-off); border-color: var(--look-off); }
[data-look] .btn:focus-visible { outline: 2px dotted transparent; outline-offset: 3px; }
[data-look] .btn:focus-visible::before { content: ""; position: absolute; inset: -6px; border-radius: 4px; box-shadow: 0 0 0 2px var(--link); pointer-events: none; }
[data-look] .btn .icon { width: 16px; height: 16px; margin-right: 8px; }
[data-look] .copy-button { vertical-align: middle; }

/* --- 7. Alerts (alert/styles.scoped.css) -------------------------------------------------------------------------
   A 2px border in the tone all round, 12px corners, the tone's pale ground, 8px by 16px inside; the words in the
   text colour and the icon in the tone. What a page says as it opens (Django's messages), a form's own refusal, a
   notice in a card and Firmdesk's own notice are each one. */
[data-look] .messages { gap: 8px; }
[data-look] .message, [data-look] .form-notice, [data-look] form > .errorlist, [data-look] .plan-banner, [data-look] .service-notice, [data-look] .app-get-done,
[data-look] .deletion-banner, [data-look] .sample-banner {
  box-sizing: border-box; margin: 0; padding: 8px 16px; border: 2px solid var(--info-border); border-radius: 12px;
  background: var(--info-bg); color: var(--text); font-size: 14px; line-height: 20px; letter-spacing: 0; box-shadow: none;
}
[data-look] .message { gap: 8px; padding-block: 12px; align-items: flex-start; }
[data-look] .message > .icon, [data-look] .plan-banner > .icon, [data-look] .service-notice > .icon, [data-look] .deletion-banner > .icon, [data-look] .sample-banner > .icon { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; color: var(--info-text); }
[data-look] .plan-banner, [data-look] .deletion-banner, [data-look] .sample-banner { gap: 8px; }
[data-look] .sample-banner { align-items: flex-start; }
[data-look] .sample-banner p { font-size: 14px; line-height: 20px; }
[data-look] .sample-banner-actions { gap: 8px; }
[data-look] .message-info { background: var(--info-bg); border-color: var(--info-border); color: var(--text); }
[data-look] .message-success, [data-look] .app-get-done { background: var(--success-bg); border-color: var(--success-border); color: var(--text); }
[data-look] .message-success > .icon { color: var(--success); }
[data-look] .message-warning, [data-look] .form-notice, [data-look] .service-notice.is-problem, [data-look] .plan-banner:not(.is-info) { background: var(--warning-bg); border-color: var(--warning-border); color: var(--text); }
[data-look] .message-warning > .icon, [data-look] .service-notice.is-problem > .icon, [data-look] .plan-banner:not(.is-info) > .icon { color: var(--warning); }
[data-look] .service-notice { gap: 8px; }
[data-look] .service-notice p { font-size: 14px; line-height: 20px; }
[data-look] .message-error, [data-look] .form-notice.is-danger, [data-look] form > .errorlist, [data-look] .deletion-banner { background: var(--danger-bg); border-color: var(--danger-border); color: var(--text); }
[data-look] .message-error > .icon, [data-look] .deletion-banner > .icon { color: var(--danger); }
[data-look] .message-close { color: var(--text-2); border-radius: 4px; opacity: 1; }
[data-look] .message-close:hover, [data-look] .message-close:focus-visible { background: none; color: var(--look-heading); }
[data-look] .message-action { color: var(--link); font-weight: 700; }
[data-look] .form-notice .link-action { font-size: inherit; }
[data-look] .tooltip { border: 1px solid var(--look-popover-border); border-radius: 8px; box-shadow: var(--shadow-md); font-size: 12px; line-height: 16px; }

/* A dialog that asks first (modal): a container that floats, over colorBackgroundModalOverlay. */
[data-look] dialog.modal { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-md); }
[data-look] dialog.modal::backdrop { background: var(--backdrop); }
[data-look] dialog.modal .modal-card { padding: 20px; }
[data-look] dialog.modal h2 { margin: 0 0 8px; font-size: 20px; line-height: 24px; }
[data-look] dialog.modal p { margin: 0 0 20px; color: var(--text); }
[data-look] dialog.modal .actions { gap: 8px; }

/* The steps from signing up to a firm's first day: a line over each, straight, in one flat colour. */
[data-look] .steps { margin: 0; gap: 8px; font-size: 12px; line-height: 16px; color: var(--muted); }
[data-look] .steps li { border-top: 2px solid var(--border); }
[data-look] .steps li.is-done { border-top-color: var(--success); color: var(--text-2); }
[data-look] .steps li.is-current { border-top-color: var(--link); color: var(--text); font-weight: 700; }

/* --- 8. A page under the top bar ---------------------------------------------------------------------------------
   Cloudscape's top navigation (top-navigation/styles.scoped.css, in its own visual context, dark in both themes):
   56px tall, 40px on a phone (spaceXxxl + spaceScaledM, spaceXxxl), a 1px rule under it; the mark at most 32px,
   12px before the name, which is heading-m in colorTextTopNavigationTitle. */
.look-bar {
  position: sticky; top: 0; z-index: 20; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 56px; padding: 0 32px; background: #161d26; border-bottom: 1px solid #424650; color: #dedee3;
}
.look-bar a.look-identity { display: flex; align-items: center; min-width: 0; color: #f9f9fa; text-decoration: none; }
.look-bar a.look-identity:hover { color: #42b4ff; text-decoration: none; }
.look-bar a.look-identity:focus-visible { outline: 2px solid #42b4ff; outline-offset: 2px; border-radius: 4px; text-decoration: none; }
.look-bar .look-identity img { display: block; width: auto; height: auto; max-height: 32px; max-width: 160px; margin-right: 12px; flex-shrink: 0; }
.look-bar .look-logo { padding: 2px; border-radius: 4px; background: #ffffff; }  /* a firm's logo is drawn for white paper */
.look-title { font-size: 18px; line-height: 22px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.look-firm { min-width: 0; font-weight: 700; letter-spacing: 0.005em; color: #dedee3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The light bar a firm can choose (PortalSettings.top_bar), as the new portal draws it (frontend/app/portal/brand.ts):
   Cloudscape's light colours, white with a colorBorderDividerDefault rule, the name in colorTextTopNavigationTitle.
   The computer's dark theme keeps the bar dark, as the rest of the page is. */
.look-bar.look-bar-light { background: #ffffff; border-bottom-color: #c6c6cd; color: #0f141a; }
.look-bar.look-bar-light a.look-identity { color: #0f141a; }
.look-bar.look-bar-light a.look-identity:hover { color: var(--link); }
.look-bar.look-bar-light a.look-identity:focus-visible { outline-color: var(--link); }
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .look-bar.look-bar-light { background: #161d26; border-bottom-color: #424650; color: #dedee3; }
  :root:not([data-theme="light"]) .look-bar.look-bar-light a.look-identity { color: #f9f9fa; }
  :root:not([data-theme="light"]) .look-bar.look-bar-light a.look-identity:hover { color: #42b4ff; }
  :root:not([data-theme="light"]) .look-bar.look-bar-light a.look-identity:focus-visible { outline-color: #42b4ff; }
}
@media (max-width: 688px) {
  .look-bar { height: 40px; padding: 0 20px; }
  .look-bar .look-identity img { max-height: 24px; }
}
/* The page: one column in the middle, as wide as Cloudscape lays out a form (800px), 20px from the bar. */
.look-page { box-sizing: border-box; max-width: 848px; margin: 0 auto; padding: 20px 24px 40px; outline: 0; }
.look-content .form, .look-content .page-header, .look-content .workspace-list, .look-content .card, .look-content > p { max-width: none; }
.look-page { display: flex; flex-direction: column; gap: var(--stack-gap); }
.look-page > .look-back { margin: 0 0 -12px; }  /* 8px over the page's title, as breadcrumbs are */
[data-look] .look-content [id] { scroll-margin-top: 76px; }  /* an address that names a part of the page (#password): clear of the bar */
.look-back a { display: inline-flex; align-items: center; gap: 4px; }
/* Under the page: who is signed in, with Sign out; on a firm's portal, the firm's own address and phone. */
.look-page > .signed-in-as { text-align: left; }
.look-firm-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12px; line-height: 16px; letter-spacing: 0.005em; color: var(--text-2); }
.look-firm-foot strong { color: var(--look-heading); }
.look-page > .auth-links { justify-content: flex-start; }
.look-back .icon { width: 16px; height: 16px; color: var(--muted); }
@media (max-width: 688px) { .look-page { padding: 16px 16px 32px; } }

/* --- 9. What those pages hold -----------------------------------------------------------------------------------
   The page's title and what it's about (header, h1), then its containers, each with its own title (header, h2). */
.look-content > h1:first-child, .look-content .page-header h1 { font-size: 24px; line-height: 30px; letter-spacing: -0.02em; }
[data-look] .look-content > h1:first-child + p { margin-top: -16px; color: var(--look-heading-2); }
.look-content .page-header p { margin-top: 4px; color: var(--look-heading-2); }
.look-content .page-header { margin: 0; gap: 16px; }
.look-content .page-header h1 { padding: 0; }
.look-content .card-heading, .look-content .card > h2 { font-size: 20px; line-height: 24px; letter-spacing: -0.015em; }
[data-look] .look-content .card > .card-heading + p.small, [data-look] .look-content .card > h2 + p.small { margin-top: -16px; }  /* a header's description */
.look-content .card .actions { gap: 8px; }
.look-content .portal-narrow { max-width: none; display: flex; flex-direction: column; gap: var(--stack-gap); }
/* A badge (badge/styles.scoped.css): small words on a solid ground, 4px corners, 8px each side. */
[data-look] .badge { display: inline-block; padding: 0 8px; border: 0; border-radius: 4px; background: var(--look-badge-grey); color: #f9f9fa; font-size: 12px; line-height: 20px; font-weight: 400; letter-spacing: 0.005em; vertical-align: middle; }
[data-look] .badge-active { background: #00802f; color: #f9f9fa; }  /* colorBackgroundBadgeGreen */
[data-look] .badge-inv-overdue { background: #db0000; color: #f9f9fa; }  /* colorBackgroundBadgeRed */
/* A list's rows: a 1px rule between them (colorBorderDividerSecondary), none after the last. */
.look-content .item-list { margin: 0; padding: 0; list-style: none; }
.look-content .item-list .item { padding: 12px 0; border: 0; border-bottom: 1px solid var(--look-rule); border-radius: 0; background: none; }
.look-content .item-list .item:first-child { padding-top: 0; }
.look-content .item-list .item:last-child { border-bottom: 0; padding-bottom: 0; }
.look-content .item-title { font-weight: 700; color: var(--look-heading); }
[data-look] .look-content .setting-group-label { margin-bottom: -12px; font-size: 14px; line-height: 18px; letter-spacing: 0; text-transform: none; color: var(--look-heading); }  /* heading-xs, 8px over its list */
.look-content .setting-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: 8px; overflow: clip; }
.look-content .setting-list > li + li { border-top: 1px solid var(--look-rule); }
.look-content .setting-row { padding: 12px 16px; border: 0; border-radius: 0; background: none; color: var(--text); }
.look-content a.setting-row:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.look-content a.setting-row:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; border-radius: 8px; }
.look-content .setting-row.is-sub { padding-left: 60px; border-top: 1px solid var(--look-rule); }  /* 16px, the icon's 32px, the gap's 12px: under the words of the row it belongs to */
.look-content .setting-title { font-weight: 700; color: var(--look-heading); }
.look-content .setting-sub { color: var(--text-2); font-size: 12px; line-height: 16px; }
.look-content .setting-sub.is-warning { color: var(--warning-text); }
.look-content .setting-action { color: var(--link); font-weight: 700; }
.look-content .setting-icon { color: var(--text-2); background: none; }
.look-content .setting-state { color: var(--success); }
.look-content .setting-row.is-danger .setting-title { color: var(--danger); }
.look-content .setting-end .icon { color: var(--muted); }
/* A table (table/styles.scoped.css): the column names in bold in colorTextColumnHeader over a rule, a rule between
   rows, none after the last. */
.look-content table { width: 100%; border-collapse: collapse; }
.look-content th { padding: 4px 16px 8px 0; border-bottom: 1px solid var(--border); background: none; color: var(--look-column); font-size: 14px; line-height: 20px; font-weight: 700; text-align: left; text-transform: none; letter-spacing: 0; }
.look-content td { padding: 8px 16px 8px 0; border-bottom: 1px solid var(--look-rule); vertical-align: middle; }
.look-content tr:last-child > td { border-bottom: 0; }
.look-content th:last-child, .look-content td:last-child { padding-right: 0; }
/* A tick box beside its words (Connected apps, Without approval): the box on the words' first line, centred on it. */
[data-look] .look-content .check-row { align-items: flex-start; gap: 8px; }
[data-look] .look-content .check-row input[type="checkbox"] { margin-top: 2px; flex: none; }
/* The list of someone's firms (cards): a container each; the one they're in has the selected item's 2px border. */
.look-content .workspace-list { display: flex; flex-direction: column; gap: 16px; padding: 0; list-style: none; }
[data-look] .look-content .workspace-card { flex-direction: row; align-items: center; gap: 16px; }
[data-look] .look-content .workspace-card .workspace-info { flex: 1; min-width: 0; }
.look-content .workspace-card.current { border: 2px solid var(--link); padding: 19px; background: var(--primary-soft); }
@media (max-width: 560px) { [data-look] .look-content .workspace-card { flex-direction: column; align-items: stretch; text-align: center; } }
.look-content .workspace-name { font-weight: 700; color: var(--look-heading); }
.look-content .workspace-name .muted { font-weight: 400; }

/* --- 10. The client portal ---------------------------------------------------------------------------------------
   The firm's logo is drawn for white paper: in the dark it keeps a white ground, as on the firm's other pages. */
[data-look] .portal-auth-logo { max-height: 56px; max-width: 180px; }
[data-look] .app-get-head h1 { font-size: 24px; line-height: 30px; }
[data-look] .app-steps h2 { font-size: 16px; line-height: 20px; letter-spacing: -0.005em; }
[data-look] .app-steps ol { margin: 8px 0 0; padding-left: 20px; }
[data-look] .setup-steps { padding-left: 20px; gap: 12px; }
[data-look] .setup-steps > li + li, [data-look] .app-steps li + li { margin-top: 8px; }
[data-look] .app-sheet-body { border-radius: 16px 16px 0 0; background: var(--surface); box-shadow: var(--shadow-md); }
[data-look] .app-sheet-backdrop { background: var(--backdrop); }
[data-look] .recovery-codes { margin: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
[data-look] .recovery-codes code { font-size: 16px; letter-spacing: 0.04em; }
[data-look] .qr { border-radius: 8px; }
[data-look] .sample-offer { padding: 20px 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: none; }
[data-look] .sample-offer > * + * { margin-top: 12px; }

/* --- 11. What Django says when something went wrong (templates/errors/page.html) ----------------------------------
   A card on its own, as the sign-in pages are: its title, what happened, what to do. */
[data-look] .error-page { max-width: 448px; text-align: left; }
[data-look] .error-card { align-items: stretch; gap: var(--stack-gap); padding: 20px; }
[data-look] .error-card h1 { margin: 0; font-size: 24px; line-height: 30px; }
[data-look] .error-card > * { margin-top: 0; margin-bottom: 0; }
[data-look] .error-card > p { max-width: none; color: var(--text); }
[data-look] .error-card > h1 + p { margin-top: -16px; }
[data-look] .error-card .actions { justify-content: flex-start; gap: 8px; margin-top: 0; }
[data-look] .error-card .error-foot { margin-top: 0; color: var(--text-2); }
