@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap");

:root {
  --bg: #f3f8f6;
  --surface: #ffffff;
  --surface-soft: #fafbfd;
  --line: #e2e8ee;
  --text: #1c2734;
  --muted: #6f7e90;
  --brand: #19b48f;
  --brand-2: #109976;
  --teal-soft: #e8f8f2;
  --sidebar-bg: #cfd9e2;
  --shadow: 0 10px 28px rgba(20, 33, 50, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(40rem 35rem at 100% -10%, #dff5ee 0%, transparent 60%),
    radial-gradient(40rem 35rem at 0% -10%, #e8f1f7 0%, transparent 60%),
    var(--bg);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 0.35rem;
}

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

.app-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.sidebar {
  border-right: none;
  background:
    radial-gradient(30rem 18rem at 100% 0%, rgba(102, 240, 207, 0.2), transparent 58%),
    radial-gradient(24rem 18rem at 0% 100%, rgba(106, 200, 255, 0.16), transparent 62%),
    linear-gradient(180deg, #2ea3be 0%, #2ab8aa 52%, #33bea6 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  padding: 1rem 0.75rem;
  overflow: hidden;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand-block {
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  padding: 0.5rem 0.55rem;
  display: grid;
  justify-items: center;
  gap: 0.35rem;
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  box-shadow: 0 10px 20px rgba(16, 128, 104, 0.24);
}

.brand-name {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.95);
}

.sidebar-nav {
  display: grid;
  gap: 0.55rem;
  width: 100%;
}

.side-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(239, 251, 255, 0.9);
  border-radius: 13px;
  padding: 0.55rem 0.6rem;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.side-item:hover {
  background: rgba(255, 255, 255, 0.16);
}

.side-item.active {
  background: rgba(233, 255, 249, 0.92);
  border-color: rgba(211, 249, 237, 0.95);
  color: #0c6c54;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(16, 105, 80, 0.08);
  border-radius: 13px;
  margin-right: 0;
  padding-right: 0.6rem;
}

.side-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  font-size: 0.9rem;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(235, 250, 255, 0.95);
  flex: 0 0 auto;
}

.side-icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.side-item.active .side-icon {
  border-color: transparent;
  background: transparent;
  color: #118a6b;
}

.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 0.45rem;
}

.side-toggle {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.side-toggle .toggle-arrow {
  transition: transform 180ms ease;
  transform-origin: 14px 12px;
}

.main-shell {
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  align-content: start;
  min-height: calc(100vh - 2rem);
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 0.82rem 1.05rem;
  min-height: 90px;
  border-radius: 16px;
  position: relative;
  background:
    radial-gradient(38rem 16rem at -8% 58%, rgba(87, 212, 173, 0.28), transparent 58%),
    linear-gradient(92deg, #f1fbf7 0%, #ffffff 46%, #ffffff 100%);
}

@media (min-width: 761px) {
  .topbar {
    min-height: 130px;
    max-height: 150px;
  }
}

.topbar h1 {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.title-logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.title-logo img {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.78rem;
  max-width: min(48vw, 560px);
}

.topbar-brand-icon {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  filter: drop-shadow(0 14px 18px rgba(22, 148, 116, 0.2));
}

.topbar-brand-text {
  font-size: clamp(1.7rem, 3.8vw, 3rem);
  letter-spacing: 0.01em;
  line-height: 1;
  text-shadow: 0 10px 22px rgba(16, 135, 102, 0.15);
  display: inline-flex;
  align-items: baseline;
  gap: 0.28em;
}

.brand-meal {
  color: #0b7f57;
  font-weight: 900;
}

.brand-planner {
  color: #32b47f;
  font-weight: 600;
}

.user-pill {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  background: #f8fafc;
  color: #3e4b5b;
}

.user-link {
  text-decoration: none;
}

body.sidebar-collapsed .app-layout {
  grid-template-columns: 68px 1fr;
}

body.sidebar-collapsed .brand-name,
body.sidebar-collapsed .side-label {
  display: none;
}

body.sidebar-collapsed .sidebar {
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

body.sidebar-collapsed .brand-block {
  padding: 0.35rem;
}

body.sidebar-collapsed .brand-logo {
  width: 36px;
  height: 36px;
}

body.sidebar-collapsed .side-item {
  justify-content: center;
  padding-left: 0.3rem;
  padding-right: 0.3rem;
}

body.sidebar-collapsed .side-icon {
  margin: 0;
}

body.sidebar-collapsed .side-toggle .side-icon svg {
  transform: none;
}

body.sidebar-collapsed .side-toggle .toggle-arrow {
  transform: rotate(180deg);
}

.side-card,
.metric,
.progress-card,
#tab-planner .planner-layout > .card:nth-child(2),
.planned-meals-panel {
  background:
    radial-gradient(24rem 10rem at 100% -15%, rgba(123, 233, 208, 0.2), transparent 58%),
    radial-gradient(20rem 10rem at 0% 100%, rgba(125, 196, 241, 0.16), transparent 62%),
    linear-gradient(132deg, #edf8f6 0%, #f9fcfb 52%, #f1f8fb 100%);
}

.metric,
.progress-card,
.side-card,
#tab-planner .planner-layout > .card:nth-child(2),
.planned-meals-panel {
  border-color: #c7dce7;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  gap: 0.9rem;
  min-height: calc(100vh - 220px);
}

.dashboard-grid-main {
  display: grid;
  grid-template-columns: 1.45fr 0.8fr;
  gap: 0.9rem;
}

.hero {
  padding: 1.1rem;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 1rem;
  align-items: center;
  background: linear-gradient(135deg, #129f84, #0d8874);
  color: #fff;
}

.hero .muted,
.hero .eyebrow {
  color: rgba(255, 255, 255, 0.86);
}

.hero h2 {
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.hero-image {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.hero-actions {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid #ccd9e3;
  border-radius: 10px;
  background: #fff;
  color: #2a3d50;
  font-weight: 700;
  padding: 0.56rem 0.88rem;
  cursor: pointer;
}

.btn-primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.44);
  color: #fff;
}

.side-card {
  padding: 0.9rem;
  background: var(--surface-soft);
}

.side-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.side-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.mini-link {
  background: none;
  border: none;
  color: #4a7cbe;
  font-weight: 700;
  cursor: pointer;
}

.mini-list,
.list-plain,
.shopping-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.side-shopping-more {
  margin-top: 0.45rem;
  font-size: 0.82rem;
}

.side-shopping-more a {
  color: #3f78bd;
  text-decoration: none;
  font-weight: 700;
}

.side-shopping-more a:hover {
  text-decoration: underline;
}

.mini-list li,
.list-plain li,
.shopping-list li {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: #fff;
}

.shopping-tools {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr 0.8fr auto;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.shopping-tools input[type="text"],
.shopping-tools input[type="number"] {
  border: 1px solid #d8e3ec;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f6fafc);
  padding: 0.58rem 0.7rem;
  font-size: 0.88rem;
  color: #2a3d50;
}

.shopping-item {
  transition: opacity 150ms ease;
}

.shop-checkline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.shop-checkline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #16a085;
  margin: 0;
  flex: 0 0 auto;
}

.shop-text {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shopping-item.checked {
  opacity: 0.72;
}

.shopping-item.checked .shop-text,
.shopping-item.checked .shop-qty {
  text-decoration: line-through;
}

.mini-list li.checked {
  opacity: 0.68;
}

.mini-list li.checked span,
.mini-list li.checked strong {
  text-decoration: line-through;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.metric {
  padding: 0.85rem;
}

.metric-label {
  color: var(--muted);
  font-size: 0.78rem;
}

.metric-value {
  margin-top: 0.2rem;
  font-size: 1.6rem;
  font-weight: 800;
}

.progress-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem;
}

.progress-wrap {
  width: min(340px, 45%);
}

.progress-value {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: #e8edf2;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #19a78a, #10907a);
}

.menu-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.menu-preview-card {
  padding: 1.1rem;
}

.menu-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.menu-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(18, 37, 53, 0.1);
}

.menu-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: 100%;
}

.menu-card-link:hover {
  transform: none;
  box-shadow: none;
}

.menu-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.menu-card-body {
  padding: 0.58rem;
  flex: 1 1 auto;
}

.menu-card h4 {
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

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

.menu-card p {
  font-size: 0.76rem;
  color: var(--muted);
}

.menu-card-selectable.selected {
  border-color: #8fd7c2;
  box-shadow: 0 10px 22px rgba(20, 123, 101, 0.16);
}

.meal-select-check {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.meal-select-check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.meal-select-check span {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1px solid #c8d6e2;
  background: rgba(255, 255, 255, 0.9);
  display: inline-block;
  position: relative;
}

.meal-select-check input:checked + span {
  border-color: #14987f;
  background: linear-gradient(130deg, #18a288, #128f79);
}

.meal-select-check input:checked + span::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 4px;
  height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(40deg);
}

.planner-layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 0.9rem;
}

#tab-my-meals .planner-layout {
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: 1rem;
}

.controls,
#tab-planner .card,
#tab-shopping .card,
#tab-history .card,
#tab-profile .card {
  padding: 0.95rem;
}

.planner-settings-hero {
  background:
    radial-gradient(34rem 12rem at 95% -20%, rgba(255, 255, 255, 0.18), transparent 60%),
    linear-gradient(135deg, #159e84, #0d8874);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 30px rgba(10, 108, 92, 0.2);
}

.planner-settings-hero h3,
.planner-settings-hero label,
.planner-settings-hero .muted {
  color: rgba(255, 255, 255, 0.95);
}

.planner-settings-hero input[type="date"],
.planner-settings-hero input[type="number"],
.planner-settings-hero input[type="text"],
.planner-settings-hero input[type="url"],
.planner-settings-hero select,
.planner-settings-hero textarea {
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.planner-settings-hero input::placeholder,
.planner-settings-hero textarea::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.planner-settings-hero input:focus,
.planner-settings-hero select:focus,
.planner-settings-hero textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.planner-settings-hero .checkline input[type="checkbox"] {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
}

.planner-settings-hero .checkline input[type="checkbox"]:checked {
  border-color: #bff6e8;
  background: rgba(200, 251, 235, 0.28);
}

#tab-my-meals .card {
  padding: 1.2rem;
}

.form-grid {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.form-grid.single {
  grid-template-columns: 1fr;
}

label {
  display: grid;
  gap: 0.28rem;
  font-size: 0.86rem;
  color: #43586f;
}

input[type="date"],
input[type="number"],
input[type="text"],
input[type="url"],
select,
textarea,
input[type="email"],
input[type="password"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.52rem 0.62rem;
  font-family: "Manrope", sans-serif;
}

.custom-meal-form input[type="text"],
.custom-meal-form input[type="url"],
.custom-meal-form input[type="number"],
.custom-meal-form select,
.custom-meal-form textarea {
  border: 1px solid #d5dee8;
  background: linear-gradient(180deg, #ffffff, #f7fafd);
  border-radius: 12px;
  padding: 0.64rem 0.72rem;
  font-size: 0.92rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.upload-row .btn {
  min-width: 136px;
}

#cm-upload-btn {
  border: 1px solid rgba(255, 255, 255, 0.92);
}

.upload-row .muted {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.86rem;
}

.custom-meal-form {
  background:
    radial-gradient(28rem 10rem at 100% -18%, rgba(255, 255, 255, 0.2), transparent 58%),
    linear-gradient(135deg, #159e84, #0d8874);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.custom-meal-form h3,
.custom-meal-form label {
  color: rgba(255, 255, 255, 0.96);
}

.custom-meal-form input[type="text"]::placeholder,
.custom-meal-form input[type="url"]::placeholder,
.custom-meal-form textarea::placeholder {
  color: #93a1b2;
}

.custom-meal-form input:focus,
.custom-meal-form select:focus,
.custom-meal-form textarea:focus {
  outline: none;
  border-color: #9bbbe6;
  box-shadow: 0 0 0 3px rgba(84, 129, 219, 0.12);
}

.my-meals-panel h3 {
  margin-bottom: 0.35rem;
}

.my-meals-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
}

.my-meals-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bulk-panel {
  margin-top: 0.7rem;
  margin-bottom: 0.4rem;
  border: 1px solid #c7dce7;
  border-radius: 12px;
  padding: 0.75rem;
  background: linear-gradient(140deg, #f4fbf8, #f8fcff);
}

.bulk-panel textarea {
  width: 100%;
  margin-top: 0.45rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
}

.my-meals-panel #custom-meals-list {
  margin-top: 1rem;
}

.toggle-list {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.52rem;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 0.56rem;
}

.checkline input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid #c8d6e2;
  border-radius: 5px;
  background: #fff;
  position: relative;
}

.checkline input[type="checkbox"]:checked {
  border-color: #14987f;
  background: linear-gradient(130deg, #18a288, #128f79);
}

.checkline input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(40deg);
}

.button-row {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.58rem;
}

.calendar {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
}

.weekday-header {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: none;
  text-align: center;
}

.day-spacer {
  min-height: 8px;
}

.day {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.46rem;
  min-height: 126px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
}

.day.cook {
  background: linear-gradient(145deg, #d4efe6, #c3e7dc);
  border-color: #9fd6c8;
}

.day.skip {
  background: #fff;
  border-color: #d9e1ea;
}

.day-top {
  display: flex;
  justify-content: space-between;
}

.day-top strong {
  font-size: 0.8rem;
}

.day-top em {
  font-size: 0.72rem;
  color: var(--muted);
  font-style: normal;
}

.day-state,
.day-meal {
  font-size: 0.74rem;
}

.day-actions {
  margin-top: auto;
}

.retry-btn {
  border: 1px solid transparent;
  color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  border-radius: 10px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.28rem 0.58rem;
}

.retry-btn:disabled {
  opacity: 0.75;
  background: #d8e3ea;
  color: #8a98a9;
  border-color: #c6d2dc;
}

.list-plain li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.6rem;
  align-items: center;
}

.planned-meals-panel {
  background:
    radial-gradient(28rem 10rem at 100% -20%, rgba(255, 255, 255, 0.2), transparent 62%),
    linear-gradient(136deg, #eef8f4 0%, #ffffff 58%, #f6fbfa 100%);
}

.planned-meals-panel h3 {
  margin-bottom: 0.55rem;
}

.planned-meals-panel .list-plain li {
  background: rgba(255, 255, 255, 0.9);
  border-color: #c8d8e5;
  display: block;
  padding: 0;
}

.list-plain li img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.plan-link {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 0.72rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  transition: background-color 120ms ease;
}

.plan-link:hover {
  background: rgba(255, 255, 255, 0.56);
}

.plan-link.is-static {
  cursor: default;
}

.plan-content {
  min-width: 0;
}

.plan-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.08rem;
}

.plan-date {
  font-weight: 800;
}

.plan-name {
  font-weight: 700;
}

.plan-arrow {
  color: #6f7e90;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #0f7f62;
  border: 1px solid #9edec9;
  background: #ecfaf4;
  border-radius: 999px;
  padding: 0.12rem 0.4rem;
  white-space: nowrap;
}

.plan-ai-badge {
  margin-left: 0.2rem;
}

.list-plain li small {
  display: block;
  color: var(--muted);
  margin-top: 0.12rem;
  font-size: 0.75rem;
}

.shopping-list li,
.mini-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

#tab-shopping .card {
  width: 100%;
  margin-inline: 0;
  background:
    radial-gradient(36rem 12rem at 100% -25%, rgba(27, 189, 154, 0.1), transparent 60%),
    #f9fcfb;
}

#tab-shopping .side-card-head {
  margin-bottom: 0.45rem;
}

.shopping-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.shopping-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.38rem;
  border: 1px solid #cde7df;
  border-radius: 999px;
  background: #ffffff;
  padding: 0.24rem 0.62rem;
}

.shopping-stat small {
  color: #5b7287;
  font-size: 0.73rem;
  font-weight: 700;
}

.shopping-stat strong {
  color: #107d62;
  font-size: 0.9rem;
}

.shopping-toolbar {
  position: sticky;
  top: 0.25rem;
  z-index: 3;
  background: #f9fcfb;
  padding-bottom: 0.35rem;
}

.shopping-lists-grid {
  display: grid;
  gap: 0.75rem;
}

.shopping-complete-wrap {
  margin-top: 0.7rem;
  display: flex;
  justify-content: flex-end;
}

#shopping-complete-btn:disabled {
  background: #d8e2ea;
  color: #7b8c9b;
  border-color: #c7d2dc;
  cursor: not-allowed;
}

.shopping-list-section {
  display: grid;
  gap: 0.45rem;
  border: 1px solid #c7dce7;
  border-radius: 14px;
  padding: 0.6rem;
  background:
    radial-gradient(24rem 10rem at 100% -15%, rgba(123, 233, 208, 0.2), transparent 58%),
    radial-gradient(20rem 10rem at 0% 100%, rgba(125, 196, 241, 0.16), transparent 62%),
    linear-gradient(132deg, #edf8f6 0%, #f9fcfb 52%, #f1f8fb 100%);
}

.shopping-list-section:nth-child(2) {
  background:
    radial-gradient(24rem 10rem at 100% -15%, rgba(120, 210, 192, 0.16), transparent 58%),
    radial-gradient(20rem 10rem at 0% 100%, rgba(157, 183, 213, 0.15), transparent 62%),
    linear-gradient(132deg, #eef7f5 0%, #f8fbfa 52%, #f2f7f8 100%);
}

.shopping-section-title {
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5c7388;
  font-weight: 800;
  margin: 0;
}

#tab-shopping .shopping-list li {
  display: grid;
  border: 1px solid #cde6df;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 107, 91, 0.08);
  transition: transform 140ms ease, box-shadow 140ms ease;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

#tab-shopping .shopping-list li:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(16, 107, 91, 0.12);
}

#tab-shopping .shopping-item-open {
  border-left: 4px solid #1ca886;
}

#tab-shopping .shopping-item-done {
  border-left: 4px solid #9fcfc3;
  background: linear-gradient(180deg, #f5fbf9, #eef7f4);
}

#tab-shopping .shop-text {
  color: #183145;
  font-weight: 800;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: #78a79a;
  cursor: grab;
  user-select: none;
}

.drag-handle svg {
  width: 10px;
  height: 14px;
  fill: currentColor;
}

#tab-shopping .shopping-item.dragging {
  opacity: 0.45;
}

#tab-shopping .shopping-item.drop-target {
  outline: 2px dashed #39a88b;
  outline-offset: 2px;
}

#tab-shopping .shop-checkline input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #65b8a4;
  border-radius: 6px;
  background: #ffffff;
  position: relative;
}

#tab-shopping .shop-checkline input[type="checkbox"]:checked {
  background: #19a383;
  border-color: #19a383;
}

#tab-shopping .shop-checkline input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(40deg);
}

.shop-qty-badge {
  border: 1px solid #bfe1d7;
  border-radius: 999px;
  background: #f2fbf8;
  color: #0f7e62;
  font-weight: 800;
  padding: 0.18rem 0.55rem;
  white-space: nowrap;
}

.shop-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.shop-delete-btn {
  border: none;
  background: transparent;
  color: #7d97a7;
  width: 22px;
  height: 22px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.shop-delete-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.shop-delete-btn:hover {
  color: #be4e55;
}

.shop-delete-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

#tab-shopping .shopping-item.checked {
  opacity: 0.72;
}

#tab-shopping .shopping-item.checked .shop-text,
#tab-shopping .shopping-item.checked .shop-qty {
  text-decoration: line-through;
}

.profile-grid {
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.history-card {
  background:
    radial-gradient(32rem 12rem at 100% -25%, rgba(27, 189, 154, 0.1), transparent 60%),
    #f9fcfb;
}

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

.history-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.history-actions strong {
  font-size: 0.94rem;
  color: #1a3a50;
  min-width: 120px;
  text-align: center;
}

.history-nav-btn {
  padding: 0.44rem 0.72rem;
}

.history-icon-btn {
  min-width: 40px;
  padding: 0.4rem 0.5rem;
  font-size: 0.95rem;
  line-height: 1;
}

.history-icon-btn span {
  display: inline-block;
  transform: translateY(1px);
}

.history-nav-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

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

.history-weekday {
  font-size: 0.76rem;
  font-weight: 800;
  color: #667c91;
  text-align: center;
}

.history-day-spacer {
  min-height: 8px;
}

.history-day {
  border: 1px solid #d7e2ea;
  border-radius: 12px;
  background: #fff;
  min-height: 112px;
  padding: 0.55rem;
  display: grid;
  align-content: start;
  gap: 0.42rem;
}

.history-day.has-meal {
  border-color: #aed8cb;
  background: linear-gradient(146deg, #e8f8f2, #f6fcfa);
}

.history-day.has-shopping {
  border-color: #9fc9ea;
  background:
    radial-gradient(22rem 8rem at 100% -20%, rgba(119, 189, 237, 0.15), transparent 60%),
    linear-gradient(146deg, #eef7fe, #f9fcff);
}

.history-day.is-today {
  box-shadow: 0 0 0 2px rgba(27, 170, 136, 0.26) inset;
}

.history-day.is-future {
  opacity: 0.72;
}

.history-day-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.3rem;
}

.history-day-top strong {
  font-size: 0.78rem;
}

.history-day-top em {
  font-style: normal;
  font-size: 0.72rem;
  color: #73889b;
}

.history-day-meal {
  display: block;
  color: #1a3348;
  text-decoration: none;
  font-size: 0.79rem;
  font-weight: 700;
  line-height: 1.35;
}

.history-day-shopping {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid #b9d7ee;
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #1f5d8a;
  background: #f4faff;
  text-decoration: none;
}

.history-day-shopping:hover {
  background: #e8f4ff;
  border-color: #9fc8e8;
}

.shopping-history-detail-card {
  background:
    radial-gradient(26rem 12rem at 100% -20%, rgba(96, 205, 177, 0.18), transparent 60%),
    radial-gradient(20rem 10rem at 0% 100%, rgba(112, 178, 228, 0.16), transparent 62%),
    linear-gradient(132deg, #eaf6f2 0%, #f6fbf9 52%, #edf5fa 100%);
  border-color: #bfd6e4;
  min-height: calc(100vh - 220px);
  align-content: start;
}

.shopping-history-hero-text p {
  color: #5d7388;
}

.history-back-btn {
  color: #2f5977;
  border-color: #b8d0e1;
  background: rgba(255, 255, 255, 0.86);
  margin-left: auto;
  flex: 0 0 auto;
}

.history-back-btn:hover {
  background: #ffffff;
  border-color: #95bdd8;
}

.shopping-history-detail-card .detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.detail-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.shopping-history-detail-card .shopping-history-hero-text {
  flex: 1 1 auto;
  min-width: 0;
}

.shopping-history-grid {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.shopping-history-list {
  border: 1px solid #bdd7e7;
  border-radius: 14px;
  background:
    radial-gradient(24rem 8rem at 100% -30%, rgba(121, 228, 200, 0.1), transparent 62%),
    #ffffff;
  box-shadow: 0 8px 20px rgba(23, 72, 105, 0.08);
  padding: 0.75rem;
}

.shopping-history-hero-text h3 {
  font-size: clamp(2rem, 3.3vw, 3.1rem);
  line-height: 1.08;
}

.shopping-history-list h4 {
  margin-bottom: 0.45rem;
}

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

.shopping-history-list-head h4 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  flex-wrap: wrap;
}

.shopping-history-list-title {
  color: #1e3346;
}

.shopping-history-time-badge {
  border: 1px solid #b6ddd0;
  border-radius: 999px;
  background: #eefaf6;
  color: #0e7a5e;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.08rem 0.45rem;
}

.shop-history-delete-btn {
  border: none;
  background: transparent;
  color: #7d97a7;
  width: 22px;
  height: 22px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
}

.shop-history-delete-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.shop-history-delete-btn:hover {
  color: #be4e55;
}

.shop-history-delete-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.shopping-history-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.36rem;
}

.shopping-history-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  border: 1px solid #cfe1ea;
  border-radius: 10px;
  background: #f7fbfa;
  padding: 0.42rem 0.56rem;
}

.shopping-history-list li span {
  font-weight: 800;
  color: #1e3347;
}

.shopping-history-list li strong {
  color: #0c7f61;
  border: 1px solid #bde1d6;
  background: #eefaf6;
  border-radius: 999px;
  padding: 0.06rem 0.42rem;
  white-space: nowrap;
}

a.history-day-meal:hover {
  text-decoration: underline;
}

.key {
  color: var(--muted);
  font-size: 0.78rem;
}

.val {
  margin-top: 0.1rem;
  font-weight: 700;
}

.profile-editor {
  margin-top: 0.8rem;
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}

.profile-preferences-grid {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.profile-settings-grid {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.profile-span-all {
  grid-column: 1 / -1;
}

.chip-field {
  border: 1px solid #c8d8e5;
  border-radius: 12px;
  background: linear-gradient(138deg, #f1faf7 0%, #ffffff 65%, #f5fafc 100%);
  padding: 0.7rem;
}

.chip-field h4 {
  margin-bottom: 0.2rem;
}

.profile-admin-groups {
  margin-top: 0.7rem;
}

.profile-admin-groups .toggle-list {
  margin-top: 0.45rem;
}

.chips-input {
  border: 1px solid #d4e0ea;
  border-radius: 10px;
  background: #fff;
  padding: 0.36rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.36rem;
  flex-wrap: wrap;
}

.chips-input:focus-within {
  border-color: #70c6b0;
  box-shadow: 0 0 0 3px rgba(33, 176, 141, 0.12);
}

.chips-input input {
  border: none;
  outline: none;
  min-width: 72px;
  flex: 1 1 120px;
  padding: 0.22rem 0.2rem;
  font-size: 0.88rem;
}

#profile-accounts-list {
  margin-top: 0.45rem;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

#profile-accounts-list li.profile-group-row {
  border: 1px solid #c7d8e6;
  border-radius: 12px;
  background: linear-gradient(152deg, #eef8f5 0%, #ffffff 62%, #f2f8fc 100%);
  padding: 0.65rem;
  display: block;
}

.profile-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.profile-group-name {
  color: #173147;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-group-count {
  color: #4e657a;
  font-size: 0.8rem;
  font-weight: 700;
}

.profile-group-head-right {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.profile-group-delete-btn {
  border: none;
  background: transparent;
  color: #7d97a7;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
}

.profile-group-delete-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.profile-group-delete-btn:hover {
  color: #be4e55;
}

.profile-group-members {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.profile-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid #d4e0ea;
  border-radius: 10px;
  background: #fff;
  padding: 0.52rem 0.56rem;
  box-shadow: 0 7px 18px rgba(20, 48, 76, 0.08);
}

.profile-account-main {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.profile-account-link {
  text-decoration: none;
  color: inherit;
}

.profile-account-link:hover .profile-account-name {
  text-decoration: underline;
}

.profile-account-row-link {
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.profile-account-row-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(20, 48, 76, 0.12);
}

.profile-account-name {
  color: #1b3247;
  font-size: 0.94rem;
  line-height: 1.2;
  font-weight: 800;
}

.profile-account-email {
  color: #5f7386;
  font-size: 0.8rem;
  line-height: 1.2;
  word-break: break-word;
}

.profile-account-role {
  border: 1px solid #bedfce;
  border-radius: 999px;
  background: #eefaf6;
  color: #0d7b5e;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.1rem 0.46rem;
  white-space: nowrap;
  flex: 0 0 auto;
}

.profile-account-role-super {
  border-color: #d7c8ff;
  background: #f4eeff;
  color: #6c3fd1;
}

.profile-account-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  min-width: 0;
}

.profile-account-tools select {
  width: 170px;
  font-size: 0.82rem;
  padding: 0.36rem 0.5rem;
}

.profile-account-tools .btn {
  padding: 0.34rem 0.52rem;
  font-size: 0.8rem;
}

.profile-account-fixed {
  color: #4c667d;
  font-size: 0.79rem;
  font-weight: 700;
}

.profile-group-toolbar {
  margin-top: 0.55rem;
  display: grid;
  gap: 0.6rem;
}

.profile-group-actions {
  display: grid;
  gap: 0.25rem;
}

.profile-inline-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
}

.profile-inline-actions-triple {
  grid-template-columns: minmax(180px, 0.9fr) minmax(170px, 1fr) auto;
}

#profile-create-group-btn,
#profile-rename-group-btn {
  width: 128px;
}

.chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid #a7d8c9;
  border-radius: 999px;
  background: #ebf9f3;
  color: #0d7156;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
}

.chip-tag button {
  border: none;
  background: transparent;
  color: #0f7d5e;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.login-shell {
  width: 100%;
  max-width: 520px;
}

.login-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

.login-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.login-title img {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.detail-page {
  background:
    radial-gradient(40rem 35rem at 100% -10%, #dff5ee 0%, transparent 60%),
    radial-gradient(40rem 35rem at 0% -10%, #e8f1f7 0%, transparent 60%),
    var(--bg);
}

.detail-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}

.detail-top {
  padding: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-edit-form {
  display: grid;
  gap: 0.9rem;
}

.detail-hero {
  padding: 1rem;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0.9rem;
}

.detail-media-column {
  display: grid;
  align-content: start;
  gap: 0.55rem;
}

.detail-hero img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.detail-photo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.detail-photo-actions .btn {
  width: 100%;
  justify-content: center;
  padding: 0.58rem 0.45rem;
  font-size: 0.92rem;
}

.detail-rating-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.52rem 0.65rem 0.62rem;
  background: rgba(255, 255, 255, 0.85);
}

.detail-rating-label {
  font-weight: 700;
  color: #1b4d43;
  margin-bottom: 0.22rem;
}

.detail-rating-stars {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-bottom: 0.22rem;
}

.detail-star-btn {
  border: none;
  background: transparent;
  color: #8fb4ab;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.08rem;
}

.detail-star-btn.active {
  color: #13a180;
  text-shadow: 0 0 8px rgba(23, 171, 136, 0.18);
}

.detail-star-btn:disabled {
  cursor: default;
  opacity: 0.82;
}

.detail-hero h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  margin-bottom: 0.4rem;
}

.detail-form-grid {
  display: grid;
  gap: 0.55rem;
}

.detail-form-grid label {
  display: grid;
  gap: 0.24rem;
}

.detail-inline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.detail-form-grid input,
.detail-form-grid textarea,
.detail-form-grid select,
.detail-card textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.52rem 0.62rem;
  font-family: "Manrope", sans-serif;
}

.detail-form-grid input:disabled,
.detail-form-grid textarea:disabled,
.detail-form-grid select:disabled,
.detail-card textarea:disabled {
  background: #f8fbfd;
  color: #273444;
  opacity: 1;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.detail-card {
  padding: 0.95rem;
}

.detail-card h3 {
  margin-bottom: 0.65rem;
  font-size: 2rem;
  letter-spacing: -0.01em;
}

.detail-textarea-rich {
  width: 100%;
  min-height: 340px;
  resize: vertical;
  border: 1px solid #c6d5e2;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 1rem 1.05rem;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 1.08rem;
  line-height: 1.62;
  letter-spacing: 0.002em;
  color: #263648;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.detail-textarea-rich:focus {
  outline: none;
  border-color: #73c7b3;
  box-shadow: 0 0 0 4px rgba(37, 178, 142, 0.12);
}

.detail-ingredients {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.detail-ingredients li {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.48rem 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.detail-meta {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.32rem;
}

.detail-steps {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.45rem;
}

.login-form {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.6rem;
}

.warning {
  color: var(--warn);
  font-weight: 700;
  margin-top: 0.5rem;
}

.dev-box {
  margin-top: 0.8rem;
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}

@media (max-width: 1100px) {
  .dashboard-grid-main {
    grid-template-columns: 1fr;
  }

  .planner-layout {
    grid-template-columns: 1fr;
  }

  #tab-my-meals .planner-layout {
    grid-template-columns: 1fr;
  }

  .metric-row,
  .menu-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-preferences-grid,
  .profile-settings-grid {
    grid-template-columns: 1fr;
  }

  .profile-group-members {
    grid-template-columns: 1fr;
  }

  .profile-inline-actions,
  .profile-inline-actions-triple {
    grid-template-columns: 1fr;
  }

  .detail-hero,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-inline {
    grid-template-columns: 1fr;
  }

  .detail-photo-actions {
    grid-template-columns: 1fr;
  }

  .shopping-tools {
    grid-template-columns: 1fr 1fr;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-image {
    height: 150px;
  }
}

@media (max-width: 760px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .main-shell {
    padding: 0.65rem;
    padding-bottom: 6.4rem;
    min-height: auto;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: auto;
    z-index: 40;
    border-right: none;
    border-top: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0.45rem 0.4rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
    background:
      radial-gradient(22rem 11rem at 50% -10%, rgba(115, 243, 214, 0.2), transparent 62%),
      linear-gradient(180deg, #26aebe 0%, #25b9a7 70%, #2abf9f 100%);
    box-shadow: 0 -10px 25px rgba(11, 78, 95, 0.24);
    overflow: visible;
    gap: 0;
  }

  body.sidebar-collapsed .app-layout {
    grid-template-columns: 1fr;
  }

  .brand-block {
    display: none;
  }

  .sidebar-nav {
    width: 100%;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.22rem;
    align-items: end;
  }

  .side-item {
    font-size: 0.58rem;
    padding: 0.32rem 0.18rem;
    justify-content: center;
    gap: 0.22rem;
    flex-direction: column;
    min-height: 54px;
    border-radius: 10px;
    min-width: 0;
    overflow: hidden;
  }

  .side-item .side-icon {
    width: 22px;
    height: 22px;
  }

  .side-item .side-icon svg {
    width: 16px;
    height: 16px;
  }

  .side-item.active {
    border-radius: 10px;
    margin-right: 0;
  }

  .side-label {
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.59rem;
    line-height: 1.05;
  }

  .sidebar-foot {
    display: none;
  }

  .topbar {
    flex-direction: row;
    align-items: stretch;
    gap: 0.5rem;
    min-height: auto;
    padding: 0.65rem 0.75rem;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
  }

  .topbar-brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }

  .topbar-brand-text {
    font-size: clamp(1.06rem, 6vw, 1.5rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .user-pill {
    position: static;
    align-self: flex-end;
    padding: 0.4rem 0.65rem;
    font-size: 0.82rem;
    max-width: 34vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .metric-row,
  .menu-gallery,
  .profile-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .calendar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .history-head {
    flex-direction: column;
    align-items: stretch;
  }

  .tab-panel.active,
  .shopping-history-detail-card {
    min-height: auto;
  }

  .shopping-history-detail-card .detail-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .history-back-btn {
    margin-left: 0;
    justify-self: start;
  }

  .history-actions {
    justify-content: flex-start;
  }

  .history-actions strong {
    min-width: 0;
    text-align: left;
  }

  .history-calendar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-weekday,
  .history-day-spacer {
    display: none;
  }

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

  .weekday-header,
  .day-spacer {
    display: none;
  }

  .shopping-tools {
    grid-template-columns: 1fr;
    margin-bottom: 0.6rem;
    gap: 0.45rem;
  }

  .shopping-stats {
    gap: 0.35rem;
    margin-bottom: 0.55rem;
    width: 100%;
  }

  .shopping-stat {
    padding: 0.2rem 0.5rem;
    min-width: 0;
  }

  .side-card-head {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .side-card-head h3 {
    min-width: 0;
  }

  .side-card-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.45rem 0.9rem;
  }

  #tab-shopping .card {
    width: 100%;
    margin-inline: 0;
    overflow: hidden;
  }

  .shopping-tools input[type="text"],
  .shopping-tools input[type="number"] {
    min-height: 44px;
    font-size: 0.98rem;
  }

  #add-extra-item-btn {
    width: 100%;
    min-height: 44px;
    font-size: 0.98rem;
  }

  .shopping-list li {
    padding: 0.7rem 0.75rem;
    border-radius: 12px;
    min-width: 0;
  }

  .shop-checkline {
    gap: 0.62rem;
    align-items: flex-start;
  }

  .shop-checkline input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-top: 0.05rem;
  }

  .shop-text {
    font-size: 1.02rem;
    line-height: 1.35;
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
  }

  .shop-qty {
    font-size: 0.92rem;
    font-weight: 800;
    margin-left: auto;
    white-space: nowrap;
  }

  #tab-shopping .shop-item-actions {
    min-width: 0;
    gap: 0.25rem;
  }

  #tab-shopping .shop-qty-badge {
    max-width: 30vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #tab-shopping .shop-delete-btn {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
  }

  #tab-shopping .shop-delete-btn svg {
    width: 13px;
    height: 13px;
  }

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .main-shell {
    width: 100%;
    max-width: 100%;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }

  .card {
    width: 100%;
    max-width: 100%;
  }
}
