:root {
  color-scheme: light;
  --ink: #142f43;
  --muted: #607889;
  --line: #d6e1e8;
  --surface: #ffffff;
  --canvas: #eef3f6;
  --navy: #173b57;
  --navy-2: #245d82;
  --mint: #168966;
  --mint-soft: #e5f6ef;
  --amber: #b56b08;
  --amber-soft: #fff3d8;
  --red: #bd3c45;
  --red-soft: #ffeaec;
  --blue-soft: #e6f1fa;
  --shadow: 0 12px 34px rgba(23, 59, 87, .10);
  --radius: 18px;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 300px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0, rgba(73, 145, 177, .10), transparent 360px),
    var(--canvas);
}

button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(48, 135, 184, .25);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.shell { width: 100%; min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  color: #fff;
  background: rgba(23, 59, 87, .97);
  box-shadow: 0 5px 22px rgba(9, 34, 52, .20);
  backdrop-filter: blur(16px);
}

.brandmark {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 12px;
  object-fit: cover;
}

.brandcopy { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.brandcopy strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.brandcopy span { overflow: hidden; color: #bed0dc; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.connection-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.09);
  font-size: 11px;
  font-weight: 700;
}
.connection-chip b, .bottom-nav b {
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 4px;
  border-radius: 99px;
  color: #173b57;
  background: #fff;
  font-size: 10px;
}
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #efbf64; box-shadow: 0 0 0 3px rgba(239,191,100,.14); }
.connection-chip.online .connection-dot { background: #61ddb1; box-shadow: 0 0 0 3px rgba(97,221,177,.15); }
.connection-chip.syncing .connection-dot { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.78); } }

.auth-view {
  display: grid;
  min-height: calc(100vh - 68px);
  place-items: center;
  padding: 24px 16px max(28px, env(safe-area-inset-bottom));
}
.auth-card {
  width: min(100%, 520px);
  padding: 30px 24px;
  border: 1px solid rgba(23,59,87,.08);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-card h1 { margin: 8px 0 10px; font-size: clamp(26px, 8vw, 36px); line-height: 1.05; }
.auth-card > p:not(.eyebrow, .form-error) { color: var(--muted); line-height: 1.55; }
.auth-card small { display: block; margin-top: 18px; color: var(--muted); line-height: 1.45; }
.auth-icon { display: block; width: 62px; height: 62px; border-radius: 18px; object-fit: cover; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 22px;
  padding: 4px;
  border-radius: 13px;
  background: #e7eef2;
}
.auth-tabs button {
  min-height: 42px;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 850;
}
.auth-tabs button.active {
  color: var(--navy);
  background: #fff;
  box-shadow: 0 2px 9px rgba(23,59,87,.10);
}
.auth-form { display: grid; gap: 8px; margin-top: 18px; }
.auth-form label:not(:first-child) { margin-top: 5px; }
.auth-form button { margin-top: 9px; }
.auth-hint {
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid #efd08d;
  border-radius: 11px;
  color: #895205;
  background: var(--amber-soft);
  font-size: 12px;
  line-height: 1.45;
}

main { width: min(100%, 1000px); margin: 0 auto; padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
.project-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 42px;
  gap: 9px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.86);
}
.project-strip label { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.project-strip select { width: 100%; min-width: 0; }
.view { display: none; padding: 16px 14px 30px; }
.view.active { display: block; }

.eyebrow { margin: 0; color: var(--navy-2); font-size: 11px; font-weight: 900; letter-spacing: .11em; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 5px 0 16px; }
.section-heading h1 { margin: 3px 0 0; font-size: 27px; letter-spacing: -.035em; }
.count-pill { min-width: 38px; padding: 7px 10px; border-radius: 999px; color: var(--navy); background: #dce8ee; font-weight: 900; text-align: center; }

label { color: var(--ink); font-size: 13px; font-weight: 750; }
input, textarea, select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #bdccd5;
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
}
textarea { min-height: 72px; resize: vertical; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: #8ca0ad; }
input:focus, textarea:focus, select:focus { border-color: #4e95bb; box-shadow: 0 0 0 3px rgba(78,149,187,.12); outline: none; }

button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; box-shadow: none; }
.primary, .secondary, .danger, .file-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: 11px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}
.primary { border: 1px solid var(--navy); color: #fff; background: var(--navy); box-shadow: 0 6px 16px rgba(23,59,87,.15); }
.primary:hover { background: #0e3049; }
.primary:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; }
.secondary, .file-button { border: 1px solid #bbcad4; color: var(--navy); background: #fff; }
.secondary:hover, .file-button:hover { background: #f4f8fa; }
.danger { border: 1px solid #e4aeb3; color: #a82f39; background: #fff5f6; }
.large { min-height: 50px; padding: 12px 18px; font-size: 15px; }
.compact { min-height: 38px; padding: 8px 11px; font-size: 12px; }
.full { width: 100%; }
.icon-button { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid #bdccd5; border-radius: 11px; color: var(--navy); background: #fff; font-size: 22px; font-weight: 800; }

svg.ph-icon {
  display: block;
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
  stroke: none;
  overflow: visible;
}
.icon-action,
button:has(> .button-label) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.field-action-icon,
.field-inline-icon,
.field-search-icon,
.field-chevron-icon {
  width: 1.125rem;
  height: 1.125rem;
}
.text-button { padding: 5px 0; border: 0; color: var(--navy-2); background: transparent; font-size: 13px; font-weight: 850; }

.room-card, .scanner-card, .today-card, .notice, .sync-hero, .metric-grid, .admin-panel {
  border: 1px solid rgba(23,59,87,.10);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 7px 22px rgba(23,59,87,.06);
}
.room-card { padding: 15px; }
.room-card > label { display: block; margin-bottom: 8px; font-size: 14px; }
.room-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.room-card > span { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.4; }

.scan-result { display: flex; align-items: center; gap: 12px; min-height: 76px; margin: 12px 0; padding: 13px 14px; border-radius: 15px; border: 1px solid #cbd9e1; background: #f8fbfc; }
.scan-result .result-icon { display: grid; flex: 0 0 43px; width: 43px; height: 43px; place-items: center; border-radius: 12px; color: #fff; background: #718998; font-size: 12px; font-weight: 900; }
.scan-result .result-icon .ph-icon { width: 24px; height: 24px; }
.scan-result div:last-child { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.scan-result strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-result span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.scan-result.success { border-color: #9bd9c2; background: var(--mint-soft); }
.scan-result.success .result-icon { background: var(--mint); }
.scan-result.warning { border-color: #efd08d; background: var(--amber-soft); }
.scan-result.warning .result-icon { background: var(--amber); }
.scan-result.error { border-color: #e7afb5; background: var(--red-soft); }
.scan-result.error .result-icon { background: var(--red); }

.scanner-card { overflow: hidden; padding: 14px; }
.camera-frame { position: relative; overflow: hidden; width: 100%; aspect-ratio: 4/3; margin-bottom: 12px; border-radius: 15px; background: #07141d; }
.camera-frame video { display: block; width: 100%; height: 100%; object-fit: cover; }
.camera-guide { position: absolute; inset: 16%; border: 2px solid rgba(255,255,255,.9); border-radius: 20px; box-shadow: 0 0 0 999px rgba(0,0,0,.28); }
.camera-guide::before, .camera-guide::after, .camera-guide span::before, .camera-guide span::after { position: absolute; width: 30px; height: 30px; border-color: #62ddb2; border-style: solid; content: ""; }
.camera-guide::before { top: -3px; left: -3px; border-width: 4px 0 0 4px; border-radius: 12px 0 0; }
.camera-guide::after { top: -3px; right: -3px; border-width: 4px 4px 0 0; border-radius: 0 12px 0 0; }
.camera-guide span::before { bottom: -3px; left: -3px; border-width: 0 0 4px 4px; border-radius: 0 0 0 12px; }
.camera-guide span::after { right: -3px; bottom: -3px; border-width: 0 4px 4px 0; border-radius: 0 0 12px; }
.scan-button { display: flex; width: 100%; min-height: 62px; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #1d6e91, #173b57); box-shadow: 0 8px 20px rgba(23,59,87,.18); font-size: 16px; font-weight: 900; }
.scan-button .ph-icon { width: 24px; height: 24px; }
.divider { display: flex; align-items: center; gap: 10px; margin: 13px 0; color: #8ca0ad; font-size: 11px; }
.divider::before, .divider::after { flex: 1; height: 1px; background: var(--line); content: ""; }
.manual-scan { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.today-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 14px; }
.today-card div { display: flex; flex-direction: column; gap: 2px; }
.today-card span { color: var(--muted); font-size: 11px; }
.today-card strong { font-size: 16px; }

.search-box { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; padding: 0 10px; border: 1px solid #bdccd5; border-radius: 13px; background: #fff; }
.search-box:focus-within { border-color: #4e95bb; box-shadow: 0 0 0 3px rgba(78,149,187,.12); }
.search-box > span,
.search-box > .ph-icon { color: var(--muted); text-align: center; }
.search-box .field-search-icon { width: 18px; height: 18px; }
.search-box input { min-height: 46px; padding-left: 4px; border: 0; box-shadow: none; }
.filter-row { display: flex; overflow-x: auto; gap: 7px; margin: 11px -14px 13px; padding: 0 14px 3px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter { flex: 0 0 auto; min-height: 36px; padding: 8px 13px; border: 1px solid #c4d2db; border-radius: 999px; color: #506b7d; background: #fff; font-size: 12px; font-weight: 800; }
.filter.active { border-color: var(--navy); color: #fff; background: var(--navy); }
.inventory-status-filters[hidden] { display: none; }
.inventory-status-filter-label { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.inventory-status-filter-row { margin-top: 7px; }
.inventory-status-filter-row .filter { display: inline-flex; align-items: center; gap: 7px; }
.inventory-status-filter-row .filter b {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  color: inherit;
  background: rgba(80, 107, 125, .1);
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}
.inventory-status-filter-row .filter.active b { background: rgba(255, 255, 255, .18); }

.item-list, .label-item-list, .conflict-list { display: grid; gap: 9px; }
.item-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px 12px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #d1dde4;
  border-radius: 15px;
  color: inherit;
  background: #fff;
  box-shadow: 0 4px 14px rgba(23,59,87,.04);
  text-align: left;
}
.item-card:hover { border-color: #9fb9c9; }
.item-card-main { min-width: 0; }
.item-number { display: block; margin-bottom: 3px; color: var(--navy-2); font-size: 12px; font-weight: 900; }
.item-name { display: -webkit-box; overflow: hidden; font-size: 14px; font-weight: 800; line-height: 1.28; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.item-meta { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 5px 12px; color: var(--muted); font-size: 11px; }
.status-pill { align-self: start; max-width: 130px; padding: 5px 8px; border-radius: 999px; color: #506b7d; background: #edf2f5; font-size: 10px; font-weight: 900; text-align: center; }
.status-pill.found { color: #0f7355; background: var(--mint-soft); }
.status-pill.issue { color: #a45f00; background: var(--amber-soft); }
.status-pill.missing { color: #a82f39; background: var(--red-soft); }
.empty-state { padding: 35px 18px; border: 1px dashed #b9c9d2; border-radius: 16px; color: var(--muted); background: rgba(255,255,255,.55); text-align: center; line-height: 1.5; }

.notice { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; padding: 13px 14px; }
.notice span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.notice.info { border-color: #b9d4e4; background: var(--blue-soft); }
.notice.warning { border-color: #efd08d; background: var(--amber-soft); }
.printer-panel {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #c8d7df;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(23,59,87,.05);
}
.printer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.printer-head > div { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.printer-head span { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .1em; }
.printer-head strong { font-size: 17px; }
.printer-head button { flex: 0 0 auto; }
.printer-status {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 12px 0;
  padding: 10px 11px;
  border-radius: 11px;
  color: var(--muted);
  background: #f1f5f7;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}
.printer-status i { flex: 0 0 9px; width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: #8297a5; box-shadow: 0 0 0 3px rgba(130,151,165,.13); }
.printer-status.connecting i, .printer-status.printing i { animation: pulse 1s infinite; background: var(--amber); }
.printer-status.ready { color: #0f7355; background: var(--mint-soft); }
.printer-status.ready i { background: var(--mint); box-shadow: 0 0 0 3px rgba(22,137,102,.13); }
.printer-status.error { color: #94313a; background: var(--red-soft); }
.printer-status.error i { background: var(--red); box-shadow: 0 0 0 3px rgba(189,60,69,.13); }
.printer-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.printer-settings > label, .custom-label-size label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.printer-settings > label:first-child { grid-column: 1 / -1; }
.printer-settings input, .printer-settings select { min-height: 40px; padding: 8px 10px; }
.custom-label-size { display: grid; grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 10px; }
.printer-apply { grid-column: 1 / -1; }
.printer-hint { margin: 11px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.label-tools { display: grid; gap: 10px; margin-bottom: 12px; }
.inline-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.label-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 11px 12px; border: 1px solid #d1dde4; border-radius: 14px; background: #fff; }
.label-row input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--navy); }
.label-row button { padding: 8px 9px; border: 1px solid #c4d2db; border-radius: 9px; color: var(--navy); background: #fff; font-size: 12px; font-weight: 850; }
.label-copy { min-width: 0; }
.label-copy strong, .label-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-copy strong { font-size: 13px; }
.label-copy span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.sticky-action { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 10; margin-top: 13px; padding: 8px; border: 1px solid #cbd8df; border-radius: 15px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.sticky-action button { width: 100%; }
.label-sticky-actions { display: grid; gap: 7px; }

.sync-hero { display: flex; align-items: center; gap: 12px; padding: 15px; }
.sync-symbol { display: grid; flex: 0 0 48px; width: 48px; height: 48px; place-items: center; border-radius: 14px; color: #fff; background: var(--amber); font-size: 23px; font-weight: 900; }
.sync-hero.online .sync-symbol { background: var(--mint); }
.sync-hero.syncing .sync-symbol { animation: rotate 1.3s linear infinite; background: var(--navy-2); }
@keyframes rotate { to { transform: rotate(360deg); } }
.sync-hero > div:last-child { display: flex; flex-direction: column; gap: 3px; }
.sync-hero span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; margin: 12px 0; }
.metric-grid div { min-width: 0; padding: 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric-grid div:nth-child(2n) { border-right: 0; }
.metric-grid div:nth-last-child(-n+2) { border-bottom: 0; }
.metric-grid span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.metric-grid strong { display: block; overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.conflict-list { margin-top: 12px; }
.conflict-card { padding: 13px; border: 1px solid #e3bd82; border-radius: 14px; background: #fff8e8; }
.conflict-card strong, .conflict-card span { display: block; }
.conflict-card span { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.conflict-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.conflict-actions button { min-height: 38px; padding: 7px; border-radius: 9px; font-size: 11px; font-weight: 850; }
.admin-panel { margin-top: 12px; padding: 0 14px; }
.admin-panel summary { padding: 15px 0; cursor: pointer; font-weight: 850; }
.admin-panel[open] { padding-bottom: 15px; }
.admin-panel p { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.admin-panel code { font-size: 11px; }
.install-links { display: grid; gap: 9px; }
.progress-panel { margin-top: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.progress-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.progress-head div { display: grid; gap: 3px; }
.progress-head span { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .04em; }
.progress-head strong { font-size: 16px; }
.progress-head > strong { color: var(--navy-2); font-size: 25px; }
.progress-track { overflow: hidden; height: 9px; margin-top: 12px; border-radius: 999px; background: #dfe8ed; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--navy-2), var(--mint)); transition: width .25s ease; }
.progress-panel > p { margin: 8px 0 0; font-size: 11px; }
.room-progress-list { display: grid; gap: 8px; margin-top: 14px; }
.room-progress-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding-top: 9px; border-top: 1px solid var(--line); }
.room-progress-row strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.room-progress-row span { color: var(--muted); font-size: 11px; }
.room-progress-row b { color: var(--navy-2); font-size: 12px; }
.room-progress-row .progress-track { grid-column: 1 / -1; height: 6px; margin-top: 2px; }
.team-panel summary span { display: inline-grid; min-width: 22px; height: 22px; margin-left: 5px; place-items: center; border-radius: 999px; color: #fff; background: var(--navy-2); font-size: 11px; }
.invite-member-form { display: grid; gap: 7px; margin-bottom: 8px; }
.invite-member-form > label { color: var(--muted); font-size: 11px; font-weight: 750; }
.team-member-list { display: grid; gap: 7px; margin-top: 10px; }
.team-member { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafb; }
.team-member div { min-width: 0; }
.team-member strong, .team-member span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-member strong { font-size: 13px; }
.team-member span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.team-member button { min-height: 34px; padding: 6px 9px; border: 1px solid #e1b9bd; border-radius: 9px; color: var(--red); background: #fff; font-size: 11px; font-weight: 800; }
.file-button { position: relative; cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.danger-zone, .account-panel { border-color: #e7c4c7; }
.muted { color: var(--muted); }
.form-error { min-height: 19px; margin: 4px 0 0; color: var(--red) !important; font-size: 12px; font-weight: 750; }

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 7px max(7px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
  border-top: 1px solid #c9d6dd;
  background: rgba(255,255,255,.96);
  box-shadow: 0 -8px 26px rgba(23,59,87,.08);
  backdrop-filter: blur(16px);
}
.bottom-nav button { position: relative; display: flex; min-height: 53px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: 12px; color: #6b8190; background: transparent; font-size: 10px; font-weight: 800; }
.bottom-nav button > span { display: grid; width: 24px; height: 24px; place-items: center; line-height: 1; }
.bottom-nav .field-nav-icon { width: 21px; height: 21px; }
.bottom-nav button.active { color: var(--navy); background: #e8f0f4; }
.bottom-nav b { position: absolute; top: 3px; right: calc(50% - 25px); color: #fff; background: var(--red); }

dialog {
  width: min(calc(100% - 20px), 620px);
  max-height: calc(100dvh - 20px);
  padding: 0;
  border: 0;
  border-radius: 21px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 80px rgba(8,31,47,.35);
}
dialog::backdrop { background: rgba(9,28,41,.62); backdrop-filter: blur(3px); }
.item-dialog form, .label-dialog, .enterprise-asset-card { padding: 18px; }
.item-dialog form { display: grid; gap: 12px; overflow-y: auto; max-height: calc(100dvh - 20px); }
.item-dialog label { display: grid; gap: 6px; }
.add-found-button { margin-top: 10px; border-style: dashed; }
.create-item-lead { margin: 0; padding: 10px 11px; border-radius: 11px; background: var(--blue-soft); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-head h2 { margin: 3px 0 0; font-size: 22px; }
.dialog-close { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 11px; color: var(--ink); background: #edf2f5; }
.dialog-close .ph-icon { width: 20px; height: 20px; }
.two-cols { display: grid; grid-template-columns: 1fr; gap: 12px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.custom-fields-editor { display: grid; gap: 12px; }
.custom-fields-editor:empty { display: none; }
.custom-fields-editor label { display: grid; gap: 6px; }
.form-hint { margin: -2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.inline-printer-status { margin: -1px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.enterprise-asset-card { display: grid; gap: 13px; overflow-y: auto; max-height: calc(100dvh - 20px); }
.enterprise-asset-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f2f5f7;
}
.enterprise-asset-tabs button {
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 850;
}
.enterprise-asset-tabs button.active {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 7px 18px rgba(37, 98, 140, .2);
}
.enterprise-asset-tab-panel { display: grid; gap: 13px; }
.enterprise-information-head { display: grid; gap: 3px; }
.enterprise-information-head h3,
.enterprise-custom-fields-head h3 { margin: 0; font-size: 17px; }
.enterprise-information-head > p:last-child {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.enterprise-custom-fields { display: grid; gap: 9px; }
.enterprise-custom-fields-head { display: grid; gap: 2px; }
.enterprise-state-row { display: flex; flex-wrap: wrap; gap: 7px; }
.enterprise-state, .enterprise-qr-state { display: inline-flex; min-height: 28px; align-items: center; padding: 5px 10px; border-radius: 999px; color: #155d43; background: #e1f3eb; font-size: 10px; font-weight: 850; letter-spacing: .02em; }
.enterprise-state.new { color: #7a5108; background: #fff0cb; }
.enterprise-state.retired { color: #8d3038; background: #f9e1e3; }
.enterprise-qr-state.pending { color: #6d5360; background: #eee8eb; }
.enterprise-reconciliation {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f9fa;
}
.enterprise-reconciliation-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.enterprise-reconciliation-head h3 { margin: 2px 0 0; font-size: 15px; }
.enterprise-reconciliation-kicker { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .12em; }
.enterprise-reconciliation-status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  color: #596673;
  background: #e7ecef;
  font-size: 10px;
  font-weight: 850;
  text-align: center;
}
.enterprise-reconciliation-status.found { color: #155d43; background: #e1f3eb; }
.enterprise-reconciliation-status.no_inventory_number,
.enterprise-reconciliation-status.discrepancy,
.enterprise-reconciliation-status.duplicate { color: #7a5108; background: #fff0cb; }
.enterprise-reconciliation-status.not_found { color: #8d3038; background: #f9e1e3; }
.enterprise-reconciliation-reasons { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.enterprise-observed-number { display: grid; gap: 6px; font-size: 12px; font-weight: 750; }
.enterprise-observed-number input { min-height: 46px; font-size: 16px; }
.enterprise-observed-number small,
#createItemInventoryField small { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.4; }
.enterprise-reconciliation-note { display: grid; gap: 6px; font-size: 12px; font-weight: 750; }
.enterprise-reconciliation-note textarea {
  min-height: 68px;
  resize: vertical;
  font-size: 16px;
  line-height: 1.4;
}
.enterprise-reconciliation-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.enterprise-reconciliation-actions button {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  font-size: 11px;
  font-weight: 800;
}
.enterprise-reconciliation-actions button.active { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.enterprise-reconciliation-save { width: 100%; min-height: 46px; }
.enterprise-reconciliation-warning {
  margin: 0;
  padding: 10px 11px;
  border: 1px solid #e9bd67;
  border-radius: 11px;
  color: #6f4a08;
  background: #fff4d8;
  font-size: 11px;
  line-height: 1.45;
}
.enterprise-asset-details { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfd; }
.enterprise-asset-details div { min-width: 0; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.enterprise-asset-details div:last-child { border-bottom: 0; }
.enterprise-asset-details dt { margin: 0 0 3px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.enterprise-asset-details dd {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  white-space: pre-wrap;
}
.enterprise-field-value { flex: 1 1 0; min-width: 0; }
.enterprise-field-edit {
  display: inline-grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: -5px -5px -5px 0;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(77, 97, 115, .28);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, .58);
}
.enterprise-field-edit .ph-icon { width: 18px; height: 18px; }
.enterprise-field-edit:hover { color: var(--blue); border-color: rgba(37, 98, 140, .35); background: #fff; }
.enterprise-field-edit:focus-visible { outline: 3px solid rgba(37, 98, 140, .25); outline-offset: 2px; }
.enterprise-field-edit[hidden] { display: none; }
.enterprise-field-editor {
  display: grid;
  flex: 1 0 100%;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding-top: 4px;
}
.enterprise-field-editor[hidden] { display: none; }
.enterprise-field-editor label { display: grid; gap: 5px; min-width: 0; }
.enterprise-field-editor-label { color: var(--muted); font-size: 11px; font-weight: 750; white-space: normal; }
.enterprise-field-editor-help { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.4; }
.enterprise-field-editor input,
.enterprise-field-editor select,
.enterprise-field-editor textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
}
.enterprise-field-editor textarea { min-height: 94px; resize: vertical; }
.enterprise-field-editor input:focus,
.enterprise-field-editor select:focus,
.enterprise-field-editor textarea:focus { outline: 3px solid rgba(37, 98, 140, .18); border-color: var(--blue); }
.enterprise-field-editor-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.enterprise-field-editor-actions button { min-height: 42px; padding: 8px 12px; }
.enterprise-field-editor-error {
  min-height: 0;
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
  white-space: normal;
}
.enterprise-field-editor[aria-busy="true"] { opacity: .7; pointer-events: none; }
.enterprise-edit-status { margin: -2px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.enterprise-edit-status.error { color: var(--red); }
.enterprise-edit-status[hidden] { display: none; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}
.enterprise-photo-gallery {
  display: grid;
  gap: 9px;
  min-width: 0;
}
.enterprise-photo-viewport {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #e7edf1;
  overscroll-behavior-x: contain;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.enterprise-photo-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  color: inherit;
  background: transparent;
  cursor: zoom-in;
}
.enterprise-asset-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #e7edf1;
  -webkit-user-drag: none;
}
.enterprise-asset-photo.is-placeholder {
  padding: 24px;
  opacity: .72;
  object-fit: contain;
}
.enterprise-photo-overlay-control {
  position: absolute;
  z-index: 3;
}
.enterprise-photo-add,
.enterprise-photo-delete {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, .42);
  color: #fff;
  background: rgba(13, 35, 51, .82);
  box-shadow: 0 8px 24px rgba(7, 24, 36, .24);
  backdrop-filter: blur(12px);
}
.enterprise-photo-add {
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
}
.enterprise-photo-delete {
  top: 12px;
  right: 12px;
  display: grid;
  width: 44px;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  line-height: 1;
}
.enterprise-photo-add .ph-icon { width: 19px; height: 19px; }
.enterprise-photo-delete .ph-icon { width: 21px; height: 21px; }
.enterprise-photo-source-menu {
  right: 12px;
  bottom: 62px;
  display: grid;
  min-width: 174px;
  overflow: hidden;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 14px;
  background: rgba(13, 35, 51, .94);
  box-shadow: 0 14px 34px rgba(7, 24, 36, .34);
  backdrop-filter: blur(16px);
}
.enterprise-photo-source-menu label {
  min-height: 44px;
  padding: 11px 12px;
  border-radius: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 750;
  cursor: pointer;
}
.enterprise-photo-source-menu label:hover,
.enterprise-photo-source-menu label:focus-within { background: rgba(255, 255, 255, .12); }
.enterprise-photo-navigation {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 44px;
  gap: 8px;
  align-items: center;
  min-height: 44px;
}
.enterprise-photo-navigation > button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface);
  line-height: 1;
}
.enterprise-photo-navigation > button .ph-icon { width: 22px; height: 22px; }
.enterprise-photo-dots {
  display: flex;
  overflow: hidden;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.enterprise-photo-dots button {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
}
.enterprise-photo-dots button::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #a8b7c1;
  content: "";
  transform: translate(-50%, -50%);
  transition: width .18s ease, background .18s ease;
}
.enterprise-photo-dots button.active::after {
  width: 22px;
  background: var(--navy-2);
}
.enterprise-photo-count {
  min-width: 38px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  text-align: right;
}
.enterprise-photo-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.enterprise-photo-status.error { color: var(--red); }
.enterprise-photo-viewer[open] {
  display: grid;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding:
    max(18px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  border-radius: 0;
  place-items: center;
  background: #05080d;
}
.enterprise-photo-viewer::backdrop { background: #05080d; }
.enterprise-photo-viewer img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 36px);
  object-fit: contain;
}
.enterprise-photo-viewer-close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 2;
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 50%;
  color: #fff;
  background: rgba(5, 8, 13, .72);
  font-size: 28px;
}
body.enterprise-photo-viewer-open { overflow: hidden; }
.label-dialog { overflow-y: auto; }
.label-preview { display: grid; overflow: auto; margin: 15px 0; place-items: center; padding: 12px; border-radius: 15px; background: #e7edf0; }
.label-preview canvas { display: block; width: min(100%, 400px); height: auto; border: 1px solid #c2ccd1; background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.10); image-rendering: auto; }
.label-dialog-actions { display: grid; grid-template-columns: 1fr; }
.stacked-mobile { display: grid; grid-template-columns: 1fr; }

.toast {
  --toast-swipe-x: 0px;
  position: fixed;
  right: 14px;
  bottom: calc(82px + env(safe-area-inset-bottom));
  left: 14px;
  z-index: 80;
  max-width: 480px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 15px;
  border-radius: 12px;
  color: #fff;
  background: #173b57;
  box-shadow: 0 10px 30px rgba(8,31,47,.28);
  font-size: 13px;
  font-weight: 700;
  touch-action: pan-y;
  user-select: none;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(var(--toast-swipe-x), 14px, 0);
  transition: opacity .2s ease, transform .2s ease;
  will-change: transform, opacity;
}
.toast.is-visible, .toast.show, .toast.visible { opacity: 1; transform: translate3d(var(--toast-swipe-x), 0, 0); pointer-events: auto; }
.toast.is-swiping { transition: none; }
.toast.is-dismissing-right { transform: translate3d(calc(100% + 40px), 0, 0); opacity: 0; pointer-events: none; }
.toast-message { min-width: 0; flex: 1 1 auto; }
.toast-close {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  font: 400 24px/1 system-ui, sans-serif;
}
.toast-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.toast[data-tone="error"], .toast[data-tone="danger"], .toast.error { background: #9f3039; }
.toast[data-tone="warning"], .toast.warning { background: #805416; }

@media (max-width: 639px) {
  .field-theme input,
  .field-theme textarea,
  .field-theme select {
    font-size: 16px;
  }
}

@media (min-width: 640px) {
  .topbar { padding-right: 22px; padding-left: 22px; }
  .view { padding: 24px; }
  .project-strip { padding-right: 24px; padding-left: 24px; }
  .two-cols { grid-template-columns: 1fr 1fr; }
  .enterprise-asset-details { grid-template-columns: 1fr 1fr; }
  .enterprise-asset-details div { border-right: 1px solid var(--line); }
  .enterprise-asset-details div:nth-child(2n), .enterprise-asset-details div.wide { border-right: 0; }
  .enterprise-asset-details div.wide { grid-column: 1 / -1; }
  .enterprise-asset-details div:last-child { border-bottom: 0; }
  .stacked-mobile { grid-template-columns: 1fr 1fr; }
  .filter-row { margin-right: 0; margin-left: 0; padding-right: 0; padding-left: 0; }
  .label-tools { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .printer-settings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .printer-settings > label:first-child { grid-column: auto; }
  .custom-label-size { grid-column: span 2; }
  .printer-apply { grid-column: auto; align-self: end; }
  .label-sticky-actions { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .label-dialog-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bottom-nav { right: 18px; bottom: 16px; left: 50%; width: min(560px, calc(100% - 36px)); padding: 7px; border: 1px solid #c9d6dd; border-radius: 18px; transform: translateX(-50%); }
  main { padding-bottom: 105px; }
  .sticky-action { bottom: 98px; }
}

@media (min-width: 900px) {
  .brandcopy strong { font-size: 16px; }
  .view.active[data-view="scan"] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; align-items: start; }
  .view.active[data-view="scan"] .scan-result { grid-column: 1; margin: 0; }
  .view.active[data-view="scan"] .room-card { grid-column: 1; }
  .view.active[data-view="scan"] .scanner-card { grid-column: 2; grid-row: 1 / span 3; }
  .view.active[data-view="scan"] .today-card { grid-column: 1; margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
