:root {
  color-scheme: dark;
  --ink: #edf8ff;
  --muted: #91a9bc;
  --dim: #587085;
  --green: #08d9ff;
  --green-strong: #7cecff;
  --green-glow: rgba(8, 217, 255, 0.16);
  --bg: #030811;
  --panel: #07111d;
  --panel-2: #0a1726;
  --line: #173149;
  --line-hot: #176a91;
  --sidebar: 17.5rem;
  --space-1: 0.4rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  font-family: "DM Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { min-height: 100%; height: 100%; }

body {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 48% 10%, rgba(0, 174, 255, 0.13), transparent 34rem),
    var(--bg);
  line-height: 1.5;
  overflow: hidden;
}

button, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

button:focus-visible, a:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0.22;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(255,255,255,0.022) 4px);
  mix-blend-mode: screen;
}

.app-shell { height: 100svh; min-height: 0; display: grid; }
.chat-panel[hidden], .images-panel[hidden] { display: none; }
.train-mode-toggle[hidden] { display: none !important; }
.live-voice-button[hidden] { display: none !important; }
.live-voice-button {
  display: inline-flex;
  width: 3.35rem;
  height: 2.65rem;
  flex: 0 0 3.35rem;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  border: 1px solid rgba(8, 217, 255, .24);
  border-radius: .35rem;
  color: var(--green);
  background: rgba(8, 217, 255, .055);
  text-decoration: none;
  overflow: hidden;
}
.live-voice-button img { width: 1.32rem; height: 1.32rem; flex: 0 0 auto; object-fit: contain; object-position: 50% 12%; filter: drop-shadow(0 0 .25rem rgba(73, 218, 255, .35)); transform: scale(1.7); transform-origin: 50% 12%; }
.live-voice-button span { font: 700 .4rem "Space Mono", monospace; letter-spacing: .03em; }
.live-voice-button:hover, .live-voice-button:focus-visible { border-color: var(--green); color: #fff; background: rgba(8, 217, 255, .12); }

.sidebar { display: none; }

.app-nav { display: grid; gap: .35rem; margin: 0 0 1.25rem; }
.app-nav-group { display: grid; gap: .25rem; min-width: 0; }
.app-nav-item { display: flex; align-items: center; gap: .65rem; min-height: 2.9rem; padding: .55rem .6rem; border: 1px solid transparent; border-radius: .2rem; color: var(--muted); background: transparent; text-align: left; text-decoration: none; cursor: pointer; }
.app-nav-item > span:first-child { width: 1.25rem; color: var(--dim); text-align: center; }
.app-nav-item > span:last-child { display: grid; min-width: 0; }
.app-nav-item strong { color: #aab5ad; font: 500 .65rem "Space Mono", monospace; }
.app-nav-item small { color: var(--dim); font-size: .48rem; }
.app-nav-item:hover, .app-nav-item.is-active { color: var(--green); border-color: var(--line-hot); background: var(--green-glow); }
.app-nav-item.is-active > span:first-child, .app-nav-item.is-active strong { color: var(--green); }
.app-nav-caret {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  flex: 0 0 1.8rem;
  margin-left: auto;
  place-items: center;
  border-radius: .45rem;
  color: var(--muted);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1;
  pointer-events: none;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}
.app-nav-item:hover .app-nav-caret,
.app-nav-item:focus-visible .app-nav-caret { color: var(--green); background: rgba(157,255,122,.08); }
.app-nav-item[aria-expanded="false"] .app-nav-caret { transform: rotate(-90deg); }
.app-subnav { display: grid; gap: .18rem; max-height: 19rem; overflow-y: auto; padding: .15rem .15rem .2rem 1.9rem; scrollbar-color: var(--line-hot) transparent; scrollbar-width: thin; }
.app-subnav[hidden] { display: none; }
.app-subnav-item { display: flex; align-items: center; gap: .45rem; min-width: 0; padding: .42rem .45rem; border: 1px solid transparent; border-radius: .15rem; color: var(--muted); background: transparent; text-align: left; cursor: pointer; font-size: .52rem; }
.app-subnav-item::before { content: "·"; color: var(--dim); }
.app-subnav-item:hover, .app-subnav-item.is-active { color: var(--green); border-color: var(--line); background: rgba(157,255,122,.06); }
.app-subnav-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-subnav-loading { padding: .5rem; color: var(--dim); font-size: .48rem; letter-spacing: .06em; }

.history { min-height: 0; flex: 0 0 auto; }
.history-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.history-heading .eyebrow { margin-bottom: .45rem; }
.history-heading > span { margin: 0 .35rem .45rem 0; color: var(--green); font-size: .5rem; letter-spacing: .08em; }
.history-list { display: grid; gap: .2rem; max-height: 12rem; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: var(--line-hot) transparent; scrollbar-width: thin; }
.history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; border-radius: .2rem; }
.history-row.is-active { background: #101611; box-shadow: inset 2px 0 var(--green); }
.history-item { width: 100%; min-width: 0; }
.history-delete, .history-share { display: grid; width: 1.75rem; height: 1.75rem; place-items: center; border: 1px solid transparent; border-radius: .2rem; color: var(--dim); background: transparent; cursor: pointer; }
.history-delete { margin-right: .25rem; }
.history-share:hover, .history-share:focus-visible { color: var(--green); border-color: var(--line-hot); background: var(--green-glow); }
.history-delete:hover, .history-delete:focus-visible { color: #ff9c91; border-color: rgba(255, 114, 102, .35); background: rgba(255, 114, 102, .08); }
.history-empty { margin: 0; padding: .65rem .55rem; color: var(--dim); font-size: .52rem; }
.session-feedback { min-height: 1.1rem; margin: .35rem .55rem 0; color: var(--muted); font-size: .48rem; line-height: 1.45; }
.session-feedback.is-error { color: #ff9c91; }

.menu-toggle { display: grid; place-items: center; font-size: 1.05rem; }

.images-panel { min-width: 0; min-height: 0; height: 100svh; grid-template-rows: auto minmax(0, 1fr); background-image: linear-gradient(rgba(106, 144, 111, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(106, 144, 111, .025) 1px, transparent 1px); background-size: 2rem 2rem; }
.images-panel:not([hidden]) { display: grid; }
.images-content { overflow-y: auto; padding: 1.5rem var(--space-3) 3rem; }
.images-hero, .image-feature-toolbar, .image-feature-grid { width: min(100%, 70rem); margin-inline: auto; }
.images-hero { margin-bottom: 1.25rem; }
.images-hero h1 { margin: 0; color: var(--ink); font: 700 clamp(1.25rem, 4vw, 2.1rem) "Space Mono", monospace; letter-spacing: -.04em; }
.images-hero p:not(.eyebrow) { max-width: 52ch; margin: .55rem 0 0; color: var(--muted); font-size: .7rem; }
.image-feature-toolbar { display: flex; align-items: center; gap: .65rem; margin-bottom: 1rem; }
.image-search { position: relative; flex: 1 1 14rem; }
.image-search input { width: 100%; min-height: 2.5rem; padding: .65rem 2rem .65rem .75rem; border: 1px solid var(--line); border-radius: .25rem; background: #0b110d; color: var(--ink); font: 500 .65rem "Space Mono", monospace; }
.image-search input:focus { outline: none; border-color: var(--line-hot); box-shadow: 0 0 0 2px var(--green-glow); }
.image-search > span { position: absolute; top: 50%; right: .75rem; color: var(--dim); transform: translateY(-50%); }
.image-feature-count { flex: 0 0 auto; color: var(--green); font-size: .52rem; letter-spacing: .08em; }
.image-feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: .7rem; }
.image-feature-card { display: grid; gap: .55rem; min-height: 8.2rem; padding: .9rem; border: 1px solid var(--line); border-radius: .35rem; color: var(--ink); background: linear-gradient(145deg, rgba(19, 30, 21, .92), rgba(9, 14, 10, .96)); text-align: left; cursor: pointer; transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
.image-feature-card:hover, .image-feature-card:focus-visible { border-color: var(--line-hot); box-shadow: 0 0 1.5rem rgba(157,255,122,.08); transform: translateY(-2px); }
.image-feature-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.image-feature-card strong { font: 700 .7rem "Space Mono", monospace; letter-spacing: .02em; }
.image-feature-card .feature-index { color: var(--green); font-size: .5rem; }
.image-feature-card p { margin: 0; color: var(--muted); font-size: .59rem; line-height: 1.45; }
.image-feature-card footer { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-top: auto; color: var(--dim); font-size: .48rem; }
.image-feature-card footer span:last-child { color: var(--green); }
.image-feature-loading { grid-column: 1 / -1; padding: 2rem; border: 1px dashed var(--line); color: var(--dim); text-align: center; font-size: .58rem; letter-spacing: .08em; }
.image-feature-sheet { position: fixed; inset: 0; z-index: 30; display: grid; place-items: end center; }
.image-feature-sheet[hidden] { display: none; }
.image-sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.68); backdrop-filter: blur(3px); }
.image-sheet-card { position: relative; display: flex; width: min(100%, 42rem); max-height: min(90svh, 52rem); min-height: 0; flex-direction: column; overflow: hidden; border: 1px solid var(--line-hot); border-radius: .6rem .6rem 0 0; background: #0a100c; box-shadow: 0 -1rem 3rem rgba(0,0,0,.35); animation: message-in 220ms ease both; }
.image-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem; border-bottom: 1px solid var(--line); }
.image-sheet-head h2 { margin: 0; color: var(--green); font: 700 .95rem "Space Mono", monospace; }
.image-sheet-head p:last-child { max-width: 46ch; margin: .35rem 0 0; color: var(--muted); font-size: .58rem; }
.image-sheet-body { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 1rem; scrollbar-color: var(--line-hot) transparent; scrollbar-width: thin; }
.image-sheet-body .image-requirements { margin: 0; }
.image-sheet-body .image-plan-actions { margin-top: 1rem; }
.image-sheet-assets { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: 1rem; padding: .65rem; border: 1px dashed var(--line); color: var(--muted); font-size: .55rem; }
.image-upload-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.image-sheet-assets button { padding: .5rem .65rem; border: 1px solid var(--line-hot); border-radius: .2rem; color: var(--green); background: var(--green-glow); cursor: pointer; font: 700 .52rem "Space Mono", monospace; }
.image-camera-action { display: none; }

@media (max-width: 55.99rem) {
  .camera-button, .image-camera-action { display: grid; }
  .image-camera-action { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar.is-open { position: fixed; inset: 0 auto 0 0; z-index: 50; display: flex; width: min(var(--sidebar), 86vw); min-height: 100svh; max-height: 100svh; padding: 1.25rem 1rem; flex-direction: column; overflow-y: auto; background: #080c09; border-right: 1px solid var(--line-hot); box-shadow: 1rem 0 3rem rgba(0,0,0,.35); }
  .sidebar.is-open .brand, .sidebar.is-open .new-chat, .sidebar.is-open .app-nav, .sidebar.is-open .history, .sidebar.is-open .sidebar-footer { display: grid; }
  .sidebar.is-open .brand { display: flex; align-items: center; gap: .75rem; padding: 0 .45rem; color: inherit; text-decoration: none; }
  .sidebar.is-open .brand > span:last-child { display: grid; }
  .sidebar.is-open .brand strong { font: 700 .95rem "Space Mono", monospace; letter-spacing: .11em; }
  .sidebar.is-open .brand small { color: var(--muted); font-size: .5rem; letter-spacing: .15em; }
  .sidebar.is-open .new-chat { min-height: 2.8rem; margin: 1.6rem 0 1rem; color: var(--green); background: rgba(157,255,122,.05); border: 1px dashed var(--line-hot); border-radius: .2rem; text-align: left; cursor: pointer; }
  .sidebar.is-open .new-chat span { margin: 0 .6rem 0 .35rem; }
  .sidebar.is-open .history { display: grid; min-height: 4rem; margin-bottom: 1rem; }
  .sidebar.is-open .history-list { max-height: 30svh; }
  .sidebar.is-open .sidebar-footer { margin-top: auto; }
  .images-content { padding-top: 1.25rem; }
}

@media (max-width: 30rem) {
  .topbar { gap: .5rem; padding-inline: .5rem; }
  .auth-link { padding-inline: .35rem; font-size: .43rem; }
}

.chat-panel {
  min-width: 0;
  min-height: 0;
  height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background-image:
    linear-gradient(rgba(106, 144, 111, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(106, 144, 111, 0.025) 1px, transparent 1px);
  background-size: 2rem 2rem;
}

.topbar {
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.7rem var(--space-3);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 8, 0.9);
  backdrop-filter: blur(12px);
}

.mobile-brand { color: inherit; text-decoration: none; }

.brand-logo {
  width: 2.75rem;
  height: 2.85rem;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 0 .7rem rgba(8,217,255,.3));
}
.brand-logo-compact { width: 2.15rem; height: 2.2rem; }

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #0b110d;
  background: var(--green);
  border-radius: 0.2rem;
  font: 700 1.05rem/1 "Space Mono", monospace;
  box-shadow: 0 0 1.25rem var(--green-glow);
  transform: skew(-3deg);
}

.brand-mark span { opacity: 0.55; }

.chat-identity { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.chat-identity > span:last-child { display: grid; min-width: 0; }
.chat-identity strong { font: 700 0.82rem/1.3 "Space Mono", monospace; letter-spacing: 0.05em; }
.chat-identity small { color: var(--muted); font-size: 0.63rem; white-space: nowrap; }

.status-orb {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0.25rem rgba(157, 255, 122, 0.08), 0 0 0.8rem var(--green);
  animation: pulse 2.4s ease-in-out infinite;
}

.topbar-actions { min-width: 0; margin-left: auto; display: flex; align-items: center; gap: 0.55rem; }
.latency { display: none; color: var(--green); font-size: 0.62rem; }
.auth-link { display: inline-flex; align-items: center; min-height: 2.25rem; padding: .35rem .5rem; border: 1px solid var(--line-hot); color: var(--green); background: var(--green-glow); text-decoration: none; font: 700 .48rem "Space Mono", monospace; letter-spacing: .05em; white-space: nowrap; }
.auth-link[hidden] { display: none; }
.auth-link:hover { background: rgba(157,255,122,.2); }

.icon-button, .attach-button, .camera-button, .voice-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-button { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 0.25rem; }
.icon-button:hover { color: var(--green); border-color: var(--line-hot); background: var(--green-glow); }
.icon-button svg, .attach-button svg, .camera-button svg, .voice-button svg, .send-button svg { width: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.messages {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.25rem var(--space-3) 2rem;
  scrollbar-color: var(--line-hot) transparent;
  scrollbar-width: thin;
}

.messages > * { width: min(100%, 47rem); margin-inline: auto; }
.auth-gate { display: grid; gap: .35rem; margin-bottom: 1.25rem; padding: .9rem; border: 1px solid var(--line-hot); background: rgba(157,255,122,.06); }
.auth-gate[hidden] { display: none; }
.auth-gate strong { color: var(--green); font: 700 .62rem "Space Mono", monospace; }
.auth-gate span { color: var(--muted); font-size: .58rem; }
.auth-gate a { justify-self: start; margin-top: .2rem; padding: .45rem .55rem; border: 1px solid var(--line-hot); color: var(--green); background: transparent; font: 700 .5rem "Space Mono", monospace; text-decoration: none; }
.auth-gate a:hover { background: var(--green-glow); }

.date-divider { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; color: var(--dim); font-size: 0.58rem; letter-spacing: 0.14em; }
.date-divider::before, .date-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

.message { margin-bottom: 1.35rem; animation: message-in 320ms ease both; }
.message-meta { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.5rem; color: var(--muted); font-size: 0.62rem; }
.message-meta strong { color: var(--green); letter-spacing: 0.08em; font: 700 0.65rem "Space Mono", monospace; }
.message-meta time { margin-left: auto; color: var(--dim); }
.message-copy {
  min-width: 3rem;
  padding: .26rem .4rem;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: .15rem;
  cursor: pointer;
  font-size: .48rem;
  letter-spacing: .08em;
}
.message-copy:hover { color: var(--green); border-color: var(--line-hot); background: var(--green-glow); }
.message-controls { display: inline-flex; align-items: center; gap: .12rem; }
.message-action {
  display: inline-grid;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: .35rem;
  color: var(--dim);
  background: transparent;
  cursor: pointer;
  font-size: .72rem;
  line-height: 1;
}
.message-action:hover, .message-action:focus-visible { color: var(--green); border-color: var(--line-hot); background: var(--green-glow); outline: none; }
.message-action.is-active { color: #02101a; border-color: var(--green); background: var(--green); }
.message-action:disabled { cursor: wait; opacity: .55; }

.mini-avatar {
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-glow);
  border: 1px solid var(--line-hot);
  border-radius: 0.15rem;
  font-weight: 700;
}
.mini-avatar-logo { overflow: hidden; padding: 0; background: #06101b; border-color: #176a91; }
.mini-avatar-logo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); }
.mini-avatar-mascot { overflow: hidden; padding: 0; background: #06101b; border-color: #176a91; }
.mini-avatar-mascot img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 12%; transform: scale(2.15); transform-origin: 50% 12%; }

.bubble {
  position: relative;
  padding: 0.95rem 1rem;
  color: #ced8d0;
  background: linear-gradient(145deg, rgba(15, 23, 17, 0.96), rgba(10, 15, 11, 0.96));
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-hot);
  border-radius: 0 0.35rem 0.35rem 0.35rem;
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.bubble p { margin: 0; }
.bubble p + p { margin-top: 0.7rem; }
.bubble strong { color: var(--green-strong); font-weight: 500; }
.rich-content { line-height: 1.7; }
.code-block { margin: .8rem 0; border: 1px solid #344039; border-radius: .25rem; background: #050806; overflow: hidden; }
.code-block:first-child { margin-top: 0; }
.code-block:last-child { margin-bottom: 0; }
.code-block header { display: flex; align-items: center; justify-content: space-between; padding: .45rem .6rem; color: var(--dim); border-bottom: 1px solid var(--line); background: #0d130f; font-size: .52rem; letter-spacing: .08em; }
.code-block button { padding: .25rem .45rem; color: var(--green); border: 1px solid #315938; background: transparent; cursor: pointer; font-size: .48rem; }
.code-block button:hover { background: var(--green-glow); }
.code-block pre { max-width: 100%; margin: 0; padding: .8rem; overflow: auto; color: #d6e1d8; font: .76rem/1.65 "DM Mono", Consolas, monospace; tab-size: 2; }
.chat-image { margin: .8rem 0; border: 1px solid var(--line); background: #080c09; overflow: hidden; }
.chat-image img { display: block; width: 100%; max-height: 32rem; object-fit: contain; background: #030503; }
.chat-image figcaption { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem .65rem; color: var(--muted); font-size: .56rem; }
.chat-image figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-download { flex: 0 0 auto; padding: .35rem .5rem; color: var(--green); border: 1px solid #315938; text-decoration: none; letter-spacing: .07em; }
.image-download:hover { background: var(--green-glow); }

.user-message .message-meta { flex-direction: row-reverse; }
.user-message .message-meta time { margin: 0 auto 0 0; }
.user-message .message-meta strong { color: #d9e1db; }
.user-message .mini-avatar { color: #d9e1db; border-color: #344039; background: #151c17; }
.user-message .bubble { width: fit-content; max-width: 92%; margin-left: auto; border-left: 1px solid var(--line); border-right: 2px solid #75887a; border-radius: 0.35rem 0 0.35rem 0.35rem; background: #151b17; }

.suggestions { display: grid; gap: 0.55rem; padding-left: 2.15rem; }
.suggestions button {
  width: 100%;
  min-height: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  color: #aab7ad;
  background: rgba(10, 15, 11, 0.76);
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  font-size: 0.72rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.suggestions button span { color: var(--green); }
.suggestions button:hover { color: var(--green-strong); border-color: var(--line-hot); transform: translateX(0.2rem); }

.typing .bubble { display: flex; gap: 0.3rem; width: 4.25rem; }
.typing .bubble i { width: 0.38rem; height: 0.38rem; border-radius: 50%; background: var(--green); opacity: 0.28; animation: typing 1s infinite; }
.typing .bubble i:nth-child(2) { animation-delay: 150ms; }
.typing .bubble i:nth-child(3) { animation-delay: 300ms; }
.loading-bubble { border-left-color: var(--green); }
.image-progress-head { display: flex; align-items: center; gap: .55rem; color: var(--green); font-size: .58rem; letter-spacing: .06em; }
.image-progress-head strong { color: var(--green); font-size: .58rem; }
.image-progress-percent { margin-left: auto; color: var(--muted); font-size: .55rem; }
.image-spinner { width: .55rem; height: .55rem; border: 1px solid var(--green); border-top-color: transparent; border-radius: 50%; animation: spin 800ms linear infinite; }
.image-progress-track { height: 3px; margin: .9rem 0 .65rem; overflow: hidden; background: #172019; }
.image-progress-track i { display: block; width: 0; height: 100%; background: var(--green); box-shadow: 0 0 .55rem var(--green); transition: width 300ms ease; }
.image-progress-steps { display: flex; justify-content: space-between; color: var(--dim); font-size: .48rem; letter-spacing: .06em; }
.image-progress-steps .active { color: var(--green); }
.image-progress-status { margin: .75rem 0 0; color: var(--muted); font-size: .68rem; }
.ai-work-progress .bubble { width: min(100%, 34rem); }
.ai-work-progress .image-progress-steps { gap: .35rem; }
.ai-work-progress .image-progress-steps span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-failure .bubble { border-left-color: #a94c43; }
.image-plan-bubble { border-left-color: var(--green); }
.image-plan-head { display: flex; justify-content: space-between; gap: .8rem; color: var(--green); font-size: .58rem; letter-spacing: .08em; }
.image-plan-head span { color: var(--muted); font-size: .48rem; }
.image-plan-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: .9rem 0; }
.image-plan-details div { padding: .5rem; border: 1px solid var(--line); background: rgba(255,255,255,.015); }
.image-plan-details dt { color: var(--dim); font-size: .46rem; letter-spacing: .08em; }
.image-plan-details dd { margin: .25rem 0 0; overflow-wrap: anywhere; color: var(--text); font-size: .62rem; }
.image-plan-assets { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: .7rem 0; padding: .5rem; border: 1px dashed var(--line); color: var(--dim); font-size: .5rem; letter-spacing: .05em; }
.image-plan-assets .image-upload-actions { flex: 0 0 auto; }
.image-plan-assets button { padding: .4rem .55rem; border: 1px solid #315938; color: var(--green); background: transparent; cursor: pointer; font: 700 .5rem "Space Mono", monospace; }
.image-plan-assets button:hover { border-color: var(--green); background: var(--green-glow); }
.image-plan-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.image-plan-actions button { padding: .5rem .65rem; border: 1px solid #315938; color: var(--green); background: transparent; cursor: pointer; font: 700 .52rem "Space Mono", monospace; letter-spacing: .05em; }
.image-plan-actions button:first-child { background: var(--green-glow); }
.image-plan-actions button:hover { border-color: var(--green); }
.image-plan-actions button:disabled { opacity: .45; cursor: wait; }
.image-plan-error { color: #ff9b91; font-size: .62rem; }
.mikrotik-plan-bubble { border-left-color: #d7a84a; }
.mikrotik-plan-head { display: flex; align-items: center; justify-content: space-between; gap: .7rem; color: #ffd477; font: 700 .58rem "Space Mono", monospace; letter-spacing: .07em; }
.mikrotik-plan-head span { padding: .22rem .38rem; border: 1px solid #70572c; color: #ffd477; background: rgba(215,168,74,.08); font-size: .45rem; white-space: nowrap; }
.mikrotik-plan-head .risk-high { color: #ff9b91; border-color: #75423d; background: rgba(169,76,67,.12); }
.mikrotik-plan-target { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .45rem; margin: .8rem 0; }
.mikrotik-plan-target div { padding: .48rem; border: 1px solid var(--line); background: rgba(255,255,255,.015); }
.mikrotik-plan-target div:last-child { grid-column: 1 / -1; }
.mikrotik-plan-target dt { color: var(--dim); font-size: .44rem; letter-spacing: .07em; }
.mikrotik-plan-target dd { margin: .18rem 0 0; color: var(--ink); font-size: .56rem; overflow-wrap: anywhere; }
.mikrotik-plan-evidence { margin: .7rem 0; padding: .55rem; border: 1px solid #49664f; background: rgba(93, 139, 101, .08); color: var(--muted); font-size: .53rem; line-height: 1.45; }
.mikrotik-plan-evidence strong { color: #a9d6ad; font: 700 .48rem "Space Mono", monospace; letter-spacing: .06em; }
.mikrotik-plan-evidence ul { margin: .35rem 0 0; padding-left: 1rem; }
.mikrotik-plan-evidence p { margin: .35rem 0 0; }
.mikrotik-plan-operations { display: grid; gap: .42rem; margin: .75rem 0; padding: 0; list-style: none; }
.mikrotik-plan-operations li { display: grid; grid-template-columns: auto minmax(0,1fr); gap: .2rem .45rem; padding: .5rem; border: 1px solid var(--line); }
.mikrotik-plan-operations strong { color: #ffd477; font: 700 .47rem "Space Mono", monospace; }
.mikrotik-plan-operations code { color: #cdd9cf; font-size: .52rem; overflow-wrap: anywhere; }
.mikrotik-plan-operations span { grid-column: 1 / -1; color: var(--muted); font-size: .52rem; }
.mikrotik-plan-reason, .mikrotik-plan-warning { color: var(--muted); font-size: .56rem; line-height: 1.5; }
.mikrotik-plan-warning { padding: .5rem; border-left: 2px solid #d7a84a; background: rgba(215,168,74,.05); }
.mikrotik-plan-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.mikrotik-plan-actions button { padding: .52rem .65rem; border: 1px solid #70572c; color: #ffd477; background: transparent; cursor: pointer; font: 700 .5rem "Space Mono", monospace; }
.mikrotik-plan-actions button:first-child { background: rgba(215,168,74,.1); }
.mikrotik-plan-actions button:hover { border-color: #ffd477; }
.mikrotik-plan-actions button:disabled { opacity: .45; cursor: wait; }
.mikrotik-plan-error { margin-top: .6rem; color: #ffb5ad; font-size: .56rem; }
.image-requirements { display: grid; gap: .6rem; margin: .8rem 0; }
.image-requirement-field { display: grid; gap: .28rem; color: var(--dim); font-size: .5rem; letter-spacing: .04em; }
.image-field-help { color: var(--muted); font-size: .48rem; line-height: 1.45; letter-spacing: 0; }
.image-requirement-field input,
.image-requirement-field select,
.image-requirement-field textarea { width: 100%; border: 1px solid var(--line); border-radius: .2rem; background: #101510; color: var(--text); padding: .5rem; font: 500 .6rem "Space Mono", monospace; }
.image-requirement-field select { min-height: 2rem; }
.image-requirement-field textarea { min-height: 3rem; resize: vertical; }
.image-requirement-field input:focus,
.image-requirement-field select:focus,
.image-requirement-field textarea:focus { outline: none; border-color: var(--line-hot); box-shadow: 0 0 0 2px rgba(157,255,122,.08); }
.image-requirement-field input.invalid,
.image-requirement-field select.invalid,
.image-requirement-field textarea.invalid { border-color: #ff7066; box-shadow: 0 0 0 1px #ff7066; }
.image-requirement-error { color: #ff9b91; font-size: .58rem; margin: .2rem 0 0; }
.image-asset-slots { display: grid; gap: .45rem; margin: .65rem 0 .85rem; padding: .55rem; border: 1px solid var(--line); background: rgba(255,255,255,.012); }
.image-asset-slots > header { display: grid; gap: .18rem; padding-bottom: .35rem; border-bottom: 1px dashed var(--line); }
.image-asset-slots > header strong { color: var(--green); font-size: .54rem; letter-spacing: .08em; }
.image-asset-slots > header small { color: var(--muted); font-size: .48rem; line-height: 1.4; }
.image-asset-slot { display: grid; grid-template-columns: 1.5rem minmax(0,1fr) auto; gap: .45rem; align-items: start; padding: .4rem .2rem; border-bottom: 1px solid rgba(126,151,132,.14); }
.image-asset-slot:last-child { border-bottom: 0; }
.image-asset-slot-index { color: var(--green); font: 700 .55rem "Space Mono", monospace; }
.image-asset-slot div { display: grid; gap: .12rem; min-width: 0; }
.image-asset-slot strong { color: var(--text); font-size: .52rem; letter-spacing: .05em; }
.image-asset-slot span { color: var(--dim); font-size: .48rem; overflow-wrap: anywhere; }
.image-asset-slot small { color: var(--muted); font-size: .46rem; line-height: 1.4; }
.image-asset-slot em { color: var(--dim); font: 700 .42rem "Space Mono", monospace; font-style: normal; white-space: nowrap; }
.image-slot-upload { justify-self: start; margin-top: .22rem; padding: .28rem .42rem; border: 1px solid #315938; color: var(--green); background: transparent; cursor: pointer; font: 700 .44rem "Space Mono", monospace; }
.image-slot-upload:hover { border-color: var(--green); background: var(--green-glow); }
.image-asset-slots-empty small { color: var(--muted); font-size: .48rem; line-height: 1.4; }

.composer-wrap { padding: 0.75rem var(--space-3) max(0.65rem, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 18%); }
.composer-wrap > * { width: min(100%, 47rem); margin-inline: auto; }

.composer {
  min-height: 3.65rem;
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  padding: 0.4rem;
  background: rgba(13, 20, 15, 0.97);
  border: 1px solid #344039;
  border-radius: 0.35rem;
  box-shadow: 0 0.85rem 3rem rgba(0,0,0,0.35), inset 0 1px rgba(255,255,255,0.025);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.composer:focus-within { border-color: var(--line-hot); box-shadow: 0 0 0 3px rgba(157,255,122,0.04), 0 0.85rem 3rem rgba(0,0,0,0.35); }

.composer-tools { display: contents; }
.attach-button, .camera-button, .voice-button { width: 2.65rem; height: 2.65rem; flex: 0 0 auto; display: grid; place-items: center; border-radius: 0.2rem; }
.attach-picker-wrap { position: relative; flex: 0 0 auto; }
.attach-picker {
  position: absolute;
  z-index: 20;
  left: 0;
  bottom: calc(100% + .5rem);
  display: grid;
  min-width: 13.5rem;
  padding: .35rem;
  border: 1px solid var(--line-hot);
  border-radius: .45rem;
  background: #151a17;
  box-shadow: 0 .8rem 2rem rgba(0,0,0,.42);
}
.attach-picker[hidden] { display: none; }
.attach-picker button {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  padding: .55rem .6rem;
  border: 0;
  border-radius: .25rem;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.attach-picker button:hover, .attach-picker button:focus-visible { color: var(--green); background: var(--green-glow); outline: none; }
.attach-picker button svg { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.attach-picker button span { display: grid; gap: .12rem; min-width: 0; }
.attach-picker button strong { font: 700 .62rem "Space Mono", monospace; letter-spacing: .04em; }
.attach-picker button small { color: var(--muted); font-size: .52rem; }
.camera-button { display: none; }
@media (max-width: 55.99rem) {
  .composer-tools {
    display: grid;
    grid-template-columns: repeat(2, 2.35rem);
    grid-template-rows: repeat(2, auto);
    gap: .18rem;
    flex: 0 0 auto;
  }
  .composer-tools .live-voice-button,
  .composer-tools .voice-button,
  .composer-tools .attach-button,
  .composer-tools .camera-button {
    width: 2.35rem;
    height: 2.35rem;
    min-width: 2.35rem;
  }
  .composer-tools .live-voice-button { grid-column: 1; grid-row: 1; flex-basis: 2.35rem; }
  .composer-tools .voice-button { grid-column: 2; grid-row: 1; }
  .composer-tools .attach-picker-wrap { grid-column: 1; grid-row: 2; }
  .composer-tools .camera-button { display: grid; grid-column: 2; grid-row: 2; }
}
.attach-button:hover, .camera-button:hover, .voice-button:hover { color: var(--green); background: var(--green-glow); }
.voice-button[hidden] { display: none !important; }
.voice-button.is-recording { color: #fff; border-color: #ff645f; background: rgba(255, 74, 70, .22); animation: voice-pulse 1.2s ease-in-out infinite; }
.voice-status { min-width: 0; overflow-wrap: anywhere; color: var(--green); }
.voice-status.is-error { color: #ff9d8c; }
.voice-disclosure { margin: .2rem 0 0; color: var(--dim); text-align: center; font-size: .48rem; }
.message-action.is-speaking { color: #02101a; border-color: var(--green); background: var(--green); }
@keyframes voice-pulse { 50% { box-shadow: 0 0 0 .35rem rgba(255, 74, 70, .12); } }
.attachment-tray { display: flex; flex-wrap: wrap; gap: .35rem; padding: .45rem 0 0; }
.attachment-tray[hidden] { display: none; }
.attachment-chip { display: inline-flex; align-items: center; gap: .35rem; max-width: min(100%, 18rem); padding: .3rem .42rem; border: 1px solid var(--line); color: var(--muted); font-size: .55rem; }
.attachment-chip-icon { color: var(--green); font: 700 .72rem "Space Mono", monospace; }
.attachment-chip-thumb { width: 2.15rem; height: 2.15rem; flex: 0 0 auto; object-fit: cover; border: 1px solid var(--line-hot); border-radius: .25rem; background: #0e120f; }
.attachment-chip-copy { display: grid; gap: .08rem; min-width: 0; }
.attachment-chip-name { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip-copy small { color: var(--dim); font-size: .46rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip button { width: 1.1rem; height: 1.1rem; padding: 0; border: 0; color: var(--muted); background: transparent; cursor: pointer; }
.attachment-chip button:hover { color: #ff9b91; }

.composer textarea {
  width: 100%;
  min-width: 0;
  max-height: 8rem;
  min-height: 2.65rem;
  resize: none;
  padding: 0.65rem 0.25rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  line-height: 1.35;
  font-size: 0.82rem;
}
.composer textarea::placeholder { color: #59665d; }

.send-button {
  width: 2.65rem;
  height: 2.65rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #0a0e0b;
  background: var(--green);
  border: 0;
  border-radius: 0.2rem;
  cursor: pointer;
  box-shadow: 0 0 1.2rem var(--green-glow);
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}
.send-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 0 1.7rem rgba(157,255,122,0.28); }
.send-button:active:not(:disabled) { transform: translateY(0); }
.send-button:disabled { opacity: 0.25; cursor: not-allowed; }

.composer-meta { display: flex; justify-content: space-between; gap: 1rem; padding-top: 0.45rem; color: var(--dim); font-size: 0.52rem; }
.composer-meta kbd { font: inherit; color: #78857c; }
.disclaimer { margin-top: 0.25rem; color: #455047; text-align: center; font-size: 0.5rem; }

@keyframes pulse { 50% { opacity: 0.62; box-shadow: 0 0 0 0.4rem rgba(157, 255, 122, 0.03), 0 0 0.5rem var(--green); } }
@keyframes message-in { from { opacity: 0; transform: translateY(0.6rem); } }
@keyframes typing { 40% { opacity: 1; transform: translateY(-0.16rem); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 30rem) {
  .latency { display: inline; }
  .messages { padding-inline: var(--space-4); padding-top: 1.75rem; }
  .composer-wrap { padding-inline: var(--space-4); }
  .suggestions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .suggestions button { align-items: flex-start; min-height: 5rem; }
}

@media (min-width: 56rem) {
  .app-shell { grid-template-columns: var(--sidebar) minmax(0, 1fr); height: 100dvh; }
  .menu-toggle { display: none; }
  .sidebar {
    display: flex;
    min-height: 0;
    flex-direction: column;
    padding: 1.25rem 1rem;
    background: #080c09;
    border-right: 1px solid var(--line);
  }
  .chat-panel, .images-panel { height: 100dvh; }
  .brand { display: flex; align-items: center; gap: 0.75rem; padding: 0 0.45rem; color: inherit; text-decoration: none; }
  .brand > span:last-child { display: grid; }
  .brand strong { font: 700 0.95rem "Space Mono", monospace; letter-spacing: 0.11em; }
  .brand small { color: var(--muted); font-size: 0.5rem; letter-spacing: 0.15em; }
  .new-chat { min-height: 2.8rem; margin: 1.6rem 0 1.75rem; color: var(--green); background: rgba(157,255,122,0.05); border: 1px dashed var(--line-hot); border-radius: 0.2rem; text-align: left; cursor: pointer; }
  .new-chat:hover { background: rgba(157,255,122,0.1); }
  .new-chat span { margin: 0 0.6rem 0 0.35rem; }
  .eyebrow { margin: 0 0.45rem 0.6rem; color: var(--dim); font-size: 0.54rem; letter-spacing: 0.11em; }
  .history { display: grid; gap: 0.3rem; }
  .history-item { display: flex; align-items: center; gap: 0.65rem; padding: 0.68rem 0.55rem; border: 0; border-radius: 0.2rem; color: var(--muted); background: transparent; text-align: left; cursor: pointer; }
  .history-item > span:last-child { display: grid; min-width: 0; }
  .history-item strong { overflow: hidden; color: #aab5ad; font-size: 0.65rem; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
  .history-item small { color: var(--dim); font-size: 0.5rem; }
  .history-item:hover, .history-item.is-active { background: #101611; }
  .history-item.is-active { box-shadow: inset 2px 0 var(--green); }
  .history-item.is-active .history-icon { color: var(--green); }
  .sidebar-footer { margin-top: auto; }
  .meter { padding: 0.8rem 0.55rem; color: var(--dim); font-size: 0.5rem; }
  .meter > div { display: flex; justify-content: space-between; margin-bottom: 0.45rem; }
  .meter-track { display: block; height: 2px; background: #172019; }
  .meter-track i { display: block; width: 12%; height: 100%; background: var(--green); box-shadow: 0 0 0.5rem var(--green); }
  .user-card { display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem 0.55rem 0; border-top: 1px solid var(--line); }
  .avatar { width: 2rem; height: 2rem; display: grid; place-items: center; color: #aab6ac; border: 1px solid #37413a; border-radius: 50%; font-size: 0.6rem; }
  .user-card > span:nth-child(2) { display: grid; }
  .user-card strong { font-size: 0.62rem; font-weight: 500; }
  .user-card small { color: var(--dim); font-size: 0.5rem; }
  .mobile-brand { display: none; }
  .topbar { padding-inline: 1.5rem; }
  .images-content { padding-inline: 1.5rem; padding-top: 2rem; }
  .chat-identity { margin-left: max(0rem, calc((100% - 47rem) / 2)); }
  .bubble { font-size: 0.88rem; }
}

/* Compact, flat workspace layout inspired by focused coding assistants. */
:root {
  --sidebar: 15.25rem;
  --ink: #edf8ff;
  --muted: #91a9bc;
  --dim: #587085;
  --green: #08d9ff;
  --green-strong: #7cecff;
  --bg: #040911;
  --panel: #07111c;
  --panel-2: #0b1827;
  --line: #183047;
  --line-hot: #176a91;
  --green-glow: rgba(8, 217, 255, 0.1);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body { background: var(--bg); }
.noise { display: none; }
.chat-panel, .images-panel { background: var(--bg); background-image: none; }

.topbar {
  min-height: 3.55rem;
  gap: .7rem;
  padding: .45rem .75rem;
  border-bottom-color: rgba(91,213,255,.1);
  background: rgba(4,10,18,.94);
  backdrop-filter: blur(10px);
}
.brand-logo { width: 2.45rem; height: 2.5rem; }
.brand-logo-compact { width: 2rem; height: 2.05rem; }
.chat-identity { gap: .5rem; }
.chat-identity strong { font: 600 .78rem/1.3 Inter, "Segoe UI", sans-serif; letter-spacing: 0; }
.chat-identity small { font-size: .58rem; }
.status-orb { width: .38rem; height: .38rem; box-shadow: 0 0 .45rem var(--green); }
.topbar-actions { gap: .2rem; }
.latency { color: var(--muted); font-size: .55rem; }
.auth-link { min-height: 2rem; padding: .3rem .55rem; border: 0; border-radius: .45rem; background: #202328; font: 600 .52rem Inter, "Segoe UI", sans-serif; }
.icon-button { width: 2.2rem; height: 2.2rem; border: 0; border-radius: .5rem; }
.icon-button:hover { border-color: transparent; background: #202226; }

.messages { padding: 1rem .9rem 1.25rem; scrollbar-color: #3a3d42 transparent; }
.messages > *, .composer-wrap > * { width: min(100%, 49rem); }
.date-divider { display: none; }
.message { margin-bottom: 1.15rem; animation-duration: 180ms; }
.message-meta { gap: .4rem; margin-bottom: .25rem; font-size: .56rem; }
.message-meta strong { color: #b6b9be; font: 600 .62rem Inter, "Segoe UI", sans-serif; letter-spacing: 0; }
.message-meta time { color: #666a70; }
.mini-avatar { width: 1.45rem; height: 1.45rem; border: 0; border-radius: .4rem; background: #1b241d; font: 700 .58rem "DM Mono", monospace; }
.message-copy { min-width: auto; padding: .22rem .32rem; border: 0; border-radius: .35rem; font: 500 .48rem Inter, "Segoe UI", sans-serif; }
.message-copy:hover { border-color: transparent; background: #202226; }
.message-action { width: 1.65rem; height: 1.65rem; border: 0; font-size: .66rem; }
.message-action:hover, .message-action:focus-visible { border-color: transparent; background: #102335; }
.bubble {
  padding: .3rem 0 .2rem 1.85rem;
  border: 0;
  border-radius: 0;
  color: #d4d6da;
  background: transparent;
  font-size: .9rem;
  line-height: 1.65;
}
.bubble strong { color: #e4e7e9; font-weight: 600; }
.user-message .message-meta { margin-bottom: .2rem; }
.user-message .message-meta .mini-avatar,
.user-message .message-meta strong,
.user-message .message-meta time { display: none; }
.user-message .message-controls { margin-left: auto; }
.user-message .bubble {
  width: fit-content;
  max-width: min(92%, 42rem);
  margin-left: auto;
  padding: .7rem .9rem;
  border: 0;
  border-radius: 1rem 1rem .3rem 1rem;
  background: #24262a;
  color: #eceef0;
}

.suggestions { display: grid; grid-template-columns: 1fr; gap: 0; padding: .15rem 0 0 1.85rem; }
.suggestions button {
  min-height: 2.35rem;
  padding: .45rem .2rem;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  border-radius: 0;
  background: transparent;
  font-size: .72rem;
  transition: color 140ms ease, padding 140ms ease;
}
.suggestions button:last-child { border-bottom: 0; }
.suggestions button:hover { padding-left: .35rem; border-color: rgba(255,255,255,.06); background: transparent; transform: none; }

.composer-wrap { padding: .45rem .75rem max(.45rem, env(safe-area-inset-bottom)); background: var(--bg); }
.composer {
  min-height: 3.2rem;
  gap: .15rem;
  padding: .28rem;
  border-color: #383a3f;
  border-radius: 1rem;
  background: #18191c;
  box-shadow: 0 .35rem 1.4rem rgba(0,0,0,.22);
}
.composer:focus-within { border-color: #5b6f5f; box-shadow: 0 0 0 2px rgba(157,255,122,.05); }
.attach-button, .camera-button, .voice-button, .send-button { width: 2.35rem; height: 2.35rem; border-radius: .72rem; }
.live-voice-button { width: 3.05rem; height: 2.35rem; flex-basis: 3.05rem; border-radius: .72rem; }
.live-voice-button img { width: 1.15rem; height: 1.15rem; }
.live-voice-button span { font-family: Inter, "Segoe UI", sans-serif; font-size: .4rem; }
.attach-button:hover, .camera-button:hover, .voice-button:hover, .live-voice-button:hover { background: #24262a; }
.composer textarea { min-height: 2.35rem; padding: .55rem .3rem; font-size: .86rem; font-family: Inter, "Segoe UI", sans-serif; }
.send-button { box-shadow: none; }
.send-button:hover:not(:disabled) { box-shadow: none; transform: none; }
.composer-meta { display: none; }
.disclaimer { margin-top: .28rem; color: #5c6066; font-size: .48rem; }

.typing .bubble { margin-left: 1.85rem; padding: .6rem .7rem; border-radius: .8rem; background: #181a1d; }
.loading-bubble,
.image-plan-bubble,
.mikrotik-plan-bubble,
.image-failure .bubble { padding: .75rem .85rem; border-left: 2px solid var(--line-hot); border-radius: .5rem; background: #151719; }
.image-failure .bubble { border-left-color: #a94c43; }
.mikrotik-plan-bubble { border-left-color: #d7a84a; }
.image-plan-details div,
.mikrotik-plan-target div,
.mikrotik-plan-operations li,
.image-asset-slots {
  padding: .45rem .15rem;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: transparent;
}
.image-plan-assets { border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.code-block { border-radius: .55rem; }
.chat-image { border: 0; border-radius: .6rem; background: #111214; }

.auth-gate { padding: .75rem; border: 0; border-left: 2px solid var(--green); border-radius: .35rem; background: #151a16; }
.auth-gate a { border: 0; border-radius: .35rem; background: #202820; }

.sidebar { padding: .8rem .65rem; border-right-color: rgba(255,255,255,.06); background: #111214; }
.sidebar .brand { gap: .55rem; padding: .2rem .45rem; }
.sidebar .brand strong { font: 650 .82rem Inter, "Segoe UI", sans-serif; letter-spacing: .02em; }
.sidebar .brand small { font-size: .46rem; letter-spacing: .08em; }
.new-chat {
  min-height: 2.3rem;
  margin: .85rem .15rem .75rem;
  padding: .35rem .45rem;
  border: 0;
  border-radius: .5rem;
  color: #d7dadc;
  background: #1b1d20;
  font: 550 .7rem Inter, "Segoe UI", sans-serif;
}
.train-mode-toggle {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: calc(100% - .3rem);
  min-height: 2.7rem;
  margin: .9rem .15rem 0;
  padding: .4rem .5rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: .55rem;
  color: #aeb3b7;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.train-mode-toggle > span:last-child { display: grid; gap: .12rem; min-width: 0; }
.train-mode-toggle strong { font: 600 .68rem Inter, "Segoe UI", sans-serif; }
.train-mode-toggle small { color: #73797e; font: 500 .5rem Inter, "Segoe UI", sans-serif; }
.train-switch { position: relative; flex: 0 0 2rem; width: 2rem; height: 1.08rem; border: 1px solid #484d52; border-radius: 1rem; background: #222529; transition: .18s ease; }
.train-switch i { position: absolute; top: .13rem; left: .14rem; width: .72rem; height: .72rem; border-radius: 50%; background: #8d9398; transition: .18s ease; }
.train-mode-toggle:hover { color: #fff; background: #191b1e; }
.train-mode-toggle.is-active { border-color: rgba(8,217,255,.35); color: #e9fbff; background: rgba(8,217,255,.08); }
.train-mode-toggle.is-active .train-switch { border-color: var(--line-hot); background: rgba(8,217,255,.24); }
.train-mode-toggle.is-active .train-switch i { left: 1.02rem; background: var(--green); box-shadow: 0 0 .7rem rgba(8,217,255,.55); }
.is-train-mode .composer { border-color: rgba(8,217,255,.5); box-shadow: 0 0 0 2px rgba(8,217,255,.06); }
.is-train-mode .send-button { background: rgba(8,217,255,.16); }
.new-chat:hover { color: #fff; background: #24262a; }
.new-chat span { margin: 0 .45rem 0 .15rem; }
.app-nav { gap: .1rem; margin-bottom: .65rem; }
.app-nav-item { min-height: 2.35rem; gap: .45rem; padding: .35rem .45rem; border: 0; border-radius: .45rem; }
[data-images-toggle] { min-height: 2.75rem; }
.app-nav-item strong { font: 550 .68rem Inter, "Segoe UI", sans-serif; }
.app-nav-item small { display: none; }
.app-nav-item:hover, .app-nav-item.is-active { border-color: transparent; color: #e7e9eb; background: #1d1f22; }
.app-nav-item.is-active > span:first-child, .app-nav-item.is-active strong { color: #e7e9eb; }
.app-subnav { gap: 0; max-height: 13rem; padding: .1rem 0 .25rem 1.7rem; }
.app-subnav-item { padding: .3rem .4rem; border: 0; border-radius: .35rem; font: 500 .58rem Inter, "Segoe UI", sans-serif; }
.app-subnav-item:hover, .app-subnav-item.is-active { border-color: transparent; background: #1d1f22; }
.history-heading .eyebrow { margin: .35rem .4rem .25rem; }
.history-heading > span { margin-bottom: .25rem; color: #777b80; }
.history-list { gap: 0; max-height: 10rem; }
.history-row { border-radius: .4rem; }
.history-row.is-active { background: #1d1f22; box-shadow: none; }
.history-item { display: flex; align-items: center; gap: .5rem; padding: .45rem; border: 0; border-radius: .4rem; color: var(--muted); background: transparent; text-align: left; cursor: pointer; }
.history-item > span:last-child { display: grid; min-width: 0; }
.history-item:hover, .history-item.is-active { background: #1d1f22; box-shadow: none; }
.history-item.is-loading { color: var(--green); background: #202328; cursor: progress; }
.history-item.is-loading::after {
  content: "";
  width: .75rem;
  height: .75rem;
  flex: 0 0 .75rem;
  margin-left: auto;
  border: 1px solid var(--green);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.history-item strong { font: 500 .65rem Inter, "Segoe UI", sans-serif; }
.history-delete, .history-share { border: 0; }
.session-feedback { margin-inline: .45rem; }
.meter { display: none; }
.sidebar-footer { margin-top: auto; }
.user-card { display: none; }
.avatar { width: 1.7rem; height: 1.7rem; border: 0; background: #24262a; }

.images-content { padding: 1.25rem .9rem 2rem; }
.images-hero { margin-bottom: .8rem; }
.images-hero h1 { font: 650 clamp(1.1rem, 4vw, 1.55rem) Inter, "Segoe UI", sans-serif; letter-spacing: 0; }
.images-hero p:not(.eyebrow) { margin-top: .35rem; font-size: .68rem; }
.image-feature-toolbar { margin-bottom: .45rem; }
.image-search input { min-height: 2.25rem; border: 0; border-radius: .55rem; background: #181a1d; font: 500 .68rem Inter, "Segoe UI", sans-serif; }
.image-feature-grid { grid-template-columns: 1fr; gap: 0; }
.image-feature-card {
  min-height: 0;
  gap: .25rem;
  padding: .7rem .25rem;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
  border-radius: 0;
  background: transparent;
  transition: background 140ms ease, padding 140ms ease;
}
.image-feature-card:hover, .image-feature-card:focus-visible { padding-inline: .55rem; border-color: rgba(255,255,255,.07); background: #151719; box-shadow: none; transform: none; }
.image-feature-card strong { font: 600 .72rem Inter, "Segoe UI", sans-serif; letter-spacing: 0; }
.image-feature-card p { font-size: .62rem; }
.image-feature-card footer { margin-top: .1rem; }
.image-sheet-card { border: 0; border-radius: .8rem .8rem 0 0; background: #151619; }
.image-sheet-head { padding: .8rem; border-bottom-color: rgba(255,255,255,.07); }
.image-sheet-head h2 { font: 650 .92rem Inter, "Segoe UI", sans-serif; }
.image-sheet-body { padding: .8rem; }

@media (max-width: 55.99rem) {
  .sidebar.is-open { padding: .8rem .65rem; border-right-color: rgba(255,255,255,.08); background: #111214; }
  .sidebar.is-open .new-chat { min-height: 2.3rem; margin: .85rem .15rem .75rem; border: 0; color: #d7dadc; background: transparent; }
  .sidebar.is-open .new-chat:hover { background: #1d1f22; }
  .sidebar.is-open .train-mode-toggle { display: flex; margin-top: .8rem; }
  .sidebar.is-open .history { min-height: 3.2rem; }
  .sidebar.is-open .history-list { max-height: 24svh; }
}

@media (min-width: 30rem) {
  .messages { padding-top: 1.2rem; }
  .suggestions { grid-template-columns: 1fr; }
  .suggestions button { min-height: 2.35rem; align-items: center; }
  .image-feature-grid { grid-template-columns: repeat(2, minmax(0,1fr)); column-gap: 1.4rem; }
}

@media (min-width: 56rem) {
  .sidebar { padding: .8rem .65rem; }
  .topbar { padding-inline: 1rem; }
  .messages { padding-top: 1.35rem; }
  .images-content { padding: 1.5rem 1.25rem 2rem; }
  .chat-identity { margin-left: max(0rem, calc((100% - 49rem) / 2)); }
  .bubble { font-size: .92rem; }
  .image-feature-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Official LICIN AI mascot palette: cyan energy, deep navy, white, and silver. */
body { background: radial-gradient(circle at 52% -10%, rgba(0,174,255,.14), transparent 34rem), var(--bg); }
.chat-panel, .images-panel { background-color: var(--bg); }
.sidebar, .sidebar.is-open { background: #050d17; border-color: var(--line); }
.brand strong, .chat-identity strong { color: #effaff; }
.brand small { color: #75bcd7; }
.status-orb { box-shadow: 0 0 0 .2rem rgba(8,217,255,.08), 0 0 .65rem var(--green); }
.app-nav-item:hover, .app-nav-item.is-active,
.app-subnav-item:hover, .app-subnav-item.is-active,
.history-row.is-active, .history-item:hover, .history-item.is-active { background: #0b1c2c; color: #eaf9ff; }
.auth-link, .icon-button:hover { background: #0d2132; color: var(--green); }
.auth-gate { background: rgba(8,217,255,.055); border-color: #176a91; }
.bubble, .loading-bubble, .image-plan-bubble, .mikrotik-plan-bubble { background: linear-gradient(145deg, rgba(9,24,38,.98), rgba(5,13,23,.98)); border-color: var(--line); }
.user-message .bubble { background: #0d2234; border-right-color: #4fb8dc; }
.chat-link { color: var(--green-strong); text-decoration: underline; text-decoration-color: rgba(124,236,255,.38); text-underline-offset: .18em; overflow-wrap: anywhere; }
.chat-link:hover, .chat-link:focus-visible { color: #fff; text-decoration-color: var(--green); }
.user-message .mini-avatar { background: #102537; border-color: #24506b; color: #dcedf7; }
.composer { background: #08131f; border-color: #234259; box-shadow: 0 .35rem 1.4rem rgba(0,0,0,.3), 0 0 1.8rem rgba(0,174,255,.025); }
.composer:focus-within { border-color: var(--line-hot); box-shadow: 0 0 0 2px rgba(8,217,255,.07); }
.attach-button:hover, .camera-button:hover, .voice-button:hover, .icon-button:hover { background: #102335; }

@media (prefers-reduced-motion: reduce) {
  .voice-button.is-recording { animation: none; }
}
.attach-picker, .image-sheet-card { background: #071421; border-color: var(--line-hot); }
.attachment-chip { background: #091724; border-color: #21455f; }
.image-search input, .image-requirement input, .image-requirement textarea, .image-requirement select { background: #081521; border-color: var(--line); color: var(--ink); }
.image-feature-card:hover, .image-feature-card:focus-visible { background: #091a29; border-color: rgba(73,197,238,.13); }
.image-sheet-head { border-bottom-color: var(--line); }
.code-block { background: #030912; border-color: var(--line); }
.code-block header { background: #081522; }
.chat-image, .chat-image img { background: #02070d; }
.image-download, .code-block button { border-color: #176a91; }
.document-download {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-top: .7rem;
  padding: .7rem .75rem;
  border: 1px solid #176a91;
  border-radius: .65rem;
  color: #edf8ff;
  background: linear-gradient(135deg, rgba(8,217,255,.1), rgba(7,20,33,.92));
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.document-download:hover,
.document-download:focus-visible {
  border-color: var(--green);
  background: linear-gradient(135deg, rgba(8,217,255,.16), rgba(8,25,40,.98));
  transform: translateY(-1px);
}
.document-download-icon {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: .5rem;
  color: #03111a;
  background: var(--green);
  font-size: 1rem;
  font-weight: 800;
}
.document-download > span:last-child { display: grid; min-width: 0; gap: .15rem; }
.document-download strong { overflow: hidden; color: #edf8ff; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.document-download small { color: #75bcd7; font-size: .48rem; letter-spacing: .07em; }
.meter-track { background: #102234; }
.meter-track i { background: linear-gradient(90deg, #007fa9, var(--green)); }

@media (max-width: 55.99rem) {
  .sidebar.is-open { background: #050d17; border-right-color: #1b4c68; }
  .sidebar.is-open .new-chat:hover { background: #0b1c2c; }
}

/* Quiet LICIN AI watermark behind the conversation surface. */
.chat-panel {
  position: relative;
  isolation: isolate;
}
.chat-panel::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: clamp(13rem, 42vw, 27rem);
  aspect-ratio: 1;
  pointer-events: none;
  background: url("/assets/mascot/v1/static/full-body/licin-mascot-v1__full-body__front__512.png?v=73b104d82344") center / contain no-repeat;
  opacity: .1;
  filter: saturate(.85) drop-shadow(0 0 2rem rgba(8,217,255,.14));
  transform: translate(-50%, -50%);
}
.chat-panel > * {
  position: relative;
  z-index: 1;
}

@media (max-width: 30rem) {
  .chat-panel::before {
    width: min(58vw, 15rem);
    opacity: .1;
  }
}

/* Compact web-image search gallery and fullscreen viewer. */
.web-image-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  margin-top: .85rem;
}
.web-image-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1 / .82;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .65rem;
  color: var(--ink);
  background: #02070d;
  cursor: pointer;
  text-align: left;
}
.web-image-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease, opacity 180ms ease;
}
.web-image-card > span {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: 1.2rem .5rem .45rem;
  background: linear-gradient(transparent, rgba(2,7,13,.94));
}
.web-image-card b {
  color: var(--green);
  font: 700 .5rem "DM Mono", monospace;
}
.web-image-card small {
  min-width: 0;
  overflow: hidden;
  color: #edf8ff;
  font-size: .54rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.web-image-card:hover,
.web-image-card:focus-visible { border-color: var(--green); }
.web-image-card:hover img,
.web-image-card:focus-visible img { transform: scale(1.035); opacity: .9; }

.web-image-viewer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: max(.75rem, env(safe-area-inset-top)) .75rem max(.75rem, env(safe-area-inset-bottom));
}
.web-image-viewer[hidden] { display: none; }
.web-image-viewer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0,5,10,.86);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
}
.web-image-viewer-card {
  position: relative;
  display: grid;
  width: min(100%, 64rem);
  max-height: 92svh;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line-hot);
  border-radius: .8rem;
  background: #030a12;
  box-shadow: 0 1.5rem 5rem rgba(0,0,0,.62);
  animation: message-in 180ms ease both;
}
.web-image-viewer-card > header,
.web-image-viewer-card > footer {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem .75rem;
  background: #071421;
}
.web-image-viewer-card > header { border-bottom: 1px solid var(--line); }
.web-image-viewer-card > header > div {
  display: grid;
  min-width: 0;
  gap: .08rem;
}
.web-image-viewer-card > header span {
  color: var(--green);
  font: 700 .5rem "DM Mono", monospace;
  letter-spacing: .08em;
}
.web-image-viewer-card > header strong {
  overflow: hidden;
  color: var(--ink);
  font-size: .64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.web-image-viewer-card > header button {
  width: 2.25rem;
  height: 2.25rem;
  margin-left: auto;
  border: 0;
  border-radius: .5rem;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 1.5rem;
}
.web-image-viewer-card > header button:hover { color: #fff; background: #102335; }
.web-image-viewer-stage {
  position: relative;
  display: grid;
  min-height: min(62svh, 34rem);
  place-items: center;
  overflow: hidden;
  background: #01050a;
}
.web-image-viewer-stage img {
  display: block;
  max-width: 100%;
  max-height: 72svh;
  object-fit: contain;
}
.web-image-viewer-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 2.65rem;
  height: 3.4rem;
  place-items: center;
  border: 1px solid rgba(124,236,255,.28);
  border-radius: .55rem;
  color: #fff;
  background: rgba(3,10,18,.76);
  cursor: pointer;
  font-size: 2rem;
  transform: translateY(-50%);
}
.web-image-viewer-nav.is-prev { left: .55rem; }
.web-image-viewer-nav.is-next { right: .55rem; }
.web-image-viewer-nav:hover { border-color: var(--green); background: #0b2132; }
.web-image-viewer-nav:disabled { display: none; }
.web-image-viewer-card > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}
.web-image-viewer-card > footer a {
  padding: .48rem .65rem;
  border: 1px solid var(--line-hot);
  border-radius: .4rem;
  color: var(--green);
  text-decoration: none;
  font: 700 .52rem "DM Mono", monospace;
  letter-spacing: .05em;
}
.web-image-viewer-card > footer a:hover { background: var(--green-glow); }

@media (min-width: 30rem) {
  .web-image-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 30rem) {
  .web-image-viewer { padding-inline: .35rem; }
  .web-image-viewer-card { max-height: 96svh; border-radius: .65rem; }
  .web-image-viewer-stage { min-height: 58svh; }
  .web-image-viewer-nav { width: 2.35rem; height: 3rem; }
  .web-image-viewer-card > footer { justify-content: stretch; }
  .web-image-viewer-card > footer a { flex: 1 1 0; text-align: center; }
}
.agent-approval-slot:empty { display:none; }
.agent-approval-card { display:grid; gap:.55rem; margin-top:.75rem; padding:.7rem; border:1px solid rgba(8,217,255,.42); border-radius:.45rem; background:rgba(3,20,32,.86); }
.agent-approval-card strong { color:#8feaff; font:700 .6rem "Space Mono",monospace; letter-spacing:.05em; }
.agent-approval-card p { margin:0; overflow-wrap:anywhere; color:#d5e8ed; font:.58rem/1.55 "DM Mono",monospace; white-space:pre-wrap; }
.agent-approval-card > div { display:grid; grid-template-columns:1fr 1fr; gap:.4rem; }
.agent-approval-card button { min-height:2.35rem; padding:.5rem .6rem; border:1px solid #2a91b8; border-radius:.35rem; color:#03131e; background:#66dff7; font:700 .48rem "Space Mono",monospace; cursor:pointer; }
.agent-approval-card button.secondary { color:#bdeaf4; background:rgba(8,114,164,.18); }
.agent-approval-card button:last-child { grid-column:1 / -1; }
.agent-approval-card button:disabled { opacity:.5; cursor:wait; }
@media (min-width:42rem) {
  .agent-approval-card > div { grid-template-columns:auto auto auto; justify-content:start; }
  .agent-approval-card button:last-child { grid-column:auto; }
}
