html,body {width:100%;overflow-x:hidden;min-width:320px}button,a,input,summary {touch-action:manipulation}button {cursor:pointer}button:disabled {cursor:wait;opacity:.6}button:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible {outline:2px solid var(--accent);outline-offset:2px}
.screen {display:none;min-height:0;height:100vh;height:100dvh}.screen.active {display:grid}.screen-content {overflow-y:auto;overscroll-behavior:contain;flex-shrink:1}.screen-content>* {flex-shrink:0}.topbar {padding:0 20px}.context-link {font-size:13px}.heading h1{font-size:24px}
#chat .screen-content {overflow:hidden;gap:8px;padding-bottom:8px}#chat .heading .subline {font-size:13px}#chat .heading h1 {font-size:22px}.role-button {display:flex;align-items:center;gap:10px;padding:8px 12px;min-height:64px;text-align:left;width:100%}.role-button img {width:44px;height:44px;object-fit:contain}.role-button>span:first-of-type{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.role-button strong {font-size:14px;font-weight:650}.role-button small {font-size:12px;color:var(--muted)}
.chat-tools {display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px}.demo-label {font-size:11px;color:var(--muted)}.text-button {min-height:44px;min-width:44px;border:0;background:transparent;padding:8px 12px;color:var(--accent);font-size:12px;font-weight:650}
.conversation {flex:1 1 auto!important;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:2px 2px 12px;scroll-behavior:smooth}.try-title {font-size:13px;color:var(--muted);margin-bottom:8px}.suggestions {display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:14px}.suggestions button {min-width:0;min-height:48px;border:1px solid #c6ddda;background:var(--accent-soft);border-radius:14px;padding:8px 12px;text-align:left;font-size:12px;line-height:17px;color:var(--accent)}
#messages {display:flex;flex-direction:column;gap:10px}.composer {margin-top:0;flex-shrink:0!important}.composer input {padding-right:4px}#chat-status:empty {display:none}#chat-status {font-size:12px}.message,.assistant-note,.action-card {overflow-wrap:anywhere}.chat-message {white-space:pre-wrap}.message.user {margin-left:24px;background:#e7f2f0}.message.don {margin-right:6px}.message.error {border-color:#c28b75;background:#fff4ed}.reply-label {display:flex;align-items:center;gap:6px;margin-bottom:5px;color:var(--muted);font-size:12px;font-weight:600}.reply-label img {height:42px;width:32px;object-fit:contain;border:0;border-radius:0;background:transparent;box-shadow:none}.action-card {margin-top:10px;padding:12px;border:1px solid #aacbc6;border-radius:14px;background:var(--accent-soft);display:flex;flex-direction:column;gap:8px}.action-card strong {font-size:14px}.action-card p {font-size:13px;line-height:19px;white-space:pre-wrap}.action-card .primary {font-size:14px;min-height:44px;width:100%}.action-card a {min-height:44px;display:flex;align-items:center;color:var(--accent);font-size:14px;font-weight:650}.answer-time {font-size:11px;color:var(--muted);margin-top:8px}
#stock-added:empty,#expenses-added:empty,#estimate-extra:empty {display:none}#stock-added,#expenses-added {display:flex;flex-direction:column;gap:10px}.added-stock {padding:12px}.added-stock h2 {font-size:16px}.added-stock .stock-number {font-size:34px}#estimate .line-copy span {white-space:normal}.line-item {padding:8px 2px}.line-sum {font-size:13px}.line-copy strong {font-size:13px}.line-copy span {font-size:12px}.inventory-row {width:100%}.inventory-row[hidden] {display:none}.inventory-row summary {list-style:none;min-height:62px;display:flex;align-items:center;justify-content:space-between;gap:8px}.inventory-row {display:block}.inventory-row p {color:var(--muted);font-size:13px;padding:0 0 10px;line-height:19px}.stock-card details>summary {min-height:44px;cursor:pointer}.stock-card details p {font-size:13px;color:var(--muted);padding:8px 0}.data-row-copy {overflow-wrap:anywhere}.data-row .amount {font-size:13px}.data-row {gap:8px}.receipt-link strong {font-size:13px}#remaining {font-size:17px}.fund-card.overdrawn {border-color:#bf866d}
dialog {border:1px solid var(--line);border-radius:24px 24px 0 0;background:var(--ground);color:var(--ink);font:inherit;padding:20px;width:100%;max-width:440px;max-height:88vh;margin:auto auto 0;overflow-y:auto;box-shadow:0 -8px 40px #1233}dialog::backdrop {background:#182c2a66}.sheet-head {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}.sheet-head h2 {font-size:20px}.sheet-head .icon-button {border:1px solid var(--line);background:white}dialog h3 {font-size:15px;margin:20px 0 10px}#role-list {display:flex;flex-direction:column;gap:10px;margin:18px 0}#role-list button {min-height:72px;display:flex;align-items:center;gap:12px;padding:8px 12px;border:1px solid var(--line);border-radius:16px;background:var(--surface);text-align:left}#role-list button[aria-pressed="true"] {border-color:var(--accent);background:var(--accent-soft)}#role-list img {height:52px;width:52px;object-fit:contain}#role-list span {display:flex;flex-direction:column;gap:3px}#role-list small {font-size:12px;color:var(--muted)}.fact {padding:12px;margin-bottom:8px}.fact p {font-size:14px;line-height:20px;white-space:pre-wrap;overflow-wrap:anywhere}.fact small {font-size:11px;color:var(--muted);display:block;margin-top:6px}#base-knowledge p {font-size:13px;line-height:20px;margin:0 0 10px}.knowledge-empty {font-size:14px;color:var(--muted);padding:12px}.photo-row {cursor:pointer}#receipt-preview {max-height:220px;width:100%;object-fit:contain;background:white;border-radius:12px;margin:8px 0 12px}dialog label {display:block;margin:12px 0 6px;font-size:14px}textarea {font:inherit;width:100%;padding:12px;border:1px solid var(--line);border-radius:14px;background:white;font-size:14px;resize:vertical;margin-bottom:12px}.photo-placeholder {padding:16px;background:white;border:1px solid var(--line);border-radius:16px;white-space:pre-wrap;line-height:1.6;font-size:14px}#toast {position:fixed;bottom:84px;left:50%;transform:translateX(-50%);width:calc(100% - 40px);max-width:400px;background:var(--ink);color:white;padding:12px 16px;border-radius:14px;z-index:50;font-size:14px}.bottomnav {padding-bottom:max(6px,env(safe-area-inset-bottom))}a.primary,button.primary {width:100%}.new-expense {min-height:72px}.message p {line-height:22px}.screen-content>* {max-width:100%}
@media(prefers-reduced-motion:reduce){.conversation{scroll-behavior:auto}}@media(min-width:500px){.screen{border-left:1px solid var(--line);border-right:1px solid var(--line)}}

.composer input {font-size:16px}

/* Джарвис: общий kit v2, переписка в штатной ленте, composer над навигацией. */
#chat-form,#chat-status{display:none!important}#jarvis-host{position:relative;flex-shrink:0!important}#jarvis-host .j-messages[hidden]{display:none}#jarvis-host .j-source{position:absolute;bottom:100%;left:0;right:0;max-height:48dvh;overflow:auto;z-index:5;box-shadow:0 -4px 20px #1232;margin-bottom:8px}#jarvis-host .j-chips{padding-bottom:6px}#jarvis-host .j-voice-options button{font-size:12px}#chat .j-card{display:block}#chat .chat-tools{gap:4px}#chat .chat-tools .text-button{padding:8px}#estimate [hidden]{display:none!important}
