:root {
  --brand: #ff6a3d;
  --brand-dark: #e0552b;
  --ink: #1c2430;
  --muted: #6b7685;
  --border: #e3e7ec;
  --bg: #f5f6f8;
  --ok: #1f9d55;
  --danger: #d64545;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.topbar__brand small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}

.topbar__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

.topbar__status {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--bg);
}

.topbar__status.is-ok {
  color: var(--ok);
  background: #e7f7ee;
}

.topbar__status.is-down {
  color: var(--danger);
  background: #fbeaea;
}

.layout {
  flex: 1;
  display: flex;
  min-height: 0;
}

.map-wrapper {
  flex: 1;
  position: relative;
}

#map {
  position: absolute;
  inset: 0;
}

.panel {
  width: 360px;
  flex-shrink: 0;
  background: #fff;
  border-left: 1px solid var(--border);
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel__block h2 {
  font-size: 1rem;
  margin: 0 0 0.35rem;
}

.panel__hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.panel__label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.75rem 0 0.3rem;
}

.panel__field-row {
  display: flex;
  gap: 0.5rem;
}

input[type='text'] {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

input[type='text']:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

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

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

.btn--primary:disabled {
  background: #f0b8a4;
  cursor: not-allowed;
}

.btn--ghost {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  background: #ececef;
}

.btn--full {
  width: 100%;
  margin-top: 0.9rem;
}

.result-box {
  margin-top: 0.85rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.result-box--hidden {
  display: none;
}

.result-box__address {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.result-box__coords {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.result-box__metrics {
  display: flex;
  gap: 1.5rem;
}

.result-box__metric-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
}

.result-box__metric-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.error-box {
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  background: #fbeaea;
  color: var(--danger);
  font-size: 0.82rem;
}

.error-box--hidden {
  display: none;
}

@media (max-width: 820px) {
  .layout {
    flex-direction: column;
  }

  .map-wrapper {
    height: 45vh;
  }

  .panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}
