:root {
  --bg: rgba(12, 16, 28, .8);
  --fg: #e8ecf4;
  --muted: #8b93a7;
  --line: rgba(255, 255, 255, .08);
  --acc: #ff7a45;
  --field: #1b2133;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--fg);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
html[lang="fa"] body { font-family: Vazirmatn, Tahoma, system-ui, sans-serif; }
a { color: var(--acc); }
#globe { position: fixed; inset: 0; }

#loader {
  position: fixed; inset: 0; z-index: 20; background: #000; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  transition: opacity .6s;
}
#loader.gone { opacity: 0; pointer-events: none; }
.spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .15); border-top-color: var(--acc);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.card {
  position: fixed; background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#panel { inset-block-start: 16px; inset-inline-start: 16px; width: 330px; max-height: calc(100vh - 32px); overflow-y: auto; }
#panel.collapsed .body { display: none; }
#feed { inset-block-start: 16px; inset-inline-end: 16px; width: 330px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
#details { inset-block-end: 16px; inset-inline-start: 362px; width: 320px; }
#sensor { inset-block-end: 16px; left: 50%; transform: translateX(-50%); width: 390px; max-width: calc(100vw - 32px); z-index: 6; }

.head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.headBtns { display: flex; gap: 6px; align-items: center; }
h1 { font-size: 17px; margin: 0 0 6px; }
h2 { font-size: 12px; margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.icon { background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.small-btn {
  background: var(--field); color: var(--fg); border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 8px; font: inherit; font-size: 12px; cursor: pointer;
}
.card .close {
  position: absolute; inset-block-start: 6px; inset-inline-end: 10px;
  background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer;
}

#status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #888; flex: none; }
#status.ok .dot { background: #34c759; animation: pulse 2s infinite; }
#status.loading .dot { background: #ffd60a; }
#status.error .dot { background: #ff3b30; }
#status.offline .dot { background: #ff9500; }
#status.replay .dot { background: #0a84ff; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, .7); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(52, 199, 89, 0); }
}

.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.controls label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.controls label.wide { grid-column: 1 / -1; }
select, #search, #sensorHost {
  background: var(--field); color: var(--fg); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px; font: inherit; font-size: 13px;
}
.btn {
  background: var(--field); color: var(--fg); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; cursor: pointer; font: inherit; font-size: 12px; white-space: nowrap;
}
.btn:hover { border-color: var(--acc); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.live { color: var(--muted); }
.btn.live.on { color: #ff3b30; border-color: rgba(255, 59, 48, .5); }
.btnRow { display: flex; gap: 8px; margin: 12px 0 4px; }
.btnRow .btn { flex: 1; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 10px; text-align: center; }
.stats.three { grid-template-columns: repeat(3, 1fr); margin: 10px 0 4px; }
.stats div { background: rgba(255, 255, 255, .04); border-radius: 10px; padding: 7px 2px; }
.stats b { display: block; font-size: 16px; }
.stats span { font-size: 10px; color: var(--muted); }

#chart { width: 100%; height: 56px; display: block; cursor: pointer; }
.chartAxis { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }
.timeline { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.timeline input { flex: 1; min-width: 0; accent-color: var(--acc); }
#replayTime { min-height: 15px; margin: 4px 0 8px; }

.toggles { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.toggles input { accent-color: var(--acc); margin-inline-end: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 5px; vertical-align: -1px; }
.hint { font-size: 12px; color: #ffd60a; }
.credit { font-size: 11px; color: var(--muted); margin: 10px 0 0; line-height: 1.7; }
.muted { color: var(--muted); }
.small { font-size: 11px; }

.feedHead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
#search { width: 100%; padding: 7px 10px; margin-bottom: 8px; }
#feedList { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
#feedList li { display: flex; gap: 10px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
#feedList li:hover { background: rgba(255, 255, 255, .05); }
#feedList li.new { animation: flash 1.5s ease 3; }
#feedList li.empty { color: var(--muted); cursor: default; }
@keyframes flash { 50% { background: rgba(255, 122, 69, .25); } }
.mag { min-width: 42px; text-align: center; font-weight: 700; border-radius: 8px; padding: 6px 0; color: #111; }
.place { font-size: 13px; direction: ltr; text-align: start; unicode-bidi: plaintext; }
.meta { font-size: 11px; color: var(--muted); }

.big { font-size: 28px; font-weight: 800; }
.big small { font-size: 12px; color: var(--muted); font-weight: 400; }
#details h3 { margin: 4px 0 10px; font-size: 15px; unicode-bidi: plaintext; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 12px; font-size: 13px; }
dt { color: var(--muted); }
dd { margin: 0; }
.links { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.alert { text-transform: capitalize; font-weight: 600; }
.alert.green { color: #34c759; } .alert.yellow { color: #ffd60a; }
.alert.orange { color: #ff9500; } .alert.red { color: #ff3b30; }

.me {
  width: 14px; height: 14px; border-radius: 50%; background: #0a84ff; border: 2px solid #fff;
  pointer-events: none; animation: mepulse 2s infinite;
}
@keyframes mepulse {
  0% { box-shadow: 0 0 0 0 rgba(10, 132, 255, .7); }
  70%, 100% { box-shadow: 0 0 0 14px rgba(10, 132, 255, 0); }
}

#seismo { width: 100%; height: 110px; display: block; background: rgba(0, 0, 0, .35); border-radius: 10px; margin-top: 8px; }
.sensorRow { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.sensorRow input { flex: 1; min-width: 0; direction: ltr; }
.events { list-style: none; margin: 8px 0 0; padding: 0; max-height: 110px; overflow-y: auto; font-size: 12px; }
.events li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.events li.test { color: var(--muted); }
#sensor.alarm { border-color: #ff3b30; animation: alarmPulse .6s infinite alternate; }
@keyframes alarmPulse {
  from { box-shadow: 0 0 0 3px rgba(255, 59, 48, .6), 0 8px 30px rgba(0, 0, 0, .4); }
  to { box-shadow: 0 0 0 12px rgba(255, 59, 48, .1), 0 8px 30px rgba(0, 0, 0, .4); }
}

#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 10; }
.toast {
  background: var(--bg); border: 1px solid var(--line); border-inline-start: 3px solid var(--acc); border-radius: 10px;
  padding: 10px 14px; max-width: 400px; cursor: pointer; transition: opacity .5s, transform .5s;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.toast.alarm { background: rgba(140, 12, 12, .92); border-color: #ff3b30; font-size: 15px; }
.toast.hide { opacity: 0; transform: translateY(-10px); }

@media (max-width: 1100px) {
  #details { inset-inline-start: auto; inset-inline-end: 16px; z-index: 5; }
}
@media (max-width: 760px) {
  #feed { display: none; }
  #panel { inset-inline: 8px; inset-block-start: 8px; width: auto; max-height: 60vh; padding: 10px 12px; }
  .toggles { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; }
  .credit { display: none; }
  #details { inset-inline: 8px; inset-block-end: 8px; width: auto; }
  #sensor { inset-block-end: 8px; }
  #toasts { top: auto; bottom: 16px; }
}
/* end of style.css */
