/* Prepping Inventory – Material theme on top of Materialize 2 */
:root {
  --md-sys-color-primary-light: #2f6a4f;
  --md-sys-color-on-primary-light: #ffffff;
  --md-sys-color-primary-container-light: #b2f1cf;
  --md-sys-color-on-primary-container-light: #002113;
  --md-sys-color-secondary-container-light: #d0e8d9;
  --app-sidebar: 264px;
  --app-bg: #f2f2f7;
  --ios-blue: #007aff;
  --app-red: #c62828; --app-red-bg: #fdecea;
  --app-amber: #a15c00; --app-amber-bg: #fff3e0;
  --app-green: #2e7d32; --app-green-bg: #e8f5e9;
  --app-grey: #546e7a; --app-grey-bg: #eceff1;
}
a { color: var(--md-sys-color-primary-light); }
body { background: var(--app-bg); font-family: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif; color: #1b1f1d; }
.material-symbols-outlined { vertical-align: middle; font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.icon-fill { font-variation-settings: 'FILL' 1; }

/* ---------- Shell (no sidebar: top bar + home screen + dock) ---------- */
html { -webkit-text-size-adjust: 100%; }
body { padding-bottom: calc(104px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
body.guest { padding-bottom: 0; }
.app-topbar { position: sticky; top: 0; z-index: 90; display: flex; align-items: center; gap: 8px; min-height: 60px; padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); background: rgba(242,242,247,.82); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid rgba(60,60,67,.18); }
.app-topbar h1 { font-size: 1.15rem; margin: 0; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.app-topbar .home-link { display: inline-flex; align-items: center; gap: 2px; height: 44px; padding: 0 8px 0 2px; border-radius: 12px; color: var(--ios-blue); font-size: 1rem; font-weight: 500; }
.app-topbar .home-link .material-symbols-outlined { font-size: 30px; }
.app-topbar .home-link:active { opacity: .5; }
.app-topbar .home-logo { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(160deg, #3bb273, #1f6d45); margin: 0 6px 0 8px; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.app-topbar .home-logo .material-symbols-outlined { font-size: 22px; }
.app-content { padding: 20px max(24px, env(safe-area-inset-right)) 24px max(24px, env(safe-area-inset-left)); max-width: 1280px; margin: 0 auto; }
@media (max-width: 600px) { .app-content { padding: 14px max(12px, env(safe-area-inset-right)) 20px max(12px, env(safe-area-inset-left)); } }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 22px; background: #fff; border: .5px solid rgba(60,60,67,.18); cursor: pointer; color: inherit; font: inherit; min-height: 40px; }
@media (max-width: 600px) { .user-chip { padding: 2px; } .user-chip .uc-name, .user-chip .uc-caret { display: none; } }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(160deg, #5e5ce6, #3634a3); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .9rem; flex-shrink: 0; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; color: inherit; }
.icon-btn:hover { background: rgba(0,0,0,.06); }

/* ---------- Home screen (springboard) ---------- */
.home-hello { margin: 4px 4px 16px; }
.home-hello .date { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #8e8e93; }
.home-hello h2 { font-size: 1.9rem; font-weight: 700; margin: 2px 0 0; letter-spacing: -.02em; line-height: 1.2; }
.spotlight { position: relative; margin: 0 0 22px; }
.spotlight .material-symbols-outlined { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #8e8e93; pointer-events: none; }
.spotlight input { width: 100%; height: 44px !important; margin: 0 !important; border: 0 !important; border-radius: 12px !important; background: rgba(118,118,128,.12) !important; padding: 0 14px 0 42px !important; font-size: 16px !important; box-sizing: border-box; box-shadow: none !important; }
.spotlight input:focus { outline: none; background: rgba(118,118,128,.18) !important; }
.springboard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 10px; margin: 0 0 28px; padding: 6px 2px; }
@media (min-width: 600px) { .springboard { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 28px 16px; } }
@media (min-width: 1100px) { .springboard { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.app-tile { display: flex; flex-direction: column; align-items: center; gap: 7px; color: #1c1c1e; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; -webkit-user-select: none; user-select: none; }
.app-tile:focus-visible { outline: none; }
.app-tile:focus-visible .app-icon { outline: 3px solid var(--ios-blue); outline-offset: 3px; }
.app-icon { position: relative; width: 62px; height: 62px; border-radius: 15px; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.16); transition: transform .12s ease, filter .12s ease; }
@media (min-width: 600px) { .app-icon { width: 76px; height: 76px; border-radius: 18px; } }
.app-icon::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 55%); pointer-events: none; }
.app-icon .material-symbols-outlined { font-size: 34px; font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 40; }
@media (min-width: 600px) { .app-icon .material-symbols-outlined { font-size: 40px; } }
.app-tile:hover .app-icon { filter: brightness(1.06); }
.app-tile:active .app-icon { transform: scale(.9); filter: brightness(.9); }
.app-label { font-size: 12px; line-height: 1.25; text-align: center; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-weight: 500; }
@media (min-width: 600px) { .app-label { font-size: 13px; } }
.app-badge { position: absolute; top: -7px; right: -7px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: #ff3b30; color: #fff; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; border: 2px solid var(--app-bg); box-sizing: border-box; z-index: 1; }
.g-green  { background: linear-gradient(160deg, #4cd964, #1f9d45); }
.g-blue   { background: linear-gradient(160deg, #3d9bff, #0a5fd8); }
.g-red    { background: linear-gradient(160deg, #ff6259, #d70015); }
.g-orange { background: linear-gradient(160deg, #ffb340, #e86a00); }
.g-yellow { background: linear-gradient(160deg, #ffd60a, #e0a800); }
.g-teal   { background: linear-gradient(160deg, #40c8e0, #0d8aa3); }
.g-indigo { background: linear-gradient(160deg, #7d7aff, #3634a3); }
.g-purple { background: linear-gradient(160deg, #d07cff, #8944ab); }
.g-pink   { background: linear-gradient(160deg, #ff6482, #c4123b); }
.g-gray   { background: linear-gradient(160deg, #a1a1a6, #5d5d63); }
.g-brown  { background: linear-gradient(160deg, #c4a57d, #7f6545); }
.g-mint   { background: linear-gradient(160deg, #47e0d6, #00a39b); }
.g-dark   { background: linear-gradient(160deg, #5a5a60, #1c1c1e); }
.section-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #8e8e93; margin: 0 4px 10px; }

/* ---------- Dock ---------- */
.app-dock { position: fixed; z-index: 95; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); width: min(460px, calc(100vw - 20px)); display: flex; justify-content: space-around; align-items: center; padding: 8px 6px; border-radius: 28px; background: rgba(255,255,255,.78); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); box-shadow: 0 8px 30px rgba(0,0,0,.14), 0 0 0 .5px rgba(60,60,67,.14); box-sizing: border-box; }
.app-dock a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; min-height: 50px; justify-content: center; color: #8e8e93; font-size: 10.5px; font-weight: 500; border-radius: 18px; }
.app-dock a .material-symbols-outlined { font-size: 27px; }
.app-dock a.active { color: var(--ios-blue); }
.app-dock a.active .material-symbols-outlined { font-variation-settings: 'FILL' 1; }
.app-dock a:active { opacity: .55; }
.app-dock a.dock-add .material-symbols-outlined { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(160deg, #4cd964, #1f9d45); box-shadow: 0 4px 12px rgba(31,157,69,.4); font-size: 30px; }
.app-dock a.dock-add span:last-child { display: none; }

/* ---------- Surfaces ---------- */
.card { border-radius: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.08); margin: 0 0 20px; background: #fff; }
.card .card-content { padding: 20px 24px; }
.card .card-title { font-size: 1.1rem !important; font-weight: 500; display: flex; align-items: center; gap: 8px; margin-bottom: 12px !important; line-height: 1.4 !important; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head .card-title { margin: 0 !important; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; margin-bottom: 16px; }
.page-actions .spacer { flex: 1; }
.muted { color: #66736c; }
.small { font-size: .85rem; }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border-radius: 16px; padding: 18px 20px; display: flex; gap: 14px; align-items: center; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.08); color: inherit; transition: box-shadow .15s; }
a.stat:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.stat .stat-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat .stat-value { font-size: 1.7rem; font-weight: 500; line-height: 1.1; }
.stat .stat-label { font-size: .85rem; color: #66736c; }
.tone-primary { background: var(--md-sys-color-primary-container-light); color: var(--md-sys-color-on-primary-container-light); }
.tone-red { background: var(--app-red-bg); color: var(--app-red); }
.tone-amber { background: var(--app-amber-bg); color: var(--app-amber); }
.tone-green { background: var(--app-green-bg); color: var(--app-green); }
.tone-grey { background: var(--app-grey-bg); color: var(--app-grey); }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 12px; font-size: .78rem; font-weight: 500; white-space: nowrap; line-height: 1.6; }
.pill .material-symbols-outlined { font-size: 16px; }
.pill-expired { background: var(--app-red-bg); color: var(--app-red); }
.pill-expiring { background: var(--app-amber-bg); color: var(--app-amber); }
.pill-ok { background: var(--app-green-bg); color: var(--app-green); }
.pill-no_expiry { background: var(--app-grey-bg); color: var(--app-grey); }
.pill-in { background: var(--app-green-bg); color: var(--app-green); }
.pill-out { background: var(--app-red-bg); color: var(--app-red); }
.pill-adjust { background: #e3f2fd; color: #1565c0; }
.low-stock { color: var(--app-red); font-weight: 600; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -24px; }
.table-wrap table { min-width: 640px; }
table.app-table th, table.app-table td { padding: 12px 16px; vertical-align: middle; }
table.app-table th:first-child, table.app-table td:first-child { padding-left: 24px; }
table.app-table th:last-child, table.app-table td:last-child { padding-right: 24px; }
table.app-table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #5b6861; font-weight: 500; border-bottom: 1px solid #e3e8e5; white-space: nowrap; }
table.app-table thead th a { color: inherit; display: inline-flex; align-items: center; gap: 2px; }
table.app-table thead th a .material-symbols-outlined { font-size: 16px; }
table.app-table tbody tr { border-bottom: 1px solid #eef2ef; }
table.app-table tbody tr:hover { background: #f7faf8; }
table.app-table td.num, table.app-table th.num { text-align: right; white-space: nowrap; }
table.app-table .item-name { font-weight: 500; color: #1b1f1d; }
table.app-table .item-name:hover { color: var(--md-sys-color-primary-light); text-decoration: underline; }
.row-actions { white-space: nowrap; text-align: right; }
.empty { text-align: center; padding: 40px 16px; color: #66736c; }
.empty .material-symbols-outlined { font-size: 48px; display: block; margin: 0 auto 8px; color: #a4b3aa; }

/* Forms */
.filters { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 0 16px; align-items: start; }
@media (max-width: 992px) { .filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .filters { grid-template-columns: 1fr; } }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }
.app-field { margin: 0 0 18px; }
.app-field label { display: block; font-size: .82rem; font-weight: 500; color: #3f4a44; margin-bottom: 6px; }
.app-field input:not([type=checkbox]):not([type=radio]), .app-field select, .app-field textarea {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid #b9c5be; border-radius: 10px; background: #fff; font-size: .95rem; box-sizing: border-box; margin: 0; box-shadow: none; color: inherit; font-family: inherit;
}
.app-field textarea { height: auto; min-height: 96px; padding: 10px 14px; resize: vertical; }
.app-field select { display: block; appearance: auto; }
.app-field input:focus, .app-field select:focus, .app-field textarea:focus { outline: none; border-color: var(--md-sys-color-primary-light); box-shadow: 0 0 0 3px rgba(47,106,79,.18) !important; }
.app-field.has-error input, .app-field.has-error select, .app-field.has-error textarea { border-color: var(--app-red); }
.app-field .hint { font-size: .78rem; color: #6b7a72; margin-top: 4px; }
.app-field .field-error { font-size: .8rem; color: var(--app-red); margin-top: 4px; }
.app-field .input-icon { position: relative; }
.app-field .input-icon .material-symbols-outlined { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #6b7a72; font-size: 20px; pointer-events: none; }
.app-field .input-icon input { padding-left: 42px !important; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { position: static !important; opacity: 1 !important; pointer-events: auto !important; width: 18px; height: 18px; accent-color: var(--md-sys-color-primary-light); margin: 0; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 8px; flex-wrap: wrap; }

/* Buttons */
.btn, .btn-flat { display: inline-flex; align-items: center; gap: 6px; border-radius: 20px; text-transform: none; font-weight: 500; letter-spacing: .01em; }
.btn .material-symbols-outlined, .btn-flat .material-symbols-outlined { font-size: 20px; }
.btn.danger { background: var(--app-red); color: #fff; }
.btn-flat.danger { color: var(--app-red); }
form.inline { display: inline; }
button.btn-flat { border: 0; background: transparent; cursor: pointer; font-family: inherit; }
button.btn-flat:focus { background: rgba(0,0,0,.06); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
/* User menu */
.user-menu-wrap { position: relative; }
.user-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border-radius: 12px; min-width: 240px; padding: 6px 0; margin: 0; list-style: none; box-shadow: 0 8px 24px rgba(0,0,0,.16); z-index: 100; }
.user-menu.open { display: block; }
.user-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: inherit; }
.user-menu a:hover { background: #f1f5f2; }
.user-menu .meta { display: block; padding: 8px 16px 10px; border-bottom: 1px solid #eef2ef; margin-bottom: 4px; }

/* Detail list */
.detail-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px 24px; }
.detail-list dt { font-size: .78rem; color: #66736c; text-transform: uppercase; letter-spacing: .04em; }
.expiry-date { white-space: nowrap; }
.detail-list dd { margin: 4px 0 0; font-size: 1rem; font-weight: 500; }
.big-count { font-size: 2.6rem; font-weight: 500; line-height: 1; }

/* Alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; }
.alert-error { background: var(--app-red-bg); color: var(--app-red); }
.alert-success { background: var(--app-green-bg); color: var(--app-green); }

/* Login */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(135deg, #e3f1e9 0%, #f4f7f5 60%); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { display: flex; align-items: center; gap: 10px; color: var(--md-sys-color-primary-light); font-size: 1.4rem; font-weight: 500; margin-bottom: 4px; }

/* Pagination */
.app-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 16px; }
.app-pagination ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; flex-wrap: wrap; }
.app-pagination li a, .app-pagination li span { display: inline-flex; min-width: 36px; height: 36px; align-items: center; justify-content: center; padding: 0 8px; border-radius: 18px; color: inherit; }
.app-pagination li a:hover { background: #eaf2ed; }
.app-pagination li.active span { background: var(--md-sys-color-primary-light); color: #fff; }
.app-pagination li.disabled span { color: #b0bcb5; }

/* Dialogs (native <dialog>) */
.app-dialog { border: 0; border-radius: 24px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 24px 48px rgba(0,0,0,.22); background: #fff; color: inherit; }
.app-dialog::backdrop { background: rgba(15, 30, 22, .45); }
.app-dialog .modal-content { padding: 24px 24px 8px; }
.app-dialog .modal-content h5 { margin: 0 0 6px; font-size: 1.3rem; }
.app-dialog .modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 24px 20px; }
.dropdown-content li > a { display: flex; align-items: center; gap: 10px; color: inherit; }
.dropdown-content { border-radius: 12px; min-width: 200px; }
.list-plain { margin: 0; padding: 0; list-style: none; }
.list-plain li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef2ef; }
.list-plain li:last-child { border-bottom: 0; }
.bar { height: 6px; border-radius: 3px; background: #e7eeea; overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: var(--md-sys-color-primary-light); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 992px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Layout helpers ---------- */
.grid-show { display: grid; grid-template-columns: 2fr 1fr; gap: 0 20px; }
@media (max-width: 900px) { .grid-show { grid-template-columns: 1fr; } }
.filters-3 { grid-template-columns: repeat(3, 1fr) !important; }
.sm-only, .sm-only-grid { display: none; }
.filter-more { margin: 0 0 8px; }
.filter-more > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 20px; background: rgba(118,118,128,.12); cursor: pointer; font-weight: 500; margin-bottom: 14px; }
.filter-more > summary::-webkit-details-marker { display: none; }
@media (min-width: 768px) { .filter-more > summary { display: none; } }
.card { border-radius: 20px; }
.stat { border-radius: 20px; }

/* Larger touch targets everywhere */
@media (pointer: coarse) {
  .btn, .btn-flat { min-height: 44px; }
  .app-pagination li a, .app-pagination li span { min-width: 44px; height: 44px; border-radius: 22px; }
}
/* iOS: 16px inputs prevent zoom-on-focus */
.app-field input:not([type=checkbox]):not([type=radio]), .app-field select, .app-field textarea { font-size: 16px; }

/* ---------- Tablet (iPad portrait) ---------- */
@media (max-width: 1024px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .app-table .hide-md { display: none; }
  .md-only { display: inline; }
}
@media (min-width: 1025px) { .md-only { display: none; } }

/* ---------- Phones ---------- */
@media (max-width: 600px) {
  .stats { gap: 10px; }
  .stat { padding: 14px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .stat .stat-icon { width: 38px; height: 38px; border-radius: 11px; }
  .stat .stat-value { font-size: 1.45rem; }
  .card .card-content { padding: 16px; }
  .home-hello h2 { font-size: 1.6rem; }
  .filters, .filters-3 { grid-template-columns: 1fr 1fr !important; gap: 0 10px; }
  .filters .search-field { grid-column: 1 / -1; }
  .sm-only { display: inline; }
  .sm-only-grid { display: contents; }
  .page-actions { justify-content: stretch; }
  .page-actions .spacer { flex-basis: 100%; }
  .hide-on-phone { display: none; }
  .app-topbar .back-label { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-actions > .btn, .page-actions > .btn-flat, .page-actions > form { flex: 1; justify-content: center; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions > * { width: 100%; justify-content: center; }
  .detail-list { grid-template-columns: 1fr 1fr; }

  /* Tables become stacked cards */
  .table-wrap { margin: 0; overflow: visible; }
  .table-wrap table { min-width: 0; }
  table.app-table thead { display: none; }
  table.app-table, table.app-table tbody { display: block; }
  table.app-table tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 14px 0; border-bottom: 1px solid #ececf0; position: relative; }
  table.app-table tbody tr:hover { background: none; }
  table.app-table td, table.app-table td:first-child, table.app-table td:last-child { display: block; padding: 0; text-align: left !important; }
  table.app-table td[data-label]::before { content: attr(data-label); display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: #8e8e93; margin-bottom: 1px; }
  table.app-table td.cell-title { grid-column: 1 / -1; font-size: 1.02rem; padding-right: 96px; }
  table.app-table td.row-actions { position: absolute; top: 6px; right: 0; }
  table.app-table td.hide-sm { display: none; }
  table.app-table td.num { font-variant-numeric: tabular-nums; }

  /* Dialogs become bottom sheets */
  .app-dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); max-height: 92vh; }
  .app-dialog .modal-footer { flex-direction: column-reverse; }
  .app-dialog .modal-footer > * { width: 100%; justify-content: center; }
  .app-dialog[open] { animation: sheet-up .22s ease-out; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
[hidden] { display: none !important; }

/* Expiry + "Does not expire" */
.expiry-input .no-expiry-check { margin-top: 8px; font-size: .9rem; }
.expiry-input input[type=date]:disabled { background: #f2f2f7; color: #8e8e93; }
/* Big choice buttons (radio cards) */
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-card { position: relative; display: flex !important; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; border: 1.5px solid #c7d0cb; border-radius: 14px; cursor: pointer; background: #fff; margin: 0 !important; font-size: .95rem !important; color: inherit !important; min-height: 92px; }
.choice-card input { position: absolute !important; opacity: 0 !important; pointer-events: none; }
.choice-card .material-symbols-outlined { color: #8e8e93; margin-bottom: 4px; }
.choice-card strong { font-weight: 600; }
.choice-card:has(input:checked) { border-color: var(--md-sys-color-primary-light); background: #eef7f1; box-shadow: 0 0 0 3px rgba(47,106,79,.15); }
.choice-card:has(input:checked) .material-symbols-outlined { color: var(--md-sys-color-primary-light); font-variation-settings: 'FILL' 1; }
.choice-card:has(input:focus-visible) { outline: 3px solid var(--ios-blue); outline-offset: 2px; }
