@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");
:root {
  font-family: "DM Sans", sans-serif;
  color: #202238;
  background: #f7f8fc;
  font-synthesis: none;
  --accent: #6254df;
  --muted: #71768b;
  --line: #e7e8f0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  display: flex;
  min-height: 100vh;
}
button,
input {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  min-height: 44px;
}
button:hover {
  filter: brightness(0.92);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #c0872e;
  outline-offset: 3px;
}
aside {
  width: 242px;
  position: fixed;
  inset: 0 auto 0 0;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 40px 26px;
  display: flex;
  flex-direction: column;
}
.brand {
  text-decoration: none;
  color: var(--accent);
  font-family: Manrope, sans-serif;
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -1.4px;
}
.brand span {
  display: block;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  margin-top: 9px;
}
nav {
  display: grid;
  gap: 8px;
  margin-top: 66px;
}
nav a {
  padding: 14px 18px;
  text-decoration: none;
  border-radius: 10px;
  color: #6c7086;
  font-weight: 600;
}
nav a.active {
  background: var(--accent);
  color: white;
}
.household {
  margin-top: auto;
  font-size: 14px;
  font-weight: 600;
}
.household small {
  display: block;
  font-weight: 400;
  margin-top: 8px;
  font-size: 12px;
}
.workspace {
  margin-left: 242px;
  width: calc(100% - 242px);
  padding: 0 50px;
  max-width: 1500px;
}
header {
  height: 88px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 2px;
}
.avatar {
  background: #edeaff;
  border-radius: 50%;
  padding: 12px 15px;
  letter-spacing: 0;
}
.notice {
  font-size: 12px;
  color: #73758a;
  background: #eeeff5;
  padding: 10px 14px;
  border-radius: 6px;
  margin-top: 22px;
}
main {
  padding: 38px 0 20px;
}
.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--muted);
}
h1 {
  font-family: Manrope, sans-serif;
  font-size: 40px;
  letter-spacing: -1.7px;
  margin: 10px 0;
}
h2 {
  font-family: Manrope, sans-serif;
  font-size: 20px;
  letter-spacing: -0.4px;
}
p {
  line-height: 1.6;
}
.sub {
  color: var(--muted);
  margin: 8px 0 28px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.panel-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-head h2 {
  margin: 0;
}
.add-form {
  display: flex;
  padding: 18px;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
input {
  border: 1px solid #dcddea;
  background: #fff;
  padding: 13px;
  border-radius: 8px;
  min-width: 0;
}
.add-form input {
  flex: 1;
}
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid #eeeff5;
}
.row:last-child {
  border: 0;
}
.item-icon {
  width: 42px;
  height: 46px;
  border-radius: 12px;
  background: #f6f3fc;
  display: grid;
  place-items: center;
  font-size: 24px;
}
.item-text {
  flex: 1;
  min-width: 0;
}
.item-text strong {
  display: block;
  font-size: 15px;
}
.item-text small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
  font-size: 12px;
}
.picked strong {
  text-decoration: line-through;
  color: #8c90a3;
}
.row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.text-button {
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  padding: 8px 10px;
}
.secondary {
  background: #f0effb;
  color: var(--accent);
}
.summary {
  padding: 26px;
  background: #efedff;
  border-radius: 16px;
  align-self: start;
}
.summary h2 {
  margin-top: 0;
}
.amount {
  font-family: Manrope;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -1px;
}
.summary p {
  font-size: 13px;
  color: #73718c;
}
.summary button {
  width: 100%;
  margin-top: 14px;
}
.divider {
  border-top: 1px solid #dcd6f7;
  margin: 20px 0;
}
.metric {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-top: 12px;
}
.hint {
  padding: 18px 22px;
  border: 1px dashed #c8c0ea;
  border-radius: 12px;
  margin-top: 20px;
  font-size: 13px;
  color: #74708c;
}
.section-label {
  margin: 25px 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #77718e;
}
.section-label:first-child {
  margin-top: 0;
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.card {
  padding: 26px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
}
.card .item-icon {
  margin-bottom: 18px;
}
.card h2 {
  margin-bottom: 6px;
}
.card p {
  color: var(--muted);
  font-size: 14px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.tag {
  display: inline-block;
  font-size: 11px;
  color: #866424;
  background: #f5edd6;
  padding: 6px 10px;
  border-radius: 20px;
  margin: 8px 0;
}
.empty {
  padding: 36px;
  text-align: center;
  color: var(--muted);
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding: 20px 0 35px;
}
#status {
  min-height: 24px;
  color: var(--accent);
  font-size: 14px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  width: min(440px, 90vw);
  color: #202238;
}
dialog::backdrop {
  background: #1b1b405c;
}
dialog label {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  font-size: 14px;
}
progress {
  width: 100%;
  height: 8px;
  accent-color: var(--accent);
  margin-top: 18px;
}
@media (max-width: 1100px) {
  .workspace {
    padding: 0 28px;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .summary {
    max-width: none;
  }
  .summary button {
    max-width: 300px;
  }
}
@media (max-width: 700px) {
  body {
    display: block;
  }
  aside {
    position: static;
    width: auto;
    padding: 20px;
    border: 0;
    background: #f0effb;
  }
  .brand {
    font-size: 25px;
  }
  .brand span,
  .household {
    display: none;
  }
  nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    margin: 0;
    background: #f0effb;
    padding: 8px 5px;
    border-top: 1px solid var(--line);
    justify-content: space-around;
  }
  nav a {
    padding: 12px 9px;
    font-size: 12px;
  }
  .workspace {
    margin: 0;
    width: 100%;
    padding: 0 18px;
  }
  header {
    display: none;
  }
  .notice {
    margin-top: 16px;
    font-size: 10px;
  }
  main {
    padding-top: 24px;
  }
  h1 {
    font-size: 32px;
  }
  .row {
    padding: 17px 14px;
    gap: 10px;
  }
  .item-icon {
    width: 34px;
    font-size: 21px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .add-form {
    padding: 12px;
  }
  .add-form button {
    padding: 12px;
  }
  .panel-head {
    padding: 18px;
  }
  .sub {
    font-size: 14px;
  }
  footer {
    padding-bottom: 90px;
    align-items: flex-start;
  }
  .summary {
    padding: 22px;
  }
}

/* Product-led cards and a cooler, high-contrast workspace. */
.brand {
  color: #25213f;
  letter-spacing: -1.5px;
}
.brand::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  background: #6254df;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  margin-right: 8px;
  font-size: 23px;
  vertical-align: 3px;
}
header {
  letter-spacing: 0;
  font-size: 14px;
  color: #71768b;
}
nav a.active {
  box-shadow: 0 6px 16px #6254df26;
}
.panel,
.card {
  box-shadow: 0 5px 22px #29214504;
  border-radius: 20px;
}
h1 {
  font-weight: 800;
  max-width: 750px;
}
.row {
  min-height: 104px;
}
.row:hover {
  background: #fbfaff;
}
.item-icon {
  width: 58px;
  height: 58px;
  font-size: 29px;
  flex-shrink: 0;
}
.product-image {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 12px;
  background: #faf9fc;
  flex-shrink: 0;
}
.product-link {
  display: inline-block;
  color: #5947c7;
  font-size: 12px;
  margin-top: 9px;
  text-decoration: none;
  padding: 4px 0;
}
.product-link:hover {
  text-decoration: underline;
}
.item-text {
  overflow-wrap: anywhere;
}
.summary {
  background: linear-gradient(145deg, #ede9ff, #f6f4ff 70%);
  border: 1px solid #e1dcf7;
  border-radius: 22px;
}
.amount {
  font-size: 46px;
  color: #302759;
}
.summary .hint {
  background: #ffffff70;
  border: 0;
}
.card > .product-image {
  width: 84px;
  height: 84px;
}
.tag {
  background: #fff2da;
  color: #896323;
}
.text-button {
  color: #6254df;
}
.editor-intro {
  font-size: 13px;
  color: #71768b;
}
dialog {
  width: min(560px, 94vw);
  max-height: 90dvh;
  padding: 30px;
  box-shadow: 0 25px 90px #19152b33;
}
dialog h2 {
  font-size: 25px;
  margin: 0;
}
.photo-editor {
  display: flex;
  gap: 16px;
  background: #f6f5fc;
  border-radius: 14px;
  padding: 16px;
  align-items: center;
}
.photo-editor > div {
  min-width: 0;
}
.photo-editor img {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: contain;
  background: white;
}
.photo-editor label {
  margin: 0;
}
.photo-editor small {
  font-size: 11px;
  color: #71768b;
}
input[type="file"] {
  border: 0;
  padding: 8px 0;
  background: transparent;
  width: 100%;
  font-size: 12px;
}
input::file-selector-button {
  border: 1px solid #dcd7f2;
  background: white;
  color: #6254df;
  padding: 8px;
  border-radius: 6px;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
#image-error {
  color: #b63448;
  font-size: 12px;
}
@media (max-width: 700px) {
  aside {
    background: white;
    border-bottom: 1px solid #e7e8f0;
  }
  nav {
    background: #ffffffed;
    backdrop-filter: blur(12px);
  }
  nav a.active {
    background: #ede9ff;
    color: #5b46d2;
    box-shadow: none;
  }
  h1 {
    font-size: 34px;
    line-height: 1.13;
  }
  .item-icon,
  .product-image {
    width: 44px;
    height: 50px;
    font-size: 24px;
  }
  .row {
    gap: 10px;
    padding: 18px 12px;
  }
  .row .text-button {
    padding: 8px 4px;
    font-size: 12px;
  }
  .item-text strong {
    font-size: 14px;
  }
  dialog {
    padding: 22px;
  }
  .photo-editor {
    flex-wrap: wrap;
  }
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 12px;
}
.quantity-control button,
.add-quantity button {
  background: #f0edff;
  color: #5540c2;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  font-size: 23px;
  border: 1px solid #e3def7;
}
.quantity-value {
  min-width: 44px;
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  color: #25213f;
  font-variant-numeric: tabular-nums;
}
.quantity-unit {
  margin-left: 12px;
  font-size: 13px;
  color: #53576e;
}
.add-form {
  flex-wrap: wrap;
  align-items: center;
}
.add-form > input {
  flex: 1 1 100%;
}
.add-quantity {
  display: flex;
  align-items: center;
  gap: 8px;
}
.add-quantity > span {
  font-size: 13px;
  font-weight: 600;
  margin-right: 4px;
}
.add-quantity input {
  width: 60px;
  flex: none;
  padding: 10px 4px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  appearance: textfield;
  -moz-appearance: textfield;
}
.add-quantity input::-webkit-inner-spin-button,
.add-quantity input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.add-form > button[type="submit"] {
  margin-left: auto;
}
@media (max-width: 700px) {
  .row {
    align-items: flex-start;
  }
  .row > .item-icon,
  .row > .product-image {
    margin-top: 4px;
  }
  .quantity-control {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .quantity-unit {
    margin-left: 8px;
  }
  .add-quantity {
    gap: 4px;
  }
  .add-quantity input {
    width: 48px;
  }
  .add-form > button[type="submit"] {
    padding: 12px 10px;
  }
}

.shop-quantity {
  flex: 0 0 32px;
  align-self: center;
  text-align: center;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 500;
  color: #53576e;
  font-variant-numeric: tabular-nums;
}

.row:has(.shop-quantity) .item-text {
  flex: 0 1 260px;
}
.row:has(.shop-quantity) > .text-button {
  margin-left: auto;
}
@media (max-width: 700px) {
  .shop-quantity {
    flex-basis: 24px;
    font-size: 14px;
  }
}


.account { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.account-button { min-height: 38px; padding: 8px 14px; font-size: 13px; }
.account-email { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
#auth-dialog form { display: grid; gap: 4px; }
#auth-dialog .actions { justify-content: flex-end; }
#auth-dialog .auth-toggle { justify-self: start; padding-left: 0; }
.auth-message { min-height: 22px; color: #6254df; font-size: 13px; }
.auth-message.error { color: #b63448; }
@media (max-width: 700px) {
  .account { position: absolute; right: 18px; top: 18px; }
  .account-email { display: none; }
}


html.auth-locked aside,
html.auth-locked .workspace {
  visibility: hidden;
}
html.auth-locked body {
  background: #f7f8fc;
}
#auth-dialog {
  z-index: 10;
}
