:root {
  --bg: #f3f5f8; --card: #fff; --ink: #14202e; --muted: #6b7a8c; --line: #e1e6ed;
  --brand: #0f2a43; --accent: #f5a623; --ok: #1f9d55; --warn: #e08a00; --bad: #d64545; --blue: #2a6fdb;
  --radius: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
h1 { font-size: 1.25rem; margin: 0; } h2 { font-size: 1.05rem; margin: 18px 0 8px; } h3 { font-size: 1rem; margin: 0 0 4px; }
.topbar { position: sticky; top: 0; z-index: 10; background: var(--brand); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; gap: 10px; }
.topbar h1 { flex: 1; font-size: 1.1rem; }
.topbar button { background: transparent; color: #fff; border: 0; font-size: 1.4rem; padding: 4px 8px; }
main { padding: 12px 16px; max-width: 900px; margin: 0 auto; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.nav a { flex: 1; text-align: center; padding: 8px 2px 6px; color: var(--muted); text-decoration: none; font-size: .72rem; }
.nav a .ic { display: block; font-size: 1.3rem; line-height: 1.2; }
.nav a.on { color: var(--brand); font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 10px; }
.row { display: flex; align-items: center; gap: 10px; } .row.sb { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: .85rem; } .small { font-size: .8rem; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .72rem; background: #e8edf4; color: var(--brand); }
.tag.ok { background: #dff3e6; color: #156b3a; } .tag.warn { background: #fdecc8; color: #8a5500; } .tag.bad { background: #fbe0e0; color: #9b2c2c; } .tag.blue { background: #dde9fb; color: #1b4fa0; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.kpi b { display: block; font-size: 1.25rem; } .kpi span { color: var(--muted); font-size: .78rem; }
.pos { color: var(--ok); } .neg { color: var(--bad); }
.bar { height: 8px; background: #e7ecf2; border-radius: 99px; overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--ok); }
.bar.goal > i { background: var(--accent); }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0; padding-bottom: 2px; }
.tabs button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 14px; font-size: .9rem; }
.tabs button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
button, .btn { font: inherit; }
.btn { display: inline-block; border: 0; border-radius: 10px; padding: 10px 16px; background: var(--brand); color: #fff; font-weight: 600; cursor: pointer; text-align: center; }
.btn.sec { background: #e8edf4; color: var(--brand); } .btn.danger { background: var(--bad); } .btn.block { width: 100%; } .btn.sm { padding: 6px 12px; font-size: .85rem; }
.fab { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 2rem; box-shadow: 0 4px 12px rgba(0,0,0,.25); z-index: 9; }
label.f { display: block; margin: 10px 0; font-size: .85rem; color: var(--muted); }
label.f input, label.f select, label.f textarea { display: block; width: 100%; margin-top: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
label.f textarea { min-height: 80px; resize: vertical; }
label.chk { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.modal-bg { position: fixed; inset: 0; background: rgba(10,20,30,.55); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 16px; } }
.err { background: #fbe0e0; color: #9b2c2c; padding: 8px 12px; border-radius: 10px; margin: 8px 0; font-size: .9rem; }
.login { max-width: 380px; margin: 12vh auto 0; padding: 0 16px; } .login .logo { text-align: center; margin-bottom: 18px; } .login .logo img { width: 72px; border-radius: 16px; }
.tree-i { padding-left: 14px; border-left: 2px solid var(--line); margin-left: 6px; }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; } .task.done .t { text-decoration: line-through; color: var(--muted); }
.chk-b { flex: none; width: 26px; height: 26px; border: 2px solid #b8c3d1; border-radius: 8px; background: #fff; padding: 0; font-size: 1rem; line-height: 1; color: #fff; }
.chk-b.done { background: var(--ok); border-color: var(--ok); } .chk-b.doing { border-color: var(--blue); background: #dde9fb; color: var(--blue); }
.gantt { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.g-head, .g-row { display: flex; } .g-name { flex: none; width: 140px; padding: 6px 8px; font-size: .8rem; border-right: 1px solid var(--line); position: sticky; left: 0; background: #fff; z-index: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-track { position: relative; height: 30px; flex: none; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); }
.g-bar { position: absolute; top: 7px; height: 16px; border-radius: 6px; background: var(--blue); } .g-bar.done { background: var(--ok); } .g-bar.phase { background: var(--brand); opacity: .75; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); }
.g-ml { font-size: .68rem; color: var(--muted); border-left: 1px solid var(--line); padding-left: 3px; position: absolute; top: 4px; }
.cols { display: flex; flex-direction: column; gap: 6px; }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }
pre.code { background: #0f2a43; color: #e8edf4; padding: 10px; border-radius: 10px; overflow: auto; font-size: .75rem; white-space: pre-wrap; word-break: break-all; }
a { color: var(--blue); }

/* ---- avvisi, Gantt esteso ---- */
.bell { position: relative; }
.badge { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: #fff; font-size: .7rem; line-height: 18px; text-align: center; font-weight: 700; }
.badge.bad { background: var(--bad); }
.brand { display: none; }
.g-inner { position: relative; }
.g-head .g-track { height: 30px; background: #f7f9fb; }
.g-bar { cursor: pointer; overflow: hidden; color: #fff; font-size: .68rem; line-height: 16px; padding-left: 5px; }
.g-bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0, 0, 0, .28); pointer-events: none; }
.g-bar > span { position: relative; }
.g-deps { position: absolute; pointer-events: none; }
.g-dep { fill: none; stroke: #6b7a8c; stroke-width: 1.4; } .g-dep.bad { stroke: var(--bad); }
.g-bar { z-index: 0; } .g-today { z-index: 0; }


/* ---- menu laterale (desktop) e barra in basso (mobile) ---- */
.side { display: none; }
.timer-pill { display: flex !important; align-items: center; gap: 6px; background: #d64545 !important; border-radius: 99px !important; font-size: .85rem !important; padding: 4px 12px !important; }
.timer-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* ---- componenti comuni ---- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: block; }
.tile .tl { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 4px; }
.tile b { font-size: 2rem; line-height: 1; color: var(--muted); } .tile b.neg { color: var(--bad); } .tile b.blu { color: var(--blue); }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: start; }
.card h3 { margin: 0 0 8px; font-size: .95rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: .75rem; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover { background: #f5f8fc; }
.tbl tr.tot td { font-weight: 700; background: #f5f8fc; }
.pill { display: inline-block; min-width: 20px; text-align: center; padding: 1px 8px; border-radius: 99px; font-size: .72rem; background: #e8edf4; color: var(--brand); }
.pill.bad { background: #fbe0e0; color: #9b2c2c; } .pill.blue { background: #dde9fb; color: #1b4fa0; } .pill.ok { background: #dff3e6; color: #156b3a; } .pill.warn { background: #fdecc8; color: #8a5500; }
.sev { display: inline-block; padding: 1px 8px; border-radius: 4px; color: #fff; font-size: .72rem; }
.chip { display: inline-block; padding: 1px 6px; border-radius: 6px; background: #eef2f7; font-size: .72rem; color: var(--muted); } .chip.bad { background: #fbe0e0; color: #9b2c2c; }
.av { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: #dde9fb; color: #1b4fa0; font-size: .68rem; font-weight: 700; flex: none; }
.dotc { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.donut { width: 120px; height: 120px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.donut > div { width: 84px; height: 84px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.donut b { font-size: 1.3rem; } .donut span { font-size: .68rem; color: var(--muted); }
.ag-bar { margin-bottom: 10px; gap: 8px; flex-wrap: wrap; }
.ag-bar select, .ag-bar input { padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; }
.cmt { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin-bottom: 8px; }
.bigtime { font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: 6px 0; }

/* ---- Kanban stile Trello ---- */
.kb-bar { gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.kb-bar select, .kb-bar input { padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; }
.kb { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 12px; -webkit-overflow-scrolling: touch; }
.kb-col { flex: 0 0 300px; background: #e4e9f0; border-radius: 12px; padding: 8px; max-height: calc(100vh - 210px); display: flex; flex-direction: column; }
.kb-h { display: flex; justify-content: space-between; padding: 4px 6px 8px; }
.kb-list { overflow-y: auto; min-height: 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kb-card { background: #fff; border-radius: 8px; padding: 8px 10px 8px; box-shadow: 0 1px 0 rgba(9, 30, 66, .25); cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.kb-card:hover { background: #f8fafc; } .kb-card.done .kb-t { text-decoration: line-through; color: var(--muted); }
.kb-card.ph { opacity: .35; }
.kb-card.ghost { position: fixed; z-index: 100; pointer-events: none; transform: rotate(3deg); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); margin: 0; }
.kb-lab { height: 6px; width: 40px; border-radius: 4px; margin-bottom: 6px; }
.kb-t { font-size: .92rem; margin-bottom: 4px; word-break: break-word; }
.kb-m { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px; } .kb-m .sp { flex: 1; }
.kb-addbtn { background: transparent; border: 0; text-align: left; padding: 8px 6px; color: var(--muted); border-radius: 8px; cursor: pointer; margin-top: 4px; } .kb-addbtn:hover { background: rgba(9, 30, 66, .08); }
.kb-add input, .kb-add select { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; font: inherit; }

/* ---- Agenda ---- */
.tg-wrap { padding: 0; overflow: auto; }
.tg { min-width: 640px; }
.tg-head, .tg-allday { display: grid; grid-template-columns: 52px repeat(var(--n, 7), 1fr); }
.tg-head > div, .tg-allday > div { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 6px 4px; font-size: .8rem; }
.tg-dh { text-align: center; font-weight: 600; cursor: pointer; } .tg-dh.now { color: var(--blue); background: #eef4fd; }
.tg-corner { border-left: 0 !important; }
.tg-ad { display: flex; flex-direction: column; gap: 2px; min-height: 26px; }
.tg-body { position: relative; display: grid; grid-template-columns: 52px repeat(var(--n, 7), 1fr); }
.tg-hours > div { font-size: .7rem; color: var(--muted); text-align: right; padding-right: 6px; border-top: 1px solid var(--line); }
.tg-col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% 44px; cursor: pointer; }
.tg-col.now { background-color: #f7faff; }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 3; }
.ev { position: absolute; border-radius: 6px; color: #fff; font-size: .74rem; padding: 2px 5px; overflow: hidden; cursor: pointer; z-index: 2; border: 1px solid rgba(255, 255, 255, .6); }
.ev-chip { color: #fff; border-radius: 4px; font-size: .7rem; padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; margin-bottom: 2px; }
.mg { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0; overflow: hidden; }
.mg-h { text-align: center; font-size: .75rem; color: var(--muted); padding: 6px 0; border-bottom: 1px solid var(--line); }
.mg-c { min-height: 92px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 3px; cursor: pointer; overflow: hidden; }
.mg-c:nth-child(7n+8) { border-left: 0; } .mg-c.out { background: #f6f8fb; color: var(--muted); } .mg-c.now { background: #eef4fd; }
.mg-n { font-size: .75rem; font-weight: 600; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 50%; cursor: pointer; } .mg-c.now .mg-n { background: var(--blue); color: #fff; }

/* ---- Carico di lavoro ---- */
.wl-g { display: grid; gap: 2px; margin-top: 8px; overflow-x: auto; }
.wl-h { text-align: center; font-size: .68rem; } .wl-h.now { color: var(--blue); font-weight: 700; }
.wl-c { position: relative; height: 88px; background: #f1f4f8; border-radius: 4px; display: flex; align-items: flex-end; overflow: hidden; } .wl-c.we { background: #fbf4ee; }
.wl-b { width: 100%; color: #fff; font-size: .62rem; text-align: center; padding-top: 2px; border-radius: 3px 3px 0 0; }
.wl-l { position: absolute; left: 0; bottom: 0; width: 5px; background: var(--blue); }
.ts-in { width: 64px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; text-align: center; font: inherit; }
.ts th.now { color: var(--blue); }

/* ---- Gantt: trascinamento e assegnatari ---- */
.g-bar.drag { cursor: grab; touch-action: none; } .g-bar.drag:active { cursor: grabbing; }
.g-who { position: absolute; top: 3px; display: flex; gap: 2px; pointer-events: none; z-index: 1; }
.g-who .av { width: 22px; height: 22px; font-size: .6rem; }

/* ---- desktop: menu laterale scuro a sezioni, pagine larghe ---- */
@media (min-width: 960px) {
  body { padding-bottom: 0; padding-left: 244px; }
  .nav { display: none; }
  .side { display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: 244px; background: #151b27; color: #c9d3df; padding: 14px 10px; overflow-y: auto; z-index: 12; }
  .side .brand { display: block; color: #fff; font-weight: 700; font-size: 1.3rem; padding: 6px 12px 16px; }
  .side .sec > a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #c9d3df; text-decoration: none; font-size: .95rem; }
  .side .sec > a:hover { background: rgba(255, 255, 255, .07); } .side .sec > a.on { background: #243049; color: #fff; }
  .side .ic { width: 22px; text-align: center; }
  .side .sub { background: #0e131c; border-radius: 10px; margin: 2px 0 6px; padding: 6px 0; }
  .side .sub a { display: block; padding: 7px 16px 7px 46px; color: #9fb0c3; text-decoration: none; font-size: .88rem; } .side .sub a:hover { color: #fff; } .side .sub a.on { color: #fff; font-weight: 600; }
  .side .who { margin-top: auto; padding: 12px; font-size: .85rem; border-top: 1px solid rgba(255, 255, 255, .1); } .side .who a { color: #7fb0ff; }
  .topbar { padding: 14px 28px; background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); }
  .topbar h1 { font-size: 1.3rem; } .topbar button { color: var(--ink); }
  main { max-width: 1400px; padding: 20px 28px; }
  .fab { right: 32px; bottom: 32px; }
  .tiles { grid-template-columns: repeat(6, 1fr); }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .grid2 { grid-template-columns: 3fr 2fr; }
  .modal { max-width: 680px; }
  .cols { flex-direction: row; align-items: flex-start; } .cols > div { flex: 1; min-width: 0; }
  .g-name { font-size: .85rem; }
  .kb-col { flex-basis: 320px; }
}
@media (min-width: 1280px) { .kpis { grid-template-columns: repeat(6, 1fr); } }
.g-bar > span { display: block; line-height: 14px; }
.g-bar { display: flex; align-items: center; } .g-bar > span { line-height: 1; }
.ag-bar .tabs { flex-wrap: wrap; }
@media (max-width: 959px) { .ag-bar .btn.sm:not(.sec) { display: none; } .ag-bar .tabs button { padding: 6px 10px; } }

/* v4: lavagne, tabelle, griglia schede */
.grid-cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .grid-cards { grid-template-columns: repeat(3, 1fr); } }
.wb-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; height: calc(100vh - 230px); min-height: 360px; }
.wb-canvas { position: relative; width: 2400px; height: 1600px; background-image: radial-gradient(#d5dde8 1px, transparent 1px); background-size: 24px 24px; }
.wb-note { position: absolute; width: 190px; min-height: 130px; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.2); display: flex; flex-direction: column; }
.wb-head { display: flex; align-items: center; gap: 2px; padding: 2px 4px; }
.wb-grip { flex: 1; cursor: grab; touch-action: none; user-select: none; font-size: 1.1rem; color: #555; padding: 2px 4px; }
.wb-btn { border: 0; background: transparent; cursor: pointer; font-size: .9rem; padding: 2px 4px; }
.wb-note textarea { flex: 1; border: 0; background: transparent; resize: none; padding: 4px 8px 8px; font: inherit; font-size: .9rem; min-height: 96px; outline: none; }
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { color: var(--muted); font-size: .78rem; font-weight: 600; }
.tbl tr.we td { background: #fbf5ee; }
.tbl input[type=time], .tbl input[type=number] { padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }

/* anti-overflow su telefono: le tabelle scorrono dentro la scheda, la pagina non si allarga */
html, body { overflow-x: hidden; max-width: 100%; }
main, .grid2 > *, .tiles > * { min-width: 0; }
.card { overflow-x: auto; }
.card table { min-width: 0; }

/* v5: grafici, Jarvis, mail, collegamenti */
.chart-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .chart-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .chart-grid { grid-template-columns: repeat(3, 1fr); } }
.chart h3 { margin: 0 0 10px; }
.donut-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.donut-box { position: relative; flex: none; }
.donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16%; line-height: 1.1; }
.donut-c b { font-size: .85rem; white-space: nowrap; } .donut-c span { font-size: .68rem; color: var(--muted); }
.legend { flex: 1; min-width: 120px; font-size: .85rem; } .lg { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.dotc { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.pill { font-size: .75rem; padding: 3px 10px; border-radius: 99px; background: #e6ebf1; } .pill.ok { background: #d4f0de; color: #14683a; } .pill.warn { background: #ffe9c7; color: #8a5300; }
.md h3, .md h4, .md h5 { margin: 12px 0 6px; } .md p { margin: 6px 0; } .md ul, .md ol { margin: 6px 0; padding-left: 22px; }
.md pre { background: #f1f4f8; padding: 8px; border-radius: 8px; overflow-x: auto; } .md code { background: #f1f4f8; padding: 1px 4px; border-radius: 4px; }
.md .tablewrap { margin: 8px 0; }
.jv { display: grid; grid-template-columns: 1fr; gap: 12px; }
.jv-side { display: flex; flex-direction: column; gap: 8px; } .jv-conv { display: block; padding: 8px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: inherit; }
.jv-conv.on { border-color: var(--brand); } .jv-main { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.jv.has-conv .jv-side { display: none; } .jv-empty { padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.jv-msgs { display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 360px); min-height: 200px; overflow-y: auto; padding: 4px; }
.jv-msg { padding: 10px 12px; border-radius: 12px; max-width: 100%; overflow-wrap: anywhere; } .jv-msg.user { background: #dbe8ff; align-self: flex-end; max-width: 92%; white-space: pre-wrap; }
.jv-msg.assistant { background: var(--card); border: 1px solid var(--line); } .jv-msg.err { background: #fde4e4; color: #8a1f1f; }
.jv-input { display: flex; gap: 8px; align-items: flex-end; } .jv-input textarea { flex: 1; padding: 8px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
@media (min-width: 960px) { .jv { grid-template-columns: 300px 1fr; } .jv.has-conv .jv-side { display: flex; } .jv-back { display: none; } .jv-msgs { max-height: calc(100vh - 320px); } }
.mail-grid { display: grid; grid-template-columns: 1fr; gap: 12px; } @media (min-width: 960px) { .mail-grid { grid-template-columns: 380px 1fr; } }
.mail-item { padding: 8px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; overflow: hidden; } .mail-item.unread b { color: var(--brand); }
.mail-item div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; background: #f7f9fc; padding: 10px; border-radius: 8px; max-height: 50vh; overflow-y: auto; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; } .bar { flex: 1; background: var(--blue, #2a6fdb); border-radius: 2px 2px 0 0; min-height: 2px; }
a.btn { text-decoration: none; display: inline-block; }
