﻿:root {
  --bg: #f2f4f7;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #d1d5db;
  --primary: #ff5308;
  --overlay-top: 220px;
  --control-height: 86px;
  --content-max: 496px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 12px;
}

.hidden {
  display: none;
}

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

select,
input[type="text"],
button {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 10px;
  font-size: 15px;
  background: #fff;
}

button {
  cursor: pointer;
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

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

.muted {
  color: var(--muted);
}

.small {
  margin: 8px 0 0;
  font-size: 12px;
}

.label {
  font-size: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.header-card {
  background: #374151;
  padding: 10px 12px;
}

.header-card h1 {
  color: #f9fafb;
}

.header-card .muted {
  color: #d1d5db;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.brand-subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.15;
}

#workScreen {
  position: relative;
  min-height: calc(100dvh - 24px);
}

.top-stack {
  display: grid;
  gap: 10px;
  padding-bottom: calc(var(--control-height) + 24px);
}

.compact-card {
  padding: 10px;
}

.compact-card select {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 14px;
}

.inline-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  align-items: start;
}

.inline-row + .inline-row {
  margin-top: 8px;
}

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

.inline-label {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
  font-size: 13px;
  color: var(--text);
  line-height: 1;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.localita-row {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.localita-row .inline-label {
  width: 74px;
  flex: 0 0 74px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  min-height: 40px;
  height: 40px;
  line-height: 1;
  padding: 0 6px;
}

.localita-row #localitaSelect {
  flex: 1 1 auto;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 0;
  min-height: 40px;
  height: 40px;
  line-height: 1.2;
  padding-top: 0;
  padding-bottom: 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.1;
  background: #fff;
  color: var(--text);
  font-weight: 500;
}

.tag.selected {
  background: #fff3ec;
  border-color: var(--primary);
  color: #b93800;
}

.tag-photo {
  display: inline-flex;
  width: 14px;
  height: 14px;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
}

.tag-photo svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.camera-card {
  display: grid;
  gap: 8px;
}

.camera-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-frame video,
.camera-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.control-card {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(var(--content-max), calc(100vw - 24px));
  z-index: 30;
  padding: 12px;
}

.control-menu {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.action-btn {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
  padding: 6px 4px;
  display: grid;
  gap: 2px;
  justify-items: center;
}

.action-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.action-icon {
  font-size: 16px;
  line-height: 1;
}

.action-label {
  font-size: 11px;
  line-height: 1;
}

.action-panel {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  width: min(var(--content-max), calc(100vw - 24px));
  top: var(--overlay-top);
  bottom: calc(var(--control-height) + 20px);
  overflow: auto;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms ease, opacity 220ms ease;
}

.action-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -12px -12px 10px;
  padding: 8px 10px;
  background: #374151;
  border-bottom: 1px solid #2f3a4c;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.panel-head .label {
  margin: 0;
  color: #f9fafb;
  font-size: 13px;
  font-weight: 600;
}

.panel-close {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  border: 1px solid #63708a;
  color: #f9fafb;
  font-weight: 700;
  line-height: 1;
}

.map-panel {
  display: flex;
  flex-direction: column;
}

.map-wrap {
  position: relative;
  min-height: 240px;
  flex: 1;
  isolation: isolate;
}

.map-canvas {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f7;
  min-height: 240px;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.map-sat-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1200;
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border-radius: 6px;
  border: 1px solid #c7ccd6;
  background: #ffffff;
  color: #111827;
  touch-action: manipulation;
}

.map-sat-btn.active {
  border-color: var(--primary);
  color: #ffffff;
  background: var(--primary);
}

.map-center-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1200;
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  border-radius: 6px;
  border: 1px solid #c7ccd6;
  background: #ffffff;
  color: #111827;
  touch-action: manipulation;
}


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

.photo-thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}


.photo-thumb {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.setting-cols {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.setting-step {
  height: 36px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.setting-value {
  margin: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(17, 24, 39, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.photo-lightbox-image {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  object-fit: contain;
}

.photo-lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border-radius: 8px;
}

.photo-lightbox.hidden {
  display: none;
}

