/* Signed-in pages of segnalio.com (login, My services, accounts, PM).
   The colour tokens below are the homepage's own (tools/hub_src.html): P04 light, P10 dark. Change them there
   and here together. Extra tokens for forms: --danger / --ok (text, >= 4.5:1 on --surface and on their tint). */
  :root {
    color-scheme: light;
    --paper: #F8F9FB;
    --surface: #FFFFFF;
    --tint1: #FDE7D3;
    --tint2: #E4E5F6;
    --soft1: #F2A65A;
    --soft2: #9EA2D8;
    --soft1-ui: #C86A10;
    --soft1-text: #995612;
    --accent: #3A3E8C;
    --on-accent: #FFFFFF;
    --ink: #1E2033;
    --muted: #62657A;
    --line: #E5E7EF;
    --field-border: #8488A6;
    --focus: #3A3E8C;
    --logo-tile: #E4E5F6;   /* = tint2 */
    --logo-s: #3A3E8C;      /* = accent */
    --logo-in: #9EA2D8;     /* punto d'ingresso = soft2 */
    --logo-out: #F2A65A;    /* punto d'arrivo = soft1 */
  }

  /* Tema scuro quando il sistema lo chiede e l'utente non ha scelto esplicitamente il chiaro */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
      --paper: #15161A;
      --surface: #1F2026;
      --tint1: #2A3218;
      --tint2: #2A2440;
      --soft1: #C6F432;
      --soft2: #9B87F5;
      --soft1-ui: #C6F432;
      --soft1-text: #C6F432;
      --accent: #C6F432;
      --on-accent: #15161A;
      --ink: #F2F3EE;
      --muted: #A3A6AE;
      --line: #2E3038;
      --field-border: #6A6E7A;
      --focus: #C6F432;
      --logo-tile: #2A2440;   /* = tint2 */
      --logo-s: #C6F432;      /* S = lime */
      --logo-in: #A3A6AE;     /* punto d'ingresso = muted */
      --logo-out: #9B87F5;    /* punto d'arrivo = lilla */
    }
  }

  /* Tema scuro scelto esplicitamente dall'utente */
  :root[data-theme="dark"] {
    color-scheme: dark;
    --paper: #15161A;
    --surface: #1F2026;
    --tint1: #2A3218;
    --tint2: #2A2440;
    --soft1: #C6F432;
    --soft2: #9B87F5;
    --soft1-ui: #C6F432;
    --soft1-text: #C6F432;
    --accent: #C6F432;
    --on-accent: #15161A;
    --ink: #F2F3EE;
    --muted: #A3A6AE;
    --line: #2E3038;
    --field-border: #6A6E7A;
    --focus: #C6F432;
    --logo-tile: #2A2440;   /* = tint2 */
    --logo-s: #C6F432;      /* S = lime */
    --logo-in: #A3A6AE;     /* punto d'ingresso = muted */
    --logo-out: #9B87F5;    /* punto d'arrivo = lilla */
  }

  :root { --radius: 14px; --danger: #A8201A; --danger-tint: #FCE9E7; --ok: #17643A; --ok-tint: #E3F4E9; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) { --danger: #FFB4AB; --danger-tint: #3A1D1B; --ok: #9BE3B4; --ok-tint: #17301F; }
  }
  :root[data-theme="dark"] { --danger: #FFB4AB; --danger-tint: #3A1D1B; --ok: #9BE3B4; --ok-tint: #17301F; }

  * { box-sizing: border-box; }
  html { height: 100%; }
  body {
    margin: 0; min-height: 100%; display: flex; flex-direction: column; background: var(--paper); color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased;
  }
  a { color: var(--accent); text-decoration: underline; }
  :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
  .wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  /* header: same as the homepage */
  header { position: sticky; top: 0; z-index: 10; background: var(--paper); background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 68px; }
  .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 21px; letter-spacing: -.01em; }
  .nav-actions { display: flex; align-items: center; gap: 12px; }
  .btn { display: inline-block; padding: 12px 22px; border: 0; border-radius: 999px; font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
  .btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 22%, transparent); }
  .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 28%, transparent); }
  .btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--field-border); }
  .btn-ghost:hover { border-color: var(--accent); }
  .btn-small { padding: 7px 14px; font-size: 14px; min-height: 36px; }
  .nav .btn { padding: 9px 18px; min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; }
  .theme-toggle { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .5rem .9rem; border: 1px solid var(--field-border); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
  .theme-toggle:hover { border-color: var(--accent); }
  .theme-toggle__icon--sun { display: none; }
  :root[data-theme="dark"] .theme-toggle__icon--sun { display: inline; }
  :root[data-theme="dark"] .theme-toggle__icon--moon { display: none; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle__icon--sun { display: inline; }
    :root:not([data-theme="light"]) .theme-toggle__icon--moon { display: none; }
  }
  .lang-switch { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 6px; border: 1px solid var(--field-border); border-radius: 999px; background: var(--surface); }
  .lang-switch a { display: inline-block; padding: 6px 7px; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--muted); text-decoration: none; border-radius: 999px; }
  .lang-switch a:hover { color: var(--accent); }
  .lang-switch a[aria-current="true"] { color: var(--on-accent); background: var(--accent); }

  /* account button + menu (the same block is in the homepage's own styles) */
  .acct { position: relative; }
  .acct > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 220px; padding: 0 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 15px; cursor: pointer; }
  .acct > summary::-webkit-details-marker { display: none; }
  .acct > summary::after { content: ""; flex: none; width: 7px; height: 7px; margin-top: -3px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
  .acct[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
  .acct__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .acct__menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; padding: 8px; background: var(--surface); border: 1px solid var(--field-border); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0, 0, 0, .16); display: grid; gap: 2px; }
  .acct__menu a, .acct__menu button { display: block; width: 100%; min-height: 44px; padding: 9px 12px; border: 0; border-radius: 9px; background: none; color: var(--ink); font: inherit; font-size: 15.5px; text-align: left; text-decoration: none; cursor: pointer; }
  .acct__menu a:hover, .acct__menu button:hover { background: var(--tint2); }
  .acct__menu form { margin: 0; border-top: 1px solid var(--line); padding-top: 2px; }

  main { flex: 1; padding: 48px 0 72px; }
  h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 12px; }
  h2 { font-size: 20px; line-height: 1.25; letter-spacing: -.01em; margin: 0 0 6px; }
  .lead { color: var(--muted); margin: 0 0 28px; max-width: 640px; }
  .muted { color: var(--muted); }
  .small { font-size: 14.5px; }

  .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px; }
  .narrow { max-width: 460px; margin: 0 auto; }
  .stack { display: grid; gap: 24px; }
  .field { display: grid; gap: 6px; margin-bottom: 18px; }
  .field label { font-weight: 600; font-size: 15px; }
  .field input[type=text], .field input[type=email], .field input[type=password], .field select {
    width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--field-border); border-radius: 10px;
    background: var(--surface); color: var(--ink); font: inherit; }
  .field .hint { color: var(--muted); font-size: 14px; }
  .check { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; font-size: 15px; }
  .check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--accent); flex: none; }
  .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 6px; }
  .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  .note { padding: 12px 14px; border-radius: 10px; margin: 0 0 20px; font-size: 15.5px; overflow-wrap: anywhere; }
  .note-err { background: var(--danger-tint); color: var(--danger); border: 1px solid var(--danger); }
  .note-ok { background: var(--ok-tint); color: var(--ok); border: 1px solid var(--ok); }
  .note code { display: block; margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 14px; user-select: all; }

  .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
  .svc { display: flex; flex-direction: column; gap: 10px; padding: 26px; border-radius: 20px; background: var(--tint2); border: 1px solid var(--edge); color: var(--ink); text-decoration: none; transition: transform .15s ease; }
  .svc:hover { transform: translateY(-2px); border-color: var(--accent); }
  .svc h2 { font-size: 24px; margin: 0; }
  .svc p { margin: 0; color: var(--ink); font-size: 15.5px; }
  .svc .go { margin-top: 8px; font-weight: 600; color: var(--accent); }

  .people { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
  .person { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 8px 20px; align-items: center; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
  .person__who { min-width: 0; }
  .person__who strong, .person__who span { display: block; overflow-wrap: anywhere; }
  .person__acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
  .person__svc { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
  .person__svc-h { font-size: 13px; font-weight: 600; color: var(--muted); }
  .tick { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; cursor: pointer; }
  .tick input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
  .person__credits { border-top: 0; padding-top: 0; }
  .person__credits input[type="text"] { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: inherit; font: inherit; font-size: 14px; min-width: 0; }
  .person__acts form { margin: 0; }
  .badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--tint2); color: var(--ink); border: 1px solid var(--field-border); }
  .state { font-size: 14.5px; }
  .state::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; border: 2px solid var(--muted); }
  .state-on::before { background: var(--ok); border-color: var(--ok); }
  .state-off::before { border-style: dashed; }
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

  .legal { max-width: 760px; }
  .legal h2 { margin: 36px 0 10px; font-size: 22px; }
  .legal li { margin-bottom: 8px; }
  .table-wrap { overflow-x: auto; margin: 16px 0; }
  .legal table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 15px; }
  .legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border: 1px solid var(--field-border); }
  .legal th { background: var(--tint2); }

  /* ===== PM =====
     Six card/section colours c0..c5: indigo and mango from the palette plus four companions. Chosen by measure
     (accessibility check, 2026-11-23): each differs from the others also with the three common kinds of colour
     blindness (lightness varies, not only hue), --ink on them is >= 9:1 and --accent >= 5:1 in both themes.
     They are backgrounds only: text on them is --ink (never --muted, see below) and nothing is told by colour alone.
     --edge is the border for anything drawn on these colours (>= 3:1 on all of them, on --surface and --paper). */
  :root { --c0: #CED0FC; --c1: #EED2B1; --c2: #C0EFE8; --c3: #F2B1C1; --c4: #F4F0B2; --c5: #E1FCDA; --edge: #646782;
          --l-ok: #17643A; --l-warn: #8A5300; --l-bad: #A8201A; --l-none: #62657A; --l-on: #FFFFFF; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) { --c0: #0F152C; --c1: #311709; --c2: #153834; --c3: #3D091E; --c4: #453A13; --c5: #273520; --edge: #848791;
          --l-ok: #9BE3B4; --l-warn: #FFD27A; --l-bad: #FFB4AB; --l-none: #A3A6AE; --l-on: #15161A; }
  }
  :root[data-theme="dark"] { --c0: #0F152C; --c1: #311709; --c2: #153834; --c3: #3D091E; --c4: #453A13; --c5: #273520; --edge: #848791;
          --l-ok: #9BE3B4; --l-warn: #FFD27A; --l-bad: #FFB4AB; --l-none: #A3A6AE; --l-on: #15161A; }
  .c0 { --card: var(--c0); } .c1 { --card: var(--c1); } .c2 { --card: var(--c2); }
  .c3 { --card: var(--c3); } .c4 { --card: var(--c4); } .c5 { --card: var(--c5); }

  .pm-chip { margin-right: auto; margin-left: 4px; padding: 3px 11px; border-radius: 999px; background: var(--tint1); color: var(--ink); border: 1px solid var(--edge); font-weight: 700; font-size: 14px; text-decoration: none; }
  .pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 28px; }
  .grouphead { margin: 44px 0 16px; }
  .crumb { margin: 0 0 14px; font-size: 15px; }
  .pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
  .pcard { display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: 22px; background: var(--card); border: 1px solid var(--edge); color: var(--ink); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
  .pcard:hover { transform: translateY(-3px) rotate(-.3deg); box-shadow: 0 14px 30px rgba(0, 0, 0, .12); border-color: var(--accent); }
  .pcard h2 { margin: 0; font-size: 22px; overflow-wrap: anywhere; }
  .pcard__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin: auto 0 0; font-size: 14.5px; }
  .pcards-closed .pcard { background: var(--surface); }
  .pwrap { position: relative; display: flex; }
  .pwrap > .pcard { flex: 1; min-width: 0; }
  .pcard.has-x h2 { padding-right: 34px; }
  .pcard__x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); text-decoration: none; font-size: 16px; line-height: 1; border: 1px solid transparent; }
  .pcard__x:hover, .pcard__x:focus-visible { background: var(--surface); border-color: var(--danger); color: var(--danger); }
  .admindex { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; }
  .admindex a { padding: 9px 16px; border-radius: 999px; background: var(--surface); color: var(--ink); border: 1px solid var(--edge); font-weight: 600; font-size: 15px; text-decoration: none; }
  .admindex a:hover { border-color: var(--accent); }
  .adminsec { scroll-margin-top: 90px; margin: 0 0 56px; }
  .adminsec__h { font-size: 26px; margin: 0 0 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .pvideo { margin: 0 0 28px; padding: 14px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--edge); }
  .pvideo summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
  .pvideo[open] summary { margin-bottom: 12px; }
  .pvideo__v { display: block; width: 100%; max-width: 860px; margin: 0 auto; aspect-ratio: 16 / 9; border-radius: 12px; background: #000; }
  .lights { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
  .light { display: flex; align-items: center; gap: 9px; font-size: 15px; }
  .light__dot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; line-height: 1; color: var(--l-on); background: var(--l-none); }
  .light-ok .light__dot { background: var(--l-ok); } .light-warn .light__dot { background: var(--l-warn); border-radius: 5px; } .light-bad .light__dot { background: var(--l-bad); border-radius: 3px; transform: rotate(45deg); }
  .light-bad .light__dot { font-size: 0; } .light-bad .light__dot::before { content: "✕"; font-size: 13px; transform: rotate(-45deg); }
  .light__k { font-weight: 700; min-width: 4.2em; }
  .phead { padding: 26px 28px; border-radius: 22px; background: var(--card); border: 1px solid var(--edge); margin-bottom: 24px; display: grid; gap: 14px; }
  .phead h1 { margin: 0; overflow-wrap: anywhere; }
  .phead__meta { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 0; font-size: 15.5px; }
  .phead .lights { display: flex; flex-wrap: wrap; gap: 8px 26px; }
  .phead .light__k { min-width: 0; }
  .role-owner { background: var(--tint1); }
  form.inline { display: flex; gap: 6px; align-items: center; }
  form.inline select { min-height: 36px; padding: 4px 8px; border: 1px solid var(--field-border); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
  .field input[type=date] { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--field-border); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
  /* ----- the project page: one screen, an index always in view, six coloured sections ----- */
  .s0 { --card: var(--c0); } .s1 { --card: var(--c1); } .s2 { --card: var(--c2); }
  .s3 { --card: var(--c3); } .s4 { --card: var(--c4); } .s5 { --card: var(--c5); }
  .proj { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px; align-items: start; }
  .pside { position: sticky; top: 88px; display: grid; gap: 16px; }
  .pindex ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
  .pindex a { display: block; padding: 9px 14px; border-radius: 12px; background: var(--card); color: var(--ink); border: 1px solid var(--edge); font-weight: 600; font-size: 15px; text-decoration: none; }
  .pindex a:hover { border-color: var(--accent); }
  .switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--field-border); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-align: left; }
  .switch__box { flex: none; width: 36px; height: 20px; border-radius: 999px; border: 2px solid var(--field-border); position: relative; }
  .switch__box::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--field-border); transition: left .15s ease; }
  .switch[aria-checked="true"] .switch__box { background: var(--accent); border-color: var(--accent); }
  .switch[aria-checked="true"] .switch__box::after { left: 18px; background: var(--on-accent); }
  .psecs { display: grid; gap: 22px; min-width: 0; }
  .psecs .phead, .psecs .note { margin: 0; }
  .sec { background: var(--surface); border: 1px solid var(--edge); border-radius: 22px; overflow: clip; scroll-margin-top: 84px; }
  .sec > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 22px; background: var(--card); }
  .sec > header h2 { margin: 0; font-size: 21px; }
  .sec__tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .sec__tools form { margin: 0; }
  .sec__body { padding: 20px 22px 22px; }
  .sec h3 { margin: 22px 0 8px; font-size: 16.5px; }
  .sec h4 { margin: 16px 0 6px; font-size: 14.5px; color: var(--muted); font-weight: 600; }
  .sec:not(.show-closed) [data-closed="1"] { display: none; }
  .mine-only [data-mine="0"] { display: none; }
  .phase-empty { display: none; }
  .minebar { display: none; margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--tint1); border: 1px solid var(--field-border); font-size: 15px; }
  .mine-only .minebar { display: block; }
  .linkbtn { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
  .mine-empty { display: none; margin: 0; }
  .mine-none .mine-empty { display: block; }
  .mine-none .gantt, .mine-none .task-head, .mine-none .gantt-none { display: none; }
  [data-show-closed][aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

  /* a value edited in place: looks like text with a soft outline, becomes a field on focus */
  .ed { width: 100%; min-height: 38px; padding: 6px 9px; border: 1px solid var(--field-border); border-radius: 9px; background: transparent; color: var(--ink); font: inherit; font-size: 15.5px; }
  textarea.ed { display: block; resize: none; overflow: hidden; line-height: 1.5; }
  select.ed { padding-right: 4px; }
  .ed:hover { border-color: var(--accent); }
  .ed:focus { border-color: var(--accent); background: var(--surface); outline: 2px solid var(--focus); outline-offset: 1px; }
  .ed.saving { opacity: .6; }
  .ed.strong, .ro.strong { font-weight: 700; }
  .ed.big, .ro.big { font-size: 17.5px; }
  input[type=checkbox].ed { width: 22px; height: 22px; min-height: 0; padding: 0; accent-color: var(--accent); }
  .ro { display: block; padding: 6px 0; font-size: 15.5px; overflow-wrap: anywhere; }
  .ro.pre { white-space: pre-wrap; }
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
  .fld { display: grid; gap: 3px; align-content: start; min-width: 0; }
  .fld > span:first-child { font-size: 13px; font-weight: 600; color: var(--muted); }
  .fld.wide { grid-column: 1 / -1; }
  .fld input:not(.ed), .fld select:not(.ed) { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--field-border); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15.5px; }
  .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .cap { display: none; font-size: 12.5px; font-weight: 600; color: var(--muted); }
  .cell { display: grid; gap: 2px; min-width: 0; }
  .delform { margin: 12px 0 0; }
  .savestatus { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 9px 16px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 14.5px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .15s ease; z-index: 30; }
  .savestatus.show { opacity: 1; }
  .savestatus.bad { background: var(--danger); color: var(--surface); border-radius: 14px; }

  /* Piano */
  .wrap-wide { max-width: 1360px; }
  .task-head, .task__main { display: grid; grid-template-columns: 122px minmax(0, 1fr) 150px 136px 136px 30px 38px; gap: 8px; align-items: start; }
  .ed, .cell { min-width: 0; }
  input[type=date].ed { padding-right: 4px; }
  .cell-ms { padding-top: 8px; }
  .task-head { padding: 0 10px 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
  .phase__name { margin: 16px 0 6px; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
  .phase:first-of-type .phase__name { margin-top: 4px; }
  .task { padding: 8px 10px; border: 1px solid var(--line); border-left: 6px solid var(--field-border); border-radius: 12px; margin-bottom: 8px; background: var(--surface); }
  .task.st-doing { border-left-color: var(--accent); }
  .task.st-done { border-left-color: var(--l-ok); }
  .task.st-blocked { border-left-color: var(--l-bad); border-left-style: double; }
  .task.is-ms { background: var(--card); }
  .cell-ms { justify-items: center; }
  .delx { margin: 0; }
  .xbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 38px; min-height: 38px; padding: 0 8px; border: 1px solid var(--field-border); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
  .xbtn:hover { border-color: var(--danger); color: var(--danger); }
  .xbtn__t { display: none; }
  .task__q { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; align-items: end; margin-top: 8px; padding-left: 130px; }
  .verify { display: flex; align-items: center; gap: 9px; min-height: 38px; font-size: 14.5px; max-width: 300px; }
  .verify input:disabled { opacity: .45; }
  .qline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; margin: 12px 0 0; font-size: 15px; }
  .qline .light__dot { background: var(--l-warn); border-radius: 5px; }
  .task__more { margin-top: 6px; }
  .task__more > summary { cursor: pointer; font-size: 14px; color: var(--muted); padding: 4px 0; width: max-content; }
  .task__more[open] > summary { margin-bottom: 10px; }

  /* Gantt, read only: bars from the dates. The status is told by the shape and fill of the bar, not by colour alone:
     to do = empty outline, in progress = full, done = full with a tick, blocked = striped. */
  .gantt { margin-bottom: 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
  .psecs > *, .sec__body > * { min-width: 0; }
  .gantt { max-width: 100%; }
  .gantt-none { margin: 0 0 14px; }
  .gantt__scroll { overflow-x: auto; }
  .gantt__in { min-width: 620px; }
  .grow, .glines { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 12px; align-items: center; }
  .grow { min-height: 30px; }
  .gbody { position: relative; }
  .glines { position: absolute; inset: 0; pointer-events: none; }
  .glines .gtrack { height: 100%; }
  .gtrack { position: relative; height: 22px; }
  .ghead .gtrack { height: 20px; }
  .gmonth { position: absolute; top: 0; padding-left: 4px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
  .gtick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
  .gtoday { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 2px solid var(--l-bad); }
  .gend { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 2px dashed var(--ink); }
  .glabel { font-size: 14px; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  a.glabel:hover { text-decoration: underline; }
  .gbar { position: absolute; top: 4px; height: 14px; min-width: 8px; border-radius: 7px; border: 2px solid var(--field-border); background: var(--surface); }
  .gbar.st-doing { background: var(--accent); border-color: var(--accent); }
  .gbar.st-done { background: var(--l-ok); border-color: var(--l-ok); }
  .gbar.st-done::after { content: "✓"; position: absolute; right: -16px; top: -6px; font-size: 13px; font-weight: 800; color: var(--l-ok); }
  .gbar.st-blocked { border-color: var(--l-bad); background: repeating-linear-gradient(45deg, var(--l-bad) 0 4px, var(--surface) 4px 8px); }
  .gms { position: absolute; top: 3px; width: 14px; height: 14px; margin-left: -8px; transform: rotate(45deg); background: var(--ink); border: 2px solid var(--ink); }
  .gms.st-done { background: var(--l-ok); border-color: var(--l-ok); }
  .gms.st-todo { background: var(--surface); }
  .gms.st-blocked { background: var(--l-bad); border-color: var(--l-bad); }
  .glegend { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
  .glegend li { display: inline-flex; align-items: center; gap: 7px; }
  .glegend .gbar, .glegend .gms, .glegend .gtoday, .glegend .gend { position: static; display: inline-block; margin: 0; }
  .glegend .gbar { width: 26px; } .glegend .gbar.st-done::after { content: none; }
  .glegend .gms { width: 10px; height: 10px; margin: 0 3px; }
  .glegend .gtoday, .glegend .gend { height: 16px; }

  /* history lines */
  .hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14.5px; }
  .hist li { overflow-wrap: anywhere; }
  .hist__when { color: var(--muted); font-size: 13px; white-space: nowrap; margin-right: 4px; }
  .sticky__acts { display: flex; flex-wrap: wrap; gap: 8px; }
  .sticky__acts form { margin: 0; }
  .sticky .hist { font-size: 13.5px; }

  /* AI: new project from a description, review of the draft, status report */
  .aibox { margin-top: 28px; padding: 20px; border-radius: 16px; background: var(--tint2); border: 1px solid var(--edge); }
  .aibox h2 { margin: 0 0 12px; }
  .field input[type=file] { width: 100%; padding: 10px 12px; border: 1px dashed var(--field-border); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; }
  #files-err { margin: 8px 0 0; }
  .note:not(.note-ok):not(.note-err) { background: var(--tint2); border: 1px solid var(--edge); }
  .fromdoc { align-self: center; justify-self: start; }
  .dadd { margin: 6px 0 0 40px; padding-top: 14px; border-top: 1px solid var(--line); }
  .field textarea, .draft textarea, .draft input[type=text], .draft input[type=date], .draft select { width: 100%; padding: 9px 12px; border: 1px solid var(--field-border); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15.5px; }
  .draft { display: grid; gap: 22px; max-width: 980px; margin: 0 auto; }
  .draft h1, .draft .note { margin: 0; }
  .drow { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
  .drow:first-of-type { border-top: 0; padding-top: 0; }
  .dcheck input { width: 22px; height: 22px; margin-top: 22px; accent-color: var(--accent); }
  .draft__acts { position: sticky; bottom: 0; padding: 14px 0; background: var(--paper); border-top: 1px solid var(--line); margin: 0; }
  .report { margin-top: 18px; padding: 16px 18px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); scroll-margin-top: 100px; }
  .report h3 { margin: 0 0 4px; }
  .report textarea.ed { background: var(--surface); line-height: 1.55; }

  .exports { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
  .exports .btn { background: var(--surface); }

  /* Chiusura */
  .s6 { --card: var(--tint2); }
  .s6 textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--field-border); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15.5px; }
  .danger-zone { margin-top: 22px; padding-top: 12px; border-top: 1px dashed var(--field-border); }
  .btn-danger { background: var(--danger); color: var(--surface); }

  /* Persone */
  .pers-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
  .pers { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; }
  .pers__access { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
  .pers__access .person__acts { align-items: center; }
  .invite-new { margin-top: 20px; padding: 18px; border-radius: 14px; background: var(--card); border: 1px solid var(--edge); }
  .invite-new h3 { margin: 0 0 4px; }
  .invite-new .form-grid { margin-bottom: 14px; }

  /* Rischi e problemi: sticky notes. The kind is written on each note, the colour only repeats it. */
  .notes { list-style: none; margin: 0; padding: 4px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
  .sticky { display: grid; gap: 8px; align-content: start; padding: 16px 16px 14px; border-radius: 4px 4px 18px 4px; background: var(--c4); border: 1px solid var(--edge); box-shadow: 3px 5px 0 rgba(0, 0, 0, .10); }
  .sticky:nth-child(odd) { transform: rotate(-.4deg); } .sticky:nth-child(even) { transform: rotate(.35deg); }
  .sticky:focus-within { transform: none; }
  .sticky.kind-issue { background: var(--c3); border-style: dashed; border-width: 2px; }
  .sticky .ed { border-color: var(--edge); }
  .sticky__top { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
  .level { padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--surface); color: var(--ink); border: 2px solid var(--l-none); white-space: nowrap; }
  .level__k { font-weight: 600; }
  .level-medium { border-color: var(--l-warn); border-style: dashed; }
  .level-high { border-color: var(--l-bad); border-width: 3px; }
  .sticky .delform { margin-top: 4px; }

  /* Modifiche */
  .change { padding: 16px 18px; border: 1px solid var(--edge); border-radius: 16px; margin-bottom: 14px; display: grid; gap: 8px; }
  .change.cs-proposed { background: var(--card); }
  .change.cs-proposed .ed, .task.is-ms .ed { background: var(--surface); border-color: var(--edge); }
  .change__top { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
  .change .cs { background: var(--surface); }
  .cs-approved .cs::before { content: "✓ "; } .cs-rejected .cs::before { content: "✕ "; }
  .change h3 { margin: 10px 0 0; }
  .item { display: grid; grid-template-columns: minmax(0, 1fr) 142px 142px auto; gap: 8px; align-items: end; margin-bottom: 6px; }
  .item form, .change form { margin: 0; }
  .change__acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; padding-top: 12px; border-top: 1px dashed var(--field-border); }
  .change__acts .delform { margin: 0 0 0 auto; }

  @media (max-width: 1000px) {
    .proj { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    /* phone and tablet: the index sticks to the top with every section in view (two short rows, nothing to
       scroll sideways); "My things" sits just below it, in the page, so it never covers the index */
    .pside { display: contents; }
    .pindex { position: sticky; top: 68px; z-index: 5; margin: 0 -16px; padding: 8px 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
    .pindex ul { display: flex; flex-wrap: wrap; gap: 6px; }
    .pindex a { padding: 6px 10px; white-space: nowrap; font-size: 13.5px; border-radius: 10px; }
    .switch { justify-self: start; min-height: 44px; }
    .sec { scroll-margin-top: 170px; }
  }
  @media (max-width: 760px) {
    .grow, .glines { grid-template-columns: 120px minmax(0, 1fr); gap: 8px; }
    .gantt { padding: 12px; }
    .task__q { grid-template-columns: 1fr; padding-left: 0; }
    .task-head { display: none; }
    .cap { display: block; }
    .task__main { grid-template-columns: 1fr 1fr; gap: 8px 10px; }
    .task__main .cell:nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
    .task__main .delx { grid-column: 2; grid-row: 4; justify-self: end; }
    .task__main .cell-ms { grid-column: 1; grid-row: 4; }
    .xbtn__t { display: inline; }
    .sticky .xbtn__t { display: none; }
    .cell-ms { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding-top: 0; justify-items: start; }
    .form-grid { grid-template-columns: 1fr; }
    .item { grid-template-columns: 1fr 1fr; }
    .item .cell:first-child { grid-column: 1 / -1; }
    .sec > header { padding: 12px 16px; } .sec__body { padding: 16px; }
    .ed { min-height: 44px; font-size: 16px; }
    .btn-small, .xbtn, form.inline select { min-height: 44px; }
    .xbtn { min-width: 44px; }
  }

  /* on a coloured background secondary text is --ink: --muted would not reach 4.5:1 there */
  .sticky, .change.cs-proposed, .invite-new, .aibox, .pcard, .phead, .sec > header, .task.is-ms, .svc, .minebar, .pindex a { --muted: var(--ink); }
  .badge { border-color: var(--edge); }

  /* keyboard: jump over the header */
  .skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none; }
  .skip:focus { top: 10px; }
  main:focus { outline: none; }

  .legalnote { margin: 0 auto 18px; font-size: 12.5px; line-height: 1.5; max-width: 860px; text-align: center; }
  .pclaim { max-width: 760px; margin: 0 auto 32px; text-align: center; }
  .pclaim p { margin: 0 0 6px; font-size: 17px; line-height: 1.5; color: var(--ink); }
  .pclaim .pclaim__h { font-size: 24px; font-weight: 700; margin-bottom: 10px; }

  footer { padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
  footer .wrap > div { display: flex; justify-content: center; gap: 12px 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 24px; }
  footer a { color: var(--muted); }

  @media (max-width: 760px) {
    .person { grid-template-columns: 1fr; }
    .person__acts { justify-content: flex-start; }
    .grid-2 { grid-template-columns: 1fr; }
  }
  @media (max-width: 640px) {
    .theme-toggle__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  }
  @media (max-width: 600px) {
    body { font-size: 16px; }
    .wrap { padding: 0 16px; }
    main { padding: 28px 0 56px; }
    .panel { padding: 22px 18px; }
  }
  @media (max-width: 520px) {
    .brand__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .nav-actions { gap: 8px; }
    .lang-switch a { padding: 6px 5px; }
    .nav .btn { padding: 9px 14px; }
    .acct > summary { max-width: 104px; padding: 0 12px; gap: 6px; }
    .pm-chip { display: none; }
    .phead { padding: 20px 18px; }
  }
  @media (max-width: 400px) { .nav-actions { gap: 6px; } .lang-switch { padding: 0 4px; } .lang-switch a { padding: 6px 4px; } .nav .btn { padding: 9px 12px; font-size: 14px; } }
  @media (max-width: 360px) { .wrap { padding: 0 12px; } .nav-actions { gap: 4px; } .theme-toggle { padding: .5rem .65rem; } .acct > summary { max-width: 82px; padding: 0 10px; } }
  @media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* a sub-site that is somebody else's brand: its colours on the pages where its people sign in (config.DRESS) */
body.dress-hicmobile { --accent: #3A3E8C; --accent-ink: #FFFFFF; }
.dress-head { background: #1E2033; border-bottom: 0; }
.dress-head .nav { min-height: 72px; }
.dress-head .brand img { display: block; height: 34px; width: auto; }
