/* app.css — мобильный каркас хаба поверх lumen.css */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.hub {
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.5 Onest, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    padding-bottom: env(safe-area-inset-bottom);
}
body.hub::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(900px 520px at 12% -8%, var(--glow-a), transparent 62%),
        radial-gradient(800px 560px at 96% 10%, var(--glow-b), transparent 60%),
        radial-gradient(700px 500px at 50% 120%, var(--glow-b), transparent 60%);
}
#app { min-height: 100vh; }

/* верхняя панель */
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    backdrop-filter: blur(18px) saturate(1.4);
    border-bottom: 1px solid var(--line);
}
.topbar .titles { flex: 1; min-width: 0; }
.topbar .titles b { font-family: var(--font-display); font-weight: 400; font-size: 18px; display: block; }
.topbar .titles small { color: var(--muted); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orb {
    width: 42px; height: 42px; border-radius: 50%; flex: none; cursor: pointer;
    background: radial-gradient(circle at 35% 30%, #fff, var(--brand) 45%, var(--violet) 130%);
    box-shadow: 0 0 18px var(--glow-a), 0 0 0 1px var(--line);
    overflow: hidden;
}
.orb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.iconbtn {
    width: 40px; height: 40px; border-radius: 50%; flex: none; cursor: pointer;
    display: grid; place-items: center; font-size: 17px;
    background: var(--surface); border: 1px solid var(--line); color: var(--ink);
    transition: transform .35s var(--spring), background .16s ease;
}
.iconbtn:active { transform: scale(.92); }

/* контент */
.content { padding: 12px 16px 130px; display: flex; flex-direction: column; gap: 12px; }
.section-title { font: 500 11px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* стеклянная карточка уже есть в lumen.css как .card; добавляем мобильные отступы */
.card { padding: 16px 18px; }

/* задачи */
.task { display: flex; gap: 0; padding: 0; overflow: hidden; cursor: pointer; }
.task .accent { width: 6px; flex: none; }
.task .body { padding: 14px 16px; flex: 1; min-width: 0; }
.task h3 { font-family: Onest, sans-serif; font-weight: 650; font-size: 16px; margin: 0 0 8px; color: var(--ink); }
.task .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.task .meta { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.task .meta + .meta { margin-top: 4px; }
.overdue { color: var(--err); font-weight: 600; }
.avatars { display: flex; }
.avatars .av { width: 22px; height: 22px; border-radius: 50%; margin-left: -6px; border: 1px solid var(--bg); display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 700; }
.avatars .av:first-child { margin-left: 0; }

/* фильтры */
.chiprow { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.chiprow::-webkit-scrollbar { display: none; }
.pill { border-radius: 999px; padding: 7px 12px; font-size: 12.5px; white-space: nowrap; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.pill.on { background: var(--brand-l); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 32%, transparent); font-weight: 600; }

/* нижний док */
.dock {
    position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex; gap: 4px; padding: 6px; z-index: 30;
    border-radius: 24px; border: 1px solid var(--line);
    background: color-mix(in srgb, var(--pop) 88%, transparent);
    backdrop-filter: blur(22px) saturate(1.6);
    box-shadow: 0 18px 40px -12px rgba(0,0,0,.5), var(--inner);
    transition: transform .5s var(--spring), opacity .3s;
    max-width: calc(100vw - 24px);
}
.dock.away { transform: translate(-50%, calc(100% + 30px)); opacity: 0; }
.dock .item { display: grid; justify-items: center; gap: 2px; min-width: 62px; padding: 8px 6px 6px; border-radius: 18px; cursor: pointer; color: var(--muted); font-size: 10.5px; font-weight: 500; }
.dock .item i { font-style: normal; font-size: 18px; }
.dock .item.on { background: var(--brand-l); color: var(--brand); }
.dock .item:active { transform: scale(.92); }

/* FAB */
.fab {
    position: fixed; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 25;
    width: 56px; height: 56px; border-radius: 19px; border: 1px solid transparent;
    display: grid; place-items: center; cursor: pointer; font-size: 22px;
    color: var(--on-brand);
    background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 100%, #fff 14%), var(--brand));
    box-shadow: 0 12px 28px -12px var(--brand), 0 2px 5px rgba(0,0,0,.2);
}
.fab:active { transform: scale(.94); }

/* формы */
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field > span { color: var(--ink); opacity: .82; font-size: 14px; }
input[type=text], input[type=password], input[type=search], textarea, select {
    width: 100%; font: inherit; padding: 12px; border-radius: 12px;
    background: var(--field); border: 1px solid var(--line); color: var(--ink);
    box-shadow: inset 0 2px 6px rgba(0,0,0,.08);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent); }
.btn { min-height: 48px; width: 100%; }
.btn.block { display: flex; }
.btnrow { display: flex; gap: 8px; }
.btnrow .btn { flex: 1; }
.btn.blue { background: linear-gradient(180deg, color-mix(in srgb, #2f6feb 100%, #fff 14%), #2f6feb); color: #fff; }

/* центр (вход/выбор) */
.center { min-height: 100vh; display: grid; align-content: center; justify-items: center; padding: 24px; gap: 14px; }
.center .logo-big { width: 96px; height: 96px; border-radius: 28px; background: #fff; overflow: hidden; box-shadow: 0 0 60px -12px var(--glow-a); }
.center .logo-big img { width: 100%; height: 100%; object-fit: contain; }
.center h1 { font-family: var(--font-display); font-weight: 300; font-size: 30px; margin: 6px 0 0; }
.center .muted { color: var(--muted); font-size: 13px; text-align: center; }

/* сервисы в выборе */
.svc { display: flex; align-items: center; gap: 14px; cursor: pointer; width: 100%; }
.svc .svc-orb { width: 46px; height: 46px; border-radius: 50%; flex: none; background: radial-gradient(circle at 35% 30%, #fff, var(--brand) 45%, var(--violet) 130%); overflow: hidden; }
.svc .svc-orb img { width: 100%; height: 100%; object-fit: cover; }
.svc b { font-size: 16px; }
.svc small { display: block; color: var(--muted); font-size: 12px; }

/* список файлов/исполнителей */
.rowitem { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.rowitem .grow { flex: 1; min-width: 0; }
.rowitem .grow small { color: var(--muted); display: block; font-size: 12px; }
.linkbtn { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: 6px; }

/* чат на весь экран */
.chatfull { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg); }
.chatfull .messages { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.chatfull .bottom { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--pop) 95%, transparent); padding: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
.chatfull .bottom .line { display: flex; gap: 8px; align-items: flex-end; }
.chatfull .bottom textarea { min-height: 44px; max-height: 120px; }
.msg { border-radius: 14px; border: 1px solid var(--line); background: var(--surface); padding: 10px 12px; }
.msg.mine { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }
.msg .who { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.msg .who b { font-size: 13px; }
.msg .who time { margin-left: auto; color: var(--muted); font: 400 10.5px var(--font-mono); }
.msg .text { white-space: pre-wrap; word-break: break-word; }
.attachments { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.attachment { font-size: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; }

/* история */
.hist { display: flex; align-items: flex-start; gap: 10px; }
.hist time { color: var(--muted); font: 400 11px var(--font-mono); white-space: nowrap; }

/* пусто/загрузка */
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty .big { font-size: 40px; display: block; margin-bottom: 8px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* тосты */
#toasts { position: fixed; left: 0; right: 0; bottom: calc(84px + env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 8px; z-index: 90; pointer-events: none; }
.toast { pointer-events: auto; background: var(--pop); border: 1px solid var(--line); border-radius: 16px; padding: 10px 16px; box-shadow: var(--shadow); font-size: 14px; max-width: 90vw; }
.toast.err { background: color-mix(in srgb, var(--err) 20%, var(--pop)); border-color: var(--err); }
.toast.ok { background: color-mix(in srgb, var(--ok) 18%, var(--pop)); border-color: var(--ok); }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition-duration: .01ms !important; }
}
