/*
  The Hauswerk theme. Loaded after bsft-ui.css and built on its tokens: the approved mock's palette
  (docs/mockup/hauswerk-prototyp.html) is mapped onto --bsft-color-* (light) and
  --bsft-dark-color-* (dark), so every framework component takes the Hauswerk look without being
  forked. Tokens the framework has no name for live as --hw-*.

  Three-state like the framework: without data-bsft-theme on <html> the system preference decides,
  data-bsft-theme="light"|"dark" overrides it either way.
*/

:root {
  /* framework tokens, light */
  --bsft-color-text: #1B2620;
  --bsft-color-muted: #56645B;
  --bsft-color-surface: #FFFFFF;
  --bsft-color-border: #D5DDD3;
  --bsft-color-primary: #2E6A4E;
  --bsft-color-primary-contrast: #FFFFFF;
  --bsft-color-danger: #B3413A;
  --bsft-color-danger-surface: #F6DCD8;
  --bsft-color-warning: #9A6410;
  --bsft-color-warning-surface: #FBEBC8;
  --bsft-color-success: #2F8558;
  --bsft-color-success-surface: #D7EEDF;
  --bsft-color-info: #3B6FA0;
  --bsft-color-info-surface: #DCE7F2;
  --bsft-color-skeleton: #F3F6F1;
  --bsft-radius: 14px;
  --bsft-font: var(--hw-font-body);

  /* framework tokens, dark palette (activated by bsft-ui.css) */
  --bsft-dark-color-text: #E4EAE5;
  --bsft-dark-color-muted: #9CA9A1;
  --bsft-dark-color-surface: #18201B;
  --bsft-dark-color-border: #2D3831;
  --bsft-dark-color-primary: #72BA94;
  --bsft-dark-color-primary-contrast: #0E1210;
  --bsft-dark-color-danger: #E8857A;
  --bsft-dark-color-danger-surface: #3C221F;
  --bsft-dark-color-warning: #E3B45C;
  --bsft-dark-color-warning-surface: #3A2E17;
  --bsft-dark-color-success: #72C492;
  --bsft-dark-color-success-surface: #1C3527;
  --bsft-dark-color-info: #86AFD9;
  --bsft-dark-color-info-surface: #1D2A37;
  --bsft-dark-color-skeleton: #1F2822;

  /* Hauswerk tokens the framework has no name for, light */
  --hw-ground: #E9EDE7;
  --hw-surface-2: #F3F6F1;
  --hw-accent-soft: #DAEBE0;
  --hw-house: #3B6FA0;
  --hw-house-soft: #DCE7F2;
  --hw-meal: #B86A12;
  --hw-meal-soft: #F6E6D0;
  --hw-act: #7A52A6;
  --hw-act-soft: #EADFF4;
  --hw-routine: #2F7A76;
  --hw-routine-soft: #D6ECEA;
  /* Google's sign-in button colours, fixed by its branding rules rather than the palette. */
  --hw-google-surface: #FFFFFF;
  --hw-google-line: #747775;
  --hw-google-text: #1F1F1F;

  --hw-font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --hw-font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --hw-font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --hw-desktop-nav-width: 240px;
  --hw-content-width: 960px;
  --hw-tabbar-height: 68px;
  --hw-keyboard-inset: 0px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-bsft-theme="light"]) {
    --hw-ground: #0E1210;
    --hw-surface-2: #1F2822;
    --hw-accent-soft: #1F3A2C;
    --hw-house: #86AFD9;
    --hw-house-soft: #1D2A37;
    --hw-meal: #E6A45A;
    --hw-meal-soft: #39291A;
    --hw-act: #BC9BE0;
    --hw-act-soft: #2D2439;
    --hw-routine: #7FC8C2;
    --hw-routine-soft: #1A3331;
    --hw-google-surface: #131314;
    --hw-google-line: #8E918F;
    --hw-google-text: #E3E3E3;
    color-scheme: dark;
  }
}

:root[data-bsft-theme="dark"] {
  --hw-ground: #0E1210;
  --hw-surface-2: #1F2822;
  --hw-accent-soft: #1F3A2C;
  --hw-house: #86AFD9;
  --hw-house-soft: #1D2A37;
  --hw-meal: #E6A45A;
  --hw-meal-soft: #39291A;
  --hw-act: #BC9BE0;
  --hw-act-soft: #2D2439;
  --hw-routine: #7FC8C2;
  --hw-routine-soft: #1A3331;
  --hw-google-surface: #131314;
  --hw-google-line: #8E918F;
  --hw-google-text: #E3E3E3;
  color-scheme: dark;
}

/* --- base ------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--hw-ground);
  color: var(--bsft-color-text);
  font-family: var(--hw-font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3 {
  font-family: var(--hw-font-display);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

/* The mock's reset: a button without a class of the button system below never shows the browser's grey bevel. */
button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

:focus-visible {
  outline: 2px solid var(--bsft-color-primary);
  outline-offset: 2px;
}

/* The start screen (docs/design/app-start.md): index.html paints it before the app's files arrive, and the shell
   renders the same while it asks who is signed in, so the change from one to the other does not move anything. The
   house sits in the middle at 128px, where and as large as the Android app's splash draws it, so the splash hands
   over without a jump; name, bar and status hang below it. */
.hw-boot {
  position: relative;
  min-height: 100dvh;
  background: var(--hw-ground);
  color: var(--bsft-color-muted);
}

.hw-boot-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 128px;
  height: 128px;
  margin: -64px 0 0 -64px;
}

.hw-boot-caption {
  position: absolute;
  top: calc(50% + 80px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
}

.hw-boot-name {
  font-family: var(--hw-font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--bsft-color-text);
}

.hw-boot-bar {
  width: min(180px, 60vw);
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--hw-accent-soft);
}

.hw-boot-bar-fill {
  width: var(--blazor-load-percentage, 0%);
  height: 100%;
  border-radius: 2px;
  background: var(--bsft-color-primary);
  transition: width 0.2s ease-out;
}

.hw-boot-bar-fill-done {
  width: 100%;
}

.hw-boot-status {
  min-height: 1.4em;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

/* A forced update (docs/design/app-version-handshake.md) lays the start screen with its words over the running app
   until the page reloads. */
.hw-boot-updating {
  position: fixed;
  inset: 0;
  z-index: 3000;
}

#blazor-error-ui {
  display: none;
  position: fixed;
  inset: auto 12px calc(12px + env(safe-area-inset-bottom)) 12px;
  z-index: 2000;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bsft-color-danger-surface);
  color: var(--bsft-color-danger);
}

#blazor-error-ui .reload {
  color: inherit;
  font-weight: 700;
  margin-left: 8px;
}

/* --- shell: phone first ------------------------------------------------------ */

.hw-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.hw-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* room for the fixed tab bar */
  padding-bottom: calc(68px + env(safe-area-inset-bottom));
}

.hw-appbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  /* status-bar safe: the notch area on an installed app */
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  background: var(--hw-ground);
}

.hw-appbar-text {
  flex: 1;
  min-width: 0;
}

.hw-household {
  font-size: 13px;
  color: var(--bsft-color-muted);
}

.hw-title {
  font-size: 24px;
  outline: none;
}

.hw-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 16px 24px;
  width: 100%;
  /* One content width for every page, centred beside the navigation on a wide screen. */
  max-width: var(--hw-content-width);
  margin-inline: auto;
}

.hw-nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10;
  background: var(--bsft-color-surface);
  border-top: 1px solid var(--bsft-color-border);
  padding: 6px 6px calc(10px + env(safe-area-inset-bottom));
}

.hw-brand {
  display: none;
}

.hw-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.hw-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  border-radius: 10px;
  font-size: 11.5px;
  color: var(--bsft-color-muted);
  text-decoration: none;
  min-height: 48px;
}

.hw-nav-link[aria-current="page"] {
  color: var(--bsft-color-primary);
  font-weight: 700;
}

.hw-icon {
  width: 22px;
  height: 22px;
  flex: none;
}

/* --- shell: desktop ---------------------------------------------------------- */

@media (min-width: 900px) {
  .hw-app {
    flex-direction: row;
  }

  .hw-main {
    padding-bottom: 0;
  }

  .hw-appbar {
    /* the title lines up with the centred content below it */
    padding: 28px max(32px, calc((100% - var(--hw-content-width)) / 2 + 32px)) 12px;
  }

  .hw-title {
    font-size: 30px;
  }

  .hw-content {
    padding: 4px 32px 48px;
  }

  .hw-nav {
    position: sticky;
    top: 0;
    inset: auto;
    align-self: flex-start;
    width: var(--hw-desktop-nav-width);
    height: 100dvh;
    flex: none;
    border-top: 0;
    border-right: 1px solid var(--bsft-color-border);
    padding: 28px 14px;
  }

  .hw-brand {
    display: block;
    font-family: var(--hw-font-display);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
    padding: 0 10px 20px;
  }

  .hw-nav-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .hw-nav-link {
    flex-direction: row;
    gap: 12px;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 15px;
    color: var(--bsft-color-text);
  }

  .hw-nav-link:hover {
    background: var(--hw-surface-2);
  }

  .hw-nav-link[aria-current="page"] {
    background: var(--hw-accent-soft);
    color: var(--bsft-color-primary);
  }
}

/* --- cards and empty states -------------------------------------------------- */

.hw-card {
  background: var(--bsft-color-surface);
  border: 1px solid var(--bsft-color-border);
  border-radius: 18px;
  padding: 14px;
}

.hw-card-title {
  font-size: 16px;
  margin-bottom: 10px;
}

.hw-empty .bsft-empty-state {
  background: var(--bsft-color-surface);
  border: 1px dashed var(--bsft-color-border);
  border-radius: 18px;
  padding: 36px 20px;
  font-family: var(--hw-font-body);
}

.hw-empty .bsft-empty-state-title {
  font-family: var(--hw-font-display);
  font-size: 18px;
  font-weight: 700;
}

.hw-empty .bsft-empty-state-description {
  max-width: 42ch;
  margin-inline: auto;
}

.hw-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* --- app bar: household switcher and settings ------------------------------------ */

.hw-household-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  padding: 2px 0;
  min-height: 32px;
  cursor: pointer;
}

.hw-household-switch .hw-icon {
  width: 16px;
  height: 16px;
}

.hw-household-menu {
  list-style: none;
  margin: 4px 0 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 320px;
  background: var(--bsft-color-surface);
  border: 1px solid var(--bsft-color-border);
  border-radius: 14px;
}

.hw-household-option {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 10px 12px;
  min-height: 44px;
  cursor: pointer;
}

.hw-household-option:hover {
  background: var(--hw-surface-2);
}

.hw-household-option[aria-current="true"] {
  background: var(--hw-accent-soft);
  color: var(--bsft-color-primary);
  font-weight: 700;
}

/* --- standalone pages: sign-in, setup, invitation, first household ------------- */

.hw-standalone {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
}

.hw-standalone-brand {
  font-family: var(--hw-font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 8px 0 20px;
}

.hw-standalone-content {
  width: 100%;
  max-width: 440px;
}

.hw-standalone-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}

.hw-standalone-title {
  font-size: 24px;
  outline: none;
}

/* The themed sign-in form ships without layout of its own. */
.bsft-idp-login,
.bsft-idp-login form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bsft-idp-secondary-link {
  color: var(--bsft-color-primary);
}

/* The theme lists external providers as plain buttons with the provider's name; the sign-in page draws Google's own
   branded button above the form instead. */
.hw-login .bsft-idp-external-providers {
  display: none;
}

/* --- forms, notices and text ---------------------------------------------------- */

.bsft-form-field input:not([type="checkbox"]):not([type="radio"]),
.bsft-form-field select {
  min-height: 44px;
  font-size: 16px; /* 16px keeps iOS from zooming into a focused field */
}

.bsft-form-field input:disabled,
.bsft-form-field select:disabled {
  opacity: 1;
  background: var(--hw-surface-2);
  color: var(--bsft-color-text);
}

.bsft-form-actions {
  flex-wrap: wrap;
}

/* --- select and combo box ----------------------------------------------------------
  One rule (docs/design/slice-00-scaffold.md, "Lists to choose from"): a list with more than seven options or with
  options from data is an HwComboBox; a short fixed list is an hw-seg, chips, or a native <select class="hw-select">.
  The field of both looks the same: 44px, the line, the radius, a chevron at the end.
*/

:is(select, button).hw-select {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 8px 36px 8px 12px;
  font-family: var(--hw-font-body);
  font-size: 16px; /* 16px keeps iOS from zooming into a focused field */
  line-height: 1.3;
  text-align: start;
  color: var(--bsft-color-text);
  background-color: var(--bsft-color-surface);
  /* The chevron from two gradients, so it takes the palette in light and dark without an image. */
  background-image:
    linear-gradient(45deg, transparent 50%, var(--bsft-color-muted) 50%),
    linear-gradient(135deg, var(--bsft-color-muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  border: 1px solid var(--bsft-color-border);
  border-radius: var(--bsft-radius);
  cursor: pointer;
}

select.hw-select-inline {
  width: auto;
}

:is(select, button).hw-select:focus-visible {
  border-color: var(--bsft-color-primary);
  outline: 2px solid var(--bsft-color-primary);
  outline-offset: 1px;
}

:is(select, button).hw-select:disabled {
  cursor: default;
  opacity: 1;
  background-color: var(--hw-surface-2);
}

:is(select, button).hw-select.invalid {
  border-color: var(--bsft-color-danger);
}

.hw-combo {
  position: relative;
  min-width: 0;
}

button.hw-combo-field {
  padding-right: 10px;
  background-image: none;
}

button.hw-combo-field[aria-expanded="true"] {
  border-color: var(--bsft-color-primary);
}

.hw-combo-field .hw-icon {
  flex: none;
  color: var(--bsft-color-muted);
}

.hw-combo-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hw-combo-placeholder {
  color: var(--bsft-color-muted);
}

/* Below 900px a bottom sheet on the soft keyboard, like HwSheet: the search field on top, the list above the keyboard. */
.hw-combo-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 var(--hw-keyboard-inset);
  background: rgba(10, 15, 12, 0.45);
  animation: hw-fade 0.16s ease-out;
}

.hw-combo-panel {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  max-width: 560px;
  height: min(560px, calc(100dvh - var(--hw-keyboard-inset) - 48px - env(safe-area-inset-top)));
  padding: 10px 18px calc(12px + env(safe-area-inset-bottom));
  color: var(--bsft-color-text);
  background: var(--bsft-color-surface);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -8px 32px rgba(10, 15, 12, 0.18);
  animation: hw-sheet-up 0.22s ease-out;
}

html[data-hw-keyboard] .hw-combo-panel {
  padding-bottom: 8px;
}

.hw-combo-grab {
  flex: none;
  width: 40px;
  height: 5px;
  margin: 0 auto 2px;
  border-radius: 9px;
  background: var(--bsft-color-border);
}

.hw-combo-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hw-combo-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: var(--hw-font-display);
  font-size: 20px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.hw-combo-close {
  margin-right: -10px;
}

.hw-combo-search {
  flex: none;
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  margin: 6px 0 8px;
  padding: 8px 12px;
  font-size: 16px;
  color: var(--bsft-color-text);
  background: var(--hw-surface-2);
  border: 1px solid var(--bsft-color-border);
  border-radius: var(--bsft-radius);
}

.hw-combo-search:focus-visible {
  border-color: var(--bsft-color-primary);
  outline: 2px solid var(--bsft-color-primary);
  outline-offset: 1px;
}

.hw-combo-list {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 -8px;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.hw-combo-group {
  padding: 12px 12px 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bsft-color-muted);
}

.hw-combo-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 12px;
  cursor: pointer;
}

.hw-combo-option.is-active {
  background: var(--hw-accent-soft);
}

@media (hover: hover) {
  .hw-combo-option:not(.is-disabled):not(.is-active):hover {
    background: var(--hw-surface-2);
  }
}

.hw-combo-option.is-selected,
.hw-combo-option .hw-icon,
.hw-combo-create {
  font-weight: 700;
  color: var(--bsft-color-primary);
}

.hw-combo-option.is-disabled {
  cursor: default;
  opacity: 0.45;
}

.hw-combo-option-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.hw-combo-option-label {
  overflow-wrap: anywhere;
}

.hw-combo-option-description {
  font-size: 13px;
  font-weight: 400;
  color: var(--bsft-color-muted);
}

.hw-combo-mark {
  font-weight: 700;
  color: inherit;
  background: transparent;
  box-shadow: inset 0 -2px 0 var(--bsft-color-primary);
}

.hw-combo-status {
  margin: 8px 4px;
  font-size: 14px;
  color: var(--bsft-color-muted);
}

/* From 900px a popover anchored under (or above) the field; js/hw-combobox.js sets the coordinates. */
@media (min-width: 900px) {
  .hw-combo-layer {
    display: block;
    padding: 0;
    background: transparent;
    animation: none;
  }

  .hw-combo-panel {
    position: fixed;
    top: var(--hw-combo-top, 20vh);
    bottom: var(--hw-combo-bottom, auto);
    left: var(--hw-combo-left, calc(50% - 180px));
    width: var(--hw-combo-width, 360px);
    max-width: none;
    height: auto;
    max-height: min(420px, var(--hw-combo-max-height, 60vh));
    padding: 8px;
    border: 1px solid var(--bsft-color-border);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(10, 15, 12, 0.18);
    animation: hw-fade 0.12s ease-out;
  }

  .hw-combo-grab,
  .hw-combo-head {
    display: none;
  }

  .hw-combo-search {
    margin: 0 0 6px;
  }

  .hw-combo-list {
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hw-combo-panel {
    animation: hw-fade 0.16s ease-out;
  }
}

.hw-lead {
  margin: 0;
  color: var(--bsft-color-muted);
}

.hw-hint {
  margin: 0;
  font-size: 14px;
  color: var(--bsft-color-muted);
}

.hw-error,
.hw-notice {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
}

.hw-error {
  background: var(--bsft-color-danger-surface);
  color: var(--bsft-color-danger);
}

.hw-notice {
  background: var(--bsft-color-success-surface);
  color: var(--bsft-color-success);
}

.hw-settings-row {
  display: flex;
}

.hw-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  margin: 0;
}

.hw-facts dt {
  color: var(--bsft-color-muted);
}

.hw-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* The sign-in methods inside the account card, set apart from the name and address above by a line. */
.hw-sign-in-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--bsft-color-border);
}

.hw-sign-in-methods .hw-sheet-label {
  margin: 0;
}

/* A build id in "Über Hauswerk": a commit, read character by character. */
.hw-build {
  font-family: var(--hw-font-mono);
  overflow-wrap: anywhere;
}

.hw-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- members ---------------------------------------------------------------------- */

.hw-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.hw-card-head .hw-card-title {
  margin-bottom: 0;
}

.hw-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hw-list-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 0;
  border-top: 1px solid var(--bsft-color-border);
}

.hw-list-row:first-child {
  border-top: 0;
}

.hw-list-text {
  flex: 1 1 180px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.hw-list-title {
  font-weight: 700;
}

.hw-list-meta {
  font-size: 13px;
  color: var(--bsft-color-muted);
  overflow-wrap: anywhere;
}

/* A member row opens the member's sheet as one tap target. */
.hw-member-open {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

/* The members card offers inviting and adding without an invitation side by side. */
/* Two actions do not fit beside the title on a phone: they move to their own row, right aligned. */
.hw-member-head {
  flex-wrap: wrap;
}

.hw-card-head.hw-member-head .hw-card-title {
  flex: 1 0 auto;
}

.hw-member-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.hw-member-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

/* A member added without an invitation who has not signed in yet. */
.hw-badge.hw-badge-waiting {
  background: var(--hw-meal-soft);
  color: var(--hw-meal);
}

.hw-member-email {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.hw-member-email .bsft-form-field {
  align-self: stretch;
}

.hw-member-role-hint {
  margin-top: 8px;
}

.hw-settings-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hw-badge {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--hw-accent-soft);
  color: var(--bsft-color-primary);
}

.hw-qr {
  width: min(240px, 100%);
  align-self: center;
  padding: 8px;
  background: #FFFFFF;
  border-radius: 14px;
}

.hw-qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.hw-invite-link {
  margin: 0;
  font-family: var(--hw-font-mono);
  font-size: 13px;
  overflow-wrap: anywhere;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--hw-surface-2);
}

/* --- house: floors and rooms ------------------------------------------------------ */

.hw-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hw-house {
  display: grid;
  gap: 12px;
  align-items: start;
}

.hw-house-rooms {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.hw-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--hw-surface-2);
  color: var(--bsft-color-muted);
  border: 1px solid var(--bsft-color-border);
  white-space: nowrap;
}

.hw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hw-push-end {
  margin-left: auto;
}

.hw-card-head .hw-card-title {
  flex: 1;
  min-width: 0;
}

.hw-card-head .hw-push-end {
  margin-left: 0;
}

.hw-rooms {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hw-room + .hw-room {
  border-top: 1px solid var(--bsft-color-border);
}

.hw-room-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 7px 0;
  border: 0;
  background: transparent;
  text-align: left;
}

button.hw-room-head {
  cursor: pointer;
}

.hw-room-number {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 999px;
  background: var(--hw-house-soft);
  color: var(--hw-house);
  font-family: var(--hw-font-mono);
  font-size: 12px;
  font-weight: 600;
}

.hw-room-icon {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--bsft-color-muted);
}

.hw-chip .hw-room-icon {
  width: 16px;
  height: 16px;
  color: inherit;
}

.hw-room-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.hw-room-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.hw-room-note {
  color: var(--bsft-color-muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hw-room-editor {
  padding: 4px 0 14px;
}

.hw-room-editor textarea {
  font-size: 16px;
  resize: vertical;
}

.hw-icon-picker {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hw-icon-picker legend {
  padding: 0;
  margin-bottom: 6px;
  font-size: 0.875em;
  font-weight: 500;
}

.hw-field-error {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--bsft-color-danger);
}

.hw-entry-form {
  display: flex;
  flex-direction: column;
}

.hw-entry {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bsft-color-surface);
  border: 1.5px solid var(--bsft-color-border);
  border-radius: 16px;
  padding: 4px 4px 4px 14px;
}

.hw-entry:focus-within {
  border-color: var(--bsft-color-primary);
}

.hw-entry input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 10px 0;
  outline: none;
  font-size: 16px;
}

.hw-entry input::placeholder {
  color: var(--bsft-color-muted);
}

.hw-order-buttons {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}

/* The ordering list (HwReorderList): one list card, a line between the rows, a grip where a pointer can drag. */
.hw-reorder {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  background: var(--bsft-color-surface);
  border: 1px solid var(--bsft-color-border);
  border-radius: 18px;
  overflow: hidden;
}

.hw-reorder-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 6px 8px 6px 14px;
  border-top: 1px solid var(--bsft-color-border);
  cursor: grab;
}

.hw-reorder-row:first-child {
  border-top: 0;
}

.hw-reorder-row:focus-visible {
  outline: 2px solid var(--bsft-color-primary);
  outline-offset: -2px;
}

.hw-reorder-row.is-held {
  background: var(--hw-accent-soft);
  cursor: grabbing;
}

.hw-reorder-row.is-over {
  box-shadow: inset 0 2px 0 0 var(--bsft-color-primary);
}

.hw-reorder-grip {
  display: grid;
  flex: none;
  margin-left: -6px;
  color: var(--bsft-color-muted);
}

.hw-reorder-grip .hw-icon {
  width: 18px;
  height: 18px;
}

/* Inside a card the card is the frame: the rows keep only their lines (no card in a card). */
.hw-card .hw-reorder {
  margin-top: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.hw-card .hw-reorder-row {
  padding-inline: 0;
}

.hw-card .hw-reorder-grip {
  margin-left: 0;
}

/* On a touch screen or a phone-narrow window the up and down buttons move a row, so no grip promises a drag or takes
   the name's room. */
@media (pointer: coarse), (max-width: 480px) {
  .hw-reorder-grip {
    display: none;
  }
}

.hw-floor-row {
  gap: 8px;
}

.hw-floor-row .hw-inline-input {
  flex: 1 1 80px;
  min-width: 0;
  min-height: 44px;
  font-size: 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--hw-surface-2);
  padding: 6px 10px;
}

.hw-floor-row .hw-inline-input:focus {
  border-color: var(--bsft-color-primary);
  background: var(--bsft-color-surface);
}

.hw-floor-row .hw-field-error {
  flex-basis: 100%;
}

.hw-floor-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hw-house-empty .bsft-empty-state-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: min(420px, 100%);
  margin: 16px auto 0;
}

.hw-suggestions {
  justify-content: center;
}

@media (min-width: 900px) {
  .hw-house {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* --- buttons ---------------------------------------------------------------------------------------------
  One button system after the mock (.btn, .iconbtn, .seg, .pill, .chip, .toast button). Every screen uses these
  classes; a feature class next to them only places the button, it does not restyle it.

  .bsft-button                  secondary: surface, line, bold, 44px (the framework class, themed here)
  .bsft-button-primary          the one main action of a screen or sheet: accent surface
  .bsft-button-danger           removing and deleting: soft critical surface
  .hw-button-ghost              a quiet action beside others: no surface, accent text
  .hw-button-sm                 36px, for dense rows; .hw-button-block takes the full width
  .hw-link-button               a text button: accent, bold, no surface
  .hw-icon-button               a 40px tile with one icon; -round for the round "+", -danger for removing,
                                -voice for the hold-to-talk microphone of an entry field (.is-listening pulses);
                                aria-pressed="true" fills it with the accent, for a toggle such as a lock
  .hw-seg (> button, > a)       segmented tabs, the pressed or selected one is the accent thumb (HwPageTabs)
  .hw-pill                      a choice in a sheet or editor, aria-pressed marks the chosen one
  .hw-chip (as a button)        a filter or suggestion chip, aria-pressed marks an active filter
  .hw-tool-button               a small toolbar tile with text (button or link), aria-expanded while its panel is open
  .hw-appbar-icon               next to .hw-icon-button: the app bar's round 44px icon without a line (HwIconAction)
  .hw-menu-item                 an entry of the ⋯ menu (HwMenuItem)
  .hw-entry-submit              next to .hw-icon-button: the send icon of an entry field once it holds text
  .hw-google-button             "Mit Google anmelden" after Google's branding, only through HwGoogleButton: full width,
                                48px, the "G" at the leading edge, the words centred; .hw-or divides it from the
                                password form

  All of them share the focus ring (:focus-visible above), a pressed nudge and one disabled look.
*/

.bsft-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--bsft-color-border);
  border-radius: 14px;
  background: var(--bsft-color-surface);
  color: var(--bsft-color-text);
  font-family: var(--hw-font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.bsft-button .hw-icon {
  width: 18px;
  height: 18px;
}

.bsft-button:hover:not(:disabled) {
  background: var(--hw-surface-2);
}

.bsft-button-primary,
.bsft-button-primary:hover {
  background: var(--bsft-color-primary);
  border-color: var(--bsft-color-primary);
  color: var(--bsft-color-primary-contrast);
}

.bsft-button-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.bsft-button-danger,
.bsft-button-danger:hover {
  background: var(--bsft-color-danger-surface);
  border-color: transparent;
  color: var(--bsft-color-danger);
}

.bsft-button-danger:hover:not(:disabled) {
  border-color: var(--bsft-color-danger);
}

.hw-button-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--bsft-color-primary);
}

.hw-button-ghost:hover:not(:disabled) {
  background: var(--hw-accent-soft);
}

.hw-button-sm {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 14px;
}

.hw-button-block {
  width: 100%;
}

.hw-link-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--bsft-color-primary);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.hw-link-button:hover:not(:disabled) {
  background: var(--hw-accent-soft);
  border-radius: 10px;
}

.hw-link-button:disabled {
  color: var(--bsft-color-muted);
}

/* Google's own button after its sign-in branding guidelines: the neutral surface with a 1px line, the unmodified
   full-colour "G" (18px) at the leading edge and the words centred on the button, dark text in light and the dark
   variant in dark. It takes the full width of the form it sits in, up to the 400px of a sign-in card (so it does not
   stretch across a wide settings card), and is 48px tall, so it weighs as much as the form's primary button; the
   corners follow Hauswerk's buttons. Three grid columns (mark, words, a mirror of
   the mark) keep the words centred on the button, not on the space next to the mark. */
.hw-google-button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 18px;
  align-items: center;
  column-gap: 12px;
  box-sizing: border-box;
  width: 100%;
  max-width: 400px;
  min-height: 48px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--hw-google-line);
  border-radius: 14px;
  background: var(--hw-google-surface);
  color: var(--hw-google-text);
  font-family: "Roboto", var(--hw-font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.hw-google-button:hover:not(:disabled) {
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);
}

.hw-google-mark {
  display: block;
  width: 18px;
  height: 18px;
}

.hw-google-button > span {
  overflow-wrap: anywhere;
}

/* "oder" between the Google button and the password form. */
.hw-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--bsft-color-muted);
  font-size: 14px;
}

.hw-or::before,
.hw-or::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--bsft-color-border);
}

/* A link button that opens a part in place ("Erledigt (3)") carries a chevron that turns while the part is open. */
.hw-link-button[aria-expanded] > .hw-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.hw-link-button[aria-expanded="true"] > .hw-icon {
  transform: rotate(180deg);
}

.hw-icon-button,
.hw-appbar-action {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--bsft-color-border);
  background: var(--bsft-color-surface);
  color: var(--bsft-color-text);
  text-decoration: none;
  cursor: pointer;
}

.hw-icon-button .hw-icon,
.hw-appbar-action .hw-icon {
  width: 19px;
  height: 19px;
}

.hw-icon-button svg:not(.hw-icon) {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hw-icon-button:hover:not(:disabled),
.hw-appbar-action:hover:not(:disabled) {
  background: var(--hw-surface-2);
}

/* One pressed look for every toggle (icon buttons, chips, pills): accent-soft surface, accent ink. */
.hw-icon-button[aria-pressed="true"],
.hw-icon-button[aria-pressed="true"]:hover:not(:disabled) {
  background: var(--hw-accent-soft);
  border-color: var(--bsft-color-primary);
  color: var(--bsft-color-primary);
}

.hw-icon-button-round {
  border-radius: 50%;
  color: var(--bsft-color-primary);
}

.hw-icon-button-danger {
  color: var(--bsft-color-danger);
}

/* The microphone of an entry field (the mock's .mic): accent-soft tile, critical and pulsing while it listens. A
   hold must not select text, open a context menu or scroll the page. */
.hw-voice {
  position: relative;
  display: inline-flex;
  flex: none;
}

.hw-icon-button-voice {
  width: 42px;
  height: 42px;
  border: 0;
  background: var(--hw-accent-soft);
  color: var(--bsft-color-primary);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.hw-icon-button-voice:hover:not(:disabled) {
  background: var(--hw-accent-soft);
}

.hw-icon-button-voice.is-listening,
.hw-icon-button-voice.is-listening:hover:not(:disabled) {
  background: var(--bsft-color-danger);
  color: #fff;
  animation: hw-voice-pulse 1s ease-in-out infinite;
}

.hw-icon-button-voice[aria-busy="true"] {
  opacity: 0.6;
}

@keyframes hw-voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bsft-color-danger) 45%, transparent); }
  50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--bsft-color-danger) 0%, transparent); }
}

/* The recording status ("Ich höre zu …") is a bubble directly above the field, never at the bottom edge where the tab
   bar or the keyboard would cover it. Inside an entry field it is anchored to the whole field, pointing at the
   microphone. */
.hw-voice-message {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  z-index: 5;
  width: max-content;
  max-width: min(280px, calc(100vw - 48px));
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bsft-color-text);
  color: var(--bsft-color-surface);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.hw-voice-message::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 15px;
  border: 6px solid transparent;
  border-top-color: var(--bsft-color-text);
}

.hw-entry .hw-voice {
  position: static;
}

.hw-entry .hw-voice-message {
  bottom: calc(100% + 8px);
  right: 4px;
}

/* The recording bar above the field (VoiceRecordingBar): a red dot and the time while recording, the slide hint while
   held, the level with discard and send once hands-free. Inside an entry field it spans the whole field. */
.hw-voice-bar {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  min-height: 56px;
  padding: 6px 6px 6px 14px;
  border-radius: 16px;
  background: var(--bsft-color-surface);
  border: 1.5px solid var(--bsft-color-border);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.35);
  color: var(--bsft-color-text);
  animation: hw-fade 0.16s ease-out;
}

.hw-entry .hw-voice-bar {
  left: -1.5px;
  right: -1.5px;
  width: auto;
  bottom: calc(100% + 8px);
}

.hw-voice-bar-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bsft-color-danger);
  animation: hw-voice-blink 1s ease-in-out infinite;
}

.hw-voice-bar-time {
  flex: none;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.hw-voice-bar-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  color: var(--bsft-color-muted);
}

.hw-voice-bar-text.is-warn {
  flex: none;
  color: var(--bsft-color-danger);
  font-weight: 700;
}

.hw-voice-bar.is-interrupted .hw-voice-bar-text {
  color: var(--bsft-color-text);
  font-weight: 600;
}

.hw-voice-level {
  flex: 1 1 auto;
  min-width: 40px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--hw-surface-2);
}

.hw-voice-level > i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--bsft-color-primary);
  transform: scaleX(max(0.06, var(--hw-voice-level, 0.06)));
  transform-origin: left center;
  transition: transform 0.08s linear;
}

.hw-voice-bar .hw-voice-send {
  flex: none;
  min-height: 44px;
  gap: 6px;
}

/* While held, the lock target floats above the microphone: slide the finger onto it to go hands-free. */
.hw-voice-lock {
  position: absolute;
  right: 4px;
  bottom: calc(100% + 76px);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 42px;
  padding: 10px 0 6px;
  border-radius: 999px;
  background: var(--bsft-color-surface);
  border: 1.5px solid var(--bsft-color-border);
  color: var(--bsft-color-primary);
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.hw-voice-lock .hw-icon:last-child {
  transform: rotate(180deg);
  animation: hw-voice-rise 1.2s ease-in-out infinite;
}

@keyframes hw-voice-blink {
  50% { opacity: 0.3; }
}

@keyframes hw-voice-rise {
  0%, 100% { translate: 0 3px; }
  50% { translate: 0 -3px; }
}

@media (prefers-reduced-motion: reduce) {
  .hw-voice-bar-dot,
  .hw-voice-lock .hw-icon:last-child {
    animation: none;
  }
}

.hw-seg,
.bsft-theme-switcher,
.bsft-locale-switcher {
  display: inline-flex;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bsft-color-surface);
  border: 1px solid var(--bsft-color-border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.bsft-theme-switcher,
.bsft-locale-switcher {
  flex-wrap: wrap;
}

/* The framework rounds only the outer corners of its first and last option, with a higher specificity than a plain
   class; here every option is its own thumb inside the track. */
.hw-seg > button,
.hw-seg > a,
.bsft-theme-switcher > .bsft-theme-option,
.bsft-locale-switcher > .bsft-locale-option {
  flex: none;
  min-height: 38px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--bsft-color-muted);
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
}

.hw-seg > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.hw-seg > a:hover:not([aria-selected="true"]),
.hw-seg > button:hover:not([aria-pressed="true"]):not([aria-selected="true"]):not(:disabled) {
  color: var(--bsft-color-text);
}

.hw-seg > button[aria-pressed="true"],
.hw-seg > [aria-selected="true"],
.bsft-theme-switcher > .bsft-theme-option[aria-pressed="true"],
.bsft-locale-switcher > .bsft-locale-option[aria-pressed="true"] {
  background: var(--bsft-color-primary);
  color: var(--bsft-color-primary-contrast);
  font-weight: 700;
}

.hw-seg-sm > button {
  min-height: 34px;
  padding: 4px 12px;
  font-size: 13px;
}

.hw-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--bsft-color-border);
  background: var(--bsft-color-surface);
  color: var(--bsft-color-text);
  font-size: 14px;
  cursor: pointer;
}

.hw-pill:hover:not(:disabled) {
  border-color: var(--bsft-color-primary);
}

.hw-pill[aria-pressed="true"] {
  background: var(--hw-accent-soft);
  border-color: var(--bsft-color-primary);
  color: var(--bsft-color-primary);
  font-weight: 700;
}

button.hw-chip {
  min-height: 36px;
  padding: 4px 12px;
  font-size: 14px;
  cursor: pointer;
}

button.hw-chip:hover:not(:disabled) {
  border-color: var(--bsft-color-primary);
}

.hw-chip[aria-pressed="true"] {
  background: var(--hw-accent-soft);
  color: var(--bsft-color-primary);
  border-color: var(--bsft-color-primary);
  font-weight: 700;
}

/* The remove cross inside a chip: a small glyph without a surface, whose touch target reaches beyond it through an
   invisible layer, so the chip keeps its size. */
.hw-chip-remove {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0 -2px 0 2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--bsft-color-muted);
  cursor: pointer;
}

.hw-chip-remove::after {
  content: "";
  position: absolute;
  inset: -11px -6px;
}

.hw-chip-remove .hw-icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.5;
}

.hw-chip-remove:hover:not(:disabled) {
  color: var(--bsft-color-text);
}

.hw-chip-remove:focus-visible {
  outline-offset: 1px;
}

.hw-chip-remove:disabled {
  opacity: 0.45;
  cursor: default;
}

.hw-chip-add {
  color: var(--bsft-color-primary);
  font-weight: 700;
}

.hw-tool-button {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--bsft-color-border);
  background: var(--bsft-color-surface);
  color: var(--bsft-color-text);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.hw-tool-button:hover:not(:disabled) {
  background: var(--hw-surface-2);
}

.hw-tool-button[aria-expanded="true"] {
  border-color: var(--bsft-color-primary);
  color: var(--bsft-color-primary);
}

.hw-entry-add {
  flex: none;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--bsft-color-primary);
  color: var(--bsft-color-primary-contrast);
  font-weight: 700;
  cursor: pointer;
}

.hw-entry-add:disabled {
  background: var(--hw-surface-2);
  color: var(--bsft-color-muted);
}

:is(.bsft-button, .hw-icon-button, .hw-appbar-action, .hw-pill, button.hw-chip, .hw-tool-button, .hw-entry-add, .hw-google-button):active:not(:disabled) {
  transform: translateY(1px);
}

:is(.bsft-button, .hw-icon-button, .hw-appbar-action, .hw-seg > button, .hw-pill, button.hw-chip, .hw-tool-button, .hw-google-button):disabled,
.bsft-button.is-disabled {
  opacity: 0.45;
  filter: none;
  cursor: default;
}

.bsft-button.is-disabled {
  pointer-events: none;
}

/* --- quantities --------------------------------------------------------------- */

.hw-qty {
  font-family: var(--hw-font-mono);
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
