:root {
  --bg: #f3f7fc;
  --card: #ffffff;
  --text: #16233a;
  --muted: #6a7b93;
  --muted-2: #8b9ab0;
  --line: #e1e9f3;
  --primary: #0f6fbf;
  --primary-dark: #0b5797;
  --primary-soft: #e7f1fb;
  --green: #16785c;
  --green-soft: #e6f5ef;
  --amber: #9a5c00;
  --amber-soft: #fff4dd;
  --red: #b42318;
  --red-soft: #fdecea;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(21, 45, 80, .05);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--primary); }

button, input, select, textarea { font: inherit; color: inherit; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .2px;
  white-space: nowrap;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(135deg, #1384d8, #0b5797);
  font-weight: 800;
  font-size: 15px;
  flex: none;
}
.mode-badge {
  font-size: 12px;
  line-height: 1;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid #c6e7da;
  white-space: nowrap;
}
.mode-badge.cloud {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: #f0d9a8;
}
.mode-badge.warn {
  background: var(--red-soft);
  color: var(--red);
  border-color: #f3c5c0;
}
.topbar-actions { margin-left: auto; }

.tabs {
  display: flex;
  gap: 6px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 12px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tab.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: #cfe3f8;
  font-weight: 600;
}

/* ------------------------------------------------------------------ layout */
.view {
  max-width: 1120px;
  margin: 0 auto;
  padding: 4px 14px calc(40px + var(--safe-bottom));
}
.banner-wrap { max-width: 1120px; margin: 0 auto; padding: 0 14px; }
.banner {
  border-radius: 12px;
  padding: 10px 13px;
  margin: 4px 0 10px;
  font-size: 13.5px;
  border: 1px solid;
}
.banner.info { background: var(--primary-soft); border-color: #cfe3f8; color: #0c4f88; }
.banner.warn { background: var(--amber-soft); border-color: #f0d9a8; color: #7a4900; }
.banner.danger { background: var(--red-soft); border-color: #f3c5c0; color: #8f1c13; }
.banner b { font-weight: 700; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 0 0 14px;
}
.card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.card-title { font-size: 16px; font-weight: 700; margin: 0; }
.card-sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.section-title { font-size: 14px; font-weight: 700; margin: 18px 0 10px; color: #2a3a52; }
.section-title:first-child { margin-top: 0; }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-danger { background: #fff; border-color: #f0c8c3; color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red-soft); }
.btn-soft { background: var(--primary-soft); border-color: #cfe3f8; color: var(--primary); }
.btn-sm { min-height: 34px; padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 34px;
  height: 34px;
  min-height: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}
.btn-icon:hover { background: #f4f8fd; }

/* ------------------------------------------------------------------ inputs */
.field { margin: 0 0 12px; }
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #34455f;
  margin-bottom: 5px;
}
.field-hint { margin: 4px 0 0; font-size: 12.5px; color: var(--muted-2); }
.input, .textarea, .select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d4dfec;
  border-radius: 10px;
  background: #fff;
  font-size: 16px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 111, 191, .12);
}
.textarea { resize: vertical; min-height: 88px; line-height: 1.6; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #7b8aa0 50%), linear-gradient(135deg, #7b8aa0 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; color: #34455f; }
.check-row input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.form-error { color: var(--red); font-size: 13px; margin: 8px 0 0; }

/* ----------------------------------------------------------------- capture */
.upload-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.upload-actions .btn { flex: 1 1 150px; min-height: 52px; font-size: 15px; }
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 9px;
  margin: 14px 0;
}
.preview-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #eef3f9;
}
.preview-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 28, 45, .65);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.preview-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 5px;
  font-size: 10px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .6));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-meta { color: var(--muted); font-size: 13px; }
.capture-note { margin: 10px 0 0; }

/* ----------------------------------------------------------------- records */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.toolbar .search { flex: 1 1 220px; }
.toolbar .input { min-height: 40px; background: #fff; }
.toolbar-count { color: var(--muted); font-size: 13px; }

.record-list { display: flex; flex-direction: column; gap: 10px; }
.record-card {
  display: flex;
  gap: 10px;
  padding: 13px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.record-card:hover { border-color: #c7dbf1; }
.record-select { flex: none; padding-top: 2px; }
.record-select input { width: 19px; height: 19px; accent-color: var(--primary); }
.record-main { min-width: 0; flex: 1; }
.record-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.record-title { font-weight: 700; font-size: 15.5px; margin: 0; overflow-wrap: anywhere; }
.record-code { color: var(--muted-2); font-size: 12px; font-family: ui-monospace, Consolas, monospace; }
.record-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.record-summary { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f4f8fd;
  border: 1px solid #e3ecf7;
  color: #40536c;
  border-radius: 7px;
  padding: 3px 7px;
  font-size: 12px;
  max-width: 100%;
}
.chip-tag b { font-weight: 600; color: #22364f; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.status-pending { background: #f0f3f7; color: #5e6d82; }
.status-processing { background: var(--primary-soft); color: var(--primary); }
.status-done { background: var(--green-soft); color: var(--green); }
.status-error { background: var(--red-soft); color: var(--red); }
.status-warn { background: var(--amber-soft); color: var(--amber); }
.error-text { color: var(--amber); font-size: 12.5px; margin-top: 6px; overflow-wrap: anywhere; }
.error-text.danger { color: var(--red); }

.empty {
  text-align: center;
  padding: 46px 16px;
  color: var(--muted);
}
.empty .empty-icon { font-size: 34px; margin-bottom: 8px; }

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin .8s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ detail */
.detail-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.detail-title-wrap { flex: 1 1 320px; min-width: 0; }
.detail-title-input { font-size: 19px; font-weight: 700; padding: 8px 10px; }
.detail-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 9px;
}
.image-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #eef3f9;
  position: relative;
  cursor: zoom-in;
}
.image-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.image-caption { padding: 5px 7px; font-size: 11px; color: var(--muted); background: #fff; display: flex; justify-content: space-between; gap: 5px; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.field-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fcfdff;
  min-width: 0;
}
.field-block.wide { grid-column: 1 / -1; }
.plain-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.field-block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.field-block-label { font-weight: 700; font-size: 13.5px; color: #253752; }
.field-block-hint { font-size: 12px; color: var(--muted-2); margin: 0 0 7px; }
.source-badge {
  display: inline-block;
  background: #eef4fb;
  color: #4d6a8c;
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 11px;
  white-space: nowrap;
}
.source-badge.manual {
  background: var(--amber-soft);
  color: var(--amber);
}
.multi-field .chips { margin-bottom: 0; }
.custom-multi {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.custom-multi .input {
  min-height: 36px;
  padding: 6px 9px;
  font-size: 14px;
}
.custom-multi .btn { flex: none; }
.field-block .input, .field-block .select, .field-block .textarea { background: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 1px solid #dbe5f1; border-radius: 999px; background: #fff; font-size: 12.5px; color: #3b4e67; cursor: pointer; }
.chip input { accent-color: var(--primary); }
.chip.on { background: var(--primary-soft); border-color: #bad7f2; color: var(--primary); }

.table-field { margin-top: 4px; }
.table-scroll-hint { display: none; font-size: 11.5px; color: var(--muted-2); margin: 2px 0 5px; }
@media (max-width: 760px) {
  .table-scroll-hint { display: block; }
}
.ftable-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.ftable { width: 100%; border-collapse: collapse; min-width: 620px; }
.ftable th, .ftable td { padding: 6px; border-bottom: 1px solid #eef3f9; text-align: left; vertical-align: top; }
.ftable th { font-size: 12px; color: var(--muted); font-weight: 600; background: #f8fbfe; white-space: nowrap; }
.ftable tr:last-child td { border-bottom: 0; }
.ftable .input { min-height: 36px; padding: 6px 8px; font-size: 14px; border-radius: 7px; }
.ftable .row-actions { width: 36px; text-align: center; }
.table-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 7px; }
.table-count { color: var(--muted-2); font-size: 12px; }

.ocr-list { display: flex; flex-direction: column; gap: 8px; }
.ocr-item { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.ocr-item summary { padding: 9px 11px; cursor: pointer; font-size: 13px; font-weight: 600; color: #33465f; list-style: none; }
.ocr-item summary::-webkit-details-marker { display: none; }
.ocr-item summary::before { content: "▸"; display: inline-block; margin-right: 6px; color: var(--muted); transition: transform .15s; }
.ocr-item[open] summary::before { transform: rotate(90deg); }
.ocr-text { margin: 0; padding: 10px 12px; border-top: 1px solid #eef3f9; background: #fbfdff; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; line-height: 1.65; color: #3a4b63; }
.ocr-actions { padding: 0 12px 10px; }

/* ------------------------------------------------------------------ fields */
.def-list { display: flex; flex-direction: column; gap: 8px; }
.def-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.def-row.disabled { background: #f8fafc; opacity: .7; }
.def-check { flex: none; }
.def-check input { width: 18px; height: 18px; accent-color: var(--primary); }
.def-info { min-width: 0; flex: 1; }
.def-label { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.def-sub { color: var(--muted); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.def-badge { display: inline-block; background: #f1f5fa; color: #536983; border-radius: 5px; padding: 0 5px; font-size: 11px; margin-right: 4px; }
.def-actions { display: flex; gap: 4px; flex: none; }
.dirty-badge { background: var(--amber-soft); color: var(--amber); border: 1px solid #f0d9a8; border-radius: 999px; padding: 2px 8px; font-size: 12px; }

/* ------------------------------------------------------------------ modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 25, 42, .45);
  z-index: 60;
}
.modal {
  position: fixed;
  z-index: 70;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 24px));
  max-height: min(88vh, 900px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(10, 25, 45, .28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-title { font-weight: 700; font-size: 16px; margin: 0; flex: 1; }
.modal-body { padding: 16px; overflow: auto; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: #fbfdff; }
.modal-close { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 5px; }
.column-row { display: grid; grid-template-columns: 1fr 1.3fr 110px 1.6fr 34px; gap: 6px; align-items: center; margin-bottom: 6px; }
.column-row .input, .column-row .select { min-height: 36px; padding: 6px 8px; font-size: 13px; border-radius: 7px; }
.column-head { font-size: 11px; color: var(--muted-2); margin-bottom: 4px; }
.columns-editor { border: 1px dashed #d7e3f0; border-radius: 10px; padding: 10px; background: #fbfdff; }

/* ---------------------------------------------------------------- settings */
.engine-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 9px; }
.engine-option {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 12px;
  background: #fff;
  cursor: pointer;
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.engine-option input { margin-top: 3px; accent-color: var(--primary); flex: none; }
.engine-option > span:last-child { flex: 1; min-width: 0; }
.engine-option.active { border-color: #9dc7ee; background: #f6faff; box-shadow: inset 0 0 0 1px #cfe3f8; }
.engine-name { display: block; font-weight: 700; font-size: 13.5px; }
.engine-desc { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.45; }
.warning-box {
  background: var(--amber-soft);
  border: 1px solid #f0d9a8;
  color: #6f4400;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.6;
  margin: 10px 0;
}
.privacy-box {
  background: #f4f9ff;
  border: 1px solid #dbeaf9;
  color: #35506e;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.6;
  margin: 10px 0;
}
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.preset-btn { font-size: 12px; padding: 5px 9px; min-height: 30px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.danger-zone { border-color: #f0c8c3; background: #fffafa; }
.danger-zone .card-title { color: var(--red); }

/* ------------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  transform: translate(-50%, 20px);
  max-width: min(520px, calc(100vw - 32px));
  background: #1f3048;
  color: #fff;
  border-radius: 10px;
  padding: 10px 15px;
  font-size: 13.5px;
  box-shadow: 0 8px 28px rgba(8, 20, 40, .25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 100;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #8f1c13; }
.toast.success { background: #145f4a; }

/* -------------------------------------------------------------- image view */
.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(6, 12, 20, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.image-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.image-viewer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

/* ------------------------------------------------------------------- login */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 500px at 10% 0%, #e5f1fd 0%, transparent 60%),
    radial-gradient(700px 500px at 100% 100%, #e8f5f0 0%, transparent 55%),
    var(--bg);
  padding: 24px 16px;
}
.login-card {
  width: min(400px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(17, 42, 75, .1);
  padding: 26px 24px 20px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-brand .brand-mark { width: 44px; height: 44px; font-size: 21px; border-radius: 13px; }
.login-brand h1 { font-size: 19px; margin: 0; }
.login-brand p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.login-form .field-label { margin-bottom: 7px; }
.login-form .input { min-height: 48px; }
.login-form .btn { margin-top: 14px; min-height: 48px; }
.login-note { color: var(--muted-2); font-size: 12px; margin: 18px 0 0; line-height: 1.6; }
.login-error { min-height: 18px; }

/* -------------------------------------------------------------- responsive */
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar-inner { padding: 8px 12px; }
  .brand { font-size: 15px; }
  .brand-mark { width: 28px; height: 28px; }
  .view { padding-left: 12px; padding-right: 12px; }
  .card { padding: 13px; border-radius: 12px; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1 1 auto; }
  .field-grid { grid-template-columns: 1fr; }
  .def-row { flex-wrap: wrap; }
  .def-actions { margin-left: auto; }
  .modal { width: calc(100vw - 16px); max-height: 92vh; }
  .column-row { grid-template-columns: 1fr 1fr; }
  .column-row .column-options { grid-column: 1 / -1; }
  .kv { grid-template-columns: 92px 1fr; }
}
