/* LandAI CSS owner: Left rail navigation and account rail controls. */
.app-left-rail {
  position: fixed;
  inset: var(--premium-banner-offset) auto 0 0;
  z-index: 6;
  width: var(--left-rail-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 10px;
  background: #fff;
  border-right: 1px solid var(--border);
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.08);
  color: var(--text);
  gap: 12px;
}

.app-left-rail-btn {
  position: relative;
  width: 64px;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 2px;
  border: none;
  border-radius: 16px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

/* The hidden attribute (e.g. admin-gated County Stats) must win over display:flex. */
.app-left-rail-btn[hidden] {
  display: none;
}

.app-left-rail-label {
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-align: center;
  color: inherit;
  opacity: 0.72;
}

.app-left-rail-btn:hover .app-left-rail-label,
.app-left-rail-btn:focus-visible .app-left-rail-label,
.app-left-rail-btn[aria-expanded="true"] .app-left-rail-label,
.app-left-rail-btn[aria-pressed="true"] .app-left-rail-label {
  opacity: 1;
}

.app-left-rail-btn:hover,
.app-left-rail-btn:focus-visible,
.app-left-rail-btn[aria-expanded="true"] {
  background: #f1f5f9;
  outline: none;
}

.app-left-rail-btn:active {
  transform: scale(0.96);
}

.app-left-rail-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #16a34a;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.app-left-rail-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.app-left-rail-account-btn {
  color: #334155;
  transition: background 0.16s ease, color 0.16s ease, transform 0.18s ease;
}

.app-left-rail-content-btn {
  color: #334155;
}

.app-left-rail-content-btn:hover,
.app-left-rail-content-btn:focus-visible {
  background: #ecfdf5;
  color: #0f172a;
}

.app-left-rail-content-btn[aria-expanded="true"] {
  background: #0f172a;
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.2);
}

.app-left-rail-content-btn[aria-expanded="true"]:hover,
.app-left-rail-content-btn[aria-expanded="true"]:focus-visible {
  background: #111827;
  color: #fff;
}

.app-left-rail-stats-btn {
  color: #334155;
}

.app-left-rail-stats-btn:hover,
.app-left-rail-stats-btn:focus-visible {
  background: #eff6ff;
  color: #0f172a;
}

.app-left-rail-stats-btn[aria-pressed="true"] {
  background: #0f172a;
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.2);
}

.app-left-rail-stats-btn[aria-pressed="true"]:hover,
.app-left-rail-stats-btn[aria-pressed="true"]:focus-visible {
  background: #111827;
  color: #fff;
}

.app-left-rail-stats-btn.is-loading {
  background: #eff6ff;
  color: #0f172a;
  cursor: progress;
  opacity: 1;
}

.app-left-rail-stats-btn.is-loading::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(37, 99, 235, 0.22);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: map-loading-spin 0.75s linear infinite;
}

.app-left-rail-usage-btn {
  color: #334155;
}

.app-left-rail-usage-btn:hover,
.app-left-rail-usage-btn:focus-visible {
  background: #f0fdf4;
  color: #0f172a;
}

.app-left-rail-usage-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.app-left-rail-account-btn:hover,
.app-left-rail-account-btn:focus-visible,
.app-left-rail-account-btn[aria-expanded="true"] {
  background: #ecfdf5;
  color: #0f172a;
}

.app-left-rail-icon {
  display: block;
}

.account-rail-options {
  width: 86px;
  display: grid;
  gap: 6px;
}

.account-rail-options[hidden] {
  display: none;
}

.account-rail-option {
  min-height: 36px;
  padding: 6px 5px;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  cursor: pointer;
}

.account-rail-option:hover,
.account-rail-option:focus-visible {
  border-color: rgba(22, 163, 74, 0.38);
  background: #ecfdf5;
  color: #15803d;
  outline: none;
}

/* Developer build tools (dev only): DEV badge + release-preview toggle.
   Hidden by default; shown only when js/feature-flags.js marks the dev env. */
.app-dev-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding-bottom: 10px;
  border-bottom: 1px dashed #e2e8f0;
}

html.landai-env-development .app-dev-panel {
  display: flex;
}

.app-dev-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.1;
  text-align: center;
}

.app-dev-badge-env {
  font-size: 0.74rem;
}

.app-dev-badge-branch {
  max-width: 64px;
  overflow: hidden;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #b45309;
}

.app-dev-badge-branch[hidden] {
  display: none;
}

.app-dev-badge-preview {
  display: none;
  padding: 1px 6px;
  border-radius: 999px;
  background: #b45309;
  color: #fff;
  font-size: 0.5rem;
  letter-spacing: 0.04em;
}

html.landai-release-preview .app-dev-badge {
  background: #fde68a;
}

html.landai-release-preview .app-dev-badge-preview {
  display: inline-block;
}

.app-dev-preview-btn {
  color: #b45309;
}

.app-dev-preview-btn:hover,
.app-dev-preview-btn:focus-visible {
  background: #fef3c7;
  color: #92400e;
}

.app-dev-preview-btn .app-dev-preview-icon-on {
  display: none;
}

.app-dev-preview-btn[aria-pressed="true"] {
  background: #fef3c7;
  color: #b45309;
  box-shadow: inset 0 0 0 2px #f59e0b;
}

.app-dev-preview-btn[aria-pressed="true"] .app-dev-preview-icon-off {
  display: none;
}

.app-dev-preview-btn[aria-pressed="true"] .app-dev-preview-icon-on {
  display: block;
}

.app-dev-help-btn {
  color: #b45309;
}

.app-dev-help-mark {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 2px solid currentColor;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
}

.app-dev-help-btn:hover,
.app-dev-help-btn:focus-visible {
  background: #fef3c7;
  color: #92400e;
}

.app-dev-help-btn[aria-expanded="true"] {
  background: #fef3c7;
  color: #b45309;
  box-shadow: inset 0 0 0 2px #f59e0b;
}

/* County map button shows a spinner while the coverage overlay loads. */
.app-left-rail-county-map-btn.is-loading {
  cursor: progress;
}

.app-left-rail-county-map-btn.is-loading::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(22, 163, 74, 0.22);
  border-top-color: #16a34a;
  border-radius: 50%;
  animation: map-loading-spin 0.75s linear infinite;
}

.dev-hide-list {
  position: fixed;
  top: calc(var(--premium-banner-offset, 0px) + 96px);
  left: calc(var(--left-rail-width) + 10px);
  z-index: 30;
  width: 280px;
  max-width: calc(100vw - var(--left-rail-width) - 24px);
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
  color: var(--text);
}

.dev-hide-list[hidden] {
  display: none;
}

.dev-hide-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dev-hide-list-title {
  font-size: 0.92rem;
  font-weight: 800;
}

.dev-hide-list-close {
  padding: 2px 7px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.dev-hide-list-close:hover,
.dev-hide-list-close:focus-visible {
  background: #f1f5f9;
  color: #0f172a;
  outline: none;
}

.dev-hide-list-sub {
  margin: 6px 0 10px;
  font-size: 0.72rem;
  line-height: 1.3;
  color: #64748b;
}

.dev-hide-list-items {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dev-hide-list-item {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid #fde68a;
  border-radius: 9px;
  background: #fffbeb;
}

.dev-hide-list-item-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #92400e;
}

.dev-hide-list-item-reason {
  font-size: 0.7rem;
  line-height: 1.3;
  color: #b45309;
}

.dev-hide-list-empty {
  font-size: 0.78rem;
  color: #64748b;
}
