/* ===== Ascend · Oracle LLM wiki ===== */

:root {
  --gold: #ffcf8f;
  --gold-strong: #ffb567;
  --ink: #1c1128;
  --user-bubble: #241a33;
  --user-bubble-text: #fdf6ec;
  --bot-bubble: rgba(255, 250, 242, 0.94);
  --bot-bubble-text: #2a2033;
  --card-bg: rgba(20, 12, 28, 0.55);
  --card-border: rgba(255, 235, 200, 0.18);
  --pane-bg: rgba(12, 7, 20, 0.35);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --error: #ff8f8f;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family:
    'Segoe UI',
    -apple-system,
    BlinkMacSystemFont,
    'Helvetica Neue',
    Arial,
    sans-serif;
  background: #140b2b url('assets/ascend-bg.svg') center center / cover
    no-repeat fixed;
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

.shell {
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: none;
  border-radius: 0;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: none;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 235, 200, 0.14);
  flex: 0 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.auth-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  flex: 0 0 auto;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-strong) 100%);
  color: #2a1710;
  flex: 0 0 auto;
  box-shadow: 0 4px 14px rgba(255, 181, 103, 0.35);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.brand-name {
  font-weight: 700;
  font-size: 16px;
  color: #fff6e8;
  letter-spacing: 0.2px;
}

.brand-sub {
  font-size: 12px;
  color: rgba(255, 246, 232, 0.58);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-status {
  font-size: 12px;
  color: rgba(255, 246, 232, 0.65);
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6be3a0;
  box-shadow: 0 0 0 3px rgba(107, 227, 160, 0.2);
  display: inline-block;
}

.brand-status--busy .status-dot {
  background: var(--gold-strong);
  box-shadow: 0 0 0 3px rgba(255, 181, 103, 0.25);
  animation: pulse 1.2s ease-in-out infinite;
}

.brand-status--error .status-dot {
  background: var(--error);
  box-shadow: 0 0 0 3px rgba(255, 143, 143, 0.25);
  animation: none;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.8fr);
  gap: 0;
}

/* ---------- Wiki pane ---------- */

.wiki-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  border-right: 1px solid rgba(255, 235, 200, 0.14);
  background: var(--pane-bg);
}

.wiki-toolbar {
  grid-column: 1 / 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 235, 200, 0.1);
}

.wiki-search {
  width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 235, 200, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff6e8;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.wiki-search::placeholder {
  color: rgba(255, 246, 232, 0.45);
}

.wiki-search:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 181, 103, 0.18);
}

.wiki-lint {
  width: 100%;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 235, 200, 0.28);
  background: rgba(255, 207, 143, 0.12);
  color: #fff6e8;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.wiki-lint:hover:not(:disabled) {
  background: rgba(255, 207, 143, 0.22);
  border-color: var(--gold);
}

.wiki-lint:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.wiki-nav {
  grid-column: 1 / 2;
  grid-row: 2;
  overflow-y: auto;
  padding: 8px 10px 16px;
  font-size: 13px;
}

.wiki-nav details {
  margin-bottom: 4px;
}

.wiki-nav summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: rgba(255, 246, 232, 0.75);
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 8px;
  list-style: none;
}

.wiki-nav__folder-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.wiki-nav summary.wiki-nav__folder--active {
  background: rgba(255, 207, 143, 0.18);
  color: #fff6e8;
}

.wiki-nav summary::-webkit-details-marker {
  display: none;
}

.wiki-nav summary::before {
  content: '▸';
  display: inline-block;
  width: 1em;
  color: var(--gold);
  transition: transform 0.12s ease;
}

.wiki-nav details[open] > summary::before {
  transform: rotate(90deg);
}

.wiki-nav__group {
  padding-left: 10px;
  border-left: 1px solid rgba(255, 235, 200, 0.12);
  margin-left: 6px;
}

.wiki-nav__item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: rgba(255, 246, 232, 0.82);
  padding: 6px 8px;
  border-radius: 8px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  overflow: hidden;
}

.wiki-nav__item-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.wiki-nav__item:hover {
  background: rgba(255, 207, 143, 0.1);
}

.wiki-nav__item--active {
  background: rgba(255, 207, 143, 0.18);
  color: #fff6e8;
  font-weight: 600;
}

.wiki-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(255, 181, 103, 0.22);
  color: var(--gold);
  border: 1px solid rgba(255, 181, 103, 0.35);
}

.wiki-article__header {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 235, 200, 0.14);
}

.wiki-article__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}

.wiki-article__header h2 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.25;
  color: #fff6e8;
}

.wiki-article__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.wiki-publish,
.wiki-action {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 235, 200, 0.28);
  background: rgba(107, 227, 160, 0.16);
  color: #b8f5d0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.wiki-action {
  background: rgba(255, 207, 143, 0.12);
  color: #fff6e8;
}

.wiki-action--muted {
  background: rgba(255, 246, 232, 0.06);
  color: rgba(255, 246, 232, 0.75);
}

.wiki-action--danger {
  background: rgba(255, 143, 143, 0.12);
  color: #ffb0b0;
  border-color: rgba(255, 143, 143, 0.35);
}

.wiki-publish:hover:not(:disabled),
.wiki-action:hover:not(:disabled) {
  background: rgba(107, 227, 160, 0.28);
}

.wiki-action:hover:not(:disabled) {
  background: rgba(255, 207, 143, 0.22);
  border-color: var(--gold);
}

.wiki-action--danger:hover:not(:disabled) {
  background: rgba(255, 143, 143, 0.22);
}

.wiki-publish:disabled,
.wiki-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wiki-nav__root {
  margin-bottom: 8px;
  font-weight: 600;
  color: rgba(255, 246, 232, 0.9);
}

.wiki-name-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 235, 200, 0.2);
  background: rgba(255, 250, 242, 0.05);
}

.wiki-name-form__label {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 246, 232, 0.85);
}

.wiki-name-form__input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 235, 200, 0.24);
  background: rgba(12, 7, 20, 0.55);
  color: #fff6e8;
  font: inherit;
  font-size: 13px;
}

.wiki-name-form__input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 181, 103, 0.18);
}

.wiki-name-form__error {
  margin: 0;
  font-size: 12.5px;
  color: var(--error);
}

.wiki-name-form__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wiki-editor {
  display: block;
  width: 100%;
  min-height: min(60vh, 560px);
  flex: 1;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 235, 200, 0.22);
  background: rgba(12, 7, 20, 0.72);
  color: #fff6e8;
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  tab-size: 2;
}

.wiki-editor:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 181, 103, 0.18);
}

.wiki-article__meta {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 246, 232, 0.55);
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
}

.wiki-article__desc {
  margin: 10px 0 0;
  font-size: 14px;
  color: rgba(255, 246, 232, 0.78);
  line-height: 1.45;
}

.wiki-article {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  overflow-y: auto;
  padding: 20px 24px 32px;
  color: #fff6e8;
  background: rgba(255, 250, 242, 0.04);
}

.wiki-article__body {
  font-size: 14.5px;
  line-height: 1.55;
  color: rgba(255, 246, 232, 0.92);
}

.wiki-article__body p {
  margin: 0 0 12px;
}

.wiki-article__body h1,
.wiki-article__body h2,
.wiki-article__body h3,
.wiki-article__body h4,
.wiki-article__body h5,
.wiki-article__body h6 {
  margin: 1.2em 0 0.5em;
  line-height: 1.3;
  color: #fff6e8;
}

.wiki-article__body h1 {
  font-size: 1.35em;
}
.wiki-article__body h2 {
  font-size: 1.2em;
}
.wiki-article__body h3 {
  font-size: 1.08em;
}

.wiki-article__body ul,
.wiki-article__body ol {
  margin: 0 0 12px;
  padding-left: 1.35em;
}

.md-table-wrap {
  overflow-x: auto;
  margin: 0 0 12px;
  max-width: 100%;
}

.wiki-article__body table,
.bubble table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

.wiki-article__body th,
.wiki-article__body td,
.bubble th,
.bubble td {
  padding: 8px 10px;
  border: 1px solid rgba(255, 235, 200, 0.16);
  text-align: left;
  vertical-align: top;
}

.wiki-article__body th {
  background: rgba(255, 207, 143, 0.14);
  color: #fff6e8;
  font-weight: 600;
}

.wiki-article__body td {
  background: rgba(8, 4, 16, 0.28);
}

.wiki-article__body tbody tr:nth-child(even) td {
  background: rgba(8, 4, 16, 0.42);
}

.wiki-article__body th code,
.wiki-article__body td code {
  white-space: nowrap;
}

.wiki-article__body li {
  margin-bottom: 4px;
}

.wiki-article__body pre {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(8, 4, 16, 0.55);
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.4;
}

.wiki-article__body code {
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.wiki-article__body :not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: rgba(255, 207, 143, 0.12);
}

.wiki-article__body a,
.wiki-cite,
.wiki-cite-code,
.wiki-fn {
  color: var(--gold);
  cursor: pointer;
}

.wiki-article__body a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wiki-cite {
  display: inline;
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wiki-cite-code {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wiki-fn {
  display: inline;
  border: none;
  background: transparent;
  padding: 0 0.1em;
  margin: 0;
  font: inherit;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  vertical-align: super;
  color: var(--gold);
  cursor: pointer;
}

.wiki-fn--static {
  cursor: help;
}

.wiki-fn:hover,
.wiki-fn:focus-visible {
  color: var(--gold-strong, #ffb567);
  outline: none;
}

.wiki-sources {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 235, 200, 0.16);
}

.wiki-sources__title {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 246, 232, 0.82);
}

.wiki-sources__list {
  margin: 0;
  padding-left: 1.25rem;
  color: rgba(255, 246, 232, 0.72);
  font-size: 0.85rem;
  line-height: 1.45;
}

.wiki-sources__list li + li {
  margin-top: 0.35rem;
}

.wiki-sources__label {
  color: rgba(255, 246, 232, 0.9);
}

.wiki-sources__list code {
  font-size: 0.8em;
  color: rgba(255, 207, 143, 0.92);
}

.wiki-sources__list a {
  color: var(--gold);
}

.wiki-empty {
  margin: 16px;
  color: rgba(255, 246, 232, 0.55);
  font-size: 13px;
}

/* ---------- Chat pane ---------- */

.chat-pane {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(12, 7, 20, 0.28);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 235, 200, 0.14);
  flex: 0 0 auto;
}

.chat-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff6e8;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.chat-action {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 235, 200, 0.28);
  background: rgba(255, 207, 143, 0.12);
  color: #fff6e8;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chat-action:hover:not(:disabled) {
  background: rgba(255, 207, 143, 0.22);
  border-color: var(--gold);
}

.chat-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chat-action[aria-expanded='true'] {
  background: rgba(255, 207, 143, 0.28);
  border-color: var(--gold);
}

.chat-history {
  flex: 0 0 auto;
  max-height: 220px;
  overflow-y: auto;
  border-bottom: 1px solid rgba(255, 235, 200, 0.14);
  background: rgba(8, 4, 14, 0.45);
  padding: 8px 10px 10px;
}

.chat-history__empty {
  margin: 8px 6px;
  color: rgba(255, 246, 232, 0.55);
  font-size: 12.5px;
}

.chat-history__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-history__item {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #fff6e8;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-history__item:hover {
  background: rgba(255, 207, 143, 0.12);
  border-color: rgba(255, 235, 200, 0.18);
}

.chat-history__item[aria-current='true'] {
  background: rgba(255, 207, 143, 0.18);
  border-color: rgba(255, 181, 103, 0.45);
}

.chat-history__item-title {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-history__item-meta {
  font-size: 11px;
  color: rgba(255, 246, 232, 0.55);
}

.chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-messages::-webkit-scrollbar,
.wiki-nav::-webkit-scrollbar,
.wiki-article::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-thumb,
.wiki-nav::-webkit-scrollbar-thumb,
.wiki-article::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}

.msg-row--user {
  justify-content: flex-start;
}

.msg-row--bot {
  justify-content: flex-end;
}

.avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.avatar svg {
  width: 16px;
  height: 16px;
}

.avatar--user {
  background: linear-gradient(160deg, #3a2a4d, #201526);
  color: #ffd9a6;
}

.avatar--bot {
  background: linear-gradient(160deg, var(--gold), var(--gold-strong));
  color: #2a1710;
}

.bubble {
  max-width: 86%;
  min-width: 0;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.48;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-shadow: 0 6px 18px rgba(10, 5, 20, 0.18);
}

.bubble p {
  margin: 0 0 8px;
}

.bubble p:last-child {
  margin-bottom: 0;
}

.bubble h1,
.bubble h2,
.bubble h3,
.bubble h4,
.bubble h5,
.bubble h6 {
  margin: 0 0 8px;
  font-size: 1em;
  line-height: 1.35;
  color: inherit;
}

.bubble ol,
.bubble ul {
  margin: 0 0 8px;
  padding-left: 20px;
}

.bubble .md-table-wrap {
  margin-bottom: 8px;
}

.bubble th,
.bubble td {
  border-color: rgba(28, 17, 40, 0.14);
}

.bubble th {
  background: rgba(28, 17, 40, 0.1);
  font-weight: 600;
}

.bubble pre {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(28, 17, 40, 0.08);
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.4;
}

.bubble code {
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.bubble :not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: rgba(28, 17, 40, 0.08);
}

.bubble a,
.bubble .wiki-cite {
  color: #a5622f;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bubble--user {
  background: var(--user-bubble);
  color: var(--user-bubble-text);
  border-bottom-left-radius: 6px;
  white-space: pre-wrap;
}

.bubble--bot {
  background: var(--bot-bubble);
  color: var(--bot-bubble-text);
  border-bottom-right-radius: 6px;
}

.bubble--streaming::after {
  content: '▍';
  display: inline-block;
  width: 0.5em;
  margin-left: 1px;
  animation: blink 0.9s step-end infinite;
  color: #a5622f;
}

.chat-thinking,
.chat-tools {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(42, 32, 51, 0.72);
}

.chat-thinking summary,
.chat-tool__detail summary {
  cursor: pointer;
  font-weight: 600;
  color: rgba(42, 32, 51, 0.78);
  list-style: none;
}

.chat-thinking summary::-webkit-details-marker,
.chat-tool__detail summary::-webkit-details-marker {
  display: none;
}

.chat-thinking summary::before,
.chat-tool__detail summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.12s ease;
}

.chat-thinking[open] summary::before,
.chat-tool__detail[open] summary::before {
  transform: rotate(90deg);
}

.chat-thinking__body,
.chat-tool__args,
.chat-tool__detail-body {
  margin: 6px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(28, 17, 40, 0.06);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 11.5px;
  max-height: 160px;
  overflow-y: auto;
}

.chat-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-tool {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(28, 17, 40, 0.05);
  border: 1px solid rgba(28, 17, 40, 0.08);
}

.chat-tool__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-tool__name {
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: #5a3d28;
}

.chat-tool__phase {
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(42, 32, 51, 0.55);
}

.chat-tool[data-phase='running'] .chat-tool__phase {
  color: #a5622f;
}

.chat-tool[data-phase='done'] .chat-tool__phase {
  color: #3d6b4f;
}

.chat-tool[data-phase='error'] .chat-tool__phase {
  color: #a33a3a;
}

.chat-tool__args {
  margin-top: 6px;
  max-height: 72px;
}

.chat-tool__detail {
  margin-top: 6px;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.msg-error {
  align-self: stretch;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 80, 80, 0.12);
  border: 1px solid rgba(255, 143, 143, 0.35);
  color: var(--error);
  font-size: 13px;
  line-height: 1.4;
}

.chat-input {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 235, 200, 0.14);
  background: rgba(12, 7, 20, 0.25);
}

.chat-input__field {
  flex: 1 1 auto;
  resize: none;
  max-height: 122px;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 235, 200, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 14.5px;
  font-family: inherit;
  line-height: 20px;
  outline: none;
  color-scheme: light;
  overflow-y: hidden;
}

.chat-input__field--scrollable {
  overflow-y: auto;
}

.chat-input__field::placeholder {
  color: #8a7f94;
}

.chat-input__field:focus {
  border-color: var(--gold-strong);
  box-shadow: 0 0 0 3px rgba(255, 181, 103, 0.22);
}

.chat-input__field:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.chat-input__send {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--gold), var(--gold-strong));
  color: #2a1710;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(255, 181, 103, 0.4);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    opacity 0.12s ease;
}

.chat-input__send:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255, 181, 103, 0.5);
}

.chat-input__send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.chat-input__send svg {
  width: 18px;
  height: 18px;
}

.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;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(280px, 42%);
  }

  .wiki-pane {
    border-right: none;
    border-bottom: 1px solid rgba(255, 235, 200, 0.14);
  }
}

@media (max-width: 640px) {
  .wiki-pane {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(120px, 32%) 1fr;
  }

  .wiki-toolbar {
    grid-column: 1;
    grid-row: 1;
  }

  .wiki-nav {
    grid-column: 1;
    grid-row: 2;
    border-bottom: 1px solid rgba(255, 235, 200, 0.1);
  }

  .wiki-article {
    grid-column: 1;
    grid-row: 3;
    padding: 16px;
  }

  .brand-sub {
    display: none;
  }
}

/* ---- Clerk auth overlay ---- */

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 7, 20, 0.72);
  backdrop-filter: blur(10px);
}

.auth-overlay[hidden] {
  display: none !important;
}

/* Caption only: Clerk renders its own sign-in modal above this backdrop. */
.auth-overlay__card {
  width: min(420px, 100%);
  text-align: center;
  color: #fdf6ec;
}

.auth-overlay__title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 650;
}

.auth-overlay__copy {
  margin: 0;
  color: rgba(253, 246, 236, 0.72);
  font-size: 0.95rem;
  line-height: 1.45;
}

.notion-connect {
  margin-right: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 235, 200, 0.22);
  background: transparent;
  color: #fdf6ec;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.notion-connect:hover {
  border-color: rgba(255, 207, 143, 0.55);
  color: #ffcf8f;
}

.notion-connect[data-connected="true"] {
  border-color: rgba(143, 220, 170, 0.45);
  color: #b6f0c8;
}

.auth-sign-out {
  margin-right: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 235, 200, 0.22);
  background: transparent;
  color: #fdf6ec;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.auth-sign-out:hover {
  border-color: rgba(255, 207, 143, 0.55);
  color: #ffcf8f;
}

/* ===== 2026 Oracle workspace redesign ===== */

:root {
  --surface: rgba(20, 12, 28, 0.55);
  --surface-soft: rgba(255, 246, 232, 0.04);
  --line: rgba(255, 235, 200, 0.18);
  --line-soft: rgba(255, 235, 200, 0.12);
  --muted: rgba(255, 246, 232, 0.55);
  --secondary: rgba(255, 246, 232, 0.78);
}

[hidden] {
  display: none !important;
}

body {
  padding: 12px;
  background:
    radial-gradient(
      ellipse 70% 30% at 50% 108%,
      rgba(255, 230, 176, 0.55),
      rgba(255, 230, 176, 0) 70%
    ),
    linear-gradient(
      180deg,
      #140b2b 0%,
      #2c1748 42%,
      #5c2c56 72%,
      #c2603f 93%,
      #f3ab5e 100%
    );
}

button,
input,
textarea {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.shell {
  height: calc(100dvh - 24px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.topbar {
  padding: 14px 20px;
  border-bottom-color: var(--line);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 16px;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  gap: 2px;
}

.brand-sub {
  line-height: 1.4;
  color: var(--muted);
}

.auth-status {
  gap: 8px;
}

.notion-connect,
.account-toggle,
.chat-action,
.wiki-lint,
.wiki-action,
.wiki-publish {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.notion-connect {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  margin: 0;
  padding: 0 14px;
  background: transparent;
  color: var(--secondary);
  font-size: 12.5px;
  font-weight: 600;
}

.notion-connect::before {
  content: '+';
  font-size: 16px;
  line-height: 1;
}

.notion-connect[data-connected='true'] {
  border-color: rgba(182, 240, 200, 0.35);
  background: rgba(107, 227, 160, 0.08);
  color: #b6f0c8;
}

.notion-connect[data-connected='true']::before {
  content: '✓';
  font-size: 13px;
}

.notion-connect:hover,
.account-toggle:hover,
.chat-action:hover:not(:disabled),
.wiki-lint:hover:not(:disabled),
.wiki-action:hover:not(:disabled) {
  border-color: var(--line);
  background: rgba(255, 235, 200, 0.12);
  color: #fff6e8;
}

.brand-status {
  height: 34px;
  padding: 0 12px;
  gap: 8px;
  color: var(--secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
}

.topbar-divider {
  width: 1px;
  height: 22px;
  background: var(--line);
}

.account {
  position: relative;
}

.account-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px 0 4px;
  background: transparent;
  color: #fff6e8;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.account-toggle[hidden] {
  display: none;
}

.account-toggle svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 120ms ease;
}

.account-toggle[aria-expanded='true'] svg {
  transform: rotate(180deg);
}

.account-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3a2a4d, #201526);
  color: #ffd9a6;
  font-size: 12px;
  font-weight: 700;
}

.account-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(24, 14, 34, 0.98);
  box-shadow: 0 14px 30px rgba(8, 4, 16, 0.36);
}

.auth-sign-out {
  width: 100%;
  margin: 0;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fdf6ec;
  text-align: left;
  font-size: 12.5px;
}

.auth-sign-out:hover {
  border-color: transparent;
  background: rgba(255, 235, 200, 0.1);
  color: #ffcf8f;
}

.workspace {
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.8fr);
}

/* Wiki */

.wiki-pane {
  grid-template-columns: 264px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  border-right-color: var(--line);
  background: rgba(12, 7, 20, 0.35);
}

.wiki-sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 12px;
  border-right: 1px solid var(--line-soft);
  overflow: hidden;
}

.wiki-search-wrap {
  position: relative;
  display: block;
  flex: 0 0 auto;
}

.wiki-search-icon {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 14px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.wiki-search {
  height: 40px;
  padding: 0 44px 0 38px;
  border-color: var(--line);
  background: rgba(255, 246, 232, 0.05);
}

.wiki-shortcut {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 400;
  pointer-events: none;
}

.wiki-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row;
  gap: 8px;
  padding: 4px 8px 0;
  border: 0;
}

.wiki-toolbar__label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wiki-lint {
  width: auto;
  min-height: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  background: transparent;
  color: var(--secondary);
  font-size: 12px;
}

.wiki-lint svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wiki-nav {
  grid-column: auto;
  grid-row: auto;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
}

.wiki-nav details {
  margin: 0;
}

.wiki-nav summary,
.wiki-nav__item {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 400;
}

.wiki-nav summary {
  gap: 6px;
}

.wiki-nav summary::before {
  width: 14px;
  color: rgba(255, 246, 232, 0.45);
  font-size: 13px;
}

.wiki-nav summary::after {
  content: '';
  width: 15px;
  height: 15px;
  order: -1;
  background:
    linear-gradient(var(--muted), var(--muted)) 2px 5px / 11px 8px no-repeat;
  opacity: 0.5;
  clip-path: polygon(0 10%, 35% 10%, 46% 30%, 100% 30%, 100% 100%, 0 100%);
}

.wiki-nav summary:hover,
.wiki-nav__item:hover {
  background: rgba(255, 235, 200, 0.07);
}

.wiki-nav summary.wiki-nav__folder--active,
.wiki-nav__item--active {
  background: rgba(255, 207, 143, 0.12);
  color: var(--gold);
}

.wiki-nav__root {
  min-height: 34px;
  margin: 0 0 2px;
}

.wiki-nav__root::before {
  content: '⌂';
  width: 16px;
  color: currentColor;
  font-size: 17px;
  line-height: 1;
}

.wiki-nav__group {
  margin-left: 9px;
  padding-left: 9px;
  border-left-color: var(--line-soft);
}

.wiki-badge {
  padding: 1px 6px;
  font-size: 9px;
}

.wiki-article {
  grid-column: 2;
  grid-row: 1;
  padding: 0;
  background: transparent;
}

.wiki-article__header {
  margin: 0;
  padding: 24px 32px 20px;
  border-bottom-color: var(--line-soft);
}

.wiki-article__title-row {
  align-items: flex-start;
  gap: 10px;
  margin: 0;
}

.wiki-article__heading {
  min-width: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
}

.wiki-article__header h2 {
  font-size: 1.55rem;
}

.wiki-article__meta {
  order: -1;
  color: var(--muted);
}

.wiki-article__desc {
  max-width: 620px;
  margin: 0;
  color: var(--secondary);
  font-size: 14.5px;
  line-height: 1.55;
}

.wiki-article__actions {
  margin-left: auto;
  flex: 0 0 auto;
}

.wiki-action,
.wiki-publish {
  min-height: 34px;
  padding: 0 14px;
  background: transparent;
  color: #fff6e8;
  font-size: 12.5px;
}

.wiki-action--primary,
.wiki-publish {
  border-color: var(--gold);
  background: var(--gold);
  color: #2a1710;
}

.wiki-action--primary:hover:not(:disabled),
.wiki-publish:hover:not(:disabled) {
  border-color: var(--gold-strong);
  background: var(--gold-strong);
  color: #2a1710;
}

.wiki-action--danger {
  color: #ffb0b0;
}

.wiki-article__body,
.wiki-editor,
.wiki-name-form,
.wiki-folder-sections {
  margin: 20px 32px 32px;
}

.wiki-article__body {
  color: rgba(255, 246, 232, 0.92);
}

.wiki-folder-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.wiki-folder-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wiki-folder-section__heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.wiki-folder-section__heading h3 {
  margin: 0;
  color: #fff6e8;
  font-size: 15px;
}

.wiki-folder-section__count {
  color: var(--muted);
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 12px;
}

.wiki-folder-section__rule {
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.wiki-folder-section__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 20px;
}

.wiki-folder-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.wiki-folder-card:hover {
  background: rgba(255, 235, 200, 0.07);
}

.wiki-folder-card__title {
  color: var(--gold);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
}

.wiki-folder-card__desc {
  color: var(--secondary);
  font-size: 12.5px;
  line-height: 1.45;
}

.wiki-editor {
  width: calc(100% - 64px);
}

/* Chat */

.chat-pane {
  background: rgba(12, 7, 20, 0.16);
}

.chat-header {
  min-height: 63px;
  gap: 10px;
  border-bottom-color: var(--line);
}

.chat-heading {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-status {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.chat-status__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #6be3a0;
}

.chat-status--busy .chat-status__dot {
  background: var(--gold-strong);
  box-shadow: 0 0 0 3px rgba(255, 181, 103, 0.25);
  animation: pulse 1.4s ease-in-out infinite;
}

.chat-status--error .chat-status__dot {
  background: var(--error);
}

.chat-action {
  height: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: transparent;
  color: #fff6e8;
}

#chat-history {
  width: 34px;
  padding: 0;
  justify-content: center;
}

.chat-action svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-history {
  border-bottom-color: var(--line);
  background: rgba(8, 4, 14, 0.62);
}

.chat-messages {
  padding: 16px;
  gap: 16px;
}

.msg-row {
  align-items: flex-start;
  gap: 10px;
}

.msg-row--user {
  justify-content: flex-end;
}

.msg-row--bot {
  justify-content: flex-start;
}

.avatar {
  width: 30px;
  height: 30px;
}

.avatar--bot {
  order: -1;
}

.bubble {
  max-width: 85%;
  padding: 12px 14px;
  box-shadow: 0 6px 18px rgba(10, 5, 20, 0.18);
}

.bubble--user {
  border: 1px solid var(--line-soft);
  border-radius: 16px 16px 4px 16px;
}

.bubble--bot {
  border-radius: 4px 16px 16px 16px;
}

.msg-row--bot:has(.chat-tools:not([hidden])) .bubble {
  max-width: calc(100% - 40px);
  flex: 1;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: #fff6e8;
}

.msg-row--bot:has(.chat-tools:not([hidden])) .bubble > .body {
  padding: 12px 14px;
  border-radius: 4px 16px 16px 16px;
  background: var(--bot-bubble);
  color: var(--bot-bubble-text);
  box-shadow: 0 6px 18px rgba(10, 5, 20, 0.18);
}

.msg-row--bot:has(.chat-tools:not([hidden])) .bubble > .body:empty {
  display: none;
}

.chat-thinking {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--secondary);
}

.chat-thinking summary {
  color: #fff6e8;
}

.chat-tools {
  align-items: flex-start;
  gap: 0;
  max-width: 100%;
  margin: 0 0 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

.chat-tools__summary {
  max-width: 100%;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 120ms ease,
    color 120ms ease;
}

.chat-tools__summary:hover,
.chat-tools__summary:focus-visible {
  background: var(--surface-soft);
  color: var(--secondary);
}

.chat-tools[data-open='true'] .chat-tools__summary {
  color: var(--secondary);
}

.chat-tools__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #6be3a0;
}

.chat-tools[data-state='running'] .chat-tools__dot {
  background: var(--gold-strong);
  box-shadow: 0 0 0 3px rgba(255, 181, 103, 0.25);
  animation: pulse 1.4s ease-in-out infinite;
}

.chat-tools[data-state='error'] .chat-tools__dot {
  background: var(--error);
}

.chat-tools__summary svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-tools__summary-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-tools__counts {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  opacity: 0.85;
}

.chat-tools__counts-error {
  color: var(--error);
}

.chat-tools__chevron {
  opacity: 0.7;
  transition: transform 120ms ease;
}

.chat-tools[data-open='true'] .chat-tools__chevron {
  transform: rotate(180deg);
}

.chat-tools__list {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: 4px;
  padding: 2px 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface-soft);
  color: #fff6e8;
}

.chat-tools[data-open='false'] .chat-tools__list {
  display: none;
}

.chat-tool {
  display: grid;
  grid-template-columns: 14px minmax(80px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 8px;
  padding: 4px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 11.5px;
}

.chat-tool + .chat-tool {
  border-top: 1px solid var(--line-soft);
}

.chat-tool__state {
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 181, 103, 0.14);
  color: var(--gold-strong);
  font-size: 9px;
  font-weight: 700;
}

.chat-tool[data-phase='done'] .chat-tool__state {
  background: rgba(107, 227, 160, 0.14);
  color: #6be3a0;
}

.chat-tool[data-phase='error'] .chat-tool__state {
  background: rgba(255, 143, 143, 0.16);
  color: var(--error);
}

.chat-tool__header {
  display: contents;
}

.chat-tool__name {
  color: #fff6e8;
  font-size: 11.5px;
}

.chat-tool__phase {
  grid-column: 4;
  grid-row: 1;
  font-size: 9.5px;
  color: var(--gold-strong);
}

.chat-tool[data-phase='done'] .chat-tool__phase {
  color: #6be3a0;
}

.chat-tool[data-phase='error'] .chat-tool__phase {
  color: var(--error);
}

.chat-tool__args {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-tool__detail {
  grid-column: 2 / 5;
  margin-top: 2px;
}

.chat-tool__detail summary {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.chat-tool__detail-body {
  margin-top: 4px;
  background: rgba(8, 4, 14, 0.4);
  color: var(--secondary);
  font-size: 11px;
  max-height: 140px;
}

.chat-input {
  align-items: stretch;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top-color: var(--line-soft);
  background: transparent;
}

.chat-context {
  width: fit-content;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 207, 143, 0.12);
  color: var(--gold);
  font-size: 12px;
}

.chat-context[hidden] {
  display: none;
}

.chat-context svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-context__remove {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: -4px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
}

.chat-context__remove svg {
  width: 10px;
  height: 10px;
}

.chat-context__remove:hover,
.chat-context__remove:focus-visible {
  background: rgba(255, 207, 143, 0.24);
  opacity: 1;
  outline: none;
}

.chat-input__composer {
  position: relative;
}

.chat-input__field {
  width: 100%;
  min-height: 64px;
  max-height: 122px;
  padding: 12px 60px 12px 14px;
  border-color: var(--line);
  border-radius: 12px;
  background: rgba(255, 250, 242, 0.94);
  line-height: 1.48;
}

.chat-input__send {
  position: absolute;
  right: 10px;
  bottom: 12px;
  width: 40px;
  height: 40px;
}

.chat-input__send svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-input__hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
  }

  .wiki-pane {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .wiki-folder-section__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  body {
    padding: 0;
  }

  .shell {
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 58%) minmax(300px, 42%);
  }

  .wiki-pane {
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 10px 12px;
  }

  .notion-connect,
  .topbar-divider,
  .account-name {
    display: none;
  }

  .account-toggle {
    width: 38px;
    padding: 3px;
  }

  .account-toggle svg {
    display: none;
  }

  .brand-status {
    padding: 0 4px;
  }

  .wiki-pane {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(150px, 38%) minmax(0, 1fr);
  }

  .wiki-sidebar {
    grid-column: 1;
    grid-row: 1;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .wiki-article {
    grid-column: 1;
    grid-row: 2;
  }

  .wiki-article__header {
    padding: 18px 16px 16px;
  }

  .wiki-article__title-row {
    flex-direction: column;
  }

  .wiki-article__actions {
    width: 100%;
    margin-left: 0;
  }

  .wiki-article__body,
  .wiki-editor,
  .wiki-name-form,
  .wiki-folder-sections {
    margin: 16px;
  }

  .wiki-editor {
    width: calc(100% - 32px);
  }
}
