.shopping-page{max-width:820px;margin:0 auto}.shopping-head{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:28px}.shopping-head h1,.shopping-list-head h1{margin-bottom:8px}.shopping-create{position:relative;flex:0 0 auto}.shopping-create>summary{list-style:none;margin:0}.shopping-create>summary::-webkit-details-marker{display:none}.shopping-create form{position:absolute;right:0;z-index:20;width:min(360px,calc(100vw - 36px));padding:18px;background:var(--theme-surface);border:1px solid var(--line);border-radius:14px 0 14px 14px;box-shadow:0 18px 45px rgba(25,59,52,.14)}.shopping-create form button{width:100%}.shopping-empty,.shopping-list-empty{padding:48px 24px;text-align:center;border:1px dashed #afc1aa;border-radius:18px}.shopping-empty p,.shopping-list-empty p{max-width:430px;margin:10px auto 0}.shopping-empty-icon{width:54px;height:54px;display:grid;place-items:center;margin:0 auto 16px;border-radius:16px;background:#e8ede1}.shopping-empty-icon svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.shopping-list-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.shopping-list-card{display:block;min-height:170px;padding:22px;background:var(--theme-surface);border:1px solid var(--line);border-radius:18px;text-decoration:none;transition:transform .12s ease,border-color .12s ease,box-shadow .12s ease}.shopping-list-card:hover{transform:translateY(-1px);border-color:#bdc9bb;box-shadow:0 9px 22px rgba(25,59,52,.06)}.shopping-list-card-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:22px}.shopping-list-card-top svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.shopping-list-card h2{font-size:26px;margin-bottom:10px}.shopping-list-card p{margin:0;color:var(--muted);font-size:14px}.shopping-list-card p strong{color:var(--ink)}.shopping-list-title-meta{display:flex;align-items:center;gap:10px;margin-bottom:8px}.shopping-add-item{display:grid;grid-template-columns:minmax(0,1fr) 190px auto;gap:9px;align-items:center;margin:0 0 28px;padding:12px;background:var(--theme-surface);border:1px solid var(--line);border-radius:14px}.shopping-add-item input,.shopping-add-item select{min-height:44px}.shopping-add-item button{min-height:44px;margin:0}.shopping-category-stack{display:grid;gap:22px}.shopping-category{background:var(--theme-surface);border:1px solid var(--line);border-radius:16px;overflow:hidden}.shopping-template-products-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 18px;border-bottom:1px solid var(--theme-divider);background:var(--theme-surface-raised)}.shopping-template-products-head h2{font-size:17px;margin:0}.shopping-template-products-head>span{font-size:12px;color:var(--muted)}.shopping-items{display:grid}.shopping-item{display:grid;grid-template-columns:42px 42px minmax(0,1fr) 42px;align-items:center;min-height:56px;padding:0 8px;border-bottom:1px solid var(--theme-divider)}.shopping-item:last-child{border-bottom:0}.shopping-item form{margin:0}.shopping-item form>button{margin:0}.shopping-check,.shopping-remove{width:36px;height:36px;padding:0;display:grid;place-items:center;background:transparent;color:var(--ink);border:0}.shopping-check{width:26px;height:26px;margin-left:5px!important;border:1.5px solid #91a398!important;border-radius:50%!important;font-size:14px}@media (hover:hover) and (pointer:fine){.shopping-check:hover{background:var(--theme-surface-soft)}}
@media (hover:none), (pointer:coarse){.shopping-check:hover{background:transparent}}.shopping-check.is-checked{background:var(--green);border-color:#729267!important}.shopping-remove{font-size:22px;color:#8a938e;border-radius:9px}.shopping-remove:hover{background:#f1f2ee;color:var(--ink)}.shopping-item-name{padding:10px 6px;overflow-wrap:anywhere}.shopping-item.is-done .shopping-item-name{text-decoration:line-through;color:var(--muted)}.shopping-completed,.shopping-settings{margin-top:24px;border:1px solid var(--line);border-radius:14px;background:var(--theme-surface);overflow:hidden}.shopping-completed>summary,.shopping-settings>summary{display:flex;align-items:center;justify-content:space-between;min-height:50px;padding:12px 16px;list-style:none}.shopping-completed>summary::-webkit-details-marker,.shopping-settings>summary::-webkit-details-marker{display:none}.shopping-completed>summary span{font-size:12px;color:var(--muted)}.shopping-completed[open]>summary,.shopping-settings[open]>summary{border-bottom:1px solid var(--line)}.shopping-settings{margin-top:34px}.shopping-settings>form{padding:16px;margin:0}.shopping-settings>form+form{padding-top:0}.shopping-settings button{margin-top:16px}.shopping-delete-list button{color:#8a2f27}.shopping-back{margin-bottom:18px}

@media(max-width:700px){.shopping-list-page{padding-bottom:calc(var(--shopping-list-bottom-clearance,0px) + var(--shopping-quantity-picker-clearance,0px))}.shopping-page{max-width:none}.shopping-head{display:block;margin-bottom:20px}.shopping-head .lede{font-size:15px}.shopping-create{margin-top:16px}.shopping-create>summary{width:100%;text-align:center}.shopping-create form{position:static;width:100%;border-radius:0 0 14px 14px;box-shadow:none}.shopping-list-grid{grid-template-columns:1fr}.shopping-list-card{min-height:145px}.shopping-list-card h2{font-size:23px}.shopping-add-item{grid-template-columns:minmax(0,1fr) auto;padding:9px;gap:8px}.shopping-add-item select{grid-column:1/-1;grid-row:2}.shopping-add-item button{grid-column:2;grid-row:1;padding:9px 13px}.shopping-list-head h1{font-size:32px}.shopping-back{margin-bottom:10px}.shopping-category-stack{gap:10px}.shopping-category{border-radius:12px}.shopping-template-products-head{padding:12px}.shopping-item{min-height:54px}.shopping-settings{margin-top:26px}}


.shopping-list-head{position:relative;display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:22px}
.shopping-add-panel{position:relative;flex:0 0 auto}
.shopping-add-panel>summary{list-style:none}
.shopping-add-panel>summary::-webkit-details-marker{display:none}
.shopping-add-panel[open] .shopping-add-toggle svg{transform:rotate(45deg)}
.shopping-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.shopping-add-popover{position:absolute;z-index:40;top:58px;right:0;width:min(390px,calc(100vw - 36px));padding:12px;background:var(--theme-surface);border:1px solid var(--line);border-radius:16px;box-shadow:0 18px 45px rgba(25,59,52,.16);overflow:hidden}
.shopping-add-popover form{margin:0}
.shopping-product-entry{position:relative}
.shopping-product-entry-row{display:grid;grid-template-columns:minmax(0,1fr);align-items:center;gap:8px}
.shopping-product-entry input{min-width:0;margin:0;font-size:16px}
.shopping-add-close{display:none}
.shopping-suggestions{z-index:45;display:grid;margin-top:8px;background:var(--theme-surface);border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 28px rgba(25,59,52,.14);overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.shopping-suggestions[hidden]{display:none}
.shopping-suggestion{display:grid;grid-template-columns:minmax(0,1fr) 32px;align-items:center;gap:7px;width:100%;min-height:46px;margin:0;padding:5px 8px 5px 10px;text-align:left;background:var(--theme-surface);color:var(--ink);border:0;border-bottom:1px solid var(--theme-divider);border-radius:0;font-weight:400}
.shopping-suggestion:last-child{border-bottom:0}
.shopping-suggestion:hover,.shopping-suggestion:focus-within{background:var(--theme-surface-soft);color:var(--ink)}
.shopping-suggestion-main{display:grid;gap:1px;min-width:0}
.shopping-suggestion-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px;line-height:1.25;font-weight:650}
.shopping-suggestion-meta{min-width:0;overflow:hidden;color:var(--muted);font-size:11px;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}
.shopping-suggestion-add{width:30px;height:30px;min-height:30px;margin:0;padding:0;display:grid;place-items:center;border:1px solid var(--line);border-radius:50%;background:var(--theme-surface-raised);color:var(--ink);font-size:20px;line-height:1}
.shopping-suggestion-add:hover,.shopping-suggestion-add:focus-visible{background:var(--theme-surface-soft);color:var(--ink)}
.shopping-suggestion-add:disabled{opacity:.45}
.shopping-suggestion-new{background:var(--theme-surface-soft)}
.shopping-add-message{margin:8px 2px 0}
.shopping-quantity-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px}
.shopping-quantity-label{font-size:13px;font-weight:650}
.shopping-quantity-control{display:grid;grid-template-columns:42px 58px 42px;gap:6px;align-items:center}
.shopping-quantity-control button{width:42px;height:42px;min-height:42px;margin:0;padding:0;border-radius:10px;font-size:20px}
.shopping-quantity-control input{height:42px;min-height:42px;padding:6px;text-align:center}
.shopping-item-quantity{font-size:13px;font-weight:750;color:var(--muted);text-align:center}
.shopping-list-empty{margin-top:4px}

@media(max-width:700px){
  .shopping-list-head{margin-bottom:12px}
  .shopping-add-panel[open]>.shopping-add-toggle{visibility:hidden;pointer-events:none}
  .shopping-add-popover{
    position:fixed;
    z-index:140;
    top:calc(env(safe-area-inset-top) + 8px);
    left:6px;
    right:6px;
    width:auto;
    max-width:none;
    padding:8px;
  }
  .shopping-product-entry-row{grid-template-columns:minmax(0,1fr) 44px;gap:14px}
  .shopping-add-close{display:grid;width:44px;height:44px;min-height:44px;flex-basis:44px}
  .shopping-add-close svg{width:21px;height:21px}
  .shopping-suggestions{margin-top:6px}
  .shopping-suggestion{grid-template-columns:minmax(0,1fr) 30px;gap:6px;min-height:44px;padding:5px 8px}
  .shopping-suggestion-add{width:28px;height:28px;min-height:28px;font-size:19px}
  .shopping-suggestions-label{padding:6px 10px 4px;font-size:10px}
  .shopping-list-title-meta{margin-bottom:6px}
}


/* Shopping disclosures: scope all list-category rules to real list categories.
 * Product-group headers reuse the legacy class name and must remain independent.
 */
[data-shopping-category]{
  --shopping-category-head-bg:var(--theme-surface-raised);
  --shopping-category-head-control-bg:var(--theme-surface);
  --shopping-category-head-control-hover:var(--theme-surface-soft);
}
/* The category card normally clips its children for rounded corners.
 * While a quantity picker is open, its popover must be allowed to escape
 * the card and the active card must paint above following category cards.
 * This keeps the stepper in the foreground on iOS/WebKit when the last row
 * overlaps the next category.
 */
[data-shopping-category].has-open-quantity-picker{position:relative;z-index:2;overflow:visible}
[data-shopping-category].has-open-quantity-picker > .shopping-category-head{
  border-top-left-radius:inherit;
  border-top-right-radius:inherit;
}
[data-shopping-category].has-open-quantity-picker > [data-shopping-category-items]{
  border-bottom-left-radius:inherit;
  border-bottom-right-radius:inherit;
}
[data-shopping-category].has-open-quantity-picker > [data-shopping-category-items] > .shopping-item:last-child{
  border-bottom-left-radius:inherit;
  border-bottom-right-radius:inherit;
}
[data-shopping-category] > .shopping-category-head{
  display:block;
  padding:0;
  border-bottom:1px solid var(--theme-divider);
  background:var(--shopping-category-head-bg);
}
[data-shopping-category].is-collapsed > .shopping-category-head{border-bottom:0}
[data-shopping-category] .shopping-category-head-display{
  display:flex;
  align-items:stretch;
  justify-content:space-between;
  width:100%;
  min-width:0;
  min-height:48px;
  cursor:pointer;
  touch-action:manipulation;
}
[data-shopping-category] .shopping-category-head-display[hidden]{display:none!important}
[data-shopping-category] .shopping-category-name-group{
  display:flex;
  flex:1 1 auto;
  align-items:stretch;
  min-width:0;
}
[data-shopping-category] .shopping-category-collapse-toggle{
  display:flex;
  flex:0 1 auto;
  align-items:center;
  width:auto;
  max-width:100%;
  min-width:0;
  min-height:48px;
  margin:0;
  padding:9px 4px 9px 12px;
  border:0!important;
  border-radius:0;
  background:transparent!important;
  box-shadow:none!important;
  color:var(--ink)!important;
  text-align:left;
  cursor:pointer;
}
[data-shopping-category] .shopping-category-collapse-toggle[hidden]{display:none!important}
[data-shopping-category] .shopping-category-collapse-toggle:hover{background:transparent!important;color:var(--ink)!important}
[data-shopping-category] .shopping-category-collapse-toggle:focus-visible{outline:3px solid #b97612;outline-offset:-3px}
[data-shopping-category] .shopping-category-title{
  min-width:0;
  overflow:hidden;
  color:var(--ink);
  font-size:17px;
  font-weight:800;
  line-height:1.25;
  text-align:left;
  text-overflow:ellipsis;
  white-space:nowrap;
}
[data-shopping-category] .shopping-category-meta{
  display:flex;
  flex:0 0 auto;
  align-items:stretch;
  justify-content:flex-end;
  margin-left:auto;
  min-height:48px;
}
[data-shopping-category] .shopping-category-count{
  display:grid;
  min-width:22px;
  place-items:center;
  padding:0 2px;
  color:var(--muted);
  font-size:12px;
}
[data-shopping-category] .shopping-category-edit-toggle{
  display:none;
  flex:0 0 38px;
  place-items:center;
  align-self:stretch;
  width:38px;
  min-width:38px;
  min-height:48px;
  margin:0;
  padding:0;
  border:0!important;
  border-radius:0;
  background:transparent!important;
  box-shadow:none!important;
  color:var(--muted)!important;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
[data-shopping-category].is-collapsed:not(.is-editing) .shopping-category-edit-toggle{display:grid}
[data-shopping-category] .shopping-category-chevron-toggle{
  display:grid;
  place-items:center;
  align-self:stretch;
  width:38px;
  min-width:38px;
  min-height:48px;
  margin:0;
  padding:0;
  border:0!important;
  border-radius:0;
  background:transparent!important;
  box-shadow:none!important;
  color:var(--muted)!important;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
[data-shopping-category] .shopping-category-edit-toggle:hover,
[data-shopping-category] .shopping-category-chevron-toggle:hover{
  background:var(--shopping-category-head-control-hover)!important;
  color:var(--ink)!important;
}
[data-shopping-category] .shopping-category-edit-toggle:focus-visible,
[data-shopping-category] .shopping-category-chevron-toggle:focus-visible{outline:3px solid #b97612;outline-offset:-3px}
[data-shopping-category] .shopping-category-edit-toggle svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
[data-shopping-category] .shopping-category-chevron{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s ease}
[data-shopping-category]:not(.is-collapsed) .shopping-category-chevron{transform:rotate(180deg)}
[data-shopping-category] .shopping-category-inline-editor{
  display:grid;
  grid-template-columns:minmax(0,1fr) 38px 38px 40px;
  align-items:center;
  gap:6px;
  width:100%;
  min-width:0;
  min-height:52px;
  padding:6px 10px;
  box-sizing:border-box;
  background:var(--shopping-category-head-bg)!important;
}
[data-shopping-category] .shopping-category-inline-editor[hidden]{display:none!important}
[data-shopping-category] .shopping-category-inline-editor input{
  min-width:0;
  width:100%;
  height:40px;
  min-height:40px;
  margin:0;
  padding:8px 10px;
  font-size:16px;
}
[data-shopping-category] .shopping-category-inline-move,
[data-shopping-category] .shopping-category-inline-save{
  width:38px;
  height:38px;
  min-height:38px;
  margin:0!important;
  padding:0!important;
  display:grid;
  place-items:center;
  border-radius:9px;
}
[data-shopping-category] .shopping-category-inline-move svg{width:17px;height:17px;fill:currentColor;stroke:none}
[data-shopping-category] .shopping-category-inline-save{
  width:40px;
  background:var(--shopping-category-head-control-bg)!important;
  border:1px solid var(--line)!important;
  color:var(--ink)!important;
  box-shadow:none!important;
}
[data-shopping-category] .shopping-category-inline-save:hover{
  background:var(--shopping-category-head-control-hover)!important;
  color:var(--ink)!important;
}
[data-shopping-category] .shopping-category-inline-save svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
[data-shopping-category] .shopping-category-inline-status{
  grid-column:1/-1;
  margin:0;
  color:#a13f35;
  font-size:11px;
  line-height:1.3;
}
[data-shopping-category] .shopping-category-inline-status:empty{display:none}
[data-shopping-category].is-saving .shopping-category-inline-editor{opacity:.72}
[data-shopping-category] [data-shopping-category-items][hidden]{display:none!important}

.shopping-category-create{border-style:dashed;background:transparent}
.shopping-category-create[hidden]{display:none!important}
.shopping-category-create>summary{list-style:none}
.shopping-category-create>summary::-webkit-details-marker{display:none}
.shopping-category-create-toggle{
  display:flex;
  align-items:center;
  gap:9px;
  min-height:48px;
  padding:11px 15px;
  color:var(--muted);
  font-size:14px;
  font-weight:750;
  cursor:pointer;
}
.shopping-category-create-toggle:hover{background:var(--theme-surface-soft);color:var(--ink)}
.shopping-category-create-toggle:focus-visible{outline:3px solid #b97612;outline-offset:-3px}
.shopping-category-create[open]>.shopping-category-create-toggle{border-bottom:1px solid var(--theme-divider)}
.shopping-category-create-icon{font-size:22px;font-weight:500;line-height:1}
.shopping-category-create-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  padding:10px 12px 12px;
  margin:0;
  background:var(--theme-surface);
}
.shopping-category-create-form input,.shopping-category-create-form button{margin:0}

@media(max-width:700px){
  [data-shopping-category] .shopping-category-head-display,
  [data-shopping-category] .shopping-category-meta{min-height:48px}
  [data-shopping-category] .shopping-category-collapse-toggle{min-height:48px;padding:9px 3px 9px 12px}
  [data-shopping-category] .shopping-category-count{min-width:22px}
  [data-shopping-category] .shopping-category-edit-toggle,
  [data-shopping-category] .shopping-category-chevron-toggle{width:38px;min-width:38px;min-height:48px}
  [data-shopping-category] .shopping-category-inline-editor{grid-template-columns:minmax(0,1fr) 36px 36px 38px;padding:6px 8px;gap:5px}
  [data-shopping-category] .shopping-category-inline-move{width:36px;height:36px;min-height:36px}
  [data-shopping-category] .shopping-category-inline-save{width:38px;height:38px;min-height:38px}
  .shopping-category-create-form{grid-template-columns:minmax(0,1fr) auto}
}

/* Use the shared primary add-action pattern on both shopping screens. */
.shopping-create>.app-add-action{margin-left:auto}
.shopping-create[open]>.app-add-action svg,.shopping-add-panel[open]>.app-add-action svg{transform:rotate(45deg)}
.shopping-create form{top:58px;border-radius:14px}

@media(max-width:700px){
  .shopping-category-create-form{grid-template-columns:minmax(0,1fr) auto}
  .shopping-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
  .shopping-head>div{min-width:0}
  .shopping-create{margin-top:0}
  .shopping-create>summary{width:44px;text-align:initial}
  .shopping-create form{position:absolute;top:52px;right:0;width:min(360px,calc(100vw - 16px));border-radius:14px;box-shadow:0 18px 45px rgba(25,59,52,.14)}
}


/* Product rows: quantity is intentionally one tap away to avoid accidental changes. */
.shopping-item{grid-template-columns:42px minmax(0,1fr) 42px}
.shopping-item.has-photo{grid-template-columns:42px 42px minmax(0,1fr) 42px}
.shopping-product-thumb{width:40px;height:40px;display:block;object-fit:cover;border:1px solid var(--line);border-radius:9px;background:#f0f2ed}
.shopping-item-main{display:flex;align-items:center;gap:8px;min-width:0}
.shopping-item-name{min-width:0;padding:10px 0}
.shopping-item-quantity-picker{position:relative;flex:0 0 auto}
.shopping-item-quantity-picker>summary{list-style:none}
.shopping-item-quantity-picker>summary::-webkit-details-marker{display:none}
.shopping-item-quantity{min-width:38px;min-height:38px;display:grid;place-items:center;padding:4px 8px;border:1px solid var(--line);border-radius:999px;background:#f7f8f4;color:var(--ink);font-size:18px;font-weight:800;line-height:1;cursor:pointer}
.shopping-item-quantity.is-static{cursor:default;color:var(--muted)}
.shopping-item-quantity-picker[open]>.shopping-item-quantity{border-color:#9eafa3;background:#edf2e9}
.shopping-item-quantity-popover{position:absolute;z-index:35;top:calc(100% + 6px);left:0;display:grid;grid-template-columns:40px 48px 40px;gap:6px;align-items:center;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--theme-surface);box-shadow:0 12px 30px rgba(25,59,52,.16)}
.shopping-item-quantity-picker[open]>.shopping-item-quantity-popover{position:fixed;z-index:200;inset:auto;width:max-content;max-width:calc(100vw - 16px);height:auto;margin:0;overflow:visible}
.shopping-item-quantity-popover form{margin:0}
.shopping-item-quantity-popover button{width:40px;height:40px;min-height:40px;margin:0;padding:0;border-radius:9px;font-size:20px}
.shopping-item-quantity-popover strong{text-align:center;font-size:14px}
.shopping-edit{width:36px;height:36px;display:grid;place-items:center;justify-self:center;border-radius:9px;color:#74847d;text-decoration:none}
.shopping-edit:hover{background:#f1f2ee;color:var(--ink)}
.shopping-edit svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* Product editor */
.shopping-product-edit-page{max-width:620px}
.shopping-product-edit-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:20px}
.shopping-product-edit-head h1{margin-bottom:0}
.shopping-product-edit-preview{display:flex;justify-content:flex-end;min-height:0;margin:0 0 14px}
.shopping-product-edit-image{width:96px;height:96px;flex:0 0 96px;object-fit:cover;border:1px solid var(--line);border-radius:16px;background:#f0f2ed}
.shopping-product-edit-form{padding:18px;background:var(--theme-surface);border:1px solid var(--line);border-radius:16px}
.shopping-product-edit-form input[type=file]{padding:9px;background:var(--theme-surface-raised)}
.shopping-remove-photo{display:flex;align-items:flex-start;gap:9px;margin-top:12px;font-weight:500}
.shopping-remove-photo input{width:auto;min-height:0;margin:5px 0 0}
.shopping-product-danger{margin-top:28px;padding-top:20px;border-top:1px solid var(--line)}
.shopping-product-danger h2{font-size:17px;margin-bottom:5px}
.shopping-product-danger form{margin:0}
.shopping-product-danger button{color:#8a2f27}

@media(max-width:520px){
  .shopping-item{padding-left:5px;padding-right:5px}
  .shopping-item.has-photo{grid-template-columns:38px 38px minmax(0,1fr) 38px}
  .shopping-product-thumb{width:36px;height:36px}
  .shopping-item-main{gap:6px}
  .shopping-edit{width:34px;height:34px}
  .shopping-product-edit-image{width:78px;height:78px;flex-basis:78px;border-radius:13px}
}

/* Product photo preview / lightbox */
.shopping-product-thumb-button,.shopping-product-edit-image-button{margin:0;padding:0;border:0;background:transparent;color:inherit}
.shopping-product-thumb-button{width:40px;height:40px;display:block;border-radius:9px;cursor:zoom-in}
.shopping-product-thumb-button:focus-visible,.shopping-product-edit-image-button:focus-visible{outline:3px solid #b97612;outline-offset:3px}
.shopping-product-thumb-button:hover .shopping-product-thumb{transform:scale(1.04)}
.shopping-product-thumb{transition:transform .12s ease}
.shopping-product-edit-image-button{display:block;flex:0 0 auto;border-radius:16px;cursor:zoom-in}
.shopping-photo-dialog{width:min(92vw,900px);max-width:none;max-height:92vh;margin:auto;padding:0;border:0;background:transparent;overflow:visible}
.shopping-photo-dialog::backdrop{background:rgba(8,14,12,.82);backdrop-filter:blur(2px)}
.shopping-photo-dialog figure{position:relative;display:grid;justify-items:center;gap:10px;margin:0}
.shopping-photo-dialog[data-mode="photo"] figure{touch-action:none}
.shopping-photo-dialog[data-mode="photo"] img{cursor:zoom-in;touch-action:none;user-select:none;-webkit-user-drag:none;transform-origin:center center;will-change:transform}
.shopping-photo-dialog[data-photo-zoomed="1"] img{cursor:grab}
.shopping-photo-dialog[data-photo-panning="1"] img{cursor:grabbing}
.shopping-photo-dialog img{display:block;max-width:92vw;max-height:82vh;object-fit:contain;border-radius:14px;background:#111;box-shadow:0 22px 60px rgba(0,0,0,.36)}
.shopping-photo-dialog figcaption{max-width:80vw;color:#fff;font-size:14px;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.55)}
.shopping-photo-zoom-hint{color:rgba(255,255,255,.76);font-size:12px;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.55)}
.shopping-photo-dialog-close{position:fixed;z-index:2;top:max(14px,env(safe-area-inset-top));right:max(14px,env(safe-area-inset-right));width:44px;height:44px;display:grid;place-items:center;margin:0;padding:0;border:1px solid rgba(255,255,255,.34);border-radius:50%;background:var(--green);color:#fff;font-size:28px;line-height:1;box-shadow:0 8px 24px rgba(0,0,0,.28)}
.shopping-photo-dialog-close:hover{background:var(--green);filter:brightness(.94)}
.shopping-photo-dialog-close:focus,.shopping-photo-dialog-close:focus-visible{outline:none!important;box-shadow:0 8px 24px rgba(0,0,0,.28)!important}
.shopping-photo-status:empty{display:none}

@media(max-width:520px){
  .shopping-product-thumb-button{width:36px;height:36px}
  .shopping-photo-dialog{width:100vw;max-height:100vh}
  .shopping-photo-dialog img{max-width:96vw;max-height:82vh;border-radius:11px}
}


/* List editor and category management */
.shopping-list-head-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.shopping-list-edit-action{width:48px;height:48px;display:grid;place-items:center;border:1px solid var(--line);border-radius:50%;background:var(--theme-surface);color:var(--ink);text-decoration:none}
.shopping-list-edit-action:hover{background:#f1f4ed;color:var(--ink)}
.shopping-list-edit-action:focus-visible{outline:3px solid #b97612;outline-offset:3px}
.shopping-list-edit-action svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.shopping-list-edit-page{max-width:720px}
.shopping-editor-head{margin-bottom:18px}
.shopping-editor-head h1{margin-bottom:0}
.shopping-editor-card{margin-top:16px;padding:18px;background:var(--theme-surface);border:1px solid var(--line);border-radius:16px}
.shopping-editor-card h2{font-size:20px;margin:0 0 12px}
.shopping-editor-card form{margin:0}
.shopping-editor-card form>button{margin-top:14px}
.shopping-editor-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.shopping-editor-section-head>div{min-width:0}
.shopping-editor-section-head p{margin:4px 0 0}
.shopping-category-add{position:relative;flex:0 0 auto}
.shopping-category-add>summary{list-style:none}
.shopping-category-add>summary::-webkit-details-marker{display:none}
.shopping-category-add[open]>.app-add-action svg{transform:rotate(45deg)}
.shopping-category-add>form{position:absolute;z-index:35;top:58px;right:0;width:min(340px,calc(100vw - 48px));padding:14px;background:var(--theme-surface);border:1px solid var(--line);border-radius:14px;box-shadow:0 16px 36px rgba(25,59,52,.15)}
.shopping-category-add>form button{width:100%}
.shopping-category-editor-list{display:grid;gap:8px;margin-top:16px}
.shopping-category-editor-row{border:1px solid var(--line);border-radius:12px;background:var(--theme-surface-raised);overflow:hidden}
.shopping-category-editor-row>summary{display:grid;grid-template-columns:30px minmax(0,1fr) auto 22px;align-items:center;gap:8px;min-height:52px;padding:8px 12px;list-style:none;cursor:pointer}
.shopping-category-editor-row>summary::-webkit-details-marker{display:none}
.shopping-category-editor-row[open]>summary{border-bottom:1px solid var(--line);background:#f4f6f1}
.shopping-category-editor-order{width:26px;height:26px;display:grid;place-items:center;border-radius:8px;background:#e8ede1;color:var(--muted);font-size:11px;font-weight:700}
.shopping-category-editor-name{min-width:0;font-weight:700;overflow-wrap:anywhere}
.shopping-category-editor-chevron{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s ease}
.shopping-category-editor-row[open] .shopping-category-editor-chevron{transform:rotate(180deg)}
.shopping-category-editor-body{padding:14px}
.shopping-category-rename-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.shopping-category-rename-row button{margin:0}
.shopping-category-row-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px}
.shopping-category-row-actions form{margin:0}
.shopping-category-move{width:40px;height:40px;min-height:40px;margin:0!important;padding:0;font-size:18px}
.shopping-category-delete{margin-left:auto!important}
.shopping-category-delete button,.shopping-list-danger button{color:#8a2f27}
.shopping-category-row-actions p{flex:1 1 240px;margin:0}
.shopping-list-danger{margin-top:28px}

@media(max-width:700px){
  .shopping-list-edit-action{width:44px;height:44px}
  .shopping-editor-card{padding:14px}
  .shopping-category-add>form{top:52px}
  .shopping-category-editor-row>summary{grid-template-columns:28px minmax(0,1fr) 20px}
  .shopping-category-editor-row>summary .badge{grid-column:2/3;justify-self:start}
  .shopping-category-editor-chevron{grid-column:3;grid-row:1/3}
  .shopping-category-rename-row{grid-template-columns:1fr}
  .shopping-category-rename-row button{width:100%}
  .shopping-category-delete{margin-left:0!important;width:100%}
  .shopping-category-delete button{width:100%}
}


/* Fast add */
.shopping-suggestions-label{display:block;padding:8px 12px 6px;background:var(--theme-surface-raised);color:var(--muted);font-size:11px;font-weight:750;text-transform:uppercase;letter-spacing:.04em}
.shopping-undo-toast{position:fixed;z-index:80;left:50%;bottom:calc(78px + env(safe-area-inset-bottom));display:flex;align-items:center;gap:14px;max-width:min(520px,calc(100vw - 28px));padding:10px 12px 10px 16px;transform:translateX(-50%);border:1px solid #cbd6c7;border-radius:14px;background:var(--theme-surface);box-shadow:0 14px 40px rgba(25,59,52,.2);transition:opacity .2s ease,transform .2s ease}
.shopping-undo-toast.is-hiding{opacity:0;transform:translate(-50%,8px)}
.shopping-undo-toast span{min-width:0;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.shopping-undo-toast form{margin:0}
.shopping-undo-toast button{margin:0;white-space:nowrap}

/* Product catalog */
.shopping-head-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.shopping-catalog-action{width:48px;height:48px;display:grid;place-items:center;border:1px solid var(--line);border-radius:50%;background:var(--theme-surface);color:var(--ink);text-decoration:none}
.shopping-catalog-action:hover{background:#f1f4ed;color:var(--ink)}
.shopping-catalog-action svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.shopping-products-head{margin-bottom:16px}
.shopping-products-head h1{margin-bottom:8px}
.shopping-catalog-switcher-row{display:block;margin:0 0 16px}
.shopping-catalog-switcher{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;min-width:0;padding:4px;border:1px solid var(--line);border-radius:14px;background:var(--theme-surface-soft)}
.shopping-catalog-switcher a{display:flex;align-items:center;justify-content:center;gap:7px;min-width:0;min-height:42px;padding:8px 10px;border-radius:10px;color:var(--muted);font-weight:750;text-decoration:none}
.shopping-catalog-switcher a[aria-current="page"]{background:var(--theme-surface);color:var(--ink);box-shadow:0 1px 3px rgba(25,59,52,.12)}
.shopping-catalog-switcher-count{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:var(--theme-surface-raised);color:currentColor;font-size:12px;font-weight:800;line-height:1}
.shopping-catalog-create{margin:0}
.shopping-product-search{display:flex;gap:8px;align-items:center;margin:0 0 20px}
.shopping-product-search input{flex:1 1 auto;margin:0}
.shopping-product-search button,.shopping-product-search a{margin:0;white-space:nowrap}
.shopping-product-catalog-grid{display:grid;gap:10px}
.shopping-product-catalog-card{display:grid;grid-template-columns:64px minmax(0,1fr) 24px;align-items:center;gap:12px;padding:10px 12px;border:1px solid var(--line);border-radius:14px;background:var(--theme-surface);color:var(--ink);text-decoration:none}
.shopping-product-catalog-card:hover{background:#f8faf6;border-color:#bccabc;color:var(--ink)}
.shopping-product-catalog-card img,.shopping-product-catalog-placeholder{width:64px;height:64px;display:grid;place-items:center;object-fit:cover;border-radius:11px;background:#eef2eb;border:1px solid #e0e7dc}
.shopping-product-catalog-placeholder svg{width:28px;height:28px;fill:none;stroke:#84948c;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.shopping-product-catalog-main{display:grid;gap:4px;min-width:0}
.shopping-product-catalog-main strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shopping-product-catalog-main>span{font-size:12px;color:var(--muted)}
.shopping-product-catalog-chevron{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.shopping-duplicate-notice{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 16px;padding:13px 15px;border:1px solid #b8c9b3;border-radius:14px;background:var(--theme-surface-soft);color:var(--ink);text-decoration:none}
.shopping-duplicate-notice>span:first-child{display:grid;gap:2px;min-width:0}
.shopping-duplicate-notice small{color:var(--muted)}
.shopping-duplicate-notice>span:last-child{flex:0 0 auto;font-weight:750}
.shopping-duplicate-label{font-weight:750;color:var(--ink)}
.shopping-duplicate-page{max-width:720px}
.shopping-duplicate-stack{display:grid;gap:14px}
.shopping-duplicate-group{padding:16px;border:1px solid var(--line);border-radius:16px;background:var(--theme-surface)}
.shopping-duplicate-group h2{font-size:19px;margin:0 0 5px}
.shopping-duplicate-group form{margin:14px 0 0}
.shopping-duplicate-options{display:grid;gap:7px;margin:12px 0}
.shopping-duplicate-option{display:flex;align-items:center;gap:10px;padding:9px 10px;border:1px solid var(--theme-divider);border-radius:10px;background:var(--theme-surface-raised);font-weight:500}
.shopping-duplicate-option input{width:auto;min-height:0;margin:0}
.shopping-duplicate-group button{margin-top:10px}
.shopping-pagination{margin-top:18px}
.shopping-product-transfer{margin-top:24px;padding:18px;background:var(--theme-surface);border:1px solid var(--line);border-radius:16px}
.shopping-product-transfer h2{font-size:17px;margin-bottom:5px}
.shopping-product-transfer form{margin:0}
.shopping-transfer-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}
.shopping-transfer-actions button{margin:0}

/* Touch drag category ordering */
.shopping-category-drag-handle{display:flex;align-items:center;justify-content:center;gap:3px;min-width:34px;height:32px;border-radius:8px;background:#e8ede1;color:var(--muted);font-size:10px;font-weight:750;cursor:grab;touch-action:none;user-select:none}
.shopping-category-drag-handle:active{cursor:grabbing}
.shopping-category-drag-handle svg{width:13px;height:18px;fill:currentColor}
.shopping-category-editor-row.is-dragging{opacity:.78;box-shadow:0 8px 24px rgba(25,59,52,.16);transform:scale(1.01)}
.shopping-is-dragging{user-select:none}
.shopping-category-editor-row>summary{grid-template-columns:42px minmax(0,1fr) auto 22px}

@media(max-width:700px){
  .shopping-catalog-action{width:44px;height:44px}
  .shopping-catalog-switcher-row{gap:8px}
  .shopping-catalog-switcher{gap:3px;padding:3px}
  .shopping-catalog-switcher a{gap:5px;min-height:38px;padding:6px 7px;font-size:14px}
  .shopping-catalog-switcher-count{min-width:20px;height:20px;padding:0 5px;font-size:11px}
  .shopping-catalog-create>summary{width:44px;height:44px}
  .shopping-product-search{display:grid;grid-template-columns:minmax(0,1fr) auto}
  .shopping-product-search a{grid-column:1/-1;text-align:center}
  .shopping-product-catalog-card{grid-template-columns:52px minmax(0,1fr) 20px;padding:8px 10px}
  .shopping-product-catalog-card img,.shopping-product-catalog-placeholder{width:52px;height:52px;border-radius:9px}
  .shopping-category-editor-row>summary{grid-template-columns:38px minmax(0,1fr) 20px}
  .shopping-category-drag-handle{min-width:34px}
}


/* Shopping templates */
.shopping-template-action{width:40px;height:40px;display:grid;place-items:center;margin:0;padding:0;list-style:none;border:1px solid var(--line);border-radius:10px;background:var(--theme-surface);color:var(--ink);text-decoration:none;cursor:pointer}
.shopping-template-action::-webkit-details-marker{display:none}
.shopping-template-action:hover{background:#f1f4ed;color:var(--ink)}
.shopping-template-action svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.shopping-template-grid{display:grid;gap:10px}
.shopping-template-card{display:grid;grid-template-columns:112px minmax(0,1fr) 22px;align-items:center;gap:14px;padding:10px;border:1px solid var(--line);border-radius:14px;background:var(--theme-surface);color:var(--ink);text-decoration:none}
.shopping-template-card:hover{background:#f8faf6;border-color:#bccabc;color:var(--ink)}
.shopping-template-card-main{display:grid;gap:4px;min-width:0}
.shopping-template-card strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shopping-template-card small{color:var(--muted)}
.shopping-template-chevron{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.shopping-template-cover{display:grid;place-items:center;overflow:hidden;background:#e8ede1;color:#365a4e}
.shopping-template-cover svg{width:58%;height:58%;fill:none;stroke:currentColor;stroke-width:2.1;stroke-linecap:round;stroke-linejoin:round}
.shopping-template-cover img{width:100%;height:100%;display:block;object-fit:cover}
.shopping-template-cover--card{width:112px;height:88px;border-radius:12px}
.shopping-template-cover--editor{width:86px;height:86px;flex:0 0 86px;border:1px solid var(--line);border-radius:14px}
.shopping-template-head{position:relative;display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}
.shopping-template-head>div:first-child{min-width:0}
.shopping-template-head h1{margin-bottom:0}
.shopping-template-head-actions{position:relative;display:flex;align-items:center;gap:8px;flex:0 0 auto}
.shopping-template-apply-panel{position:static;flex:0 0 auto}
.shopping-template-apply-popover{width:min(330px,calc(100vw - 36px))}
.shopping-template-apply-popover form{margin:0}
.shopping-template-apply-popover label{margin-top:0}
.shopping-template-apply-popover select{margin:0}
.shopping-template-multiplier-control{grid-template-columns:42px 72px 42px;align-items:center;justify-content:start;margin-top:6px}
.shopping-template-multiplier-control button,.shopping-template-multiplier-control input{width:100%;height:42px;min-height:42px;margin:0;box-sizing:border-box}
.shopping-template-multiplier-control input{padding:6px;text-align:center;font-size:18px;font-weight:800;appearance:textfield;-moz-appearance:textfield}
.shopping-template-multiplier-control input::-webkit-outer-spin-button,.shopping-template-multiplier-control input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.shopping-template-apply-popover p{margin:10px 0 0}
.shopping-template-apply-submit{width:100%;margin-top:12px}
.shopping-template-add-panel{margin:0}
.shopping-template-hero{width:100%;height:190px;display:block;margin:0 0 14px;padding:0;overflow:hidden;border:1px solid var(--line);border-radius:16px;background:#eef2eb;cursor:pointer}
.shopping-template-hero img{width:100%;height:100%;display:block;object-fit:cover}
.shopping-template-products{overflow:visible}
.shopping-template-products-head{align-items:center}
.shopping-template-products-head h2{margin-bottom:0}
.shopping-template-empty{padding:30px 18px;text-align:center}
.shopping-template-empty p{margin:0}
.shopping-template-item-list{display:grid}
.shopping-item.shopping-template-product-row{grid-template-columns:42px minmax(0,1fr) 42px}
.shopping-item.shopping-template-product-row.has-photo{grid-template-columns:42px 42px minmax(0,1fr) 42px}
.shopping-template-product-row .shopping-template-remove{width:36px;height:36px;padding:0;font-size:22px}
.shopping-template-image-editor{display:grid;gap:12px;margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
.shopping-template-image-editor-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.shopping-template-image-editor-head label{margin-top:0}
.shopping-template-image-editor-head p{margin:4px 0 0}
.shopping-template-edit-page{width:100%;min-width:0}

@media(max-width:700px){
  .shopping-template-action{width:44px;height:44px}
  .shopping-template-card{grid-template-columns:88px minmax(0,1fr) 20px;gap:12px;padding:8px}
  .shopping-template-cover--card{width:88px;height:78px}
  .shopping-template-cover--editor{width:74px;height:74px;flex-basis:74px}
  .shopping-template-head{gap:10px;margin-bottom:12px}
  .shopping-template-head-actions{gap:5px}
  .shopping-template-apply-popover{top:52px;width:min(330px,calc(100vw - 16px))}
  .shopping-template-hero{height:160px;border-radius:13px}
}

@media(max-width:520px){
  .shopping-item.shopping-template-product-row{grid-template-columns:38px minmax(0,1fr) 38px}
  .shopping-item.shopping-template-product-row.has-photo{grid-template-columns:38px 38px minmax(0,1fr) 38px}
  .shopping-template-card{grid-template-columns:74px minmax(0,1fr) 18px}
  .shopping-template-cover--card{width:74px;height:68px}
}

/* Shared shopping lists */
.shopping-share-list{display:grid;gap:10px;margin:16px 0}
.shopping-share-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,auto) auto;gap:10px;align-items:center;padding:12px 0;border-bottom:1px solid var(--theme-divider)}
.shopping-share-person{display:grid;min-width:0}
.shopping-share-row form{margin:0;display:flex;align-items:center;gap:8px}
.shopping-share-row select{min-width:150px}
.shopping-share-row button{margin:0}
.shopping-share-add{margin-top:16px}
.shopping-share-row{align-items:start}
.shopping-share-row .shopping-share-permission-form,.shopping-share-add.shopping-share-permission-form{display:grid;grid-template-columns:minmax(180px,1fr) auto;gap:8px;align-items:start}
.shopping-share-row .shopping-share-permission-form>label,.shopping-share-add.shopping-share-permission-form>label{grid-column:1/-1;margin:0}
.shopping-share-row .shopping-share-permission-form>select,.shopping-share-add.shopping-share-permission-form>select{min-width:0;width:100%}
.shopping-share-custom-permissions{grid-column:1/-1;display:grid;gap:10px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--theme-surface-soft)}
.shopping-share-custom-permissions[hidden]{display:none}
.shopping-share-custom-permissions>p{margin:0}
.shopping-share-capability-group{display:grid;gap:6px;margin:0;padding:0;border:0}
.shopping-share-capability-group legend{margin-bottom:4px;font-size:12px;font-weight:750;color:var(--muted)}
.shopping-share-capability{display:grid;grid-template-columns:18px minmax(0,1fr);align-items:start;gap:8px;margin:0;font-size:14px}
.shopping-share-capability input[type="checkbox"]{width:18px;min-width:18px;height:18px;min-height:18px;padding:0;margin:2px 0 0}
.shopping-share-capability span{min-width:0;overflow-wrap:anywhere}
.shopping-share-permission-form>button{justify-self:start}
.shopping-check.is-readonly{cursor:default}
@media(max-width:700px){
    .shopping-share-row{grid-template-columns:1fr}
    .shopping-share-row form{width:100%}
    .shopping-share-row select{flex:1;min-width:0}
    .shopping-share-row button{flex:0 0 auto}
    .shopping-share-row .shopping-share-permission-form,.shopping-share-add.shopping-share-permission-form{grid-template-columns:1fr}
    .shopping-share-row .shopping-share-permission-form>label,.shopping-share-add.shopping-share-permission-form>label,.shopping-share-custom-permissions{grid-column:1}
    .shopping-share-permission-form>button{width:100%}
}

/* Shared-list recipient controls */
.shopping-shared-access{margin-top:24px;border:1px solid var(--line);border-radius:14px;background:var(--theme-surface);overflow:hidden}
.shopping-shared-access>summary{padding:13px 16px;list-style:none;cursor:pointer}
.shopping-shared-access>summary::-webkit-details-marker{display:none}
.shopping-shared-access[open]>summary{border-bottom:1px solid var(--line)}
.shopping-shared-access-body{padding:14px 16px}
.shopping-shared-access-body p{margin:0 0 10px}
.shopping-shared-access-body form{margin:0}
.shopping-shared-access-body button{margin:0;color:#8a2f27}


/* Delayed check-off: keep the row reversible for three seconds. */
.shopping-item.is-pending-completion{opacity:.68;background:var(--theme-surface-soft);transition:opacity .18s ease,background .18s ease}
.shopping-item.is-pending-completion .shopping-item-name{color:var(--muted);text-decoration:none}
.shopping-check.is-pending{background:var(--theme-surface-soft)!important;border-color:var(--theme-selected-border)!important;color:var(--muted)!important}
.shopping-item.is-removing{opacity:0;transform:translateX(8px);transition:opacity .18s ease,transform .18s ease}
.shopping-item-quantity{white-space:nowrap}

/* Shopping-list covers */
.shopping-list-cover{display:grid;place-items:center;overflow:hidden;background:#e8ede1;color:#365a4e}
.shopping-list-cover svg{width:58%;height:58%;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.shopping-list-cover img{width:100%;height:100%;display:block;object-fit:cover}
.shopping-list-cover--supermarket{background:#e5efe7;color:#2f6654}
.shopping-list-cover--drugstore{background:#efe8f2;color:#74547d}
.shopping-list-cover--hardware{background:#eee9df;color:#755f3f}
.shopping-list-cover--drinks{background:#e4eef3;color:#496f83}
.shopping-list-cover--produce{background:#eaf2df;color:#587344}
.shopping-list-cover--bakery{background:#f3eadc;color:#8a6743}
.shopping-list-cover--generic{background:#ecefed;color:#65716c}
.shopping-list-cover--card{width:100%;height:112px;border-radius:14px}
.shopping-list-cover--editor{width:86px;height:86px;flex:0 0 86px;border-radius:14px;border:1px solid var(--line)}

.shopping-list-card{display:grid;grid-template-columns:132px minmax(0,1fr);gap:16px;min-height:0;padding:14px}
.shopping-list-card-content{min-width:0;align-self:center}
.shopping-list-card-top{margin-bottom:12px}
.shopping-list-card h2{font-size:23px;margin-bottom:8px}

.shopping-list-image-editor{display:grid;gap:12px;margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
.shopping-list-image-editor-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.shopping-list-image-editor-head label{margin-top:0}
.shopping-list-image-editor-head p{margin:4px 0 0}
.shopping-list-preset-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.shopping-list-preset-option{display:grid;gap:6px;margin:0;padding:7px;border:1px solid var(--line);border-radius:12px;background:var(--theme-surface-raised);cursor:pointer;font-size:11px;text-align:center;font-weight:650}
.shopping-list-preset-option input{position:absolute;opacity:0;pointer-events:none}
.shopping-list-preset-option:has(input:checked){border-color:#779687;box-shadow:0 0 0 2px rgba(80,120,100,.13);background:#f1f6ef}
.shopping-list-preset-visual{height:54px;display:grid;place-items:center;border-radius:9px}
.shopping-list-preset-visual svg{width:34px;height:34px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}

/* Category ordering uses deterministic one-step arrows instead of drag/drop. */
.shopping-category-editor-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;overflow:visible}
.shopping-category-editor-details{min-width:0}
.shopping-category-editor-details>summary{display:grid;grid-template-columns:30px minmax(0,1fr) auto 22px;align-items:center;gap:8px;min-height:52px;padding:8px 10px;list-style:none;cursor:pointer}
.shopping-category-editor-details>summary::-webkit-details-marker{display:none}
.shopping-category-editor-details[open]>summary{border-bottom:1px solid var(--line);background:#f4f6f1}
.shopping-category-editor-details[open] .shopping-category-editor-chevron{transform:rotate(180deg)}
.shopping-category-order-controls{display:grid;grid-template-columns:40px 40px;gap:4px;padding:6px 8px 6px 0}
.shopping-category-order-controls form{margin:0}
.shopping-category-move{width:40px;height:40px;min-height:40px;margin:0!important;padding:0!important;border-radius:9px}
.shopping-category-move svg{width:18px;height:18px;fill:currentColor;stroke:none}
.shopping-category-move:disabled{opacity:.28}
.shopping-category-editor-body .shopping-category-delete{margin-top:12px!important}
.shopping-category-editor-body>p{margin:12px 0 0}

@media(max-width:700px){
  .shopping-list-card{grid-template-columns:88px minmax(0,1fr);gap:12px;padding:10px}
  .shopping-list-cover--card{height:88px;border-radius:12px}
  .shopping-list-card h2{font-size:20px}
  .shopping-list-card-top{margin-bottom:8px}
  .shopping-list-preset-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .shopping-list-cover--editor{width:74px;height:74px;flex-basis:74px}
  .shopping-category-editor-row{grid-template-columns:minmax(0,1fr) 82px}
  .shopping-category-editor-details>summary{grid-template-columns:28px minmax(0,1fr) 20px;padding-left:9px;padding-right:6px}
  .shopping-category-editor-details>summary .badge{grid-column:2/3;justify-self:start}
  .shopping-category-editor-chevron{grid-column:3;grid-row:1/3}
  .shopping-category-order-controls{grid-template-columns:38px 38px;gap:3px;padding-right:5px}
  .shopping-category-move{width:38px;height:42px;min-height:42px}
}


/* Keep quantity aligned before the optional product photo. */
.shopping-item{grid-template-columns:42px 42px minmax(0,1fr) 42px}
.shopping-item.has-photo{grid-template-columns:42px 42px 42px minmax(0,1fr) 42px}
.shopping-item-main{display:block;min-width:0}
.shopping-item-name{display:block}

@media(max-width:520px){
  .shopping-item{grid-template-columns:38px 38px minmax(0,1fr) 38px}
  .shopping-item.has-photo{grid-template-columns:38px 38px 38px minmax(0,1fr) 38px}
}


/* List editor: never shrink-wrap on mobile (notably iOS with large text / native controls). */
.shopping-list-edit-page{width:100%;min-width:0}
.shopping-list-edit-page>.shopping-editor-card,
.shopping-list-edit-page>.shopping-product-danger{width:100%;min-width:0}
.shopping-list-edit-page form,
.shopping-list-image-editor,
.shopping-list-image-editor-head>div{min-width:0}
.shopping-list-edit-page input,
.shopping-list-edit-page select{max-width:100%}
.shopping-list-edit-page input[type=file]{width:100%;min-width:0}

@media(max-width:700px){
  .shopping-list-edit-page{max-width:none;margin-left:0;margin-right:0}
  .shopping-list-edit-page>.shopping-editor-card{width:100%}
  .shopping-list-image-editor-head{min-width:0}
  .shopping-list-preset-grid{width:100%;min-width:0}
}


/* Fix iOS horizontal overflow in shopping-list editor.
   The preset radios inherited global input width:100%; as absolutely positioned
   controls this could enlarge the page's scrollable width. Keep them truly tiny. */
.shopping-list-preset-option{position:relative;min-width:0}
.shopping-list-preset-option input[type=radio]{
  position:absolute;
  width:1px;
  height:1px;
  min-width:0;
  min-height:0;
  margin:0;
  padding:0;
  opacity:0;
  pointer-events:none;
}
.shopping-list-preset-option>span{min-width:0}
.shopping-list-preset-option>span:last-child{overflow-wrap:anywhere}

@media(max-width:700px){
  .shopping-list-edit-page{overflow-x:clip}
}

.shopping-notification-toggle{display:flex;align-items:flex-start;gap:10px;margin:0 0 12px;font-weight:500}
.shopping-notification-toggle input{width:auto;min-height:0;margin:4px 0 0}
.shopping-notification-toggle span{display:grid;gap:3px}
.shopping-notification-toggle small{color:var(--muted);font-weight:400;line-height:1.4}
.shopping-notification-hint{margin:10px 0 0!important}
.shopping-notification-settings .shopping-shared-access-body button{color:var(--ink)}
.shopping-shared-list-settings .shopping-leave-list{margin:0;color:#8a2f27}


/* List settings overview disclosures */
.shopping-settings-section{padding:0;overflow:hidden}
.shopping-settings-section>summary{display:grid;grid-template-columns:minmax(0,1fr) auto 22px;align-items:center;gap:12px;min-height:68px;padding:14px 18px;list-style:none;cursor:pointer}
.shopping-settings-section>summary::-webkit-details-marker{display:none}
@media (hover:hover) and (pointer:fine){.shopping-settings-section>summary:hover{background:var(--theme-surface-soft)}}
.shopping-settings-section>summary:focus-visible{outline:3px solid #b97612;outline-offset:-3px}
.shopping-settings-section[open]>summary{background:var(--theme-surface-raised);border-bottom:1px solid var(--line)}
@media (hover:none), (pointer:coarse){.shopping-settings-section:not([open])>summary:hover{background:transparent}}
.shopping-settings-summary-copy{display:grid;gap:3px;min-width:0}
.shopping-settings-summary-copy strong{font-size:17px;line-height:1.25}
.shopping-settings-summary-copy small{color:var(--muted);font-size:12px;line-height:1.35}
.shopping-settings-current{max-width:180px;overflow:hidden;color:var(--muted);font-size:12px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}
.shopping-settings-chevron{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s ease}
.shopping-settings-section[open] .shopping-settings-chevron{transform:rotate(180deg)}
.shopping-settings-body{padding:18px}
.shopping-settings-intro{margin:0 0 14px!important}
.shopping-settings-body>form:first-child>label:first-of-type{margin-top:0}
.shopping-category-settings-head{align-items:center}
.shopping-category-settings-head p{margin:0}
.shopping-settings-danger .shopping-settings-summary-copy strong{color:#7f3029}
.shopping-settings-danger .shopping-list-danger{margin-top:0;padding-top:18px;border-top:0}
.shopping-settings-danger .shopping-list-danger p{margin-top:0}
.shopping-settings-danger .shopping-list-danger form{margin:0}

@media(max-width:700px){
  .shopping-settings-section{margin-top:10px}
  .shopping-settings-section>summary{grid-template-columns:minmax(0,1fr) auto 20px;min-height:62px;padding:12px 14px;gap:9px}
  .shopping-settings-current{max-width:110px}
  .shopping-settings-body{padding:14px}
}


/* Demand-time location explanation before the browser permission prompt. */
.shopping-location-permission{width:min(92vw,520px);max-width:none;margin:auto;padding:0;border:0;border-radius:20px;background:var(--theme-surface);color:var(--ink);box-shadow:0 24px 70px rgba(0,0,0,.28)}
.shopping-location-permission:not([open]){display:none}
.shopping-location-permission::backdrop{background:rgba(8,14,12,.62);backdrop-filter:blur(3px)}
.shopping-location-permission-body{display:grid;grid-template-columns:48px minmax(0,1fr);gap:15px;padding:20px}
.shopping-location-permission-icon{width:48px;height:48px;display:grid;place-items:center;border-radius:14px;background:var(--theme-surface-raised);color:var(--ink)}
.shopping-location-permission-icon svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.shopping-location-permission-copy>strong{display:block;margin:2px 0 7px;font-size:18px;line-height:1.25}
.shopping-location-permission-copy>p{margin:0 0 8px;line-height:1.45}
.shopping-location-permission-actions{display:grid;gap:8px;margin-top:14px}
.shopping-location-permission-actions button{width:100%;margin:0}
.shopping-location-permission-status{margin-top:9px!important}
.shopping-location-permission-status:empty{display:none}

@media(max-width:520px){
  .shopping-location-permission{width:calc(100vw - 24px);border-radius:18px}
  .shopping-location-permission-body{grid-template-columns:40px minmax(0,1fr);gap:11px;padding:16px}
  .shopping-location-permission-icon{width:40px;height:40px;border-radius:12px}
  .shopping-location-permission-copy>strong{font-size:17px}
}

/* Merchant-bound shopping and online product sources */
.shopping-item-commerce{display:block;margin:-5px 0 8px}
.shopping-merchant-link,.shopping-online-source-preview{display:inline-flex;align-items:center;gap:5px;color:var(--ink);font-size:12px;font-weight:700;text-decoration:none}
.shopping-merchant-link:hover,.shopping-online-source-preview:hover{text-decoration:underline}
.shopping-merchant-link svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.shopping-merchant-link.is-missing,.shopping-merchant-link.is-secondary,.shopping-merchant-missing{color:var(--muted);font-weight:600}
.shopping-merchant-missing{font-size:11px}
.shopping-online-source-editor{margin:16px 0;border:1px solid var(--line);border-radius:12px;background:var(--theme-surface-raised);overflow:hidden}
.shopping-online-source-editor>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 13px;list-style:none;cursor:pointer}
.shopping-online-source-editor>summary::-webkit-details-marker{display:none}
.shopping-online-source-editor>summary span{display:grid;gap:2px}
.shopping-online-source-editor>summary small{color:var(--muted);font-weight:400}
.shopping-online-source-editor>summary svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;transition:transform .15s ease}
.shopping-online-source-editor[open]>summary{border-bottom:1px solid var(--line)}
.shopping-online-source-editor[open]>summary svg{transform:rotate(180deg)}
.shopping-online-source-body{padding:13px}
.shopping-online-source-body label{margin-top:0}
.shopping-online-source-body p{margin:7px 0 9px}
.shopping-online-source-preview{font-size:13px}


/* Compact shopping rows and automatic merchant cover */
.shopping-list-cover--merchant-amazon{background:radial-gradient(circle at 28% 22%,#37475a 0,#232f3e 58%,#131a22 100%);color:#fff}
.shopping-list-cover--merchant-amazon svg{width:78%;height:78%;fill:none;stroke-linecap:round;stroke-linejoin:round}
.shopping-list-cover--merchant-amazon .shopping-amazon-box{stroke:#fff;stroke-width:2.15}
.shopping-list-cover--merchant-amazon .shopping-amazon-accent{stroke:#ff9900;stroke-width:3.2}
.shopping-merchant-cover-hint{display:grid;grid-template-columns:86px minmax(0,1fr);align-items:center;gap:14px;padding:10px;border:1px solid var(--line);border-radius:12px;background:var(--theme-surface-raised)}
.shopping-merchant-cover-hint .shopping-list-preset-visual{height:64px}
.shopping-merchant-cover-hint p{margin:0!important}

.shopping-item{grid-template-columns:31px 44px minmax(0,1fr) auto!important;min-height:58px;padding-top:5px;padding-bottom:5px}
.shopping-item.has-photo{grid-template-columns:31px 44px 46px minmax(0,1fr) auto!important}
.shopping-item-quantity-picker,
.shopping-item>.shopping-item-quantity.is-static{margin-left:6px}
.shopping-product-thumb-button{margin-left:6px}
.shopping-item-main{min-width:0!important;overflow:hidden;padding-left:6px}
.shopping-item-name{display:block!important;min-width:0;max-width:100%;padding:0!important;overflow:hidden!important;text-overflow:ellipsis;white-space:nowrap!important;line-height:1.35}
.shopping-item-actions{display:flex;align-items:center;justify-content:flex-end;gap:2px;min-width:0}
.shopping-item-actions:empty{display:none}
.shopping-merchant-action,.shopping-edit{width:34px;height:34px;display:grid;place-items:center;flex:0 0 34px;margin:0;padding:0;border-radius:9px;color:#74847d;text-decoration:none}
.shopping-merchant-action:hover,.shopping-edit:hover{background:var(--theme-surface-soft);color:var(--ink)}
.shopping-merchant-action svg,.shopping-edit svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.shopping-merchant-action.is-missing{opacity:.62}
.shopping-item-commerce,.shopping-merchant-link,.shopping-merchant-missing{display:none!important}

@media(max-width:520px){
  .shopping-item{grid-template-columns:31px 44px minmax(0,1fr) auto!important}
  .shopping-item.has-photo{grid-template-columns:31px 44px 42px minmax(0,1fr) auto!important}
  .shopping-item-actions{gap:0}
  .shopping-merchant-action,.shopping-edit{width:32px;height:32px;flex-basis:32px}
  .shopping-merchant-action svg,.shopping-edit svg{width:17px;height:17px}
  .shopping-merchant-cover-hint{grid-template-columns:74px minmax(0,1fr);gap:11px}
  .shopping-merchant-cover-hint .shopping-list-preset-visual{height:58px}
}


/* Product detail overlay: compact list, rich detail on demand */
.shopping-photo-dialog [hidden]{display:none!important}
.shopping-item-name-button{display:block;width:100%;min-width:0;margin:0;padding:0;border:0!important;background:transparent!important;color:inherit;text-align:left;font:inherit;cursor:pointer}
.shopping-item-name-button:hover,.shopping-item-name-button:active{background:transparent!important;color:inherit}
.shopping-item-name-button:disabled{opacity:1;cursor:default;color:inherit}
.shopping-item-name-button:disabled:hover{background:transparent!important;color:inherit}
.shopping-item-name-button:focus-visible{outline:2px solid var(--theme-selected-border);outline-offset:3px;border-radius:5px}
.shopping-item.is-done .shopping-item-name-button{color:var(--muted)}
.shopping-product-detail-trigger{touch-action:manipulation}

.shopping-photo-dialog[data-mode="detail"]{width:min(92vw,680px);max-height:min(88vh,720px);padding:0;border:1px solid var(--line);border-radius:20px;background:var(--theme-surface);color:var(--ink);box-shadow:0 26px 80px rgba(0,0,0,.32);overflow:visible}
.shopping-photo-dialog[data-mode="detail"] .shopping-photo-dialog-close{position:absolute;top:-54px;right:0;width:44px;height:44px;font-size:28px}
.shopping-product-detail{display:grid;grid-template-columns:minmax(0,1fr);gap:0;min-width:0;padding:22px}
.shopping-product-detail:has(.shopping-product-detail-media:not([hidden])){grid-template-columns:150px minmax(0,1fr);column-gap:20px}
.shopping-product-detail-media{width:150px;height:150px;display:block;margin:0;padding:0;overflow:hidden;border:1px solid var(--line)!important;border-radius:16px;background:var(--theme-surface-raised)!important;color:inherit;cursor:zoom-in}
.shopping-product-detail-media:hover,.shopping-product-detail-media:active{background:var(--theme-surface-soft)!important}
.shopping-product-detail-media:focus-visible{outline:3px solid #b97612;outline-offset:3px}
.shopping-product-detail-media img{width:100%;height:100%;max-width:none;max-height:none;object-fit:contain;border-radius:0;background:transparent;box-shadow:none;transition:transform .12s ease}
.shopping-product-detail-media:hover img{transform:scale(1.025)}
.shopping-product-detail-copy{min-width:0;padding:4px 0 0}
.shopping-product-detail-copy h2{margin:0;font-size:22px;line-height:1.28;overflow-wrap:anywhere}
.shopping-product-detail-actions{grid-column:2;display:grid;gap:8px;margin-top:18px}
.shopping-product-detail-actions[hidden]{display:none}
.shopping-product-detail-buy,.shopping-product-detail-edit{min-height:44px;display:flex;align-items:center;justify-content:center;gap:7px;margin:0;padding:10px 14px;border-radius:11px;text-decoration:none;font-weight:750}
.shopping-product-detail-buy{background:var(--green);color:#fff}
.shopping-product-detail-buy:hover{color:#fff;filter:brightness(.96)}
.shopping-product-detail-buy svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.shopping-product-detail-edit{border:1px solid var(--line);background:var(--theme-surface-raised);color:var(--ink)}
.shopping-product-detail-edit:hover{background:var(--theme-surface-soft);color:var(--ink)}
.shopping-product-detail:not(:has(.shopping-product-detail-media:not([hidden]))) .shopping-product-detail-actions{grid-column:1}

@media(max-width:520px){
  .shopping-photo-dialog[data-mode="detail"]{width:calc(100vw - 24px);max-height:86vh;border-radius:18px}
  .shopping-product-detail{padding:17px}
  .shopping-product-detail:has(.shopping-product-detail-media:not([hidden])){grid-template-columns:92px minmax(0,1fr);column-gap:13px}
  .shopping-product-detail-media{width:92px;height:92px;border-radius:13px}
  .shopping-product-detail-copy{padding:3px 0 0}
  .shopping-product-detail-copy h2{font-size:18px}
  .shopping-photo-dialog[data-mode="detail"] .shopping-photo-dialog-close{top:-52px;right:0}
  .shopping-product-detail-actions,
  .shopping-product-detail:not(:has(.shopping-product-detail-media:not([hidden]))) .shopping-product-detail-actions{grid-column:1/-1;margin-top:15px}
}


/* Manual purchase capture inside product details */
.shopping-product-detail-history{grid-column:1/-1;margin-top:12px;padding:0 2px}
.shopping-product-detail-history[hidden]{display:none!important}
.shopping-product-detail-history p{margin:0;overflow:hidden;color:var(--muted);font-size:12px;font-weight:650;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}
.shopping-product-purchase{display:grid;grid-template-columns:104px minmax(0,1fr);align-items:stretch;gap:8px;margin:0;padding:0;border:0;background:transparent}
.shopping-product-purchase[hidden]{display:none!important}
.shopping-product-purchase-price{width:104px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;border:1px solid var(--line);border-radius:9px;background:var(--theme-surface);box-sizing:border-box}
.shopping-product-purchase-price:focus-within{border-color:var(--theme-selected-border);box-shadow:0 0 0 2px color-mix(in srgb,var(--theme-selected-border) 20%,transparent)}
.shopping-product-purchase-price input{min-width:0;width:100%;margin:0;padding:8px 4px 8px 8px;border:0!important;outline:0!important;background:transparent!important;color:var(--ink);font-size:16px;box-shadow:none!important}
.shopping-product-purchase-price span{padding:0 8px 0 2px;color:var(--muted);font-size:13px;font-weight:750}
.shopping-product-purchase button{align-self:stretch;width:100%;height:100%;min-height:50px;margin:0;padding:9px 12px;background:var(--theme-selected-border);color:#fff;font-size:16px;font-weight:800;white-space:nowrap}
.shopping-product-purchase button:hover{filter:brightness(.96)}
.shopping-product-purchase button:disabled{opacity:.62}
.shopping-product-purchase-status{grid-column:1/-1;min-height:0;margin:0;color:#a13f35;font-size:11px}
.shopping-product-purchase-status:empty{display:none}

@media(max-width:520px){
  .shopping-product-detail-history{margin-top:10px}
  .shopping-product-purchase{grid-template-columns:96px minmax(0,1fr);gap:8px;padding:0}
  .shopping-product-purchase-price{width:96px}
  .shopping-product-purchase button{min-height:48px;padding:8px 10px;font-size:15px}
}



/* Einkaufsverlauf */
.shopping-history-page{min-width:0;overflow-x:clip}
.shopping-history-head{position:relative;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}
.shopping-history-head>div:first-child{min-width:0}
.shopping-history-filter-panel{position:relative;z-index:55;flex:0 0 auto}
.shopping-history-toolbar .shopping-history-filter-toggle{position:relative}
.shopping-history-toolbar .app-filter-text{display:none}
.shopping-history-toolbar .shopping-history-filter-count{position:absolute;top:-5px;right:-5px;min-width:18px;height:18px;padding:0 4px}
.shopping-history-filter-panel>summary{list-style:none}
.shopping-history-filter-panel>summary::-webkit-details-marker{display:none}
.shopping-history-filter-toggle{display:flex;align-items:center;justify-content:center;gap:7px;min-height:42px;margin:0;padding:8px 11px;border:1px solid var(--line);border-radius:12px;background:var(--theme-surface);color:var(--ink);font-size:13px;font-weight:700;cursor:pointer}
.shopping-history-filter-toggle:hover{background:var(--theme-surface-soft)}
.shopping-history-filter-toggle svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round}
.shopping-history-filter-count{min-width:19px;height:19px;display:grid;place-items:center;padding:0 5px;border-radius:10px;background:var(--theme-selected-border);color:#fff;font-size:10px;line-height:1}
.shopping-history-filter-popover{position:absolute;z-index:60;top:50px;right:0;width:min(360px,calc(100vw - 32px));max-width:calc(100vw - 32px);padding:14px;overflow:hidden;border:1px solid var(--line);border-radius:14px;background:var(--theme-surface);box-shadow:0 18px 45px rgba(25,59,52,.2);box-sizing:border-box}
.shopping-history-filter{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;width:100%;min-width:0;margin:0}
.shopping-history-filter>*{min-width:0;max-width:100%;box-sizing:border-box}
.shopping-history-filter-field{display:grid;gap:6px;width:100%;min-width:0;max-width:100%;margin:0;overflow:hidden}
.shopping-history-filter-field select{display:block;width:100%;min-width:0;max-width:100%;margin:0;box-sizing:border-box;font-size:16px}
.shopping-history-date-wrap{display:block;width:100%;min-width:0;max-width:100%;overflow:hidden}
.shopping-history-date-wrap input[type="date"]{display:block;width:100%;min-width:0;max-width:100%;inline-size:100%;min-inline-size:0;max-inline-size:100%;margin:0;overflow:hidden;box-sizing:border-box;font-size:16px;-webkit-appearance:none;appearance:none}
.shopping-history-filter button,.shopping-history-filter a{width:100%;margin:0;box-sizing:border-box;text-align:center}
.shopping-history-days{display:grid;gap:10px;margin-top:10px}
.shopping-history-day{min-width:0;border:1px solid var(--theme-divider);border-radius:12px;overflow:hidden;background:var(--theme-surface)}
.shopping-history-day>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:42px;padding:9px 12px;list-style:none;cursor:pointer;font-weight:650}
.shopping-history-day>summary::-webkit-details-marker{display:none}
.shopping-history-day[open]>summary{border-bottom:1px solid var(--theme-divider)}
.shopping-history-day>summary span:last-child{font-size:12px;color:var(--muted);font-weight:500}
.shopping-history-list-groups{display:grid}
.shopping-history-list-group{min-width:0}
.shopping-history-list-group+.shopping-history-list-group{border-top:1px solid var(--theme-divider)}
.shopping-history-list-head{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:36px;padding:7px 11px;background:var(--theme-surface-soft)}
.shopping-history-list-head strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.shopping-history-list-head span{flex:0 0 auto;color:var(--muted);font-size:11px}
.shopping-history-items{display:grid}
.shopping-history-item{display:grid;grid-template-columns:36px minmax(0,1fr) 32px;align-items:center;gap:7px;min-height:46px;padding:5px 9px;border-bottom:1px solid var(--theme-divider)}
.shopping-history-item:last-child{border-bottom:0}
.shopping-history-quantity{font-size:14px;font-weight:700;text-align:center}
.shopping-history-main{display:grid;gap:1px;min-width:0}
.shopping-history-main strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px;line-height:1.25}
.shopping-history-meta{overflow:hidden;color:var(--muted);font-size:11px;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}
.shopping-history-item form{margin:0}
.shopping-history-add{width:30px!important;height:30px!important;display:grid!important;place-items:center;margin:0!important;padding:0!important;border:1px solid var(--line)!important;border-radius:50%!important;background:transparent!important;color:var(--ink)!important;transition:opacity .12s ease,background .12s ease,border-color .12s ease}
.shopping-history-add:hover{background:var(--theme-surface-soft)!important}
.shopping-history-add:disabled{cursor:default}
.shopping-history-add.is-pending{opacity:.48}
.shopping-history-add.is-success{border-color:var(--green)!important;background:var(--green)!important;color:#fff!important}
.shopping-history-add-icon{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.shopping-history-ajax-status{position:fixed;z-index:95;left:50%;bottom:24px;width:max-content;max-width:calc(100vw - 32px);margin:0;padding:9px 13px;transform:translateX(-50%);border-radius:12px;background:var(--green);color:#fff;font-size:12px;font-weight:700;text-align:center;box-shadow:0 10px 30px rgba(0,0,0,.22)}
.shopping-history-ajax-status[data-state="error"]{background:#a13f35}
.shopping-history-ajax-status[hidden]{display:none!important}
body.has-mobile-tabbar .shopping-history-ajax-status{bottom:calc(92px + env(safe-area-inset-bottom))}
.shopping-history-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:18px}
.shopping-history-pagination span{font-size:12px;color:var(--muted)}
@media(max-width:700px){
    .shopping-history-filter-popover{width:min(340px,calc(100vw - 24px));max-width:calc(100vw - 24px)}
    .shopping-history-item{grid-template-columns:34px minmax(0,1fr) 30px;gap:6px;min-height:44px;padding:5px 8px}
    .shopping-history-add{width:28px!important;height:28px!important}
}



/* Shopping module home: compact direct actions */
.shopping-head-action{width:48px;height:48px;display:grid;place-items:center;margin:0;padding:0;border:1px solid var(--line);border-radius:50%;background:var(--theme-surface);color:var(--ink);text-decoration:none;box-sizing:border-box;-webkit-tap-highlight-color:transparent}
.shopping-head-action svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
@media (hover:hover) and (pointer:fine){
  .shopping-head-action:hover,
  .shopping-template-action:hover,
  .shopping-catalog-action:hover{background:#f1f4ed;color:var(--ink)}
}
@media (hover:none), (pointer:coarse){
  .shopping-head-action:hover,
  .shopping-head-action:active,
  .shopping-template-action:hover,
  .shopping-template-action:active,
  .shopping-catalog-action:hover,
  .shopping-catalog-action:active{background:var(--theme-surface);color:var(--ink)}
}

@media(max-width:700px){
  .shopping-head{margin-bottom:18px}
  .shopping-head .lede{display:none}
  .shopping-head h1{margin-bottom:0}
  .shopping-head-actions{gap:6px;flex-wrap:nowrap}
  .shopping-head-action{width:44px;height:44px;flex:0 0 44px}
}


@media(max-width:380px){
  .shopping-head{gap:10px}
  .shopping-head-actions{gap:4px}
  .shopping-head-action,
  .shopping-template-action,
  .shopping-catalog-action,
  .shopping-create>.app-add-action{
    width:40px;
    height:40px;
    flex-basis:40px;
  }
  .shopping-head-action svg,
  .shopping-template-action svg,
  .shopping-catalog-action svg{width:19px;height:19px}
  .shopping-create>.app-add-action svg{width:20px;height:20px}
}


/* Product group rows: restore their own grid after the generic compact shopping-row override. */
.shopping-item.shopping-template-product-row{grid-template-columns:42px minmax(0,1fr) 42px!important}
.shopping-item.shopping-template-product-row.has-photo{grid-template-columns:42px 42px minmax(0,1fr) 42px!important}
@media(max-width:520px){
  .shopping-item.shopping-template-product-row{grid-template-columns:38px minmax(0,1fr) 38px!important}
  .shopping-item.shopping-template-product-row.has-photo{grid-template-columns:38px 38px minmax(0,1fr) 38px!important}
}


/* Desktop app shell: let module overview pages use the available workspace. */
@media(min-width:701px){
  body[data-authenticated-app] .shopping-page{max-width:1180px}
}
@media(min-width:1200px){
  body[data-authenticated-app] .shopping-page{max-width:1280px}
  body[data-authenticated-app] .shopping-list-grid{grid-template-columns:repeat(auto-fit,minmax(420px,1fr));gap:20px}
}


/* Product overlay v2 and receipt checkout */
.shopping-photo-dialog[data-mode="detail"]{
  width:min(92vw,760px);
  height:min(82vh,620px);
  max-height:min(82vh,620px);
  overflow:hidden;
}
.shopping-product-detail{
  grid-template-columns:210px minmax(0,1fr)!important;
  grid-template-rows:auto auto minmax(0,1fr) auto;
  column-gap:24px;
  height:100%;
  padding:24px;
  overflow:auto;
  box-sizing:border-box;
}
.shopping-product-detail-media-slot{
  grid-column:1;
  grid-row:1/3;
  width:210px;
  height:210px;
}
.shopping-product-detail-media,
.shopping-product-detail-placeholder{
  width:210px;
  height:210px;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--theme-surface-raised);
  box-sizing:border-box;
}
.shopping-product-detail-placeholder{
  display:grid;
  place-items:center;
  color:var(--muted);
}
.shopping-product-detail-placeholder[hidden]{display:none!important}
.shopping-product-detail-placeholder svg{
  width:64px;
  height:64px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.35;
  stroke-linecap:round;
  stroke-linejoin:round;
  opacity:.5;
}
.shopping-product-detail-media{border-radius:18px!important}
.shopping-product-detail-copy{grid-column:2;grid-row:1;padding-top:5px}
.shopping-product-detail-copy h2{font-size:26px}
.shopping-product-detail-history{
  grid-column:1/-1;
  grid-row:3;
  align-self:start;
  margin-top:22px;
  padding:16px;
  border:1px solid var(--theme-divider);
  border-radius:14px;
  background:var(--theme-surface-raised);
}
.shopping-product-detail-last{display:grid;gap:4px}
.shopping-product-detail-last>span{
  color:var(--muted);
  font-size:11px;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.shopping-product-detail-last>strong{
  color:var(--ink);
  font-size:15px;
  line-height:1.4;
}
.shopping-product-detail-history-list{
  display:grid;
  gap:0;
  margin-top:12px;
  border-top:1px solid var(--theme-divider);
}
.shopping-product-detail-history-row{
  padding:9px 0;
  border-bottom:1px solid var(--theme-divider);
  color:var(--muted);
  font-size:13px;
  font-weight:600;
}
.shopping-product-detail-history-row:last-child{border-bottom:0}
.shopping-product-detail-actions,
.shopping-product-detail:not(:has(.shopping-product-detail-media:not([hidden]))) .shopping-product-detail-actions{
  grid-column:1/-1;
  grid-row:4;
  margin-top:18px;
}
.shopping-trip-finish{margin:8px 0 16px}
.shopping-trip-finish[hidden]{display:none!important}
.shopping-trip-finish-open{
  min-height:40px;
  margin:0;
  padding:8px 13px;
  border:1px solid var(--line);
  border-radius:11px;
  background:var(--theme-surface);
  color:var(--ink);
  font-size:13px;
  font-weight:750;
}
.shopping-trip-finish-open:hover{background:var(--theme-surface-soft);color:var(--ink)}
.shopping-trip-fab{
  margin:0;
  font-size:13px;
  line-height:1;
}
.shopping-trip-fab[hidden]{display:none!important}
.shopping-trip-fab:disabled{opacity:.62;cursor:wait}

.shopping-receipt-dialog{
  width:min(92vw,520px);
  max-width:none;
  margin:auto;
  padding:0;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--theme-surface);
  color:var(--ink);
  box-shadow:0 26px 80px rgba(0,0,0,.32);
}
.shopping-receipt-dialog::backdrop{background:rgba(8,14,12,.72);backdrop-filter:blur(2px)}
.shopping-receipt-dialog-body{padding:22px}
.shopping-receipt-dialog-body h2{margin:0 0 8px}
.shopping-receipt-dialog-body p{margin:0 0 16px}
.shopping-receipt-dialog form{display:grid;gap:9px;margin:0}
.shopping-receipt-dialog form button{width:100%;margin:0}
.shopping-receipt-input{display:none}
.shopping-receipt-dialog-close{
  position:absolute;
  top:10px;
  right:10px;
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  margin:0;
  padding:0;
  border:0;
  border-radius:50%;
  background:var(--theme-surface-raised);
  color:var(--ink);
  font-size:24px;
  line-height:1;
}
.shopping-receipt-status{min-height:0;margin:2px 0 0!important}
.shopping-receipt-status:empty{display:none}

@media(max-width:520px){
  .shopping-photo-dialog[data-mode="detail"]{
    width:calc(100vw - 20px);
    height:min(84vh,640px);
    max-height:min(84vh,640px);
  }
  .shopping-product-detail{
    grid-template-columns:120px minmax(0,1fr)!important;
    column-gap:14px;
    padding:16px;
  }
  .shopping-product-detail-media-slot,
  .shopping-product-detail-media,
  .shopping-product-detail-placeholder{
    width:120px;
    height:120px;
  }
  .shopping-product-detail-placeholder svg{width:44px;height:44px}
  .shopping-product-detail-copy h2{font-size:20px}
  .shopping-product-detail-history{margin-top:16px;padding:13px}
  .shopping-product-detail-actions,
  .shopping-product-detail:not(:has(.shopping-product-detail-media:not([hidden]))) .shopping-product-detail-actions{
    margin-top:14px;
  }
  .shopping-receipt-dialog{width:calc(100vw - 20px)}
  .shopping-receipt-dialog-body{padding:18px}
}


/* Coupons & vouchers */
.shopping-list-more-actions{position:relative;flex:0 0 auto}
.shopping-list-more-actions>summary{list-style:none;cursor:pointer}
.shopping-list-more-actions>summary::-webkit-details-marker{display:none}
.shopping-list-more-toggle svg{width:20px;height:20px;fill:currentColor;stroke:none}
.shopping-list-more-menu{
  position:absolute;
  z-index:55;
  top:56px;
  right:0;
  width:max-content;
  min-width:230px;
  padding:6px;
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--theme-surface);
  box-shadow:0 16px 40px rgba(25,59,52,.16);
}
.shopping-list-more-menu a{
  display:block;
  padding:10px 12px;
  border-radius:9px;
  color:var(--ink);
  text-decoration:none;
  font-size:14px;
  font-weight:700;
  white-space:nowrap;
}
.shopping-list-more-menu a:hover{background:var(--theme-surface-soft);color:var(--ink)}
.shopping-coupon-notice{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:44px;
  margin:0 0 14px;
  padding:9px 13px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--theme-surface);
  color:var(--ink);
  text-decoration:none;
  font-size:13px;
}
.shopping-coupon-notice:hover{background:var(--theme-surface-soft);color:var(--ink)}
.shopping-coupon-notice strong{font-weight:800}
.shopping-coupon-notice-arrow{font-size:22px;line-height:1;color:var(--muted)}
.shopping-coupon-editor-page,.shopping-coupon-detail-page{max-width:720px}
.shopping-coupon-form>.shopping-editor-card{margin-top:0}
.shopping-coupon-form label{display:block;margin-top:15px}
.shopping-coupon-form label:first-child{margin-top:0}
.shopping-coupon-value-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.shopping-coupon-money-input{display:grid;grid-template-columns:minmax(0,1fr) 42px;align-items:center}
.shopping-coupon-money-input input{border-radius:10px 0 0 10px}
.shopping-coupon-money-input span{
  height:100%;
  min-height:44px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-left:0;
  border-radius:0 10px 10px 0;
  background:var(--theme-surface-soft);
  font-weight:700;
}
.shopping-coupon-detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}
.shopping-coupon-detail-head h1{margin-bottom:6px}
.shopping-coupon-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:8px;margin-bottom:14px}
.shopping-coupon-facts>div{display:grid;gap:3px;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:var(--theme-surface)}
.shopping-coupon-facts span{font-size:11px;color:var(--muted);font-weight:650}
.shopping-coupon-facts strong{font-size:15px}
.shopping-coupon-barcode-card{
  margin:14px 0;
  padding:14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--theme-surface);
  color:var(--ink);
  text-align:center;
}
.shopping-coupon-barcode-svg{display:block;width:min(100%,540px);height:auto;margin:0 auto}
.shopping-coupon-barcode-value{display:block;margin-top:8px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.08em;overflow-wrap:anywhere}
.shopping-coupon-original{margin:14px 0;padding:14px;border:1px solid var(--line);border-radius:16px;background:var(--theme-surface)}
.shopping-coupon-original h2,.shopping-coupon-terms h2{margin:0 0 10px;font-size:18px}
.shopping-coupon-original-button{display:block;width:100%;margin:0;padding:0;border:0;background:transparent;color:inherit;cursor:zoom-in}
.shopping-coupon-original-button:focus-visible{outline:3px solid #b97612;outline-offset:3px}
.shopping-coupon-original img{display:block;max-width:100%;max-height:70vh;margin:0 auto;border-radius:11px;object-fit:contain}
.shopping-coupon-original-hint{margin:9px 0 0;text-align:center}
.shopping-coupon-original-link{display:inline-block}
.shopping-coupon-terms p{margin:0;white-space:pre-wrap}
.shopping-coupon-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}
.shopping-coupon-actions form{margin:0}
.shopping-coupon-actions button{margin:0}

@media(max-width:700px){
  .shopping-list-more-menu{position:fixed;top:calc(env(safe-area-inset-top) + 64px);right:8px;max-width:calc(100vw - 16px)}
  .shopping-coupon-notice{align-items:flex-start}
  .shopping-coupon-value-grid{grid-template-columns:1fr}
}

.shopping-coupon-index-page{max-width:720px}
.shopping-coupon-index-page .shopping-list-head{margin-bottom:14px}
.shopping-coupon-index-page .app-add-action{text-decoration:none}
.shopping-coupon-list{display:grid;gap:8px}
.shopping-coupon-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  min-height:64px;
  padding:11px 13px;
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--theme-surface);
  color:var(--ink);
  text-decoration:none;
}
.shopping-coupon-card:hover{background:var(--theme-surface-soft);color:var(--ink)}
.shopping-coupon-card-main{display:grid;gap:2px;min-width:0}
.shopping-coupon-card-main strong,.shopping-coupon-card-main span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shopping-coupon-card-main span{font-size:13px}
.shopping-coupon-card-main small{color:var(--muted)}
.shopping-coupon-card.is-past{opacity:.72}
.shopping-coupon-past{margin-top:18px}
.shopping-coupon-past .shopping-coupon-list{padding:10px}

.shopping-coupon-capture-status{min-height:1.35em;margin-top:6px}
.shopping-coupon-capture-status[data-state="working"]{font-weight:700}
.shopping-coupon-capture-status[data-state="success"]{font-weight:700}
.shopping-coupon-capture-status[data-state="error"]{font-weight:700}
.shopping-coupon-form button[type="submit"]:disabled{opacity:.55;cursor:wait}


/* Completed shopping trip and receipt visibility */
.shopping-trip-card{
  margin-top:18px;
  padding:15px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--theme-surface);
}
.shopping-trip-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}
.shopping-trip-card-title{
  display:grid;
  gap:2px;
  min-width:0;
}
.shopping-trip-card-title>span{
  color:var(--muted);
  font-size:11px;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.shopping-trip-card-title>strong{font-size:15px;line-height:1.35}
.shopping-trip-card-title>small{color:var(--muted);font-size:12px}
.shopping-trip-badge{
  flex:0 0 auto;
  padding:5px 8px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--theme-surface-raised);
  color:var(--ink);
  font-size:11px;
  font-weight:750;
}
.shopping-trip-card-status{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin-top:13px;
  padding:11px 12px;
  border-radius:11px;
  background:var(--theme-surface-raised);
}
.shopping-trip-status-check{
  width:24px;
  height:24px;
  display:grid;
  place-items:center;
  flex:0 0 24px;
  border-radius:50%;
  background:var(--green);
  color:#fff;
  font-size:13px;
  font-weight:800;
}
.shopping-trip-card-status>div{display:grid;gap:2px;min-width:0}
.shopping-trip-card-status strong{font-size:13px}
.shopping-trip-card-status span:not(.shopping-trip-status-check){color:var(--muted);font-size:12px}
.shopping-trip-card-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:11px;
}
.shopping-trip-card-actions form{margin:0}
.shopping-trip-card-actions .button{
  min-height:38px;
  margin:0;
  padding:8px 11px;
  font-size:12px;
}
.shopping-history-purchase-group{min-width:0}
.shopping-history-purchase-group+.shopping-history-purchase-group{border-top:1px solid var(--theme-divider)}
.shopping-history-purchase-group>.shopping-trip-card{margin:10px 12px 0}
.shopping-history-purchase-group.has-trip>.shopping-history-items{margin-top:4px}

@media(max-width:520px){
  .shopping-trip-card{padding:13px}
  .shopping-trip-card-head{gap:8px}
  .shopping-trip-badge{font-size:10px}
  .shopping-trip-card-actions{display:grid;grid-template-columns:1fr 1fr}
  .shopping-trip-card-actions .button{text-align:center}
  .shopping-history-purchase-group>.shopping-trip-card{margin:8px 9px 0}
}

/* Shopping home copy is content, not part of the shared toolbar geometry. */
.shopping-home-intro{margin:-4px 0 20px}
@media(max-width:700px){.shopping-home-intro{display:none}}
.shopping-photo-save-progress{margin:8px 0 0}
.shopping-photo-save-progress[hidden]{display:none!important}
.shopping-photo-save-progress progress{display:block;width:100%;height:8px;accent-color:var(--green)}
.shopping-product-edit-form button[aria-busy="true"]{cursor:progress}

/* X22: receipt review workflow */
.shopping-trip-badge-action{text-decoration:none}
.shopping-trip-badge-action:hover{text-decoration:underline}
.shopping-receipt-review-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin:12px 0 14px;
}
.shopping-receipt-review-head h1{margin:2px 0 4px}
.shopping-receipt-review-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:0 0 14px;
  padding:13px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--theme-surface);
}
.shopping-receipt-review-summary>div{display:grid;gap:2px}
.shopping-receipt-review-summary span{color:var(--muted);font-size:12px}
.shopping-receipt-reprocess{
  display:flex;
  align-items:center;
  gap:12px;
  margin:0 0 14px;
}
.shopping-receipt-reprocess p{margin:0}
.shopping-receipt-review-list{display:grid;gap:12px}
.shopping-receipt-review-line{
  padding:14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--theme-surface);
}
.shopping-receipt-review-line>header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.shopping-receipt-review-line h2{
  margin:2px 0 0;
  font-size:16px;
  line-height:1.35;
}
.shopping-receipt-line-state{
  flex:0 0 auto;
  padding:4px 8px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--theme-surface-raised);
  font-size:11px;
  font-weight:750;
}
.shopping-receipt-line-values{
  display:flex;
  flex-wrap:wrap;
  gap:6px 12px;
  margin-top:10px;
  font-size:13px;
}
.shopping-receipt-suggestion{
  margin:11px 0 0;
  padding:10px 11px;
  border-radius:10px;
  background:var(--theme-surface-raised);
  font-size:13px;
}
.shopping-receipt-review-form{
  display:grid;
  gap:10px;
  margin-top:12px;
}
.shopping-receipt-review-form label{display:grid;gap:6px;font-size:13px;font-weight:700}
.shopping-receipt-review-form select{width:100%}
.shopping-receipt-review-actions{display:flex;gap:8px;flex-wrap:wrap}
.shopping-receipt-review-actions button{margin:0}
.shopping-receipt-line-message{margin:0;font-size:12px}
.shopping-receipt-line-message[data-state="working"]{color:var(--muted)}
.shopping-receipt-line-message[data-state="success"]{font-weight:700}
.shopping-receipt-line-message[data-state="error"]{font-weight:700}
.shopping-receipt-review-line.is-resolved{
  opacity:.55;
  transition:opacity .2s ease;
}

@media(max-width:620px){
  .shopping-receipt-review-head{display:grid}
  .shopping-receipt-review-head .button{justify-self:start}
  .shopping-receipt-review-summary{display:grid}
  .shopping-receipt-reprocess{display:grid}
  .shopping-receipt-review-actions{display:grid;grid-template-columns:1fr}
  .shopping-receipt-review-actions button{width:100%}
}


/* Receipt review: keep unresolved work primary and resolved rows compact. */
.shopping-receipt-review-work{display:grid;gap:10px}
.shopping-receipt-section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin:6px 0 0;
}
.shopping-receipt-section-head h2{margin:0 0 2px;font-size:18px}
.shopping-receipt-section-head p{margin:0}
.shopping-receipt-section-count{
  display:grid;
  min-width:30px;
  height:30px;
  place-items:center;
  padding:0 8px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--theme-surface-raised);
  color:var(--ink);
  font-size:12px;
  font-weight:800;
}
.shopping-receipt-review-complete{
  display:grid;
  gap:3px;
  margin:6px 0 12px;
  padding:13px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--theme-surface);
}
.shopping-receipt-review-complete[hidden]{display:none!important}
.shopping-receipt-resolved-group{
  margin-top:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--theme-surface);
  overflow:hidden;
}
.shopping-receipt-resolved-group>summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:52px;
  padding:10px 13px;
  list-style:none;
  cursor:pointer;
  font-weight:800;
}
.shopping-receipt-resolved-group>summary::-webkit-details-marker{display:none}
.shopping-receipt-resolved-group>summary::after{
  content:"⌄";
  margin-left:2px;
  color:var(--muted);
  font-size:18px;
  line-height:1;
  transition:transform .15s ease;
}
.shopping-receipt-resolved-group[open]>summary{
  border-bottom:1px solid var(--theme-divider);
}
.shopping-receipt-resolved-group[open]>summary::after{transform:rotate(180deg)}
.shopping-receipt-resolved-group>summary .shopping-receipt-section-count{margin-left:auto}
.shopping-receipt-compact-list{display:grid;gap:0}
.shopping-receipt-review-line-compact{
  border:0;
  border-radius:0;
  border-bottom:1px solid var(--theme-divider);
  padding:12px 13px;
}
.shopping-receipt-review-line-compact:last-child{border-bottom:0}
.shopping-receipt-review-line-compact h2{font-size:15px}
.shopping-receipt-review-line-compact .shopping-receipt-line-values{margin-top:6px}
.shopping-receipt-assignment{
  display:flex;
  align-items:center;
  gap:7px;
  margin:8px 0 0;
  font-size:13px;
}
.shopping-receipt-no-assignment{margin:8px 0 0}
.shopping-receipt-line-editor{margin-top:9px}
.shopping-receipt-line-editor>summary{
  width:max-content;
  max-width:100%;
  padding:4px 0;
  list-style:none;
  color:var(--muted);
  cursor:pointer;
  font-size:12px;
  font-weight:750;
}
.shopping-receipt-line-editor>summary::-webkit-details-marker{display:none}
.shopping-receipt-line-editor>summary::after{content:" ›"}
.shopping-receipt-line-editor[open]>summary::after{content:" ⌄"}
.shopping-receipt-line-editor .shopping-receipt-review-form{
  margin-top:8px;
  padding-top:10px;
  border-top:1px solid var(--theme-divider);
}
.shopping-receipt-integrity-warning{
  margin:10px 0 0;
  padding:9px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--theme-surface-raised);
  font-size:12px;
  font-weight:700;
}

@media(max-width:620px){
  .shopping-receipt-section-head{align-items:center}
  .shopping-receipt-resolved-group>summary{min-height:50px}
  .shopping-receipt-review-line-compact{padding:11px 12px}
}

.shopping-category-editor-details>div{display:grid;grid-template-columns:30px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:52px;padding:8px 10px}

/* X24 offline-first: compact state and recoverable conflict controls. */
[data-shopping-offline-status]{white-space:nowrap}
[data-shopping-offline-status][data-state="offline"],
[data-shopping-offline-status][data-state="auth"],
[data-shopping-offline-status][data-state="conflict"]{font-weight:650}
[data-shopping-offline-conflicts]{display:grid;gap:8px;margin:0 0 12px}
[data-shopping-offline-conflicts][hidden]{display:none}
.shopping-offline-conflict{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--theme-surface)}
.shopping-offline-conflict>span{flex:1 1 220px;min-width:0}
.shopping-offline-conflict button{margin:0}

/* X34 history-first add overlay: reuse list-row proportions and keep iOS keyboard opt-in. */
.shopping-add-popover{
  width:min(620px,calc(100vw - 36px));
  max-height:min(78vh,720px);
  padding:10px;
  overflow:hidden;
}
.shopping-add-popover form{
  display:flex;
  flex-direction:column;
  min-height:0;
  max-height:inherit;
}
.shopping-product-entry{
  display:flex;
  flex:1 1 auto;
  flex-direction:column;
  min-height:0;
}
.shopping-suggestions{
  flex:1 1 auto;
  min-height:0;
  margin-top:8px;
  align-content:start;
  grid-auto-rows:max-content;
  box-shadow:none;
}
.shopping-add-product-row{
  grid-template-columns:44px minmax(0,1fr) 42px!important;
  gap:8px!important;
  min-height:58px!important;
  padding:5px 8px!important;
}
.shopping-add-product-row.has-photo{
  grid-template-columns:44px 46px minmax(0,1fr) 42px!important;
}
.shopping-add-product-row .shopping-add-quantity-picker{
  margin-left:0;
}
.shopping-add-product-row .shopping-item-quantity-popover{
  z-index:155;
}
.shopping-add-product-row .shopping-product-thumb{
  justify-self:center;
}
.shopping-add-product-main{
  overflow:hidden;
}
.shopping-add-product-name{
  display:block;
  max-width:100%;
  padding:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis;
  white-space:nowrap!important;
  font-size:16px;
  line-height:1.35;
}
.shopping-add-product-add{
  width:38px;
  height:38px;
  min-height:38px;
  justify-self:center;
  font-size:23px;
}
.shopping-add-empty{
  margin:0;
  padding:20px 12px;
  text-align:center;
}
.shopping-suggestions-label{
  padding:9px 10px 6px;
}

@media(max-width:700px){
  body.shopping-add-overlay-open{
    overflow:hidden;
  }
  body.shopping-add-overlay-open .shopping-trip-fab{
    visibility:hidden;
    pointer-events:none;
  }
  .shopping-add-panel[open]::before{
    content:"";
    position:fixed;
    z-index:130;
    inset:0;
    background:rgba(8,14,12,.48);
  }
  .shopping-add-popover{
    position:fixed;
    z-index:140;
    top:max(6px,env(safe-area-inset-top));
    right:6px;
    bottom:max(6px,env(safe-area-inset-bottom));
    left:6px;
    width:auto;
    height:auto;
    max-width:none;
    max-height:none;
    padding:8px;
    border-radius:16px;
  }
  .shopping-add-popover form{
    height:100%;
  }
  .shopping-product-entry{
    height:100%;
  }
  .shopping-product-entry-row{
    flex:0 0 auto;
  }
  .shopping-suggestions{
    flex:1 1 auto;
    max-height:none;
    margin-top:8px;
  }
  .shopping-add-product-row{
    grid-template-columns:42px minmax(0,1fr) 40px!important;
    min-height:58px!important;
  }
  .shopping-add-product-row.has-photo{
    grid-template-columns:42px 42px minmax(0,1fr) 40px!important;
  }
  .shopping-add-product-row .shopping-product-thumb{
    width:36px;
    height:36px;
  }
  .shopping-add-product-add{
    width:36px;
    height:36px;
    min-height:36px;
  }
}


/* X75: optional row tap acts only on established products; quantity and + remain distinct. */
.shopping-add-product-row[data-shopping-row-tappable="true"]{cursor:pointer}
.shopping-add-row-label-button{
  display:grid;
  align-content:center;
  justify-content:stretch;
  justify-items:stretch;
  width:100%;
  min-height:40px;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  color:inherit;
  font:inherit;
  text-align:left;
  cursor:pointer;
}
.shopping-add-row-label-button:hover{background:transparent;color:inherit}
.shopping-add-row-label-button:focus-visible{outline:2px solid var(--ink);outline-offset:2px;border-radius:3px}
.shopping-ui-preferences-panel{padding:20px}
.shopping-ui-preferences-panel h2{margin:0 0 8px}
.shopping-ui-preferences-panel>p{margin:0 0 18px}
.shopping-ui-preferences-panel fieldset{margin:0;padding:0;border:0}
.shopping-ui-preferences-panel legend{margin-bottom:10px;font-weight:700}
.shopping-ui-preference-option{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin:0;
  padding:16px 0;
  border-top:1px solid var(--theme-divider);
  cursor:pointer;
}
.shopping-ui-preference-copy{display:grid;gap:4px;min-width:0}
.shopping-ui-preference-copy strong{font-size:15px}
.shopping-ui-preference-copy small{font-size:13px;color:var(--muted);line-height:1.4}
.shopping-ui-preference-option input[type="checkbox"]{width:22px;height:22px;margin:0}
.shopping-ui-preferences-panel form>button{margin-top:16px}
@media(max-width:700px){.shopping-ui-preferences-panel{padding:14px}}
