:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-subtle: #f1f5f9;
  --border: #e5e7eb;
  --border-strong: #dbe4ee;
  --text: #0f172a;
  --muted: #64748b;
  --muted-soft: #94a3b8;
  --primary: #6366f1;
  --primary-strong: #4f46e5;
  --secondary: #10b981;
  --danger: #ef4444;
  --danger-strong: #dc2626;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.06);
  --radius-xl: 24px;
  --radius-lg: 18px;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #020617;
  --surface: #0f172a;
  --surface-muted: #020617;
  --surface-subtle: #111827;
  --border: #1e293b;
  --border-strong: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-soft: #64748b;
  --primary: #818cf8;
  --primary-strong: #6366f1;
  --secondary: #34d399;
  --danger: #f87171;
  --danger-strong: #ef4444;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.24);
}

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

html {
  min-height: 100%;
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

a,
button,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

a:hover {
  color: var(--primary);
}

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

button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='search'],
textarea,
select {
  -webkit-appearance: none;
  appearance: none;
}

input[type='search']::-webkit-search-decoration,
input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-results-button,
input[type='search']::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type='number'] {
  -moz-appearance: textfield;
}

svg {
  display: block;
}

svg path,
svg circle,
svg line,
svg polyline {
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--line) 78%, white 22%);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  background: color-mix(in srgb, var(--surface-subtle) 82%, white 18%);
  color: var(--text);
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(99, 102, 241, 0.52);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

input:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

code {
  padding: 0.12rem 0.35rem;
  border-radius: 8px;
  background: var(--surface-subtle);
  font-size: 0.92em;
}

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

.http-warning {
  padding: 0.75rem 1rem;
  text-align: center;
  background: #991b1b;
  color: #fff;
  font-size: 0.95rem;
}

.gradient-title {
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 58%, var(--primary-strong) 100%);
  background-size: 165% 100%;
  background-position: 35% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted {
  color: var(--muted);
}

.public-layout {
  width: min(100%, 48rem);
  margin: 0 auto;
  padding: 1rem;
  min-height: calc(100vh - 52px);
  min-height: calc(100dvh - 52px);
  display: grid;
  place-items: center;
}

.page-content {
  width: min(100%, 42rem);
  margin: 0 auto;
  padding: 1rem;
}

body.app-shell .page-content {
  width: min(100%, 82rem);
  padding-inline: clamp(1rem, 2vw, 1.75rem);
}

body.app-shell[data-page='index'] .page-content {
  width: min(100%, 70rem);
}

.card,
.page-card,
.subcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.card,
.page-card {
  padding: 1.5rem;
}

.subcard {
  padding: 1.25rem;
}

.auth-card {
  width: min(100%, 32rem);
}

.wide-card {
  width: min(100%, 48rem);
}

.auth-panel {
  display: grid;
  gap: 1.25rem;
}

.auth-brand-block {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 0.75rem;
}

.auth-brand-mark {
  width: clamp(5.2rem, 18vw, 7rem);
  height: auto;
}

.auth-brand {
  margin: 0;
  font-size: clamp(2rem, 5.6vw, 2.8rem);
  line-height: 1;
  font-weight: 800;
}

.auth-subtitle {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-style: italic;
  font-size: 0.92rem;
}

.card-head {
  display: grid;
  gap: 0.35rem;
}

.compact-card-head h2,
.card-head h1,
.section-copy h2,
.page-card h2,
.modal-head h2 {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.45rem);
  line-height: 1.15;
}

.compact-card-head p,
.section-copy p,
.card-head p {
  margin: 0;
}

.stack-form,
.stack-gap,
.profile-grid,
.share-grid,
.list-detail-screen,
.items-section,
.members-list,
.history-list,
.preview-list {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.45rem;
}

label > span {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.grid-two,
.share-grid,
.profile-grid {
  display: grid;
  gap: 1rem;
}

.auth-links-row,
.card-links {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.92rem;
  color: var(--muted);
}

.invite-actions,
.notification-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.notification-controls {
  width: 100%;
  display: grid;
  gap: 0.65rem;
  align-items: stretch;
}

.notification-status {
  color: var(--muted);
  font-size: 0.92rem;
}

.notification-preferences {
  display: grid;
  gap: 0.22rem;
  width: 100%;
}

.notification-schedule {
  display: grid;
  gap: 0.7rem;
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 78%, var(--surface-subtle));
}

.notification-schedule-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.notification-schedule-field {
  display: grid;
  gap: 0.38rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.notification-schedule-field select {
  width: 100%;
}

.notification-schedule-hint {
  margin: 0;
  font-size: 0.85rem;
}

.switch-row {
  width: 100%;
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

.switch-control {
  position: relative;
  width: 3.2rem;
  height: 1.9rem;
  display: inline-flex;
  align-items: center;
}

.switch-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.switch-slider {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted-soft) 40%, var(--surface-subtle));
  transition: background-color 0.2s ease;
}

.switch-slider::after {
  content: '';
  position: absolute;
  top: 0.2rem;
  left: 0.22rem;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}

.switch-control input:checked + .switch-slider {
  background: var(--primary);
}

.switch-control input:checked + .switch-slider::after {
  transform: translateX(1.3rem);
}

@media (max-width: 640px) {
  .notification-schedule-range {
    grid-template-columns: 1fr;
  }
}

.switch-control input:disabled + .switch-slider {
  opacity: 0.55;
}

.notification-pref {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.35rem;
  padding: 0.42rem 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

.notification-pref input {
  width: auto;
  margin: 0;
  accent-color: var(--primary);
}

.notification-pref span {
  font-size: 0.88rem;
  font-weight: 600;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.checkbox-row input {
  width: auto;
  accent-color: var(--primary);
}

.primary-button,
.secondary-button,
.ghost-button,
.chip-button,
.danger-fill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0.85rem 1.1rem;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.chip-button:hover,
.danger-fill-button:hover,
.fab-add-list:hover,
.add-bar-submit:hover,
.menu-button:hover,
.header-share-button:hover,
.modal-close:hover,
.icon-button:hover,
.mini-icon-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.25);
}

.primary-button:hover {
  background: var(--primary-strong);
}

.secondary-button,
.ghost-button,
.chip-button {
  background: var(--surface-subtle);
  color: var(--text);
  border-color: transparent;
}

.secondary-button:hover,
.ghost-button:hover,
.chip-button:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary);
}

.danger-fill-button {
  background: var(--danger);
  color: #fff;
}

.danger-fill-button:hover {
  background: var(--danger-strong);
}

.flash,
.success-panel,
.info-panel {
  border-radius: 18px;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
}

.flash {
  margin-bottom: 1rem;
}

.flash-success,
.success-panel {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.18);
}

.flash-info,
.info-panel {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.16);
}

.flash-error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.18);
}

.app-layout {
  min-height: 100vh;
  min-height: 100dvh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-left,
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.header-actions {
  flex-shrink: 0;
}

.menu-button,
.modal-close,
.menu-close,
.field-icon-button,
.icon-button,
.mini-icon-button {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.menu-button:hover,
.modal-close:hover,
.menu-close:hover,
.field-icon-button:hover,
.icon-button:hover,
.mini-icon-button:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.menu-button svg,
.modal-close svg,
.menu-close svg {
  width: 1.35rem;
  height: 1.35rem;
}

.header-left {
  flex: 1 1 auto;
  min-width: 0;
}

.header-title-wrap {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  flex: 1 1 auto;
  width: 100%;
}

.header-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  width: 100%;
}

.header-title-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-left: 0;
  justify-content: flex-end;
  justify-self: end;
}

.header-icon-button,
.header-list-menu > summary {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted);
  padding: 0;
}

.header-title {
  margin: 0;
  flex: 1 1 auto;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.1;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-icon-button:hover,
.header-list-menu > summary:hover {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
}

.header-icon-button svg,
.header-list-menu > summary svg {
  width: 1.05rem;
  height: 1.05rem;
}

.shared-members-button {
  width: 2rem;
  min-width: 2rem;
  padding: 0;
}

[hidden] {
  display: none !important;
}

.drawer-shell {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.52);
  backdrop-filter: blur(3px);
  border: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.drawer-panel {
  position: relative;
  width: min(18rem, calc(100vw - 3rem));
  max-width: 18rem;
  height: 100%;
  padding: 1.4rem 1rem 1rem;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.24s ease;
}

body.drawer-open .drawer-shell {
  pointer-events: auto;
}

body.drawer-open .drawer-panel {
  transform: translateX(0);
}

body.drawer-open .drawer-backdrop {
  opacity: 1;
}

.drawer-head,
.drawer-theme-row,
.share-page-head,
.panel-head,
.section-title-row,
.member-row,
.history-row,
.preview-row,
.link-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.drawer-head {
  margin-bottom: 1rem;
}

.drawer-head h2 {
  margin: 0;
  font-size: 1.3rem;
}

.drawer-scroll {
  flex: 1;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 0.3rem;
}

.drawer-link,
.drawer-list-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 40px;
  padding: 0.58rem 0.7rem;
  border-radius: 16px;
  color: var(--text);
  font-size: 0.9rem;
}

.drawer-link {
  border: 0;
  background: transparent;
  text-align: left;
}

.drawer-link svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.drawer-link:hover,
.drawer-list-link:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.drawer-link.is-active,
.drawer-list-link.is-active {
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary);
}

.drawer-divider {
  margin: 0.5rem 0 0.25rem;
  border-top: 1px solid var(--border);
}

.drawer-section-label {
  padding: 0.55rem 0.7rem 0.1rem;
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.drawer-list-links {
  display: grid;
  gap: 0.3rem;
  padding-left: 0;
}

.drawer-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.28rem;
}

.drawer-list-link {
  min-width: 0;
}

.drawer-list-name {
  min-width: 0;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-main-button {
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-subtle) 78%, transparent);
  color: var(--muted-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.drawer-main-button .button-icon {
  width: 0.92rem;
  height: 0.92rem;
}

.drawer-main-button:hover {
  background: color-mix(in srgb, var(--surface-subtle) 92%, transparent);
  color: var(--primary);
}

.drawer-main-button.is-main {
  border-color: rgba(99, 102, 241, 0.24);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 10px 22px rgba(99, 102, 241, 0.28);
}

.drawer-main-button.is-main .button-icon {
  width: 0.98rem;
  height: 0.98rem;
  filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.25));
}

.drawer-empty {
  padding: 0.7rem 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.drawer-foot {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 1rem;
}

.drawer-user-meta {
  display: grid;
  gap: 0.2rem;
}

.drawer-user-name {
  font-weight: 700;
}

.drawer-user-email {
  color: var(--muted);
  font-size: 0.92rem;
}

.drawer-theme-row {
  background: var(--surface-subtle);
  padding: 0.25rem;
  border-radius: 999px;
}

.theme-toggle-pill {
  min-height: 36px;
  padding: 0 0.95rem;
  border-radius: 999px;
  border: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.drawer-link.drawer-danger {
  border: 0;
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  justify-content: center;
}

.drawer-link.drawer-install {
  border: 1px solid rgba(52, 211, 153, 0.18);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.16), rgba(132, 204, 22, 0.16));
  color: var(--text);
  justify-content: center;
  font-weight: 700;
}

.drawer-link.drawer-install:hover {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.22), rgba(132, 204, 22, 0.22));
}

.page-content {
  padding-bottom: 6rem;
}

.list-detail-screen {
  gap: 0.45rem;
}

.add-bar {
  position: sticky;
  top: 4.4rem;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}

.add-bar-field {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0.7rem 0.8rem;
  box-shadow: none;
}

.add-bar-qty {
  width: 4rem;
  flex: 0 0 4rem;
  text-align: center;
  padding-inline: 0.65rem;
}

.add-bar-submit,
.fab-add-list {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 14px 28px rgba(99, 102, 241, 0.3);
}

.add-bar-submit svg,
.fab-add-list svg {
  width: 1.35rem;
  height: 1.35rem;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
}

.connection-pill.is-offline {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.items-section {
  gap: 0.45rem;
}

.bought-block {
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
}

.bought-block.is-recently-updated {
  animation: bought-section-pulse 0.65s ease;
}

.section-title-row h2 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.section-title-group {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.section-badge {
  min-width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.55rem;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.section-badge.is-updated {
  animation: bought-badge-pop 0.55s ease;
}

.items-list {
  display: grid;
  gap: 0.22rem;
}

.item-group {
  border-radius: 14px;
  overflow: hidden;
}

.group-toggle {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 0.8rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text);
  font-weight: 600;
}

.group-toggle-label {
  color: var(--muted);
  font-size: 0.88rem;
}

.group-items {
  display: grid;
  gap: 0.35rem;
  padding-top: 0.35rem;
}

.group-items.is-collapsed {
  display: none;
}

.item-row {
  position: relative;
  display: grid;
  grid-template-columns: 1.82rem minmax(0, 1fr) minmax(4.6rem, auto) auto;
  gap: 0.5rem;
  align-items: center;
  min-height: 2.9rem;
  padding: 0.34rem 0.52rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: none;
}

.item-row.is-important {
  border-left: 4px solid #ef1d48;
}

.item-row.is-bought {
  background: color-mix(in srgb, var(--surface) 86%, var(--surface-subtle));
}

.item-row.is-recently-bought {
  border-color: color-mix(in srgb, var(--secondary) 58%, var(--border) 42%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--secondary) 22%, transparent);
  animation: bought-item-highlight 2.1s ease;
}

.item-check {
  width: 1.58rem;
  height: 1.58rem;
  border-radius: 999px;
  border: 2.5px solid color-mix(in srgb, var(--muted-soft) 45%, transparent);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 0;
}

.item-check .button-icon {
  width: 0.96rem;
  height: 0.96rem;
  opacity: 0;
}

.item-row.is-bought .item-check {
  background: var(--secondary);
  border-color: var(--secondary);
}

.item-row.is-bought .item-check .button-icon {
  opacity: 1;
}

@keyframes bought-item-highlight {
  0% {
    border-color: color-mix(in srgb, var(--secondary) 90%, white 10%);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--secondary) 0%, transparent);
  }

  18% {
    border-color: color-mix(in srgb, var(--secondary) 78%, var(--border) 22%);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--secondary) 20%, transparent);
  }

  100% {
    border-color: var(--border);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--secondary) 0%, transparent);
  }
}

@keyframes bought-badge-pop {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.14);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes bought-section-pulse {
  0% {
    transform: translateY(0);
  }

  35% {
    transform: translateY(-1px);
  }

  100% {
    transform: translateY(0);
  }
}

.item-main {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
}

.item-name-button {
  width: auto;
  max-width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: inherit;
  display: inline-flex;
  min-width: 0;
}

.item-name-text {
  display: block;
  font-size: 1.12rem;
  font-weight: 400;
  line-height: 1.22;
  word-break: break-word;
}

.item-row.is-bought .item-name-text {
  color: var(--muted);
  text-decoration: line-through;
}

.item-qty {
  min-width: 4.6rem;
  display: flex;
  justify-content: flex-end;
  text-align: right;
  justify-self: stretch;
}

.item-qty.is-empty {
  visibility: hidden;
}

.item-qty-text {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.15;
  color: var(--muted);
  white-space: nowrap;
}

.item-inline-editor {
  width: 100%;
  display: flex;
  align-items: center;
}

.item-edit-prompt {
  min-height: 1.55rem;
  padding: 0 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 0.72rem;
}

.item-inline-name,
.item-inline-qty,
.add-item-modal-qty {
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--surface) 86%, white 14%);
  color: var(--text);
}

.item-inline-name {
  width: 100%;
  min-height: 2rem;
  padding: 0.2rem 0.45rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 400;
}

.item-inline-qty {
  width: 100%;
  min-width: 0;
  min-height: 2rem;
  padding: 0.2rem 0.35rem;
  border-radius: 10px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 500;
}

.item-actions,
.list-card-actions {
  display: flex;
  align-items: center;
  gap: 0.02rem;
  flex-shrink: 0;
}

.item-actions .icon-button {
  width: 2.08rem;
  height: 2.08rem;
}

.button-icon {
  width: 0.96rem;
  height: 0.96rem;
}

.info-button .button-icon {
  width: 1.08rem;
  height: 1.08rem;
}

.star-button {
  color: #cbd5e1;
}

.star-button.is-important {
  color: #ef1d48;
}

.star-button.is-important svg {
  fill: rgba(239, 29, 72, 0.26);
}

.save-button {
  color: #10b981;
}

.delete-button:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
}

.info-button.is-open {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.item-popover {
  position: absolute;
  right: 0.6rem;
  bottom: calc(100% + 0.45rem);
  z-index: 5;
  width: min(18rem, calc(100vw - 3rem));
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  color: var(--text);
}

.item-popover-arrow {
  position: absolute;
  right: 1rem;
  bottom: -0.35rem;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--surface);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
}

.empty-inline-state,
.empty-state,
.lists-empty-state {
  padding: 1.35rem 1rem;
  border-radius: 18px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
}

.empty-action-button {
  width: 100%;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.empty-action-button:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--primary);
}

.lists-screen {
  display: grid;
  gap: 1rem;
}

.screen-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.lists-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  align-items: start;
}

.lists-board.is-empty {
  grid-template-columns: 1fr;
}

.list-card {
  width: 100%;
  margin: 0;
}

.list-card.is-main-list {
  grid-column: 1 / -1;
}

.list-card-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.65rem;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.list-card.is-main-list .list-card-body {
  border-width: 2px;
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border) 45%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 22%, transparent);
}

.list-card-body:hover {
  transform: scale(1.01);
  box-shadow: var(--shadow);
}

.list-card-head {
  display: block;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  margin-bottom: 0.5rem;
}

.list-card-meta {
  min-width: 0;
  flex: 1;
}

.list-card-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 0.55rem;
}

.list-card-title-row h3 {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.18;
  min-width: 0;
  flex: 1 1 auto;
}

.list-card-side-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.32rem;
  flex-shrink: 0;
  justify-self: end;
}

.shared-dot {
  width: 0.5rem;
  height: 0.5rem;
  display: inline-block;
  border-radius: 999px;
  background: var(--primary);
}

.list-card-date {
  margin: 0.25rem 0 0;
  font-size: 0.68rem;
  color: var(--muted-soft);
}

.list-main-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.2rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  font-size: 0.64rem;
  font-weight: 700;
}

.mini-icon-button {
  width: 1.95rem;
  height: 1.95rem;
}

.list-preview {
  display: grid;
  gap: 0.28rem;
}

.list-preview-row {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  font-size: 0.79rem;
  line-height: 1.26;
  color: var(--text);
}

.preview-important-dot,
.preview-spacer {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  margin-top: 0.45rem;
  flex-shrink: 0;
}

.preview-important-dot {
  background: var(--danger);
}

.preview-spacer {
  background: transparent;
}

.list-preview-name {
  word-break: break-word;
}

.list-card-menu {
  flex-shrink: 0;
}

.header-list-menu {
  flex-shrink: 0;
}

.header-list-menu .card-menu-panel {
  right: 0;
  top: calc(100% + 0.35rem);
}

.list-preview-name.is-bought {
  color: var(--muted);
  text-decoration: line-through;
}

.list-empty-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
}

.drag-over .list-card-body {
  outline: 2px dashed rgba(99, 102, 241, 0.45);
}

.fab-add-list,
.fab-add-item {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  background: linear-gradient(90deg, var(--primary), var(--primary-strong));
  z-index: 32;
}

.fab-add-list {
  border-radius: 999px;
}

.fab-add-item {
  border-radius: 1rem;
}

.compact-modal-card {
  width: min(100%, 28rem);
}

.add-item-modal-field {
  font-size: 1rem;
}

#add-item-form {
  grid-template-columns: minmax(0, 1fr) minmax(11rem, 12.5rem);
  align-items: start;
}

#add-item-form .add-item-qty-stepper {
  grid-column: 2;
}

#add-item-form .add-item-unit-field {
  grid-column: 2;
  gap: 0.45rem;
}

#add-item-form .primary-button {
  grid-column: 1 / -1;
  width: 100%;
}

.add-item-modal-field {
  margin: 0;
}

.qty-stepper {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.25rem;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 86%, white 14%);
}

.qty-stepper-button {
  width: 2.1rem;
  height: 2.1rem;
  border: 0;
  border-radius: 10px;
  background: var(--surface-subtle);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qty-stepper-button:hover {
  background: color-mix(in srgb, var(--surface-subtle) 72%, var(--primary) 28%);
}

.qty-stepper-input {
  border: 0;
  box-shadow: none;
  background: transparent;
}

.qty-stepper-input:focus {
  border: 0;
  box-shadow: none;
}

.add-item-modal-qty {
  min-height: 2.2rem;
  padding: 0.3rem 0.25rem;
  border-radius: 14px;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
}

.add-item-modal-unit {
  min-height: 2.2rem;
  padding: 0.3rem 0.25rem;
  border-radius: 14px;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
}

.unit-switcher-input {
  cursor: pointer;
  user-select: none;
  text-align: center;
  text-align-last: center;
  text-transform: none;
}

.field-with-unit {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.field-with-unit input {
  flex: 0 1 7rem;
}

.history-minutes-stepper {
  flex: 0 1 11rem;
}

.field-unit-text {
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

.members-actions {
  display: flex;
  justify-content: flex-end;
}

.card-menu {
  position: relative;
}

.card-menu > summary {
  list-style: none;
}

.card-menu > summary::-webkit-details-marker {
  display: none;
}

.card-menu-panel {
  position: absolute;
  top: calc(100% + 0.3rem);
  right: 0;
  min-width: 11rem;
  max-width: min(14rem, calc(100vw - 1.5rem));
  display: grid;
  gap: 0.15rem;
  padding: 0.35rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 8;
}

.card-menu-button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.25rem;
  padding: 0.45rem 0.55rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.card-menu-button:hover {
  background: var(--surface-subtle);
}

.card-menu-button.delete-tone {
  color: var(--danger);
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-shell[hidden] {
  display: none;
}

.modal-shell-top-mobile {
  align-items: flex-start;
}

.modal-shell-top-edge {
  align-items: flex-start;
  justify-content: center;
  padding-top: calc(env(safe-area-inset-top, 0px) + 0.35rem);
  padding-bottom: 20vh;
}

.modal-shell-top-edge .modal-card {
  margin-top: 0;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  width: min(100%, 32rem);
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.15rem;
}

.modal-head h2 {
  flex: 1 1 auto;
}

.modal-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.list-modal-form {
  display: grid;
  gap: 0.9rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
}

.modal-actions > * {
  flex: 1;
}

.lists-empty-icon {
  width: 6rem;
  height: 6rem;
  margin: 0 auto 0.85rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-subtle);
  color: var(--muted-soft);
}

.lists-empty-icon svg {
  width: 2.25rem;
  height: 2.25rem;
}

.share-page,
.profile-shell {
  display: grid;
  gap: 1rem;
}

.share-page-head,
.panel-head {
  flex-wrap: wrap;
}

.section-copy {
  display: grid;
  gap: 0.35rem;
}

.link-box {
  flex-wrap: wrap;
}

.link-box input {
  flex: 1;
  min-width: min(100%, 16rem);
}

.member-row,
.history-row,
.preview-row {
  padding: 0.7rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.member-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.member-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.78rem;
}

.member-name,
.history-title {
  font-weight: 700;
}

.tag,
.mini-danger-button {
  min-height: 2rem;
  padding: 0 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.tag {
  background: var(--surface-subtle);
  color: var(--muted);
}

.section-icon-button {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: var(--surface-subtle);
  color: var(--muted);
  padding: 0;
}

.section-icon-button svg {
  width: 1rem;
  height: 1rem;
}

.section-icon-button:hover {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
}

.mini-danger-button {
  border: 0;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.history-list {
  display: grid;
  gap: 0.4rem;
}

.history-search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: end;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--panel) 94%, var(--surface-subtle));
}

.history-search-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.history-search-field {
  display: grid;
  gap: 0.22rem;
  font-size: 0.74rem;
  color: var(--muted);
}

.history-search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.history-range-summary {
  display: grid;
  gap: 0.18rem;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  background: color-mix(in srgb, var(--surface-subtle) 72%, transparent);
}

.history-range-summary-title {
  color: var(--muted-soft);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.history-range-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  align-items: baseline;
}

.history-range-summary-value {
  font-size: 0.84rem;
  font-weight: 700;
}

.history-range-summary-count {
  font-size: 0.72rem;
  color: var(--muted);
}

.history-group {
  display: grid;
  gap: 0.3rem;
  padding: 0.5rem 0.7rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  background: color-mix(in srgb, var(--panel) 98%, var(--surface-subtle));
}

.history-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.history-group-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.history-group-title-row .history-title {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.2;
}

.history-group-subtitle {
  margin: 0;
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

.history-group-items {
  display: grid;
}

.history-line-row {
  display: grid;
  gap: 0.08rem;
  padding: 0.34rem 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  background: transparent;
}

.history-group-items .history-line-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.history-group-items .history-line-row:last-child {
  padding-bottom: 0;
}

.history-line-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem 0.4rem;
  align-items: center;
}

.history-line-date,
.history-line-time {
  font-size: 0.66rem;
  color: var(--muted);
}

.history-line-date {
  font-weight: 700;
}

.history-line-time {
  color: var(--muted-soft);
}

.history-line-item {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.24;
  font-size: 0.8rem;
  font-weight: 600;
}

.history-line-user {
  color: var(--muted-soft);
  font-size: 0.66rem;
  white-space: normal;
}

.history-card {
  display: grid;
  gap: 1rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.chip-button {
  min-height: 2.5rem;
  padding-inline: 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.chip-button.is-active {
  background: var(--text);
  color: var(--surface);
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap input {
  padding-right: 3rem;
}

.field-icon-button {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
}

.field-icon-button:hover,
.field-icon-button:focus-visible,
.field-icon-button:active {
  transform: translateY(-50%);
}

.field-icon-button.field-icon-button-plain {
  width: 1.9rem;
  height: 1.9rem;
  right: 0.7rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted-soft);
  line-height: 0;
}

.field-icon-button.field-icon-button-plain:hover,
.field-icon-button.field-icon-button-plain:focus-visible {
  background: transparent;
  color: var(--text);
}

.field-icon-button.field-icon-button-plain svg {
  width: 1.1rem;
  height: 1.1rem;
}

.field-icon-button .icon-eye-off {
  display: none;
}

.field-icon-button.is-active .icon-eye {
  display: none;
}

.field-icon-button.is-active .icon-eye-off {
  display: block;
}

.preview-list {
  gap: 0.75rem;
}

.admin-users-list {
  display: block;
}

.admin-users-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.admin-users-table {
  width: 100%;
  min-width: 54rem;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.admin-users-table th,
.admin-users-table td {
  padding: 0.42rem 0.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  text-align: left;
  vertical-align: middle;
}

.admin-users-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--panel) 96%, var(--surface-subtle));
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-users-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-toolbar {
  display: grid;
  gap: 0.5rem;
}

.admin-search-field {
  display: block;
}

.admin-search-field input {
  width: 100%;
}

.admin-toolbar-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.admin-user-row {
  background: transparent;
}

.admin-user-row.is-blocked {
  background: rgba(239, 68, 68, 0.05);
}

.admin-user-cell {
  min-width: 0;
}

.admin-user-cell-user {
  min-width: 13rem;
}

.admin-user-cell-date,
.admin-user-cell-number {
  white-space: nowrap;
}

.admin-user-cell-number {
  text-align: center;
}

.admin-user-cell-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.admin-user-name {
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1.2;
  word-break: break-word;
}

.admin-user-email {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.72rem;
  word-break: break-word;
}

.admin-user-menu {
  margin-left: 0;
}

.admin-user-menu-button {
  width: 2rem;
  height: 2rem;
}

.admin-user-menu .card-menu-panel {
  right: 0;
  left: auto;
  top: calc(100% + 0.3rem);
  min-width: 14rem;
}

.admin-mini-button {
  min-height: 2rem;
  padding: 0.38rem 0.62rem;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 600;
}

.admin-role-badge,
.admin-block-badge {
  min-height: 1.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-role-badge {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.admin-block-badge {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.admin-status-text {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.danger-soft-button {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.14);
  color: var(--danger);
}

.admin-user-stats {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--muted);
}

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.pagination-caption {
  font-size: 0.8rem;
  color: var(--muted);
}

.preview-row {
  font-size: 0.94rem;
}

.page-panel {
  padding: 1.5rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 90;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  padding: 0.7rem 0.9rem;
  border-radius: 16px;
  color: #fff;
  background: rgba(15, 23, 42, 0.92);
  box-shadow: var(--shadow);
  border: 1px solid transparent;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-success {
  color: #34d399;
  background: rgba(6, 78, 59, 0.92);
  border-color: rgba(52, 211, 153, 0.28);
}

.toast-error {
  background: rgba(239, 68, 68, 0.96);
}

@media (min-width: 980px) {
  body.app-shell[data-page='history'] .history-card,
  body.app-shell[data-page='admin'] .admin-card,
  body.app-shell[data-page='lists'] .lists-screen {
    gap: 1.25rem;
  }

  body.app-shell[data-page='admin'] .admin-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  body.app-shell[data-page='history'] .history-search-panel {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (min-width: 760px) {
  .grid-two,
  .share-grid,
  .profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1180px) {
  body.app-shell .page-content {
    width: min(100%, 88rem);
    padding-inline: clamp(1.25rem, 2vw, 2.25rem);
  }

  body.app-shell[data-page='index'] .page-content {
    width: min(100%, 74rem);
  }

  body.app-shell[data-page='profile'] .profile-grid,
  body.app-shell[data-page='settings'] .profile-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.25rem;
  }

  body.app-shell[data-page='profile'] .profile-grid > .page-card:first-child {
    grid-column: span 7;
  }

  body.app-shell[data-page='profile'] .profile-grid > .page-card:last-child {
    grid-column: span 5;
  }

  body.app-shell[data-page='settings'] .profile-grid > .page-card:first-child {
    grid-column: span 7;
  }

  body.app-shell[data-page='settings'] .profile-grid > .page-card:nth-child(2) {
    grid-column: span 5;
  }

  body.app-shell[data-page='settings'] .profile-grid > .page-card:nth-child(n + 3) {
    grid-column: span 6;
  }
}

@media (min-width: 1500px) {
  body.app-shell .page-content {
    width: min(100%, 96rem);
  }

}

@media (max-width: 759px) {
  .app-header {
    padding-inline: 0.85rem;
  }

  .header-title {
    max-width: none;
  }

  .add-bar {
    top: 4.8rem;
  }

  .lists-board {
    gap: 0.5rem;
  }

  .history-row,
  .member-row,
  .share-page-head,
  .admin-user-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-shell-top-mobile {
    align-items: flex-start;
    justify-content: center;
    padding-top: calc(env(safe-area-inset-top, 0px) + 0.75rem);
    padding-bottom: 20vh;
  }

  .modal-shell-top-mobile .modal-card {
    margin-top: 0;
  }

  .drawer-panel {
    padding: 1.15rem 0.85rem 0.85rem;
  }
}

@media (max-width: 560px) {
  .public-layout,
  .page-content {
    padding-inline: 0.85rem;
  }

  .card,
  .page-card,
  .subcard {
    padding: 1.2rem;
    border-radius: 22px;
  }

  .lists-board {
    gap: 0.45rem;
  }

  .modal-actions {
    flex-direction: column;
  }

  .invite-actions,
  .notification-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .add-bar {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .add-bar-field {
    grid-column: 1 / -1;
  }

  .item-row {
    grid-template-columns: 1.56rem minmax(0, 1fr) auto;
    grid-template-areas:
      "check main actions"
      "check qty actions";
    gap: 0.34rem;
    min-height: 2.34rem;
    padding: 0.22rem 0.3rem;
    align-items: start;
  }

  .item-check {
    grid-area: check;
    align-self: center;
  }

  .item-main {
    grid-area: main;
  }

  .item-qty {
    grid-area: qty;
    min-width: 0;
    width: 100%;
    justify-self: stretch;
    justify-content: flex-start;
    text-align: left;
  }

  .item-qty-text {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .item-inline-qty {
    width: min(100%, 5.25rem);
  }

  .item-actions {
    grid-area: actions;
    align-self: center;
  }

  .item-name-text {
    font-size: 0.98rem;
    line-height: 1.16;
  }

  .card-menu-panel {
    right: 0;
    min-width: min(11rem, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
  }

  .item-actions .icon-button {
    width: 1.98rem;
    height: 1.98rem;
  }

  .item-check {
    width: 1.28rem;
    height: 1.28rem;
  }

  .button-icon {
    width: 0.82rem;
    height: 0.82rem;
  }

  #add-item-form {
    grid-template-columns: 1fr;
  }

  #add-item-form .add-item-qty-stepper {
    grid-column: 1;
  }

  #add-item-form .add-item-unit-field {
    grid-column: 1;
  }

  .history-search-panel {
    grid-template-columns: 1fr;
  }

  .history-search-range {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .history-search-actions {
    width: 100%;
  }

  .history-search-actions .secondary-button,
  .history-search-actions .ghost-button {
    flex: 1 1 10rem;
  }

  .history-group {
    padding: 0.46rem 0.6rem;
  }

  .history-line-row {
    gap: 0.08rem;
    padding-block: 0.32rem;
  }

  .admin-user-stats {
    gap: 0.35rem;
  }

  .drawer-link,
  .drawer-list-link {
    padding-inline: 0.62rem;
    font-size: 0.86rem;
  }
}
