/* Made by Federico Dionisi - IG: @fede.ddi */
/* © 2025 – Tutti i diritti riservati */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --sidebar-w: 250px;
  --charts-gutter: clamp(24px, 6vw, 100px);
  --topbar-h: 60px;
}

html,
body {
  height: 100%;
  width: 100%;
  font-family: "Questrial", sans-serif;
  background: #f0f0f0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
button,
a,
div,
.popup-content-admin,
.popup-content-admin h2,
.popup-content-admin input,
.popup-content-admin button,
.popup-buttons-admin,
.password-error {
  font-family: 'Questrial', sans-serif !important;
}

body {
  transition: filter 0.3s ease;
}

body.blurred .container {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
}

.container {
  background: #fff;
  position: relative;
  width: 100vw;
  height: 100vh;
  padding: 0 5vw 3vw 5vw;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  animation: fadeIn 0.6s ease-in-out;
  overflow: hidden;
}

.container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(12vh + (clamp(90px, 18vw, 180px) / 2));
  background-color: #00aff0;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.container::after {
  content: "";
  position: absolute;
  top: calc(12vh + (clamp(90px, 18vw, 180px) / 2));
  left: 0;
  width: 100%;
  height: calc(100% - (12vh + (clamp(90px, 18vw, 180px) / 2)));
  background-color: #fff;
  z-index: 0;
}

.stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(12vh + (clamp(90px, 18vw, 180px) / 2));
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  background: url('star.png') no-repeat center center;
  background-size: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 0 1px white);
  opacity: 0.8;
}

.profile-pic {
  width: clamp(90px, 18vw, 180px);
  height: clamp(90px, 18vw, 180px);
  border-radius: 50%;
  object-fit: cover;
  margin: 12vh 0 4vh 0;
  border: 1mm solid white;
  position: relative;
  z-index: 1;
}

h1 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  margin-bottom: 2vh;
  color: black;
  z-index: 1;
}

.name-text {
  font-size: clamp(1.2rem, 4vw, 2rem);
  font-weight: normal;
}

.verified-badge {
  width: 0.9em;
  height: 0.9em;
  display: inline-block;
  background-image: url('badge.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.subtitle {
  margin-bottom: 5vh;
  color: #666;
  font-size: clamp(0.7rem, 2vw, 1rem);
  z-index: 1;
}

.links {
  width: 100%;
  max-width: 400px;
  margin-top: 3vh;
  z-index: 1;
}

.btn-white {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 400px;
  height: 46px;
  padding-left: 46px;
  padding-right: 40px;
  border: 2px solid #ccc;
  border-radius: 40px;
  background: #fff;
  color: #000;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: bounceIn 0.6s ease;
  gap: 10px;
  line-height: 1;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
}

.btn-text {
  display: flex;
  align-items: center;
  height: 100%;
  line-height: 1;
  font-size: 16px;
}

.btn-text2 {
  display: flex;
  align-items: center;
  height: 100%;
  line-height: 1;
  font-size: 16px;
}

.btn-white::after {
  content: "›";
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #000;
  font-weight: bold;
  line-height: 1;
}

.icon-lock {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.icon-lock img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.btn-white:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.btn-black,
.btn-blue {
  padding: clamp(10px, 2vw, 18px) clamp(15px, 4vw, 25px);
  border: none;
  font-size: clamp(0.9rem, 3vw, 1.2rem);
  border-radius: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 400px;
  animation: bounceIn 0.6s ease;
  text-align: center;
  box-shadow: none;
  font-family: 'Questrial', sans-serif;
}

.btn-black {
  background: #000;
  color: white;
  font-family: 'Questrial', sans-serif;
}

.btn-blue {
  background: #00aff0;
  color: white;
  text-decoration: none;
  font-family: 'Questrial', sans-serif;
}

.btn-black:hover,
.btn-blue:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
  padding: 5vw;
}

.popup-content {
  background: #fff;
  padding: 4vw;
  border-radius: 20px;
  max-width: 600px;
  min-width: 320px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.4s ease;
  font-family: 'Questrial', sans-serif;
}

.popup-content h2 {
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  margin-bottom: 1.2rem;
}

.popup-content p {
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  color: #333;
  margin-bottom: 2rem;
}

.popup-buttons {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: nowrap;
}

.popup-buttons .btn-black,
.popup-buttons .btn-blue {
  flex: 1 1 48%;
  min-width: 140px;
  font-family: 'Questrial', sans-serif;
}

@media (max-width: 480px) {
  .container::before {
    height: calc(12vh + (clamp(156px, 42vw, 300px) * 1.2) / 2);
  }

  .container::after {
    top: calc(12vh + (clamp(156px, 42vw, 300px) * 1.2) / 2);
    height: calc(100% - (12vh + (clamp(156px, 42vw, 300px) * 1.2) / 2));
  }

  .stars {
    height: calc(12vh + (clamp(156px, 42vw, 300px) * 1.2) / 2);
  }

  .profile-pic {
    width: calc(clamp(156px, 42vw, 300px) * 1.2);
    height: calc(clamp(156px, 42vw, 300px) * 1.2);
    margin: 12vh 0 3vh 0;
  }

  h1 .name-text {
    font-size: clamp(2.1rem, 6vw, 3rem);
    margin-top: 0.5vh;
  }

  .subtitle {
    font-size: clamp(1.05rem, 3vw, 1.5rem);
    margin-top: 0.5vh;
    margin-bottom: 4vh;
  }

  .popup-buttons {
    flex-wrap: nowrap;
    flex-direction: row;
    gap: 10px;
  }

  .popup-buttons .btn-black,
  .popup-buttons .btn-blue {
    flex: 1;
    min-width: unset;
    width: auto;
  }
}

.footer-instagram {
  position: fixed;
  bottom: 20px;
  width: 100%;
  text-align: center;
  font-family: 'Questrial', sans-serif;
  font-size: 0.75rem;
  color: #777777;
  z-index: 2147483649 !important;
  user-select: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
}

.footer-copyrights {
  user-select: none;
}

.instagram-link {
  color: #777777;
  text-decoration: none;
  transition: color 0.3s ease;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.instagram-link:hover {
  color: #00aff0;
  text-decoration: underline;
}

.instagram-text {
  text-decoration: underline;
  font-size: 12px;
}

.instagram-icon {
  font-size: 12px;
  vertical-align: middle;
  pointer-events: none;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }

  60% {
    opacity: 1;
    transform: translateY(-10px);
  }

  80% {
    transform: translateY(5px);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.popup-admin {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-content-admin {
  background: white;
  padding: 20px;
  border-radius: 20px;
  width: 300px;
  max-width: 80%;
  box-sizing: border-box;
  text-align: center;
}

.popup-content-admin h2 {
  margin: 0 0 15px;
}

.popup-content-admin input {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-size: 16px;
}

.password-error {
  color: red;
  margin-bottom: 10px;
  font-size: 14px;
}

.popup-buttons-admin {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-black,
.btn-blue {
  padding: clamp(10px, 2vw, 18px) clamp(15px, 4vw, 25px);
  border: none;
  border-radius: 40px;
  cursor: pointer;
}

.password-toggle {
  position: relative;
}

.password-toggle input {
  width: 100%;
  padding-right: 40px;
}

#password-popup .remember-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 12px 0;
}

#password-popup .remember-wrap label {
  display: inline-flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  font-size: 0.95rem;
}

#password-popup .remember-wrap input[type="checkbox"] {
  margin: 0;
}

.toggle-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-67%);
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.toggle-icon svg {
  width: 100%;
  height: 100%;
}

@media (max-width: 480px) {
  .toggle-icon {
    transform: translateY(-67%);
  }
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-credentials-auto-fill-button {
  display: none;
}

.sidebar {
  width: 250px;
  background: #d8d8d8;
  height: 100svh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  height: clamp(60px, 7svh, 70px);
  background: #00aff0;
  color: white;
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-weight: bold;
  font-size: clamp(22px, 3.2svh, 30px);
  box-sizing: border-box;
  justify-content: flex-start;
}

.period-selector {
  margin-top: 30px;
  padding: 10px;
}

.period-selector label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.period-selector select {
  width: 100%;
  padding: 8px;
  font-size: 1rem;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-family: 'Questrial', sans-serif !important;
}

.date-selector {
  padding: 10px;
}

.date-selector label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.period-selector select,
.date-selector input {
  width: 100%;
  font-size: clamp(14px, 1.8svh, 16px);
  font-family: 'Questrial', sans-serif !important;
}

.date-selector input {
  width: 100%;
  padding: 8px;
  font-size: 1rem;
  border-radius: 5px;
  border: 1px solid #ccc;
  margin-bottom: 10px;
  font-family: 'Questrial', sans-serif !important;
}

.sidebar-divider {
  position: static;
  width: 90%;
  height: 1px;
  background: black;
  align-self: center;
  margin: 12px 0;
  transform: none;
}

.sidebar-counters {
  position: static;
  width: 100%;
  padding: 0 10px;
  left: auto;
  top: auto;
}

.sidebar-counters:last-of-type {
  margin-top: clamp(16px, 4svh, 40px);
}

.sidebar-counters .counter-item {
  margin-bottom: 15px;
  font-size: 1.1rem;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
}

.real-subcounters {
  margin-top: 10px;
  padding-left: 0;
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  column-gap: 12px;
}

.real-subcounters .divider {
  width: 1px;
  background: #000000;
  opacity: 0, 8;
  align-self: stretch;
}

.real-subcounters .subcounter-col {
  padding: 0 6px;
  min-width: 0;
}

.real-subcounters .subcounter-group {
  margin-bottom: 10px;
}

.real-subcounters .subcounter-title {
  font-weight: bold;
  margin-bottom: 5px;
  font-weight: bold;
  margin-bottom: 5px;
  text-align: center;
}

.real-subcounters .subcounter-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}

.real-subcounters .subcounter-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
}

.real-subcounters .subcounter-list li .is-altro {
  font-weight: 700;
  text-decoration: underline;
  cursor: help;
}

@media (max-height: 720px) {
  .sidebar {
    row-gap: 6px;
  }

  .period-selector,
  .date-selector {
    padding: 8px;
  }
}

.dashboard-main {
  position: absolute;
  top: 50%;
  left: calc(var(--sidebar-w) + var(--charts-gutter));
  transform: translateY(-50%);
  display: flex;
  flex-direction: row;
  gap: 20px;
}

.dashboard-top {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.dashboard-top-left {
  width: 600px;
  height: 600px;
  flex: 0 0 auto;
}

.dashboard-top-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-left: 80px;
  flex: 0 0 auto;
}

.dashboard-top-right-top,
.dashboard-top-right-bottom {
  width: 300px;
  height: 300px;
}

#cartesian-chart {
  width: 100% !important;
  height: 100% !important;
  display: block;
  max-width: 100% !important;
  max-height: 100% !important;
}

#social-pie-chart,
#nation-pie-chart {
  width: 250px !important;
  height: 250px !important;
  display: block;
}

.counter-select-style {
  width: 100%;
  padding: 3px 6px;
  font-size: 0.85rem;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-family: 'Questrial', sans-serif !important;
  background-color: white;
}

#social-toggle-container select,
#nation-toggle-container select {
  font-family: 'Questrial', sans-serif !important;
}

.settings-button {
  position: fixed;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1000;
}

.settings-button svg {
  width: 24px;
  height: 24px;
  stroke: black;
}

#settings-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

#settings-popup>div {
  background: white;
  padding: 25px 30px;
  border-radius: 16px;
  min-width: 300px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
  font-family: inherit;
}

#settings-popup h2 {
  font-size: 20px;
  margin-bottom: 20px;
}

#settings-popup label {
  display: block;
  margin-bottom: 10px;
}

#settings-popup input[type="checkbox"] {
  margin-right: 10px;
}

#settings-popup button {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

#settings-popup .btn-cancel {
  background: #ccc;
}

#settings-popup .btn-confirm {
  background: #333;
  color: white;
}

.home-button {
  position: fixed;
  top: 15px;
  left: calc(var(--sidebar-w) + 5px);
  display: flex;
  align-items: center;
  gap: 0.1px;
  font-size: 16px;
  color: black;
  text-decoration: none;
  z-index: 1000;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Questrial', sans-serif;
}

.home-button svg {
  width: 24px;
  height: 24px;
  stroke: black;
}

@media (max-width: 480px) {
  .footer-instagram {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    line-height: 1;
  }

  .footer-instagram a,
  .footer-instagram span,
  .footer-instagram i {
    font-size: inherit;
  }

  .footer-instagram .instagram-icon {
    vertical-align: middle;
  }
}

@media (max-width: 420px) {
  .footer-instagram {
    font-size: 9px;
    gap: 3px;
  }
}

@media (max-width: 360px) {
  .footer-instagram {
    font-size: 8px;
    gap: 2px;
  }
}

#counter-toggle-wrapper label[for="counter-toggle"] {
  display: block;
  margin-bottom: 5px;
}

.pie-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.pie-row canvas {
  flex: 1 1 auto;
}

.pie-toggle-block {
  flex: 0 0 auto;
  min-width: 170px;
  position: relative;
  z-index: 2;
  margin-left: -60px;
  margin-top: 10px;
}

.pie-toggle-block.hidden {
  display: none;
}

.pie-toggle-block label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
}

.pie-toggle-block select {
  min-width: 170px;
}

.pie-toggle {
  flex: 0 0 auto;
  min-width: 160px;
}

.pie-toggle.hidden {
  display: none;
}

.btn-danger {
  background: #D32F2F;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-danger:hover {
  background: #B71C1C;
}

.btn-secondary {
  background: #e0e0e0;
  color: #333;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #d5d5d5;
}

.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.admin-modal-card {
  background: #fff;
  width: min(520px, 92vw);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  padding: 18px 16px;
}

.admin-modal-card .modal-title {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 28px;
  text-align: center;
}

.admin-modal-card .modal-title.danger {
  color: #D32F2F;
  font-size: 28px;
  text-align: center;
}

.admin-modal-card .modal-body {
  font-size: 16px;
  line-height: 1.45;
  margin-bottom: 14px;
  text-align: center;
}

.admin-modal-card .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.info-help {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #333;
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
  cursor: default;
}

.info-help .tip {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  color: #333;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
  padding: 8px 10px;
  min-width: 240px;
  max-width: 320px;
  font-size: 13px;
  line-height: 1.45;
  display: none;
  z-index: 1000;
  pointer-events: none;
}

.info-help.open .tip {
  display: block;
}

.info-help .tip.tip-altro {
  --tip-radius: 8px;
  max-height: 100px;
  overflow-y: auto;
  pointer-events: auto;
  scrollbar-width: thin;
  scrollbar-color: #c9c9c9 transparent;
}

.info-help .tip.tip-altro::-webkit-scrollbar {
  width: 8px;
}

.info-help .tip.tip-altro::-webkit-scrollbar-track {
  border-radius: var(--tip-radius);
  background: transparent;
}

.info-help .tip.tip-altro::-webkit-scrollbar-thumb {
  border-radius: var(--tip-radius);
  background: #c9c9c9;
  border: 2px solid transparent;
  background-clip: content-box;
}

.info-help:hover .tip,
.info-help:focus .tip {
  display: block;
}

.info-help .tip.tip-altro {
  width: 120px;
  min-width: 0;
  max-width: 90vw;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.info-help .tip.tip-altro .mobile-tip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  text-align: left !important;
}

.info-help .tip.tip-altro .mobile-tip-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.info-help .tip.tip-altro .mobile-tip-list li .c {
  flex: 1 1 auto;
  min-width: 0;
}

.info-help .tip.tip-altro .mobile-tip-list li .v {
  flex: 0 0 auto;
  text-align: right;
}

.info-help .tip::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent #d9d9d9 transparent transparent;
}

.info-help .tip::after {
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: transparent #fff transparent transparent;
}

.top-fixed-bar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  width: calc(100vw - var(--sidebar-w));
  height: 60px;
  background: #f0f0f0;
  z-index: 900;
}

@media (max-width: 1255px) {

  .info-help .tip.tip-altro,
  .info-help:hover .tip.tip-altro,
  .info-help:focus .tip.tip-altro {
    z-index: -1 !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 250px;
    transform: translateX(-100%);
    transition: transform 280ms ease;
    z-index: 1040;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    border-right: 0px solid #E6EEFC;
    background: #fff;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .dashboard-main {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    display: block;
    margin: 0;
    padding: 16px;
  }

  .sidebar-toggle {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 64px;
    border-radius: 0 10px 10px 0;
    background: #ffffff;
    border: 1px solid #E6EEFC;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: 0;
    overflow: visible;
    transition: left 280ms ease;
    will-change: left;
  }

  body.sidebar-open .sidebar-toggle {
    left: var(--sidebar-w);
  }

  .sidebar-toggle .toggle-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    display: block;
  }

  .sidebar-toggle svg {
    transition: transform 180ms ease;
    width: 100%;
    height: 100%;
    display: block;
  }

  body.sidebar-open .sidebar-toggle svg {
    transform: scaleX(-1);
  }

  #sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.20);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
    z-index: 1030;
  }

  body.sidebar-open #sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .home-button {
    left: 15px;
  }

  .sidebar {
    border-radius: 12px;
    overflow: hidden;
  }

  .sidebar-header {
    width: 100%;
  }

  .sidebar .date-selector input[type="date"] {
    width: 230px;
    height: 35px;
    line-height: 40px;
    padding: 0 10px;
    display: block;
  }

  .sidebar .date-selector input[type="date"]::-webkit-datetime-edit {
    line-height: 35px;
    padding: 0;
  }

  .sidebar .date-selector input[type="date"]::-webkit-date-and-time-value {
    line-height: 35px;
  }

  .sidebar .date-selector input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    display: flex;
    align-items: center;
    height: 100%;
  }

  .sidebar .period-selector select,
  .sidebar input,
  .sidebar select {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .sidebar .real-subcounters .subcounter-title {
    font-size: 0.85rem;
  }

  .sidebar .real-subcounters .subcounter-list {
    font-size: 0.80rem;
  }

  .sidebar .real-subcounters .subcounter-list li {
    padding: 1px 0;
  }

  .sidebar>.sidebar-counters:last-of-type {
    bottom: 45px !important;
  }

  .dashboard-top-left {
    width: 370px;
    height: 370px;
    margin-top: 50px;
  }

  #cartesian-chart {
    width: 100% !important;
    height: 100% !important;
    display: block;
    max-width: 100% !important;
    max-height: 100% !important;
  }

  .dashboard-top {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .dashboard-top-right {
    margin-top: 30px;
    gap: 30px;
    margin-left: 0;
    align-items: center;
  }

  html,
  body {
    overflow-y: auto;
    height: auto;
    min-height: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .top-fixed-bar {
    left: 0;
    width: 100vw;
    height: 56px;
  }

  .pie-toggle-block {
    min-width: 100px;
    margin-left: -75px;
    margin-top: 6px;
  }

  .pie-toggle-block label {
    font-size: 12px;
    line-height: 1.1;
  }

  .pie-toggle-block select {
    min-width: 90px;
    max-width: 100px;
    height: 24px;
    padding: 0 4px;
    font-size: 8px;
  }

  .pie-toggle {
    min-width: 90px;
    max-width: 100px;
  }

  body.scroll-locked {
    position: fixed;
    width: 100%;
    overflow: hidden !important;
  }

  #settings-popup .info-help .tip {
    font-size: 12px;
    line-height: 1.25;
    max-width: min(280px, calc(100vw - 32px));
    width: auto;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    top: calc(100% + 8px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    z-index: 9999;
  }

  #settings-popup .info-help .tip li {
    font-size: 12px;
    line-height: 1.25;
  }

  #password-popup .remember-wrap label {
    gap: 1px;
  }

  #password-popup .remember-wrap input[type="checkbox"] {
    margin: 0;
    padding: 0;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
  }
}

@media (min-width: 1256px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
  }

  .dashboard-main {
    position: relative;
    top: 50px;
    left: calc(var(--sidebar-w) + var(--charts-gutter));
    transform: none;
  }

  .sidebar-toggle svg {
    transition: transform 180ms ease;
    width: 100%;
    height: 100%;
    display: none;
  }
}

@media (orientation: landscape) and (max-height: 480px) and (hover: none) and (pointer: coarse) {
  .sidebar {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-padding-bottom: env(safe-area-inset-bottom);
    height: 100svh;
  }
}

@media (min-width: 1256px) {
  .dashboard-main {
    --column-gap: 20px;
    --main-w: calc(100vw - var(--sidebar-w) - var(--charts-gutter));
    --main-h: calc(100svh - var(--topbar-h) - 50px);
    --S-by-width: calc((var(--main-w) - var(--column-gap)) / 1.5);
    --S-by-height: calc(var(--main-h) - var(--column-gap));
    --chart-S: clamp(520px, min(var(--S-by-width), var(--S-by-height)), 720px);
  }

  .dashboard-top {
    gap: var(--column-gap);
  }

  .dashboard-top-left {
    width: var(--chart-S);
    height: var(--chart-S);
    flex: 0 0 auto;
  }

  .dashboard-top-right {
    width: calc(var(--chart-S) * 0.5);
    display: flex;
    flex-direction: column;
    gap: var(--column-gap);
    margin-left: 0;
    flex: 0 0 auto;
  }

  .dashboard-top-right-top,
  .dashboard-top-right-bottom {
    width: 100%;
    height: calc(var(--chart-S) * 0.5);
  }
}

#cartesian-chart,
#pie-social,
#pie-nation {
  width: 100% !important;
  height: 100% !important;
  display: block;
  max-width: 100% !important;
  max-height: 100% !important;
}

@media (max-height: 628px) {

  html,
  body {
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
  }

  .sidebar {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-padding-bottom: env(safe-area-inset-bottom);
    height: 100svh;
  }
}

a, button, input, select, textarea {
  touch-action: manipulation;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@supports not (height: 100svh) {
  .sidebar { height: 100vh; }
}