:root {
  --color-ink: #142b3c;
  --color-muted: #647684;
  --color-background: #f4f6f7;
  --color-surface: #ffffff;
  --color-border: #dce4e8;
  --color-primary: #087c79;
  --color-primary-hover: #066560;
  --color-primary-soft: #e7f4f1;
  --color-navy: #102d3e;
  --color-navy-deep: #0b2230;
  --color-person: #00bca2;
  --color-vehicle: #ffbf59;
  --color-warning: #9b5b13;
  --color-warning-soft: #fff3df;
  --color-danger: #a43232;
  --color-danger-soft: #fbecec;
  --shadow-soft: 0 8px 30px rgb(20 43 60 / 4%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--color-ink);
  background: var(--color-background);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.42;
}

button,
a,
input,
select {
  outline-offset: 4px;
}

:focus-visible {
  outline: 3px solid var(--color-primary);
}

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

h1,
h2,
h3 {
  line-height: 1.2;
}

h1 {
  letter-spacing: -0.045em;
}

h2 {
  letter-spacing: -0.025em;
}

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

.eyebrow {
  margin-bottom: 12px;
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 10px 17px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  text-decoration: none;
  transition: background 140ms, border-color 140ms, box-shadow 140ms;
}

.button-primary {
  color: var(--color-surface);
  background: var(--color-primary);
}

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

.button-secondary {
  border-color: var(--color-border);
  color: var(--color-ink);
  background: var(--color-surface);
}

.button-secondary:hover:not(:disabled) {
  border-color: #afc2c9;
  background: #f8fbfb;
}

.button-text {
  color: var(--color-muted);
  background: transparent;
}

.button-text:hover {
  color: var(--color-ink);
  background: var(--color-background);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-ink);
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(8 124 121 / 15%);
  border-radius: 11px;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  font-size: 21px;
  font-weight: 800;
}

.brand-divider {
  width: 1px;
  height: 22px;
  margin: 0 8px;
  background: var(--color-border);
}

.brand-section {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.app-header {
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--color-border);
  padding: 14px max(5vw, 24px);
  background: var(--color-surface);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 8px;
}

.header-actions form {
  margin: 0;
}

.header-actions .button {
  white-space: nowrap;
}

.account-layout {
  width: min(560px, calc(100% - 40px));
  margin: 46px auto;
}

.account-panel {
  border: 1px solid var(--color-border);
  border-radius: 15px;
  padding: 35px;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.account-panel h1 {
  margin-bottom: 13px;
  font-size: 29px;
}

.account-description {
  margin-bottom: 27px;
  color: var(--color-muted);
  font-size: 14px;
}

.password-form,
.password-field {
  display: flex;
  flex-direction: column;
}

.password-form {
  gap: 22px;
}

.password-field {
  gap: 8px;
}

.password-field label {
  color: var(--color-ink);
  font-size: 12px;
  font-weight: 650;
}

.password-field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 11px 13px;
  color: var(--color-ink);
  background: var(--color-surface);
}

.password-help,
.password-session-note {
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: 11px;
}

.password-help {
  margin-top: 0;
}

.password-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.password-actions .button-primary {
  flex: 1 1 auto;
}

.gallery-layout {
  width: min(1320px, 90vw);
  margin: 0 auto;
  padding-top: 48px;
}

.page-introduction {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.page-introduction h1 {
  margin-bottom: 12px;
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 750;
}

.page-description {
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: 14px;
}

.reception-status {
  display: flex;
  max-width: 310px;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--color-muted);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #a2b1b9;
}

.has-reception .status-dot {
  background: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-soft);
}

.has-reception-error .status-dot {
  background: var(--color-warning);
  box-shadow: 0 0 0 4px var(--color-warning-soft);
}

.filter-panel {
  border: 1px solid var(--color-border);
  border-radius: 13px;
  padding: 21px 24px;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.traffic-overview {
  margin-bottom: 32px;
}

.traffic-overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.traffic-overview-header h2 {
  margin-bottom: 5px;
  font-size: 18px;
}

.traffic-overview-header p {
  margin-bottom: 0;
  font-size: 12px;
}

.history-link {
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.history-link:hover {
  text-decoration: underline;
}

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

.traffic-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 19px 21px;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.traffic-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.traffic-card h3 {
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
}

.traffic-icon {
  display: inline-flex;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-size: 19px;
  font-weight: 600;
}

.traffic-icon-entry {
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

.traffic-icon-exit {
  color: var(--color-warning);
  background: var(--color-warning-soft);
}

.traffic-icon-occupancy {
  color: #487591;
  background: #edf3f8;
  font-size: 16px;
  font-weight: 750;
}

.traffic-value {
  margin: 10px 0 5px;
  font-size: 39px;
  font-weight: 750;
  letter-spacing: -0.05em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.traffic-caption {
  min-height: 18px;
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: 11px;
}

.traffic-overview-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--color-muted);
  font-size: 11px;
}

.traffic-overview-note p {
  margin-bottom: 0;
}

.traffic-overview-note > span {
  white-space: nowrap;
}

.traffic-overview .gallery-message {
  margin: 15px 0 0;
  font-size: 12px;
}

.traffic-history {
  margin-top: 45px;
  scroll-margin-top: 24px;
}

.traffic-history .eyebrow {
  margin-bottom: 8px;
}

.history-panel {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 13px;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.traffic-filter-form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 15px;
  border-bottom: 1px solid var(--color-border);
  padding: 20px 24px;
}

.traffic-filter-form input {
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--color-ink);
  background: var(--color-surface);
  font-size: 13px;
}

.traffic-history-message {
  margin-bottom: 0;
  padding: 35px 24px;
  color: var(--color-muted);
  font-size: 13px;
  text-align: center;
}

.traffic-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.traffic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.traffic-table th,
.traffic-table td {
  border-bottom: 1px solid #edf1f3;
  padding: 14px 20px;
  text-align: right;
}

.traffic-table th:first-child,
.traffic-table td:first-child {
  padding-left: 24px;
  text-align: left;
}

.traffic-table th {
  color: var(--color-muted);
  background: #fafcfc;
  font-size: 11px;
  font-weight: 650;
}

.traffic-table tbody tr:hover {
  background: #fcfefe;
}

.traffic-table .traffic-day-label {
  font-weight: 600;
}

.traffic-table .traffic-history-today {
  display: inline-block;
  border-radius: 4px;
  margin-left: 8px;
  padding: 2px 5px;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  font-size: 10px;
}

.traffic-day-note {
  display: block;
  margin-top: 4px;
  color: var(--color-warning);
  font-size: 10px;
}

.traffic-table .history-images-button {
  min-height: 32px;
  padding: 6px 8px;
  color: var(--color-primary);
  font-size: 11px;
}

.traffic-history-note {
  margin-bottom: 0;
  padding: 16px 24px;
  color: var(--color-muted);
  font-size: 11px;
}

.traffic-pagination {
  margin: 0;
  padding: 20px 24px 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.filter-form {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.filter-field label,
.login-form label {
  color: var(--color-ink);
  font-size: 12px;
  font-weight: 650;
}

.camera-field {
  min-width: 240px;
  flex: 1 1 auto;
}

.filter-field select,
.login-form input[type="password"] {
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 13px;
  color: var(--color-ink);
  background: var(--color-surface);
}

.date-control {
  display: flex;
  height: 44px;
  overflow: hidden;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}

.day-button {
  width: 35px;
  height: 42px;
  flex: 0 0 auto;
  border: 0;
  color: var(--color-muted);
  background: transparent;
  font-size: 24px;
}

.day-button:hover {
  background: var(--color-background);
}

.date-control input {
  width: 153px;
  min-width: 0;
  height: 42px;
  border: 0;
  padding: 6px;
  color: var(--color-ink);
  background: transparent;
  font-size: 14px;
  text-align: center;
}

.refresh-button {
  margin-left: 8px;
}

.refresh-button svg {
  width: 17px;
  height: 17px;
}

.results-section {
  padding-top: 34px;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 22px;
}

.results-header h2 {
  margin-bottom: 5px;
  font-size: 20px;
}

.results-header p {
  margin-bottom: 0;
  font-size: 13px;
}

.results-count {
  border-radius: 7px;
  padding: 6px 11px;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.gallery-message {
  border: 1px solid #ebd2ab;
  border-radius: 9px;
  padding: 13px 17px;
  color: var(--color-warning);
  background: var(--color-warning-soft);
}

.loading-panel {
  display: flex;
  min-height: 250px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--color-muted);
  font-size: 14px;
}

.loading-spinner {
  width: 21px;
  height: 21px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: turn 700ms linear infinite;
}

@keyframes turn {
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  display: flex;
  min-height: 330px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed #cdd9de;
  border-radius: 13px;
  padding: 35px;
  background: rgb(255 255 255 / 48%);
  text-align: center;
}

.empty-icon {
  display: flex;
  width: 72px;
  height: 72px;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  margin-bottom: 20px;
  color: #6b979b;
  background: var(--color-primary-soft);
}

.empty-icon svg {
  width: 43px;
  height: 43px;
}

.empty-state h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.empty-state p {
  max-width: 450px;
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: 14px;
}

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

.image-card {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  transition: transform 160ms, box-shadow 160ms;
}

.image-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgb(20 43 60 / 9%);
}

.image-card-button {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.image-card-button:focus-visible {
  outline-offset: -4px;
}

.card-preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #dfe7e9;
}

.card-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-time {
  position: absolute;
  right: 11px;
  bottom: 10px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 6px;
  padding: 3px 7px;
  color: var(--color-surface);
  background: rgb(11 34 48 / 77%);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.025em;
}

.card-content {
  padding: 16px;
}

.card-camera {
  margin-bottom: 11px;
  color: var(--color-muted);
  font-size: 12px;
}

.card-reasons,
.event-list,
.detection-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.event-badge,
.detection-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--color-muted);
  background: #f0f3f5;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
}

.event-person {
  color: #08695f;
  background: #e4f5ee;
}

.event-arrival {
  color: #2b6094;
  background: #e9f1fa;
}

.event-departure {
  color: #986415;
  background: var(--color-warning-soft);
}

.event-control {
  color: var(--color-muted);
  background: #edf1f3;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #edf1f3;
  margin-top: 15px;
  padding-top: 12px;
  color: var(--color-muted);
  font-size: 11px;
}

.card-open {
  color: var(--color-primary);
  font-weight: 650;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 23px;
  margin-top: 32px;
  font-size: 13px;
}

.gallery-footer {
  margin: 36px 0 28px;
  color: var(--color-muted);
  font-size: 11px;
  text-align: center;
}

body.dialog-open {
  overflow: hidden;
}

.image-dialog {
  width: min(1120px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 0;
  color: var(--color-ink);
  background: var(--color-surface);
  box-shadow: 0 20px 80px rgb(0 0 0 / 25%);
}

.image-dialog::backdrop {
  background: rgb(8 24 34 / 77%);
  backdrop-filter: blur(4px);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 26px 17px;
}

.dialog-header .eyebrow {
  margin-bottom: 6px;
}

.dialog-header h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.icon-button {
  display: flex;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-muted);
  background: var(--color-surface);
  font-size: 28px;
  line-height: 1;
}

.icon-button:hover {
  background: var(--color-background);
}

.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #edf1f3;
  padding: 12px 26px;
}

.viewer-navigation {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.viewer-navigation .button {
  min-width: 36px;
  min-height: 34px;
  padding: 5px 10px;
}

.overlay-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 20px;
}

.box-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-muted);
  font-size: 12px;
  cursor: pointer;
}

.box-toggle input {
  width: 17px;
  height: 17px;
  accent-color: var(--color-primary);
}

.image-stage {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: center;
  background: var(--color-navy-deep);
}

.image-canvas {
  position: relative;
  display: flex;
  max-width: 100%;
}

.image-canvas img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 64dvh;
  height: auto;
  object-fit: contain;
}

.detection-overlay,
.counting-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.counting-region {
  fill: var(--color-person);
  fill-opacity: 0.12;
  stroke: var(--color-person);
  stroke-width: 2;
  stroke-dasharray: 8 6;
  vector-effect: non-scaling-stroke;
}

.counting-line,
.counting-arrow,
.counting-line-shadow,
.counting-arrow-shadow {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.counting-line-shadow,
.counting-arrow-shadow {
  stroke: var(--color-navy-deep);
  stroke-width: 6;
}

.counting-line,
.counting-arrow {
  stroke: var(--color-person);
  stroke-width: 3;
}

.counting-label-background {
  fill: var(--color-navy-deep);
  fill-opacity: 0.92;
}

.counting-label {
  fill: var(--color-surface);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 650;
}

.counting-zone-help {
  border-bottom: 1px solid var(--color-border);
  margin: 0;
  padding: 12px 26px;
  color: var(--color-muted);
  background: #f7fbfa;
  font-size: 11px;
}

.detection-box {
  fill: transparent;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.detection-person .detection-box {
  stroke: var(--color-person);
}

.detection-vehicle .detection-box {
  stroke: var(--color-vehicle);
}

.detection-label-background {
  fill: var(--color-vehicle);
}

.detection-person .detection-label-background {
  fill: var(--color-person);
}

.detection-label {
  fill: var(--color-navy-deep);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 750;
}

.image-error {
  margin: 30px;
  color: white;
  text-align: center;
}

.dialog-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  padding: 23px 26px;
}

.dialog-details h3 {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 650;
}

.detection-pill {
  border: 1px solid #c9e8e2;
  color: #08695f;
  background: #eef8f5;
}

.detection-pill-vehicle {
  border-color: #ebd6b6;
  color: #885819;
  background: #fff7e9;
}

.confidence-help {
  margin: 11px 0 0;
  color: var(--color-muted);
  font-size: 11px;
}

.no-detection {
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: 12px;
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--color-border);
  padding: 17px 26px;
  background: #fafcfc;
  font-size: 11px;
}

.login-page {
  min-height: 100dvh;
  background: var(--color-surface);
}

.login-layout {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: 1fr 1fr;
}

.login-intro {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 40px clamp(35px, 6vw, 100px) 30px;
  color: var(--color-surface);
  background: var(--color-navy);
}

.brand-light {
  color: var(--color-surface);
}

.brand-light .brand-mark {
  border-color: rgb(109 216 198 / 22%);
  color: #8de0d4;
  background: rgb(109 216 198 / 10%);
}

.login-presentation {
  margin-top: 55px;
}

.login-presentation .eyebrow {
  color: #8de0d4;
}

.login-presentation h1 {
  margin-bottom: 22px;
  font-size: clamp(40px, 4.5vw, 64px);
  line-height: 1.08;
}

.login-presentation > p:not(.eyebrow) {
  max-width: 360px;
  color: #b0c3cd;
  font-size: 15px;
}

.login-illustration {
  position: relative;
  height: 190px;
  overflow: hidden;
  margin: 35px 0;
}

.illustration-grid {
  position: absolute;
  inset: 0;
  opacity: 0.33;
  background-image: linear-gradient(rgb(171 213 217 / 12%) 1px, transparent 1px), linear-gradient(90deg, rgb(171 213 217 / 12%) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(transparent, black 20%, black 70%, transparent);
}

.illustration-frame {
  position: absolute;
  border: 1px solid #58bdae;
  border-radius: 5px;
  background: rgb(54 154 143 / 9%);
}

.illustration-frame span {
  position: absolute;
  top: -13px;
  left: 9px;
  border: 1px solid #387e7c;
  border-radius: 4px;
  padding: 2px 7px;
  color: #9de5d9;
  background: var(--color-navy);
  font-size: 10px;
}

.frame-person {
  top: 37px;
  left: 35px;
  width: 63px;
  height: 112px;
}

.frame-car {
  top: 75px;
  left: 144px;
  width: 160px;
  height: 74px;
  border-color: #b59a65;
  background: rgb(181 154 101 / 6%);
}

.frame-car span {
  border-color: #7d725c;
  color: #e8ce9b;
}

.illustration-caption {
  position: absolute;
  right: 0;
  bottom: 2px;
  color: #7796a5;
  font-size: 10px;
  letter-spacing: 0.03em;
}

.login-footer {
  margin-bottom: 0;
  color: #87a2b0;
  font-size: 11px;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px;
}

.login-form-wrap {
  width: 100%;
  max-width: 350px;
}

.lock-symbol {
  display: flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d0e9e2;
  border-radius: 17px;
  margin-bottom: 28px;
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

.lock-symbol svg {
  width: 27px;
  height: 27px;
}

.login-form-wrap h2 {
  margin-bottom: 13px;
  font-size: 29px;
}

.login-form-wrap > .muted {
  margin-bottom: 29px;
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.login-form input[type="password"] {
  height: 49px;
}

.login-submit {
  justify-content: space-between;
  margin-top: 12px;
  padding: 14px 17px;
}

.login-note {
  margin: 24px 0 0;
  color: var(--color-muted);
  font-size: 11px;
  text-align: center;
}

.form-error {
  border: 1px solid #ecc8c8;
  border-radius: 8px;
  padding: 11px 13px;
  color: var(--color-danger);
  background: var(--color-danger-soft);
  font-size: 13px;
}

.form-success {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 11px 13px;
  color: var(--color-primary-hover);
  background: var(--color-primary-soft);
  font-size: 13px;
}

@media (min-width: 1500px) {
  .image-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1050px) {
  .filter-form {
    flex-wrap: wrap;
    gap: 14px;
  }

  .camera-field {
    min-width: 210px;
  }

  .refresh-button {
    margin-left: 0;
  }

  .page-introduction {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .reception-status {
    max-width: none;
    min-height: auto;
  }

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

@media (max-width: 700px) {
  .app-header {
    min-height: 72px;
    flex-wrap: wrap;
    padding: 12px 20px;
  }

  .header-actions {
    flex: 1 1 260px;
    justify-content: flex-start;
    gap: 4px;
  }

  .header-actions .button {
    min-height: 40px;
    padding: 8px;
    font-size: 11px;
  }

  .account-layout {
    margin-top: 26px;
  }

  .account-panel {
    padding: 24px 20px;
  }

  .account-panel h1 {
    font-size: 25px;
  }

  .password-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .brand-divider,
  .brand-section {
    display: none;
  }

  .logout-button {
    min-height: 40px;
    padding-right: 0;
    padding-left: 8px;
    font-size: 11px;
  }

  .gallery-layout {
    width: calc(100% - 40px);
    padding-top: 29px;
  }

  .page-introduction {
    margin-bottom: 24px;
  }

  .page-introduction h1 {
    font-size: 29px;
  }

  .page-description {
    max-width: 330px;
    font-size: 13px;
  }

  .filter-panel {
    padding: 17px;
  }

  .traffic-overview-header {
    align-items: flex-start;
  }

  .traffic-overview-header h2 {
    font-size: 16px;
  }

  .history-link {
    padding-top: 2px;
    font-size: 11px;
  }

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

  .traffic-card {
    padding: 15px;
  }

  .traffic-card-occupancy {
    grid-column: 1 / -1;
  }

  .traffic-card h3 {
    font-size: 11px;
  }

  .traffic-card-heading {
    gap: 6px;
  }

  .traffic-icon {
    width: 25px;
    height: 25px;
    border-radius: 7px;
    font-size: 16px;
  }

  .traffic-value {
    font-size: 34px;
  }

  .traffic-overview-note {
    flex-direction: column;
    gap: 5px;
    font-size: 10px;
  }

  .traffic-filter-form {
    gap: 12px;
    padding: 17px;
  }

  .traffic-filter-form .filter-field {
    width: calc(50% - 6px);
  }

  .traffic-filter-form input {
    width: 100%;
    min-width: 0;
  }

  .traffic-table th,
  .traffic-table td {
    padding: 13px 15px;
  }

  .traffic-table th:first-child,
  .traffic-table td:first-child {
    padding-left: 17px;
  }

  .traffic-history-note {
    padding: 15px 17px;
  }

  .camera-field {
    width: 100%;
  }

  .date-field {
    flex: 1 1 auto;
  }

  .date-control input {
    width: 100%;
  }

  .date-control {
    width: 100%;
  }

  .today-button {
    flex: 0 0 auto;
  }

  .refresh-button {
    width: 100%;
    margin-top: 2px;
  }

  .results-section {
    padding-top: 28px;
  }

  .results-header h2 {
    font-size: 18px;
  }

  .results-count {
    font-size: 10px;
  }

  .image-grid {
    gap: 16px;
  }

  .card-content {
    padding: 13px;
  }

  .image-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 12px;
  }

  .dialog-header {
    padding: 17px;
  }

  .dialog-header h2 {
    font-size: 17px;
  }

  .viewer-toolbar {
    align-items: flex-start;
    gap: 9px;
    padding: 11px 17px;
  }

  .viewer-navigation {
    gap: 9px;
  }

  .box-toggle {
    gap: 5px;
    font-size: 11px;
  }

  .overlay-controls {
    align-items: flex-end;
    flex-direction: column;
    gap: 8px;
  }

  .counting-zone-help {
    padding: 12px 17px;
  }

  .dialog-details {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 20px 17px;
  }

  .dialog-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 13px;
    padding: 16px 17px;
  }

  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-intro {
    min-height: auto;
    padding: 26px;
  }

  .login-presentation {
    margin-top: 36px;
  }

  .login-presentation h1 {
    margin-bottom: 12px;
    font-size: 36px;
  }

  .login-presentation h1 br {
    display: none;
  }

  .login-presentation > p:not(.eyebrow) {
    max-width: 420px;
    margin-bottom: 0;
    font-size: 13px;
  }

  .login-illustration,
  .login-footer {
    display: none;
  }

  .login-panel {
    padding: 35px 26px;
  }

  .lock-symbol {
    display: none;
  }

  .login-form-wrap {
    max-width: 420px;
  }

  .login-form-wrap h2 {
    font-size: 25px;
  }
}

@media (max-width: 460px) {
  .image-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .card-preview {
    aspect-ratio: 16 / 10;
  }

  .pagination {
    gap: 12px;
  }

  .pagination .button {
    padding-right: 12px;
    padding-left: 12px;
    font-size: 11px;
  }

  .pagination .muted {
    font-size: 11px;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
