:root {
  --bg: #e6eef5;
  --surface: #f2f6fb;
  --surface-soft: #e8eff6;
  --ink: #10233f;
  --muted: #5c6f87;
  --line: rgba(12, 37, 71, 0.12);
  --primary: #008ec6;
  --primary-strong: #0074a3;
  --primary-soft: #d8f0fa;
  --danger: #c72234;
  --ok: #0f8f66;
  --warn: #ef8d32;
  --accent: #ef8d32;
  --accent-strong: #dd7a1e;
  --accent-soft: #fbe6d0;
  --card-bg: #f7fafd;
  --card-bg-soft: #f2f7fc;
  --card-line: rgba(12, 37, 71, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: "IBM Plex Sans KR", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 14%, rgba(0, 142, 198, 0.1), transparent 42%),
    radial-gradient(circle at 84% 16%, rgba(31, 120, 159, 0.08), transparent 38%),
    linear-gradient(180deg, #f0f5fa 0%, var(--bg) 100%);
  padding: 18px;
}

.phone-shell {
  width: min(460px, 100%);
  height: min(920px, calc(100vh - 36px));
  background: linear-gradient(180deg, #f5f9fd 0%, #edf3f9 100%);
  border-radius: 34px;
  border: 1px solid rgba(8, 33, 66, 0.2);
  box-shadow:
    0 28px 80px rgba(6, 24, 53, 0.22),
    inset 0 1px 1px rgba(255, 255, 255, 0.7);
  padding: 18px 14px 104px;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

.app-header {
  display: grid;
  gap: 10px;
}

.app-header-top {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
  min-height: 34px;
}

.header-top-spacer {
  display: none;
}

.app-header-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.header-brand {
  margin: 0;
  min-height: 20px;
  display: flex;
  align-items: center;
}

.header-brand-img {
  display: block;
  width: min(164px, 42vw);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  opacity: 0.96;
}

.header-brand-fallback {
  display: none;
  font-family: "Outfit", sans-serif;
  letter-spacing: 0.02em;
  color: #123458;
  font-size: 0.78rem;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 4px;
  font-family: "Outfit", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  font-size: 0.78rem;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.26rem;
  line-height: 1.25;
}

.platform-title {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  text-align: left;
}

.platform-title-main {
  color: #ef8d32;
}

.platform-title-sub {
  color: #2b92bb;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(185, 28, 28, 0.14);
  color: #991b1b;
  border: 1px solid rgba(185, 28, 28, 0.28);
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.app-header-top .status-pill {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  background: rgba(15, 143, 102, 0.14);
  border: 1px solid rgba(15, 143, 102, 0.28);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.76rem;
  color: #0c6e4f;
}

.user-pill .btn.neutral {
  background: rgba(15, 143, 102, 0.18);
  color: #0c6e4f;
  border: 1px solid rgba(15, 143, 102, 0.34);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc2626;
}

.status-pill.is-online {
  background: rgba(15, 143, 102, 0.14);
  color: #0c6e4f;
  border-color: rgba(15, 143, 102, 0.28);
}

.status-pill.is-offline {
  background: rgba(185, 28, 28, 0.14);
  color: #991b1b;
  border-color: rgba(185, 28, 28, 0.28);
}

.dot.is-online {
  background: #16a34a;
}

.dot.is-offline {
  background: #dc2626;
}

.incident-card {
  margin-top: 14px;
  background: linear-gradient(145deg, #4da9cf 0%, #2b92bb 58%, #1d7fa6 100%);
  color: #f8fbff;
  border-radius: 22px;
  padding: 14px;
  display: none;
}

.phone-shell.dispatch-mode .incident-card {
  display: block;
}

.incident-title {
  opacity: 0.88;
  font-size: 0.85rem;
}

.incident-card h2 {
  margin-top: 4px;
  font-size: 1.05rem;
}

.incident-meta {
  margin-top: 4px;
  color: #d7ecf8;
  font-size: 0.84rem;
}

.incident-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.dispatch-viewer-panel {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.dispatch-viewer-panel p {
  margin: 0;
  font-size: 0.8rem;
  color: #dff0fb;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 10px;
  font-weight: 700;
  cursor: pointer;
}

.btn.tiny {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
}

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

.btn.neutral {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.btn.subtle {
  background: rgba(255, 255, 255, 0.14);
  color: #e9f1ff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn.full {
  width: 100%;
  margin-top: 10px;
}

.screen {
  display: none;
  margin-top: 12px;
  gap: 10px;
}

.screen.is-active {
  display: grid;
}

.card {
  border-radius: 18px;
  background: linear-gradient(180deg, var(--card-bg) 0%, var(--card-bg-soft) 100%);
  border: 1px solid var(--card-line);
  padding: 12px;
}

#screen-dispatch > .card:nth-of-type(1),
#screen-dispatch > .card.lcd {
  background: #f7fbff;
  border: 1px solid rgba(16, 35, 63, 0.14);
}

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

.card-head h3 {
  font-size: 0.98rem;
}

.card-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.mini-map {
  margin-top: 8px;
  height: 130px;
  border-radius: 14px;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      120deg,
      #e7ecf3 0,
      #e7ecf3 14px,
      #f4f7fb 14px,
      #f4f7fb 28px
    );
}

.mini-map > * {
  width: 100%;
  height: 100%;
}

.map-fallback {
  position: relative;
}

.mini-map.map-active .map-fallback {
  display: none;
}

.chip {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.chip.agent {
  left: 10px;
  bottom: 10px;
  background: #007ab0;
}

.chip.lift {
  right: 10px;
  top: 10px;
  background: var(--accent-strong);
}

.card-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.lcd p {
  margin-top: 8px;
  line-height: 1.45;
}

.pipeline-note {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.checklist {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.checklist li {
  display: flex;
  gap: 8px;
  font-size: 0.92rem;
}

.inspection-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.inspection-table-wrap {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  background: #f7fbff;
}

.inspection-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 0.84rem;
  table-layout: fixed;
}

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

.inspection-table th {
  background: #f2f6fb;
  white-space: normal;
}

.inspection-table th,
.inspection-table td {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.inspection-table .empty-row {
  color: var(--muted);
  text-align: center;
  padding: 14px 10px;
}

.inspection-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  font: inherit;
  font-size: 0.84rem;
}

.compliance-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 700;
  font-size: 0.78rem;
}

.compliance-badge.pending {
  background: #e9eff6;
  color: #596f88;
}

.compliance-badge.match {
  background: #dff7ea;
  color: #0f7a4a;
}

.compliance-badge.mismatch {
  background: #fee3e3;
  color: #b91c1c;
}

.self-check-form {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.self-check-form label {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  color: #2f4668;
  font-weight: 600;
}

.self-check-form input,
.self-check-form select,
.self-check-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: #f8fbfe;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}

.self-check-form textarea {
  resize: vertical;
}

.queue-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.queue-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.log-box {
  margin-top: 10px;
  background: #f8fbfe;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  color: #334a6d;
  font-size: 0.9rem;
}

.chat {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.bubble {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.bubble.bot {
  background: #fff2e0;
}

.bubble.bot.rich {
  display: grid;
  gap: 8px;
}

.bubble.bot.rich p {
  margin: 0;
}

.bubble.bot.rich ol {
  margin: 0;
  padding-left: 18px;
}

.bubble.bot.rich li {
  margin-top: 4px;
}

.bubble.user {
  background: #e8edf3;
  justify-self: end;
}

.chat-input {
  margin-top: 10px;
  border-radius: 999px;
  background: #f8fbfe;
  border: 1px solid var(--line);
  padding: 10px 12px;
  color: #485d79;
  font-size: 0.9rem;
}

.chat-form {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.chat-input-control {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fbfe;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9rem;
}

.chat-ref {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.training-docs {
  margin-top: 8px;
}

.chat-doc-list {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.78rem;
}

.chat-doc-list li {
  margin-top: 4px;
  line-height: 1.35;
}

.chat-images {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.chat-image-title {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.chat-image-item {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #f8fbfe;
}

.chat-image-item img {
  display: block;
  width: 100%;
  height: auto;
}

.chat-image-item figcaption {
  padding: 6px 8px;
  font-size: 0.76rem;
  color: var(--muted);
}

.chat-followups {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.chat-followup-title {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.chat-followup-list {
  display: grid;
  gap: 6px;
}

.chat-followup-btn {
  border: 1px solid rgba(0, 117, 191, 0.22);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
  background: #ffffff;
  color: #123f71;
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.35;
  cursor: pointer;
}

.chat-followup-btn:hover {
  background: #eef6ff;
  border-color: rgba(0, 117, 191, 0.35);
}

.edu-item {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f7fbff;
}

.edu-item strong {
  font-size: 0.92rem;
}

.edu-item p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.edu-playlist-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.edu-player-wrap {
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 8px;
}

.edu-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 10px;
  background: #0b1f36;
}

.edu-player-caption {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.edu-video-item {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: 102px 1fr;
  gap: 10px;
  align-items: center;
  text-align: left;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 8px;
  cursor: pointer;
}

.edu-video-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid rgba(0, 117, 191, 0.15);
  background: #eaf2fb;
}

.edu-video-title {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
  color: #0f2f56;
  font-weight: 700;
}

.edu-video-meta {
  margin-top: 4px;
  margin-bottom: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.edu-video-source {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.74rem;
  color: #365883;
  background: #ecf4fd;
  border: 1px solid rgba(0, 117, 191, 0.2);
  border-radius: 999px;
  padding: 2px 8px;
}

.edu-video-item:hover {
  border-color: rgba(0, 117, 191, 0.35);
  background: #f4f9ff;
}

.edu-video-item.is-active {
  border-color: rgba(245, 130, 32, 0.55);
  background: #fff6ec;
}

.fault-search-form {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.fault-board-toolbar {
  grid-template-columns: 1fr auto auto;
}

.fault-search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: #f8fbfe;
  font: inherit;
  font-size: 0.9rem;
}

.fault-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.fault-compose {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #f8fbfe;
}

.fault-compose h4 {
  margin: 0;
  font-size: 0.9rem;
}

.fault-guide-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #334a6b;
  font-size: 0.8rem;
  line-height: 1.45;
}

.fault-compose-meta {
  margin-top: 8px;
  font-size: 0.8rem;
  color: #365276;
}

.fault-compose-form {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.fault-compose-form label {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  color: #2f4668;
  font-weight: 600;
}

.fault-compose-form input,
.fault-compose-form textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}

.fault-compose-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.fault-attachment-preview {
  display: grid;
  gap: 6px;
}

.fault-attachment-item {
  border: 1px solid #d7e4f2;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.fault-attachment-thumb,
.fault-attachment-video {
  margin-top: 6px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid #d9e3ef;
  max-height: 180px;
  object-fit: cover;
}

.fault-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #f8fbfe;
}

.fault-item h4 {
  margin: 0;
  font-size: 0.92rem;
}

.fault-item .meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.fault-item p {
  margin-top: 6px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.fault-item .tags {
  margin-top: 6px;
  color: #2d548d;
  font-size: 0.78rem;
}

.fault-media-list {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.fault-media-image,
.fault-media-video {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #d7e4f3;
  background: #fff;
  max-height: 240px;
  object-fit: cover;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, calc(100vw - 36px));
  bottom: 10px;
  background: rgba(243, 248, 253, 0.96);
  border: 1px solid rgba(16, 35, 63, 0.16);
  border-radius: 18px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  z-index: 30;
}

.app-tab {
  border: 0;
  border-radius: 12px;
  padding: 10px 6px;
  font-weight: 700;
  background: transparent;
  color: #4f6686;
  cursor: pointer;
}

.app-tab.is-active {
  background: var(--accent);
  color: #fff;
}

.alert-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(14, 18, 25, 0.7);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 200;
}

.alert-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.alert-modal {
  width: min(410px, 100%);
  background: #102644;
  color: #f3f5f8;
  border-radius: 20px;
  border: 1px solid rgba(215, 230, 250, 0.2);
  padding: 20px 16px 14px;
  position: relative;
}

.alert-modal h2 {
  font-size: 1.22rem;
}

.alert-modal p {
  margin-top: 10px;
  color: #c2d2e7;
  line-height: 1.45;
}

.alert-close {
  position: absolute;
  right: 10px;
  top: 6px;
  border: 0;
  background: transparent;
  color: #99b0cc;
  font-size: 1.8rem;
  cursor: pointer;
}

.alert-confirm {
  margin-top: 14px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: #e3effc;
  color: #163c73;
  font-weight: 700;
  padding: 10px 12px;
  cursor: pointer;
}

.dispatch-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: stretch;
  background: rgba(12, 16, 25, 0.55);
  backdrop-filter: blur(2px);
  padding: 12px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 220;
}

.dispatch-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.dispatch-modal {
  width: auto;
  max-width: 460px;
  margin: 0 auto;
  left: 0;
  right: 0;
  max-height: 82vh;
  overflow: auto;
  overflow-x: hidden;
  background: #f5f9fd;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-sizing: border-box;
}

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

.dispatch-head h2 {
  font-size: 1.08rem;
}

.dispatch-close {
  border: 0;
  border-radius: 10px;
  background: #e5edf6;
  color: #4a6281;
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.dispatch-guide {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.4;
}

.dispatch-form {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.dispatch-region-section {
  display: grid;
  gap: 6px;
}

.dispatch-region-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #446184;
}

.origin-suggestion-wrap {
  margin-top: -2px;
  display: grid;
  gap: 6px;
}

.origin-suggestion-title {
  margin: 0;
  font-size: 0.78rem;
  color: #5d7492;
}

.origin-suggestions {
  display: grid;
  gap: 6px;
}

.origin-suggest-button {
  border: 1px solid #c6d8ee;
  border-radius: 10px;
  padding: 7px 9px;
  text-align: left;
  background: #ffffff;
  color: #1f3658;
  font-size: 0.79rem;
  line-height: 1.35;
  cursor: pointer;
}

.origin-suggest-button:hover {
  border-color: #86addf;
  background: #edf4fd;
}

.region-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 8px;
}

.region-grid label {
  min-width: 0;
}

.region-grid input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.dispatch-form label {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  color: #2f4668;
  font-weight: 600;
}

.dispatch-form input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: #f8fbfe;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}

.dispatch-address-field {
  display: grid;
  gap: 4px;
}

.dispatch-address-field > label {
  font-size: 0.82rem;
  color: #2f4668;
  font-weight: 600;
}

.dispatch-address-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  align-items: center;
  gap: 6px;
}

.dispatch-address-actions-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dispatch-address-btn {
  min-height: 37px;
  white-space: nowrap;
  font-size: 0.78rem;
  padding: 7px 6px;
}

.dispatch-site-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  align-items: end;
  gap: 6px;
}

.dispatch-site-row.compact {
  grid-template-columns: minmax(0, 1fr);
}

.dispatch-site-input-label {
  min-width: 0;
}

.dispatch-site-input-label input {
  min-width: 0;
  width: 100%;
}

.dispatch-site-save-btn {
  white-space: nowrap;
  min-height: 36px;
  padding: 7px 6px;
  font-size: 0.8rem;
  line-height: 1;
  border-radius: 10px;
}

.dispatch-site-actions {
  display: grid;
  gap: 6px;
}

.address-finder-panel {
  border: 1px solid #c6d8ee;
  border-radius: 12px;
  background: #eff5fc;
  padding: 10px;
  display: grid;
  gap: 8px;
}

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

.address-finder-head h3 {
  margin: 0;
  font-size: 0.92rem;
  color: #1f3658;
}

.address-finder-guide {
  margin: 0;
  font-size: 0.77rem;
  color: #5b7393;
}

.address-finder-query {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 9px;
  background: #fff;
  font: inherit;
}

.address-finder-results {
  display: grid;
  gap: 6px;
  max-height: 190px;
  overflow: auto;
}

.address-finder-region-grid {
  margin-bottom: 2px;
}

.dispatch-feedback {
  margin-top: 10px;
  min-height: 18px;
  font-size: 0.82rem;
  color: var(--primary);
}

.dispatch-feedback.error {
  color: #b91c1c;
}

.dispatch-results {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #f7fbff;
}

.result-card h4 {
  margin: 0;
  font-size: 0.94rem;
}

.result-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.result-select {
  margin-top: 8px;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-strong);
  cursor: pointer;
}

.result-actions {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}

.result-bookmark {
  border: 1px solid #bfd2eb;
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 700;
  background: #f8fbfe;
  color: #1f467f;
  cursor: pointer;
}

.result-delete {
  border: 1px solid rgba(220, 38, 38, 0.28);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 700;
  background: #fff5f5;
  color: #b42318;
  cursor: pointer;
}

.auth-modal {
  background: #f5f9fd;
  color: var(--ink);
}

.auth-modal p {
  color: var(--muted);
}

@media (max-width: 420px) {
  .app-header-top {
    gap: 6px;
    padding: 0 1px;
    min-height: 32px;
  }

  .header-brand-img {
    width: min(146px, 44vw);
  }

  .app-header-bottom {
    gap: 8px;
    padding: 0 1px;
  }

  h1 {
    font-size: 1.16rem;
  }

  .user-pill {
    gap: 6px;
    padding: 4px 6px;
    font-size: 0.72rem;
  }

  .phone-shell {
    min-height: calc(100vh - 16px);
    border-radius: 24px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .incident-actions {
    grid-template-columns: 1fr;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }

  .chat-form,
  .fault-search-form {
    grid-template-columns: 1fr;
  }

  #admin-site-ownership-search-form {
    grid-template-columns: 1fr;
  }

  .inspection-actions {
    grid-template-columns: 1fr;
  }

  .region-grid {
    grid-template-columns: 1fr;
  }

  .dispatch-overlay {
    padding: 8px;
  }

  .dispatch-modal {
    max-width: none;
    width: 100%;
    border-radius: 14px;
  }

  .admin-ownership-actions,
  .admin-ownership-transfer {
    grid-template-columns: 1fr;
  }
}

/* 2026-03-26 UI Redesign: KoELSA identity */
:root {
  --bg: #edf3f8;
  --surface: #f7fbff;
  --surface-soft: #ecf4fb;
  --ink: #0e243d;
  --muted: #546b84;
  --line: rgba(12, 40, 76, 0.14);
  --primary: #0075bf;
  --primary-strong: #005e98;
  --primary-soft: #dceefb;
  --danger: #c8282f;
  --ok: #0f8f66;
  --warn: #f58220;
  --accent: #f58220;
  --accent-strong: #d86b11;
  --accent-soft: #ffefdf;
  --card-bg: #ffffff;
  --card-bg-soft: #f9fcff;
  --card-line: rgba(12, 40, 76, 0.12);
}

body {
  background:
    radial-gradient(circle at 50% -20%, rgba(0, 117, 191, 0.16), transparent 46%),
    radial-gradient(circle at 10% 80%, rgba(0, 94, 152, 0.09), transparent 40%),
    linear-gradient(180deg, #f4f8fc 0%, var(--bg) 100%);
}

.phone-shell {
  background:
    linear-gradient(180deg, #f9fcff 0%, #f4f9fe 100%);
  border: 1px solid rgba(8, 34, 67, 0.18);
  box-shadow:
    0 24px 66px rgba(6, 24, 53, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.app-header {
  position: relative;
  background:
    linear-gradient(135deg, rgba(0, 117, 191, 0.1) 0%, rgba(0, 117, 191, 0.05) 36%, rgba(245, 130, 32, 0.08) 100%);
  border: 1px solid rgba(0, 117, 191, 0.2);
  border-radius: 18px;
  padding: 10px 10px 12px;
}

.app-header::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 117, 191, 0.25), transparent);
}

.app-header-top {
  min-height: 38px;
  padding: 0 4px;
}

.header-brand-img {
  width: min(182px, 48vw);
}

.status-pill {
  font-weight: 700;
}

.app-header-bottom {
  margin-top: 4px;
  align-items: flex-end;
  padding: 0 4px;
}

.title-group {
  display: grid;
  gap: 3px;
}

.platform-title {
  gap: 5px;
  font-size: 1.58rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.platform-title-main {
  color: var(--primary);
}

.platform-title-sub {
  color: #f58220;
}

.platform-subtitle {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.045em;
  color: #4b6482;
  font-weight: 600;
}

.user-pill {
  background: rgba(15, 143, 102, 0.12);
  border: 1px solid rgba(15, 143, 102, 0.25);
  color: #0e7354;
  padding: 6px 8px;
  gap: 6px;
}

.user-pill .btn.neutral {
  background: #eaf8f2;
  color: #0e7354;
  border: 1px solid rgba(15, 143, 102, 0.28);
}

.incident-card {
  margin-top: 12px;
  border-radius: 20px;
  border: 1px solid rgba(0, 86, 138, 0.24);
  background:
    radial-gradient(circle at 88% 15%, rgba(245, 130, 32, 0.22), transparent 40%),
    linear-gradient(138deg, #2a99c4 0%, #177fa8 58%, #0f678d 100%);
  box-shadow: 0 10px 24px rgba(15, 69, 111, 0.22);
}

.incident-title {
  font-weight: 600;
  letter-spacing: 0.015em;
}

.incident-card h2 {
  font-size: 1.15rem;
}

.incident-meta {
  color: #d8ecfa;
}

.btn {
  font-size: 0.92rem;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn.danger {
  background: linear-gradient(180deg, #d93b41 0%, #bb2329 100%);
  box-shadow: 0 6px 12px rgba(150, 24, 29, 0.22);
}

.btn.neutral {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid rgba(216, 107, 17, 0.24);
}

.btn.subtle {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.card {
  border-radius: 16px;
  background: linear-gradient(180deg, var(--card-bg) 0%, var(--card-bg-soft) 100%);
  border: 1px solid var(--card-line);
  box-shadow: 0 6px 16px rgba(15, 46, 84, 0.07);
}

#screen-dispatch > .card:nth-of-type(1),
#screen-dispatch > .card.lcd {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.card-head {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 117, 191, 0.12);
}

.card-head h3 {
  font-size: 1rem;
  color: #0a2f5c;
  font-weight: 750;
}

.card-head span {
  color: #5a6f88;
  font-weight: 600;
}

.mini-map {
  height: 146px;
  border: 1px solid rgba(0, 117, 191, 0.2);
  background:
    linear-gradient(140deg, #edf5fc 0%, #f9fcff 44%, #e7f1f9 100%);
}

.chip {
  box-shadow: 0 4px 9px rgba(7, 34, 70, 0.22);
}

.chip.agent {
  background: #0f7aad;
}

.chip.lift {
  background: #f58220;
}

.card-note,
.pipeline-note,
.chat-ref,
.queue-meta,
.fault-item .meta,
.dispatch-guide,
.result-meta,
.edu-item p {
  color: #5a6f88;
}

.inspection-table-wrap,
.chat-image-item,
.fault-item,
.result-card,
.log-box,
.edu-item,
.edu-video-item {
  background: #ffffff;
  border: 1px solid rgba(0, 117, 191, 0.15);
}

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

.inspection-table th {
  background: #eaf3fb;
  color: #1f3d61;
}

.inspection-input,
.self-check-form input,
.self-check-form select,
.self-check-form textarea,
.chat-input-control,
.fault-search-input,
.dispatch-form input {
  background: #ffffff;
  border: 1px solid rgba(12, 40, 76, 0.2);
}

.bubble.bot {
  background: #fff0df;
  border: 1px solid rgba(245, 130, 32, 0.23);
}

.bubble.user {
  background: #eaf2fb;
  border: 1px solid rgba(0, 117, 191, 0.15);
}

.bottom-nav {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 117, 191, 0.2);
  box-shadow: 0 10px 24px rgba(13, 42, 76, 0.16);
}

.app-tab {
  color: #4a6180;
  border: 1px solid transparent;
}

.app-tab.is-active {
  background: linear-gradient(180deg, #f79a45 0%, #f58220 100%);
  color: #ffffff;
  box-shadow: 0 5px 12px rgba(168, 84, 11, 0.3);
}

.alert-modal {
  background: #13355d;
  border: 1px solid rgba(175, 210, 245, 0.24);
}

.alert-confirm {
  background: #ffffff;
  color: #194a83;
}

.dispatch-modal {
  background: #f7fbff;
  border: 1px solid rgba(0, 117, 191, 0.2);
}

.dispatch-close {
  background: #e6f0fa;
  color: #345679;
}

.dispatch-feedback {
  color: #1b5e99;
}

.result-select {
  background: #fff1e2;
  color: #ce6610;
  border: 1px solid rgba(216, 107, 17, 0.25);
}

.result-bookmark {
  border: 1px solid rgba(0, 117, 191, 0.25);
  color: #23518a;
}

.result-delete {
  border: 1px solid rgba(220, 38, 38, 0.3);
  background: #fff2f2;
  color: #b42318;
}

.auth-modal {
  background: #f7fbff;
}

@media (max-width: 420px) {
  .app-header {
    border-radius: 15px;
    padding: 9px 8px 10px;
  }

  .platform-title {
    font-size: 1.36rem;
  }

  .platform-subtitle {
    font-size: 0.7rem;
  }

  .header-brand-img {
    width: min(156px, 48vw);
  }

  .user-pill {
    justify-content: flex-end;
  }

  .inspection-table {
    min-width: 560px;
  }
}

/* Overflow safety patch: prevent clipping on popup/tab screens */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.phone-shell {
  width: min(460px, calc(100vw - 24px));
  height: min(920px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
}

.app-header,
.app-header-top,
.app-header-bottom,
.title-group,
.screen,
.card,
.card-head,
.incident-actions,
.inspection-actions,
.chat-form,
.fault-search-form,
.region-grid,
.dispatch-form label,
.result-actions {
  min-width: 0;
  max-width: 100%;
}

.card-head {
  flex-wrap: wrap;
}

.card-head h3,
.card-head span,
.dispatch-guide,
.result-meta,
.fault-item p {
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.dispatch-overlay {
  padding-top: max(10px, env(safe-area-inset-top));
  padding-right: 10px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  padding-left: 10px;
}

.dispatch-modal {
  box-sizing: border-box;
  width: min(440px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 24px);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.dispatch-modal * {
  max-width: 100%;
}

.dispatch-form {
  padding-inline: 2px;
}

.inspection-table-wrap {
  -webkit-overflow-scrolling: touch;
}

.inspection-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.inspection-table th,
.inspection-table td {
  width: 25%;
}

@media (max-width: 560px) {
  .app-header-bottom {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
  }

  .user-pill {
    justify-self: end;
    max-width: 100%;
  }

  .dispatch-modal {
    border-radius: 14px;
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    padding: 12px 10px;
  }

  .inspection-table {
    font-size: 0.8rem;
  }

  .inspection-table th,
  .inspection-table td {
    padding: 7px 6px;
  }

  .region-grid,
  .inspection-actions,
  .result-actions,
  .fault-compose-actions,
  .chat-form,
  .fault-search-form {
    grid-template-columns: 1fr;
  }

  .edu-video-item {
    grid-template-columns: 92px 1fr;
    gap: 8px;
    padding: 7px;
  }
}

/* Auth gate */
.auth-gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 18% 16%, rgba(0, 117, 191, 0.24), transparent 46%),
    radial-gradient(circle at 86% 12%, rgba(245, 130, 32, 0.2), transparent 44%),
    linear-gradient(180deg, #ebf3fa 0%, #dce8f3 100%);
}

.auth-gate-card {
  width: min(460px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  overflow: auto;
  background: #f8fcff;
  border: 1px solid rgba(0, 117, 191, 0.25);
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(12, 39, 72, 0.24);
  padding: 18px 16px;
}

.auth-gate-logo {
  display: block;
  width: min(192px, 54vw);
  margin: 0 auto;
  height: auto;
}

.auth-gate-title {
  margin-top: 10px;
  text-align: center;
  font-size: 1.5rem;
  color: #0a2f5c;
}

.auth-gate-subtitle {
  margin-top: 6px;
  text-align: center;
  color: #5a6f88;
  font-size: 0.88rem;
}

.auth-gate-tabs {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-gate-tab {
  border: 1px solid rgba(0, 117, 191, 0.22);
  background: #eff6fd;
  color: #365883;
  font-weight: 700;
  border-radius: 12px;
  padding: 10px 8px;
  cursor: pointer;
}

.auth-gate-tab.is-active {
  background: linear-gradient(180deg, #f79a45 0%, #f58220 100%);
  color: #fff;
  border-color: rgba(245, 130, 32, 0.52);
}

.auth-gate-form {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.auth-gate-form[hidden] {
  display: none !important;
}

.auth-gate-form.is-fading-in {
  animation: authGateFadeIn 200ms ease both;
}

@keyframes authGateFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-gate-form label {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  color: #264365;
  font-weight: 700;
}

.auth-gate-form input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(0, 117, 191, 0.24);
  background: #fff;
  padding: 10px;
  font: inherit;
  color: #0e243d;
}

.auth-gate-feedback {
  margin-top: 10px;
  min-height: 20px;
  font-size: 0.82rem;
  color: #1b5e99;
}

.auth-gate-feedback.error {
  color: #b91c1c;
}

body.auth-locked .auth-gate {
  display: grid;
}

body.auth-locked .phone-shell,
body.auth-locked .alert-overlay,
body.auth-locked .dispatch-overlay {
  display: none !important;
}

/* Admin management */
.admin-users {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.admin-user-item {
  border: 1px solid rgba(0, 117, 191, 0.2);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
}

.admin-user-item h4 {
  margin: 0;
  font-size: 0.94rem;
  color: #193a63;
}

.admin-user-item .meta {
  margin-top: 6px;
  color: #5c7390;
  font-size: 0.82rem;
  line-height: 1.45;
}

.admin-user-actions {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-user-temp {
  margin-top: 8px;
  border: 1px dashed rgba(206, 102, 16, 0.45);
  background: #fff4e8;
  border-radius: 10px;
  padding: 7px 8px;
  color: #b35a10;
  font-size: 0.82rem;
  word-break: break-all;
}

.admin-pagination {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.admin-pagination #admin-page-meta {
  text-align: center;
  color: #365b86;
  font-weight: 700;
  font-size: 0.85rem;
}

.admin-pagination .btn {
  min-height: 40px;
}

.admin-lcd-form {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.admin-lcd-form label {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  color: #264365;
  font-weight: 700;
}

.admin-lcd-form input,
.admin-lcd-form select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(0, 117, 191, 0.24);
  background: #fff;
  padding: 10px;
  font: inherit;
  color: #0e243d;
}

.admin-lcd-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-lcd-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.admin-lcd-item {
  border: 1px solid rgba(0, 117, 191, 0.2);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
}

.admin-lcd-item h4 {
  margin: 0;
  font-size: 0.93rem;
  color: #193a63;
}

.admin-lcd-item .meta {
  margin-top: 6px;
  color: #5c7390;
  font-size: 0.82rem;
  line-height: 1.45;
}

.admin-lcd-item .admin-user-actions {
  margin-top: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-ownership-filter {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #35587f;
  font-weight: 600;
}

.admin-ownership-filter input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

#admin-site-ownership-search-form {
  grid-template-columns: minmax(0, 1fr) 88px auto;
}

#admin-site-ownership-stale-days {
  border: 1px solid rgba(0, 117, 191, 0.24);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  font: inherit;
  color: #0e243d;
}

.admin-ownership-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.admin-ownership-item {
  border: 1px solid rgba(0, 117, 191, 0.2);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
}

.admin-ownership-item.needs-review {
  border-color: rgba(206, 102, 16, 0.45);
  background: #fffaf4;
}

.admin-ownership-item h4 {
  margin: 0;
  font-size: 0.93rem;
  color: #193a63;
}

.admin-ownership-item .meta {
  margin-top: 6px;
  color: #5c7390;
  font-size: 0.82rem;
  line-height: 1.45;
}

.admin-ownership-actions {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px;
}

.admin-ownership-transfer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 6px;
}

.admin-ownership-transfer input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(0, 117, 191, 0.24);
  background: #fff;
  padding: 8px 10px;
  font: inherit;
  color: #0e243d;
}

/* Header alignment refinement */
.app-header {
  --header-side-gap: 4px;
  --header-top-pill-width: clamp(196px, 46%, 246px);
}

.app-header-top {
  padding-inline: var(--header-side-gap);
  min-height: 44px;
}

.app-header-top .header-top-spacer {
  width: 100%;
  visibility: hidden;
}

.app-header-top .status-pill {
  position: absolute;
  right: var(--header-side-gap);
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  min-height: 34px;
  width: var(--header-top-pill-width);
  max-width: var(--header-top-pill-width);
  justify-content: center;
}

.app-header-top .user-pill {
  position: absolute;
  left: var(--header-side-gap);
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  min-height: 34px;
  width: var(--header-top-pill-width);
  max-width: var(--header-top-pill-width);
  min-width: 0;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 7px;
}

.app-header-bottom {
  display: block;
  margin-top: 2px;
  min-height: 0;
  padding-inline: var(--header-side-gap);
}

.app-header-bottom .title-group {
  display: grid;
  justify-items: center;
  text-align: center;
  width: 100%;
  min-width: 0;
  padding-inline: 6px;
  gap: 2px;
}

.app-header-bottom .title-main-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.app-header-bottom .platform-title {
  justify-content: center;
  text-align: center;
  align-items: center;
  gap: 4px;
}

.app-header-bottom .platform-subtitle {
  text-align: center;
}

.app-header-top #current-user-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header-top .user-pill .btn {
  flex: 0 0 auto;
}

.footer-brand-fixed {
  position: relative;
  width: 100%;
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.footer-brand-img {
  width: clamp(132px, 34vw, 176px);
  max-width: 48%;
  height: auto;
  object-fit: contain;
  opacity: 0.95;
  filter: drop-shadow(0 2px 8px rgba(8, 33, 66, 0.16));
}

/* Bottom nav adapts when admin tab appears/disappears */
.bottom-nav {
  display: flex;
  gap: 6px;
}

.bottom-nav .app-tab {
  flex: 1 1 0;
}

@media (max-width: 560px) {
  .app-header-top {
    min-height: 40px;
  }

  .app-header-top .user-pill,
  .app-header-top .status-pill {
    width: min(48%, 198px);
    max-width: min(48%, 198px);
    font-size: 0.74rem;
    padding: 5px 7px;
  }

  .app-header-bottom .title-main-row {
    gap: 6px;
  }

  .footer-brand-img {
    width: clamp(120px, 36vw, 154px);
    max-width: 52%;
  }
}
