/* ---------- файлы: значки, плитки ---------- */
.fi { display: grid; place-items: center; width: 100%; height: 100%; background: color-mix(in srgb, var(--c) 13%, var(--surface)); color: color-mix(in srgb, var(--c) 80%, var(--text)); font-size: 13px; line-height: 16px; font-weight: 700; letter-spacing: .02em; }
.fi .ico { width: 26px; height: 26px; }
.fc-pv .fi .ico, .fl-pv .fi .ico, .att-pv .fi .ico { width: 22px; height: 22px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.sec-head .dt-h { margin-top: 0; }
.add-btn { min-height: 44px; margin-right: -8px; padding: 0 14px; border-radius: 22px; color: color-mix(in srgb, var(--accent) 75%, var(--text)); font-size: 16px; line-height: 20px; font-weight: 600; }
.add-btn:active { background: var(--surface-2); }
.ft-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 4px; }
.ft { display: flex; flex-direction: column; gap: 6px; min-width: 0; text-align: left; border-radius: 14px; }
.ft-pv { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.ft-pv img, .fc-pv img, .fl-pv img, .att-pv img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ft-n { font-size: 13px; line-height: 16px; overflow-wrap: anywhere; }
.tag { flex: none; padding: 2px 8px; border-radius: 10px; background: color-mix(in srgb, var(--doing) 16%, var(--surface)); color: color-mix(in srgb, var(--doing) 80%, var(--text)); font-size: 12px; line-height: 16px; font-weight: 600; }

/* ---------- окно «Разговор» ---------- */
.sheet.chat { display: flex; flex-direction: column; height: 88%; max-height: 88%; padding: 0; overflow: hidden; }
.chat-grab { position: relative; flex: none; height: 32px; padding-top: 10px; touch-action: none; cursor: grab; }
.chat-grab:active { cursor: grabbing; }
.chat-grab .grabber { margin-bottom: 0; }
.chat-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 8px 8px 16px; }
.chat-seg { flex: 1; }
.chat-done { flex: none; min-height: 44px; padding: 0 12px; border-radius: 22px; color: color-mix(in srgb, var(--accent) 75%, var(--text)); font-size: 17px; line-height: 22px; font-weight: 600; }
.chat-done:active { background: var(--surface-2); }
.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.msgs { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 8px 16px 12px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.msgs::-webkit-scrollbar { display: none; }
.msg-day { align-self: center; font-size: 13px; line-height: 16px; color: var(--muted); }
.m time { display: block; font-size: 12px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.m-me { align-self: flex-end; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; max-width: 88%; }
.bub { padding: 10px 14px; border-radius: 20px 20px 6px 20px; background: var(--surface-2); font-size: 17px; line-height: 22px; overflow-wrap: anywhere; }
.bub > * + * { margin-top: 8px; }
.fc-gone { font-size: 15px; line-height: 20px; color: var(--muted); }
.m-bot { display: flex; align-items: flex-start; gap: 10px; max-width: 94%; }
.bot-ic { flex: none; width: 28px; height: 28px; }
.bot-ic svg { width: 100%; height: 100%; }
.bot-body { min-width: 0; }
.bot-body p { padding-top: 3px; font-size: 17px; line-height: 22px; overflow-wrap: anywhere; }
.bot-link { position: relative; color: color-mix(in srgb, var(--accent) 75%, var(--text)); font-weight: 600; }
.bot-link::before { content: ""; position: absolute; inset: -12px -8px; }
.bot-btn { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; padding: 0 16px; border-radius: 22px; background: var(--surface-2); font-size: 15px; line-height: 20px; font-weight: 500; }
.bot-btn:active { background: var(--line); }
.fcard-btn { display: block; width: 100%; text-align: left; border-radius: 14px; }
.fcard { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 14px; background: var(--surface); }
.fc-pv { flex: none; width: 48px; height: 48px; overflow: hidden; border-radius: 10px; background: var(--surface-2); }
.fc-n { min-width: 0; }
.fc-n b { display: block; font-size: 15px; line-height: 20px; font-weight: 600; overflow-wrap: anywhere; }
.fc-n span { font-size: 13px; line-height: 16px; color: var(--muted); }
.sugg { display: grid; gap: 4px; margin-top: 4px; }
.sugg p { padding: 0 4px; font-size: 13px; line-height: 16px; color: var(--muted); }
.hint { min-height: 44px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); text-align: left; font-size: 15px; line-height: 20px; }
.hint:active { background: var(--line); }

.composer { flex: none; padding: 8px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface); }
.cmp-note { padding: 0 4px 8px; font-size: 13px; line-height: 16px; color: var(--muted); }
.composer .chips { margin-bottom: 8px; }
.composer .chips:empty { display: none; }
.cmp-att { display: grid; gap: 4px; max-height: 148px; margin-bottom: 6px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.att-item { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 16px; background: var(--surface-2); }
.att-pv { flex: none; width: 44px; height: 44px; overflow: hidden; border-radius: 10px; background: var(--surface); }
.att-n { flex: 1; min-width: 0; }
.att-n b { display: block; font-size: 15px; line-height: 20px; font-weight: 600; overflow-wrap: anywhere; }
.att-n span { font-size: 13px; line-height: 16px; color: var(--muted); }
.att-x { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 22px; color: var(--muted); }
.field { display: flex; align-items: flex-end; gap: 2px; padding: 4px; border-radius: 26px; border: 1px solid var(--line); background: var(--surface-2); }
.field:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.cmp-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.cmp-mic { background: var(--accent); color: var(--on-color); }
.cmp-mic .ico { width: 22px; height: 22px; }
.cmp-clip { color: var(--muted); }
.cmp-clip:active { background: var(--line); }
.field-text { flex: 1; min-width: 0; min-height: 44px; max-height: 118px; padding: 11px 6px; border: 0; background: none; color: var(--text); font: 400 17px/22px var(--font-ui); resize: none; overflow-y: auto; outline: none; }
.field-text::placeholder { color: var(--muted); }
.cmp-save { width: 100%; min-height: 48px; margin-top: 8px; }

/* голос: большой пульсирующий микрофон, живые столбики, слова появляются в поле */
.vc { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; padding: 8px; border-radius: 40px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.vc-mic { position: relative; flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--on-color); }
.vc-mic .ico { width: 28px; height: 28px; }
.vc-mic::before, .vc-mic::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: vc-ring 1.8s ease-out infinite; }
.vc-mic::after { animation-delay: .9s; }
@keyframes vc-ring { from { transform: scale(1); opacity: .6; } to { transform: scale(1.45); opacity: 0; } }
.vc-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.vc-wave { display: flex; align-items: center; gap: 3px; height: 32px; }
.vc-wave i { flex: none; width: 4px; height: calc(var(--h) * 100%); min-height: 6px; border-radius: 2px; background: var(--accent); animation: vc-bar .8s ease-in-out infinite alternate; animation-delay: var(--d); }
@keyframes vc-bar { from { transform: scaleY(.3); } to { transform: scaleY(1); } }
.vc-t { font-size: 15px; line-height: 20px; font-weight: 600; color: color-mix(in srgb, var(--accent) 78%, var(--text)); }
.vc-stop { flex: none; min-height: 44px; padding: 0 18px; border-radius: 22px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 16px; line-height: 20px; font-weight: 600; }
@keyframes vc-fade { from { opacity: .5; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .vc-mic::before, .vc-mic::after { display: none; }
  .vc-mic { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
  .vc-wave i { animation: vc-fade 1.2s ease-in-out infinite alternate; animation-delay: var(--d); }
}

/* вкладка «Файлы» */
.pane-files { display: block; padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.pane-files::-webkit-scrollbar { display: none; }
.fl-src { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 4px; font-size: 15px; line-height: 20px; font-weight: 500; }
.fl-search { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 0 14px; border-radius: 16px; background: var(--surface-2); color: var(--muted); }
.fl-search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.fl-search input { flex: 1; min-width: 0; min-height: 48px; padding: 0; border: 0; background: none; color: var(--text); font: 400 17px/22px var(--font-ui); outline: none; }
.fl-search input::placeholder { color: var(--muted); }
.fl-hint { margin-top: 8px; padding: 0 4px; font-size: 13px; line-height: 16px; color: var(--muted); }
.fl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.fl-folder { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 92px; padding: 12px; border-radius: 18px; background: var(--surface-2); text-align: left; }
.fl-folder:active { background: var(--line); }
.fl-fi { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 6px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: color-mix(in srgb, var(--accent) 75%, var(--text)); }
.fl-folder b { font-size: 16px; line-height: 20px; font-weight: 600; }
.fl-folder > span:last-child { font-size: 13px; line-height: 16px; color: var(--muted); }
.fl-h { margin-top: 20px; font-size: 17px; line-height: 22px; font-weight: 600; }
.fl-list { display: grid; margin-top: 4px; }
.fl-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 0; text-align: left; }
.fl-row + .fl-row { border-top: 1px solid var(--line); }
.fl-pv { flex: none; width: 44px; height: 44px; overflow: hidden; border-radius: 10px; background: var(--surface-2); }
.fl-meta { flex: 1; min-width: 0; }
.fl-meta b { display: block; font-size: 15px; line-height: 20px; font-weight: 600; overflow-wrap: anywhere; }
.fl-meta span { font-size: 13px; line-height: 16px; color: var(--muted); }
.fl-row time { flex: none; align-self: flex-start; padding-top: 10px; font-size: 13px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fl-head { margin-top: 8px; }
.fl-back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin-left: -4px; padding: 0 12px 0 4px; border-radius: 22px; color: color-mix(in srgb, var(--accent) 75%, var(--text)); font-size: 16px; line-height: 20px; font-weight: 600; }
.fl-back .ico { width: 22px; height: 22px; }
.fl-head h3 { display: flex; align-items: baseline; gap: 8px; font-size: 20px; line-height: 26px; font-weight: 600; }
.fl-head h3 span { font-size: 15px; line-height: 20px; font-weight: 400; color: var(--muted); }
.fl-empty { padding: 24px 8px; text-align: center; font-size: 15px; line-height: 20px; color: var(--muted); }

/* ---------- просмотр файла и выбор папки ---------- */
.sheet.viewer { max-height: 92%; }
.vw-pv { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; height: min(36vh, 280px); overflow: hidden; border-radius: 20px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.vw-pv img { display: block; width: 100%; height: 100%; object-fit: contain; }
.vw-pv .fi { width: 104px; height: 128px; border-radius: 16px; font-size: 22px; line-height: 28px; }
.vw-pv .fi .ico { width: 40px; height: 40px; }
.vw-name { margin-top: 16px; font-size: 20px; line-height: 26px; font-weight: 600; overflow-wrap: anywhere; }
.vw-meta { margin-top: 4px; font-size: 15px; line-height: 20px; color: var(--muted); overflow-wrap: anywhere; }
.vw-btns { display: grid; gap: 8px; margin-top: 16px; }
.vw-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vw-ask { font-size: 17px; line-height: 22px; overflow-wrap: anywhere; }
.ghost-btn.danger { color: color-mix(in srgb, var(--urgent) 80%, var(--text)); }
.pk-name { margin-top: 4px; font-size: 15px; line-height: 20px; color: var(--muted); overflow-wrap: anywhere; }
.pk-folders { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.pk-folders button, .pk-subs button { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: 16px; background: var(--surface-2); text-align: left; font-size: 16px; line-height: 20px; font-weight: 500; }
.pk-folders .ico { width: 20px; height: 20px; color: var(--muted); }
.pk-subs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pk-subs button { min-height: 44px; border-radius: 22px; font-size: 15px; }
.pk-folders button[aria-pressed="true"], .pk-subs button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); box-shadow: inset 0 0 0 2px var(--accent); font-weight: 600; }
.pk-lbl { margin-top: 16px; font-size: 14px; line-height: 18px; color: var(--muted); }
.pk-path { margin-top: 16px; font-size: 15px; line-height: 20px; font-weight: 500; overflow-wrap: anywhere; }
.picker .rl-btns { margin-top: 12px; }

/* ---------- заметка на весь экран ---------- */
.note-screen { position: absolute; inset: 0; z-index: 42; display: flex; flex-direction: column; background: var(--bg); opacity: 0; transform: translateX(24px); visibility: hidden; transition: transform .35s var(--ease-out), opacity .25s, visibility 0s .35s; }
.note-screen.on { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.nt-top { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: calc(48px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 16px 0 4px; }
.nt-back { justify-self: start; display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 12px 0 6px; border-radius: 22px; color: color-mix(in srgb, var(--accent) 75%, var(--text)); font-size: 17px; line-height: 22px; font-weight: 500; }
.nt-back .ico { width: 22px; height: 22px; }
.nt-kind { position: relative; height: 32px; padding: 0 14px; border-radius: 16px; font-size: 14px; line-height: 18px; font-weight: 600; background: color-mix(in srgb, var(--snooze) 14%, var(--bg)); color: color-mix(in srgb, var(--snooze) 78%, var(--text)); }
.nt-kind[data-kind="note"] { background: color-mix(in srgb, var(--drop) 18%, var(--bg)); color: var(--text); }
.nt-kind::before { content: ""; position: absolute; inset: -6px -4px; }
.nt-saved { justify-self: end; font-size: 14px; line-height: 18px; color: var(--muted); }
.nt-body { flex: 1; min-height: 0; padding: 12px 20px 24px; overflow-y: auto; overscroll-behavior: contain; }
.nt-title, .nt-text { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; color: var(--text); font-family: var(--font-ui); resize: none; overflow: hidden; outline: none; overflow-wrap: break-word; }
.nt-title { font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -.01em; }
.nt-text { min-height: 96px; margin-top: 12px; font-size: 17px; line-height: 1.5; }
.nt-title::placeholder, .nt-text::placeholder { color: var(--muted); }
.nt-title:focus-visible, .nt-text:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 4px; }
.nt-body .vc { margin-top: 12px; margin-bottom: 0; }
.nt-voice { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; margin-top: 12px; border-radius: 24px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: color-mix(in srgb, var(--accent) 78%, var(--text)); font-size: 16px; line-height: 20px; font-weight: 600; }
.nt-voice:active { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.nt-bar { flex: none; display: grid; grid-template-columns: 1.5fr 1fr; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--bg); }
