@import url("https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --bg: #f7f0ed;
  --panel: #fffaf7;
  --panel-strong: #ffffff;
  --text: #3b3231;
  --muted: #8b7472;
  --line: #e4d2ce;
  --soft: #f1e1dc;
  --soft-2: #ead5cf;
  --primary: #b99da4;
  --primary-dark: #957780;
  --primary-soft: #ead8dc;
  --danger: #b75d57;
  --warn: #9b7651;
  --ok: #6f8f72;
  --shadow: 0 18px 45px rgba(91, 69, 64, 0.08);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Prompt", "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px clamp(16px, 4vw, 48px);
  background: rgba(255, 250, 247, 0.94);
  backdrop-filter: blur(10px);
  color: var(--text);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(91, 69, 64, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand-logo {
  width: 120px;
  height: 64px;
  object-fit: contain;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  font-weight: 650;
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
  padding: 0 14px;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

button:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(149, 119, 128, 0.12);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fffaf8;
  padding: 0 18px;
}

.primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fffaf8;
}

.danger:hover {
  border-color: #964640;
  background: #964640;
}

.icon-button {
  min-width: 72px;
}

.nav-button {
  display: inline-grid;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.nav-button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fffaf8;
  box-shadow: 0 10px 22px rgba(149, 119, 128, 0.18);
}

.nav-button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

[data-admin-only][hidden] {
  display: none !important;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: min(100%, 620px);
}

.login-name {
  flex: 0 0 auto;
  min-width: max-content;
  max-width: none;
  overflow: visible;
  color: var(--muted);
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(59, 50, 49, 0.34);
  backdrop-filter: blur(4px);
}

.login-overlay[hidden] {
  display: none;
}

.login-dialog {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-dialog button {
  width: 100%;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 26px clamp(12px, 3vw, 32px) 52px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary div,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summary div {
  padding: 18px;
  background: var(--panel-strong);
}

.summary span {
  display: block;
  margin-bottom: 4px;
  font-size: 30px;
  font-weight: 700;
  color: var(--primary-dark);
}

.summary p {
  margin-bottom: 0;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 20px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--soft);
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  color: #5b4a48;
  font-weight: 600;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin-top: 26px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-weight: 400;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(185, 157, 164, 0.2);
}

textarea {
  resize: vertical;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: #5b4a48;
  font-weight: 600;
}

.camera-capture-field {
  position: relative;
  margin-bottom: 14px;
}

.camera-actions {
  display: grid;
  grid-template-columns: minmax(180px, max-content);
  gap: 10px;
  align-items: center;
}

.camera-actions .primary {
  min-height: 44px;
}

.camera-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.camera-capture-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.camera-preview {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.camera-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 6px;
  background: #fbf5f2;
}

.camera-preview figcaption {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-word;
}

.camera-preview button {
  min-height: 32px;
}

.camera-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(59, 50, 49, 0.76);
}

.camera-modal[hidden] {
  display: none;
}

.camera-dialog {
  width: min(720px, 100%);
  display: grid;
  gap: 12px;
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.camera-video {
  width: 100%;
  max-height: min(68vh, 620px);
  border-radius: 8px;
  background: #000;
  object-fit: contain;
}

.camera-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
}

.camera-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.password-field {
  position: relative;
  width: 100%;
}

.password-field input {
  padding-right: 46px;
}

.password-field .password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 34px;
  min-height: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  transform: translateY(-50%);
}

.password-field .password-toggle:hover {
  border-color: transparent;
  background: var(--soft);
  color: var(--text);
  box-shadow: none;
  transform: translateY(-50%);
}

.password-field .password-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(185, 157, 164, 0.24);
}

.password-field .password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.grid {
  display: grid;
  gap: 12px;
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-panel .three {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-panel .three label:first-child {
  grid-column: 1 / -1;
}

.filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(4, minmax(140px, 150px));
  gap: 10px;
  margin-bottom: 14px;
}

.form-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.report-list {
  display: grid;
  gap: 10px;
  max-height: none;
  overflow: auto;
  padding-right: 4px;
}

.report-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(6, minmax(118px, 140px)) 96px;
  gap: 10px;
  margin-bottom: 12px;
}

.report-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.public-view-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.report-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  background: var(--panel-strong);
}

.report-table th,
.report-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.report-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--soft);
  color: #594744;
  font-weight: 700;
}

.report-table td {
  white-space: normal;
}

.report-table th:nth-child(1),
.report-table td:nth-child(1) {
  width: 110px;
}

.report-table th:nth-child(2),
.report-table td:nth-child(2) {
  width: 220px;
}

.report-date {
  white-space: nowrap;
}

.report-product {
  display: grid;
  gap: 5px;
}

.report-product strong {
  color: var(--text);
}

.report-product span {
  color: var(--muted);
  font-size: 13px;
}

.report-detail {
  display: grid;
  gap: 8px;
}

.report-detail p {
  margin: 0;
  white-space: pre-wrap;
}

.report-detail span {
  font-weight: 700;
}

.report-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, 220px);
  gap: 10px;
  align-items: start;
  justify-content: start;
  margin-top: 4px;
}

.report-images figure {
  margin: 0;
}

.report-images a,
.operation-images a {
  display: block;
  width: fit-content;
  color: inherit;
  line-height: 0;
  text-decoration: none;
}

.report-images img {
  display: block;
  width: 220px;
  height: 165px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fbf5f2;
}

.report-images figcaption {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-word;
}

.report-qr {
  display: none;
  justify-items: center;
  gap: 4px;
  width: 92px;
  margin-top: 14px;
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.report-qr[hidden] {
  display: none !important;
}

.report-qr img {
  display: block;
  width: 82px;
  height: 82px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.operation-search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) 120px;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.operation-search label {
  margin-bottom: 0;
}

.operation-search input,
.operation-search select,
.operation-search button {
  height: 44px;
  min-height: 44px;
}

.operation-record h2 {
  margin-bottom: 12px;
  text-align: center;
  font-size: 20px;
}

.operation-product-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.operation-product-info {
  display: grid;
  gap: 8px;
}

.operation-product-info span {
  font-weight: 600;
}

.operation-product-picture {
  justify-self: end;
  margin: 0;
}

.operation-product-picture img {
  width: 150px;
  height: 112px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #fbf5f2;
}

.operation-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  background: var(--panel-strong);
}

.operation-table th,
.operation-table td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.operation-table th {
  background: var(--soft);
  color: #594744;
  text-align: center;
}

.operation-table th:nth-child(1),
.operation-table td:nth-child(1) {
  width: 120px;
}

.operation-table th:nth-child(2),
.operation-table td:nth-child(2) {
  width: auto;
}

.operation-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, 150px);
  gap: 8px;
  justify-content: start;
  margin-top: 8px;
}

.operation-images figure {
  margin: 0;
}

.operation-images.is-single {
  grid-template-columns: 150px;
}

.operation-images img {
  display: block;
  width: 150px;
  height: 112px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #fbf5f2;
}

.operation-description {
  display: grid;
  gap: 8px;
  white-space: pre-wrap;
}

.operation-description p {
  margin: 0;
}

.report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-strong);
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.user-form {
  margin-bottom: 16px;
}

.sub-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.58);
}

.sub-panel[hidden] {
  display: none;
}

.user-list {
  display: grid;
  gap: 8px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(160px, 1fr) 90px 90px minmax(220px, auto);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-strong);
}

.user-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-actions button {
  min-height: 34px;
  padding: 0 10px;
}

.log-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  background: var(--panel-strong);
}

.log-table th,
.log-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px;
  text-align: left;
  vertical-align: top;
}

.log-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--soft);
  color: #594744;
  font-weight: 700;
}

.log-table pre {
  margin: 0;
  color: var(--text);
  font: inherit;
  white-space: pre-wrap;
}

.report-card:hover {
  border-color: var(--primary);
  box-shadow: 0 12px 24px rgba(149, 119, 128, 0.12);
  transform: translateY(-1px);
}

.report-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.meta,
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.badges {
  margin-top: 10px;
}

.badge {
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--soft);
  color: #5d4a47;
}

.status-closed {
  background: #e6f0e4;
  color: var(--ok);
}

.message {
  min-height: 20px;
  margin-bottom: 0;
  color: var(--muted);
}

.detail-panel {
  margin-top: 18px;
}

.actions {
  display: flex;
  gap: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.detail-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.62);
}

.detail-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.content-block {
  margin-bottom: 18px;
  white-space: pre-wrap;
  line-height: 1.55;
}

.edit-report-form {
  display: grid;
  gap: 12px;
}

.attachment-edit-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.attachment-edit-item {
  display: grid;
  gap: 8px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.68);
}

.attachment-edit-preview img,
.attachment-edit-preview video {
  width: 100%;
  height: 140px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #000;
}

.attachment-edit-item > span {
  color: var(--muted);
  font-size: 13px;
  word-break: break-word;
}

.inline-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--danger);
  font-weight: 600;
}

.inline-check input {
  width: auto;
}

.edit-actions {
  gap: 8px;
}

.edit-actions .danger {
  margin-right: auto;
}

.attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.attachments img,
.attachments video,
.attachments iframe {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.attachments img,
.attachments video {
  max-height: 420px;
  background: #000;
  object-fit: contain;
}

.attachments video {
  min-height: 260px;
}

.attachments iframe {
  height: 420px;
  background: var(--panel-strong);
}

.pdf-preview {
  margin: 0;
}

.pdf-header-logo {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm;
  }

  body {
    background: #fff;
    color: #000;
  }

  .topbar,
  .report-filters,
  .operation-search,
  .report-actions,
  .public-view-note,
  #reportMessage,
  #operationMessage {
    display: none !important;
  }

  .shell {
    padding: 0;
    max-width: none;
  }

  .panel {
    position: relative;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }

  .panel-head {
    justify-content: center;
    min-height: 15mm;
    margin-bottom: 8px;
  }

  .panel-head h2 {
    font-size: 15px;
    text-align: center;
  }

  .pdf-header-logo {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 11 !important;
    display: block !important;
    width: 30mm !important;
    height: 14mm !important;
    object-fit: contain !important;
  }

  .table-wrap {
    overflow: visible;
    border: 1px solid #333;
    border-radius: 0;
  }

  .report-table {
    min-width: 0;
    table-layout: fixed;
    font-size: 9px;
    line-height: 1.35;
  }

  .report-table th {
    position: static;
    background: #d9d9d9 !important;
    color: #000;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-table th,
  .report-table td {
    border: 1px solid #333;
    padding: 4px;
  }

  .report-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .report-table th:nth-child(1),
  .report-table td:nth-child(1) {
    width: 18mm;
  }

  .report-table th:nth-child(2),
  .report-table td:nth-child(2) {
    width: 34mm;
  }

  .report-product {
    gap: 2px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .report-product strong {
    font-size: 8px;
    line-height: 1.25;
  }

  .report-product span {
    font-size: 4px;
    line-height: 1.2;
  }

  .report-detail {
    gap: 5px;
  }

  .report-product span,
  .report-images figcaption {
    color: #333;
  }

  .report-images {
    grid-template-columns: repeat(3, 32mm) !important;
    gap: 3mm !important;
    justify-content: start !important;
    align-items: start !important;
  }

  .report-images figure,
  .report-images a {
    display: block !important;
    width: 32mm !important;
    max-width: 32mm !important;
  }

  .report-images img {
    width: 32mm !important;
    max-width: 32mm !important;
    height: 24mm !important;
    max-height: 24mm !important;
    object-fit: contain !important;
    border-radius: 0 !important;
  }

  .report-qr {
    position: fixed !important;
    right: 8mm !important;
    bottom: 6mm !important;
    z-index: 10 !important;
    display: grid !important;
    width: 22mm !important;
    margin: 0 !important;
    color: #000 !important;
    font-size: 6px !important;
    line-height: 1.1 !important;
    text-align: center !important;
    text-decoration: none !important;
  }

  .report-qr img {
    width: 20mm !important;
    height: 20mm !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  .report-qr span {
    display: block !important;
    margin-top: 1mm !important;
    white-space: nowrap !important;
  }

  .operation-panel > .panel-head {
    display: none;
  }

  .operation-record {
    display: block !important;
  }

  .operation-record h2 {
    min-height: 15mm;
    margin-bottom: 4px;
    font-size: 15px;
  }

  .operation-product-info {
    gap: 4px;
    font-size: 10px;
  }

  .operation-product-head {
    grid-template-columns: minmax(0, 1fr) 26mm;
    gap: 4mm;
    margin-bottom: 8px;
  }

  .operation-product-picture img {
    width: 26mm;
    height: 18mm;
    border: 0;
  }

  .operation-table-wrap {
    overflow: visible;
    border: 1px solid #333;
    border-radius: 0;
  }

  .operation-table {
    min-width: 0;
    table-layout: fixed;
    font-size: 9px;
    line-height: 1.35;
  }

  .operation-table th,
  .operation-table td {
    border: 1px solid #333;
    padding: 4px;
  }

  .operation-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .operation-table th:nth-child(1),
  .operation-table td:nth-child(1) {
    width: 22mm;
  }

  .operation-table th:nth-child(2),
  .operation-table td:nth-child(2) {
    width: auto;
    text-align: left;
  }

  .operation-images {
    grid-template-columns: repeat(3, 32mm) !important;
    gap: 3mm !important;
    justify-content: start !important;
    align-items: start !important;
  }

  .operation-images.is-single {
    grid-template-columns: 32mm !important;
  }

  .operation-images figure,
  .operation-images a {
    display: block !important;
    width: 32mm !important;
    max-width: 32mm !important;
    color: #000 !important;
    line-height: 0 !important;
    text-decoration: none !important;
  }

  .operation-images img {
    display: block !important;
    width: 32mm !important;
    max-width: 32mm !important;
    height: 24mm !important;
    max-height: 24mm !important;
    object-fit: contain !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  .operation-description {
    gap: 4px;
  }
}

@media (max-width: 1100px) {
  .topbar {
    align-items: flex-start;
  }

  .top-actions {
    min-width: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .report-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-row {
    grid-template-columns: minmax(140px, 1fr) minmax(180px, 1fr) 88px 96px;
  }

  .user-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .attachments {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (max-width: 760px) {
  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 18px;
  }

  .topbar {
    gap: 12px;
    padding: 14px 12px;
  }

  .topbar > div:first-child {
    width: 100%;
  }

  .brand {
    min-width: 0;
  }

  .top-actions {
    gap: 8px;
  }

  .login-name {
    flex: 1 0 100%;
    min-width: 0;
    width: 100%;
  }

  .nav-button,
  .top-actions > button {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 96px;
    justify-content: center;
    min-height: 42px;
    padding: 0 10px;
  }

  .shell {
    padding: 16px 10px 36px;
  }

  .panel {
    padding: 14px;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-head > button,
  .panel-head .report-actions,
  .report-actions button,
  .form-footer button,
  .actions button,
  .actions select {
    width: 100%;
  }

  .summary,
  .workspace,
  .detail-grid,
  .filters,
  .report-filters,
  .operation-search,
  .camera-actions,
  .two,
  .three,
  .form-panel .three {
    grid-template-columns: 1fr;
  }

  .summary {
    gap: 10px;
    margin-bottom: 14px;
  }

  .summary div {
    padding: 14px;
  }

  .summary span {
    font-size: 24px;
  }

  .form-footer,
  .report-actions,
  .actions,
  .edit-actions,
  .camera-dialog-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .check-row {
    margin-top: 0;
  }

  .report-list {
    padding-right: 0;
  }

  .report-table {
    min-width: 680px;
  }

  .operation-table {
    min-width: 720px;
  }

  .report-images {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .report-images img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .operation-images {
    grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  }

  .operation-images.is-single {
    grid-template-columns: 150px;
  }

  .operation-images img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .attachment-edit-list,
  .attachments {
    grid-template-columns: 1fr;
  }

  .attachments img,
  .attachments video {
    max-height: 320px;
  }

  .attachments video {
    min-height: 200px;
  }

  .attachments iframe {
    height: 320px;
  }

  .camera-dialog {
    padding: 10px;
  }

  .camera-video {
    max-height: 62vh;
  }

  .user-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .user-actions {
    justify-content: stretch;
  }

  .user-actions button {
    flex: 1 1 150px;
  }
}

@media (max-width: 520px) {
  .login-overlay {
    align-items: start;
    padding: 12px;
  }

  .login-dialog {
    margin-top: 24px;
    padding: 18px;
  }

  .nav-button,
  .top-actions > button {
    flex-basis: calc(50% - 8px);
  }

  .filters,
  .report-filters,
  .operation-search {
    gap: 8px;
  }

  .report-table {
    min-width: 620px;
  }

  .operation-table {
    min-width: 640px;
  }
}

@media print {
  .topbar button,
  .form-panel,
  .list-panel,
  #closeDetail {
    display: none;
  }

  body {
    background: #fff;
  }

  .shell {
    padding: 0;
  }

  .panel {
    border: 0;
  }
}
