/* Ravi v38 (6e33a2d): the app shell, composer and artefact tab adapted to the landing walkthrough. */
@font-face {
  font-family: "Instrument Sans";
  src: url("assets/instrument-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("assets/instrument-serif-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

#demo-workspace.ravi-v38-demo {
  --v38-font: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --v38-home-font: "Instrument Sans", Arial, sans-serif;
  --v38-ink: #1b2d27;
  --v38-ink-secondary: #385348;
  --v38-ink-muted: #506257;
  --v38-icon: #556f62;
  --v38-side: var(--v30-soft);
  --v38-rule: #dce8df;
  --v38-line: #d0dfd6;
  --v38-raised: #f0f6f2;
  --v38-active: #d8e9df;
  --v38-accent: var(--v30-green);
  --v38-accent-ink: var(--v30-green-hover);
  --v38-accent-soft: var(--v30-green-soft);
  --v38-accent-line: var(--v32-accent-line);
  --v38-head-height: 48px;
  --v38-pane-width: 0px;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--v38-line);
  border-radius: 16px;
  background: white;
  color: var(--v38-ink);
  font: 400 14px/1.5 var(--v38-font);
  text-align: left;
  filter: none;
  box-shadow: 0 18px 50px #1617191c;

  &[data-demo-stage="1"] { --v38-pane-width: 238px; }
  &[data-demo-stage="2"] { --v38-pane-width: 308px; }
  &[data-demo-stage="3"] { --v38-pane-width: min(48%, 440px); }

  & .product-surface {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    height: 100%;
    border: 0;
    border-radius: 0;
  }

  /* Sidebar and workspace switcher from Ravi's v38 shell. */
  & .product-history {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: var(--v38-side);
    border-right: 1px solid var(--v38-rule);
    color: var(--v38-ink);
    font-family: var(--v38-font);
  }
  & .product-history-head {
    min-height: 0;
    height: 54px;
    padding: 12px 10px 8px;
    border: 0;
  }
  & .v38-workspace-brand,
  & .v38-side-link,
  & .v38-side-actions button,
  & .v38-side-foot {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  & .v38-workspace-brand { padding-left: 5px; gap: 9px; }
  & .v38-workspace-brand strong { font-size: 14px; font-weight: 700; }
  & .v38-mark {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: var(--v38-accent);
  }
  & .v38-mark img { display: block; object-fit: contain; filter: brightness(0) invert(1); }
  & .product-history-head button {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--v38-icon);
    display: grid;
    place-items: center;
  }
  & .product-history-head button svg { width: 16px; height: 16px; }
  & .v38-side-actions { display: flex; gap: 6px; padding: 4px 10px 12px; }
  & .v38-side-actions button {
    min-height: 34px;
    border: 1px solid var(--v38-line);
    border-radius: 8px;
    padding: 0 10px;
    background: white;
    color: var(--v38-ink);
    font: 500 14px/1 var(--v38-font);
  }
  & .v38-side-actions button:first-child {
    flex: 1;
    border-color: var(--v38-accent);
    background: var(--v38-accent);
    color: white;
  }
  & .v38-side-actions button:first-child svg { color: inherit; }
  & #product-search-toggle { flex: none; width: 34px; justify-content: center; padding: 0; }
  & .v38-side-nav { padding: 0 10px; }
  & .v38-side-link {
    min-height: 32px;
    margin-bottom: 2px;
    padding: 0 8px;
    border-radius: 8px;
    color: var(--v38-ink-secondary);
  }
  & :is(.v38-side-link, .v38-side-actions, .v38-side-foot, .v38-workspace-brand) svg {
    flex: none;
    color: var(--v38-icon);
  }
  & .product-history-body {
    flex: 1;
    width: 100%;
    min-height: 0;
    padding: 22px 10px 10px;
  }
  & .product-history-body h3 {
    margin: 0;
    padding: 0 8px;
    color: var(--v38-ink-muted);
    font: 400 12px/28px var(--v38-font);
    letter-spacing: 0;
    text-transform: none;
  }
  & .example-choices { gap: 2px; }
  & :is(.example-choices button, .product-project) {
    min-height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    font: 400 14px/1.4 var(--v38-font);
    color: var(--v38-ink-secondary);
  }
  & .example-choices button[aria-pressed="true"] {
    background: var(--v38-active);
    color: var(--v38-accent-ink);
    font-weight: 400;
  }
  & .product-project-heading { margin-top: 20px; }
  & .product-project-heading > span { padding-right: 8px; color: var(--v38-icon); }
  & .product-project > svg { width: 16px; height: 16px; }
  & .v38-side-foot {
    margin-top: auto;
    min-height: 46px;
    padding: 0 18px;
    border-top: 1px solid var(--v38-rule);
    color: var(--v38-ink-secondary);
  }
  & .v38-side-foot small { margin-left: auto; color: var(--v38-ink-muted); font-size: 12px; }

  /* One 48px bar for the conversation and the open panel. */
  & .screen-main {
    grid-template-rows: var(--v38-head-height) minmax(0, 1fr);
    min-width: 0;
    padding: 0;
  }
  & .product-thread-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--v38-pane-width);
    height: var(--v38-head-height);
    min-height: var(--v38-head-height);
    padding: 0;
    gap: 0;
    overflow: hidden;
    border-bottom: 1px solid var(--v38-rule);
  }
  & :is(.v38-convo-head, .v38-panel-head, .v38-artifact-tab, .v38-panel-actions, .v38-project-crumb) {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  & .v38-convo-head { height: 100%; padding: 0 8px 0 16px; gap: 6px; }
  & .v38-project-crumb { flex: 0 1 auto; max-width: 34%; color: var(--v38-ink-muted); white-space: nowrap; font-size: 13px; }
  & :is(.v38-project-crumb > span, .product-thread-title h2, .v38-artifact-tab strong) {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  & .v38-project-crumb svg { flex: none; }
  & .v38-crumb-separator { color: var(--v38-icon); }
  & .product-thread-bar #demo-role { font: 700 14.5px/1.4 var(--v38-font); letter-spacing: 0; }
  & .product-thread-title > span[hidden] { display: none; }
  & .product-thread-bar .product-sidebar-button { display: none; }
  & #product-copy-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: none;
    width: auto;
    height: 32px;
    padding: 0 9px;
    border: 0;
    background: transparent;
    color: var(--v38-ink-secondary);
    font: 500 12.5px/1 var(--v38-font);
  }
  & .v38-header-icon { display: inline-grid; flex: none; place-items: center; width: 28px; height: 32px; color: var(--v38-icon); }
  & .v38-panel-head {
    display: none;
    height: 100%;
    justify-content: space-between;
    padding: 0 8px 0 12px;
    border-left: 1px solid var(--v38-line);
    background: var(--v38-side);
    font: 700 13px/1.4 var(--v38-font);
  }
  &[data-demo-stage="1"] [data-v38-panel="process"],
  &[data-demo-stage="2"] [data-v38-panel="source"],
  &[data-demo-stage="3"] [data-v38-panel="draft"] { display: flex; }
  & .v38-panel-head strong > span { color: var(--v38-ink-muted); font-weight: 400; }
  & [data-v38-panel="draft"] { padding-left: 0; }
  & .v38-artifact-tab {
    height: 100%;
    align-self: stretch;
    padding: 0 12px;
    border-right: 1px solid var(--v38-line);
    border-radius: 0 8px 0 0;
    background: white;
  }
  & .v38-artifact-tab b { color: var(--v38-accent); font-size: 12px; }
  & .v38-panel-actions { flex: none; gap: 15px; padding: 0 4px; color: var(--v38-icon); }

  /* The first beat uses the v38 home surface before switching to chat. */
  &:has(.case-story[data-case-stage="0"][data-case-sent="false"]) {
    & .screen-main { grid-template-rows: 0 minmax(0, 1fr); }
    & .product-thread-bar { visibility: hidden; }
    & [data-v38-home] { background: var(--v38-active); color: var(--v38-accent-ink); }
    & [data-v38-home] svg { color: inherit; }
    & .example-choices button[aria-pressed="true"] { background: transparent; color: var(--v38-ink-secondary); }
    & .case-brief { justify-content: flex-start; padding: 108px 32px 24px; }
    & .case-chat-scroll { max-height: none; }
    & .case-reading-column { padding: 0; }
    & .case-welcome { gap: 14px; padding: 0 0 38px; }
    & .case-composer-dock { font-family: var(--v38-home-font); }
    & .case-composer-placeholder { min-height: 56px; font-size: 17px; }
  }
  & .case-welcome h3 {
    order: 0;
    font: 400 46px/1.08 "Instrument Serif", Georgia, serif;
    letter-spacing: -.012em;
    text-wrap: balance;
    color: var(--v38-ink);
  }
  & .case-welcome p { order: 1; font: 400 16px/1.5 var(--v38-home-font); color: var(--v38-ink-muted); }

  /* Composer stays on the same 720px reading column. */
  & .case-composer-dock { padding: 8px 24px 14px; }
  & .case-composer-box {
    display: grid;
    gap: 6px;
    max-width: 720px;
    padding: 18px 14px 12px 20px;
    border-color: var(--v38-line);
    border-radius: 24px;
    background: white;
    box-shadow: 0 1px 2px #1617190a, 0 10px 32px #16171912;
  }
  & .case-composer-placeholder {
    min-height: 32px;
    padding: 2px 6px 0 0;
    color: var(--v38-ink-muted);
    font-family: inherit;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
  }
  & .case-brief .case-composer-placeholder { color: var(--v38-ink-muted); }
  & .case-story:is([data-hero-beat="typing"], [data-hero-beat="ready-to-send"]) .case-brief .case-composer-box {
    border-color: var(--v38-accent-line);
    box-shadow: 0 1px 2px #1617190d, 0 14px 40px #16171917;
  }
  & .case-story:is([data-hero-beat="typing"], [data-hero-beat="ready-to-send"]) #case-typed-prompt { color: var(--v38-ink); }
  & .case-compose-files {
    max-width: 720px;
    margin: 0 auto 8px;
    padding: 8px 10px;
    border-radius: 16px;
    background: var(--v38-raised);
  }
  & .case-compose-files:not(:has([data-ready="true"])),
  & .case-compose-files [data-ready="false"] { display: none; }
  & .case-compose-files > span {
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid var(--v38-line);
    border-radius: 8px;
    background: white;
    color: var(--v38-ink-secondary);
    font: 400 12.5px/1.3 var(--v38-home-font);
  }
  & .case-compose-files > span i { color: var(--v38-accent); }
  & .case-composer-tools { height: 40px; gap: 4px; margin-left: -8px; }
  & .case-tool-visual { width: 36px; height: 36px; color: var(--v38-ink-secondary); }
  & .case-tool-visual svg { width: 19px; height: 19px; }
  & .case-alur-visual {
    height: 36px;
    padding: 0 12px;
    gap: 6px;
    color: var(--v38-ink-muted);
    font: 500 14px/1.4 var(--v38-home-font);
  }
  & .case-analysis .case-alur-visual { font: 400 13.5px/1.4 var(--v38-font); }
  & .case-send-visual {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--v38-rule);
    color: var(--v38-ink-muted);
  }
  & .case-send-visual svg { width: 19px; height: 19px; }
  & .case-story:is([data-hero-beat="typing"], [data-hero-beat="ready-to-send"]) .case-brief .case-send-visual {
    background: var(--v38-accent);
    color: white;
  }
  & .case-quick-actions { margin-top: 34px; gap: 23px; }
  & .case-quick-actions > div { display: grid; justify-items: center; gap: 9px; width: 91px; text-align: center; }
  & .case-quick-actions i {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 1px solid var(--v38-line);
    border-radius: 50%;
    background: var(--v38-accent-soft);
    color: var(--v38-accent-ink);
  }
  & .case-quick-actions span { padding: 0; border: 0; color: var(--v38-ink); font-size: 13px; }

  /* All four authored beats use the updated reading and document surfaces. */
  & .case-story[data-case-stage] .case-scene-grid {
    grid-template-columns: minmax(0, 1fr) var(--v38-pane-width);
  }
  & .case-reading-column { max-width: 720px; padding: 20px 24px 24px; }
  & .case-user-bubble { padding: 11px 17px; background: var(--v38-raised); border-radius: 20px; }
  & .case-user-bubble p { font: 400 15px/1.6 var(--v38-font); color: var(--v38-ink); }
  & .case-native-assistant { font: 400 14px/1.4 var(--v38-font); }
  & .case-native-assistant .v38-mark { width: 20px; height: 20px; margin: 0; border-radius: 5px; }
  & .case-native-assistant img { width: 14px; height: 14px; }
  & .case-native-assistant strong { font-weight: 700; }
  & .case-native-assistant > span[data-case-assistant-state] { font-size: 12.5px; color: var(--v38-ink-muted); }
  & :is(.case-process-line, .case-file-card, .case-source-reference strong) { font-family: var(--v38-font); }
  & .case-analysis-text,
  & :is(.case-assistant-message li, .case-source-result) { font: 400 15px/1.65 var(--v38-font); }
  & .case-assistant-message h3 { font: 700 17px/1.4 var(--v38-font); }
  & .case-citation {
    min-width: 19px;
    min-height: 19px;
    border: 0;
    border-radius: 5px;
    background: var(--v38-accent-soft);
    color: var(--v38-accent);
    font: 400 11px/1 var(--v38-font);
  }
  & :is(.case-process-pane, .case-pustaka, .case-memo) {
    position: static;
    width: auto;
    min-width: 0;
    border-left: 1px solid var(--v38-line);
    background: var(--v38-side);
  }
  & :is(.case-pane-tabs, .case-canvas-header) { display: none; }
  & .case-source-list { padding: 14px; }
  & .case-source-list > li { border-color: var(--v38-line); }
  & .case-source-list > li.case-source-highlight { background: var(--v38-accent-soft); border-color: var(--v38-accent-line); }
  & .case-status-badge { background: var(--v38-accent-soft); color: var(--v38-accent-ink); }
  & .case-master-card { border-color: var(--v38-line); background: white; }
  & .v38-artifact-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; }
  & .v38-artifact-thumb {
    display: grid;
    place-items: center;
    flex: none;
    width: 65px;
    height: 52px;
    border-radius: 8px;
    background: var(--v38-raised);
  }
  & .v38-artifact-thumb i {
    display: grid;
    place-items: center;
    width: 30px;
    height: 40px;
    border: 1px solid var(--v38-line);
    border-radius: 2px;
    background: white;
  }
  & .v38-artifact-thumb i::after {
    content: "";
    width: 16px;
    height: 17px;
    background: repeating-linear-gradient(var(--v38-line) 0 1px, transparent 1px 4px);
  }
  & .v38-artifact-info { flex: 1; min-width: 0; }
  & .v38-artifact-info h3 { font: 700 14px/1.4 var(--v38-font); }
  & .v38-artifact-info > span { color: var(--v38-ink-muted); font-size: 12.5px; }
  & .v38-artifact-open {
    display: inline-flex;
    align-items: center;
    flex: none;
    gap: 4px;
    height: 32px;
    padding: 0 9px 0 12px;
    border: 1px solid var(--v38-accent-line);
    border-radius: 999px;
    color: var(--v38-accent-ink);
    font-size: 12.5px;
  }
  & .case-paper-tray { background: var(--v38-side); padding: 16px; }
  & .case-memo-paper {
    padding: 33px 24px;
    border: 1px solid var(--v38-line);
    border-radius: 5px;
    background: white;
    font-family: Georgia, "Times New Roman", serif;
    box-shadow: 0 1px 2px #1617190a;
  }
  & .case-memo-paper h2 { color: var(--v38-ink); font: 700 20px/1.28 Georgia, serif; }
  & .case-memo-paper section p { font: 400 13px/1.56 Georgia, serif; color: var(--v38-ink); }
}
