/* VYRO AI One Studio - Modern Dark Theme */
:root {
    --bg: #0a0a0f;
    --bg-elevated: #12121a;
    --bg-card: #18181f;
    --border: #2a2a35;
    --text: #f0f0f5;
    --text-muted: #8b8b9a;
    --accent: #7c5cfc;
    --accent-hover: #6a4ae8;
    --accent-glow: rgba(124, 92, 252, 0.25);
    --success: #22c55e;
    --danger: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', system-ui, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --sidebar-w: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease, transform 0.2s ease;
    z-index: 20;
}

.sidebar.collapsed {
    width: 72px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-item span:not(.nav-icon),
.sidebar.collapsed .status-badge span:not(.status-dot),
.sidebar.collapsed .version {
    display: none;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.15rem;
}

.logo-icon {
    font-size: 1.4rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
}

.btn-icon:hover {
    background: var(--bg-card);
    color: var(--text);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent);
}

.nav-icon {
    font-size: 1.15rem;
    width: 1.5rem;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.version {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Main */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

.view {
    display: none;
    flex-direction: column;
    height: 100%;
}

.view.active {
    display: flex;
}

.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}

.main-header h1 {
    font-size: 1.35rem;
    font-weight: 600;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.model-select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    cursor: pointer;
    min-width: 240px;
}

.model-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text);
}

/* Chat */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    scroll-behavior: smooth;
}

.welcome-message {
    text-align: center;
    max-width: 560px;
    margin: 4rem auto 2rem;
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.welcome-message h2 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.welcome-message p {
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

.quick-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}

.prompt-chip {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.55rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}

.prompt-chip:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.messages {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.message {
    display: flex;
    gap: 0.85rem;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    flex-direction: row-reverse;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.message.user .avatar {
    background: var(--accent);
}

.bubble {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.9rem 1.15rem;
    border-radius: var(--radius);
    max-width: 75%;
    line-height: 1.55;
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.message.user .bubble {
    background: var(--accent);
    border-color: transparent;
    color: white;
}

.message.assistant .bubble {
    background: var(--bg-elevated);
}

.message.error .bubble {
    border-color: var(--danger);
    color: #fca5a5;
}

.typing {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0;
}

.typing span {
    width: 7px;
    height: 7px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.2s infinite;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Composer */
.composer {
    padding: 1rem 1.75rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
}

.composer-inner {
    display: flex;
    gap: 0.75rem;
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 0.75rem;
    align-items: flex-end;
}

.composer-inner:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

#user-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    resize: none;
    max-height: 160px;
    line-height: 1.45;
    padding: 0.35rem 0.25rem;
}

#user-input:focus {
    outline: none;
}

.composer-footer {
    max-width: 800px;
    margin: 0.5rem auto 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

/* Models Grid */
.models-grid {
    padding: 1.75rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    overflow-y: auto;
}

.model-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem;
    transition: border-color 0.15s;
}

.model-card:hover {
    border-color: var(--accent);
}

.model-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

.model-card .provider {
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.model-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.model-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border-radius: 4px;
    font-weight: 500;
}

/* Settings */
.settings-panel {
    padding: 1.75rem;
    max-width: 680px;
    overflow-y: auto;
}

.setting-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.setting-card h3 {
    margin-bottom: 0.4rem;
}

.setting-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
}

.form-group input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--mono);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group small {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-group a {
    color: var(--accent);
}

.note {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hosting-list {
    margin-top: 0.75rem;
    padding-left: 1.25rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.hosting-list li {
    margin-bottom: 0.4rem;
}

.hosting-list code {
    background: var(--bg-card);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.85em;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .header-right {
        width: 100%;
    }
    .model-select {
        flex: 1;
        min-width: 0;
    }
    .bubble {
        max-width: 88%;
    }
}

/* Load progress */
.load-progress {
    max-width: 360px;
    margin: 1.5rem auto;
}
.progress-bar {
    height: 8px;
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.3s ease;
}
.progress-text {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Better formatting inside assistant bubbles */
.bubble p {
    margin: 0 0 0.75rem 0;
    line-height: 1.6;
}
.bubble p:last-child {
    margin-bottom: 0;
}
.bubble strong {
    font-weight: 600;
    color: #e0e0ff;
}
.bubble em {
    font-style: italic;
}
.bubble br {
    display: block;
    content: "";
    margin-top: 0.35rem;
}


/* =========================================================
   AI ONE STUDIO — SIGNATURE PREMIUM DESIGN
   Editorial ivory + ink + restrained emerald, polished SaaS
   ========================================================= */
:root {
  --bg: #f5f6f2;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --border: #e4e7e1;
  --text: #17221e;
  --text-muted: #6d7972;
  --accent: #147d62;
  --accent-hover: #0c654e;
  --accent-glow: rgba(20, 125, 98, .14);
  --sidebar-w: 270px;
}
* { box-sizing: border-box; }
html { background: #f5f6f2; }
body {
  color: #17221e;
  background:
    radial-gradient(ellipse at 82% -8%, rgba(196, 224, 210, .42), transparent 36rem),
    #f5f6f2;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -.018em;
}
::selection { background: #c7e8d9; color: #123c30; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(20,125,98,.28); outline-offset: 2px; }

/* Navigation rail */
.sidebar {
  color: #eaf1ed;
  background: #14251f;
  border-right: 1px solid rgba(255,255,255,.07);
  box-shadow: 8px 0 30px rgba(23,45,35,.04);
}
.sidebar-header {
  min-height: 92px; padding: 22px 19px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.logo { gap: 11px; min-width: 0; }
.logo-image { width: 41px; height: 41px; display: block; border-radius: 13px; object-fit: cover; flex: 0 0 auto; }
.logo-icon { display: none; }
.logo-text { color: #f7faf8; font-size: 15px; font-weight: 750; letter-spacing: -.045em; white-space: nowrap; }
#sidebar-toggle { color: #a9bdb3; background: transparent; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; }
#sidebar-toggle:hover { color: white; background: rgba(255,255,255,.08); }
.sidebar-nav { padding: 25px 13px; gap: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 13px; width: 100%;
  min-height: 47px; padding: 12px 14px; margin: 0;
  border: 1px solid transparent; border-radius: 11px;
  color: #a8b8af; background: transparent; text-align: left;
  font-size: 13px; font-weight: 600;
}
.nav-icon { width: 22px; text-align: center; opacity: .9; filter: grayscale(.2); }
.nav-item:hover { color: #f4faf6; background: rgba(255,255,255,.055); }
.nav-item.active {
  color: #fff; background: #244237; border-color: rgba(148,211,178,.13);
  box-shadow: inset 3px 0 #6ed1a5;
}
.sidebar-footer { margin-top: auto; padding: 18px 16px 20px; border-top: 1px solid rgba(255,255,255,.09); }
.status-badge {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.09); border-radius: 10px;
  color: #d1e6d9; background: rgba(255,255,255,.045); font-size: 11px; font-weight: 600;
}
.status-dot.online { background: #70d5a7; box-shadow: 0 0 0 3px rgba(112,213,167,.13); }
.version { padding: 12px 3px 0; color: #83998d; font-size: 10px; letter-spacing: .02em; }

/* Main canvas */
.main { min-width: 0; background: transparent; }
.main-header {
  min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 21px clamp(22px, 4vw, 58px);
  background: rgba(255,255,255,.78); border-bottom: 1px solid #e7eae5;
  backdrop-filter: blur(18px);
}
.main-header h1 { margin: 0; color: #17221e; font-size: 19px; line-height: 1.3; font-weight: 750; letter-spacing: -.045em; }
.subtitle { margin-top: 5px; color: #7b8780; font-size: 12px; line-height: 1.5; }
.header-right { display: flex; align-items: center; gap: 9px; }
.model-select, select {
  max-width: 100%; min-height: 40px; padding: 0 34px 0 12px;
  border: 1px solid #dfe5df; border-radius: 9px;
  color: #293a32; background-color: #fff; font-size: 12px; font-weight: 600;
}
.btn {
  min-height: 39px; border-radius: 9px; padding: 9px 14px;
  font-size: 12px; font-weight: 650; box-shadow: none;
}
.btn-primary, .btn:not(.btn-secondary):not(.btn-ghost):not(.btn-icon) {
  color: #fff; background: #147d62; border: 1px solid #147d62;
  box-shadow: 0 3px 8px rgba(20,125,98,.12);
}
.btn-primary:hover, .btn:not(.btn-secondary):not(.btn-ghost):not(.btn-icon):hover {
  background: #0c654e; border-color: #0c654e; transform: translateY(-1px);
  box-shadow: 0 5px 13px rgba(20,125,98,.18);
}
.btn-ghost, .btn-secondary, .btn-icon {
  color: #52645a; background: #fff; border: 1px solid #e0e6e0;
}
.btn-ghost:hover, .btn-secondary:hover, .btn-icon:hover { color: #17674f; background: #f4f8f4; border-color: #c9d9ce; }

/* Welcome / first-use state */
.chat-container { background: transparent; }
.welcome-message {
  width: min(100% - 36px, 760px); margin: clamp(48px, 10vh, 112px) auto 50px;
  text-align: center;
}
.welcome-icon {
  display: grid; place-items: center; width: 76px; height: 76px;
  margin: 0 auto 25px; border-radius: 22px; overflow: hidden;
  background: #14251f; border: 1px solid rgba(20,125,98,.14);
  box-shadow: 0 12px 26px rgba(21,56,41,.12);
}
.welcome-logo-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.welcome-message h2 {
  max-width: 650px; margin: 0 auto 15px; color: #172a22;
  font-size: clamp(30px, 4vw, 47px); font-weight: 760; line-height: 1.12;
  letter-spacing: -.065em; background: none; -webkit-text-fill-color: currentColor;
}
.welcome-message p { max-width: 490px; margin: 0 auto; color: #78847d; font-size: 14px; line-height: 1.8; }
.quick-prompts {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 9px;
  margin: 31px auto 0; max-width: 680px;
}
.prompt-chip {
  min-height: 41px; padding: 10px 14px; border-radius: 10px;
  color: #46574e; background: rgba(255,255,255,.88);
  border: 1px solid #e1e7e0; box-shadow: 0 2px 5px rgba(24,45,32,.025);
  font-size: 11px; font-weight: 600;
}
.prompt-chip:hover {
  color: #12684f; background: #f0f8f2; border-color: #b9d9c6;
  transform: translateY(-2px); box-shadow: 0 6px 14px rgba(26,76,51,.07);
}

/* Conversation */
.messages { width: min(100% - 40px, 850px); margin: 0 auto; gap: 23px; }
.message { gap: 12px; align-items: flex-start; }
.avatar {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 11px;
  display: grid; place-items: center; color: #e8f3ec;
  background: #234236; border: 1px solid rgba(20,125,98,.13);
}
.message.user .avatar { color: #fff; background: #147d62; }
.bubble {
  max-width: 100%; padding: 14px 17px; border-radius: 4px 14px 14px 14px;
  border: 1px solid #e5e9e4; color: #2b3931; background: #fff;
  font-size: 13px; line-height: 1.8; box-shadow: 0 3px 12px rgba(25,44,31,.025);
}
.message.user .bubble {
  color: #f7fbf8; background: #1d4738; border-color: #1d4738;
  border-radius: 14px 4px 14px 14px;
}

/* Composer is the main interaction: crisp, grounded, and premium */
.composer {
  padding: 24px 20px 15px; background: linear-gradient(180deg, rgba(245,246,242,0), rgba(245,246,242,.97) 22%);
  border-top: 0;
}
.composer-inner {
  width: min(100%, 850px); margin: 0 auto; padding: 12px 12px 10px 16px;
  display: flex; align-items: flex-end; gap: 12px;
  border: 1px solid #dce4dc; border-radius: 15px; background: #fff;
  box-shadow: 0 9px 28px rgba(25,48,33,.07);
}
.composer-inner:focus-within {
  border-color: #83bca0; box-shadow: 0 0 0 3px rgba(20,125,98,.08), 0 10px 28px rgba(25,48,33,.07);
}
#user-input {
  min-width: 0; color: #20352a; background: transparent; border: 0; outline: 0;
  font-size: 13px; line-height: 1.7; resize: none;
}
#user-input::placeholder { color: #9aa69d; }
.composer-inner .btn-primary { min-width: 78px; min-height: 38px; }
.composer-footer { width: min(100%, 850px); margin: 10px auto 0; color: #98a29a; font-size: 10px; text-align: center; }

/* Models / About / settings surfaces */
.models-grid { width: min(100% - 48px, 1160px); margin: 35px auto; gap: 17px; }
.model-card, .setting-card {
  padding: 23px; color: #24342b; background: #fff;
  border: 1px solid #e3e9e2; border-radius: 15px;
  box-shadow: 0 4px 16px rgba(22,43,29,.035);
}
.model-card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.model-card:hover {
  transform: translateY(-3px); border-color: #b6d6c2;
  box-shadow: 0 12px 28px rgba(22,65,42,.08);
}
.model-card h3, .setting-card h3 { color: #1c3025; font-size: 15px; font-weight: 730; letter-spacing: -.035em; }
.model-card p, .setting-card p, .setting-desc { color: #78857c; font-size: 12px; line-height: 1.8; }
.model-card .provider { color: #147d62; font-size: 11px; font-weight: 700; }
.model-badge { color: #18724f; background: #e9f6ed; border: 1px solid #d2ead9; border-radius: 6px; }
input:not([type="checkbox"]):not([type="radio"]), textarea {
  accent-color: #147d62;
}
@media (max-width: 900px) {
  .main-header { align-items: flex-start; flex-direction: column; gap: 14px; }
  .header-right { width: 100%; flex-wrap: wrap; }
  .model-select { flex: 1; min-width: 180px; }
}
@media (max-width: 680px) {
  .sidebar { box-shadow: 16px 0 40px rgba(0,0,0,.22); }
  .main-header { min-height: auto; padding: 18px 16px; }
  .main-header h1 { font-size: 18px; }
  .header-right { gap: 7px; }
  .model-select { min-width: 0; width: 100%; flex-basis: 100%; }
  .welcome-message { width: calc(100% - 28px); margin-top: 48px; }
  .welcome-message h2 { font-size: 31px; }
  .welcome-message p { font-size: 13px; }
  .quick-prompts { gap: 8px; margin-top: 24px; }
  .prompt-chip { width: 100%; text-align: left; }
  .messages { width: calc(100% - 24px); }
  .composer { padding: 15px 12px 12px; }
  .composer-inner { padding: 10px; gap: 7px; }
  .composer-inner .btn-primary { min-width: 58px; padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Spacious layout refinement — generous breathing room and clearer hierarchy */
:root { --sidebar-w: 286px; }
body { line-height: 1.65; }
.sidebar-header { padding: 27px 22px; gap: 16px; }
.logo { gap: 13px; font-size: 19px; letter-spacing: -.025em; }
.logo img, .logo-icon { flex: 0 0 auto; }
.sidebar-nav { padding: 22px 16px; }
.nav-item { min-height: 48px; padding: 12px 15px; margin: 4px 0; gap: 13px; border-radius: 11px; font-size: 14px; }
.sidebar-footer { padding: 20px 18px; }
.main-content { min-width: 0; }
.main-header { min-height: 106px; padding: 27px clamp(26px, 4vw, 64px); gap: 24px; }
.main-header h1 { font-size: clamp(22px, 2vw, 29px); line-height: 1.25; letter-spacing: -.04em; }
.header-right { gap: 12px; }
.header-right button, .header-right select, .header-right .btn { min-height: 44px; padding: 11px 16px; }
.chat-container { min-height: 0; }
.welcome-message { width: min(100% - 64px, 850px); margin: clamp(64px, 10vh, 115px) auto 50px; }
.welcome-message h2 { font-size: clamp(38px, 4.2vw, 54px); line-height: 1.14; letter-spacing: -.055em; margin-bottom: 22px; }
.welcome-message p { max-width: 610px; font-size: 16px; line-height: 1.9; }
.quick-prompts { max-width: 800px; gap: 13px; margin-top: 42px; }
.prompt-chip { min-height: 49px; padding: 14px 19px; border-radius: 13px; font-size: 13px; line-height: 1.5; }
.messages { width: min(100% - 72px, 980px); gap: 32px; padding-top: 22px; }
.message { gap: 16px; }
.avatar { width: 42px; height: 42px; flex-basis: 42px; border-radius: 13px; }
.bubble { padding: 19px 23px; font-size: 15px; line-height: 1.9; border-radius: 5px 18px 18px 18px; }
.message.user .bubble { border-radius: 18px 5px 18px 18px; }
.composer { padding: 28px clamp(22px, 4vw, 60px) 20px; }
.composer-inner { width: min(100%, 980px); min-height: 76px; padding: 17px 18px 15px 22px; gap: 16px; border-radius: 19px; }
#user-input { font-size: 15px; line-height: 1.8; padding: 6px 0; }
.composer-inner .btn-primary { min-width: 92px; min-height: 46px; border-radius: 12px; font-size: 14px; }
.composer-footer { width: min(100%, 980px); margin-top: 14px; font-size: 11px; }
.models-grid { width: min(100% - 80px, 1320px); margin: 48px auto; gap: 24px; }
.model-card, .setting-card { padding: 30px; border-radius: 19px; }
.model-card h3, .setting-card h3 { font-size: 18px; margin-bottom: 12px; }
.model-card p, .setting-card p, .setting-desc { font-size: 14px; line-height: 1.9; }
.model-card .provider { font-size: 12px; }
@media (min-width: 1500px) {
  .welcome-message { margin-top: 12vh; }
  .messages, .composer-inner, .composer-footer { max-width: 1060px; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 260px; }
  .main-header { min-height: auto; padding: 23px 25px; }
  .welcome-message { width: calc(100% - 48px); margin-top: 56px; }
  .models-grid { width: calc(100% - 48px); margin: 32px auto; gap: 18px; }
}
@media (max-width: 680px) {
  .sidebar-header { padding: 20px 17px; }
  .sidebar-nav { padding: 16px 12px; }
  .nav-item { min-height: 46px; padding: 11px 12px; }
  .main-header { padding: 20px 18px; gap: 17px; }
  .main-header h1 { font-size: 22px; }
  .header-right { gap: 9px; }
  .welcome-message { width: calc(100% - 36px); margin: 46px auto 32px; }
  .welcome-message h2 { font-size: clamp(32px, 9vw, 42px); margin-bottom: 17px; }
  .welcome-message p { font-size: 14px; line-height: 1.8; }
  .quick-prompts { gap: 11px; margin-top: 29px; }
  .prompt-chip { width: 100%; min-height: 48px; padding: 13px 16px; font-size: 13px; }
  .messages { width: calc(100% - 28px); gap: 22px; }
  .avatar { width: 36px; height: 36px; flex-basis: 36px; }
  .bubble { padding: 14px 16px; font-size: 14px; }
  .composer { padding: 16px 13px 12px; }
  .composer-inner { min-height: 64px; padding: 11px; gap: 9px; border-radius: 15px; }
  #user-input { font-size: 14px; }
  .composer-inner .btn-primary { min-width: 64px; min-height: 40px; padding: 9px; }
  .composer-footer { font-size: 10px; line-height: 1.6; }
  .models-grid { width: calc(100% - 32px); margin: 24px auto; gap: 15px; }
  .model-card, .setting-card { padding: 21px; }
}


/* AI One Studio — airy, focused workspace refinement */
:root {
  --sidebar-w: 278px;
  --bg: #f8faf8;
  --bg-elevated: #ffffff;
  --bg-card: #f4f7f3;
  --border: #e5eae4;
  --text: #1e2b23;
  --text-muted: #78857c;
  --accent: #18765a;
  --accent-hover: #105d45;
  --accent-glow: rgba(24,118,90,.09);
}
html, body { min-height: 100%; }
body { background: #f8faf8; line-height: 1.7; }
#app { min-height: 100dvh; }
.sidebar { background: #f3f6f2; border-right: 1px solid #e5eae4; }
.sidebar-header { padding: 29px 22px 25px; border-bottom: 0; }
.logo { gap: 13px; font-size: 18px; }
.logo-image { width: 37px; height: 37px; object-fit: contain; }
.sidebar-nav { padding: 12px 15px; gap: 8px; }
.nav-item { min-height: 48px; padding: 13px 15px; border-radius: 12px; font-size: 14px; }
.nav-item.active { background: #e4eee6; color: #155e45; }
.nav-icon { font-size: 17px; }
.sidebar-footer { padding: 22px 21px 25px; }
.main { background: #fbfcfa; min-width: 0; }
#view-chat { min-height: 0; }
.main-header { flex: 0 0 auto; min-height: 88px; padding: 22px clamp(28px, 4vw, 58px); background: rgba(251,252,250,.92); border-bottom: 1px solid #edf0eb; }
.main-header h1 { font-size: 20px; font-weight: 650; color: #233229; }
.subtitle { font-size: 12px; line-height: 1.6; color: #839087; }
.model-select { background: #fff; color: #314238; border-color: #e1e7df; min-width: 245px; min-height: 43px; padding: 10px 14px; border-radius: 12px; }
.btn-ghost { color: #5e6d62; border-color: #e1e7df; background: #fff; min-height: 43px; border-radius: 12px; }
.chat-container { display: flex; flex-direction: column; min-height: 0; padding: 0 clamp(22px, 4vw, 58px); }
.welcome-message { width: min(100%, 790px); max-width: 790px; margin: auto; padding: 56px 0 64px; text-align: center; }
.welcome-icon { display: flex; align-items: center; justify-content: center; margin: 0 auto 27px; font-size: 0; }
.welcome-logo-image { width: 62px; height: 62px; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(21,94,69,.09)); }
.welcome-message h2 { margin: 0 0 16px; color: #203329; font-size: clamp(34px, 3.3vw, 46px); font-weight: 650; line-height: 1.2; letter-spacing: -.05em; }
.welcome-message p { max-width: 580px; margin: 0 auto; color: #748278; font-size: 15px; line-height: 1.9; }
.quick-prompts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; width: min(100%, 690px); margin: 42px auto 0; }
.prompt-chip { display: flex; align-items: center; justify-content: flex-start; min-height: 66px; padding: 17px 20px; border-radius: 15px; background: #fff; border: 1px solid #e5eae4; color: #35463b; font-size: 13px; line-height: 1.6; text-align: left; white-space: normal; box-shadow: 0 2px 8px rgba(32,57,38,.025); }
.prompt-chip:hover { transform: translateY(-2px); background: #f7fbf7; border-color: #bfd7c5; box-shadow: 0 8px 22px rgba(32,57,38,.06); }
.messages { width: min(100% - 24px, 920px); gap: 35px; padding: 35px 0 44px; }
.message { gap: 17px; }
.bubble { padding: 19px 24px; font-size: 15px; line-height: 1.9; border-color: #e8ece6; border-radius: 5px 18px 18px 18px; box-shadow: 0 3px 14px rgba(25,44,31,.025); }
.message.user .bubble { background: #e8f1e9; color: #263d2f; border-color: #e0ebe1; }
.message.user .avatar { background: #e1eee4; color: #176447; }
.composer { flex: 0 0 auto; padding: 20px clamp(22px, 4vw, 58px) 20px; background: linear-gradient(180deg, rgba(251,252,250,0), #fbfcfa 20%); }
.composer-inner { width: min(100%, 920px); min-height: 78px; padding: 17px 17px 16px 24px; gap: 15px; border-radius: 22px; border-color: #dfe6de; box-shadow: 0 8px 30px rgba(26,52,32,.07); }
.composer-inner:focus-within { border-color: #9dc6aa; box-shadow: 0 0 0 4px rgba(24,118,90,.07), 0 10px 30px rgba(26,52,32,.07); }
#user-input { font-size: 15px; color: #27392d; }
.composer-inner .btn-primary { min-width: 48px; width: 48px; min-height: 46px; padding: 10px; border-radius: 14px; background: #17684d; font-size: 0; justify-content: center; }
.composer-inner .btn-primary span { display: none; }
.composer-inner .btn-primary svg { width: 18px; height: 18px; }
.composer-footer { width: min(100%, 920px); margin-top: 12px; color: #9aa59c; font-size: 11px; }
.models-grid { width: min(100% - 100px, 1200px); margin: 44px auto; gap: 24px; }
.model-card, .setting-card { padding: 30px; border-radius: 18px; }
.settings-panel { padding: 35px clamp(28px, 5vw, 65px); max-width: 900px; }
.setting-card { margin-bottom: 20px; }
@media (min-width: 1500px) {
  .welcome-message { padding-top: 70px; padding-bottom: 80px; }
  .quick-prompts { width: min(100%, 730px); }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 250px; }
  .main-header { padding: 20px 25px; }
  .chat-container { padding: 0 25px; }
  .welcome-message { padding: 44px 0; }
  .composer { padding: 17px 24px; }
  .models-grid { width: calc(100% - 48px); }
}
@media (max-width: 680px) {
  .sidebar-header { padding: 20px 17px; }
  .main-header { min-height: 0; padding: 18px 17px; gap: 14px; }
  .main-header h1 { font-size: 19px; }
  .header-right { gap: 8px; }
  .model-select { min-width: 0; width: 100%; }
  .chat-container { padding: 0 16px; }
  .welcome-message { margin: auto; padding: 44px 0 35px; }
  .welcome-logo-image { width: 54px; height: 54px; }
  .welcome-message h2 { font-size: clamp(30px, 8vw, 38px); margin-bottom: 13px; }
  .welcome-message p { font-size: 14px; }
  .quick-prompts { grid-template-columns: 1fr; gap: 10px; margin-top: 27px; }
  .prompt-chip { min-height: 54px; padding: 14px 16px; }
  .messages { width: 100%; gap: 23px; padding: 24px 0; }
  .message { gap: 10px; }
  .bubble { padding: 14px 16px; font-size: 14px; }
  .composer { padding: 13px 12px 12px; }
  .composer-inner { min-height: 64px; padding: 10px 10px 10px 15px; gap: 8px; border-radius: 17px; }
  .composer-inner .btn-primary { width: 42px; min-width: 42px; min-height: 42px; border-radius: 12px; }
  .composer-footer { font-size: 10px; }
  .models-grid { width: calc(100% - 32px); margin: 24px auto; }
  .model-card, .setting-card { padding: 22px; }
  .settings-panel { padding: 22px 16px; }
}

/* Readability refinements + user-controlled dark mode */
.logo-text { color: #26382d !important; opacity: 1 !important; text-shadow: none !important; }
.sidebar .status-badge { display: inline-flex; align-items: center; gap: 9px; width: fit-content; max-width: 100%; padding: 9px 12px; border: 1px solid #dce8df; border-radius: 999px; background: #eaf3ec; color: #216548 !important; font-size: 12px; font-weight: 650; line-height: 1.4; opacity: 1 !important; }
.sidebar .status-badge span:not(.status-dot) { color: #216548 !important; opacity: 1 !important; text-shadow: none !important; }
.sidebar .status-dot.online { flex: 0 0 8px; width: 8px; height: 8px; box-shadow: 0 0 0 3px rgba(42,170,112,.13); }
.sidebar .version { color: #748579 !important; opacity: 1 !important; font-size: 11px; }
.header-right { gap: 10px; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; padding: 10px 14px; border-radius: 12px; white-space: nowrap; font-weight: 600; }
.theme-toggle-icon { font-size: 17px; line-height: 1; }
.theme-toggle-label { font-size: 12px; }
/* Keep the light theme crisp instead of washed out */
.sidebar .logo-text, .sidebar .status-badge, .sidebar .version, .subtitle, .composer-footer { -webkit-font-smoothing: antialiased; }

html[data-theme="dark"] body,
html[data-theme="dark"] #app,
html[data-theme="dark"] .main { background: #111714; color: #e7eee9; }
html[data-theme="dark"] .sidebar { background: #151e19; border-right-color: #29382f; }
html[data-theme="dark"] .sidebar .logo-text { color: #e6efe8 !important; }
html[data-theme="dark"] .sidebar .status-badge { background: #1d3328; border-color: #315541; color: #a9e3bf !important; }
html[data-theme="dark"] .sidebar .status-badge span:not(.status-dot) { color: #a9e3bf !important; }
html[data-theme="dark"] .sidebar .version { color: #9aaa9f !important; }
html[data-theme="dark"] .nav-item { color: #a8b7ad; }
html[data-theme="dark"] .nav-item.active { background: #203b2d; color: #bce8cb; border-color: #2b503c; }
html[data-theme="dark"] .main-header { background: rgba(17,23,20,.96); border-bottom-color: #29372f; }
html[data-theme="dark"] .main-header h1,
html[data-theme="dark"] .welcome-message h2 { color: #edf4ef; }
html[data-theme="dark"] .subtitle,
html[data-theme="dark"] .welcome-message p { color: #a0afa5; }
html[data-theme="dark"] .model-select,
html[data-theme="dark"] .btn-ghost,
html[data-theme="dark"] .prompt-chip,
html[data-theme="dark"] .model-card,
html[data-theme="dark"] .setting-card { background: #19231d; color: #e1ebe4; border-color: #304137; }
html[data-theme="dark"] .prompt-chip:hover { background: #203128; border-color: #477358; }
html[data-theme="dark"] .composer { background: linear-gradient(180deg, rgba(17,23,20,0), #111714 20%); }
html[data-theme="dark"] .composer-inner { background: #19231d; border-color: #34463a; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
html[data-theme="dark"] .composer-inner:focus-within { border-color: #5c9873; box-shadow: 0 0 0 4px rgba(71,139,94,.14); }
html[data-theme="dark"] #user-input { color: #e7eee9; }
html[data-theme="dark"] #user-input::placeholder { color: #87998d; }
html[data-theme="dark"] .composer-footer { color: #91a095; }
html[data-theme="dark"] .message .bubble { background: #19231d; color: #e0e9e2; border-color: #2c3b31; }
html[data-theme="dark"] .message.user .bubble { background: #20392b; color: #e3f2e7; border-color: #2b4a37; }
html[data-theme="dark"] .message.user .avatar { background: #254633; color: #bde8ca; }
html[data-theme="dark"] .settings-panel, html[data-theme="dark"] .setting-card p, html[data-theme="dark"] .setting-desc { color: #c5d1c8; }
html[data-theme="dark"] code { color: #c4e7ce; background: #24372b; }
@media (max-width: 680px) {
  .theme-toggle { padding: 9px 10px; min-height: 40px; }
  .theme-toggle-label { font-size: 11px; }
  .header-right { flex-wrap: wrap; }
}

/* Sidebar overlap fix and theme compatibility */
.sidebar-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:22px 16px;min-width:0}
.sidebar-header .logo{flex:1 1 auto;min-width:0;overflow:hidden}
.sidebar-header .logo-text{overflow:hidden;text-overflow:ellipsis}
#sidebar-toggle{flex:0 0 38px;width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;margin-left:auto;position:relative;z-index:2;line-height:1}
.sidebar.collapsed .sidebar-header{justify-content:center;padding-left:12px;padding-right:12px}
.sidebar.collapsed .sidebar-header .logo{flex:0 0 auto}
.sidebar.collapsed .sidebar-header .logo-text{display:none}
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="dark"] .main,html[data-theme="dark"] #view-chat,html[data-theme="dark"] #view-models,html[data-theme="dark"] #view-about{background:#111714;color:#e7eee9}
html[data-theme="dark"] .messages{color:#e7eee9}
html[data-theme="dark"] .btn-icon{color:#d7e4db}
@media(max-width:680px){.sidebar-header{padding:16px 12px;gap:8px}.sidebar-header .logo-text{font-size:13px;letter-spacing:-.02em}#sidebar-toggle{flex-basis:36px;width:36px;height:36px}}


/* Clean assistant answer typography: Markdown headings, lists, tables and code */
.message.assistant .bubble { line-height: 1.75; overflow-wrap: anywhere; }
.message.assistant .bubble p { margin: 0 0 14px; }
.message.assistant .bubble p:last-child { margin-bottom: 0; }
.message.assistant .bubble h1,.message.assistant .bubble h2,.message.assistant .bubble h3,
.message.assistant .bubble h4 { color: inherit; line-height: 1.3; letter-spacing: -.025em; margin: 24px 0 10px; font-weight: 700; }
.message.assistant .bubble h1 { font-size: 1.55em; }
.message.assistant .bubble h2 { font-size: 1.3em; }
.message.assistant .bubble h3 { font-size: 1.12em; }
.message.assistant .bubble ul,.message.assistant .bubble ol { padding-left: 1.5rem; margin: 8px 0 16px; }
.message.assistant .bubble li { padding-left: .2rem; margin: 5px 0; }
.message.assistant .bubble li::marker { color: #278364; }
.message.assistant .bubble strong { font-weight: 700; }
.message.assistant .bubble a { color: #168264; text-decoration: underline; text-underline-offset: 3px; }
.message.assistant .bubble blockquote { margin: 12px 0; padding: 3px 0 3px 16px; border-left: 3px solid #9bcbb4; color: #68776e; }
.message.assistant .bubble code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; padding: 2px 5px; border-radius: 5px; background: #edf2ee; }
.message.assistant .bubble pre { overflow-x: auto; padding: 16px; margin: 12px 0; border-radius: 12px; background: #17221b; color: #edf5ef; line-height: 1.6; }
.message.assistant .bubble pre code { background: transparent; color: inherit; padding: 0; }
.reply-table-wrap { width: 100%; overflow-x: auto; margin: 14px 0 18px; border: 1px solid #dce6de; border-radius: 10px; }
.reply-table { width: 100%; border-collapse: collapse; font-size: .94em; min-width: 360px; }
.reply-table th { text-align: left; font-weight: 700; background: #edf4ef; color: #24382d; }
.reply-table th,.reply-table td { padding: 10px 13px; border-bottom: 1px solid #e0e8e2; vertical-align: top; }
.reply-table tr:last-child td { border-bottom: 0; }
html[data-theme="dark"] .message.assistant .bubble a { color: #83d8b1; }
html[data-theme="dark"] .message.assistant .bubble code { background: #26372d; }
html[data-theme="dark"] .reply-table-wrap { border-color: #35483b; }
html[data-theme="dark"] .reply-table th { background: #25382b; color: #e3eee6; }
html[data-theme="dark"] .reply-table td { border-color: #35483b; }
@media(max-width:680px) { .reply-table th,.reply-table td { padding: 8px 10px; } }


/* Free bundle: Image Studio */
.nav-pill { margin-left:auto; padding:3px 7px; border-radius:999px; font-size:10px; font-weight:700; color:#176b4c; background:#dff4e9; }
.image-studio-wrap { width:min(100% - 48px, 920px); margin:36px auto 70px; }
.image-studio-intro { text-align:center; margin:20px auto 30px; max-width:640px; }
.image-studio-icon { display:grid; place-items:center; width:58px; height:58px; margin:0 auto 18px; border-radius:18px; background:#e3f4eb; color:#176b4c; font-size:30px; }
.image-studio-intro h2 { margin:0 0 10px; font-size:clamp(26px,3vw,36px); letter-spacing:-.04em; }
.image-studio-intro p { margin:0; line-height:1.7; color:var(--text-muted,#77827a); }
.image-form { padding:24px; border:1px solid var(--border,#dfe6df); border-radius:22px; background:var(--surface,#fff); box-shadow:0 12px 35px rgba(20,50,35,.05); }
.image-form > label,.image-option label { display:block; margin:0 0 10px; font-size:13px; font-weight:650; }
#image-prompt { width:100%; min-height:112px; resize:vertical; border:1px solid var(--border,#dfe6df); border-radius:14px; padding:15px 16px; font:inherit; line-height:1.6; color:var(--text,#26352d); background:var(--input-bg,#fff); outline:none; }
#image-prompt:focus { border-color:#4aa982; box-shadow:0 0 0 3px rgba(74,169,130,.13); }
.image-form-options { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:18px 0; }
.image-option .model-select { width:100%; max-width:none; }
.image-generate-btn { min-height:48px; width:100%; justify-content:center; }
.image-disclaimer { margin:13px 0 0; color:var(--text-muted,#77827a); font-size:11px; text-align:center; line-height:1.5; }
.image-result { margin-top:24px; }
.generated-image-card { padding:12px; border:1px solid var(--border,#dfe6df); border-radius:18px; background:var(--surface,#fff); }
.generated-image-card img { display:block; width:100%; max-height:720px; object-fit:contain; border-radius:12px; background:#f0f2ef; }
.generated-image-actions { display:flex; flex-wrap:wrap; gap:10px; padding:14px 2px 2px; }
.image-loading,.image-error { padding:28px 18px; text-align:center; border:1px dashed var(--border,#dfe6df); border-radius:16px; }
.image-loading p,.image-error p { color:var(--text-muted,#77827a); line-height:1.6; }
.image-spinner { display:block; width:30px; height:30px; margin:0 auto 14px; border:3px solid #dce9e1; border-top-color:#25815c; border-radius:50%; animation:ais-spin .8s linear infinite; }
@keyframes ais-spin { to { transform:rotate(360deg); } }
html[data-theme="dark"] .image-form,html[data-theme="dark"] .generated-image-card { background:#17221c; border-color:#2c3d32; }
html[data-theme="dark"] #image-prompt { color:#e7eee9; background:#111a15; border-color:#34483a; }
html[data-theme="dark"] .image-studio-icon { color:#a4e4c2; background:#203c2d; }
html[data-theme="dark"] .nav-pill { color:#b8efd0; background:#234633; }
@media(max-width:680px) { .image-studio-wrap { width:calc(100% - 28px); margin:22px auto 45px; } .image-form { padding:16px; } .image-form-options { grid-template-columns:1fr; gap:12px; } }

/* Image Studio viewport fix: keep the full form reachable above the taskbar */
#view-image {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
#view-image .main-header { flex: 0 0 auto; }
#view-image .image-studio-wrap {
  flex: 0 0 auto;
  margin: 22px auto 36px;
  padding-bottom: 28px;
}
#view-image .image-studio-intro { margin-top: 8px; margin-bottom: 22px; }
#view-image .image-form-options { margin-bottom: 16px; }
#view-image .image-generate-btn { margin-top: 4px; }
#view-image .image-result { padding-bottom: 20px; }
@media (max-height: 800px) {
  #view-image .image-studio-wrap { margin-top: 14px; margin-bottom: 20px; }
  #view-image .image-studio-intro { margin-top: 0; margin-bottom: 16px; }
  #view-image .image-studio-icon { width: 44px; height: 44px; margin-bottom: 10px; }
}


/* Art Studio polish: focused, gallery-like image results */
#view-image .image-studio-wrap { width: min(100% - 48px, 880px); }
#view-image .image-studio-intro { margin-bottom: 26px; }
#view-image .image-form { padding: clamp(18px, 3vw, 28px); }
#view-image .image-result { max-width: 820px; margin: 26px auto 0; }
#view-image .generated-image-card { padding: clamp(12px, 2vw, 18px); border-radius: 22px; box-shadow: 0 18px 50px rgba(0,0,0,.09); }
.generated-image-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:4px 4px 16px; }
.generated-image-heading h3 { margin:5px 0 3px; font-size:19px; letter-spacing:-.025em; }
.generated-image-heading p { margin:0; color:var(--text-muted,#77827a); font-size:13px; }
.result-eyebrow { color:#248363; font-size:10px; font-weight:800; letter-spacing:.13em; }
.result-status { padding:6px 10px; border:1px solid var(--border,#dfe6df); border-radius:999px; color:var(--text-muted,#77827a); font-size:11px; font-weight:650; }
.generated-image-frame { display:grid; place-items:center; overflow:hidden; min-height:180px; padding:12px; border-radius:16px; background:linear-gradient(135deg,#eef2ee,#e3e9e4); }
.generated-image-preview { display:block; width:auto !important; max-width:100%; height:auto; max-height:min(66vh,680px); object-fit:contain; border-radius:10px; box-shadow:0 8px 28px rgba(0,0,0,.13); }
.generated-image-actions { gap:10px; padding:16px 2px 2px; }
.generated-image-actions .btn { min-height:42px; }
.image-loading { padding:38px 22px; background:var(--surface,#fff); }
.image-error { background:var(--surface,#fff); }
html[data-theme="dark"] .generated-image-frame { background:linear-gradient(135deg,#0e1511,#222e26); }
html[data-theme="dark"] .result-eyebrow { color:#8dd8b4; }
html[data-theme="dark"] .image-loading,html[data-theme="dark"] .image-error { background:#17221c; }
@media(max-width:680px) {
 #view-image .image-studio-wrap { width:calc(100% - 28px); }
 .generated-image-heading h3 { font-size:17px; }
 .generated-image-preview { max-height:58vh; }
 .generated-image-actions .btn { flex:1 1 140px; }
}

/* Gemini image result: art-first preview, contained and responsive */
#view-image .generated-image-card { width:100%; }
#view-image .generated-image-frame { min-height:220px; max-height: min(72vh, 760px); padding:16px; }
#view-image .generated-image-preview { display:block; width:auto; height:auto; max-width:100%; max-height: min(68vh, 720px); object-fit:contain; border-radius:10px; box-shadow:0 12px 36px rgba(0,0,0,.18); }
#view-image .image-error { padding:22px; border:1px solid rgba(220,80,80,.3); border-radius:16px; }
#view-image .image-error p { white-space:normal; overflow-wrap:anywhere; }
