/* ==========================================================================
   Grement design system â€” dark theme (pass 1)
   Plain CSS, no Tailwind build needed. Loaded automatically by
   `stylesheet_link_tag :app`. Classes are prefixed `k-`.

   The last section ("Compatibility layer") re-colours the Tailwind utility
   classes still used by screens that haven't been redesigned yet, so the
   whole app is dark and consistent from day one. As screens get converted,
   rules in that section can be deleted.
   ========================================================================== */

   :root {
    --k-bg: #1F1F1F;
    --k-surface: #292929;
    --k-surface-2: #363636;
    --k-border: #343434;
    --k-border-strong: #4A4A4A;
    --k-text: #FFFFFF;
    --k-text-2: #D2D2D2;
    --k-muted: #A3A3A3;
    --k-faint: #A0A0A0;
    --k-ink: #FFFFFF;
    --k-on-ink: #1F1F1F;
    --k-danger: #FF7A7A;
    --k-danger-bg: rgba(255, 122, 122, 0.12);
    --k-success: #6FDC9C;
    --k-success-bg: rgba(111, 220, 156, 0.14);
    --k-radius: 18px;
    --k-font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --k-pink: linear-gradient(145deg, #F7C9B6, #E99BA8);
  }
  
  [hidden] { display: none !important; }
  
  html.k-dark { color-scheme: dark; background: var(--k-bg); }
  
  /* ---------- Base ---------- */
  .k-body {
    margin: 0;
    background: var(--k-bg);
    color: var(--k-text);
    font-family: var(--k-font);
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
  }
  
  .k-topbar { border-bottom: 1px solid var(--k-border); }
  .k-topbar__inner {
    max-width: 560px; margin: 0 auto; padding: 14px 24px;
    display: flex; align-items: center; justify-content: space-between;
  }
  .k-wordmark { font-weight: 600; font-size: 17px; color: var(--k-text); text-decoration: none; }
  .k-toplink { font-size: 14px; color: var(--k-muted); text-decoration: none; }
  .k-toplink:hover { color: var(--k-text); }
  
  .k-main { max-width: 560px; margin: 0 auto; padding: 28px 24px 56px; }
  /* Screens not yet redesigned wrap themselves in px-4; avoid double padding. */
  .k-main > .px-4 { padding-left: 0; padding-right: 0; }
  
  /* ---------- Typography ---------- */
  .k-title { font-size: 22px; font-weight: 600; line-height: 1.25; margin: 0; }
  .k-title--lg { font-size: 26px; margin-bottom: 20px; }
  .k-caption { font-size: 12px; line-height: 1.5; color: var(--k-muted); margin: 4px 0 0; }
  .k-section-title { font-size: 14px; font-weight: 600; margin: 28px 0 12px; }
  .k-empty { font-size: 14px; color: var(--k-muted); margin: 24px 0; }
  
  /* ---------- Header ---------- */
  .k-header { margin-bottom: 18px; }
  .k-header__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .k-owner { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 13px; font-weight: 500; color: var(--k-text); }
  .k-owner svg { color: var(--k-text); }
  .k-iconbtn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    background: var(--k-surface); border: 1px solid var(--k-border);
    color: var(--k-text-2); text-decoration: none;
  }
  .k-iconbtn:active { background: var(--k-surface-2); }
    
  /* ---------- Shared lists link ---------- */
  .k-sharelink {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; padding: 18px; border-radius: var(--k-radius);
    background: #fff; color: #1F1F1F; text-decoration: none;
    font-size: 16px; font-weight: 600;
  }
  .k-sharelink:active { opacity: 0.85; }

  /* ---------- Filter tiles ---------- */
  .k-tiles { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
  .k-tiles > .button_to { display: contents; }
  .k-tile {
    display: flex; flex-direction: column; align-items: center; gap: 8px; width: 64px;
    padding: 0; border: 0; background: none; cursor: pointer;
    font: inherit; color: var(--k-text); text-decoration: none;
  }
  .k-tile__box {
    width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
    background: var(--k-surface-2); transition: background 0.15s, color 0.15s, transform 0.1s;
  }
  .k-tile__label { font-size: 11px; font-weight: 600; line-height: 1.25; text-align: center; }
  .k-tile:active .k-tile__box { transform: scale(0.96); }
  .k-tile.is-active .k-tile__box { background: var(--k-ink); color: var(--k-on-ink); }
  .k-tile--danger .k-tile__box { color: var(--k-danger); }
  
  /* ---------- Search ---------- */
  .k-search { position: relative; margin-bottom: 16px; }
  .k-search__input {
    box-sizing: border-box; width: 100%; height: 52px; padding: 0 52px 0 20px;
    border-radius: 16px; border: 1px solid var(--k-border); background: transparent;
    color: var(--k-text); font: inherit; font-size: 16px; outline: none; -webkit-appearance: none;
  }
  .k-search__input::placeholder { color: var(--k-faint); }
  .k-search__input:focus { border-color: var(--k-border-strong); }
  .k-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
  .k-search__clear {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; display: grid; place-items: center; padding: 0;
    border: 0; background: none; color: var(--k-muted); cursor: pointer;
  }
  turbo-frame[busy] #items { opacity: 0.55; transition: opacity 0.15s; }
  .k-search__icon {
    position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
    color: var(--k-muted); pointer-events: none; display: flex;
  }
  
  /* ---------- Buttons ---------- */
  .k-actions { display: flex; gap: 10px; margin-bottom: 20px; }
  .k-actions .k-btn { flex: 1; }
  .k-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    box-sizing: border-box; min-height: 44px; padding: 12px 16px; border-radius: 14px; border: 1px solid transparent;
    background: var(--k-ink); color: var(--k-on-ink);
    font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
    text-decoration: none; cursor: pointer; transition: opacity 0.15s;
  }
  .k-btn:active { opacity: 0.85; }
  .k-btn--ghost { background: var(--k-surface); color: var(--k-text); border-color: var(--k-border); }
  .k-btn--danger { background: var(--k-danger); color: #1F1F1F; }
  .k-btn--block { display: flex; box-sizing: border-box; width: 100%; }
  
  
  
/* ---------- Floating add button + menu ---------- */
.k-fab {
  position: fixed; z-index: 30;
  /* aligned with the right edge of the content column on any screen width */
  right: max(20px, calc((100vw - 560px) / 2 + 24px));
  bottom: calc(var(--k-dock-offset, 0px) + 16px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
.k-fab__backdrop { position: fixed; inset: 0; z-index: -1; background: rgba(0, 0, 0, 0.55); }
.k-fab__btn {
  width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--k-pink); color: #1F1F1F;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  transition: transform 0.2s ease;
}
.k-fab__btn:active { transform: scale(0.94); }
.k-fab__btn svg { transition: transform 0.2s ease; }
.k-fab.is-open .k-fab__btn svg { transform: rotate(45deg); } /* the + turns into an x */
.k-fab__menu { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.k-fab__item {
  display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 22px 0 18px;
  border-radius: 999px; background: var(--k-surface-2); border: 1px solid var(--k-border-strong);
  color: var(--k-text); font-size: 16px; font-weight: 600; text-decoration: none; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.k-fab__item svg { color: #F7C9B6; }
.k-fab__item:active { background: var(--k-border-strong); }
.k-dock-spacer { height: calc(var(--k-dock-offset, 0px) + 96px); }
.k-main:has(.k-search__input:focus) .k-fab { display: none; }
@media (prefers-reduced-motion: reduce) { .k-fab__btn, .k-fab__btn svg { transition: none; } }

/* Native app: sit above the floating tab bar (measured from your screenshot; adjust if needed) */
.k-native { --k-dock-offset: 84px; }



  
  /* ---------- Buy: item cards ---------- */
  .k-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .k-item {
    position: relative; display: block; overflow: hidden;
    border-radius: var(--k-radius); background: var(--k-surface);
    border: 1px solid var(--k-border); color: var(--k-text); text-decoration: none;
  }
  .k-item:active { border-color: var(--k-border-strong); }
  .k-item__media { position: relative; }
  .k-item__img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
  .k-item__ph { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--k-surface-2); color: var(--k-faint); }
  .k-item__body { padding: 12px 14px 14px; }
  .k-item__title { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.35; word-break: break-word; }
  .k-item__meta { margin: 6px 0 0; font-size: 12px; color: var(--k-muted); }
  .k-item__meta--faint { margin-top: 4px; color: var(--k-faint); font-size: 11px; }
  .k-dup {
    display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px;
    border: 1px solid var(--k-border-strong); font-size: 11px; color: var(--k-muted);
  }
  .k-badge {
    position: absolute; top: 10px; left: 10px; z-index: 1;
    padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.3;
  }
  .k-badge--todo { background: #1F1F1F; color: #fff; }
  .k-badge--claimed { background: #1D4430; color: var(--k-success); }
  .k-badge--done { background: rgba(20, 20, 20, 0.72); color: var(--k-text-2); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .k-clip {
    position: absolute; top: 10px; right: 10px; z-index: 1; width: 28px; height: 28px;
    display: grid; place-items: center; border-radius: 999px;
    background: rgba(20, 20, 20, 0.72); color: var(--k-text-2);
  }
  
  /* ---------- Todo / Record: rows ---------- */
  .k-month { margin: 22px 0 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--k-text); }
  .k-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--k-border); }
  .k-row__main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
  .k-row__text { display: block; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
  .k-row__title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .k-row__title.is-done { text-decoration: line-through; color: var(--k-faint); }
  .k-row__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; font-size: 12px; color: var(--k-muted); }
  .k-row__meta > span { display: inline-flex; align-items: center; gap: 4px; }
  .k-row__note { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--k-faint); }
  .k-row__aside { flex-shrink: 0; }
  .k-row__thumb { flex-shrink: 0; display: block; }
  .k-row__thumb img { display: block; width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }
  .k-check {
    flex-shrink: 0; display: grid; place-items: center; width: 32px; height: 32px; margin-left: -4px;
    padding: 0; border: 0; background: none; cursor: pointer; color: var(--k-muted);
  }
  .k-check.is-done { color: var(--k-text); }
  .k-chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; border-radius: 999px;
    font: inherit; font-size: 11px; font-weight: 500; line-height: 1.2; white-space: nowrap;
    color: var(--k-text); text-decoration: none;
  }
  .k-chip.is-on { background: var(--k-surface-2); }
  
  /* ---------- Profile / lists ---------- */
  .k-flash { margin-bottom: 16px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--k-border-strong); font-size: 14px; color: var(--k-text-2); }
  .k-flash--error { border-color: rgba(255, 122, 122, 0.4); color: var(--k-danger); }
  .k-field { margin-bottom: 22px; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--k-border); }
  .k-field__label { display: block; margin-bottom: 2px; font-size: 12px; color: var(--k-muted); }
  .k-field__value { font-size: 16px; font-weight: 500; word-break: break-all; }
  .k-listitem {
    display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 14px 16px;
    border-radius: 16px; border: 1px solid var(--k-border);
  }
  .k-listitem__main {
    display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
    color: inherit; text-decoration: none; font-size: 15px; font-weight: 600;
  }
  .k-listitem__main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .k-listitem__main svg { flex-shrink: 0; color: var(--k-faint); }
  .k-default { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; font-size: 12px; color: var(--k-muted); }
  .k-default svg { fill: currentColor; }
  .k-link-btn { flex-shrink: 0; padding: 6px 0; border: 0; background: none; font: inherit; font-size: 12px; font-weight: 500; color: var(--k-muted); cursor: pointer; }
  .k-link-btn:active { color: var(--k-text); }
  .k-danger { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--k-border); scroll-margin-top: 16px; }
  .k-danger h2 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--k-danger); }
  .k-danger p { margin: 0 0 14px; font-size: 13px; line-height: 1.55; color: var(--k-muted); }
  .k-label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--k-muted); }
  .k-input {
    box-sizing: border-box; width: 100%; max-width: 280px; margin-bottom: 14px; padding: 12px 14px;
    border-radius: 14px; border: 1px solid var(--k-border-strong); background: var(--k-surface);
    color: var(--k-text); font: inherit; font-size: 16px; outline: none;
  }
  .k-input:focus { border-color: var(--k-text); }
  
  /* ---------- Pass 2: forms, detail pages, auth, shared lists ---------- */
  .k-back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 18px -4px; padding: 4px 8px 4px 4px; font-size: 14px; color: var(--k-muted); text-decoration: none; }
  .k-native .k-back { display: none; }
  .k-native .k-title { margin-top: 0; }
  .k-back:active { color: var(--k-text); }
  .k-page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
  .k-page-head .k-title { overflow-wrap: anywhere; }
  
  .k-section { margin-bottom: 20px; }
  .k-section-sm { margin-bottom: 12px; }
  .k-grow { flex: 1; }
  .k-center { text-align: center; }
  .k-divider { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--k-border); }
  .k-subtitle { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
  .k-stack { display: grid; gap: 10px; }
  .k-text { margin: 0 0 16px; font-size: 14px; line-height: 1.55; color: var(--k-text-2); }
  .k-text--muted { color: var(--k-muted); }
  .k-hint { margin: 0 0 16px; font-size: 12px; line-height: 1.5; color: var(--k-faint); }
  .k-link { color: var(--k-text); text-decoration: underline; text-underline-offset: 3px; }
  .k-link--muted { color: var(--k-muted); text-decoration: none; font-size: 14px; }
  .k-link--muted:active { color: var(--k-text); }
  
  /* Form controls */
  .k-control {
    box-sizing: border-box; display: block; width: 100%; margin: 0 0 12px; padding: 14px 16px;
    border-radius: 14px; border: 1px solid var(--k-border-strong); background: var(--k-surface);
    color: var(--k-text); font: inherit; font-size: 16px; line-height: 1.4; outline: none;
    -webkit-appearance: none; appearance: none;
  }
  .k-control::placeholder { color: var(--k-faint); }
  .k-control:focus { border-color: var(--k-text); }
  .k-control:disabled { background: var(--k-bg); color: var(--k-faint); }
  textarea.k-control { resize: vertical; min-height: 96px; }
  input[type="date"].k-control, input[type="time"].k-control { min-height: 52px; }
  select.k-control {
    padding-right: 44px; background-repeat: no-repeat; background-position: right 14px center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23A3A3A3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }
  .k-errors { margin-bottom: 16px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255, 122, 122, 0.4); color: var(--k-danger); font-size: 14px; line-height: 1.5; }
  .k-errors p { margin: 0; }
  .k-checkline { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 14px; color: var(--k-text-2); }
  .k-checkline input { width: 18px; height: 18px; accent-color: #fff; }
  .k-inline { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
  .k-inline .k-control { flex: 1; min-width: 0; margin-bottom: 0; }
  .k-inline .k-btn { flex-shrink: 0; padding: 14px 16px; }
  
  /* Buttons: extra variants */
  .k-btn--sm { min-height: 44px; padding: 10px 14px; font-size: 13px; border-radius: 12px; }
  .k-btn--outline-danger { background: transparent; color: var(--k-danger); border-color: rgba(255, 122, 122, 0.45); }
  .k-btn--plain-danger { background: transparent; color: var(--k-danger); }
  .k-btn--static { background: var(--k-surface); color: var(--k-faint); cursor: default; }
  .k-btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
  
  /* Auth pages */
  .k-auth { max-width: 400px; margin: 0 auto; padding-top: 8px; }
  .k-auth__brand { margin: 0 0 28px; font-size: 20px; font-weight: 600; }
  
  /* Cards and detail pages */
  .k-card { margin-bottom: 14px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--k-border); }
  .k-card__label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 500; color: var(--k-muted); }
  .k-card__value { margin: 0; font-size: 15px; line-height: 1.5; color: var(--k-text); overflow-wrap: anywhere; white-space: pre-wrap; }
  .k-card__line { margin: 0 0 4px; font-size: 14px; color: var(--k-text-2); }
  .k-card__line:last-child { margin-bottom: 0; }
  .k-card__line strong { color: var(--k-text); font-weight: 500; }
  .k-notes a { color: var(--k-text); text-decoration: underline; text-underline-offset: 3px; }
  .k-detail-chip { margin-bottom: 16px; }
  .k-detail-chip .k-chip { padding: 8px 12px; border: 1px solid var(--k-border-strong); }
  .k-detail-chip .k-chip.is-on { border-color: transparent; }
  .k-pill { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.3; }
  .k-pill--todo { background: #fff; color: #1F1F1F; }
  .k-pill--claimed { background: #1D4430; color: var(--k-success); }
  .k-pill--done { background: var(--k-surface-2); color: var(--k-text-2); }
  .k-photo-btn { display: block; width: 100%; margin-bottom: 16px; padding: 0; border: 0; background: none; cursor: zoom-in; }
  .k-photo { display: block; width: 100%; border-radius: var(--k-radius); border: 1px solid var(--k-border); }
  .k-attach-img { display: block; width: 100%; border-radius: 14px; border: 1px solid var(--k-border); }
  .k-lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; }
  .k-lightbox::backdrop { background: rgba(0, 0, 0, 0.88); }
  .k-lightbox__inner { box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: 100%; height: calc(100% - 160px); padding: 16px; } /* lightbox position v2: leave room for the tab bar so the photo sits higher; make 160px larger to move it up more */
  .k-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
  .k-video { display: block; width: 100%; max-height: 70vh; border-radius: 12px; background: #000; }
  
  /* Uploads */
  .k-drop {
    display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px 14px;
    border-radius: 14px; border: 1px dashed var(--k-border-strong); color: var(--k-muted);
    font-size: 14px; text-align: center; cursor: pointer;
  }
  .k-drop:hover { border-color: #fff; color: #fff; }
  .k-drop--stack { flex-direction: column; flex: 1; gap: 6px; padding: 14px 10px; border-style: solid; font-size: 13px; }
  .k-drop-pair { display: flex; gap: 10px; }
  .k-drop-pair > label { flex: 1; }
  .k-drop-pair > form { flex: 1; display: flex; margin: 0; }
  .k-drop-pair > form > label { flex: 1; }
  .k-progress { height: 6px; overflow: hidden; border-radius: 999px; background: var(--k-border-strong); }
  .k-progress__bar { height: 100%; border-radius: 999px; background: #fff; transition: width 0.15s; }
  .k-progress-wrap { margin-top: 8px; }
  .k-success { align-items: center; gap: 6px; margin: 8px 0 0; font-size: 14px; color: var(--k-success); }
  .k-error-text { margin: 8px 0 0; font-size: 14px; color: var(--k-danger); }
  .k-filelist { display: grid; gap: 6px; margin-bottom: 12px; }
  .k-filelist:empty { display: none; }
  .k-file { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--k-border); }
  .k-file__main { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
  .k-file__thumb { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
  .k-file__ph { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--k-surface-2); color: var(--k-faint); }
  .k-file__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
  .k-file__remove { flex-shrink: 0; padding: 6px; border: 0; background: none; color: var(--k-faint); cursor: pointer; }
  .k-file__remove:active { color: var(--k-danger); }
  .k-current-photo { position: relative; width: 200px; height: 200px; margin-bottom: 16px; }
  
  /* Shared lists */
  .k-sl { margin-bottom: 10px; padding: 16px; border-radius: 16px; border: 1px solid var(--k-border); }
  .k-sl__name { margin: 0; font-size: 15px; font-weight: 600; }
  .k-sl__meta { margin: 4px 0 0; font-size: 12px; color: var(--k-muted); }
  .k-sl__meta.is-bad { color: var(--k-danger); }
  .k-sl__actions { display: flex; align-items: center; gap: 4px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--k-border); }
  .k-sl__actions .k-iconbtn { border: 0; background: transparent; }
  .k-sl__actions form.button_to { margin-left: auto; }
  .k-kind { margin: 22px 0 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--k-muted); }
  .k-pick { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--k-border); font-size: 15px; cursor: pointer; }
  .k-pick input { flex-shrink: 0; width: 20px; height: 20px; accent-color: #fff; }
  .k-pick img { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
  .k-pick span { flex: 1; min-width: 0; }
  .k-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 16px;
    border-radius: 14px; border: 1px solid var(--k-border-strong); background: transparent;
    color: var(--k-text); font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer;
  }
  .k-toggle.is-on { background: var(--k-ink); border-color: var(--k-ink); color: var(--k-on-ink); }
  .k-share-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 12px; border-radius: 16px; border: 1px solid var(--k-border); background: var(--k-surface); }
  .k-share-row > img,
  .k-share-row .k-photo-btn img { flex-shrink: 0; width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
  .k-share-row__photo { flex-shrink: 0; width: 56px; }
  .k-share-row .k-photo-btn { width: 56px; margin-bottom: 0; }
  .k-share-row__text { flex: 1; min-width: 0; }
  .k-share-row__title { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
  .k-share-row__status { margin: 3px 0 0; font-size: 12px; color: var(--k-muted); }
  .k-public { max-width: 560px; margin: 0 auto; padding: 28px 24px 56px; }
  
  /* ==========================================================================
     Compatibility layer â€” dark colours for Tailwind classes used by screens
     that have not been redesigned yet. Delete rules as screens are converted.
     ========================================================================== */
  
  /* Form controls */
  .k-dark input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]),
  .k-dark textarea,
  .k-dark select {
    background-color: var(--k-surface);
    color: var(--k-text);
    border-radius: 14px;
  }
  .k-dark ::placeholder { color: var(--k-faint); opacity: 1; }
  .k-dark .disabled\:bg-gray-50:disabled { background-color: var(--k-bg); }
  .k-dark .disabled\:text-gray-400:disabled { color: var(--k-faint); }
  .k-dark .accent-gray-900 { accent-color: #fff; }
  
  /* Backgrounds */
  .k-dark .bg-white { background-color: var(--k-bg); }
  .k-dark .bg-gray-50 { background-color: var(--k-surface); }
  .k-dark .bg-gray-100 { background-color: var(--k-surface-2); }
  .k-dark .bg-gray-200 { background-color: var(--k-border-strong); }
  .k-dark .bg-gray-900 { background-color: var(--k-ink); }
  .k-dark .bg-green-50 { background-color: var(--k-success-bg); }
  .k-dark .bg-red-600 { background-color: var(--k-danger); }
  .k-dark .bg-rose-100 { background-color: rgba(20, 20, 20, 0.72); }
  .k-dark .hover\:bg-black:hover { background-color: #E8E8E8; }
  .k-dark .hover\:bg-gray-100:hover { background-color: var(--k-surface-2); }
  .k-dark .hover\:bg-red-50:hover { background-color: var(--k-danger-bg); }
  
  /* Text */
  .k-dark .text-white { color: var(--k-on-ink); }
  .k-dark .text-gray-900 { color: var(--k-text); }
  .k-dark .text-gray-700 { color: var(--k-text-2); }
  .k-dark .text-gray-600 { color: #BDBDBD; }
  .k-dark .text-gray-500 { color: var(--k-muted); }
  .k-dark .text-gray-400 { color: var(--k-faint); }
  .k-dark .text-gray-300 { color: #6B6B6B; }
  .k-dark .text-red-500,
  .k-dark .text-red-600,
  .k-dark .text-red-700 { color: var(--k-danger); }
  .k-dark .text-green-600,
  .k-dark .text-green-700 { color: var(--k-success); }
  .k-dark .hover\:text-gray-900:hover { color: var(--k-text); }
  .k-dark .hover\:text-red-600:hover { color: var(--k-danger); }
  
  /* Borders */
  .k-dark .border-gray-100 { border-color: #2B2B2B; }
  .k-dark .border-gray-200 { border-color: var(--k-border); }
  .k-dark .border-gray-300 { border-color: var(--k-border-strong); }
  .k-dark .border-gray-900 { border-color: #fff; }
  .k-dark .border-red-200 { border-color: rgba(255, 122, 122, 0.25); }
  .k-dark .border-red-300 { border-color: rgba(255, 122, 122, 0.45); }
  .k-dark .hover\:border-gray-400:hover { border-color: #777; }
  .k-dark .hover\:border-gray-900:hover { border-color: #fff; }
  .k-dark .focus\:border-gray-900:focus { border-color: #fff; }
/* Prevents iOS from auto-zooming the page when a form input is focused.
   iOS does this automatically whenever a focused input's font-size is
   under 16px — Tailwind's text-sm (14px), used throughout our forms,
   was triggering it. Setting a 16px minimum here stops the zoom without
   needing to change the visual size of the text everywhere it's used. */
input,
textarea,
select {
  font-size: 16px;
}


/* Photos: placeholder tile first, fade the photo in once it has loaded */
.k-item__media, .k-row__thumb { background: var(--k-surface-2); }
.k-row__thumb { border-radius: 12px; }
.k-item__img, .k-row__thumb img { transition: opacity 0.25s ease; }
img.is-pending { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .k-item__img, .k-row__thumb img { transition: none; }
}

/* ---------- Offline notice ---------- */
.k-offline {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 16px; text-align: center;
  background: #3A2A12; color: #FFD9A0; border-bottom: 1px solid #5A4220;
  font-size: 14px; font-weight: 500; line-height: 1.35;
  animation: k-offline-in 0.25s ease;
}
.k-offline__dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: #FFB347; }
.k-offline.is-nudged { animation: k-offline-nudge 0.4s ease; }
@keyframes k-offline-in { from { transform: translateY(-100%); } }
@keyframes k-offline-nudge { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .k-offline, .k-offline.is-nudged { animation: none; } }

/* ---------- Photo picker: current photo and the pending replacement ---------- */
.k-photo-slot { margin-bottom: 12px; }
.k-photo-preview {
  position: relative; width: 200px; height: 200px; margin-bottom: 10px; overflow: hidden;
  border-radius: var(--k-radius); background: var(--k-surface-2); border: 2px solid #E99BA8;
}
.k-photo-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.k-photo-preview img.is-broken { visibility: hidden; }
.k-photo-preview__tag {
  position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 6px 10px; border-radius: 999px;
  background: var(--k-pink); color: #1F1F1F; font-size: 11px; font-weight: 600; line-height: 1.25; text-align: center;
}


.k-count {
  position: absolute; bottom: 10px; right: 10px; z-index: 1;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.3;
  background: rgba(20, 20, 20, 0.72); color: var(--k-text-2);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

/* Place reminders: the "Remind me when I'm near" field, suggestion chips, and
   the line on the item page. Append to kilog.css. Colors follow the text
   color, so it works with your light and dark themes as they are. */

   .k-place-label {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  .k-place-hint {
    margin: 8px 0 0;
    font-size: 13px;
    opacity: 0.7;
  }
  
  .k-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
  }
  
  .k-chips:empty {
    display: none;
  }
  
  .k-chip {
    appearance: none;
    font: inherit;
    font-size: 14px;
    line-height: 1;
    padding: 9px 14px;
    border-radius: 999px;
    color: inherit;
    background: transparent;
    border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
    cursor: pointer;
  }
  
  .k-chip[aria-pressed="true"] {
    background: color-mix(in srgb, currentColor 12%, transparent);
    border-color: currentColor;
    font-weight: 600;
  }
  
  .k-place-note {
    margin: 8px 0 0;
    font-size: 12px;
    opacity: 0.6;
  }
  
  .k-place-line {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  /* Hide "No items here yet." as soon as a card is present, including a card
   that arrives live from a broadcast. */
  .k-grid:has(.k-item) + .k-empty {
    display: none;
  }

/* Video indicators and the public-list video player */
.k-play { position: absolute; left: 8px; bottom: 8px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 999px; background: rgba(0, 0, 0, .65); color: #fff; }
.k-play--sm { width: 20px; height: 20px; left: 4px; bottom: 4px; }
.k-play--sm svg { width: 10px; height: 10px; }
.k-row__thumb { position: relative; }
.k-share-row__video { margin-top: 6px; }
.k-share-row__video summary { cursor: pointer; font-size: 14px; }
.k-share-row__video video { display: block; width: min(100%, 520px); margin-top: 8px; border-radius: 8px; }

.k-share-row__video summary { list-style: none; }
.k-share-row__video summary::-webkit-details-marker { display: none; }

.k-sl__name a { display: block; color: inherit; text-decoration: none; }
.k-sl__name a:active { opacity: .7; }

/* Make notices as noticeable as errors: filled background, bright text */
.k-flash { background: var(--k-surface-2); color: var(--k-text, #ffffff); }
.k-flash--error { background: rgba(255, 122, 122, 0.08); color: var(--k-danger); }


/* Todo: Now | Day | All switch, big-type list, day navigation */
.k-seg { display: flex; gap: 4px; padding: 4px; margin: 0 0 14px; background: var(--k-surface-2); border-radius: 12px; }
.k-seg__btn { flex: 1; text-align: center; padding: 10px 0; border-radius: 9px; font-weight: 600; text-decoration: none; color: inherit; opacity: .6; }
.k-seg__btn.is-active { opacity: 1; background: rgba(255,255,255,.12); }
.k-daynav { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; }
.k-daynav__label { font-size: 20px; font-weight: 700; }
.k-now { list-style: none; margin: 0; padding: 0; }
.k-now__item { border-bottom: 1px solid rgba(255,255,255,.12); }
.k-now__link { display: block; padding: 18px 2px; text-decoration: none; color: inherit; }
.k-now__when { display: block; font-size: 15px; opacity: .65; margin-bottom: 4px; }
.k-now__when.is-overdue { opacity: 1; color: #f2a58e; font-weight: 600; }
.k-now__title { display: block; font-size: 24px; line-height: 1.25; font-weight: 600; overflow-wrap: anywhere; }
.k-now__item.is-done .k-now__title { text-decoration: line-through; opacity: .5; }


/* Group header: (i) popover, owner + shared-lists link on one row */
.k-header__row { position: relative; }
.k-info { position: relative; display: inline-block; margin-left: 4px; }
.k-info summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; opacity: .6; }
.k-info summary::-webkit-details-marker { display: none; }
.k-info[open] summary { opacity: 1; }
.k-info__pop { position: absolute; z-index: 20; top: 38px; left: -8px; width: min(280px, 78vw); padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; background: var(--k-surface-2); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.k-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.k-meta .k-owner { margin: 0; }
.k-sharelink--compact { width: auto; margin: 0; padding: 6px 12px; font-size: 14px; border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }

/* (i) stays next to the group name; pencil stays at the far right */
.k-header__row .k-info { margin-right: auto; position: static; }
.k-info__pop { top: 100%; left: 0; margin-top: 4px; }

/* "My shared lists": plain text, same weight as "Group Owner" */
.k-sharelink--compact { background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; font-size: 14px; font-weight: 500; color: inherit; opacity: .85; text-decoration: none; }
.k-sharelink--compact:active { opacity: .6; }

/* Spacing pass: header, Todo switch, tiles, search */
.k-header { margin-bottom: 20px; }
.k-meta { margin-top: 10px; }
.k-seg { margin: 4px 0 22px; padding: 5px; gap: 6px; }
.k-seg__btn { padding: 12px 0; font-size: 16px; }
.k-tiles { margin-bottom: 22px; }
.k-daynav { margin: 0 0 16px; }
.k-search { margin-top: 4px; margin-bottom: 18px; }


/* Stale-item banner and review page */
.k-stale { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 18px; padding: 12px 14px; border-radius: 12px; background: var(--k-surface-2); color: inherit; text-decoration: none; font-size: 14px; }
.k-stale__go { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; white-space: nowrap; }
.k-review { padding: 8px 0 40px; }
.k-review__count { font-size: 14px; opacity: .6; margin: 0 0 14px; }
.k-review__img { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 14px; margin-bottom: 18px; }
.k-review__title { font-size: 28px; line-height: 1.2; margin: 0 0 8px; overflow-wrap: anywhere; }
.k-review__meta { font-size: 14px; opacity: .65; margin: 0 0 24px; }
.k-review__actions { display: grid; gap: 12px; }
.k-review__actions form { display: block; }
.k-review__btn { width: 100%; min-height: 52px; border: 0; border-radius: 14px; font-size: 17px; font-weight: 600; color: inherit; background: var(--k-surface-2); }
.k-review__btn--main { background: #f2e9df; color: #1b1917; }
.k-review__back { display: block; text-align: center; margin-top: 22px; font-size: 15px; opacity: .65; color: inherit; }


/* "Understood this date" chip under the title field */
.k-datechip { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 4px; padding: 6px 8px 6px 12px; border-radius: 999px; background: var(--k-surface-2); font-size: 14px; font-weight: 600; }
.k-datechip[hidden] { display: none; }
.k-datechip__x { border: 0; background: none; color: inherit; font-size: 20px; line-height: 1; padding: 0 6px; opacity: .6; cursor: pointer; }


/* "We're generating the title..." screen */
.k-generating { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 0 24px; }
.k-spinner { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); border-top-color: var(--k-text, #fff); animation: k-spin .9s linear infinite; }
@keyframes k-spin { to { transform: rotate(360deg); } }
.k-generating__title { font-size: 22px; font-weight: 600; margin: 6px 0 0; }
.k-generating__sub { opacity: .65; font-size: 15px; margin: 0; }
.k-generating__skip { margin-top: 18px; opacity: .6; font-size: 15px; color: inherit; }
@media (prefers-reduced-motion: reduce) { .k-spinner { animation-duration: 3s; } }


/* Tags on a card */
.k-item__tags { font-size: 13px; opacity: .8; margin: 2px 0 0; overflow-wrap: anywhere; }


/* Tags: chips, the picker sheet, the add field */
.k-tagrow { display: flex; flex-wrap: wrap; gap: 8px; }
.k-tagchip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; box-sizing: border-box; padding: 6px 12px; border-radius: 999px; background: var(--k-surface-2); color: inherit; font-size: 14px; font-weight: 500; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.k-tagchip form { display: inline; margin: 0; }
.k-tagchip__x { border: 0; background: none; color: inherit; opacity: .6; font-size: 18px; line-height: 1; padding: 0 2px; cursor: pointer; }
.k-tagchip__n { font-size: 12px; opacity: .6; }
.k-tagchip--on { background: #f2e9df; color: #1b1917; }
.k-tagchip--on .k-tagchip__n { opacity: .7; }
.k-tagbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.k-tagbtn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); background: none; color: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
dialog.k-tagsheet { border: 0; padding: 0; width: min(520px, 100%); margin: auto auto 0; border-radius: 18px 18px 0 0; background: var(--k-surface-2, #2d2926); color: inherit; }
dialog.k-tagsheet::backdrop { background: rgba(0,0,0,.55); }
.k-tagsheet__inner { padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); }
.k-tagsheet__actions { display: flex; gap: 12px; margin-top: 8px; }
.k-tagsheet__actions .k-btn { flex: 1; }
.k-tagadd { display: flex; gap: 10px; align-items: stretch; margin-top: 12px; }
.k-tagadd .k-control { flex: 1; margin: 0; }


/* Tag sheet: centered, so the app's floating tab bar never covers it */
dialog.k-tagsheet { margin: auto; width: min(520px, calc(100% - 32px)); max-height: 70vh; overflow-y: auto; border-radius: 18px; }


.k-row__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.k-row__tag { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--k-surface-2, #2d2926); opacity: .85; }

/* Profile: breathing room around the AI suggestions block */
.k-hint--profile { margin: 4px 2px 16px; }
.k-aibtn { margin-bottom: 28px; }


/* + button: camera first, with a small way to add without a photo */
label.k-fab__btn { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.k-fab__alt { align-self: flex-end; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px; background: var(--k-surface-2, #2d2926); border: 1px solid rgba(255,255,255,.16); color: inherit; text-decoration: none; }
.k-fab__status { align-self: flex-end; margin: 0; font-size: 13px; padding: 8px 14px; border-radius: 999px; background: var(--k-surface-2, #2d2926); }

.k-fab__alt { background: #F2A7BC; color: #2A1218; border-color: transparent; }


/* Swipe a to-do row left to reveal Delete */
.k-swipe { position: relative; overflow: hidden; }
.k-swipe__front { transition: transform .2s ease; touch-action: pan-y; will-change: transform; }
.k-swipe.is-moving .k-swipe__front { transition: none; }
.k-swipe__form { position: absolute; top: 0; right: 0; bottom: 0; width: 88px; margin: 0; opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.k-swipe.is-moving .k-swipe__form, .k-swipe.is-open .k-swipe__form { opacity: 1; pointer-events: auto; }
.k-swipe__btn { width: 100%; height: 100%; border: 0; border-radius: 0; background: #D9534F; color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; }

/* Photo pile on the item page */
.k-pile { margin: 16px 0 22px; }
.k-pile__stage { position: relative; width: calc(100% - 28px); aspect-ratio: 1 / 1; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.k-pile__card { position: absolute; inset: 0; padding: 0; border: 1px solid rgba(255,255,255,.08); border-radius: 16px; overflow: hidden; background: #111; box-shadow: 0 6px 18px rgba(0,0,0,.45); transform-origin: 50% 100%; will-change: transform; cursor: pointer; }
.k-pile__card img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; -webkit-user-drag: none; }
.k-pile__count { margin: 14px 0 0; font-size: 13px; opacity: .7; }

/* Delete button: inset from the row's lines, rounded, with a gap from the row */
.k-swipe__form { top: 8px; bottom: 8px; width: 88px; }
.k-swipe__btn { border-radius: 14px; }

.k-pile__nav { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.k-pile__nav .k-pile__count { margin: 0; }
.k-pile__arrow { width: 44px; height: 44px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); background: none; color: inherit; font-size: 22px; line-height: 1; cursor: pointer; }

/* Welcome tour */
.k-ob { min-height: 78vh; display: flex; flex-direction: column; }
.k-main:has(.k-ob) { padding-top: 8px; }
.k-ob__top { display: flex; justify-content: flex-end; }
.k-ob__pages { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; padding-top: 12px; }
.k-ob__page { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 0 6px; }
.k-ob__page[hidden] { display: none; }
.k-ob__icon { width: 92px; height: 92px; border-radius: 28px; display: flex; align-items: center; justify-content: center; background: var(--k-surface-2, #2d2926); color: #F7C9B6; }
.k-ob__title { margin: 8px 0 0; font-size: 28px; line-height: 1.15; }
.k-ob__text { margin: 0; font-size: 17px; line-height: 1.5; opacity: .9; }
.k-ob__hint { margin: 0; font-size: 14px; line-height: 1.5; opacity: .7; }
.k-ob__switch { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 16px; text-align: left; }
.k-ob__switch input { width: 22px; height: 22px; }
/* Pinned above the tab bar so Next is always reachable, however long the page is. */
.k-ob__footer { position: sticky; bottom: calc(var(--k-dock-offset, 0px) + env(safe-area-inset-bottom, 0px) + 8px); display: flex; flex-direction: column; gap: 14px; padding: 18px 0 8px; background: var(--k-bg); }
.k-ob__footer form { margin: 0; }
.k-ob__footer [hidden] { display: none; }
.k-ob__dots { display: flex; justify-content: center; gap: 8px; }
.k-ob__dot { width: 8px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.25); }
.k-ob__dot.is-on { background: #F7C9B6; width: 22px; }

/* Profile page: grouped cards with rows */
.k-pcard { border: 1px solid var(--k-border); border-radius: 18px; overflow: hidden; margin: 0 0 14px; }
.k-pcard form { margin: 0; display: block; }
.k-prow { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; box-sizing: border-box; padding: 16px 18px; border: 0; border-bottom: 1px solid var(--k-border); background: none; color: inherit; font: inherit; font-size: 16px; text-align: left; text-decoration: none; }
.k-pcard > :last-child, .k-pcard > :last-child .k-prow { border-bottom: 0; }
.k-prow--info .k-prow__label { font-size: 14px; opacity: .65; }
.k-prow--info .k-prow__value { font-size: 16px; text-align: right; overflow-wrap: anywhere; }
.k-prow--link { cursor: pointer; }
.k-prow--link:active { background: rgba(255,255,255,.05); }
.k-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; cursor: pointer; }
.k-switch input[type=checkbox] { -webkit-appearance: none; appearance: none; margin: 0; flex-shrink: 0; width: 51px; height: 31px; border-radius: 99px; background: rgba(255,255,255,.2); position: relative; transition: background .2s ease; }
.k-switch input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.k-switch input[type=checkbox]:checked { background: #F0B8A2; }
.k-switch input[type=checkbox]:checked::after { transform: translateX(20px); }

/* Tags are for finding items (Tags button) and for the item page, not for the lists */
.k-item__tags, .k-row__tags { display: none; }

/* Smaller, lighter-pink + above the main one: add without a photo */
.k-fab__btn.k-fab__btn--light { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; align-self: flex-end; margin: 0 6px 4px 0; background: #F8D3DE; color: #2A1218; text-decoration: none; }

/* Main + button shows the lens artwork */
.k-fab__btn.k-fab__btn--photo { background: transparent; padding: 0; overflow: hidden; }
.k-fab__img { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; pointer-events: none; }

/* To-do tabs: smaller text so "In 2 hours" fits */
.k-seg__btn { font-size: 14px; padding-left: 8px; padding-right: 8px; white-space: nowrap; }

/* Today view: Anytime / Morning / Afternoon / Evening headings */
.k-now__group { margin: 22px 0 4px; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; }

/* Onboarding: the real lens button and the small pink + */
.k-ob__lens { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; display: block; }
.k-ob__plus { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; vertical-align: middle; background: #F8D3DE; color: #2A1218; }

/* Onboarding: looping demo of adding from the album */
.k-ob__demo { display: block; height: 36vh; max-height: 330px; width: auto; border-radius: 18px; margin: 4px auto 6px; background: #2d2926; }

/* Onboarding: drawn step-by-step demo (shapes and icons, no images or video) */
.k-sim { display: block; width: fit-content; margin: 4px auto 0; --h: min(34vh, 320px); }
.k-sim__phone { position: relative; width: calc(var(--h) * .4615); height: var(--h); font-size: calc(var(--h) / 39); border-radius: 2.4em; overflow: hidden; background: #1f1f1f; border: .35em solid #3a3532; box-sizing: content-box; }
.k-sim__scene { position: absolute; inset: 0; opacity: 0; animation: k-sim-show 14.4s infinite; animation-delay: calc(var(--i) * 2.4s); background: #262321; }
.k-sim__bar { position: absolute; display: block; height: .9em; border-radius: .45em; background: #4a443f; }
.k-sim__bar--pill { height: 1.6em; border-radius: .8em; }
.k-sim__bar--mid { background: #6a625b; }
.k-sim__bar--pink { background: #F7C9B6; }
.k-sim__grid { position: absolute; left: .3em; top: 7em; right: .3em; display: grid; grid-template-columns: repeat(3, 1fr); gap: .6em; }
.k-sim__grid i { display: block; aspect-ratio: 1; border-radius: .7em; opacity: .85; }
.k-sim__photo { position: absolute; left: 0; right: 0; top: 9em; height: 18em; }
.k-sim__photo svg, .k-sim__thumb svg { display: block; width: 100%; height: 100%; }
.k-sim__toolbar { position: absolute; left: 0; right: 0; bottom: 0; height: 5em; display: flex; justify-content: space-around; align-items: center; background: #1c1a19; }
.k-sim__toolbar svg { width: 2.4em; height: 2.4em; stroke: #f4f1ee; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.k-sim__dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.k-sim__sheet { position: absolute; left: 0; right: 0; top: 15em; bottom: 0; background: #2d2926; border-radius: 1.8em 1.8em 0 0; }
.k-sim__grab { position: absolute; left: 50%; margin-left: -2em; top: .9em; width: 4em; height: .4em; border-radius: .2em; background: #5b5550; }
.k-sim__sheethead { position: absolute; left: 1.2em; top: 2.2em; display: flex; align-items: center; gap: 1em; }
.k-sim__sheethead s { display: block; width: 3.6em; height: 3.6em; border-radius: .8em; background: #6d5a8c; }
.k-sim__sheethead .k-sim__bar { position: static; }
.k-sim__tiles { position: absolute; left: 1.2em; right: 1.2em; top: 8em; display: flex; justify-content: space-between; }
.k-sim__tiles em { display: grid; place-items: center; width: 3.8em; height: 3.8em; border-radius: 1em; background: #3d3834; font-style: normal; }
.k-sim__tiles em span { font-size: 1.6em; font-weight: 700; color: #2a1a14; }
.k-sim__tiles em.g { background: #F7C9B6; }
.k-sim__tiles em.b { background: #4d86d6; }
.k-sim__tiles svg { width: 2.2em; height: 2.2em; stroke: #d8d0c8; fill: none; stroke-width: 1.7; stroke-linecap: round; }
.k-sim__circles { position: absolute; left: 1.2em; right: 1.2em; top: 13.8em; display: flex; justify-content: space-between; }
.k-sim__circles i { display: block; width: 3.4em; height: 3.4em; border-radius: 50%; background: #3d3834; }
.k-sim__rows { position: absolute; left: 1.2em; right: 1.2em; top: 18.6em; }
.k-sim__rows b { display: block; height: 2.6em; border-radius: 1em; background: #3d3834; margin-bottom: .7em; }
.k-sim__card { position: absolute; inset: 0; background: #242120; }
.k-sim__thumb { position: absolute; left: 1.2em; top: 4.2em; width: 5em; height: 5em; border-radius: 1em; overflow: hidden; }
.k-sim__field { position: absolute; border-radius: 1em; background: #2f2b29; }
.k-sim__seg { position: absolute; left: 1.2em; right: 1.2em; top: 10.4em; height: 2.4em; border-radius: 1.2em; background: #2f2b29; display: flex; padding: .3em; gap: .3em; }
.k-sim__seg i { flex: 1; border-radius: .9em; }
.k-sim__seg i.on { background: #5a534d; }
.k-sim__row { position: absolute; left: 1.2em; right: 1.2em; height: 4.6em; border-radius: 1em; background: #2f2b29; }
.k-sim__row--s { height: 3em; }
.k-sim__toggle { position: absolute; right: 1em; top: 1.3em; width: 3.4em; height: 2em; border-radius: 1em; background: #5a534d; }
.k-sim__toggle::after { content: ""; position: absolute; left: .2em; top: .2em; width: 1.6em; height: 1.6em; border-radius: 50%; background: #fff; }
.k-sim__toggle.is-on { background: #34c759; }
.k-sim__toggle.is-on::after { left: 1.6em; }
.k-sim__chip { position: absolute; left: 2.2em; top: 18.2em; width: 7em; height: 2em; border-radius: 1em; background: #4a443f; }
.k-sim__done { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.k-sim__badge { display: grid; place-items: center; width: 9em; height: 9em; border-radius: 50%; background: #F7C9B6; }
.k-sim__badge svg { width: 4.6em; height: 4.6em; stroke: #2a1a14; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.k-sim__tap { position: absolute; width: 3.4em; height: 3.4em; margin: -1.7em 0 0 -1.7em; border-radius: 50%; border: .25em solid #fff; background: rgba(247, 150, 120, .5); box-shadow: 0 0 0 .18em rgba(0, 0, 0, .35); opacity: 0; animation: k-sim-tap 14.4s infinite; animation-delay: calc(var(--i) * 2.4s); }
.k-sim__cap { position: relative; height: 22px; margin-top: 8px; font-size: 14px; color: #d8d0c8; text-align: center; }
.k-sim__cap span { position: absolute; left: 50%; top: 0; transform: translateX(-50%); white-space: nowrap; opacity: 0; animation: k-sim-cap 14.4s infinite; animation-delay: calc(var(--i) * 2.4s); }
@keyframes k-sim-show { 0% { opacity: 0; } 2% { opacity: 1; } 15.5% { opacity: 1; } 17.5% { opacity: 0; } 100% { opacity: 0; } }
@keyframes k-sim-cap { 0% { opacity: 0; } 2% { opacity: 1; } 15.5% { opacity: 1; } 16.6%, 100% { opacity: 0; } }
@keyframes k-sim-tap { 0%, 9.5% { opacity: 0; transform: scale(.4); } 10.4% { opacity: 1; transform: scale(.6); } 14.5% { opacity: 0; transform: scale(1.5); } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .k-sim__scene, .k-sim__cap span { animation: none; }
  .k-sim__scene:nth-child(3), .k-sim__cap span:nth-child(3) { opacity: 1; }
  .k-sim__tap { display: none; }
}

/* Onboarding: drawn location prompt with the right option highlighted */
.k-loc { display: block; width: fit-content; margin: 6px auto 4px; }
.k-loc__card { position: relative; width: 236px; padding: 14px 0 0; border-radius: 16px; background: #2b2927; border: 1px solid #3d3935; overflow: hidden; text-align: center; }
.k-loc__pin { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 8px; border-radius: 50%; background: #F7C9B6; }
.k-loc__pin svg { width: 18px; height: 18px; stroke: #2a1a14; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.k-loc__title { margin: 0 14px 8px; font-size: 14px; line-height: 1.25; font-weight: 600; color: #f4f1ee; }
.k-loc__line { display: block; height: 6px; margin: 0 auto 5px; width: 78%; border-radius: 3px; background: #4a443f; }
.k-loc__line--short { width: 52%; margin-bottom: 12px; }
.k-loc__btn { position: relative; padding: 11px 8px; border-top: 1px solid #3d3935; font-size: 14px; color: #6aa8ff; }
.k-loc__btn--pick { font-weight: 600; background: rgba(247, 201, 182, .14); }
.k-loc__btn--pick u { position: absolute; inset: 3px 6px; border: 2px solid #F7C9B6; border-radius: 10px; animation: k-loc-pulse 1.8s ease-in-out infinite; }
@keyframes k-loc-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .k-loc__btn--pick u { animation: none; } }


/* grement-icon-v2: real app icon instead of the lettered tile */
.notif .app { background: none !important; padding: 0 !important; overflow: hidden; }
.notif .app img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.k-sim__tiles em.g { background: none !important; padding: 0 !important; overflow: hidden; }
.k-sim__tiles em.g img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* detail page redesign */
.k-hero { margin: 4px 0 18px; }
.k-statusline { margin: 6px 0 0; font-size: 14px; color: var(--k-text-2, #a69d92); }
.k-statusline--claimed { color: var(--k-success, #6fcf97); }
.k-due { display: inline-block; margin: 12px 0 0; padding: 7px 14px; border-radius: 999px; background: var(--k-surface-2, #2d2926); font-size: 14px; font-weight: 600; }
.k-due--overdue { color: #ff8a80; background: rgba(255, 138, 128, .14); }
.k-detail-chip--bottom { margin: 16px 0 0; }
.k-chip__label { margin-left: 8px; font-size: 14px; }
.k-footnote { margin: 28px 0 8px; text-align: center; font-size: 13px; color: var(--k-text-2, #8d857d); opacity: .7; }

/* detail spacing v2: explicit gaps between blocks on the item page */
.k-hero:not(:has(*)) { display: none; }
#item_status > .k-statusline { margin: 12px 0 0; }
#item_status > .k-due { margin: 14px 0 0; }
#item_status > .k-place-line { margin: 14px 0 0; }
.k-page-head ~ .k-card { margin: 20px 0 0; }
.k-page-head ~ .k-tagrow { margin: 20px 0 0; }
#item_status > .k-stack { margin: 26px 0 0; }
.k-page-head ~ .k-detail-chip--bottom { margin: 18px 0 0; }
.k-page-head ~ .k-footnote { margin: 32px 0 12px; }

/* pink primary buttons: every .k-btn except the ghost, danger and static variants */
.k-btn:not(.k-btn--ghost):not(.k-btn--danger):not(.k-btn--outline-danger):not(.k-btn--plain-danger):not(.k-btn--static) {
  background: #F0B8A2;
  color: #2a1a14;
  border-color: transparent;
}
.k-btn:not(.k-btn--ghost):not(.k-btn--danger):not(.k-btn--outline-danger):not(.k-btn--plain-danger):not(.k-btn--static):disabled {
  opacity: .5;
}

/* icons inside the status buttons on the item page */
.k-stack .k-btn--block { align-items: center; justify-content: center; gap: 10px; }

/* detail chips v1: the shared-list chip and the Search prices chip sit side by side */
.k-detail-chip--bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* attachment rows v1: a long file name shortens with "..." instead of pushing the row past the card */
.k-card .k-stack { min-width: 0; }
.k-card .k-file { min-width: 0; max-width: 100%; box-sizing: border-box; }
.k-file__main { display: flex; align-items: center; min-width: 0; flex: 1 1 auto; max-width: 100%; }
.k-file__ph { flex-shrink: 0; }
.k-file__name { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* price link v1: small accent link under the status lines (Buy items) */
.k-price-link { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; color: #F0B8A2; text-decoration: none; }
.k-page-head ~ .k-price-link { margin: 14px 0 0; }

/* focus rings v1: a visible outline for keyboard focus (WCAG 2.4.7 / 1.4.11).
   !important so it also wins over the fields that set `outline: none`. It shows
   for keyboard focus and when a text field is tapped, not when a button is tapped. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #F0B8A2 !important;
  outline-offset: 2px;
}

/* note links v1: links typed into item notes; accent color is about 9:1 on the dark cards. */
.k-notelink { color: #F0B8A2; text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }

/* overdue todos v1: pending to-dos past their date; --k-danger is about 6.5:1 on the dark background. */
.k-row__title.is-overdue, .k-row__meta .is-overdue { color: var(--k-danger); }

/* card remind v1: reminder date on Buy cards; red once it has passed (about 6.5:1). */
.k-item__remind { font-weight: 500; }
.k-item__remind.is-overdue { color: var(--k-danger); }

/* favourite shops v1: the Favourite shops page and the button beside the Buy search box. */
.k-searchrow { display: flex; align-items: flex-start; gap: 10px; }
.k-searchrow .k-search { flex: 1; min-width: 0; }
.k-shoplist { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.k-shop { display: flex; align-items: center; gap: 10px; }
.k-shop__link { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 12px 16px;
  border-radius: 16px; background: var(--k-surface); border: 1px solid var(--k-border);
  color: var(--k-text); text-decoration: none; }
.k-shop__name { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.k-shop__host { font-size: 12px; color: var(--k-muted); overflow-wrap: anywhere; }
.k-shop-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.k-shop-suggest form { margin: 0; }

/* shops button v1: matches the 52px search box (same corners, same 4px top offset). */
.k-searchrow .k-iconbtn { width: 52px; height: 52px; margin-top: 4px; border-radius: 16px; }


/* member actions v1: remove and report buttons on the members page */
.k-listitem:has(.k-listitem__actions) { flex-wrap: wrap; row-gap: 4px; }
.k-listitem__actions { flex-basis: 100%; display: flex; gap: 16px; align-items: center; }
.k-listitem__actions form { margin: 0; }
.k-memberaction { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; background: none; border: 0; font: inherit; font-size: 14px; color: #F0B8A2; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.k-memberaction--danger { color: var(--k-danger); }
.k-reportreasons { border: 0; padding: 0; margin: 16px 0; }
.k-reportreasons legend { font-weight: 600; margin-bottom: 8px; }
.k-reportreasons label { display: flex; align-items: center; gap: 10px; min-height: 44px; }


/* share extras v1: cover note, guest name box, footer on public share pages */
.k-share-note { white-space: pre-line; margin: 0 0 16px; }
.k-share-name { margin: 0 0 20px; }
.k-share-name .k-control { margin-top: 8px; }
.k-share-foot { margin-top: 40px; }
.k-share-foot a { color: #F0B8A2; text-decoration: underline; text-underline-offset: 2px; }


/* onboarding widget v1: a small picture of the Due Soon widget */
.k-ob__widget { background: #F2F2F2; color: #1a1a1a; border-radius: 22px; padding: 16px 18px; width: min(240px, 80%); margin: 8px auto 20px; text-align: left; }
.k-ob__widget-head { font-weight: 600; font-size: 15px; margin: 0 0 10px; }
.k-ob__widget-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin: 0 0 6px; }
.k-ob__widget-row span:last-child { color: #6b6b6b; }
.k-ob__widget-row .is-late { color: #c62828; }


/* starter lists v1: tick-box rows on the template preview */
.k-startlist label { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.k-startlist input[type="checkbox"] { width: 22px; height: 22px; flex: none; }

/* THEME-AUTO: the app screens (layout class "k-auto") follow the iPhone's light/dark setting.
   Dark stays the default. Landing, Terms, Privacy, share and invite pages do not use k-auto. */
@media (prefers-color-scheme: light) {
  html.k-auto {
    color-scheme: light;
    --k-bg: #FBF9F7;
    --k-surface: #F2EFEC;
    --k-surface-2: #E9E5E1;
    --k-border: #E4DFDA;
    --k-border-strong: #CFC8C1;
    --k-text: #1A1A1A;
    --k-text-2: #3D3D3D;
    --k-muted: #66625E;
    --k-faint: #6B6762;
    --k-ink: #1A1A1A;
    --k-on-ink: #FFFFFF;
    --k-danger: #C62828;
    --k-danger-bg: rgba(198, 40, 40, 0.08);
    --k-success: #1B7A43;
    --k-success-bg: rgba(27, 122, 67, 0.10);
    --k-accent-text: #B5532F;
  }

  /* Buttons and pills that were white-on-dark become dark-on-light */
  html.k-auto .k-sharelink:not(.k-sharelink--compact) { background: var(--k-ink); color: var(--k-on-ink); }
  html.k-auto .k-btn--danger { color: #fff; }
  html.k-auto .k-pill--todo { background: var(--k-ink); color: var(--k-on-ink); }
  html.k-auto .k-badge--claimed, html.k-auto .k-pill--claimed { background: #DFF3E6; color: var(--k-success); }
  html.k-auto .k-tagchip--on, html.k-auto .k-review__btn--main { background: var(--k-ink); color: var(--k-on-ink); }

  /* Badges that sit on photos stay dark glass with light text */
  html.k-auto .k-badge--done, html.k-auto .k-clip, html.k-auto .k-count { color: #E6E6E6; }

  /* Light-grey lines and tints that assumed a dark page */
  html.k-auto .k-seg__btn.is-active { background: var(--k-bg); }
  html.k-auto .k-now__item { border-bottom-color: var(--k-border); }
  html.k-auto .k-spinner { border-color: rgba(0, 0, 0, 0.12); border-top-color: var(--k-text); }
  html.k-auto .k-tagbtn, html.k-auto .k-pile__arrow, html.k-auto .k-fab__alt { border-color: var(--k-border-strong); }
  html.k-auto .k-pile__card { border-color: var(--k-border); }
  html.k-auto .k-prow--link:active { background: rgba(0, 0, 0, 0.05); }
  html.k-auto .k-ob__dot { background: rgba(0, 0, 0, 0.18); }
  html.k-auto .k-ob__dot.is-on { background: #E08E78; }
  html.k-auto .k-switch input[type=checkbox] { background: rgba(0, 0, 0, 0.18); }
  html.k-auto .k-switch input[type=checkbox]:checked { background: #E08E78; }
  html.k-auto .k-ob__widget { border: 1px solid var(--k-border-strong); }
  html.k-auto .k-sim__cap { color: var(--k-text-2); }

  /* Check boxes, progress, hover borders */
  html.k-auto .k-checkline input, html.k-auto .k-pick input, html.k-auto.k-dark .accent-gray-900 { accent-color: var(--k-ink); }
  html.k-auto .k-progress__bar { background: var(--k-ink); }
  html.k-auto .k-drop:hover { border-color: var(--k-ink); color: var(--k-ink); }

  /* Red and orange text and tints */
  html.k-auto .k-flash--error, html.k-auto .k-errors { border-color: rgba(198, 40, 40, 0.4); background: var(--k-danger-bg); }
  html.k-auto .k-btn--outline-danger { border-color: rgba(198, 40, 40, 0.45); }
  html.k-auto .k-now__when.is-overdue { color: var(--k-danger); }
  html.k-auto .k-due--overdue { color: var(--k-danger); background: var(--k-danger-bg); }
  html.k-auto .k-delete > summary { color: var(--k-danger) !important; }

  /* Peach on dark becomes a deeper peach on light, so text and icons stay readable */
  html.k-auto .k-fab__item svg, html.k-auto .k-ob__icon { color: var(--k-accent-text); }
  html.k-auto .k-price-link, html.k-auto .k-notelink, html.k-auto .k-memberaction,
  html.k-auto .k-share-foot a { color: var(--k-accent-text); }
  html.k-auto input:focus-visible, html.k-auto textarea:focus-visible, html.k-auto [tabindex]:focus-visible { outline-color: var(--k-accent-text) !important; }

  /* Shadows are lighter on a light page */
  html.k-auto .k-fab__btn { box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22); }
  html.k-auto .k-fab__item { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16); }
  html.k-auto .k-info__pop { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }

  /* Compatibility layer (Tailwind classes recoloured for dark) */
  html.k-auto.k-dark .text-gray-600 { color: #555; }
  html.k-auto.k-dark .text-gray-300 { color: #8A8A8A; }
  html.k-auto.k-dark .border-gray-100 { border-color: #EDEAE6; }
  html.k-auto.k-dark .border-gray-900, html.k-auto.k-dark .hover\:border-gray-900:hover,
  html.k-auto.k-dark .focus\:border-gray-900:focus { border-color: var(--k-ink); }
  html.k-auto.k-dark .border-red-200 { border-color: rgba(198, 40, 40, 0.25); }
  html.k-auto.k-dark .border-red-300 { border-color: rgba(198, 40, 40, 0.45); }
  html.k-auto.k-dark .hover\:border-gray-400:hover { border-color: #999; }
  html.k-auto.k-dark .hover\:bg-black:hover { background-color: #333; }
}

/* native search bar: once the app confirms its own search bar is showing, the page's box is hidden */
.has-native-search .k-search { display: none; }
.has-native-search .k-searchrow { justify-content: flex-end; }

/* group page v2: calmer header, one slim status switch, one chip row */
.k-header { margin-bottom: 14px; }
.k-header__row .k-title { min-width: 0; overflow-wrap: anywhere; }
.k-title__crown { display: inline-flex; vertical-align: -2px; margin-left: 6px; opacity: .85; }
.k-gmenu { position: static; margin-left: auto; }
.k-gmenu > summary { list-style: none; cursor: pointer; }
.k-gmenu > summary::-webkit-details-marker { display: none; }
.k-gmenu[open] > summary { background: var(--k-surface-2); }
.k-gmenu__pop, .k-sortmenu__pop { position: absolute; z-index: 30; top: 100%; margin-top: 6px; padding: 8px; border-radius: 14px;
  background: var(--k-surface-2); border: 1px solid var(--k-border-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.k-gmenu__pop { right: 0; min-width: 240px; max-width: min(320px, 92vw); }
.k-gmenu__role { display: flex; align-items: center; gap: 6px; margin: 4px 8px 2px; font-size: 13px; font-weight: 600; }
.k-gmenu__note { margin: 0 8px 8px; font-size: 13px; line-height: 1.45; color: var(--k-muted); }
.k-gmenu__item, .k-sortmenu__item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px;
  padding: 0 10px; border-radius: 10px; color: var(--k-text); text-decoration: none; font-size: 15px; font-weight: 500; }
.k-gmenu__item:active, .k-sortmenu__item:active { background: var(--k-surface); }
.k-sortmenu { position: relative; display: inline-block; }
.k-sortmenu > summary { list-style: none; cursor: pointer; }
.k-sortmenu > summary::-webkit-details-marker { display: none; }
.k-sortmenu__pop { left: 0; min-width: 190px; display: flex; flex-direction: column; }
.k-sortmenu__item.is-active { font-weight: 700; background: var(--k-surface); }
.k-tagbtn--link { text-decoration: none; }
.k-tiles { flex-wrap: nowrap; gap: 4px; padding: 5px; margin: 0 0 12px; background: var(--k-surface-2); border-radius: 12px; }
.k-tile { flex: 1; width: auto; min-width: 0; flex-direction: row; justify-content: center; gap: 0; padding: 10px 0; border-radius: 9px; opacity: .6; }
.k-tile.is-active { opacity: 1; background: rgba(255, 255, 255, .12); }
.k-tile__box { display: none; }
.k-tile__label { font-size: 14px; }
.k-search { margin-bottom: 14px; }
@media (prefers-color-scheme: light) {
  html.k-auto .k-tile.is-active { background: var(--k-bg); }
  html.k-auto .k-gmenu__pop, html.k-auto .k-sortmenu__pop { box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
}

/* group page v2.1: tighter tiles and chips */
.k-tiles { gap: 2px; padding: 4px; }
.k-tile { flex: 1 1 auto; padding: 10px 6px; white-space: nowrap; }
.k-tile__label { font-size: 13px; font-weight: 600; letter-spacing: 0; }
.k-tagbar { flex-wrap: wrap; gap: 8px; }
.k-tagbar .k-tagbtn { padding: 8px 12px; font-size: 14px; gap: 6px; white-space: nowrap; }

/* tags sheet: no scrolling the page behind it */
html.k-scroll-lock, html.k-scroll-lock body { overflow: hidden; }
dialog.k-tagsheet { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* shared-list page: link settings row, calmer preview rows */
.k-linkset { padding: 0; }
.k-linkset__sum { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none; }
.k-linkset__sum::-webkit-details-marker { display: none; }
.k-linkset__title { font-weight: 600; font-size: 15px; }
.k-linkset__state { flex: 1; min-width: 0; text-align: right; font-size: 13px; color: var(--k-muted); }
.k-linkset[open] > .k-linkset__sum svg { transform: rotate(180deg); }
.k-linkset__body { padding: 0 16px 16px; }
.k-linkset__more { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--k-border); }
.k-linkset__more form { margin: 0; }
.k-share-row__status--done { color: var(--k-success, #6fcf97); font-weight: 600; }

/* swipe: "Move to today" sits left of Delete on overdue to-dos */
.k-swipe__form--today { right: 92px; width: 96px; }
.k-swipe__btn--today { background: var(--k-ink, #F2EFEC); color: var(--k-on-ink, #1A1A1A); font-size: 13px; line-height: 1.15; padding: 0 6px; }

/* Android app: its bottom bar is outside the web view, so no extra lift for the + and camera buttons */
.k-native.k-android { --k-dock-offset: 0px; }

/* todo views: four labels in one row; completed section under Pending */
.k-seg--four { gap: 2px; padding: 4px; }
.k-seg--four .k-seg__btn { flex: 1 1 auto; padding-left: 6px; padding-right: 6px; font-size: 14px; white-space: nowrap; }
.k-completed { margin: 28px 0 0; }
.k-completed__sum { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 4px; cursor: pointer; list-style: none; font-size: 15px; font-weight: 600; color: var(--k-muted); border-top: 1px solid var(--k-border); }
.k-completed__sum::-webkit-details-marker { display: none; }
.k-completed[open] > .k-completed__sum svg { transform: rotate(180deg); }


/* Members page v2 */
.k-members__count { margin: 6px 0 18px; font-size: 14px; }
.k-members { display: grid; gap: 10px; }
.k-member { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; row-gap: 10px; align-items: center; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--k-border); }
.k-member__avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--k-surface-2, rgba(255,255,255,.08)); color: var(--k-muted); font-size: 16px; font-weight: 600; }
.k-member__body { min-width: 0; }
.k-member__name { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.k-member__you { margin-left: 6px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--k-border); font-size: 11px; font-weight: 600; color: var(--k-muted); vertical-align: 1px; }
.k-member__role { margin: 2px 0 0; display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--k-muted); }
.k-member__role svg { fill: currentColor; }
.k-member__actions { grid-column: 2; display: flex; gap: 10px; align-items: center; }
.k-member__form { margin: 0; }
.k-memberbtn { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; height: 40px; line-height: 1; padding: 0 16px; border-radius: 999px; border: 1px solid var(--k-border); background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--k-text); text-decoration: none; cursor: pointer; }
.k-memberbtn--danger { color: var(--k-danger); border-color: currentColor; }
.k-auth > .k-section-sm > .k-memberaction { padding-left: 0; }


/* Item page v2: quick links row (shared list, price search) and tags at the bottom */
.k-detail-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 22px 0 0; }
.k-detail-links .k-detail-chip, .k-detail-links .k-price-link { margin: 0; }
.k-page-head ~ .k-tagrow { margin: 30px 0 0; }

/* ---------- Mascot (Pip) ---------- */
/* Swap characters by replacing shared/_mascot_art.html.erb and this block.
   Keep four moods on .k-mascot[data-mood]: idle, wave, empty, celebrate. */
.k-mascot { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; margin: 28px 0; }
.k-mascot__text { margin: 0; font-size: 14px; color: var(--k-muted); }
.k-pip { overflow: visible; max-width: 60vw; height: auto; }
.k-pip * { transform-box: fill-box; }
.pip-shadow { transform-origin: center; animation: pip-shadow 3.2s ease-in-out infinite; }
.pip-all { transform-origin: 50% 100%; animation: pip-bob 3.2s ease-in-out infinite; }
.pip-leaf { transform-origin: 20% 100%; animation: pip-sway 4s ease-in-out infinite; }
.pip-eye { transform-origin: center; animation: pip-blink 4.8s infinite; }
.pip-arm-l, .pip-arm-r { transform-origin: 50% 0%; }
.pip-mouth, .pip-spark, .pip-eye-e, .pip-eye-happy, .pip-arm-wave { display: none; }
.k-pip .pip-arm-wave { transform-box: view-box; transform-origin: 162px 126px; }
.k-mascot[data-mood="idle"] .pip-m-idle, .k-mascot[data-mood="wave"] .pip-m-idle { display: inline; }
.k-mascot[data-mood="wave"] .pip-arm-r { display: none; }
.k-mascot[data-mood="wave"] .pip-arm-wave { display: inline; animation: pip-wave .8s ease-in-out infinite; }
.k-mascot[data-mood="empty"] .pip-m-empty { display: inline; }
.k-mascot[data-mood="empty"] .pip-eye { display: none; }
.k-mascot[data-mood="empty"] .pip-eye-e { display: inline; }
.k-mascot[data-mood="empty"] .pip-all { animation: pip-sigh 4s ease-in-out infinite; }
.k-mascot[data-mood="celebrate"] .pip-m-party { display: inline; }
.k-mascot[data-mood="celebrate"] .pip-eye { display: none; }
.k-mascot[data-mood="celebrate"] .pip-eye-happy { display: inline; }
.k-mascot[data-mood="celebrate"] .pip-all { animation: pip-jump 1.1s cubic-bezier(.3, .7, .4, 1) infinite; }
.k-mascot[data-mood="celebrate"] .pip-shadow { animation: pip-shadow-jump 1.1s infinite; }
.k-mascot[data-mood="celebrate"] .pip-arm-l { animation: pip-cheer-l .55s ease-in-out infinite alternate; }
.k-mascot[data-mood="celebrate"] .pip-arm-r { animation: pip-cheer-r .55s ease-in-out infinite alternate; }
.k-mascot[data-mood="celebrate"] .pip-spark { display: inline; animation: pip-pop 1.1s ease-out infinite; }
.k-mascot[data-mood="celebrate"] .pip-spark-2 { animation-delay: .25s; }
.k-mascot[data-mood="celebrate"] .pip-spark-3 { animation-delay: .5s; }
@keyframes pip-bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-6px) scale(.985, 1.02); } }
@keyframes pip-shadow { 0%, 100% { transform: scale(1); opacity: .1; } 50% { transform: scale(.88); opacity: .06; } }
@keyframes pip-sway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(7deg); } }
@keyframes pip-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes pip-wave { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(16deg); } }
@keyframes pip-jump { 0%, 100% { transform: translateY(0) scale(1.04, .94); } 40% { transform: translateY(-34px) scale(.96, 1.05); } 70% { transform: translateY(0) scale(1.05, .95); } }
@keyframes pip-shadow-jump { 0%, 100% { transform: scale(1); opacity: .1; } 40% { transform: scale(.6); opacity: .04; } }
@keyframes pip-cheer-l { from { transform: rotate(18deg); } to { transform: rotate(-24deg); } }
@keyframes pip-cheer-r { from { transform: rotate(-18deg); } to { transform: rotate(24deg); } }
@keyframes pip-pop { 0% { opacity: 0; transform: scale(.2) translateY(10px); } 35% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(.8) translateY(-14px); } }
@keyframes pip-sigh { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(3px) scale(1.03, .97); } }
@media (prefers-reduced-motion: reduce) { .k-pip * { animation: none !important; } }

/* ---------- Form header (Cancel) ---------- */
.k-formhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.k-formhead .k-title { margin: 0; }
.k-cancel { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 6px; margin-right: -6px; font-size: 16px; font-weight: 600; color: var(--k-text-2); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.k-cancel:active { opacity: .5; }

/* ---------- Tips card ---------- */
.k-tips { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 20px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--k-border); background: var(--k-surface); }
.k-tips__title { margin: 0; font-size: 14px; font-weight: 600; color: var(--k-text); }
.k-tips__list { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.5; color: var(--k-text-2); }
.k-tips__list li + li { margin-top: 4px; }
.k-tips form { margin: 0; }

/* ---------- Receipt button ---------- */
#item_status > .k-receipt { margin: 14px 0 0; }

/* ---------- Touch ---------- */
/* iOS draws a grey box on every tapped link unless told not to. Controls that need
   feedback have their own pressed state. */
html { -webkit-tap-highlight-color: transparent; }
.k-chip:active, .k-tagchip:active { opacity: .6; }
/* Small controls keep their look but get a bigger area that responds to a tap. */
.k-chip, .k-datechip__x { position: relative; }
.k-chip::after, .k-datechip__x::after { content: ""; position: absolute; inset: -6px; }
