:root {
    --bg: var(--ui-page);
    --panel: var(--ui-surface);
    --panel-2: var(--ui-surface-soft);
    --primary: var(--ui-primary);
    --primary-2: var(--ui-primary-strong);
    --primary-soft: var(--ui-primary-soft);
    --success: var(--ui-success);
    --success-soft: var(--ui-success-soft);
    --warning: var(--ui-warning);
    --warning-soft: var(--ui-warning-soft);
    --danger: var(--ui-danger);
    --danger-soft: var(--ui-danger-soft);
    --purple: var(--ui-violet);
    --text: var(--ui-text);
    --muted: var(--ui-muted);
    --line: var(--ui-line);
}
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--ui-page); }
body::before {
    content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .38;
    background-image: radial-gradient(rgba(45, 99, 232, .08) .7px, transparent .7px);
    background-size: 18px 18px;
}
.app { max-width: none; width: 100%; min-height: 100dvh; margin: 0; padding: 0; }
.topbar {
    position: fixed; z-index: var(--ui-z-header); top: 0; left: 292px; right: 0;
    display: grid; grid-template-columns: minmax(260px, 1fr) auto; align-items: center; gap: 16px;
    min-height: 64px; height: 64px; margin: 0; padding: 0 24px;
    border: 0; border-bottom: 1px solid rgba(207, 219, 238, .88); border-radius: 0;
    background: rgba(247, 249, 253, .9); box-shadow: none; backdrop-filter: blur(18px);
}
.topbar .brand, .topbar .header-date,
.topbar #templateStatusPill, .topbar #photoStatusPill, .topbar #logStatusPill, .topbar #downloadStatusPill { display: none !important; }
.topbar .browser-tabs-wrap {
    position: static; z-index: auto; min-width: 0; width: 100%; margin: 0; padding: 0;
    border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
.topbar .browser-tabs-head, .topbar .browser-tabs-content { display: none; }
.topbar .browser-tabs-shell {
    min-width: 0; min-height: 46px; display: flex; align-items: center; gap: 7px;
    padding: 4px 6px; border: 1px solid #dbe5f3; border-radius: 13px; background: #f1f5fb;
}
.mobile-resource-toggle-mount { display: none; }
.topbar .tabs { min-width: 0; display: flex; flex: 1; gap: 6px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.topbar .browser-tab {
    min-width: 138px; max-width: 210px; height: 38px; display: flex; align-items: center; gap: 7px;
    padding: 0 8px 0 11px; border: 1px solid var(--ui-line); border-radius: 11px;
    color: var(--ui-muted); background: rgba(255,255,255,.72); box-shadow: none;
}
.topbar .browser-tab:hover { color: var(--ui-primary-strong); border-color: #c7d6f1; background: #fff; transform: none; }
.topbar .browser-tab.active { color: var(--ui-primary-strong); border-color: #bcd0fa; background: var(--ui-primary-soft); }
.topbar .browser-tab .dot { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: #9cacbf; }
.topbar .browser-tab.active .dot { background: var(--ui-primary); }
.topbar .browser-tab .tab-title { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; }
.tab-ai-status { width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center; border-radius: 7px; color: var(--ui-primary); background: #fff; }
.tab-ai-status svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab-ai-status.succeeded { color: var(--ui-primary); background: #eaf1ff; }
.tab-ai-status.failed { color: var(--ui-danger); background: var(--ui-danger-soft); }
.tab-ai-status:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 1px; }
.tab-ai-spinner { width: 11px; height: 11px; border: 2px solid #c8d7f8; border-top-color: var(--ui-primary); border-radius: 50%; animation: tabAiSpin .72s linear infinite; }
@keyframes tabAiSpin { to { transform: rotate(360deg); } }
.topbar .browser-tab .close {
    position: static !important; inset: auto !important; flex: 0 0 23px;
    width: 23px !important; min-width: 23px !important; max-width: 23px; height: 23px !important; min-height: 23px !important;
    display: grid; place-items: center; margin: 0; padding: 0; border: 0; border-radius: 7px;
    color: var(--ui-muted); background: transparent; box-shadow: none; line-height: 1;
    opacity: .72; transform: none !important; transition: color .16s ease, background-color .16s ease, opacity .16s ease, scale .16s ease;
}
.topbar .browser-tab .close svg { width: 14px; height: 14px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.topbar .browser-tab .close:hover:not(:disabled), .topbar .browser-tab .close:focus-visible { color: var(--ui-primary-strong); background: #fff; box-shadow: none; opacity: 1; scale: 1.06; }
.topbar .browser-tab .close:active:not(:disabled) { scale: .9; }
.topbar .browser-tab.is-closing { pointer-events: none; animation: tabCloseOut .12s ease forwards; }
@keyframes tabCloseOut { to { max-width: 0; min-width: 0; padding-inline: 0; border-width: 0; opacity: 0; transform: translateY(-3px); } }
.topbar .status-strip { width: auto; min-width: 0; height: 100%; justify-content: flex-end; flex-wrap: nowrap; gap: 8px; }
.topbar .status-strip > * { flex: 0 0 auto; }
.topbar .header-tool-btn, .topbar .mini-logout, .topbar .user-pill, .topbar .project-select {
    min-height: 34px; border-radius: 10px; border-color: var(--ui-line); color: var(--ui-text); background: rgba(255,255,255,.82);
}
.topbar .project-select { width: clamp(220px, 24vw, 320px); min-width: 220px; max-width: 320px; }
.topbar .header-tool-btn:hover:not(:disabled), .topbar .mini-logout:hover:not(:disabled) { color: var(--ui-primary-strong); background: var(--ui-primary-soft); box-shadow: none; transform: translateY(-1px); }
.topbar .project-select:focus { border-color: var(--ui-primary); box-shadow: 0 0 0 3px rgba(45,99,232,.14); }
.layout { display: block; margin: 0; }
.right-panel {
    position: fixed; z-index: 45; inset: 0 auto 0 0; width: 292px; height: 100dvh;
    display: flex; flex-direction: column; gap: 0; padding: 0;
    border: 0; border-right: 1px solid var(--ui-line); border-radius: 0;
    background: rgba(250, 251, 254, .97); box-shadow: 12px 0 32px rgba(35, 65, 118, .06);
    overflow: hidden;
}
.layout > .right-panel.panel-scroll-region { position: fixed; inset: 0 auto 0 0; width: 292px; height: 100dvh; max-height: none; }
.resource-brand { min-height: 82px; padding: 18px 16px; display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 11px; border-bottom: 1px solid var(--ui-line); }
.resource-brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: var(--ui-primary); box-shadow: 0 10px 22px rgba(45,99,232,.23); font-weight: 800; }
.resource-brand strong, .resource-brand span { display: block; }
.resource-brand strong { font-size: 14px; line-height: 1.25; letter-spacing: -.03em; white-space: nowrap; }
.resource-brand span { margin-top: 3px; color: var(--ui-muted); font-size: 11px; }
.resource-icon { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 10px; color: var(--ui-muted); background: transparent; }
.resource-icon:hover:not(:disabled) { color: var(--ui-primary); background: var(--ui-primary-soft); box-shadow: none; }
.right-panel-card { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.right-panel .action-card { order: 4; margin: 0; padding: 12px 14px 16px; border-top: 1px solid var(--ui-line); }
.right-panel .action-card h3, .right-panel .action-card #generateBtn { display: none !important; }
.right-panel .action-card .actions { display: grid; grid-template-columns: 1fr; gap: 7px; }
.right-panel .action-card button { min-height: 38px; padding: 7px 9px; border: 1px solid var(--ui-line); border-radius: 10px; color: var(--ui-primary-strong); background: #fff; box-shadow: 0 5px 14px rgba(31,64,120,.06); font-size: 12px; }
.right-panel .action-card #newBlankBtn { color: #fff; border-color: var(--ui-primary); background: var(--ui-primary); box-shadow: 0 8px 18px rgba(45,99,232,.2); }
.right-panel .action-card #newBlankBtn:hover:not(:disabled) { color: #fff; background: var(--ui-primary-strong); box-shadow: 0 10px 22px rgba(45,99,232,.22); }
.right-panel .action-card button:not(#newBlankBtn):hover:not(:disabled) { color: var(--ui-primary-strong); border-color: #c8d7f1; background: var(--ui-primary-soft); box-shadow: none; }
.right-panel .action-card button:disabled { opacity: 1; color: #58677f; border-color: #d9e1ec; background: #eef2f7; box-shadow: none; }
.log-explorer-card { order: 2; min-height: 0; flex: 1; margin: 0; padding: 14px 12px 0; display: flex; flex-direction: column; }
.member-template-card { order: 3; flex: 0 0 auto; padding: 12px 14px 13px; border-top: 1px solid var(--ui-line); background: rgba(247,249,253,.72); }
.member-template-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.member-template-heading span:first-child { display: block; margin-bottom: 2px; color: var(--ui-muted); font-size: 9px; }
.member-template-heading h3 { margin: 0; font-size: 13px; }
.member-template-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.member-template-selects label { min-width: 0; color: var(--ui-muted); font-size: 9px; }
.member-template-selects label:last-child { grid-column: 1 / -1; }
.member-template-selects select { width: 100%; height: 33px; margin-top: 4px; padding: 0 8px; border: 1px solid var(--ui-line); border-radius: 9px; color: var(--ui-text); background: #fff; font-size: 10px; }
.member-template-selects select:hover:not(:disabled) { border-color: #b7c9e7; background: #fff; }
.member-template-selects select:focus-visible { border-color: var(--ui-primary); outline: 3px solid rgba(45,99,232,.12); }
.member-template-selects select:disabled { color: #94a1b5; background: #eef2f7; cursor: not-allowed; }
.member-template-hint { margin-top: 7px; color: var(--ui-muted); font-size: 9px; line-height: 1.45; }
.explorer-heading { padding: 0 3px 12px; }
.explorer-heading h3 { font-size: 15px; }
.explorer-project-name { color: var(--ui-muted); }
.explorer-toolbar { display: grid; grid-template-columns: minmax(0,1fr) 78px 38px 38px; align-items: center; gap: 5px; }
.explorer-toolbar select { display: block; min-width: 0; width: 100%; height: 40px; padding: 0 7px; border-color: var(--ui-line); border-radius: 11px; color: var(--ui-muted); background: #fff; font-size: 10px; }
.explorer-toolbar input { min-width: 0; width: 100%; height: 40px; border-radius: 11px; border-color: var(--ui-line); background: #fff; }
.explorer-icon-btn { width: 38px; height: 40px; display: grid; place-items: center; padding: 0; border-color: var(--ui-line); border-radius: 11px; color: var(--ui-primary-strong); background: #fff; box-shadow: none; line-height: 1; }
.explorer-icon-btn:hover:not(:disabled) { color: var(--ui-primary-strong); border-color: #c8d7f1; background: var(--ui-primary-soft); box-shadow: none; }
.explorer-icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.template-setup-scrim { position: fixed; z-index: calc(var(--ui-z-dialog) + 4); inset: 0; background: rgba(18,34,62,.32); }
.template-setup-dialog { position: fixed; z-index: calc(var(--ui-z-dialog) + 5); top: 50%; left: 50%; width: min(440px, calc(100vw - 32px)); overflow: hidden; border: 1px solid rgba(184,199,225,.82); border-radius: 20px; color: var(--ui-text); background: #fff; box-shadow: 0 20px 56px rgba(28,56,106,.18); transform: translate(-50%, -50%); }
.template-setup-dialog[hidden], .template-setup-scrim[hidden] { display: none; }
.template-setup-head { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px 14px; border-bottom: 1px solid var(--ui-line); }
.template-setup-head span { display: block; margin-bottom: 4px; color: var(--ui-muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.template-setup-head h2 { margin: 0; font-size: 19px; letter-spacing: -.03em; }
.template-setup-head button { width: 40px; height: 40px; min-height: 40px; padding: 0; border: 1px solid var(--ui-line); border-radius: 12px; color: var(--ui-muted); background: #fff; box-shadow: none; font-size: 24px; line-height: 1; }
.template-setup-head button:hover, .template-setup-head button:focus-visible { color: var(--ui-primary-strong); border-color: #bdd0ef; background: var(--ui-primary-soft); box-shadow: none; }
.template-setup-body { padding: 18px; }
.template-setup-body > p { max-width: 35em; margin: 0 0 16px; color: var(--ui-muted); font-size: 13px; line-height: 1.65; }
.template-setup-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.template-setup-selects label { min-width: 0; color: #52627b; font-size: 12px; font-weight: 700; }
.template-setup-selects label:last-child { grid-column: 1 / -1; }
.template-setup-selects select { width: 100%; min-height: 44px; margin-top: 6px; padding: 0 10px; border: 1px solid var(--ui-line); border-radius: 11px; color: var(--ui-text); background: #fff; font-size: 13px; }
.template-setup-selects select:hover:not(:disabled) { border-color: #b8cbea; }
.template-setup-selects select:focus-visible { border-color: var(--ui-primary); outline: 3px solid rgba(45,99,232,.14); }
.template-setup-selects select:disabled { color: #8d9bb0; background: #f1f4f8; cursor: not-allowed; }
.template-setup-summary { min-height: 22px; margin-top: 14px; color: var(--ui-primary-strong); font-size: 12px; font-weight: 700; line-height: 1.5; }
.template-setup-status { min-height: 18px; margin-top: 5px; color: var(--ui-muted); font-size: 11px; line-height: 1.5; }
.template-setup-badge { display: inline-flex; margin-top: 8px; padding: 3px 7px; border: 1px solid #c4d9fb; border-radius: 7px; color: var(--ui-primary-strong); background: #edf4ff; font-size: 10px; font-weight: 800; }
.template-setup-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 13px 18px 18px; border-top: 1px solid var(--ui-line); background: #fbfcfe; }
.template-setup-actions button { min-width: 98px; min-height: 44px; border-radius: 11px; font-weight: 800; }
.template-setup-actions button:disabled { color: #8c9ab0; border-color: #dbe2ec; background: #edf1f6; box-shadow: none; cursor: not-allowed; }
.explorer-folders { max-height: 116px; padding: 6px 0; overflow-y: auto; }
.explorer-folder { min-height: 34px; border-radius: 9px; }
.right-panel .explorer-folder:hover:not(:disabled), .right-panel .explorer-folder.active { color: var(--ui-primary-strong); background: var(--ui-primary-soft); box-shadow: none; transform: none; }
.record-list { min-height: 0; flex: 1; overflow-y: auto; padding: 5px 0 16px; }
.explorer-list-header { display: none; }
.explorer-record {
    position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 8px;
    min-height: 70px; margin-bottom: 6px; padding: 11px 12px;
    border: 1px solid transparent; border-radius: 13px; background: transparent;
}
.explorer-record:hover { background: #fff; border-color: var(--ui-line); box-shadow: var(--ui-shadow-sm); }
.explorer-record.selected { color: var(--ui-primary-strong); background: var(--ui-primary-soft); border-color: #c9d8ff; }
.explorer-record-name { position: relative; grid-column: 1 / -1; min-width: 0; }
.explorer-record.has-review-badge .explorer-record-name { padding-right: 28px; }
.explorer-record-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.explorer-record-name span { margin-top: 5px; color: var(--ui-muted); font-size: 10px; }
.explorer-record-date { color: var(--ui-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.explorer-record-status { justify-self: end; padding: 2px 7px; border-radius: 7px; color: var(--ui-muted); background: rgba(255,255,255,.72); font-size: 10px; }
.explorer-record-status.review-submitted { color: var(--ui-primary-strong); background: #dfe9ff; }
.explorer-record-status.review-partial { color: var(--ui-warning); background: var(--ui-warning-soft); }
.explorer-record-status.review-approved { color: var(--ui-success); background: var(--ui-success-soft); }
.explorer-record-status.review-rejected { color: var(--ui-danger); background: var(--ui-danger-soft); }
.explorer-review-badge { position: absolute; top: -7px; right: -4px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; border: 2px solid #fff; border-radius: 999px; color: #fff; background: var(--ui-danger); box-shadow: 0 4px 10px rgba(220,52,69,.25); font-size: 9px; line-height: 1; }
.review-action-badge {
    position: absolute; top: 5px; right: 5px; min-width: 19px; height: 19px; display: grid; place-items: center;
    padding: 0 5px; border: 2px solid #fff; border-radius: 999px; color: #fff; background: #e33d4f;
    box-shadow: 0 4px 10px rgba(195,45,62,.25); font-size: 10px; font-weight: 800;
}
#autoSaveControl { display: none !important; }
.auto-sync-control { transform: scale(.86); transform-origin: right center; }
.right-panel .auto-sync-control input:checked + .auto-sync-track { border-color: var(--ui-primary); background: var(--ui-primary); }
.right-panel .auto-sync-control input:focus-visible + .auto-sync-track { outline-color: rgba(45,99,232,.28); }

.auth-overlay { background: #edf2fa; }
.auth-overlay::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 8%, rgba(45,99,232,.12), transparent 38%); }
.auth-card { position: relative; border-color: #d5dfef; background: rgba(255,255,255,.96); box-shadow: 0 28px 70px rgba(35,65,118,.16); }
.auth-card h2 { color: var(--ui-text); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.auth-brand h2 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.brand-icon.friday-brand-logo { padding: 0; border-radius: 0; background: transparent; box-shadow: none; object-fit: contain; }
.auth-form input { border-color: var(--ui-line); color: var(--ui-text); }
.auth-form input:focus { border-color: var(--ui-primary); outline: 3px solid rgba(45,99,232,.14); }
.auth-form button { border-color: var(--ui-primary); background: var(--ui-primary); box-shadow: 0 10px 20px rgba(45,99,232,.2); }
.auth-form button:hover:not(:disabled) { border-color: var(--ui-primary-strong); background: var(--ui-primary-strong); box-shadow: 0 13px 25px rgba(45,99,232,.23); }

.main {
    position: fixed; inset: 64px 0 0 292px; min-width: 0; margin: 0; padding: 0;
    border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: hidden;
    transition: none;
}
.main.chat-drawer-open { right: 470px; }
.layout > .main.panel-scroll-region { position: fixed; inset: 64px 0 0 292px; width: auto; height: auto; max-height: none; }
.layout > .main.panel-scroll-region.chat-drawer-open { right: 470px; }
.main > .section, .main > #workspaceEmptyState { display: none !important; }
.main.is-idle { display: block; align-items: initial; justify-content: initial; }
.main.is-idle > #chatWorkspace { display: grid !important; }
.main.is-idle > #workspaceEmptyState { display: none !important; }
.layout.workspace-idle .action-card { display: block !important; }
.chat-workspace { height: 100%; display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.chat-head { position: relative; z-index: 12; padding: 16px 26px 0; background: linear-gradient(180deg, rgba(241,244,249,.98) 78%, rgba(241,244,249,0)); }
.chat-head-row { width: min(1050px, 100%); margin: 0 auto 12px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 18px; }
.chat-head-row h2 { margin: 3px 0 0; font-size: 21px; letter-spacing: -.04em; }
.chat-eyebrow { color: var(--ui-muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.chat-mobile-menu { display: none; }
.chat-date-control { display: flex; align-items: center; gap: 9px; }
.chat-date-control > label { color: var(--ui-muted); font-size: 11px; }
#chatDateMount input { width: 152px; height: 38px; padding: 0 10px; border: 1px solid var(--ui-line); border-radius: 11px; color: var(--ui-text); background: rgba(255,255,255,.88); font-variant-numeric: tabular-nums; }
.weather-scene {
    position: relative; width: min(1050px,100%); min-height: 110px; margin: 0 auto; overflow: hidden;
    display: grid; grid-template-columns: 110px minmax(0,1fr) minmax(190px,260px); align-items: center; gap: 5px 18px;
    padding: 18px 24px; border-radius: 22px; color: #fff;
    background: radial-gradient(circle at 18% 120%, rgba(255,255,255,.22), transparent 35%),
                radial-gradient(circle at 78% -30%, rgba(114,83,232,.72), transparent 46%), #2d63e8;
    box-shadow: 0 18px 38px rgba(45,99,232,.22);
}
.weather-scene::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, rgba(255,255,255,.09), transparent 38%); }
.weather-scene.is-loading .weather-copy, .weather-scene.is-loading .weather-details { animation: weatherLoadingPulse 1.4s ease-in-out infinite; }
@keyframes weatherLoadingPulse { 50% { opacity: .58; } }
.weather-visual-column { display: contents; }
.weather-mobile-condition { display: none; }
.weather-visual-group { position: relative; z-index: 1; width: 92px; min-width: 92px; height: 72px; display: flex; align-items: center; justify-content: center; gap: 2px; }
.weather-visual-group.is-composite { width: 174px; min-width: 174px; gap: 4px; }
.weather-scene.is-composite { grid-template-columns: 174px minmax(0,1fr) minmax(190px,260px); }
.weather-visual-slot { display: contents; }
.weather-visual-unit { position: relative; width: 82px; height: 72px; flex: 0 0 82px; overflow: hidden; }
.weather-transition-separator { position: relative; z-index: 8; flex: 0 0 auto; color: rgba(255,255,255,.78); font-size: 21px; font-weight: 300; line-height: 1; }
.weather-sun { position: absolute; display: none; left: 22px; top: 15px; width: 38px; height: 38px; border-radius: 50%; background: #ffd050; box-shadow: 0 0 0 9px rgba(255,208,80,.13), 0 0 28px rgba(255,207,70,.45); animation: weatherPulse 2.8s ease-in-out infinite; }
.weather-cloud { position: absolute; display: none; width: 49px; height: 18px; border-radius: 20px; background: rgba(255,255,255,.92); box-shadow: 12px -9px 0 -2px rgba(255,255,255,.92), 25px -4px 0 -5px rgba(255,255,255,.92); }
.cloud-one { --weather-cloud-scale: 1; left: 0; top: 33px; transform: translateX(0) scale(var(--weather-cloud-scale)); animation: cloudDrift 4s ease-in-out infinite; }
.cloud-two { --weather-cloud-scale: .67; left: 23px; top: 20px; opacity: .56; transform: translateX(0) scale(var(--weather-cloud-scale)); transform-origin: left center; animation: cloudDrift 5s ease-in-out -1.2s infinite; }
.weather-rain-field, .weather-snow-field, .weather-particles, .weather-mist, .weather-wind { position: absolute; display: none; inset: 0; }
.weather-rain { --weather-rain-angle: 9deg; position: absolute; left: var(--weather-left); top: 48px; width: 2px; height: 10px; border-radius: 3px; background: #c8e3ff; transform: rotate(var(--weather-rain-angle)); animation: rainDrop .95s linear var(--weather-delay) infinite; }
.weather-bolt { position: absolute; display: none; left: 40px; top: 45px; width: 12px; height: 22px; background: #ffe16e; clip-path: polygon(44% 0,100% 0,67% 39%,100% 39%,20% 100%,39% 55%,0 55%); filter: drop-shadow(0 0 5px rgba(255,225,110,.65)); animation: boltFlash 2.4s infinite; }
.weather-snow { position: absolute; left: var(--weather-left); top: 44px; width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.95); box-shadow: 0 0 5px rgba(255,255,255,.35); animation: snowFall 2.2s linear var(--weather-delay) infinite; }.weather-snow:nth-child(even) { top: 51px; }
.weather-mist { inset: 28px 8px 5px; }
.weather-mist i { position: absolute; left: 4px; width: 58px; height: 3px; border-radius: 3px; background: rgba(239,246,255,.78); animation: mistDrift 3.8s ease-in-out infinite; }
.weather-mist i:nth-child(2) { top: 11px; left: 15px; width: 53px; animation-delay: -1.2s; }.weather-mist i:nth-child(3) { top: 22px; width: 45px; animation-delay: -2.1s; }
.weather-particles span { position: absolute; left: var(--weather-left); top: 25px; width: 5px; height: 5px; border-radius: 50%; background: #e8bc73; animation: particleDrift 2.4s linear var(--weather-delay) infinite; }.weather-particles span:nth-child(3n+2) { top: 36px; }.weather-particles span:nth-child(3n) { top: 47px; }
.weather-wind { inset: 17px 5px; }
.weather-wind i { position: absolute; top: 5px; left: 7px; width: 56px; height: 4px; border-radius: 8px; border-top: 3px solid rgba(255,255,255,.88); animation: windSweep 1.8s ease-in-out infinite; }.weather-wind i:nth-child(2) { top: 20px; left: 18px; width: 48px; animation-delay: -.6s; }.weather-wind i:nth-child(3) { top: 35px; width: 42px; animation-delay: -1.1s; }
.weather-swirl { position: absolute; display: none; left: 21px; top: 13px; width: 40px; height: 40px; border: 4px solid rgba(255,255,255,.82); border-left-color: transparent; border-radius: 50%; animation: typhoonSpin 1.7s linear infinite; }.weather-swirl::after { content: ""; position: absolute; inset: 9px; border: 3px solid rgba(255,255,255,.58); border-right-color: transparent; border-radius: 50%; }
.weather-unknown-mark { position: absolute; display: none; inset: 13px 15px; place-items: center; border: 2px dashed rgba(255,255,255,.5); border-radius: 50%; color: #fff; font-size: 24px; font-weight: 700; }
.weather-clear .weather-sun, .weather-partly-cloudy .weather-sun, .weather-haze .weather-sun { display: block; }
.weather-partly-cloudy .weather-cloud, .weather-cloudy .weather-cloud, .weather-overcast .weather-cloud, .weather-fog .weather-cloud,
.weather-drizzle .weather-cloud, .weather-freezing-drizzle .weather-cloud, .weather-rain-light .weather-cloud, .weather-rain-moderate .weather-cloud, .weather-rain-heavy .weather-cloud, .weather-rain-storm .weather-cloud, .weather-rain-extreme .weather-cloud,
.weather-shower .weather-cloud, .weather-shower-heavy .weather-cloud, .weather-thunder .weather-cloud, .weather-hail .weather-cloud, .weather-freezing-rain .weather-cloud, .weather-sleet .weather-cloud,
.weather-snow-light .weather-cloud, .weather-snow-moderate .weather-cloud, .weather-snow-heavy .weather-cloud, .weather-blizzard .weather-cloud, .weather-snow-shower .weather-cloud, .weather-snow-grains .weather-cloud { display: block; }
.weather-overcast .weather-cloud { background: #cbd6e8; box-shadow: 12px -9px 0 -2px #cbd6e8, 25px -4px 0 -5px #cbd6e8; filter: brightness(.88); }
.weather-fog .weather-mist, .weather-haze .weather-mist, .weather-dust .weather-particles { display: block; }
.weather-haze .weather-mist i { background: rgba(232,214,170,.62); }.weather-haze .weather-sun { opacity: .55; filter: saturate(.7); }
.weather-drizzle .weather-rain-field, .weather-freezing-drizzle .weather-rain-field, .weather-rain-light .weather-rain-field, .weather-rain-moderate .weather-rain-field, .weather-rain-heavy .weather-rain-field, .weather-rain-storm .weather-rain-field, .weather-rain-extreme .weather-rain-field,
.weather-shower .weather-rain-field, .weather-shower-heavy .weather-rain-field, .weather-thunder .weather-rain-field, .weather-hail .weather-rain-field, .weather-freezing-rain .weather-rain-field, .weather-sleet .weather-rain-field { display: block; }
.weather-drizzle .weather-rain:nth-child(n+4), .weather-freezing-drizzle .weather-rain:nth-child(n+4), .weather-rain-light .weather-rain:nth-child(n+5) { display: none; }
.weather-rain-moderate .weather-rain:nth-child(n+7), .weather-shower .weather-rain:nth-child(n+7) { display: none; }
.weather-rain-moderate .weather-rain, .weather-shower .weather-rain { height: 13px; animation-duration: .78s; }
.weather-rain-heavy .weather-rain, .weather-shower-heavy .weather-rain { --weather-rain-angle: 15deg; width: 3px; height: 17px; animation-duration: .58s; }
.weather-rain-storm .weather-rain, .weather-rain-extreme .weather-rain { --weather-rain-angle: 22deg; width: 3px; height: 21px; animation-duration: .38s; }
.weather-rain-storm, .weather-rain-extreme, .weather-thunder { filter: brightness(.82); }.weather-rain-extreme { filter: brightness(.68) saturate(.88); }
.weather-shower .weather-rain:nth-child(even), .weather-shower-heavy .weather-rain:nth-child(even) { animation-delay: -.8s; }
.weather-thunder .weather-bolt, .weather-hail .weather-bolt { display: block; }
.weather-hail .weather-particles, .weather-freezing-drizzle .weather-snow-field, .weather-freezing-rain .weather-snow-field, .weather-sleet .weather-snow-field { display: block; }.weather-hail .weather-particles span { background: #e9f6ff; }.weather-freezing-drizzle .weather-snow:nth-child(n+4) { display: none; }
.weather-snow-light .weather-snow-field, .weather-snow-moderate .weather-snow-field, .weather-snow-heavy .weather-snow-field, .weather-blizzard .weather-snow-field, .weather-snow-shower .weather-snow-field, .weather-snow-grains .weather-snow-field { display: block; }
.weather-snow-light .weather-snow:nth-child(n+5), .weather-snow-grains .weather-snow:nth-child(n+6) { display: none; }.weather-snow-moderate .weather-snow:nth-child(n+7) { display: none; }
.weather-snow-heavy .weather-snow, .weather-blizzard .weather-snow { width: 7px; height: 7px; animation-duration: 1.35s; }.weather-blizzard .weather-snow { animation-duration: .85s; transform: rotate(28deg); }
.weather-windy .weather-wind, .weather-typhoon .weather-swirl { display: block; }
.weather-unknown .weather-unknown-mark { display: grid; }
.weather-copy { position: relative; z-index: 1; min-width: 0; }
.weather-copy > span { color: rgba(255,255,255,.7); font-size: 11px; font-weight: 600; }
.weather-copy strong { display: block; margin: 1px 0 0; font-size: 30px; line-height: 1.1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.weather-copy p { margin: 3px 0 0; color: rgba(255,255,255,.85); font-size: 12px; }
.weather-scene-location {
    display: block; max-width: 100%; margin-top: 4px; overflow: hidden;
    color: rgba(255,255,255,.78); font-size: 11px; font-weight: 700; line-height: 1.2;
    letter-spacing: .01em; text-overflow: ellipsis; white-space: nowrap;
}
.weather-side { position: relative; z-index: 1; min-width: 0; display: grid; justify-items: end; gap: 8px; }
.weather-details { display: grid; justify-items: end; gap: 4px; color: rgba(255,255,255,.82); font-size: 11px; font-variant-numeric: tabular-nums; }
.weather-details span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes weatherPulse { 50% { transform: scale(1.08); box-shadow: 0 0 0 12px rgba(255,208,80,.1), 0 0 34px rgba(255,207,70,.55); } }
@keyframes cloudDrift { 0%, 100% { transform: translateX(0) scale(var(--weather-cloud-scale)); } 50% { transform: translateX(7px) scale(var(--weather-cloud-scale)); } }
@keyframes rainDrop { from { transform: translateY(-3px) rotate(var(--weather-rain-angle)); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(12px) rotate(var(--weather-rain-angle)); opacity: 0; } }
@keyframes boltFlash { 0%, 75%, 100% { opacity: 0; } 78%, 84% { opacity: 1; } 81% { opacity: .25; } }
@keyframes snowFall { to { transform: translateY(16px) rotate(160deg); opacity: .15; } }
@keyframes mistDrift { 50% { transform: translateX(8px); opacity: .5; } }
@keyframes particleDrift { from { transform: translate(7px,-4px); opacity: 0; } 30% { opacity: .9; } to { transform: translate(-12px,9px); opacity: .15; } }
@keyframes windSweep { 50% { transform: translateX(10px); opacity: .55; } }
@keyframes typhoonSpin { to { transform: rotate(360deg); } }
.conversation-stream { min-height: 0; overflow-y: auto; padding: 22px max(24px, calc((100% - 1050px)/2)); scroll-behavior: smooth; }
.chat-empty { min-height: 260px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--ui-muted); }
.chat-empty-mark { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 18px; color: var(--ui-primary); background: var(--ui-primary-soft); font-size: 14px; font-weight: 800; }
.chat-empty h3 { margin: 0 0 7px; color: var(--ui-text); font-size: 18px; letter-spacing: -.03em; }.chat-empty p { max-width: 440px; margin: 0; line-height: 1.65; font-size: 12px; }
.chat-row { width: 100%; display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; animation: chatEnter .28s ease both; }
.chat-row.user { flex-direction: row-reverse; justify-content: flex-start; }.chat-row.assistant { justify-content: flex-start; }
.chat-row.user:has(.chat-user-actions) { margin-bottom: 38px; }
.chat-avatar { position: relative; z-index: 2; width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; margin-top: 3px; overflow: hidden; border-radius: 12px; box-shadow: 0 5px 14px rgba(28,51,84,.12); }
.chat-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.assistant-avatar { border: 1px solid #d8e4ff; background: var(--ui-primary-soft); }
.assistant-avatar img { width: 24px; height: 24px; object-fit: contain; }
.user-avatar { color: #fff; background: #163b7a; }
.user-avatar svg { width: 22px; height: 22px; fill: rgba(255,255,255,.96); stroke: rgba(255,255,255,.96); stroke-width: 1.6; stroke-linecap: round; }
.chat-bubble { position: relative; max-width: min(790px, 82%); padding: 14px 16px 15px; border-radius: 18px; box-shadow: var(--ui-shadow-sm); }
.chat-row.user .chat-bubble { max-width: min(650px,72%); border-bottom-right-radius: 6px; color: #fff; background: var(--ui-primary); box-shadow: 0 12px 26px rgba(45,99,232,.17); }
.chat-row.assistant .chat-bubble { border: 1px solid var(--ui-line); border-bottom-left-radius: 6px; background: rgba(255,255,255,.96); }
.chat-row.user .chat-bubble::before, .chat-row.assistant .chat-bubble::before { content: ""; position: absolute; top: 15px; width: 12px; height: 12px; transform: rotate(45deg); }
.chat-row.user .chat-bubble::before { right: -6px; background: var(--ui-primary); }
.chat-row.assistant .chat-bubble::before { left: -7px; border-left: 1px solid var(--ui-line); border-bottom: 1px solid var(--ui-line); background: rgba(255,255,255,.96); }
.chat-bubble-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: var(--ui-muted); font-size: 10px; }
.chat-row.user .chat-bubble-meta { color: rgba(255,255,255,.7); }
.chat-bubble-text { white-space: pre-wrap; line-height: 1.75; font-size: 13px; }
.chat-row.user .chat-bubble:focus-visible { outline: 2px solid #86a9ff; outline-offset: 3px; }
.chat-user-actions { position: absolute; top: 100%; right: 2px; display: flex; gap: 5px; padding-top: 6px; opacity: 0; pointer-events: none; transform: translateY(-3px); transition: opacity .16s ease, transform .16s ease; }
.chat-row.user .chat-bubble:hover .chat-user-actions, .chat-row.user .chat-bubble:focus-within .chat-user-actions { opacity: 1; pointer-events: auto; transform: translateY(0); }
.chat-user-actions button { min-height: 27px; padding: 4px 8px; border: 1px solid var(--ui-line); border-radius: 8px; color: var(--ui-muted); background: #fff; box-shadow: 0 4px 12px rgba(28,51,84,.08); font-size: 10px; }
.chat-user-actions button:hover:not(:disabled), .chat-user-actions button:focus-visible { color: var(--ui-primary-strong); border-color: #bfd1f5; background: var(--ui-primary-soft); box-shadow: none; }
.chat-user-action-toggle { display: none; }.chat-user-action-menu { display: flex; gap: 5px; }.chat-user-action-menu[hidden] { display: none; }
.chat-row.user .chat-bubble:hover .chat-user-action-menu[hidden], .chat-row.user .chat-bubble:focus-within .chat-user-action-menu[hidden] { display: flex; }
.chat-ai-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chat-ai-title { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.chat-ai-actions { display: flex; gap: 5px; }
.chat-ai-actions button { min-height: 28px; padding: 5px 8px; border: 1px solid var(--ui-line); border-radius: 8px; color: var(--ui-muted); background: #fff; font-size: 10px; }
.chat-ai-actions button.primary { color: #fff; border-color: var(--ui-primary); background: var(--ui-primary); }
.chat-ai-actions button:hover:not(:disabled) { color: var(--ui-primary-strong); border-color: #c7d6f1; background: var(--ui-primary-soft); box-shadow: none; }
.chat-ai-actions button.primary:hover:not(:disabled) { color: #fff; border-color: var(--ui-primary-strong); background: var(--ui-primary-strong); }
.generation-delta { margin-top: 12px; display: grid; gap: 7px; }
.generation-change { padding: 9px 10px; border-left: 3px solid var(--ui-primary); border-radius: 4px 9px 9px 4px; background: var(--ui-surface-soft); }
.generation-change.added { border-color: var(--ui-success); }.generation-change.removed { border-color: var(--ui-danger); }.generation-change.updated { border-color: var(--ui-warning); }
.generation-change strong { display: block; margin-bottom: 3px; font-size: 11px; }.generation-change p { margin: 0; color: var(--ui-muted); line-height: 1.55; font-size: 10px; white-space: pre-wrap; }
.generation-empty-delta { padding: 12px; color: var(--ui-muted); border-radius: 10px; background: var(--ui-surface-soft); font-size: 11px; }
.chat-generation-process { margin: 8px 0; border: 1px solid #dbe6f7; border-radius: 10px; background: #f8faff; overflow: hidden; }
.chat-process-summary { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 8px; align-items: center; padding: 7px 10px; color: var(--ui-muted); font-size: 10px; line-height: 1.35; }
.chat-process-summary strong { color: var(--ui-primary-strong); white-space: nowrap; }
.chat-process-summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-generation-process details { border-top: 1px solid #e1e9f5; }
.chat-generation-process summary { padding: 7px 10px; cursor: pointer; color: var(--ui-primary-strong); font-size: 10px; font-weight: 700; }
.chat-generation-process ol { display: grid; gap: 0; margin: 0; padding: 0 10px 6px; list-style: none; }
.chat-generation-process li { display: grid; grid-template-columns: 18px minmax(0,1fr) auto; gap: 7px; align-items: center; min-height: 30px; padding: 4px 2px; border-top: 1px solid #e8eef8; font-size: 10px; }
.chat-generation-process li:first-child { border-top: 0; }
.chat-generation-process li.warning { color: #855900; }
.chat-generation-process li.skipped { opacity: .72; }
.chat-process-state { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: var(--ui-primary-strong); background: var(--ui-primary-soft); font-size: 9px; line-height: 1; }
.chat-process-state > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chat-generation-process li.warning .chat-process-state { color: #855900; background: #fff4cf; }
.chat-process-duration { color: var(--ui-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chat-process-legacy { margin: 0; padding: 2px 10px 8px 35px; color: var(--ui-muted); font-size: 9px; }
.chat-active-task .chat-bubble { width: min(560px, 76%); }
.chat-row.chat-active-task { animation: none; }
.chat-active-task-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.chat-active-task-head > div { min-width: 0; display: grid; gap: 3px; }
.chat-active-task-head strong { color: var(--ui-text); font-size: 13px; }
.chat-active-task-head span { color: var(--ui-muted); font-size: 10px; }
.chat-active-task-time { display: flex !important; grid-auto-flow: column; align-items: center; gap: 8px !important; white-space: nowrap; }
.chat-task-spinner { width: 17px; height: 17px; flex: 0 0 17px; border: 2px solid #d5e2fb; border-top-color: var(--ui-primary); border-radius: 50%; animation: chatTaskSpin .8s linear infinite; }
.chat-active-task-progress { height: 4px; margin-top: 11px; overflow: hidden; border-radius: 999px; background: #e9eff9; }
.chat-active-task-progress span { display: block; height: 100%; border-radius: inherit; background: var(--ui-primary); transition: width .25s ease; }
.chat-live-process { margin-bottom: 8px; }
.chat-live-process li.current .chat-process-state { color: #fff; background: var(--ui-primary); }
@keyframes chatTaskSpin { to { transform: rotate(360deg); } }
.generation-complete { margin-top: 11px; border-top: 1px solid var(--ui-line); }
.generation-complete summary { padding: 11px 0 2px; cursor: pointer; color: var(--ui-primary-strong); font-size: 11px; font-weight: 700; }
.generation-section { margin-top: 10px; }.generation-section h4 { margin: 0 0 7px; color: var(--ui-muted); font-size: 10px; }
.generation-row { display: grid; grid-template-columns: minmax(110px,1fr) minmax(100px,1fr) 100px 70px 90px; gap: 7px; padding: 8px 0; border-bottom: 1px solid #edf1f7; font-size: 10px; }
.generation-note { margin-bottom: 6px; padding: 8px 10px; border-radius: 8px; background: var(--ui-surface-soft); font-size: 10px; line-height: 1.6; }
.generation-note strong { color: var(--ui-muted); }
.generation-gx-header > h4 { color: var(--ui-text); font-size: 12px; }
.generation-gx-meta { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--ui-line); border-radius: 9px; background: var(--ui-line); }
.generation-gx-meta > div { min-width: 0; display: grid; grid-template-columns: 72px minmax(0,1fr); gap: 8px; padding: 7px 9px; background: var(--ui-surface); }
.generation-gx-meta dt { color: var(--ui-muted); font-size: 9px; }.generation-gx-meta dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: 10px; }
.generation-gx-daily .generation-note { white-space: pre-wrap; }
.generation-gx-records { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--ui-line); border-radius: 9px; background: var(--ui-line); }
.generation-gx-records > h4 { margin: 0; padding: 8px 10px; background: var(--ui-surface-soft); }
.generation-gx-record { display: grid; grid-template-columns: minmax(125px,.34fr) minmax(0,1fr); gap: 10px; padding: 8px 10px; background: var(--ui-surface); font-size: 10px; line-height: 1.55; }
.generation-gx-record strong { color: var(--ui-muted); }.generation-gx-record span { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-gx-inline-editor .chat-edit-notes textarea { min-height: 66px; }
.chat-gx-inline-editor .chat-edit-notes label:first-child textarea { min-height: 150px; }
.approval-inline { margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--ui-surface-soft); }
.approval-inline-item { padding: 8px 0; border-bottom: 1px solid var(--ui-line); font-size: 10px; }.approval-inline-item:last-child { border: 0; }
.approval-inline-item p { margin: 4px 0 0; color: var(--ui-muted); }
.chat-inline-editor { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ui-line); }
.chat-edit-row { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 6px; margin-bottom: 7px; }
.chat-edit-row input, .chat-edit-notes textarea, .chat-edit-notes input { width: 100%; min-width: 0; border: 1px solid var(--ui-line); border-radius: 8px; padding: 7px 8px; color: var(--ui-text); background: #fff; font-size: 10px; }
.chat-work-item-picker-wrap { position: relative; display: block; min-width: 0; }
.chat-work-item-picker-wrap input { padding-right: 30px; }
.chat-work-item-picker-wrap button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; min-height: 0; padding: 0; border: 0; border-radius: 6px; color: var(--ui-primary); background: var(--ui-primary-soft); box-shadow: none; }
.chat-work-item-picker-wrap button:hover:not(:disabled) { color: #fff; background: var(--ui-primary); box-shadow: none; }
.chat-conflict-note { margin-bottom: 9px; padding: 9px 10px; border: 1px solid #f0d9a6; border-radius: 9px; color: #8a5b00; background: var(--ui-warning-soft); font-size: 10px; }
.chat-conflict-note strong, .chat-conflict-note span { display: block; }.chat-conflict-note span { margin-top: 4px; color: #735d31; }
.chat-edit-notes { display: grid; gap: 6px; }.chat-edit-notes label { color: var(--ui-muted); font-size: 9px; }.chat-edit-notes textarea { min-height: 56px; resize: vertical; }
@keyframes chatEnter { from { opacity: 0; transform: translateY(8px); } }

.chat-composer-shell { position: relative; z-index: 20; padding: 2px max(24px, calc((100% - 900px)/2)) 16px; background: linear-gradient(180deg, rgba(241,244,249,0), rgba(241,244,249,.98) 23%); }
.chat-composer-resize-handle { width: min(900px,100%); height: 14px; margin: 0 auto 2px; display: grid; place-items: center; border-radius: 8px; cursor: ns-resize; touch-action: none; }
.chat-composer-resize-handle span { width: 52px; height: 4px; border-radius: 999px; background: #b9c7dc; transition: width .16s ease, background-color .16s ease; }
.chat-composer-resize-handle:hover span, .chat-composer-resize-handle:focus-visible span, body.is-resizing-composer .chat-composer-resize-handle span { width: 68px; background: var(--ui-primary); }
.chat-composer-resize-handle:focus-visible { outline: 2px solid #2563eb; outline-offset: -1px; }
body.is-resizing-composer { cursor: ns-resize; user-select: none; }
.chat-composer { position: relative; min-height: 72px; display: grid; grid-template-columns: 42px minmax(0,1fr) 46px; align-items: end; gap: 8px; padding: 10px; border: 1px solid var(--ui-line-strong); border-radius: 20px; background: rgba(255,255,255,.96); box-shadow: var(--ui-shadow-md), inset 0 1px 0 rgba(255,255,255,.95); }
.chat-icon-button, .chat-generate-mount button { width: 42px; height: 42px; padding: 0; border-radius: 13px; }
.chat-icon-button { border: 1px solid var(--ui-line); color: var(--ui-primary); background: var(--ui-primary-soft); font-size: 24px; }
.chat-generate-mount button { position: relative; display: grid; place-items: center; min-width: 42px !important; min-height: 42px !important; border: 0; color: #fff; background: var(--ui-primary); font-size: 0; box-shadow: 0 8px 18px rgba(45,99,232,.2); }
.chat-icon-button:hover:not(:disabled) { color: #fff; border-color: var(--ui-primary); background: var(--ui-primary); box-shadow: 0 8px 18px rgba(45,99,232,.18); }
.chat-generate-mount button:hover:not(:disabled) { background: var(--ui-primary-strong); box-shadow: 0 11px 22px rgba(45,99,232,.24); }
.chat-generate-mount button:active:not(:disabled) { background: #174ec9; transform: translateY(1px); }
.chat-generate-mount button:disabled { color: #8090aa; background: #e2e8f2; box-shadow: none; }
.chat-generate-mount button::before { content: none; }
.chat-generate-mount button svg { width: 22px; height: 22px; display: block; fill: currentColor; stroke: none; transform: translateX(.5px); }
.chat-generate-mount button.is-loading svg { visibility: hidden; }
.chat-generate-mount button.is-loading::after { content: ""; width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.42); border-top-color: #fff; border-radius: 50%; animation: sendSpin .72s linear infinite; }
@keyframes sendSpin { to { transform: rotate(360deg); } }
.chat-generate-mount button:disabled.is-loading { color: #fff; background: var(--ui-primary); }
.chat-composer-input { position: relative; min-width: 0; }
.chat-composer-input textarea { width: 100%; height: 42px; min-height: 42px; max-height: 280px; padding: 10px 6px 5px; overflow-y: auto; resize: none; border: 0; outline: 0; color: var(--ui-text); background: transparent; line-height: 1.55; font-size: 13px; }
.chat-voice-button { display: none; }
.chat-composer-hint { margin: 7px 8px 0; color: var(--ui-muted); font-size: 10px; text-align: center; }
.chat-composer-hint.error { color: var(--ui-danger); }
.chat-composer-hint button { min-height: 24px; margin-left: 7px; padding: 3px 8px; border: 1px solid #f2b8bd; border-radius: 7px; color: var(--ui-danger); background: #fff; box-shadow: none; font-size: 10px; }
.chat-composer-hint button:hover:not(:disabled), .chat-composer-hint button:focus-visible { border-color: var(--ui-danger); background: var(--ui-danger-soft); box-shadow: none; }
.chat-add-wrap { position: relative; }
.chat-camera-wrap, .mobile-ledger-action { display: none; }
.chat-add-menu { position: absolute; z-index: var(--ui-z-popover); left: 0; bottom: calc(100% + 12px); width: 260px; padding: 6px; border: 1px solid var(--ui-line); border-radius: 15px; background: rgba(255,255,255,.98); box-shadow: 0 16px 38px rgba(31,64,120,.14), 0 2px 8px rgba(31,64,120,.06); }
.chat-add-menu[hidden] { display: none; }
.chat-add-menu button { width: 100%; min-height: 50px; display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 1px 8px; padding: 8px 9px; border: 0; border-radius: 9px; color: var(--ui-text); background: transparent; box-shadow: none; transform: none; text-align: left; transition: color .16s ease, background-color .16s ease; }
.chat-add-menu button + button { margin-top: 1px; }
.chat-add-menu button:hover:not(:disabled) { color: var(--ui-text); background: var(--ui-primary-soft); box-shadow: none; transform: none; }
.chat-add-menu button:active:not(:disabled) { background: #e4edff; box-shadow: none; transform: none; }
.chat-add-menu button:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; box-shadow: none; }
.chat-add-menu button > span { grid-row: 1 / 3; align-self: center; color: var(--ui-primary); font-size: 18px; }.chat-add-menu button strong { font-size: 11px; }.chat-add-menu button small { color: var(--ui-muted); font-size: 9px; }
.chat-camera-menu { position: absolute; z-index: var(--ui-z-popover); bottom: calc(100% + 12px); left: 0; width: 252px; padding: 9px; border: 1px solid var(--ui-line); border-radius: 15px; color: var(--ui-text); background: rgba(255,255,255,.98); box-shadow: 0 16px 38px rgba(31,64,120,.14), 0 2px 8px rgba(31,64,120,.06); }
.chat-camera-menu[hidden] { display: none; }.chat-camera-menu > strong { display: block; padding: 3px 5px 7px; font-size: 12px; }.chat-camera-menu button { width: 100%; min-height: 48px; display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 1px 8px; padding: 7px 8px; border: 0; border-radius: 10px; color: var(--ui-text); background: transparent; box-shadow: none; text-align: left; }.chat-camera-menu button + button { margin-top: 2px; }.chat-camera-menu button:hover:not(:disabled), .chat-camera-menu button:focus-visible { color: var(--ui-text); background: var(--ui-primary-soft); box-shadow: none; }.chat-camera-menu button:active:not(:disabled) { background: #e4edff; transform: none; }.chat-camera-menu button > span { grid-row: 1 / 3; align-self: center; display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: var(--ui-primary); background: #edf3ff; font-size: 11px; font-weight: 800; }.chat-camera-menu button b { font-size: 11px; }.chat-camera-menu button small { color: var(--ui-muted); font-size: 9px; }
.composer-source-tray { width: min(900px,100%); margin: 0 auto 7px; display: flex; gap: 6px; overflow-x: auto; }.composer-source-tray[hidden] { display: none; }.composer-source-chip { min-height: 0; padding: 6px 9px; border: 1px solid var(--ui-line); border-radius: 9px; color: var(--ui-muted); background: #fff; box-shadow: none; font: inherit; font-size: 10px; white-space: nowrap; }

.chat-tool-drawer { position: fixed; z-index: var(--ui-z-dialog); top: 64px; right: 0; bottom: 0; width: min(470px, calc(100vw - 292px)); display: flex; flex-direction: column; border-left: 1px solid var(--ui-line); background: #fff; box-shadow: -18px 0 48px rgba(31,64,120,.16); }
.chat-tool-drawer[hidden] { display: none; }
.chat-tool-drawer > header { min-height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--ui-line); }
.chat-tool-drawer > header span, .chat-tool-drawer > header strong { display: block; }.chat-tool-drawer > header span { color: var(--ui-muted); font-size: 10px; }.chat-tool-drawer > header strong { margin-top: 3px; font-size: 16px; }.chat-tool-drawer > header button { width: 34px; height: 34px; min-height: 34px; padding: 0; display: grid; place-items: center; border: 1px solid var(--ui-line); border-radius: 10px; color: var(--ui-muted); background: #fff; }
.chat-tool-drawer > header button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.chat-tool-drawer-body { min-height: 0; flex: 1; overflow-y: auto; padding: 14px; }
.chat-tool-drawer-body > .section { display: block !important; margin: 0; padding: 0; border: 0; box-shadow: none; }
.chat-tool-drawer-body > .section::before { content: none !important; display: none !important; }
.chat-tool-drawer-body .section-number { display: none; }.chat-tool-drawer-body .section-head h2 { font-size: 14px; }.chat-tool-drawer-body .upload-box { border-color: #cbd8eb; background: var(--ui-surface-soft); }
.chat-tool-drawer > header button:hover:not(:disabled), .chat-tool-drawer-body button.ghost:hover:not(:disabled) { color: var(--ui-primary-strong); border-color: #c8d7f1; background: var(--ui-primary-soft); box-shadow: none; }
.chat-tool-drawer-body .upload-box:hover { border-color: #8cabe8; background: var(--ui-primary-soft); }
.chat-tool-drawer-body button.manual, .chat-tool-drawer-body button.success { border-color: var(--ui-primary); background: var(--ui-primary); box-shadow: 0 8px 18px rgba(45,99,232,.16); }
.chat-tool-drawer-body button.manual:hover:not(:disabled), .chat-tool-drawer-body button.success:hover:not(:disabled) { border-color: var(--ui-primary-strong); background: var(--ui-primary-strong); box-shadow: 0 10px 22px rgba(45,99,232,.2); }
.chat-tool-drawer-body button.manual:disabled, .chat-tool-drawer-body button.success:disabled { color: #8593a8; border-color: #d8e0ec; background: #edf1f7; box-shadow: none; cursor: not-allowed; opacity: 1; transform: none; }
.chat-tool-drawer-body button.ghost { border-color: var(--ui-line); color: var(--ui-text); background: #fff; box-shadow: none; }
.chat-tool-drawer-body #evidenceSection #imagePreview,
.chat-tool-drawer-body #scenePhotoSection #sceneImagePreview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.chat-tool-drawer-body #evidenceSection .image-ocr-card,
.chat-tool-drawer-body #scenePhotoSection .image-ocr-card { gap: 6px; padding: 6px; border-radius: 11px; contain-intrinsic-size: 190px 110px; }
.chat-tool-drawer-body #evidenceSection .image-ocr-card .thumb,
.chat-tool-drawer-body #scenePhotoSection .image-ocr-card .thumb { height: 96px; border-radius: 9px; }
.chat-tool-drawer-body #evidenceSection .image-ocr-card.has-ocr,
.chat-tool-drawer-body #scenePhotoSection .image-ocr-card.has-ocr { grid-column: 1 / -1; grid-template-columns: 112px minmax(0, 1fr); align-items: start; }
.chat-tool-drawer-body #evidenceSection .image-ocr-card.has-ocr .image-ocr-result,
.chat-tool-drawer-body #scenePhotoSection .image-ocr-card.has-ocr .image-ocr-result { min-width: 0; padding: 0 0 0 8px; border-top: 0; border-left: 1px solid var(--ui-line); }
.chat-tool-drawer-body #evidenceSection .image-ocr-card.has-ocr textarea,
.chat-tool-drawer-body #scenePhotoSection .image-ocr-card.has-ocr textarea { min-height: 96px; height: 96px; padding: 7px 8px; resize: vertical; }
.thumb.thumbnail-loading::before, .thumb.thumbnail-failed::before { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; padding: 8px; color: var(--ui-muted); font-size: 10px; text-align: center; pointer-events: none; }
.thumb.thumbnail-loading::before { content: "缩略图加载中"; }
.thumb.thumbnail-failed::before { content: "加载失败，点击重试"; color: var(--ui-danger); background: var(--ui-danger-soft); }

.record-context-menu button:hover:not(:disabled), .member-approval-summary:hover:not(:disabled) { color: var(--ui-primary-strong); background: var(--ui-primary-soft); box-shadow: none; transform: none; }
.panel-scroll-region:focus-visible { outline-color: rgba(45,99,232,.28); }
.desktop-scroll-thumb, .desktop-scroll-rail:hover .desktop-scroll-thumb, .desktop-scroll-rail.is-dragging .desktop-scroll-thumb { background: rgba(45,99,232,.68); }

.sidebar { position: fixed; z-index: var(--ui-z-popover); top: 64px; left: 292px; bottom: 0; width: 340px; margin: 0; padding: 18px; overflow-y: auto; border: 0; border-right: 1px solid var(--ui-line); border-radius: 0; background: #fff; box-shadow: 18px 0 48px rgba(31,64,120,.14); transform: translateX(-110%); transition: transform .22s ease; }
.sidebar.open { transform: translateX(0); }.sidebar .workflow-line, .sidebar .side-kicker { display: none; }.sidebar .left-panel-block { margin: 0; border: 0; padding: 0; }

.conversation-loading { display: grid; gap: 2px; padding-top: 10px; }
.chat-skeleton-bubble { width: min(520px, 62%); display: grid; gap: 9px; }
.chat-row.user .chat-skeleton-bubble { width: min(380px, 48%); }
.chat-skeleton-bubble .ui-skeleton { display: block; width: 100%; height: 14px; border-radius: 7px; }
.chat-skeleton-bubble .ui-skeleton.short { width: 42%; }.chat-skeleton-bubble .ui-skeleton.medium { width: 68%; }
.chat-load-error { min-height: 260px; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--ui-muted); text-align: center; }
.chat-load-error strong { color: var(--ui-text); font-size: 15px; }.chat-load-error span { max-width: 440px; font-size: 11px; }
.chat-load-error button { min-height: 34px; margin-top: 4px; padding: 7px 13px; border: 1px solid var(--ui-primary); border-radius: 9px; color: #fff; background: var(--ui-primary); box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
    .topbar .browser-tab.is-closing, .tab-ai-spinner, .chat-task-spinner, .weather-scene.is-loading .weather-copy, .weather-scene.is-loading .weather-details { animation: none; }
    .main, .topbar .browser-tab .close, .chat-user-actions { transition: none; }
}

@media (max-width: 900px) {
    .topbar { left: 0; padding: 0 12px; }.right-panel { transform: translateX(-105%); width: min(320px,88vw); transition: transform .22s ease; }.right-panel.mobile-open { transform: translateX(0); }
    .main { left: 0; }.chat-mobile-menu { display: inline-grid; width: 36px; height: 36px; place-items: center; padding: 0; border: 1px solid var(--ui-line); border-radius: 10px; color: var(--ui-text); background: #fff; }
    .chat-head-row { grid-template-columns: 36px minmax(0,1fr); }.chat-date-control { grid-column: 1 / -1; justify-content: flex-end; }
    .chat-head { padding-inline: 14px; }.weather-scene, .weather-scene.is-composite { grid-template-columns: 78px minmax(0,1fr); padding: 15px 16px; }.weather-visual-group { transform: scale(.8); transform-origin: left center; }.weather-side { grid-column: 1 / -1; width: 100%; }.weather-details { width: 100%; grid-template-columns: 1fr 1fr; justify-items: start; }.weather-details span:last-child { justify-self: end; }.chat-weather-input { display: none; }
    .conversation-stream { padding-inline: 14px; }.chat-bubble, .chat-row.user .chat-bubble { max-width: 92%; }.chat-composer-shell { padding-inline: 12px; }.generation-row { grid-template-columns: 1fr 1fr; }.chat-edit-row { grid-template-columns: 1fr 1fr; }
    .sidebar { left: 0; width: min(340px,92vw); }.chat-tool-drawer { top: 64px; width: min(470px,100vw); }
}

@media (max-width: 520px) {
    .topbar .status-strip > *:not(#currentUserPill):not(#logoutBtn) { display: none !important; }
    .chat-head-row h2 { font-size: 18px; }.weather-scene { min-height: 102px; border-radius: 18px; }.weather-copy strong { font-size: 25px; }
    .chat-composer { grid-template-columns: 38px minmax(0,1fr) 42px; border-radius: 17px; }.chat-icon-button { width: 38px; height: 38px; }.chat-generate-mount button { width: 42px; height: 42px; }.chat-add-menu { width: min(260px, calc(100vw - 42px)); }
}

/* Mobile workspace: the desktop resource rail becomes an intentional task sheet. */
.mobile-workspace-scrim, .mobile-resource-close, .mobile-photo-actions { display: none; }

@media (max-width: 767px) {
    html, body { height: var(--mobile-visual-height, 100dvh); overflow: hidden; overscroll-behavior: none; }
    body.has-mobile-layer { overflow: hidden; }
    .app { min-height: var(--mobile-visual-height, 100dvh); }
    .topbar {
        left: 0; height: 56px; min-height: 56px; padding: 0 8px; gap: 6px;
        grid-template-columns: minmax(0, 1fr); background: rgba(247,249,253,.97);
    }
    .topbar .browser-tabs-shell { min-height: 42px; gap: 4px; padding: 3px; border-radius: 11px; }
    .mobile-resource-toggle-mount { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; }
    .topbar .mobile-resource-toggle-mount .chat-mobile-menu { display: grid; width: 40px; height: 40px; min-height: 40px; }
    .topbar .browser-tab { min-width: 116px; max-width: 172px; height: 34px; padding-left: 9px; }
    .topbar .browser-tab .close { width: 30px !important; min-width: 30px !important; max-width: 30px; height: 30px !important; min-height: 30px !important; }
    .topbar .status-strip { display: none !important; }

    body.workspace-idle .topbar { display: none; }
    body.workspace-idle .layout > .main.panel-scroll-region,
    body.workspace-idle .main {
        top: 0;
        height: var(--mobile-visual-height, 100dvh);
    }
    body.workspace-idle .chat-head { padding: 12px 12px 0; }
    body.workspace-idle .chat-date-control,
    body.workspace-idle .weather-scene,
    body.workspace-idle .chat-composer-shell { display: none; }
    body.workspace-idle .conversation-stream {
        display: grid;
        place-items: center;
        padding: 24px 22px calc(28px + env(safe-area-inset-bottom));
    }

    .layout > .main.panel-scroll-region, .main {
        top: 56px; right: 0; bottom: auto; left: 0; width: 100%; height: calc(var(--mobile-visual-height, 100dvh) - 56px);
    }
    .layout > .main.panel-scroll-region.chat-drawer-open, .main.chat-drawer-open { right: 0; }
    .chat-workspace { min-height: 0; }
    .chat-head { display: grid; grid-template-columns: minmax(0, 1fr) 112px; align-items: center; gap: 7px; padding: 9px 12px 0; }
    .chat-head-row { display: contents; }
    .chat-head-row > div:nth-child(2), .chat-head-row > #mobileResourceToggleHome { display: none; }
    .chat-mobile-menu { width: 40px; height: 40px; min-height: 40px; border-radius: 12px; font-size: 0; }
    .chat-mobile-menu::before { content: none; }
    .chat-mobile-menu svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .chat-mobile-menu:active { transform: scale(.97); }
    .chat-mobile-menu:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 2px; }
    .chat-eyebrow, .chat-head-row h2 { display: none; }
    .chat-date-control { grid-column: 2; grid-row: 1; justify-content: flex-end; gap: 0; }
    .chat-date-control > label { display: none; }
    #chatDateMount input { width: 112px; height: 40px; min-width: 0; border-radius: 11px; font-size: 11px; }
    .weather-scene, .weather-scene.is-composite {
        grid-column: 1; grid-row: 1; width: 100%; height: 64px; min-height: 64px; box-sizing: border-box; grid-template-columns: 116px minmax(0,1fr); gap: 0 8px; margin: 0; padding: 5px 10px; border-radius: 15px;
        box-shadow: 0 5px 14px rgba(45,99,232,.12);
    }
    .weather-visual-column { display: grid; grid-template-rows: 42px 12px; width: 116px; height: 54px; align-items: center; justify-items: center; overflow: hidden; }
    .weather-visual-group { width: 108px; min-width: 108px; height: 42px; display: grid; place-items: center; transform: none; overflow: visible; }
    .weather-visual-slot { position: relative; display: block; width: 108px; height: 42px; overflow: visible; }
    .weather-visual-group .weather-visual-unit { position: absolute; top: 50%; left: 50%; margin: 0; overflow: visible; transform: translate(-50%, -50%) scale(.48); transform-origin: center; }
    .weather-visual-group.is-composite { width: 108px; min-width: 108px; display: grid; grid-template-columns: 47px 14px 47px; gap: 0; align-items: center; justify-content: start; padding: 0; box-sizing: border-box; }
    .weather-visual-group.is-composite .weather-visual-slot { width: 47px; height: 42px; }
    .weather-visual-group.is-composite .weather-visual-unit { flex: none; width: 82px; height: 72px; transform: translate(-50%, -50%) scale(.43); }
    .weather-visual-group.is-composite .weather-transition-separator { width: 14px; margin: 0; font-size: 14px; text-align: center; }
    .weather-mobile-condition { display: block; width: 112px; margin: 0; overflow: hidden; color: rgba(255,255,255,.88); font-size: 9px; font-weight: 700; line-height: 12px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
    .weather-copy { min-width: 0; align-self: center; overflow: hidden; text-align: right; }
    .weather-copy > span, .weather-copy p { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .weather-copy > #weatherSceneLabel, .weather-copy > #weatherSceneCondition { display: none; }
    .weather-copy strong { margin-top: 0; font-size: 24px; line-height: 1; }
    .weather-scene-location { display: block; margin-top: 3px; overflow: hidden; color: rgba(255,255,255,.82); font-size: 10px; font-weight: 700; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
    .weather-side { display: none; }
    .weather-scene.is-unbound { height: 64px; min-height: 64px; display: grid; grid-template-columns: 1fr; align-items: center; padding: 8px 12px; }
    .weather-scene.is-unbound .weather-visual-column,
    .weather-scene.is-unbound .weather-copy strong,
    .weather-scene.is-unbound .weather-side { display: none; }
    .weather-scene.is-unbound .weather-copy { grid-column: 1; text-align: left; }
    .weather-scene.is-unbound .weather-copy > span { display: none; }
    .weather-scene.is-unbound .weather-copy p { display: block; margin: 0; overflow: hidden; color: #fff; font-size: 12px; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }

    .conversation-stream { padding: 15px 12px max(18px, calc(var(--chat-composer-reserve, 96px) + 12px)); overscroll-behavior: contain; }
    .chat-row { gap: 8px; margin-bottom: 14px; }
    .chat-avatar { width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px; }
    .chat-bubble, .chat-row.user .chat-bubble { max-width: calc(100% - 40px); padding: 12px 13px; border-radius: 16px; font-size: 12px; }
    .chat-bubble-text { font-size: 12px; line-height: 1.7; }
    .chat-row.user:has(.chat-user-actions) { margin-bottom: 16px; }
    .chat-user-actions { position: absolute; top: 7px; right: 7px; padding: 0; opacity: 1; pointer-events: auto; transform: none; }
    .chat-user-action-toggle { display: inline-flex; min-height: 30px !important; padding: 4px 8px !important; border-color: rgba(255,255,255,.38) !important; color: #fff !important; background: rgba(17,48,112,.22) !important; box-shadow: none !important; }
    .chat-user-action-menu { position: absolute; z-index: 20; top: 34px; right: 0; width: 132px; padding: 5px; border: 1px solid var(--ui-line); border-radius: 10px; background: #fff; box-shadow: 0 12px 28px rgba(24,54,107,.18); }
    .chat-user-action-menu[hidden] { display: none; }
    .chat-user-action-menu button { width: 100%; min-height: 36px; padding: 6px 8px; border: 0; border-radius: 7px; color: var(--ui-text); background: transparent; text-align: left; box-shadow: none; }
    .chat-user-action-menu button:active { color: var(--ui-primary-strong); background: var(--ui-primary-soft); }
    .chat-ai-head { align-items: flex-start; gap: 8px; }
    .chat-ai-actions { flex-wrap: wrap; justify-content: flex-end; }
    .chat-ai-actions button { min-height: 32px; padding: 5px 7px; }
    .chat-process-summary { padding: 7px 8px; }
    .generation-row, .chat-edit-row { grid-template-columns: 1fr; gap: 6px; }
    .generation-gx-meta { grid-template-columns: 1fr; }
    .generation-gx-record { grid-template-columns: 1fr; gap: 4px; }
    .chat-edit-row input, .chat-edit-notes textarea, .chat-edit-notes input { min-height: 40px; font-size: 12px; }
    .chat-edit-notes textarea { min-height: 88px; }

    .chat-composer-shell { padding: 6px 10px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(0deg, #f1f4f9 84%, rgba(241,244,249,0)); }
    .chat-composer-resize-handle { min-height: 20px; touch-action: none; }
    .chat-composer { grid-template-columns: 42px 42px minmax(0,1fr) 46px; gap: 7px; padding: 7px; border-radius: 16px; }
    .chat-icon-button, .chat-camera-button { width: 42px; height: 42px; min-height: 42px; border-radius: 12px; }
    .chat-camera-wrap { position: relative; display: block; }
    .chat-camera-button { display: grid; place-items: center; padding: 0; border: 1px solid var(--ui-line); color: var(--ui-primary); background: #fff; box-shadow: none; }
    .chat-camera-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .chat-camera-button:active:not(:disabled) { color: #fff; border-color: var(--ui-primary); background: var(--ui-primary); transform: scale(.97); }
    .chat-camera-button:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 2px; }
    .chat-generate-mount button { width: 46px; height: 46px; min-height: 46px; }
    .chat-composer-input textarea, #logDesc {
        min-height: 42px;
        max-height: max(42px, min(280px, calc(var(--mobile-visual-height, 100dvh) - 300px)));
        padding: 10px 48px 6px 2px;
        font-size: 13px;
        line-height: 1.45;
    }
    .chat-voice-button {
        position: absolute; z-index: 1; top: 50%; right: 0; width: 44px; height: 44px; min-width: 44px; min-height: 44px;
        display: grid; place-items: center; padding: 0; border: 1px solid var(--ui-line); border-radius: 11px; color: var(--ui-primary); background: #fff;
        box-shadow: none; transform: translateY(-50%); transition: color .16s ease, border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
    }
    .chat-voice-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
    .chat-voice-button:disabled { color: #9aa8bd; border-color: #e1e7f0; background: #f3f6fa; cursor: not-allowed; }
    .chat-voice-button:not(:disabled):active { color: #fff; border-color: var(--ui-primary); background: var(--ui-primary); transform: translateY(-50%) scale(.96); }
    .chat-voice-button:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 2px; }
    .chat-voice-button.is-listening { color: #fff; border-color: #d84252; background: #d84252; box-shadow: 0 0 0 4px rgba(216,66,82,.14); animation: chatVoicePulse 1.35s ease-in-out infinite; }
    @keyframes chatVoicePulse { 50% { box-shadow: 0 0 0 7px rgba(216,66,82,0); } }
    .chat-composer-hint { display: none; }
    .chat-composer-hint.template-required { display: block; margin: 4px 10px 0; color: var(--ui-primary-strong); }
    .composer-source-tray { width: 100%; margin-bottom: 5px; padding-inline: 2px; }
    .composer-source-chip { min-height: 30px; padding: 6px 8px; color: var(--ui-primary-strong); font-size: 10px; font-weight: 700; cursor: pointer; transition: color .16s ease, border-color .16s ease, background-color .16s ease, transform .16s ease; }
    .composer-source-chip:active { border-color: var(--ui-primary); color: var(--ui-primary); background: var(--ui-primary-soft); transform: scale(.98); }
    .composer-source-chip:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 1px; }
    .chat-add-menu {
        position: fixed; z-index: calc(var(--ui-z-dialog) + 2); right: 0; bottom: 0; left: 0; width: auto;
        padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; box-shadow: 0 -10px 34px rgba(25,54,104,.18);
    }
    .chat-add-menu button { min-height: 52px; grid-template-columns: 38px minmax(0,1fr); border-radius: 11px; }
    .chat-camera-menu { position: fixed; z-index: calc(var(--ui-z-dialog) + 2); right: 0; bottom: 0; left: 0; width: auto; padding: 13px 12px calc(14px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; box-shadow: 0 -10px 34px rgba(25,54,104,.18); }
    .chat-camera-menu > strong { padding: 2px 5px 9px; font-size: 13px; }
    .chat-camera-menu button { min-height: 56px; grid-template-columns: 36px minmax(0,1fr); border-radius: 11px; }
    body.mobile-add-menu-open .chat-composer-shell,
    body.mobile-camera-menu-open .chat-composer-shell { z-index: calc(var(--ui-z-dialog) + 2); }
    body.mobile-add-menu-open .chat-composer,
    body.mobile-camera-menu-open .chat-composer { pointer-events: none; }
    body.mobile-add-menu-open .chat-add-wrap,
    body.mobile-add-menu-open .chat-add-menu,
    body.mobile-camera-menu-open .chat-camera-wrap,
    body.mobile-camera-menu-open .chat-camera-menu { pointer-events: auto; }
    @media (prefers-reduced-motion: reduce) { .chat-voice-button.is-listening { animation: none; } }

    .right-panel, .layout > .right-panel.panel-scroll-region {
        z-index: calc(var(--ui-z-dialog) + 1); inset: 0 auto 0 0; width: min(92vw, 390px); height: var(--mobile-visual-height, 100dvh);
        padding-bottom: env(safe-area-inset-bottom); transform: translateX(-105%); transition: transform .2s ease;
    }
    .right-panel.mobile-open, .layout > .right-panel.panel-scroll-region.mobile-open { transform: translateX(0); }
    .mobile-workspace-scrim { position: fixed; z-index: var(--ui-z-dialog); inset: 0; display: block; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: rgba(17,35,67,.38); }
    .mobile-workspace-scrim[hidden] { display: none; }
    .mobile-resource-close { width: 40px; height: 40px; min-height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--ui-line); border-radius: 12px; color: var(--ui-muted); background: #fff; font-size: 22px; line-height: 1; }
    .resource-brand { grid-template-columns: 42px minmax(0,1fr) 40px; min-height: 72px; padding: 14px; }
    .mobile-project-select-mount { padding: 0 14px 10px; border-bottom: 1px solid var(--ui-line); }
    .mobile-project-select-mount:not([hidden]) { display: block; }
    .mobile-project-select-mount .project-select { display: block !important; width: 100%; min-width: 0; height: 44px; }
    .right-panel .action-card button, .explorer-toolbar input, .explorer-toolbar select, .explorer-icon-btn { min-height: 44px; height: 44px; }
    .right-panel .action-card { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
    .member-template-card { display: none; }
    .mobile-account-mount { padding: 0 14px 10px; border-bottom: 1px solid var(--ui-line); }
    .mobile-account-mount:not([hidden]) { display: block; }
    .mobile-account-mount .mini-logout { width: 100%; min-height: 44px; border-radius: 11px; }

    .template-setup-scrim { z-index: calc(var(--ui-z-dialog) + 6); }
    .template-setup-dialog {
        z-index: calc(var(--ui-z-dialog) + 7); inset: 0; width: 100vw; height: var(--mobile-visual-height, 100dvh);
        max-height: none; display: flex; flex-direction: column; border: 0; border-radius: 0; transform: none; box-shadow: none;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .template-setup-head { min-height: 68px; padding: 12px 14px; }
    .template-setup-head h2 { font-size: 18px; }
    .template-setup-body { flex: 1; padding: 20px 16px; overflow: auto; }
    .template-setup-body > p { margin-bottom: 20px; font-size: 14px; }
    .template-setup-selects { grid-template-columns: 1fr; gap: 14px; }
    .template-setup-selects label:last-child { grid-column: auto; }
    .template-setup-selects select { min-height: 48px; margin-top: 7px; font-size: 16px; }
    .template-setup-summary { margin-top: 18px; font-size: 13px; }
    .template-setup-status { font-size: 12px; }
    .template-setup-actions { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
    .template-setup-actions button { flex: 1; min-height: 48px; font-size: 15px; }

    .chat-tool-drawer {
        z-index: 1000; inset: 0; width: 100vw; height: var(--mobile-visual-height, 100dvh);
        padding-bottom: env(safe-area-inset-bottom); border: 0; box-shadow: none;
    }
    body.mobile-tool-open .main { z-index: 999; }
    .chat-tool-drawer > header { min-height: 64px; padding: 12px 14px; }
    .chat-tool-drawer-body { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 12px 12px calc(18px + env(safe-area-inset-bottom)); }
    .chat-tool-drawer-body .upload-box { display: none; }
    .chat-tool-drawer-body .file-row { min-height: 52px; align-items: center; }
    .chat-tool-drawer-body #evidenceSection #imagePreview,
    .chat-tool-drawer-body #scenePhotoSection #sceneImagePreview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .chat-tool-drawer-body #evidenceSection .image-ocr-card.has-ocr,
    .chat-tool-drawer-body #scenePhotoSection .image-ocr-card.has-ocr { grid-template-columns: 96px minmax(0, 1fr); }
    .mobile-photo-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 10px 0; }
    .mobile-photo-actions button { min-height: 44px; padding: 8px; font-size: 12px; }
    .mobile-ledger-action { display: grid; gap: 7px; margin: 10px 0; }
    .mobile-ledger-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .mobile-ledger-action button { min-height: 46px; width: 100%; }
    .mobile-ledger-action span { color: var(--ui-muted); font-size: 10px; text-align: center; }
    #imageCameraInput, #sceneImageCameraInput, #wechatLedgerInput { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

    .preview-modal { z-index: calc(var(--ui-z-dialog) + 4); align-items: stretch; padding: 0; }
    .preview-dialog { width: 100vw; max-height: var(--mobile-visual-height, 100dvh); min-height: var(--mobile-visual-height, 100dvh); padding: 12px; border-radius: 0; }
    .preview-head { position: sticky; top: -12px; z-index: 2; min-height: 50px; padding: 8px 0; background: #fff; }
    .preview-head .mini-btn { min-height: 40px; }

    .chat-empty-idle { width: min(100%, 300px); min-height: 0; }
    .chat-empty-idle .chat-empty-mark { width: 50px; height: 50px; margin-bottom: 12px; border-radius: 16px; }
    .chat-empty-idle h3 { font-size: 20px; }
    .chat-empty-idle p { max-width: 260px; font-size: 13px; }
    .chat-empty-actions { width: 100%; display: grid; gap: 10px; margin-top: 22px; }
    .chat-empty-actions button { min-height: 46px; border-radius: 12px; font-size: 14px; font-weight: 800; }
    .chat-empty-actions [data-idle-action="new"] { border: 1px solid var(--ui-primary); color: #fff; background: var(--ui-primary); box-shadow: 0 8px 18px rgba(45,99,232,.18); }
    .chat-empty-actions [data-idle-action="open"] { border: 1px solid var(--ui-line-strong); color: var(--ui-primary-strong); background: rgba(255,255,255,.9); box-shadow: none; }
    .chat-empty-actions button:active { transform: scale(.98); }
}
