#indee-launcher {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(calc(16px + var(--indee-clearance, 0px)), env(safe-area-inset-bottom));
  z-index: 65;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 48px;
  padding: 4px 13px 4px 6px;
  border: 1px solid var(--line-control, #d0d5dd);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-2);
  color: var(--ink, #101828);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

#indee-launcher img { width: 36px; height: 36px; }
#indee-launcher[hidden], #indee-panel [hidden] { display: none; }

#indee-panel {
  position: fixed;
  inset: auto max(16px, env(safe-area-inset-right)) calc(max(16px, env(safe-area-inset-bottom)) + var(--indee-keyboard, 0px)) auto;
  box-sizing: border-box;
  width: min(440px, calc(100% - 32px));
  max-width: none;
  height: min(610px, calc(var(--indee-height, 100dvh) - 32px));
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-control, #d0d5dd);
  border-radius: 16px;
  background: #fff;
  color: var(--ink, #101828);
  box-shadow: var(--shadow-3);
}

#indee-panel[open] { display: flex; flex-direction: column; }
#indee-panel::backdrop { background: rgb(16 24 40 / .12); }

.indee-head, .indee-compose, .indee-status {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .85rem;
}
.indee-head { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; border-bottom: 1px solid var(--line); }
.indee-audio-controls { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: .35rem; }
.indee-audio-controls[hidden] { display: none; }
.indee-head h2 { font: inherit; font-weight: 750; }
.indee-head h2, .indee-head p, .indee-scroll p, .indee-status p { margin: 0; }
.indee-head p, .indee-status, .indee-footer { color: var(--muted); font-size: .8rem; }
.indee-controls { margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: 2px; }
.indee-avatar { position: relative; width: 56px; height: 52px; flex: 0 0 56px; display: grid; place-items: center; }
.indee-avatar canvas { position: absolute; inset: 0; }
.indee-avatar.has-avatar img { visibility: hidden; }
.indee-scroll { flex: 1; min-height: 0; padding: .9rem; overflow-y: auto; overscroll-behavior: contain; }
.indee-intro { color: var(--muted); font-size: .9rem; }
.indee-starters { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.indee-log { display: grid; gap: .7rem; margin-top: .8rem; }
.indee-turn, .indee-preview { padding: .7rem .85rem; border-radius: 12px; overflow-wrap: anywhere; font-size: .9rem; }
.indee-turn p, .indee-preview { white-space: pre-wrap; }
.indee-guide, .indee-preview { background: var(--surface-subtle); margin-right: .7rem; }
.indee-preview { margin-top: .65rem !important; }
.indee-user { justify-self: end; max-width: 88%; color: #fff; background: var(--action); }
.indee-links { list-style: none; padding: 0; margin: .65rem 0 0; display: grid; gap: .35rem; }
.indee-links a {
  display: block; padding: .42rem .55rem; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: #143fbd; font-weight: 650; text-decoration: none;
}
.indee-links a span { text-decoration: underline; text-underline-offset: 2px; }
.indee-links small { display: block; color: var(--muted); font-weight: 400; }
#indee-panel button {
  font: inherit; font-size: .79rem; font-weight: 650; color: var(--ink-2); background: #fff;
  border: 1px solid var(--line-control); border-radius: 8px; padding: .35rem .55rem; min-height: 36px; cursor: pointer;
}
#indee-panel button:disabled { opacity: .55; cursor: default; }
#indee-panel .indee-controls button, #indee-panel button.indee-read, #indee-panel footer button { border-color: transparent; }
#indee-panel .indee-controls button[data-indee-close] { font-size: 1.45rem; padding: 0 .65rem; }
#indee-panel button.indee-read { display: block; margin-top: .3rem; }
#indee-panel button[data-indee-ask] { background: var(--action); color: white; border-color: var(--action); }
#indee-panel button[aria-pressed="true"] { background: var(--surface-muted); }
#indee-panel :focus-visible, #indee-launcher:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.indee-status { justify-content: space-between; padding-block: .2rem; }
.indee-status:has(p:empty):not(:has(button:not([hidden]))) { display: none; }
.indee-compose { align-items: end; border-top: 1px solid var(--line); }
.indee-compose textarea {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  min-height: 44px;
  max-height: 100px;
  resize: vertical;
  padding: .45rem .6rem;
  font-family: inherit;
  font-size: 16px;
  border: 1px solid var(--line-control);
  border-radius: 8px;
}
#indee-panel .indee-compose button { min-height: 44px; }
.indee-footer { padding: 0 .85rem .55rem; line-height: 1.35; }
#indee-panel footer button { min-height: 28px; padding: 0 .3rem; color: #143fbd; }
.indee-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 550px) {
  #indee-panel {
    inset: auto 0 var(--indee-keyboard, 0px);
    border-radius: 16px 16px 0 0;
    height: min(650px, calc(var(--indee-height, 100dvh) - max(8px, env(safe-area-inset-top))));
    width: 100%;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .indee-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; }
  .indee-avatar { width: 44px; height: 44px; }
  .indee-avatar img { width: 44px; height: 44px; }
  .indee-controls { flex-wrap: nowrap; }
  .indee-audio-controls { grid-column: 1 / -1; }
  #indee-panel .indee-controls button, #indee-panel .indee-audio-controls button { min-height: 44px; white-space: nowrap; }
}
@media print {
  #indee-launcher, #indee-panel { display: none !important; }
}

.indee-evidence {
  min-width: 0;
  display: grid;
  gap: .65rem;
  padding: .7rem;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--action);
  border-radius: 9px;
  background: #fff;
}
.indee-evidence h3 { margin: 0; font-size: 1rem; line-height: 1.3; }
.indee-evidence-table { min-width: 0; overflow-x: auto; }
.indee-evidence table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: .77rem;
  text-align: left;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.indee-evidence th, .indee-evidence td { padding: .4rem; border: 1px solid var(--line); vertical-align: top; }
.indee-evidence th[scope="col"] { background: var(--surface-subtle); }
.indee-evidence th[scope="row"] { font-weight: 650; }
.indee-evidence[data-evidence-id="pilot-trace"] thead th:first-child { width: 24%; }
.indee-evidence[data-evidence-id="api-comparison"] thead th:first-child { width: 38%; }
.indee-evidence[data-evidence-id="api-comparison"] thead th:nth-child(2) { width: 16%; white-space: nowrap; }
.indee-evidence[data-evidence-id="tera-modules"] thead th:last-child { width: 42%; }
.indee-evidence-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.indee-evidence-controls span, .indee-evidence-provenance { color: var(--muted); font-size: .75rem; }
.indee-evidence details { min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 0 .5rem; }
.indee-evidence summary { min-height: 36px; padding-block: .42rem; color: #143fbd; font-weight: 650; cursor: pointer; }
.indee-evidence pre { margin: 0 0 .5rem; padding: .5rem; background: var(--surface-subtle); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .73rem; }

.indee-workspace { margin-block: .65rem; padding: .7rem; border: 1px solid var(--line); border-radius: .6rem; }
.indee-workspace h3, .indee-workspace p, .indee-workspace details { margin-block: .2rem .55rem; }
.indee-workspace button { margin: .15rem .35rem .15rem 0; }
.indee-attachment { padding: .25rem .85rem; display: flex; align-items: center; gap: .5rem; font-size: .8rem; }
.indee-attachment[hidden] { display: none; }
.indee-workspace textarea { display: block; width: 100%; min-height: 5rem; margin-block: .4rem; font: inherit; }

.indee-workspace fieldset { min-width: 0; margin: .6rem 0; padding: .5rem; border: 1px solid var(--line); }
.indee-workspace fieldset button { display: block; text-align: left; }
