/* UX-01: v0 visual language, layered after the existing mode-specific cascade.
   Existing native Adaptive Surface still owns Mini geometry. */
:root { --bg-primary:#0b0e16;--bg-secondary:#101520;--bg-tertiary:#151c2a;--bg-input:#101520;--bg-hover:#1b2434;--border:#262e40;--border-active:#22d3ee65;--accent:#22d3ee;--accent-dim:#22d3ee99;--accent-glow:#22d3ee12;--text-primary:#edf2fa;--text-secondary:#b7c2d5;--text-muted:#8291a9;--success:#64d8ad;--warning:#e9b864;--error:#f08087;--font:'Segoe UI',system-ui,-apple-system,sans-serif;--sidebar-w:210px;--radius:12px;--radius-lg:16px; }
html,body {background:#0b0e16;color:var(--text-primary);font-family:var(--font);}
[hidden] {display:none!important;}
button,input,textarea,select {font:inherit;}
button {cursor:pointer;}
button:disabled {cursor:not-allowed;opacity:.5;}
:where(button,a,input,textarea,summary):focus-visible {outline:2px solid var(--accent);outline-offset:3px;}
.app .sidebar {background:#0d111b;border-right:1px solid var(--border);}
.app .sidebar-header {border-bottom:1px solid var(--border);padding:20px 16px;}
.app .sidebar-logo-ver {color:var(--text-muted);font-size:10px;}
.app .chat-item {border-radius:10px;margin:3px 8px;padding:12px;}
.app .chat-item.active {background:#1b2535;border-color:transparent;box-shadow:none;}
.app .main-area,.app .content,.app .chat-view {min-width:0;}
.app .header {background:#0b0e16;border-bottom:1px solid var(--border);box-shadow:none;min-height:52px;}
.app .header-title {font:500 13px var(--font);color:var(--text-muted);}
.app .header-right .btn-header-link {background:transparent;border-color:transparent;}
.app .chat-view {background:#0b0e16;display:flex;flex-direction:column;}
.ux-navigation {display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:14px 24px;border-bottom:1px solid var(--border);}
.ux-brand {display:flex;align-items:center;gap:9px;font-size:16px;font-weight:650;letter-spacing:.05em;white-space:nowrap;}
.ux-brand small {font-size:11px;font-weight:400;letter-spacing:0;color:var(--text-muted);}
.ux-brand-dot,.ux-status-dot {display:inline-block;width:8px;height:8px;background:var(--accent);border-radius:50%;}
.ux-navigation [role=tablist] {display:flex;padding:3px;background:#111723;border:1px solid var(--border);border-radius:10px;}
.ux-navigation [role=tab] {padding:7px 13px;border:0;border-radius:7px;color:var(--text-muted);background:none;font-size:12px;}
.ux-navigation [role=tab][aria-selected=true] {background:#243044;color:var(--text-primary);}
#uxCompactStatus {display:flex;align-items:center;gap:7px;color:var(--text-muted);font-size:11px;white-space:nowrap;}
.ux-overview {flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;display:grid;grid-template-columns:minmax(0,1fr) 285px;gap:26px;padding:24px;scroll-behavior:smooth;}
.ux-primary,.ux-secondary {display:flex;flex-direction:column;gap:26px;min-width:0;}
.ux-section-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;}
.ux-section-heading h2 {font-size:13px;font-weight:600;letter-spacing:.01em;}
.ux-section-heading>span {font-size:11px;color:var(--text-muted);}
.ux-overview button,.ux-gallery button {background:#172131;border:1px solid var(--border);color:var(--text-secondary);border-radius:8px;padding:7px 10px;font-size:12px;transition:background .15s,border-color .15s;}
.ux-overview button:hover,.ux-gallery button:hover {border-color:#50617c;background:#213047;}
.ux-section-heading>button {background:none;border:0;color:var(--text-muted);padding:0;}
.ux-hero {display:flex;align-items:center;gap:24px;padding:24px;border:1px solid var(--border);border-radius:18px;background:#101620;min-width:0;}
.ux-core {--core-color:var(--accent);position:relative;display:flex;flex-shrink:0;align-items:center;justify-content:center;width:164px;height:164px;color:var(--core-color);}
.ux-core svg {position:absolute;inset:0;width:100%;height:100%;overflow:visible;fill:none;}
.ux-core circle {vector-effect:non-scaling-stroke;}
.ux-core-outer {stroke:var(--border);stroke-width:1;}
.ux-core-ticks {stroke:#344155;stroke-width:4;stroke-dasharray:1 8.2;}
.ux-core-track {stroke:#253145;stroke-width:2;}
.ux-core-ring {stroke:var(--core-color);stroke-width:2;stroke-linecap:round;transform-origin:100px 100px;}
.ux-core-center {fill:#121b28;stroke:#26354a;stroke-width:1;}
.ux-core>span {position:relative;font-size:29px;font-weight:300;line-height:1;}
.ux-core[data-state=idle] {--core-color:#778ca8;}
.ux-core[data-state=success] {--core-color:var(--success);}
.ux-core[data-state=partial],.ux-core[data-state=awaiting] {--core-color:var(--warning);}
.ux-core[data-state=error] {--core-color:var(--error);}
.ux-core[data-state=unknown] {--core-color:#acb9cd;}
.ux-core[data-state=unknown] .ux-core-ring {stroke-dasharray:6 9;}
.ux-core[data-state=partial] .ux-core-ring {stroke-dasharray:305 465;transform:rotate(-90deg);}
.ux-core[data-state=working] .ux-core-ring {stroke-dasharray:145 85;animation:ux-spin 8s linear infinite;}
.ux-core[data-state=thinking] .ux-core-ring {stroke-dasharray:105 465;animation:ux-spin 2.8s linear infinite;}
.ux-core[data-state=listening] .ux-core-ring {animation:ux-listen 2s ease-in-out infinite;}
.ux-core.small {width:34px;height:34px;}
.ux-core.small .ux-core-outer,.ux-core.small .ux-core-ticks {display:none;}
.ux-core.small>span {font-size:14px;}
.ux-hero-copy {min-width:0;flex:1;}
.ux-eyebrow {font-size:10px;letter-spacing:.09em;line-height:1.5;color:var(--accent);font-weight:600;}
.ux-hero h1 {font-size:29px;line-height:1.18;letter-spacing:-.035em;font-weight:550;margin:9px 0 12px;overflow-wrap:anywhere;}
.ux-hero-copy>p:not(.ux-eyebrow) {font-size:13px;line-height:1.65;color:var(--text-muted);}
.ux-facts {display:flex;gap:8px;margin-top:20px;}
.ux-facts a {display:flex;flex:1;flex-direction:column;gap:3px;padding:9px 10px;border:1px solid var(--border);border-radius:9px;text-decoration:none;color:var(--text-primary);min-width:0;}
.ux-facts strong {font-size:20px;font-weight:550;line-height:1.1;}
.ux-facts span {font-size:10px;color:var(--text-muted);}
.ux-card-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start;}
.ux-task-card,.ux-result-card,.ux-approval-card,.ux-notice {min-width:0;padding:17px;border:1px solid var(--border);border-radius:13px;background:#111723;overflow-wrap:anywhere;}
.ux-task-card h3,.ux-approval-card h3,.ux-gallery h3 {font-size:14px;font-weight:550;line-height:1.5;margin:12px 0;}
.ux-task-card>p,.ux-approval-card>p,.ux-gallery-preview p {font-size:12px;color:var(--text-muted);line-height:1.7;}
.ux-task-card>button {margin-top:14px;}
.ux-activity {height:3px;background:#223047;overflow:hidden;border-radius:3px;margin-top:14px;}
.ux-activity:after {content:'';display:block;width:30%;height:100%;background:var(--accent);border-radius:inherit;animation:ux-progress 2.5s ease-in-out infinite;}
.ux-chip {display:inline-flex;align-items:center;gap:6px;max-width:100%;border:1px solid var(--border);padding:3px 7px;border-radius:20px;font-size:10px;font-weight:500;color:var(--text-muted);}
.ux-chip i,.ux-activity-feed i {width:6px;height:6px;flex:none;display:inline-block;border-radius:50%;background:currentColor;}
.ux-chip[data-status=running],.ux-chip[data-status=queued] {color:var(--accent);border-color:#22d3ee30;}
.ux-chip[data-status=success] {color:var(--success);border-color:#64d8ad30;}
.ux-chip[data-status=partial],.ux-chip[data-status=waiting_confirmation],.ux-chip[data-status=waiting_input] {color:var(--warning);border-color:#e9b86455;}
.ux-chip[data-status=failed],.ux-chip[data-status=blocked] {color:var(--error);border-color:#f0808750;}
.ux-result-meta {display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;}
.ux-result-meta>span {color:var(--text-muted);font-size:10px;}
.ux-result-card>.smart-blocks+.smart-blocks {margin-top:12px;}
.ux-result-card[data-result-status=partial] {border-style:dashed;border-color:#e9b86466;}
.ux-result-card[data-result-status=unknown] {border-style:dashed;border-color:#7e8da5;}
.ux-result-card[data-result-status=failed] {border-color:#f0808755;}
.ux-overview .smart-goal,.ux-overview .smart-text {padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;}
.ux-overview .smart-goal-message,.ux-overview .smart-text-content {font:400 13px/1.7 var(--font);}
.ux-result-preview {font-size:13px;line-height:1.7;overflow-wrap:anywhere;}
.ux-result-full {margin-top:10px;font-size:12px;}
.ux-result-full>summary {color:var(--accent);cursor:pointer;margin-bottom:10px;}
.ux-task-card h3 {display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;}
.ux-overview .smart-goal .smart-status {display:none;}
.ux-overview .smart-blocks {gap:12px;}
.ux-overview .smart-file {background:#172131;border-radius:10px;padding:12px;}
.ux-overview .smart-file-heading strong {font-size:12px;}
.ux-overview .smart-file-verified {font-size:10px;}
.ux-overview .smart-file-actions {display:flex;flex-wrap:wrap;gap:6px;}
.ux-overview .smart-file-actions button {font-size:10px;padding:6px 7px;}
.ux-approval-card {border-color:#e9b86666;background:#1a1b23;margin-bottom:10px;}
.ux-approval-card .confirm-actions {display:flex;gap:8px;flex-wrap:wrap;margin-top:14px;padding:0;background:none;border:0;}
.ux-approval-card .confirm-actions::before {display:none;}
.ux-approval-card .confirm-actions button {text-transform:none;letter-spacing:normal;font-size:12px;padding:8px 11px;box-shadow:none;}
.ux-approval-card .btn-confirm-yes {background:var(--accent);border-color:var(--accent);color:#052631;}
.ux-approval-details {margin-top:12px;font-size:12px;color:var(--text-muted);}
.ux-approval-details summary {cursor:pointer;}
.ux-approval-details pre {white-space:pre-wrap;overflow-wrap:anywhere;font:11px/1.6 ui-monospace,monospace;margin-top:8px;max-height:200px;overflow:auto;}
.ux-empty {padding:21px 15px;border:1px dashed var(--border);border-radius:12px;color:var(--text-muted);font-size:12px;line-height:1.8;grid-column:1/-1;}
.ux-quiet {padding:14px;border:1px solid var(--border);border-radius:11px;font-size:12px;color:var(--text-muted);}
.ux-quiet>span {color:var(--success);margin-right:5px;}
.ux-device-list {list-style:none;border:1px solid var(--border);border-radius:12px;background:#101620;}
.ux-device-list li {display:flex;align-items:center;gap:9px;padding:13px;min-width:0;}
.ux-device-list li+li {border-top:1px solid var(--border);}
.ux-device-list li>div {display:flex;flex-direction:column;flex:1;min-width:0;}
.ux-device-list strong {font-size:12px;font-weight:500;overflow-wrap:anywhere;}
.ux-device-list div>span {font-size:10px;color:var(--text-muted);}
.ux-device-symbol {color:var(--accent);font-size:21px;}
.ux-connection {font-size:10px;color:var(--text-muted);white-space:nowrap;}
.ux-connection.online {color:var(--success);}
.ux-activity-feed {list-style:none;}
.ux-activity-feed li {display:flex;align-items:flex-start;gap:11px;position:relative;padding:0 0 16px;}
.ux-activity-feed li:not(:last-child):before {content:'';position:absolute;top:14px;bottom:3px;left:2px;border-left:1px solid var(--border);}
.ux-activity-feed i {margin-top:6px;color:#8291a9;}
.ux-activity-feed i[data-status=success] {color:var(--success);}
.ux-activity-feed i[data-status=partial],.ux-activity-feed i[data-status=unknown] {color:var(--warning);}
.ux-activity-feed button {padding:0;text-align:left;background:none;border:0;font-size:12px;line-height:1.65;overflow-wrap:anywhere;}
.ux-activity-feed button>span {display:block;color:var(--text-muted);font-size:10px;}
.ux-history-more {color:var(--text-muted)!important;background:none!important;}
.app .chat-input-area {background:#0b0e16;border-top:1px solid var(--border);padding:15px 24px 12px;flex-shrink:0;}
.app .chat-input-wrap {background:#141b28;border:1px solid #344259;border-radius:16px;box-shadow:0 5px 24px #0002;}
.app .chat-input-wrap:focus-within {border-color:var(--accent);box-shadow:0 0 0 2px #22d3ee0a;}
.app .chat-input {font:400 14px/1.6 var(--font);color:var(--text-primary);}
.app .btn-send {background:var(--accent);color:#052631;border-radius:10px;}
.app .msg {animation:none;}
.app .msg-role {font-size:10px;color:var(--text-muted);}
.app .smart-goal,.app .smart-file,.app .smart-task {border-radius:12px;}
.app .smart-goal[data-status=partial] {--goal-color:var(--warning);}
.app .smart-goal[data-status=unknown] {--goal-color:#a1adc0;}
.app .conversation-toolbar {background:transparent;border-bottom:1px solid var(--border);}
html[data-ux-view=overview] .conversation-toolbar,html[data-ux-view=components] .conversation-toolbar,html[data-ux-view=components] .chat-input-area {display:none!important;}
.toast {border:1px solid var(--border);border-radius:12px;background:#1a2332;color:var(--text-primary);box-shadow:0 12px 36px #0005;}
.ux-mini-status {display:flex;align-items:center;gap:10px;padding:10px 14px;flex:none;}
.ux-mini-status>div:last-child {min-width:0;display:flex;flex-direction:column;}
.ux-mini-status strong {font-size:12px;font-weight:550;}
.ux-mini-status div>span {font-size:11px;color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
@keyframes ux-spin {to{transform:rotate(360deg)}}
@keyframes ux-listen {50%{opacity:.4;stroke-width:4}}
@keyframes ux-progress {0%{transform:translateX(-100%)}100%{transform:translateX(435%)}}
@media(min-width:901px) and (max-width:1400px) {
 .ux-brand small,#uxCompactStatus {display:none;}.ux-overview {grid-template-columns:minmax(0,1fr) 250px;gap:20px;padding:20px;}.ux-hero {gap:16px;padding:18px;}.ux-core.large {width:125px;height:125px;}.ux-hero h1 {font-size:27px;}.ux-card-grid {grid-template-columns:1fr;}
}
@media(max-width:900px) {
 .ux-navigation {padding:11px 14px;}.ux-brand {font-size:14px;}.ux-brand small,#uxCompactStatus,#ux-tab-components {display:none;}.ux-navigation [role=tab] {font-size:11px;padding:6px 9px;}
 .ux-overview {grid-template-columns:1fr;padding:16px;gap:22px;}.ux-primary,.ux-secondary {gap:22px;}.ux-hero {padding:18px;gap:16px;}.ux-core.large {width:106px;height:106px;}.ux-hero h1 {font-size:25px;}.ux-facts {gap:5px;margin-top:13px;}.ux-facts a {padding:8px;}.ux-facts span {font-size:9px;}.ux-facts strong {font-size:18px;}.ux-hero-copy>p:not(.ux-eyebrow) {font-size:12px;}
 .ux-card-grid {grid-template-columns:1fr;}.app .chat-input-area {padding:10px 10px max(8px,env(safe-area-inset-bottom));}.app .chat-input-wrap {border-radius:14px;}.app .chat-input {font-size:14px;}
}
html.iru-mini .ux-navigation,html.iru-mini #uxOverview,html.iru-mini #uxGallery {display:none!important;}
html.iru-mini .ux-mini-status {padding:8px 12px;border-bottom:1px solid var(--border);}
html.iru-mini .chat-welcome {padding:8px 12px!important;min-height:0!important;}
html.iru-mini .chat-welcome img,html.iru-mini .chat-welcome h2,html.iru-mini .chat-welcome .hints {display:none;}
html.iru-mini .chat-welcome p {font-size:12px;line-height:1.6;}
html.iru-mini .app .chat-input-area {padding:8px!important;background:#0b0e16;}
html.iru-mini .app .smart-file {padding:10px;border:1px solid var(--border);background:#141c29;}
html.iru-mini .smart-file-actions {display:flex;flex-wrap:wrap;gap:5px;}
html.iru-mini .smart-file-actions button {font-size:10px;}
html.iru-mini .app .smart-file:not(.expanded) .smart-file-actions>button:not(:first-child) {display:none;}
html.iru-mini .app .smart-file.expanded .smart-file-actions>button {display:inline-flex;}
.smart-file-toggle {display:none;}
html.iru-mini .smart-file-toggle {display:inline-flex;background:none;border:0;color:var(--text-muted);font-size:10px;padding:7px 0 0;}
html.iru-mini .app .chat-welcome {display:none!important;}
@media(prefers-reduced-motion:reduce) {
 *,*::before,*::after {animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important;}
}
/* Released small-window hosts can use the legacy low-height browser surface
   before announcing iru-mini. Keep its existing confirmation viewport usable. */
@media(max-width:720px) and (max-height:350px) {
 .ux-navigation {display:none;}
 .app .chat-input-area {padding:7px 9px;}
}

/* UX-01.1: one identity, one live state; empty sections remain absent. */
.ux-navigation {justify-content:flex-end;padding-block:10px;}
.ux-hero {min-height:190px;}
.ux-devices-section {border:1px solid var(--border);border-radius:12px;padding:14px;font-size:12px;color:var(--text-muted);}
.ux-devices-section summary {cursor:pointer;color:var(--text-secondary);}
.ux-devices-section>p {margin:12px 0;font-size:11px;line-height:1.6;}
.ux-secondary:has(>#uxDecisionsSection[hidden]) {align-self:start;}
.ux-overview .ux-result-card .smart-status {display:none;}
