/* 0ps · hub operativo — design «console live»: superfici neutre, un accento indaco,
   colori di stato solo come segnale (mai unico portatore: c'è sempre il testo). */
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-400-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-600-latin.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-glow: #e9e8ff;
  --surface: #ffffff;
  --surface-2: #f4f4f6;
  --surface-3: #ececf0;
  --glass: rgb(255 255 255 / .72);
  --ink: #18181b;
  --mute: #5b5b66;
  --faint: #9a9aa6;
  --line: #e4e4ea;
  --line-strong: #d3d3dc;
  --accent: #4f46e5;
  --accent-ink: #4338ca;
  --accent-soft: #eef0ff;
  --on-accent: #fff;
  --focus: #4f46e5;
  --shadow-sm: 0 1px 2px rgb(16 16 24 / .05);
  --shadow: 0 1px 2px rgb(16 16 24 / .04), 0 8px 24px -12px rgb(16 16 24 / .14);
  --shadow-lg: 0 24px 64px -24px rgb(16 16 24 / .35);
  --open: #2563eb;   --open-bg: #e8efff;   --open-ink: #1d4ed8;
  --doing: #7c3aed;  --doing-bg: #f1eaff;  --doing-ink: #6d28d9;
  --blocked: #dc2626;--blocked-bg: #fdecec;--blocked-ink: #b91c1c;
  --hold: #d97706;   --hold-bg: #fdf3e3;   --hold-ink: #92400e;
  --done: #16a34a;   --done-bg: #e7f6ec;   --done-ink: #166534;
  --backlog: #64748b;--backlog-bg: #eef1f5;--backlog-ink: #475569;
  --live: #16a34a;
  --radius: 14px;
  --radius-sm: 10px;
  --side: 264px;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font: 15px/1.55 var(--sans);
  font-feature-settings: "cv11", "ss01";
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0f;
  --bg-glow: #1b1840;
  --surface: #131318;
  --surface-2: #1a1a21;
  --surface-3: #23232c;
  --glass: rgb(16 16 21 / .72);
  --ink: #ececf1;
  --mute: #a1a1ad;
  --faint: #62626e;
  --line: #24242c;
  --line-strong: #32323d;
  --accent: #8b8cff;
  --accent-ink: #a5a6ff;
  --accent-soft: #1f1e3d;
  --on-accent: #0b0b0f;
  --focus: #a5a6ff;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
  --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 12px 32px -16px rgb(0 0 0 / .7);
  --shadow-lg: 0 32px 80px -24px rgb(0 0 0 / .8);
  --open: #60a5fa;   --open-bg: #14223d;   --open-ink: #93c5fd;
  --doing: #a78bfa;  --doing-bg: #241a3f;  --doing-ink: #c4b5fd;
  --blocked: #f87171;--blocked-bg: #3a1618;--blocked-ink: #fca5a5;
  --hold: #fbbf24;   --hold-bg: #33260e;   --hold-ink: #fcd34d;
  --done: #4ade80;   --done-bg: #10301d;   --done-ink: #86efac;
  --backlog: #94a3b8;--backlog-bg: #1c2230;--backlog-ink: #cbd5e1;
  --live: #4ade80;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 80px; }
body { margin: 0; min-width: 300px; background:
  radial-gradient(1100px 420px at 70% -140px, var(--bg-glow), transparent 70%) no-repeat, var(--bg); min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
svg { display: block; width: 18px; height: 18px; flex: none; }
p, h1, h2, h3, h4 { margin: 0; }
kbd { font: 600 .72rem/1 var(--mono); color: var(--faint); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 3px 6px; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 30; top: 10px; left: 10px; padding: 8px 14px; background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.muted { color: var(--mute); }

/* --- sidebar ---------------------------------------------------------------------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side); display: flex; flex-direction: column; padding: 22px 14px 14px; background: var(--glass); backdrop-filter: saturate(1.6) blur(18px); border-right: 1px solid var(--line); z-index: 8; }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 8px 26px; font-size: 1.12rem; font-weight: 750; line-height: 1.1; letter-spacing: -.02em; }
.brand img { border-radius: 10px; box-shadow: var(--shadow); }
.brand small, .side-footer small { display: block; color: var(--mute); font-size: .76rem; font-weight: 500; letter-spacing: 0; margin-top: 4px; }
#navigation { display: grid; gap: 2px; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.nav-link { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 36px; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--mute); font-size: .875rem; font-weight: 550; transition: background .15s, color .15s; }
.nav-link:hover { background: var(--surface-3); color: var(--ink); }
.nav-link[aria-current="page"] { color: var(--accent-ink); background: var(--accent-soft); font-weight: 650; }
.nav-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font: 600 .74rem/1 var(--mono); color: var(--mute); background: var(--surface-3); padding: 4px 7px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.nav-link[aria-current="page"] .nav-count { background: var(--surface); color: var(--accent-ink); }
.project-nav { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.side-label { display: flex; justify-content: space-between; padding: 0 10px; margin-bottom: 10px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
#project-nav { overflow-y: auto; padding: 4px 2px; margin: 8px -2px 0; display: grid; align-content: start; gap: 1px; scrollbar-width: thin; }
.side-footer { display: flex; align-items: center; gap: 10px; padding: 14px 10px 4px; margin-top: 12px; border-top: 1px solid var(--line); font-size: .82rem; font-weight: 600; }
.private-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--surface-3); color: var(--mute); }

/* --- shell + topbar --------------------------------------------------------------- */
.shell { margin-left: var(--side); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 clamp(16px, 3vw, 36px); background: var(--glass); backdrop-filter: saturate(1.6) blur(18px); border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--mute); font-size: .86rem; }
.breadcrumb svg { width: 14px; height: 14px; color: var(--faint); }
.breadcrumb strong { color: var(--ink); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-button { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--mute); box-shadow: var(--shadow-sm); transition: color .15s, border-color .15s, background .15s; }
.icon-button:hover { color: var(--ink); border-color: var(--line-strong); }
.theme-toggle .theme-sun, [data-theme="dark"] .theme-toggle .theme-moon { display: none; }
[data-theme="dark"] .theme-toggle .theme-sun { display: block; }
.control-button { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: .86rem; font-weight: 600; box-shadow: var(--shadow-sm); transition: border-color .15s, background .15s, color .15s; }
.control-button:hover { border-color: var(--line-strong); }
.control-button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.control-button:disabled { opacity: .65; cursor: default; }
.refresh-button.is-busy svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* pill di stato live */
.live-pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .78rem; font-weight: 650; color: var(--mute); white-space: nowrap; }
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.live-pill[data-state="live"] { color: var(--done-ink); border-color: color-mix(in srgb, var(--live) 35%, var(--line)); }
.live-pill[data-state="live"] .live-dot { background: var(--live); }
.live-pill[data-state="live"] .live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--live); opacity: 0; animation: ping 2.4s cubic-bezier(0, 0, .2, 1) infinite; }
.live-pill[data-state="syncing"] .live-dot { background: var(--accent); }
.live-pill[data-state="stale"] { color: var(--hold-ink); background: var(--hold-bg); border-color: transparent; }
.live-pill[data-state="stale"] .live-dot { background: var(--hold); }
.live-pill[data-state="error"] { color: var(--blocked-ink); background: var(--blocked-bg); border-color: transparent; }
.live-pill[data-state="error"] .live-dot { background: var(--blocked); }
@keyframes ping { 0% { transform: scale(.6); opacity: .7; } 80%, 100% { transform: scale(1.6); opacity: 0; } }

/* --- main ------------------------------------------------------------------------- */
main { width: 100%; max-width: 1240px; padding: 28px clamp(16px, 3vw, 36px) 40px; }
.stale-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 20px; border-radius: var(--radius); background: var(--hold-bg); color: var(--hold-ink); border: 1px solid color-mix(in srgb, var(--hold) 30%, transparent); font-size: .88rem; }
.stale-banner p { flex: 1; }
.stale-banner .text-button { color: inherit; text-decoration: underline; }

.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.hero-context { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--accent-ink); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hero-diamond { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.hero h1 { font-size: clamp(1.7rem, 2.6vw, 2.35rem); line-height: 1.1; letter-spacing: -.035em; font-weight: 760; }
.hero p { margin-top: 8px; color: var(--mute); max-width: 60ch; }
.sync-card { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 250px; }
.sync-card > div { display: grid; gap: 1px; }
.sync-ring { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--done-bg); color: var(--done-ink); }
.sync-card[data-state="stale"] .sync-ring, .sync-card[data-state="error"] .sync-ring { background: var(--hold-bg); color: var(--hold-ink); }
.sync-card[data-state="loading"] .sync-ring, .sync-card[data-state="syncing"] .sync-ring { background: var(--accent-soft); color: var(--accent-ink); }
.sync-label { font-size: .72rem; font-weight: 650; color: var(--mute); text-transform: uppercase; letter-spacing: .05em; }
.sync-card time { font: 600 .92rem/1.3 var(--mono); font-variant-numeric: tabular-nums; }
.sync-age { font-size: .78rem; color: var(--mute); }

.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.metric { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); text-align: left; transition: transform .15s, box-shadow .15s, border-color .15s; }
button.metric:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.metric[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.metric-body { display: grid; min-width: 0; }
.metric strong { font: 650 1.5rem/1.1 var(--mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.metric small { color: var(--mute); font-size: .8rem; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; flex: none; }
.metric-icon.neutral { background: var(--surface-3); color: var(--mute); }
.metric-icon.open { background: var(--open-bg); color: var(--open-ink); }
.metric-icon.doing { background: var(--doing-bg); color: var(--doing-ink); }
.metric-icon.blocked { background: var(--blocked-bg); color: var(--blocked-ink); }
.metric-icon.hold { background: var(--hold-bg); color: var(--hold-ink); }

/* --- lavoro ----------------------------------------------------------------------- */
.work-section { padding: 22px; border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); background: var(--surface); box-shadow: var(--shadow); }
.work-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.work-header h2 { font-size: 1.15rem; letter-spacing: -.02em; }
.work-header p { color: var(--mute); font-size: .82rem; margin-top: 3px; }
.text-button { border: 0; background: none; padding: 4px 2px; color: var(--accent-ink); font-size: .84rem; font-weight: 600; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.search-wrap { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--faint); transition: border-color .15s, box-shadow .15s, background .15s; }
.search-wrap:focus-within { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-wrap input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font-size: .88rem; }
.search-wrap input::placeholder { color: var(--faint); }
.main-search { flex: 1 1 280px; }
.side-search { margin: 0 2px; height: 36px; }
.select-wrap select { height: 38px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .86rem; font-weight: 550; appearance: none; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; box-shadow: var(--shadow-sm); }
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 2px 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; color: var(--mute); font-size: .82rem; }
#tree-tools { display: flex; gap: 12px; }

.results { display: grid; gap: 10px; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.chevron { width: 15px; height: 15px; color: var(--faint); transition: transform .18s ease; }
details[open] > summary > .chevron { transform: rotate(90deg); }
.project-group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.project-summary { display: flex; align-items: center; gap: 10px; padding: 13px 16px; font-weight: 650; transition: background .15s; }
.project-summary:hover { background: var(--surface-2); }
.project-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); }
.project-icon svg { width: 16px; height: 16px; }
.group-title { flex: 1; min-width: 0; overflow-wrap: anywhere; letter-spacing: -.01em; }
.group-meta { color: var(--mute); font-size: .78rem; font-weight: 550; white-space: nowrap; font-variant-numeric: tabular-nums; }
.phase-list { display: grid; gap: 8px; padding: 0 12px 12px; }
.phase-group { border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid transparent; }
.phase-group[open] { border-color: var(--line); }
.phase-summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); }
.phase-summary:hover { background: var(--surface-3); }
.phase-left { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.phase-title { font-size: .9rem; font-weight: 620; overflow-wrap: anywhere; }
.phase-tag { font: 700 .64rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-soft); padding: 4px 6px; border-radius: 5px; }
.phase-meta { display: flex; align-items: center; gap: 10px; }
.phase-progress { width: 72px; height: 6px; border: 0; border-radius: 999px; overflow: hidden; background: var(--surface-3); appearance: none; }
.phase-progress::-webkit-progress-bar { background: var(--surface-3); border-radius: 999px; }
.phase-progress::-webkit-progress-value { background: var(--done); border-radius: 999px; }
.phase-progress::-moz-progress-bar { background: var(--done); border-radius: 999px; }
.phase-link { display: inline-block; margin: 2px 14px 12px; color: var(--accent-ink); font-size: .8rem; font-weight: 600; }
.phase-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.task-list { display: grid; gap: 6px; padding: 4px 8px 8px; }

.task { position: relative; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.task:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.issue-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 4px; }
.issue-title { display: flex; align-items: baseline; gap: 9px; flex: 1; min-width: 0; padding: 6px 8px; border: 0; border-radius: 8px; background: none; text-align: left; font-size: .9rem; line-height: 1.4; }
.issue-title strong { font-weight: 560; overflow-wrap: anywhere; }
.issue-title:hover strong { color: var(--accent-ink); }
.status-mark { flex: none; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--open); box-shadow: 0 0 0 3px var(--open-bg); }
.status-doing .status-mark { background: var(--doing); box-shadow: 0 0 0 3px var(--doing-bg); }
.status-blocked .status-mark { background: var(--blocked); box-shadow: 0 0 0 3px var(--blocked-bg); }
.status-hold .status-mark { background: var(--hold); box-shadow: 0 0 0 3px var(--hold-bg); }
.status-backlog .status-mark { background: var(--backlog); box-shadow: 0 0 0 3px var(--backlog-bg); }
.status-done .status-mark, .status-closed .status-mark { background: var(--done); box-shadow: 0 0 0 3px var(--done-bg); }
.status-done .issue-title strong, .status-closed .issue-title strong { color: var(--mute); }
.issue-number { font: 600 .78rem/1 var(--mono); color: var(--faint); flex: none; font-variant-numeric: tabular-nums; }
.issue-tags { display: flex; align-items: center; gap: 6px; flex: none; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: .72rem; font-weight: 650; white-space: nowrap; background: var(--surface-3); color: var(--mute); }
.badge.p1 { background: var(--blocked-bg); color: var(--blocked-ink); font-family: var(--mono); }
.badge.p2 { background: var(--hold-bg); color: var(--hold-ink); font-family: var(--mono); }
.badge.p3 { background: var(--surface-3); color: var(--mute); font-family: var(--mono); }
.badge.todo, .badge.open { background: var(--open-bg); color: var(--open-ink); }
.badge.doing { background: var(--doing-bg); color: var(--doing-ink); }
.badge.blocked { background: var(--blocked-bg); color: var(--blocked-ink); }
.badge.hold { background: var(--hold-bg); color: var(--hold-ink); }
.badge.backlog { background: var(--backlog-bg); color: var(--backlog-ink); }
.badge.done { background: var(--done-bg); color: var(--done-ink); }
.badge.closed, .badge.unknown, .badge.source { background: var(--surface-3); color: var(--mute); }
.prompt-button { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--mute); font-size: .74rem; font-weight: 650; transition: color .15s, border-color .15s, background .15s; }
.prompt-button svg { width: 14px; height: 14px; }
.prompt-button:hover { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }

/* evidenza di una modifica arrivata dal vivo */
.task.is-updated { border-color: color-mix(in srgb, var(--accent) 55%, transparent); animation: flash 2.4s ease-out 1; }
.fresh-tag { flex: none; align-self: center; font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-soft); padding: 3px 7px; border-radius: 999px; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); } 100% { box-shadow: 0 0 0 0 transparent; background: var(--surface); } }

.inline-micro { margin: 0 10px 8px 30px; }
.inline-micro > summary { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 6px; color: var(--mute); font-size: .78rem; font-weight: 600; }
.inline-micro > summary:hover { color: var(--ink); background: var(--surface-2); }
.micro-list { list-style: none; margin: 6px 0 2px; padding: 0 0 0 4px; display: grid; gap: 2px; border-left: 2px solid var(--line); }
.micro-list li { display: flex; align-items: flex-start; gap: 8px; padding: 5px 4px 5px 10px; font-size: .84rem; }
.micro-list li > svg { width: 15px; height: 15px; margin-top: 2px; color: var(--faint); }
.micro-list li.is-done > svg { color: var(--done); }
.micro-list li.is-done .micro-text { color: var(--mute); text-decoration: line-through; text-decoration-color: var(--faint); }
.micro-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.micro-text a { color: var(--accent-ink); }
.micro-text a:hover { text-decoration: underline; }
.micro-list .prompt-button { opacity: 0; }
.micro-list li:hover .prompt-button, .micro-list .prompt-button:focus-visible { opacity: 1; }

.empty { display: grid; gap: 4px; padding: 36px 16px; text-align: center; color: var(--mute); font-size: .9rem; }
.empty strong { color: var(--ink); }
.empty.small { padding: 12px; font-size: .82rem; }
.skeleton { display: grid; gap: 10px; }
.skeleton span { height: 54px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; color: var(--mute); font-size: .8rem; }
.footer > span { display: inline-flex; align-items: center; gap: 8px; }
.footer svg { width: 15px; height: 15px; }
.footer a { color: var(--accent-ink); font-weight: 600; }

/* --- dialoghi --------------------------------------------------------------------- */
dialog { width: min(640px, calc(100vw - 24px)); max-height: min(86vh, 900px); padding: 22px; border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgb(8 8 12 / .45); backdrop-filter: blur(4px); }
dialog[open] { animation: rise .2s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.dialog-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; color: var(--mute); font-size: .8rem; }
.dialog-top h2 { color: var(--ink); font-size: 1.15rem; letter-spacing: -.02em; }
#issue-detail h2 { font-size: 1.25rem; line-height: 1.3; letter-spacing: -.02em; margin-bottom: 12px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.detail-source { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: .84rem; font-weight: 600; }
.detail-source:hover { border-color: var(--line-strong); }
.detail-block { margin-top: 18px; }
.detail-block h3 { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); margin-bottom: 8px; }
.criterion { white-space: pre-line; font-size: .88rem; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border-left: 3px solid var(--accent); }
.eyebrow { font: 600 .74rem/1 var(--mono); color: var(--accent-ink); margin-bottom: 6px; }
.prompt-ticket-title { margin: -4px 0 16px; color: var(--mute); font-size: .9rem; }
.prompt-form, .prompt-settings, .prompt-extra { display: grid; gap: 12px; }
.prompt-field { display: grid; gap: 6px; font-size: .8rem; font-weight: 650; color: var(--mute); }
.prompt-field input, .prompt-field select, .prompt-field textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); font-size: .88rem; font-weight: 450; }
.prompt-field input:focus, .prompt-field select:focus, .prompt-field textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.prompt-missing { color: var(--hold-ink); font-size: .8rem; }
.prompt-options > summary { display: inline-flex; align-items: center; gap: 6px; color: var(--mute); font-size: .84rem; font-weight: 600; }
.prompt-options[open] > summary .chevron { transform: rotate(90deg); }
.prompt-extra { margin-top: 12px; }
.prompt-ready { display: grid; gap: 8px; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.prompt-copy { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; font-weight: 650; color: var(--mute); }
.prompt-output { min-height: 220px; font: .78rem/1.5 var(--mono) !important; }
.primary-button { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 0; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); font-size: .84rem; font-weight: 650; box-shadow: var(--shadow-sm); }
.primary-button:hover { filter: brightness(1.08); }
#prompt-feedback { font-size: .8rem; color: var(--done-ink); }

/* --- responsive ------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); background: var(--surface); }
  .menu-open .sidebar { transform: none; }
  .shell { margin-left: 0; }
  .hero { flex-direction: column; align-items: stretch; }
  .sync-card { min-width: 0; }
  .refresh-button .label { display: none; }
  .refresh-button { width: 38px; padding: 0; justify-content: center; }
}
@media (max-width: 620px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-section { padding: 14px; }
  .issue-row { flex-wrap: wrap; }
  .issue-tags { padding-left: 28px; flex-wrap: wrap; }
  .prompt-button span { display: none; }
  .phase-progress { display: none; }
  .breadcrumb > span { display: none; }
  .breadcrumb > svg { display: none; }
  .live-pill { padding: 0 8px; }
  #live-text { display: none; }
  .inline-micro { margin-left: 12px; }
  .micro-list .prompt-button { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
