@media (orientation: portrait) and (max-width: 600px) {
  /* Match the larger iPhone's home-indicator spacing across phone widths. */
  html[data-shell="dom"][data-standalone="true"] .shell-pane[data-chrome="compact"] {
    --shell-chrome-edge: max(calc(15px + var(--shell-safe-right)), calc(var(--shell-safe-bottom) - 6px));
  }
}

/* The action covers the title; inline links sit above it as separate controls. */
html[data-shell="dom"] .shell-task {
  padding-block: var(--shell-space-6);
}
html[data-shell="dom"] .shell-task-heading {
  position: relative;
  min-height: 26px;
  font-size: var(--shell-text-control);
  line-height: var(--shell-leading-copy);
  color: var(--shell-ink);
}
html[data-shell="dom"] .shell-task-heading > .shell-task-title {
  position: absolute;
  inset: 0;
  height: 100%;
  min-height: 26px;
}
html[data-shell="dom"] .shell-task-body {
  min-height: 34px;
}
html[data-shell="dom"] .shell-task .shell-task-properties {
  margin-top: 2px;
}
.shopping-conflict-label {
  margin-block: 2px;
  color: var(--color-foreground-secondary);
  font-size: var(--shell-text-small);
  font-weight: 600;
}
.shell-task .shell-task-properties > .shopping-item-tags {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.shopping-item-tag {
  display: inline-flex;
  align-items: flex-start;
  max-inline-size: 100%;
  vertical-align: top;
}
.shopping-item-tag > .shopping-tag-glyph {
  margin-block-start: calc((1lh - 1.15em) / 2);
}
/* Keep the dock and inline editor in the visible area in a browser tab too. */
.shell-app:has(.shopping-inline-item) {
  height: var(--shell-keyboard-height, auto);
}
html[data-shell="dom"] .shopping-inline-item .shell-field {
  gap: 0;
  margin: 0;
}
.shopping-inline-item .shell-field > label {
  display: none;
}
html[data-shell="dom"] .shopping-inline-item .shell-field textarea {
  min-height: 26px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  line-height: inherit;
}
.shell-task-heading > .shell-label,
dialog[data-sheet-id^="task-actions:"] .shell-label {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
html[data-shell="dom"] .shell-task-heading > .shell-label {
  display: block;
  position: relative;
  pointer-events: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
html[data-shell="dom"] .shell-task-heading a {
  pointer-events: auto;
}
html[data-shell="dom"] .shell-task[data-read-only] .shell-task-heading > .shell-label {
  pointer-events: auto;
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
}
html[data-shell="dom"] .shell-task-heading mark {
  color: inherit;
  background: var(--color-selection-background);
}

/* Shopping owns transition states; the shared shell owns row geometry. */
html[data-shell="dom"] .shell-task .shell-task-check {
  color: var(--color-foreground-secondary);
}
html[data-shell="dom"] .shell-task .shell-task-check::before {
  top: 6px;
  left: 0;
  width: 32px;
  height: 32px;
  border-color: var(--color-foreground-secondary);
}
html[data-shell="dom"] .shell-task .shell-task-check .shell-icon {
  top: 12px;
  left: 6px;
  width: 20px;
  height: 20px;
}
html[data-shell="dom"] .shell-task .shell-task-check[data-permanent]::before {
  border-style: dashed;
}
html[data-shell="dom"] .shell-task .shell-slide-action[data-danger="true"] {
  background: var(--color-error);
  color: var(--color-background-canvas);
  border-color: var(--color-error);
}
html[data-shell="dom"] .shell-task .shell-slide-action-copy {
  padding-inline: 4px;
  text-align: center;
}
html[data-shell="dom"] .shell-task .shell-task-check[aria-checked="true"] {
  color: var(--color-on-accent);
}
html[data-shell="dom"] .shell-task .shell-task-check[aria-checked="true"]::before {
  background: var(--color-foreground-secondary);
  border-color: var(--color-foreground-secondary);
}
html[data-shell="dom"] .shell-task[data-transition] :is(.shell-task-title, .shell-task-heading) {
  color: var(--color-foreground-secondary);
}
html[data-shell="dom"] .shell-task[data-transition^="complete"] .shell-task-properties {
  opacity: .45;
}
html[data-shell="dom"] .shell-task[data-transition="delete"] {
  --task-transition-color: var(--color-error);
}
html[data-shell="dom"] .shell-task[data-transition="delete"]
  :is(.shell-task-body, .shell-task-body *, .shell-task-marker) {
  color: var(--task-transition-color);
  accent-color: var(--task-transition-color);
}
html[data-shell="dom"] .shell-task[data-transition="delete"]
  .shell-property::before {
  color: var(--task-transition-color);
}
html[data-shell="dom"] .shell-task[data-transition="delete"] :is(.shell-task-body, .shell-task-marker) {
  opacity: .45;
}
html[data-shell="dom"] .shell-task .shell-task-marker::before {
  display: none;
}
html[data-shell="dom"] .shell-task .shell-task-marker .shell-icon {
  left: 2px;
  top: 9px;
  width: 26px;
  height: 26px;
}

/* The snow loops by exactly one tile, with slower, smaller flakes behind. */
:root[data-shopping-theme="theme:shopping-preset:christmas"] .shopping-theme-preview {
  position: relative;
  overflow: hidden;
}
:root[data-shopping-theme="theme:shopping-preset:christmas"]
  :is(.shell-pane, .shopping-theme-preview)::before,
:root[data-shopping-theme="theme:shopping-preset:christmas"]
  :is(.shell-pane, .shopping-theme-preview)::after {
  position: absolute;
  inset: calc(-1 * var(--snow-tile-height)) 0 0;
  z-index: 1;
  content: "";
  pointer-events: none;
  background-size: var(--snow-tile-width) var(--snow-tile-height);
}
:root[data-shopping-theme="theme:shopping-preset:christmas"]
  :is(.shell-pane, .shopping-theme-preview)::before {
  --snow-tile-width: 249px;
  --snow-tile-height: 212px;
  --snow-fall-duration: 22s;
  --snow-flake: rgb(241 255 249 / 42%);
  background-image:
    radial-gradient(circle at 10% 19%, var(--snow-flake) 1px, transparent 1.7px),
    radial-gradient(circle at 42% 8%, var(--snow-flake) .8px, transparent 1.5px),
    radial-gradient(circle at 70% 39%, var(--snow-flake) .9px, transparent 1.6px),
    radial-gradient(circle at 29% 73%, var(--snow-flake) 1px, transparent 1.7px),
    radial-gradient(circle at 87% 89%, var(--snow-flake) .9px, transparent 1.6px);
}
:root[data-shopping-theme="theme:shopping-preset:christmas"]
  :is(.shell-pane, .shopping-theme-preview)::after {
  --snow-tile-width: 331px;
  --snow-tile-height: 268px;
  --snow-fall-duration: 15s;
  --snow-flake: rgb(250 255 252 / 70%);
  background-image:
    radial-gradient(circle at 19% 43%, var(--snow-flake) 1.55px, transparent 2.35px),
    radial-gradient(circle at 77% 23%, var(--snow-flake) 1.8px, transparent 2.6px),
    radial-gradient(circle at 53% 87%, var(--snow-flake) 1.5px, transparent 2.3px),
    radial-gradient(circle at 94% 66%, var(--snow-flake) 1.65px, transparent 2.45px);
}
@media (prefers-reduced-motion: no-preference) {
  :root[data-shopping-theme="theme:shopping-preset:christmas"]
    :is(.shell-pane, .shopping-theme-preview)::before,
  :root[data-shopping-theme="theme:shopping-preset:christmas"]
    :is(.shell-pane, .shopping-theme-preview)::after {
    animation: shopping-snow-fall var(--snow-fall-duration) linear infinite;
  }
}
@keyframes shopping-snow-fall {
  to { transform: translateY(var(--snow-tile-height)); }
}
