:root {
  --ink: #17323a;
  --muted: #63777b;
  --ice: #eaf8f8;
  --aqua: #b9e5e7;
  --deep-aqua: #246f77;
  --coral: #e56f59;
  --cream: #fffdf7;
  --line: rgba(23, 50, 58, 0.12);
  --shadow: 0 18px 50px rgba(35, 102, 109, 0.13);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  background:
    radial-gradient(circle at 8% 8%, rgba(255,255,255,.95) 0 5%, transparent 22%),
    linear-gradient(145deg, #d9f2f3 0%, #f4fbf8 48%, #fff7ea 100%);
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.freezer-shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 52px 0 30px; }
.freezer-header { display: flex; align-items: center; gap: 22px; padding: 14px 4px 34px; }
.brand-mark { flex: 0 0 auto; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 24px; color: white; background: var(--deep-aqua); font-size: 2.5rem; box-shadow: 0 12px 30px rgba(36,111,119,.22); transform: rotate(-4deg); }
.kicker, .step { margin: 0 0 7px; color: var(--deep-aqua); font-weight: 700; font-size: .75rem; letter-spacing: .15em; text-transform: uppercase; }
h1, h2, h3 { font-family: "Fredoka", sans-serif; }
h1 { margin: 0; font-size: clamp(2.35rem, 7vw, 4.6rem); line-height: .98; letter-spacing: -.035em; }
.intro { margin: 13px 0 0; color: var(--muted); font-size: 1.05rem; }
.add-panel { position: relative; overflow: hidden; padding: 26px; border: 1px solid rgba(255,255,255,.8); border-radius: 28px; background: rgba(255,255,255,.72); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.panel-heading, .inventory-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.panel-heading h2, .inventory-heading h2 { margin: 0; font-size: 1.75rem; }
.snow-dots { color: #79bdc3; letter-spacing: .45rem; font-size: 1.3rem; }
.add-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(140px, 1fr) auto; align-items: end; gap: 14px; margin-top: 22px; }
.field { display: grid; gap: 8px; min-width: 0; }
.field span { font-size: .84rem; font-weight: 700; color: var(--muted); }
input { width: 100%; min-height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: var(--cream); outline: none; }
select { width: 100%; min-height: 52px; padding: 0 42px 0 16px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: var(--cream); outline: none; }
input:focus, select:focus { border-color: #62aab1; box-shadow: 0 0 0 4px rgba(98,170,177,.15); }
.add-button { min-height: 52px; padding: 0 20px; border: 0; border-radius: 15px; color: white; background: var(--coral); font-weight: 700; cursor: pointer; box-shadow: 0 9px 18px rgba(229,111,89,.24); transition: transform .15s, box-shadow .15s; white-space: nowrap; }
.add-button:hover { transform: translateY(-2px); box-shadow: 0 12px 22px rgba(229,111,89,.3); }
.add-button:disabled { opacity: .55; cursor: wait; }
.form-message { min-height: 20px; margin: 12px 2px 0; font-size: .9rem; font-weight: 600; }
.form-message.success { color: #327c62; } .form-message.error { color: #b84236; }
.inventory { padding: 50px 2px 30px; }
.count-pill, .quantity-badge { display: inline-flex; align-items: center; border-radius: 999px; font-weight: 700; }
.count-pill { padding: 8px 13px; color: var(--deep-aqua); background: rgba(255,255,255,.7); font-size: .86rem; border: 1px solid var(--line); }
.freezer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.freezer-card { position: relative; min-width: 0; overflow: hidden; padding: 18px; border: 1px solid rgba(255,255,255,.92); border-radius: 24px; background: rgba(255,253,247,.82); box-shadow: 0 12px 28px rgba(39,91,97,.1); transition: transform .2s, opacity .2s; }
.freezer-card:hover { transform: translateY(-3px); }
.freezer-card.removing { opacity: .35; transform: scale(.97); }
.illustration-wrap { display: grid; place-items: center; height: 180px; border-radius: 18px; background: linear-gradient(145deg, #dff5f4, #f7faf0); }
.illustration-wrap.emoji-fallback { font-size: 6rem; line-height: 1; }
.item-illustration { width: 126px; height: 126px; object-fit: contain; filter: drop-shadow(0 8px 8px rgba(24,55,62,.12)); }
.card-actions { position: absolute; z-index: 1; top: 27px; right: 27px; display: flex; gap: 7px; }
.image-button, .edit-button, .delete-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid rgba(23,50,58,.09); border-radius: 50%; color: #536d71; background: rgba(255,255,255,.92); font-size: 1.25rem; line-height: 1; cursor: pointer; transition: color .15s, background .15s, transform .15s; }
.image-button:hover { color: white; background: #639fca; transform: rotate(5deg); }
.edit-button:hover { color: white; background: var(--deep-aqua); transform: rotate(-5deg); }
.delete-button:hover { color: white; background: var(--coral); transform: rotate(5deg); }
.card-copy { padding: 17px 3px 2px; }
.item-title { overflow-wrap: anywhere; margin: 0; font-size: 1.35rem; line-height: 1.1; }
.item-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.quantity-badge { max-width: 48%; padding: 6px 10px; color: #25626a; background: #d8f0ee; font-size: .8rem; overflow-wrap: anywhere; }
.logged-date { color: var(--muted); font-size: .76rem; text-align: right; }
.empty-state { margin-top: 22px; padding: 50px 20px; border: 2px dashed rgba(36,111,119,.18); border-radius: 24px; text-align: center; background: rgba(255,255,255,.36); }
.empty-state span { font-size: 3rem; }.empty-state h3 { margin: 10px 0 4px; font-size: 1.4rem; }.empty-state p { margin: 0; color: var(--muted); }
footer { padding: 16px 0 4px; color: var(--muted); font-size: .72rem; text-align: center; } footer a { color: inherit; }
.edit-dialog { width: min(480px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 26px; color: var(--ink); background: var(--cream); box-shadow: 0 28px 80px rgba(20,59,64,.28); }
.edit-dialog::backdrop { background: rgba(20,48,53,.46); backdrop-filter: blur(4px); }
.edit-form { display: grid; gap: 17px; padding: 26px; }
.edit-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.edit-heading h2 { margin: 0; font-size: 1.75rem; }
.dialog-close { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: white; font-size: 1.4rem; cursor: pointer; }
.edit-note { margin: -3px 0 0; color: var(--muted); font-size: .82rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.cancel-button { min-height: 52px; padding: 0 20px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: white; font-weight: 700; cursor: pointer; }

@media (max-width: 760px) {
  .freezer-shell { width: min(100% - 22px, 600px); padding-top: 28px; }
  .freezer-header { align-items: flex-start; gap: 14px; }
  .brand-mark { width: 56px; height: 56px; border-radius: 18px; font-size: 1.8rem; }
  .add-form { grid-template-columns: 1fr 1fr; }
  .item-field { grid-column: 1 / -1; }
  .add-button { align-self: end; }
  .freezer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 500px) {
  .freezer-header { padding-bottom: 24px; }
  .brand-mark { display: none; }
  .add-panel { padding: 20px; border-radius: 22px; }
  .add-form { grid-template-columns: 1fr; }
  .item-field { grid-column: auto; }
  .add-button { width: 100%; }
  .inventory { padding-top: 38px; }
  .freezer-grid { grid-template-columns: 1fr; gap: 14px; }
  .freezer-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 14px; padding: 13px; }
  .illustration-wrap { height: 112px; }
  .illustration-wrap.emoji-fallback { font-size: 4.2rem; }
  .item-illustration { width: 82px; height: 82px; }
  .card-copy { padding: 0 4px 0 0; }
  .card-actions { top: 9px; right: 9px; }
  .item-meta { align-items: flex-start; flex-direction: column; gap: 7px; margin-top: 11px; }
  .quantity-badge { max-width: 100%; }
  .logged-date { text-align: left; }
}
