
:root {
  color-scheme: dark;
  --bg: #0f1115;
  --sidebar: #141820;
  --panel: #181c24;
  --panel-light: #1c212b;
  --border: #2a3140;
  --text: #eef1f6;
  --muted: #9aa3b2;
  --faint: #6b7383;
  --gold: #e0a04a;
  --accent: #5b8def;
  --accent-soft: #8eb0f5;
  --cyan: #7ec8e3;
  --green: #8fd18a;
  --danger: #e06a5c;
  --chip: #222836;
  --radius: 12px;
  --shadow: 0 8px 28px rgba(0, 0, 0, .35);
  --focus: rgba(91, 141, 239, .38);
  /* Kahraman kalite renkleri: 5/4/3 yıldız rozetleri aynı kaynaktan beslenir. */
  --q5: #e8a33d;
  --q4: #a46ee8;
  --q3: #4f8fe0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 74% -18%, rgba(91, 141, 239, .10), transparent 42%),
    var(--bg);
  color: var(--text);
  font-family: "Outfit", "Segoe UI", Inter, system-ui, Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* Başlıklar Fraunces; font indirilemezse Segoe UI düşüşü yeterli görünür. */
h1,
h2,
h3 {
  font-family: "Fraunces", "Segoe UI", Georgia, serif;
  font-weight: 600;
  letter-spacing: .1px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
  display: flex;
}

/* SIDEBAR */

.sidebar {
  width: 248px;
  min-width: 248px;
  background: linear-gradient(180deg, #141820 0%, var(--sidebar) 72%);
  border-right: 1px solid var(--border);
  padding: 25px 15px 18px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 9px 34px;
}

.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #211b11;
  background: linear-gradient(145deg, #f0c67a, #c39850);
  box-shadow: 0 8px 24px rgba(216, 177, 109, .18);
  font-size: 17px;
  font-weight: 900;
}

.brand b {
  display: block;
  letter-spacing: 2px;
  font-size: 14px;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  letter-spacing: 3px;
  font-size: 10px;
}

.nav-label {
  padding: 0 10px;
  margin-bottom: 10px;
  color: #738294;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.7px;
}

.nav {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #aab7c4;
  padding: 11px 13px;
  margin-bottom: 4px;
  text-align: left;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  transition: .15s ease;
}

.nav:hover {
  background: rgba(255,255,255,.055);
  color: white;
}

.nav.active {
  color: #f0c67a;
  background: linear-gradient(90deg, rgba(216,177,109,.17), rgba(216,177,109,.06));
  box-shadow: inset 3px 0 var(--gold), 0 5px 16px rgba(0,0,0,.12);
}

.sidebar-bottom {
  margin-top: auto;
}

.server-card {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.server-card b {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
}

.server-card small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #60c89a;
  box-shadow: 0 0 10px rgba(96,200,154,.5);
}

.muted {
  color: #748293;
  font-size: 11px;
  padding-left: 4px;
}

/* MAIN */

.main {
  flex: 1;
  min-width: 0;
  padding: 30px clamp(20px, 2.4vw, 38px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.eyebrow {
  color: #91a1b1;
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
  margin-bottom: 7px;
}

h1 {
  margin: 0;
  font-size: clamp(23px, 2vw, 28px);
  font-weight: 700;
}

.server-pill {
  display: inline-block;
  vertical-align: middle;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(214,170,91,.13);
  color: #e3bd7d;
  font-size: 11px;
  margin-left: 6px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search {
  width: 285px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(18,28,38,.88);
  color: var(--muted);
}

.search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: white;
  font-size: 12px;
}

.search input::placeholder {
  color: #748394;
}

.primary {
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #e2bf7e, #c69a58);
  color: #211a11;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}

.primary:hover {
  background: #e0b879;
}

.primary:disabled {
  opacity: .65;
  cursor: wait;
}

/* STATS */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  min-width: 0;
  position: relative;
  overflow: hidden;
  padding: 17px 18px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(24,37,49,.95), rgba(17,27,37,.96));
  box-shadow: 0 10px 28px rgba(0,0,0,.10);
  transition: transform .18s ease, border-color .18s ease;
}

.stat:hover { transform: translateY(-2px); border-color: rgba(216,177,109,.25); }

.stat span {
  display: block;
  color: #8493a2;
  font-size: 9px;
  letter-spacing: 1.2px;
  font-weight: 700;
  margin-bottom: 9px;
}

.stat b {
  display: block;
  font-size: 19px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.stat .status {
  color: var(--green);
  font-size: 13px;
}

/* WORKSPACE */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
  min-height: 590px;
  height: calc(100vh - 225px);
}

.map-wrap {
  position: relative;
  min-width: 0;
  min-height: 450px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #192e2b;
  display: flex;
  flex-direction: column;
}

.map-toolbar {
  position: relative;
  z-index: 2;
  min-height: 53px;
  padding: 9px 12px;
  background: rgba(15,23,32,.96);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-controls select,
.filter-button {
  height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 9px;
  background: #1c212b;
  color: #dce5ed;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.filter-controls select {
  max-width: 190px;
}

.filter-controls select:focus,
.filter-button:focus {
  border-color: #c98f3f;
}

.filter-button {
  transition: .15s ease;
}

.filter-button:hover {
  background: #243342;
}

.filter-button.active {
  color: #ffe2a0;
  background: rgba(230,184,79,.16);
  border-color: #c98f3f;
}

.filter-button.secondary {
  color: #aebbc8;
}

.map-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-actions button {
  min-width: 33px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #1b2935;
  color: #dbe5ed;
  font-size: 13px;
}

.map-actions button:hover {
  background: #2a3b49;
}

#mapCanvas {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 0;
  touch-action: none;
  cursor: grab;
}

#mapCanvas:active {
  cursor: grabbing;
}

.map-footer {
  position: absolute;
  bottom: 12px;
  left: 13px;
  right: 13px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  color: rgba(235,244,239,.75);
  font-size: 11px;
  text-shadow: 0 1px 5px #000;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 39px;
  transform: translateX(-50%);
  max-width: calc(100% - 30px);
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: rgba(10,17,24,.92);
  color: #dce7e3;
  font-size: 11px;
  text-align: center;
  pointer-events: none;
  transition: opacity .2s ease;
}

/* DETAILS */

.details {
  min-width: 0;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: linear-gradient(160deg, #14202b, #101922);
}

.details-head {
  min-height: 49px;
  padding: 0 15px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #a6b3c0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.3px;
}

.details-head button {
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #94a2b0;
  font-size: 21px;
}

.details-head button:hover {
  background: rgba(255,255,255,.07);
  color: white;
}

.empty-state {
  padding: 45px 22px;
  text-align: center;
  color: #9aa8b5;
}

.empty-icon {
  width: 55px;
  height: 55px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  color: #d3ac6a;
  font-size: 25px;
}

.empty-state b {
  display: block;
  color: #dce4eb;
  font-size: 13px;
}

.empty-state p {
  margin: 9px auto 0;
  max-width: 230px;
  color: #8594a3;
  font-size: 11px;
  line-height: 1.7;
}

/* PLAYER PROFILE */

.profile {
  padding: 22px 17px;
  text-align: center;
}

.profile-emblem {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 13px;
  border: 3px solid rgba(255,255,255,.16);
  border-radius: 15px;
  color: #18212a;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 5px 20px rgba(0,0,0,.2);
}

.profile h3 {
  margin: 0;
  color: #eef1f6;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.profile > p {
  margin: 6px 0 22px;
  color: #d3ad6c;
  font-size: 12px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
  text-align: left;
  border-top: 1px solid var(--border);
}

.profile-grid span,
.profile-grid b {
  min-width: 0;
  padding: 12px 2px;
  border-bottom: 1px solid var(--border);
}

.profile-grid span {
  color: #8796a5;
  font-size: 10px;
  letter-spacing: .4px;
}

.profile-grid b {
  color: #e1e8ee;
  font-size: 11px;
  text-align: right;
  overflow-wrap: anywhere;
}

.profile-intel-btn {
  width: 100%;
  margin-top: 15px;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: rgba(91, 141, 239, .12);
  color: var(--accent-soft);
  font: inherit;
  font-weight: 650;
  letter-spacing: .3px;
  cursor: pointer;
}

.profile-intel-btn:hover:not(:disabled) {
  background: var(--accent);
  color: #0f1115;
}

.profile-intel-btn:disabled {
  border-color: var(--border);
  background: transparent;
  color: var(--faint);
  cursor: not-allowed;
}

/* SCROLLBAR */

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #333b4d;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #526779;
}

/* Consistent focus and module styling */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
input, select, textarea { accent-color: var(--gold); }
.search:focus-within, .filter-controls select:focus, .filter-button:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--focus);
}
.navigation-toolbar { background: rgba(15,23,32,.88) !important; }
.navigation-toolbar input, .navigation-toolbar select {
  min-height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px;
  background: #1c212b; color: var(--text); outline: none;
}
.navigation-toolbar input:focus, .navigation-toolbar select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--focus); }
.map-actions button { border-radius: 9px; background: #1c212b; }
.map-actions button:hover { border-color: rgba(216,177,109,.42); }

/* The feature screens are created by their own scripts; keep their look aligned. */
:is(#overviewScreen,#alliancesScreen,#attendanceScreen,#backupScreen,#historyScreen,
    #diplomacyScreen,#warScreen,#militaryScreen,#allianceAnalysisScreen,
    #profileRankingsScreen,#activityCenterScreen) {
  background-color: #0f1115 !important;
  background-image: radial-gradient(ellipse at 75% -18%, rgba(46,69,83,.19), transparent 42%) !important;
  color: #eef1f6 !important;
  scrollbar-color: #333b4d transparent;
}
:is(#overviewScreen,#alliancesScreen,#attendanceScreen,#backupScreen,#historyScreen,
    #diplomacyScreen,#warScreen,#militaryScreen,#allianceAnalysisScreen,
    #profileRankingsScreen,#activityCenterScreen) :is(.aa-stat,.aa-panel,.ac-stat,.ac-panel,
    .att-card,.att-panel,.mil-card,.mil-panel,.ov-card,.ov-panel,.pr-card,.pr-panel,
    .dip-card,.dip-panel,.war-card,.war-panel,.hist-card,.hist-panel,.alliance-card,
    .backup-card) {
  border-color: rgba(184,202,217,.12) !important;
  border-radius: 13px !important;
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
}
:is(#overviewScreen,#alliancesScreen,#attendanceScreen,#backupScreen,#historyScreen,
    #diplomacyScreen,#warScreen,#militaryScreen,#allianceAnalysisScreen,
    #profileRankingsScreen,#activityCenterScreen) :is(button,.aa-btn,.ac-btn,.att-btn,
    .mil-btn,.ov-btn,.pr-btn,.dip-btn,.war-btn) {
  border-radius: 9px;
  transition: filter .16s ease, transform .16s ease, border-color .16s ease;
}
:is(#overviewScreen,#alliancesScreen,#attendanceScreen,#backupScreen,#historyScreen,
    #diplomacyScreen,#warScreen,#militaryScreen,#allianceAnalysisScreen,
    #profileRankingsScreen,#activityCenterScreen) :is(button:hover,.aa-btn:hover,.ac-btn:hover,
    .att-btn:hover,.mil-btn:hover,.ov-btn:hover,.pr-btn:hover,.dip-btn:hover,.war-btn:hover) {
  filter: brightness(1.12);
}
:is(#overviewScreen,#alliancesScreen,#attendanceScreen,#backupScreen,#historyScreen,
    #diplomacyScreen,#warScreen,#militaryScreen,#allianceAnalysisScreen,
    #profileRankingsScreen,#activityCenterScreen) :is(table th, .aa-table th, .ac-table th,
    .att-table th, .mil-table th, .war-table th) {
  background: #1c212b;
}

/* RESPONSIVE */

@media (max-width: 1150px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 275px;
  }

  .main {
    padding: 20px;
  }

  .search {
    width: 220px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 190px;
    min-width: 190px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }

  .map-wrap {
    height: 650px;
  }

  .details {
    min-height: 230px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
  }

  .search {
    flex: 1;
  }

  .filter-controls {
    width: 100%;
  }

  .filter-controls select {
    flex: 1;
    min-width: 130px;
  }
}

@media (max-width: 760px) {
  .app {
    display: block;
  }

  .sidebar {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  /* Marka, kaydırmanın başında yarım ekran yer kaplamasın:
     yalnızca rozet kalır ve solda sabit durur. */
  .brand {
    position: sticky;
    left: 0;
    z-index: 2;
    flex: 0 0 auto;
    padding: 0 8px;
    background: linear-gradient(90deg, #141820 65%, rgba(16, 25, 35, 0));
  }

  .brand > div:not(.brand-mark) {
    display: none;
  }

  .nav-label,
  .sidebar-bottom {
    display: none;
  }

  .sidebar {
    flex-direction: row;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .nav {
    scroll-margin-inline: 12px;
  }

  /* Varsayılan 13px kutucuklar parmakla seçilemiyor. */
  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    height: 20px;
  }

  .nav {
    width: auto;
    white-space: nowrap;
    margin: 0;
    padding: 9px 10px;
    font-size: 12px;
  }

  .main {
    padding: 15px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .search {
    width: 100%;
    flex-basis: 100%;
  }

  .map-wrap {
    height: 560px;
  }

  .map-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-actions {
    align-self: flex-end;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 21px;
  }

  .stats {
    gap: 8px;
  }

  .stat {
    padding: 12px;
  }

  .stat b {
    font-size: 16px;
  }

  .filter-controls select,
  .filter-button {
    font-size: 11px;
  }

  .map-wrap {
    height: 500px;
  }

  .main { padding: 13px; }
  .brand-mark { width: 38px; height: 38px; }
}

/* Harita görünümü: geniş ve açık bir oyun haritası, kompakt üst araç çubukları. */
.app.map-focus { min-height: 100dvh; height: 100dvh; overflow: hidden; }
.app.map-focus .sidebar { width: 68px; min-width: 68px; padding: 10px 7px; }
.app.map-focus .brand { justify-content: center; padding: 0 0 16px; }
.app.map-focus .brand > div:not(.brand-mark),
.app.map-focus .nav-label,
.app.map-focus .nav span,
.app.map-focus .sidebar-bottom { display: none; }
.app.map-focus .brand-mark { width: 42px; height: 42px; }
.app.map-focus .nav { justify-content: center; padding: 10px 4px; font-size: 18px; }
.app.map-focus .main { display: flex; flex-direction: column; height: 100dvh; min-height: 0; padding: 0; }
.app.map-focus .topbar { min-height: 43px; margin: 0; padding: 5px 12px; background: #151a22; border-bottom: 1px solid #252b34; }
.app.map-focus .topbar .eyebrow { display: none; }
.app.map-focus .topbar h1 { font: 700 14px/1.2 "Outfit", "Segoe UI", sans-serif; letter-spacing: .05em; }
.app.map-focus .topbar .server-pill { margin-left: 5px; padding: 3px 7px; font-size: 10px; }
.app.map-focus .topbar .primary { height: 31px; padding: 0 10px; border: 1px solid #5788ff; border-radius: 999px; background: linear-gradient(180deg,#3f7af0,#2459cc); color: white; font-size: 11px; }
.app.map-focus .stats { display: none; }
.app.map-focus .workspace { flex: 1; height: auto; min-height: 0; display: block; margin: 0; }
.app.map-focus .map-wrap { height: 100%; min-height: 0; border: 0; border-radius: 0; background: #5b7957; }
.app.map-focus .map-toolbar { position: relative; min-height: 0; padding: 6px 10px; background: rgba(20,25,32,.97); border-bottom: 1px solid #272d36; }
.map-control-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-width: 0; }
.map-control-row > label, .map-inline-filter > label { color: #9da6b3; font-size: 9px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
.map-control-row select, .map-control-row input, .map-pill {
  height: 30px; padding: 0 10px; border: 1px solid rgba(255,255,255,.09); border-radius: 999px;
  background: #1a202a; color: #e8ebf0; font-size: 11px; outline: none;
}
.map-control-row select { max-width: 175px; }
.map-control-row input { width: 78px; min-width: 58px; }
.map-control-row select:focus, .map-control-row input:focus, .map-pill:focus-visible { border-color: #668cff; box-shadow: 0 0 0 2px rgba(91,141,239,.24); }
.map-inline-filter { display: flex; align-items: center; gap: 6px; }
.map-inline-filter[hidden], .map-search-panel[hidden], .map-search-range[hidden] { display: none !important; }
.map-actions { margin-left: auto; gap: 6px; }
.map-pill { cursor: pointer; white-space: nowrap; }
.map-pill:hover { background: #28303c; }
.map-secondary-row { justify-content: space-between; padding-top: 7px; }
.map-secondary-row .filter-controls { gap: 6px; }
.map-secondary-row .filter-controls select, .map-secondary-row .filter-button { height: 28px; padding: 0 9px; border-radius: 999px; font-size: 10px; }
.map-coordinate-controls { display: flex; gap: 5px; }
.app.map-focus #mapCanvas { background: #5b7957; }
.app.map-focus .map-footer { left: 10px; right: 10px; bottom: 8px; align-items: center; gap: 12px; padding: 5px 9px; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; background: rgba(17,22,29,.88); font-size: 10px; }
.app.map-focus .toast { bottom: 45px; }
.map-search-panel { position: absolute; z-index: 5; top: 105px; left: 10px; width: min(360px, calc(100% - 20px)); max-height: min(58vh, 520px); overflow: auto; padding: 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(20,25,34,.97); box-shadow: 0 14px 38px rgba(0,0,0,.42); }
.map-search-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.map-search-tabs { display: flex; gap: 5px; }
.map-search-tabs button, #mapSearchClose { min-height: 29px; padding: 0 10px; border: 1px solid transparent; border-radius: 999px; background: #1a202a; color: #d8dce4; font-size: 11px; cursor: pointer; }
.map-search-tabs button.active { border-color: #668cff; color: #a9bfff; }
#mapSearchClose { width: 29px; padding: 0; font-size: 19px; }
.map-search-panel > input { width: 100%; height: 37px; padding: 0 11px; border: 1px solid #303744; border-radius: 9px; background: #171c25; color: #f1f3f7; outline: none; }
.map-search-input-wrap { position: relative; }
.map-search-input-wrap > input { width: 100%; height: 37px; padding: 0 11px; border: 1px solid #303744; border-radius: 9px; background: #171c25; color: #f1f3f7; outline: none; }
.map-search-range { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.map-search-range input { width: 50%; min-width: 0; height: 33px; padding: 0 9px; border: 1px solid #303744; border-radius: 8px; background: #171c25; color: #f1f3f7; }
.map-search-panel p { margin: 8px 2px 0; color: #8e98a8; font-size: 10px; line-height: 1.4; }
.app.map-focus .details { display: none; position: absolute; z-index: 6; top: 10px; right: 10px; width: min(310px, calc(100% - 20px)); max-height: calc(100% - 25px); box-shadow: 0 15px 40px rgba(0,0,0,.45); }
.app.map-focus .details.is-open { display: block; }

@media (max-width: 760px) {
  .app.map-focus { display: flex; flex-direction: column; }
  .app.map-focus .sidebar { width: 100%; min-width: 0; height: 48px; min-height: 48px; padding: 5px 8px; border-bottom: 1px solid #252b34; }
  .app.map-focus .brand { position: sticky; left: 0; z-index: 2; padding: 0 5px; background: #141820; }
  .app.map-focus .brand-mark { width: 34px; height: 34px; }
  .app.map-focus .nav { flex: 0 0 auto; width: auto; padding: 7px 9px; font-size: 12px; }
  .app.map-focus .nav span { display: inline; font-size: 11px; }
  .app.map-focus .main { width: 100%; height: calc(100dvh - 48px); }
  .app.map-focus .topbar { padding: 5px 9px; }
  .app.map-focus .map-toolbar { padding: 6px 8px; }
  .map-control-row { gap: 5px; }
  .map-control-row select { max-width: 140px; }
  .map-actions { margin-left: 0; }
  .map-secondary-row { align-items: flex-start; }
  .map-secondary-row .filter-controls { width: 100%; }
  .map-secondary-row .filter-controls select { flex: 1; min-width: 105px; }
  .map-secondary-row .map-coordinate-controls { display: none; }
  .map-search-panel { top: 150px; left: 7px; }
}
@media (max-width: 450px) {
  .app.map-focus .sidebar { gap: 3px; }
  .app.map-focus .nav { padding: 7px 7px; }
  .app.map-focus .nav span { display: none; }
  .map-control-row select { max-width: 115px; }
  .map-inline-filter { flex-wrap: wrap; }
  .map-control-row > label { display: none; }
  .map-search-panel { top: 165px; }
}
