:root {
  --bg: #f9fafb;
  --card: #ffffff;
  --line: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --accent: #2563eb;
  --bg-landscape: url("/photo/buttonbackground.jpeg");
  --bg-mobile: url("/photo/mobilebuttonbackground.jpeg");
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  background-image: var(--bg-landscape);
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

.page {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0.35rem 0.45rem;
}

#mainApp.app:not(.hidden) {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 0.7rem);
  max-height: calc(100vh - 0.7rem);
  overflow: hidden;
}
#mainApp .hero,
#mainApp .search-panel {
  flex-shrink: 0;
}
#mainApp .table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
#mainApp .view-toolbar {
  position: sticky;
  top: 0;
  z-index: 12;
  box-shadow: 0 1px 0 var(--line);
}
#mainApp .result-table thead {
  position: sticky;
  top: var(--view-toolbar-height, 42px);
  z-index: 11;
}
#mainApp .result-table thead th {
  box-shadow: inset 0 -1px 0 var(--line);
}

.login-card {
  max-width: 420px;
  margin: 3rem auto;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
  padding: 1.5rem;
}

.login-card h1 { margin: 0 0 0.5rem; font-size: 1.4rem; }
.login-card p { margin: 0 0 1rem; color: var(--muted); }

.login-card input,
.login-card button,
.search-row input,
.search-row button,
.size-select {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0.72rem 0.9rem;
  font-size: 0.95rem;
}

.login-card input { width: 100%; margin-bottom: 0.6rem; }
.login-card button {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
}

.hero {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.05);
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.5rem;
}
.hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.hero-titles { min-width: 0; }
.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  margin-left: auto;
}
.mobile-preview-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  color: #374151;
}
.mobile-preview-btn:hover { background: #f3f4f6; }
.mobile-preview-btn.active {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.hero h1 { margin: 0; font-size: 1.25rem; }
.hero p, .hero-sub { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.85rem; }

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.icon-tool {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.icon-tool:disabled { opacity: 0.35; cursor: not-allowed; }

.save-all-btn {
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0.35rem 0.85rem;
  font-size: 0.88rem;
  cursor: pointer;
  font-weight: 600;
}

.dirty-hint {
  color: #b45309;
  font-size: 0.8rem;
  margin-left: 0.25rem;
}

.search-panel {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.05);
  padding: 0.65rem;
  margin-bottom: 0.45rem;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 40px 40px auto;
  gap: 0.4rem;
  align-items: center;
}
.search-row .reset-filter-btn {
  width: auto;
  white-space: nowrap;
  font-size: 0.78rem;
  padding: 0.35rem 0.55rem;
}
.icon-btn {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  height: 36px;
}
.camera-menu {
  margin-top: 0.35rem;
  display: flex;
  gap: 0.35rem;
}
.camera-menu button {
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0.3rem 0.55rem;
  background: #fff;
  cursor: pointer;
  font-size: 0.82rem;
}
.pasted-preview {
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.pasted-preview img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}


.view-toolbar {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex-wrap: wrap;
}
.view-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  color: #4b5563;
  font-size: 0.82rem;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.view-tool-btn:hover { background: #f3f4f6; color: #111827; }
.view-tool-btn.active { background: #eff6ff; color: #1d4ed8; }
.view-tool-btn .tool-icon { opacity: 0.72; font-size: 0.9rem; }
.sort-icon { display: inline-flex; flex-direction: column; line-height: 0.65; font-size: 0.62rem; font-weight: 700; gap: 0; }

.tool-panel {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
}
.sort-tool-wrap { position: relative; display: inline-flex; align-items: center; gap: 0.1rem; }
.view-tool-btn.has-sort { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }

.sort-popover {
  position: absolute;
  z-index: 120;
  top: calc(100% + 0.25rem);
  left: 0;
  width: min(320px, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.14);
  padding: 0.65rem;
}
.view-toolbar { position: relative; }
.sort-popover-head {
  font-size: 0.88rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.45rem;
}
.sort-field-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}
.sort-field-list {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.sort-field-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.84rem;
  color: #374151;
}
.sort-field-item:hover { background: #f3f4f6; }
.sort-field-item .field-type-icon { min-width: 1.1rem; text-align: center; color: #9ca3af; font-size: 0.68rem; }
.sort-dir-label { margin: 0 0 0.5rem; font-size: 0.82rem; color: #6b7280; }
.sort-dir-btns { display: flex; flex-direction: column; gap: 0.25rem; }
.sort-dir-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font-size: 0.84rem;
  cursor: pointer;
  text-align: left;
}
.sort-dir-btn:hover { background: #eff6ff; border-color: #93c5fd; }
.sort-back-btn {
  margin-top: 0.55rem;
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.2rem 0;
}
.sort-active-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: #6b7280;
}
.sort-clear-btn {
  border: none;
  background: #f3f4f6;
  border-radius: 6px;
  width: 1.5rem;
  height: 1.5rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.sort-panel-row select { max-width: 280px; width: 100%; font-size: 0.82rem; padding: 0.35rem 0.45rem; }

.hide-tool-wrap { position: relative; display: inline-flex; }
.view-tool-btn.has-hidden { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }

.hide-fields-popover {
  position: absolute;
  z-index: 120;
  top: calc(100% + 0.25rem);
  left: 0;
  width: min(340px, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.14);
  padding: 0.65rem;
}
.hide-fields-popover-head {
  font-size: 0.88rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.45rem;
}
.hide-field-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}
.hide-fields-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.hide-field-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.4rem;
  border-radius: 6px;
  min-height: 2rem;
}
.hide-field-row:hover { background: #f3f4f6; }
.hide-field-row.dragging { opacity: 0.45; }
.hide-field-row.drag-over { background: #eff6ff; }
.field-toggle {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  cursor: pointer;
}
.field-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.toggle-switch {
  display: block;
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: #d1d5db;
  position: relative;
  transition: background 0.15s;
}
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s;
}
.field-toggle input:checked + .toggle-switch { background: #2563eb; }
.field-toggle input:checked + .toggle-switch::after { transform: translateX(12px); }
.hide-field-row .field-type-icon {
  min-width: 1.1rem;
  text-align: center;
  color: #9ca3af;
  font-size: 0.68rem;
  flex-shrink: 0;
}
.hide-field-row .field-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
  color: #374151;
}
.field-drag-handle {
  color: #9ca3af;
  cursor: grab;
  font-size: 0.82rem;
  letter-spacing: -0.06em;
  padding: 0.1rem 0.2rem;
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
}
.field-drag-handle:active { cursor: grabbing; }
.hide-fields-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}
.hide-fields-footer button {
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.25rem 0.35rem;
}
.hide-fields-footer button:hover { text-decoration: underline; }

.filter-tool-wrap { position: relative; display: inline-flex; }
.view-tool-btn.has-filter { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }

.filter-popover {
  position: absolute;
  z-index: 120;
  top: calc(100% + 0.25rem);
  left: 0;
  width: min(680px, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.14);
  padding: 0.65rem;
}
.filter-popover-head {
  font-size: 0.88rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
}
.filter-intro {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  color: #6b7280;
}
.filter-conditions-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 320px;
  overflow-y: auto;
}
.filter-condition-row {
  display: grid;
  grid-template-columns: 68px minmax(100px, 1.1fr) 118px minmax(100px, 1.2fr) 32px;
  gap: 0.35rem;
  align-items: center;
}
.filter-join-label {
  font-size: 0.82rem;
  color: #6b7280;
  text-align: right;
  padding-right: 0.15rem;
}
.filter-join-select,
.filter-condition-row select,
.filter-condition-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.38rem 0.45rem;
  font-size: 0.82rem;
  background: #fff;
  min-width: 0;
}
.filter-condition-row input:disabled {
  background: #f9fafb;
  color: #9ca3af;
}
.filter-remove-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
  opacity: 0.55;
  padding: 0.2rem;
  line-height: 1;
}
.filter-remove-btn:hover { opacity: 1; color: #dc2626; }
.filter-add-btn {
  margin-top: 0.45rem;
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.25rem 0;
}
.filter-add-btn:hover { text-decoration: underline; }
.filter-popover-footer {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}
.filter-popover-footer button {
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.2rem 0;
}
.filter-popover-footer button:hover { text-decoration: underline; }

.filter-empty-hint {
  margin: 0.35rem 0;
  font-size: 0.82rem;
  color: #9ca3af;
}

.sort-quick-clear {
  align-self: center;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #c2410c;
  border-radius: 6px;
  width: 1.55rem;
  height: 1.55rem;
  margin-left: -0.15rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}
.sort-quick-clear:hover { background: #ffedd5; }
.sort-config-row {
  display: grid;
  grid-template-columns: 1fr auto 32px;
  gap: 0.35rem;
  align-items: center;
}
.sort-config-field,
.sort-config-dir {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.42rem 0.5rem;
  font-size: 0.82rem;
  background: #fff;
  min-width: 0;
}
.sort-row-clear {
  border: none;
  background: #f3f4f6;
  border-radius: 6px;
  width: 1.75rem;
  height: 1.75rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: #6b7280;
}
.sort-row-clear:hover { background: #fee2e2; color: #dc2626; }

.row-height-tool-wrap { position: relative; display: inline-flex; }
.row-height-icon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  width: 14px;
  height: 14px;
  vertical-align: middle;
}
.row-height-icon span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}
.row-height-icon span:nth-child(1) { width: 14px; }
.row-height-icon span:nth-child(2) { width: 10px; }
.row-height-icon span:nth-child(3) { width: 6px; }

.row-height-popover {
  position: absolute;
  z-index: 120;
  top: calc(100% + 0.25rem);
  left: 0;
  width: min(220px, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.14);
  padding: 0.55rem 0;
}
.row-height-popover-head {
  font-size: 0.88rem;
  font-weight: 600;
  color: #374151;
  padding: 0 0.65rem 0.45rem;
}
.row-height-options { display: flex; flex-direction: column; }
.row-height-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.45rem 0.65rem;
  font-size: 0.84rem;
  color: #374151;
  cursor: pointer;
}
.row-height-option:hover { background: #f3f4f6; }
.row-height-option.active { color: #2563eb; font-weight: 600; }
.rh-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  width: 16px;
  flex-shrink: 0;
}
.rh-icon::before,
.rh-icon::after {
  content: "";
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}
.rh-short::before { width: 14px; }
.rh-short::after { width: 10px; }
.rh-medium::before { width: 14px; }
.rh-medium::after { width: 12px; }
.rh-tall::before { width: 14px; }
.rh-tall::after { width: 14px; }
.rh-extratall::before { width: 14px; height: 3px; }
.rh-extratall::after { width: 14px; height: 3px; }
.row-height-divider {
  margin: 0.35rem 0.65rem;
  border: none;
  border-top: 1px solid var(--line);
}
.wrap-headers-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.65rem 0.15rem;
  font-size: 0.82rem;
  color: #374151;
  cursor: pointer;
}
.wrap-headers-toggle input { margin: 0; }

.airtable-th {
  vertical-align: middle;
  padding: 0;
  white-space: nowrap;
  position: relative;
}
.airtable-th .th-inner {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.28rem 0.35rem;
  padding-right: 0.55rem;
}
.col-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 14px;
  height: 100%;
  cursor: col-resize;
  z-index: 4;
  transform: translateX(50%);
  touch-action: none;
  background: transparent;
}
.col-resize-handle::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 18%;
  bottom: 18%;
  width: 2px;
  border-radius: 1px;
  background: transparent;
  transition: background 0.1s;
}
.col-resize-handle:hover::after {
  background: rgba(107, 114, 128, 0.45);
}
.col-resize-handle.is-dragging::after {
  background: #2563eb;
  top: 0;
  bottom: 0;
}
body.col-resizing {
  cursor: col-resize !important;
  user-select: none;
}
body.col-resizing * {
  cursor: col-resize !important;
}
body.col-resizing .result-table col,
body.col-resizing .result-table th {
  transition: none !important;
}
body.col-resizing .result-table {
  pointer-events: none;
}
body.col-resizing .col-resize-handle {
  pointer-events: auto;
}

.inline-field-rename {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid #2563eb;
  border-radius: 4px;
  padding: 0.1rem 0.25rem;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
body.is-mobile .col-resize-handle { display: none; }
.airtable-th .field-type-icon {
  flex-shrink: 0;
  font-size: 0.68rem;
  color: #9ca3af;
  font-weight: 600;
  min-width: 1.1rem;
  text-align: center;
}
.airtable-th .field-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.78rem;
  font-weight: 600;
}
.airtable-th .field-chevron {
  flex-shrink: 0;
  opacity: 0.45;
  cursor: pointer;
  font-size: 0.65rem;
  padding: 0.1rem 0.15rem;
  border-radius: 4px;
}
.airtable-th .field-chevron:hover { opacity: 1; background: #e5e7eb; }
.col-draggable-th.airtable-th { cursor: grab; }
.col-draggable-th.airtable-th:active { cursor: grabbing; }

.airtable-menu {
  min-width: 220px;
  padding: 0.35rem 0;
  border-radius: 8px;
}
.airtable-menu button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.84rem;
  color: #374151;
}
.airtable-menu button .mi {
  width: 1rem;
  text-align: center;
  opacity: 0.75;
  flex-shrink: 0;
}
.airtable-menu button.danger { color: #dc2626; }
.airtable-menu hr { margin: 0.25rem 0; }

.filter-row {
  display: grid;
  grid-template-columns: 150px 130px minmax(120px, 1fr) 150px 130px minmax(120px, 1fr) auto auto;
  gap: 0.4rem;
}
.tool-panel .filter-row { margin-top: 0; }

.search-row input { width: 100%; }
.filter-row input,
.filter-row select,
.filter-row button { width: 100%; font-size: 0.82rem; padding: 0.35rem 0.45rem; }
.filter-row button { background: #111827; color: #fff; border: none; cursor: pointer; border-radius: 8px; }
.filter-row .reset-filter-btn {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
  font-weight: 600;
}
.filter-row .reset-filter-btn:hover { background: #dbeafe; }

.filter-status {
  margin-top: 0.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.82rem;
}
.filter-status.hidden { display: none; }

.table-wrap {
  position: relative;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.05);
  padding: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  --row-min-height: 44px;
  --thumb-size: 40px;
}
.table-wrap.wrap-headers .airtable-th .field-name {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}
.table-wrap.wrap-headers .airtable-th .th-inner {
  align-items: flex-start;
  white-space: normal;
}

.table-footer {
  position: sticky;
  left: 0;
  bottom: 0;
  z-index: 4;
  padding: 0.5rem 0.75rem 0.55rem;
  border-top: 1px solid var(--line);
  background: #f8fafc;
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.table-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
}
#recordCount {
  padding-left: 0.15rem;
  font-size: 0.8rem;
  color: #6b7280;
}
.airtable-add-btn {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06);
  font-family: inherit;
  font-size: 0.84rem;
  color: #374151;
  line-height: 1;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.airtable-add-btn:hover {
  border-color: #9ca3af;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.1);
}
.airtable-add-btn:active { transform: scale(0.98); }
.airtable-add-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.airtable-add-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  min-width: 2.15rem;
  background: #f9fafb;
  border-right: 1px solid #e5e7eb;
  font-size: 1.15rem;
  font-weight: 400;
  color: #111827;
}
.airtable-add-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.75rem 0.42rem 0.5rem;
  font-weight: 500;
  white-space: nowrap;
}
.airtable-add-icon {
  font-size: 0.88rem;
  line-height: 1;
  opacity: 0.85;
}
body.is-mobile .airtable-add-btn { display: none !important; }
body.is-mobile .table-footer {
  margin-bottom: 0;
}
html.mobile-preview .table-footer {
  max-width: 420px;
  margin: 0 auto;
}

.result-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 900px;
  table-layout: fixed;
}
.result-table th .field-name,
.result-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-table tbody td {
  min-height: var(--row-min-height);
}
.result-table .cell-input {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-table .img-cell {
  overflow: visible;
}

.result-table th,
.result-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 0.28rem 0.45rem;
  text-align: left;
  vertical-align: middle;
  font-size: 0.8rem;
  line-height: 1.25;
  color: #111827;
  word-break: break-word;
  overflow: visible;
}
.result-table th:last-child,
.result-table td:last-child { border-right: none; }

.result-table th {
  color: #374151;
  background: #f3f4f6;
  font-weight: 600;
  padding: 0.28rem 0.28rem;
}

.col-idx {
  text-align: center;
  color: var(--muted);
  cursor: context-menu;
  font-variant-numeric: tabular-nums;
  position: relative;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  padding-left: 0.1rem;
  padding-right: 0.1rem;
}
.result-table th.col-idx .th-inner {
  justify-content: center;
  min-width: 0;
  padding: 0.2rem 0.1rem;
}
.result-table th.col-idx .field-name {
  font-size: 0.72rem;
}

.result-table tr.row-dirty td { background: #fffbeb; }
.result-table tr.row-selected td { background: #eff6ff; }
.result-table tr.row-selected.row-dirty td { background: #dbeafe; }
.result-table tr.row-dragging td { opacity: 0.45; }
.result-table tr.drag-over td { box-shadow: inset 0 3px 0 #2563eb; }
.result-table tbody.is-row-dragging { cursor: grabbing; }

.row-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  margin-right: 0.2rem;
  color: #9ca3af;
  cursor: grab;
  font-size: 0.72rem;
  letter-spacing: -0.08em;
  vertical-align: middle;
}
.row-drag-handle:active { cursor: grabbing; }
.row-seq { vertical-align: middle; }

.result-table tr:hover td { background: #f9fafb; }
.result-table tr.row-dirty:hover td { background: #fef3c7; }

.img-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
  min-height: calc(var(--thumb-size) + 4px);
  cursor: pointer;
  outline: none;
}
.img-cell-nav:focus {
  box-shadow: inset 0 0 0 2px #2563eb;
  border-radius: 6px;
}

.thumb-img {
  width: var(--thumb-size);
  height: var(--thumb-size);
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
  display: block;
}

.img-more {
  font-size: 0.7rem;
  color: var(--muted);
  padding: 0 2px;
}

.cell-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.12rem 0.2rem;
  font-size: 0.8rem;
  color: #111827;
  background: #fff;
}
.cell-input:focus {
  border-color: var(--accent);
  outline: none;
}

.cell-text {
  display: block;
  color: #111827;
  word-break: break-word;
  white-space: normal;
  line-height: 1.3;
}


.editor-actions {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.editor-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  background: #fff;
  cursor: pointer;
  font-size: 0.82rem;
}
.custom-col-th,
.col-draggable-th {
  cursor: grab;
  user-select: none;
  white-space: nowrap;
  position: relative;
}
.custom-col-th.dragging,
.col-draggable-th.dragging {
  opacity: 0.45;
  cursor: grabbing;
}
.custom-col-th.drag-over,
.col-draggable-th.drag-over {
  background: #dbeafe;
}
.col-draggable-th .col-menu-btn,
.custom-col-th .col-menu-btn {
  margin-left: 0.25rem;
  opacity: 0.45;
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0 0.15rem;
}
.col-draggable-th .col-menu-btn:hover,
.custom-col-th .col-menu-btn:hover { opacity: 1; }
.cell-input.c-sku { font-family: ui-monospace, monospace; font-size: 0.78rem; }

.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 500;
  min-width: 200px;
  max-width: 360px;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.15);
  background: #111827;
  color: #fff;
  transition: opacity 0.2s ease;
}
.toast.toast-error { background: #dc2626; }
.toast.toast-info { background: #2563eb; }

.size-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
}
.size-chip {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.05rem 0.3rem;
  font-size: 0.72rem;
  background: #f9fafb;
}

.hidden { display: none !important; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 0.8rem 0.4rem;
}

.context-menu {
  position: fixed;
  z-index: 300;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.12);
  padding: 0.25rem 0;
}
.context-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.4rem 0.75rem;
  font-size: 0.84rem;
  cursor: pointer;
}
.context-menu button:hover { background: #f3f4f6; }
.context-menu button.danger { color: #dc2626; }
.context-menu hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0.2rem 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 200;
}

.modal {
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 1rem;
}

.expand-record-backdrop { padding: 1.25rem; }
.expand-record-panel {
  max-width: min(560px, 100%);
  width: 100%;
  max-height: min(92vh, 900px);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.expand-record-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.expand-record-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.expand-close-btn {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
}
.expand-close-btn:hover { background: #f3f4f6; color: #111827; }
.expand-record-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.85rem 1rem 1.1rem;
}
.expand-record-fields {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.75rem;
}
.expand-field-row {
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 0.55rem;
}
.expand-field-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.expand-field-value {
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.result-table tbody tr:hover .row-expand-btn,
.result-table tbody tr.row-selected .row-expand-btn {
  opacity: 1;
  pointer-events: auto;
}
.row-expand-btn {
  position: absolute;
  right: 1px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.96);
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.row-expand-btn:hover {
  background: #fff;
  border-color: #9ca3af;
}
@media (max-width: 900px) {
  .row-expand-btn {
    opacity: 1;
    pointer-events: auto;
  }
}
.result-table tbody td.col-idx {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0.15rem 0.1rem;
  overflow: visible;
  position: relative;
  z-index: 2;
  isolation: isolate;
}
.col-idx .row-hover-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.08rem 0.12rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 6;
}
.result-table tbody tr:hover .col-idx .row-seq-btn,
.result-table tbody tr.row-selected .col-idx .row-seq-btn {
  opacity: 0;
  pointer-events: none;
}
.row-seq-btn {
  cursor: pointer;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  padding: 0;
  border-radius: 4px;
  min-width: 0;
  line-height: 1.2;
  flex-shrink: 0;
  width: 100%;
  text-align: center;
}
.result-table tbody tr:hover .col-idx .row-hover-tools,
.result-table tbody tr.row-selected .col-idx .row-hover-tools {
  opacity: 1;
  pointer-events: auto;
}
.row-seq-btn:hover { background: rgba(37, 99, 235, 0.12); }
.col-idx .row-drag-handle {
  flex: 0 0 auto;
  width: 0.75rem;
  margin-right: 0;
  font-size: 0.65rem;
}
.result-table tbody td.col-idx .row-expand-btn {
  position: static;
  transform: none;
  opacity: 1;
  pointer-events: auto;
  width: 18px;
  height: 18px;
  font-size: 0.62rem;
  flex-shrink: 0;
}
.result-table tbody tr:not(:hover):not(.row-selected) td.col-idx .row-expand-btn {
  display: none;
}
.row-select-cb {
  width: 13px;
  height: 13px;
  margin: 0;
  cursor: pointer;
  accent-color: #2563eb;
  flex-shrink: 0;
}
.result-table tbody td:has(.img-cell) {
  overflow: hidden;
  padding-left: 0.35rem;
}
.hero-link-btn {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0.2rem 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1d4ed8;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.hero-link-btn:hover { background: transparent; color: #1e40af; }

.gallery-modal {
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  padding: 0.75rem;
}

.gallery-list {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.65rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  align-items: flex-start;
}

.gallery-item {
  flex: 0 0 168px;
  width: 168px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.4rem;
  position: relative;
  background: #fff;
}
.gallery-item.dragging { opacity: 0.45; }
.gallery-item.drag-over { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25); }

.gallery-item-drag {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1;
  user-select: none;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 6px;
  cursor: grab;
  z-index: 2;
  touch-action: none;
}
.gallery-item-drag:active { cursor: grabbing; }
.gallery-item img { cursor: zoom-in; }
.gallery-list.is-dragging { overflow: hidden; }

.modal-img-wrap { position: relative; flex: 1; min-width: 0; }
.modal-zoom-btn {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  cursor: pointer;
  font-size: 1rem;
}
.modal-zoom-btn:hover { background: #fff; }

.modal-viewer {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.modal-nav {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #374151;
}
.modal-nav:hover { background: #f3f4f6; }
.modal-viewer .hero-img {
  flex: 1;
  min-width: 0;
  width: 100%;
  cursor: zoom-in;
}
.modal-img-counter {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.35rem 0 0.5rem;
}

.gallery-item img {
  width: 100%;
  height: 130px;
  object-fit: contain;
  border-radius: 8px;
  background: #f9fafb;
  display: block;
}

.gallery-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}
.gallery-hint {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.gallery-head strong { flex: 1; }
.gallery-add-wrap {
  position: relative;
}
.gallery-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.gallery-icon-btn:hover { background: #f3f4f6; }
.gallery-add-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 10;
  min-width: 140px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.12);
  padding: 0.25rem 0;
}
.gallery-add-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.45rem 0.75rem;
  font-size: 0.84rem;
  cursor: pointer;
}
.gallery-add-menu button:hover { background: #f3f4f6; }
.gallery-close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  color: var(--muted);
}

.gallery-item-name {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
}
.gallery-item-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.35rem;
}
.gallery-item-tools button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 0.72rem;
  line-height: 1;
  padding: 0;
}
.gallery-item-tools button:hover { background: #f3f4f6; }

.hero-img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.modal dl { margin: 0.85rem 0 0; }
.modal dt { color: var(--muted); margin-top: 0.45rem; }
.modal dd { margin: 0.2rem 0 0; }
.close {
  margin-top: 1rem;
  width: 100%;
  border: none;
  background: #111827;
  color: #fff;
  border-radius: 12px;
  padding: 0.7rem;
  cursor: pointer;
}

/* Fullscreen zoom lightbox */
.zoom-lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
}
.zoom-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem;
  background: rgba(17, 24, 39, 0.85);
  flex-shrink: 0;
}
.zoom-toolbar button {
  min-width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}
.zoom-toolbar button:hover { background: rgba(255,255,255,0.2); }
#zoomLevel { color: #fff; font-size: 0.88rem; min-width: 48px; text-align: center; }
.zoom-stage {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
}
.zoom-stage.is-panning { cursor: grabbing; }
#zoomImg {
  max-width: 95vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  transform-origin: center center;
  user-select: none;
  pointer-events: none;
}

/* Entry splash */
.mobile-splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg-landscape) center center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
body.real-mobile-device .mobile-splash,
html.mobile-preview .mobile-splash {
  background-image: var(--bg-mobile);
}
.mobile-splash-inner {
  text-align: center;
  padding: 2rem 1.25rem;
  max-width: 92%;
}
.mobile-splash-inner h1 {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 700;
  color: #111827;
  line-height: 1.35;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.95), 0 0 40px rgba(255, 255, 255, 0.8);
}
body.splash-open { overflow: hidden; }
.mobile-splash-hint {
  margin: 1rem 0 0;
  color: #374151;
  font-size: 0.92rem;
  text-shadow: 0 1px 8px rgba(255, 255, 255, 0.9);
}
.mobile-splash.loading {
  pointer-events: none;
}
.mobile-splash.loading .mobile-splash-hint {
  animation: splash-pulse 1.2s ease-in-out infinite;
}
@keyframes splash-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

body.mobile-bg {
  background-color: #eef2f6 !important;
  background-image: var(--bg-mobile) !important;
  background-size: cover !important;
  background-position: center center !important;
  background-attachment: scroll !important;
  background-repeat: no-repeat !important;
}
body.mobile-bg .page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem;
  padding-bottom: 1rem;
}
body.mobile-bg .login-card {
  margin: auto;
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px rgba(17, 24, 39, 0.1);
}

/* Mobile Airtable-style layout (after login) */
body.is-mobile {
  background-image: none;
  background-color: #f3f4f6;
}
body.is-mobile .page { padding: 0; padding-bottom: 56px; }
body.is-mobile .hero {
  border-radius: 0;
  margin-bottom: 0;
  padding: 0.55rem 0.75rem;
  box-shadow: 0 1px 0 var(--line);
}
body.is-mobile .hero-sub { display: none; }
body.real-mobile-device .mobile-preview-btn { display: none; }
body.is-mobile .search-panel {
  border-radius: 0;
  margin-bottom: 0;
  padding: 0.45rem 0.55rem;
  box-shadow: none;
  border-bottom: 1px solid var(--line);
}
body.is-mobile #filterPanel { display: none !important; }
body.is-mobile.mobile-show-filters #filterPanel {
  display: block !important;
}
body.is-mobile .view-toolbar { flex-wrap: wrap; }

body.is-mobile .table-wrap {
  border-radius: 0;
  box-shadow: none;
  background: #fff;
}
body.is-mobile.mobile-table-view .result-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.55rem 0.65rem;
  border-bottom: 2px solid #e5e7eb;
}
body.is-mobile.mobile-table-view .result-table td {
  padding: 0.5rem 0.65rem;
  font-size: 0.82rem;
  background: #fff;
}
body.is-mobile.mobile-table-view .col-idx {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #f8fafc;
  box-shadow: 2px 0 4px rgba(0,0,0,0.04);
}
body.is-mobile.mobile-table-view .result-table tbody tr:nth-child(even) td { background: #fafafa; }
body.is-mobile.mobile-table-view .result-table tbody tr:nth-child(even) td.col-idx { background: #f3f4f6; }
body.is-mobile.mobile-table-view .thumb-img { width: 36px; height: 36px; }

.mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 52px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}
.mobile-nav button {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.35rem;
  height: 100%;
  cursor: pointer;
  color: #374151;
}
.mobile-nav-add {
  font-size: 1.8rem !important;
  font-weight: 300;
  color: var(--accent) !important;
}

.result-cards.platform-gallery-cards {
  display: block !important;
  padding: 0.75rem 0.85rem 1rem;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.platform-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--pg-min-col, 220px), 1fr));
  gap: var(--pg-gap, 0.85rem);
}
.platform-gallery-grid.pg-size-sm { --pg-min-col: 160px; }
.platform-gallery-grid.pg-size-md { --pg-min-col: 220px; }
.platform-gallery-grid.pg-size-lg { --pg-min-col: 300px; }
.platform-gallery-grid.pg-gap-compact { --pg-gap: 0.45rem; }
.platform-gallery-grid.pg-gap-normal { --pg-gap: 0.85rem; }
.platform-gallery-grid.pg-gap-wide { --pg-gap: 1.35rem; }
.platform-gallery-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}
.platform-gallery-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}
.pg-cover-wrap {
  background: #f3f4f6;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
}
.pg-cover-main {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f3f4f6;
}
.pg-cover-main .pg-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pg-cover-text {
  padding: 0.75rem;
  font-weight: 600;
  font-size: 0.85rem;
  text-align: center;
}
.pg-cover-slider {
  position: relative;
  cursor: ew-resize;
}
.pg-slide-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 2px;
  padding: 0 4px 4px;
  pointer-events: none;
}
.pg-slide-seg {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.45);
  transition: background 0.12s;
}
.pg-slide-seg.active {
  background: rgba(255, 255, 255, 0.95);
}
.pg-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pg-cover.fit {
  object-fit: contain;
  padding: 0.35rem;
}
.pg-no-cover { color: #9ca3af; }
.pg-card-body { padding: 0.55rem 0.65rem 0.7rem; }
.pg-title {
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pg-field {
  display: flex;
  gap: 0.35rem;
  font-size: 0.72rem;
  line-height: 1.35;
  margin-top: 0.18rem;
}
.pg-label { color: #6b7280; flex-shrink: 0; }
.pg-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pg-pill {
  display: inline-block;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  font-size: 0.68rem;
}
.result-table.hidden { display: none; }

.customize-cards-wrap { position: relative; }
.customize-cards-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 120;
  width: min(340px, 92vw);
  max-height: min(70vh, 520px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  padding: 0.65rem 0.75rem 0.75rem;
}
.customize-cards-size,
.customize-cards-gap {
  display: flex;
  gap: 0.65rem;
  font-size: 0.78rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}
.share-view-section {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}
.share-view-section h4 {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
}
.share-link-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.share-link-row input {
  flex: 1;
  min-width: 0;
  font-size: 0.72rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.share-view-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}
.share-view-actions button {
  font-size: 0.75rem;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}
.share-view-actions button.primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.share-view-hint {
  font-size: 0.72rem;
  color: #6b7280;
  margin: 0.35rem 0 0;
}
.customize-cards-head { font-weight: 700; font-size: 0.85rem; margin-bottom: 0.5rem; }
.customize-cards-cover,
.customize-cards-fit {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  margin-bottom: 0.5rem;
}
.customize-cards-fit { flex-direction: row; gap: 0.75rem; }
.customize-cards-list {
  max-height: 240px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.customize-card-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  padding: 0.2rem 0;
}
.customize-card-name { flex: 1; min-width: 0; }
.customize-card-drag { color: #9ca3af; cursor: grab; }

.catalog-field-dialog label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
}
.catalog-field-dialog input,
.catalog-field-dialog select {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.result-cards { display: none; }

/* Mobile card list (readable on phone + desktop mobile-preview) */
body.is-mobile .result-cards,
html.mobile-preview .result-cards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem 1rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.is-mobile.mobile-table-view .result-cards,
html.mobile-preview.mobile-table-view .result-cards {
  display: none !important;
}
body.is-mobile:not(.mobile-table-view) .result-table,
html.mobile-preview:not(.mobile-table-view) .result-table {
  display: none !important;
}
body.is-mobile.mobile-table-view .table-wrap,
html.mobile-preview.mobile-table-view .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
body.is-mobile.mobile-table-view .result-table,
html.mobile-preview.mobile-table-view .result-table {
  display: table;
  min-width: max-content;
  table-layout: auto;
  width: max-content;
}
body.is-mobile.mobile-table-view .result-table th,
body.is-mobile.mobile-table-view .result-table td,
html.mobile-preview.mobile-table-view .result-table th,
html.mobile-preview.mobile-table-view .result-table td {
  white-space: normal;
  word-break: break-word;
  max-width: none;
  min-width: 4.5rem;
}
body.is-mobile .mobile-view-toggle,
html.mobile-preview .mobile-view-toggle {
  display: inline-flex;
  gap: 0.25rem;
  margin-left: auto;
}
.mobile-view-toggle { display: none; }
.mobile-view-toggle .view-tool-btn.active {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.mobile-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 0.65rem;
  align-items: start;
  padding: 0.65rem 0.7rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  cursor: pointer;
}
.mobile-card:active { background: #f9fafb; }
.mobile-card-img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mobile-card-no-img { color: #9ca3af; font-size: 0.85rem; }
.mobile-card-body { min-width: 0; display: flex; flex-direction: column; gap: 0.28rem; }
.mobile-card-field {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: 0.35rem;
  font-size: 0.8rem;
  line-height: 1.35;
}
.mobile-card-field .mcf-label {
  color: #6b7280;
  font-weight: 500;
  font-size: 0.72rem;
}
.mobile-card-field .mcf-value {
  color: #111827;
  word-break: break-word;
}
.mobile-card-expand {
  border: none;
  background: #f3f4f6;
  color: #374151;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  align-self: center;
}
.mobile-cards-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
}
body.is-mobile .table-wrap,
html.mobile-preview .table-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
body.is-mobile .view-toolbar,
html.mobile-preview .view-toolbar {
  flex-wrap: wrap;
  gap: 0.35rem;
}

@media (max-width: 840px) {
  html, body { background-attachment: scroll; }
  .page { padding: 0; padding-bottom: 56px; }
  .hero-bar { flex-direction: row; align-items: center; }
  .hero-sub { display: none; }
  .search-row { grid-template-columns: 1fr 44px 44px auto; }
  .icon-btn { height: 44px; min-width: 44px; font-size: 1.1rem; }
  .filter-condition-row { grid-template-columns: 1fr; }
  .filter-join-label { text-align: left; }
  .table-wrap { overflow-x: auto; border-radius: 0; }
  .result-table { display: table; min-width: max-content; }
  .gallery-modal { max-width: calc(100vw - 1rem); }
  .modal-backdrop { padding: 0.5rem; align-items: flex-end; }
  .modal { max-width: 100%; width: 100%; border-radius: 16px 16px 0 0; }
  .modal-nav { flex: 0 0 44px; width: 44px; height: 44px; font-size: 1.6rem; }
  .modal-viewer .hero-img { max-height: 50vh; }
  .close { min-height: 48px; font-size: 1rem; }
  .toast { left: 0.75rem; right: 0.75rem; max-width: none; text-align: center; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1rem; }
  .filter-row { grid-template-columns: 1fr; }
}

/* Desktop mobile-preview: phone frame in center */
html.mobile-preview body {
  background-color: #374151;
  background-image: none;
}
html.mobile-preview .page {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0;
  padding-bottom: 56px;
  background-color: #f3f4f6;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 8px 32px rgba(0,0,0,0.35);
}
html.mobile-preview .mobile-splash {
  left: 50%;
  right: auto;
  width: min(420px, 100vw);
  transform: translateX(-50%);
  background-image: var(--bg-mobile);
}
html.mobile-preview .mobile-nav {
  left: 50%;
  right: auto;
  width: min(420px, 100vw);
  transform: translateX(-50%);
}
html.mobile-preview .toast {
  left: 50%;
  right: auto;
  width: min(420px, 100vw);
  transform: translateX(-50%);
  max-width: none;
}
html.mobile-preview body.mobile-bg {
  background-image: none !important;
  background-color: #374151 !important;
}
html.mobile-preview body.mobile-bg .page {
  background-image: var(--bg-mobile);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem;
  padding-bottom: 1rem;
}
html.mobile-preview .hero {
  border-radius: 0;
  margin-bottom: 0;
  box-shadow: 0 1px 0 var(--line);
}
html.mobile-preview .search-panel {
  border-radius: 0;
  margin-bottom: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--line);
}
html.mobile-preview .table-wrap {
  border-radius: 0;
  box-shadow: none;
  background: #fff;
}
html.mobile-preview.mobile-table-view .result-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  font-size: 0.72rem;
}
html.mobile-preview.mobile-table-view .col-idx {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #f8fafc;
}
html.mobile-preview #filterPanel { display: none !important; }
html.mobile-preview.mobile-show-filters #filterPanel,
html.mobile-preview .mobile-show-filters #filterPanel {
  display: block !important;
}
html.mobile-preview.mobile-table-view .result-cards { display: none !important; }

/* SortableJS — translate3d hardware-accelerated drag */
.sortable-col-ghost,
.sortable-row-ghost {
  opacity: 0.35;
  background: #eff6ff !important;
}
.sortable-col-chosen,
.sortable-row-chosen {
  background: #f0f9ff;
}
.sortable-col-drag,
.sortable-row-drag,
.sortable-fallback {
  opacity: 0.98;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.12);
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.mobile-view-bar {
  display: none;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  color: #6b7280;
}
body.is-mobile .mobile-view-bar,
html.mobile-preview .mobile-view-bar {
  display: flex;
}
.mobile-view-path { color: #9ca3af; }
.mobile-view-path::after { content: " / "; }
.mobile-view-name {
  flex: 1;
  font-weight: 600;
  color: #111827;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-view-tools-btn {
  border: none;
  background: transparent;
  padding: 0.35rem;
  color: #374151;
  cursor: pointer;
  border-radius: 6px;
}
.mobile-view-tools-btn:active { background: #f3f4f6; }

body.is-mobile #catalogWorkspace,
html.mobile-preview #catalogWorkspace {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 40px);
  max-height: calc(100dvh - 40px);
}
body.is-mobile .platform-content,
html.mobile-preview .platform-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
body.is-mobile .search-panel,
html.mobile-preview .search-panel {
  display: none !important;
}
body.is-mobile .hero-actions .hero-link-btn,
body.is-mobile .hero-actions .mobile-preview-btn,
html.mobile-preview .hero-actions .hero-link-btn,
html.mobile-preview .hero-actions .mobile-preview-btn {
  display: none !important;
}
body.is-mobile .hero-actions,
html.mobile-preview .hero-actions {
  margin-left: auto;
}
body.is-mobile .mobile-view-toggle,
html.mobile-preview .mobile-view-toggle {
  display: none !important;
}
body.is-mobile .view-toolbar .row-height-tool-wrap,
body.is-mobile .view-toolbar #downloadCsvBtn,
body.is-mobile .view-toolbar .customize-cards-wrap,
html.mobile-preview .view-toolbar .row-height-tool-wrap,
html.mobile-preview .view-toolbar #downloadCsvBtn,
html.mobile-preview .view-toolbar .customize-cards-wrap {
  display: none !important;
}
body.is-mobile .view-toolbar,
html.mobile-preview .view-toolbar {
  display: flex !important;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 0.4rem;
  padding: 0.45rem 0.55rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
body.is-mobile .view-toolbar::-webkit-scrollbar,
html.mobile-preview .view-toolbar::-webkit-scrollbar { display: none; }
body.is-mobile .view-toolbar .view-tool-btn,
html.mobile-preview .view-toolbar .view-tool-btn {
  flex-shrink: 0;
  font-size: 0.78rem;
  padding: 0.38rem 0.62rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  white-space: nowrap;
}
body.is-mobile .view-toolbar .view-tool-btn.active,
body.is-mobile .view-toolbar .view-tool-btn.has-filter,
body.is-mobile .view-toolbar .view-tool-btn.has-hidden,
body.is-mobile .view-toolbar .view-tool-btn.has-sort,
html.mobile-preview .view-toolbar .view-tool-btn.active,
html.mobile-preview .view-toolbar .view-tool-btn.has-filter,
html.mobile-preview .view-toolbar .view-tool-btn.has-hidden,
html.mobile-preview .view-toolbar .view-tool-btn.has-sort {
  border-color: #86efac;
  background: #ecfdf5;
}
body.is-mobile.mobile-tools-open .view-toolbar,
html.mobile-preview.mobile-tools-open .view-toolbar {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
body.is-mobile .table-wrap,
html.mobile-preview .table-wrap {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
body.is-mobile.mobile-table-view .result-table,
html.mobile-preview.mobile-table-view .result-table {
  min-width: max-content;
}
body.is-mobile.mobile-table-view .result-table tbody tr,
html.mobile-preview.mobile-table-view .result-table tbody tr {
  cursor: pointer;
}
body.is-mobile .table-footer,
html.mobile-preview .table-footer {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  z-index: 2;
  padding-bottom: 0;
}
body.is-mobile .page,
html.mobile-preview .page {
  padding-bottom: calc(52px + env(safe-area-inset-bottom, 0));
}
body.is-mobile #platformTableBar,
html.mobile-preview #platformTableBar {
  flex-shrink: 0;
}

.mobile-nav {
  height: calc(52px + env(safe-area-inset-bottom, 0));
  padding: 0 0.5rem env(safe-area-inset-bottom, 0);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.mobile-nav-side {
  justify-self: center;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #374151;
  cursor: pointer;
  border-radius: 10px;
}
.mobile-nav-side:active { background: #f3f4f6; }
.mobile-nav-add {
  justify-self: center;
  width: 52px;
  height: 52px;
  border: none;
  background: transparent;
  color: #111827;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.mobile-nav-add:active { background: #f3f4f6; }

.mobile-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(17, 24, 39, 0.35);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.mobile-sheet.hidden { display: none !important; }
.mobile-sheet-panel {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 0.75rem 0.85rem calc(0.85rem + env(safe-area-inset-bottom, 0));
  box-shadow: 0 -8px 32px rgba(0,0,0,0.12);
}
html.mobile-preview .mobile-sheet-panel { max-width: 100%; }
.mobile-sheet-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.mobile-sheet-close {
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: #6b7280;
  padding: 0.25rem 0.45rem;
  cursor: pointer;
}
.mobile-sheet-head input[type="search"] {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font-size: 1rem;
}
.mobile-sheet-go {
  border: none;
  background: var(--accent, #2563eb);
  color: #fff;
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.mobile-search-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.mobile-search-img {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.65rem;
  background: #f9fafb;
  font-size: 0.88rem;
  cursor: pointer;
}

.mobile-record-sheet {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.mobile-record-sheet.hidden { display: none !important; }
html.mobile-preview .mobile-record-sheet {
  left: 50%;
  width: min(420px, 100vw);
  transform: translateX(-50%);
}
.mobile-record-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}
.mobile-record-title {
  flex: 1;
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-record-save {
  border: none;
  background: var(--accent, #2563eb);
  color: #fff;
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.mobile-record-body {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.65rem 0.85rem calc(1rem + env(safe-area-inset-bottom, 0));
}
.mobile-field {
  display: block;
  margin-bottom: 0.85rem;
}
.mobile-field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.mobile-field-input {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  background: #fff;
}
.mobile-field-image-btn {
  width: 100%;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  padding: 0.65rem;
  background: #f9fafb;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.mobile-field-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
.mobile-field-image-hint {
  font-size: 0.85rem;
  color: #6b7280;
}
body.mobile-sheet-open { overflow: hidden; }

