/* synced from shared/base @ 2026-11-13 — do not edit copies; run: node scripts/sync-shared-skin.mjs */
/**
 * Base unica per riccardolucca.com.
 * Sorgente: shared/base/base.css
 * Copia: npm run sync:skin
 *
 * Le regole di pagina valgono solo dentro .page, così le mappe
 * (LiveTT, LiveATV) prendono i token senza diventare una colonna.
 */

:root {
  color-scheme: light dark;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --ease: 0.15s ease;

  --bg: #f2f2f7;
  --surface: rgb(255 255 255 / 0.72);
  --surface-muted: rgb(255 255 255 / 0.5);
  --surface-hover: rgb(255 255 255 / 0.86);
  --border: rgb(0 0 0 / 0.08);
  --text: rgb(0 0 0 / 0.88);
  --muted: rgb(60 60 67 / 0.6);
  --accent: #0088ff;
  --accent-soft: #f4f4f5;
  --on-accent: #ffffff;
  --accent-fallback: var(--accent);
  --success: #15803d;
  --success-soft: #f0fdf4;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --warn: #a16207;
  --warn-soft: #fefce8;
  --track: #e4e4e7;
  --preview: #18181b;
  --scan: #71717a;

  --radius: 8px;
  --hit: 44px;
  --inset: 20px;
  --page: 40rem;
  --page-wide: 72rem;
  --shadow: none;
  --shadow-lg: none;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: rgb(28 28 31 / 0.86);
    --surface-muted: rgb(40 40 40 / 0.72);
    --surface-hover: rgb(70 70 70 / 0.62);
    --border: rgb(255 255 255 / 0.13);
    --text: #ffffff;
    --muted: rgb(235 235 245 / 0.6);
    --accent: #0091ff;
    --accent-soft: #27272a;
    --on-accent: #ffffff;
    --success: #4ade80;
    --success-soft: #052e16;
    --danger: #f87171;
    --danger-soft: #450a0a;
    --warn: #facc15;
    --warn-soft: #422006;
    --track: #27272a;
    --preview: #09090b;
    --scan: #a1a1aa;
  }
}

@media (max-width: 480px) {
  :root {
    --inset: 16px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
}

.page {
  width: min(100%, var(--page));
  margin: 0 auto;
  padding: max(16px, var(--safe-top)) var(--inset) calc(24px + var(--safe-bottom));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page.rl-wide {
  width: min(100%, var(--page-wide));
}

.page.credits-page {
  width: min(100%, 36rem);
}

.page img,
.page video,
.page canvas,
.page svg {
  max-width: 100%;
}

.page > main {
  flex: 1;
  min-width: 0;
}

a {
  color: inherit;
}

.site-header,
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--hit);
  margin-bottom: 16px;
}

.brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: 0;
  line-height: 1.2;
}

.brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-actions .btn-secondary,
.header-actions .btn-primary {
  flex: 0 0 auto;
}

.lede {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.875rem;
}

.tabs {
  display: flex;
  gap: 0;
  margin: 0 0 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  appearance: none;
  flex: 0 0 auto;
  margin: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  min-height: var(--hit);
  padding: 8px 16px;
  cursor: pointer;
  white-space: nowrap;
}

.tab:hover,
.tab.active {
  color: var(--text);
}

.tab.active {
  border-bottom-color: var(--text);
}

.tab:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-success:focus-visible,
.btn-danger:focus-visible,
.footer-link:focus-visible,
.back-link:focus-visible,
.brand:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.skip-link:focus {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: max(8px, var(--safe-top));
  left: 8px;
  z-index: 100000;
  padding: 10px 14px;
  background: var(--text);
  color: var(--bg);
  font-weight: 650;
  text-decoration: none;
  border-radius: var(--radius);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.panel {
  display: none;
  min-width: 0;
}

.panel.active {
  display: block;
}

.card {
  border-radius: 22px;
  padding: 16px;
  min-width: 0;
}

.card-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.split-controls,
.split-preview {
  min-width: 0;
  padding: 16px;
}

.split-preview {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
}

@media (min-width: 720px) {
  .card-split {
    grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  }

  .split-preview {
    border-top: 0;
    border-left: 1px solid var(--border);
  }
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  min-width: 0;
}

.card-meta span {
  font-size: 0.875rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page label,
.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.field {
  margin-bottom: 12px;
  min-width: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (min-width: 720px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

.page input[type="text"],
.page input[type="search"],
.page input[type="number"],
.page input[type="url"],
.page input[type="email"],
.page select,
.page textarea {
  width: 100%;
  min-height: var(--hit);
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.page textarea {
  min-height: 6rem;
  resize: vertical;
}

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

.actions > * {
  flex: 1 1 8rem;
}

.actions-full {
  margin-top: 8px;
}

.actions-full > * {
  flex-basis: 100%;
}

.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger {
  min-height: var(--hit);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-success:disabled,
.btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.site-footer {
  margin-top: auto;
  padding-top: 16px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 12px;
  padding: 6px 12px;
  border-radius: 22px;
}

.footer-link,
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
}

.footer-link:hover,
.back-link:hover {
  color: var(--text);
}

.modal,
.rl-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: max(16px, var(--safe-top)) 16px max(16px, var(--safe-bottom));
  background: rgba(0, 0, 0, 0.45);
}

.modal[hidden],
.rl-modal[hidden] {
  display: none;
}

.modal-card,
.rl-modal-card {
  width: min(100%, 24rem);
  max-height: min(100%, 85dvh);
  overflow: auto;
  padding: 16px;
  border-radius: 22px;
  color: var(--text);
}

.modal-card h2,
.rl-modal-card h2 {
  margin: 0 0 8px;
  font-size: 1.125rem;
}

.rl-modal-card ul,
.modal-card ul {
  margin: 0 0 16px;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.rl-modal-card li,
.modal-card li {
  margin-bottom: 6px;
}

.rl-modal-card kbd,
.modal-card kbd {
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 0.85em;
}

.credits-head h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0;
}

.credits-head .sub {
  margin: 4px 0 0;
  color: var(--muted);
}

.credits-section {
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

.credits-section h2 {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.credits-section p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.credits-section p:last-child {
  margin-bottom: 0;
}

.credits-section a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.credits-section strong {
  color: var(--text);
  font-weight: 650;
}

.credits-section ul {
  margin: 0 0 10px;
  padding-left: 1.2rem;
  color: var(--muted);
}

.credits-section li {
  margin: 0 0 8px;
}

.credits-section li:last-child {
  margin-bottom: 0;
}

.credits-section code {
  font-family: var(--mono);
  font-size: 0.85em;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Glisse su questa base. Le classi lg-* stanno in glisse.css, caricato prima. */

.site-header {
  padding: 8px 12px;
  border-radius: 22px;
}

.page .lg-segmented {
  display: flex;
  width: 100%;
  margin: 0 0 16px;
}

.page .lg-segmented .lg-tab,
.page .lg-segmented .lg-tab-copy {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  padding: 0 10px;
}

.header-actions .lg-segmented {
  width: auto;
  margin: 0;
  --lg-tab-width: 46px;
}

.header-actions .lg-segmented .lg-tab,
.header-actions .lg-segmented .lg-tab-copy {
  flex: none;
  width: 46px;
  padding: 0;
}

.lg-button {
  min-height: var(--hit);
  height: auto;
}

.lg-input {
  max-width: none;
  height: auto;
  min-height: var(--hit);
}

.lg-field {
  width: 100%;
  border-radius: 20px;
  padding: 0 14px;
}

.page .lg-field select,
.page .lg-field input,
.page .lg-input input,
.lg-field select,
.lg-field input,
.lg-input input {
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
}

.apps > .app {
  border: 0;
  border-radius: 28px;
}
