/* Avanza AI Studio v72 — full-page Agent workspace
   Scope: immersive demo only. The site, launch section, hero, header, and footer are untouched. */

.demo-experience {
  --demo-sidebar: clamp(238px, 18vw, 286px);
  --demo-topbar: clamp(62px, 4.7vw, 74px);
  background: #101112;
  transform: translateY(8px) scale(.996);
}

.demo-experience.is-open {
  transform: none;
}

.demo-experience-shell,
.demo-experience-canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.demo-experience-canvas {
  display: block;
  overflow: hidden;
  padding: 0 !important;
  background: #171819;
}

.demo-experience .agent-console {
  display: grid;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0;
  min-height: 0;
  grid-template-columns: var(--demo-sidebar) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  margin: 0;
  overflow: hidden;
  border: 0 !important;
  border-radius: 0 !important;
  background: #171819 !important;
  box-shadow: none !important;
}

/* Desktop workspace rail */
.demo-experience .agent-app-sidebar {
  position: relative;
  z-index: 3;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 15px 12px 13px;
  border-right: 1px solid rgba(255,255,255,.075);
  background: #0d0e0f;
}

.agent-sidebar-brand {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 11px;
  padding: 4px 9px 12px;
}

.agent-sidebar-mark,
.agent-sidebar-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.055);
}

.agent-sidebar-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.agent-sidebar-mark img {
  width: 21px;
}

.agent-sidebar-brand > span:last-child,
.agent-sidebar-profile > span:last-child {
  display: grid;
  min-width: 0;
}

.agent-sidebar-brand strong {
  color: rgba(255,255,255,.96);
  font-size: .79rem;
  letter-spacing: -.025em;
}

.agent-sidebar-brand small {
  margin-top: 2px;
  color: rgba(255,255,255,.35);
  font-size: .54rem;
  font-weight: 650;
}

.agent-sidebar-new {
  display: flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.105);
  border-radius: 11px;
  color: rgba(255,255,255,.88);
  font: inherit;
  font-size: .68rem;
  font-weight: 650;
  background: rgba(255,255,255,.045);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.agent-sidebar-new span:first-child {
  color: rgba(255,255,255,.6);
  font-size: 1rem;
  font-weight: 400;
}

.agent-sidebar-new:hover:not(:disabled),
.agent-sidebar-new:focus-visible:not(:disabled) {
  border-color: rgba(255,255,255,.18);
  color: #fff;
  background: rgba(255,255,255,.08);
}

.agent-sidebar-new:disabled {
  opacity: .48;
  cursor: default;
}

.agent-sidebar-section {
  display: grid;
  gap: 3px;
  margin-top: 23px;
}

.agent-sidebar-section > small {
  padding: 0 11px 7px;
  color: rgba(255,255,255,.28);
  font-size: .47rem;
  font-weight: 800;
  letter-spacing: .13em;
}

.agent-sidebar-thread {
  display: flex;
  min-height: 38px;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border-radius: 9px;
  color: rgba(255,255,255,.48);
  font-size: .63rem;
}

.agent-sidebar-thread span {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
}

.agent-sidebar-thread strong {
  overflow: hidden;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-sidebar-thread.is-active {
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.065);
}

.agent-sidebar-thread.is-active span {
  background: rgba(255,255,255,.78);
  box-shadow: 0 0 0 4px rgba(255,255,255,.045);
}

.agent-sidebar-bottom {
  display: grid;
  gap: 11px;
  margin-top: auto;
}

.agent-sidebar-systems {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 11px;
  background: rgba(255,255,255,.026);
}

.agent-sidebar-systems span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.68);
  font-size: .57rem;
  font-weight: 650;
}

.agent-sidebar-systems i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e3e6e2;
  box-shadow: 0 0 0 4px rgba(255,255,255,.05);
}

.agent-sidebar-systems small {
  color: rgba(255,255,255,.3);
  font-size: .49rem;
  line-height: 1.55;
}

.agent-sidebar-profile {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 8px 7px 2px;
}

.agent-sidebar-avatar {
  width: 31px;
  height: 31px;
  border-radius: 50%;
}

.agent-sidebar-avatar img {
  width: 18px;
}

.agent-sidebar-profile strong {
  overflow: hidden;
  color: rgba(255,255,255,.75);
  font-size: .59rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-sidebar-profile small {
  margin-top: 3px;
  overflow: hidden;
  color: rgba(255,255,255,.28);
  font-size: .47rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Main ChatGPT-style conversation surface */
.demo-experience .agent-console-main {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: var(--demo-topbar) minmax(0, 1fr);
  background:
    radial-gradient(circle at 50% -12%, rgba(255,255,255,.025), transparent 31%),
    #171819;
}

.demo-experience .agent-console-topbar {
  display: flex !important;
  min-height: var(--demo-topbar) !important;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px clamp(14px, 1.5vw, 24px) !important;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(23,24,25,.91);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.demo-experience .agent-console-brand {
  gap: 10px;
}

.demo-experience .agent-console-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(255,255,255,.055);
}

.demo-experience .agent-console-mark img {
  width: 21px;
}

.demo-experience .agent-console-brand strong {
  font-size: .79rem;
  font-weight: 650;
}

.demo-experience .agent-console-brand small {
  margin-top: 3px;
  color: rgba(255,255,255,.36);
  font-size: .53rem;
}

.agent-console-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.demo-experience .agent-console-state {
  min-height: 34px;
  padding: 0 11px;
  color: rgba(255,255,255,.52);
  font-size: .56rem;
  background: rgba(255,255,255,.025);
}

.demo-experience-back {
  display: inline-flex;
  min-height: 36px;
  width: auto;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 11px 0 13px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: rgba(255,255,255,.61);
  font: inherit;
  font-size: .56rem;
  font-weight: 650;
  background: rgba(255,255,255,.025);
  cursor: pointer;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}

.demo-experience-back span:last-child {
  color: rgba(255,255,255,.48);
  font-size: .9rem;
  line-height: 1;
}

.demo-experience-back:hover,
.demo-experience-back:focus-visible {
  border-color: rgba(255,255,255,.19);
  color: #fff;
  background: rgba(255,255,255,.07);
  transform: none;
}

.demo-experience .agent-console-body,
.demo-experience .agent-workspace {
  width: 100%;
  height: 100%;
  min-height: 0 !important;
}

.demo-experience .agent-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  background: transparent;
}

.demo-experience .agent-conversation-head {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px clamp(18px, 2vw, 32px) !important;
  border-bottom: 0;
}

.demo-experience .agent-conversation-head > span:first-child {
  display: grid;
}

.demo-experience .agent-conversation-head small {
  color: rgba(255,255,255,.28);
  font-size: .46rem;
}

.demo-experience .agent-conversation-head strong {
  margin-top: 4px;
  color: rgba(255,255,255,.7);
  font-size: .62rem;
  font-weight: 600;
}

.agent-conversation-context {
  color: rgba(255,255,255,.26);
  font-size: .5rem;
  font-weight: 550;
}

.demo-experience .agent-chat-thread {
  position: relative;
  width: 100%;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(22px, 3.2dvh, 42px) clamp(20px, 4vw, 74px) !important;
  scroll-padding-block: 30px;
}

.demo-experience .agent-empty-state {
  display: grid;
  width: min(100%, 940px);
  min-height: 100% !important;
  margin: 0 auto;
  place-items: center;
  align-content: center;
  padding: clamp(24px, 3dvh, 42px) 0 clamp(34px, 5dvh, 66px) !important;
  text-align: center;
}

.demo-experience .agent-empty-orb {
  width: 62px;
  height: 62px;
  margin-bottom: 16px;
}

.demo-experience .agent-empty-orb span {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: rgba(255,255,255,.055);
  box-shadow: 0 18px 48px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.075);
}

.demo-experience .agent-empty-orb img {
  width: 33px;
}

.demo-experience .agent-empty-state > small {
  color: rgba(255,255,255,.43);
  font-size: .53rem;
  letter-spacing: .14em;
}

.demo-experience .agent-empty-state h3 {
  margin-top: 10px;
  color: #f4f4f2;
  font-size: clamp(2rem, min(3.5vw, 5.1dvh), 3.2rem);
  line-height: 1;
  letter-spacing: -.055em;
}

.demo-experience .agent-empty-state > p {
  max-width: 650px;
  margin-top: 15px;
  color: rgba(255,255,255,.49);
  font-size: clamp(.77rem, .84vw, .91rem);
  line-height: 1.72;
}

.demo-experience .agent-starter-grid {
  display: grid;
  width: min(100%, 820px) !important;
  grid-template-columns: 1fr 1fr;
  gap: 10px !important;
  margin-top: clamp(24px, 3.4dvh, 36px) !important;
  text-align: left;
}

.demo-experience .agent-starter-grid button {
  min-height: clamp(76px, 8.6dvh, 94px) !important;
  padding: 16px 18px !important;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 15px;
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.035);
  box-shadow: none;
  transition: background .24s ease, border-color .24s ease, transform .28s cubic-bezier(.16,1,.3,1);
}

.demo-experience .agent-starter-grid button:hover,
.demo-experience .agent-starter-grid button:focus-visible {
  border-color: rgba(255,255,255,.17);
  color: #fff;
  background: rgba(255,255,255,.075);
  box-shadow: none;
  transform: translateY(-2px);
}

.demo-experience .agent-starter-grid small {
  color: rgba(255,255,255,.32);
  font-size: .47rem;
  letter-spacing: .12em;
}

.demo-experience .agent-starter-grid strong {
  margin-top: 8px;
  color: rgba(255,255,255,.86);
  font-size: .73rem;
  font-weight: 600;
  line-height: 1.45;
}

/* Conversation width and response rhythm */
.demo-experience .agent-messages {
  width: min(100%, 960px);
  margin: 0 auto;
  gap: 26px;
}

.demo-experience .owner-message {
  width: min(88%, 620px);
  padding: 14px 17px;
  border-color: rgba(255,255,255,.09);
  background: rgba(255,255,255,.065);
  box-shadow: none;
}

.demo-experience .agent-message-main {
  width: 100% !important;
  max-width: 100% !important;
}

.demo-experience .agent-response-stage .agent-response {
  border-color: rgba(255,255,255,.1);
  border-radius: 18px;
  background: rgba(255,255,255,.025);
  box-shadow: none;
}

.demo-experience .agent-answer-grid {
  gap: 10px;
}

.demo-experience .agent-answer-card {
  border-color: rgba(255,255,255,.11);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  box-shadow: none;
}

.demo-experience .agent-answer-card:hover {
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.07);
  box-shadow: none;
}

/* Bottom composer becomes part of the page, not a giant footer tray. */
.demo-experience .agent-composer {
  position: relative;
  z-index: 4;
  padding: 0 clamp(18px, 4vw, 74px) clamp(14px, 2dvh, 20px) !important;
  border-top: 0;
  background: linear-gradient(to top, #171819 72%, rgba(23,24,25,0));
}

.agent-composer-inner {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 19px;
  background: #222324;
  box-shadow: 0 18px 52px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.035);
}

.demo-experience .agent-composer-head {
  margin: 0 2px 9px;
  color: rgba(255,255,255,.48);
  font-size: .5rem;
  letter-spacing: .08em;
}

.demo-experience .agent-composer-head small {
  color: rgba(255,255,255,.25);
  font-size: .47rem;
  text-transform: none;
}

.demo-experience .agent-prompt-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.demo-experience .agent-prompt-compact {
  min-height: 42px;
  padding: 9px 10px;
  border-color: rgba(255,255,255,.085);
  border-radius: 11px;
  color: rgba(255,255,255,.5);
  font-size: .51rem;
  background: rgba(255,255,255,.025);
}

.demo-experience .agent-prompt-compact:hover:not(:disabled),
.demo-experience .agent-prompt-compact:focus-visible:not(:disabled) {
  border-color: rgba(255,255,255,.17);
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.06);
  box-shadow: none;
  transform: none;
}

.agent-composer-disclaimer {
  margin-top: 9px;
  color: rgba(255,255,255,.22);
  font-size: .45rem;
  line-height: 1.45;
  text-align: center;
}

.demo-experience .agent-console-footer {
  display: none !important;
}

/* Keep the entire page usable on shorter laptops. */
@media (min-width: 901px) and (max-height: 760px) {
  .demo-experience {
    --demo-sidebar: 224px;
    --demo-topbar: 58px;
  }

  .demo-experience .agent-app-sidebar {
    padding-top: 10px;
  }

  .agent-sidebar-section {
    margin-top: 14px;
  }

  .agent-sidebar-thread {
    min-height: 34px;
  }

  .demo-experience .agent-conversation-head {
    min-height: 42px;
    padding-block: 6px !important;
  }

  .demo-experience .agent-chat-thread {
    padding-block: 16px 22px !important;
  }

  .demo-experience .agent-empty-state {
    padding-block: 10px 26px !important;
  }

  .demo-experience .agent-empty-orb {
    width: 50px;
    height: 50px;
    margin-bottom: 9px;
  }

  .demo-experience .agent-empty-orb span {
    width: 48px;
    height: 48px;
    border-radius: 15px;
  }

  .demo-experience .agent-empty-orb img {
    width: 27px;
  }

  .demo-experience .agent-empty-state h3 {
    font-size: clamp(1.75rem, 4.2dvh, 2.25rem);
  }

  .demo-experience .agent-empty-state > p {
    margin-top: 10px;
    font-size: .76rem;
  }

  .demo-experience .agent-starter-grid {
    margin-top: 18px !important;
  }

  .demo-experience .agent-starter-grid button {
    min-height: 66px !important;
    padding-block: 12px !important;
  }

  .agent-sidebar-systems {
    display: none;
  }
}

/* Collapse the navigation rail before it starts stealing conversation width. */
@media (max-width: 900px) {
  .demo-experience .agent-console {
    grid-template-columns: minmax(0, 1fr);
  }

  .demo-experience .agent-app-sidebar {
    display: none;
  }

  .demo-experience .agent-console-main {
    grid-column: 1;
  }

  .demo-experience .agent-chat-thread {
    padding-inline: clamp(16px, 5vw, 44px) !important;
  }

  .demo-experience .agent-composer {
    padding-inline: clamp(14px, 4vw, 36px) !important;
  }
}

@media (max-width: 640px) {
  .demo-experience {
    --demo-topbar: 60px;
  }

  .demo-experience .agent-console-topbar {
    padding-inline: 12px !important;
  }

  .demo-experience .agent-console-mark {
    width: 34px;
    height: 34px;
  }

  .demo-experience .agent-console-brand small,
  .demo-experience .agent-console-state span,
  .demo-experience-back span:first-child,
  .agent-conversation-context {
    display: none;
  }

  .demo-experience .agent-console-state {
    width: 34px;
    min-height: 34px;
    justify-content: center;
    padding: 0;
  }

  .demo-experience-back {
    width: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 50%;
  }

  .demo-experience-back span:last-child {
    font-size: 1rem;
  }

  .demo-experience .agent-conversation-head {
    min-height: 43px;
    padding-inline: 15px !important;
  }

  .demo-experience .agent-chat-thread {
    padding: 18px 13px 26px !important;
  }

  .demo-experience .agent-empty-state {
    width: 100%;
    padding: 18px 0 30px !important;
  }

  .demo-experience .agent-empty-state h3 {
    max-width: 330px;
    font-size: clamp(1.85rem, 9vw, 2.5rem);
  }

  .demo-experience .agent-empty-state > p {
    max-width: 360px;
    padding-inline: 8px;
    font-size: .76rem;
  }

  .demo-experience .agent-starter-grid {
    width: 100% !important;
    grid-template-columns: 1fr;
    margin-top: 22px !important;
  }

  .demo-experience .agent-starter-grid button {
    min-height: 68px !important;
    border-radius: 13px;
  }

  .demo-experience .agent-composer {
    padding: 0 9px 9px !important;
  }

  .agent-composer-inner {
    padding: 10px;
    border-radius: 16px;
  }

  .demo-experience .agent-composer-head small,
  .agent-composer-disclaimer {
    display: none;
  }

  .demo-experience .agent-prompt-rail {
    display: flex;
    overflow-x: auto;
    padding-bottom: 1px;
    scrollbar-width: none;
  }

  .demo-experience .agent-prompt-rail::-webkit-scrollbar {
    display: none;
  }

  .demo-experience .agent-prompt-compact {
    flex: 0 0 205px;
    min-height: 40px;
  }

  .demo-experience .owner-message {
    width: 92%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo-experience,
  .agent-sidebar-new,
  .demo-experience-back,
  .demo-experience .agent-starter-grid button {
    transition: none !important;
  }
}

/* Shared reset control stays available when the desktop rail is collapsed. */
.agent-topbar-reset {
  display: none;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: rgba(255,255,255,.58);
  font: inherit;
  font-size: .55rem;
  font-weight: 650;
  background: rgba(255,255,255,.025);
  cursor: pointer;
}

.agent-topbar-reset:hover:not(:disabled),
.agent-topbar-reset:focus-visible:not(:disabled) {
  border-color: rgba(255,255,255,.18);
  color: #fff;
  background: rgba(255,255,255,.065);
}

.agent-topbar-reset:disabled {
  opacity: .34;
  cursor: default;
}

@media (max-width: 900px) {
  .agent-topbar-reset {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  .agent-topbar-reset {
    width: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 50%;
  }

  .agent-topbar-reset span:last-child {
    display: none;
  }
}
