:root {
  /* -------------------------------------------------
     THEME CORE (RGB ONLY)
     Regola: il colore base sta qui; l’alpha resta nei template.
     La scelta del tema avviene via:
       document.documentElement.dataset.amTheme = "p" | "d"
  ------------------------------------------------- */

  /* DEFAULT: paper */
  --am-bg-rgb: 255,255,255;
  --am-fg-rgb: 0,0,0;
  --am-fg-wrt-rgb: 255,
  /* link base (può divergere dal fg in temi futuri) */
  --am-link-rgb: var(--am-fg-rgb);

  /* convenience */
  --am-bg: rgb(var(--am-bg-rgb));
  --am-fg: rgb(var(--am-fg-rgb));
  --am-link: rgb(var(--am-link-rgb));

  /* typography */
  --am-font-serif: ui-serif, Georgia, 'Times New Roman', Times, serif;
  --am-font-sans: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  /* effects */
  --am-blur-backdrop: blur(6px);
  --am-shadow-soft: 0 0 22px rgba(var(--am-fg-rgb), 0.10);
}

/* DARK */
:root[data-am-theme="d"] {
  --am-bg-rgb: 0,0,0;
  --am-fg-rgb: 255,255,255;
  --am-link-rgb: var(--am-fg-rgb);
  --am-audio-ui-filter: invert(1) hue-rotate(180deg); 
   .wrfb { color: rgb(180, 195, 255); }
}

/* Applica i colori agli option solo se il tema "d" è attivo sull'elemento radice */
:root[data-am-theme="d"] option {
  background-color: rgb(var(--am-bg-rgb));
  color: rgb(var(--am-fg-rgb));
}

/* PAPER */
:root[data-am-theme="p"] {
  --am-bg-rgb: 255,255,255;
  --am-fg-rgb: 0,0,0;
  --am-link-rgb: var(--am-fg-rgb);
  --am-audio-ui-filter: invert(1) hue-rotate(180deg);
    .wrfb { color: rgb(0, 51, 255); }
}

/* PERSPECTIVE micro breathing (scale + opacity) */
#amUixNavProfBadge, .pro-act  {
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  animation: amProfBreath 10s ease-in-out infinite;
}

@keyframes amProfBreath{
  0%   { transform: translateZ(0) scale(1);     opacity: .78; }
  50%  { transform: translateZ(0) scale(1.035); opacity: .96; }
  100% { transform: translateZ(0) scale(1);     opacity: .78; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  #amUixNavProfBadge{ animation: none; }
}

  @keyframes amGhost {
    0%   { opacity: 0.00; transform: translate(-50%,-50%) scale(0.98); }
    35%  { opacity: 0.10; transform: translate(-50%,-50%) scale(1.00); }
    50%  { opacity: 0.14; transform: translate(-50%,-50%) scale(1.01); }
    70%  { opacity: 0.08; transform: translate(-50%,-50%) scale(1.00); }
    100% { opacity: 0.00; transform: translate(-50%,-50%) scale(0.98); }
  }

  @keyframes ghostFade {
      0%   { opacity: 0.05; transform: scale(0.1); }
      20%  { opacity: 0.35; transform: scale(0.9); }
      40%  { opacity: 0.85; transform: scale(0.99); }
      50%  { opacity: 0.95; transform: scale(1.01); }
      65%  { opacity: 0.85; transform: scale(1); }
      85%  { opacity: 0.45; transform: scale(0.99); }
      100% { opacity: 0.05; transform: scale(0.3); }
    }

  @keyframes amFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @keyframes amPulseHighlight {
    0%   { box-shadow: 0 0 0 rgba(0,0,0,0); }
    50%  { box-shadow: 0 0 18px rgba(255,180,0,0.65); }
    100% { box-shadow: 0 0 0 rgba(0,0,0,0); }
  }

  .am-appear {
    animation: amFadeIn 350ms ease forwards;
  }

  .am-blink {
    animation: amPulseHighlight 900ms ease 3;
  }

  .amSwitch { font-family: var(--am-font-serif); font-size: 14px; }
  .pro-ico { font-family: var(--am-font-serif); font-size: 20px; }

  .wrfb { font-family: var(--am-font-serif); font-style: oblique; }

  #ttHomePill {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 9997;
  width: 52px;
  height: 52px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  cursor: pointer;
  border: 1.5px solid rgba(128, 128, 128, 0.42);
  background: rgba(var(--am-fg-rgb), 0.92);
  color: rgba(var(--am-bg-rgb), 0.95);
  box-shadow: var(--am-shadow-soft);
  backdrop-filter: var(--am-blur-backdrop);
  opacity: 0.92;
  transition: opacity 160ms ease, border-color 160ms ease, transform 160ms ease;
}

#ttHomePill:hover {
  opacity: 1;
}

#ttHomePill.is-authenticated {
  border-color: rgba(46, 160, 67, 0.78);
}

#ttHomePill.is-guest {
  border-color: rgba(140, 140, 140, 0.48);
}

#ttHomePillIcon {
  display: block;
  line-height: 1;
  font-size: 19px;
  transform: translateY(-0.5px);
  font-family: var(--am-font-serif);
}

#ttBackPill {
  position: fixed;
  top: 20px;
  left: 83px;
  z-index: 9997;
  width: 46px;
  height: 46px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  cursor: pointer;
  border: 1px solid rgba(128, 128, 128, 0.28);
  background: rgba(var(--am-bg-rgb), 0.78);
  color: rgba(var(--am-fg-rgb), 0.92);
  box-shadow: var(--am-shadow-soft);
  backdrop-filter: var(--am-blur-backdrop);
  -webkit-backdrop-filter: var(--am-blur-backdrop);
  opacity: 0.9;
  transition: opacity 160ms ease, border-color 160ms ease, transform 160ms ease;
}

#ttBackPill:hover {
  opacity: 1;
}

#ttBackPillIcon {
  display: block;
  line-height: 1;
  font-size: 20px;
  transform: translateY(-1px);
  font-family: var(--am-font-serif);
}

@media (max-width: 640px) {
  #ttBackPill {
    top: 22px;
    left: 75px;
    width: 42px;
    height: 42px;
  }

  #ttBackPillIcon {
    font-size: 18px;
  }
  
  #amThemeSwitch {
    top: 22px !important;
    right: 17px !important;
  }

}

#ttAppHeader {
  position: fixed;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 9995;
  pointer-events: none;
}

#ttAppHeaderInner {
  min-height: 66px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 78px;
  box-sizing: border-box;
  background: rgba(var(--am-bg-rgb), 0.58);
  border: 1px solid rgba(var(--am-fg-rgb), 0.10);
  box-shadow: var(--am-shadow-soft);
  backdrop-filter: var(--am-blur-backdrop);
  -webkit-backdrop-filter: var(--am-blur-backdrop);
}

#ttAppHeaderTitle {
  text-align: center;
  line-height: 1;
  font-family: var(--am-font-serif);
  font-size: 22px;
  letter-spacing: 0.02em;
  opacity: 0.50;
  font-stretch: extra-expanded;
}

#ttAppHeaderTitleWrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
}

#ttAppHeaderTitleLogo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  transform: translate(-50%, -50%);
  object-fit: contain;
  opacity: 0.30;
  pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(var(--am-fg-rgb), 0.06));
}

.tt-tap2-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.tt-tap2-hero-media {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  overflow: hidden;
  flex: 0 0 96px;
  border: 1px solid rgba(var(--am-fg-rgb), .10);
  box-shadow: var(--am-shadow-soft);
  background: rgba(var(--am-fg-rgb), .03);
  animation: ttTap2HeroPulse 4.6s ease-in-out infinite;
}

.tt-tap2-hero-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.tt-tap2-hero-text {
  min-width: 0;
  flex: 1 1 240px;
}

.tt-tap2-hero-text .tt-hosted-title {
  margin-top: 0;
  margin-bottom: 0;
}

@keyframes ttTap2HeroPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(var(--am-fg-rgb), .00);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 0 8px rgba(var(--am-fg-rgb), .04);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(var(--am-fg-rgb), .00);
  }
}

/* Variante compatta quando la GIF è usata nel titolo/header globale */
#ttAppHeaderTitleWrap .tt-tap2-hero-media {
  width: 72px;
  height: 72px;
  flex-basis: 72px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .tt-tap2-hero {
    gap: 14px;
  }

  .tt-tap2-hero-media {
    width: 78px;
    height: 78px;
    flex-basis: 78px;
  }

  #ttAppHeaderTitleWrap .tt-tap2-hero-media {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }
}

#ttAppHeaderTitle {
  position: relative;
  z-index: 1;
}

#ttAppFooter {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 9995;
  pointer-events: none;
}

#ttAppFooterInner {
  min-height: 30px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 14px;
  box-sizing: border-box;
  background: rgba(var(--am-bg-rgb), 0.52);
  border: 1px solid rgba(var(--am-fg-rgb), 0.08);
  box-shadow: var(--am-shadow-soft);
  backdrop-filter: var(--am-blur-backdrop);
  -webkit-backdrop-filter: var(--am-blur-backdrop);
  font-size: 12px;
  line-height: 1;
  opacity: 0.82;
}

#ttPageContent {
  position: relative;
  z-index: 1;
  padding-top: 92px;
  padding-bottom: 54px;
  box-sizing: border-box;
}

#ttHomePill {
  top: 17px;
  left: 17px;
}

#amThemeSwitch {
  top: 20px !important;
  right: 17px !important;
}

@media (max-width: 640px) {
  #ttAppHeaderInner {
    min-height: 60px;
    padding-left: 66px;
    padding-right: 66px;
  }

  #ttAppHeaderLogo {
    width: 28px;
    height: 28px;
  }

  #ttAppHeaderTitle {
    font-size: 18px;
  }

  #ttAppHeaderTitleLogo {
    width: 52px;
    height: 52px;
  }

  #ttPageContent {
    padding-top: 84px;
    padding-bottom: 52px;
  }

  #ttAppFooterInner {
    font-size: 11px;
  }
}

:root[data-am-theme="d"] .wrfb {
  color: rgb(180, 195, 255);
}

:root[data-am-theme="p"] .wrfb {
  color: rgb(0, 51, 255);
}

.tt-page-flash-wrap {
  padding: 0 24px 18px 24px;
  box-sizing: border-box;
}

.tt-msg {
  padding: 12px 14px;
  border: 1px solid rgba(var(--am-fg-rgb), .18);
  border-radius: 14px;
  line-height: 1.45;
  box-sizing: border-box;
}

.tt-msg-info {
  background: rgba(var(--am-fg-rgb), .04);
  opacity: .88;
}

.tt-msg-success {
  border-color: rgba(46, 160, 67, .42);
  background: rgba(46, 160, 67, .10);
}

.tt-msg-error {
  border-color: rgba(180, 35, 24, .42);
  background: rgba(180, 35, 24, .10);
}

.tt-admin-page {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-sizing: border-box;
}

.tt-admin-page--narrow {
  max-width: 720px;
}

.tt-admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.tt-admin-head-title {
  margin: 0 0 8px 0;
}

.tt-admin-head-subtitle {
  margin: 0;
  opacity: .78;
}

.tt-btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 999px;
  text-decoration: none;
  box-sizing: border-box;
}

.tt-btn-pill--primary {
  background: rgba(var(--am-fg-rgb), .92);
  color: rgba(var(--am-bg-rgb), .96);
  border: 0;
  cursor: pointer;
}

.tt-btn-pill--secondary {
  border: 1px solid rgba(var(--am-fg-rgb), .18);
  color: inherit;
  background: transparent;
}

.tt-btn-pill--logout {
  border: 1px solid rgba(249, 59, 49, 0.92);
  background: rgba(213, 131, 126, 0.92);
  color: inherit;
  cursor: pointer;
}

.tt-btn-pill--danger {
  background: rgba(180, 35, 24, .92);
  color: #fff;
  border: 1px solid rgba(180, 35, 24, .92);
  cursor: pointer;
}

.tt-form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tt-config-section {
  padding: 16px;
  border: 1px solid rgba(var(--am-fg-rgb), .14);
  border-radius: 18px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tt-service-contract-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tt-service-contract-group[hidden] {
  display: none !important;
}

.tt-config-section--access {
  background: rgba(var(--am-fg-rgb), .035);
}

.tt-config-section-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tt-config-section-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.tt-config-section-subtitle {
  margin: 0;
  opacity: .74;
  font-size: 13px;
  line-height: 1.45;
}

.tt-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tt-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(var(--am-fg-rgb), .18);
  background: transparent;
  color: inherit;
  box-sizing: border-box;
}

.tt-checkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tt-bounded-toggle-wrap[hidden],
.tt-bounded-config-wrap[hidden] {
  display: none !important;
}

.tt-bounded-config-wrap {
  padding: 14px;
  border: 1px solid rgba(var(--am-fg-rgb), .10);
  border-radius: 16px;
  background: rgba(var(--am-fg-rgb), .025);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tt-bounded-map-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tt-bounded-map {
  width: 100%;
  height: 320px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(var(--am-fg-rgb), .14);
  background: rgba(var(--am-fg-rgb), .04);
}

.tt-bounded-map-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  opacity: .74;
}

.tt-bounded-map-fallback {
  padding: 12px 14px;
  border: 1px solid rgba(180, 35, 24, .22);
  border-radius: 14px;
  background: rgba(180, 35, 24, .07);
  font-size: 13px;
  line-height: 1.45;
}

.tt-bounded-coords-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(var(--am-fg-rgb), .14);
  background: rgba(var(--am-fg-rgb), .03);
  box-sizing: border-box;
  font-size: 13px;
  line-height: 1.2;
  word-break: break-word;
}

@media (max-width: 640px) {
  .tt-bounded-map {
    height: 280px;
  }
}

.tt-form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tt-form-actions--top-spaced {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(var(--am-fg-rgb), .08);
}

.tt-filters-panel {
  padding: 16px;
  border: 1px solid rgba(var(--am-fg-rgb), .4);
  border-radius: 18px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, .045);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    0 8px 22px rgba(var(--am-fg-rgb), .045);
}

:root[data-am-theme="d"] .tt-filters-panel {
  background: rgba(255, 255, 255, .075);
  border-color: rgba(var(--am-fg-rgb), .16);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 8px 22px rgba(0,0,0,.20);
}

.tt-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.tt-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 110px 24px 24px 24px;
  box-sizing: border-box;
}

.tt-auth-card {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tt-auth-head {
  text-align: center;
}

.tt-auth-title {
  margin: 0 0 8px 0;
  font-size: 30px;
}

.tt-auth-subtitle {
  margin: 0;
  opacity: .78;
}

.tt-table-wrap {
  overflow: auto;
  border: 0;
  border-radius: 18px;
}

.tt-table-wrap--top-spaced {
  margin-top: 14px;
}

.tt-admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  table-layout: fixed;
}

.tt-admin-table th,
.tt-admin-table td {
  text-align: left;
  padding: 14px;
  vertical-align: top;
  box-sizing: border-box;
}

.tt-admin-table thead th {
  border-bottom: 1px solid rgba(var(--am-fg-rgb), .16);
  padding-bottom: 12px;
  opacity: .78;
}

.tt-admin-table tbody tr {
  background: rgba(var(--am-bg-rgb), .86);
  box-shadow:
    inset 0 0 0 1px rgba(var(--am-fg-rgb), .14),
    0 8px 18px rgba(var(--am-fg-rgb), .045);
}

.tt-admin-table tbody td {
  border-top: 1px solid rgba(var(--am-fg-rgb), .14);
  border-bottom: 1px solid rgba(var(--am-fg-rgb), .14);
}

.tt-admin-table tbody td:first-child {
  border-left: 1px solid rgba(var(--am-fg-rgb), .14);
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
}

.tt-admin-table tbody td:last-child {
  border-right: 1px solid rgba(var(--am-fg-rgb), .14);
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

:root[data-am-theme="d"] .tt-admin-table tbody tr {
  background: rgba(255,255,255,.055);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.16),
    0 8px 18px rgba(0,0,0,.28);
}

:root[data-am-theme="d"] .tt-admin-table tbody td {
  border-color: rgba(255,255,255,.16);
}

:root[data-am-theme="d"] .tt-admin-table tbody td:first-child {
  border-left-color: rgba(255,255,255,.16);
}

:root[data-am-theme="d"] .tt-admin-table tbody td:last-child {
  border-right-color: rgba(255,255,255,.16);
}

.tt-cell-break {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.tt-col-actions {
  width: 128px;
}

.tt-action-icons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tt-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid rgba(var(--am-fg-rgb), .20);
  color: rgba(var(--am-fg-rgb), .92);
  background:
    linear-gradient(
      180deg,
      rgba(var(--am-bg-rgb), .98),
      rgba(var(--am-fg-rgb), .055)
    );
  box-sizing: border-box;
  font-size: 16px;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.42),
    0 7px 14px rgba(var(--am-fg-rgb), .10);
  transform: translateY(0);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    opacity 140ms ease;
}

.tt-icon-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.48),
    0 10px 18px rgba(var(--am-fg-rgb), .14);
}

.tt-icon-btn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 5px rgba(var(--am-fg-rgb), .14),
    0 3px 8px rgba(var(--am-fg-rgb), .08);
}

.tt-icon-btn--ok {
  border-color: rgba(46, 160, 67, .92);
  background:
    linear-gradient(
      180deg,
      rgba(46, 160, 67, .16),
      rgba(46, 160, 67, .055)
    );
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.44),
    0 7px 14px rgba(46, 160, 67, .16);
}

.tt-icon-btn--ko {
  border-color: rgba(180, 35, 24, .70);
  background:
    linear-gradient(
      180deg,
      rgba(180, 35, 24, .105),
      rgba(var(--am-fg-rgb), .035)
    );
  opacity: .68;
  filter: saturate(.72);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.34),
    0 5px 11px rgba(var(--am-fg-rgb), .075);
}

.tt-icon-btn--delete {
  border-color: rgba(180, 35, 24, .55);
  background:
    linear-gradient(
      180deg,
      rgba(180, 35, 24, .14),
      rgba(180, 35, 24, .045)
    );
}

.tt-unassigned-mark {
  color: rgb(180, 35, 24);
  font-weight: 700;
  display: inline-block;
}

.tt-muted-mark {
  color: rgba(128, 128, 128, .88);
  font-weight: 700;
  display: inline-block;
}

.tt-service-text {
  font-size: 12px;
  line-height: 1.35;
}

.tt-resource-file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.tt-resource-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--am-fg-rgb), .12);
  background: rgba(var(--am-fg-rgb), .04);
  flex: 0 0 28px;
}

.tt-resource-file-meta {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tt-resource-original-name {
  font-weight: 500;
}

.tt-resource-kind {
  font-size: 12px;
  opacity: .70;
}

.tt-resource-snippet {
  font-size: 13px;
  opacity: .82;
}

.tt-col-service-icon {
  width: 56px;
  text-align: center;
}

.tt-service-icon-box,
.tt-service-inline {
  display: inline-flex;
  align-items: center;
}

.tt-service-icon-box {
  justify-content: center;
}

.tt-service-inline {
  gap: 8px;
  min-width: 0;
}

.tt-col-service-icon {
  width: 84px;
  text-align: center;
}

.tt-service-icon-box,
.tt-service-inline {
  display: inline-flex;
  align-items: center;
}

.tt-service-icon-box {
  justify-content: center;
}

.tt-service-inline {
  gap: 10px;
  min-width: 0;
}

.tt-service-icon {
  width: 30px;
  height: 30px;
  display: inline-block;
  object-fit: cover;
  flex: 0 0 30px;
  vertical-align: middle;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(var(--am-fg-rgb), .10);
  background: rgba(var(--am-fg-rgb), .03);
}

.tt-service-icon--lg {
  width: 64px;
  height: 64px;
  flex-basis: 64px;
}

.tt-service-icon-placeholder {
  width: 64px;
  height: 64px;
  display: inline-block;
  border-radius: 999px;
  border: 1px solid rgba(var(--am-fg-rgb), .12);
  background: rgba(var(--am-fg-rgb), .04);
  opacity: .45;
}

.tt-service-inline-text {
  min-width: 0;
}

@media (max-width: 760px) {
  .tt-col-service-icon {
    width: 100%;
  }

  .tt-service-icon-box {
    justify-content: flex-end;
  }

  .tt-service-inline {
    justify-content: flex-end;
  }

  .tt-service-icon--lg,
  .tt-service-icon-placeholder {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }
}

.tt-col-id-compact {
  width: 56px;
  white-space: nowrap;
}

.tt-cell-id-compact {
  font-size: 12px;
  line-height: 1.2;
  opacity: .82;
}

.tt-col-check {
  width: 44px;
}

.tt-tag-check,
#ttCheckAllTags {
  width: 16px;
  height: 16px;
  accent-color: rgba(46, 160, 67, 1);
}

@media (max-width: 760px) {
  .tt-page-flash-wrap {
    padding: 0 16px 16px 16px;
  }

  .tt-admin-page {
    padding: 16px;
  }

  .tt-table-wrap {
    overflow: visible;
  }

  .tt-admin-table,
  .tt-admin-table thead,
  .tt-admin-table tbody,
  .tt-admin-table tr,
  .tt-admin-table th,
  .tt-admin-table td {
    display: block;
    width: 100%;
  }

  .tt-admin-table thead {
    display: none;
  }

  .tt-admin-table tbody tr {
    margin: 0 0 14px 0;
    border: 1px solid rgba(var(--am-fg-rgb), .18);
    border-radius: 18px;
    background: rgba(var(--am-bg-rgb), .90);
    box-shadow:
      0 8px 18px rgba(var(--am-fg-rgb), .045);
    overflow: hidden;
  }

  .tt-admin-table tbody tr:last-child {
    margin-bottom: 0;
  }

  :root[data-am-theme="d"] .tt-admin-table tbody tr {
    background: rgba(255,255,255,.055);
    border-color: rgba(255,255,255,.18);
    box-shadow:
      0 8px 18px rgba(0,0,0,.28);
  }

  .tt-admin-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 10px 14px;
    border: 0 !important;
    border-bottom: 1px solid rgba(var(--am-fg-rgb), .10) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .tt-admin-table td:last-child {
    border-bottom: 0 !important;
  }

  .tt-admin-table td::before {
    content: attr(data-label);
    flex: 0 0 84px;
    font-weight: 600;
    opacity: .78;
  }

  .tt-admin-table td > .tt-cell-value {
    flex: 1 1 auto;
    text-align: right;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .tt-col-actions {
    width: 100%;
  }

  .tt-col-actions .tt-action-icons {
    justify-content: flex-end;
  }
}

.tt-hosted-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.tt-hosted-main {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 24px 96px 24px;
  box-sizing: border-box;
}

.tt-hosted-card {
  border: 1px solid rgba(var(--am-fg-rgb), .12);
  border-radius: 24px;
  background: rgba(var(--am-bg-rgb), .72);
  box-shadow: var(--am-shadow-soft);
  backdrop-filter: var(--am-blur-backdrop);
  -webkit-backdrop-filter: var(--am-blur-backdrop);
  overflow: hidden;
}

.tt-hosted-media {
  border-bottom: 1px solid rgba(var(--am-fg-rgb), .08);
  background: rgba(var(--am-fg-rgb), .03);
}

.tt-hosted-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
}

.tt-hosted-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
}

.tt-hosted-title {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
  font-family: var(--am-font-serif);
  letter-spacing: 0.01em;
}

.tt-hosted-secondary {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  opacity: .74;
}

.tt-hosted-body {
  margin: 0;
  font-size: 16px;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.tt-hosted-cta-wrap {
  padding-top: 4px;
}

.tt-hosted-media-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tt-hosted-audio,
.tt-hosted-video {
  width: 100%;
  display: block;
}

.tt-hosted-empty {
  padding: 48px 28px;
  text-align: center;
  opacity: .74;
}

@media (max-width: 760px) {
  .tt-hosted-main {
    padding: 20px 16px 84px 16px;
  }

  .tt-hosted-content {
    padding: 22px 18px;
    gap: 16px;
  }

  .tt-hosted-title {
    font-size: 26px;
  }

  .tt-hosted-body {
    font-size: 15px;
    line-height: 1.66;
  }
}

.tt-icon-btn--nfc {
  border-color: rgba(46, 160, 67, .62);
  background:
    linear-gradient(
      180deg,
      rgba(46, 160, 67, .14),
      rgba(46, 160, 67, .045)
    );
}

:root[data-am-theme="d"] .tt-icon-btn {
  border-color: rgba(255,255,255,.22);
  color: rgba(255,255,255,.94);
  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,.10),
      rgba(255,255,255,.035)
    );
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.11),
    0 8px 16px rgba(0,0,0,.36);
}

:root[data-am-theme="d"] .tt-icon-btn:hover {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.15),
    0 11px 20px rgba(0,0,0,.44);
}

:root[data-am-theme="d"] .tt-icon-btn--ok {
  border-color: rgba(68, 190, 92, .86);
  background:
    linear-gradient(
      180deg,
      rgba(68, 190, 92, .18),
      rgba(68, 190, 92, .055)
    );
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    0 8px 16px rgba(46, 160, 67, .20);
}

:root[data-am-theme="d"] .tt-icon-btn--ko {
  border-color: rgba(220, 70, 58, .62);
  background:
    linear-gradient(
      180deg,
      rgba(220, 70, 58, .12),
      rgba(255,255,255,.03)
    );
  opacity: .62;
}

:root[data-am-theme="d"] .tt-icon-btn--delete {
  border-color: rgba(220, 70, 58, .68);
  background:
    linear-gradient(
      180deg,
      rgba(220, 70, 58, .16),
      rgba(220, 70, 58, .05)
    );
}

:root[data-am-theme="d"] .tt-icon-btn--nfc {
  border-color: rgba(68, 190, 92, .66);
  background:
    linear-gradient(
      180deg,
      rgba(68, 190, 92, .15),
      rgba(68, 190, 92, .045)
    );
}

.tt-icon-btn--nfc[hidden],
.tt-nfc-only[hidden] {
  display: none !important;
}

.tt-modal-open {
  overflow: hidden;
}

.tt-nfc-overlay {
  position: fixed;
  inset: 0;
  z-index: 10040;
}

.tt-nfc-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(var(--am-bg-rgb), .72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tt-nfc-modal {
  position: relative;
  width: min(520px, calc(100vw - 24px));
  margin: 110px auto 0 auto;
  padding: 18px;
  border-radius: 22px;
  box-sizing: border-box;
  border: 1px solid rgba(var(--am-fg-rgb), .14);
  background: rgba(var(--am-bg-rgb), .86);
  box-shadow: var(--am-shadow-soft);
  backdrop-filter: var(--am-blur-backdrop);
  -webkit-backdrop-filter: var(--am-blur-backdrop);
}

.tt-nfc-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(var(--am-fg-rgb), .16);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.tt-floating-nav-modal {
  width: min(420px, calc(100vw - 24px));
}

.tt-floating-nav-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tt-floating-nav-link {
  width: 100%;
  min-height: 48px;
}

.tt-floating-nav-link.tt-btn-pill--secondary {
  justify-content: flex-start;
}

.tt-floating-nav-link.tt-btn-pill--logout {
  justify-content: center;
}

.tt-nfc-hero {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 0 8px 0;
}

.tt-nfc-hero-gif {
  width: 88px;
  height: 88px;
  object-fit: contain;
  opacity: .55;
  pointer-events: none;
}

.tt-nfc-hero {
  padding: 8px 0 12px 0;
}

.tt-nfc-hero-gif {
  width: 92px;
  height: 92px;
  object-fit: cover;
  opacity: .75;
  pointer-events: none;

  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

/* leggero alone interno (come homepage ghost) */
.tt-nfc-hero-gif::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: radial-gradient(circle at center,
    rgba(0,0,0,0.00) 40%,
    rgba(0,0,0,0.18) 75%,
    rgba(0,0,0,0.45) 100%
  );
  pointer-events: none;
}

.tt-nfc-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.tt-nfc-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.tt-nfc-status {
  margin: 0;
  opacity: .82;
  line-height: 1.45;
}

.tt-nfc-status.is-pending {
  opacity: .82;
}

.tt-nfc-status.is-success {
  color: rgba(46, 160, 67, 1);
  opacity: 1;
}

.tt-nfc-status.is-error {
  color: rgba(180, 35, 24, 1);
  opacity: 1;
}

.tt-nfc-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid rgba(var(--am-fg-rgb), .10);
  border-radius: 16px;
  background: rgba(var(--am-fg-rgb), .03);
}

.tt-nfc-meta-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tt-nfc-meta-label {
  font-size: 12px;
  opacity: .68;
}

.tt-nfc-meta-value {
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .tt-nfc-modal {
    width: calc(100vw - 16px);
    margin-top: 88px;
    padding: 16px;
  }

  .tt-nfc-hero-gif {
    width: 74px;
    height: 74px;
  }

  .tt-nfc-title {
    font-size: 20px;
  }
}

.tt-active-mark {
  color: rgba(46,160,67,1);
  font-weight: 700;
}
