:root {
  --navy-950: #000814;
  --navy-900: #00122e;
  --navy-850: #001a3d;
  --navy-800: #00224f;
  --white: #ffffff;
  --soft-white: #f4f8fb;
  --ice-blue: #78cdff;
  --text-dark: #07182f;
  --muted: rgba(255,255,255,0.76);
  --shadow: 0 24px 70px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--navy-950);
  color: var(--white);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden { display: none !important; }

.splash-screen {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(50, 118, 200, 0.30), transparent 34%),
    linear-gradient(180deg, var(--navy-950), var(--navy-850) 55%, var(--navy-950));
  display: grid;
  place-items: center;
  overflow: hidden;
  z-index: 1000;
}

.splash-logo {
  width: min(62vw, 520px);
  position: absolute;
  top: 36%;
  filter: drop-shadow(0 0 18px rgba(255,255,255,0.14));
}

.storage-title {
  position: absolute;
  top: calc(36% + 145px);
  right: 18%;
  color: var(--ice-blue);
  font-weight: 800;
  font-size: clamp(2.3rem, 8vw, 4.8rem);
  letter-spacing: 0.02em;
  text-shadow: 0 0 22px rgba(120,205,255,0.22);
}

.logo-slide-in {
  animation: logoEnter 2.1s cubic-bezier(.16,1,.3,1) both;
}

.storage-slide-in {
  animation: storageEnter 2.3s cubic-bezier(.16,1,.3,1) .55s both;
}

@keyframes logoEnter {
  from { transform: translateX(-115vw); opacity: 0; }
  22% { opacity: 1; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes storageEnter {
  from { transform: translateX(115vw); opacity: 0; }
  22% { opacity: 1; }
  to { transform: translateX(0); opacity: 1; }
}

.wave-layer {
  position: absolute;
  left: -12%;
  right: -12%;
  bottom: 7%;
  height: 32%;
  opacity: 0.68;
  background:
    radial-gradient(ellipse at 52% 55%, rgba(65, 143, 230, 0.18), transparent 52%),
    repeating-radial-gradient(ellipse at 44% 58%, rgba(97, 170, 255, 0.07) 0 1px, transparent 2px 10px);
  filter: blur(0.4px);
  clip-path: ellipse(70% 34% at 50% 62%);
  animation: waveFloat 5s ease-in-out infinite alternate;
}

@keyframes waveFloat {
  from { transform: translateX(-2%) translateY(2%); }
  to { transform: translateX(2%) translateY(-2%); }
}

.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 28%, rgba(45, 110, 190, 0.22), transparent 34%),
    linear-gradient(180deg, var(--navy-950), var(--navy-850) 48%, var(--navy-950));
}

.main-screen {
  position: relative;
  min-height: 100vh;
  padding: env(safe-area-inset-top) 22px 76px;
  overflow: hidden;
}

.main-screen::after {
  content: "";
  position: fixed;
  left: -12%;
  right: -12%;
  bottom: 3%;
  height: 24%;
  opacity: 0.28;
  background:
    radial-gradient(ellipse at center, rgba(64,142,230,0.18), transparent 56%),
    repeating-radial-gradient(ellipse at center, rgba(90,165,255,0.065) 0 1px, transparent 2px 10px);
  pointer-events: none;
  filter: blur(0.6px);
}

.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 64px;
  position: relative;
  z-index: 3;
}

.hamburger {
  width: 48px;
  height: 48px;
  display: grid;
  place-content: center;
  gap: 5px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.hamburger span {
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: var(--white);
  display: block;
}

.main-logo {
  display: block;
  width: min(70vw, 390px);
  margin: 28px auto 72px;
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.12));
}

.page {
  display: none;
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: 0 auto;
  animation: pageIn .25s ease both;
}

.page-active { display: block; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-block {
  margin: 0 0 28px;
}

.search-block label,
.form-card label {
  display: block;
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 650;
  margin-bottom: 10px;
}

input, textarea, select {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 17px 18px;
  background: var(--white);
  color: var(--text-dark);
  font-size: 1rem;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04), 0 10px 28px rgba(0,0,0,0.12);
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(120,205,255,0.38), 0 10px 28px rgba(0,0,0,0.12);
}

.archive-info {
  color: var(--muted);
  font-size: .88rem;
  margin: 6px 0 18px;
}

.results {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.result-card {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.96);
  color: var(--text-dark);
  padding: 16px;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}

.result-code {
  font-weight: 800;
  color: var(--navy-800);
  margin-bottom: 4px;
}

.result-desc {
  margin-bottom: 8px;
}

.result-location {
  display: inline-block;
  color: var(--navy-950);
  font-weight: 800;
  background: rgba(120,205,255,0.28);
  padding: 6px 10px;
  border-radius: 999px;
}

.no-results {
  color: var(--muted);
  border: 1px dashed rgba(255,255,255,.22);
  padding: 16px;
  border-radius: 18px;
}

h1 {
  font-size: clamp(1.7rem, 6vw, 2.7rem);
  margin: 24px 0 8px;
}

.page-intro {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 24px;
}

.form-card {
  display: grid;
  gap: 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 24px;
  padding: 20px;
  backdrop-filter: blur(12px);
}

.primary-btn {
  border: 0;
  border-radius: 18px;
  padding: 16px 18px;
  background: var(--white);
  color: var(--navy-900);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0,0,0,.16);
}

.primary-btn:active {
  transform: translateY(1px);
}

.help-card {
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.13);
  padding: 18px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.help-card h2 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  color: var(--ice-blue);
}

.help-card p {
  margin: 0;
  color: rgba(255,255,255,0.86);
  line-height: 1.55;
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(84vw, 340px);
  background: rgba(255,255,255,0.98);
  color: var(--text-dark);
  z-index: 20;
  transform: translateX(104%);
  transition: transform .28s cubic-bezier(.16,1,.3,1);
  box-shadow: var(--shadow);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  background: linear-gradient(180deg, var(--navy-850), var(--navy-950));
  border-radius: 24px;
  padding: 18px;
  margin-bottom: 18px;
}

.drawer-logo {
  width: 190px;
  max-width: 100%;
  display: block;
}

.drawer-subtitle {
  color: var(--ice-blue);
  font-weight: 800;
  font-size: 1.15rem;
  margin-top: 4px;
  text-align: right;
}

.drawer-nav {
  display: grid;
  gap: 8px;
}

.drawer-item {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 14px 12px;
  border-radius: 14px;
  color: var(--text-dark);
  font-weight: 750;
  font-size: 1rem;
  cursor: pointer;
}

.drawer-item:hover,
.drawer-item.active {
  background: rgba(0,34,79,.10);
}

.drawer-note {
  margin-top: auto;
  border-top: 1px solid rgba(7,24,47,.14);
  padding-top: 14px;
  font-size: .82rem;
  color: rgba(7,24,47,.72);
  line-height: 1.35;
}

.drawer-note strong {
  display: block;
  color: var(--navy-900);
  margin-bottom: 4px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 15;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.footer {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 3;
  color: rgba(255,255,255,0.78);
  font-size: .72rem;
  text-align: center;
}

@media (min-width: 760px) {
  .main-screen {
    padding-left: 40px;
    padding-right: 40px;
  }

  .main-logo {
    margin-top: 10px;
  }
}


.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.result-department {
  display: inline-block;
  color: var(--white);
  font-weight: 850;
  background: var(--navy-800);
  padding: 6px 10px;
  border-radius: 999px;
}


.result-department-main {
  display: inline-block;
  width: fit-content;
  margin-bottom: 12px;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}


.result-label {
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: rgba(7, 24, 47, 0.65);
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.result-location-lines {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}

.result-location-lines div {
  display: inline-block;
  width: fit-content;
  color: var(--navy-950);
  font-weight: 850;
  background: rgba(120,205,255,0.28);
  padding: 7px 10px;
  border-radius: 999px;
}

.etik-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.etik-meta span {
  background: rgba(0,34,79,.08);
  color: var(--navy-900);
  border: 1px solid rgba(0,34,79,.12);
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 750;
  font-size: .84rem;
}

.shelf-card {
  margin-top: 16px;
  background: #eaf3fb;
  border: 1px solid rgba(0,34,79,.14);
  border-radius: 20px;
  padding: 14px;
  color: var(--text-dark);
}

.shelf-summary {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
}

.shelf-summary strong {
  color: var(--navy-900);
}

.shelf-summary span {
  color: rgba(7,24,47,.72);
  font-size: .9rem;
}

.shelf-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.shelf-tab {
  border: 0;
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(0,34,79,.10);
  color: var(--navy-900);
  font-weight: 850;
  cursor: pointer;
}

.shelf-tab.active {
  background: var(--navy-800);
  color: white;
}

.shelf-map-wrap {
  background: #d7ecfb;
  border-radius: 16px;
  padding: 12px;
  border: 2px solid rgba(0,34,79,.22);
}

.shelf-hidden {
  display: none;
}

.shelf-title {
  font-weight: 900;
  color: var(--navy-900);
  margin-bottom: 10px;
}

.shelf-scroll {
  overflow: auto;
  max-height: 440px;
  border-radius: 12px;
  background: #f4f8fb;
  border: 2px solid rgba(0,0,0,.72);
}

.shelf-grid {
  min-width: 820px;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(58px, 1fr));
  gap: 0;
}

.shelf-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #b8ce8f;
  border: 1px solid rgba(0,0,0,.46);
  color: #07182f;
  font-weight: 900;
  text-align: center;
  padding: 8px 4px;
  font-size: .78rem;
}

.shelf-cell {
  height: 30px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,.32);
  display: grid;
  place-items: center;
  font-size: .74rem;
  color: rgba(7,24,47,.68);
}

.shelf-cell:nth-child(24n + 13),
.shelf-cell:nth-child(24n + 14),
.shelf-cell:nth-child(24n + 15),
.shelf-cell:nth-child(24n + 16),
.shelf-cell:nth-child(24n + 17),
.shelf-cell:nth-child(24n + 18),
.shelf-cell:nth-child(24n + 19),
.shelf-cell:nth-child(24n + 20),
.shelf-cell:nth-child(24n + 21),
.shelf-cell:nth-child(24n + 22),
.shelf-cell:nth-child(24n + 23),
.shelf-cell:nth-child(24n + 24) {
  background: #f8fbff;
}

.shelf-cell.found {
  background: #ffe84a;
  color: #07182f;
  font-weight: 950;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.35), 0 0 0 3px rgba(255,232,74,.32);
}

@media (max-width: 520px) {
  .shelf-scroll {
    max-height: 380px;
  }
  .shelf-grid {
    min-width: 760px;
  }
}


.form-card input::placeholder,
.form-card textarea::placeholder {
  color: rgba(7, 24, 47, 0.34);
}


/* FINAL OVERRIDES - Scanreco Storage */
.archive-info {
  display: none !important;
}

.main-logo {
  margin-bottom: 8px !important;
}

.home-storage-title {
  text-align: center;
  color: var(--ice-blue);
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  margin: 0 auto 66px;
  text-shadow: 0 0 18px rgba(120,205,255,0.24);
}

.drawer {
  padding-top: 20px;
}

.drawer-title-small {
  color: var(--navy-900);
  font-weight: 900;
  font-size: 1.45rem;
  padding: 8px 12px 18px;
  border-bottom: 1px solid rgba(7,24,47,.10);
  margin-bottom: 12px;
}

.drawer-header,
.drawer-logo,
.drawer-subtitle {
  display: none !important;
}

.result-label {
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: rgba(7, 24, 47, 0.65);
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.result-location-lines {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}

.result-location-lines div {
  display: inline-block;
  width: fit-content;
  color: var(--navy-950);
  font-weight: 850;
  background: rgba(120,205,255,0.28);
  padding: 7px 10px;
  border-radius: 999px;
}

.etik-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.etik-meta span {
  background: rgba(0,34,79,.08);
  color: var(--navy-900);
  border: 1px solid rgba(0,34,79,.12);
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 750;
  font-size: .84rem;
}

/* Hide older grid shelf styles if present */
.shelf-card {
  display: none;
}

/* Realistic shelf */
.real-shelf-card {
  margin-top: 18px;
  padding: 16px;
  border-radius: 24px;
  background: linear-gradient(180deg, #eef7ff 0%, #d8ebf8 100%);
  border: 1px solid rgba(0, 34, 79, .13);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), 0 18px 38px rgba(0,0,0,.12);
}

.shelf-summary {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.shelf-summary strong {
  color: var(--navy-900);
  font-size: 1.05rem;
}

.shelf-summary span {
  color: rgba(7,24,47,.72);
  font-size: .92rem;
}

.real-shelf-frame {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.22), transparent 28%, rgba(255,255,255,.18)),
    linear-gradient(180deg, #c6d9ea, #9eb8cf);
  border: 3px solid #25364a;
  box-shadow:
    inset 0 0 0 4px rgba(255,255,255,.22),
    inset 0 16px 30px rgba(255,255,255,.18),
    inset 0 -20px 34px rgba(0,0,0,.14);
  padding: 14px;
}

.real-shelf-frame::before,
.real-shelf-frame::after {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 28px;
  width: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #1b2635, #52657a, #1b2635);
  opacity: .72;
  z-index: 1;
}

.real-shelf-frame::before { left: 10px; }
.real-shelf-frame::after { right: 10px; }

.real-shelf-title {
  position: relative;
  z-index: 2;
  display: inline-block;
  margin: 0 0 12px 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #001a3d;
  color: white;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
}

.real-shelf-scroll {
  position: relative;
  z-index: 2;
  overflow: auto;
  max-height: 510px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255,255,255,.34);
  border: 1px solid rgba(255,255,255,.42);
}

.real-shelf-layout {
  min-width: 1080px;
  display: grid;
  grid-template-columns: repeat(12, minmax(78px, 1fr));
  gap: 10px;
  padding: 4px;
}

.real-column {
  border-radius: 14px;
  background: linear-gradient(180deg, #31465d, #1f2f42);
  border: 2px solid rgba(0,0,0,.48);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.08),
    0 10px 20px rgba(0,0,0,.16);
  overflow: hidden;
}

.real-column.target-column {
  box-shadow:
    inset 0 0 0 2px rgba(255,232,74,.42),
    0 0 0 3px rgba(255,232,74,.22),
    0 10px 20px rgba(0,0,0,.16);
}

.real-column-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: linear-gradient(180deg, #c4d89a, #9ebc70);
  color: #07182f;
  font-size: .78rem;
  font-weight: 950;
  text-align: center;
  padding: 9px 4px;
  border-bottom: 2px solid rgba(0,0,0,.42);
}

.real-column-body {
  display: grid;
  gap: 3px;
  padding: 7px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.10), transparent, rgba(0,0,0,.08)),
    linear-gradient(180deg, #26394e, #172537);
}

.real-slot {
  height: 26px;
  position: relative;
  border-radius: 5px;
  background:
    linear-gradient(180deg, #ffffff, #e8edf2 62%, #d5dde5);
  border: 1px solid rgba(0,0,0,.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.86),
    inset 0 -5px 10px rgba(0,0,0,.07);
  display: grid;
  place-items: center;
  color: rgba(7,24,47,.58);
  font-size: .72rem;
}

.real-slot::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: -3px;
  height: 3px;
  border-radius: 999px;
  background: rgba(0,0,0,.24);
}

.real-slot.found {
  background:
    linear-gradient(180deg, #fff76b, #ffe84a 58%, #e4c916);
  color: #07182f;
  font-weight: 950;
  border-color: rgba(0,0,0,.72);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.42),
    0 0 0 3px rgba(255,232,74,.42),
    0 0 18px rgba(255,232,74,.58);
  transform: scale(1.05);
  z-index: 2;
}

.real-slot.found .slot-label::before {
  content: "● ";
}

.shelf-hint {
  position: relative;
  z-index: 2;
  color: rgba(7,24,47,.66);
  font-size: .78rem;
  margin: 10px 4px 0;
}

@media (max-width: 700px) {
  .real-shelf-layout {
    min-width: 960px;
    grid-template-columns: repeat(12, minmax(68px, 1fr));
    gap: 8px;
  }
  .real-slot {
    height: 24px;
  }
  .real-shelf-scroll {
    max-height: 430px;
  }
}


/* COMPACT SHELF OVERRIDES */
.real-shelf-card {
  max-width: 100%;
  padding: 12px;
}

.real-shelf-frame {
  padding: 10px;
}

.real-shelf-scroll {
  max-height: min(62vh, 620px);
  overflow: auto;
}

.real-shelf-layout {
  min-width: 0 !important;
  width: 100%;
  grid-template-columns: repeat(12, minmax(42px, 1fr)) !important;
  gap: 5px !important;
}

.real-column {
  border-radius: 10px;
  border-width: 1px;
}

.real-column-head {
  font-size: clamp(0.48rem, 0.72vw, 0.72rem);
  padding: 6px 2px;
  white-space: nowrap;
}

.real-column-body {
  gap: 2px;
  padding: 4px;
}

.real-slot {
  height: clamp(13px, 1.55vw, 22px);
  min-height: 13px;
  border-radius: 3px;
  font-size: clamp(0.46rem, 0.7vw, 0.68rem);
}

.real-slot::after {
  left: 3px;
  right: 3px;
  bottom: -2px;
  height: 2px;
}

.real-slot.found {
  transform: scale(1.08);
}

.shelf-hint {
  font-size: .72rem;
}

@media (min-width: 900px) {
  .page {
    max-width: 1120px;
  }

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

  .real-shelf-scroll {
    overflow: hidden;
  }
}

@media (max-width: 899px) {
  .real-shelf-layout {
    min-width: 780px !important;
    width: 780px;
    grid-template-columns: repeat(12, minmax(54px, 1fr)) !important;
    gap: 6px !important;
  }

  .real-shelf-scroll {
    overflow: auto;
    max-height: 430px;
  }

  .real-slot {
    height: 22px;
    font-size: .64rem;
  }
}

@media (max-width: 520px) {
  .real-shelf-layout {
    min-width: 720px !important;
    width: 720px;
  }

  .real-shelf-scroll {
    max-height: 380px;
  }
}


/* FULL SHELF OVERRIDES - no internal vertical scroll */
.real-shelf-card {
  padding: 12px;
}

.real-shelf-frame {
  padding: 10px;
}

.real-shelf-scroll {
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
}

.real-shelf-layout {
  min-width: 0 !important;
  width: 100% !important;
  grid-template-columns: repeat(12, minmax(38px, 1fr)) !important;
  gap: 4px !important;
}

.real-column {
  border-radius: 9px;
  border-width: 1px;
}

.real-column-head {
  font-size: clamp(0.42rem, 0.66vw, 0.66rem) !important;
  padding: 5px 1px !important;
  white-space: nowrap;
}

.real-column-body {
  gap: 1px !important;
  padding: 3px !important;
}

.real-slot {
  height: clamp(10px, 1.05vw, 15px) !important;
  min-height: 10px !important;
  border-radius: 2px !important;
  font-size: clamp(0.34rem, 0.52vw, 0.52rem) !important;
}

.real-slot::after {
  display: none !important;
}

.real-slot.found {
  transform: scale(1.06);
}

.shelf-hint {
  display: none !important;
}

@media (min-width: 900px) {
  .page {
    max-width: 1240px !important;
  }

  .real-shelf-scroll {
    overflow: visible !important;
  }
}

@media (max-width: 899px) {
  .real-shelf-scroll {
    overflow-x: auto !important;
    overflow-y: visible !important;
    max-height: none !important;
  }

  .real-shelf-layout {
    min-width: 780px !important;
    width: 780px !important;
    grid-template-columns: repeat(12, minmax(54px, 1fr)) !important;
  }

  .real-slot {
    height: 15px !important;
    font-size: .52rem !important;
  }
}

@media (max-width: 520px) {
  .real-shelf-layout {
    min-width: 720px !important;
    width: 720px !important;
  }

  .real-slot {
    height: 14px !important;
    font-size: .48rem !important;
  }
}


/* SECTIONAL SHELF - MOBILE FIRST */
.real-shelf-card {
  padding: 10px !important;
  border-radius: 20px !important;
}

.real-shelf-frame {
  padding: 8px !important;
  border-width: 2px !important;
  border-radius: 18px !important;
}

.real-shelf-title {
  margin: 0 0 8px 6px !important;
  padding: 7px 12px !important;
  font-size: .92rem !important;
}

.real-shelf-scroll {
  max-height: none !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.real-shelf-layout.sectional-shelf {
  width: 100% !important;
  min-width: 860px !important;
  grid-template-columns: repeat(12, minmax(58px, 1fr)) !important;
  gap: 5px !important;
  align-items: stretch;
}

.real-column {
  border-radius: 9px !important;
  border-width: 1px !important;
}

.real-column.column-group-break {
  margin-right: 7px;
  position: relative;
}

.real-column.column-group-break::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #111a25, #6b7f92 50%, #111a25);
  box-shadow: 0 0 4px rgba(0,0,0,.28);
}

.real-column-head {
  font-size: .55rem !important;
  padding: 5px 1px !important;
  white-space: nowrap;
}

.real-column-body {
  display: grid !important;
  gap: 5px !important;
  padding: 4px !important;
  background:
    linear-gradient(90deg, rgba(255,255,255,.10), transparent, rgba(0,0,0,.08)),
    linear-gradient(180deg, #26394e, #172537) !important;
}

.real-section {
  position: relative;
  display: grid;
  gap: 1px;
  padding: 3px;
  border-radius: 6px;
  background: rgba(0,0,0,.30);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.real-section.group-small {
  grid-template-rows: repeat(10, 1fr);
}

.real-section.group-large {
  grid-template-rows: repeat(5, 1fr);
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.18);
}

.real-section.group-base {
  grid-template-rows: 1fr;
  background: rgba(0,0,0,.38);
  border-color: rgba(255,255,255,.22);
  margin-top: 2px;
}

.real-section + .real-section {
  margin-top: 4px;
}

.real-section + .real-section::before {
  content: "";
  position: absolute;
  top: -7px;
  left: -4px;
  right: -4px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #111a25, #566a7f 55%, #111a25);
  box-shadow: 0 1px 2px rgba(0,0,0,.35);
}

.real-slot {
  height: 12px !important;
  min-height: 12px !important;
  border-radius: 2px !important;
  font-size: .42rem !important;
  background:
    linear-gradient(180deg, #ffffff, #e8edf2 62%, #d5dde5) !important;
  border: 1px solid rgba(0,0,0,.24) !important;
}

.real-slot.slot-large {
  height: 19px !important;
  min-height: 19px !important;
}

.real-slot.slot-base {
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 4px !important;
}

.real-slot::after {
  display: none !important;
}

.real-slot.found {
  background:
    linear-gradient(180deg, #fff76b, #ffe84a 58%, #e4c916) !important;
  color: #07182f !important;
  font-weight: 950 !important;
  transform: scale(1.10) !important;
  z-index: 4 !important;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.42),
    0 0 0 3px rgba(255,232,74,.42),
    0 0 18px rgba(255,232,74,.62) !important;
}

.shelf-hint {
  display: none !important;
}

@media (min-width: 900px) {
  .page {
    max-width: 1240px !important;
  }

  .real-shelf-layout.sectional-shelf {
    min-width: 0 !important;
    width: 100% !important;
    grid-template-columns: repeat(12, minmax(42px, 1fr)) !important;
    gap: 4px !important;
  }

  .real-column.column-group-break {
    margin-right: 8px;
  }

  .real-column-head {
    font-size: clamp(.42rem, .62vw, .64rem) !important;
  }

  .real-slot {
    height: clamp(9px, .78vw, 12px) !important;
    min-height: 9px !important;
    font-size: clamp(.30rem, .45vw, .48rem) !important;
  }

  .real-slot.slot-large {
    height: clamp(15px, 1.10vw, 20px) !important;
  }

  .real-slot.slot-base {
    height: clamp(28px, 2.00vw, 38px) !important;
  }

  .real-shelf-scroll {
    overflow-x: hidden !important;
  }
}

@media (max-width: 520px) {
  .real-shelf-card {
    margin-left: -8px;
    margin-right: -8px;
  }

  .real-shelf-layout.sectional-shelf {
    min-width: 760px !important;
    grid-template-columns: repeat(12, minmax(50px, 1fr)) !important;
    gap: 4px !important;
  }

  .real-column-head {
    font-size: .48rem !important;
  }

  .real-slot {
    height: 10px !important;
    min-height: 10px !important;
    font-size: .35rem !important;
  }

  .real-slot.slot-large {
    height: 16px !important;
  }

  .real-slot.slot-base {
    height: 28px !important;
  }
}


/* FOOTER CORRETTO - non sovrapposto ai risultati */
.main-screen {
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  padding-bottom: 18px !important;
}

.page {
  flex: 1 0 auto;
  width: 100%;
}

.footer {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 3;
  margin-top: auto !important;
  padding: 26px 12px 8px !important;
  color: rgba(255,255,255,0.78);
  font-size: .72rem;
  text-align: center;
}


/* SPLASH SCINTILLA / BORDI ILLUMINATI */
.splash-brand-shine {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.splash-brand-shine::before {
  content: "";
  position: absolute;
  top: 30%;
  left: -45%;
  width: 34%;
  height: 34%;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255,255,255,.95) 0%, rgba(150,220,255,.58) 24%, rgba(120,205,255,.18) 46%, transparent 72%);
  filter: blur(10px);
  transform: rotate(-16deg);
  opacity: 0;
  animation: logoSweep 3.25s cubic-bezier(.16,1,.3,1) .85s both;
  mix-blend-mode: screen;
}

.splash-brand-shine::after {
  content: "";
  position: absolute;
  top: 30%;
  left: -35%;
  width: 18%;
  height: 28%;
  background: linear-gradient(105deg, transparent 0%, rgba(255,255,255,.0) 35%, rgba(255,255,255,.95) 50%, rgba(120,205,255,.15) 60%, transparent 100%);
  filter: blur(2px);
  transform: skewX(-18deg);
  opacity: 0;
  animation: edgeFlash 3.35s cubic-bezier(.16,1,.3,1) .98s both;
  mix-blend-mode: screen;
}

@keyframes logoSweep {
  0%, 42% {
    opacity: 0;
    transform: translateX(0) rotate(-16deg) scale(.85);
  }
  52% {
    opacity: .95;
  }
  78% {
    opacity: .72;
  }
  100% {
    opacity: 0;
    transform: translateX(185vw) rotate(-16deg) scale(1.05);
  }
}

@keyframes edgeFlash {
  0%, 44% {
    opacity: 0;
    transform: translateX(0) skewX(-18deg);
  }
  55% {
    opacity: .92;
  }
  82% {
    opacity: .38;
  }
  100% {
    opacity: 0;
    transform: translateX(180vw) skewX(-18deg);
  }
}

.splash-logo {
  animation:
    logoEnter 2.1s cubic-bezier(.16,1,.3,1) both,
    logoGlowPulse 1.25s ease 2.05s both !important;
}

.storage-title {
  animation:
    storageEnter 2.3s cubic-bezier(.16,1,.3,1) .55s both,
    storageGlowPulse 1.25s ease 2.25s both !important;
}

@keyframes logoGlowPulse {
  0% {
    filter: drop-shadow(0 0 18px rgba(255,255,255,0.14));
  }
  38% {
    filter:
      drop-shadow(0 0 10px rgba(255,255,255,.65))
      drop-shadow(0 0 28px rgba(120,205,255,.48));
  }
  100% {
    filter: drop-shadow(0 0 18px rgba(255,255,255,0.16));
  }
}

@keyframes storageGlowPulse {
  0% {
    text-shadow: 0 0 22px rgba(120,205,255,0.22);
  }
  38% {
    text-shadow:
      0 0 8px rgba(255,255,255,.92),
      0 0 24px rgba(120,205,255,.78),
      0 0 44px rgba(120,205,255,.35);
  }
  100% {
    text-shadow: 0 0 22px rgba(120,205,255,0.28);
  }
}

.spark {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow:
    0 0 8px rgba(255,255,255,.95),
    0 0 18px rgba(120,205,255,.80),
    0 0 34px rgba(120,205,255,.42);
  opacity: 0;
  z-index: 20;
}

.spark::before,
.spark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(255,255,255,.95);
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.spark::before {
  width: 34px;
  height: 2px;
}

.spark::after {
  width: 2px;
  height: 34px;
}

.spark-1 {
  top: 36%;
  left: 36%;
  animation: sparkPop .58s ease 2.42s both;
}

.spark-2 {
  top: 38%;
  left: 63%;
  animation: sparkPop .55s ease 2.62s both;
}

.spark-3 {
  top: 49%;
  left: 70%;
  animation: sparkPop .62s ease 2.82s both;
}

@keyframes sparkPop {
  0% {
    opacity: 0;
    transform: scale(.25) rotate(0deg);
  }
  28% {
    opacity: 1;
    transform: scale(1.05) rotate(35deg);
  }
  100% {
    opacity: 0;
    transform: scale(.45) rotate(90deg);
  }
}


/* ANDROID MOBILE FIX - no visual clipping */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.app-shell,
.main-screen {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.main-screen {
  padding-left: max(16px, env(safe-area-inset-left)) !important;
  padding-right: max(16px, env(safe-area-inset-right)) !important;
  padding-top: max(12px, env(safe-area-inset-top)) !important;
}

.result-card,
.real-shelf-card {
  max-width: 100%;
  overflow: hidden;
}

/* On phones: show a focused 3-column shelf group instead of cutting the full shelf */
@media (max-width: 700px) {
  .real-shelf-scroll {
    overflow-x: auto !important;
    overflow-y: visible !important;
    max-width: 100% !important;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .real-shelf-layout,
  .real-shelf-layout.sectional-shelf {
    width: max-content !important;
    min-width: 0 !important;
    grid-template-columns: repeat(12, 54px) !important;
    gap: 5px !important;
    padding-right: 10px;
  }

  .real-column {
    width: 54px !important;
    min-width: 54px !important;
    scroll-snap-align: start;
  }

  .real-column-head {
    font-size: 0.47rem !important;
    padding: 5px 1px !important;
  }

  .real-column-body {
    padding: 3px !important;
    gap: 4px !important;
  }

  .real-section {
    padding: 2px !important;
    gap: 1px !important;
  }

  .real-slot {
    height: 10px !important;
    min-height: 10px !important;
    font-size: 0.34rem !important;
  }

  .real-slot.slot-large {
    height: 15px !important;
  }

  .real-slot.slot-base {
    height: 27px !important;
  }

  .real-shelf-frame {
    padding: 8px !important;
  }

  .real-shelf-title {
    font-size: .9rem !important;
  }
}

/* make found cell more visible on phone */
.real-slot.found {
  outline: 2px solid rgba(255, 232, 74, .95);
}
