:root { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #1b1d23; background: #f3f1ec; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { width: 100%; min-width: 100%; touch-action: manipulation; }
body { width: 100%; min-width: 100%; margin: 0; min-height: 100vh; touch-action: manipulation; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button > svg, a > svg { width: 18px; height: 18px; flex: 0 0 auto; stroke-width: 2; }
.primary-button, .secondary-button, .install-button, .admin-access-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button { transform-origin: center; transition: transform .34s cubic-bezier(.2, .9, .2, 1.35), background-color .22s ease, border-color .22s ease, box-shadow .22s ease, opacity .2s ease; }
button.is-pressing { transform: scale(.93); opacity: .88; transition-duration: .1s; }
button.liquid-release { animation: liquid-release .42s cubic-bezier(.2, .9, .2, 1.4); }
button.is-pressing > svg { transform: scale(.88); }
button > svg { transition: transform .34s cubic-bezier(.2, .9, .2, 1.4), rotate .34s cubic-bezier(.2, .9, .2, 1.4); }
button:hover > svg { transform: translateY(-1px); }
@keyframes liquid-release { 0% { transform: scale(.93); } 58% { transform: scale(1.035); } 100% { transform: scale(1); } }
@keyframes glass-present { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes backdrop-present { from { opacity: 0; } to { opacity: 1; } }
.topbar { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 68px; padding: max(12px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left)); background: #17191f; color: #fff; }
.home-link { display: grid; place-items: center; width: 46px; height: 46px; overflow: hidden; border-radius: 14px; background: #fff; color: #fff; font-weight: 900; text-decoration: none; cursor: default; user-select: none; -webkit-user-select: none; }
.home-link img { width: 100%; height: 100%; object-fit: cover; }
.topbar > div { display: grid; gap: 2px; }
.topbar span { color: #aeb1b9; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.topbar strong { font-size: 15px; }
.install-button { min-height: 40px; padding: 0 13px; border: 1px solid #4a4d55; border-radius: 6px; background: transparent; color: #fff; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.admin-access-button { min-height: 40px; padding: 0 13px; border: 1px solid #4a4d55; border-radius: 6px; background: transparent; color: #fff; font-size: 13px; font-weight: 700; }
.app-shell { width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 80px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 7px; color: #a51e2c; font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .12em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(34px, 6vw, 56px); line-height: 1; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 25px; letter-spacing: 0; }
.primary-button, .secondary-button { min-height: 46px; border-radius: 6px; padding: 0 18px; border: 0; font-weight: 750; }
.primary-button { background: #cf2434; color: #fff; }
.primary-button:hover { background: #ae1e2b; }
.secondary-button { border: 1px solid #ccc8bf; background: #fff; color: #25272d; }
.connection-notice { margin: 22px 0 0; padding: 13px 15px; border-left: 4px solid #d09620; background: #fff8e5; line-height: 1.45; }
.reminder-panel { margin-top: 24px; padding: 18px; border: 1px solid #d8d1bd; border-left: 5px solid #d09620; border-radius: 7px; background: #fffaf0; }
.reminder-heading { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; }
.reminder-heading h2 { font-size: 20px; }
.reminder-heading .eyebrow { margin-bottom: 4px; }
.reminder-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 6px; background: #f0dca7; color: #76520a; }
.reminder-list { display: grid; gap: 7px; margin-top: 15px; }
.reminder-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 5px; background: #fff; }
.reminder-dot { width: 8px; height: 8px; border-radius: 50%; background: #d19a18; }
.reminder-item[data-status="expired"] .reminder-dot { background: #c21f30; }
.reminder-item strong { font-size: 14px; }
.reminder-item span:last-child { color: #6b6e75; font-size: 12px; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 28px 0; }
.stats button { display: grid; gap: 5px; min-height: 88px; padding: 13px; text-align: left; border: 1px solid #d8d5ce; border-radius: 7px; background: #fff; color: #1c1e24; }
.stats span { font-size: 28px; font-weight: 850; }
.stats small { color: #6d7078; font-weight: 650; }
.stats button:first-child span { color: #b21e2c; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.filters { --glider-x: 0px; --glider-width: 80px; position: relative; isolation: isolate; display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; }
.filter-glider { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: var(--glider-width); border: 1px solid rgba(255,255,255,.22); border-radius: 18px; background: rgba(28,28,32,.9); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 5px 16px rgba(20,22,27,.24); transform: translateX(var(--glider-x)); transition: transform .48s cubic-bezier(.22, 1.18, .36, 1), width .42s cubic-bezier(.22, 1.18, .36, 1); pointer-events: none; }
.filters button { min-height: 40px; white-space: nowrap; padding: 0 14px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #62656d; font-weight: 700; }
.filters button { position: relative; z-index: 1; }
.filters button.active { background: transparent; color: #fff; }
.search input { width: 250px; min-height: 42px; padding: 0 13px; border: 1px solid #ccc8bf; border-radius: 6px; background: #fff; }
.item-list { display: grid; gap: 9px; }
.item-card { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: center; gap: 17px; padding: 16px; border: 1px solid #d8d5ce; border-left: 5px solid #8b8f98; border-radius: 7px; background: #fff; }
.item-card[data-status="expired"] { border-left-color: #c21f30; }
.item-card[data-status="today"] { border-left-color: #d47b12; }
.item-card[data-status="soon"] { border-left-color: #d4a018; }
.item-card[data-status="ok"] { border-left-color: #348667; }
.item-card[data-status="completed"] { opacity: .7; border-left-color: #8b8f98; }
.date-block { display: grid; place-items: center; min-height: 62px; border-right: 1px solid #e1ded7; }
.date-block strong { font-size: 25px; line-height: 1; }
.date-block span { margin-top: 3px; font-size: 11px; font-weight: 800; text-transform: uppercase; color: #666a72; }
.item-info { min-width: 0; }
.item-title-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.item-title-row h3 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.status-tag { padding: 4px 7px; border-radius: 4px; background: #eeeae3; color: #555861; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.item-meta, .item-note { margin: 6px 0 0; color: #6b6e75; font-size: 13px; }
.item-note { color: #3f4249; }
.actions { display: flex; gap: 7px; }
.actions button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 12px; border: 1px solid #cbc7bf; border-radius: 6px; background: #fff; color: #272930; font-weight: 700; }
.actions .done-button { border-color: #29745a; background: #29745a; color: #fff; }
.actions .delete-button { color: #a91f2c; }
.empty-state { display: grid; place-items: center; gap: 7px; min-height: 220px; padding: 30px; border: 1px dashed #c9c5bc; border-radius: 7px; color: #696c74; text-align: center; }
.empty-state strong { color: #292b31; font-size: 20px; }
dialog { width: min(590px, calc(100% - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: 8px; box-shadow: 0 28px 80px #0005; }
dialog::backdrop { background: #111319aa; backdrop-filter: blur(2px); }
dialog[open] { animation: glass-present .36s cubic-bezier(.22, 1, .36, 1); }
dialog[open]::backdrop { animation: backdrop-present .28s ease-out; }
dialog form { display: grid; gap: 17px; padding: 24px; overflow-y: auto; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #eeeae4; }
label { display: grid; gap: 7px; color: #454850; font-size: 13px; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid #c9c5bc; border-radius: 6px; background: #fff; color: #1e2026; padding: 11px 12px; font-weight: 500; }
input, select { min-height: 46px; }
textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.barcode-field { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; }
.barcode-actions { display: flex; gap: 6px; }
.finder-dialog { width: min(560px, calc(100% - 24px)); padding: 24px; }
.finder-results { display: grid; gap: 7px; max-height: 42vh; margin: 15px 0; overflow-y: auto; }
.finder-result { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; width: 100%; min-height: 62px; padding: 11px 13px; border: 1px solid #d4d0c8; border-radius: 6px; background: #fff; color: #202228; text-align: left; }
.finder-result strong, .finder-result span { display: block; }
.finder-result span { margin-top: 4px; color: #6b6e75; font-size: 12px; }
.finder-result small { color: #a51e2c; font-weight: 800; }
.finder-empty { padding: 30px 10px; color: #6b6e75; text-align: center; }
.full-button { width: 100%; }
.scanner-dialog { padding: 22px; }
.scanner-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 16px; }
.camera-frame { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 7px; background: #111; }
.camera-frame video { width: 100%; height: 100%; object-fit: cover; }
.html5-reader { width: 100%; height: 100%; }
.html5-reader video { width: 100% !important; height: 100% !important; object-fit: cover !important; }
.html5-reader:empty { display: none; }
.camera-frame:has(.html5-reader:not(:empty)) .legacy-video { display: none; }
.html5-reader img, .html5-reader button, .html5-reader select { display: none !important; }
.scan-line { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: #ef3349; box-shadow: 0 0 12px #ef3349; }
.scanner-dialog > p { margin: 14px 0; color: #5f626a; }
.code-dialog { width: min(430px, calc(100% - 24px)); }
.code-error { margin: -5px 0 0; color: #ad1e2b; font-size: 13px; font-weight: 700; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 5px; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 30; transform: translate(-50%, 30px); padding: 12px 16px; border-radius: 6px; background: #17191f; color: #fff; opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.visible { transform: translate(-50%, 0); opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

@supports ((-webkit-backdrop-filter: blur(18px)) or (backdrop-filter: blur(18px))) {
  .topbar {
    background: rgba(23, 25, 31, .82);
    border-bottom: 1px solid rgba(255, 255, 255, .16);
    -webkit-backdrop-filter: saturate(165%) blur(18px);
    backdrop-filter: saturate(165%) blur(18px);
  }
  .admin-access-button, .install-button {
    border-color: rgba(255, 255, 255, .24);
    border-radius: 20px;
    background: rgba(255, 255, 255, .09);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 7px 22px rgba(0, 0, 0, .18);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
  }
  .admin-access-button:hover, .install-button:hover { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .34); }
  .primary-button {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 16px;
    background: rgba(196, 27, 44, .86);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), inset 0 -1px 0 rgba(91, 7, 17, .28), 0 8px 22px rgba(151, 17, 32, .24);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
  }
  .primary-button::before, .admin-access-button::before, .install-button::before {
    content: "";
    position: absolute;
    inset: 1px 12px auto;
    height: 1px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .48);
    pointer-events: none;
  }
  .admin-access-button, .install-button { position: relative; overflow: hidden; }
  .filters {
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 15px;
    background: rgba(255, 255, 255, .5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .96), inset 0 -1px 0 rgba(31, 33, 39, .06), 0 10px 28px rgba(28, 30, 36, .1);
    -webkit-backdrop-filter: saturate(175%) blur(20px);
    backdrop-filter: saturate(175%) blur(20px);
  }
  .filters button { border-radius: 11px; }
  .filters button.active { border-color: transparent; box-shadow: none; }
  .search input {
    border-color: rgba(255, 255, 255, .8);
    background: rgba(255, 255, 255, .58);
    box-shadow: inset 0 1px 0 #fff, 0 6px 20px rgba(28, 30, 36, .07);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    backdrop-filter: saturate(160%) blur(16px);
  }
  .icon-button {
    border: 1px solid rgba(255, 255, 255, .76);
    background: rgba(239, 237, 232, .72);
    box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(30, 32, 38, .08), 0 6px 18px rgba(28, 30, 36, .14);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    backdrop-filter: saturate(160%) blur(18px);
  }
  dialog {
    border: 1px solid rgba(255, 255, 255, .78);
    background: rgba(250, 250, 249, .88);
    box-shadow: inset 0 1px 0 #fff, 0 30px 90px rgba(10, 12, 18, .32);
    -webkit-backdrop-filter: saturate(175%) blur(28px);
    backdrop-filter: saturate(175%) blur(28px);
  }
  .reminder-icon {
    border: 1px solid rgba(255, 255, 255, .72);
    background: rgba(232, 196, 102, .42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75), 0 5px 16px rgba(116, 82, 10, .12);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
}
@media (max-width: 720px) { .app-shell { width: min(100% - 22px, 1040px); padding-top: 28px; } .stats { grid-template-columns: 1fr 1fr; } .toolbar { align-items: stretch; flex-direction: column; } .search input { width: 100%; } .item-card { grid-template-columns: 58px minmax(0, 1fr); gap: 12px; } .actions { grid-column: 1 / -1; } .actions button { flex: 1; } }
@media (max-width: 650px) { .reminder-heading { grid-template-columns: auto 1fr; } .reminder-heading .secondary-button { grid-column: 1 / -1; width: 100%; } }
@media (max-width: 480px) { .admin-access-button { width: 42px; overflow: hidden; padding: 0; } .admin-access-button span { display: none; } .page-heading { align-items: start; } .page-heading .primary-button { width: 46px; overflow: hidden; white-space: nowrap; padding: 0; } .page-heading .primary-button span { display: none; } .field-row { grid-template-columns: 1fr; } .item-card { padding: 13px; } .actions { display: grid; grid-template-columns: 1fr 1fr; } }

@media (max-width: 720px) and (hover: none) {
  @supports ((-webkit-backdrop-filter: blur(16px)) or (backdrop-filter: blur(16px))) {
    .actions {
      padding: 5px;
      border: 1px solid rgba(255, 255, 255, .82);
      border-radius: 12px;
      background: rgba(246, 245, 241, .68);
      box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(28, 30, 36, .05), 0 9px 24px rgba(28, 30, 36, .1);
      -webkit-backdrop-filter: saturate(175%) blur(18px);
      backdrop-filter: saturate(175%) blur(18px);
    }
    .actions button { border-radius: 9px; }
  }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar, .filters, .actions, dialog, .search input, .primary-button, .admin-access-button, .install-button { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}

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

/* iOS-inspired application layer: content stays quiet while controls float above it. */
body { background: #f2f2f7; color: #111114; }
.topbar {
  min-height: 64px;
  color: #151518;
  background: rgba(242, 242, 247, .78);
  border-bottom: 0;
  box-shadow: 0 1px 0 rgba(32, 32, 38, .08);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  backdrop-filter: saturate(180%) blur(28px);
}
.home-link { box-shadow: inset 0 1px 0 rgba(255,255,255,.65), 0 6px 16px rgba(30, 30, 38, .14); }
.topbar span { color: #75757d; }
.admin-access-button, .install-button {
  color: #17171a;
  border-color: rgba(255,255,255,.86);
  background: rgba(255,255,255,.58);
  box-shadow: inset 0 1px 0 #fff, 0 5px 18px rgba(30,30,38,.1);
}
.app-shell { padding-top: 30px; }
.page-heading { align-items: center; }
.eyebrow { color: #b52232; }
h1 { font-size: clamp(34px, 7vw, 52px); }
.page-heading .primary-button {
  border-radius: 22px;
  background: rgba(207, 36, 52, .88);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.38), 0 8px 24px rgba(176, 25, 42, .24);
}
.reminder-panel {
  border: 0;
  border-radius: 22px;
  background: rgba(255, 248, 226, .76);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 9px 28px rgba(82,65,22,.08);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
}
.reminder-item { border-radius: 13px; background: rgba(255,255,255,.62); }
.stats {
  overflow: hidden;
  gap: 1px;
  border-radius: 22px;
  background: rgba(110,110,120,.16);
  box-shadow: 0 8px 28px rgba(30,30,38,.07);
}
.stats button {
  min-height: 82px;
  border: 0;
  border-radius: 0;
  background: rgba(255,255,255,.76);
}
.toolbar { margin-bottom: 14px; }
.filters {
  border-color: rgba(255,255,255,.88);
  border-radius: 22px;
  background: rgba(248,248,250,.68);
  box-shadow: inset 0 1px 0 #fff, 0 10px 30px rgba(30,30,38,.12);
  -webkit-backdrop-filter: saturate(180%) blur(26px);
  backdrop-filter: saturate(180%) blur(26px);
}
.filters button { border-radius: 18px; }
.filters button.active { background: transparent; }
.search input {
  border: 0;
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  box-shadow: inset 0 0 0 1px rgba(65,65,72,.08);
}
.item-list { gap: 0; overflow: hidden; border-radius: 22px; background: rgba(255,255,255,.72); box-shadow: 0 9px 30px rgba(30,30,38,.07); }
.item-card {
  border: 0;
  border-bottom: 1px solid rgba(74,74,82,.1);
  border-left: 4px solid #8b8f98;
  border-radius: 0;
  background: transparent;
}
.item-card:last-child { border-bottom: 0; }
.date-block { border-right-color: rgba(74,74,82,.12); }
.status-tag { border-radius: 7px; background: rgba(118,118,128,.12); }

@media (max-width: 720px) {
  .app-shell { width: min(100% - 24px, 1040px); padding-bottom: 118px; }
  .toolbar { display: contents; }
  .search { display: block; margin: 16px 0; }
  .filters {
    position: fixed;
    z-index: 20;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    justify-content: space-evenly;
    padding: 6px;
  }
  .filters button { flex: 1; padding: 0 8px; }
  .item-list { border-radius: 20px; }
  .item-card { padding: 16px 13px; }
  .actions {
    border: 0;
    border-radius: 17px;
    background: rgba(242,242,247,.72);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
  }
}

@media (max-width: 430px) {
  .topbar > div span { display: none; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stats button { min-height: 72px; padding: 10px 8px; text-align: center; }
  .stats span { font-size: 24px; }
  .stats small { font-size: 10px; }
  .reminder-panel { padding: 15px; }
  .filters button { font-size: 12px; }
}
