:root {
  --bg: #fff;
  --surface: #f6f8fa;
  --surface-2: #fbfcfd;
  --text: #24292f;
  --text-soft: #57606a;
  --text-faint: #8c959f;
  --border: #d8dee4;
  --border-soft: #eaeef2;
  --link: #0969da;
  --link-hover: #0550ae;
  --green: #2f6f46;
  --green-hover: #285f3c;
  --danger: #cf222e;
  --danger-bg: #ffebe9;
  --header-height: 56px;
  --sidebar-width: 244px;
  --content-width: 920px;
}

* { box-sizing: border-box; }

html {
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans CJK SC",
    "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { margin: 0; min-height: 100vh; background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { color: inherit; }

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

/* header */

.site-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header-inner {
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.site-brand-name {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.site-brand-section {
  padding-left: 10px;
  border-left: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 13px;
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-link {
  color: var(--text-soft);
  font-size: 13px;
}

.header-link:hover { color: var(--text); }

.account-menu { position: relative; }

.account-menu summary {
  list-style: none;
  cursor: pointer;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 5px;
  color: var(--text-soft);
  font-size: 13px;
  user-select: none;
}

.account-menu summary::-webkit-details-marker { display: none; }

.account-menu summary::after {
  content: "";
  width: 5px; height: 5px;
  margin-left: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.account-menu summary:hover,
.account-menu[open] summary {
  color: var(--text);
  background: var(--surface);
}

.account-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  width: 220px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(140,149,159,.22);
  overflow: hidden;
  z-index: 60;
}

.account-popover-user {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.account-popover-user strong,
.account-popover-user span { display: block; }

.account-popover-user strong { font-size: 13px; font-weight: 600; }
.account-popover-user span { margin-top: 2px; color: var(--text-faint); font-size: 11px; }

.account-popover-links {
  padding: 5px;
  border-bottom: 1px solid var(--border-soft);
}

.account-popover-links a,
.account-logout button {
  display: block;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--text);
  text-align: left;
  font-size: 12px;
  cursor: pointer;
}

.account-popover-links a:hover,
.account-logout button:hover { background: var(--surface); }

.account-logout { margin: 0; padding: 5px; }

/* notices */

.notice-stack {
  position: fixed;
  top: 68px;
  right: 18px;
  z-index: 80;
  width: min(360px, calc(100vw - 36px));
}

.notice {
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(140,149,159,.18);
  font-size: 12px;
}

.notice-success { border-left-color: #1a7f37; }
.notice-error { border-left-color: var(--danger); }
.notice-info { border-left-color: var(--link); }

/* controls */

.button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
}

.button:hover { background: var(--surface); border-color: #b6bec7; }

.button-primary {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.button-primary:hover {
  color: #fff;
  background: var(--green-hover);
  border-color: var(--green-hover);
}

.button-danger {
  color: var(--danger);
  border-color: #ffb8b8;
}

.button-danger:hover {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: #ff8182;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  cursor: pointer;
  font-size: 12px;
}

.link-button:hover { color: var(--link-hover); text-decoration: underline; }

/* library */

.library-layout {
  min-height: calc(100vh - var(--header-height));
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0,1fr);
}

.library-sidebar {
  border-right: 1px solid var(--border-soft);
  padding: 26px 18px 40px;
  background: var(--surface-2);
}

.sidebar-title {
  padding: 0 10px 10px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.library-nav {
  display: grid;
  gap: 1px;
}

.library-nav-item {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 5px;
  color: var(--text-soft);
  font-size: 13px;
}

.library-nav-item:hover { color: var(--text); background: var(--surface); }

.library-nav-item.current {
  color: var(--text);
  background: #eaeef2;
  font-weight: 600;
}

.nav-folder {
  width: 13px; height: 10px;
  position: relative;
  flex: 0 0 auto;
  border: 1px solid #8c959f;
  border-radius: 2px;
}

.nav-folder::before {
  content: "";
  position: absolute;
  top: -4px; left: 1px;
  width: 6px; height: 3px;
  border: 1px solid #8c959f;
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  background: var(--surface-2);
}

.library-main {
  width: 100%;
  max-width: 1100px;
  padding: 48px 56px 90px;
}

.library-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.library-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -.025em;
  font-weight: 650;
}

.library-head p {
  margin: 7px 0 0;
  color: var(--text-soft);
  font-size: 13px;
}

.library-search {
  width: min(360px,45%);
  height: 36px;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.library-search:focus-within {
  border-color: #8c959f;
  box-shadow: 0 0 0 2px rgba(9,105,218,.08);
}

.search-icon {
  width: 14px; height: 14px;
  margin-left: 11px;
  border: 1.5px solid #8c959f;
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 5px; height: 1.5px;
  right: -4px; bottom: -2px;
  background: #8c959f;
  transform: rotate(45deg);
}

.library-search input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0 10px;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
  font-size: 12px;
}

.library-search button {
  height: 100%;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text-soft);
  font-size: 11px;
  cursor: pointer;
}

.library-search button:hover { color: var(--text); background: var(--surface); }

.search-result-note {
  margin: 20px 0 -2px;
  color: var(--text-soft);
  font-size: 12px;
}

.search-result-note span { color: var(--text-faint); }

.knowledge-section { margin-top: 34px; }

.knowledge-section-head {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.knowledge-section-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}

.knowledge-section-head a {
  color: var(--text-faint);
  font-size: 11px;
}

.knowledge-section-head a:hover { color: var(--link); }

.knowledge-list { border-top: 1px solid var(--border); }

.knowledge-row {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border-soft);
}

.knowledge-row-main { min-width: 0; }

.knowledge-row-main strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-row:hover .knowledge-row-main strong { color: var(--link); }

.knowledge-row-meta {
  display: flex;
  gap: 5px;
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 10px;
}

.meta-separator { color: #afb8c1; }

.file-ext {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  color: var(--text-faint);
  background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8px;
  font-weight: 650;
}

.library-empty {
  padding: 70px 0;
  color: var(--text-soft);
  text-align: center;
}

.library-empty strong { color: var(--text); font-size: 14px; }
.library-empty p { margin: 5px 0 0; font-size: 12px; }

/* document */

.doc-layout {
  min-height: calc(100vh - var(--header-height));
  display: grid;
  grid-template-columns: 220px minmax(0,var(--content-width)) 180px;
  justify-content: center;
  gap: 42px;
  padding: 44px 32px 100px;
}

.doc-left,
.doc-right {
  min-width: 0;
  align-self: start;
  position: sticky;
  top: calc(var(--header-height) + 28px);
}

.doc-back {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--text-soft);
  font-size: 11px;
}

.doc-back:hover { color: var(--link); }

.doc-siblings {
  display: grid;
  gap: 1px;
}

.doc-siblings a {
  padding: 6px 8px;
  border-left: 2px solid transparent;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.45;
}

.doc-siblings a:hover { color: var(--text); }

.doc-siblings a.current {
  border-left-color: #6e7781;
  color: var(--text);
  font-weight: 600;
}

.doc-main { min-width: 0; }

.doc-header {
  padding-bottom: 28px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--border);
}

.doc-breadcrumb {
  display: flex;
  gap: 7px;
  margin-bottom: 13px;
  color: var(--text-faint);
  font-size: 10px;
}

.doc-breadcrumb a:hover { color: var(--link); }

.doc-header h1 {
  margin: 0;
  color: #1f2328;
  font-size: 34px;
  line-height: 1.22;
  letter-spacing: -.035em;
  font-weight: 650;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  margin-top: 13px;
  color: var(--text-faint);
  font-size: 10px;
}

.doc-meta > * + *::before {
  content: "·";
  margin: 0 7px;
  color: #afb8c1;
}

.doc-meta a { color: var(--text-soft); }
.doc-meta a:hover { color: var(--link); }

.toc-title {
  margin-bottom: 9px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc li ul { padding-left: 10px; }

.toc a {
  display: block;
  padding: 4px 0;
  color: var(--text-soft);
  line-height: 1.4;
}

.toc a:hover { color: var(--link); }

.file-info dl { margin: 0; }

.file-info dl > div {
  padding: 7px 0;
  border-bottom: 1px solid var(--border-soft);
}

.file-info dt { color: var(--text-faint); font-size: 9px; }
.file-info dd { margin: 2px 0 0; color: var(--text-soft); font-size: 11px; }

/* prose */

.prose {
  color: #24292f;
  font-size: 15px;
  line-height: 1.78;
}

.prose > :first-child { margin-top: 0; }

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  color: #1f2328;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.015em;
}

.prose h1 { margin: 36px 0 16px; font-size: 26px; }
.prose h2 { margin: 34px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border-soft); font-size: 21px; }
.prose h3 { margin: 28px 0 12px; font-size: 17px; }
.prose h4 { margin: 24px 0 10px; font-size: 15px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 25px; }
.prose li + li { margin-top: 4px; }

.prose a { color: var(--link); }
.prose a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 2px; }

.prose blockquote {
  margin: 18px 0;
  padding: 0 15px;
  border-left: 3px solid #d0d7de;
  color: var(--text-soft);
}

.prose code {
  padding: .15em .35em;
  border-radius: 4px;
  background: rgba(175,184,193,.2);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .87em;
}

.prose pre {
  margin: 18px 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--surface);
  color: #24292f;
  line-height: 1.55;
}

.prose pre code { padding: 0; background: none; font-size: 12px; }

.prose table {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
  font-size: 13px;
}

.prose th,
.prose td {
  padding: 8px 10px;
  border: 1px solid var(--border);
  text-align: left;
}

.prose th { background: var(--surface); font-weight: 600; }

/* viewers */

.pdf-shell {
  min-height: 72vh;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #f0f1f2;
}

.pdf-frame {
  display: block;
  width: 100%;
  height: 76vh;
  border: 0;
  background: #fff;
}

.image-viewer {
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  text-align: center;
}

.image-viewer img { display: block; max-width: 100%; height: auto; margin: 0 auto; }

.media-viewer {
  padding: 14px;
  border-radius: 5px;
  background: #161b22;
}

.media-viewer video { display: block; width: 100%; max-height: 72vh; }

.audio-viewer {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.audio-viewer audio { display: block; width: 100%; }

.text-viewer {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.text-viewer pre {
  max-height: 72vh;
  margin: 0;
  padding: 17px;
  overflow: auto;
  color: #24292f;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.viewer-note {
  margin: 10px 0 0;
  color: var(--text-faint);
  font-size: 10px;
}

.text-viewer .viewer-note {
  margin: 0;
  padding: 10px 17px;
  border-top: 1px solid var(--border-soft);
  background: #fff;
}

.viewer-note-download {
  margin-left: 4px;
  color: var(--gmail-blue);
  font-weight: 600;
  white-space: nowrap;
}

.viewer-note-download:hover {
  text-decoration: underline;
}

.file-download-view {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  text-align: center;
}

.file-download-ext {
  min-width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
}

.file-download-view h2 { margin: 16px 0 5px; font-size: 16px; }
.file-download-view p { max-width: 480px; margin: 0 0 18px; color: var(--text-soft); font-size: 12px; }

/* admin */

.admin-body { background: #fff; }

.admin-layout {
  min-height: calc(100vh - var(--header-height));
  display: grid;
  grid-template-columns: 190px minmax(0,1fr);
}

.admin-sidebar {
  border-right: 1px solid var(--border);
  padding: 28px 16px;
  background: var(--surface-2);
}

.admin-sidebar-title {
  padding: 0 9px 11px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.admin-nav { display: grid; gap: 1px; }

.admin-nav a {
  padding: 7px 9px;
  border-radius: 5px;
  color: var(--text-soft);
  font-size: 12px;
}

.admin-nav a:hover { color: var(--text); background: var(--surface); }

.admin-nav a.current {
  color: var(--text);
  background: #eaeef2;
  font-weight: 600;
}

.admin-main {
  width: 100%;
  max-width: 1200px;
  padding: 44px 50px 90px;
}

.admin-narrow { max-width: 950px; }

.admin-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding-bottom: 22px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.admin-page-head h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -.02em;
  font-weight: 650;
}

.admin-page-head p {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 12px;
}

.admin-actions { display: flex; gap: 8px; }

.admin-breadcrumb {
  display: flex;
  gap: 6px;
  margin-bottom: 9px;
  color: var(--text-faint);
  font-size: 10px;
}

.admin-breadcrumb a:hover { color: var(--link); }

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-table th {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-faint);
  text-align: left;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-soft);
  vertical-align: middle;
}

.admin-doc-title {
  color: var(--text);
  font-weight: 560;
}

.admin-doc-title:hover { color: var(--link); }

.table-ext {
  padding: 2px 5px;
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8px;
  font-weight: 650;
}

.table-action { text-align: right; white-space: nowrap; }
.table-action a { color: var(--link); }
.table-action a:hover { text-decoration: underline; }
.table-empty { padding: 40px !important; text-align: center; color: var(--text-faint) !important; }

.admin-users-layout {
  display: grid;
  grid-template-columns: 300px minmax(0,1fr);
  gap: 36px;
}

.admin-section h2 {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 650;
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.admin-section-head span { color: var(--text-faint); font-size: 10px; }

.admin-form {
  display: grid;
  gap: 14px;
}

.admin-form label,
.form-grid label,
.editor-field,
.file-replace-row label {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
}

.admin-form input,
.form-grid input,
.editor-field textarea,
.file-replace-row input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.admin-form input,
.form-grid input {
  min-height: 36px;
  padding: 0 10px;
}

.admin-form input:focus,
.form-grid input:focus,
.editor-field textarea:focus,
.file-replace-row input:focus {
  border-color: #8c959f;
  box-shadow: 0 0 0 2px rgba(9,105,218,.08);
}

.admin-form small,
.form-grid small,
.file-replace-row small {
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 400;
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 7px !important;
  font-weight: 400 !important;
}

.check-row input { width: 14px; min-height: 14px; }

.current-user {
  margin-left: 6px;
  color: var(--text-faint);
  font-size: 9px;
}

.account-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.account-status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #afb8c1;
}

.account-status.active::before { background: #1a7f37; }
.account-status.inactive::before { background: #cf222e; }

.admin-form-block {
  gap: 0;
}

.file-picker {
  min-height: 130px;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px;
  border: 1px dashed #afb8c1;
  border-radius: 6px;
  background: var(--surface-2);
  cursor: pointer;
}

.file-picker-title { color: var(--text); font-size: 13px; font-weight: 600; }
.file-picker-help { margin-top: 2px; color: var(--text-faint); font-size: 10px; }

.file-picker input[type="file"] {
  width: auto;
  min-height: auto;
  margin-top: 12px;
  border: 0;
  box-shadow: none;
  font-size: 11px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 14px;
  padding: 20px 0;
}

.format-note {
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.6;
}

.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 20px;
}

.editor-field { padding-top: 18px; }

.editor-field textarea {
  min-height: 520px;
  resize: vertical;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
}

.file-replace-row {
  margin-top: 18px;
  padding: 16px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.file-replace-row strong,
.file-replace-row span { display: block; }

.file-replace-row strong { font-size: 11px; }
.file-replace-row > div > span { margin-top: 4px; color: var(--text-faint); font-size: 10px; }

.danger-section {
  margin-top: 38px;
  padding-top: 20px;
  border-top: 1px solid #ffb8b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.danger-section strong { color: var(--danger); font-size: 12px; }
.danger-section p { margin: 3px 0 0; color: var(--text-faint); font-size: 10px; }

/* login */

.login-page { background: var(--surface-2); }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px 18px;
}

.login-box {
  width: min(370px,100%);
  padding: 28px 30px 30px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(140,149,159,.12);
}

.login-wordmark {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.login-box h1 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -.02em;
  font-weight: 650;
}

.login-box > p {
  margin: 7px 0 22px;
  color: var(--text-soft);
  font-size: 12px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
}

.login-form input {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  outline: none;
}

.login-form input:focus {
  border-color: #8c959f;
  box-shadow: 0 0 0 2px rgba(9,105,218,.08);
}

.login-submit { width: 100%; margin-top: 2px; }

.login-help {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-faint);
  font-size: 10px;
  text-align: center;
}

/* error */

.error-page {
  max-width: 620px;
  margin: 12vh auto 0;
  padding: 30px;
  text-align: center;
}

.error-page h1 { margin: 0 0 24px; font-size: 24px; }
.eyebrow { color: var(--text-faint); font-size: 10px; }

/* responsive */

@media (max-width: 1180px) {
  .doc-layout {
    grid-template-columns: 190px minmax(0,1fr);
    max-width: 1100px;
    margin: 0 auto;
  }
  .doc-right { display: none; }
}

@media (max-width: 900px) {
  .library-layout { grid-template-columns: 190px minmax(0,1fr); }
  .library-main { padding: 38px 30px 70px; }
  .library-head { flex-direction: column; align-items: stretch; }
  .library-search { width: 100%; }

  .doc-layout {
    grid-template-columns: 1fr;
    max-width: 860px;
    padding: 34px 28px 70px;
  }
  .doc-left { position: static; }
  .doc-siblings { display: none; }

  .admin-users-layout { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .file-replace-row { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .site-header-inner { padding: 0 14px; }
  .header-link { display: none; }

  .library-layout { display: block; }
  .library-sidebar {
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
    overflow-x: auto;
  }
  .sidebar-title { display: none; }
  .library-nav {
    display: flex;
    width: max-content;
    gap: 3px;
  }
  .library-nav-item { white-space: nowrap; }
  .nav-folder { display: none; }
  .library-main { padding: 30px 18px 60px; }
  .library-head h1 { font-size: 24px; }

  .doc-layout { padding: 26px 18px 60px; }
  .doc-header h1 { font-size: 28px; }

  .admin-layout { display: block; }
  .admin-sidebar {
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .admin-sidebar-title { display: none; }
  .admin-nav { display: flex; gap: 4px; }
  .admin-nav a { min-width: 70px; text-align: center; }
  .admin-main { padding: 28px 16px 60px; }
  .admin-page-head { align-items: stretch; flex-direction: column; }
  .admin-actions { flex-wrap: wrap; }
  .admin-actions .button { flex: 1; }

  .login-box { padding: 25px 22px 26px; }
}


/* role navigation and boards */
.header-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 28px;
}

.primary-nav {
  height: var(--header-height);
  display: flex;
  align-items: stretch;
  gap: 2px;
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-bottom: 2px solid transparent;
  color: var(--text-soft);
  font-size: 12px;
}

.primary-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.primary-nav a.current {
  color: var(--text);
  border-bottom-color: #57606a;
  font-weight: 600;
}

.board-page {
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: 46px 0 90px;
}

.board-head {
  min-height: 72px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.board-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -.025em;
  font-weight: 650;
}

.board-head p,
.simple-form-head p {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 12px;
}

.announcement-list {
  display: grid;
  gap: 0;
}

.announcement-item {
  padding: 24px 2px;
  border-bottom: 1px solid var(--border-soft);
}

.announcement-item:first-child { padding-top: 4px; }

.announcement-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.announcement-title-line h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -.01em;
}

.pin-mark {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid #d0d7de;
  border-radius: 3px;
  color: #57606a;
  background: #f6f8fa;
  font-size: 9px;
  font-weight: 600;
}

.announcement-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 7px;
  color: var(--text-faint);
  font-size: 10px;
}

.announcement-meta > span + span::before {
  content: "·";
  margin-right: 7px;
  color: #afb8c1;
}

.announcement-body {
  margin-top: 18px;
  max-width: 780px;
  font-size: 14px;
}

.announcement-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--text-faint);
  font-size: 10px;
}

.announcement-actions a:hover { color: var(--link); }

.danger-link { color: var(--danger); }

.board-empty {
  padding: 70px 0;
  text-align: center;
  color: var(--text-soft);
}

.board-empty strong { color: var(--text); font-size: 14px; }
.board-empty p { margin: 5px 0 0; font-size: 11px; }

.simple-form-page {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0 90px;
}

.simple-form-head {
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.simple-form-head > a {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--text-soft);
  font-size: 11px;
}

.simple-form-head > a:hover { color: var(--link); }

.simple-form-head h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -.02em;
}

.password-page { max-width: 520px; }

.library-head-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.submission-list,
.private-list,
.review-list {
  border-top: 1px solid var(--border);
}

.submission-row,
.private-row,
.review-row {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--border-soft);
}

.submission-row > div:first-child,
.private-row-main,
.review-main {
  min-width: 0;
}

.submission-row a,
.private-row-main strong,
.review-main a {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.submission-row a:hover,
.private-row-main:hover strong,
.review-main a:hover {
  color: var(--link);
}

.submission-row > div:first-child > div,
.private-row-main span,
.review-main span {
  display: block;
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 10px;
}

.review-status {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 600;
}

.status-pending { color: #6e5300; background: #fff8c5; }
.status-approved { color: #116329; background: #dafbe1; }
.status-rejected { color: #82071e; background: #ffebe9; }

.review-actions {
  display: flex;
  gap: 7px;
  flex: 0 0 auto;
}

.review-actions form,
.private-row form,
.announcement-actions form {
  margin: 0;
}

.form-help {
  margin: -2px 0 0;
  color: var(--text-faint);
  font-size: 10px;
  line-height: 1.55;
}

.admin-form select,
.form-grid select {
  width: 100%;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.admin-form select:focus,
.form-grid select:focus {
  border-color: #8c959f;
  box-shadow: 0 0 0 2px rgba(9,105,218,.08);
}

#student-date-fields {
  display: grid;
  gap: 14px;
}

#student-date-fields[hidden] { display: none; }

.password-pending {
  margin-left: 6px;
  padding: 2px 5px;
  border-radius: 3px;
  color: #6e5300;
  background: #fff8c5;
  font-size: 8px;
  font-weight: 600;
}

@media (max-width: 760px) {
  .header-left { gap: 10px; }
  .site-brand-name { display: none; }
  .primary-nav { gap: 0; }
  .primary-nav a { padding: 0 8px; font-size: 11px; }

  .board-page {
    width: calc(100% - 32px);
    padding-top: 30px;
  }

  .board-head {
    align-items: stretch;
    flex-direction: column;
  }

  .submission-row,
  .private-row,
  .review-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .review-actions {
    align-self: flex-end;
  }
}


/* ============================================================
   Knowledge workspace v4
   Outline shell + BookStack hierarchy + GitBook reader
   ============================================================ */

:root {
  --workspace-sidebar: 264px;
  --topbar-height: 54px;
  --canvas: #ffffff;
  --sidebar-bg: #f8f9fb;
  --soft-bg: #f5f6f8;
  --hover-bg: #f0f2f5;
  --ink: #1f2328;
  --muted-ink: #66707b;
  --faint-ink: #929aa4;
  --hairline: #e5e8ec;
  --hairline-strong: #d9dee5;
  --accent: #285c46;
  --accent-soft: #e9f2ed;
}

.app-body {
  background: var(--canvas);
  color: var(--ink);
}

.app-topbar {
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(255,255,255,.97);
}

.app-topbar-left,
.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.app-wordmark-mark {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid var(--hairline-strong);
  border-radius: 7px;
  background: #fff;
  color: #30363d;
  font-size: 12px;
  font-weight: 750;
}

.app-wordmark-text {
  font-size: 14px;
  font-weight: 670;
  letter-spacing: -.01em;
}

.topbar-context {
  padding-left: 12px;
  border-left: 1px solid var(--hairline);
  color: var(--muted-ink);
  font-size: 12px;
}

.topbar-link {
  color: var(--muted-ink);
  font-size: 11px;
}

.topbar-link:hover { color: var(--ink); }

.app-topbar .account-menu summary {
  gap: 7px;
  min-height: 31px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
}

.app-topbar .account-menu summary:hover,
.app-topbar .account-menu[open] summary {
  border-color: var(--hairline);
  background: var(--soft-bg);
}

.role-dot {
  color: var(--faint-ink);
  font-size: 9px;
  font-weight: 500;
}

.workspace-shell {
  min-height: calc(100vh - var(--topbar-height));
  display: grid;
  grid-template-columns: var(--workspace-sidebar) minmax(0, 1fr);
}

.workspace-sidebar {
  height: calc(100vh - var(--topbar-height));
  position: sticky;
  top: var(--topbar-height);
  align-self: start;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--hairline);
  background: var(--sidebar-bg);
}

.workspace-sidebar-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 20px 12px 28px;
}

.workspace-label {
  padding: 0 10px 8px;
  color: var(--faint-ink);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.workspace-nav {
  display: grid;
  gap: 2px;
}

.workspace-nav > a {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  border-radius: 7px;
  color: #515a64;
  font-size: 12px;
  font-weight: 520;
}

.workspace-nav > a:hover {
  color: var(--ink);
  background: var(--hover-bg);
}

.workspace-nav > a.current {
  color: #20262c;
  background: #e9edf1;
  font-weight: 650;
}

.nav-symbol {
  width: 16px;
  flex: 0 0 16px;
  color: #87919c;
  text-align: center;
  font-size: 11px;
}

.workspace-divider {
  height: 1px;
  margin: 20px 9px;
  background: var(--hairline);
}

.knowledge-tree {
  display: grid;
  gap: 1px;
  font-size: 11px;
}

.knowledge-tree a {
  display: block;
  min-width: 0;
  overflow: hidden;
  border-radius: 5px;
  color: #616a74;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-tree a:hover {
  color: var(--ink);
  background: #eef1f4;
}

.tree-category {
  padding: 6px 8px;
  font-weight: 600;
}

.tree-category.active { color: var(--ink); }

.tree-caret {
  margin-right: 6px;
  color: #a1a8b0;
}

.tree-books { padding-left: 14px; }
.tree-book { padding: 5px 8px; }
.tree-book.active { color: #31383f; font-weight: 620; }

.tree-chapters {
  padding-left: 12px;
  border-left: 1px solid #e0e4e8;
  margin-left: 8px;
}

.tree-chapter { padding: 4px 8px; }
.tree-chapter.active { color: #39424b; font-weight: 600; }

.tree-pages {
  padding: 2px 0 5px 11px;
  display: grid;
  gap: 1px;
}

.tree-page { padding: 4px 7px; color: #78818b !important; }
.tree-page.current {
  color: var(--accent) !important;
  background: var(--accent-soft) !important;
  font-weight: 620;
}

.workspace-sidebar-foot {
  padding: 11px 18px 14px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--faint-ink);
  font-size: 9px;
}

.workspace-sidebar-foot span:first-child {
  color: #616a74;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-main {
  min-width: 0;
  background: #fff;
}

/* shared content surface */

.content-page,
.board-page,
.simple-form-page {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 48px 56px 96px;
}

.content-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 24px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--hairline);
}

.content-page-head.compact {
  align-items: flex-start;
}

.content-heading { min-width: 0; }

.content-heading h1,
.board-head h1,
.simple-form-head h1 {
  margin: 0;
  color: #191d21;
  font-size: 29px;
  line-height: 1.18;
  font-weight: 690;
  letter-spacing: -.032em;
}

.content-heading p,
.board-head p,
.simple-form-head p {
  max-width: 700px;
  margin: 7px 0 0;
  color: var(--muted-ink);
  font-size: 12px;
  line-height: 1.65;
}

.content-head-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

.quiet-button {
  min-height: 35px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--hairline-strong);
  border-radius: 7px;
  background: #fff;
  color: #48515b;
  font-size: 11px;
  font-weight: 580;
}

.quiet-button:hover { background: var(--soft-bg); }

.breadcrumb {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--faint-ink);
  font-size: 10px;
  overflow: hidden;
  white-space: nowrap;
}

.breadcrumb a {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb a:hover { color: var(--link); }

.library-search {
  width: 330px;
  height: 35px;
  display: flex;
  align-items: center;
  border: 1px solid var(--hairline-strong);
  border-radius: 7px;
  background: #fff;
}

.library-search:focus-within {
  border-color: #aab2bc;
  box-shadow: 0 0 0 3px rgba(50,77,103,.06);
}

.library-search input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0 9px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
}

.library-search button {
  height: 100%;
  padding: 0 10px;
  border: 0;
  border-left: 1px solid var(--hairline);
  background: transparent;
  color: var(--faint-ink);
  font-size: 10px;
  cursor: pointer;
}

.search-icon {
  width: 13px;
  height: 13px;
  margin-left: 10px;
  border: 1.4px solid #9aa2aa;
  border-radius: 50%;
  position: relative;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.4px;
  right: -4px;
  bottom: -2px;
  background: #9aa2aa;
  transform: rotate(45deg);
}

/* BookStack-style hierarchy */

.hierarchy-list {
  display: grid;
  gap: 46px;
}

.hierarchy-category {
  min-width: 0;
}

.hierarchy-category + .hierarchy-category {
  padding-top: 38px;
  border-top: 1px solid var(--hairline);
}

.hierarchy-category-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.hierarchy-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--faint-ink);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hierarchy-category-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.018em;
  font-weight: 660;
}

.hierarchy-category-head > a,
.book-head > a {
  color: var(--faint-ink);
  font-size: 10px;
}

.hierarchy-category-head > a:hover,
.book-head > a:hover { color: var(--link); }

.book-list {
  border-top: 1px solid var(--hairline);
}

.book-section {
  padding: 18px 0 4px;
  border-bottom: 1px solid var(--hairline);
}

.book-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.book-head > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.book-icon {
  width: 26px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--hairline-strong);
  border-radius: 5px;
  background: var(--soft-bg);
  color: #78818b;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
}

.book-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}

.book-head h3 + span {
  display: block;
  margin-top: 2px;
  color: var(--faint-ink);
  font-size: 9px;
}

.chapter-list {
  margin-left: 36px;
}

.chapter-block {
  padding: 11px 0 4px;
  border-top: 1px solid #f0f2f4;
}

.chapter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 26px;
}

.chapter-head a {
  color: #4f5862;
  font-size: 11px;
  font-weight: 640;
}

.chapter-head a:hover { color: var(--link); }
.chapter-head span { color: #a0a8b1; font-size: 9px; }

.page-list { margin-top: 2px; }

.page-row,
.search-result-row {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 4px 8px 14px;
  border-left: 1px solid #e5e8eb;
}

.page-row:hover,
.search-result-row:hover { background: #fafbfc; }

.page-row-main,
.search-result-row > div { min-width: 0; }

.page-row-main strong,
.search-result-row strong {
  display: block;
  color: #30363d;
  font-size: 11px;
  font-weight: 580;
}

.page-row:hover strong,
.search-result-row:hover strong { color: var(--link); }

.page-row-main span,
.search-result-row > div > span {
  display: block;
  margin-top: 3px;
  color: var(--faint-ink);
  font-size: 9px;
}

.file-ext {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: #fafbfc;
  color: #9098a1;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8px;
  font-weight: 700;
}

.search-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--hairline);
}

.search-summary strong { font-size: 13px; }
.search-summary span { color: var(--faint-ink); font-size: 10px; }

.search-results {
  display: grid;
}

.search-result-row {
  padding-left: 4px;
  border-left: 0;
  border-bottom: 1px solid var(--hairline);
}

/* GitBook / Material-style reader */

.reader-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 820px) 210px;
  justify-content: center;
  gap: 56px;
  padding: 48px 56px 110px;
}

.reader-main { min-width: 0; }

.reader-head {
  padding-bottom: 26px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--hairline);
}

.reader-head h1 {
  margin: 0;
  color: #171b20;
  font-size: 34px;
  line-height: 1.18;
  letter-spacing: -.04em;
  font-weight: 700;
}

.reader-meta {
  display: flex;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--faint-ink);
  font-size: 9px;
}

.reader-meta > * + *::before {
  content: "·";
  margin: 0 7px;
  color: #b4bbc3;
}

.reader-meta a { color: #67717b; }
.reader-meta a:hover { color: var(--link); }

.reader-content {
  min-width: 0;
}

.reader-toc {
  position: sticky;
  top: calc(var(--topbar-height) + 32px);
  align-self: start;
  max-height: calc(100vh - var(--topbar-height) - 64px);
  overflow-y: auto;
  padding-left: 17px;
  border-left: 1px solid var(--hairline);
}

.reader-toc-title {
  margin-bottom: 9px;
  color: var(--faint-ink);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.reader-toc .toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.reader-toc .toc li ul { padding-left: 10px; }

.reader-toc .toc a {
  display: block;
  padding: 4px 0;
  color: #7a838c;
  font-size: 10px;
  line-height: 1.4;
}

.reader-toc .toc a:hover { color: var(--link); }

.reader-file-info { margin: 0; }

.reader-file-info > div {
  padding: 7px 0;
  border-bottom: 1px solid #f0f2f4;
}

.reader-file-info dt {
  color: #9aa2ab;
  font-size: 8px;
}

.reader-file-info dd {
  margin: 2px 0 0;
  color: #626b74;
  font-size: 10px;
  line-height: 1.45;
}

/* technical prose */

.reader-content .prose {
  max-width: 780px;
  color: #2d333b;
  font-size: 15px;
  line-height: 1.82;
}

.reader-content .prose h1,
.reader-content .prose h2,
.reader-content .prose h3,
.reader-content .prose h4 {
  scroll-margin-top: calc(var(--topbar-height) + 22px);
  color: #1d2228;
  letter-spacing: -.018em;
}

.reader-content .prose h2 {
  margin-top: 2.1em;
  padding-bottom: .42em;
  border-bottom: 1px solid var(--hairline);
  font-size: 21px;
}

.reader-content .prose h3 { margin-top: 1.9em; font-size: 17px; }

.reader-content .prose pre {
  margin: 18px 0;
  padding: 16px 17px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #f7f8fa;
  color: #24292f;
}

.reader-content .prose code {
  border-radius: 4px;
  background: #f1f2f4;
}

.reader-content .prose pre code { background: transparent; }

.reader-content .prose img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.reader-content .prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

/* forms and private/announcement surfaces */

.board-page,
.simple-form-page {
  width: min(100%, 1040px);
  padding: 48px 56px 96px;
}

.board-head {
  margin-bottom: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--hairline);
}

.announcement-item,
.private-row,
.submission-row {
  background: transparent;
}

.announcement-item {
  padding: 21px 2px;
}

.announcement-title-line h2 {
  font-size: 16px;
  letter-spacing: -.012em;
}

.hierarchy-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 20px 0;
}

.hierarchy-form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted-ink);
  font-size: 10px;
  font-weight: 620;
}

.hierarchy-form-grid input {
  width: 100%;
  min-height: 37px;
  padding: 0 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  outline: 0;
}

.hierarchy-form-grid input:focus {
  border-color: #9fa8b2;
  box-shadow: 0 0 0 3px rgba(50,77,103,.06);
}

.hierarchy-form-grid small {
  color: var(--faint-ink);
  font-size: 8px;
  font-weight: 400;
}

.editor-surface {
  padding: 22px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: #fff;
}

.form-note {
  padding: 11px 12px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: var(--soft-bg);
  color: var(--muted-ink);
  font-size: 10px;
  line-height: 1.55;
}

.hierarchy-cell {
  max-width: 330px;
  color: #727b84 !important;
  font-size: 10px;
}

/* preserve neutral admin styling */
.admin-main {
  padding-top: 42px;
}

.admin-page-head h1 {
  font-size: 25px;
  letter-spacing: -.025em;
}

/* responsive */
@media (max-width: 1120px) {
  .reader-shell {
    grid-template-columns: minmax(0, 1fr);
    max-width: 900px;
  }
  .reader-toc { display: none; }
}

@media (max-width: 900px) {
  :root { --workspace-sidebar: 218px; }

  .content-page,
  .board-page,
  .simple-form-page,
  .reader-shell {
    padding-left: 30px;
    padding-right: 30px;
  }

  .content-page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .content-head-actions {
    align-items: stretch;
  }

  .library-search {
    width: min(100%, 420px);
  }

  .hierarchy-form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .app-wordmark-text { display: none; }

  .workspace-shell { display: block; }

  .workspace-sidebar {
    height: auto;
    position: sticky;
    top: var(--topbar-height);
    z-index: 55;
    display: block;
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
  }

  .workspace-sidebar-scroll {
    padding: 7px 10px;
    overflow-x: auto;
  }

  .workspace-label,
  .workspace-divider,
  .knowledge-tree,
  .workspace-sidebar-foot {
    display: none;
  }

  .workspace-nav {
    width: max-content;
    display: flex;
    gap: 3px;
  }

  .workspace-nav > a {
    min-height: 32px;
    white-space: nowrap;
  }

  .nav-symbol { display: none; }

  .content-page,
  .board-page,
  .simple-form-page,
  .reader-shell {
    padding: 28px 18px 70px;
  }

  .content-heading h1,
  .board-head h1,
  .simple-form-head h1 {
    font-size: 25px;
  }

  .reader-head h1 { font-size: 28px; }

  .content-head-actions {
    flex-direction: column;
  }

  .library-search { width: 100%; }

  .hierarchy-form-grid { grid-template-columns: 1fr; }

  .chapter-list { margin-left: 18px; }

  .account-menu summary .role-dot { display: none; }
}


/* ============================================================
   Gmail-inspired visual pass
   Clean typography, readable hierarchy, fewer micro labels
   ============================================================ */

:root {
  --gmail-bg: #f6f8fc;
  --gmail-panel: #ffffff;
  --gmail-text: #1f1f1f;
  --gmail-secondary: #444746;
  --gmail-muted: #5f6368;
  --gmail-line: #e7eaf0;
  --gmail-hover: #eef2f7;
  --gmail-active: #d3e3fd;
  --gmail-active-text: #001d35;
  --gmail-search: #eaf1fb;
  --gmail-button: #c2e7ff;
  --gmail-button-hover: #a8d9f7;
  --gmail-blue: #0b57d0;
  --topbar-height: 64px;
  --workspace-sidebar: 252px;
}

html {
  font-size: 15px;
  line-height: 1.5;
  color: var(--gmail-text);
  background: var(--gmail-bg);
  font-family: "Google Sans Text", Roboto, "Noto Sans CJK SC", "Microsoft YaHei",
    "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

[hidden] {
  display: none !important;
}

body,
.app-body {
  background: var(--gmail-bg);
  color: var(--gmail-text);
}

.app-topbar {
  height: var(--topbar-height);
  padding: 0 22px;
  border-bottom: 0;
  background: var(--gmail-bg);
}

.app-wordmark {
  gap: 10px;
}

.app-wordmark-mark {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: var(--gmail-button);
  color: #0b57d0;
  font-size: 15px;
  font-weight: 700;
}

.app-wordmark-text {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -.02em;
}

.topbar-context,
.topbar-link {
  font-size: 13px;
  color: var(--gmail-muted);
}

.app-topbar .account-menu summary {
  min-height: 40px;
  gap: 9px;
  padding: 4px 8px 4px 4px;
  border-radius: 22px;
  color: var(--gmail-secondary);
  font-size: 14px;
}

.app-topbar .account-menu summary:hover,
.app-topbar .account-menu[open] summary {
  border-color: transparent;
  background: #e9edf3;
}

.account-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  border-radius: 50%;
  background: #e8def8;
  color: #4a4458;
  font-size: 14px;
  font-weight: 700;
}

.account-name {
  font-size: 14px;
  font-weight: 500;
}

.account-menu summary::after {
  margin-left: 3px;
}

.account-popover {
  width: 230px;
  border-color: var(--gmail-line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(60,64,67,.18);
}

.account-popover-user {
  padding: 14px 16px;
}

.account-popover-user strong {
  font-size: 14px;
}

.account-popover-user span {
  margin-top: 3px;
  color: var(--gmail-muted);
  font-size: 13px;
}

.account-popover-links a,
.account-logout button {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
}

.workspace-shell {
  min-height: calc(100vh - var(--topbar-height));
  grid-template-columns: var(--workspace-sidebar) minmax(0, 1fr);
  background: var(--gmail-bg);
}

.workspace-sidebar {
  height: calc(100vh - var(--topbar-height));
  top: var(--topbar-height);
  border-right: 0;
  background: var(--gmail-bg);
}

.workspace-sidebar-scroll {
  padding: 12px 10px 26px 0;
}

.workspace-nav {
  gap: 3px;
}

.workspace-nav > a {
  min-height: 42px;
  gap: 12px;
  padding: 9px 18px 9px 24px;
  border-radius: 0 22px 22px 0;
  color: var(--gmail-secondary);
  font-size: 14px;
  font-weight: 500;
}

.workspace-nav > a:hover {
  color: var(--gmail-text);
  background: #e9edf3;
}

.workspace-nav > a.current {
  color: var(--gmail-active-text);
  background: var(--gmail-active);
  font-weight: 700;
}

.nav-symbol {
  width: 20px;
  flex: 0 0 20px;
  color: var(--gmail-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-symbol svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace-nav > a.current .nav-symbol {
  color: var(--gmail-active-text);
}

.workspace-divider {
  margin: 16px 18px 12px 22px;
  background: #dde2e8;
}

.knowledge-tree {
  gap: 2px;
  padding-left: 12px;
  font-size: 13px;
}

.knowledge-tree a {
  min-height: 32px;
  display: flex;
  align-items: center;
  border-radius: 16px;
  color: var(--gmail-secondary);
}

.tree-category {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
}

.tree-books {
  padding-left: 12px;
}

.tree-book,
.tree-chapter,
.tree-page {
  padding: 6px 12px;
  font-size: 13px;
}

.tree-book.active,
.tree-chapter.active {
  color: var(--gmail-active-text);
  font-weight: 700;
}

.tree-chapters {
  margin-left: 8px;
  padding-left: 9px;
  border-left: 1px solid #dfe4ea;
}

.tree-page.current {
  color: var(--gmail-active-text) !important;
  background: var(--gmail-active) !important;
  font-weight: 700;
}

.workspace-main {
  min-height: calc(100vh - var(--topbar-height) - 8px);
  margin: 8px 12px 0 0;
  overflow: hidden;
  border-radius: 18px 18px 0 0;
  background: var(--gmail-panel);
}

.content-page,
.board-page,
.simple-form-page {
  width: min(100%, 1180px);
  padding: 30px 36px 80px;
}

.content-page-head,
.board-head,
.admin-page-head {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--gmail-line);
}

.content-heading h1,
.board-head h1,
.simple-form-head h1,
.admin-page-head h1 {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--gmail-text);
}

.content-heading p,
.board-head p,
.simple-form-head p,
.admin-page-head p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--gmail-muted);
}

.content-head-actions {
  gap: 12px;
}

.library-search {
  width: min(460px, 42vw);
  height: 46px;
  border: 0;
  border-radius: 24px;
  background: var(--gmail-search);
}

.library-search:focus-within {
  border: 0;
  background: #fff;
  box-shadow: 0 1px 2px rgba(60,64,67,.2), 0 1px 3px 1px rgba(60,64,67,.12);
}

.library-search input {
  padding: 0 12px;
  font-size: 14px;
  color: var(--gmail-text);
}

.library-search input::placeholder {
  color: var(--gmail-muted);
}

.library-search button {
  padding: 0 14px;
  border-left: 0;
  color: var(--gmail-muted);
  font-size: 13px;
  font-weight: 500;
}

.search-icon {
  width: 15px;
  height: 15px;
  margin-left: 16px;
  border-color: var(--gmail-muted);
}

.search-icon::after {
  background: var(--gmail-muted);
}

.button,
.quiet-button {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 19px;
  background: #edf1f5;
  color: var(--gmail-text);
  font-size: 13px;
  font-weight: 600;
}

.button:hover,
.quiet-button:hover {
  background: #e2e7ed;
}

.button-primary {
  border: 0;
  background: var(--gmail-button);
  color: var(--gmail-active-text);
}

.button-primary:hover {
  border: 0;
  background: var(--gmail-button-hover);
  color: var(--gmail-active-text);
}

.breadcrumb {
  gap: 8px;
  margin-bottom: 12px;
  color: var(--gmail-muted);
  font-size: 13px;
}

.hierarchy-list {
  gap: 34px;
}

.hierarchy-category + .hierarchy-category {
  padding-top: 28px;
  border-top-color: var(--gmail-line);
}

.hierarchy-category-head {
  margin-bottom: 12px;
}

.hierarchy-category-head h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--gmail-text);
}

.hierarchy-category-head > a,
.book-head > a {
  color: var(--gmail-blue);
  font-size: 13px;
  font-weight: 500;
}

.book-list {
  border-top: 1px solid var(--gmail-line);
}

.book-section {
  padding: 16px 0 2px;
  border-bottom: 1px solid var(--gmail-line);
}

.book-head {
  margin-bottom: 8px;
}

.book-icon {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #e8f0fe;
  color: var(--gmail-blue);
  font-size: 12px;
}

.book-head h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gmail-text);
}

.chapter-list {
  margin-left: 44px;
}

.chapter-block {
  padding: 8px 0 0;
  border-top: 1px solid #f0f2f5;
}

.chapter-head {
  min-height: 34px;
}

.chapter-head a {
  color: var(--gmail-secondary);
  font-size: 14px;
  font-weight: 600;
}

.page-list {
  margin-top: 0;
}

.page-row,
.search-result-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 0 12px;
  border-left: 0;
  border-bottom: 1px solid var(--gmail-line);
  background: #fff;
}

.page-row:hover,
.search-result-row:hover {
  background: #f2f6fc;
  box-shadow: inset 0 1px 0 #e7eaf0, inset 0 -1px 0 #e7eaf0;
}

.page-row-main strong,
.search-result-row strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--gmail-text);
}

.page-row-date {
  color: var(--gmail-muted);
  font-size: 12px;
  font-weight: 500;
}

.file-ext {
  min-width: 36px;
  padding: 3px 7px;
  border: 0;
  border-radius: 12px;
  background: #eef1f5;
  color: var(--gmail-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.search-summary {
  padding-bottom: 12px;
  border-bottom-color: var(--gmail-line);
}

.search-summary strong {
  font-size: 15px;
}

.search-summary span {
  color: var(--gmail-muted);
  font-size: 13px;
}

.search-result-row {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 56px;
}

.search-result-row > div > span {
  margin-top: 3px;
  color: var(--gmail-muted);
  font-size: 13px;
}

.announcement-item {
  padding: 18px 8px;
  border-bottom: 1px solid var(--gmail-line);
}

.announcement-title-line h2 {
  font-size: 16px;
  font-weight: 600;
}

.pin-mark {
  padding: 3px 8px;
  border: 0;
  border-radius: 12px;
  background: #fef3c7;
  color: #795600;
  font-size: 12px;
}

.announcement-meta {
  gap: 8px;
  margin-top: 6px;
  color: var(--gmail-muted);
  font-size: 13px;
}

.announcement-body {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.7;
}

.announcement-actions {
  margin-top: 12px;
  font-size: 13px;
}

.submission-row,
.private-row,
.review-row {
  min-height: 56px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gmail-line);
}

.submission-row:hover,
.private-row:hover,
.review-row:hover {
  background: #f2f6fc;
}

.submission-row a,
.private-row-main strong,
.review-main a {
  font-size: 14px;
  font-weight: 600;
}

.submission-row > div:first-child > div,
.private-row-main span,
.review-main span {
  margin-top: 3px;
  color: var(--gmail-muted);
  font-size: 13px;
}

.review-status {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.form-help,
.form-note,
.format-note,
.file-picker-help,
.viewer-note {
  color: var(--gmail-muted);
  font-size: 13px;
  line-height: 1.55;
}

.password-pending {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
}

.admin-table {
  font-size: 13px;
}

.admin-table th {
  padding: 10px 12px;
  color: var(--gmail-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.admin-table td {
  padding: 13px 12px;
  color: var(--gmail-secondary);
}

.admin-doc-title {
  font-size: 14px;
  font-weight: 600;
}

.table-ext {
  padding: 3px 8px;
  border: 0;
  border-radius: 12px;
  background: #eef1f5;
  color: var(--gmail-muted);
  font-family: inherit;
  font-size: 11px;
}

.hierarchy-cell {
  color: var(--gmail-muted) !important;
  font-size: 13px;
}

.admin-section h2 {
  font-size: 16px;
}

.admin-section-head span,
.current-user {
  color: var(--gmail-muted);
  font-size: 12px;
}

.admin-form label,
.form-grid label,
.hierarchy-form-grid label,
.editor-field,
.file-replace-row label {
  gap: 7px;
  color: var(--gmail-secondary);
  font-size: 13px;
  font-weight: 600;
}

.admin-form small,
.form-grid small,
.hierarchy-form-grid small,
.file-replace-row small {
  color: var(--gmail-muted);
  font-size: 12px;
}

.admin-form input,
.form-grid input,
.hierarchy-form-grid input,
.admin-form select,
.form-grid select {
  min-height: 42px;
  padding: 0 12px;
  border-color: #cbd2da;
  border-radius: 8px;
  font-size: 14px;
}

.file-picker {
  min-height: 126px;
  border-color: #cbd2da;
  border-radius: 12px;
  background: #f8fafd;
}

.file-picker-title {
  font-size: 15px;
  font-weight: 600;
}

.editor-surface {
  border-color: var(--gmail-line);
  border-radius: 14px;
}

.reader-shell {
  width: min(100%, 1200px);
  grid-template-columns: minmax(0, 850px) 220px;
  gap: 48px;
  padding: 36px 46px 100px;
}

.reader-head {
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom-color: var(--gmail-line);
}

.reader-head h1 {
  font-size: 30px;
  font-weight: 600;
}

.reader-meta {
  margin-top: 10px;
  color: var(--gmail-muted);
  font-size: 12px;
}

.reader-toc {
  top: calc(var(--topbar-height) + 28px);
  padding-left: 18px;
  border-left-color: var(--gmail-line);
}

.reader-toc-title {
  color: var(--gmail-secondary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.reader-toc .toc a {
  padding: 5px 0;
  color: var(--gmail-muted);
  font-size: 13px;
}

.reader-file-info dt {
  color: var(--gmail-muted);
  font-size: 12px;
}

.reader-file-info dd {
  color: var(--gmail-secondary);
  font-size: 13px;
}

.reader-content .prose {
  font-size: 15px;
  line-height: 1.8;
}

.reader-content .prose pre {
  border-color: #dfe3e8;
  border-radius: 10px;
  background: #f6f8fa;
}

.board-empty {
  padding: 54px 0;
}

.board-empty strong {
  font-size: 15px;
}

.board-empty p {
  margin-top: 6px;
  color: var(--gmail-muted);
  font-size: 13px;
}

.login-page {
  background: var(--gmail-bg);
}

.login-box {
  border-color: var(--gmail-line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(60,64,67,.08);
}

.login-box h1 {
  font-size: 22px;
  font-weight: 600;
}

.login-box > p,
.login-help,
.login-form label {
  font-size: 13px;
}

.login-form input {
  height: 44px;
  border-color: #cbd2da;
  border-radius: 8px;
  font-size: 14px;
}

@media (max-width: 900px) {
  :root {
    --workspace-sidebar: 218px;
  }

  .content-page,
  .board-page,
  .simple-form-page {
    padding-left: 28px;
    padding-right: 28px;
  }

  .library-search {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-topbar {
    padding: 0 12px;
  }

  .app-wordmark-text {
    display: none;
  }

  .account-name {
    display: none;
  }

  .workspace-main {
    margin: 0;
    border-radius: 0;
  }

  .workspace-sidebar-scroll {
    padding: 8px 10px 8px 0;
  }

  .workspace-nav > a {
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 0 19px 19px 0;
    font-size: 13px;
  }

  .content-page,
  .board-page,
  .simple-form-page,
  .reader-shell {
    padding: 24px 16px 64px;
  }

  .content-heading h1,
  .board-head h1,
  .simple-form-head h1 {
    font-size: 22px;
  }

  .content-head-actions {
    gap: 8px;
  }

  .page-row,
  .search-result-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .page-row-date {
    display: none;
  }

  .chapter-list {
    margin-left: 18px;
  }
}


/* Gmail-like admin and form readability */
.admin-layout {
  background: var(--gmail-bg);
}

.admin-sidebar {
  border-right: 0;
  background: var(--gmail-bg);
}

.admin-sidebar-title {
  min-height: 46px;
  display: flex;
  align-items: center;
  margin: 0 4px 11px;
  padding: 0 10px 8px;
  border-bottom: 1px solid #dde3ea;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}

.admin-nav {
  gap: 3px;
}

.admin-nav a {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 20px;
  color: var(--gmail-secondary);
  font-size: 14px;
}

.admin-nav a:hover {
  background: #e9edf3;
}

.admin-nav a.current {
  color: var(--gmail-active-text);
  background: var(--gmail-active);
  font-weight: 700;
}

.admin-main {
  margin: 8px 12px 0 0;
  border-radius: 18px 18px 0 0;
  background: #fff;
}

.admin-breadcrumb,
.simple-form-head > a {
  color: var(--gmail-muted);
  font-size: 13px;
}

.editor-field textarea {
  font-size: 14px;
}

.file-replace-row strong,
.danger-section strong {
  font-size: 14px;
}

.file-replace-row > div > span,
.danger-section p {
  color: var(--gmail-muted);
  font-size: 13px;
}

.table-action a,
.link-button {
  font-size: 13px;
}

.notice {
  font-size: 13px;
}

@media (max-width: 680px) {
  .admin-main {
    margin: 0;
    border-radius: 0;
  }
}


.file-ext,
.password-pending {
  font-size: 12px;
}


/* ============================================================
   Windows-style folder explorer
   ============================================================ */

.explorer-page {
  width: min(100%, 1220px);
  margin: 0 auto;
  padding: 26px 30px 84px;
}

.explorer-head {
  min-height: 70px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 12px;
}

.explorer-head h1 {
  margin: 0 0 12px;
  color: var(--gmail-text);
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.02em;
}

.explorer-toolbar {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0 12px;
  border-bottom: 1px solid var(--gmail-line);
}

.explorer-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: #edf1f5;
  color: var(--gmail-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.explorer-button::-webkit-details-marker {
  display: none;
}

.explorer-button:hover {
  background: #e2e7ed;
}

.explorer-button.subtle {
  margin-left: auto;
  background: transparent;
  color: var(--gmail-secondary);
}

.explorer-up-link {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  color: var(--gmail-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.explorer-up-link:hover {
  color: var(--gmail-blue);
}

.explorer-up-arrow {
  position: relative;
  top: -1px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

.plus-icon,
.upload-icon {
  font-size: 16px;
  line-height: 1;
}

.toolbar-create {
  position: relative;
}

.toolbar-popover {
  width: 290px;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--gmail-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(60,64,67,.18);
}

.toolbar-popover label,
.single-field {
  display: grid;
  gap: 7px;
  color: var(--gmail-secondary);
  font-size: 13px;
  font-weight: 600;
}

.toolbar-popover input,
.single-field input,
.item-menu-popover input,
.item-menu-popover select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #cbd2da;
  border-radius: 7px;
  background: #fff;
  color: var(--gmail-text);
  font-size: 13px;
  outline: none;
}

.explorer-search-note {
  padding: 13px 4px;
  color: var(--gmail-secondary);
  font-size: 13px;
}

.explorer-table {
  width: 100%;
  overflow: visible;
}

.explorer-row {
  display: grid;
  grid-template-columns: 36px minmax(260px, 1fr) 145px 145px 95px 44px;
  align-items: center;
  min-height: 48px;
  gap: 12px;
  padding: 0 8px;
}

.explorer-columns {
  min-height: 38px;
  border-bottom: 1px solid var(--gmail-line);
  color: var(--gmail-muted);
  font-size: 12px;
  font-weight: 500;
}

.explorer-item {
  border-bottom: 1px solid #edf0f3;
  color: var(--gmail-secondary);
  font-size: 13px;
}

.explorer-item:hover {
  background: #f2f6fc;
  box-shadow: inset 0 1px 0 #e7eaf0, inset 0 -1px 0 #e7eaf0;
}

.library-pin-mark {
  flex: 0 0 auto;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 9px;
  background: #e8f0fe;
  color: #174ea6;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
}

.item-menu-popover .library-pin-action {
  color: #174ea6;
  background: #e8f0fe;
}

.item-menu-popover .library-pin-action:hover {
  background: #dce8fb;
}

.explorer-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--gmail-text);
}

.explorer-name strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explorer-date {
  color: var(--gmail-muted);
}

.folder-icon {
  width: 27px;
  height: 19px;
  position: relative;
  flex: 0 0 27px;
  border-radius: 3px 3px 4px 4px;
  background: #f2c94c;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.08);
}

.folder-icon::before {
  content: "";
  width: 12px;
  height: 5px;
  position: absolute;
  top: -4px;
  left: 2px;
  border-radius: 3px 3px 0 0;
  background: #e7b936;
}

.file-icon {
  width: 27px;
  height: 31px;
  position: relative;
  flex: 0 0 27px;
  display: grid;
  place-items: end center;
  padding-bottom: 3px;
  border: 1px solid #c9d2dc;
  border-radius: 3px;
  background: #fff;
  color: var(--gmail-blue);
}

.file-icon::before {
  content: "";
  width: 8px;
  height: 8px;
  position: absolute;
  top: -1px;
  right: -1px;
  border-left: 1px solid #c9d2dc;
  border-bottom: 1px solid #c9d2dc;
  background: #edf3fb;
}

.file-icon span {
  max-width: 24px;
  overflow: hidden;
  font-size: 7px;
  font-weight: 700;
  text-overflow: ellipsis;
}

.explorer-actions {
  position: relative;
  text-align: right;
}

.item-menu {
  position: relative;
}

.item-menu > summary {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  color: var(--gmail-muted);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.item-menu > summary::-webkit-details-marker {
  display: none;
}

.item-menu > summary:hover,
.item-menu[open] > summary {
  background: #e5eaf0;
  color: var(--gmail-text);
}

.item-menu-popover {
  width: 280px;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 70;
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--gmail-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(60,64,67,.2);
  text-align: left;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.item-menu-popover form {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf0f3;
}

.item-menu-popover form:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.item-menu-popover label {
  display: grid;
  gap: 5px;
  color: var(--gmail-secondary);
  font-size: 12px;
  font-weight: 600;
}

.item-menu-popover button {
  min-height: 32px;
  justify-self: end;
  padding: 0 10px;
  border: 0;
  border-radius: 16px;
  background: #edf1f5;
  color: var(--gmail-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.item-menu-popover button:hover {
  background: #e2e7ed;
}

.item-menu-popover .danger-link {
  color: #b3261e;
  background: #fce8e6;
}

.explorer-empty {
  padding: 72px 12px;
  color: var(--gmail-muted);
  font-size: 14px;
  text-align: center;
}

.compact-upload-form {
  max-width: 720px;
}

.single-field {
  margin-top: 18px;
}

.single-field small {
  color: var(--gmail-muted);
  font-size: 12px;
  font-weight: 400;
}

/* Student first-login onboarding */

.onboarding-page {
  min-height: calc(100vh - var(--topbar-height));
  display: grid;
  place-items: start center;
  padding: 52px 20px 80px;
}

.onboarding-card {
  width: min(540px, 100%);
  padding: 28px 30px 30px;
  border: 1px solid var(--gmail-line);
  border-radius: 16px;
  background: #fff;
}

.onboarding-card h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.onboarding-card > p {
  margin: 7px 0 24px;
  color: var(--gmail-muted);
  font-size: 14px;
}

.onboarding-form {
  gap: 16px;
}

.onboarding-date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.onboarding-date-grid label {
  display: grid;
  gap: 7px;
  color: var(--gmail-secondary);
  font-size: 13px;
  font-weight: 600;
}

.onboarding-date-grid input {
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid #cbd2da;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}

.onboarding-submit {
  width: 100%;
  margin-top: 4px;
}

@media (max-width: 820px) {
  .explorer-head {
    flex-direction: column;
  }

  .explorer-head .library-search {
    width: 100%;
  }

  .explorer-row {
    grid-template-columns: 36px minmax(0, 1fr) 120px 42px;
  }

  .explorer-row > :nth-child(4),
  .explorer-row > :nth-child(5) {
    display: none;
  }
}

@media (max-width: 560px) {
  .explorer-page {
    padding: 20px 12px 60px;
  }

  .explorer-toolbar {
    flex-wrap: wrap;
  }

  .explorer-button.subtle {
    margin-left: 0;
  }

  .explorer-row {
    grid-template-columns: 36px minmax(0, 1fr) 42px;
    gap: 6px;
  }

  .explorer-row > :nth-child(3),
  .explorer-row > :nth-child(4),
  .explorer-row > :nth-child(5) {
    display: none;
  }

  .explorer-columns {
    display: none;
  }

  .onboarding-date-grid {
    grid-template-columns: 1fr;
  }
}

/* 206 Lab Docs brand + announcement/feedback additions */
.app-wordmark-logo {
  display: block;
  width: auto;
  height: 42px;
  object-fit: contain;
}

.login-wordmark {
  display: inline-block;
  width: min(100%, 250px);
}

.login-logo {
  display: block;
  width: 100%;
  height: auto;
}

.item-menu-link {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--gmail-secondary);
  font-size: 13px;
}

.item-menu-link:hover {
  background: var(--gmail-hover);
  color: var(--gmail-text);
}

.announcement-title-line h2 a {
  color: inherit;
}

.announcement-title-line h2 a:hover {
  color: var(--gmail-blue);
}

.announcement-preview {
  max-width: 820px;
  margin: 14px 0 0;
  color: var(--gmail-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.announcement-read-more {
  font-weight: 600;
  color: var(--gmail-blue);
}

.announcement-detail-page {
  max-width: 980px;
}

.announcement-detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.announcement-detail-top > a {
  color: var(--gmail-muted);
  font-size: 13px;
}

.announcement-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.announcement-detail-actions form {
  margin: 0;
}

.danger-button {
  color: #b3261e;
}

.announcement-detail-card {
  padding: 8px 4px 40px;
}

.announcement-detail-card h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -.025em;
}

.announcement-detail-body {
  max-width: 840px;
  margin-top: 32px;
  font-size: 15px;
  line-height: 1.8;
}

.announcement-detail-body img,
.rich-editor img {
  display: block;
  max-width: min(100%, 760px);
  height: auto;
  margin: 18px 0;
  border-radius: 8px;
}

.announcement-attachments {
  max-width: 840px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--gmail-line);
}

.announcement-attachments h2,
.existing-attachments h2,
.feedback-list-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.announcement-attachment-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.announcement-attachment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--gmail-line);
  border-radius: 9px;
}

.announcement-attachment-row:hover {
  background: var(--gmail-hover);
}

.attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gmail-text);
}

.attachment-size {
  color: var(--gmail-muted);
  font-size: 12px;
}

.attachment-download {
  color: var(--gmail-blue);
  font-size: 13px;
  font-weight: 600;
}

.announcement-editor-page {
  max-width: 980px;
}

.existing-attachments {
  margin: 0 0 22px;
  padding: 16px;
  border: 1px solid var(--gmail-line);
  border-radius: 10px;
  background: #fff;
}

.existing-attachment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--gmail-line);
  font-size: 13px;
}

.existing-attachment-row:last-child {
  border-bottom: 0;
}

.existing-attachment-row > span {
  color: var(--gmail-muted);
}

.existing-attachment-row form {
  margin: 0;
}

.rich-editor-field {
  display: grid;
  gap: 7px;
}

.field-label,
.announcement-attachment-field > span {
  color: var(--gmail-secondary);
  font-size: 13px;
  font-weight: 600;
}

.field-label small,
.announcement-attachment-field small {
  color: var(--gmail-muted);
  font-weight: 400;
}

.rich-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 7px;
  border: 1px solid #cbd2da;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: #f8fafd;
}

.rich-editor-toolbar button {
  min-height: 30px;
  padding: 4px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--gmail-secondary);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.rich-editor-toolbar button:hover {
  background: var(--gmail-hover);
}

.toolbar-separator {
  width: 1px;
  height: 24px;
  margin: 3px 3px;
  background: #d7dce3;
}

.rich-editor {
  min-height: 320px;
  padding: 18px 20px;
  border: 1px solid #cbd2da;
  border-radius: 0 0 9px 9px;
  background: #fff;
  color: var(--gmail-text);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  outline: none;
  overflow-wrap: anywhere;
}

.rich-editor:focus {
  border-color: #7aa7e8;
  box-shadow: 0 0 0 2px rgba(11,87,208,.08);
}

.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: #9aa0a6;
  pointer-events: none;
}

.announcement-attachment-field {
  display: grid;
  gap: 8px;
}

.announcement-attachment-field input[type="file"] {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #cbd2da;
  border-radius: 8px;
  background: #fff;
}

.feedback-page {
  max-width: 980px;
}

.feedback-compose {
  margin-bottom: 32px;
  padding: 20px;
  border: 1px solid var(--gmail-line);
  border-radius: 12px;
  background: #fff;
}

.feedback-form textarea,
.feedback-manage-form textarea {
  resize: vertical;
}

.feedback-list {
  display: grid;
  gap: 0;
}

.feedback-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gmail-line);
}

.feedback-list-head > span {
  color: var(--gmail-muted);
  font-size: 13px;
}

.feedback-item {
  padding: 22px 4px;
  border-bottom: 1px solid var(--gmail-line);
}

.feedback-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.feedback-item h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.feedback-meta {
  display: flex;
  gap: 8px;
  margin-top: 5px;
  color: var(--gmail-muted);
  font-size: 12px;
}

.feedback-status {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
}

.feedback-status-pending {
  background: #fef3c7;
  color: #795600;
}

.feedback-status-in_progress {
  background: #d3e3fd;
  color: #174ea6;
}

.feedback-status-completed {
  background: #ceead6;
  color: #137333;
}

.feedback-status-closed {
  background: #e8eaed;
  color: #5f6368;
}

.feedback-body {
  margin-top: 14px;
  white-space: pre-wrap;
  color: var(--gmail-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.feedback-attachment-field {
  display: grid;
  gap: 7px;
}

.feedback-attachment-field > span {
  color: var(--gmail-secondary);
  font-size: 13px;
  font-weight: 600;
}

.feedback-attachment-field small {
  color: var(--gmail-muted);
  font-size: 12px;
  font-weight: 400;
}

.feedback-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.feedback-attachments a {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid var(--gmail-line);
  border-radius: 7px;
  background: #fff;
  color: var(--gmail-secondary);
  font-size: 12px;
}

.feedback-attachments a:hover {
  background: var(--gmail-hover);
}

.feedback-attachments a span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-attachments a small {
  flex: 0 0 auto;
  color: var(--gmail-muted);
}

.feedback-manage-form {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 9px;
  background: #f8fafd;
}

.feedback-manage-form label {
  display: grid;
  gap: 6px;
  color: var(--gmail-secondary);
  font-size: 12px;
  font-weight: 600;
}

.feedback-note-field textarea {
  min-height: 72px;
}

.feedback-admin-note {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 9px;
  background: #f1f3f4;
}

.feedback-admin-note strong {
  font-size: 13px;
}

.feedback-admin-note p {
  margin: 6px 0 0;
  white-space: pre-wrap;
  color: var(--gmail-secondary);
  font-size: 13px;
  line-height: 1.65;
}

@media (max-width: 720px) {
  .app-wordmark-logo {
    height: 36px;
  }

  .announcement-detail-top,
  .feedback-item-head {
    align-items: stretch;
    flex-direction: column;
  }

  .feedback-manage-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .announcement-attachment-row,
  .existing-attachment-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .attachment-download,
  .existing-attachment-row form {
    grid-column: 1 / -1;
  }
}

/* Round 2: separated brand, clearer toggles, verification and graduation flow */
.app-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-icon-crop {
  width: 42px;
  height: 42px;
  display: block;
  overflow: hidden;
  flex: 0 0 auto;
  border-radius: 9px;
}

.brand-icon-crop img {
  display: block;
  width: auto;
  height: 42px;
  max-width: none;
  transform: translateX(-4px);
}

.app-wordmark-text {
  display: inline-block;
  color: var(--gmail-text);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.login-wordmark {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.login-brand-icon {
  width: 46px;
  height: 46px;
}

.login-brand-icon img {
  height: 46px;
}

.login-wordmark-text {
  color: var(--gmail-text);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.02em;
}

.rich-editor-toolbar button.is-active,
.rich-editor-toolbar button[aria-pressed="true"] {
  background: var(--gmail-active);
  color: var(--gmail-blue);
  box-shadow: inset 0 0 0 1px rgba(11,87,208,.12);
  font-weight: 650;
}

.switch-row {
  position: relative;
  width: fit-content;
  min-height: 34px;
  gap: 9px !important;
  cursor: pointer;
  user-select: none;
}

.switch-row > input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-visual {
  width: 38px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: #c7cbd1;
  transition: background .15s ease;
}

.switch-visual > span {
  width: 18px;
  height: 18px;
  display: block;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
  transition: transform .15s ease;
}

.switch-row.is-on .switch-visual {
  background: var(--gmail-blue);
}

.switch-row.is-on .switch-visual > span {
  transform: translateX(16px);
}

.switch-state {
  min-width: 42px;
  color: var(--gmail-muted);
  font-size: 12px;
  font-weight: 600;
}

.switch-row.is-on .switch-state {
  color: var(--gmail-blue);
}

.email-verification-block {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--gmail-line);
  border-radius: 10px;
  background: #f8fafd;
}

.email-verification-block > label {
  display: grid;
  gap: 7px;
}

.email-verify-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.email-code-button {
  min-width: 106px;
  white-space: nowrap;
}

.email-verified-badge {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 14px;
  background: #ceead6;
  color: #137333;
  font-size: 12px;
  font-weight: 650;
}

.warning-help {
  color: #9a6700 !important;
}

.email-status {
  display: inline-flex;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 650;
}

.email-status.verified {
  color: #137333;
  background: #ceead6;
}

.email-status.unverified {
  color: #9a6700;
  background: #fef3c7;
}

.graduation-export-page {
  min-height: 100vh;
  background: var(--gmail-bg);
}

.graduation-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.graduation-card {
  width: min(100%, 680px);
  padding: 34px;
  border: 1px solid var(--gmail-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(60,64,67,.08);
}

.graduation-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  color: var(--gmail-text);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -.02em;
}

.graduation-card h1 {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 650;
}

.graduation-card > p {
  color: var(--gmail-secondary);
  line-height: 1.7;
}

.graduation-actions {
  margin: 24px 0 18px;
}

.graduation-download {
  min-height: 42px;
}

.graduation-data-note {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f8fafd;
}

.graduation-data-note strong {
  font-size: 13px;
}

.graduation-data-note p {
  margin: 6px 0 0;
  color: var(--gmail-secondary);
  font-size: 13px;
  line-height: 1.65;
}

.graduation-cleanup-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--gmail-line);
}

.cleanup-consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--gmail-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.cleanup-consent input {
  margin-top: 3px;
}

.graduation-note {
  margin-top: 18px;
  color: var(--gmail-muted) !important;
  font-size: 12px;
}

@media (max-width: 720px) {
  .brand-icon-crop {
    width: 38px;
    height: 38px;
  }

  .brand-icon-crop img {
    height: 38px;
  }

  .app-wordmark-text {
    display: inline-block;
    font-size: 17px;
  }

  .email-verify-row {
    grid-template-columns: 1fr;
  }

  .graduation-card {
    padding: 24px 20px;
  }
}

/* Round 3: Gmail-like sidebar, blue brand, removable file picks, email rebind */
.app-wordmark-text,
.login-wordmark-text {
  color: var(--gmail-blue);
}

.sidebar-toggle {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-content: center;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.sidebar-toggle:hover {
  background: var(--gmail-hover);
}

.sidebar-toggle span {
  width: 20px;
  height: 2px;
  display: block;
  border-radius: 2px;
  background: #5f6368;
}

.sidebar-collapsed {
  --workspace-sidebar: 72px;
}

.sidebar-collapsed .workspace-sidebar {
  overflow: hidden;
}

.sidebar-collapsed .workspace-sidebar-scroll {
  padding-right: 8px;
}

.sidebar-collapsed .workspace-nav > a {
  width: 48px;
  min-height: 48px;
  margin: 0 auto 4px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}

.sidebar-collapsed .workspace-nav > a > span:not(.nav-symbol) {
  display: none;
}

.sidebar-collapsed .workspace-nav .nav-symbol {
  width: 24px;
  flex: 0 0 24px;
  text-align: center;
}

.sidebar-collapsed .workspace-nav .nav-symbol svg {
  width: 22px;
  height: 22px;
}

.sidebar-collapsed .workspace-divider,
.sidebar-collapsed .knowledge-tree {
  display: none;
}

.reader-edit-link {
  color: var(--gmail-blue) !important;
  font-weight: 600;
}

.file-selection-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.file-selection-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 6px 9px;
  border: 1px solid var(--gmail-line);
  border-radius: 8px;
  background: #f8fafd;
}

.file-selection-meta {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.file-selection-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}

.file-selection-meta span {
  flex: 0 0 auto;
  color: var(--gmail-muted);
  font-size: 11px;
}

.file-selection-remove {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #b3261e;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.file-selection-remove:hover {
  background: #fce8e6;
}

.current-email-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0;
  padding: 16px 18px;
  border: 1px solid var(--gmail-line);
  border-radius: 10px;
  background: #f8fafd;
}

.current-email-card > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.current-email-card > div > span {
  color: var(--gmail-muted);
  font-size: 12px;
}

.current-email-card strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.email-change-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
}

.email-change-entry p {
  margin: 0;
  color: var(--gmail-secondary);
  font-size: 13px;
}

@media (max-width: 720px) {
  .sidebar-toggle {
    display: none;
  }

  .sidebar-collapsed {
    --workspace-sidebar: 218px;
  }

  .email-change-entry {
    align-items: stretch;
    flex-direction: column;
  }

  .file-selection-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}

/* Folder upload */
.upload-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.upload-mode-card {
  min-width: 0;
}

.upload-mode-head {
  margin-bottom: 10px;
}

.upload-mode-head h2 {
  margin: 0;
  color: var(--gmail-text);
  font-size: 16px;
  font-weight: 600;
}

.upload-mode-head p {
  margin: 5px 0 0;
  color: var(--gmail-muted);
  font-size: 12px;
  line-height: 1.55;
}

.folder-upload-card {
  padding: 18px;
  border: 1px solid var(--gmail-line);
  border-radius: 12px;
  background: #fff;
}

.folder-picker {
  min-height: 150px;
}

.folder-upload-summary {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f1f3f4;
  color: var(--gmail-secondary);
  font-size: 13px;
}

.folder-upload-progress {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.folder-upload-progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e6ea;
}

.folder-upload-progress-track > span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--gmail-blue);
  transition: width .12s linear;
}

#folder-upload-progress-text {
  overflow-wrap: anywhere;
  color: var(--gmail-secondary);
  font-size: 12px;
}

.folder-upload-errors {
  max-height: 220px;
  margin-top: 12px;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid #f1c7c3;
  border-radius: 8px;
  background: #fce8e6;
  color: #8c1d18;
  font-size: 12px;
}

.folder-upload-errors strong {
  display: block;
  margin-bottom: 5px;
}

.folder-upload-errors ul {
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 900px) {
  .upload-mode-grid {
    grid-template-columns: 1fr;
  }
}

/* Unified file / folder upload */
.unified-upload-panel {
  width: min(100%, 900px);
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--gmail-line);
  border-radius: 12px;
  background: #fff;
}

.unified-upload-dropzone {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 30px 22px;
  border: 1px dashed #c4ccd7;
  border-radius: 12px;
  background: #f8fafd;
  text-align: center;
  outline: none;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.unified-upload-dropzone:focus-visible,
.unified-upload-dropzone.is-dragging {
  border-color: var(--gmail-blue);
  background: #eef5ff;
  box-shadow: 0 0 0 3px rgba(11, 87, 208, .1);
}

.unified-upload-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f0fe;
  color: var(--gmail-blue);
  font-size: 24px;
  line-height: 1;
}

.unified-upload-dropzone > strong {
  color: var(--gmail-text);
  font-size: 17px;
  font-weight: 600;
}

.unified-upload-dropzone > p {
  max-width: 620px;
  margin: 0;
  color: var(--gmail-muted);
  font-size: 13px;
  line-height: 1.6;
}

.unified-upload-picker-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 7px;
}

.unified-upload-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 9px;
  background: #f1f3f4;
}

.unified-upload-selection > div {
  min-width: 0;
}

.unified-upload-selection strong,
.unified-upload-selection p {
  margin: 0;
}

.unified-upload-selection strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--gmail-text);
  font-size: 13px;
}

.unified-upload-selection p {
  margin-top: 3px;
  color: var(--gmail-muted);
  font-size: 12px;
}

.unified-upload-title {
  margin: 0;
}

@media (max-width: 720px) {
  .unified-upload-panel {
    padding: 14px;
  }

  .unified-upload-dropzone {
    min-height: 190px;
    padding: 24px 14px;
  }

  .unified-upload-selection {
    align-items: stretch;
    flex-direction: column;
  }
}

/* 206 Lab Docs wordmark */
.app-wordmark,
.login-wordmark {
  gap: 0;
}

.labdocs-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: .16em;
  color: #14233b;
  font-family: "Segoe UI Variable Display", "Segoe UI", Arial, sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: 1;
  white-space: nowrap;
}

.labdocs-wordmark-number,
.labdocs-wordmark-name {
  display: inline-block;
}

.labdocs-wordmark-number {
  display: inline-block;
  padding-right: .09em;
  margin-right: -.025em;
  overflow: visible;
  background: linear-gradient(135deg, #7650df 0%, #5d63ef 46%, #2f8df7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  letter-spacing: -.055em;
}

.labdocs-wordmark-name {
  color: #14233b;
  font-weight: 800;
  letter-spacing: -.055em;
}

.login-wordmark .labdocs-wordmark {
  font-size: 30px;
}

.graduation-brand .labdocs-wordmark {
  font-size: 24px;
}

@media (max-width: 720px) {
  .app-wordmark .labdocs-wordmark {
    font-size: 20px;
  }

  .login-wordmark .labdocs-wordmark {
    font-size: 26px;
  }
}


/* Baidu-Netdisk-style library selection */
.explorer-select-cell {
  display: grid;
  place-items: center;
}

.explorer-select-cell input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--gmail-blue);
  cursor: pointer;
}

.explorer-item .explorer-select-cell input {
  opacity: 0;
  transition: opacity .12s ease;
}

.explorer-item:hover .explorer-select-cell input,
.explorer-item.is-selected .explorer-select-cell input {
  opacity: 1;
}

.explorer-item.is-selected {
  background: #eaf3ff;
  box-shadow: inset 0 1px 0 #dbe9fb, inset 0 -1px 0 #dbe9fb;
}

.library-selection-toolbar[hidden],
#library-normal-toolbar[hidden] {
  display: none;
}

.library-selection-toolbar > strong {
  color: var(--gmail-secondary);
  font-size: 13px;
  font-weight: 600;
}

.library-selection-toolbar .explorer-button.subtle {
  margin-left: 0;
}

.library-selection-toolbar .explorer-button.danger {
  background: #fce8e6;
  color: var(--danger);
}

.library-selection-toolbar .explorer-button.danger:hover {
  background: #f8d7d3;
}

.library-selection-toolbar .explorer-button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

@media (hover: none) {
  .explorer-item .explorer-select-cell input {
    opacity: 1;
  }
}


/* Isolated HTML document preview */
.html-shell {
  width: 100%;
  min-height: 72vh;
  overflow: hidden;
  border: 1px solid var(--gmail-line);
  border-radius: 10px;
  background: #fff;
}

.html-frame {
  width: 100%;
  height: 78vh;
  min-height: 620px;
  display: block;
  border: 0;
  background: #fff;
}

@media (max-width: 720px) {
  .html-frame {
    height: 74vh;
    min-height: 520px;
  }
}


/* Transient notices */
.notice {
  transition: opacity .24s ease, transform .24s ease;
}
.notice.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

/* Grouped admin knowledge-base views */
.admin-entry-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.admin-entry-title .folder-icon {
  width: 24px;
  height: 17px;
  flex-basis: 24px;
}
.admin-library-table td:first-child {
  min-width: 260px;
}
.review-batch {
  align-items: flex-start;
  padding: 16px 14px;
}
.review-batch-main {
  flex: 1 1 auto;
}
.review-batch-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gmail-text);
  font-size: 15px;
}
.review-batch-title strong {
  font-weight: 650;
}
.review-batch-files {
  margin-top: 10px;
}
.review-batch-files > summary {
  width: fit-content;
  cursor: pointer;
  color: var(--gmail-blue);
  font-size: 12px;
  list-style: none;
}
.review-batch-files > summary::-webkit-details-marker {
  display: none;
}
.review-batch-file-list {
  max-height: 320px;
  overflow-y: auto;
  display: grid;
  gap: 1px;
  margin-top: 8px;
  border: 1px solid var(--gmail-line);
  border-radius: 8px;
  background: #fff;
}
.review-batch-file-list a {
  min-width: 0;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px;
  border-bottom: 1px solid #edf0f3;
  font-size: 12px !important;
  font-weight: 500 !important;
}
.review-batch-file-list a:last-child {
  border-bottom: 0;
}
.review-batch-file-list a:hover {
  background: #f2f6fc;
}
.review-batch-file-list a span {
  min-width: 0;
  overflow: hidden;
  margin: 0 !important;
  color: var(--gmail-secondary) !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.review-batch-file-list a small {
  flex: 0 0 auto;
  color: var(--gmail-muted);
  white-space: nowrap;
}
.review-batch-actions {
  padding-top: 2px;
}
@media (max-width: 760px) {
  .review-batch {
    flex-direction: column;
  }
  .review-batch-actions {
    width: 100%;
  }
}


/* Windows-Explorer-inspired library controls */
.explorer-head-note {
  max-width: 720px;
  margin: 6px 0 0;
  color: var(--gmail-muted);
  font-size: 12px;
  line-height: 1.55;
}

.library-heading .explorer-up-link + .explorer-head-note {
  margin-top: 8px;
}

.explorer-toolbar-divider {
  width: 1px;
  height: 25px;
  margin: 0 2px;
  background: var(--gmail-line);
}

.toolbar-menu {
  position: relative;
}

.explorer-view-button {
  background: transparent;
  border-color: var(--gmail-line);
}

.toolbar-chevron {
  margin-left: 1px;
  color: var(--gmail-muted);
  font-size: 11px;
}

.sort-icon,
.filter-icon {
  min-width: 14px;
  color: var(--gmail-blue);
  font-size: 16px;
  line-height: 1;
  text-align: center;
}

.explorer-view-popover {
  width: 240px;
  gap: 3px;
  padding: 7px;
}

.explorer-view-popover > button,
.filter-clear-button {
  min-height: 34px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--gmail-secondary);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.explorer-view-popover > button:hover,
.explorer-view-popover > button.is-active,
.filter-clear-button:hover {
  background: #f2f6fc;
  color: var(--gmail-text);
}

.explorer-view-popover > button.is-active::before {
  content: "✓";
  display: inline-block;
  width: 18px;
  color: var(--gmail-blue);
}

.explorer-filter-popover {
  width: 270px;
}

.explorer-filter-popover select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #cbd2da;
  border-radius: 7px;
  background: #fff;
  color: var(--gmail-text);
  font-size: 13px;
}

.library-view-status {
  width: fit-content;
  margin: 10px 0 4px;
  padding: 5px 10px;
  border-radius: 14px;
  background: #eaf2ff;
  color: #345b91;
  font-size: 12px;
}

.explorer-button-accent {
  color: #174ea6;
  background: #e8f0fe;
}
.explorer-button-accent:hover {
  background: #dbe8fd;
}

.public-library-table .explorer-row {
  grid-template-columns:
    36px
    minmax(240px, 1fr)
    120px
    110px
    90px
    165px
    44px;
}

.private-library-table .explorer-row {
  grid-template-columns:
    36px
    minmax(260px, 1fr)
    145px
    145px
    95px
    44px;
}

.explorer-uploader {
  min-width: 0;
  overflow: hidden;
  color: var(--gmail-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explorer-item[draggable="true"] {
  user-select: none;
}

.explorer-item.is-dragging {
  opacity: .45;
}

.explorer-item.is-drop-target {
  background: #e8f0fe;
  box-shadow:
    inset 0 0 0 2px #7aa7e8,
    inset 0 1px 0 #dbe9fb,
    inset 0 -1px 0 #dbe9fb;
}

.item-menu-popover .item-menu-download {
  background: #e8f0fe;
  color: #174ea6;
  font-weight: 650;
}
.item-menu-popover .item-menu-download:hover {
  background: #dbe8fd;
  color: #0b57d0;
}

@media (max-width: 980px) {
  .public-library-table .explorer-row {
    grid-template-columns: 36px minmax(0, 1fr) 115px 140px 42px;
  }
  .public-library-table .explorer-col-type,
  .public-library-table .explorer-col-size {
    display: none;
  }

  .private-library-table .explorer-row {
    grid-template-columns: 36px minmax(0, 1fr) 115px 42px;
  }
  .private-library-table .explorer-col-type,
  .private-library-table .explorer-col-size {
    display: none;
  }
}

@media (max-width: 560px) {
  .public-library-table .explorer-row,
  .private-library-table .explorer-row {
    grid-template-columns: 36px minmax(0, 1fr) 42px;
  }

  .public-library-table .explorer-col-date,
  .public-library-table .explorer-col-type,
  .public-library-table .explorer-col-size,
  .public-library-table .explorer-col-uploader,
  .private-library-table .explorer-col-date,
  .private-library-table .explorer-col-type,
  .private-library-table .explorer-col-size {
    display: none;
  }

  .explorer-toolbar-divider {
    display: none;
  }

}


.admin-nav-section {
  margin: 15px 14px 4px;
  padding-top: 12px;
  border-top: 1px solid var(--gmail-line);
  color: var(--gmail-muted);
  font-size: 11px;
  font-weight: 600;
}


/* Administrator role preview */
.role-preview-banner {
  min-height: 48px;
  position: sticky;
  top: var(--topbar-height);
  z-index: 84;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 7px 24px;
  border-bottom: 1px solid #c7d7f0;
  background: #edf4ff;
  color: #174ea6;
  box-shadow: 0 1px 2px rgba(60,64,67,.08);
}

.role-preview-banner > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.role-preview-banner strong {
  font-size: 13px;
  font-weight: 700;
}

.role-preview-banner span {
  color: #52677f;
  font-size: 12px;
}

.role-preview-banner form {
  margin: 0;
}

.role-preview-banner button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid #9bb9e8;
  border-radius: 15px;
  background: #fff;
  color: #174ea6;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.role-preview-banner button:hover {
  background: #e3edfc;
}

.role-preview-active .workspace-sidebar {
  top: calc(var(--topbar-height) + 48px);
  height: calc(100vh - var(--topbar-height) - 48px);
}

.role-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.role-preview-card {
  min-height: 230px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--gmail-line);
  border-radius: 16px;
  background: #fff;
}

.role-preview-card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #e8f0fe;
  color: #174ea6;
  font-size: 16px;
  font-weight: 750;
}

.role-preview-card h2 {
  margin: 0 0 8px;
  color: var(--gmail-text);
  font-size: 18px;
}

.role-preview-card p,
.role-preview-note p {
  margin: 0;
  color: var(--gmail-muted);
  font-size: 13px;
  line-height: 1.65;
}

.role-preview-card form {
  margin: 0;
}

.role-preview-note {
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid #d8e4f6;
  border-radius: 12px;
  background: #f7faff;
}

.role-preview-note strong {
  display: block;
  margin-bottom: 6px;
  color: var(--gmail-text);
  font-size: 13px;
}

.role-preview-active .explorer-button:disabled,
.role-preview-active .library-search button:disabled,
.role-preview-active .library-search input:disabled {
  cursor: not-allowed;
  opacity: .62;
}

@media (max-width: 720px) {
  .role-preview-banner {
    align-items: flex-start;
    padding: 8px 12px;
  }

  .role-preview-banner > div {
    display: grid;
    gap: 2px;
  }

  .role-preview-grid {
    grid-template-columns: 1fr;
  }
}


/* Admin public-library management actions */
.admin-create-folder {
  position: relative;
}

.admin-create-folder > summary {
  list-style: none;
  cursor: pointer;
}

.admin-create-folder > summary::-webkit-details-marker {
  display: none;
}

.admin-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.admin-row-actions > a {
  min-width: 34px;
}

.admin-item-menu {
  display: inline-block;
  vertical-align: middle;
}

.admin-item-menu > summary {
  width: 30px;
  height: 30px;
}

.admin-library-table th:last-child,
.admin-library-table td:last-child {
  width: 92px;
}

@media (max-width: 900px) {
  .admin-library-table {
    min-width: 980px;
  }
}


/* Grouped submission history */
.submission-group-row {
  min-height: 82px;
}

.submission-group-main {
  min-width: 0;
  flex: 1 1 auto;
}

.submission-group-title {
  min-width: 0;
  display: inline-flex !important;
  align-items: center;
  gap: 12px;
}

.submission-group-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--gmail-text);
  font-size: 15px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submission-group-icon {
  flex: 0 0 auto;
}

.submission-group-meta {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0;
  margin: 7px 0 0 39px !important;
  color: var(--gmail-muted) !important;
  font-size: 12px !important;
}

.submission-group-meta > span + span::before,
.submission-detail-summary > span + span::before {
  content: "·";
  margin: 0 7px;
  color: #a0a7b0;
}

.submission-group-side {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.submission-detail-link {
  color: var(--gmail-blue) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

.submission-back-link {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--gmail-muted);
  font-size: 12px;
}

.submission-detail-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
  color: var(--gmail-muted);
  font-size: 12px;
}

.submission-detail-summary .review-status::before {
  content: none;
  margin: 0;
}

.submission-detail-list {
  border-top: 1px solid var(--gmail-line);
}

.submission-detail-columns,
.submission-detail-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 150px 110px 90px;
  align-items: center;
  gap: 18px;
  padding: 0 10px;
}

.submission-detail-columns {
  min-height: 40px;
  color: var(--gmail-muted);
  font-size: 11px;
  font-weight: 600;
  border-bottom: 1px solid var(--gmail-line);
}

.submission-detail-row {
  min-height: 62px;
  border-bottom: 1px solid #edf0f3;
  color: var(--gmail-secondary);
  font-size: 12px;
}

.submission-detail-row:hover {
  background: #f7f9fc;
}

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

.submission-detail-name > div {
  min-width: 0;
}

.submission-detail-name a {
  display: block;
  overflow: hidden;
  color: var(--gmail-text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submission-detail-name small {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--gmail-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .submission-group-side {
    width: 100%;
    justify-content: space-between;
  }

  .submission-group-meta {
    margin-left: 0 !important;
  }

  .submission-detail-list {
    overflow-x: auto;
  }

  .submission-detail-columns,
  .submission-detail-row {
    min-width: 760px;
  }
}


/* Public knowledge-base section switcher */
.library-heading {
  min-width: 0;
}

.library-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.library-title-row h1 {
  margin: 0;
}

.library-section-menu {
  position: relative;
}

.library-section-menu > summary {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid #d5dbe3;
  border-radius: 15px;
  background: #fff;
  color: var(--gmail-secondary);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.library-section-menu > summary::-webkit-details-marker {
  display: none;
}

.library-section-menu[open] > summary,
.library-section-menu > summary:hover {
  background: #f2f6fc;
  border-color: #c8d2e0;
}

.library-section-popover {
  min-width: 132px;
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 92;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid #d7dce2;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(60,64,67,.18);
}

.library-section-popover a {
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--gmail-text);
  font-size: 13px;
}

.library-section-popover a:hover {
  background: #f2f6fc;
}

.library-section-popover a.current {
  background: #e8f0fe;
  color: #174ea6;
  font-weight: 700;
}

/* Paper library: academic blue folder extracted from the user-provided reference. */
.paper-library-page .folder-icon {
  width: 32px;
  height: 27px;
  flex: 0 0 32px;
  border: 0;
  border-radius: 0;
  background: url("/static/images/paper-folder-academic.png") center / contain no-repeat;
  box-shadow: none;
}

.paper-library-page .folder-icon::before,
.paper-library-page .folder-icon::after {
  content: none;
}

.paper-library-page .explorer-item:hover {
  background: #f5f7fa;
}

.paper-library-page .explorer-name strong {
  font-weight: 650;
}

/* Member profile correction and approval workflow */
.profile-correction-banner {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 7px 24px;
  border-bottom: 1px solid #ead7a1;
  background: #fff8e1;
  color: #5f4b16;
}

.profile-correction-banner > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.profile-correction-banner strong {
  flex: 0 0 auto;
  font-size: 13px;
}

.profile-correction-banner span {
  min-width: 0;
  overflow: hidden;
  color: #6f6241;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-correction-banner > a {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid #d8bd72;
  border-radius: 15px;
  background: #fff;
  color: #5f4b16;
  font-size: 12px;
  font-weight: 700;
}

.profile-current-card,
.profile-pending-card,
.profile-correction-card {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
  padding: 18px 20px;
  border: 1px solid var(--gmail-line);
  border-radius: 12px;
  background: #fff;
}

.profile-current-card {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-current-card > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.profile-current-card span,
.profile-change-grid span {
  color: var(--gmail-muted);
  font-size: 12px;
}

.profile-current-card strong {
  overflow: hidden;
  color: var(--gmail-text);
  font-size: 14px;
  text-overflow: ellipsis;
}

.profile-pending-card {
  border-color: #c7d7f0;
  background: #f7faff;
}

.profile-correction-card {
  border-color: #ead7a1;
  background: #fffaf0;
}

.profile-pending-card > p,
.profile-correction-card > p {
  margin: 0;
  color: var(--gmail-muted);
  font-size: 13px;
}

.profile-change-grid {
  display: grid;
  gap: 8px;
}

.profile-change-grid > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.profile-change-grid b {
  min-width: 0;
  overflow: hidden;
  color: var(--gmail-text);
  font-weight: 600;
  text-overflow: ellipsis;
}

.profile-change-form textarea,
.member-profile-action-form textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.member-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.member-profile-action {
  position: relative;
}

.member-profile-action > summary {
  cursor: pointer;
  list-style: none;
}

.member-profile-action > summary::-webkit-details-marker {
  display: none;
}

.member-profile-action-form {
  width: 300px;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 95;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #d7dce2;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(60,64,67,.2);
  text-align: left;
  white-space: normal;
}

.profile-review-section {
  margin-bottom: 34px;
}

.profile-review-section > h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
}

.profile-review-row {
  align-items: center;
}

@media (max-width: 760px) {
  .library-title-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .profile-correction-banner {
    align-items: flex-start;
    padding: 8px 12px;
  }

  .profile-correction-banner > div {
    display: grid;
    gap: 2px;
  }

  .profile-current-card {
    grid-template-columns: 1fr;
  }

  .profile-change-grid > div {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .profile-change-grid > div > span:nth-of-type(2) {
    display: none;
  }

  .member-profile-action-form {
    width: min(300px, calc(100vw - 36px));
  }
}


/* Writable role-preview sandbox */
.sandbox-mode-banner {
  min-height: 48px;
  position: sticky;
  top: var(--topbar-height);
  z-index: 84;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 7px 24px;
  border-bottom: 1px solid #b9d7c3;
  background: #eef8f1;
  color: #176b3a;
  box-shadow: 0 1px 2px rgba(60,64,67,.08);
}

.sandbox-mode-banner > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.sandbox-mode-banner strong {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 750;
}

.sandbox-mode-banner span {
  min-width: 0;
  overflow: hidden;
  color: #4f6959;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sandbox-mode-banner > a {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid #9bc9aa;
  border-radius: 15px;
  background: #fff;
  color: #176b3a;
  font-size: 12px;
  font-weight: 700;
}

.sandbox-mode-active .workspace-sidebar {
  top: calc(var(--topbar-height) + 48px);
  height: calc(100vh - var(--topbar-height) - 48px);
}

.sandbox-preview-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.sandbox-preview-note > div {
  min-width: 0;
}

.sandbox-preview-note form {
  flex: 0 0 auto;
  margin: 0;
}

@media (max-width: 720px) {
  .sandbox-mode-banner {
    align-items: flex-start;
    padding: 8px 12px;
  }

  .sandbox-mode-banner > div {
    display: grid;
    gap: 2px;
  }

  .sandbox-preview-note {
    align-items: stretch;
    flex-direction: column;
  }
}


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

.sandbox-preview-actions form {
  margin: 0;
}

@media (max-width: 720px) {
  .sandbox-preview-actions {
    align-items: stretch;
    flex-direction: column;
  }
}


/* Personal information edit: two-step email rebind + academic review */
.account-profile-page {
  width: min(100%, 980px);
  padding-top: 34px;
}

.profile-page-head {
  margin-bottom: 26px;
}

.profile-page-head h1 {
  margin-bottom: 0;
}

.profile-section {
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid var(--gmail-line);
  border-radius: 16px;
  background: #fff;
}

.profile-section-head {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.profile-section-head h2 {
  margin: 0;
  color: var(--gmail-text);
  font-size: 18px;
  font-weight: 700;
}

.sandbox-code-badge,
.email-step-state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  background: #eef2f6;
  color: var(--gmail-secondary);
  font-size: 13px;
  font-weight: 650;
}

.email-step-state.success {
  background: #e7f5ec;
  color: #176b3a;
}

.email-rebind-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
}

.email-rebind-step {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 20px;
  border: 1px solid #d9dfe7;
  border-radius: 14px;
  background: #fff;
}

.email-rebind-step.is-active {
  border-color: #b8cbe8;
  box-shadow: inset 0 0 0 1px rgba(23,78,166,.05);
}

.email-rebind-step.is-locked {
  background: #f6f7f9;
  opacity: .58;
}

.email-rebind-step-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.email-rebind-step-title strong {
  color: var(--gmail-text);
  font-size: 16px;
  font-weight: 700;
}

.email-step-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  border-radius: 50%;
  background: #e8f0fe;
  color: #174ea6;
  font-size: 13px;
  font-weight: 750;
}

.email-rebind-value {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 10px;
  background: #f4f6f8;
  color: var(--gmail-text);
  font-size: 15px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.email-rebind-actions,
.email-new-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.email-rebind-actions {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.email-rebind-actions input,
.email-new-row input,
.academic-date-grid input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid #cfd6df;
  border-radius: 10px;
  background: #fff;
  color: var(--gmail-text);
  outline: none;
  font: inherit;
  font-size: 14px;
}

.email-rebind-actions input:focus,
.email-new-row input:focus,
.academic-date-grid input:focus {
  border-color: #7da3d9;
  box-shadow: 0 0 0 3px rgba(26,115,232,.10);
}

.email-new-row input:disabled {
  background: #e9edf1;
  color: #8a939d;
}

.email-rebind-arrow {
  display: grid;
  place-items: center;
  color: #9aa4af;
  font-size: 22px;
  font-weight: 600;
}

.academic-change-form {
  display: grid;
  gap: 18px;
}

.academic-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.academic-date-grid label {
  display: grid;
  gap: 9px;
}

.academic-date-grid label > span {
  color: var(--gmail-text);
  font-size: 14px;
  font-weight: 650;
}

.profile-section-actions {
  display: flex;
  justify-content: flex-end;
}

.profile-review-message {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 13px 15px;
  border: 1px solid #ead7a1;
  border-radius: 10px;
  background: #fff8e6;
  color: #5f4b16;
  font-size: 14px;
}

.academic-pending-grid {
  display: grid;
  gap: 10px;
}

.academic-pending-grid > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 10px;
  background: #f5f7fa;
  font-size: 14px;
}

.academic-pending-grid span {
  color: var(--gmail-secondary);
}

.academic-pending-grid b {
  color: #8a939d;
  text-align: center;
}

/* The account menu belongs to the topbar and must always sit above sandbox banners. */
.app-topbar {
  z-index: 140;
  overflow: visible;
}

.app-topbar .account-menu {
  z-index: 150;
}

.app-topbar .account-popover {
  z-index: 160;
}

.sandbox-mode-banner {
  z-index: 90;
}

@media (max-width: 820px) {
  .email-rebind-flow {
    grid-template-columns: 1fr;
  }

  .email-rebind-arrow {
    transform: rotate(90deg);
  }

  .email-rebind-actions {
    grid-template-columns: 1fr;
  }

  .email-new-row {
    grid-template-columns: 1fr;
  }

  .academic-date-grid {
    grid-template-columns: 1fr;
  }

  .academic-pending-grid > div {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .academic-pending-grid b {
    display: none;
  }
}


/* Public knowledge-base selector lives in the sidebar. */
.workspace-nav-group {
  display: grid;
}

.workspace-nav-group > summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  padding: 9px 18px 9px 24px;
  border-radius: 0 22px 22px 0;
  color: var(--gmail-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.workspace-nav-group > summary::-webkit-details-marker {
  display: none;
}

.workspace-nav-group > summary:hover {
  color: var(--gmail-text);
  background: #e9edf3;
}

.workspace-nav-group > summary.current {
  color: var(--gmail-active-text);
  background: var(--gmail-active);
  font-weight: 700;
}

.workspace-nav-group > summary.current .nav-symbol {
  color: var(--gmail-active-text);
}

.workspace-nav-chevron {
  width: 10px;
  height: 10px;
  position: absolute;
  left: 8px;
  top: 50%;
  flex: 0 0 10px;
  color: var(--gmail-muted);
  transform: translateY(-50%);
}

.workspace-nav-chevron::before {
  content: "";
  width: 6px;
  height: 6px;
  position: absolute;
  top: 1px;
  left: 0;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transform-origin: center;
  transition: transform .12s ease;
}

.workspace-nav-group[open] .workspace-nav-chevron::before {
  transform: rotate(45deg);
}

.workspace-nav-submenu {
  display: grid;
  gap: 2px;
  padding: 5px 12px 7px 44px;
}

.workspace-nav-submenu a {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 16px;
  color: var(--gmail-secondary);
  font-size: 13px;
  font-weight: 500;
}

.workspace-nav-submenu a:hover {
  background: #e9edf3;
  color: var(--gmail-text);
}

.workspace-nav-submenu a.current {
  background: #dce8fb;
  color: var(--gmail-active-text);
  font-weight: 700;
}

.sidebar-collapsed .workspace-nav-group > summary {
  width: 48px;
  min-height: 48px;
  margin: 0 auto 4px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}

.sidebar-collapsed .workspace-nav-group > summary > span:not(.nav-symbol) {
  display: none;
}

.sidebar-collapsed .workspace-nav-chevron {
  display: none;
}

.sidebar-collapsed .workspace-nav-submenu {
  display: none;
}


/* Collapsed public-library flyout */
.collapsed-library-flyout {
  width: 224px;
  position: fixed;
  z-index: 2400;
  padding: 7px;
  border: 1px solid #dfe5ec;
  border-radius: 14px;
  background: #fff;
  box-shadow:
    0 12px 32px rgba(60, 64, 67, .18),
    0 2px 8px rgba(60, 64, 67, .10);
}

.collapsed-library-flyout[hidden] {
  display: none;
}

.collapsed-library-flyout::before {
  content: "";
  width: 10px;
  height: 10px;
  position: absolute;
  left: -6px;
  top: var(--flyout-arrow-top, 24px);
  border-left: 1px solid #dfe5ec;
  border-bottom: 1px solid #dfe5ec;
  background: #fff;
  transform: rotate(45deg);
}

.collapsed-library-flyout-title {
  margin: 1px 3px 5px;
  padding: 8px 9px 9px;
  border-bottom: 1px solid #edf0f4;
  color: var(--gmail-text);
  font-size: 13px;
  font-weight: 700;
}

.collapsed-library-flyout-links {
  display: grid;
  gap: 2px;
}

.collapsed-library-flyout .workspace-nav-submenu a,
.collapsed-library-flyout-link {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--gmail-secondary);
  font-size: 13px;
  font-weight: 500;
}

.collapsed-library-flyout-link:hover {
  background: #f1f3f4;
  color: var(--gmail-text);
}

.collapsed-library-flyout-link.current {
  background: #dce8fb;
  color: var(--gmail-active-text);
  font-weight: 700;
}

.collapsed-library-flyout .library-subnav-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.collapsed-library-flyout .library-subnav-icon svg {
  width: 22px;
  height: 22px;
}

.public-library-nav > summary[data-flyout-open="true"] {
  color: var(--gmail-active-text);
  background: #e8eef8;
}

@media (max-width: 760px) {
  .collapsed-library-flyout {
    display: none !important;
  }

  .sidebar-collapsed .public-library-nav > summary::after {
    display: none;
  }
}


/* Root bootstrap */
.root-setup-form-gap {
  margin-top: 18px;
}

.root-setup-reset {
  margin-top: 10px;
}


/* Root TOTP setup */
.root-authenticator-setup {
  width: min(470px, 100%);
}

.root-totp-setup-card {
  display: grid;
  gap: 16px;
  margin: 20px 0;
  padding: 18px;
  border: 1px solid var(--gmail-line);
  border-radius: 14px;
  background: #f8fafd;
}

.root-totp-setup-card ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
  color: var(--gmail-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.root-secret-field {
  display: grid;
  gap: 7px;
  color: var(--gmail-secondary);
  font-size: 12px;
  font-weight: 650;
}

.root-secret-field input {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--gmail-line);
  border-radius: 8px;
  background: #fff;
  color: var(--gmail-text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 14px;
  letter-spacing: .04em;
}

.root-totp-confirm-form {
  margin-top: 16px;
}

.root-otpauth-details {
  margin-top: 18px;
  color: var(--gmail-muted);
  font-size: 11px;
}

.root-otpauth-details summary {
  cursor: pointer;
}

.root-otpauth-details code {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #f3f5f8;
}

/* Administrator handover and audit log */
.admin-device-page .admin-section + .admin-section { margin-top: 32px; }
.admin-device-page .form-help { margin: 8px 0; }
.admin-device-page details { max-width: 480px; margin-top: 16px; }
.admin-device-page summary { cursor: pointer; font-weight: 600; }
.admin-device-page details .admin-form { margin-top: 16px; }
.admin-device-page .admin-table td { white-space: nowrap; }

.admin-handover-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--gmail-line);
  background: #eef4ff;
  color: var(--gmail-text);
}

.admin-handover-banner > div {
  display: grid;
  gap: 2px;
}

.admin-handover-banner strong {
  font-size: 13px;
}

.admin-handover-banner span {
  color: var(--gmail-secondary);
  font-size: 12px;
}

.admin-handover-banner a {
  flex: 0 0 auto;
  color: var(--gmail-blue);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.handover-person {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.handover-person strong {
  font-size: 18px;
}

.handover-person span,
.handover-status {
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--gmail-blue);
  font-size: 12px;
  font-weight: 650;
}

.handover-flow-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  margin-top: 14px;
}

.handover-flow-summary > div:not(.handover-arrow) {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--gmail-line);
  border-radius: 12px;
  background: #f8fafd;
}

.handover-flow-summary span,
.handover-flow-summary small {
  color: var(--gmail-muted);
  font-size: 12px;
}

.handover-flow-summary strong {
  color: var(--gmail-text);
  font-size: 17px;
}

.handover-arrow {
  display: grid;
  place-items: center;
  color: var(--gmail-muted);
  font-size: 24px;
}

.handover-search-form {
  display: flex;
  gap: 8px;
  margin: 12px 0 18px;
}

.handover-search-form input {
  width: min(420px, 100%);
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--gmail-line);
  border-radius: 9px;
  background: #fff;
  color: var(--gmail-text);
  outline: none;
}

.handover-search-form input:focus {
  border-color: var(--gmail-blue);
  box-shadow: 0 0 0 2px rgba(26,115,232,.12);
}

.handover-empty {
  padding: 28px 16px !important;
  color: var(--gmail-muted);
  text-align: center;
}

.handover-verify-card {
  margin-top: 18px;
}

.handover-verify-form {
  max-width: 560px;
  margin-top: 16px;
}

.handover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.handover-receive-page {
  width: min(820px, calc(100% - 36px));
  margin: 38px auto 70px;
}

.handover-receive-card {
  padding: 28px;
  border: 1px solid var(--gmail-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(60,64,67,.08);
}

.handover-receive-head {
  display: grid;
  gap: 6px;
}

.handover-receive-head h1,
.handover-receive-head p {
  margin: 0;
}

.handover-receive-head p {
  color: var(--gmail-secondary);
}

.handover-kicker {
  color: var(--gmail-blue);
  font-size: 12px;
  font-weight: 700;
}

.handover-receive-note {
  margin: 18px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafd;
  color: var(--gmail-secondary);
  font-size: 13px;
  line-height: 1.65;
}

.handover-receive-form {
  display: grid;
  gap: 14px;
}

.handover-receive-form label {
  display: grid;
  gap: 7px;
  color: var(--gmail-secondary);
  font-size: 13px;
  font-weight: 600;
}

.handover-receive-form input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--gmail-line);
  border-radius: 9px;
  background: #fff;
  color: var(--gmail-text);
}

.handover-reject-form {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--gmail-line);
}

.danger-link {
  color: #b3261e;
}

.admin-log-table-wrap {
  max-height: calc(100vh - 280px);
  overflow: auto;
}

.admin-log-table {
  min-width: 980px;
}

.admin-log-time {
  white-space: nowrap;
  color: var(--gmail-muted);
  font-size: 12px;
}

.admin-log-details {
  min-width: 300px;
  white-space: normal;
  line-height: 1.5;
}

.admin-log-result {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e6f4ea;
  color: #137333;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.admin-log-result.rejected,
.admin-log-result.cancelled {
  background: #fce8e6;
  color: #a50e0e;
}

@media (max-width: 760px) {
  .admin-handover-banner {
    align-items: flex-start;
    padding: 11px 14px;
  }

  .admin-nav {
    overflow-x: auto;
  }

  .admin-nav a {
    white-space: nowrap;
  }

  .handover-flow-summary {
    grid-template-columns: 1fr;
  }

  .handover-arrow {
    transform: rotate(90deg);
  }

  .handover-search-form {
    flex-wrap: wrap;
  }

  .handover-receive-card {
    padding: 20px;
  }
}


/* Administrator attention indicator */
.admin-review-dot {
  width: 8px;
  height: 8px;
  margin-left: 7px;
  border-radius: 50%;
  background: #d93025;
  box-shadow: 0 0 0 2px #fff;
  flex: 0 0 auto;
}

.admin-review-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: auto;
  border-radius: 999px;
  background: #d93025;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  white-space: nowrap;
  flex: 0 0 auto;
}

.account-popover-links a.admin-menu-entry {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-nav a .admin-review-badge {
  margin-left: auto;
}


/* Admin back-to-library control */
.topbar-back-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 17px 0 12px;
  border-radius: 999px;
  background: #f1f4f8;
  color: #293442;
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -.025em;
  line-height: 1;
  text-decoration: none;
  transition: background-color .14s ease, color .14s ease, transform .14s ease;
}

.topbar-back-link:hover {
  background: #e7ecf2;
  color: #1f2937;
}

.topbar-back-link:active {
  transform: translateX(-1px);
}

.topbar-back-link:focus-visible {
  outline: 2px solid #0b57d0;
  outline-offset: 2px;
}

.topbar-back-arrow {
  display: inline-block;
  flex: 0 0 auto;
  margin-top: -2px;
  font-size: 30px;
  font-weight: 500;
  line-height: .8;
}

@media (max-width: 720px) {
  .topbar-back-link {
    min-height: 40px;
    padding: 0 14px 0 10px;
    font-size: 16px;
  }

  .topbar-back-arrow {
    font-size: 26px;
  }
}


/* Library subsection icons */
.workspace-nav-submenu a {
  gap: 9px;
}

.library-subnav-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
}

.library-subnav-icon svg {
  width: 22px;
  height: 22px;
  overflow: visible;
}

.library-icon-outline,
.library-icon-detail,
.library-icon-accent,
.library-icon-shelf,
.library-icon-book-mark {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.library-icon-outline {
  stroke: #49515c;
  stroke-width: 1.8;
}

.library-icon-detail {
  stroke: #606977;
  stroke-width: 1.65;
}

.library-icon-accent {
  stroke: #4f67d8;
  stroke-width: 2;
}

.library-icon-shelf {
  stroke: #49515c;
  stroke-width: 1.9;
}

.library-icon-book-mark {
  stroke: #fff;
  stroke-width: 1.45;
}

.library-icon-ink-fill,
.library-icon-dot {
  fill: #49515c;
}

.library-icon-accent-fill {
  fill: #4f67d8;
}

.workspace-nav-submenu a.current .library-icon-outline,
.workspace-nav-submenu a.current .library-icon-detail,
.workspace-nav-submenu a.current .library-icon-shelf {
  stroke: #33415d;
}

.workspace-nav-submenu a.current .library-icon-ink-fill,
.workspace-nav-submenu a.current .library-icon-dot {
  fill: #33415d;
}

.workspace-nav-submenu a.current .library-icon-accent {
  stroke: #3858c8;
}

.workspace-nav-submenu a.current .library-icon-accent-fill {
  fill: #3858c8;
}

/* Developer changelog */
.developer-log-page {
  max-width: 1040px;
}

.developer-log-head {
  align-items: flex-end;
}

.developer-log-head p {
  max-width: 680px;
}

.developer-log-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 32px;
}

.developer-log-filters a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--gmail-line);
  border-radius: 999px;
  color: var(--gmail-secondary);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
}

.developer-log-filters a:hover {
  background: var(--gmail-hover);
  color: var(--gmail-text);
}

.developer-log-filters a.current {
  border-color: #c2d5f6;
  background: #eaf2ff;
  color: #174ea6;
}

.developer-log-feed {
  display: grid;
}

.developer-log-entry {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 30px;
  position: relative;
}

.developer-log-entry:last-child .developer-log-rail::after {
  display: none;
}

.developer-log-rail {
  min-height: 100%;
  position: relative;
  padding: 5px 21px 0 0;
  text-align: right;
}

.developer-log-rail::after {
  content: "";
  width: 1px;
  position: absolute;
  top: 25px;
  right: 3px;
  bottom: -1px;
  background: #e2e7ee;
}

.developer-log-rail time {
  color: var(--gmail-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}

.developer-log-dot {
  width: 9px;
  height: 9px;
  position: absolute;
  top: 8px;
  right: -1px;
  z-index: 1;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #9aa4b2;
  box-shadow: 0 0 0 1px #cbd3dd;
}

.developer-log-content {
  min-width: 0;
  padding: 0 0 38px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--gmail-line);
}

.developer-log-entry:last-child .developer-log-content {
  margin-bottom: 0;
}

.developer-log-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.developer-log-badge,
.developer-log-version {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.developer-log-version {
  border: 1px solid #d9dee5;
  background: #f7f8fa;
  color: var(--gmail-secondary);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 600;
}

.developer-log-badge.new {
  background: #e6f4ea;
  color: #137333;
}

.developer-log-badge.improvement {
  background: #e8f0fe;
  color: #1967d2;
}

.developer-log-badge.fix {
  background: #fef7e0;
  color: #a15c00;
}

.developer-log-badge.security {
  background: #fce8e6;
  color: #b3261e;
}

.developer-log-badge.maintenance {
  background: #f1f3f4;
  color: #5f6368;
}

.developer-log-content h2 {
  margin: 0;
  color: var(--gmail-text);
  font-size: 21px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -.015em;
}

.developer-log-body {
  max-width: 760px;
  margin-top: 15px;
  color: var(--gmail-secondary);
  font-size: 14px;
  line-height: 1.75;
}

.developer-log-body > :first-child {
  margin-top: 0;
}

.developer-log-body > :last-child {
  margin-bottom: 0;
}

.developer-log-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  font-size: 12px;
}

.developer-log-actions a {
  color: var(--gmail-blue);
  font-weight: 600;
}

.developer-log-actions form {
  margin: 0;
}

.developer-log-empty {
  padding: 72px 24px;
  border: 1px dashed #d8dee7;
  border-radius: 14px;
  text-align: center;
  color: var(--gmail-muted);
  background: #fbfcfd;
}

.developer-log-empty strong {
  display: block;
  color: var(--gmail-text);
  font-size: 15px;
  font-weight: 650;
}

.developer-log-empty p {
  margin: 7px 0 0;
  font-size: 12px;
}

.developer-log-editor-page {
  max-width: 800px;
}

.developer-log-form {
  gap: 18px;
}

.developer-log-editor-meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.developer-log-form select,
.developer-log-form textarea {
  width: 100%;
  border: 1px solid #cbd2da;
  border-radius: 8px;
  background: #fff;
  color: var(--gmail-text);
  font: inherit;
  outline: none;
}

.developer-log-form select {
  min-height: 42px;
  padding: 0 10px;
  font-size: 13px;
}

.developer-log-form textarea {
  min-height: 330px;
  padding: 12px 13px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
}

.developer-log-form select:focus,
.developer-log-form textarea:focus {
  border-color: #8ab4f8;
  box-shadow: 0 0 0 1px #8ab4f8;
}

.developer-log-form label > span small {
  margin-left: 5px;
  color: var(--gmail-muted);
  font-size: 11px;
  font-weight: 500;
}

.developer-log-editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

@media (max-width: 720px) {
  .developer-log-entry {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .developer-log-rail {
    padding: 0;
    text-align: left;
  }

  .developer-log-rail::after,
  .developer-log-dot {
    display: none;
  }

  .developer-log-content {
    padding-bottom: 28px;
    margin-bottom: 26px;
  }

  .developer-log-editor-meta-grid {
    grid-template-columns: 1fr;
  }
}


/* Feature Focus + developer center */
.feature-focus-layer[hidden] {
  display: none !important;
}

.feature-focus-layer {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.feature-focus-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 30, 38, .36);
  backdrop-filter: blur(3px);
}

.feature-focus-dialog {
  width: min(590px, calc(100vw - 32px));
  position: relative;
  z-index: 1;
  padding: 34px 36px 30px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 24px;
  outline: none;
  background: #fff;
  color: var(--gmail-text);
  box-shadow:
    0 24px 70px rgba(33, 42, 54, .24),
    0 3px 12px rgba(33, 42, 54, .12);
  animation: feature-focus-enter .18s ease-out both;
}

@keyframes feature-focus-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.feature-focus-open {
  overflow: hidden;
}

.feature-focus-close {
  width: 36px;
  height: 36px;
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--gmail-muted);
  font-size: 25px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.feature-focus-close:hover,
.feature-focus-close:focus-visible {
  background: #f1f3f4;
  color: var(--gmail-text);
}

.feature-focus-eyebrow {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #e8f0fe;
  color: #185abc;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .04em;
}

.feature-focus-dialog h2 {
  max-width: 490px;
  margin: 17px 38px 0 0;
  font-size: 29px;
  line-height: 1.25;
  font-weight: 720;
  letter-spacing: -.025em;
}

.feature-focus-dialog > p {
  max-width: 510px;
  margin: 15px 0 0;
  color: var(--gmail-secondary);
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.feature-focus-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
}

.feature-focus-actions .button {
  min-height: 40px;
  border-radius: 20px;
  padding: 0 18px;
}

.feature-focus-action-button[hidden] {
  display: none;
}

.developer-center-page,
.feature-focus-admin-page {
  max-width: 1080px;
}

.developer-center-head {
  margin-bottom: 28px;
}

.developer-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.developer-tool-card {
  min-height: 190px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--gmail-line);
  border-radius: 18px;
  background: #fff;
  color: var(--gmail-text);
  text-decoration: none;
  transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.developer-tool-card:hover {
  border-color: #bdc8d8;
  box-shadow: 0 6px 22px rgba(60, 64, 67, .09);
  transform: translateY(-1px);
}

.developer-tool-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  grid-row: 1 / 3;
  border-radius: 14px;
  background: #e8f0fe;
  color: #185abc;
}

.developer-tool-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.developer-tool-card strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
}

.developer-tool-card p {
  margin: 7px 0 0;
  color: var(--gmail-secondary);
  font-size: 13px;
  line-height: 1.65;
}

.developer-tool-count {
  grid-column: 2;
  color: var(--gmail-muted);
  font-size: 12px;
  font-weight: 600;
}

.feature-focus-admin-head {
  align-items: flex-end;
}

.developer-back-link {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--gmail-blue);
  font-size: 12px;
  font-weight: 650;
}

.feature-focus-admin-list {
  display: grid;
  gap: 14px;
}

.feature-focus-admin-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 28px;
  padding: 22px 24px;
  border: 1px solid var(--gmail-line);
  border-radius: 16px;
  background: #fff;
}

.feature-focus-admin-card-main h2 {
  margin: 10px 0 0;
  color: var(--gmail-text);
  font-size: 19px;
  line-height: 1.35;
  font-weight: 680;
}

.feature-focus-admin-card-main > p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--gmail-secondary);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.feature-focus-admin-meta,
.feature-focus-admin-time {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  color: var(--gmail-muted);
  font-size: 11px;
  font-weight: 600;
}

.feature-focus-admin-time {
  margin-top: 13px;
}

.feature-focus-status {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
}

.feature-focus-status.active {
  background: #e6f4ea;
  color: #137333;
}

.feature-focus-status.scheduled {
  background: #e8f0fe;
  color: #185abc;
}

.feature-focus-status.disabled,
.feature-focus-status.ended {
  background: #f1f3f4;
  color: #5f6368;
}

.feature-focus-admin-stats {
  display: flex;
  align-items: center;
  gap: 20px;
}

.feature-focus-admin-stats > div {
  min-width: 54px;
  text-align: center;
}

.feature-focus-admin-stats strong {
  display: block;
  color: var(--gmail-text);
  font-size: 20px;
  line-height: 1.1;
}

.feature-focus-admin-stats span {
  display: block;
  margin-top: 5px;
  color: var(--gmail-muted);
  font-size: 10px;
}

.feature-focus-admin-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid #edf0f3;
  font-size: 12px;
}

.feature-focus-admin-actions form {
  margin: 0;
}

.feature-focus-admin-actions a,
.feature-focus-admin-actions .link-button {
  color: var(--gmail-blue);
  font-weight: 650;
}

.feature-focus-editor-page {
  max-width: 820px;
}

.feature-focus-form {
  gap: 18px;
}

.feature-focus-form textarea {
  width: 100%;
  min-height: 150px;
  padding: 12px 13px;
  border: 1px solid #cbd2da;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--gmail-text);
  font: inherit;
  font-size: 13px;
  line-height: 1.65;
  resize: vertical;
}

.feature-focus-form textarea:focus {
  border-color: #8ab4f8;
  box-shadow: 0 0 0 1px #8ab4f8;
}

.feature-focus-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.feature-focus-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 14px 16px 16px;
  border: 1px solid #d8dde4;
  border-radius: 10px;
}

.feature-focus-targets legend {
  padding: 0 6px;
  color: var(--gmail-secondary);
  font-size: 12px;
  font-weight: 650;
}

.feature-focus-target-option {
  min-height: 36px;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #d8dde4;
  border-radius: 18px;
  background: #fff;
  color: var(--gmail-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.feature-focus-target-option:has(input:checked) {
  border-color: #a8c7fa;
  background: #e8f0fe;
  color: #185abc;
}

.feature-focus-target-option input {
  margin: 0;
}

.feature-focus-enabled-row {
  min-height: 70px;
  align-self: end;
}

.feature-focus-editor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

@media (max-width: 760px) {
  .feature-focus-dialog {
    padding: 28px 24px 24px;
    border-radius: 20px;
  }

  .feature-focus-dialog h2 {
    margin-right: 28px;
    font-size: 24px;
  }

  .feature-focus-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .feature-focus-actions .button {
    width: 100%;
    justify-content: center;
  }

  .developer-tool-grid,
  .feature-focus-form-grid {
    grid-template-columns: 1fr;
  }

  .feature-focus-admin-card {
    grid-template-columns: 1fr;
  }

  .feature-focus-admin-stats {
    justify-content: flex-start;
  }
}


/* Global AI entry */
.topbar-ai-entry {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 0 12px 0 9px;
  border: 1px solid #e1dcf7;
  border-radius: 18px;
  background: linear-gradient(135deg, #f7f4ff 0%, #f0f6ff 100%);
  color: #5747a8;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color .14s ease,
    border-color .14s ease,
    color .14s ease,
    box-shadow .14s ease,
    transform .14s ease;
}

.topbar-ai-entry:hover {
  border-color: #ccc3f1;
  background: linear-gradient(135deg, #f1ecff 0%, #e8f1ff 100%);
  color: #443494;
  box-shadow: 0 2px 8px rgba(80, 64, 150, .09);
}

.topbar-ai-entry:active {
  transform: translateY(1px);
}

.topbar-ai-entry.current {
  border-color: #c9bdf2;
  background: linear-gradient(135deg, #ece5ff 0%, #e4efff 100%);
  color: #3f2f91;
}

.topbar-ai-entry:focus-visible {
  outline: 2px solid #7650df;
  outline-offset: 2px;
}

.topbar-ai-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
  border-radius: 7px;
  background: linear-gradient(135deg, #7650df 0%, #5d63ef 50%, #2f8df7 100%);
  color: #fff;
}

.topbar-ai-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* AI assistant */
.ai-assistant-page {
  width: min(1180px, 100%);
  min-height: calc(100vh - var(--topbar-height));
  margin: 0 auto;
  padding: 30px 32px 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ai-assistant-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.ai-assistant-kicker {
  margin-bottom: 5px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ai-assistant-head h1 {
  margin: 0;
  color: #172033;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 760;
  letter-spacing: -.035em;
  line-height: 1.08;
}

.ai-assistant-head p {
  max-width: 660px;
  margin: 8px 0 0;
  color: #667085;
  font-size: 14px;
  line-height: 1.65;
}

.ai-provider-state {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 17px;
  background: #f8fafc;
  color: #697386;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.ai-provider-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #98a2b3;
}

.ai-provider-state.is-ready {
  border-color: #cce7d7;
  background: #f0f9f4;
  color: #28603f;
}

.ai-provider-state.is-ready .ai-provider-dot {
  background: #35a866;
  box-shadow: 0 0 0 3px rgba(53, 168, 102, .12);
}

.ai-chat-shell {
  min-height: 610px;
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #e5e9f0;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% -20%, rgba(117, 80, 223, .08), transparent 35%),
    #fff;
  box-shadow: 0 12px 36px rgba(38, 51, 77, .07);
}

.ai-message-list {
  min-height: 420px;
  max-height: calc(100vh - 310px);
  overflow-y: auto;
  padding: 30px clamp(22px, 5vw, 64px);
  overscroll-behavior: contain;
}

.ai-empty-state {
  min-height: 390px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.ai-empty-symbol {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 15px;
  border-radius: 17px;
  background: linear-gradient(135deg, #7650df 0%, #5d63ef 50%, #2f8df7 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(93, 99, 239, .20);
}

.ai-empty-symbol svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-empty-state h2 {
  margin: 0;
  color: #172033;
  font-size: 22px;
  font-weight: 720;
  letter-spacing: -.025em;
}

.ai-empty-state > p {
  max-width: 590px;
  margin: 10px auto 0;
  color: #7a8496;
  font-size: 13px;
  line-height: 1.65;
}

.ai-prompt-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.ai-prompt-suggestions button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid #e1e5eb;
  border-radius: 17px;
  background: rgba(255,255,255,.88);
  color: #556070;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.ai-prompt-suggestions button:hover {
  border-color: #cec6ef;
  background: #f7f4ff;
  color: #4f3d9d;
}

.ai-message-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  margin: 0 0 22px;
}

.ai-message-user {
  align-items: flex-end;
}

.ai-message-assistant {
  align-items: flex-start;
}

.ai-message-bubble {
  max-width: min(760px, 86%);
  padding: 13px 16px;
  border-radius: 18px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.68;
}

.ai-message-user .ai-message-bubble {
  border-bottom-right-radius: 6px;
  background: #e9efff;
  color: #20345b;
}

.ai-message-assistant .ai-message-bubble {
  border: 1px solid #e6e9ef;
  border-bottom-left-radius: 6px;
  background: #fff;
  color: #273142;
  box-shadow: 0 2px 9px rgba(31, 41, 55, .04);
}

.ai-message-bubble.is-pending {
  color: #7a8496;
}

.ai-message-sources {
  width: min(760px, 92%);
  margin-top: 10px;
}

.ai-message-sources > strong {
  display: block;
  margin: 0 0 7px 2px;
  color: #7a8496;
  font-size: 11px;
  font-weight: 700;
}

.ai-source-list {
  display: grid;
  gap: 7px;
}

.ai-source-card {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #e8eaf0;
  border-radius: 12px;
  background: #fbfcfe;
  color: inherit;
  text-decoration: none;
  transition: border-color .12s ease, background .12s ease, transform .12s ease;
}

.ai-source-card:hover {
  border-color: #d4cef1;
  background: #f8f6ff;
  transform: translateY(-1px);
}

.ai-source-title {
  color: #273142;
  font-size: 12px;
  font-weight: 700;
}

.ai-source-meta {
  color: #8a93a2;
  font-size: 10px;
}

.ai-source-snippet {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: #667085;
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ai-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px 16px 11px;
  border-top: 1px solid #eaedf2;
  background: rgba(250,251,253,.96);
}

.ai-composer textarea {
  min-height: 46px;
  max-height: 160px;
  resize: none;
  padding: 12px 14px;
  border: 1px solid #dfe3e9;
  border-radius: 16px;
  outline: none;
  background: #fff;
  color: #202938;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color .12s ease, box-shadow .12s ease;
}

.ai-composer textarea:focus {
  border-color: #aa9de4;
  box-shadow: 0 0 0 3px rgba(118, 80, 223, .10);
}

.ai-composer textarea::placeholder {
  color: #9aa3af;
}

.ai-composer > button {
  min-width: 90px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #6f54d9 0%, #526ce9 100%);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(82, 108, 233, .18);
}

.ai-composer > button:hover {
  filter: brightness(.98);
}

.ai-composer > button:disabled {
  cursor: wait;
  opacity: .58;
}

.ai-composer > button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-composer-note {
  grid-column: 1 / -1;
  padding: 0 4px;
  color: #98a2b3;
  font-size: 10px;
  text-align: center;
}

@media (max-width: 760px) {
  .topbar-ai-entry {
    min-height: 34px;
    padding: 0 9px;
  }

  .topbar-ai-label {
    display: none;
  }

  .ai-assistant-page {
    padding: 20px 14px 14px;
  }

  .ai-assistant-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .ai-provider-state {
    white-space: normal;
  }

  .ai-chat-shell {
    min-height: calc(100vh - 220px);
    border-radius: 18px;
  }

  .ai-message-list {
    min-height: 360px;
    max-height: none;
    padding: 22px 14px;
  }

  .ai-empty-state {
    min-height: 330px;
  }

  .ai-message-bubble,
  .ai-message-sources {
    max-width: 94%;
    width: auto;
  }

  .ai-composer {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px;
  }

  .ai-composer > button {
    min-width: 48px;
    width: 48px;
    padding: 0;
  }

  .ai-composer > button span {
    display: none;
  }
}


/* ============================================================
   AI workspace Mark 1 + private conversation history Mark 2
   ============================================================ */

.topbar-ai-entry {
  min-height: 34px;
  gap: 7px;
  padding: 0 11px 0 8px;
  border-color: #d9e0e8;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
}

.topbar-ai-entry:hover,
.topbar-ai-entry.current {
  border-color: #c5d0dc;
  background: #f5f8fc;
  color: #1f2937;
  box-shadow: none;
}

.topbar-ai-icon,
.ai-panel-logo,
.ai-empty-mini-logo {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  border: 1px solid #d8e2ef;
  border-radius: 7px;
  background: #f4f8fd;
  color: #42566f;
  box-shadow: none;
}

.topbar-ai-icon svg,
.ai-panel-logo svg,
.ai-empty-mini-logo svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-document-logo .ai-document-logo-spark {
  stroke: #4f7ee8;
  stroke-width: 1.7;
}

.ai-document-logo .ai-document-logo-line {
  stroke: #718096;
  stroke-width: 1.35;
}

.ai-drawer {
  width: min(460px, calc(100vw - 18px));
  height: calc(100dvh - var(--topbar-height));
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  z-index: 180;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid #dfe5ec;
  background: #fff;
  box-shadow: -18px 0 44px rgba(38, 51, 77, .13);
  transform: translateX(calc(100% + 20px));
  visibility: hidden;
  transition:
    transform .2s ease,
    visibility .2s linear;
}

.ai-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}

.ai-panel-head {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 10px 12px 10px 15px;
  border-bottom: 1px solid #e7ebf0;
  background: #fff;
}

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

.ai-panel-brand > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ai-panel-brand strong {
  color: #1f2937;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.1;
}

.ai-panel-brand > div > span {
  overflow: hidden;
  color: #8a94a3;
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-panel-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.ai-panel-actions button,
.ai-panel-actions a {
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #657184;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}

.ai-panel-actions button:hover,
.ai-panel-actions a:hover {
  background: #f1f4f8;
  color: #273142;
}

.ai-drawer-chat-view {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.ai-context-bar {
  display: grid;
  gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid #edf0f4;
  background: #fbfcfe;
}

.ai-scope-switch {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid #dfe4eb;
  border-radius: 10px;
  background: #f2f4f7;
}

.ai-scope-switch button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 190px;
  padding: 0 11px;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #657184;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.ai-scope-switch button.current {
  background: #fff;
  color: #25364d;
  box-shadow: 0 1px 4px rgba(31, 41, 55, .08);
}

.ai-scope-switch button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.ai-context-document {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 3px;
  color: #8a94a3;
  font-size: 10px;
}

.ai-context-document strong {
  min-width: 0;
  overflow: hidden;
  color: #556174;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-drawer-messages {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding: 20px 18px 14px;
  background: #fff;
}

.ai-drawer .ai-empty-state {
  min-height: 320px;
}

.ai-empty-mini-logo {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  margin-bottom: 14px;
  border-radius: 11px;
}

.ai-empty-mini-logo svg {
  width: 27px;
  height: 27px;
}

.ai-drawer-empty h2 {
  font-size: 19px;
}

.ai-drawer-empty > p {
  max-width: 330px;
}

.ai-drawer .ai-message-row {
  margin-bottom: 18px;
}

.ai-drawer .ai-message-bubble {
  max-width: 90%;
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.62;
}

.ai-drawer .ai-message-sources {
  width: 94%;
}

.ai-drawer-composer {
  padding: 10px 12px 9px;
  border-top: 1px solid #e7ebf0;
}

.ai-drawer-composer textarea {
  min-height: 44px;
  border-radius: 13px;
  font-size: 13px;
}

.ai-drawer-composer > button {
  min-width: 44px;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 13px;
}

.ai-drawer-composer > button span {
  display: none;
}

.ai-drawer-history-view {
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  background: #fbfcfe;
}

.ai-history-mobile-head {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 8px 12px;
  border-bottom: 1px solid #e7ebf0;
  background: #fff;
}

.ai-history-mobile-head strong {
  flex: 1 1 auto;
  color: #273142;
  font-size: 13px;
  font-weight: 700;
}

.ai-history-mobile-head button {
  min-height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5d697a;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.ai-history-mobile-head button:hover {
  background: #eef2f6;
}

.ai-history-list {
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}

.ai-drawer-history-list {
  flex: 1 1 auto;
}

.ai-history-group-label {
  padding: 12px 8px 6px;
  color: #98a1ae;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .035em;
}

.ai-history-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 2px;
  border-radius: 9px;
}

.ai-history-item:hover,
.ai-history-item.current {
  background: #edf2f8;
}

.ai-history-open {
  min-width: 0;
  min-height: 52px;
  flex: 1 1 auto;
  display: grid;
  gap: 3px;
  padding: 8px 8px 8px 10px;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.ai-history-title,
.ai-history-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-history-title {
  color: #334155;
  font-size: 12px;
  font-weight: 650;
}

.ai-history-meta {
  color: #929baa;
  font-size: 9px;
}

.ai-history-menu {
  position: relative;
  flex: 0 0 auto;
  margin-right: 4px;
}

.ai-history-menu > summary {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #8791a0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.ai-history-menu > summary::-webkit-details-marker {
  display: none;
}

.ai-history-menu > summary:hover,
.ai-history-menu[open] > summary {
  background: #e2e8f0;
  color: #475569;
}

.ai-history-menu-popover {
  width: 116px;
  position: absolute;
  top: calc(100% + 3px);
  right: 0;
  z-index: 25;
  display: grid;
  gap: 2px;
  padding: 5px;
  border: 1px solid #dfe4eb;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(31, 41, 55, .13);
}

.ai-history-menu-popover button {
  min-height: 31px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4b5563;
  text-align: left;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.ai-history-menu-popover button:hover {
  background: #f1f4f7;
}

.ai-history-menu-popover button.danger {
  color: #b3261e;
}

.ai-history-empty {
  display: grid;
  gap: 5px;
  padding: 34px 16px;
  text-align: center;
  color: #98a1ae;
}

.ai-history-empty strong {
  color: #5d697a;
  font-size: 12px;
  font-weight: 650;
}

.ai-history-empty span {
  font-size: 10px;
  line-height: 1.5;
}

.ai-source-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.ai-source-index {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 18px;
  border-radius: 5px;
  background: #edf3fb;
  color: #4b6c95;
  font-size: 9px;
  font-weight: 750;
}

.ai-source-open {
  margin-top: 3px;
  color: #5378aa;
  font-size: 10px;
  font-weight: 650;
}

.ai-source-card {
  position: relative;
}

.ai-source-card:hover .ai-source-open {
  color: #345f98;
}

.ai-drawer-mobile-backdrop {
  display: none;
}

/* Full AI workspace */
.ai-full-page-body .workspace-main {
  overflow: hidden;
}

.ai-workspace-page {
  width: 100%;
  height: calc(100dvh - var(--topbar-height));
  min-height: 620px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
}

.ai-history-sidebar {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-right: 1px solid #e3e8ee;
  background: #f8fafc;
}

.ai-history-sidebar-head {
  display: grid;
  gap: 14px;
  padding: 18px 14px 12px;
  border-bottom: 1px solid #e5e9ef;
}

.ai-history-new-button {
  min-height: 36px;
  border: 1px solid #d8e0e9;
  border-radius: 9px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ai-history-new-button:hover {
  background: #f1f5f9;
}

.ai-full-chat-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  padding: 22px 28px 24px;
  background: #fff;
}

.ai-full-chat-head {
  min-height: 82px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 2px 2px 16px;
}

.ai-full-chat-head h1 {
  margin: 0;
  color: #1f2937;
  font-size: 25px;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -.025em;
}

.ai-full-chat-head p {
  max-width: 650px;
  margin: 6px 0 0;
  color: #7a8494;
  font-size: 12px;
  line-height: 1.55;
}

.ai-full-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 7px 2px 10px;
  border: 0;
  background: #fff;
}

.ai-full-context-bar .ai-context-document {
  max-width: 46%;
  justify-content: flex-end;
}

.ai-full-chat-shell {
  min-height: 0;
  height: 100%;
  border-radius: 18px;
}

.ai-full-messages {
  min-height: 0;
  max-height: none;
}

@media (min-width: 761px) {
  body.ai-drawer-open {
    overflow-x: hidden;
  }
}

@media (max-width: 980px) {
  .ai-workspace-page {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .ai-full-chat-panel {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 760px) {
  .topbar-ai-entry {
    min-height: 34px;
    padding: 0 7px;
  }

  .topbar-ai-label {
    display: none;
  }

  .ai-drawer {
    width: min(100vw, 460px);
    height: calc(100dvh - var(--topbar-height));
  }

  .ai-drawer-mobile-backdrop {
    position: fixed;
    inset: var(--topbar-height) 0 0;
    z-index: 170;
    background: rgba(15, 23, 42, .25);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s linear;
  }

  body.ai-drawer-open .ai-drawer-mobile-backdrop {
    display: block;
    opacity: 1;
    visibility: visible;
  }

  .ai-workspace-page {
    height: auto;
    min-height: calc(100dvh - var(--topbar-height));
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .ai-history-sidebar {
    max-height: 230px;
    border-right: 0;
    border-bottom: 1px solid #e3e8ee;
  }

  .ai-history-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
  }

  .ai-history-sidebar-head .ai-panel-brand > div > span {
    display: none;
  }

  .ai-history-new-button {
    padding: 0 11px;
  }

  .ai-history-sidebar .ai-history-list {
    max-height: 170px;
  }

  .ai-full-chat-panel {
    min-height: calc(100dvh - var(--topbar-height) - 230px);
    padding: 14px 12px;
  }

  .ai-full-chat-head {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .ai-full-chat-head h1 {
    font-size: 22px;
  }

  .ai-full-context-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-full-context-bar .ai-context-document {
    max-width: 100%;
    justify-content: flex-start;
  }

  .ai-full-chat-shell {
    min-height: 520px;
  }
}

.ai-drawer-history-view { display: flex; }

/* Administrator notifications and graduation handover reminders */
.admin-graduation-banner {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 22px;
  border-bottom: 1px solid #bfd0ec;
  background: #eef4ff;
  color: var(--gmail-text);
}

.admin-graduation-banner > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.admin-graduation-banner strong {
  font-size: 13px;
  font-weight: 750;
}

.admin-graduation-banner span {
  color: var(--gmail-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.admin-graduation-banner > a {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid #aac3ea;
  border-radius: 16px;
  background: #fff;
  color: #185abc;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.admin-graduation-banner.warning {
  border-bottom-color: #ead7a1;
  background: #fff8e1;
}

.admin-graduation-banner.warning > a {
  border-color: #d8bd72;
  color: #795500;
}

.admin-graduation-banner.urgent {
  border-bottom-color: #e4b4af;
  background: #fce8e6;
}

.admin-graduation-banner.urgent strong,
.admin-graduation-banner.urgent > a {
  color: #b3261e;
}

.admin-graduation-banner.urgent > a {
  border-color: #dfaaa4;
}

.site-notifications-page {
  max-width: 900px;
}

.site-notification-list {
  display: grid;
  gap: 12px;
}

.site-notification-card {
  padding: 20px 22px;
  border: 1px solid var(--gmail-line);
  border-left: 4px solid #a8b3c2;
  border-radius: 14px;
  background: #fff;
}

.site-notification-card.warning {
  border-left-color: #e0a100;
  background: #fffcf3;
}

.site-notification-card.urgent {
  border-left-color: #d93025;
  background: #fff8f7;
}

.site-notification-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--gmail-muted);
  font-size: 11px;
}

.site-notification-level {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1f3f4;
  color: #5f6368;
  font-weight: 700;
}

.site-notification-card.warning .site-notification-level {
  background: #fef7e0;
  color: #8a5a00;
}

.site-notification-card.urgent .site-notification-level {
  background: #fce8e6;
  color: #b3261e;
}

.site-notification-card h2 {
  margin: 12px 0 0;
  color: var(--gmail-text);
  font-size: 17px;
  line-height: 1.4;
  font-weight: 680;
}

.site-notification-card p {
  margin: 7px 0 0;
  color: var(--gmail-secondary);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.site-notification-action {
  display: inline-block;
  color: var(--gmail-blue);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.site-notification-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.site-notification-actions form {
  margin: 0;
}

.site-notification-retry {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
  color: var(--gmail-blue);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.site-notification-retry:hover {
  background: #f6f9fe;
}

.admin-notification-form {
  display: grid;
  gap: 18px;
}

.notification-channel-section {
  margin: 0;
}

.notification-channel-section .admin-section-head p {
  margin: 5px 0 0;
  color: var(--gmail-muted);
  font-size: 12px;
}

.notification-channel-section > label:not(.switch-row):not(.notification-remove-webhook) {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.notification-channel-section select,
.notification-channel-section input[type="password"] {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid #cbd2da;
  border-radius: 8px;
  background: #fff;
  color: var(--gmail-text);
  font: inherit;
  font-size: 13px;
}

.notification-remove-webhook {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  color: var(--gmail-secondary);
  font-size: 12px;
}

.admin-notification-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.handover-candidate-table form {
  margin: 0;
}

@media (max-width: 760px) {
  .admin-graduation-banner {
    align-items: flex-start;
    padding: 9px 12px;
  }

  .admin-graduation-banner > div {
    gap: 3px;
  }

  .site-notification-card {
    padding: 17px 16px;
  }

  .site-notifications-head {
    align-items: stretch;
  }
}

/* AI composer Mark 3: restored sparkle identity + contextual attachments */
.topbar-ai-icon.ai-spark-logo,
.ai-panel-logo.ai-spark-logo {
  border: 0;
  background: linear-gradient(135deg, #7650df 0%, #5d63ef 50%, #2f8df7 100%);
  color: #fff;
  box-shadow: 0 5px 14px rgba(82, 108, 233, .18);
}

.topbar-ai-icon.ai-spark-logo {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
  border-radius: 7px;
}

.ai-panel-logo.ai-spark-logo {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-radius: 9px;
}

.topbar-ai-icon.ai-spark-logo svg,
.ai-panel-logo.ai-spark-logo svg,
.ai-empty-symbol.ai-spark-logo svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-empty-symbol.ai-spark-logo {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  margin-bottom: 15px;
  border: 0;
  border-radius: 17px;
  background: linear-gradient(135deg, #7650df 0%, #5d63ef 50%, #2f8df7 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(93, 99, 239, .20);
}

.ai-empty-symbol.ai-spark-logo svg {
  width: 28px;
  height: 28px;
}

.ai-composer {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  padding: 12px 14px 10px;
}

.ai-composer-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.ai-composer-main textarea {
  width: 100%;
  min-height: 46px;
  max-height: 160px;
  resize: none;
  padding: 12px 14px;
  border: 1px solid #dfe3e9;
  border-radius: 16px;
  outline: none;
  background: #fff;
  color: #202938;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color .12s ease, box-shadow .12s ease;
}

.ai-composer-main textarea:focus {
  border-color: #aa9de4;
  box-shadow: 0 0 0 3px rgba(118, 80, 223, .10);
}

.ai-composer-main textarea::placeholder {
  color: #9aa3af;
}

.ai-send-button {
  min-width: 90px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #6f54d9 0%, #526ce9 100%);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(82, 108, 233, .18);
}

.ai-send-button:hover {
  filter: brightness(.98);
}

.ai-send-button:disabled {
  cursor: wait;
  opacity: .58;
}

.ai-send-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-composer-toolbar {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 2px;
}

.ai-composer-tool-wrap {
  position: relative;
  display: inline-flex;
}

.ai-composer-tool {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #667085;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.ai-composer-tool:hover,
.ai-composer-tool:focus-visible {
  border-color: #dfe4eb;
  background: #f1f4f8;
  color: #344054;
  outline: none;
}

.ai-composer-note {
  margin-left: auto;
  padding: 0 3px;
  color: #98a2b3;
  font-size: 10px;
  text-align: right;
}

.ai-composer-menu {
  width: 184px;
  position: absolute;
  left: 0;
  bottom: calc(100% + 7px);
  z-index: 40;
  display: grid;
  gap: 3px;
  padding: 6px;
  border: 1px solid #dde3ea;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(31, 41, 55, .14);
}

.ai-composer-menu[hidden],
.ai-reference-panel[hidden],
.ai-composer-context[hidden] {
  display: none !important;
}

.ai-composer-menu button {
  min-height: 35px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #344054;
  text-align: left;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.ai-composer-menu button:hover {
  background: #f3f5f8;
}

.ai-composer-menu button:disabled {
  color: #a4acb8;
  cursor: not-allowed;
}

.ai-composer-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 1px;
}

.ai-context-chip {
  max-width: min(320px, 100%);
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 6px 5px 10px;
  border: 1px solid #dfe5ed;
  border-radius: 10px;
  background: #f8fafc;
  color: #344054;
}

.ai-context-chip-text {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.ai-context-chip-text strong,
.ai-context-chip-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-context-chip-text strong {
  font-size: 11px;
  font-weight: 700;
}

.ai-context-chip-text span {
  color: #8a94a3;
  font-size: 9px;
}

.ai-context-chip > button {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #8b95a4;
  font: inherit;
  cursor: pointer;
}

.ai-context-chip > button:hover {
  background: #e8edf3;
  color: #475467;
}

.ai-reference-panel {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(100% + 8px);
  z-index: 45;
  display: grid;
  gap: 8px;
  max-height: min(360px, 55vh);
  padding: 11px;
  overflow: hidden;
  border: 1px solid #dce3eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(31, 41, 55, .16);
}

.ai-reference-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-reference-panel-head strong {
  color: #273142;
  font-size: 12px;
  font-weight: 750;
}

.ai-reference-panel-head button {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #7b8492;
  font: inherit;
  font-size: 18px;
  cursor: pointer;
}

.ai-reference-panel-head button:hover {
  background: #f1f4f7;
}

.ai-reference-panel > input[type="search"] {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid #dbe1e8;
  border-radius: 10px;
  outline: none;
  background: #fbfcfe;
  color: #273142;
  font: inherit;
  font-size: 12px;
}

.ai-reference-panel > input[type="search"]:focus {
  border-color: #aaa0df;
  box-shadow: 0 0 0 3px rgba(118, 80, 223, .08);
}

.ai-reference-results {
  min-height: 54px;
  max-height: 250px;
  display: grid;
  gap: 4px;
  overflow-y: auto;
}

.ai-reference-hint {
  padding: 18px 10px;
  color: #98a2b3;
  font-size: 11px;
  text-align: center;
}

.ai-reference-result {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #344054;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.ai-reference-result:hover {
  background: #f2f5f9;
}

.ai-reference-result.selected,
.ai-reference-result:disabled {
  background: #f5f7fa;
  color: #98a2b3;
  cursor: default;
}

.ai-reference-result strong,
.ai-reference-result span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-reference-result strong {
  font-size: 11px;
  font-weight: 700;
}

.ai-reference-result span {
  color: #8b95a4;
  font-size: 9px;
}

.ai-drawer-composer {
  padding: 9px 11px 8px;
}

.ai-drawer-composer .ai-composer-main textarea {
  min-height: 44px;
  border-radius: 13px;
  font-size: 13px;
}

.ai-drawer-composer .ai-send-button {
  min-width: 44px;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 13px;
}

.ai-drawer-composer .ai-send-button span {
  display: none;
}

@media (max-width: 760px) {
  .ai-composer {
    padding: 10px;
  }

  .ai-send-button {
    min-width: 48px;
    width: 48px;
    padding: 0;
  }

  .ai-send-button span {
    display: none;
  }

  .ai-composer-note {
    max-width: 210px;
  }

  .ai-reference-panel {
    left: 8px;
    right: 8px;
  }
}


/* AI workspace Mark 3: dedicated full-page layout + compact composer */
.ai-full-page-body {
  min-width: 0;
  height: 100dvh;
  overflow: hidden;
  background: #fff;
}

.ai-composer-main {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.ai-input-shell {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 2px;
  padding: 5px 8px 5px 7px;
  border: 1px solid #dfe3e9;
  border-radius: 16px;
  background: #fff;
  transition: border-color .12s ease, box-shadow .12s ease;
}

.ai-input-shell:focus-within {
  border-color: #aa9de4;
  box-shadow: 0 0 0 3px rgba(118, 80, 223, .10);
}

.ai-input-shell .ai-composer-leading {
  align-self: center;
  margin-bottom: 0;
}

.ai-input-shell .ai-composer-tool {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.ai-input-shell textarea,
.ai-input-shell textarea:focus {
  min-height: 36px;
  padding: 7px 8px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.ai-input-shell textarea:focus {
  outline: none;
}

.ai-composer-toolbar {
  min-height: 30px;
}

.ai-composer-toolbar .ai-composer-tool {
  margin-left: 1px;
}

.ai-workspace-page {
  height: 100dvh;
  min-height: 0;
  grid-template-columns: 280px minmax(0, 1fr);
  background: #fff;
}

.ai-history-sidebar {
  border-right: 1px solid #e5e8ed;
  background: #f7f8fa;
}

.ai-history-sidebar-head {
  gap: 13px;
  padding: 14px 14px 12px;
  background: #f7f8fa;
}

.ai-return-library {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 0 12px 0 9px;
  border-radius: 12px;
  color: #1f2937;
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
  transition: background .12s ease, color .12s ease;
}

.ai-return-library:hover {
  background: #eceff3;
  color: #111827;
}

.ai-return-library-arrow {
  font-size: 24px;
  font-weight: 450;
  line-height: 1;
}

.ai-history-brand-row {
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0 4px;
}

.ai-history-sidebar-head .ai-panel-brand strong {
  font-size: 16px;
}

.ai-history-sidebar-head .ai-panel-brand > div > span {
  font-size: 11px;
}

.ai-history-new-button {
  min-height: 40px;
  font-size: 13px;
}

.ai-history-sidebar .ai-history-list {
  padding: 8px 10px 14px;
}

.ai-history-sidebar .ai-history-title {
  font-size: 13px;
}

.ai-history-sidebar .ai-history-meta {
  font-size: 10px;
}

.ai-full-chat-panel {
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: 0;
  background: #fff;
}

.ai-full-chat-head {
  min-height: 0;
  align-items: center;
  padding: 24px 34px 14px;
}

.ai-full-chat-head h1 {
  font-size: 27px;
}

.ai-full-chat-head p {
  margin-top: 5px;
  font-size: 13px;
}

.ai-full-context-bar {
  min-height: 52px;
  padding: 0 34px 12px;
}

.ai-full-chat-shell {
  min-height: 0;
  height: 100%;
  border: 0;
  border-top: 1px solid #edf0f4;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.ai-full-messages {
  min-height: 0;
  max-height: none;
  padding: 34px max(34px, calc((100% - 980px) / 2));
}

.ai-full-messages .ai-empty-state {
  min-height: 100%;
}

.ai-full-messages .ai-message-bubble {
  max-width: min(820px, 88%);
  font-size: 14px;
}

.ai-full-messages .ai-message-sources {
  width: min(820px, 92%);
}

.ai-full-chat-shell > .ai-composer {
  padding: 14px 28px 18px;
  border-top: 1px solid #edf0f4;
  background: rgba(255,255,255,.98);
}

.ai-full-chat-shell > .ai-composer .ai-composer-main,
.ai-full-chat-shell > .ai-composer .ai-composer-context,
.ai-full-chat-shell > .ai-composer .ai-composer-toolbar {
  width: min(980px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.ai-full-chat-shell > .ai-composer .ai-input-shell {
  min-height: 54px;
  border-radius: 18px;
}

.ai-full-chat-shell > .ai-composer .ai-input-shell textarea {
  min-height: 42px;
  font-size: 14px;
}

.ai-full-chat-shell > .ai-composer .ai-send-button {
  min-height: 54px;
  height: 54px;
  border-radius: 17px;
}

.ai-full-chat-shell > .ai-composer .ai-reference-panel {
  width: min(980px, calc(100% - 56px));
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.ai-drawer .ai-input-shell {
  min-height: 44px;
  border-radius: 13px;
}

.ai-drawer .ai-input-shell textarea {
  min-height: 32px;
  font-size: 13px;
}

.ai-drawer .ai-send-button {
  min-width: 44px;
  width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0;
  border-radius: 13px;
}

.ai-drawer .ai-send-button span {
  display: none;
}

@media (max-width: 980px) {
  .ai-workspace-page {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .ai-full-chat-head {
    padding-left: 24px;
    padding-right: 24px;
  }

  .ai-full-context-bar {
    padding-left: 24px;
    padding-right: 24px;
  }

  .ai-full-messages {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 760px) {
  .ai-workspace-page {
    min-height: 100dvh;
    height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .ai-history-sidebar {
    max-height: 190px;
  }

  .ai-history-sidebar-head {
    grid-template-columns: 1fr auto;
    gap: 8px 10px;
    padding: 9px 10px;
  }

  .ai-return-library {
    grid-column: 1 / -1;
    min-height: 34px;
    padding-left: 5px;
    font-size: 13px;
  }

  .ai-return-library-arrow {
    font-size: 21px;
  }

  .ai-history-brand-row {
    padding: 0 2px;
  }

  .ai-history-new-button {
    min-height: 34px;
    padding: 0 10px;
  }

  .ai-history-sidebar .ai-history-list {
    display: none;
  }

  .ai-full-chat-panel {
    min-height: 0;
    height: 100%;
  }

  .ai-full-chat-head {
    padding: 13px 14px 8px;
  }

  .ai-full-chat-head h1 {
    font-size: 22px;
  }

  .ai-full-chat-head p {
    display: none;
  }

  .ai-provider-state {
    display: none;
  }

  .ai-full-context-bar {
    min-height: 42px;
    padding: 0 14px 8px;
  }

  .ai-full-chat-shell {
    min-height: 0;
  }

  .ai-full-messages {
    padding: 18px 14px;
  }

  .ai-full-chat-shell > .ai-composer {
    padding: 9px 10px 10px;
  }

  .ai-full-chat-shell > .ai-composer .ai-reference-panel {
    width: calc(100% - 20px);
  }

  .ai-send-button {
    min-width: 48px;
    width: 48px;
    padding: 0;
  }

  .ai-send-button span {
    display: none;
  }
}


/* AI mention picker Mark 1: dense single-column multi-select */
.ai-composer {
  gap: 7px;
}

.ai-composer-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 1px;
}

.ai-context-chip {
  max-width: min(360px, 100%);
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 5px 4px 8px;
  border: 1px solid #dde3eb;
  border-radius: 10px;
  background: #f8fafc;
}

.ai-context-chip-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
  font-size: 14px;
  line-height: 1;
}

.ai-context-chip-text {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.ai-context-chip-text strong {
  min-width: 0;
  max-width: 210px;
  overflow: hidden;
  color: #344054;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-context-chip-text span {
  min-width: 0;
  max-width: 120px;
  overflow: hidden;
  color: #8a94a3;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-context-chip > button {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.ai-reference-panel.ai-mention-picker {
  gap: 0;
  max-height: min(390px, 58vh);
  padding: 0;
  overflow: hidden;
  border: 1px solid #d9e0e8;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(31, 41, 55, .16);
}

.ai-reference-picker-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 12px;
  border-bottom: 1px solid #edf0f4;
  background: #fbfcfe;
}

.ai-reference-picker-head strong {
  flex: 0 0 auto;
  color: #273142;
  font-size: 12px;
  font-weight: 750;
}

.ai-reference-picker-head span {
  min-width: 0;
  overflow: hidden;
  color: #8a94a3;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-reference-results {
  min-height: 72px;
  max-height: 300px;
  display: block;
  padding: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ai-reference-group-label {
  min-height: 24px;
  display: flex;
  align-items: center;
  padding: 4px 7px 2px;
  color: #98a1ae;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .035em;
}

.ai-reference-result {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 24px minmax(120px, 1.15fr) minmax(90px, 1fr) 50px 20px;
  align-items: center;
  gap: 7px;
  padding: 4px 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #344054;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.ai-reference-result:hover,
.ai-reference-result.keyboard-active {
  background: #f1f4f8;
}

.ai-reference-result.selected {
  background: #f5f7ff;
  color: #273142;
}

.ai-reference-result.selected.keyboard-active,
.ai-reference-result.selected:hover {
  background: #edf1ff;
}

.ai-reference-result-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
}

.ai-reference-result-title,
.ai-reference-result-meta,
.ai-reference-result-extra {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-reference-result-title {
  color: #344054;
  font-size: 11px;
  font-weight: 690;
}

.ai-reference-result-meta {
  color: #8a94a3;
  font-size: 9px;
}

.ai-reference-result-extra {
  color: #98a2b3;
  font-size: 9px;
  text-align: right;
}

.ai-reference-result-selected {
  width: 20px;
  color: #5e63e9;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.ai-reference-hint {
  padding: 24px 10px;
  color: #98a2b3;
  font-size: 10px;
  text-align: center;
}

.ai-reference-picker-foot {
  min-height: 29px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 11px;
  border-top: 1px solid #edf0f4;
  background: #fbfcfe;
  color: #9aa3af;
  font-size: 9px;
}

.ai-full-chat-shell > .ai-composer {
  padding-top: 10px;
  padding-bottom: 13px;
}

.ai-drawer-composer {
  padding-top: 8px;
  padding-bottom: 8px;
}

@media (max-width: 760px) {
  .ai-reference-result {
    grid-template-columns: 22px minmax(120px, 1fr) minmax(70px, .8fr) 18px;
  }

  .ai-reference-result-extra {
    display: none;
  }

  .ai-reference-result-selected {
    width: 18px;
  }

  .ai-context-chip-text span {
    display: none;
  }
}


/* AI workspace Mark 4: compact DeepSeek-like sidebar and chat-first layout */
.ai-workspace-page {
  grid-template-columns: 228px minmax(0, 1fr);
}

.ai-history-sidebar {
  border-right-color: #eceff3;
  background: #f7f8fa;
}

.ai-history-sidebar-head {
  gap: 9px;
  padding: 11px 10px 9px;
  border-bottom: 0;
  background: transparent;
}

.ai-return-library {
  min-height: 34px;
  gap: 8px;
  padding: 0 8px 0 6px;
  border-radius: 9px;
  color: #1f2937;
  font-size: 13px;
  font-weight: 720;
}

.ai-return-library:hover {
  background: #eceff3;
}

.ai-return-library-arrow {
  font-size: 21px;
}

.ai-history-brand-row {
  min-height: 34px;
  padding: 0 6px;
}

.ai-history-sidebar-head .ai-panel-brand {
  gap: 9px;
}

.ai-history-sidebar-head .ai-panel-logo.ai-spark-logo {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-radius: 9px;
}

.ai-history-sidebar-head .ai-panel-brand strong {
  font-size: 15px;
  font-weight: 760;
}

.ai-history-sidebar-head .ai-panel-brand > div > span {
  font-size: 10px;
}

.ai-history-new-button {
  min-height: 38px;
  border-color: #e1e5eb;
  border-radius: 10px;
  background: #fff;
  color: #253247;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(31, 41, 55, .025);
}

.ai-history-new-button:hover {
  border-color: #d8dee6;
  background: #fdfefe;
}

.ai-history-sidebar .ai-history-list {
  padding: 5px 7px 12px;
}

.ai-history-group-label {
  min-height: 26px;
  padding: 9px 9px 4px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0;
}

.ai-history-item {
  min-height: 40px;
  gap: 1px;
  margin-bottom: 1px;
  border-radius: 8px;
}

.ai-history-item:hover,
.ai-history-item.current {
  background: #eceff3;
}

.ai-history-open {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 7px 0 10px;
}

.ai-history-title {
  font-size: 12px;
  font-weight: 570;
}

.ai-history-meta {
  display: none;
}

.ai-history-menu {
  margin-right: 3px;
}

.ai-history-menu > summary {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  opacity: 0;
  color: #7e8997;
  font-size: 13px;
  transition: opacity .1s ease, background .1s ease;
}

.ai-history-item:hover .ai-history-menu > summary,
.ai-history-item.current .ai-history-menu > summary,
.ai-history-menu[open] > summary,
.ai-history-menu > summary:focus-visible {
  opacity: 1;
}

.ai-history-menu > summary:hover,
.ai-history-menu[open] > summary {
  background: #dde3ea;
  color: #475467;
}

.ai-history-menu-popover {
  width: 108px;
  top: calc(100% + 4px);
  right: 0;
  padding: 5px;
  border-color: #e0e4e9;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(31, 41, 55, .14);
}

.ai-history-menu-popover button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 11px;
}

.ai-full-chat-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  padding: 0;
}

.ai-full-chat-head,
.ai-full-context-bar {
  display: none !important;
}

.ai-full-chat-shell {
  min-height: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.ai-full-messages {
  min-height: 0;
  max-height: none;
  padding: 28px max(28px, calc((100% - 1080px) / 2));
}

.ai-full-messages .ai-empty-state {
  min-height: 100%;
}

.ai-full-messages .ai-message-bubble {
  max-width: min(900px, 90%);
}

.ai-full-messages .ai-message-sources {
  width: min(900px, 94%);
}

.ai-full-chat-shell > .ai-composer {
  padding: 7px 20px 10px;
  border-top: 0;
  background:
    linear-gradient(
      to bottom,
      rgba(255,255,255,0),
      rgba(255,255,255,.96) 12px,
      #fff 100%
    );
}

.ai-full-chat-shell > .ai-composer .ai-composer-main,
.ai-full-chat-shell > .ai-composer .ai-composer-context {
  width: min(800px, 100%);
}

.ai-full-chat-shell > .ai-composer .ai-input-shell {
  min-height: 50px;
  padding-top: 3px;
  padding-bottom: 3px;
  border-color: #dfe3e9;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(31, 41, 55, .035);
}

.ai-full-chat-shell > .ai-composer .ai-send-button {
  min-width: 82px;
  min-height: 50px;
  height: 50px;
  padding: 0 12px;
  border-radius: 16px;
}

.ai-full-chat-shell > .ai-composer .ai-reference-panel {
  width: min(800px, calc(100% - 40px));
}

@media (max-width: 1180px) and (min-width: 761px) {
  .ai-workspace-page {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .ai-history-sidebar-head {
    padding-left: 8px;
    padding-right: 8px;
  }

  .ai-history-sidebar .ai-history-list {
    padding-left: 5px;
    padding-right: 5px;
  }

  .ai-full-messages {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 760px) {
  .ai-workspace-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .ai-history-sidebar {
    max-height: 156px;
  }

  .ai-history-sidebar-head {
    padding: 7px 9px;
  }

  .ai-return-library {
    min-height: 31px;
  }

  .ai-history-brand-row {
    min-height: 31px;
  }

  .ai-history-new-button {
    min-height: 32px;
  }

  .ai-full-messages {
    padding: 16px 12px;
  }

  .ai-full-chat-shell > .ai-composer {
    padding: 7px 9px 9px;
  }
}

/* AI sources Mark 5: compact citation rows */
.ai-message-sources {
  margin-top: 8px;
}

.ai-message-sources > strong {
  margin: 0 0 4px 4px;
  color: #8b95a4;
  font-size: 10px;
  font-weight: 650;
}

.ai-source-list {
  display: grid;
  gap: 1px;
}

.ai-source-card {
  display: block;
  padding: 5px 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  transition: background .12s ease;
}

.ai-source-card:hover {
  border-color: transparent;
  background: #f4f6f9;
  transform: none;
}

.ai-source-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.ai-source-index {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border-radius: 5px;
  font-size: 8px;
}

.ai-source-title {
  min-width: 0;
  max-width: 44%;
  overflow: hidden;
  color: #334155;
  font-size: 11px;
  font-weight: 690;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-source-meta {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: #98a2b3;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-source-snippet {
  display: none;
}

.ai-source-open {
  margin: 0;
  flex: 0 0 14px;
  color: #8090a5;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
}

.ai-source-card:hover .ai-source-open {
  color: #4f6f99;
}

@media (max-width: 760px) {
  .ai-source-title {
    max-width: 52%;
  }

  .ai-source-meta {
    font-size: 8px;
  }
}



/* AI Markdown rendering · 2026-09-22 */
.ai-message-assistant .ai-message-bubble.is-markdown {
  white-space: normal;
}

.ai-message-bubble.is-markdown > :first-child {
  margin-top: 0;
}

.ai-message-bubble.is-markdown > :last-child {
  margin-bottom: 0;
}

.ai-message-bubble.is-markdown p {
  margin: 0 0 0.72em;
}

.ai-message-bubble.is-markdown h1,
.ai-message-bubble.is-markdown h2,
.ai-message-bubble.is-markdown h3,
.ai-message-bubble.is-markdown h4 {
  margin: 1.15em 0 0.5em;
  color: inherit;
  line-height: 1.35;
}

.ai-message-bubble.is-markdown h1 {
  font-size: 1.34em;
}

.ai-message-bubble.is-markdown h2 {
  font-size: 1.22em;
}

.ai-message-bubble.is-markdown h3 {
  font-size: 1.1em;
}

.ai-message-bubble.is-markdown ul,
.ai-message-bubble.is-markdown ol {
  margin: 0.45em 0 0.8em;
  padding-left: 1.55em;
}

.ai-message-bubble.is-markdown li + li {
  margin-top: 0.22em;
}

.ai-message-bubble.is-markdown blockquote {
  margin: 0.7em 0;
  padding: 0.15em 0 0.15em 0.85em;
  border-left: 3px solid #d8dce5;
  color: #667085;
}

.ai-message-bubble.is-markdown code {
  padding: 0.12em 0.34em;
  border-radius: 5px;
  background: #f2f4f7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.ai-message-bubble.is-markdown pre {
  margin: 0.75em 0;
  padding: 12px 14px;
  overflow-x: auto;
  border: 1px solid #e6e9ef;
  border-radius: 10px;
  background: #f7f8fa;
  line-height: 1.55;
}

.ai-message-bubble.is-markdown pre code {
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.9em;
}

.ai-message-bubble.is-markdown table {
  width: 100%;
  margin: 0.75em 0;
  border-collapse: collapse;
  font-size: 0.95em;
}

.ai-message-bubble.is-markdown th,
.ai-message-bubble.is-markdown td {
  padding: 7px 9px;
  border: 1px solid #dfe3e9;
  text-align: left;
  vertical-align: top;
}

.ai-message-bubble.is-markdown th {
  background: #f6f7f9;
  font-weight: 650;
}

.ai-message-bubble.is-markdown a {
  color: #4f63d8;
  text-decoration: none;
}

.ai-message-bubble.is-markdown a:hover {
  text-decoration: underline;
}

.ai-message-bubble.is-markdown hr {
  margin: 1em 0;
  border: 0;
  border-top: 1px solid #e5e7eb;
}


/* AI sources Mark 6: source open area + reference action */
.ai-source-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 3px;
  border-radius: 7px;
}

.ai-source-item .ai-source-card {
  min-width: 0;
  width: 100%;
}

.ai-source-reference-button {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #8090a5;
  cursor: pointer;
  transition:
    background .12s ease,
    color .12s ease,
    transform .12s ease;
}

.ai-source-reference-button:hover,
.ai-source-reference-button:focus-visible {
  background: #edf1f6;
  color: #4d6689;
  outline: none;
}

.ai-source-reference-button:active {
  transform: scale(.94);
}

.ai-source-reference-button.selected {
  background: #eef0ff;
  color: #5962df;
}

.ai-source-reference-button svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.ai-source-item:has(.ai-source-reference-button:hover) .ai-source-card {
  background: transparent;
}

@media (max-width: 760px) {
  .ai-source-item {
    grid-template-columns: minmax(0, 1fr) 30px;
  }

  .ai-source-reference-button {
    width: 28px;
    height: 28px;
  }
}

/* AI workspace Mark 7: DeepSeek-style conversation layout + history controls */
.ai-workspace-page {
  grid-template-columns: 260px minmax(0, 1fr);
}

.ai-history-sidebar-head {
  gap: 8px;
  padding: 8px 10px 10px;
}

.ai-history-topline {
  min-width: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-history-topline .ai-return-library {
  min-width: 0;
  min-height: 34px;
  flex: 1 1 auto;
  padding-right: 6px;
}

.ai-history-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.ai-history-icon-button {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #667085;
  cursor: pointer;
}

.ai-history-icon-button:hover,
.ai-history-icon-button.active {
  background: #eceff3;
  color: #253247;
}

.ai-history-icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-history-new-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.ai-history-new-plus {
  font-size: 16px;
  line-height: 1;
}

.ai-history-search[hidden],
.ai-history-bulk-bar[hidden] {
  display: none !important;
}

.ai-history-search {
  min-height: 36px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 5px;
  padding: 0 6px 0 9px;
  border: 1px solid #dfe4eb;
  border-radius: 10px;
  background: #fff;
}

.ai-history-search > svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #8a94a3;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.ai-history-search input {
  min-width: 0;
  width: 100%;
  height: 32px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #273142;
  font: inherit;
  font-size: 11px;
}

.ai-history-search input::placeholder {
  color: #a0a8b5;
}

.ai-history-search button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #98a2b3;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.ai-history-search button:hover {
  background: #f0f2f5;
  color: #667085;
}

.ai-history-bulk-bar {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 4px 3px 8px;
  border-radius: 9px;
  background: #eef2f7;
}

.ai-history-bulk-bar > span {
  color: #667085;
  font-size: 10px;
  white-space: nowrap;
}

.ai-history-bulk-bar > div {
  display: flex;
  align-items: center;
  gap: 1px;
}

.ai-history-bulk-bar button {
  min-height: 27px;
  padding: 0 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #556070;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.ai-history-bulk-bar button:hover:not(:disabled) {
  background: #fff;
  color: #253247;
}

.ai-history-bulk-bar button.danger {
  color: #b42318;
}

.ai-history-bulk-bar button:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.ai-history-list.is-selecting .ai-history-menu {
  display: none;
}

.ai-history-item.is-selected {
  background: #e7eefc;
}

.ai-history-select {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 18px;
  margin-left: 8px;
  padding: 0;
  border: 1px solid #c9d1dc;
  border-radius: 5px;
  background: #fff;
  color: transparent;
  cursor: pointer;
}

.ai-history-select[aria-pressed="true"] {
  border-color: #5a78d1;
  background: #5a78d1;
  color: #fff;
}

.ai-history-select svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-history-list.is-selecting .ai-history-open {
  padding-left: 5px;
}

.ai-full-messages {
  padding-left: 24px;
  padding-right: 24px;
}

.ai-full-messages .ai-message-row {
  width: min(760px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.ai-full-messages .ai-message-user .ai-message-bubble {
  max-width: calc(100% - 88px);
  padding: 10px 16px;
  border-radius: 22px;
  background: #edf3fe;
  color: #0f1115;
  line-height: 1.6;
  box-shadow: none;
}

.ai-message-assistant .ai-message-bubble {
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #20242c;
  box-shadow: none;
}

.ai-full-messages .ai-message-assistant .ai-message-bubble {
  width: 100%;
}

.ai-full-messages .ai-message-assistant .ai-message-sources {
  width: 100%;
  max-width: 100%;
}

.ai-message-actions {
  min-height: 26px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.ai-message-user .ai-message-actions {
  justify-content: flex-end;
}

.ai-message-copy {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #8a94a3;
  cursor: pointer;
  opacity: .72;
}

.ai-message-copy:hover,
.ai-message-copy.is-copied {
  background: #f0f2f5;
  color: #475467;
  opacity: 1;
}

.ai-message-copy.is-copied {
  color: #2f6c49;
}

.ai-message-copy svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 761px) {
  .ai-workspace-page.ai-sidebar-collapsed {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .ai-workspace-page.ai-sidebar-collapsed .ai-history-sidebar-head {
    justify-items: center;
    padding: 10px 8px;
  }

  .ai-workspace-page.ai-sidebar-collapsed .ai-history-topline {
    width: 100%;
    justify-content: center;
  }

  .ai-workspace-page.ai-sidebar-collapsed .ai-return-library,
  .ai-workspace-page.ai-sidebar-collapsed .ai-history-brand-row,
  .ai-workspace-page.ai-sidebar-collapsed .ai-history-search,
  .ai-workspace-page.ai-sidebar-collapsed .ai-history-bulk-bar,
  .ai-workspace-page.ai-sidebar-collapsed .ai-history-list,
  .ai-workspace-page.ai-sidebar-collapsed
    .ai-history-header-actions
    > :not([data-ai-sidebar-toggle]) {
    display: none !important;
  }

  .ai-workspace-page.ai-sidebar-collapsed .ai-history-header-actions {
    display: flex;
  }

  .ai-workspace-page.ai-sidebar-collapsed .ai-history-new-button {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 10px;
  }

  .ai-workspace-page.ai-sidebar-collapsed .ai-history-new-text {
    display: none;
  }

  .ai-workspace-page.ai-sidebar-collapsed .ai-history-new-plus {
    font-size: 18px;
  }
}

@media (max-width: 760px) {
  .ai-sidebar-toggle-button {
    display: none;
  }

  .ai-history-topline {
    min-height: 34px;
  }

  .ai-history-header-actions {
    margin-left: auto;
  }

  .ai-full-messages .ai-message-user .ai-message-bubble {
    max-width: 88%;
  }
}



/* AI thinking Mark 7: animated status + collapsible process trace */
.ai-thinking-panel {
  width: min(760px, 100%);
  margin: 0 0 10px;
  color: #697386;
}

.ai-full-messages .ai-thinking-panel {
  width: 100%;
}

.ai-thinking-summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0 2px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.ai-thinking-summary::-webkit-details-marker {
  display: none;
}

.ai-thinking-summary:hover {
  color: #475467;
}

.ai-thinking-title-wrap {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ai-thinking-static-icon {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 16px;
  color: #8792a3;
}

.ai-thinking-static-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-origin: 50% 50%;
}

.ai-thinking-panel.is-active .ai-thinking-static-icon {
  color: #6475db;
  animation: ai-thinking-spark-color 1.2s ease-in-out infinite;
}

.ai-thinking-panel.is-active .ai-thinking-static-icon svg {
  animation:
    ai-thinking-spark-spin 1.8s linear infinite,
    ai-thinking-spark-breathe .9s ease-in-out infinite alternate;
}

.ai-thinking-label {
  overflow: hidden;
  color: #697386;
  font-size: 12px;
  font-weight: 590;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-thinking-panel.is-active .ai-thinking-label {
  color: #536174;
}

.ai-thinking-activity {
  width: 18px;
  height: 18px;
  position: relative;
  flex: 0 0 18px;
  margin-left: auto;
  color: #6879d8;
}

.ai-thinking-activity > span {
  width: 4px;
  height: 4px;
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: .25;
  animation: ai-thinking-orbit-dot 1.1s ease-in-out infinite;
}

.ai-thinking-activity > span:nth-child(1) {
  top: 1px;
  left: 7px;
  animation-delay: 0s;
}

.ai-thinking-activity > span:nth-child(2) {
  top: 7px;
  right: 1px;
  animation-delay: .14s;
}

.ai-thinking-activity > span:nth-child(3) {
  bottom: 1px;
  left: 7px;
  animation-delay: .28s;
}

.ai-thinking-activity > span:nth-child(4) {
  top: 7px;
  left: 1px;
  animation-delay: .42s;
}

.ai-thinking-panel:not(.is-active) .ai-thinking-activity {
  display: none;
}

.ai-thinking-panel:not(.is-active) .ai-thinking-summary::after {
  content: "›";
  margin-left: 3px;
  color: #8f98a6;
  font-size: 16px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .12s ease;
}

.ai-thinking-panel[open]:not(.is-active) .ai-thinking-summary::after {
  transform: rotate(90deg);
}

.ai-thinking-body {
  margin: 1px 0 2px 8px;
  padding: 5px 0 8px 16px;
  border-left: 1px solid #e2e7ed;
}

.ai-thinking-body-title {
  margin-bottom: 5px;
  color: #9aa3b0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .03em;
}

.ai-thinking-steps {
  display: grid;
  gap: 6px;
}

.ai-thinking-step {
  min-height: 20px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  color: #7a8493;
}

.ai-thinking-step-marker {
  width: 6px;
  height: 6px;
  margin-top: 6px;
  border-radius: 50%;
  background: #cbd2dc;
}

.ai-thinking-step-done .ai-thinking-step-marker {
  background: #8d99aa;
}

.ai-thinking-step-active .ai-thinking-step-marker {
  background: #6374db;
  box-shadow: 0 0 0 3px rgba(99, 116, 219, .12);
  animation: ai-thinking-step-pulse 1.2s ease-in-out infinite;
}

.ai-thinking-step-error .ai-thinking-step-marker {
  background: #c66a64;
}

.ai-thinking-step-text {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
  line-height: 1.45;
}

.ai-thinking-step-text strong {
  color: #687386;
  font-size: 11px;
  font-weight: 580;
}

.ai-thinking-step-text span {
  min-width: 0;
  overflow: hidden;
  color: #9aa3b0;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-thinking-panel.is-failed .ai-thinking-label {
  color: #a45e59;
}

@keyframes ai-thinking-spark-spin {
  0% {
    transform: rotate(0deg) scale(.92);
  }
  25% {
    transform: rotate(90deg) scale(1.06);
  }
  50% {
    transform: rotate(180deg) scale(.96);
  }
  75% {
    transform: rotate(270deg) scale(1.08);
  }
  100% {
    transform: rotate(360deg) scale(.92);
  }
}

@keyframes ai-thinking-spark-breathe {
  from {
    filter: drop-shadow(0 0 0 rgba(99, 116, 219, 0));
  }
  to {
    filter: drop-shadow(0 0 3px rgba(99, 116, 219, .42));
  }
}

@keyframes ai-thinking-spark-color {
  0%, 100% {
    opacity: .68;
  }
  50% {
    opacity: 1;
  }
}

@keyframes ai-thinking-orbit-dot {
  0%, 55%, 100% {
    opacity: .22;
    transform: scale(.72);
  }
  25% {
    opacity: 1;
    transform: scale(1.12);
  }
}

@keyframes ai-thinking-step-pulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(99, 116, 219, .10);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(99, 116, 219, .04);
  }
}

@media (max-width: 760px) {
  .ai-thinking-summary {
    min-height: 32px;
  }

  .ai-thinking-label {
    font-size: 11px;
  }

  .ai-thinking-body {
    margin-left: 7px;
    padding-left: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-thinking-panel.is-active .ai-thinking-static-icon,
  .ai-thinking-panel.is-active .ai-thinking-static-icon svg,
  .ai-thinking-activity > span,
  .ai-thinking-step-active .ai-thinking-step-marker {
    animation: none;
  }
}


/* Admin AI model settings */
.ai-model-page-head {
  align-items: center;
}

.ai-model-live-state {
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e3e7ed;
  border-radius: 12px;
  background: #fff;
}

.ai-model-live-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #9aa3b0;
}

.ai-model-live-state.is-ready .ai-model-live-dot {
  background: #3b9a68;
  box-shadow: 0 0 0 4px rgba(59, 154, 104, .10);
}

.ai-model-live-state.is-offline .ai-model-live-dot {
  background: #a3aab5;
}

.ai-model-live-state > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ai-model-live-state strong {
  color: #2f3a4a;
  font-size: 12px;
}

.ai-model-live-state span:last-child {
  overflow: hidden;
  color: #8993a1;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-model-current {
  margin-bottom: 16px;
}

.ai-model-current-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ai-model-current-grid > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 12px 13px;
  border: 1px solid #e8ebef;
  border-radius: 10px;
  background: #fafbfc;
}

.ai-model-current-grid span {
  color: #98a1ad;
  font-size: 10px;
}

.ai-model-current-grid strong {
  overflow: hidden;
  color: #364152;
  font-size: 12px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-model-form {
  display: grid;
  gap: 14px;
}

.ai-model-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px 16px;
}

.ai-model-form-grid label {
  min-width: 0;
}

.ai-model-form-grid .ai-model-wide {
  grid-column: 1 / -1;
}

.ai-model-form-grid small {
  display: block;
  margin-top: 5px;
  color: #929baa;
  font-size: 10px;
  line-height: 1.45;
}

.ai-model-timeout {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-model-timeout input {
  width: 110px;
}

.ai-model-timeout > span {
  color: #7f8998;
  font-size: 11px;
}

.ai-model-test-state {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid #e0e5eb;
  border-radius: 10px;
  background: #f8fafc;
  color: #5f6c7e;
  font-size: 11px;
  line-height: 1.5;
}

.ai-model-test-state.is-testing {
  border-color: #d9dcef;
  background: #f6f7ff;
  color: #5966a8;
}

.ai-model-test-state.is-success {
  border-color: #cfe6d8;
  background: #f4fbf7;
  color: #377453;
}

.ai-model-test-state.is-error {
  border-color: #ecd4d2;
  background: #fff7f6;
  color: #9a514c;
}

.ai-model-test-state.is-neutral {
  color: #6f7987;
}

.ai-model-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 24px;
}

.ai-model-actions .button[disabled] {
  cursor: not-allowed;
  opacity: .45;
}

@media (max-width: 900px) {
  .ai-model-page-head {
    align-items: stretch;
  }

  .ai-model-live-state {
    min-width: 0;
  }

  .ai-model-current-grid,
  .ai-model-form-grid {
    grid-template-columns: 1fr;
  }

  .ai-model-form-grid .ai-model-wide {
    grid-column: auto;
  }
}


/* AI full-page account + composer alignment · 2026-09-22 */
.ai-history-sidebar {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.ai-history-account-zone {
  position: relative;
  z-index: 6;
  padding: 8px 10px 10px;
  border-top: 1px solid #eceff3;
  background: #f7f8fa;
}

.ai-history-account-menu {
  position: relative;
}

.ai-history-account-menu > summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 7px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #253247;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.ai-history-account-menu > summary::-webkit-details-marker {
  display: none;
}

.ai-history-account-menu > summary::after {
  content: none;
}

.ai-history-account-menu > summary:hover,
.ai-history-account-menu[open] > summary {
  background: #eceff3;
}

.ai-history-account-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  border-radius: 50%;
  background: linear-gradient(145deg, #e8def8, #d9e5ff);
  color: #4a4458;
  font-size: 13px;
  font-weight: 760;
  line-height: 1;
}

.ai-history-account-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
}

.ai-history-account-copy strong,
.ai-history-account-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-history-account-copy strong {
  color: #253247;
  font-size: 12px;
  font-weight: 680;
  line-height: 1.25;
}

.ai-history-account-copy span {
  color: #8a94a3;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.25;
}

.ai-history-account-more {
  flex: 0 0 auto;
  color: #7e8997;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.ai-history-account-alert {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #d93025;
}

.ai-history-account-popover {
  width: 218px;
  position: absolute;
  left: 0;
  bottom: calc(100% + 7px);
  z-index: 100;
  overflow: hidden;
  border: 1px solid #e0e4e9;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(31, 41, 55, .16);
}

.ai-history-account-popover-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 13px 11px;
  border-bottom: 1px solid #edf0f4;
}

.ai-history-account-avatar-large {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  font-size: 14px;
}

.ai-history-account-popover-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ai-history-account-popover-head strong,
.ai-history-account-popover-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-history-account-popover-head strong {
  color: #253247;
  font-size: 13px;
  font-weight: 680;
}

.ai-history-account-popover-head span {
  color: #8a94a3;
  font-size: 10px;
}

.ai-history-account-links {
  display: grid;
  padding: 5px;
}

.ai-history-account-links a,
.ai-history-account-logout button {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #556070;
  font: inherit;
  font-size: 11px;
  font-weight: 540;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.ai-history-account-links a:hover,
.ai-history-account-logout button:hover {
  background: #f1f3f4;
  color: #253247;
}

.ai-history-account-logout {
  margin: 0;
  padding: 5px;
  border-top: 1px solid #edf0f4;
}

.ai-history-account-logout button {
  color: #b42318;
}

.ai-full-chat-shell .ai-composer-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.ai-full-chat-shell .ai-composer-add-icon {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
}

@media (min-width: 761px) {
  .ai-workspace-page.ai-sidebar-collapsed .ai-history-account-zone {
    padding: 8px;
  }

  .ai-workspace-page.ai-sidebar-collapsed .ai-history-account-menu > summary {
    width: 40px;
    min-height: 40px;
    justify-content: center;
    margin: 0 auto;
    padding: 0;
    border-radius: 10px;
  }

  .ai-workspace-page.ai-sidebar-collapsed .ai-history-account-avatar {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .ai-workspace-page.ai-sidebar-collapsed .ai-history-account-copy,
  .ai-workspace-page.ai-sidebar-collapsed .ai-history-account-more,
  .ai-workspace-page.ai-sidebar-collapsed .ai-history-account-alert {
    display: none;
  }

  .ai-workspace-page.ai-sidebar-collapsed .ai-history-account-popover {
    left: 46px;
    bottom: 0;
  }
}

@media (max-width: 760px) {
  .ai-history-sidebar {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .ai-history-account-zone {
    display: none;
  }
}


/* AI model pool + user model selector */
.ai-model-pool-section {
  margin-bottom: 16px;
}

.ai-model-pool-list {
  display: grid;
  gap: 8px;
}

.ai-model-pool-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid #e5e9ef;
  border-radius: 12px;
  background: #fff;
}

.ai-model-pool-card.is-default {
  border-color: #cfd7f5;
  background: #fbfcff;
}

.ai-model-pool-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.ai-model-pool-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.ai-model-pool-title-row > strong {
  min-width: 0;
  overflow: hidden;
  color: #273142;
  font-size: 13px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-model-pool-badges {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.ai-model-badge {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #f0f2f5;
  color: #778190;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.ai-model-badge.is-default {
  background: #eef0ff;
  color: #5966b7;
}

.ai-model-badge.is-on,
.ai-model-badge.is-public {
  background: #eef8f2;
  color: #397256;
}

.ai-model-badge.is-off,
.ai-model-badge.is-private {
  background: #f4f5f7;
  color: #8b94a1;
}

.ai-model-pool-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #8a94a3;
  font-size: 10px;
}

.ai-model-pool-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-model-pool-meta span + span::before {
  content: "·";
  margin-right: 7px;
  color: #c1c7d0;
}

.ai-model-pool-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  flex-wrap: wrap;
}

.ai-model-pool-actions form {
  margin: 0;
}

.ai-model-pool-actions .link-button {
  min-height: 28px;
  padding: 0 7px;
  border-radius: 7px;
  font-size: 10px;
  text-decoration: none;
}

.ai-model-pool-actions .link-button:hover:not(:disabled) {
  background: #f2f4f7;
}

.ai-model-pool-actions .link-button:disabled {
  cursor: not-allowed;
  opacity: .38;
}

.ai-model-pool-actions .link-button.danger {
  color: #b15a55;
}

.ai-model-env-fallback,
.ai-model-empty-pool {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px dashed #d9dee6;
  border-radius: 12px;
  background: #fafbfc;
  color: #7b8594;
  font-size: 11px;
}

.ai-model-env-fallback strong,
.ai-model-empty-pool strong {
  color: #425066;
  font-size: 12px;
}

.ai-model-env-fallback p {
  margin: 3px 0 0;
}

.ai-model-switch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--gmail-line);
}

.ai-model-switch-grid .switch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: start;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.ai-model-switch-grid .switch-row > span:first-child {
  min-width: 0;
}

.ai-model-switch-grid .switch-row strong {
  display: block;
  color: var(--gmail-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
}

.ai-model-switch-grid .switch-row small {
  display: block;
  margin-top: 4px;
  color: var(--gmail-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.ai-model-switch-grid .switch-visual {
  box-sizing: border-box;
  grid-column: 2;
  grid-row: 1;
}

.ai-model-switch-grid .switch-state {
  display: none;
}

.ai-model-switch-grid input:focus-visible + .switch-visual {
  outline: 2px solid var(--gmail-blue);
  outline-offset: 3px;
}

.ai-input-shell:has(.ai-model-picker) {
  grid-template-columns: 34px minmax(92px, 148px) minmax(0, 1fr);
}

.ai-model-picker {
  min-width: 0;
  height: 30px;
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: center;
  border: 1px solid #e1e5eb;
  border-radius: 9px;
  background: #f7f8fa;
  color: #586475;
}

.ai-model-picker select {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 23px 0 9px;
  border: 0;
  outline: 0;
  appearance: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  cursor: pointer;
}

.ai-model-picker select:disabled {
  cursor: wait;
  opacity: .58;
}

.ai-model-picker-chevron {
  position: absolute;
  right: 7px;
  top: 50%;
  pointer-events: none;
  color: #8f98a6;
  font-size: 10px;
  transform: translateY(-55%);
}

.ai-model-picker-empty {
  justify-content: center;
  padding: 0 9px;
  color: #929baa;
  font-size: 9px;
  cursor: default;
}

.ai-drawer .ai-input-shell:has(.ai-model-picker) {
  grid-template-columns: 34px minmax(82px, 112px) minmax(0, 1fr);
}

.ai-drawer .ai-model-picker select {
  padding-left: 7px;
  font-size: 9px;
}

@media (max-width: 1000px) {
  .ai-model-pool-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ai-model-pool-actions {
    justify-content: flex-start;
  }

  .ai-model-switch-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .ai-input-shell:has(.ai-model-picker) {
    grid-template-columns: 32px minmax(76px, 104px) minmax(0, 1fr);
  }

  .ai-model-picker {
    height: 28px;
  }

  .ai-model-picker select {
    padding-left: 6px;
    font-size: 9px;
  }
}

/* AI composer: align + icon center with first-line text center */
.ai-full-chat-shell > .ai-composer .ai-input-shell {
  align-items: start;
}

.ai-full-chat-shell > .ai-composer .ai-composer-leading {
  align-self: start;
  margin-top: 1.5px;
}


/* AI model pool actions alignment · 2026-09-22 */
.ai-model-pool-title-row {
  align-items: center;
}

.ai-model-pool-actions {
  min-height: 28px;
  align-items: center;
}

.ai-model-pool-actions form,
.ai-model-pool-actions a,
.ai-model-pool-actions .link-button {
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ai-model-pool-actions .link-button {
  padding-top: 0;
  padding-bottom: 0;
}

.ai-model-badge {
  line-height: 1;
}

/* AI model picker v2: OpenAI-style inline control */
.ai-input-shell:has(.ai-model-picker) {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}
.ai-drawer .ai-input-shell:has(.ai-model-picker) {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}
.ai-model-picker {
  height: 34px;
  border: 0;
  background: transparent;
  border-radius: 10px;
}
.ai-model-picker:hover {
  background: #f5f6f8;
}
.ai-model-picker select {
  padding: 0 22px 0 8px;
  font-size: 12px;
  font-weight: 550;
  color: #697386;
}
.ai-model-picker-chevron {
  right: 8px;
  font-size: 12px;
}
.ai-model-picker-empty {
  height: 34px;
  padding: 0 10px;
  font-size: 12px;
}


/* AI model selector refinement: OpenAI style compact control */
.ai-full-chat-shell .ai-input-shell:has(.ai-model-picker) {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
}

.ai-full-chat-shell .ai-input-shell .ai-composer-leading {
  grid-column: 1;
  grid-row: 1;
}

.ai-full-chat-shell .ai-input-shell textarea {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.ai-full-chat-shell .ai-input-shell .ai-model-picker {
  grid-column: 3;
  grid-row: 1;
  height: 34px;
  min-width: 92px;
  max-width: 150px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #697386;
  transition: background .12s ease;
}

.ai-full-chat-shell .ai-input-shell .ai-model-picker:hover {
  background: #f4f5f7;
}

.ai-full-chat-shell .ai-model-picker select {
  padding: 0 22px 0 10px;
  font-size: 12px;
  font-weight: 550;
  color: #667085;
  cursor: pointer;
}

.ai-full-chat-shell .ai-model-picker-chevron {
  right: 8px;
  font-size: 12px;
  color: #98a2b3;
}

.ai-full-chat-shell .ai-model-picker-empty {
  font-size: 12px;
  font-weight: 550;
}

@media (max-width: 760px) {
  .ai-full-chat-shell .ai-input-shell:has(.ai-model-picker) {
    grid-template-columns: 32px minmax(0, 1fr) auto;
  }

  .ai-full-chat-shell .ai-input-shell .ai-model-picker {
    min-width: 76px;
    max-width: 96px;
  }
}


/* AI model picker v3: composer control */
.ai-full-chat-shell .ai-input-shell:has(.ai-model-picker) {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
}

.ai-model-picker {
  position: relative;
  height: 34px;
}

.ai-model-picker-trigger {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #697386;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
}

.ai-model-picker-trigger:hover {
  background: #f4f5f7;
}

.ai-model-picker-chevron {
  position: static;
  transform: none;
  font-size: 11px;
}

.ai-model-picker-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 100;
  width: 220px;
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
}

.ai-model-picker-menu[hidden] {
  display: none;
}

.ai-model-picker-menu button {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.ai-model-picker-menu button:hover {
  background: #f3f4f6;
}

.ai-model-picker-menu span {
  color: #273142;
  font-size: 12px;
}

.ai-model-picker-menu small {
  color: #98a2b3;
  font-size: 10px;
}


/* AI model picker final refinement */
.ai-full-chat-shell .ai-model-picker {
  height: 32px;
}

.ai-full-chat-shell .ai-model-picker-trigger {
  height: 32px;
  padding: 0 7px;
  color: #5f6b7a;
  font-size: 13px;
  font-weight: 550;
  border-radius: 8px;
}

.ai-full-chat-shell .ai-model-picker-trigger:hover {
  background: #f1f3f5;
}

.ai-model-picker-menu {
  width: 260px;
  padding: 5px;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0,0,0,.14);
}

.ai-model-picker-menu button {
  position: relative;
  min-height: 46px;
  padding: 8px 34px 8px 11px;
}

.ai-model-picker-menu button.is-selected {
  background: #f2f4f7;
}

.ai-model-option-name {
  color: #202123;
  font-size: 13px;
  font-weight: 600;
}

.ai-model-picker-menu small {
  font-size: 11px;
}

.ai-model-option-check {
  display: none;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #2563eb;
  font-size: 14px;
  font-weight: 700;
}

.ai-model-picker-menu button.is-selected .ai-model-option-check {
  display: block;
}


/* AI reasoning strength control · OpenAI-inspired compact badge */
.ai-full-chat-shell .ai-input-shell:has(.ai-reasoning-picker) {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
}

.ai-reasoning-picker {
  position: relative;
  grid-column: 3;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  justify-self: end;
}

.ai-reasoning-trigger {
  min-width: 64px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px 0 13px;
  border: 0;
  border-radius: 17px;
  background: #f4f4f4;
  color: #8b8b8b;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}

.ai-reasoning-trigger:hover,
.ai-reasoning-trigger[aria-expanded="true"] {
  background: #ececec;
  color: #676767;
}

.ai-reasoning-chevron {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .14s ease;
}

.ai-reasoning-trigger[aria-expanded="true"] .ai-reasoning-chevron {
  transform: rotate(180deg);
}

.ai-reasoning-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 120;
  width: 270px;
  padding: 9px;
  border: 1px solid #e7e7e7;
  border-radius: 20px;
  background: #fff;
  box-shadow:
    0 16px 38px rgba(0, 0, 0, .10),
    0 2px 8px rgba(0, 0, 0, .05);
}

.ai-reasoning-menu[hidden] {
  display: none;
}

.ai-reasoning-menu button {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 42px 0 16px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #242424;
  font: inherit;
  font-size: 14px;
  font-weight: 450;
  text-align: left;
  cursor: pointer;
}

.ai-reasoning-menu button:hover {
  background: #f5f5f5;
}

.ai-reasoning-menu button.is-selected {
  background: #f7f7f7;
}

.ai-reasoning-option-check {
  display: none;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #1f1f1f;
  font-size: 17px;
  line-height: 1;
}

.ai-reasoning-menu button.is-selected .ai-reasoning-option-check {
  display: inline;
}

@media (max-width: 760px) {
  .ai-full-chat-shell .ai-input-shell:has(.ai-reasoning-picker) {
    grid-template-columns: 32px minmax(0, 1fr) auto;
  }

  .ai-reasoning-trigger {
    min-width: 58px;
    height: 32px;
    padding: 0 9px 0 11px;
    font-size: 12px;
  }

  .ai-reasoning-menu {
    width: 238px;
    right: -2px;
  }
}


/* Shared composer alignment and compact model control. */
.ai-full-chat-shell > .ai-composer .ai-input-shell,
.ai-drawer .ai-input-shell:has(.ai-model-picker) {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
}
.ai-full-chat-shell > .ai-composer .ai-composer-leading,
.ai-drawer .ai-input-shell .ai-composer-leading {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  margin: 0;
}
.ai-full-chat-shell > .ai-composer .ai-input-shell textarea,
.ai-drawer .ai-input-shell textarea {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  height: 42px;
  min-height: 42px;
  max-height: 160px;
  padding: 9px 8px;
  font-family: inherit;
  font-size: 14px;
  line-height: 24px;
  resize: none;
  overflow-y: hidden;
  scrollbar-width: none;
}
.ai-drawer .ai-input-shell textarea {
  height: 36px;
  min-height: 36px;
  padding: 6px 4px;
}
.ai-input-shell textarea:placeholder-shown {
  white-space: pre;
  text-overflow: ellipsis;
}
.ai-input-shell textarea::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.ai-full-chat-shell .ai-input-shell .ai-model-picker,
.ai-drawer .ai-input-shell .ai-model-picker {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  justify-self: end;
  min-width: 0;
  max-width: none;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
}
.ai-full-chat-shell .ai-model-picker-trigger,
.ai-drawer .ai-model-picker-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-width: 0;
  max-width: none;
  gap: 7px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #8b8b8b;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
}
.ai-full-chat-shell [data-ai-model-label] {
  display: block;
  min-width: 0;
  height: auto;
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 24px;
  white-space: nowrap;
}
.ai-model-picker-menu .ai-model-option-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-full-chat-shell .ai-model-picker-chevron,
.ai-drawer .ai-model-picker-chevron {
  position: static;
  display: block;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  transform: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: inherit;
}
.ai-drawer .ai-model-picker-trigger {
  width: 30px;
  padding: 0;
}
.ai-drawer [data-ai-model-label] {
  display: none;
}
.ai-drawer .ai-model-picker-menu {
  max-width: min(260px, calc(100vw - 64px));
}

/* External AI topbar preview · owner-only */
/* External AI guide preview · owner-only */
.topbar-external-ai-entry {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0 12px 0 8px;
  border: 1px solid #d9e0e8;
  border-radius: 11px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.topbar-external-ai-entry:hover,
.topbar-external-ai-entry.current {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #1f2937;
  box-shadow: 0 5px 16px rgba(51, 65, 85, .06);
}

.topbar-external-ai-entry:active {
  transform: translateY(1px);
}

.topbar-external-ai-entry:focus-visible {
  outline: 2px solid #5d63ef;
  outline-offset: 2px;
}

.topbar-external-ai-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, #7857f5 0%, #5f67ef 52%, #3694f8 100%);
  color: #fff;
  box-shadow: 0 5px 14px rgba(82, 108, 233, .18);
}

.topbar-external-ai-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mcp-guide-page {
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 56px;
  color: #172033;
}

.mcp-guide-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  padding: 24px 26px;
  border: 1px solid #e1e7ef;
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 20%, rgba(103, 92, 246, .10), transparent 26%),
    radial-gradient(circle at 83% 86%, rgba(51, 144, 250, .09), transparent 25%),
    #fff;
  box-shadow: 0 14px 34px rgba(39, 50, 82, .055);
}

.mcp-guide-hero-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  flex: 0 0 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #7857f5 0%, #5f67ef 52%, #3694f8 100%);
  color: #fff;
  box-shadow: 0 12px 28px rgba(82, 108, 233, .24);
}

.mcp-guide-hero-icon svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mcp-guide-hero h1 {
  margin: 0;
  color: #16223b;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 780;
  letter-spacing: -.035em;
  line-height: 1.08;
}

.mcp-guide-hero p {
  margin: 9px 0 0;
  color: #718096;
  font-size: 14px;
  line-height: 1.65;
}

.mcp-guide-notice {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px 17px;
  border: 1px solid #c9d8ff;
  border-radius: 14px;
  background: #f6f9ff;
  color: #315ccc;
}

.mcp-guide-notice > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #4f71eb;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  font-family: Georgia, serif;
}

.mcp-guide-notice p {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.6;
}

.mcp-guide-card,
.mcp-guide-grants {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  padding: 22px;
  border: 1px solid #e1e6ee;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(31, 41, 64, .045);
}

.mcp-guide-step {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #5d63ef, #398df5);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 7px 18px rgba(69, 103, 232, .20);
}

.mcp-guide-card-body {
  min-width: 0;
}

.mcp-guide-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.mcp-guide-card h2,
.mcp-guide-grants h2 {
  margin: 0;
  color: #17233c;
  font-size: 19px;
  font-weight: 760;
  letter-spacing: -.02em;
}

.mcp-guide-card-head p,
.mcp-guide-grants-head p {
  margin: 5px 0 0;
  color: #8791a3;
  font-size: 12px;
  line-height: 1.6;
}

.mcp-guide-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #dce3ec;
  border-radius: 12px;
  background: #f8fafc;
}

.mcp-guide-url-row code {
  min-width: 0;
  overflow: hidden;
  padding: 12px 14px;
  color: #475569;
  font-size: 12px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mcp-guide-url-row button,
.mcp-guide-copy-prompt {
  border: 0;
  background: linear-gradient(135deg, #5c63ef, #368cf6);
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  transition: opacity .14s ease, transform .14s ease, box-shadow .14s ease;
}

.mcp-guide-url-row button {
  min-width: 104px;
  padding: 0 17px;
}

.mcp-guide-copy-prompt {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0 15px;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(66, 100, 229, .16);
}

.mcp-guide-url-row button:hover,
.mcp-guide-copy-prompt:hover {
  opacity: .93;
  box-shadow: 0 9px 22px rgba(66, 100, 229, .20);
}

.mcp-guide-url-row button:active,
.mcp-guide-copy-prompt:active {
  transform: translateY(1px);
}

.mcp-guide-url-row button:focus-visible,
.mcp-guide-copy-prompt:focus-visible {
  outline: 2px solid #5d63ef;
  outline-offset: 2px;
}

.mcp-guide-prompt {
  margin: 0;
  padding: 18px;
  overflow: auto;
  border: 1px solid #dfe5ee;
  border-radius: 13px;
  background: #f8fafc;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.mcp-guide-grants {
  grid-template-columns: 1fr;
  margin-top: 22px;
}

.mcp-guide-grants-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.mcp-guide-grants-head > span {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
}

.mcp-guide-grant-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.mcp-guide-grant-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 13px;
  border: 1px solid #e6eaf0;
  border-radius: 12px;
  background: #fbfcfd;
}

.mcp-guide-grant-list article > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mcp-guide-grant-list strong {
  color: #344054;
  font-size: 12px;
}

.mcp-guide-grant-list span {
  color: #98a2b3;
  font-size: 10px;
}

.mcp-guide-grant-list button {
  padding: 6px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9a4f4f;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.mcp-guide-grant-list button:hover {
  background: #fff1f1;
}

.mcp-guide-empty {
  margin-top: 14px;
  padding: 15px;
  border: 1px dashed #dce2ea;
  border-radius: 12px;
  background: #fafbfc;
  color: #98a2b3;
  font-size: 11px;
}

@media (max-width: 760px) {
  .topbar-external-ai-entry {
    min-height: 34px;
    padding: 0 7px;
  }

  .topbar-external-ai-label {
    display: none;
  }

  .mcp-guide-page {
    width: min(100% - 24px, 680px);
    padding-top: 20px;
  }

  .mcp-guide-hero {
    align-items: flex-start;
    padding: 20px;
  }

  .mcp-guide-hero-icon {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    border-radius: 14px;
  }

  .mcp-guide-hero-icon svg {
    width: 26px;
    height: 26px;
  }

  .mcp-guide-card {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
    padding: 18px 15px;
  }

  .mcp-guide-step {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .mcp-guide-card-head,
  .mcp-guide-grants-head {
    align-items: stretch;
    flex-direction: column;
  }

  .mcp-guide-copy-prompt {
    align-self: flex-start;
  }
}

@media (max-width: 520px) {
  .mcp-guide-hero {
    gap: 12px;
  }

  .mcp-guide-hero h1 {
    font-size: 26px;
  }

  .mcp-guide-hero p {
    font-size: 12px;
  }

  .mcp-guide-notice {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 9px;
    padding: 12px;
  }

  .mcp-guide-notice > span {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .mcp-guide-url-row {
    grid-template-columns: 1fr;
  }

  .mcp-guide-url-row button {
    min-height: 38px;
    border-top: 1px solid #dce3ec;
  }

  .mcp-guide-prompt {
    padding: 14px;
    font-size: 11px;
  }
}


/* MCP guide platform-first flow */
.mcp-platform-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  padding: 22px;
  border: 1px solid #e1e6ee;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(31, 41, 64, .045);
}

.mcp-platform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mcp-platform-option {
  min-height: 76px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 12px 13px;
  border: 1px solid #e1e6ee;
  border-radius: 14px;
  background: #fff;
  color: #344054;
  text-align: left;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease, transform .14s ease;
}

.mcp-platform-option:hover {
  border-color: #cfd6e3;
  background: #fafbff;
  box-shadow: 0 7px 18px rgba(54, 70, 113, .06);
  transform: translateY(-1px);
}

.mcp-platform-option.is-selected {
  border-color: #8ea3ff;
  background: #f5f7ff;
  box-shadow: 0 0 0 2px rgba(93, 99, 239, .08);
}

.mcp-platform-option:focus-visible {
  outline: 2px solid #5d63ef;
  outline-offset: 2px;
}

.mcp-platform-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #f1f3f6;
  color: #465165;
  font-size: 13px;
  font-weight: 800;
}

.mcp-platform-mark.is-chatgpt { background: #edf6f2; color: #167b66; }
.mcp-platform-mark.is-claude { background: #fbf0ea; color: #b45f3a; }
.mcp-platform-mark.is-gemini { background: #eef2ff; color: #5966ce; }
.mcp-platform-mark.is-cursor { background: #eff1f4; color: #222b38; }
.mcp-platform-mark.is-vscode { background: #eaf4fd; color: #2d78b7; }
.mcp-platform-mark.is-other { background: #f2efff; color: #6f55cf; }

.mcp-platform-option > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mcp-platform-option strong {
  color: #273142;
  font-size: 13px;
  font-weight: 760;
}

.mcp-platform-option small {
  color: #98a2b3;
  font-size: 10px;
}

.mcp-prompt-card[hidden] {
  display: none;
}

.mcp-prompt-card {
  animation: mcpPromptReveal .18s ease-out;
}

@keyframes mcpPromptReveal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.mcp-selected-platform-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 7px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #6570c8;
  font-size: 10px;
  font-weight: 650;
}

.mcp-selected-platform-label strong {
  color: #4f5ec4;
}

.mcp-guide-url-inline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid #e2e7ee;
  border-radius: 11px;
  background: #fbfcfd;
}

.mcp-guide-url-inline > span {
  color: #98a2b3;
  font-size: 10px;
  font-weight: 700;
}

.mcp-guide-url-inline code {
  min-width: 0;
  overflow: hidden;
  color: #596273;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mcp-guide-url-inline button {
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  background: #eef2ff;
  color: #5966d8;
  font: inherit;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.mcp-guide-url-inline button:hover {
  background: #e6eaff;
}

@media (max-width: 760px) {
  .mcp-platform-card {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
    padding: 18px 15px;
  }

  .mcp-platform-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mcp-guide-url-inline {
    grid-template-columns: 1fr auto;
  }

  .mcp-guide-url-inline > span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .mcp-platform-grid {
    grid-template-columns: 1fr;
  }
}

/* MCP platform selector v3 · category → list → custom input */
.mcp-category-card,
.mcp-platform-picker {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  padding: 22px;
  border: 1px solid #e1e6ee;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(31, 41, 64, .045);
}

.mcp-platform-picker[hidden] {
  display: none;
}

.mcp-platform-picker {
  animation: mcpStageReveal .18s ease-out;
}

@keyframes mcpStageReveal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.mcp-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mcp-category-option {
  min-height: 82px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 15px;
  border: 1px solid #e0e6ef;
  border-radius: 14px;
  background: #fff;
  color: #344054;
  text-align: left;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease, transform .14s ease;
}

.mcp-category-option:hover {
  border-color: #ccd5e4;
  background: #fafbff;
  box-shadow: 0 8px 20px rgba(54, 70, 113, .06);
  transform: translateY(-1px);
}

.mcp-category-option.is-selected {
  border-color: #8fa4ff;
  background: #f4f6ff;
  box-shadow: 0 0 0 2px rgba(93, 99, 239, .07);
}

.mcp-category-option:focus-visible {
  outline: 2px solid #5d63ef;
  outline-offset: 2px;
}

.mcp-category-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
}

.mcp-category-icon.is-agent {
  background: linear-gradient(135deg, #eef0ff, #e7edff);
  color: #5d63df;
}

.mcp-category-icon.is-ide {
  background: linear-gradient(135deg, #e9f4ff, #e8f1fb);
  color: #327bb8;
}

.mcp-category-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mcp-category-icon circle {
  fill: currentColor;
  stroke: none;
}

.mcp-category-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mcp-category-copy strong {
  color: #273142;
  font-size: 15px;
  font-weight: 780;
}

.mcp-category-copy small {
  overflow: hidden;
  color: #98a2b3;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mcp-category-chevron {
  color: #a6afbd;
  font-size: 21px;
  line-height: 1;
  transition: transform .14s ease, color .14s ease;
}

.mcp-category-option.is-selected .mcp-category-chevron {
  color: #5d63df;
  transform: rotate(180deg);
}

.mcp-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.mcp-picker-head h2 {
  margin: 2px 0 0;
  color: #17233c;
  font-size: 19px;
  font-weight: 760;
  letter-spacing: -.02em;
}

.mcp-picker-eyebrow {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #5f68c7;
  font-size: 9px;
  font-weight: 760;
  letter-spacing: .04em;
}

.mcp-platform-panel[hidden] {
  display: none;
}

.mcp-platform-list-v3 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.mcp-platform-row {
  min-height: 44px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 18px;
  gap: 9px;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid #e5e9f0;
  border-radius: 10px;
  background: #fff;
  color: #344054;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}

.mcp-platform-row:hover {
  border-color: #d4dbe7;
  background: #f8faff;
}

.mcp-platform-row.is-selected {
  border-color: #97a9fb;
  background: #f2f5ff;
}

.mcp-platform-row:focus-visible {
  outline: 2px solid #5d63ef;
  outline-offset: 1px;
}

.mcp-platform-row > span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  color: #344054;
  font-size: 11px;
  font-weight: 690;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mcp-platform-check {
  visibility: hidden;
  color: #5965d8;
  font-size: 11px;
  font-weight: 800;
}

.mcp-platform-row.is-selected .mcp-platform-check {
  visibility: visible;
}

.mcp-platform-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f1f3f6;
  color: #465165;
  font-size: 9px;
  font-weight: 800;
}

.mcp-platform-mark.is-chatgpt { background: #edf6f2; color: #167b66; }
.mcp-platform-mark.is-claude { background: #fbf0ea; color: #b45f3a; }
.mcp-platform-mark.is-gemini { background: #eef2ff; color: #5966ce; }
.mcp-platform-mark.is-grok { background: #f1f3f5; color: #202936; }
.mcp-platform-mark.is-perplexity { background: #eaf7f6; color: #237c79; }
.mcp-platform-mark.is-poe { background: #eef0ff; color: #5a63c8; }
.mcp-platform-mark.is-manus { background: #f2f4f7; color: #3f4754; }
.mcp-platform-mark.is-deepseek { background: #edf3ff; color: #316ad9; }
.mcp-platform-mark.is-doubao { background: #eef5ff; color: #4b72d3; }
.mcp-platform-mark.is-kimi { background: #f1f3f5; color: #273142; }
.mcp-platform-mark.is-qwen { background: #f3efff; color: #7854c7; }
.mcp-platform-mark.is-yuanbao { background: #eef8f3; color: #31825c; }
.mcp-platform-mark.is-zhipu { background: #eef4ff; color: #4169c1; }
.mcp-platform-mark.is-wenxin { background: #edf4ff; color: #4778c7; }
.mcp-platform-mark.is-coze { background: #eef4ff; color: #4771c8; }

.mcp-platform-mark.is-cursor { background: #eff1f4; color: #222b38; }
.mcp-platform-mark.is-vscode { background: #eaf4fd; color: #2d78b7; }
.mcp-platform-mark.is-windsurf { background: #eaf8f5; color: #278475; }
.mcp-platform-mark.is-trae { background: #f0f0ff; color: #6862ca; }
.mcp-platform-mark.is-copilot { background: #f0f2f5; color: #333b48; }
.mcp-platform-mark.is-jetbrains { background: #f5edff; color: #7b4bb3; }
.mcp-platform-mark.is-cline { background: #eef2ff; color: #5964c8; }
.mcp-platform-mark.is-roo { background: #eef8f3; color: #3f8463; }
.mcp-platform-mark.is-zed { background: #fff4e8; color: #ad6b2b; }
.mcp-platform-mark.is-other { background: #f2efff; color: #6f55cf; }

.mcp-custom-platform {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  margin-top: 8px;
  padding: 7px 8px;
  border: 1px dashed #d7dde8;
  border-radius: 10px;
  background: #fafbfc;
}

.mcp-custom-platform input {
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  background: #fff;
  color: #344054;
  font: inherit;
  font-size: 11px;
  outline: none;
}

.mcp-custom-platform input:focus,
.mcp-custom-platform input.is-selected {
  border-color: #91a5fb;
  box-shadow: 0 0 0 2px rgba(93, 99, 239, .08);
}

.mcp-custom-platform input.has-error {
  border-color: #d87b7b;
  box-shadow: 0 0 0 2px rgba(201, 76, 76, .07);
}

.mcp-custom-platform input::placeholder {
  color: #a3acb9;
}

.mcp-custom-platform button {
  height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: #eef2ff;
  color: #5966d8;
  font: inherit;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.mcp-custom-platform button:hover {
  background: #e5eaff;
}

.mcp-guide-grants-head {
  align-items: center;
}

.mcp-guide-grants-head h2 {
  margin: 0;
}

@media (max-width: 760px) {
  .mcp-category-card,
  .mcp-platform-picker {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
    padding: 18px 15px;
  }

  .mcp-category-grid {
    grid-template-columns: 1fr;
  }

  .mcp-platform-list-v3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .mcp-category-option {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    min-height: 70px;
    padding: 11px;
  }

  .mcp-category-icon {
    width: 40px;
    height: 40px;
  }

  .mcp-custom-platform {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .mcp-custom-platform button {
    grid-column: 2;
    justify-self: start;
  }
}


/* MCP simple platform input · 2026-09-22 */
.mcp-simple-guide {
  width: min(1040px, calc(100% - 56px));
  margin: 0 auto;
  padding: 64px 0 72px;
  color: #172033;
}

.mcp-simple-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-bottom: 36px;
}

.mcp-simple-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, #7650df 0%, #5d63ef 52%, #2f8df7 100%);
  color: #fff;
  box-shadow: 0 12px 28px rgba(82, 108, 233, .18);
}

.mcp-simple-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mcp-simple-kicker {
  display: block;
  margin: 1px 0 8px;
  color: #6266e7;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: .06em;
}

.mcp-simple-head h1 {
  margin: 0;
  color: #172033;
  font-size: clamp(40px, 4.8vw, 58px);
  font-weight: 780;
  letter-spacing: -.04em;
  line-height: 1.08;
}

.mcp-simple-head p {
  max-width: 760px;
  margin: 14px 0 0;
  color: #7c8798;
  font-size: 17px;
  line-height: 1.65;
}

.mcp-simple-input-card,
.mcp-simple-prompt-card {
  border: 1px solid #e1e5eb;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(35, 47, 74, .055);
}

.mcp-simple-input-card {
  padding: 26px 28px 24px;
}

.mcp-simple-input-card > label {
  display: block;
  margin-bottom: 10px;
  color: #344054;
  font-size: 13px;
  font-weight: 720;
}

.mcp-simple-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.mcp-simple-input-row input {
  min-width: 0;
  height: 56px;
  padding: 0 17px;
  border: 1px solid #d9dee7;
  border-radius: 14px;
  background: #fbfcfd;
  color: #253044;
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

.mcp-simple-input-row input:focus {
  border-color: #777be8;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(98, 102, 231, .10);
}

.mcp-simple-input-row input::placeholder {
  color: #a1a9b5;
}

.mcp-simple-input-row button,
.mcp-simple-primary,
.mcp-simple-secondary {
  min-height: 48px;
  border-radius: 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 740;
  cursor: pointer;
}

.mcp-simple-input-row button {
  min-width: 104px;
  border: 0;
  background: #6266e7;
  color: #fff;
}

.mcp-simple-input-row button:hover:not(:disabled),
.mcp-simple-primary:hover {
  background: #565bd9;
}

.mcp-simple-input-row button:disabled {
  background: #d9dde6;
  color: #fff;
  cursor: not-allowed;
}

.mcp-simple-hint {
  display: block;
  margin-top: 10px;
  color: #98a2b3;
  font-size: 11px;
}

.mcp-simple-prompt-card {
  margin-top: 24px;
  padding: 26px 28px 28px;
}

.mcp-simple-prompt-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 16px;
}

.mcp-simple-prompt-head > div:first-child {
  min-width: 0;
}

.mcp-simple-prompt-head span {
  display: block;
  margin-bottom: 5px;
  color: #7e8795;
  font-size: 11px;
}

.mcp-simple-prompt-head h2 {
  margin: 0;
  color: #253044;
  font-size: 22px;
  font-weight: 740;
  letter-spacing: -.02em;
}

.mcp-simple-prompt-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.mcp-simple-primary,
.mcp-simple-secondary {
  padding: 0 15px;
}

.mcp-simple-primary {
  border: 0;
  background: #6266e7;
  color: #fff;
}

.mcp-simple-secondary {
  border: 1px solid #dfe3e9;
  background: #fff;
  color: #626c7c;
}

.mcp-simple-secondary:hover {
  background: #f7f8fa;
}

.mcp-simple-prompt {
  margin: 0;
  max-height: 440px;
  overflow: auto;
  padding: 20px 22px;
  border: 1px solid #e3e7ed;
  border-radius: 14px;
  background: #f8f9fb;
  color: #394457;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 700px) {
  .mcp-simple-guide {
    width: min(100% - 24px, 620px);
    padding: 28px 0 48px;
  }

  .mcp-simple-head {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .mcp-simple-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .mcp-simple-head h1 {
    font-size: 34px;
  }

  .mcp-simple-head p {
    font-size: 14px;
  }

  .mcp-simple-input-card,
  .mcp-simple-prompt-card {
    padding: 18px;
    border-radius: 16px;
  }

  .mcp-simple-input-row {
    grid-template-columns: 1fr;
  }

  .mcp-simple-input-row button {
    width: 100%;
  }

  .mcp-simple-prompt-head {
    align-items: stretch;
    flex-direction: column;
  }

  .mcp-simple-prompt-actions {
    width: 100%;
  }

  .mcp-simple-prompt-actions button {
    flex: 1;
  }
}


/* MCP OAuth authorization experience · 2026-09-23 */
.mcp-oauth-body {
  background:
    radial-gradient(circle at 50% -10%, rgba(98, 102, 231, .10), transparent 34rem),
    #f6f7fa;
}

.mcp-oauth-body .app-topbar,
.mcp-oauth-body .workspace-sidebar,
.mcp-oauth-body .ai-drawer,
.mcp-oauth-body .quick-note-dock,
.mcp-oauth-body .profile-correction-banner,
.mcp-oauth-body .admin-handover-banner,
.mcp-oauth-body .admin-graduation-banner {
  display: none !important;
}

.mcp-oauth-body .workspace-shell {
  display: block;
  min-height: 100vh;
}

.mcp-oauth-body .workspace-main {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.mcp-auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 20px;
}

.mcp-auth-card {
  width: min(620px, 100%);
  padding: 32px;
  border: 1px solid #e1e5ec;
  border-radius: 24px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 24px 70px rgba(35, 47, 74, .10);
}

.mcp-auth-card-compact {
  width: min(520px, 100%);
}

.mcp-auth-brand {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, #7650df 0%, #5d63ef 52%, #2f8df7 100%);
  color: #fff;
  box-shadow: 0 12px 30px rgba(82, 108, 233, .20);
}

.mcp-auth-brand svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mcp-auth-title > span,
.mcp-simple-grants-head span {
  display: block;
  margin-bottom: 6px;
  color: #6266e7;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.mcp-auth-title h1 {
  margin: 0;
  color: #1f2937;
  font-size: 30px;
  font-weight: 780;
  letter-spacing: -.035em;
  line-height: 1.12;
}

.mcp-auth-title p {
  margin: 10px 0 0;
  color: #7d8796;
  font-size: 14px;
  line-height: 1.65;
}

.mcp-auth-summary {
  display: grid;
  gap: 1px;
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid #e7eaf0;
  border-radius: 16px;
  background: #e7eaf0;
}

.mcp-auth-summary > div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 6px 16px;
  align-items: center;
  padding: 14px 16px;
  background: #fbfcfd;
}

.mcp-auth-summary span {
  color: #8a94a3;
  font-size: 12px;
}

.mcp-auth-summary strong {
  min-width: 0;
  color: #303b4c;
  font-size: 13px;
  font-weight: 720;
  word-break: break-word;
}

.mcp-auth-summary small {
  grid-column: 2;
  color: #9aa3af;
  font-size: 10px;
  line-height: 1.5;
}

.mcp-auth-permissions {
  margin-top: 24px;
}

.mcp-auth-permissions h2 {
  margin: 0 0 10px;
  color: #344054;
  font-size: 13px;
  font-weight: 760;
}

.mcp-auth-permission {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 36px;
  color: #4b5565;
  font-size: 13px;
}

.mcp-auth-permission b {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
}

.mcp-auth-permission.is-allowed b {
  background: #eaf7f0;
  color: #18835b;
}

.mcp-auth-permission.is-denied b {
  background: #f4f5f7;
  color: #7d8796;
}

.mcp-auth-validity {
  margin-top: 20px;
  padding: 15px 16px;
  border: 1px solid #dfe3fb;
  border-radius: 14px;
  background: #f7f8ff;
}

.mcp-auth-validity strong {
  color: #5156ca;
  font-size: 12px;
}

.mcp-auth-validity p {
  margin: 5px 0 0;
  color: #707b8c;
  font-size: 11px;
  line-height: 1.6;
}

.mcp-auth-tech {
  margin-top: 16px;
  color: #7d8796;
  font-size: 11px;
}

.mcp-auth-tech summary {
  cursor: pointer;
  user-select: none;
}

.mcp-auth-tech > div {
  display: grid;
  gap: 5px;
  margin-top: 9px;
  padding: 12px 13px;
  border-radius: 11px;
  background: #f7f8fa;
}

.mcp-auth-tech code,
.mcp-auth-tech small {
  overflow-wrap: anywhere;
}

.mcp-auth-tech code {
  color: #4e5868;
  font-size: 11px;
}

.mcp-auth-tech small {
  color: #9aa3af;
}

.mcp-auth-actions,
.mcp-auth-login-actions {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.mcp-auth-actions {
  grid-template-columns: 1fr 1.25fr;
}

.mcp-auth-primary-button,
.mcp-auth-secondary-button,
.mcp-auth-primary-link,
.mcp-auth-secondary-link {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

.mcp-auth-primary-button,
.mcp-auth-primary-link {
  border: 0;
  background: #6266e7;
  color: #fff;
}

.mcp-auth-primary-button:hover,
.mcp-auth-primary-link:hover {
  background: #565bd9;
}

.mcp-auth-secondary-button,
.mcp-auth-secondary-link {
  border: 1px solid #dfe3e9;
  background: #fff;
  color: #596579;
}

.mcp-auth-secondary-button:hover,
.mcp-auth-secondary-link:hover {
  background: #f7f8fa;
}

.mcp-auth-footnote {
  margin: 14px 0 0;
  color: #98a2b3;
  font-size: 10px;
  line-height: 1.55;
  text-align: center;
}

.mcp-reauth-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.mcp-reauth-form label {
  display: grid;
  gap: 7px;
}

.mcp-reauth-form label > span {
  color: #4a5568;
  font-size: 12px;
  font-weight: 680;
}

.mcp-reauth-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #d9dee7;
  border-radius: 12px;
  background: #fbfcfd;
  color: #253044;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.mcp-reauth-form input:focus {
  border-color: #777be8;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(98, 102, 231, .10);
}

.mcp-simple-grants {
  margin-top: 24px;
  padding: 24px 26px;
  border: 1px solid #e1e5eb;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(35, 47, 74, .05);
}

.mcp-simple-grants-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.mcp-simple-grants-head h2 {
  margin: 0;
  color: #253044;
  font-size: 20px;
  font-weight: 740;
}

.mcp-simple-grants-head > strong {
  color: #8a94a3;
  font-size: 11px;
}

.mcp-simple-grant-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.mcp-simple-grant-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 13px;
  border: 1px solid #e8ebf0;
  border-radius: 14px;
  background: #fbfcfd;
}

.mcp-simple-grant-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eef0ff;
  color: #6266e7;
  font-size: 18px;
}

.mcp-simple-grant-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mcp-simple-grant-copy strong {
  color: #344054;
  font-size: 13px;
}

.mcp-simple-grant-copy span,
.mcp-simple-grant-copy small {
  color: #8d97a5;
  font-size: 10px;
  line-height: 1.45;
}

.mcp-simple-grant-row form button {
  padding: 7px 10px;
  border: 1px solid #e1e5eb;
  border-radius: 9px;
  background: #fff;
  color: #7b8493;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.mcp-simple-grant-row form button:hover {
  border-color: #efc9c9;
  color: #b54747;
  background: #fffafa;
}

.mcp-simple-grant-empty {
  margin-top: 16px;
  padding: 22px;
  border: 1px dashed #dfe3e9;
  border-radius: 14px;
  color: #98a2b3;
  font-size: 11px;
  text-align: center;
}

@media (max-width: 640px) {
  .mcp-auth-page {
    align-items: start;
    padding: 18px 12px 36px;
  }

  .mcp-auth-card {
    padding: 22px 18px;
    border-radius: 18px;
  }

  .mcp-auth-title h1 {
    font-size: 26px;
  }

  .mcp-auth-summary > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .mcp-auth-summary small {
    grid-column: 1;
  }

  .mcp-auth-actions {
    grid-template-columns: 1fr;
  }

  .mcp-simple-grant-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .mcp-simple-grant-row form {
    grid-column: 2;
  }
}

/* AI sources Mark 7: collapsed-by-default source disclosure */
.ai-message-sources {
  width: min(760px, 100%);
}

.ai-source-summary {
  min-height: 28px;
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  color: #8b95a4;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.ai-source-summary::-webkit-details-marker {
  display: none;
}

.ai-source-summary:hover {
  color: #657184;
}

.ai-source-summary-label {
  min-width: 0;
  overflow: hidden;
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-source-summary-chevron {
  display: inline-block;
  flex: 0 0 auto;
  margin-left: 3px;
  color: #8f98a6;
  font-size: 16px;
  line-height: 1;
  transition: color .12s ease;
}

.ai-message-sources[open] .ai-source-list {
  margin-top: 1px;
}


/* AI attachments use the compact composer chips; hide the global file picker rows here. */
[data-ai-chat-root] > .file-selection-list,
[data-ai-chat-root] .ai-composer > .file-selection-list {
  display: none !important;
}


/* AI attachment preview · click chip body, × only removes */
.ai-context-chip[data-previewable="true"] {
  cursor: pointer;
}

.ai-context-chip[data-previewable="true"]:hover,
.ai-context-chip[data-previewable="true"]:focus-visible {
  border-color: #cbd4e1;
  background: #f3f6fa;
  outline: none;
}

.ai-attachment-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .46);
  backdrop-filter: blur(3px);
}

.ai-attachment-preview-backdrop[hidden] {
  display: none !important;
}

.ai-attachment-preview-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: min(88vh, 900px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, .95);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
}

.ai-attachment-preview-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid #e7ebf0;
  background: #fbfcfe;
}

.ai-attachment-preview-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ai-attachment-preview-head strong,
.ai-attachment-preview-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-attachment-preview-head strong {
  color: #263246;
  font-size: 14px;
  font-weight: 760;
}

.ai-attachment-preview-head span {
  color: #8792a3;
  font-size: 11px;
}

.ai-attachment-preview-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #6b7686;
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.ai-attachment-preview-close:hover {
  background: #edf1f5;
  color: #344054;
}

.ai-attachment-preview-body {
  min-height: 220px;
  max-height: calc(88vh - 58px);
  display: grid;
  place-items: center;
  overflow: auto;
  background: #f5f7fa;
}

.ai-attachment-preview-image,
.ai-attachment-preview-video {
  display: block;
  max-width: 100%;
  max-height: calc(88vh - 90px);
  object-fit: contain;
}

.ai-attachment-preview-video {
  width: min(100%, 900px);
  background: #111827;
}

.ai-attachment-preview-audio {
  width: min(720px, calc(100% - 48px));
  margin: 56px 24px;
}

.ai-attachment-preview-frame {
  width: 100%;
  height: min(76vh, 780px);
  border: 0;
  background: #fff;
}

.ai-attachment-preview-text {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 22px 24px 40px;
  overflow: auto;
  box-sizing: border-box;
  background: #fff;
  color: #273142;
  font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-attachment-preview-note {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 16px;
  border-top: 1px solid #e7ebf0;
  background: #fff8e8;
  color: #7c5a15;
  font-size: 11px;
}

.ai-attachment-preview-generic {
  width: min(520px, calc(100% - 40px));
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 48px 20px;
  padding: 28px;
  box-sizing: border-box;
  border: 1px solid #dfe5ed;
  border-radius: 16px;
  background: #fff;
  color: #344054;
  text-align: center;
}

.ai-attachment-preview-generic-icon {
  font-size: 36px;
}

.ai-attachment-preview-generic strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.ai-attachment-preview-generic span,
.ai-attachment-preview-generic p {
  margin: 0;
  color: #7b8796;
  font-size: 11px;
  line-height: 1.6;
}

.ai-attachment-preview-zip {
  width: min(760px, calc(100% - 32px));
  align-self: start;
  display: grid;
  gap: 10px;
  margin: 18px 16px 28px;
  padding: 16px;
  box-sizing: border-box;
  border: 1px solid #dfe5ed;
  border-radius: 14px;
  background: #fff;
}

.ai-attachment-preview-zip > strong {
  color: #344054;
  font-size: 12px;
}

.ai-attachment-preview-zip-list {
  display: grid;
  gap: 1px;
  max-height: 64vh;
  overflow: auto;
}

.ai-attachment-preview-zip-list > div {
  min-height: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 4px 7px;
  border-radius: 6px;
}

.ai-attachment-preview-zip-list > div:nth-child(odd) {
  background: #f8fafc;
}

.ai-attachment-preview-zip-list span {
  overflow: hidden;
  color: #344054;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-attachment-preview-zip-list small {
  color: #98a2b3;
  font-size: 10px;
}

@media (max-width: 720px) {
  .ai-attachment-preview-backdrop {
    padding: 8px;
  }

  .ai-attachment-preview-dialog {
    width: calc(100vw - 16px);
    max-height: 92vh;
    border-radius: 14px;
  }

  .ai-attachment-preview-body {
    max-height: calc(92vh - 58px);
  }
}


.mcp-auth-result {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 20px;
  padding: 14px 15px;
  border: 1px solid #dfe3e9;
  border-radius: 14px;
  background: #f8fafc;
}

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

.mcp-auth-result-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef0ff;
  color: #6266e7;
  font-size: 16px;
  font-weight: 800;
}

.mcp-auth-result-icon::before {
  content: "…";
}

.mcp-auth-result[data-state="pending"] .mcp-auth-result-icon {
  animation: mcp-auth-result-pulse 1s ease-in-out infinite;
}

.mcp-auth-result[data-state="authorized"] {
  border-color: #d9defc;
  background: #f7f8ff;
}

.mcp-auth-result[data-state="authorized"] .mcp-auth-result-icon::before {
  content: "✓";
}

.mcp-auth-result[data-state="connected"] {
  border-color: #cfe9db;
  background: #f3fbf6;
}

.mcp-auth-result[data-state="connected"] .mcp-auth-result-icon {
  background: #e2f5e9;
  color: #17815a;
}

.mcp-auth-result[data-state="connected"] .mcp-auth-result-icon::before {
  content: "✓";
}

.mcp-auth-result[data-state="waiting"] {
  border-color: #eadfb8;
  background: #fffaf0;
}

.mcp-auth-result[data-state="waiting"] .mcp-auth-result-icon {
  background: #fff0c9;
  color: #946b12;
}

.mcp-auth-result[data-state="waiting"] .mcp-auth-result-icon::before {
  content: "!";
}

.mcp-auth-result[data-state="error"] {
  border-color: #efcccc;
  background: #fff7f7;
}

.mcp-auth-result[data-state="error"] .mcp-auth-result-icon {
  background: #fde8e8;
  color: #b54747;
}

.mcp-auth-result[data-state="error"] .mcp-auth-result-icon::before {
  content: "×";
}

.mcp-auth-result[data-state="cancelled"] .mcp-auth-result-icon::before {
  content: "–";
}

.mcp-auth-result strong {
  display: block;
  color: #344054;
  font-size: 12px;
  font-weight: 760;
}

.mcp-auth-result p {
  margin: 4px 0 0;
  color: #727d8d;
  font-size: 11px;
  line-height: 1.6;
}

.mcp-auth-result-return {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-top: 9px;
  padding: 0 10px;
  border: 1px solid #d9defc;
  border-radius: 9px;
  background: #fff;
  color: #565bd9;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.mcp-auth-result-return[hidden] {
  display: none !important;
}

.mcp-auth-actions button:disabled {
  cursor: wait;
  opacity: .68;
}

@keyframes mcp-auth-result-pulse {
  0%, 100% {
    opacity: .55;
    transform: scale(.94);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}


/* Notification center visual refresh: compact, quiet, task-focused */
.site-notifications-page {
  max-width: 980px;
  padding-top: 38px;
}

/* Compatibility while the current Gunicorn workers still hold the older
   notifications template in Jinja cache. Safe to remove after next restart. */
.site-notifications-page > .site-notifications-head {
  align-items: flex-start;
  min-height: 0;
  gap: 32px;
  margin-bottom: 24px;
  padding: 2px 0 24px;
  border-bottom: 1px solid var(--hairline);
}

.site-notifications-page > .site-notifications-head h1 {
  font-size: 30px;
  line-height: 1.16;
  font-weight: 720;
  letter-spacing: -.035em;
}

.site-notifications-page > .site-notifications-head p {
  max-width: 720px;
  margin-top: 9px;
  color: #68727e;
  font-size: 13px;
  line-height: 1.75;
}

.site-notifications-page > .site-notifications-head > .button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-top: 7px;
  padding: 0 13px;
  border: 1px solid #dce2e8;
  border-radius: 10px;
  background: #fff;
  color: #35404c;
  box-shadow: 0 1px 2px rgba(24, 32, 41, .04);
  font-size: 11px;
  font-weight: 650;
}

.site-notifications-page > .site-notifications-head > .button:hover {
  border-color: #cfd6de;
  background: #f7f9fb;
  box-shadow: 0 2px 8px rgba(24, 32, 41, .06);
}

.site-notifications-page > .developer-log-empty {
  min-height: 204px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 34px 28px;
  border: 1px solid #e2e7ed;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(235, 243, 252, .55), transparent 48%),
    #fbfcfd;
  text-align: center;
}

.site-notifications-page > .developer-log-empty::before {
  content: "✓";
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 15px;
  border: 1px solid #dce6f1;
  border-radius: 15px;
  background: #f1f6fb;
  color: #58718c;
  font-size: 19px;
  font-weight: 650;
}

.site-notifications-page > .developer-log-empty strong {
  color: #20262d;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 690;
}

.site-notifications-page > .developer-log-empty p {
  max-width: 520px;
  margin: 8px auto 0;
  color: #7a8490;
  font-size: 12px;
  line-height: 1.7;
}

.site-notifications-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 24px;
  padding: 2px 0 24px;
  border-bottom: 1px solid var(--hairline);
}

.site-notifications-heading {
  min-width: 0;
}

.site-notifications-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 8px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef3f8;
  color: #5e6b78;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
}

.site-notifications-heading h1 {
  margin: 0;
  color: #171b20;
  font-size: 30px;
  line-height: 1.16;
  font-weight: 720;
  letter-spacing: -.035em;
}

.site-notifications-heading p {
  max-width: 720px;
  margin: 9px 0 0;
  color: #68727e;
  font-size: 13px;
  line-height: 1.75;
}

.site-notifications-settings {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  margin-top: 27px;
  padding: 0 13px;
  border: 1px solid #dce2e8;
  border-radius: 10px;
  background: #fff;
  color: #35404c;
  box-shadow: 0 1px 2px rgba(24, 32, 41, .04);
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.site-notifications-settings:hover {
  border-color: #cfd6de;
  background: #f7f9fb;
  box-shadow: 0 2px 8px rgba(24, 32, 41, .06);
}

.site-notifications-settings svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-notifications-empty {
  min-height: 204px;
  display: grid;
  place-items: center;
  padding: 34px 28px;
  border: 1px solid #e2e7ed;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(235, 243, 252, .55), transparent 48%),
    #fbfcfd;
  text-align: center;
}

.site-notifications-empty-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  border: 1px solid #dce6f1;
  border-radius: 15px;
  background: #f1f6fb;
  color: #58718c;
}

.site-notifications-empty-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-notifications-empty-copy {
  max-width: 520px;
}

.site-notifications-empty-copy strong {
  display: block;
  color: #20262d;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 690;
}

.site-notifications-empty-copy p {
  margin: 8px 0 0;
  color: #7a8490;
  font-size: 12px;
  line-height: 1.7;
}

.site-notification-list {
  gap: 10px;
}

.site-notification-card {
  border-radius: 13px;
  box-shadow: 0 1px 2px rgba(24, 32, 41, .025);
}

@media (max-width: 760px) {
  .site-notifications-page {
    padding-top: 28px;
  }

  .site-notifications-page > .site-notifications-head {
    display: grid;
    gap: 16px;
    padding-bottom: 20px;
  }

  .site-notifications-page > .site-notifications-head > .button {
    width: fit-content;
    margin-top: 0;
  }

  .site-notifications-page > .developer-log-empty {
    min-height: 190px;
    padding: 28px 20px;
    border-radius: 14px;
  }

  .site-notifications-hero {
    display: grid;
    gap: 16px;
    padding-bottom: 20px;
  }

  .site-notifications-heading h1 {
    font-size: 27px;
  }

  .site-notifications-settings {
    width: fit-content;
    margin-top: 0;
  }

  .site-notifications-empty {
    min-height: 190px;
    padding: 28px 20px;
    border-radius: 14px;
  }
}


/* Developer changelog collapsible entries */
.developer-log-entry {
  display: block;
  position: relative;
  padding-bottom: 34px;
  margin-bottom: 34px;
}

.developer-log-entry::before {
  content: "";
  width: 1px;
  position: absolute;
  top: 25px;
  left: 106px;
  bottom: -35px;
  background: #e2e7ee;
}

.developer-log-entry::after {
  content: "";
  height: 1px;
  position: absolute;
  left: 140px;
  right: 0;
  bottom: 0;
  background: var(--gmail-line);
}

.developer-log-entry:last-child {
  margin-bottom: 0;
}

.developer-log-entry:last-child::before,
.developer-log-entry:last-child::after {
  display: none;
}

.developer-log-summary {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.developer-log-summary::-webkit-details-marker {
  display: none;
}

.developer-log-summary::marker {
  content: "";
}

.developer-log-summary:focus-visible {
  outline: 2px solid #8ab4f8;
  outline-offset: 5px;
  border-radius: 6px;
}

.developer-log-summary:hover .developer-log-title {
  color: #174ea6;
}

.developer-log-entry .developer-log-rail {
  min-height: 25px;
  padding: 5px 21px 0 0;
}

.developer-log-entry .developer-log-rail::after {
  display: none;
}

.developer-log-date-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  white-space: nowrap;
}

.developer-log-chevron {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-right: 1.5px solid #8c97a5;
  border-bottom: 1.5px solid #8c97a5;
  transform: rotate(45deg) translateY(-1px);
  transform-origin: center;
  transition: transform .16s ease, border-color .16s ease;
}

.developer-log-entry:not([open]) .developer-log-chevron {
  transform: rotate(-45deg);
}

.developer-log-summary:hover .developer-log-chevron {
  border-color: #4d5c6d;
}

.developer-log-heading {
  min-width: 0;
  display: block;
}

.developer-log-entry .developer-log-meta {
  margin-bottom: 10px;
}

.developer-log-title {
  display: block;
  color: var(--gmail-text);
  font-size: 21px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -.015em;
  transition: color .14s ease;
}

.developer-log-entry .developer-log-panel {
  min-width: 0;
  padding: 0;
  margin: 15px 0 0 140px;
  border-bottom: 0;
}

.developer-log-entry:not([open]) .developer-log-summary {
  opacity: .92;
}

.developer-log-entry:not([open]) .developer-log-title {
  color: #414a55;
}

@media (max-width: 720px) {
  .developer-log-entry {
    padding-bottom: 26px;
    margin-bottom: 26px;
  }

  .developer-log-entry::before {
    display: none;
  }

  .developer-log-entry::after {
    left: 0;
  }

  .developer-log-summary {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .developer-log-entry .developer-log-rail {
    padding: 0;
    text-align: left;
  }

  .developer-log-date-toggle {
    justify-content: flex-start;
  }

  .developer-log-entry .developer-log-dot {
    display: none;
  }

  .developer-log-entry .developer-log-panel {
    margin: 14px 0 0;
  }

  .developer-log-title {
    font-size: 19px;
  }
}


/* Developer changelog summary chips + explicit detail affordance */
.developer-log-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
}

.developer-log-copy {
  min-width: 0;
  display: block;
}

.developer-log-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.developer-log-tag {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid #e0e6ed;
  border-radius: 6px;
  background: #f7f9fb;
  color: #52606f;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
}

.developer-log-preview {
  max-width: 720px;
  display: block;
  margin-top: 10px;
  color: #6b7480;
  font-size: 13px;
  line-height: 1.65;
}

.developer-log-expand-hint {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 27px;
  padding: 0 9px;
  border: 1px solid #dde3ea;
  border-radius: 999px;
  background: #fafbfc;
  color: #66717f;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}

.developer-log-summary:hover .developer-log-expand-hint {
  border-color: #c7d7ef;
  background: #f1f6fd;
  color: #174ea6;
}

.developer-log-expand-icon {
  width: 6px;
  height: 6px;
  display: inline-block;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform .16s ease;
}

.developer-log-expand-opened {
  display: none;
}

.developer-log-entry[open] .developer-log-expand-collapsed {
  display: none;
}

.developer-log-entry[open] .developer-log-expand-opened {
  display: inline;
}

.developer-log-entry[open] .developer-log-expand-icon {
  transform: rotate(225deg) translate(-1px, -1px);
}

.developer-log-entry[open] .developer-log-preview {
  display: none;
}

.developer-log-entry .developer-log-detail-panel {
  margin-top: 18px;
  padding: 17px 19px 18px;
  border: 1px solid #e3e8ee;
  border-radius: 12px;
  background: #fafbfc;
}

.developer-log-detail-label {
  margin-bottom: 10px;
  color: #7a8491;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

.developer-log-entry .developer-log-detail-panel .developer-log-body {
  margin-top: 0;
}

@media (max-width: 720px) {
  .developer-log-heading {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .developer-log-expand-hint {
    width: fit-content;
    margin-top: 0;
  }

  .developer-log-preview {
    margin-top: 8px;
  }

  .developer-log-entry .developer-log-detail-panel {
    margin-top: 14px;
    padding: 15px 16px;
  }
}
