/* Shared touch targets; phone layouts first, desktop enhancements below. */
.inventory-tools { margin-bottom: 24px; }
.inventory-tools .search { margin-bottom: 8px; }
.inventory-filters { border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; background: var(--surface); }
.inventory-filters summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 12px 0; list-style: none; font-size: 14px; }
.inventory-filters summary::-webkit-details-marker { display: none; }
.inventory-filters summary > span:first-child::before { content: '+ '; }
.inventory-filters[open] summary > span:first-child::before { content: '− '; }
.inventory-filters summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
.inventory-filters .sort-caption { font-size: 12px; color: var(--text-muted); }
.inventory-filters[open] { padding-bottom: 16px; }
.filter-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
.filter-grid label { min-width: 0; }
@media (min-width: 701px) { .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.test-workspace { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; background: var(--warm-soft); border: 1px solid var(--accent-border); padding: 16px; border-radius: 12px; margin-bottom: 24px; }
.test-workspace p { margin: 6px 0 0; }
.test-workspace .button { max-width: 100%; }
html { scroll-padding-bottom: 100px; }
body { -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; }
input, select, textarea { min-width: 0; max-width: 100%; font-size: 16px; }
input[type="hidden"] { display: none; }
.button { min-height: 44px; font-size: 14px; line-height: 1.4; text-align: center; }
.avatar { width: 44px; height: 44px; flex-shrink: 0; }
.brand { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
.back-link, .tabs a, summary, footer a { min-height: 44px; display: inline-flex; align-items: center; }
summary { width: 100%; }
.checkbox-row { min-height: 44px; }
.checkbox-row input { width: 22px; height: 22px; flex-shrink: 0; }
.photo-grid .button { min-height: 44px; font-size: 14px; }
.photo-grid > *, .detail-grid > *, .form-grid > *, .hero > *, .profile-row > * { min-width: 0; }
.profile-row, .field-row, .price { overflow-wrap: anywhere; }
.large-avatar { flex-shrink: 0; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 30; background: var(--surface); padding: 12px; color: var(--accent-text); }
.skip-link:focus { top: 12px; }
main:focus { outline: none; }
header { min-height: 76px; height: auto; padding: 12px max(16px, env(safe-area-inset-left)); gap: 12px; flex-wrap: nowrap; }
main { padding: 24px max(16px, env(safe-area-inset-left)) 16px; }
footer { margin: 24px 16px; padding-bottom: env(safe-area-inset-bottom); gap: 16px; align-items: center; }
.workspace { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.workspace-nav { position: fixed; z-index: 20; bottom: 0; left: 0; right: 0; width: auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 20px var(--nav-shadow); }
.workspace-nav a { min-height: 52px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.workspace-nav a[aria-current="page"] { color: var(--accent-text); background: var(--accent-soft); }
.nav-icon { font-size: 21px; line-height: 1; }
.public-nav { order: initial; width: auto; gap: 10px; }
.public-nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; white-space: nowrap; }
.hero { display: block; margin-bottom: 24px; }
.hero h1 { font-size: 30px; line-height: 1.15; }
p, small { font-size: 14px; }
label { font-size: 14px; }
.hint, .info-note, .success-note, .error-note { font-size: 13px; }
.actions { gap: 10px; margin-top: 18px; }
.actions > .button, .actions > form { flex: 1 1 130px; }
.actions > form > .button { width: 100%; }
.hero .button, .back-link { margin-top: 0; }
.hero > .button { margin-top: 12px; }
.stats { gap: 8px; }
.stat-link { padding: 14px 10px; }
.stat-link small { font-size: 12px; }
.section-head { flex-wrap: wrap; gap: 8px; }
.section-head h2 { margin: 0; }
.section-head form { max-width: 100%; }
.section-head .button { white-space: normal; }
.tabs { gap: 4px; }
.tabs a { font-size: 13px; padding: 10px; }
.search { flex-wrap: nowrap; align-items: stretch; gap: 8px; }
.search input { width: 0; margin: 0; }
.item { grid-template-columns: 44px minmax(0, 1fr) minmax(65px, 85px); gap: 7px 10px; padding: 16px 12px; font-size: 14px; }
.item .thumb { width: 44px; height: 44px; grid-row: 1 / 3; align-self: start; }
.item small { font-size: 12px; }
.item .price { font-size: 12px; text-align: right; }
.item em { display: block; grid-column: 2 / 4; justify-self: start; font-size: 11px; }
.detail-grid, .detail-grid.item-layout, .form-grid { grid-template-columns: minmax(0, 1fr); }
.detail-card, .evidence-card { padding: 16px; }
.detail-card form > .button { max-width: 100%; }
.upload-page { min-height: 0; padding: 24px 16px; }
.upload-page input { width: 100%; max-width: 100%; font-size: 16px; }
input[type="file"] { padding: 10px; overflow: hidden; }
input::file-selector-button { min-height: 36px; max-width: 100%; border: 0; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); font: inherit; margin-right: 8px; padding: 6px 10px; }
.upload-page .button { width: 100%; }
.attention { flex-direction: column; align-items: stretch; }
.setting { align-items: flex-start; flex-direction: column; gap: 7px; }
.field-row { gap: 12px; }
.evidence-frame { min-height: 220px; }
.evidence-frame iframe { height: 380px; }
.public-hero { margin: 8px auto 30px; }
.public-hero h1 { font-size: 34px; }
.product-preview { padding: 16px; }
.preview-stats { justify-content: space-between; gap: 12px; }
.preview-stats small { font-size: 12px; }
.sample-row { grid-template-columns: 32px minmax(0, 1fr) 80px; gap: 10px; }
.sample-row .badge { grid-column: 2 / 4; justify-self: start; }
.feature-grid { grid-template-columns: 1fr; gap: 18px; margin-top: 32px; }
.login-card { padding: 22px; margin: 16px auto; }
.login-card .button { width: 100%; }
.empty { padding: 28px 16px; }

@media (max-width: 700px) {
  /* Keep the on-screen keyboard and focused field free of bottom navigation. */
  body:has(input:not([type="checkbox"]):focus, textarea:focus, select:focus) .workspace-nav { display: none; }
}

@media (min-width: 701px) {
  header { padding: 12px max(28px, calc((100% - 1060px) / 2)); }
  main { padding: 48px 28px; }
  footer { max-width: 904px; margin: 40px auto; }
  .workspace { padding-bottom: 0; }
  .workspace-nav { position: static; width: auto; display: flex; gap: 18px; padding: 0; background: transparent; border: 0; box-shadow: none; }
  .workspace-nav a { font-size: 13px; min-height: 44px; padding: 0 8px; }
  .nav-icon { display: none; }
  .hero { display: flex; margin-bottom: 32px; }
  .hero h1 { font-size: 34px; }
  .hero .actions { justify-content: flex-end; }
  .actions > .button, .actions > form { flex: 0 1 auto; }
  .stats { gap: 13px; }
  .stat-link { padding: 17px 19px; }
  .item { grid-template-columns: 44px minmax(0, 1fr) 110px 100px; padding: 16px 17px; }
  .item .thumb { grid-row: auto; }
  .item em { grid-column: auto; }
  .detail-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
  .detail-grid.item-layout { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attention, .setting { flex-direction: row; align-items: center; }
  .upload-page { min-height: 300px; padding: 30px; }
  .upload-page .button { width: auto; }
  .evidence-frame { min-height: 360px; }
  .evidence-frame iframe { height: 500px; }
  .public-hero h1 { font-size: 46px; }
  .product-preview { padding: 26px; }
  .preview-stats { justify-content: flex-start; gap: 40px; }
  .sample-row { grid-template-columns: 40px minmax(0, 1fr) 100px 100px; gap: 14px; }
  .sample-row .badge { grid-column: auto; }
  .feature-grid { grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 48px; }
}

/* Public navigation gets its own row on small phones, leaving the toggle accessible. */
@media (max-width: 700px) {
  .public header { flex-wrap: wrap; }
  .public-nav { order: 3; width: 100%; justify-content: flex-end; }
  .header-actions { margin-left: auto; gap: 8px; }
}
@media (min-width: 701px) and (max-width: 900px) {
  .workspace-nav { gap: 4px; }
  .workspace-nav a { padding: 0 4px; }
}
