/* ---------------------------------------------------------------------------
   Shopping — Material 3 flavoured design tokens
   --------------------------------------------------------------------------- */

:root {
  --primary: #386a20;
  --on-primary: #ffffff;
  --primary-container: #b8f397;
  --on-primary-container: #0b2000;
  --secondary-container: #dce5d5;
  --on-secondary-container: #161e12;
  --surface: #fcfdf6;
  --surface-container: #f0f2e9;
  --surface-container-high: #eaece3;
  --surface-container-highest: #e4e6dd;
  --on-surface: #1a1c18;
  --on-surface-variant: #43483e;
  --outline: #73796d;
  --outline-variant: #c3c8bb;
  --error: #b3261e;
  --on-error: #ffffff;
  --error-container: #f9dedc;
  --on-error-container: #410e0b;
  --inverse-surface: #2f312a;
  --inverse-on-surface: #f1f1e9;
  --inverse-primary: #9cd67d;
  --backdrop: #e6e8df;
  --banner-bg: #ffedc2;
  --banner-fg: #4a3600;
  --online: #2e8b3d;
  --hairline: rgba(115, 121, 109, 0.22);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.14), 0 1px 3px 1px rgba(0, 0, 0, 0.08);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.18);
  --appbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --primary: #9cd67d;
    --on-primary: #0b3900;
    --primary-container: #215109;
    --on-primary-container: #b8f397;
    --secondary-container: #3c4a34;
    --on-secondary-container: #dce5d5;
    --surface: #11140e;
    --surface-container: #1d211a;
    --surface-container-high: #272b23;
    --surface-container-highest: #32362d;
    --on-surface: #e2e3db;
    --on-surface-variant: #c3c8bb;
    --outline: #8d9387;
    --outline-variant: #43483e;
    --error: #ffb4ab;
    --on-error: #690005;
    --error-container: #93000a;
    --on-error-container: #ffdad6;
    --inverse-surface: #e2e3db;
    --inverse-on-surface: #2f312a;
    --inverse-primary: #386a20;
    --backdrop: #090b06;
    --banner-bg: #3d2e00;
    --banner-fg: #ffe08a;
    --online: #7bd88a;
    --hairline: rgba(141, 147, 135, 0.26);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --primary: #9cd67d;
  --on-primary: #0b3900;
  --primary-container: #215109;
  --on-primary-container: #b8f397;
  --secondary-container: #3c4a34;
  --on-secondary-container: #dce5d5;
  --surface: #11140e;
  --surface-container: #1d211a;
  --surface-container-high: #272b23;
  --surface-container-highest: #32362d;
  --on-surface: #e2e3db;
  --on-surface-variant: #c3c8bb;
  --outline: #8d9387;
  --outline-variant: #43483e;
  --error: #ffb4ab;
  --on-error: #690005;
  --error-container: #93000a;
  --on-error-container: #ffdad6;
  --inverse-surface: #e2e3db;
  --inverse-on-surface: #2f312a;
  --inverse-primary: #386a20;
  --backdrop: #090b06;
  --banner-bg: #3d2e00;
  --banner-fg: #ffe08a;
  --online: #7bd88a;
  --hairline: rgba(141, 147, 135, 0.26);
  color-scheme: dark;
}

/* ---------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------- */

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: Roboto, "Helvetica Neue", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--backdrop);
  color: var(--on-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

#app {
  position: relative;
  max-width: 640px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--surface);
}

button,
input {
  font-family: inherit;
}

button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

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

input:focus-visible {
  outline: none;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.icon {
  width: 24px;
  height: 24px;
  flex: none;
  display: block;
  fill: currentColor;
}

/* material ink ripple */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple .ink {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.16;
  transform: scale(0);
  pointer-events: none;
  animation: ink 0.55s cubic-bezier(0.2, 0, 0, 1) forwards;
}

@keyframes ink {
  to {
    opacity: 0;
    transform: scale(1);
  }
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.12s, background-color 0.2s;
}

.button.filled {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-1);
}

.button.filled:active {
  box-shadow: none;
  transform: scale(0.99);
}

.button.large {
  width: 100%;
  height: 56px;
  font-size: 16px;
}

.button[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

.text-button {
  border: 0;
  background: transparent;
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
}

.text-button.small {
  padding: 6px 12px;
  font-size: 13px;
}

.text-button.danger {
  color: var(--error);
}

.text-button.inline {
  display: inline;
  padding: 4px 4px;
}

.icon-button {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
}

.icon-button.small {
  width: 40px;
  height: 40px;
}

.icon-button .icon {
  width: 22px;
  height: 22px;
}

/* ---------------------------------------------------------------------------
   Splash
   --------------------------------------------------------------------------- */

.loading-view {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 24px;
  background: var(--surface);
}

.brand-mark {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  display: block;
  box-shadow: 0 10px 30px rgba(19, 45, 8, 0.22);
}

.loading-bar {
  width: 84px;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-container-high);
  overflow: hidden;
}

.loading-bar span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 2px;
  background: var(--primary);
  animation: load-slide 1.1s ease-in-out infinite;
}

@keyframes load-slide {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(260%);
  }
}

/* ---------------------------------------------------------------------------
   Auth
   --------------------------------------------------------------------------- */

.auth-view {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: calc(28px + env(safe-area-inset-top)) 24px calc(28px + env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 55% at 50% 0%, var(--primary-container) 0%, transparent 68%),
    var(--surface);
}

.auth-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.auth-hero h1 {
  margin: 6px 0 0;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.auth-form {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-form h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.auth-form .button.large {
  margin-top: 22px;
}

.auth-switch {
  margin: 14px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--on-surface-variant);
}

.form-error {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--error-container);
  color: var(--on-error-container);
  font-size: 14px;
  line-height: 1.4;
}

/* ---------------------------------------------------------------------------
   Text fields
   --------------------------------------------------------------------------- */

.field {
  position: relative;
  margin-top: 16px;
}

.field input {
  width: 100%;
  height: 56px;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid var(--outline);
  border-radius: 12px;
  background: transparent;
  padding: 18px 16px 4px;
  color: var(--on-surface);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus {
  border-color: var(--primary);
  border-width: 2px;
  padding-left: 15px;
}

.field label {
  position: absolute;
  left: 12px;
  top: 50%;
  padding: 0 4px;
  transform: translateY(-50%);
  background: var(--field-label-bg, var(--surface));
  color: var(--on-surface-variant);
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  transition: top 0.15s ease, font-size 0.15s ease, color 0.15s ease;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: 0;
  font-size: 12px;
}

.field input:focus + label {
  color: var(--primary);
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row .field {
  flex: 1;
  min-width: 0;
}

.field-row .grow-2 {
  flex: 2;
}

.password-field input {
  padding-right: 52px;
}

.password-field .icon-button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.password-field .icon {
  width: 21px;
  height: 21px;
}

/* ---------------------------------------------------------------------------
   App bar + list
   --------------------------------------------------------------------------- */

.list-view {
  min-height: 100dvh;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: calc(var(--appbar-h) + env(safe-area-inset-top));
  padding: calc(env(safe-area-inset-top) + 10px) 8px 10px 20px;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.appbar.scrolled {
  border-bottom-color: var(--hairline);
}

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

.appbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.appbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}

.presence-pill {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 2px;
  margin-right: 2px;
  border: 0;
  border-radius: 999px;
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  cursor: pointer;
}

.presence-pill.multi {
  padding-right: 10px;
}

.presence-avatars {
  display: flex;
  align-items: center;
}

.presence-avatars .avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
  border: 2px solid var(--secondary-container);
}

.presence-avatars .avatar + .avatar {
  margin-left: -9px;
}

.presence-more {
  padding-left: 5px;
  font-size: 12px;
  font-weight: 600;
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  overflow: hidden;
}

.main {
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 16px 2px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--banner-bg);
  color: var(--banner-fg);
  font-size: 13px;
  line-height: 1.4;
}

.banner .icon {
  width: 20px;
  height: 20px;
}

.group-head {
  position: sticky;
  top: calc(env(safe-area-inset-top) + var(--appbar-h));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 6px;
  background: var(--surface);
}

.group-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface-variant);
}

.group-head .text-button {
  margin-left: auto;
}

.count {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

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

.item {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--surface);
  scroll-margin-bottom: calc(96px + env(safe-area-inset-bottom));
}

.item.swiping {
  z-index: 2;
}

.item-swipe-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 26px;
  background: var(--error);
  color: var(--on-error);
  opacity: 0;
  transition: opacity 0.12s;
}

.item-swipe-bg .icon {
  width: 26px;
  height: 26px;
}

.item-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 64px;
  padding-right: 20px;
  background: var(--surface);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.24s cubic-bezier(0.2, 0, 0, 1);
  will-change: transform;
}

.item.swiping .item-content {
  transition: none;
}

.item-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 72px;
  right: 0;
  height: 1px;
  background: var(--hairline);
  pointer-events: none;
}

.items .item:first-child .item-content::before {
  display: none;
}

.item.removing .item-content {
  transform: translateX(-100%) !important;
  transition: transform 0.18s cubic-bezier(0.2, 0, 0, 1);
}

.item.removing .item-swipe-bg {
  opacity: 1;
}

.check {
  flex: none;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--outline);
  cursor: pointer;
}

.check .box {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid var(--outline);
  border-radius: 50%;
  background: transparent;
  transition: background-color 0.18s, border-color 0.18s, transform 0.18s;
}

.check .tick {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: var(--on-primary);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
  transition: stroke-dashoffset 0.18s ease 0.05s;
}

.check:active .box {
  transform: scale(0.9);
}

.item.done .check .box {
  background: var(--primary);
  border-color: var(--primary);
}

.item.done .check .tick {
  stroke-dashoffset: 0;
}

.item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.item-name {
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.item.done .item-name {
  color: var(--on-surface-variant);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  color: var(--on-surface-variant);
}

.item-meta:empty {
  display: none;
}

.qty {
  flex: none;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

.note {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-enter {
  animation: item-in 0.22s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes item-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

body.overlay-open {
  overflow: hidden;
}

.shake {
  animation: shake 0.3s ease;
}

@keyframes shake {
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

.inline-empty {
  margin: 0;
  padding: 18px 20px 8px;
  font-size: 14px;
  color: var(--on-surface-variant);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 40px 32px 24px;
  text-align: center;
  color: var(--on-surface-variant);
}

.empty-art {
  width: 112px;
  height: 112px;
  margin-bottom: 6px;
}

.empty-art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.empty-art .bag {
  fill: var(--primary-container);
}

.empty-art .stroke {
  fill: none;
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-art .dot {
  fill: var(--primary);
}

.empty-art .dot-faint {
  fill: var(--outline);
}

.empty-state h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  color: var(--on-surface);
}

.empty-state p {
  max-width: 28ch;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

/* ---------------------------------------------------------------------------
   Composer
   --------------------------------------------------------------------------- */

.composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  max-width: 640px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-top: 1px solid var(--hairline);
}

.composer-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 1px solid transparent;
  border-radius: 24px;
  background: var(--surface-container-high);
  padding: 0 18px;
  color: var(--on-surface);
  font-size: 16px;
  outline: none;
  transition: border-color 0.18s, background-color 0.18s;
}

.composer-input::placeholder {
  color: var(--on-surface-variant);
}

.composer-input:focus {
  border-color: var(--primary);
  background: var(--surface-container-highest);
}

.fab {
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-2);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s;
}

.fab:active {
  transform: scale(0.94);
  box-shadow: var(--shadow-1);
}

.fab .icon {
  width: 26px;
  height: 26px;
}

/* ---------------------------------------------------------------------------
   Sheets, scrim, dialog
   --------------------------------------------------------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  transition: opacity 0.25s;
}

.scrim.visible {
  opacity: 1;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  max-width: 640px;
  max-height: 92dvh;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
  border-radius: 28px 28px 0 0;
  background: var(--surface-container);
  box-shadow: 0 -10px 44px rgba(0, 0, 0, 0.3);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
  will-change: transform;
  --field-label-bg: var(--surface-container);
}

.sheet.open {
  transform: translateY(0);
}

.sheet-handle {
  flex: none;
  width: 32px;
  height: 4px;
  margin: 10px auto 2px;
  border-radius: 2px;
  background: var(--outline-variant);
}

.sheet-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 4px 24px;
}

.sheet-head h2 {
  flex: 1;
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.sheet-body {
  padding: 4px 24px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet-caption {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--on-surface-variant);
}

.sheet-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 22px;
}

.flex-spacer {
  flex: 1;
}

.menu-section {
  padding: 14px 4px 4px;
}

.menu-label {
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--on-surface-variant);
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--on-surface);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.menu-row .icon {
  color: var(--on-surface-variant);
}

.menu-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.menu-row-text > span {
  font-size: 15px;
}

.menu-row-text small {
  overflow: hidden;
  color: var(--on-surface-variant);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.menu-row:active {
  background: color-mix(in srgb, var(--on-surface) 8%, transparent);
}

.segmented {
  display: flex;
  gap: 2px;
  margin-top: 8px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-container-high);
}

.segmented button {
  flex: 1;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--on-surface-variant);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.18s, color 0.18s, box-shadow 0.18s;
}

.segmented button[aria-checked="true"] {
  background: var(--surface);
  color: var(--on-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
}

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

.person-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 4px;
}

.person-row .avatar {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.person-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.person-info > span {
  overflow: hidden;
  font-size: 15px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.person-info small {
  font-size: 12px;
  color: var(--on-surface-variant);
}

.person-status {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-size: 12px;
  color: var(--on-surface-variant);
}

.dot-idle,
.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--outline-variant);
}

.dot-live {
  background: var(--online);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--online) 22%, transparent);
}

.dialog {
  position: fixed;
  inset: 0;
  z-index: 95;
  width: min(88vw, 360px);
  height: fit-content;
  margin: auto;
  padding: 24px;
  border-radius: 28px;
  background: var(--surface-container-high);
  color: var(--on-surface);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.36);
  animation: dialog-in 0.18s cubic-bezier(0.2, 0, 0, 1);
}

.dialog h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 500;
}

.dialog p {
  margin: 0;
  color: var(--on-surface-variant);
  font-size: 14px;
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 22px;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
}

/* ---------------------------------------------------------------------------
   Snackbar
   --------------------------------------------------------------------------- */

.snackbar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  z-index: 70;
  max-width: 592px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 8px 12px 16px;
  border-radius: 10px;
  background: var(--inverse-surface);
  color: var(--inverse-on-surface);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  font-size: 14px;
  animation: snack-in 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.snackbar > span {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.snackbar-action {
  flex: none;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 8px 12px;
  color: var(--inverse-primary);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}

@keyframes snack-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ---------------------------------------------------------------------------
   Desktop / tablet
   --------------------------------------------------------------------------- */

@media (min-width: 680px) {
  body {
    padding: 0;
  }

  #app {
    box-shadow: 0 0 0 1px var(--hairline);
  }

  .sheet {
    border-radius: 28px;
    bottom: 24px;
    max-height: 80dvh;
  }

  .composer {
    border-radius: 24px 24px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
