:root {
  --skin-white: #fff9f9;
  --skin-pink: #ffd1d1;
  --skin-rose: #ff8585;
  --skin-deep: #4a2b52;
  --purple: #7c66ee;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --orange-50: #fff7ed;
  --orange-400: #fb923c;
  --orange-500: #f97316;
  --indigo-50: #eef2ff;
  --indigo-400: #818cf8;
  --indigo-500: #6366f1;
  --yellow-500: #eab308;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--skin-white);
  color: #1a1a1a;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

img {
  display: block;
  max-width: 100%;
}

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

h1,
h2,
h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
}

.phone-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 448px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--skin-white);
  padding-bottom: 96px;
  box-shadow: 0 18px 45px rgb(0 0 0 / 0.12);
}

.app-header {
  padding: 48px 24px 16px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.app-title {
  color: var(--gray-800);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.05;
}

.app-subtitle {
  margin-top: 4px;
  color: var(--gray-400);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.header-actions {
  display: flex;
  gap: 24px;
  padding-top: 2px;
}

.quick-button,
.nav-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--gray-500);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  transition: color 160ms ease, transform 160ms ease;
}

.quick-button svg,
.nav-button svg {
  color: var(--gray-700);
  transition: color 160ms ease, transform 160ms ease;
}

.quick-button:hover,
.quick-button:hover svg {
  color: var(--skin-rose);
}

.nav-button.active,
.nav-button.active svg {
  color: var(--purple);
}

.nav-button.active svg {
  transform: scale(1.1);
  stroke-width: 2.5;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px;
  scrollbar-width: none;
}

.content::-webkit-scrollbar,
.scroll-row::-webkit-scrollbar,
.modal-panel::-webkit-scrollbar {
  display: none;
}

.view {
  display: grid;
  gap: 32px;
  padding-bottom: 80px;
  animation: fade-up 220ms ease both;
}

.view.compact {
  gap: 20px;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  display: grid;
  gap: 16px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  color: var(--gray-800);
  font-size: 23px;
  font-weight: 800;
  line-height: 1.1;
}

.section-heading p {
  margin-top: 2px;
  color: var(--gray-400);
  font-size: 10px;
  font-weight: 700;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.soft-button,
.primary-button,
.danger-button,
.submit-button,
.record-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.soft-button,
.primary-button,
.danger-button {
  min-height: 36px;
  border-radius: 14px;
  padding: 8px 14px;
  font-size: 12px;
}

.soft-button {
  border: 1px solid var(--gray-100);
  background: #fff;
  color: var(--skin-deep);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.04);
}

.primary-button {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 10px 18px rgb(124 102 238 / 0.12);
}

.danger-button {
  width: 100%;
  margin-top: 12px;
  background: var(--red-50);
  color: var(--red-500);
}

.soft-button:active,
.primary-button:active,
.danger-button:active,
.submit-button:active,
.record-button:active {
  transform: scale(0.97);
}

.submit-button {
  width: 100%;
  min-height: 62px;
  border-radius: 24px;
  background: var(--skin-deep);
  color: #fff;
  font-size: 18px;
  box-shadow: 0 20px 35px rgb(124 102 238 / 0.22);
}

.submit-button:disabled {
  opacity: 0.5;
  box-shadow: none;
  transform: none;
}

.link-button {
  display: inline-flex;
  align-items: center;
  color: var(--gray-400);
  font-size: 14px;
  font-weight: 700;
}

.link-button:hover {
  color: var(--red-500);
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--gray-100);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.04);
}

.card.padded {
  padding: 20px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.red {
  background: var(--red-500);
  color: #fff;
}

.badge.deep {
  background: var(--skin-white);
  color: var(--skin-deep);
}

.badge.gray {
  background: var(--gray-50);
  color: var(--gray-500);
}

.badge.high {
  background: var(--red-500);
  color: #fff;
}

.badge.medium {
  background: var(--orange-500);
  color: #fff;
}

.badge.low {
  background: var(--yellow-500);
  color: #fff;
}

.alert-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--red-500);
}

.conflict-mini {
  border-color: #fff1f2;
}

.conflict-mini::after {
  content: "";
  position: absolute;
  top: -48px;
  right: -48px;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: var(--red-50);
  opacity: 0.7;
  transition: transform 180ms ease;
}

.conflict-mini:hover::after {
  transform: scale(1.1);
}

.conflict-pair {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.conflict-pair p {
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 800;
}

.conflict-pair .right {
  text-align: right;
}

.cross {
  color: #fca5a5;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 28px;
  font-style: italic;
  font-weight: 700;
}

.conflict-message {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  color: var(--red-500);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.65;
}

.scroll-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 0 8px 4px;
  margin: 0 -8px;
  scrollbar-width: none;
}

.product-tile {
  flex: 0 0 128px;
  border: 1px solid #fff1f2;
  border-radius: 28px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.04);
}

.product-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 8px;
}

.product-tile h3,
.product-card h3 {
  overflow: hidden;
  color: var(--gray-800);
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.tag {
  border-radius: 5px;
  background: #fff1f2;
  color: var(--skin-rose);
  padding: 2px 6px;
  font-size: 8px;
  font-weight: 800;
}

.add-product-card {
  flex: 0 0 128px;
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed var(--gray-200);
  border-radius: 28px;
  color: var(--gray-300);
  font-size: 12px;
  font-weight: 800;
  transition: border 160ms ease, color 160ms ease;
}

.add-product-card:hover {
  border-color: var(--skin-rose);
  color: var(--skin-rose);
}

.schedule-board {
  overflow: hidden;
  border: 1px solid #f5f3ff;
  border-radius: 40px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 20px 35px rgb(124 102 238 / 0.1);
}

.week-header,
.schedule-row {
  display: grid;
  grid-template-columns: 38px repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.week-header {
  padding-bottom: 6px;
}

.week-header span {
  color: var(--gray-400);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.schedule-row + .schedule-row {
  margin-top: 4px;
}

.time-cell,
.day-slot {
  min-height: 96px;
}

.time-cell {
  display: grid;
  place-items: center;
  border-radius: 28px 10px 10px 28px;
}

.time-cell.am {
  background: rgb(255 247 237 / 0.65);
  color: var(--orange-400);
}

.time-cell.pm {
  background: rgb(238 242 255 / 0.75);
  color: var(--indigo-500);
}

.day-slot {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  border-radius: 12px;
  padding: 4px;
}

.day-slot.am {
  background: rgb(255 247 237 / 0.28);
}

.day-slot.pm {
  background: rgb(238 242 255 / 0.35);
}

.slot-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.slot-stack img,
.empty-slot {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.slot-stack img {
  object-fit: cover;
  border: 1px solid #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}

.empty-slot {
  background: var(--gray-50);
}

.tips-grid {
  display: grid;
  gap: 24px;
}

.tip-box {
  display: grid;
  gap: 12px;
  border-radius: 28px;
  background: rgb(253 242 248 / 0.38);
  padding: 20px;
}

.tip-line,
.principle-line {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.principle-card h3 {
  color: var(--gray-800);
  font-family: Inter, sans-serif;
  font-size: 14px;
  font-weight: 800;
}

.principle-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.intro-card {
  display: flex;
  align-items: center;
  gap: 16px;
  border-color: #f5f3ff;
}

.intro-icon {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 999px;
  background: #f5f3ff;
  color: var(--purple);
}

.intro-card p:first-child {
  color: var(--gray-800);
  font-size: 14px;
  font-weight: 800;
}

.intro-card p:last-child {
  margin-top: 3px;
  color: var(--gray-500);
  font-size: 11px;
  line-height: 1.55;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.record-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.record-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-800);
  font-size: 13px;
  font-weight: 800;
}

.record-list {
  display: grid;
  gap: 8px;
}

.record-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.record-item img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
}

.record-item span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-button {
  border-radius: 12px;
  background: var(--skin-deep);
  color: #fff;
  padding: 7px 10px;
  font-size: 10px;
}

.record-button:disabled {
  background: var(--gray-100);
  color: var(--gray-400);
}

.empty-note {
  color: var(--gray-400);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.55;
}

.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-heading h2 {
  color: var(--gray-800);
  font-family: Inter, sans-serif;
  font-size: 18px;
  font-weight: 800;
}

.history-heading span {
  color: var(--gray-400);
  font-size: 10px;
  font-weight: 800;
}

.history-entry {
  padding: 16px;
}

.history-entry-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-meta {
  display: grid;
  gap: 8px;
}

.history-date {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-800);
  font-size: 14px;
  font-weight: 800;
}

.history-product {
  width: max-content;
  border-radius: 999px;
  background: var(--gray-50);
  color: var(--gray-600);
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 800;
}

.history-time {
  color: var(--gray-400);
  font-size: 10px;
}

.icon-danger {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: var(--red-50);
  color: var(--red-500);
}

.search-wrap {
  position: relative;
}

.search-wrap svg {
  position: absolute;
  top: 50%;
  left: 16px;
  color: var(--gray-400);
  transform: translateY(-50%);
}

.search-input,
.text-input {
  width: 100%;
  outline: 0;
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 700;
  transition: box-shadow 160ms ease;
}

.search-input {
  border: 1px solid var(--gray-100);
  border-radius: 18px;
  background: #fff;
  padding: 16px 16px 16px 44px;
}

.text-input {
  border: 0;
  border-radius: 18px;
  background: var(--gray-50);
  padding: 20px;
}

.search-input:focus,
.text-input:focus {
  box-shadow: 0 0 0 3px rgb(255 209 209 / 0.6);
}

.encyclopedia-list {
  display: grid;
  gap: 16px;
}

.ingredient-card {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.ingredient-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ingredient-name {
  color: var(--gray-800);
  font-size: 16px;
  font-weight: 800;
}

.alias-block {
  text-align: right;
}

.alias-label {
  color: var(--gray-400);
  font-size: 9px;
  font-weight: 800;
}

.alias-text {
  margin-top: 2px;
  color: var(--gray-500);
  font-size: 10px;
  font-weight: 700;
}

.description-box {
  border-radius: 18px;
  background: rgb(249 250 251 / 0.7);
  padding: 16px;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--gray-400);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.description-box p:last-child,
.interaction-card p,
.conflict-card p {
  color: var(--gray-600);
  font-size: 12px;
  line-height: 1.65;
}

.interaction-list {
  display: grid;
  gap: 8px;
}

.interaction-card {
  display: grid;
  gap: 8px;
  border: 1px solid #fee2e2;
  border-radius: 18px;
  background: rgb(254 242 242 / 0.4);
  padding: 12px;
}

.interaction-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.interaction-head span:first-child {
  color: var(--red-700);
  font-size: 12px;
  font-weight: 800;
}

.conflict-intro {
  border-color: transparent;
  background: var(--red-50);
}

.conflict-intro .intro-icon {
  background: var(--red-100);
  color: var(--red-500);
}

.conflict-intro p:first-child {
  color: #991b1b;
}

.conflict-intro p:last-child {
  color: var(--red-600);
}

.conflict-card {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.conflict-ingredients {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: center;
}

.conflict-ingredients strong {
  display: block;
  color: var(--gray-800);
  font-size: 14px;
}

.conflict-ingredients small {
  color: var(--gray-400);
  font-size: 10px;
}

.plus-circle {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 999px;
  background: var(--gray-50);
  color: #fecaca;
}

.conflict-detail {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--gray-100);
  padding-top: 16px;
}

.conflict-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.conflict-detail-row svg {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--skin-rose);
}

.severity-row {
  display: flex;
  justify-content: flex-end;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  border-radius: 32px;
  padding: 16px;
}

.product-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 12px;
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.06);
}

.product-add-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 190px;
  border: 2px dashed var(--gray-200);
  border-radius: 32px;
  color: var(--gray-400);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.product-add-box .icon-wrap {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.06);
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(448px, 100%);
  height: 80px;
  margin: 0 auto;
  border: 1px solid rgb(255 255 255 / 0.3);
  border-top-color: var(--gray-100);
  border-radius: 40px 40px 0 0;
  background: rgb(255 255 255 / 0.7);
  padding: 0 32px;
  box-shadow: 0 -18px 45px rgb(0 0 0 / 0.12);
  backdrop-filter: blur(10px);
}

.nav-button {
  position: relative;
}

.nav-dot {
  position: absolute;
  bottom: -10px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--purple);
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}

.modal-root.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.6);
  backdrop-filter: blur(4px);
  animation: fade-in 160ms ease both;
}

.modal-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(448px, 100%);
  height: 85vh;
  margin: 0 auto;
  overflow-y: auto;
  border-radius: 50px 50px 0 0;
  background: #fff;
  padding: 32px 32px 0;
  box-shadow: 0 -25px 50px rgb(0 0 0 / 0.25);
  scrollbar-width: none;
  animation: slide-up 220ms ease both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-handle {
  width: 48px;
  height: 6px;
  border-radius: 999px;
  background: var(--gray-200);
  margin: 0 auto 32px;
}

.modal-content {
  display: grid;
  gap: 24px;
}

.modal-title {
  text-align: center;
}

.modal-title h2 {
  color: #111827;
  font-size: 31px;
  font-weight: 800;
}

.modal-title p {
  margin-top: 4px;
  color: var(--gray-400);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.image-picker {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: var(--gray-100);
  aspect-ratio: 16 / 9;
}

.image-picker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 200ms ease;
}

.image-picker:hover img {
  transform: scale(1.04);
}

.image-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / 0.2);
}

.image-overlay label {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.2);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 160ms ease;
}

.image-overlay label:hover {
  background: rgb(255 255 255 / 0.38);
}

.upload-chip {
  position: absolute;
  right: 16px;
  bottom: 16px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.9);
  padding: 7px 12px;
  color: #111827;
  font-size: 10px;
  font-weight: 800;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  padding-left: 8px;
  color: var(--gray-400);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ingredient-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ingredient-option {
  min-height: 67px;
  border: 1px solid var(--gray-100);
  border-radius: 18px;
  background: #fff;
  padding: 14px 16px;
  text-align: left;
  transition: border 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.ingredient-option:hover {
  border-color: var(--skin-pink);
}

.ingredient-option strong {
  display: block;
  color: var(--gray-700);
  font-size: 12px;
  font-weight: 800;
}

.ingredient-option small {
  display: block;
  margin-top: 2px;
  color: var(--gray-400);
  font-size: 9px;
}

.ingredient-option.selected {
  border-color: var(--skin-deep);
  background: var(--skin-deep);
  box-shadow: 0 12px 18px rgb(124 102 238 / 0.14);
}

.ingredient-option.selected strong {
  color: #fff;
}

.ingredient-option.selected small {
  color: #ddd6fe;
}

.modal-footer {
  position: sticky;
  bottom: 0;
  margin: 0 -32px;
  border-top: 1px solid var(--gray-100);
  background: rgb(255 255 255 / 0.95);
  padding: 16px 32px 32px;
  backdrop-filter: blur(10px);
}

.hidden-input {
  display: none;
}

.empty-card {
  border-radius: 28px;
  border: 1px solid var(--gray-100);
  background: #fff;
  padding: 32px;
  text-align: center;
}

.empty-card p:first-child {
  color: var(--gray-500);
  font-size: 14px;
  font-weight: 800;
}

.empty-card p:last-child {
  margin-top: 4px;
  color: var(--gray-400);
  font-size: 11px;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .tips-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  .app-title {
    font-size: 25px;
  }

  .header-actions {
    gap: 14px;
  }

  .content,
  .app-header {
    padding-right: 18px;
    padding-left: 18px;
  }

  .bottom-nav {
    padding: 0 22px;
  }

  .nav-button span {
    font-size: 9px;
  }

  .button-row {
    width: 100%;
    justify-content: flex-start;
  }

  .soft-button,
  .primary-button {
    padding-right: 11px;
    padding-left: 11px;
  }
}

/* Visual polish */
:root {
  --cream: #fffdf8;
  --mist: #eef8f3;
  --mint: #6fb99f;
  --mint-deep: #2f7d69;
  --coral: #ef786f;
  --apricot: #ffd9b8;
  --ink: #20212a;
  --muted: #7b7c87;
  --line-soft: rgba(32, 33, 42, 0.08);
  --shadow-soft: 0 18px 42px rgba(41, 31, 26, 0.1);
  --shadow-card: 0 12px 28px rgba(32, 33, 42, 0.08);
}

body {
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 217, 184, 0.55), transparent 28%),
    radial-gradient(circle at 88% 22%, rgba(111, 185, 159, 0.32), transparent 24%),
    linear-gradient(145deg, #fff7f1 0%, #f6fbf8 48%, #fffdf8 100%);
  color: var(--ink);
}

.phone-shell {
  max-width: 460px;
  height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 253, 248, 0.96) 28%),
    var(--cream);
  border-right: 1px solid rgba(255, 255, 255, 0.72);
  border-left: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 24px 70px rgba(42, 31, 22, 0.16);
}

.phone-shell::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 220px;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(239, 120, 111, 0.16), transparent 40%),
    linear-gradient(225deg, rgba(111, 185, 159, 0.18), transparent 38%);
}

.app-header,
.content,
.bottom-nav,
.auth-prompt {
  position: relative;
  z-index: 1;
}

.app-header {
  padding-top: 42px;
}

.topbar {
  align-items: center;
}

.app-title {
  max-width: 270px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 25px;
  letter-spacing: 0;
}

.app-subtitle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.header-actions {
  gap: 10px;
}

.quick-button {
  width: 52px;
  min-height: 52px;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 26px rgba(32, 33, 42, 0.07);
  backdrop-filter: blur(12px);
}

.quick-button span {
  display: none;
}

.quick-button svg {
  color: var(--ink);
}

.quick-button:hover,
.quick-button:hover svg {
  color: var(--mint-deep);
  transform: translateY(-1px);
}

.view {
  gap: 24px;
}

.section {
  gap: 14px;
}

.section-heading {
  align-items: flex-end;
}

.section-heading h2 {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 18px;
  letter-spacing: 0;
}

.section-heading p {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.card,
.product-tile,
.schedule-board,
.tip-box,
.empty-card,
.product-add-box,
.add-product-card {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
}

.card {
  border-radius: 22px;
}

.card.padded {
  padding: 18px;
}

.soft-button,
.primary-button,
.danger-button,
.record-button,
.submit-button,
.link-button,
.auth-prompt button {
  letter-spacing: 0;
}

.soft-button,
.primary-button {
  min-height: 38px;
  border-radius: 14px;
}

.soft-button {
  border-color: rgba(47, 125, 105, 0.12);
  color: var(--mint-deep);
}

.primary-button {
  background: linear-gradient(135deg, var(--ink), #3a342f);
  box-shadow: 0 14px 28px rgba(32, 33, 42, 0.18);
}

.link-button {
  color: var(--mint-deep);
  font-size: 13px;
}

.link-button:hover {
  color: var(--coral);
}

.badge.deep,
.tag {
  background: rgba(111, 185, 159, 0.13);
  color: var(--mint-deep);
}

.badge.gray {
  background: rgba(32, 33, 42, 0.06);
  color: var(--muted);
}

.badge.red,
.badge.high {
  background: var(--coral);
}

.badge.medium {
  background: #d9893d;
}

.badge.low {
  background: var(--mint);
}

.scroll-row {
  gap: 12px;
  padding-bottom: 8px;
}

.product-tile {
  flex-basis: 122px;
  border-radius: 20px;
  padding: 10px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.product-tile:active,
.product-card:active,
.ingredient-card:active,
.conflict-card:active {
  transform: translateY(1px);
}

.product-tile img,
.product-card img {
  border-radius: 15px;
}

.product-tile h3,
.product-card h3 {
  color: var(--ink);
  letter-spacing: 0;
}

.add-product-card {
  flex-basis: 122px;
  border-color: rgba(47, 125, 105, 0.22);
  border-radius: 20px;
  color: var(--mint-deep);
}

.add-product-card:hover,
.product-add-box:hover {
  border-color: var(--mint);
  background: rgba(238, 248, 243, 0.82);
}

.schedule-board {
  border-radius: 26px;
  padding: 10px;
  box-shadow: 0 18px 44px rgba(47, 125, 105, 0.12);
}

.week-header,
.schedule-row {
  grid-template-columns: 34px repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.week-header span {
  color: #8c8d98;
  font-size: 11px;
}

.time-cell,
.day-slot {
  min-height: 84px;
}

.time-cell {
  border-radius: 16px;
}

.time-cell.am {
  background: rgba(255, 217, 184, 0.46);
  color: #c97730;
}

.time-cell.pm {
  background: rgba(111, 185, 159, 0.17);
  color: var(--mint-deep);
}

.day-slot {
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 14px;
}

.day-slot.am {
  background: rgba(255, 245, 235, 0.68);
}

.day-slot.pm {
  background: rgba(238, 248, 243, 0.78);
}

.slot-stack {
  gap: 5px;
}

.slot-stack img,
.empty-slot {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.slot-stack img {
  box-shadow: 0 6px 14px rgba(32, 33, 42, 0.13);
}

.tips-grid {
  gap: 14px;
}

.tip-box {
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 217, 184, 0.46), rgba(255, 255, 255, 0.78));
}

.tip-line {
  color: #565860;
  font-size: 12px;
}

.tip-line svg {
  flex: 0 0 auto;
  color: var(--mint-deep);
}

.principle-card {
  background: linear-gradient(135deg, rgba(238, 248, 243, 0.9), rgba(255, 255, 255, 0.9));
}

.principle-card h3,
.history-heading h2 {
  color: var(--ink);
  letter-spacing: 0;
}

.intro-card {
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(238, 248, 243, 0.92), rgba(255, 255, 255, 0.92));
}

.intro-icon {
  background: rgba(47, 125, 105, 0.12);
  color: var(--mint-deep);
}

.intro-card p:first-child,
.ingredient-name,
.history-date,
.conflict-ingredients strong {
  color: var(--ink);
}

.record-grid,
.products-grid {
  gap: 14px;
}

.record-card {
  border-radius: 22px;
  padding: 14px;
}

.record-title {
  color: var(--ink);
}

.record-button {
  min-width: 48px;
  background: var(--mint-deep);
}

.record-button:disabled {
  background: rgba(47, 125, 105, 0.09);
  color: var(--mint-deep);
}

.history-entry {
  margin-top: 10px;
  border-radius: 20px;
}

.history-product {
  background: rgba(255, 217, 184, 0.42);
  color: #8a542b;
}

.icon-danger,
.danger-button {
  background: rgba(239, 120, 111, 0.11);
  color: #d85f57;
}

.search-input,
.text-input {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.search-input:focus,
.text-input:focus {
  box-shadow: 0 0 0 3px rgba(111, 185, 159, 0.18), var(--shadow-card);
}

.ingredient-card,
.conflict-card,
.product-card {
  border-radius: 22px;
  transition: transform 160ms ease;
}

.description-box {
  background: rgba(238, 248, 243, 0.58);
  border: 1px solid rgba(47, 125, 105, 0.06);
}

.eyebrow {
  color: var(--mint-deep);
  letter-spacing: 0.04em;
}

.interaction-card {
  border-color: rgba(239, 120, 111, 0.16);
  background: rgba(255, 246, 241, 0.72);
}

.interaction-head span:first-child {
  color: #a94740;
}

.conflict-intro {
  background: linear-gradient(135deg, rgba(255, 235, 225, 0.96), rgba(255, 255, 255, 0.88));
}

.conflict-intro .intro-icon {
  background: rgba(239, 120, 111, 0.12);
  color: var(--coral);
}

.conflict-intro p:first-child,
.conflict-intro p:last-child {
  color: #8d3f39;
}

.disclaimer-intro {
  background: linear-gradient(135deg, rgba(255, 246, 241, 0.96), rgba(238, 248, 243, 0.9));
}

.disclaimer-intro .intro-icon {
  background: rgba(239, 120, 111, 0.12);
  color: var(--coral);
}

.disclaimer-list {
  display: grid;
  gap: 12px;
}

.disclaimer-card {
  display: grid;
  gap: 8px;
  border-radius: 20px;
  padding: 18px;
}

.disclaimer-card h2 {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.disclaimer-card p {
  color: #5f616b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.75;
}

.conflict-mini {
  background: linear-gradient(135deg, rgba(255, 246, 241, 0.96), rgba(255, 255, 255, 0.92));
}

.conflict-mini::after {
  background: rgba(239, 120, 111, 0.12);
}

.alert-title {
  color: var(--coral);
}

.product-add-box {
  min-height: 180px;
  border-color: rgba(47, 125, 105, 0.2);
  border-radius: 22px;
  color: var(--mint-deep);
  letter-spacing: 0.03em;
}

.product-add-box .icon-wrap {
  color: var(--mint-deep);
}

.bottom-nav {
  height: 82px;
  border-radius: 28px 28px 0 0;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 -18px 42px rgba(32, 33, 42, 0.12);
}

.nav-button {
  color: #858691;
}

.nav-button svg {
  color: #696b75;
}

.nav-button.active,
.nav-button.active svg {
  color: var(--mint-deep);
}

.nav-dot {
  background: var(--mint-deep);
}

.modal-panel {
  border-radius: 34px 34px 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 253, 248, 0.98)),
    var(--cream);
}

.modal-title h2 {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 24px;
  letter-spacing: 0;
}

.modal-title p,
.field label {
  color: var(--muted);
  letter-spacing: 0.04em;
}

.image-picker {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
}

.image-overlay {
  background: linear-gradient(180deg, rgba(32, 33, 42, 0.04), rgba(32, 33, 42, 0.28));
}

.upload-chip {
  color: var(--ink);
}

.ingredient-option {
  border-color: rgba(32, 33, 42, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.ingredient-option:hover {
  border-color: rgba(47, 125, 105, 0.34);
}

.ingredient-option.selected {
  border-color: var(--mint-deep);
  background: linear-gradient(135deg, var(--mint-deep), #3d907a);
  box-shadow: 0 14px 28px rgba(47, 125, 105, 0.24);
}

.submit-button {
  min-height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--ink), #32343f);
  font-size: 16px;
  box-shadow: 0 18px 34px rgba(32, 33, 42, 0.22);
}

.modal-footer {
  background: rgba(255, 253, 248, 0.92);
}

.auth-prompt {
  position: sticky;
  bottom: 90px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 18px 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  backdrop-filter: blur(16px);
}

.auth-prompt[hidden] {
  display: none;
}

.auth-prompt p {
  margin: 0;
}

.auth-prompt strong {
  display: block;
  font-size: 13px;
  line-height: 1.3;
}

.auth-prompt span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.auth-prompt button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--mint-deep);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.auth-prompt.syncing button {
  opacity: 0.64;
}

@media (max-width: 390px) {
  .app-header {
    padding-top: 34px;
  }

  .app-title {
    max-width: 230px;
    font-size: 22px;
  }

  .quick-button {
    width: 46px;
    min-height: 46px;
    border-radius: 16px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .section-heading .link-button {
    align-self: flex-start;
  }

  .week-header,
  .schedule-row {
    grid-template-columns: 30px repeat(7, minmax(0, 1fr));
    gap: 3px;
  }

  .time-cell,
  .day-slot {
    min-height: 76px;
  }

  .slot-stack img,
  .empty-slot {
    width: 26px;
    height: 26px;
  }

  .record-grid,
  .products-grid,
  .ingredient-options {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    padding: 0 16px;
  }

  .auth-prompt {
    margin-right: 14px;
    margin-left: 14px;
  }
}

/* Keep bottom navigation pinned to the viewport bottom */
.phone-shell {
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

.view {
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

.bottom-nav {
  position: fixed;
  right: auto;
  bottom: 0;
  left: 50%;
  width: min(460px, 100vw);
  height: calc(82px + env(safe-area-inset-bottom, 0px));
  padding: 0 18px env(safe-area-inset-bottom, 0px);
  transform: translateX(-50%);
}

.bottom-nav .nav-button {
  min-width: 42px;
}

.auth-prompt {
  bottom: calc(94px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 390px) {
  .bottom-nav {
    padding-right: 16px;
    padding-left: 16px;
  }
}

/* Ingredient picker columns */
.ingredient-options {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}

.ingredient-option {
  min-height: 58px;
  padding: 12px;
}

.ingredient-option strong,
.ingredient-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 430px) {
  .ingredient-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .ingredient-options {
    grid-template-columns: 1fr;
  }
}
