:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #dce2ea;
  --muted: #64748b;
  --text: #172033;
  --strong: #0f172a;
  --blue: #2563eb;
  --blue-ink: #1d4ed8;
  --red: #dc2626;
  --green: #15803d;
  --amber: #b7791f;
  --violet: #6d28d9;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

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

button {
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--strong);
  min-height: 34px;
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
}

button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

button.danger {
  border-color: #fecaca;
  background: #fff1f2;
  color: #9f1239;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.small-button {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 12px;
}

.link-button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-ink);
  font-weight: 700;
  text-align: left;
}

.link-button:hover {
  text-decoration: underline;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 9px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 86px;
  resize: vertical;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.app-frame {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 18px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.brand-mark,
.portal-badge {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  font-weight: 800;
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-text strong {
  color: var(--strong);
  font-size: 14px;
}

.brand-text span {
  color: var(--muted);
  font-size: 12px;
}

.nav-section {
  margin-top: 18px;
}

.nav-section h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.site-button {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  margin-bottom: 7px;
}

.site-button.active {
  border-color: #93c5fd;
  background: #eff6ff;
}

.site-button strong {
  font-size: 13px;
}

.site-button span {
  color: var(--muted);
  font-size: 12px;
}

.main {
  min-width: 0;
  padding: 22px;
}

.admin-login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-login-card .brand {
  margin-bottom: 2px;
}

.admin-login-card h1 {
  margin: 0;
  color: var(--strong);
  font-size: 24px;
  letter-spacing: 0;
}

.admin-login-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.admin-login-card button {
  justify-self: start;
}

.panel,
.topbar > div {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.topbar h1 {
  margin: 0;
  color: var(--strong);
  font-size: 24px;
  letter-spacing: 0;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.toolbar.left {
  justify-content: flex-start;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid > *,
.form-grid > *,
.filter-grid > * {
  min-width: 0;
}

.grid.two {
  grid-template-columns: minmax(360px, 0.95fr) minmax(360px, 1.05fr);
}

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

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.section-title {
  display: grid;
  gap: 4px;
  margin: 24px 0 12px;
}

.section-title h2 {
  margin: 0;
  color: var(--strong);
  font-size: 18px;
}

.section-title p,
.panel-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  color: var(--strong);
  font-size: 15px;
}

.panel-body {
  padding: 15px;
}

.metric {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  color: var(--strong);
  font-size: 26px;
}

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

.form-grid.one {
  grid-template-columns: 1fr;
}

.form-section {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.form-section h3 {
  margin: 0;
  color: var(--strong);
  font-size: 14px;
}

.advanced-options {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.advanced-options summary {
  cursor: pointer;
  color: var(--strong);
  font-size: 12px;
  font-weight: 700;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}

.check-row input {
  width: auto;
}

.config-list {
  display: grid;
  gap: 0;
}

.config-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.config-row:last-child {
  border-bottom: 0;
}

.config-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.config-row > strong {
  color: var(--strong);
  font-size: 13px;
}

.config-row p {
  margin: 0;
}

.chip-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.chip {
  min-width: 0;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--strong);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.limit-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  min-width: 0;
}

.limit-item {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.limit-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.limit-item strong {
  color: var(--strong);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.segmented button {
  min-height: 28px;
  border: 0;
  background: transparent;
}

.segmented button.active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}

.color-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 8px;
  align-items: center;
}

.color-row input[type="color"] {
  height: 36px;
  padding: 2px;
}

.upload-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.upload-field input[type="file"] {
  min-height: 36px;
  padding: 6px;
}

.profile-create {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.inline-message {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.inline-message.success {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: var(--green);
}

.inline-message.info {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: var(--blue);
}

.inline-message.fail {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: var(--red);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

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

.analytics-insights {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.insight-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: var(--panel-2);
}

.insight-card span,
.insight-card small {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.insight-card strong {
  color: var(--strong);
  font-size: 21px;
}

.insight-card.blue {
  border-left-color: var(--blue);
}

.insight-card.green {
  border-left-color: var(--green);
}

.insight-card.amber {
  border-left-color: var(--amber);
}

.insight-card.violet {
  border-left-color: var(--violet);
}

.insight-card.neutral {
  border-left-color: var(--muted);
}

.hour-chart {
  display: grid;
  grid-template-columns: repeat(24, minmax(12px, 1fr));
  align-items: end;
  gap: 5px;
  height: 140px;
  padding: 14px 12px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.hour-bar {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 5px;
  min-width: 0;
  height: 100%;
  cursor: help;
}

.hour-bar i {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--blue) 0%, #60a5fa 100%);
  transition: filter 0.12s ease, transform 0.12s ease;
}

.hour-bar:hover i {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.hour-bar span {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.breakdown {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.breakdown h3 {
  margin: 0;
  color: var(--strong);
  font-size: 13px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(86px, 0.9fr) minmax(90px, 1fr) auto;
  gap: 8px;
  align-items: center;
  cursor: help;
  font-size: 12px;
}

.bar-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row div {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
  transition: background 0.12s ease;
}

.bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: filter 0.12s ease;
}

.bar-row:hover div {
  background: #dbeafe;
}

.bar-row:hover i {
  filter: brightness(1.08);
}

.bar-row strong {
  color: var(--strong);
  font-size: 12px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status.success {
  background: #dcfce7;
  color: var(--green);
}

.status.view {
  background: #dbeafe;
  color: var(--blue-ink);
}

.status.fail {
  background: #fee2e2;
  color: var(--red);
}

.event-table th {
  white-space: nowrap;
}

.event-table td {
  min-width: 150px;
}

.event-table td:last-child {
  min-width: 260px;
}

.event-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.event-stack strong,
.event-stack span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-stack span {
  color: var(--muted);
  font-size: 12px;
}

.user-agent-cell strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.mini-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 20px;
  margin-right: 6px;
  padding: 1px 5px;
  border-radius: 5px;
  background: #e0ecff;
  color: var(--blue-ink);
  font-size: 10px;
  font-weight: 800;
}

.check-result {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.check-result.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.check-result.fail {
  border-color: #fecaca;
  background: #fff1f2;
}

.check-result.pending {
  color: var(--muted);
}

.check-summary {
  display: grid;
  gap: 3px;
}

.check-summary strong {
  color: var(--strong);
  font-size: 14px;
}

.check-summary span {
  color: var(--muted);
  font-size: 12px;
}

.next-steps {
  display: grid;
  gap: 8px;
}

.next-steps h4 {
  margin: 0;
  color: var(--strong);
  font-size: 13px;
}

.check-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-details {
  display: grid;
  gap: 10px;
}

.check-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.check-list li {
  display: grid;
  grid-template-columns: minmax(150px, 0.5fr) 1fr;
  gap: 8px;
  align-items: start;
  padding: 7px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.check-list li strong::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
}

.check-list li.warn strong::before {
  background: var(--amber);
}

.check-list li.fail strong::before {
  background: var(--red);
}

.check-list span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.inventory-site-value {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.code {
  padding: 2px 6px;
  border-radius: 5px;
  background: #eef2ff;
  color: #3730a3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.preview-shell {
  display: grid;
  place-items: center;
  min-height: 620px;
  border-radius: 8px;
  background: #eef2f7;
  overflow: hidden;
}

.tablet {
  width: min(760px, 95%);
  aspect-ratio: 4 / 3;
  padding: 18px;
  border-radius: 32px;
  background: #101014;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28);
}

.tablet-screen {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
}

.tablet-screen .portal-page {
  width: 100%;
  min-height: 100%;
  padding: 18px;
  gap: 12px;
}

.tablet-screen .portal-topbar {
  width: 100%;
}

.tablet-screen .portal-card {
  width: 100%;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 280px);
  gap: 18px;
}

.tablet-screen .portal-hero h1 {
  font-size: 34px;
}

.tablet-screen .portal-welcome {
  font-size: 13px;
}

.tablet-screen .portal-access-panel {
  padding: 18px;
}

.tablet-screen .portal-access-panel h2 {
  font-size: 20px;
}

.tablet-screen .portal-language-button {
  min-height: 28px;
  padding: 4px 7px;
  font-size: 11px;
}

.preview-portal-page .portal-provider {
  position: absolute;
  right: 12px;
  bottom: 12px;
  transform: scale(0.9);
  transform-origin: right bottom;
}

.portal-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 34px;
  padding: 34px 52px 52px;
  background-position: center;
  background-size: cover;
}

.portal-topbar {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.portal-card {
  width: min(1180px, 100%);
  max-width: 100%;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 520px);
  align-items: center;
  gap: 44px;
}

.portal-hero {
  min-width: 0;
  max-width: 660px;
  color: #fff;
  text-shadow: 0 2px 18px rgba(15, 23, 42, 0.28);
}

.portal-kicker {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.portal-hero h1 {
  margin: 0 0 16px;
  font-size: 64px;
  line-height: 1.02;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.portal-access-panel {
  min-width: 0;
  padding: 32px;
  background: var(--portal-surface, #fff);
  color: var(--portal-text, #232326);
  border-radius: var(--portal-radius, 8px);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.portal-access-panel h2 {
  margin: 0 0 8px;
  color: var(--portal-headline, #111827);
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.portal-panel-copy {
  margin: 0 0 18px;
  color: var(--portal-text, #232326);
}

.portal-language {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-language-button {
  width: auto;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.portal-language-button.active {
  border-color: #fff;
  background: #fff;
  color: #172033;
}

.portal-language-flag {
  font-size: 18px;
  line-height: 1;
}

.portal-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 0;
  text-align: left;
  flex-wrap: wrap;
}

.portal-topbar .portal-logo.left,
.portal-topbar .portal-logo.right,
.portal-topbar .portal-logo.center {
  justify-content: flex-start;
}

.portal-topbar .portal-logo .portal-wordmark {
  color: #fff;
  text-shadow: 0 2px 16px rgba(15, 23, 42, 0.28);
}

.portal-badge {
  background: var(--portal-button, #cfa052);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.portal-logo-image {
  display: block;
  max-width: min(220px, 100%);
  max-height: 74px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.portal-wordmark {
  min-width: 0;
  max-width: 240px;
  color: var(--portal-headline, #111827);
  font-size: 18px;
  font-weight: 900;
  line-height: 0.98;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.portal-card p {
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.portal-welcome {
  margin: 0;
  max-width: 560px;
  font-size: 20px;
  line-height: 1.45;
}

.portal-form {
  display: grid;
  gap: 14px;
}

.portal-form-fallback {
  margin-top: 16px;
}

.portal-methods-fallback {
  display: grid;
  gap: 8px;
  padding: 10px 0 0;
  border: 0;
}

.portal-methods-fallback legend {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.portal-radio-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.portal-methods {
  display: flex;
  gap: 6px;
}

.portal-methods button {
  flex: 1;
}

.portal-methods button.active {
  border-color: var(--portal-link, var(--portal-button, #cfa052));
  color: var(--portal-link, var(--portal-button, #cfa052));
}

.portal-terms {
  overflow: visible;
  padding: 12px 0 2px;
  border: 1px solid var(--line);
  border-width: 1px 0 0;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
  line-height: 1.48;
  white-space: pre-line;
}

.portal-card a {
  color: var(--portal-link, var(--portal-button, #cfa052));
}

.portal-submit {
  width: 100%;
  border-color: var(--portal-button, #cfa052);
  background: var(--portal-button, #cfa052);
  color: var(--portal-button-text, #fff);
}

.portal-result-panel {
  width: min(520px, calc(100vw - 32px));
  margin: auto;
}

.portal-result-panel h1 {
  margin: 0 0 10px;
  color: var(--portal-headline, #111827);
  font-size: 30px;
  line-height: 1.1;
}

.portal-result-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 14px;
  text-align: center;
  text-decoration: none;
}

.portal-provider {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 30;
  color: #334155;
  font-size: 11px;
}

.portal-provider summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  list-style: none;
  opacity: 0.72;
  backdrop-filter: blur(12px);
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.portal-provider summary::-webkit-details-marker {
  display: none;
}

.portal-provider summary::marker {
  content: "";
}

.portal-provider:hover summary,
.portal-provider:focus-within summary,
.portal-provider[open] summary {
  border-color: rgba(14, 165, 233, 0.35);
  background: rgba(255, 255, 255, 0.9);
  opacity: 1;
}

.portal-provider-logo {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.portal-provider-text {
  max-width: 132px;
  overflow: hidden;
  color: #475569;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-provider-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  display: none;
  width: min(280px, calc(100vw - 32px));
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(14px);
}

.portal-provider:hover .portal-provider-popover,
.portal-provider:focus-within .portal-provider-popover,
.portal-provider[open] .portal-provider-popover {
  display: grid;
}

.portal-provider-popover strong {
  color: #0f172a;
  font-size: 13px;
}

.portal-provider-popover span {
  color: #475569;
  line-height: 1.35;
}

.portal-provider-url {
  color: #0369a1 !important;
  font-weight: 800;
}

.portal-message {
  display: none;
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 14px;
}

.portal-message.visible {
  display: block;
}

.portal-message.success {
  background: #dcfce7;
  color: var(--green);
}

.portal-message.error {
  background: #fee2e2;
  color: var(--red);
}

.error-page {
  max-width: 640px;
  margin: 16vh auto;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

@media (max-width: 980px) {
  .app-frame,
  .grid.two,
  .grid.three,
  .metrics-grid,
  .analytics-grid,
  .analytics-insights,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .hour-chart {
    grid-template-columns: repeat(12, minmax(14px, 1fr));
    height: 180px;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .config-row {
    grid-template-columns: 1fr;
  }

  .limit-list {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 16px;
  }

  .topbar .toolbar,
  .panel-header .toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .portal-page {
    padding: 24px;
    gap: 26px;
  }

  .portal-topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .portal-language {
    margin-left: auto;
  }

  .portal-card {
    grid-template-columns: 1fr;
    gap: 26px;
    align-content: center;
  }

  .portal-hero {
    max-width: 720px;
  }

  .portal-hero h1 {
    font-size: 44px;
  }

  .portal-welcome {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .portal-page {
    padding: 18px;
    gap: 18px;
  }

  .portal-topbar {
    gap: 14px;
  }

  .portal-language {
    width: 100%;
    justify-content: flex-start;
  }

  .portal-language-button {
    flex: 1;
    justify-content: center;
  }

  .portal-access-panel {
    padding: 24px 20px;
  }

  .portal-logo {
    gap: 8px;
  }

  .portal-badge {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
  }

  .portal-wordmark {
    max-width: 190px;
    font-size: 15px;
    line-height: 1.05;
  }

  .portal-logo-image {
    max-width: 190px;
    max-height: 62px;
  }

  .portal-hero h1 {
    font-size: 36px;
    overflow-wrap: anywhere;
  }

  .portal-access-panel h2 {
    font-size: 24px;
  }

  .portal-welcome {
    font-size: 16px;
  }

  .portal-provider {
    right: 12px;
    bottom: 10px;
  }

  .portal-provider summary {
    min-height: 28px;
    padding: 5px;
  }

  .portal-provider-text {
    display: none;
  }
}
