﻿:root {
  color-scheme: light;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  --brand-dark: #0f172a;
  --brand-dark-rgb: 15, 23, 42;
  --text: #0b0d12;
  --muted: #344054;
  --muted-2: #475467;
  --link: #0b0d12;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f7f8;
  --surface-3: #f2f4f7;
  --border: #e4e7ec;
  --border-2: #d0d5dd;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 6px 18px rgba(16, 24, 40, 0.08);
  --header-h: 60px;
  --content-max: min(1680px, calc(100vw - 24px));
  --toc-w: 280px;
  --gap: 28px;
  --h1: clamp(34px, 3.2vw, 44px);
  --h2: 22px;
  --h3: 18px;
  --p: 16px;
  --small: 13px;
  --lh: 1.55;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: var(--lh);
  overflow-x: hidden;
  overflow-y: scroll;
}

.portal-page {
  background:
    radial-gradient(circle at top left, rgba(15, 23, 42, 0.025), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
}

html {
  scrollbar-gutter: stable;
}

a,
a:hover,
a:focus,
a:focus-visible,
a:active {
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex;
  align-items: center;
  box-shadow: 0 1px 0 var(--border), 0 8px 18px rgba(16, 24, 40, 0.06);
}

.topbar-inner {
  max-width: min(1680px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0c0d12;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.2rem;
  line-height: 1;
  white-space: nowrap;
}

.brand:hover,
.brand:focus-visible,
.brand:active {
  text-decoration: none;
  color: #0c0d12;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: contain;
  display: inline-block;
}

.brand .material-symbols-outlined {
  font-size: 1.2rem;
  line-height: 1;
}

.topbar-nav {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  align-items: center;
  margin-left: auto;
}

.topbar-nav a {
  text-decoration: none;
  color: var(--link);
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  height: 32px;
  line-height: 1;
}

.topbar-nav .icon {
  font-size: 1.24rem;
  line-height: 1;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
}

.icon-circle-link {
  width: 36px;
  min-width: 36px;
  height: 36px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
}

.topbar-nav .icon-circle-link .icon {
  font-size: 1.38rem;
}

.topbar-nav .nav-trigger {
  line-height: 1;
}

.topbar-nav .nav-trigger,
.topbar-nav a {
  height: 32px;
}

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: -8px;
}

.nav-dropdown::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 10px;
}

.nav-trigger {
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.95rem;
  color: var(--link);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
}

.nav-trigger .material-symbols-outlined {
  font-size: 18px;
  color: var(--muted);
}

.topbar-nav a:hover,
.nav-trigger:hover {
  background: var(--surface-3);
}

.topbar-nav a.is-active,
.nav-trigger.is-active {
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--border);
}

.nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: none;
  z-index: 20;
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  line-height: 1.2;
  white-space: nowrap;
}

.nav-menu a .material-symbols-outlined {
  font-size: 16px;
  color: var(--muted);
}

.nav-menu a:hover {
  background: var(--surface-3);
}

.nav-menu a:hover .material-symbols-outlined {
  color: var(--brand-dark);
}

.nav-menu a.is-active {
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--border);
}

.nav-menu a.is-active .material-symbols-outlined {
  color: var(--brand-dark);
}

.nav-dropdown:hover .nav-menu,
.nav-dropdown:focus-within .nav-menu {
  display: block;
}

.nav-dropdown.is-open .nav-menu {
  display: block;
}

.nav-dropdown.is-open .nav-trigger {
  background: var(--surface-3);
}

.nav-mobile-toggle {
  display: none;
  margin-left: auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-mobile-toggle .material-symbols-outlined {
  font-size: 1.28rem;
  line-height: 1;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    min-height: var(--header-h);
    z-index: 30;
  }

  .topbar-inner {
    padding: 8px 16px;
    flex-wrap: wrap;
    row-gap: 10px;
    position: relative;
  }

  .nav-mobile-toggle {
    display: inline-flex;
  }

  .topbar-nav {
    width: 100%;
    order: 3;
    margin-left: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    overflow: hidden;
    pointer-events: none;
    transition:
      max-height 220ms ease,
      opacity 180ms ease,
      transform 220ms ease,
      padding 220ms ease,
      border-color 220ms ease,
      background-color 220ms ease,
      box-shadow 220ms ease;
  }

  .topbar-nav.is-open {
    padding: 10px;
    border-color: var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    max-height: 74vh;
    opacity: 1;
    transform: translateY(0);
    overflow: auto;
    pointer-events: auto;
  }

  .topbar-nav a,
  .topbar-nav .nav-trigger {
    width: 100%;
    height: 40px;
    justify-content: flex-start;
  }

  .topbar-nav a.icon-circle-link {
    width: 40px;
    min-width: 40px;
    justify-content: center;
    align-self: flex-start;
  }

  .nav-dropdown {
    width: 100%;
    display: grid;
    gap: 4px;
    padding-bottom: 0;
    margin-bottom: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    padding: 6px;
  }

  .nav-dropdown::after {
    display: none;
  }

  .topbar-nav .nav-trigger {
    width: 100%;
    height: 40px;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
  }

  .nav-menu {
    position: static;
    min-width: 0;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
    padding: 4px 0 0 8px;
  }

  .topbar-nav.is-open .nav-dropdown .nav-menu {
    display: grid;
    gap: 4px;
  }

  .nav-menu a {
    padding: 8px 10px;
    border-radius: 10px;
    height: auto;
    background: var(--surface);
    border: 1px solid var(--border);
  }
}

.container {
  max-width: var(--content-max);
  margin: 32px auto 64px;
  padding: 0 24px;
  display: grid;
  gap: 24px;
}

.portal-page .container {
  gap: 18px;
}

.container-wide {
  max-width: min(1680px, calc(100vw - 48px));
}

.posologia-page-container {
  max-width: calc(100vw - 20px);
  padding-left: 12px;
  padding-right: 12px;
}

.posologia-page-shell {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  gap: 0;
}

.examples-ux .posologia-page-shell {
  display: grid;
  gap: 14px;
}

.examples-ux .card-header {
  align-items: flex-start;
}

.examples-ux .card-title {
  min-width: 0;
}

.examples-ux .card-title h2 {
  line-height: 1.14;
}

.examples-ux .card-title .badge {
  flex: 0 0 auto;
}

.examples-ux .table-wrap {
  scrollbar-gutter: stable both-edges;
}

.examples-ux .table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7fafc;
}

.examples-ux .search-panel-head p,
.examples-ux .advanced-help,
.examples-ux .advanced-current-desc,
.examples-ux .muted {
  line-height: 1.5;
}

.examples-ux .advanced-current-name,
.examples-ux .eq-item-name,
.examples-ux .format-group-head strong {
  line-height: 1.28;
}

.examples-ux .detail-pair,
.examples-ux .eq-item,
.examples-ux .format-group,
.examples-ux .advanced-current-chip,
.examples-ux .magazzino-kpi,
.examples-ux .example-intro-item {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.docs-page {
  max-width: min(1320px, calc(100vw - 24px));
  gap: 18px;
}

.docs-page .card-header {
  justify-content: flex-start;
  align-items: flex-start;
  margin-bottom: 8px;
}

.docs-page .card-header h2 {
  line-height: 1.24;
}

.docs-page .card-body {
  gap: 10px;
}

.docs-quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  padding: 7px 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
}

.doc-chip:hover {
  background: var(--surface-3);
}

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

.docs-block {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.docs-block h3 {
  font-size: 1rem;
}

.docs-note {
  border: 1px dashed var(--border-2);
  border-radius: var(--r-sm);
  background: #f8fafc;
  padding: 10px 12px;
}

.docs-code-stack {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.docs-code-stack > * {
  min-width: 0;
}

.docs-code-title {
  font-size: 0.85rem;
  color: var(--muted);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.docs-table th,
.docs-table td {
  font-size: 0.84rem;
  vertical-align: top;
}

.docs-table th:nth-child(1),
.docs-table td:nth-child(1) {
  width: 15%;
  white-space: nowrap;
}

.docs-table th:nth-child(2),
.docs-table td:nth-child(2) {
  width: 35%;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.docs-table th:nth-child(3),
.docs-table td:nth-child(3) {
  width: 50%;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.docs-table code {
  font-size: 0.8rem;
  word-break: break-word;
}

.docs-kpi-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.docs-kpi {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 10px 12px;
}

.docs-kpi strong {
  display: block;
  margin-top: 4px;
}

.docs-toc-title {
  margin-bottom: 8px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.portal-page .card {
  box-shadow: none;
}

.card-body,
.card-title,
.article-card,
.article-body,
.article-detail-content {
  min-width: 0;
}

.card h1,
.card h2,
.card h3,
.card h4,
.card p,
.card li,
.card td,
.card th,
.muted,
.table-desc,
.article-body h2,
.article-body p,
.article-detail-content p,
.article-detail-content li,
.article-detail-content h2,
.article-detail-content h3 {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.card a:not(.btn):not(.brand):not(.article-card-link):not(.article-page-link):not(.article-page-nav):not(.share-btn),
.article-body a,
.article-detail-content a {
  color: #0f172a;
  text-decoration: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero-card {
  display: grid;
  gap: 20px;
}

.portal-page .hero-card {
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(15, 23, 42, 0.04), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
}

.hero-home {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.hero-home-v2 {
  position: relative;
  overflow: hidden;
  padding: 28px;
  gap: 24px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top right, rgba(15, 23, 42, 0.05), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
}

.hero-home-v2::after {
  content: "";
  position: absolute;
  inset: auto -100px -120px auto;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.08), transparent 68%);
  pointer-events: none;
}

.home-page-shell {
  gap: 20px;
}

.home-hero-copy,
.home-runtime-panel,
.home-section-card {
  position: relative;
  z-index: 1;
}

.home-lead {
  max-width: 72ch;
  margin-top: 14px;
  font-size: 1.04rem;
  line-height: 1.72;
  color: #1f2937;
}

.home-hero-points {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.home-hero-point {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(247, 247, 248, 0.72);
}

.home-hero-point .material-symbols-outlined {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2f7;
  color: #111827;
}

.home-hero-point strong {
  display: block;
  margin-bottom: 2px;
}

.home-runtime-panel {
  padding: 20px;
  gap: 14px;
}

.home-runtime-head {
  display: grid;
  gap: 4px;
}

.home-summary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-summary-card {
  padding: 18px 18px 16px;
  box-shadow: none;
}

.home-summary-card strong {
  font-size: clamp(1.5rem, 2vw, 1.9rem);
}

.home-section-card {
  padding: 20px;
  box-shadow: none;
}

.home-feature-grid,
.home-story-grid,
.home-example-grid {
  display: grid;
  gap: 14px;
}

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

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

.home-example-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-feature-card,
.home-story-card,
.home-example-card {
  padding: 16px;
}

.home-split-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
}

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

.home-ring-wrap {
  margin-top: 8px;
}

.home-chart-card {
  padding: 18px;
  box-shadow: none;
}

.home-process-list {
  display: grid;
  gap: 12px;
}

.home-process-step {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
}

.home-process-step strong {
  font-size: 0.98rem;
}

.home-section-headline {
  align-items: end;
}

.hero-context {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  background: linear-gradient(180deg, #f9fafb, #f3f5f8);
  display: grid;
  gap: 10px;
}

.hero-context-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 8px;
}

.hero-context-row:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.hero-context-row strong {
  font-size: 0.98rem;
}

.portal-runtime-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.portal-page .portal-runtime-strip {
  gap: 14px;
}

.portal-runtime-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  background: linear-gradient(180deg, #fbfcfd, #f4f6f8);
  display: grid;
  gap: 6px;
}

.portal-runtime-card span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.portal-runtime-card strong {
  font-size: 1.08rem;
  line-height: 1.2;
}

.portal-runtime-card small {
  color: #475467;
  font-size: 0.84rem;
}

.portal-note-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.portal-page .portal-note-grid,
.portal-page .docs-grid,
.portal-page .docs-kpi-list,
.portal-page .grid-two,
.portal-page .form-grid {
  gap: 14px;
}

.portal-note-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  background: var(--surface-2);
  display: grid;
  gap: 8px;
}

.portal-note-card h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.portal-note-card h3 .material-symbols-outlined {
  font-size: 1.25rem;
  color: #374151;
}

.portal-inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.portal-chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.86rem;
  color: #334155;
}

.portal-page .docs-note,
.portal-page .admin-details,
.portal-page .admin-auth-notice,
.portal-page .json-preview {
  box-shadow: none;
}

.portal-page .docs-note,
.portal-page .admin-details,
.portal-page .admin-auth-notice {
  background: var(--surface-2);
}

.portal-page .feature-list {
  gap: 10px;
}

.portal-page .feature-list li,
.portal-page p,
.portal-page td,
.portal-page th {
  line-height: 1.62;
}

.portal-page .card-link,
.portal-page .article-card,
.portal-page .article-detail {
  box-shadow: none;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--muted);
}

h1 {
  font-size: var(--h1);
  margin-top: 8px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--h2);
  font-weight: 650;
}

.muted {
  color: var(--muted);
  margin-top: 8px;
}

.portal-page .muted,
.portal-page .section-desc {
  color: var(--muted);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.metric {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  display: grid;
  gap: 6px;
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
}

.metric-sub {
  font-size: var(--small);
  color: #475467;
}

.metric-icon {
  position: absolute;
  right: 12px;
  bottom: 10px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e7ecf5, #f7f7f8);
  box-shadow: var(--shadow-sm);
  animation: pulse 2.4s ease-in-out infinite;
}

.metric-wide {
  min-height: 110px;
}

.metric strong {
  font-size: 1.2rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.portal-page .card-header {
  margin-bottom: 14px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.card-body {
  display: grid;
  gap: 12px;
}

.portal-page .card-body {
  gap: 14px;
}

.input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.95rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
  background: var(--surface);
  position: relative;
}

.table-wrap::before,
.table-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20px;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity 160ms ease;
}

.table-wrap::before {
  left: 0;
  background: linear-gradient(90deg, rgba(12, 13, 18, 0.14), rgba(12, 13, 18, 0));
}

.table-wrap::after {
  right: 0;
  background: linear-gradient(270deg, rgba(12, 13, 18, 0.14), rgba(12, 13, 18, 0));
}

.table-wrap.is-scrollable::before,
.table-wrap.is-scrollable::after {
  opacity: 1;
}

.table-wrap.is-at-start::before {
  opacity: 0;
}

.table-wrap.is-at-end::after {
  opacity: 0;
}

.table-wrap > table {
  min-width: 100%;
}

.table-wrap > table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  box-shadow: inset 0 -1px 0 var(--border);
}

.posologia-table-wrap {
  min-height: 420px;
}

.magazzino-table-wrap {
  min-height: 360px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  background: var(--surface-2);
  font-weight: 600;
}

.split {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
}

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

.card-item {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  background: var(--surface);
}

.portal-page .card-item {
  padding: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.toolbar .btn {
  height: 32px;
}

.btn {
  border: 1px solid var(--brand-dark);
  background: var(--brand-dark);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: #ffffff;
  font-weight: 600;
  transition:
    box-shadow 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.btn:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
  box-shadow: 0 0 0 1px rgba(var(--brand-dark-rgb), 0.14), var(--shadow-sm);
}

.btn:focus-visible {
  outline: 2px solid rgba(var(--brand-dark-rgb), 0.35);
  outline-offset: 2px;
}

.btn-ghost {
  background: transparent;
  color: var(--brand-dark);
  border-color: rgba(var(--brand-dark-rgb), 0.35);
}

.btn-ghost:hover {
  background: rgba(var(--brand-dark-rgb), 0.08);
}

.btn[href*="aipersonal.it/contatti"] {
  padding: 6px 12px;
  font-size: 0.82rem;
  min-height: 32px;
}

.grid-two {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

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

.admin-step-chip {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-step-chip strong {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-dark);
  color: #ffffff;
  font-size: 0.85rem;
}

.admin-create-card {
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 1px rgba(var(--brand-dark-rgb), 0.12), var(--shadow-sm);
}

.admin-permissions {
  display: grid;
  gap: 8px;
}

.admin-details {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  background: var(--surface-2);
}

.admin-details > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.admin-details[open] > summary {
  margin-bottom: 8px;
}

.admin-advanced-grid {
  margin-top: 4px;
}

.admin-key-output {
  border: 1px solid var(--brand-dark);
  border-radius: 12px;
  background: #f3f7ff;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.admin-key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.admin-copy-status {
  margin: 0;
  color: var(--brand-dark);
  font-size: 0.86rem;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: end;
}

.admin-auth-page {
  max-width: min(1280px, calc(100vw - 40px));
}

.admin-auth-shell {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.4fr);
  gap: 20px;
  align-items: start;
}

.admin-auth-hero {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(160deg, #f4f8ff 0%, #f7f7f8 100%);
  padding: 18px;
  display: grid;
  gap: 10px;
}

.admin-auth-logo {
  width: 78px;
  height: 78px;
  border-radius: 16px;
  object-fit: contain;
  box-shadow: var(--shadow-sm);
}

.auth-security-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.auth-security-list li {
  border: 1px solid #dbe8ff;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8fbff;
  font-size: 0.9rem;
  color: var(--brand-dark);
}

.auth-mini-note {
  font-size: 0.86rem;
}

.admin-auth-panel {
  display: grid;
  gap: 14px;
}

.admin-auth-notice {
  margin-top: 16px;
  border: 1px solid var(--border-2);
  background: #f8fafc;
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: grid;
  gap: 10px;
}

.admin-auth-notice strong {
  color: var(--text);
}

.admin-auth-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-auth-tabs .btn {
  gap: 6px;
}

.admin-auth-tabs .material-symbols-outlined {
  font-size: 18px;
  line-height: 1;
}

.admin-auth-tabs .btn.is-active {
  background: var(--brand-dark);
  color: #ffffff;
  border-color: var(--brand-dark);
}

.admin-auth-tab {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface-2);
}

.auth-feedback {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.35;
  background: #f8fafc;
  color: var(--brand-dark);
}

.auth-feedback.info {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--brand-dark);
}

.auth-feedback.success {
  background: #ecfdf3;
  border-color: #a7f3d0;
  color: #065f46;
}

.auth-feedback.error {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.password-field .input {
  min-width: 0;
}

.password-toggle {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
}

.password-toggle .material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
}

.auth-strength {
  margin: 0;
  font-size: 0.88rem;
  color: #475569;
}

.auth-strength.weak {
  color: #9f1239;
}

.auth-strength.medium {
  color: #a16207;
}

.auth-strength.strong {
  color: #166534;
}

.auth-honeypot {
  position: absolute;
  left: -100000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.feature-list {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
  display: grid;
  gap: 8px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.card-link {
  display: block;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.card-link h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.card-link h3 .material-symbols-outlined {
  font-size: 1.35rem;
  color: #374151;
  line-height: 1;
}

.section-head {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.portal-page .section-head {
  gap: 8px;
  margin-bottom: 14px;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-title .material-symbols-outlined {
  font-size: 1.4rem;
  color: #374151;
  line-height: 1;
}

.section-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.62;
}

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

.kpi-card strong {
  display: block;
  font-size: clamp(1.2rem, 1.75vw, 1.55rem);
  line-height: 1.1;
  margin-top: 6px;
}

.kpi-card .muted {
  margin-top: 4px;
}

.home-coverage-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.coverage-row {
  display: grid;
  gap: 8px;
}

.coverage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.coverage-head strong {
  font-size: 1rem;
}

.coverage-track {
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background: #eceff3;
  overflow: hidden;
  border: 1px solid var(--border);
}

.coverage-track span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #151a21, #39404d);
  transition: width 0.6s ease;
}

.ring-wrap {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.ring-chart {
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: conic-gradient(#0b0d12 0%, #d0d5dd 0%);
  position: relative;
  border: 1px solid var(--border);
}

.ring-chart::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: inherit;
  background: #fff;
}

.ring-legend {
  display: grid;
  gap: 8px;
}

.ring-legend p {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.dot-dark {
  background: #0b0d12;
}

.dot-light {
  background: #d0d5dd;
}

.home-chart-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.dist-row {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.dist-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.dist-label,
.dist-value {
  color: #1f2937;
}

@media (max-width: 1200px) {
  .home-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .home-split-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .hero-home-v2 {
    grid-template-columns: 1fr;
    padding: 22px 18px;
  }

  .home-story-grid,
  .home-mini-metrics,
  .home-chart-grid {
    grid-template-columns: 1fr;
  }

  .home-example-grid,
  .home-feature-grid,
  .home-summary-grid {
    grid-template-columns: 1fr;
  }

  .home-section-card,
  .home-chart-card {
    padding: 18px;
  }
}

.dist-label {
  text-transform: capitalize;
}

.dist-value {
  font-size: 0.92rem;
}

.dist-value small {
  color: var(--muted);
  font-size: 0.8rem;
}

.dist-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #f2f4f7;
  border: 1px solid var(--border);
  overflow: hidden;
}

.dist-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1b222d, #5f697a);
}

.card-item h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.card-item h3 .material-symbols-outlined {
  font-size: 1.35rem;
  color: #374151;
  line-height: 1;
}

.site-footer {
  margin-top: 36px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

.site-footer-inner {
  max-width: min(1680px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 14px 24px;
}

.footer-policy {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  margin-bottom: 10px;
}

.footer-policy small {
  display: inline;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 0.86rem;
  flex-wrap: wrap;
}

.footer-bottom small {
  flex: 1 1 280px;
  min-width: 0;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
}

.footer-link:hover {
  text-decoration: none;
}

.footer-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--brand-dark);
  background: var(--brand-dark);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
}

.footer-link-button:hover {
  text-decoration: none;
  box-shadow: 0 0 0 1px rgba(var(--brand-dark-rgb), 0.14), var(--shadow-sm);
}

.footer-link-gdpr {
  padding: 4px 6px;
}

.aifa-usage-note {
  margin: 12px 0 2px;
  font-size: 0.84rem;
}

.aifa-usage-note-footer {
  margin: 24px 8px 8px;
  border-radius: 14px;
  border: 1px solid rgba(var(--brand-dark-rgb), 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(245,248,255,0.96) 100%);
  box-shadow: 0 10px 24px rgba(var(--brand-dark-rgb), 0.06);
}

@media (max-width: 1400px) {
  .home-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .home-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .docs-quick-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doc-chip {
    width: 100%;
    justify-content: center;
  }
}

.json-preview {
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px;
  border-radius: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.8rem;
}

.portal-page pre,
.portal-page code,
.portal-page .docs-code-title,
.portal-page .portal-note-card,
.portal-page .portal-runtime-card,
.portal-page .docs-kpi,
.portal-page .card {
  min-width: 0;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 80;
}

.modal.open {
  display: flex;
}

.modal.modal-fade {
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.modal.modal-fade .modal-content {
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition: opacity 220ms ease, transform 220ms ease;
}

.modal.modal-fade.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal.modal-fade.is-open .modal-content {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal-content {
  background: var(--surface);
  border-radius: 20px;
  padding: 20px 24px;
  width: min(720px, 100%);
  box-shadow: var(--shadow-md);
  max-height: 90vh;
  overflow: hidden;
  animation: modal-rise 180ms ease-out;
}

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

.modal-body {
  margin-top: 16px;
  max-height: calc(90vh - 120px);
  overflow-y: auto;
  padding-right: 4px;
}

@media (max-width: 720px) {
  .topbar-inner {
    padding: 8px 16px;
  }

  .container {
    padding-left: 6px;
    padding-right: 6px;
  }

  .admin-step-grid {
    grid-template-columns: 1fr;
  }

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

  .hero-home {
    grid-template-columns: 1fr;
  }

  .ring-wrap {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .home-chart-grid {
    grid-template-columns: 1fr;
  }

  .site-footer-inner {
    padding: 18px 16px 24px;
  }

  .footer-policy {
    text-align: center;
  }

  .footer-bottom {
    justify-content: center;
    text-align: center;
  }

  .footer-bottom small {
    flex: 1 1 100%;
  }

  .footer-links {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

  .home-kpi-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.6rem;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.7;
  }
}
.search-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.search-item {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.search-item:hover,
.search-item:focus-within {
  background: var(--surface-3);
}

.search-item-main {
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 4px;
  width: 100%;
}

.search-item-main:focus-visible {
  outline: 2px solid var(--brand-dark);
  outline-offset: 2px;
  border-radius: 8px;
}

.search-insert-btn {
  min-width: 92px;
  justify-self: end;
}

.search-empty {
  padding: 10px 12px;
}

.search-title {
  font-weight: 400;
}

.search-title strong {
  font-weight: 700;
}

.search-meta {
  font-size: 12px;
  color: var(--muted-2);
}

.search-desc {
  color: var(--muted);
  font-size: 0.9rem;
}

.search-panel {
  background: linear-gradient(180deg, #f8fafc, #f3f5f8);
  border: 1px solid #cdd5df;
  border-radius: var(--r-md);
  padding: 14px;
  margin-bottom: 16px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.search-panel .muted {
  color: #4d5c75;
}

[data-posologia-api-status]:empty {
  display: none;
}

.search-panel.is-open {
  max-height: 860px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.search-panel-head {
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 10px;
}

.search-panel-head h3 {
  font-size: 1rem;
}

.posologia-livebar {
  margin-top: 4px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 10px 12px;
}

.posologia-livebar > :not(.badge) {
  order: 1;
}

.posologia-livebar > .badge {
  order: 2;
  opacity: 0.88;
  font-size: 0.78rem;
  flex: 0 0 auto;
  white-space: nowrap;
}

.posologia-key-field {
  min-width: min(420px, 100%);
  flex: 1 1 360px;
}

.posologia-search-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.posologia-stat-chip {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 8px 10px;
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.posologia-stat-chip strong {
  color: var(--text);
}

.icon-button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 12px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-button .material-symbols-outlined {
  font-size: 1.2rem;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.search-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.search-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #c7d3e6;
  border-top-color: var(--brand-dark);
  animation: search-spin 0.8s linear infinite;
}

@keyframes search-spin {
  to {
    transform: rotate(360deg);
  }
}

.search-field {
  position: relative;
  width: 100%;
}

.search-field .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.05rem;
  color: var(--muted-2);
}

.search-field .input {
  padding-left: 44px;
}

.search-item.is-selected {
  border-color: var(--border-2);
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px rgba(11, 13, 18, 0.08);
}

.search-list {
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.posologia-scenarios {
  align-items: center;
}

.posologia-scenarios .btn {
  margin-top: 0;
}

.table-title {
  font-weight: 600;
}

.table-meta {
  font-size: 12px;
  color: var(--muted-2);
  margin-top: 2px;
}

.table-desc {
  font-size: 0.85rem;
  color: var(--muted);
}

.posologia-empty {
  padding: 18px 12px;
  display: grid;
  gap: 10px;
  justify-items: start;
}

.packs-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.packs-control .input {
  width: 72px;
  padding: 6px 8px;
  text-align: center;
}

.packs-control .btn {
  padding: 4px 10px;
  height: 28px;
}

.posologia-therapy-table {
  table-layout: fixed;
  width: 100%;
  min-width: 1040px;
}

.posologia-therapy-table th,
.posologia-therapy-table td {
  font-size: 0.8rem;
  vertical-align: middle;
}

.posologia-therapy-table th:nth-child(1),
.posologia-therapy-table td:nth-child(1) {
  width: 31%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.posologia-therapy-table th:nth-child(2),
.posologia-therapy-table td:nth-child(2) {
  width: 15%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.posologia-therapy-table th:nth-child(3),
.posologia-therapy-table td:nth-child(3) {
  width: 19%;
  white-space: nowrap;
}

.posologia-therapy-table th:nth-child(4),
.posologia-therapy-table td:nth-child(4) {
  width: 15.5%;
  white-space: nowrap;
}

.posologia-therapy-table th:nth-child(5),
.posologia-therapy-table td:nth-child(5) {
  width: 14.5%;
  white-space: nowrap;
}

.posologia-therapy-table th:nth-child(6),
.posologia-therapy-table td:nth-child(6) {
  width: 6%;
  white-space: nowrap;
  padding-left: 6px;
  padding-right: 6px;
}

.posologia-therapy-table thead th {
  text-align: left;
  font-size: 0.76rem;
}

.posologia-therapy-table thead th:nth-child(n + 2),
.posologia-therapy-table tbody td:nth-child(n + 2) {
  text-align: center;
}

.posologia-therapy-table thead th:nth-child(4),
.posologia-therapy-table thead th:nth-child(5),
.posologia-therapy-table thead th:nth-child(6) {
  background: #edf3ff;
}

.posologia-therapy-table td input[type="date"] {
  padding: 8px 10px;
}

.posologia-therapy-table td:nth-child(4) .input-date {
  min-width: 132px;
  width: 132px;
}

.posologia-therapy-table td:nth-child(5) .therapy-end-output {
  min-width: 120px;
  font-weight: 600;
}

.posologia-therapy-table tbody tr:nth-child(odd) td {
  background: #ffffff;
}

.posologia-therapy-table tbody tr:nth-child(even) td {
  background: #f7f7f7;
}

.table-drug-headline {
  font-weight: 700;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.15;
}

.table-drug-subline {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.cell-details {
  margin-top: 8px;
}

.cell-details-summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--muted);
}

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

.cell-details-summary .material-symbols-outlined {
  font-size: 0.95rem;
}

.cell-details-body {
  margin-top: 8px;
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 8px;
}

.posologia-main-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.posologia-main-text {
  display: inline-block;
  font-size: 0.81rem;
  line-height: 1.22;
}

.btn-dark {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #ffffff;
}

.btn-dark:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.input-compact {
  min-height: 34px;
  padding: 7px 10px;
}

.input-date {
  min-width: 126px;
}

.packs-control-compact .btn {
  min-width: 30px;
  height: 30px;
}

.packs-control-compact .input {
  width: 66px;
}

.posologia-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.posologia-actions-row .icon-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
}

.posologia-actions-row .material-symbols-outlined {
  font-size: 1.08rem;
}

.posologia-therapy-table td:nth-child(3) .packs-control {
  justify-content: center;
}

.posologia-therapy-table td:nth-child(4) input,
.posologia-therapy-table td:nth-child(5) input {
  text-align: center;
}

.posologia-help-trigger {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.posologia-help-trigger .material-symbols-outlined {
  font-size: 1.45rem;
}

.posologia-help-content {
  width: min(760px, 100%);
}

.actions-modal-content {
  width: min(980px, 100%);
}

.actions-rich-grid {
  gap: 12px;
}

.actions-rich-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.modal-close-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  border-radius: 999px;
  padding: 0;
}

.modal-close-icon-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.modal-close-icon-button:hover {
  background: var(--surface-2);
  border-color: rgba(var(--brand-dark-rgb), 0.24);
}

.modal-close-icon-button .material-symbols-outlined {
  font-size: 1.25rem;
}

.example-help-trigger {
  flex: 0 0 auto;
}

.example-help-content {
  max-width: 760px;
}

.example-help-content .feature-list {
  margin-left: 18px;
}

.example-help-section {
  display: grid;
  gap: 8px;
}

.modal-close-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--surface);
}

.posologia-landscape-tip {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #d5e2ff;
  background: rgba(243, 247, 255, 0.94);
  border-radius: 16px;
  color: var(--brand-dark);
  font-size: 0.9rem;
  line-height: 1.35;
  box-shadow: 0 14px 30px rgba(var(--brand-dark-rgb), 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}

.posologia-landscape-tip[hidden] {
  display: none !important;
}

.posologia-landscape-tip .material-symbols-outlined {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-dark);
  background: rgba(219, 232, 255, 0.9);
}

.posologia-landscape-tip strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 3px;
}

.posologia-landscape-tip small {
  display: block;
  font-size: 0.79rem;
}

.posologia-landscape-tip.is-strong {
  border-color: #9dbdff;
  background: linear-gradient(180deg, rgba(238, 244, 255, 0.96) 0%, rgba(223, 234, 255, 0.94) 100%);
  animation: tipPulse 1.3s ease-in-out infinite alternate;
}

.posologia-landscape-tip.is-soft {
  border-color: #d5e2ff;
  background: rgba(243, 247, 255, 0.94);
}

.posologia-landscape-tip.is-overlay {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(92vw, 420px);
  z-index: 34;
}

.posologia-landscape-tip.is-overlay .material-symbols-outlined {
  font-size: 2.25rem;
  width: 54px;
  height: 54px;
}

@keyframes tipPulse {
  from {
    box-shadow: 0 4px 14px rgba(var(--brand-dark-rgb), 0.12);
  }
  to {
    box-shadow: 0 8px 20px rgba(var(--brand-dark-rgb), 0.20);
  }
}

.icon-danger {
  border-color: #fecdca;
  color: #b42318;
}

.icon-action-dark {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
  color: #ffffff;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  min-width: 32px;
}

.icon-action-dark:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
  color: #ffffff;
}

.posologia-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.posologia-input[readonly] {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #ffffff;
  font-weight: 700;
  text-align: center;
}

.posologia-input:disabled {
  opacity: 0.9;
  cursor: not-allowed;
}

.therapy-end-output {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.therapy-end-output:disabled {
  opacity: 0.9;
  cursor: not-allowed;
}

@media (max-width: 1080px) {
  .posologia-therapy-table th:nth-child(1),
  .posologia-therapy-table td:nth-child(1) {
    width: 27%;
  }

  .posologia-therapy-table th:nth-child(2),
  .posologia-therapy-table td:nth-child(2) {
    width: 15%;
  }

  .posologia-therapy-table th:nth-child(3),
  .posologia-therapy-table td:nth-child(3) {
    width: 18%;
  }

  .posologia-therapy-table th:nth-child(4),
  .posologia-therapy-table td:nth-child(4) {
    width: 16%;
  }

  .posologia-therapy-table th:nth-child(5),
  .posologia-therapy-table td:nth-child(5) {
    width: 17%;
  }

  .posologia-therapy-table th:nth-child(6),
  .posologia-therapy-table td:nth-child(6) {
    width: 7%;
  }
}

@media (max-width: 980px) {
  .container {
    max-width: 100vw;
    margin: 16px auto 38px;
    padding-left: 8px;
    padding-right: 8px;
    gap: 16px;
  }

  .docs-page {
    max-width: 100vw;
    padding-left: 8px;
    padding-right: 8px;
  }

  .posologia-page-container {
    max-width: 100vw;
    margin: 12px auto 28px;
    padding-left: 0;
    padding-right: 0;
    gap: 14px;
  }

  .card {
    padding: 16px;
  }

  .table-wrap {
    border-radius: 12px;
    border: 1px solid #dbe6fb;
    box-shadow: inset 0 0 0 1px rgba(var(--brand-dark-rgb), 0.04);
  }

  .posologia-therapy-table {
    min-width: 1120px;
  }

  .magazzino-table {
    min-width: 1180px;
  }

  .posologia-table-wrap {
    min-height: 360px;
  }

  .magazzino-table-wrap {
    min-height: 320px;
  }

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

  .posologia-livebar {
    gap: 8px;
  }

  .posologia-livebar .badge {
    width: fit-content;
  }

  .posologia-search-stats {
    grid-template-columns: 1fr;
  }

  .posologia-therapy-table th:nth-child(1),
  .posologia-therapy-table td:nth-child(1) {
    width: 23%;
  }

  .posologia-therapy-table th:nth-child(2),
  .posologia-therapy-table td:nth-child(2) {
    width: 14%;
  }

  .posologia-therapy-table th:nth-child(3),
  .posologia-therapy-table td:nth-child(3) {
    width: 15%;
  }

  .posologia-therapy-table th:nth-child(4),
  .posologia-therapy-table td:nth-child(4) {
    width: 20%;
  }

  .posologia-therapy-table th:nth-child(5),
  .posologia-therapy-table td:nth-child(5) {
    width: 21%;
  }

  .posologia-therapy-table th:nth-child(6),
  .posologia-therapy-table td:nth-child(6) {
    width: 7%;
  }
}

@media (max-width: 980px) and (orientation: landscape) {
  .container {
    padding-left: 4px;
    padding-right: 4px;
  }
}

@media (max-width: 980px) and (orientation: portrait) {
  .posologia-landscape-tip.is-overlay {
    bottom: 14px;
    width: min(94vw, 420px);
  }
}

@media (max-width: 640px) {
  .docs-quick-nav {
    grid-template-columns: 1fr;
  }

  .posologia-page-container {
    margin: 10px auto 22px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .posologia-therapy-table {
    min-width: 1080px;
  }

  .magazzino-table {
    min-width: 1100px;
  }

  .posologia-table-wrap {
    min-height: 340px;
  }

  .magazzino-table-wrap {
    min-height: 300px;
  }

  .packs-control .input {
    width: 84px;
  }

  .input-date {
    min-width: 120px;
    width: 120px;
  }

  .posologia-therapy-table th:nth-child(1),
  .posologia-therapy-table td:nth-child(1) {
    width: 22%;
  }

  .posologia-therapy-table th:nth-child(2),
  .posologia-therapy-table td:nth-child(2) {
    width: 14%;
  }

  .posologia-therapy-table th:nth-child(3),
  .posologia-therapy-table td:nth-child(3) {
    width: 14%;
  }

  .posologia-therapy-table th:nth-child(4),
  .posologia-therapy-table td:nth-child(4) {
    width: 23%;
  }

  .posologia-therapy-table th:nth-child(5),
  .posologia-therapy-table td:nth-child(5) {
    width: 21%;
  }

  .posologia-therapy-table th:nth-child(6),
  .posologia-therapy-table td:nth-child(6) {
    width: 6%;
  }
}

.posologia-modal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.posologia-modal-content {
  width: min(1080px, 100%);
  animation: modal-rise 180ms ease-out;
}

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

.posologia-modal-title {
  margin: 4px 0 0;
  color: var(--fg);
  font-weight: 500;
}

.posologia-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.posologia-header-actions .icon-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.posologia-status-btn.is-ok {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.posologia-status-btn.is-warn {
  border-color: #fedf89;
  background: #fffaeb;
  color: #b54708;
}

.posologia-close-btn {
  border-color: var(--border);
  background: var(--surface);
  color: var(--fg);
}

.posologia-status-popover {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 0 12px;
  opacity: 0;
  transform: translateY(-6px);
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    max-height 180ms ease,
    padding 180ms ease,
    margin 180ms ease;
}

.posologia-status-popover.is-open {
  margin: 0 0 12px;
  padding: 10px 12px;
  opacity: 1;
  transform: translateY(0);
  max-height: 680px;
  pointer-events: auto;
}

.posologia-status-popover p {
  margin: 6px 0 0;
  font-size: 0.83rem;
}

.posologia-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.posologia-status-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 0.9rem;
  word-break: break-word;
  line-height: 1.35;
}

.posologia-status-controls {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.posologia-modal-left,
.posologia-modal-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.posologia-live-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.posologia-live-kpi {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px;
  background: var(--surface);
  display: grid;
  gap: 4px;
}

.posologia-live-kpi strong {
  font-size: 0.95rem;
  line-height: 1.2;
}

.posologia-kpi-context {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.posologia-kpi-context strong {
  display: block;
  margin-top: 4px;
  font-size: 0.92rem;
  line-height: 1.35;
  word-break: break-word;
}

.posologia-live-alert {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 10px 12px;
  font-size: 0.84rem;
  color: var(--muted);
}

.posologia-live-alert.is-success {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.posologia-live-alert.is-warn {
  border-color: #fedf89;
  background: #fffaeb;
  color: #b54708;
}

.posologia-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.posologia-meta strong {
  display: block;
  margin-top: 4px;
  font-size: 0.9rem;
  word-break: break-word;
  line-height: 1.35;
}

.posologia-profile-list ul {
  margin: 6px 0 0 16px;
  padding: 0;
  display: grid;
  gap: 4px;
}

.posologia-profile-list li {
  font-size: 0.88rem;
  line-height: 1.3;
}

.posologia-calc {
  margin-top: 8px;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #f8f9fb, #eef2f6);
}

.posologia-calc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.posologia-calc-options {
  background: var(--surface);
  border: 1px dashed var(--border);
  padding: 10px;
  border-radius: var(--r-sm);
}

.posologia-calc-details {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.posologia-calc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.posologia-calc-info strong {
  display: block;
  margin-top: 4px;
}

.badge-muted {
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--muted);
}

.posologia-hint {
  padding: 12px;
  border-radius: var(--r-sm);
  border: 1px dashed rgba(11, 13, 18, 0.12);
  background: var(--surface-2);
}

.posologia-hint strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.85rem;
}

.posologia-hint p {
  margin: 0 0 6px;
  font-size: 0.85rem;
}

.posologia-question {
  padding: 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: grid;
  gap: 10px;
}

.posologia-question-fade {
  opacity: 0;
  transform: translateY(-6px);
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  margin: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    max-height 180ms ease,
    padding 180ms ease,
    margin 180ms ease,
    border-width 180ms ease;
}

.posologia-question-fade.is-open {
  opacity: 1;
  transform: translateY(0);
  max-height: 260px;
  pointer-events: auto;
  padding: 12px;
  border-width: 1px;
  margin: 0;
}

.posologia-question h4 {
  margin: 0;
  font-size: 0.9rem;
}

.posologia-question p {
  margin: 0;
  font-size: 0.85rem;
}

.form-grid-dose-mult {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 10px;
}

.posologia-multiplier {
  align-self: center;
  justify-self: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--fg);
  padding-bottom: 8px;
}

.posologia-oxygen-summary {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.posologia-oxygen-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 0.92rem;
}

.posologia-helper {
  margin-top: -4px;
}

.weekday-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.weekday {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.weekday input {
  accent-color: var(--brand-dark);
}

.magazzino-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.mag-opportunity-actions {
  margin-top: -2px;
  margin-bottom: 10px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--r-md);
  background: #f8fbff;
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mag-opportunity-actions .btn {
  min-height: 32px;
}

.mag-opportunity-actions .material-symbols-outlined {
  font-size: 18px;
}

.magazzino-toolbar .search-field {
  flex: 1 1 520px;
}

.magazzino-toolbar select.input {
  width: auto;
  min-width: 200px;
}

.magazzino-table {
  table-layout: fixed;
  width: 100%;
  min-width: 1180px;
}

.magazzino-table th,
.magazzino-table td {
  vertical-align: top;
  font-size: 0.8rem;
}

.magazzino-table th:nth-child(1),
.magazzino-table td:nth-child(1) {
  width: 27%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.magazzino-table th:nth-child(2),
.magazzino-table td:nth-child(2) {
  width: 18%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.magazzino-table th:nth-child(3),
.magazzino-table td:nth-child(3) {
  width: 10%;
  text-align: center;
  white-space: nowrap;
}

.magazzino-table th:nth-child(4),
.magazzino-table td:nth-child(4) {
  width: 13%;
  text-align: center;
  white-space: nowrap;
}

.magazzino-table th:nth-child(5),
.magazzino-table td:nth-child(5) {
  width: 11%;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.magazzino-table th:nth-child(6),
.magazzino-table td:nth-child(6) {
  width: 11%;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.magazzino-table th:nth-child(7),
.magazzino-table td:nth-child(7) {
  width: 10%;
  text-align: center;
  white-space: nowrap;
}

.magazzino-table tr.is-selected td {
  background: var(--surface-3);
}

.magazzino-table td.mag-actions-cell {
  white-space: normal;
  vertical-align: middle;
}

.magazzino-table td:nth-child(5) strong,
.magazzino-table td:nth-child(6) strong {
  display: block;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.28;
}

.magazzino-table td.mag-actions-cell .icon-button {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
  color: #ffffff;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  min-width: 34px;
  margin: 0 2px;
}

.magazzino-table td.mag-actions-cell .icon-button:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
  color: #ffffff;
}

.magazzino-table td.mag-actions-cell .icon-button .material-symbols-outlined {
  font-size: 1.08rem;
}

.fab-table-wrap {
  min-height: 360px;
}

.fab-table {
  table-layout: fixed;
  width: 100%;
  min-width: 1260px;
}

.fab-table th,
.fab-table td {
  vertical-align: top;
  font-size: 0.8rem;
}

.fab-table th:nth-child(1),
.fab-table td:nth-child(1) {
  width: 27%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.fab-table th:nth-child(2),
.fab-table td:nth-child(2) {
  width: 22%;
}

.fab-table th:nth-child(3),
.fab-table td:nth-child(3) {
  width: 12%;
  text-align: center;
}

.fab-table th:nth-child(4),
.fab-table td:nth-child(4) {
  width: 12%;
  text-align: center;
}

.fab-table th:nth-child(5),
.fab-table td:nth-child(5) {
  width: 12%;
  text-align: center;
}

.fab-table th:nth-child(6),
.fab-table td:nth-child(6) {
  width: 10%;
  text-align: center;
}

.fab-table th:nth-child(7),
.fab-table td:nth-child(7) {
  width: 5%;
  text-align: center;
}

.fab-table td .btn-xs {
  margin-top: 6px;
}

.fab-table td:nth-child(6) .table-desc {
  margin-top: 4px;
}

.fab-excess-positive {
  color: #b54708;
  font-weight: 700;
}

.fab-excess-shortage {
  color: #b42318;
  font-weight: 700;
}

.fab-excess-neutral {
  color: var(--muted);
}

.fab-date-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
  flex: 1 1 240px;
  min-height: 32px;
}

.fab-date-inline .input-date {
  min-width: 180px;
  width: 100%;
  max-width: 260px;
}

.fab-modal-content {
  width: min(860px, 100%);
}

.mag-search-panel {
  margin-top: 12px;
}

.search-loading {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.search-loading .spin {
  animation: spin 0.9s linear infinite;
}

.mag-search-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}

.mag-search-item:hover {
  background: var(--surface-3);
}

.mag-search-item.is-selected {
  border-color: rgba(var(--brand-dark-rgb), 0.25);
  background: rgba(var(--brand-dark-rgb), 0.08);
}

.mag-search-main {
  color: var(--text-color);
}

.mag-search-main strong {
  font-weight: 800;
}

.mag-search-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.mag-search-item .actions-inline {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.magazzino-kpi {
  padding: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: grid;
  gap: 6px;
}

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

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

.advanced-inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 8px 10px;
}

.advanced-inline-check input[type="checkbox"] {
  accent-color: var(--brand-dark);
  width: 16px;
  height: 16px;
}

.advanced-help {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 12px;
}

.advanced-help strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.example-intro-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 2px;
}

.example-intro-item {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.example-intro-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  line-height: 1.3;
}

.example-intro-title .material-symbols-outlined {
  font-size: 17px;
  color: var(--brand-dark);
}

.advanced-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.advanced-current-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 14px;
  min-height: 124px;
}

.advanced-current-head {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.advanced-current-name {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
}

.advanced-current-desc {
  color: var(--muted);
  font-size: 0.85rem;
}

.advanced-current-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.advanced-current-chip {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 8px 10px;
  display: grid;
  gap: 4px;
}

.advanced-current-chip .muted {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.advanced-current-chip .material-symbols-outlined {
  font-size: 16px;
  color: var(--brand-dark);
}

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

.detail-sections {
  display: grid;
  gap: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.detail-pair {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.detail-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.detail-label .material-symbols-outlined {
  font-size: 16px;
  color: var(--brand-dark);
}

.detail-value {
  font-weight: 700;
  line-height: 1.35;
}

.detail-section-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.detail-section-title .material-symbols-outlined {
  font-size: 18px;
  color: var(--brand-dark);
}

.adv-kpi-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.adv-kpi-label .material-symbols-outlined {
  font-size: 16px;
  color: var(--brand-dark);
}

[data-adv-normalized-all] {
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.card-header-tight {
  margin-bottom: 8px;
  align-items: center;
}

.eq-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

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

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

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

.eq-item {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 10px 12px;
  display: grid;
  gap: 10px;
}

.eq-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.eq-item-name {
  font-weight: 800;
  line-height: 1.3;
}

.eq-item-pack {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.84rem;
}

.eq-item-meta {
  display: grid;
  gap: 4px;
  font-size: 0.84rem;
}

.eq-saving {
  font-weight: 700;
}

.eq-saving.gain {
  color: #067647;
}

.eq-saving.loss {
  color: #b42318;
}

.eq-saving.neutral {
  color: var(--muted);
}

.eq-active {
  color: var(--brand-dark);
}

.eq-empty {
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 10px 12px;
}

.decode-summary {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 10px 12px;
}

.decode-summary .feature-list {
  margin: 0;
}

.quick-examples-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.quick-example-btn {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

.quick-example-btn:hover,
.quick-example-btn:focus-visible {
  border-color: var(--brand-dark);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.quick-example-label {
  font-weight: 700;
  color: var(--text);
}

.quick-example-hint {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.spec-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.spec-overview-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.spec-overview-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.spec-overview-head .material-symbols-outlined {
  font-size: 16px;
  color: var(--brand-dark);
}

.spec-overview-value {
  font-weight: 800;
  line-height: 1.35;
}

.spec-overview-note {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.spec-contracts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.spec-contract-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.spec-contract-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
}

.spec-contract-head .material-symbols-outlined {
  color: var(--brand-dark);
  font-size: 18px;
}

.spec-contract-subtitle {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
  margin-top: 2px;
}

.spec-contract-main {
  font-weight: 800;
  line-height: 1.35;
}

.spec-contract-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.summary-rich-list li {
  line-height: 1.45;
  word-break: break-word;
}

.summary-rich-list strong {
  color: var(--text);
}

.detail-value-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.detail-value-list li {
  line-height: 1.35;
}

.detail-note {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.format-groups {
  display: grid;
  gap: 12px;
}

.format-group {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 10px 12px;
  display: grid;
  gap: 10px;
}

.format-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.examples-ux .search-panel,
.examples-ux .advanced-current-card,
.examples-ux .format-group,
.examples-ux .eq-item,
.examples-ux .detail-pair {
  min-width: 0;
}

.examples-ux .search-title,
.examples-ux .search-meta,
.examples-ux .advanced-current-desc,
.examples-ux .eq-item-pack,
.examples-ux .eq-item-meta,
.examples-ux .detail-value {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.examples-ux .search-list {
  max-height: min(52vh, 420px);
  overflow: auto;
}

.examples-ux .search-empty {
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 10px 12px;
}

.examples-ux .example-quick-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.examples-ux .example-quick-pick {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.84rem;
  line-height: 1;
  cursor: pointer;
}

.examples-ux .example-quick-pick:hover,
.examples-ux .example-quick-pick:focus-visible {
  background: var(--surface-3);
}

.examples-ux .search-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.examples-ux .example-command-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.examples-ux .example-command-cluster .btn {
  min-height: 38px;
}

.examples-ux .muted[role="status"] {
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 10px 12px;
}

.btn.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.btn.is-loading .material-symbols-outlined {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .example-intro-grid {
    grid-template-columns: 1fr;
  }

  .examples-ux .posologia-livebar {
    position: sticky;
    top: calc(var(--header-h) + 8px);
    z-index: 14;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .examples-ux .example-command-cluster {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .examples-ux .example-command-cluster .btn {
    width: 100%;
    min-height: 42px;
  }

  .examples-ux .card-header {
    gap: 10px;
  }

  .examples-ux .card-title {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .examples-ux .card-title .badge {
    width: fit-content;
    max-width: 100%;
  }

  .examples-ux .advanced-current-grid,
  .examples-ux .eq-kpis,
  .examples-ux .portal-note-grid {
    grid-template-columns: 1fr;
  }

  .examples-ux .search-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .examples-ux .search-insert-btn {
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    min-height: 38px;
  }

  .examples-ux .eq-item-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .examples-ux .eq-item-meta span {
    display: block;
    line-height: 1.4;
  }

  .portal-page .json-preview {
    border-radius: 14px;
    font-size: 0.75rem;
    padding: 12px;
  }

  .examples-ux .example-quick-picks,
  .examples-ux .search-panel-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .examples-ux .example-quick-pick {
    width: 100%;
    text-align: left;
  }

  .fab-table {
    min-width: 1320px;
  }

  .fab-table-wrap {
    min-height: 340px;
  }

  .fab-date-inline {
    width: 100%;
    justify-content: space-between;
  }

  .mag-opportunity-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mag-opportunity-actions .btn {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .examples-ux .card {
    padding: 14px;
  }

  .examples-ux .example-command-cluster {
    grid-template-columns: minmax(0, 1fr);
  }

  .magazzino-table {
    min-width: 1040px;
  }

  .mag-opportunity-actions {
    padding: 10px;
  }

  .fab-table {
    min-width: 1360px;
  }

  .fab-date-inline .input-date {
    min-width: 124px;
    width: 124px;
  }
}

@media (max-width: 1100px) {
  .advanced-filter-grid {
    grid-template-columns: 1fr 1fr;
  }
  .advanced-actions {
    justify-content: flex-start;
  }

  .detail-kpis {
    grid-template-columns: minmax(0, 1fr);
  }

  .price-controls {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .advanced-filter-grid {
    grid-template-columns: 1fr;
  }
}

.badge-success {
  background: #ecfdf3;
  border-color: #abefc6;
  color: #067647;
}

.badge-warn {
  background: #fffaeb;
  border-color: #fedf89;
  color: #b54708;
}

.badge-danger {
  background: #fef3f2;
  border-color: #fecdca;
  color: #b42318;
}

.dose-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.75rem;
}

.field-inline {
  display: flex;
  gap: 10px;
  align-items: center;
}

.toolbar .field-inline {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  background: var(--surface);
  font-size: 0.82rem;
}

.toolbar .field-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

.stack {
  display: grid;
  gap: 10px;
}

.dialog-actions {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dialog-actions-start {
  justify-content: flex-start;
}

.posologia-dialog-actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #ffffff 35%);
  padding-top: 14px;
  margin-top: 28px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
  gap: 12px;
}

.posologia-dialog-actions [data-posologia-cancel] {
  min-width: 120px;
}

.posologia-dialog-actions [data-posologia-save] {
  min-width: 190px;
  box-shadow: var(--shadow-sm);
}

.posologia-actions {
  display: grid;
  gap: 6px;
}

.posologia-actions .btn {
  justify-content: flex-start;
  width: 100%;
}

.posologia-actions .material-symbols-outlined {
  font-size: 1.05rem;
}

@keyframes modal-rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.text-right {
  text-align: right;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.mini-table th,
.mini-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  font-size: 0.82rem;
  vertical-align: top;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-table th {
  font-weight: 650;
  color: var(--muted);
}

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: grid;
  gap: 10px;
  z-index: 40;
  width: min(560px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: toast-in 160ms ease-out;
}

.toast .icon {
  font-size: 1.1rem;
  line-height: 1.1rem;
  margin-top: 1px;
  color: var(--muted);
}

.toast strong {
  font-size: 0.9rem;
}

.toast p {
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--muted);
}

.toast.toast-success {
  border-color: #abefc6;
}

.toast.toast-warn {
  border-color: #fedf89;
}

.toast.toast-danger {
  border-color: #fecdca;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 861px) {
  .posologia-livebar {
    position: static;
    top: auto;
    z-index: auto;
  }
}

@media (max-width: 980px) {
  .posologia-modal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .admin-auth-shell {
    grid-template-columns: 1fr;
  }

  .posologia-live-kpis {
    grid-template-columns: 1fr;
  }

  .posologia-kpi-context {
    grid-template-columns: 1fr;
  }

  .posologia-oxygen-summary {
    grid-template-columns: 1fr;
  }

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

  .posologia-multiplier {
    padding-bottom: 0;
  }

  .posologia-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .posologia-dialog-actions .btn {
    width: 100%;
  }
}

.articles-page {
  display: grid;
  gap: 16px;
}

.articles-hero h1 {
  margin: 0 0 8px;
}

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

.article-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.article-card-link {
  display: grid;
  grid-template-rows: 180px auto;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.article-cover {
  background: #f4f6fb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #fff;
}

.article-cover-placeholder .material-symbols-outlined {
  font-size: 42px;
  color: #6b7280;
}

.article-body {
  padding: 14px 14px 16px;
  display: grid;
  gap: 8px;
}

.article-body h2 {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.35;
}

.article-body p {
  margin: 0;
  color: var(--muted);
}

.article-meta-line {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
}

.article-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.article-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #d8dee9;
  background: #f8fafc;
  color: #334155;
  font-size: 0.78rem;
}

.articles-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.article-page-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.article-page-link,
.article-page-nav {
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  color: #111827;
  background: #fff;
  font-size: 0.9rem;
}

.article-page-link.is-active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.article-page-nav.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.article-detail-page {
  display: grid;
  gap: 12px;
}

.article-breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.9rem;
  color: #64748b;
}

.article-breadcrumb a {
  color: #0f172a;
  text-decoration: none;
}

.article-detail-head h1 {
  margin: 0 0 8px;
}

.article-detail-meta {
  margin: 0 0 10px;
  color: #64748b;
  font-size: 0.9rem;
}

.article-detail-cover {
  margin: 6px 0 14px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f8fafc;
}

.article-detail-cover img {
  width: 100%;
  display: block;
  max-height: 520px;
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.article-detail-content {
  margin-top: 14px;
  color: #0f172a;
  line-height: 1.65;
}

.article-detail-content h2,
.article-detail-content h3 {
  margin-top: 20px;
  margin-bottom: 8px;
}

.article-detail-content p {
  margin: 0 0 12px;
}

.article-detail-content a[target="_blank"]::after,
.card a[target="_blank"]:not(.btn):not(.article-card-link):not(.article-page-link):not(.article-page-nav):not(.share-btn)::after {
  content: " ↗";
  font-size: 0.82em;
}

.article-detail-content ul {
  margin: 0 0 14px;
  padding-left: 22px;
}

.article-detail-content code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.9em;
}

.article-share {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

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

.article-share-actions a {
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  color: #0f172a;
  background: #fff;
  font-size: 0.88rem;
}

.article-share-actions .share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.article-share-actions .share-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  text-transform: uppercase;
}

.article-share-actions .share-x .share-icon {
  background: #111827;
}

.article-share-actions .share-linkedin .share-icon {
  background: #0a66c2;
}

.article-share-actions .share-facebook .share-icon {
  background: #1877f2;
}

.article-share-actions .share-whatsapp .share-icon {
  background: #25d366;
}

.article-share-actions .share-telegram .share-icon {
  background: #229ed9;
}

.article-share-actions .share-copy .share-icon {
  background: #475569;
}

@media (max-width: 1100px) {
  .articles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }

  .articles-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .article-page-nav {
    text-align: center;
  }
}

@media (max-width: 900px) {
  .brand span {
    max-width: calc(100vw - 132px);
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

