:root {
  color-scheme: light;
  --bg: #f7faf8;
  --surface: #ffffff;
  --surface-soft: #f1fbf5;
  --ink: #1a1a1a;
  --muted: #686f6b;
  --line: #dfe8e2;
  --brand: #00a651;
  --brand-dark: #008f45;
  --brand-soft: #e7f8ef;
  --accent: #7d7d00;
  --danger: #b42318;
  --ok: #16a34a;
  --shadow: 0 16px 38px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Montserrat, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}

.login-visual {
  min-height: 100vh;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(rgba(5, 35, 32, 0.38), rgba(5, 35, 32, 0.7)),
    url("https://images.unsplash.com/photo-1493238792000-8113da705763?auto=format&fit=crop&w=1600&q=80") center/cover;
  color: white;
}

.login-visual h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(2.7rem, 6vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.login-visual p {
  max-width: 560px;
  margin: 20px 0 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.86);
}

.login-panel {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px;
}

.login-card {
  width: min(100%, 430px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: block;
  object-fit: contain;
  background: white;
  border: 1px solid var(--line);
  padding: 4px;
  box-shadow: 0 8px 20px rgba(15, 36, 33, 0.08);
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.field label {
  font-size: 0.9rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-height: 46px;
  background: white;
  color: var(--ink);
  outline: none;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.14);
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.between {
  justify-content: space-between;
}

.btn {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  color: var(--ink);
  background: #eef2ef;
}

.btn.primary {
  color: white;
  background: var(--brand);
}

.btn.primary:hover {
  background: var(--brand-dark);
}

.btn.ghost {
  background: transparent;
  color: var(--brand-dark);
}

.btn.danger {
  color: white;
  background: var(--danger);
}

.demo-hint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 256px 1fr;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 78px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--brand-dark);
  background: var(--surface-soft);
}

.app-shell.sidebar-collapsed .sidebar {
  padding: 18px;
  align-items: center;
}

.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .nav span,
.app-shell.sidebar-collapsed #logout span {
  display: none;
}

.app-shell.sidebar-collapsed .brand-lockup {
  margin: 0;
}

.app-shell.sidebar-collapsed .sidebar-head {
  flex-direction: column;
}

.app-shell.sidebar-collapsed .nav button,
.app-shell.sidebar-collapsed #logout {
  width: 42px;
  padding: 0;
  justify-content: center;
}

.nav {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--brand) transparent;
}

.nav::-webkit-scrollbar {
  width: 8px;
}

.nav::-webkit-scrollbar-thumb {
  background: var(--brand);
  border-radius: 999px;
}

.nav::-webkit-scrollbar-track {
  background: transparent;
}

.nav button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  color: var(--brand-dark);
  background: var(--surface-soft);
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 72px;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(246, 248, 247, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.content {
  padding: 28px;
  display: grid;
  gap: 22px;
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.section-head > div {
  min-width: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat,
.panel,
.item-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(15, 36, 33, 0.04);
}

.stat {
  padding: 18px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.bar-chart {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) 2fr auto;
  gap: 10px;
  align-items: center;
}

.bar-row span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-weight: 800;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ece9;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.panel.grid-2,
.panel.grid-3 {
  align-items: end;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.form-wide {
  grid-column: 1 / -1;
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.managed-companies {
  display: grid;
  gap: 8px;
}

.notice {
  padding: 14px;
  border-radius: 8px;
  display: grid;
  gap: 5px;
  line-height: 1.45;
}

.notice.warn {
  border: 1px solid #f8d36b;
  background: #fffbeb;
  color: #713f12;
}

.notice.danger {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

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

.item-card {
  padding: 16px;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.checklist-card {
  border-left: 4px solid var(--brand);
}

.checklist-card-head,
.checklist-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.checklist-card-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.checklist-card-title strong {
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.checklist-card-title span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.checklist-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.checklist-meta span {
  min-height: 42px;
  padding: 8px;
  display: grid;
  align-content: center;
  gap: 3px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.checklist-meta strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.muted {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.pill {
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 0.78rem;
  font-weight: 900;
  background: #edf2f7;
  color: #334155;
}

.pill.ok {
  background: #dcfce7;
  color: #008f45;
}

.pill.warn {
  background: #fef3c7;
  color: #92400e;
}

.pill.danger {
  background: #fee2e2;
  color: #991b1b;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.photo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.photo-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.photo-box {
  border: 1px dashed #a7b8b2;
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfc;
  display: grid;
  gap: 8px;
}

.photo-box input {
  font-size: 0.82rem;
}

.thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.thumbs img {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.photo-gallery {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 112px));
  gap: 12px;
  align-items: start;
}

.photo-preview {
  display: grid;
  gap: 8px;
  width: 112px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: left;
}

.photo-preview img {
  width: 112px;
  height: 84px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1f5f3;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  background: rgba(7, 20, 18, 0.94);
}

.photo-viewer-head {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: white;
}

.photo-viewer img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.signature-pad {
  width: 100%;
  min-height: 150px;
  border: 1px dashed #8aa39b;
  border-radius: 8px;
  background: #ffffff;
  touch-action: none;
}

.signature-preview {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.email-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

body.viewer-open {
  overflow: hidden;
}

.qr-card {
  display: inline-grid;
  gap: 6px;
  justify-items: center;
  color: var(--brand-dark);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.qr-card img {
  width: 86px;
  height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 4px;
}

.qr-scanner {
  display: grid;
  gap: 14px;
}

.qr-video {
  width: 100%;
  max-height: 420px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1f1c;
}

.qr-manual {
  display: grid;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #10201d;
  color: white;
  box-shadow: var(--shadow);
}

.empty {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .login-shell,
  .app-shell,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 42vh;
  }

  .sidebar {
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-shell.sidebar-collapsed .sidebar {
    align-items: stretch;
  }

  .app-shell.sidebar-collapsed .brand-copy,
  .app-shell.sidebar-collapsed .nav span,
  .app-shell.sidebar-collapsed #logout span {
    display: inline;
  }

  .app-shell.sidebar-collapsed .sidebar-head {
    flex-direction: row;
  }

  .app-shell.sidebar-collapsed .nav {
    display: none;
  }

  .app-shell.sidebar-collapsed #logout {
    display: none;
  }

  .nav {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
  }

  .nav button {
    white-space: nowrap;
  }

  .stats-grid,
  .photo-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: static;
  }

  .table-wrap {
    overflow: visible;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tr {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    box-shadow: 0 8px 22px rgba(15, 36, 33, 0.04);
  }

  .table-wrap td {
    min-height: 42px;
    padding: 10px 0;
    border-bottom: 1px solid #edf2ef;
    display: grid;
    grid-template-columns: minmax(96px, 34%) 1fr;
    gap: 12px;
    align-items: start;
  }

  .table-wrap td:last-child {
    border-bottom: 0;
  }

  .table-wrap td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
  }
}

@media (max-width: 620px) {
  .login-visual,
  .login-panel,
  .content,
  .topbar {
    padding: 20px;
  }

  .section-head,
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .login-shell {
    min-height: 100vh;
  }

  .login-visual {
    min-height: 34vh;
  }

  .login-visual h1 {
    font-size: 2.25rem;
    line-height: 1;
  }

  .login-visual p {
    font-size: 0.96rem;
  }

  .login-card {
    padding: 20px;
  }

  .sidebar {
    padding: 16px;
  }

  .sidebar-head .brand-lockup {
    margin-bottom: 0;
  }

  .nav button {
    flex: 0 0 auto;
  }

  .topbar .row,
  .item-card .row.between {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar .pill,
  .item-card .pill {
    width: 100%;
    justify-content: center;
  }

  .panel,
  .item-card,
  .stat {
    padding: 14px;
  }

  .stats-grid,
  .photo-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
    min-height: 46px;
    white-space: normal;
    text-align: center;
  }

  .field {
    margin-top: 12px;
  }

  .photo-box {
    padding: 12px;
  }

  .table-wrap tr {
    padding: 14px;
  }

  .table-wrap td {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .bar-row {
    grid-template-columns: 1fr auto;
  }

  .bar-track {
    grid-column: 1 / -1;
    order: 3;
  }

  .qr-card {
    width: 100%;
    justify-items: center;
  }

  .qr-card img {
    width: 112px;
    height: 112px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }
}

@media (max-width: 820px) and (orientation: portrait) {
  body {
    background:
      linear-gradient(180deg, #e7f8ef 0, #f7faf8 230px, #f7faf8 100%);
  }

  .app-shell {
    position: relative;
  }

  .sidebar {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 30;
    width: auto;
    height: auto;
    padding: 0;
    gap: 8px;
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .app-shell.mobile-menu-open .sidebar {
    width: min(306px, calc(100vw - 28px));
    max-height: min(74vh, 620px);
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
    overflow: hidden;
  }

  .sidebar-head {
    justify-content: flex-start;
  }

  .sidebar .brand-lockup,
  .sidebar-head .brand-lockup {
    display: none;
  }

  .icon-btn {
    width: 52px;
    height: 52px;
    color: white;
    background: var(--brand);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 12px 26px rgba(0, 166, 81, 0.3);
  }

  .nav {
    display: none;
    margin: 0;
    padding: 8px 0 0;
    gap: 6px;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
    max-height: calc(74vh - 128px);
    overflow-y: auto;
    overflow-x: hidden;
  }

  .nav button {
    width: 100%;
    min-height: 48px;
    justify-content: flex-start;
    white-space: normal;
    background: transparent;
  }

  #logout {
    display: none;
    margin-top: 0 !important;
  }

  .app-shell.mobile-menu-open .nav {
    display: grid;
  }

  .app-shell.mobile-menu-open .nav button,
  .app-shell.mobile-menu-open #logout {
    width: 100%;
    padding: 0 12px;
    justify-content: flex-start;
  }

  .app-shell.mobile-menu-open #logout {
    display: inline-flex;
  }

  .main {
    padding-top: 0;
    padding-bottom: 76px;
  }

  .topbar {
    min-height: auto;
    margin: 0 12px 12px;
    padding: 15px 16px;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(219, 229, 225, 0.9);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(12px);
  }

  .topbar h2 {
    font-size: 1.35rem;
    line-height: 1.1;
  }

  .topbar .row {
    gap: 8px;
  }

  .content {
    padding: 0 12px 18px;
    gap: 14px;
  }

  .section-head {
    padding: 2px 2px 0;
    gap: 10px;
  }

  .section-head h2 {
    font-size: 1.35rem;
    line-height: 1.15;
  }

  .section-head p {
    margin-top: 4px;
    font-size: 0.86rem;
    line-height: 1.45;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat,
  .panel,
  .item-card,
  .table-wrap tr {
    border-color: rgba(219, 229, 225, 0.95);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
  }

  .stat {
    min-height: 104px;
    padding: 14px;
    background: linear-gradient(180deg, #ffffff 0, #f8fbfa 100%);
  }

  .stat .muted,
  .stat > span {
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .stat strong {
    margin-top: 10px;
    font-size: 1.85rem;
    line-height: 1;
    color: var(--brand-dark);
  }

  .panel,
  .item-card {
    background: rgba(255, 255, 255, 0.97);
  }

  .panel {
    padding: 16px;
  }

  .item-card {
    gap: 11px;
    padding: 14px;
  }

  .btn {
    min-height: 52px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
  }

  .btn.primary {
    background: linear-gradient(180deg, var(--brand) 0, var(--brand-dark) 100%);
    box-shadow: 0 10px 22px rgba(0, 166, 81, 0.24);
  }

  .btn.ghost {
    background: #eef7f4;
  }

  .field {
    margin-top: 10px;
  }

  .field label {
    font-size: 0.86rem;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 48px;
    background: #fbfdfc;
  }

  .photo-box {
    padding: 14px;
    background: #fbfdfc;
  }

  .photo-box strong {
    font-size: 0.98rem;
    line-height: 1.25;
  }

  .notice {
    padding: 13px;
  }

  .pill {
    min-height: 30px;
  }

  .checklist-card {
    gap: 10px;
    border-left-width: 5px;
  }

  .checklist-card-head,
  .checklist-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .checklist-card-head .pill {
    width: 100%;
    justify-content: center;
  }

  .checklist-card-title strong {
    font-size: 1.02rem;
  }

  .checklist-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .checklist-meta span {
    min-height: 40px;
    padding: 7px 8px;
  }

  .panel.grid-3,
  .panel.grid-2 {
    gap: 8px;
    padding: 12px;
  }

  .bar-chart {
    gap: 12px;
  }

  .bar-track {
    height: 10px;
    background: #dfe9e5;
  }

  .bar-fill {
    background: linear-gradient(90deg, var(--brand-dark), var(--brand), var(--accent));
  }

  .qr-video {
    max-height: 360px;
  }
}
}

@media (max-width: 480px) and (orientation: portrait) {
  body {
    background:
      linear-gradient(180deg, #e7f8ef 0, #f7faf8 220px, #f7faf8 100%);
  }

  .login-visual,
  .login-panel,
  .topbar {
    padding: 16px;
  }

  .content {
    padding: 0 12px 18px;
  }

  .login-visual {
    min-height: 30vh;
  }

  .login-visual h1 {
    font-size: 2rem;
  }

  .brand-lockup {
    gap: 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .sidebar {
    padding: 0;
  }

  .app-shell.mobile-menu-open .sidebar {
    padding: 8px;
  }

  .sidebar-head {
    align-items: center;
  }

  .sidebar .brand-copy strong {
    font-size: 0.95rem;
  }

  .icon-btn {
    width: 52px;
    height: 52px;
  }

  .nav button {
    min-height: 50px;
    padding: 0 12px;
    font-size: 0.9rem;
  }

  .content {
    gap: 16px;
  }

  .section-head {
    gap: 12px;
  }

  .section-head h2,
  .topbar h2 {
    font-size: 1.35rem;
  }

  .section-head p {
    font-size: 0.84rem;
    line-height: 1.45;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat strong {
    font-size: 1.7rem;
  }

  .grid-2,
  .grid-3,
  .photo-stack {
    gap: 12px;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 48px;
    padding: 12px 13px;
    font-size: 1rem;
  }

  .field textarea {
    min-height: 118px;
  }

  .panel,
  .item-card,
  .stat,
  .login-card {
    border-radius: 8px;
    padding: 12px;
  }

  .item-card {
    gap: 10px;
  }

  .checklist-meta {
    grid-template-columns: 1fr 1fr;
  }

  .checklist-actions .btn {
    min-height: 52px;
  }

  .row {
    gap: 8px;
  }

  .pill {
    min-height: 30px;
    white-space: normal;
    text-align: center;
  }

  .photo-box {
    gap: 10px;
  }

  .photo-box strong {
    font-size: 1rem;
  }

  .photo-box input[type="file"] {
    width: 100%;
  }

  .photo-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .photo-preview {
    width: 100%;
    min-width: 0;
    font-size: 0.76rem;
  }

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

  .photo-preview span {
    overflow-wrap: anywhere;
  }

  .photo-viewer {
    padding: 12px;
  }

  .table-wrap tr {
    margin-bottom: 10px;
  }

  .table-wrap td {
    min-height: 0;
    padding: 9px 0;
  }

  .notice {
    padding: 12px;
    font-size: 0.92rem;
  }

  .qr-card img {
    width: 128px;
    height: 128px;
  }
}
