:root {
  color-scheme: dark;
  --bg: #061816;
  --bg-deep: #041210;
  --surface: #0d2925;
  --surface-2: #12342f;
  --surface-3: #173d36;
  --surface-glass: rgba(15, 46, 41, 0.82);
  --line: rgba(135, 232, 205, 0.16);
  --line-strong: rgba(135, 232, 205, 0.3);
  --text: #f5fffb;
  --text-soft: #cae0d9;
  --muted: #88a79e;
  --mint: #5ff0c4;
  --mint-bright: #9fffe2;
  --mint-deep: #1ebf91;
  --lime: #b9ea52;
  --orange: #ff9b5d;
  --orange-soft: #ffd3b9;
  --blue: #73c9ff;
  --red: #ff747c;
  --shadow-card: 0 18px 42px rgba(0, 8, 7, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  --shadow-lift: 0 15px 34px rgba(0, 8, 7, 0.4), 0 0 0 1px rgba(129, 236, 205, 0.13);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 17px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg-deep);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 3%, rgba(44, 179, 137, 0.12), transparent 28rem),
    linear-gradient(180deg, #071d1a 0%, var(--bg) 38%, var(--bg-deep) 100%);
  color: var(--text);
  font-family: Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(94px + var(--safe-bottom));
}

button, input { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(95, 240, 196, 0.36);
  outline-offset: 2px;
}

.hidden { display: none !important; }

.ambient {
  position: fixed;
  pointer-events: none;
  filter: blur(1px);
  opacity: 0.5;
  z-index: 0;
}

.ambient-one {
  width: 280px;
  height: 280px;
  right: -170px;
  top: 18%;
  border: 1px solid rgba(95, 240, 196, 0.15);
  border-radius: 50%;
  box-shadow: 0 0 70px rgba(31, 187, 141, 0.06), inset 0 0 40px rgba(95, 240, 196, 0.03);
}

.ambient-two {
  width: 180px;
  height: 180px;
  left: -120px;
  bottom: 20%;
  background: rgba(255, 155, 93, 0.05);
  border-radius: 50%;
  filter: blur(45px);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  min-height: 100vh;
  margin: 0 auto;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 18px 12px;
  background: linear-gradient(180deg, rgba(6, 24, 22, 0.97), rgba(6, 24, 22, 0.86));
  border-bottom: 1px solid rgba(141, 231, 206, 0.08);
  backdrop-filter: blur(18px) saturate(130%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 13px;
  box-shadow: 0 8px 18px rgba(0, 8, 7, 0.4), 0 0 0 1px rgba(125, 237, 207, 0.16);
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong { font-size: 0.98rem; font-weight: 850; white-space: nowrap; }
.brand-copy small { color: var(--muted); font-size: 0.67rem; white-space: nowrap; }

.network-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 48, 43, 0.75);
  color: var(--text-soft);
  font-size: 0.68rem;
  font-weight: 750;
  white-space: nowrap;
}

.status-dot, .live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(95, 240, 196, 0.1), 0 0 10px rgba(95, 240, 196, 0.72);
}

.network-badge.offline .status-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(255, 116, 124, 0.1); }
.network-badge.offline { color: #ffd7d9; border-color: rgba(255, 116, 124, 0.24); }

.main-content { padding: 16px 16px 32px; }

.screen { display: none; animation: screen-in 0.24s ease both; }
.screen.active { display: block; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-card {
  position: relative;
  min-height: 292px;
  overflow: hidden;
  border: 1px solid rgba(128, 236, 205, 0.22);
  border-radius: 30px;
  background: #092620;
  box-shadow: 0 24px 55px rgba(0, 8, 7, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  isolation: isolate;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(6, 28, 25, 0.97) 0%, rgba(6, 28, 25, 0.8) 43%, rgba(6, 28, 25, 0.12) 78%),
    linear-gradient(180deg, transparent 60%, rgba(6, 24, 22, 0.45));
}

.hero-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 63% center;
  opacity: 0.95;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  min-height: 292px;
  padding: 25px 22px 21px;
}

.eyebrow, .section-kicker {
  color: var(--mint);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(126, 239, 207, 0.24);
  border-radius: 999px;
  background: rgba(6, 28, 25, 0.58);
  backdrop-filter: blur(8px);
}

.hero-content h1 {
  margin: 17px 0 9px;
  font-size: clamp(1.82rem, 8vw, 2.45rem);
  line-height: 1.13;
  letter-spacing: -0.055em;
  text-shadow: 0 4px 20px rgba(0, 8, 7, 0.48);
}

.hero-content h1 em { color: var(--mint-bright); font-style: normal; }
.hero-content p { margin: 0; color: #c5dcd5; font-size: 0.84rem; line-height: 1.6; }

.freshness-pill {
  margin-top: auto;
  padding: 8px 11px;
  border: 1px solid rgba(95, 240, 196, 0.22);
  border-radius: 10px;
  background: rgba(4, 21, 18, 0.64);
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 760;
  backdrop-filter: blur(8px);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 13px;
}

.summary-tile {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: linear-gradient(145deg, rgba(22, 59, 52, 0.96), rgba(10, 37, 32, 0.96));
  box-shadow: var(--shadow-card);
}

.summary-tile::after {
  content: "";
  position: absolute;
  width: 54px;
  height: 54px;
  right: -22px;
  top: -21px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.09;
}

.summary-tile.mint { color: var(--mint); }
.summary-tile.orange { color: var(--orange); }
.summary-tile.blue { color: var(--blue); }
.summary-tile strong { display: block; margin-top: 8px; color: var(--text); font-size: 1.05rem; font-weight: 900; }
.summary-tile small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.65rem; }
.summary-icon { font-size: 0.78rem; font-weight: 900; }

.notice-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 13px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 155, 93, 0.2);
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(104, 54, 31, 0.3), rgba(46, 39, 29, 0.32));
}

.notice-icon, .confirm-icon {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 155, 93, 0.16);
  color: var(--orange);
  font-size: 0.8rem;
  font-weight: 950;
}

.notice-card p { margin: 0; color: var(--text-soft); font-size: 0.74rem; line-height: 1.5; }
.notice-card strong { color: var(--orange-soft); }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 2px 13px;
}

.section-heading.compact { margin-top: 25px; }
.section-heading h2 { margin: 4px 0 0; font-size: 1.26rem; letter-spacing: -0.04em; }
.section-kicker { display: block; }

.text-button {
  min-height: 40px;
  padding: 8px 3px 8px 12px;
  border: 0;
  background: none;
  color: var(--mint);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.board-list, .registered-list, .purchase-history, .search-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.market-card {
  position: relative;
  overflow: hidden;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0%, rgba(95, 240, 196, 0.065), transparent 13rem),
    linear-gradient(145deg, rgba(19, 55, 49, 0.98), rgba(9, 33, 29, 0.98));
  box-shadow: var(--shadow-card);
}

.market-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--mint), rgba(95, 240, 196, 0));
  opacity: 0.78;
}

.card-top { display: flex; align-items: center; gap: 11px; }

.ingredient-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(148, 245, 217, 0.18);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(95, 240, 196, 0.2), rgba(22, 88, 71, 0.17));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 16px rgba(0, 8, 7, 0.28);
  font-size: 1.55rem;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.card-title-block { min-width: 0; flex: 1; }
.card-title-block h3 { overflow: hidden; margin: 0; font-size: 1.04rem; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.condition-line { margin-top: 4px; color: var(--muted); font-size: 0.7rem; }

.confidence-chip {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid rgba(95, 240, 196, 0.16);
  border-radius: 999px;
  background: rgba(95, 240, 196, 0.08);
  color: var(--mint);
  font-size: 0.63rem;
  font-weight: 850;
}

.confidence-chip.caution { border-color: rgba(255, 155, 93, 0.19); background: rgba(255, 155, 93, 0.09); color: var(--orange); }

.price-stage {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 17px;
}

.price-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 0.68rem; font-weight: 720; }
.market-price { font-size: clamp(1.65rem, 7vw, 2.05rem); font-weight: 950; letter-spacing: -0.055em; font-variant-numeric: tabular-nums; }
.market-price small { margin-left: 2px; color: var(--text-soft); font-size: 0.9rem; font-weight: 800; }

.change-pill {
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(136, 167, 158, 0.1);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.change-pill.up { background: rgba(255, 116, 124, 0.1); color: #ff9ca2; }
.change-pill.down { background: rgba(115, 201, 255, 0.1); color: var(--blue); }

.realtime-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 155, 93, 0.22);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(255, 155, 93, 0.105), rgba(255, 116, 124, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.realtime-copy { min-width: 0; }
.realtime-copy span { display: flex; align-items: center; gap: 6px; color: var(--orange); font-size: 0.62rem; font-weight: 850; }
.realtime-copy i { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(255, 155, 93, 0.1), 0 0 9px rgba(255, 155, 93, 0.45); }
.realtime-copy strong { display: block; margin-top: 3px; font-size: 1rem; font-variant-numeric: tabular-nums; }
.realtime-panel > small { color: var(--muted); font-size: 0.59rem; line-height: 1.4; text-align: right; }

.comparison-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
  padding: 13px 14px;
  border: 1px solid rgba(139, 225, 201, 0.13);
  border-radius: 16px;
  background: rgba(4, 23, 20, 0.46);
}

.comparison-panel.good { border-color: rgba(95, 240, 196, 0.19); background: rgba(30, 191, 145, 0.07); }
.comparison-panel.bad { border-color: rgba(255, 116, 124, 0.18); background: rgba(255, 116, 124, 0.065); }
.comparison-panel.neutral { border-color: rgba(115, 201, 255, 0.17); background: rgba(115, 201, 255, 0.055); }
.comparison-copy { min-width: 0; }
.comparison-copy span { display: block; color: var(--muted); font-size: 0.65rem; }
.comparison-copy strong { display: block; overflow: hidden; margin-top: 3px; font-size: 0.82rem; text-overflow: ellipsis; white-space: nowrap; }
.comparison-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.63rem; }

.mini-button {
  min-height: 42px;
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(95, 240, 196, 0.22);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(95, 240, 196, 0.2), rgba(30, 191, 145, 0.13));
  color: var(--mint-bright);
  font-size: 0.69rem;
  font-weight: 850;
  cursor: pointer;
}

.detail-panel { margin-top: 10px; border-top: 1px solid rgba(136, 213, 191, 0.1); }
.detail-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 43px;
  list-style: none;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 760;
  cursor: pointer;
}
.detail-panel summary::-webkit-details-marker { display: none; }
.detail-panel summary::after { content: "⌄"; color: var(--mint); font-size: 1rem; transition: transform 0.2s ease; }
.detail-panel[open] summary::after { transform: rotate(180deg); }
.detail-content { padding: 4px 0 1px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.metric-box { min-width: 0; padding: 10px 9px; border-radius: 12px; background: rgba(128, 219, 193, 0.055); }
.metric-box span { display: block; color: var(--muted); font-size: 0.58rem; }
.metric-box strong { display: block; overflow: hidden; margin-top: 4px; font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.dispersion-warning { margin: 9px 0 0; color: var(--orange); font-size: 0.65rem; line-height: 1.45; }

.chart-wrap { min-height: 116px; margin-top: 10px; padding: 9px 7px 3px; border-radius: 13px; background: rgba(3, 19, 16, 0.38); }
.chart-wrap svg { display: block; overflow: visible; }
.chart-line { fill: none; stroke: var(--mint); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px rgba(95, 240, 196, 0.35)); }
.chart-area { fill: url(#chartGradient); }
.chart-dot { fill: var(--mint-bright); stroke: #0b3029; stroke-width: 2; }
.chart-label { fill: var(--muted); font-size: 8px; font-family: inherit; }

.no-data-card { opacity: 0.84; }
.no-data-message { margin-top: 14px; padding: 12px; border-radius: 14px; background: rgba(136, 167, 158, 0.07); color: var(--muted); font-size: 0.74rem; line-height: 1.5; }

.page-intro { margin: 4px 2px 20px; }
.page-intro h1 { margin: 6px 0 6px; font-size: 1.9rem; letter-spacing: -0.055em; }
.page-intro p { margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.55; }

.search-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(20, 57, 50, 0.97), rgba(9, 32, 28, 0.97));
  box-shadow: var(--shadow-card);
}

.search-shell:focus-within { border-color: rgba(95, 240, 196, 0.58); box-shadow: 0 0 0 4px rgba(95, 240, 196, 0.07), var(--shadow-card); }
.search-shell svg { width: 21px; height: 21px; flex: 0 0 auto; fill: none; stroke: var(--mint); stroke-width: 2; }
.search-shell input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 0.86rem; }
.search-shell input::placeholder { color: #718f86; }

.clear-search {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(132, 179, 166, 0.12);
  color: var(--muted);
  cursor: pointer;
}

.quick-chips { display: flex; gap: 7px; overflow-x: auto; padding: 12px 1px 5px; scrollbar-width: none; }
.quick-chips::-webkit-scrollbar { display: none; }
.quick-chip {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(14, 46, 40, 0.78);
  color: var(--text-soft);
  font-size: 0.69rem;
  font-weight: 750;
  cursor: pointer;
}
.quick-chip.active { border-color: rgba(95, 240, 196, 0.34); background: rgba(95, 240, 196, 0.12); color: var(--mint-bright); }

.search-helper { display: flex; justify-content: space-between; margin: 9px 3px 13px; color: var(--muted); font-size: 0.62rem; }

.search-result-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: linear-gradient(145deg, rgba(18, 53, 47, 0.95), rgba(8, 31, 27, 0.96));
  box-shadow: var(--shadow-card);
}

.search-result-trigger {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 67px;
  padding: 11px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.search-result-trigger .ingredient-avatar { width: 42px; height: 42px; border-radius: 14px; font-size: 1.3rem; }
.search-result-trigger strong { display: block; font-size: 0.92rem; }
.search-result-trigger small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.64rem; }
.result-arrow { margin-left: auto; color: var(--mint); transition: transform 0.2s ease; }
.search-result-card.open .result-arrow { transform: rotate(180deg); }
.search-options { display: none; padding: 0 10px 10px; }
.search-result-card.open .search-options { display: flex; flex-direction: column; gap: 7px; }

.search-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 9px 10px 9px 12px;
  border: 1px solid rgba(136, 218, 195, 0.1);
  border-radius: 13px;
  background: rgba(3, 22, 19, 0.42);
}
.option-condition strong { display: block; font-size: 0.76rem; }
.option-condition small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.6rem; }
.option-price { font-size: 0.78rem; font-weight: 900; white-space: nowrap; }
.option-add {
  min-width: 48px;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid rgba(95, 240, 196, 0.22);
  border-radius: 10px;
  background: rgba(95, 240, 196, 0.12);
  color: var(--mint-bright);
  font-size: 0.66rem;
  font-weight: 850;
  cursor: pointer;
}
.option-add:disabled { opacity: 0.45; cursor: default; }

.info-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border: 1px solid rgba(95, 240, 196, 0.18);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(24, 87, 69, 0.35), rgba(11, 47, 40, 0.65));
  box-shadow: var(--shadow-card);
}
.info-banner-orb {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--mint-bright), var(--mint-deep));
  color: #063128;
  font-size: 1.6rem;
  font-weight: 650;
  box-shadow: 0 10px 20px rgba(21, 169, 126, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.info-banner strong { display: block; font-size: 0.84rem; }
.info-banner p { margin: 4px 0 0; color: var(--muted); font-size: 0.67rem; line-height: 1.5; }
.count-badge { margin-left: 4px; color: var(--mint); font-size: 0.82rem; }

.registered-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 70px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(18, 53, 47, 0.94), rgba(8, 31, 27, 0.94));
  box-shadow: var(--shadow-card);
}
.registered-item .ingredient-avatar { width: 43px; height: 43px; border-radius: 14px; font-size: 1.3rem; }
.registered-copy { min-width: 0; flex: 1; }
.registered-copy strong { display: block; font-size: 0.86rem; }
.registered-copy span { display: block; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 0.64rem; text-overflow: ellipsis; white-space: nowrap; }
.delete-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 116, 124, 0.16);
  border-radius: 12px;
  background: rgba(255, 116, 124, 0.07);
  color: #ff969c;
  cursor: pointer;
}
.delete-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

.catalog-heading { margin-top: 30px !important; }
.ingredient-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ingredient-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 82px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(18, 53, 47, 0.95), rgba(8, 31, 27, 0.95));
  text-align: left;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.ingredient-tile:active { transform: translateY(2px) scale(0.985); }
.ingredient-tile:disabled { opacity: 0.48; cursor: default; }
.tile-emoji { font-size: 1.55rem; filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.25)); }
.tile-copy { min-width: 0; }
.tile-copy strong { display: block; font-size: 0.82rem; }
.tile-copy small { display: block; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 0.59rem; text-overflow: ellipsis; white-space: nowrap; }
.tile-plus { position: absolute; right: 8px; top: 7px; color: var(--mint); font-size: 0.9rem; }

.record-summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  min-height: 110px;
  padding: 19px 20px;
  border: 1px solid rgba(255, 155, 93, 0.2);
  border-radius: 22px;
  background:
    radial-gradient(circle at 90% 20%, rgba(255, 155, 93, 0.19), transparent 9rem),
    linear-gradient(145deg, rgba(59, 48, 32, 0.9), rgba(18, 40, 33, 0.95));
  box-shadow: var(--shadow-card);
}
.record-summary span { color: var(--orange-soft); font-size: 0.7rem; font-weight: 800; }
.record-summary strong { display: block; margin-top: 5px; font-size: 1.72rem; font-weight: 950; }
.record-summary-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(255, 198, 160, 0.23);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 178, 126, 0.3), rgba(204, 105, 45, 0.13));
  color: var(--orange-soft);
  font-size: 1.35rem;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 20px rgba(0, 8, 7, 0.2);
}
.purchase-history { margin-top: 15px; }
.purchase-record {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(18, 53, 47, 0.94), rgba(8, 31, 27, 0.94));
  box-shadow: var(--shadow-card);
}
.record-date {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  flex-direction: column;
  border-radius: 14px;
  background: rgba(255, 155, 93, 0.1);
  color: var(--orange-soft);
}
.record-date strong { font-size: 0.86rem; }
.record-date small { font-size: 0.55rem; }
.record-main { min-width: 0; flex: 1; }
.record-main strong { display: block; font-size: 0.82rem; }
.record-main span { display: block; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 0.61rem; text-overflow: ellipsis; white-space: nowrap; }
.record-price { flex: 0 0 auto; font-size: 0.83rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.privacy-note { display: flex; align-items: flex-start; gap: 7px; margin: 17px 5px 0; color: #6e9086; font-size: 0.61rem; line-height: 1.5; }

.empty-state {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 32px 18px;
  border: 1px dashed rgba(134, 221, 197, 0.18);
  border-radius: 20px;
  background: rgba(14, 45, 39, 0.42);
  text-align: center;
}
.empty-orb {
  display: grid;
  width: 63px;
  height: 63px;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(95, 240, 196, 0.2), rgba(30, 191, 145, 0.07));
  font-size: 1.85rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 12px 24px rgba(0,0,0,0.2);
}
.empty-state h3 { margin: 15px 0 5px; font-size: 0.92rem; }
.empty-state p { margin: 0; color: var(--muted); font-size: 0.69rem; line-height: 1.5; }
.empty-state .mini-button { margin-top: 14px; }

.skeleton-stack { display: flex; flex-direction: column; gap: 12px; }
.skeleton-card { height: 218px; border-radius: 22px; background: linear-gradient(100deg, rgba(19, 54, 48, 0.66) 25%, rgba(40, 82, 72, 0.7) 43%, rgba(19, 54, 48, 0.66) 63%); background-size: 300% 100%; animation: shimmer 1.25s infinite linear; }
.skeleton-row { height: 74px; border-radius: 17px; background: linear-gradient(100deg, rgba(19, 54, 48, 0.66) 25%, rgba(40, 82, 72, 0.7) 43%, rgba(19, 54, 48, 0.66) 63%); background-size: 300% 100%; animation: shimmer 1.25s infinite linear; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.bottom-nav {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  max-width: 720px;
  min-height: calc(78px + var(--safe-bottom));
  padding: 7px 7px calc(7px + var(--safe-bottom));
  transform: translateX(-50%);
  border-top: 1px solid rgba(138, 228, 202, 0.12);
  background: rgba(4, 18, 16, 0.94);
  box-shadow: 0 -14px 35px rgba(0, 8, 7, 0.28);
  backdrop-filter: blur(22px) saturate(145%);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 60px;
  flex-direction: column;
  padding: 5px 2px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: #78978e;
  font-size: 0.64rem;
  font-weight: 780;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}
.nav-icon { display: grid; width: 35px; height: 31px; place-items: center; border-radius: 12px; }
.nav-item svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active { color: var(--mint-bright); background: linear-gradient(180deg, rgba(95, 240, 196, 0.13), rgba(95, 240, 196, 0.035)); }
.nav-item.active .nav-icon { background: rgba(95, 240, 196, 0.1); box-shadow: inset 0 1px 0 rgba(255,255,255,0.05); }
.nav-item:active { transform: scale(0.97); }

.sheet-layer, .dialog-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-backdrop, .dialog-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(0, 10, 8, 0.73); backdrop-filter: blur(5px); }
.bottom-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 10px 18px calc(22px + var(--safe-bottom));
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  background: linear-gradient(180deg, #12352f, #071f1b);
  box-shadow: 0 -25px 55px rgba(0, 8, 7, 0.55), inset 0 1px 0 rgba(255,255,255,0.05);
  animation: sheet-up 0.25s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes sheet-up { from { transform: translateY(35px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.sheet-handle { width: 43px; height: 4px; margin: 0 auto 17px; border-radius: 999px; background: rgba(185, 224, 213, 0.28); }
.sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.sheet-heading h2 { margin: 5px 0 0; font-size: 1.35rem; }
.sheet-heading p { margin: 4px 0 0; color: var(--muted); font-size: 0.7rem; }
.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(5, 27, 23, 0.5);
  color: var(--muted);
  font-size: 1.15rem;
  cursor: pointer;
}

#purchaseForm { margin-top: 20px; }
.field-grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-label { display: block; margin-bottom: 13px; color: var(--text-soft); font-size: 0.7rem; font-weight: 750; }
.field-label .optional { color: var(--muted); font-size: 0.61rem; font-weight: 600; }
.field-label > input, .input-suffix, .won-input {
  width: 100%;
  min-height: 50px;
  margin-top: 7px;
  border: 1px solid rgba(142, 222, 200, 0.17);
  border-radius: 14px;
  background: rgba(3, 21, 18, 0.53);
  color: var(--text);
}
.field-label > input { padding: 0 13px; }
.field-label input { outline: 0; }
.field-label > input:focus, .input-suffix:focus-within, .won-input:focus-within { border-color: rgba(95, 240, 196, 0.58); box-shadow: 0 0 0 3px rgba(95, 240, 196, 0.07); }
.input-suffix, .won-input { display: flex; align-items: center; overflow: hidden; }
.input-suffix input, .won-input input { width: 100%; min-width: 0; height: 48px; padding: 0 8px 0 13px; border: 0; background: transparent; color: var(--text); }
.input-suffix span { padding-right: 13px; color: var(--muted); font-size: 0.75rem; }
.won-input span { padding-left: 14px; color: var(--mint); font-weight: 900; }
.won-input input { font-size: 1.45rem; font-weight: 900; text-align: right; }
.price-field { margin-top: 2px; }
.form-error { margin: -2px 0 12px; color: #ff9ba1; font-size: 0.68rem; line-height: 1.45; }

.primary-button, .secondary-button, .danger-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  border-radius: 15px;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}
.primary-button { width: 100%; border: 0; background: linear-gradient(180deg, var(--mint-bright), #42dbae); color: #063128; box-shadow: 0 12px 24px rgba(32, 196, 148, 0.22), inset 0 1px 0 rgba(255,255,255,0.55); }
.primary-button:disabled { opacity: 0.55; cursor: wait; }
.secondary-button { flex: 1; border: 1px solid var(--line); background: rgba(111, 157, 143, 0.09); color: var(--text-soft); }
.danger-button { flex: 1; border: 1px solid rgba(255, 116, 124, 0.23); background: rgba(255, 116, 124, 0.13); color: #ffadb2; }

.dialog-layer { align-items: center; padding: 18px; }
.confirm-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 350px;
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 23px;
  background: linear-gradient(145deg, #153b34, #09241f);
  text-align: center;
  box-shadow: 0 28px 68px rgba(0, 7, 6, 0.58), inset 0 1px 0 rgba(255,255,255,0.05);
  animation: dialog-in 0.2s ease both;
}
@keyframes dialog-in { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confirm-card .confirm-icon { margin: 0 auto; width: 43px; height: 43px; border-radius: 14px; font-size: 1rem; }
.confirm-card h2 { margin: 14px 0 7px; font-size: 1.04rem; }
.confirm-card p { margin: 0; color: var(--muted); font-size: 0.7rem; line-height: 1.5; }
.dialog-actions { display: flex; gap: 9px; margin-top: 19px; }

.toast-region { position: fixed; z-index: 120; left: 50%; bottom: calc(92px + var(--safe-bottom)); display: flex; width: min(calc(100% - 30px), 480px); transform: translateX(-50%); flex-direction: column; gap: 7px; pointer-events: none; }
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid rgba(145, 232, 208, 0.23);
  border-radius: 15px;
  background: rgba(13, 43, 37, 0.96);
  color: var(--text-soft);
  box-shadow: 0 18px 35px rgba(0, 8, 7, 0.48);
  backdrop-filter: blur(15px);
  font-size: 0.72rem;
  font-weight: 750;
  animation: toast-in 0.22s ease both;
}
.toast::before { content: "✓"; display: grid; width: 24px; height: 24px; place-items: center; border-radius: 8px; background: rgba(95, 240, 196, 0.13); color: var(--mint); }
.toast.error { border-color: rgba(255, 116, 124, 0.25); }
.toast.error::before { content: "!"; background: rgba(255, 116, 124, 0.12); color: #ff9ca2; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 580px) {
  .main-content { padding-left: 22px; padding-right: 22px; }
  .hero-card { min-height: 320px; }
  .hero-content { min-height: 320px; padding: 30px; }
  .summary-grid { gap: 12px; }
  .ingredient-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 370px) {
  .app-header { padding-left: 13px; padding-right: 13px; }
  .main-content { padding-left: 12px; padding-right: 12px; }
  .brand-copy small { display: none; }
  .hero-content { padding-left: 18px; }
  .hero-content h1 { font-size: 1.72rem; }
  .summary-tile { padding: 12px 9px; }
  .realtime-panel { align-items: flex-start; flex-direction: column; }
  .realtime-panel > small { text-align: left; }
  .comparison-panel { align-items: flex-start; flex-direction: column; }
  .mini-button { width: 100%; }
  .field-grid.two { grid-template-columns: 1fr; gap: 0; }
  .search-option { grid-template-columns: minmax(0, 1fr) auto; }
  .option-add { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
