:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #171717;
  background: #fff;
  font-synthesis: none;
  --accent: #0f766e;
  --accent-soft: #ecfdf5;
  --line: #e8e8e5;
  --muted: #71717a;
  --surface: #f7f7f5;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body { margin: 0; min-width: 320px; background: #fff; }
button, textarea { font: inherit; }
button { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }

.app-shell { position: fixed; top: var(--app-top, 0px); right: 0; left: 0; height: 100vh; height: 100svh; height: var(--app-height, 100dvh); overflow: hidden; display: grid; grid-template-rows: 56px minmax(0, 1fr); }
.topbar { z-index: 10; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 56px; padding: 0 18px; border-bottom: 1px solid #efefed; background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 9px; width: max-content; color: #202020; text-decoration: none; font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
.topbar > .brand { justify-self: center; }
.brand-mark { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: #202020; font-family: "Microsoft YaHei", sans-serif; font-size: 13px; font-weight: 700; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.icon-button:hover { background: #f3f3f1; }
.icon-button:disabled { color: #b8b8b2; cursor: default; }
#menu-button { justify-self: start; }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 6px; }
.session-chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border: 1px solid #e7e7e4; border-radius: 999px; color: #66665f; background: #fafaf9; font-size: 12px; }
.session-dot { width: 6px; height: 6px; border-radius: 50%; background: #16a34a; }

.main { min-height: 0; position: relative; display: flex; flex-direction: column; }
.conversation { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 36px max(20px, calc((100% - 800px) / 2)) 190px; scroll-behavior: smooth; }
.empty { min-height: calc(100% - 40px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 0 70px; }
.hero-mark { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 24px; border: 1px solid #deded9; border-radius: 18px; background: linear-gradient(145deg,#fff,#f4f4f1); box-shadow: 0 8px 28px rgba(0,0,0,.05); }
.hero-mark span { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: #202020; font-size: 16px; font-weight: 700; }
.empty h1 { margin: 0 0 12px; font-size: clamp(27px, 4vw, 36px); line-height: 1.18; letter-spacing: -.045em; font-weight: 650; }
.empty > p { max-width: 560px; margin: 0; color: #707069; font-size: 15px; line-height: 1.7; }
.hero-upload { display: inline-flex; align-items: center; gap: 9px; height: 45px; margin-top: 28px; padding: 0 18px; border: 1px solid #292929; border-radius: 12px; color: #fff; background: #202020; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 5px 18px rgba(0,0,0,.1); }
.hero-upload:hover { background: #333; }
.hero-upload svg { width: 18px; height: 18px; }
.capabilities { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; color: #8b8b84; font-size: 12px; }
.capabilities i { width: 3px; height: 3px; border-radius: 50%; background: #c5c5bf; }
.chat { width: 100%; }

.message { width: 100%; display: flex; gap: 14px; margin: 0 0 30px; }
.message-avatar { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; margin-top: 2px; border-radius: 9px; color: #fff; background: #202020; font-size: 12px; font-weight: 700; }
.message-content { min-width: 0; max-width: calc(100% - 44px); }
.message-text { margin: 0; color: #2b2b29; font-size: 15px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user { justify-content: flex-end; }
.message.user .message-content { max-width: min(76%, 590px); display: flex; flex-direction: column; align-items: flex-end; }
.message.user .message-text { padding: 10px 15px; border-radius: 18px; background: #f2f2ef; }
.message.error .message-text { color: #991b1b; }
.message.partial .message-text { color: #8a4b08; }
.message-actions { min-height: 30px; display: flex; align-items: center; gap: 2px; margin-top: 8px; color: #92928d; }
.message-action { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; transition: background .15s, transform .15s; }
.message-action:hover { background: #f1f1ee; }
.message-action:active { transform: scale(.94); }
.message-action img { width: 19px; height: 19px; opacity: .9; }
.message-action.is-selected { box-shadow: inset 0 0 0 1px currentColor; }
.message-action.is-selected[data-rating="positive"] { color: #157347; background: #e8f5ee; }
.message-action.is-selected[data-rating="negative"] { color: #b42318; background: #fff0ee; }
.message-action.is-selected[data-rating="positive"] img { opacity: 1; filter: invert(37%) sepia(39%) saturate(1082%) hue-rotate(103deg) brightness(88%) contrast(88%); }
.message-action.is-selected[data-rating="negative"] img { opacity: 1; filter: invert(22%) sepia(74%) saturate(2359%) hue-rotate(351deg) brightness(87%) contrast(88%); }
.message-time { margin-left: 7px; color: #969690; font-size: 12px; font-variant-numeric: tabular-nums; }
.message-recovery-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.message-recovery { min-height: 34px; padding: 0 13px; border: 1px solid #b9b9b2; border-radius: 9px; color: #33332f; background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.message-recovery:hover { background: #f6f6f2; }
.message.error .message-recovery { border-color: #b91c1c; color: #991b1b; }
.message.error .message-recovery:hover { background: #fff7f7; }
.retry-upload { align-self: flex-start; min-height: 34px; margin-top: 10px; padding: 0 13px; border: 1px solid #b91c1c; border-radius: 9px; color: #991b1b; background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.retry-upload:hover { background: #fff7f7; }
.message.pending .message-text { color: #71717a; }
.typing-dots { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.typing-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: bounce 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }

.media-grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; margin-top: 14px; }
.message.user .media-grid { width: min(380px, 100%); }
.media-card { min-width: 0; position: relative; overflow: hidden; margin: 0; border: 1px solid #e3e3df; border-radius: 14px; background: #fafaf8; }
.media-card button.media-open { width: 100%; display: block; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.media-card img { width: 100%; max-height: 360px; display: block; object-fit: contain; background: #fff; }
.candidate-index { position: absolute; top: 10px; left: 10px; min-width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: rgba(20,20,20,.82); font-size: 12px; font-weight: 700; backdrop-filter: blur(5px); pointer-events: none; }
.media-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px 9px 13px; border-top: 1px solid #e8e8e4; }
.media-footer span { color: #777770; font-size: 12px; }
.select-candidate { min-height: 32px; padding: 0 12px; border: 1px solid #d7d7d2; border-radius: 9px; background: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }
.select-candidate:hover { border-color: #aaa9a3; background: #f7f7f4; }
.select-candidate:disabled { color: #999991; background: #f1f1ee; border-color: #e2e2dd; cursor: default; }
.answer-label { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--accent); font-size: 12px; font-weight: 650; }
.answer-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #14b8a6; }
.expired-image { display: block; padding: 24px 16px; color: #777770; font-size: 13px; text-align: center; }

.composer-dock { position: absolute; z-index: 8; left: 0; right: 0; bottom: 0; padding: 45px 20px 14px; background: linear-gradient(to bottom, transparent, #fff 28%, #fff); pointer-events: none; }
.drop-target { width: min(800px, 100%); margin: auto; pointer-events: auto; }
.composer { padding: 10px 11px 9px; border: 1px solid #d9d9d5; border-radius: 21px; background: #fff; box-shadow: 0 10px 34px rgba(0,0,0,.09); transition: border-color .16s, box-shadow .16s; }
.composer:focus-within { border-color: #b8b8b2; box-shadow: 0 12px 38px rgba(0,0,0,.11); }
.composer textarea { width: 100%; min-height: 42px; max-height: 160px; resize: none; display: block; padding: 7px 8px 9px; border: 0; outline: 0; color: #242422; background: transparent; font-size: 15px; line-height: 1.5; }
.composer textarea::placeholder { color: #96968f; }
.composer-toolbar { height: 36px; display: flex; align-items: center; gap: 8px; }
.tool-button { height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border-radius: 10px; color: #4f4f49; cursor: pointer; font-size: 13px; font-weight: 520; }
.tool-button:hover { background: #f3f3f0; }
.tool-button input { display: none; }
.tool-button svg { width: 18px; height: 18px; }
.composer-hint { color: #a0a099; font-size: 11px; }
.send-button { width: 34px; height: 34px; display: grid; place-items: center; margin-left: auto; border: 0; border-radius: 11px; color: #fff; background: #202020; cursor: pointer; }
.send-button:disabled { color: #a6a69f; background: #e6e6e2; cursor: default; }
.send-button svg { width: 18px; height: 18px; stroke-width: 2; }
.runtime-status { min-height: 22px; display: flex; align-items: center; justify-content: center; gap: 7px; padding-top: 7px; color: #8c8c85; font-size: 11px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #22a06b; }
.runtime-status[data-state="working"] .status-dot { background: #d97706; animation: pulse 1.2s ease-in-out infinite; }
.runtime-status[data-state="error"] { color: #a61b1b; }
.runtime-status[data-state="error"] .status-dot { background: #dc2626; }
.fine-print { margin: 3px 0 0; color: #a1a19a; text-align: center; font-size: 11px; pointer-events: auto; }

.drawer-backdrop { position: fixed; z-index: 30; inset: 0; background: rgba(0,0,0,.22); backdrop-filter: blur(2px); }
.drawer { position: fixed; z-index: 31; inset: 0 auto 0 0; width: min(330px, 88vw); display: flex; flex-direction: column; padding: 13px; background: #f7f7f4; border-right: 1px solid #e4e4df; box-shadow: 16px 0 50px rgba(0,0,0,.12); transform: translateX(-102%); transition: transform .22s ease; }
.drawer.is-open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 2px 3px 14px 7px; }
.new-chat { width: 100%; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid #deded9; border-radius: 12px; background: #fff; cursor: pointer; font-size: 14px; font-weight: 560; }
.new-chat:hover { background: #fafaf8; border-color: #c9c9c3; }
.new-chat svg { width: 18px; height: 18px; }
.drawer-section { margin-top: 24px; }
.drawer-section h2 { margin: 0 0 9px; padding: 0 9px; color: #8a8a83; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.current-session { display: flex; gap: 10px; padding: 11px; border-radius: 11px; background: #ebebe7; }
.session-icon { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 8px; color: #4f4f49; background: #fff; }
.session-icon svg { width: 16px; height: 16px; }
.current-session strong, .current-session small { display: block; }
.current-session strong { margin: 1px 0 3px; font-size: 13px; font-weight: 600; }
.current-session small { color: #777770; font-size: 11px; }
.how-it-works ol { display: grid; gap: 11px; margin: 0; padding: 5px 9px; list-style: none; color: #5f5f59; font-size: 13px; }
.how-it-works li { display: flex; align-items: center; gap: 10px; }
.how-it-works li span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; background: #e7e7e2; color: #55554f; font-size: 11px; font-weight: 700; }
.privacy-note { display: flex; gap: 10px; margin-top: auto; padding: 13px; border: 1px solid #dfdfda; border-radius: 12px; background: #fff; }
.privacy-note > svg { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 1px; color: var(--accent); }
.privacy-note p { margin: 0; }
.privacy-note strong, .privacy-note span { display: block; }
.privacy-note strong { margin-bottom: 3px; font-size: 12px; }
.privacy-note span { color: #777770; font-size: 11px; line-height: 1.5; }

.drop-overlay { position: fixed; z-index: 50; inset: 12px; display: grid; place-items: center; border: 2px dashed #4f4f49; border-radius: 20px; background: rgba(255,255,255,.94); opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.drop-overlay.is-visible { opacity: 1; }
.drop-overlay > div { text-align: center; }
.drop-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 15px; color: #fff; background: #202020; }
.drop-overlay strong, .drop-overlay small { display: block; }
.drop-overlay strong { font-size: 18px; }
.drop-overlay small { margin-top: 7px; color: #777770; font-size: 12px; }
.lightbox { position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; padding: 56px 24px 24px; background: rgba(15,15,15,.88); backdrop-filter: blur(8px); }
.lightbox img { max-width: min(1100px, 96vw); max-height: calc(100vh - 80px); object-fit: contain; border-radius: 8px; background: #fff; }
.lightbox-close { position: absolute; top: 14px; right: 18px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #fff; background: rgba(255,255,255,.12); cursor: pointer; }

.feedback-backdrop { position: fixed; z-index: 70; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(20,20,20,.28); backdrop-filter: blur(3px); }
.feedback-dialog { width: min(620px, 100%); max-height: min(720px, calc(100dvh - 32px)); overflow-y: auto; padding: 27px; border: 1px solid #e2e2de; border-radius: 20px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.18); }
.feedback-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.feedback-header h2 { margin: 0; color: #232321; font-size: 23px; line-height: 1.25; letter-spacing: -.035em; }
.feedback-header p { margin: 7px 0 0; color: #85857e; font-size: 13px; }
.feedback-close { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; margin: -6px -6px 0 0; padding: 0; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.feedback-close:hover { background: #f2f2ef; }
.feedback-close img { width: 21px; height: 21px; }
.feedback-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 22px; }
.feedback-tag { min-height: 38px; padding: 0 15px; border: 1px solid #e0e0dc; border-radius: 999px; color: #474743; background: #fff; font-size: 13px; cursor: pointer; }
.feedback-tag:hover { border-color: #bdbdb7; background: #fafaf8; }
.feedback-tag[aria-pressed="true"] { border-color: #30302d; color: #fff; background: #30302d; }
.feedback-detail-label { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; color: #41413d; font-size: 13px; font-weight: 620; }
.feedback-detail-label span { color: #999992; font-size: 11px; font-weight: 450; }
.feedback-detail { width: 100%; min-height: 126px; resize: vertical; display: block; padding: 13px 14px; border: 1px solid #d8d8d3; border-radius: 13px; outline: 0; color: #292927; background: #fff; font-size: 14px; line-height: 1.6; }
.feedback-detail:focus { border-color: #6f6f69; box-shadow: 0 0 0 3px rgba(35,35,32,.08); }
.feedback-detail::placeholder { color: #a0a09a; }
.feedback-privacy { margin: 10px 0 18px; color: #999992; font-size: 11px; line-height: 1.5; }
.feedback-error { margin: -7px 0 12px; color: #a61b1b; font-size: 12px; }
.feedback-actions { display: flex; gap: 10px; }
.feedback-cancel { min-width: 120px; height: 46px; padding: 0 17px; border: 1px solid #d7a6a1; border-radius: 12px; color: #a12820; background: #fff; font-size: 14px; font-weight: 620; cursor: pointer; }
.feedback-cancel:hover { border-color: #c2746d; background: #fff7f6; }
.feedback-cancel:disabled { color: #aaa5a2; border-color: #dedbd8; background: #f5f4f2; cursor: wait; }
.feedback-submit { flex: 1; height: 46px; border: 0; border-radius: 12px; color: #fff; background: #30302d; font-size: 14px; font-weight: 650; cursor: pointer; }
.feedback-submit:hover { background: #41413d; }
.feedback-submit:disabled { color: #f1f1ef; background: #acaca8; cursor: wait; }

.author-contact-backdrop { position: fixed; z-index: 75; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(20,20,20,.28); backdrop-filter: blur(3px); }
.author-contact-dialog { width: min(430px, 100%); padding: 27px; border: 1px solid #e2e2de; border-radius: 20px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.18); }
.author-contact-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.author-contact-header h2 { margin: 0; color: #232321; font-size: 23px; line-height: 1.25; letter-spacing: -.035em; }
.author-contact-header p { margin: 7px 0 0; color: #85857e; font-size: 13px; }
.author-contact-value { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 16px; padding: 15px 16px; border: 1px solid #dfdfda; border-radius: 12px; background: #f8f8f6; }
.author-contact-value span { color: #777770; font-size: 13px; }
.author-contact-value strong { color: #232321; font-size: 17px; letter-spacing: .02em; overflow-wrap: anywhere; }
.author-contact-copy { width: 100%; height: 46px; border: 0; border-radius: 12px; color: #fff; background: #30302d; font-size: 14px; font-weight: 650; cursor: pointer; }
.author-contact-copy:hover { background: #41413d; }

.a3-unit-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.a3-unit-choice { min-height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid #d7d7d2; border-radius: 9px; color: #33332f; background: #fff; font-size: 13px; font-weight: 620; cursor: pointer; }
.a3-unit-choice:hover { border-color: #999992; background: #f7f7f4; }
.a3-unit-choice:disabled { color: #999991; border-color: #e2e2dd; background: #f1f1ee; cursor: default; }
.a3-unit-choice.is-complete { color: #176b55; border-color: #b7dbcf; background: #eef8f4; }
.a3-unit-choice svg { width: 16px; height: 16px; }

.a3-crop-workspace { position: fixed; z-index: 65; inset: 0; display: grid; grid-template-rows: 58px minmax(0, 1fr) 78px; color: #20201e; background: #f4f4f1; }
.a3-crop-header { min-width: 0; position: relative; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid #deded9; background: #fff; }
.a3-crop-heading { min-width: 0; position: absolute; top: 50%; left: 50%; max-width: calc(100% - 280px); display: flex; align-items: baseline; justify-content: center; gap: 9px; transform: translate(-50%, -50%); }
.a3-crop-heading strong { font-size: 15px; font-weight: 680; }
.a3-crop-heading span { max-width: min(36vw, 360px); overflow: hidden; color: #777770; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.a3-header-action { justify-self: end; min-height: 34px; padding: 0 11px; border: 1px solid #d8d8d3; border-radius: 9px; background: #fff; font-size: 12px; font-weight: 620; cursor: pointer; }
.a3-header-action:hover { background: #f5f5f2; }
.a3-crop-body { min-height: 0; display: grid; grid-template-columns: 290px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.a3-crop-guide { grid-row: 1 / 3; padding: 28px 24px; border-right: 1px solid #deded9; background: #fff; }
.a3-crop-guide > div { display: flex; align-items: flex-start; gap: 12px; }
.a3-step { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: #202020; font-size: 12px; font-weight: 700; }
.a3-crop-guide h2 { margin: 1px 0 8px; font-size: 15px; line-height: 1.4; font-weight: 680; }
.a3-crop-guide p { margin: 0; color: #707069; font-size: 12px; line-height: 1.7; }
.a3-example-button { width: 100%; min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; border: 1px solid #d6d6d1; border-radius: 9px; color: #383834; background: #fafaf8; font-size: 12px; font-weight: 620; cursor: pointer; }
.a3-example-button:hover { border-color: #ababA5; background: #f2f2ef; }
.a3-example-button svg { width: 17px; height: 17px; }
.a3-context { min-width: 0; padding: 11px 18px; border-bottom: 1px solid #deded9; background: #fbfbfa; }
.a3-context span { display: block; margin-bottom: 3px; color: #8a8a83; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.a3-context p { max-height: 42px; overflow: auto; margin: 0; color: #53534e; font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.a3-image-area { min-width: 0; min-height: 0; position: relative; overflow: auto; padding: 22px; background-color: #e8e8e4; background-image: linear-gradient(45deg, #deded9 25%, transparent 25%), linear-gradient(-45deg, #deded9 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #deded9 75%), linear-gradient(-45deg, transparent 75%, #deded9 75%); background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-size: 16px 16px; }
.a3-image-frame { position: relative; width: fit-content; line-height: 0; overflow: hidden; margin: 0 auto; border: 1px solid #cfcfca; background: #fff; box-shadow: 0 8px 28px rgba(0,0,0,.08); cursor: crosshair; touch-action: none; user-select: none; }
.a3-source-image { display: block; object-fit: contain; pointer-events: none; user-select: none; }
.a3-selection { position: absolute; z-index: 2; border: 2px solid #0f766e; background: rgba(15,118,110,.08); box-shadow: 0 0 0 9999px rgba(20,20,20,.34); cursor: move; pointer-events: auto; touch-action: none; }
.a3-selection i { position: absolute; width: 44px; height: 44px; border: 0; background: transparent; touch-action: none; }
.a3-selection i::after { content: ''; position: absolute; width: 15px; height: 15px; border-color: #fff; border-style: solid; filter: drop-shadow(0 1px 1px rgba(0,0,0,.45)); }
.a3-selection i[data-a3-handle="nw"] { top: -2px; left: -2px; cursor: nwse-resize; }
.a3-selection i[data-a3-handle="nw"]::after { top: 0; left: 0; border-width: 3px 0 0 3px; }
.a3-selection i[data-a3-handle="ne"] { top: -2px; right: -2px; cursor: nesw-resize; }
.a3-selection i[data-a3-handle="ne"]::after { top: 0; right: 0; border-width: 3px 3px 0 0; }
.a3-selection i[data-a3-handle="se"] { right: -2px; bottom: -2px; cursor: nwse-resize; }
.a3-selection i[data-a3-handle="se"]::after { right: 0; bottom: 0; border-width: 0 3px 3px 0; }
.a3-selection i[data-a3-handle="sw"] { bottom: -2px; left: -2px; cursor: nesw-resize; }
.a3-selection i[data-a3-handle="sw"]::after { bottom: 0; left: 0; border-width: 0 0 3px 3px; }
.a3-image-hint { position: absolute; z-index: 3; top: 14px; left: 50%; transform: translateX(-50%); padding: 7px 10px; border-radius: 8px; color: #fff; background: rgba(31,31,29,.84); font-size: 11px; line-height: 1; white-space: nowrap; pointer-events: none; }
.a3-crop-footer { display: flex; align-items: center; justify-content: flex-end; gap: 18px; padding: 0 max(20px, calc((100% - 1040px) / 2)); border-top: 1px solid #deded9; background: #fff; }
.a3-crop-footer p { margin: 0; color: #777770; font-size: 12px; }
.a3-crop-footer p.is-warning { color: #a43b18; }
.a3-submit { min-width: 210px; height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 0; border-radius: 10px; color: #fff; background: #202020; font-size: 13px; font-weight: 650; cursor: pointer; }
.a3-submit:hover { background: #333; }
.a3-submit:disabled { color: #9c9c95; background: #e2e2de; cursor: default; }
.a3-submit svg { width: 17px; height: 17px; }

.a3-sheet-backdrop, .a3-example-backdrop { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(20,20,20,.28); backdrop-filter: blur(3px); }
.a3-sheet, .a3-example-dialog { width: min(620px, 100%); max-height: min(720px, calc(100dvh - 32px)); overflow-y: auto; padding: 24px; border: 1px solid #e2e2de; border-radius: 16px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.18); }
.a3-sheet > header, .a3-example-dialog > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.a3-sheet h2, .a3-example-dialog h2 { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 680; }
.a3-sheet header p, .a3-example-dialog header p { margin: 6px 0 0; color: #85857e; font-size: 12px; line-height: 1.55; }
.a3-sheet-units { display: grid; gap: 8px; }
.a3-sheet-unit { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border: 1px solid #dfdfda; border-radius: 9px; background: #fff; text-align: left; cursor: pointer; }
.a3-sheet-unit:hover { border-color: #a9a9a3; background: #f8f8f6; }
.a3-sheet-unit[aria-current="true"] { border-color: #0f766e; box-shadow: inset 0 0 0 1px #0f766e; }
.a3-sheet-unit:disabled { color: #8a8a83; background: #f1f1ee; cursor: default; }
.a3-sheet-unit strong, .a3-sheet-unit small { display: block; }
.a3-sheet-unit strong { font-size: 13px; }
.a3-sheet-unit small { max-width: 420px; overflow: hidden; margin-top: 3px; color: #85857e; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.a3-sheet-unit svg { width: 17px; height: 17px; flex: 0 0 17px; color: #0f766e; }
.a3-sheet-overlay { width: 100%; display: grid; grid-template-columns: 104px minmax(0,1fr); align-items: center; gap: 12px; margin: 0 0 14px; padding: 8px; border: 1px solid #dfdfda; border-radius: 8px; background: #f8f8f6; color: #40403c; text-align: left; cursor: pointer; }
.a3-sheet-overlay img { width: 104px; aspect-ratio: 4 / 3; object-fit: contain; border: 1px solid #e4e4df; border-radius: 5px; background: #fff; }
.a3-sheet-overlay span { font-size: 12px; font-weight: 650; }
.a3-auto-unit { width: 100%; min-height: 92px; display: grid; grid-template-columns: auto 112px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 9px; border: 1px solid #dfdfda; border-radius: 8px; background: #fff; color: #282825; text-align: left; cursor: pointer; }
.a3-auto-unit:hover { border-color: #aaa9a3; background: #fafaf8; }
.a3-auto-unit.is-prepared { grid-template-columns: 112px minmax(0,1fr) auto; }
.a3-auto-unit.is-closed, .a3-auto-unit:disabled { color: #282825; background: #f1f1ee; opacity: .72; cursor: default; }
.a3-auto-unit:disabled .a3-auto-unit-arrow { color: #282825; }
.a3-auto-unit > input { width: 18px; height: 18px; margin: 0 1px; accent-color: #0f766e; }
.a3-auto-unit-visual { width: 112px; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; border: 1px solid #e3e3de; border-radius: 5px; background: #f3f3ef; color: #7a7a73; font-size: 10px; text-align: center; }
.a3-auto-unit-visual img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.a3-auto-unit-copy { min-width: 0; }
.a3-auto-unit-copy strong, .a3-auto-unit-copy small { display: block; overflow-wrap: anywhere; }
.a3-auto-unit-copy strong { font-size: 13px; line-height: 1.35; }
.a3-auto-unit-copy small { margin-top: 5px; color: #77776f; font-size: 11px; line-height: 1.4; }
.a3-auto-unit-arrow { color: #0f766e; font-size: 11px; font-weight: 650; white-space: nowrap; }
.a3-sheet-footer { position: sticky; bottom: -24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px -24px -24px; padding: 13px 24px; border-top: 1px solid #e2e2de; background: rgba(255,255,255,.97); }
.a3-sheet-footer span { color: #6f6f69; font-size: 12px; }
.a3-sheet-footer button { min-height: 38px; padding: 0 15px; border: 0; border-radius: 7px; background: #0f766e; color: #fff; font-size: 12px; font-weight: 650; cursor: pointer; }
.a3-sheet-footer button:disabled { background: #c9c9c3; cursor: default; }
.a3-example-backdrop { z-index: 85; }
.a3-example-dialog { width: min(760px, 100%); }
.a3-example-dialog canvas { width: 100%; height: auto; display: block; border: 1px solid #dfdfda; border-radius: 8px; background: #f7f7f4; }
.a3-example-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 13px; color: #65655f; font-size: 11px; }
.a3-example-legend span { display: inline-flex; align-items: center; gap: 6px; }
.a3-example-legend i { width: 9px; height: 9px; border-radius: 3px; background: #202020; }
.a3-example-legend i.load { background: #c2410c; }

button:focus-visible, [role="button"]:focus-visible, textarea:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
@keyframes pulse { 50% { opacity: .3; } }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-3px); opacity: 1; } }

@media (max-width: 640px) {
  .topbar { padding: 0 10px; }
  #top-new-chat { display: none; }
  .session-chip { display: none; }
  .conversation { padding: 24px 14px 175px; }
  .empty { justify-content: flex-start; padding-top: max(72px, 14vh); }
  .empty h1 { font-size: 27px; }
  .empty > p { max-width: 340px; font-size: 14px; }
  .capabilities { max-width: 300px; }
  .capabilities i:nth-of-type(2) { display: none; }
  .capabilities span:last-child { flex-basis: 100%; }
  .message { gap: 10px; margin-bottom: 25px; }
  .message-avatar { width: 28px; height: 28px; flex-basis: 28px; }
  .message-content { max-width: calc(100% - 38px); }
  .message.user .message-content { max-width: 88%; }
  .media-grid { grid-template-columns: 1fr; }
  .composer-dock { padding: 38px 10px 10px; }
  .composer { border-radius: 19px; }
  .composer-hint { display: none; }
  .fine-print { font-size: 10px; }
  .feedback-backdrop { align-items: end; padding: 0; }
  .feedback-dialog { width: 100%; max-height: min(82dvh, 680px); padding: 23px 18px max(20px, env(safe-area-inset-bottom)); border-width: 1px 0 0; border-radius: 20px 20px 0 0; }
  .author-contact-backdrop { align-items: end; padding: 0; }
  .author-contact-dialog { width: 100%; padding: 23px 18px max(20px, env(safe-area-inset-bottom)); border-width: 1px 0 0; border-radius: 20px 20px 0 0; }
  .feedback-header h2 { font-size: 21px; }
  .feedback-tag { min-height: 36px; padding: 0 13px; font-size: 12px; }
  .a3-crop-workspace { grid-template-rows: 54px minmax(0, 1fr) auto; }
  .a3-crop-header { padding: 0 8px; }
  .a3-crop-heading { width: 42vw; max-width: 160px; display: block; text-align: center; }
  .a3-crop-heading strong, .a3-crop-heading span { display: block; }
  .a3-crop-heading strong { font-size: 14px; }
  .a3-crop-heading span { width: 100%; max-width: 42vw; margin: 2px auto 0; font-size: 10px; }
  .a3-header-action { padding: 0 8px; font-size: 11px; }
  .a3-crop-body { display: flex; flex-direction: column; }
  .a3-crop-guide { flex: 0 0 auto; padding: 13px 14px 11px; border-right: 0; border-bottom: 1px solid #deded9; }
  .a3-step { width: 22px; height: 22px; flex-basis: 22px; }
  .a3-crop-guide h2 { margin: 0 0 4px; font-size: 13px; }
  .a3-crop-guide p { font-size: 11px; line-height: 1.55; }
  .a3-example-button { width: auto; min-height: 32px; margin: 9px 0 0 34px; padding: 0 10px; }
  .a3-context { padding: 8px 14px; }
  .a3-context p { max-height: 34px; font-size: 11px; }
  .a3-image-area { flex: 1 1 auto; padding: 12px; }
  .a3-crop-footer { display: grid; grid-template-columns: 1fr; gap: 7px; padding: 9px 12px max(10px, env(safe-area-inset-bottom)); }
  .a3-crop-footer p { text-align: center; }
  .a3-submit { width: 100%; min-width: 0; }
  .a3-sheet-backdrop, .a3-example-backdrop { align-items: end; padding: 0; }
  .a3-sheet, .a3-example-dialog { width: 100%; max-height: min(82dvh, 680px); padding: 21px 16px max(18px, env(safe-area-inset-bottom)); border-width: 1px 0 0; border-radius: 16px 16px 0 0; }
  .a3-auto-unit { grid-template-columns: auto 88px minmax(0,1fr) auto; min-height: 76px; }
  .a3-auto-unit.is-prepared { grid-template-columns: 88px minmax(0,1fr) auto; }
  .a3-auto-unit-visual { width: 88px; }
  .a3-sheet-footer { bottom: calc(-1 * max(18px, env(safe-area-inset-bottom))); margin: 14px -16px calc(-1 * max(18px, env(safe-area-inset-bottom))); padding: 12px 16px max(12px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
