/*
 * Assistente Marco — foglio di stile pubblicato direttamente.
 * Le variabili definiscono i temi; seguono componenti, viste e adattamenti.
 * L’ordine delle regole conserva la cascata originale.
 */

/* Temi: colori, caratteri e ombre condivisi. */
:root {
  color-scheme: dark;
  --bg: #090e13;
  --panel: #10171e;
  --card: #131c24;
  --hover: #19242d;
  --line: #26333e;
  --ink: #edf2f5;
  --soft: #c5d0d9;
  --muted: #92a2b1;
  --green: #8bfa69;
  --green-bg: #1d3526;
  --green-ink: #13210c;
  --gold: #f5ce72;
  --gold-bg: #342d1d;
  --red: #ff8a85;
  --red-bg: #372324;
  --blue: #86c2f7;
  --shadow: 0 26px 80px #0007;
  --sans: 'Sora',system-ui,sans-serif;
  --mono: 'IBM Plex Mono',monospace;
}

html[data-tema=chiaro] {
  color-scheme: light;
  --bg: #f2f5f4;
  --panel: #fff;
  --card: #fff;
  --hover: #f0f4f2;
  --line: #ccd6d0;
  --ink: #192c24;
  --soft: #364c41;
  --muted: #53695d;
  --green: #287b37;
  --green-bg: #e0f2de;
  --green-ink: #fff;
  --gold: #805c08;
  --gold-bg: #f8efd7;
  --red: #b23232;
  --red-bg: #ffe9e6;
  --blue: #245f90;
  --shadow: 0 24px 70px #1932221c;
}

/* Regole di base, campi, tipografia e accessibilità. */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(ellipse at 85% 0,rgba(104,248,64,.035),transparent 40%),var(--bg);
  color: var(--ink);
  font: 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

body:after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFre\
quency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath filter='url(%23n)' opacity='.8' d='M0 0h100v100H0z'/%3E%3C/svg%3E");
}

[hidden] {
  display: none!important;
}

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

button {
  cursor: pointer;
  color: inherit;
}

button:disabled {
  opacity: .45;
  cursor: wait;
}

button,a,input,select,textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  touch-action: manipulation;
}

a {
  color: inherit;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}

input,select,textarea {
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
  padding: 12px 13px;
  width: 100%;
  font-size: 16px;
}

input[type=checkbox] {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.65;
}

h1,h2,h3,p {
  margin: 0;
}

h1 {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -1.3px;
  line-height: 1.2;
}

h2 {
  font-size: 21px;
  letter-spacing: -.5px;
}

h3 {
  font-size: 15px;
  font-weight: 600;
}

/* Marchio e utilità di presentazione. */
.svg-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.punta-sx {
  fill: var(--ink);
}

.punta-dx {
  fill: var(--green);
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -1px;
}

.brand-small {
  display: block;
  font: 9px/1.9 var(--mono);
  letter-spacing: 1.5px;
  color: var(--muted);
}

.eyebrow,.nav-label {
  font: 10px/1.5 var(--mono);
  letter-spacing: 1.8px;
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 10px;
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: var(--mono);
}

.small {
  font-size: 12px;
}

.green {
  color: var(--green);
}

.danger {
  color: var(--red);
}

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

.skip-link {
  position: fixed;
  top: -70px;
  left: 12px;
  z-index: 200;
  background: var(--green);
  color: var(--green-ink);
  padding: 12px;
}

.skip-link:focus {
  top: 12px;
}

/* Pulsanti, avatar e indicatori comuni. */
.button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s,transform .15s;
}

.button:hover {
  transform: translateY(-1px);
}

.primary {
  background: var(--green);
  color: var(--green-ink);
  border-color: var(--green);
}

.secondary {
  background: var(--card);
}

.subtle {
  background: transparent;
}

.danger-button {
  background: var(--red-bg);
  color: var(--red);
  border-color: transparent;
}

.wide {
  width: 100%;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-size: 23px;
}

.icon-button:hover {
  background: var(--hover);
}

.text-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  min-height: 44px;
  padding: 7px 0;
  font-size: 12px;
  text-align: left;
}

.text-button:hover {
  color: var(--ink);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-bg);
  border: 1px solid color-mix(in srgb,var(--gold) 25%,transparent);
  color: var(--gold);
  font: 11px var(--mono);
}

.avatar.lg {
  width: 48px;
  height: 48px;
  font-size: 16px;
}

.green-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px #8bfa6933;
}

/* Accesso e dimostrazione. */
.login-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 22px;
  background: radial-gradient(ellipse at 50% 15%,rgba(104,248,64,.08),transparent 60%);
}

.login-card {
  max-width: 410px;
  width: 100%;
}

.login-heading {
  margin: 56px 0 28px;
}

.login-heading h1 {
  font-size: 56px;
  line-height: 1.08;
  letter-spacing: -2.8px;
  margin-bottom: 22px;
}

.login-heading p:last-child {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.login-foot {
  font-size: 11px;
  color: var(--muted);
  margin-top: 30px;
  text-align: center;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 500;
}

.field>small {
  font-weight: 400;
  color: var(--muted);
}

.notice {
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid color-mix(in srgb,var(--gold) 25%,transparent);
  padding: 12px 15px;
  border-radius: 10px;
  font-size: 12px;
  margin-bottom: 20px;
}

.form-error {
  color: var(--red);
  background: var(--red-bg);
  padding: 12px;
  border-radius: 8px;
  margin: 14px 0;
  font-size: 13px;
}

/* Navigazione laterale e profilo. */
.sidebar {
  width: 240px;
  position: fixed;
  inset: 0 auto 0 0;
  border-right: 1px solid var(--line);
  padding: 35px 24px 25px;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb,var(--bg) 96%,var(--green));
  z-index: 10;
}

.sidebar .brand {
  margin: 0 3px 60px;
}

.nav-label {
  margin: 0 13px 14px;
  font-size: 9px;
}

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.main-nav>button {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  text-align: left;
  font-size: 13px;
  min-height: 49px;
  color: var(--muted);
}

.main-nav>button:hover {
  background: var(--card);
  color: var(--ink);
}

.main-nav>button.active {
  color: var(--green);
  background: var(--green-bg);
  border-color: color-mix(in srgb,var(--green) 13%,transparent);
}

.nav-icon {
  font-size: 22px;
  width: 23px;
  text-align: center;
  line-height: 1;
}

.nav-count {
  margin-left: auto;
  font: 10px var(--mono);
  background: color-mix(in srgb,var(--green) 14%,transparent);
  padding: 3px 6px;
  border-radius: 5px;
}

.nav-count:empty {
  display: none;
}

.settings-nav {
  margin-top: 22px;
}

.sidebar-bottom {
  margin-top: auto;
}

.calm-note {
  color: var(--muted);
  font-size: 11px;
  padding: 20px 8px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.profile {
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  width: 100%;
  padding: 22px 0 0;
}

.profile strong {
  font-size: 11px;
  display: block;
  font-weight: 500;
}

.profile small {
  font-size: 9px;
  color: var(--muted);
}

/* Area di lavoro, intestazione e barra dei comandi. */
.workspace {
  margin-left: 240px;
  min-width: 0;
}

.topbar {
  height: 87px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 44px;
  gap: 16px;
}

.desktop-path {
  font-size: 11px;
  color: var(--muted);
}

.desktop-path span {
  padding: 0 12px;
  color: var(--line);
}

.desktop-path strong {
  color: var(--soft);
  font-weight: 400;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 15px;
}

.demo-badge {
  font: 9px var(--mono);
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--gold);
}

.mobile-brand {
  display: none;
}

.command-section {
  position: sticky;
  top: 0;
  z-index: 9;
  padding: 26px 44px 14px;
  background: linear-gradient(var(--bg) 88%,transparent);
}

.command-bar {
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid color-mix(in srgb,var(--green) 26%,var(--line));
  background: var(--panel);
  border-radius: 14px;
  padding: 10px 12px 10px 20px;
  box-shadow: 0 5px 35px #00000008;
}

.command-spark {
  font-size: 29px;
  color: var(--green);
  line-height: 1;
}

.command-bar input {
  border: 0;
  background: transparent;
  padding: 10px 0;
  outline: none;
  font-size: 13px;
  flex: 1;
  min-width: 0;
}

.command-bar input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.command-send {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid color-mix(in srgb,var(--green) 18%,transparent);
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  font-size: 25px;
}

.mic-button {
  color: var(--muted);
  flex-shrink: 0;
}

.mic-button svg {
  width: 18px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.mic-button.listening {
  color: var(--red);
  background: var(--red-bg);
}

.command-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 36px;
  color: var(--muted);
  font-size: 10px;
  gap: 12px;
  padding: 3px 2px;
}

.command-caption .text-button {
  color: var(--green);
  font-size: 10px;
  min-height: 30px;
  white-space: nowrap;
}

/* Struttura delle viste e intestazioni. */
.content {
  max-width: 1390px;
  margin: 0 auto;
  padding: 18px 44px 40px;
  min-height: calc(100vh - 330px);
  outline: none;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 29px;
}

.page-heading p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
}

.page-heading .eyebrow {
  font-size: 10px;
  margin-bottom: 10px;
}

.heading-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.date-line {
  font: 10px var(--mono);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Riepilogo numerico e filtri. */
.stats {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 14px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 19px 21px;
  position: relative;
  overflow: hidden;
}

.stat-card .number {
  font: 32px/1.2 var(--mono);
  letter-spacing: -1.5px;
}

.stat-card .label {
  color: var(--muted);
  font-size: 11px;
  margin-top: 8px;
}

.stat-card .stat-symbol {
  position: absolute;
  right: 20px;
  top: 24px;
  font-size: 22px;
  color: var(--muted);
}

.stat-card.due .number,.stat-card.due .stat-symbol {
  color: var(--red);
}

.stat-card.completed .number,.stat-card.completed .stat-symbol {
  color: var(--green);
}

.filters {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding-bottom: 5px;
  margin-bottom: 23px;
  scrollbar-width: none;
}

.filter {
  white-space: nowrap;
  min-height: 40px;
  padding: 8px 13px;
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.filter.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.filter .activity-dot {
  margin-right: 6px;
}

.activity-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--activity,var(--muted));
  flex-shrink: 0;
}

/* Sezioni, elenchi dei punti e azioni. */
.section-block {
  margin-bottom: 29px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 13px;
  font-size: 13px;
  font-weight: 500;
}

.section-title .count {
  font: 10px var(--mono);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
}

.section-title .line {
  height: 1px;
  background: var(--line);
  flex: 1;
  margin-left: 5px;
}

.section-title .section-note {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
}

.point-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.point-card {
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 17px 18px;
  transition: background .16s,border-color .16s;
}

.point-card:hover {
  background: var(--hover);
  border-color: color-mix(in srgb,var(--muted) 45%,var(--line));
}

.point-card.overdue {
  border-left: 2px solid var(--red);
}

.point-card.done .point-title {
  text-decoration: line-through;
  color: var(--muted);
}

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

.point-title {
  display: block;
  text-align: left;
  font-size: 13px;
  line-height: 1.65;
  font-weight: 500;
  word-break: break-word;
  border: 0;
  background: transparent;
  padding: 0;
}

.point-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 10px;
  color: var(--muted);
}

.point-meta .separator {
  opacity: .4;
}

.point-person {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
}

.point-person .avatar {
  height: 21px;
  width: 21px;
  font-size: 8px;
}

.deadline {
  color: var(--muted);
  white-space: nowrap;
}

.deadline.overdue {
  color: var(--red);
}

.point-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-shrink: 0;
}

.small-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  background: transparent;
  color: var(--soft);
}

.small-button:hover {
  background: var(--panel);
}

.small-button.complete {
  border-color: color-mix(in srgb,var(--green) 25%,var(--line));
  color: var(--green);
  background: var(--green-bg);
}

.point-order {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
  font: 16px var(--mono);
  gap: 3px;
}

.point-order .drag-handle {
  font-size: 15px;
  cursor: grab;
  line-height: 1;
  letter-spacing: 2px;
  color: var(--muted);
}

.reorder-controls {
  display: flex;
  flex-direction: column;
}

.reorder-controls button {
  min-height: 35px;
  min-width: 35px;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 5px;
}

.reorder-controls button:hover {
  background: var(--panel);
  color: var(--ink);
}

.point-card.dragging {
  opacity: .4;
}

.point-card.drag-target {
  border-color: var(--green);
}

/* Stati vuoti e punti futuri. */
.empty-state {
  padding: 32px;
  text-align: center;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.empty-state .empty-symbol {
  display: block;
  font-size: 28px;
  color: var(--green);
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 14px;
  margin-bottom: 7px;
}

.empty-state p {
  font-size: 12px;
  color: var(--muted);
  max-width: 420px;
  margin: 0 auto 12px;
}

.section-empty {
  color: var(--muted);
  font-size: 11px;
  padding: 13px 15px;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.future-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  color: var(--muted);
  font-size: 12px;
  min-height: 46px;
  margin-bottom: 15px;
}

.future-toggle span:last-child {
  margin-left: auto;
}

/* Progetti: schede, avanzamento e dettaglio. */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 15px;
}

.project-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  text-align: left;
  transition: transform .18s,background .18s;
  display: flex;
  flex-direction: column;
  min-height: 210px;
  gap: 13px;
}

.project-card:hover {
  transform: translateY(-3px);
  background: var(--hover);
}

.project-card h3 {
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: -.4px;
}

.project-card p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.status-badge {
  font-size: 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 7px;
}

.status-badge.chiuso {
  color: var(--green);
}

.project-progress {
  margin-top: auto;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font: 10px var(--mono);
  margin-bottom: 8px;
}

.progress-track {
  height: 3px;
  border-radius: 10px;
  background: var(--line);
  overflow: hidden;
}

.progress-track span {
  height: 100%;
  background: var(--green);
  display: block;
}

.back-button {
  font-size: 11px;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0 0 20px;
  min-height: 44px;
}

.project-description {
  color: var(--muted);
  font-size: 13px;
  max-width: 760px;
  margin-top: 14px;
  white-space: pre-wrap;
}

.detail-summary {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  margin: 24px 0;
  font-size: 11px;
  color: var(--muted);
}

.detail-summary .progress-track {
  width: 150px;
}

/* Persone: contatti, attività e punti assegnati. */
.person-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 16px;
}

.person-card {
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
}

.person-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.person-card-head .icon-button {
  margin-left: auto;
  font-size: 17px;
}

.person-card h3 {
  font-size: 15px;
}

.person-contact {
  font-size: 10px;
  color: var(--muted);
  word-break: break-all;
}

.person-activities {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 13px 0;
}

.mini-tag {
  font-size: 9px;
  padding: 4px 7px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
}

.person-work {
  border-top: 1px solid var(--line);
  padding-top: 15px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.person-work strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  margin-right: 5px;
}

.person-work button {
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 11px;
}

.person-point {
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.person-point>button {
  color: var(--soft);
  text-align: left;
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 12px;
}

/* Impostazioni e relative azioni. */
.settings-grid {
  max-width: 750px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 24px;
}

.settings-card h3 {
  margin-bottom: 6px;
}

.settings-card p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 15px;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
}

.settings-row>span:nth-child(2) {
  flex: 1;
}

.settings-row .small-button {
  margin-left: auto;
}

.settings-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Connessione, piè di pagina e notifiche. */
.connection-banner {
  background: var(--gold-bg);
  color: var(--gold);
  padding: 11px 44px;
  font-size: 12px;
}

.app-footer {
  max-width: 1390px;
  margin: 0 auto;
  padding: 22px 44px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 9px;
  color: var(--muted);
}

.app-footer b {
  color: var(--green);
  padding: 0 6px;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: calc(50% + 120px);
  transform: translateX(-50%);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 15px 22px;
  border-radius: 12px;
  max-width: min(540px,90vw);
  z-index: 150;
  font-size: 12px;
}

.toast.error {
  border-color: var(--red);
  color: var(--red);
}

/* Finestre di dialogo e moduli. */
dialog {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 19px;
  padding: 0;
  width: 600px;
  max-width: calc(100vw - 30px);
  max-height: 90dvh;
  box-shadow: var(--shadow);
  overflow: auto;
}

dialog::backdrop {
  background: #02060bbd;
  backdrop-filter: blur(6px);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 25px 26px 19px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
}

.dialog-head .eyebrow {
  font-size: 9px;
  margin-bottom: 5px;
}

.dialog-head h2 {
  font-size: 22px;
}

.dialog-head .icon-button {
  margin-top: -6px;
  margin-right: -8px;
}

#dialog-body {
  padding: 25px 26px;
}

.dialog-intro {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.form-grid .full {
  grid-column: 1/-1;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 8px;
}

.form-footer .danger-button {
  margin-right: auto;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  min-height: 40px;
  color: var(--soft);
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 15px;
  margin-bottom: 20px;
}

/* Caricamento della riunione e suggerimenti. */
.upload-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 15px;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 17px;
}

.upload-zone:hover {
  border-color: var(--green);
}

.upload-zone input {
  max-width: 100%;
  padding: 5px;
  font-size: 12px;
}

.meeting-suggestions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.suggestion {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--bg);
}

.suggestion.discarded {
  opacity: .5;
}

.suggestion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font: 10px var(--mono);
  color: var(--muted);
}

.suggestion-head .text-button {
  min-height: 30px;
  padding: 0;
  color: var(--red);
}

.suggestion-head .text-button.restore {
  color: var(--green);
}

.suggestion .field {
  margin-bottom: 12px;
}

.suggestion textarea {
  min-height: 80px;
}

.suggestion .form-grid .field {
  margin-bottom: 0;
}

/* Anteprima dei comandi e scelta del canale. */
.preview-description {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 20px;
  word-break: break-word;
}

.preview-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  margin-bottom: 9px;
  background: var(--bg);
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-item strong {
  display: block;
  font-size: 10px;
  color: var(--green);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .8px;
}

.channel-picker {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}

.channel-picker label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
  min-height: 48px;
}

.channel-picker input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

/* Messaggi di supporto, ricerca e trascrizione originale. */
.file-notice {
  font-size: 11px;
  color: var(--gold);
  margin: 10px 0;
}

.busy-line {
  font-size: 12px;
  color: var(--green);
  padding: 20px 0;
}

.loading-content {
  padding: 70px 20px;
  text-align: center;
  color: var(--muted);
}

.search-field {
  margin-bottom: 22px;
  max-width: 450px;
}

.search-field input {
  font-size: 13px;
}

.source-text {
  font-size: 11px;
  white-space: pre-wrap;
  color: var(--muted);
  max-height: 200px;
  overflow: auto;
  margin-top: 12px;
}

.source-details {
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 10px;
  margin-top: 25px;
}

.source-details summary {
  font-size: 12px;
  cursor: pointer;
  color: var(--muted);
  min-height: 30px;
}

.help-box {
  padding: 16px;
  border-left: 2px solid var(--green);
  background: var(--green-bg);
  border-radius: 0 8px 8px 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.8;
  margin: 16px 0;
}

.example-command {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: var(--card);
  font-size: 11px;
  text-align: left;
  min-height: 44px;
}

.example-commands {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.helper-text {
  font-size: 11px;
  color: var(--muted);
  margin: -7px 0 17px;
  line-height: 1.8;
}

/* Adattamento agli schermi molto larghi. */
@media(min-width:1600px) {
  .command-section {
    padding-left: max(44px,calc((100% - 1390px)/2 + 44px));
    padding-right: max(44px,calc((100% - 1390px)/2 + 44px));
  }

}

/* Adattamento ai portatili e agli schermi intermedi. */
@media(max-width:1150px) {
  .sidebar {
    width: 205px;
    padding-left: 18px;
    padding-right: 18px;
  }

  .workspace {
    margin-left: 205px;
  }

  .topbar {
    padding: 0 28px;
  }

  .content {
    padding-left: 28px;
    padding-right: 28px;
  }

  .command-section {
    padding-left: 28px;
    padding-right: 28px;
  }

  .app-footer {
    padding-left: 28px;
    padding-right: 28px;
  }

  .point-card {
    gap: 11px;
    padding: 15px;
  }

  .point-actions {
    flex-direction: column;
    gap: 5px;
  }

  .point-actions .small-button {
    min-height: 34px;
    width: 85px;
  }

  .toast {
    left: calc(50% + 102px);
  }

  .project-grid,.person-grid {
    gap: 12px;
  }

}

/* Navigazione compatta e schede su tablet. */
@media(max-width:800px) {
  .sidebar {
    width: 82px;
    padding: 27px 12px;
  }

  .sidebar .brand {
    margin: 0 auto 45px;
  }

  .sidebar .brand>span,.nav-label,.main-nav>button>span:not(.nav-icon),.sidebar-bottom,.main-nav>button.settings-nav>span:not(.nav-icon) {
    display: none;
  }

  .main-nav>button {
    justify-content: center;
    padding: 13px 8px;
  }

  .workspace {
    margin-left: 82px;
  }

  .settings-nav {
    margin-top: 24px;
  }

  .desktop-path {
    font-size: 10px;
  }

  .topbar {
    height: 76px;
  }

  .point-card {
    flex-wrap: wrap;
  }

  .point-actions {
    flex-direction: row;
    margin-left: auto;
  }

  .point-main {
    flex-basis: calc(100% - 65px);
  }

  .point-actions .small-button {
    width: auto;
    min-height: 38px;
  }

  .project-card {
    padding: 18px;
  }

  .project-card h3 {
    font-size: 16px;
  }

  .toast {
    left: calc(50% + 41px);
  }

  h1 {
    font-size: 30px;
  }

  .page-heading {
    align-items: flex-start;
  }

  .heading-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .page-heading .button {
    font-size: 11px;
  }

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

  .reorder-controls {
    flex-direction: row;
    margin-left: auto;
    gap: 7px;
  }

  .reorder-controls button {
    border: 1px solid var(--line);
    width: 40px;
    height: 38px;
  }

  .point-card .reorder-controls+.point-actions {
    margin-left: 0;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card .stat-symbol {
    display: none;
  }

  .stat-card .label {
    font-size: 10px;
  }

  .stat-card .number {
    font-size: 28px;
  }

}

/* Navigazione inferiore e impaginazione su telefono. */
@media(max-width:600px) {
  body {
    font-size: 13px;
  }

  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(73px + env(safe-area-inset-bottom));
    width: 100%;
    padding: 6px 12px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    border-right: 0;
    background: var(--panel);
    z-index: 20;
  }

  .sidebar .brand {
    display: none;
  }

  .main-nav {
    height: 60px;
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 5px;
  }

  .main-nav>button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 0;
    border-radius: 9px;
    min-height: 56px;
    font-size: 9px;
  }

  .main-nav>button>span:not(.nav-icon),.main-nav>button.settings-nav>span:not(.nav-icon) {
    display: block;
  }

  .main-nav .nav-count {
    display: none!important;
  }

  .main-nav>button.active {
    background: var(--green-bg);
    border: 0;
  }

  .nav-icon {
    font-size: 21px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .settings-nav {
    margin: 0;
  }

  .workspace {
    margin: 0;
    padding-bottom: calc(73px + env(safe-area-inset-bottom));
  }

  .topbar {
    height: 76px;
    padding: 0 19px;
    border-bottom: 0;
    align-items: center;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
  }

  .mobile-brand .brand-mark {
    width: 28px;
    height: 30px;
  }

  .desktop-path {
    display: none;
  }

  .topbar-tools {
    gap: 4px;
  }

  .demo-badge {
    position: absolute;
    right: 62px;
    top: 57px;
    font-size: 7px;
    padding: 3px 6px;
    line-height: 1;
    z-index: 10;
  }

  .topbar-tools .icon-button {
    font-size: 20px;
  }

  .command-section {
    padding: 15px 18px 7px;
    background: linear-gradient(var(--bg) 90%,transparent);
  }

  .command-bar {
    padding: 7px 8px 7px 13px;
    gap: 8px;
    border-radius: 12px;
  }

  .command-spark {
    font-size: 23px;
  }

  .command-bar input {
    font-size: 12px;
    min-height: 40px;
  }

  .command-bar input::placeholder {
    font-size: 11px;
  }

  .command-send {
    width: 40px;
    height: 42px;
    font-size: 23px;
  }

  .mic-button {
    min-width: 34px;
  }

  .command-caption {
    font-size: 8px;
    line-height: 1.6;
    align-items: flex-start;
    padding-top: 7px;
    min-height: 31px;
    gap: 6px;
  }

  .command-caption .text-button {
    font-size: 8px;
    white-space: normal;
    text-align: right;
    padding: 0;
    min-height: 24px;
    max-width: 106px;
  }

  .content {
    padding: 20px 18px 28px;
  }

  .page-heading {
    margin-bottom: 23px;
    gap: 12px;
  }

  .page-heading h1 {
    font-size: 28px;
    letter-spacing: -1px;
  }

  .page-heading p {
    font-size: 11px;
    line-height: 1.7;
    max-width: 250px;
  }

  .page-heading .eyebrow {
    font-size: 9px;
    margin-bottom: 8px;
  }

  .heading-actions .button {
    min-height: 44px;
    padding: 9px 11px;
    font-size: 10px;
    line-height: 1.6;
  }

  .stats {
    gap: 8px;
    margin-bottom: 24px;
  }

  .stat-card {
    padding: 15px 12px;
    border-radius: 11px;
  }

  .stat-card .number {
    font-size: 27px;
  }

  .stat-card .label {
    font-size: 9px;
    line-height: 1.7;
    min-height: 28px;
  }

  .filters {
    gap: 7px;
    margin-right: -18px;
    padding-right: 18px;
    margin-bottom: 22px;
  }

  .filter {
    font-size: 10px;
    padding: 8px 11px;
  }

  .section-title {
    font-size: 12px;
    gap: 8px;
  }

  .section-title .section-note {
    font-size: 8px;
  }

  .section-block {
    margin-bottom: 25px;
  }

  .point-list {
    gap: 9px;
  }

  .point-card {
    padding: 14px;
    gap: 11px 9px;
    border-radius: 11px;
  }

  .point-title {
    font-size: 12px;
    line-height: 1.75;
  }

  .point-main {
    flex-basis: calc(100% - 40px);
  }

  .point-meta {
    font-size: 9px;
    gap: 7px;
    margin-top: 9px;
  }

  .point-actions {
    justify-content: flex-end;
    width: 100%;
    border-top: 1px solid var(--line);
    padding-top: 10px;
    margin-top: 1px;
    gap: 8px;
  }

  .point-actions .small-button {
    min-height: 42px;
    font-size: 10px;
    padding: 9px 14px;
  }

  .point-card .reorder-controls {
    margin-left: 0;
    flex: 1;
  }

  .point-card .reorder-controls+.point-actions {
    width: auto;
    border: 0;
    padding: 0;
  }

  .reorder-controls button {
    height: 42px;
    min-width: 42px;
  }

  .point-order {
    font-size: 14px;
    width: 19px;
  }

  .drag-handle {
    display: none;
  }

  .project-grid,.person-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: 190px;
    padding: 21px;
  }

  .project-card h3 {
    font-size: 17px;
  }

  .person-card {
    padding: 19px;
  }

  .app-footer {
    padding: 19px 18px;
    font-size: 8px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .connection-banner {
    padding: 10px 18px;
    font-size: 11px;
  }

  .toast {
    left: 50%;
    bottom: calc(87px + env(safe-area-inset-bottom));
    font-size: 11px;
    padding: 14px 17px;
    width: max-content;
    max-width: calc(100vw - 32px);
  }

  dialog {
    max-width: 100%;
    width: 100%;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: 19px 19px 0 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .dialog-head {
    padding: 21px 20px 16px;
  }

  .dialog-head h2 {
    font-size: 20px;
  }

  #dialog-body {
    padding: 21px 20px;
  }

  .form-grid {
    gap: 0 12px;
  }

  .form-footer {
    flex-wrap: wrap;
    gap: 8px;
  }

  .form-footer .button {
    flex: 1;
    min-width: 100px;
    font-size: 12px;
  }

  .form-footer .danger-button {
    flex-basis: 100%;
  }

  .login-heading {
    margin-top: 38px;
  }

  .login-heading h1 {
    font-size: 50px;
  }

  .settings-card {
    padding: 20px;
  }

  .source-details {
    padding: 13px;
  }

  .detail-summary {
    gap: 12px;
    font-size: 10px;
  }

  .preview-description {
    font-size: 13px;
  }

  .suggestion {
    padding: 13px;
  }

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

  .meeting-suggestions .form-grid .field {
    margin-bottom: 12px;
  }

  .meeting-suggestions .form-grid .field:last-child {
    margin-bottom: 0;
  }

  .empty-state {
    padding: 25px 17px;
  }

  .example-commands {
    flex-direction: column;
  }

  .settings-row {
    flex-wrap: wrap;
  }

  .settings-row .small-button {
    min-height: 44px;
  }

  .point-person .avatar {
    height: 20px;
    width: 20px;
  }

}

/* Rispetto della preferenza per il movimento ridotto. */
@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior: auto!important;
    transition: none!important;
    animation: none!important;
  }

}

/* Dimensioni dei controlli e leggibilità sul telefono principale di Marco. */
@media(max-width:600px) {
  .command-bar input,.search-field input {
    font-size: 16px;
  }

  .point-title {
    font-size: 14px;
  }

  .point-meta {
    font-size: 10px;
  }

  .point-actions .small-button {
    font-size: 11px;
    min-height: 44px;
  }

  .reorder-controls button {
    height: 44px;
    min-width: 44px;
  }

  .demo-badge {
    font-size: 9px;
  }

  .command-caption,.command-caption .text-button {
    font-size: 9px;
  }

  .command-caption {
    min-height: 35px;
  }

  .point-card .point-actions {
    flex-wrap: wrap;
  }

}
