:root {
  --bg: #f3f7fa;
  --land: #bdd6d2;
  --road: rgba(255, 255, 255, 0.98);
  --river: rgba(173, 205, 213, 0.74);
  --panel: rgba(255, 255, 255, 0.8);
  --line: rgba(77, 93, 93, 0.12);
  --text: #243746;
  --muted: #718082;
  --accent: #cc9441;
  --accent-soft: rgba(204, 148, 65, 0.16);
  --green: #9b7440;
  --green-soft: rgba(155, 116, 64, 0.12);
  --locked: #a5aea0;
  --bronze: #9d6844;
  --silver: #8e9aa3;
  --gold: #b98a1f;
  --platinum: #5f8f92;
  --obsidian: #2f3138;
  --shadow: 0 18px 38px rgba(89, 79, 66, 0.08);
  --sheet-height: min(58vh, 520px);
  --radius-card: 22px;
  --radius-soft: 18px;
  --radius-pill: 999px;
  --shadow-soft: 0 12px 30px rgba(26, 48, 67, 0.08);
  --shadow-card: 0 18px 44px rgba(26, 48, 67, 0.12);
  --shadow-floating: 0 28px 64px rgba(26, 48, 67, 0.18);
  --interactive: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

input, textarea, select {
  -webkit-user-select: auto;
  user-select: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Hiragino Sans GB", "PingFang SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(173, 205, 213, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(204, 148, 65, 0.08), transparent 22%),
    linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  text-rendering: optimizeLegibility;
}

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

.hidden {
  display: none !important;
}

.mobile-dock {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 1320;
  display: grid;
  grid-template-columns: repeat(3, minmax(124px, 1fr));
  gap: 10px;
  padding: 10px 12px;
  width: min(540px, calc(100vw - 32px));
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 24px 44px rgba(46, 71, 84, 0.18);
  backdrop-filter: blur(24px) saturate(1.2);
}

.mobile-dock-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(33, 52, 71, 0.78);
  border-radius: 18px;
  min-height: 56px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.22s var(--interactive), background-color 0.22s ease, box-shadow 0.22s ease, color 0.22s ease;
}

.mobile-dock-button.active {
  background: rgba(255, 255, 255, 0.6);
  color: #244261;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 18px rgba(37, 60, 81, 0.08);
}

.mobile-dock-button-primary {
  background: linear-gradient(180deg, #2f537d 0%, #284667 100%);
  color: #fffdfa;
  box-shadow: 0 14px 26px rgba(40, 70, 103, 0.26);
}

.mobile-dock-button:hover {
  transform: translateY(-1px);
}

.mobile-dock-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}

.mobile-dock-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  height: 100vh;
  display: block;
  overflow: hidden;
  position: relative;
}

.app-loading {
  position: absolute;
  inset: 0;
  z-index: 1800;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(142, 196, 255, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 210, 153, 0.18), transparent 26%),
    linear-gradient(180deg, rgba(241, 246, 252, 0.82), rgba(229, 237, 245, 0.8));
  backdrop-filter: blur(14px) saturate(1.08);
}

.app-loading.hidden {
  display: none;
}

.app-loading-card {
  display: grid;
  justify-items: start;
  gap: 16px;
  width: min(520px, calc(100vw - 40px));
  padding: 22px 24px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.52);
  color: var(--text);
  box-shadow: 0 24px 48px rgba(54, 77, 96, 0.14);
}

.app-loading-visual {
  position: relative;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
}

.app-loading-copy {
  display: grid;
  gap: 10px;
}

.app-loading-eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #617487;
}

.app-loading-copy h2 {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #22394f;
}

.app-loading-tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.app-loading-tips li {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(244, 249, 255, 0.78);
  border: 1px solid rgba(125, 151, 176, 0.12);
  color: #4f6276;
  font-size: 13px;
  line-height: 1.45;
}

.map-view {
  position: relative;
  padding: 0;
  min-width: 0;
  isolation: isolate;
}

.upload-button,
.upload-confirm {
  border: 1px solid rgba(80, 92, 94, 0.08);
  background: linear-gradient(180deg, #335a86 0%, #284667 100%);
  color: #fbfaf7;
  border-radius: var(--radius-pill);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(40, 70, 103, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.22s var(--interactive), box-shadow 0.22s var(--interactive), filter 0.22s ease;
}

.upload-button:hover,
.upload-confirm:hover {
  transform: translateY(-1px);
  filter: saturate(1.04) brightness(1.01);
  box-shadow: 0 18px 34px rgba(40, 70, 103, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.upload-button:active,
.upload-confirm:active {
  transform: translateY(1px) scale(0.995);
}

.small-label,
.meta-text {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* .rail-card is fully defined below */

.map-canvas {
  height: 100vh;
  border-radius: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
  background:
    radial-gradient(circle at 12% 14%, rgba(188, 214, 210, 0.38), transparent 24%),
    radial-gradient(circle at 78% 12%, rgba(204, 148, 65, 0.06), transparent 18%),
    linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
}

.map-canvas::before,
.map-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.map-canvas::before {
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.08), transparent 24%),
    radial-gradient(circle at 82% 74%, rgba(183, 211, 216, 0.04), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(240, 246, 250, 0.06));
}

.map-canvas::after {
  background: linear-gradient(180deg, rgba(216, 231, 240, 0.04), rgba(18, 50, 72, 0.025));
}

.marker-label {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(80, 92, 94, 0.08);
  font-size: 10px;
  letter-spacing: 0.04em;
  max-width: 138px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 0 auto;
  margin-top: -1px;
}

.marker-label.hidden {
  display: none !important;
}

.portal-marker {
  width: auto !important;
  height: auto !important;
  min-width: 120px;
  min-height: 82px;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  pointer-events: auto;
  overflow: visible !important;
}


.portal-marker-shell {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 180px;
  min-width: 180px;
  padding-top: 4px;
  overflow: visible;
}

.portal-marker-droplet {
  --pin-stroke: #1e3b61;
  width: 62px;
  height: 62px;
  border-radius: 999px;
  transform: none;
  border: 2px solid var(--pin-stroke);
  background-color: rgba(255, 255, 255, 0.98);
  background-size: cover;
  background-position: center;
  display: block;
  box-shadow: 0 2px 10px rgba(23, 42, 64, 0.16);
  flex: 0 0 auto;
  position: relative;
}

.portal-marker.zoom-9 .portal-marker-droplet,
.portal-marker.zoom-10 .portal-marker-droplet {
  width: 40px;
  height: 40px;
  border-width: 2px;
  box-shadow: 0 2px 7px rgba(23, 42, 64, 0.14);
}

.portal-marker.zoom-11 .portal-marker-droplet {
  width: 52px;
  height: 52px;
  border-width: 2px;
  box-shadow: 0 2px 8px rgba(23, 42, 64, 0.15);
}

.portal-marker.hot .portal-marker-droplet {
  width: 74px;
  height: 74px;
  --pin-stroke: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(147, 103, 34, 0.2);
}

.portal-marker.hot.zoom-9 .portal-marker-droplet,
.portal-marker.hot.zoom-10 .portal-marker-droplet {
  width: 48px;
  height: 48px;
  box-shadow: 0 2px 8px rgba(147, 103, 34, 0.17);
}

.portal-marker.hot.zoom-11 .portal-marker-droplet {
  width: 60px;
  height: 60px;
  box-shadow: 0 2px 9px rgba(147, 103, 34, 0.18);
}

.portal-marker.mine .portal-marker-droplet {
  --pin-stroke: #3d6289;
  border-color: #3d6289;
}

.portal-marker-pulse {
  position: absolute;
  top: -6px;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  border: 1px solid rgba(211, 154, 59, 0.34);
  animation: pulse 2.8s infinite;
  pointer-events: none;
}


.side-rail {
  position: fixed;
  left: 0;
  right: 0;
  margin: 0 auto;
  bottom: 92px;
  width: min(720px, calc(100vw - 32px));
  padding: 12px 0 4px;
  display: grid;
  gap: 12px;
  align-content: start;
  height: auto;
  max-height: calc(100vh - 100px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  transition: opacity 0.18s ease, transform 0.22s ease, height 0.16s linear;
  z-index: 1250;
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(240, 245, 250, 0.35) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 20px 50px rgba(29, 49, 67, 0.12);
  backdrop-filter: blur(35px) saturate(190%);
  -webkit-backdrop-filter: blur(35px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.48);
}

.sheet-handle {
  touch-action: none;
  cursor: default;
}

.app-shell.rail-empty .side-rail {
  display: none;
}

.side-rail.dragging {
  transition: opacity 0.18s ease, transform 0.22s ease; /* Disable height transition while dragging */
}

.app-shell.rail-collapsed .side-rail {
  opacity: 0;
  transform: translateY(calc(100% + 24px));
  pointer-events: none;
  overflow: hidden;
}

.rail-card {
  margin: 0 12px;
  border-radius: var(--radius-card);
  padding: 16px;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.62) 0%, rgba(247, 251, 254, 0.44) 100%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 8px 32px rgba(29, 49, 67, 0.04);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.profile-head,
.card-heading,
.rank-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.profile-head {
  justify-content: start;
}

.headline-block {
  display: grid;
  gap: 6px;
}

.card-subtitle {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(77, 96, 111, 0.92);
}

.search-panel {
  margin-top: 2px;
}

.search-input {
  margin-top: 0;
  padding-left: 15px;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: linear-gradient(135deg, #284667, #3d6289);
  color: white;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 18px rgba(40, 70, 103, 0.2);
}

.profile-lines {
  margin-top: 10px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.hub-panel {
  display: grid;
  gap: 12px;
  max-height: min(66vh, 620px);
  overflow: auto;
  overscroll-behavior: contain;
}

.rail-card.hub-panel {
  overflow: auto;
}

.rank-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.rank-item {
  border-radius: 18px;
  padding: 12px;
  border: 1px solid rgba(80, 92, 94, 0.08);
  background: linear-gradient(180deg, rgba(248, 251, 254, 0.84), rgba(255, 255, 255, 0.78));
  align-items: center;
  box-shadow: 0 8px 22px rgba(29, 49, 67, 0.05);
  transition: transform 0.22s var(--interactive), box-shadow 0.22s var(--interactive), border-color 0.22s ease;
}

.rank-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(29, 49, 67, 0.08);
  border-color: rgba(72, 105, 136, 0.14);
}

.rank-podium-1 {
  background: linear-gradient(180deg, rgba(255, 247, 217, 0.9), rgba(255, 255, 255, 0.8));
  border-color: rgba(213, 161, 52, 0.24);
}

.rank-podium-2 {
  background: linear-gradient(180deg, rgba(242, 245, 250, 0.9), rgba(255, 255, 255, 0.8));
  border-color: rgba(143, 157, 175, 0.22);
}

.rank-podium-3 {
  background: linear-gradient(180deg, rgba(247, 233, 221, 0.9), rgba(255, 255, 255, 0.8));
  border-color: rgba(164, 117, 78, 0.24);
}

.rank-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.rank-main strong {
  line-height: 1.25;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list-inline {
  margin-top: 6px;
}

.portal-tag-list {
  margin-top: 10px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(69, 102, 137, 0.14);
  background: rgba(244, 249, 255, 0.88);
  color: #48627d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-selector.is-disabled {
  opacity: 0.48;
}

.tag-selector.is-disabled .tag-chip-button {
  cursor: default;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

.tag-chip-button {
  appearance: none;
  cursor: pointer;
  transition: transform 0.2s var(--interactive), background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.tag-chip-button:hover {
  transform: translateY(-1px);
}

.tag-chip-button.active {
  background: linear-gradient(180deg, #335a86 0%, #284667 100%);
  border-color: transparent;
  color: #fefcf8;
  box-shadow: 0 8px 16px rgba(40, 70, 103, 0.16);
}

.rank-leading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rank-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.rank-score b {
  font-size: 14px;
  color: #8d5f1f;
}

.rank-badge {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  position: relative;
  border: 1px solid rgba(73, 90, 101, 0.24);
  background: rgba(236, 243, 249, 0.92);
  color: #4b6072;
  flex: 0 0 auto;
}

.rank-badge svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rank-badge-number {
  position: absolute;
  right: -4px;
  top: -4px;
  min-width: 13px;
  height: 13px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 3px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: #335273;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.rank-badge-1 {
  color: #a2771a;
  border-color: rgba(183, 134, 33, 0.3);
  background: rgba(255, 243, 198, 0.88);
}

.rank-badge-2 {
  color: #607385;
  border-color: rgba(116, 134, 151, 0.3);
  background: rgba(236, 241, 246, 0.92);
}

.rank-badge-3 {
  color: #885a32;
  border-color: rgba(145, 98, 62, 0.28);
  background: rgba(247, 233, 219, 0.9);
}

.tabs-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-button {
  border: 1px solid rgba(80, 92, 94, 0.08);
  background: rgba(245, 250, 255, 0.86);
  color: var(--muted);
  border-radius: var(--radius-pill);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.22s var(--interactive), background-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

.tab-button.active {
  background: linear-gradient(180deg, #335a86 0%, #284667 100%);
  color: #fbfaf7;
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(40, 70, 103, 0.16);
}

.tab-button:hover {
  transform: translateY(-1px);
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(80, 92, 94, 0.08);
}

.auth-tabs .tab-button {
  flex: 1;
  text-align: center;
}

.auth-form-area {
  display: grid;
  gap: 16px;
}

.auth-form-area .coord-input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0;
}

.auth-form-area .section-line {
  margin: 4px 0;
}

.auth-submit,
.auth-fallback {
  width: 100%;
}

.auth-submit {
  margin-top: 10px;
}

.auth-fallback {
  margin-top: 8px;
}

.auth-divider {
  position: relative;
  margin: 16px 0;
  text-align: center;
}

.auth-divider::before {
  position: absolute;
  inset: 50% 0 auto;
  z-index: 0;
  border-top: 1px solid rgba(80, 92, 94, 0.08);
  content: "";
}

.auth-divider span {
  position: relative;
  z-index: 1;
  padding: 0 10px;
  color: var(--text-muted, #7e8c8d);
  background: var(--bg-card, #fff);
  font-size: 12px;
}

.auth-status-line {
  margin-top: 16px;
}

.auth-status-line .meta-text {
  width: 100%;
  color: var(--color-error, #ff4d4f);
  text-align: center;
}

.login-modal,
.report-modal-surface {
  width: 100%;
  max-width: 400px;
}

.profile-avatar-section {
  padding-bottom: 10px;
}

.profile-avatar-heading {
  margin-bottom: 8px;
}

.profile-avatar-action {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-privacy-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}

.me-summary {
  justify-content: flex-start;
}

.me-menu {
  display: grid;
  gap: 8px;
}

.me-menu-item {
  appearance: none;
  width: 100%;
  border: 1px solid rgba(80, 92, 94, 0.08);
  background: rgba(245, 252, 255, 0.78);
  color: var(--text);
  border-radius: 20px;
  padding: 14px 15px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(29, 49, 67, 0.04);
  transition: transform 0.22s var(--interactive), box-shadow 0.22s var(--interactive), border-color 0.22s ease, background-color 0.22s ease;
}

.me-menu-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(29, 49, 67, 0.08);
  border-color: rgba(72, 105, 136, 0.14);
  background: rgba(248, 252, 255, 0.9);
}

.me-menu-glyph {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(241, 247, 253, 0.96), rgba(231, 240, 249, 0.9));
  border: 1px solid rgba(106, 130, 153, 0.14);
  color: #355779;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.me-menu-glyph svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.me-menu-item.danger strong {
  color: #9c5a52;
}

.me-menu-item.danger .me-menu-glyph {
  color: #9c5a52;
  background: linear-gradient(180deg, rgba(255, 250, 248, 0.96), rgba(252, 241, 239, 0.9));
  border-color: rgba(156, 90, 82, 0.14);
}

.me-menu-copy {
  display: grid;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  justify-items: start;
}

.me-menu-copy strong,
.me-menu-copy span {
  text-align: left;
}

.me-menu-copy span {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.me-menu-arrow {
  margin-left: auto;
  font-size: 22px;
  color: rgba(36, 55, 70, 0.48);
  line-height: 1;
  flex: 0 0 auto;
}

.rank-list {
  align-content: start;
  overflow: auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.2), transparent 36%), rgba(36, 55, 70, 0.2);
  backdrop-filter: blur(12px) saturate(1.05);
  z-index: 1400;
  display: grid;
  place-items: center;
}

.modal-backdrop.hidden {
  display: none;
}

.upload-modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 20px;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 251, 254, 0.92));
  border: 1px solid rgba(80, 92, 94, 0.08);
  box-shadow: var(--shadow-floating);
  display: grid;
  gap: 16px;
  backdrop-filter: blur(22px);
}

.login-modal {
  width: min(420px, calc(100vw - 32px));
}

.upload-dropzone {
  border: 1px dashed rgba(80, 92, 94, 0.18);
  border-radius: 24px;
  min-height: 120px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 6px;
  background: linear-gradient(180deg, rgba(249, 252, 255, 0.9), rgba(244, 249, 253, 0.82));
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.upload-dropzone.dragover {
  border-color: rgba(40, 70, 103, 0.38);
  background: rgba(244, 249, 250, 0.92);
  transform: translateY(-1px);
}

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

.location-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.coord-input {
  width: 100%;
  margin-top: 6px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 8px rgba(29, 49, 67, 0.02);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.coord-input:focus,
.location-search-input:focus,
textarea.coord-input:focus,
select.coord-input:focus {
  outline: none;
  border-color: rgba(10, 132, 255, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 10px rgba(10, 132, 255, 0.15);
  background: rgba(255, 255, 255, 0.7);
}

/* ==================== Admin Panel Styles ==================== */

.admin-users-list,
.admin-invite-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.admin-user-card,
.admin-invite-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.4) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 6px 18px rgba(29, 49, 67, 0.03);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  transition: transform 0.22s var(--interactive), box-shadow 0.22s var(--interactive), border-color 0.22s ease, background 0.22s ease;
}

.admin-user-card:hover,
.admin-invite-card:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0.6) 100%);
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 12px 28px rgba(29, 49, 67, 0.08), 0 0 14px rgba(10, 132, 255, 0.1);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 4px 10px rgba(0, 0, 0, 0.08);
  user-select: none;
}

.avatar.admin {
  background: linear-gradient(135deg, #ff9500 0%, #ffcc00 100%);
}

.avatar.manager {
  background: linear-gradient(135deg, #007aff 0%, #00c7fc 100%);
}

.avatar.user {
  background: linear-gradient(135deg, #34c759 0%, #85f385 100%);
}

.status-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  display: inline-block;
  text-transform: uppercase;
}

.status-pill.active {
  background: rgba(52, 199, 89, 0.12);
  color: #24b147;
  border: 1px solid rgba(52, 199, 89, 0.2);
}

.status-pill.banned {
  background: rgba(255, 59, 48, 0.12);
  color: #ff3b30;
  border: 1px solid rgba(255, 59, 48, 0.2);
}

.admin-code-style {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: rgba(10, 132, 255, 0.06);
  color: #007aff;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(10, 132, 255, 0.1);
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.admin-code-style:hover {
  background: rgba(10, 132, 255, 0.12);
  border-color: rgba(10, 132, 255, 0.25);
  box-shadow: 0 2px 6px rgba(10, 132, 255, 0.08);
}

.invite-generator-card {
  margin-bottom: 20px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.3) 100%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 20px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 8px 24px rgba(29, 49, 67, 0.04);
}

.invite-generator-card h3 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.invite-generator-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.invite-generator-row {
  display: flex;
  gap: 8px;
}

.invite-generator-count {
  flex: 1;
}

.invite-generator-note {
  flex: 3;
}

.invite-generator-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.invite-generator-input {
  box-sizing: border-box;
  width: 100%;
}

.invite-generator-count-input {
  text-align: center;
}

.invite-generator-submit {
  width: 100%;
  padding: 8px;
  font-size: 13px;
}

.admin-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(80, 92, 94, 0.06);
}

.admin-muted {
  font-size: 13px;
  color: var(--muted);
}

.admin-empty {
  padding: 20px;
  text-align: center;
}

.admin-avatar {
  flex-shrink: 0;
}

.admin-card-main {
  flex: 1;
  min-width: 0;
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-invite-header {
  margin-bottom: 4px;
}

.admin-status-pill {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.admin-email {
  margin-top: 2px;
}

.admin-compact-meta {
  font-size: 11px;
}

.admin-copy-code {
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.admin-invite-actions {
  margin-top: 6px;
  text-align: right;
}

.photo-overlay-report {
  margin-top: 4px;
}

.glass-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(40, 70, 103, 0.85);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.14s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 6px rgba(0, 0, 0, 0.02);
  text-decoration: none;
}

.glass-action-btn:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.9);
  color: rgba(40, 70, 103, 1);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 4px 10px rgba(40, 70, 103, 0.08);
}

.glass-action-btn:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.6);
}

.glass-action-btn.danger {
  color: #ff453a;
  background: rgba(255, 69, 58, 0.06);
  border: 1px solid rgba(255, 69, 58, 0.15);
}

.glass-action-btn.danger:hover {
  background: rgba(255, 69, 58, 0.15);
  border-color: rgba(255, 69, 58, 0.3);
  color: #ff3b30;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 10px rgba(255, 69, 58, 0.08);
}

.glass-action-btn.danger:active {
  background: rgba(255, 69, 58, 0.1);
}

.location-search-input {
  min-width: 0;
  margin-top: 0;
}

.search-button {
  width: auto;
  white-space: nowrap;
}

.mini-map {
  height: 240px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(80, 92, 94, 0.08);
  background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
}

.upload-confirm {
  width: 100%;
  justify-self: stretch;
}

.upload-confirm:disabled {
  opacity: 0.68;
  cursor: wait;
}

.upload-preview-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(80, 92, 94, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(247, 251, 254, 0.82));
}

.upload-preview-card img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  background: rgba(226, 232, 240, 0.9);
}

.upload-preview-meta {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
}

.upload-preview-meta strong,
.upload-preview-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-preview-meta span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}


.floating-header,
.section-line,
.agent-summary,
.owned-portal-item,
.photo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.close-button,
.fold-button,
.author-link {
  border: 1px solid rgba(80, 92, 94, 0.08);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.22s var(--interactive), box-shadow 0.22s var(--interactive), background-color 0.22s ease, border-color 0.22s ease;
}

.close-button:hover,
.fold-button:hover,
.author-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(29, 49, 67, 0.08);
  border-color: rgba(72, 105, 136, 0.14);
}

.close-button {
  width: 34px;
  height: 34px;
  font-size: 20px;
}

.fold-button {
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
}

.google-signin-container {
  min-height: 42px;
  display: grid;
  justify-content: center;
}

.floating-description,
.photo-note,
.owned-portal-item span,
.agent-meta span {
  color: var(--muted);
}

.photo-author-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.photo-author-avatar {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(80, 92, 94, 0.18);
  box-shadow: 0 1px 4px rgba(22, 37, 56, 0.16);
  flex: 0 0 auto;
}

.photo-author-avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background-color: #2f537d;
}

.photo-capture-time {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(90, 104, 117, 0.9);
}

.section-block {
  display: grid;
  gap: 10px;
}

.editor-field {
  display: grid;
  gap: 6px;
}

.editor-modal-header {
  align-items: flex-start;
}

.editor-title-wrap {
  display: grid;
  gap: 6px;
}

.editor-title-wrap .small-label {
  margin: 0;
}

.editor-title-wrap h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.editor-field-label {
  padding-left: 2px;
}

.editor-section-line {
  justify-content: flex-start;
  align-items: flex-start;
}

.editor-section-copy {
  display: grid;
  gap: 4px;
}

.editor-section-copy h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.editor-section-copy .meta-text {
  padding-left: 2px;
}

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

.stat-chip {
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid rgba(80, 92, 94, 0.08);
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.88), rgba(241, 247, 252, 0.8));
  display: grid;
  gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.stat-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.portal-meta-block {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.portal-meta-row {
  margin: 0;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 13px;
  line-height: 1.4;
}

.portal-meta-label {
  font-size: 11px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 1px;
}

.portal-share-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.portal-share-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-address-line {
  margin: 6px 0 0;
  font-size: 14px;
  color: rgba(44, 54, 56, 0.78);
  line-height: 1.4;
}

.portal-coord-line {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.portal-share-bar {
  margin-bottom: 12px;
  position: relative;
}

.portal-share-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(86, 138, 192, 0.42);
  background: linear-gradient(180deg, #8ec4ff 0%, #4d8fd8 48%, #3f7fc7 100%);
  color: #f5fbff;
  border-radius: var(--radius-pill);
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(59, 117, 182, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.38);
  transition: transform 0.22s var(--interactive), box-shadow 0.22s var(--interactive), filter 0.18s ease;
}

.photo-share-trigger {
  padding: 8px 12px;
  font-size: 12px;
  box-shadow: 0 10px 22px rgba(59, 117, 182, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.photo-share-menu {
  margin-top: 10px;
}

.portal-share-trigger:hover {
  filter: saturate(1.06) brightness(1.02);
}

.portal-share-trigger:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 5px 12px rgba(59, 117, 182, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.portal-share-trigger span,
.photo-share-trigger span {
  letter-spacing: 0.01em;
}



.portal-share-trigger svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-share-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 20;
  min-width: 180px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(251, 252, 253, 0.95);
  border: 1px solid rgba(80, 92, 94, 0.12);
  box-shadow: 0 18px 30px rgba(24, 36, 48, 0.16);
  backdrop-filter: blur(12px);
}

.portal-share-item {
  border: 0;
  border-radius: 10px;
  text-align: left;
  padding: 9px 10px;
  font-size: 13px;
  color: #26394d;
  background: rgba(241, 245, 249, 0.82);
  cursor: pointer;
}

.portal-share-item:hover {
  background: rgba(226, 236, 247, 0.88);
}

.recipient-modal {
  width: min(560px, calc(100vw - 24px));
}

.recipient-list {
  max-height: min(42vh, 360px);
  overflow: auto;
}

.recipient-item {
  width: 100%;
  border: 1px solid rgba(80, 92, 94, 0.08);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.recipient-item:hover {
  transform: translateY(-1px);
  background: rgba(246, 250, 255, 0.92);
}

.photo-share-menu.portal-share-menu {
  position: static;
  left: auto;
  top: auto;
  min-width: 0;
  margin-top: 10px;
  z-index: 1;
}

@media (max-width: 720px) {
  .portal-share-bar {
    margin-bottom: 10px;
  }

  #portalPanel[data-share-mode="fallback"] .portal-share-menu {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 84px);
    top: auto;
    border-radius: 20px;
    padding: 10px;
    background: rgba(248, 251, 255, 0.96);
    border: 1px solid rgba(128, 152, 176, 0.28);
    box-shadow: 0 24px 40px rgba(24, 36, 48, 0.18);
    backdrop-filter: blur(18px);
  }

  #portalPanel[data-share-mode="fallback"] .portal-share-item {
    padding: 12px 13px;
    border-radius: 12px;
    font-size: 14px;
  }

  .photo-share-menu.portal-share-menu {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    top: auto;
    margin-top: 10px;
    border-radius: 14px;
    box-shadow: 0 10px 18px rgba(24, 36, 48, 0.12);
    backdrop-filter: blur(10px);
  }
}

.photo-list {
  display: grid;
  gap: 10px;
}

.photo-list.collapsed {
  display: none;
}

.photo-card {
  border: 1px solid rgba(80, 92, 94, 0.08);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.88), rgba(241, 247, 252, 0.84));
  position: relative;
  transition: transform 0.24s var(--interactive), box-shadow 0.24s var(--interactive), border-color 0.24s ease;
  box-shadow: 0 10px 24px rgba(29, 49, 67, 0.06);
}

.photo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(29, 49, 67, 0.1);
  border-color: rgba(72, 105, 136, 0.16);
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.photo-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.photo-meta-chip {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: rgba(18, 28, 39, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  max-width: calc(100% - 20px);
}

.photo-meta-chip .photo-author-avatar {
  width: 20px;
  height: 20px;
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: none;
}

.photo-meta-chip-text {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-card.mosaic-item {
  aspect-ratio: 1 / 1;
}

.photo-card.hero-item {
  aspect-ratio: 16 / 10;
}

.photo-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.64) 100%);
  color: white;
  pointer-events: none;
  display: grid;
  gap: 2px;
}

.photo-overlay * {
  pointer-events: auto;
}

.photo-overlay-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 5px;
  border-radius: 999px;
  background: rgba(18, 28, 39, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.22);
  width: fit-content;
  max-width: 100%;
}

.photo-overlay-chip .photo-author-avatar {
  width: 18px;
  height: 18px;
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: none;
}

.photo-overlay-author {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-overlay-meta {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.72);
}

.photo-overlay-like {
  justify-self: start;
  margin-top: 4px;
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(18, 28, 39, 0.62);
  color: rgba(255, 255, 255, 0.96);
}

.photo-overlay-like.liked {
  background: rgba(59, 120, 183, 0.35);
  border-color: rgba(155, 201, 245, 0.72);
  color: #fff;
}

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

.photo-mosaic .hero-item {
  grid-column: span 3;
}

.photo-mosaic .compact-hidden {
  display: none;
}

.photo-body {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.photo-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.like-button.liked {
  background: rgba(43, 92, 140, 0.14);
  border-color: rgba(43, 92, 140, 0.28);
  color: #244d77;
}

.like-button {
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.like-button.like-burst {
  animation: likeBurst 0.32s ease;
}

.profile-email-display {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(80, 92, 94, 0.1);
  background: rgba(255, 255, 255, 0.7);
  color: rgba(44, 54, 56, 0.88);
  font-size: 13px;
}

.profile-delete-account {
  margin-top: 10px;
  width: 100%;
  justify-content: center;
}

.author-link {
  padding: 6px 10px;
  font-size: 12px;
}

.subtle-link {
  border-color: rgba(80, 92, 94, 0.06);
  background: rgba(255, 255, 255, 0.72);
  color: rgba(44, 54, 56, 0.82);
}

.danger-link {
  color: #9c5a52;
  border-color: rgba(156, 90, 82, 0.12);
  background: rgba(255, 248, 246, 0.82);
}

.photo-rank {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.month-strip {
  display: grid;
  gap: 8px;
}

.month-slider-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.month-slider {
  width: 100%;
  accent-color: #284667;
}

.month-slider-value {
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

.month-chip {
  border: 1px solid rgba(80, 92, 94, 0.08);
  background: rgba(255, 255, 255, 0.72);
  color: rgba(44, 54, 56, 0.76);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: 0.18s ease;
}

.month-chip.active {
  background: #284667;
  color: #fbfaf7;
  border-color: transparent;
  box-shadow: 0 8px 16px rgba(40, 70, 103, 0.16);
}

.coord-inline-meta {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.agent-avatar {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #284667, #3d6289);
  color: white;
  font-weight: 700;
  font-size: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 18px rgba(40, 70, 103, 0.2);
}

.agent-meta {
  display: grid;
  gap: 6px;
}

.sheet-handle {
  display: grid;
  justify-items: center;
  padding: 4px 0 2px;
}

.sheet-handle span {
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: rgba(51, 72, 86, 0.18);
}

.owned-portal-list {
  display: grid;
  gap: 8px;
}

.owned-portal-item {
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.4) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 6px 16px rgba(29, 49, 67, 0.03);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  transition: transform 0.22s var(--interactive), box-shadow 0.22s var(--interactive), border-color 0.22s ease, background-color 0.22s ease;
}

.owned-portal-item:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0.6) 100%);
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 12px 26px rgba(29, 49, 67, 0.08), 0 0 12px rgba(10, 132, 255, 0.1);
}

.inbox-item {
  display: grid;
  gap: 10px;
}

.inbox-item-unread {
  border-color: rgba(77, 143, 216, 0.26);
  background: linear-gradient(180deg, rgba(241, 248, 255, 0.94), rgba(255, 255, 255, 0.88));
}

.inbox-item-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.owned-portal-item .rank-leading {
  align-items: center;
}

.owned-portal-item .rank-thumb {
  width: 56px;
  height: 56px;
}

.upload-portal-section {
  border: 1px solid rgba(53, 88, 124, 0.2);
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(231, 244, 255, 0.58), rgba(255, 255, 255, 0.72));
}

.upload-portal-name-block {
  border: 1px dashed rgba(80, 92, 94, 0.22);
  border-radius: 14px;
  padding: 10px;
  background: rgba(250, 252, 255, 0.64);
}

.upload-group {
  border-radius: 26px;
  padding: 16px 0 10px;
}

.upload-group-photo {
  border: 1px solid rgba(80, 92, 94, 0.14);
  background: rgba(253, 255, 255, 0.82);
}

.upload-group-portal {
  border: 1px solid rgba(61, 101, 145, 0.22);
  background: linear-gradient(180deg, rgba(238, 247, 255, 0.72), rgba(255, 255, 255, 0.84));
}

.upload-subtitle {
  padding: 2px 18px 8px;
}

.upload-subtitle h3 {
  font-size: 18px;
  letter-spacing: -0.02em;
  margin: 0;
}

.upload-group-body {
  margin: 0 18px 14px;
}

.upload-main-heading {
  font-size: clamp(28px, 4vw, 34px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.upload-modal .small-label {
  font-size: 12px;
}

.upload-modal .section-line h3 {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.upload-modal .meta-text {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: none;
}

.upload-modal .coord-input,
.upload-modal .location-search-input,
.upload-modal .upload-dropzone strong,
.upload-modal .upload-dropzone span,
.upload-modal .coord-inline-meta {
  font-size: 14px;
  line-height: 1.45;
}

.lightbox-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.photo-overlay-edit {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.88);
}

#portalNameInput:disabled {
  background: rgba(230, 236, 242, 0.7);
  color: rgba(99, 112, 124, 0.72);
  cursor: not-allowed;
}

.editor-photo-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.editor-photo-thumb {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  display: block;
  background: rgba(226, 232, 240, 0.72);
}

.owned-portal-main {
  display: grid;
  gap: 4px;
}

.editor-photo-item .owned-portal-main {
  padding-top: 2px;
}

.editor-photo-item .owned-portal-main strong {
  font-size: 15px;
  line-height: 1.2;
}

.editor-photo-item .owned-portal-main span {
  line-height: 1.45;
}

.editor-photo-item .photo-head {
  justify-content: flex-start;
  gap: 8px;
  margin-top: 4px;
}

.editor-photo-actions .author-link {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
}

.editor-footer-actions {
  margin-top: 4px;
  align-items: center;
}

.editor-footer-actions .upload-confirm {
  width: auto;
  min-width: 128px;
  justify-self: auto;
}

.portal-rank-badge {
  min-width: 38px;
  text-align: center;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(211, 154, 59, 0.2);
  color: #9f6d21;
  font-weight: 700;
  font-size: 12px;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid rgba(80, 92, 94, 0.15);
  background: rgba(255, 255, 255, 0.82);
  color: #2a3d52;
}

.type-badge svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rank-score .type-badge {
  padding: 4px;
  min-width: 22px;
  min-height: 22px;
  justify-content: center;
}

.rank-score .type-badge span {
  display: none;
}

.type-badge-photo {
  background: rgba(74, 133, 193, 0.12);
  color: #2c5a88;
}

.type-badge-portal {
  background: rgba(211, 154, 59, 0.16);
  color: #94611d;
}

.type-badge {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

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

.showcase-card {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(80, 92, 94, 0.08);
  background: rgba(255, 255, 255, 0.8);
}

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

.photo-card img {
  cursor: zoom-in;
}

.lightbox-image {
  width: 100%;
  max-height: min(70vh, 720px);
  object-fit: contain;
  border-radius: 18px;
  background: rgba(226, 232, 240, 0.72);
  display: block;
}

.showcase-card div {
  padding: 8px 10px 10px;
  display: grid;
  gap: 4px;
}

.showcase-card span {
  font-size: 11px;
  color: var(--muted);
}

.rank-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.rank-leading {
  min-width: 0;
}

.rank-thumb {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(80, 92, 94, 0.12);
  background: rgba(226, 232, 240, 0.75);
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(29, 49, 67, 0.08);
}

.rank-main strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

.rank-main .meta-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-score b {
  white-space: nowrap;
}

.rank-tier-1 .rank-badge,
.rank-tier-2 .rank-badge,
.rank-tier-3 .rank-badge,
.rank-tier-4 .rank-badge,
.rank-tier-5 .rank-badge,
.rank-tier-6 .rank-badge {
  color: #2b4b6a;
}

.rank-tier-1 .rank-badge { color: #af7c1d; }
.rank-tier-2 .rank-badge { color: #6d7784; }
.rank-tier-3 .rank-badge { color: #8d5d3b; }
.rank-tier-4 .rank-badge { color: #316a75; }
.rank-tier-5 .rank-badge { color: #476d4a; }
.rank-tier-6 .rank-badge { color: #5c5c6a; }


@keyframes pulse {
  0% {
    transform: scale(0.86);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.42);
    opacity: 0;
  }
}

@keyframes likeBurst {
  0% { transform: scale(1); }
  35% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    overflow: auto;
  }

  .side-rail {
    padding: 0 18px 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: auto;
    overflow: visible;
  }

  .side-rail .sheet-handle,
  .side-rail .rail-card {
    grid-column: 1 / -1;
  }

}

@media (max-width: 720px) {
  body {
    background: #edf3f5;
  }

  .map-view {
    padding: 0;
  }

  .map-canvas {
    min-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
  }

  .side-rail {
    position: fixed;
    left: 12px;
    right: 12px;
    margin: 0;
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: auto;
    z-index: 1250;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    align-content: start;
    gap: 10px;
    height: var(--sheet-height, auto);
    max-height: calc(100dvh - 100px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px 0 4px;
    border-left: 0;
    border-radius: 32px;
    background: linear-gradient(180deg, rgba(241, 248, 253, 0.76), rgba(228, 237, 246, 0.64));
    box-shadow: var(--shadow-floating);
    backdrop-filter: blur(26px) saturate(1.15);
    transform: translateY(0);
    transition: height 0.16s linear, transform 0.24s ease, opacity 0.2s ease;
  }

  .coord-input,
  .coord-input[type="text"],
  .coord-input[type="password"],
  .coord-input[type="email"],
  .coord-input[type="date"],
  .coord-input[type="datetime-local"],
  select.coord-input,
  textarea.coord-input {
    font-size: 16px;
  }
  
  .side-rail.dragging {
    transition: transform 0.24s ease, opacity 0.2s ease; /* Disable height transition while dragging */
  }

  .side-rail.rail-collapsed {
    transform: translateY(calc(100% + 100px));
    pointer-events: none;
    opacity: 0;
  }

  .sheet-handle {
    display: grid;
    justify-items: center;
    padding: 4px 0 2px;
    cursor: grab;
  }

  .sheet-handle span {
    width: 42px;
    height: 5px;
    border-radius: 999px;
    background: rgba(51, 72, 86, 0.18);
  }

  .app-shell.rail-collapsed .side-rail {
    opacity: 0;
    transform: translateY(calc(100% + 24px));
    padding: 12px 0 4px;
  }

  .rail-card {
    margin: 0 12px;
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(247, 251, 254, 0.76));
    backdrop-filter: blur(22px);
    overflow: visible;
  }

  .profile-card {
    order: 3;
  }

  .portal-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .upload-modal {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 24px);
    border-radius: 32px;
    padding: 18px;
  }

  .upload-preview-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .upload-preview-card img {
    width: 92px;
    height: 92px;
  }

  .mini-map {
    height: 220px;
  }

  .photo-card:not(.mosaic-item):not(.hero-item) img {
    height: 164px;
  }

  .editor-photo-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .editor-photo-thumb {
    width: 64px;
    height: 64px;
  }

  .mobile-dock {
    left: 12px;
    right: 12px;
    width: auto;
    transform: none;
    bottom: calc(10px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mobile-dock-button {
    appearance: none;
    border: 0;
    background: transparent;
    color: rgba(33, 52, 71, 0.78);
    border-radius: 18px;
    min-height: 56px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
  }

  .mobile-dock-button-primary {
    background: linear-gradient(180deg, #2f537d 0%, #284667 100%);
    color: #fffdfa;
    box-shadow: 0 14px 26px rgba(40, 70, 103, 0.26);
  }

  .mobile-dock-icon {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
  }

  .mobile-dock-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

}

.photo-exif-container {
  margin-top: 12px;
  padding: 12px;
  background: rgba(80, 92, 94, 0.04);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  font-size: 11px;
}

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

.exif-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.exif-field strong {
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.exif-field span {
  color: var(--text);
  font-weight: 600;
}

.photo-details-meta {
  margin-top: 8px;
  display: grid;
  gap: 8px;
  font-size: 11px;
}

.photo-details-meta .exif-grid {
  gap: 6px;
}

.lightbox-swipe-hint {
  margin: 6px 0 0;
  min-height: 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.exif-more {
  border-top: 1px dashed rgba(80, 92, 94, 0.22);
  padding-top: 8px;
}

.exif-more summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
  user-select: none;
}

.exif-more[open] summary {
  margin-bottom: 8px;
}

/* Photogress optical interface: glass is reserved for elevated navigation. */
:root {
  --bg: #e7eef3;
  --panel: rgba(247, 251, 253, 0.76);
  --line: rgba(42, 74, 96, 0.12);
  --text: #183247;
  --muted: #607586;
  --accent: #c58a35;
  --accent-soft: rgba(197, 138, 53, 0.14);
  --radius-card: 16px;
  --radius-soft: 12px;
  --glass-thin: rgba(246, 251, 254, 0.58);
  --glass-regular: rgba(242, 248, 252, 0.72);
  --glass-thick: rgba(248, 251, 253, 0.88);
  --glass-rim: rgba(255, 255, 255, 0.72);
  --shadow-soft: 0 8px 24px rgba(21, 48, 68, 0.08);
  --shadow-card: 0 18px 44px rgba(21, 48, 68, 0.12);
  --shadow-floating: 0 28px 72px rgba(15, 40, 60, 0.2);
  --interactive: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: #dfe9f1;
  letter-spacing: -0.008em;
}

button,
input,
select,
textarea {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(47, 103, 148, 0.3);
  outline-offset: 2px;
}

.brand-island {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 18px;
  z-index: 1210;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 7px 14px 7px 8px;
  border: 1px solid var(--glass-rim);
  border-radius: 17px;
  color: var(--text);
  background: var(--glass-thin);
  box-shadow: 0 12px 34px rgba(20, 48, 67, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

.brand-mark,
.app-loading-lens {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.84);
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.96), transparent 24%),
    linear-gradient(145deg, rgba(101, 166, 210, 0.86), rgba(37, 91, 130, 0.9));
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.72),
    inset 0 -8px 16px rgba(11, 51, 82, 0.18),
    0 7px 18px rgba(23, 71, 106, 0.22);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.brand-mark span,
.app-loading-lens span {
  width: 42%;
  height: 42%;
  border: 1.5px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 14px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.sheet-handle {
  display: none;
}

.app-loading {
  background:
    radial-gradient(circle at 22% 16%, rgba(255, 255, 255, 0.76), transparent 30%),
    radial-gradient(circle at 80% 78%, rgba(117, 161, 190, 0.18), transparent 28%),
    rgba(219, 231, 239, 0.84);
  backdrop-filter: blur(22px) saturate(1.08);
  -webkit-backdrop-filter: blur(22px) saturate(1.08);
}

.app-loading-card {
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  width: min(610px, calc(100vw - 40px));
  padding: 28px;
  border-radius: 22px;
  border-color: rgba(255, 255, 255, 0.76);
  background: var(--glass-regular);
  box-shadow: var(--shadow-floating), inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(30px) saturate(1.2);
  -webkit-backdrop-filter: blur(30px) saturate(1.2);
}

.app-loading-visual {
  width: 76px;
  height: 76px;
}

.app-loading-lens {
  width: 64px;
  height: 64px;
  border-radius: 22px;
  animation: lensBreathe 2.2s var(--interactive) infinite alternate;
}

.app-loading-copy {
  gap: 7px;
  min-width: 0;
}

.app-loading-eyebrow {
  color: #46677f;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-transform: none;
}

.app-loading-copy h2 {
  max-width: 440px;
  color: var(--text);
  font-size: clamp(23px, 3vw, 30px);
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.app-loading-status {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.app-loading-tips {
  margin-top: 12px;
  gap: 0;
}

.app-loading-tips li {
  position: relative;
  padding: 8px 0 8px 19px;
  border: 0;
  border-top: 1px solid rgba(42, 74, 96, 0.08);
  border-radius: 0;
  color: #536b7d;
  background: transparent;
  font-size: 12px;
}

.app-loading-tips li::before {
  position: absolute;
  top: 14px;
  left: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(47, 103, 148, 0.58);
  content: "";
}

.mobile-dock {
  gap: 4px;
  padding: 6px;
  width: min(430px, calc(100vw - 32px));
  border-color: var(--glass-rim);
  border-radius: 20px;
  background: var(--glass-thin);
  box-shadow: 0 18px 48px rgba(18, 47, 67, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
}

.mobile-dock-button {
  min-height: 52px;
  border-radius: 15px;
  font-size: 11px;
  transition: color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.mobile-dock-button.active {
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 5px 14px rgba(26, 57, 78, 0.07);
}

.mobile-dock-button-primary {
  color: #f7fbfd;
  background: linear-gradient(180deg, #3974a2, #285a83);
  box-shadow: 0 8px 18px rgba(35, 84, 121, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mobile-dock-button:active,
.upload-button:active,
.upload-confirm:active,
.tab-button:active,
.me-menu-item:active,
.rank-item:active,
.glass-action-btn:active,
.close-button:active,
.fold-button:active,
.author-link:active {
  transform: scale(0.97);
}

.side-rail {
  bottom: 84px;
  width: min(680px, calc(100vw - 32px));
  padding: 6px;
  gap: 0;
  border-color: var(--glass-rim);
  border-radius: 21px;
  background: var(--glass-regular);
  box-shadow: var(--shadow-floating), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(28px) saturate(1.28);
  -webkit-backdrop-filter: blur(28px) saturate(1.28);
}

.rail-card,
.rail-card.hub-panel {
  margin: 0;
  padding: 18px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.hub-panel {
  gap: 14px;
  max-height: min(67vh, 650px);
}

.small-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0;
  text-transform: none;
}

.meta-text {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.card-subtitle,
.me-menu-copy span {
  color: var(--muted);
  font-size: 12px;
}

.rank-list,
.me-menu,
.owned-portal-list,
.photo-list {
  gap: 0;
}

.rank-item,
.me-menu-item,
.owned-portal-item {
  border: 0;
  border-bottom: 1px solid rgba(42, 74, 96, 0.09);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.rank-item {
  padding: 11px 4px;
}

.rank-item:first-child,
.me-menu-item:first-child,
.owned-portal-item:first-child {
  border-top: 1px solid rgba(42, 74, 96, 0.09);
}

.rank-podium-1,
.rank-podium-2,
.rank-podium-3 {
  border-color: rgba(42, 74, 96, 0.09);
  background: transparent;
}

.me-menu-item {
  min-height: 66px;
  padding: 10px 4px;
  gap: 12px;
}

.me-menu-glyph {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(69, 106, 134, 0.12);
  border-radius: 12px;
  color: #315f82;
  background: rgba(223, 235, 243, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.me-menu-item.danger .me-menu-glyph {
  background: rgba(246, 229, 226, 0.54);
}

.me-menu-arrow {
  color: rgba(49, 78, 98, 0.34);
}

.portal-stat-grid {
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(42, 74, 96, 0.09);
  border-radius: 14px;
  background: rgba(42, 74, 96, 0.08);
}

.stat-chip {
  min-height: 67px;
  padding: 11px 12px;
  border: 0;
  border-radius: 0;
  background: rgba(249, 252, 253, 0.62);
  box-shadow: none;
}

.stat-label,
.portal-meta-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.section-block {
  gap: 9px;
}

.section-line {
  min-height: 28px;
}

.tabs-header {
  gap: 3px;
  margin-bottom: 4px;
  padding: 3px;
  border-radius: 14px;
  background: rgba(47, 82, 107, 0.08);
}

.tab-button {
  min-height: 36px;
  padding: 7px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  box-shadow: none;
  transition: color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.tab-button.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(19, 45, 64, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.coord-input,
.coord-input[type="text"],
.coord-input[type="password"],
.coord-input[type="email"],
.coord-input[type="date"],
.coord-input[type="datetime-local"],
select.coord-input,
textarea.coord-input {
  min-height: 44px;
  margin-top: 5px;
  border-color: rgba(42, 74, 96, 0.12);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.56);
  box-shadow: inset 0 1px 2px rgba(21, 48, 68, 0.04);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.coord-input:focus,
.location-search-input:focus,
textarea.coord-input:focus,
select.coord-input:focus {
  border-color: rgba(47, 103, 148, 0.48);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 0 3px rgba(47, 103, 148, 0.11);
}

.modal-backdrop {
  background: rgba(21, 40, 54, 0.24);
  backdrop-filter: blur(16px) saturate(0.9);
  -webkit-backdrop-filter: blur(16px) saturate(0.9);
}

.upload-modal,
.modal-surface {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 22px;
  background: var(--glass-thick);
  box-shadow: var(--shadow-floating), inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(32px) saturate(1.18);
  -webkit-backdrop-filter: blur(32px) saturate(1.18);
}

.close-button,
.fold-button,
.author-link,
.glass-action-btn {
  border-color: rgba(42, 74, 96, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: none;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.portal-share-trigger,
.upload-button,
.upload-confirm {
  border-radius: 13px;
  background: linear-gradient(180deg, #3974a2, #285a83);
  box-shadow: 0 8px 18px rgba(35, 84, 121, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: filter 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.portal-share-menu {
  padding: 6px;
  border-color: rgba(255, 255, 255, 0.76);
  border-radius: 14px;
  background: rgba(244, 249, 252, 0.88);
  box-shadow: 0 18px 42px rgba(17, 43, 62, 0.18);
  transform-origin: top left;
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
}

.portal-share-item {
  min-height: 40px;
  border-radius: 9px;
  background: transparent;
}

.tag-chip {
  min-height: 26px;
  padding: 0 10px;
  border-color: rgba(47, 103, 148, 0.12);
  color: #41677f;
  background: rgba(225, 237, 245, 0.58);
  font-size: 11px;
  font-weight: 600;
}

.upload-dropzone,
.upload-preview-card,
.photo-exif-container,
.showcase-card {
  border-color: rgba(42, 74, 96, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: none;
}

.upload-group {
  padding: 0;
  border: 0;
  border-radius: 16px;
}

.upload-group-photo {
  background: transparent;
}

.upload-group-portal {
  padding: 14px;
  border: 1px solid rgba(47, 103, 148, 0.12);
  background: rgba(224, 236, 244, 0.46);
}

.upload-subtitle {
  padding: 0 0 10px;
}

.upload-group-body {
  margin: 0 0 16px;
}

.upload-group-body:last-child {
  margin-bottom: 0;
}

.upload-portal-name-block,
.upload-portal-section {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .mobile-dock-button:hover,
  .tab-button:hover,
  .tag-chip-button:hover,
  .rank-item:hover,
  .me-menu-item:hover,
  .close-button:hover,
  .fold-button:hover,
  .author-link:hover,
  .glass-action-btn:hover {
    transform: translateY(-1px);
  }

  .rank-item:hover,
  .me-menu-item:hover {
    border-color: rgba(42, 74, 96, 0.09);
    background: rgba(255, 255, 255, 0.34);
    box-shadow: none;
  }
}

@keyframes lensBreathe {
  0% {
    transform: scale(0.96);
    filter: saturate(0.92);
  }
  100% {
    transform: scale(1.03);
    filter: saturate(1.08);
  }
}

@media (max-width: 720px) {
  .brand-island {
    top: max(10px, env(safe-area-inset-top));
    left: 10px;
    min-height: 44px;
    padding: 5px 10px 5px 6px;
    border-radius: 15px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .brand-copy small {
    display: none;
  }

  .sheet-handle {
    display: grid;
  }

  .side-rail {
    left: 10px;
    right: 10px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    max-height: calc(100dvh - 92px);
    padding: 6px;
    border-radius: 21px;
    background: var(--glass-regular);
  }

  .rail-card,
  .rail-card.hub-panel {
    margin: 0;
    padding: 14px;
    border-radius: 15px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .mobile-dock {
    bottom: calc(8px + env(safe-area-inset-bottom));
    padding: 5px;
    border-radius: 19px;
  }

  .mobile-dock-button {
    min-height: 52px;
    border-radius: 14px;
  }

  .app-loading-card {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 22px;
  }

  .app-loading-visual {
    width: 62px;
    height: 62px;
  }

  .app-loading-lens {
    width: 56px;
    height: 56px;
    border-radius: 19px;
  }

  .app-loading-copy h2 {
    font-size: 23px;
  }

  .upload-modal {
    border-radius: 22px;
  }
}

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

@media (prefers-reduced-transparency: reduce) {
  .brand-island,
  .mobile-dock,
  .side-rail,
  .upload-modal,
  .modal-surface,
  .portal-share-menu {
    background: #f3f7fa;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(24, 50, 71, 0.28);
    --muted: #455d6f;
  }

  .brand-island,
  .mobile-dock,
  .side-rail,
  .upload-modal,
  .modal-surface {
    border-color: rgba(24, 50, 71, 0.34);
  }
}
