@import url("./report.css");

:root {
  color-scheme: light;
  --bg: #f7f8f9;
  --panel: #ffffff;
  --ink: #17181a;
  --muted: #6b7280;
  --line: #e6e7eb;
  --accent: #1a56d6;
  --bad: #c5221f;
  --wash: #eef2fb;
  --hover: #f3f4f6;
  --selected: #e8f0fe;
}

* { box-sizing: border-box; }
/* Keep the sticky navigation in place when scrolling past page boundaries. */
html, body { overscroll-behavior-y: none; }
html, body, body * { scrollbar-width: none; }
html::-webkit-scrollbar,
body::-webkit-scrollbar,
body *::-webkit-scrollbar { display: none; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.45 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.top-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
  min-height: 48px;
}

.top-nav {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

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

.brand-mark {
  display: block;
  width: 22px;
  height: 22px;
  flex: none;
}

.brand-copy { min-width: 0; }
body:has(#authLayout:not([hidden])) .brand-copy h1 { color: var(--accent); }

h1, h2, h3 { margin: 0; }
.top h1 { font-size: 15px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.help { color: var(--muted); }

.account-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 280px;
  margin-left: auto;
}

.account-menu {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.account-chip {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 3px 8px 3px 3px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.account-chip:hover { background: var(--bg); }
.account-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.account-chip[aria-expanded="true"] { background: var(--bg); }

.account-avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: #e7eefc;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.account {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-caret {
  flex: none;
  color: var(--muted);
}

.account-chip[aria-expanded="true"] .account-caret { transform: rotate(180deg); }

.account-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 2;
  width: min(300px, calc(100vw - 32px));
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(23, 24, 26, 0.08), 0 0 0 1px rgba(23, 24, 26, 0.04);
}

.account-panel-info { padding-bottom: 14px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.account-panel-label { color: var(--muted); font-size: 12px; }
.account-panel-email { margin: 6px 0 0; font-weight: 600; overflow-wrap: anywhere; }

.account-action {
  appearance: none;
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.account-action:hover { background: var(--hover); }
.account-action:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.account-action + .account-action { margin-top: 6px; }
.account-action[aria-current="page"] { background: var(--selected); color: var(--accent); }
.account-signout { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

.row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 400px);
  align-items: center;
  justify-content: center;
  gap: clamp(40px, 6vw, 96px);
  min-height: calc(100vh - 49px);
  min-height: calc(100dvh - 49px);
  padding: 48px 32px;
}
.auth-story { min-width: 0; }
.auth-story h2 { font-size: clamp(28px, 2.8vw, 34px); line-height: 1.5; letter-spacing: -.025em; font-weight: 650; }
.auth-story-emphasis { color: var(--accent); }
.auth-illustration { position: relative; height: 326px; margin-top: 28px; max-width: 420px; }
.auth-connectors { position: absolute; inset: 0; width: 100%; height: 326px; color: var(--accent); overflow: visible; }
.auth-input-path { stroke: var(--line); stroke-width: 1.5; }
.auth-output-path, .auth-arrow-head { stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.auth-source-card, .auth-agent-card, .auth-result-card { position: absolute; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 4px 16px rgb(0 0 0 / 3%); }
.auth-source-card { top: 0; width: calc(50% - 12px); height: 96px; padding: 16px; }
.auth-data-card { left: 0; }
.auth-memo-card { right: 0; }
.auth-source-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.auth-source-label svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.auth-data-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 7px 10px; margin-top: 12px; }
.auth-data-grid :is(i,b) { height: 4px; border-radius: 3px; background: var(--hover); }
.auth-data-grid b { background: var(--selected); }
.auth-memo-mark { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; background: var(--wash); color: var(--accent); font-size: 12px; }
.auth-memo-description { display: block; color: var(--muted); font-size: 12px; margin-top: 12px; }
.auth-agent-card { display: flex; align-items: center; gap: 12px; top: 134px; left: 50%; transform: translateX(-50%); width: 240px; height: 72px; padding: 14px 20px; background: var(--wash); border-color: color-mix(in srgb, var(--accent) 28%, var(--panel)); }
.auth-agent-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); flex: none; }
.auth-agent-mark img { display: block; }
.auth-agent-card strong { display: block; color: var(--accent); font-size: 16px; font-weight: 650; }
.auth-agent-card div > span { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.auth-result-card { top: 246px; left: 0; right: 0; height: 80px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-result-copy strong { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.auth-result-copy > span { display: block; font-size: 11px; color: var(--muted); margin-top: 6px; }
.auth-result-check { color: var(--accent); }
.auth-chart { display: flex; align-items: end; gap: 6px; width: 104px; height: 42px; flex: none; border-bottom: 1px solid var(--line); }
.auth-chart i { flex: 1; height: 32%; background: var(--selected); border-radius: 3px 3px 0 0; }
.auth-chart i:nth-child(2n) { height: 60%; }
.auth-chart i:nth-child(3n) { height: 86%; background: var(--accent); }
.auth-chart i:last-child { height: 100%; background: var(--accent); opacity: .7; }
.auth-form-column { width: 100%; min-width: 0; }
#loginView.panel {
  width: 100%; margin: 0; padding: 32px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 8px 32px rgb(0 0 0 / 4%);
}
.auth-heading { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 28px; text-align: center; }
.auth-logo { display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid var(--line); border-radius: 16px; background: var(--wash); }
.auth-logo img { display: block; }
#loginView #authTitle { font-size: 23px; line-height: 1.4; font-weight: 650; letter-spacing: -.025em; }
#loginView .form { gap: 20px; }
.auth-field { display: grid; gap: 8px; min-width: 0; }
#loginView label { font-size: 13px; color: var(--ink); }
#loginView input { width: 100%; height: 44px; padding: 0 12px; border-radius: 8px; font-size: 14px; color: var(--ink); }
#loginView input::placeholder { color: var(--muted); }
#loginView input[aria-invalid="true"] { border-color: var(--bad); }
#loginView input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.auth-password-wrap { position: relative; }
#loginView #password { padding-right: 68px; }
.auth-password-toggle { position: absolute; right: 5px; top: 4px; min-width: 52px; height: 36px; padding: 0 8px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font: inherit; cursor: pointer; }
.auth-password-toggle:hover { color: var(--accent); background: var(--hover); }
.auth-password-toggle:active { background: var(--selected); }
.auth-password-toggle:disabled { opacity: .6; cursor: wait; }
.auth-password-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.auth-field-hint, .auth-field-error { margin: 0; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.auth-field-hint { color: var(--muted); }
.auth-field-error { color: var(--bad); }
#loginView #authSubmit { height: 44px; margin-top: 4px; border-radius: 8px; font-size: 14px; font-weight: 600; }
#loginView #authSubmit:disabled { opacity: .6; cursor: wait; }
#loginView #toggleAuth { display: block; width: 100%; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; font-size: 13px; }
#loginView #toggleAuth:disabled { opacity: .6; cursor: wait; }
#loginView #toggleAuth:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
#loginView .auth-feedback { margin: 0; padding: 12px; border-radius: 8px; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.auth-feedback-error { color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, var(--panel)); border: 1px solid color-mix(in srgb, var(--bad) 25%, var(--panel)); }
.auth-feedback-notice { color: var(--ink); background: var(--wash); border: 1px solid var(--line); }
@media (max-width: 760px) {
  .auth-layout { display: flex; align-items: flex-start; padding: 32px 16px; }
  .auth-story { display: none; }
  .auth-form-column { max-width: 400px; }
}
@media (max-width: 480px) {
  .auth-layout { padding-top: 24px; }
  #loginView.panel { padding: 28px 24px; }
  #loginView #authTitle { font-size: 21px; }
  #loginView input { font-size: 16px; }
}
.nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item.is-active { background: #eceef1; color: var(--ink); font-weight: 600; }
.nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-icon { width: 16px; height: 16px; flex: none; }
.console-shell,
.invite-admin {
  max-width: 1120px;
  margin: 20px auto 32px;
  padding: 0 20px;
}
.panel { margin: 0; padding: 0; background: transparent; border: 0; }
.panel.bare { background: transparent; }
.split-panel { padding: 0; overflow: visible; background: transparent; }
.split {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.split-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  max-height: calc(100vh - 120px);
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.split-main {
  min-width: 0;
  padding: 16px 18px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
@media (min-width: 761px) {
  #panel-history .split-side {
    position: sticky;
    top: 69px;
  }
}
.split-empty { margin: 0; padding: 20px; }
.picker-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow: auto;
}
.picker-item {
  appearance: none;
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: var(--panel);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.picker-item:hover { background: var(--surface-soft,#f3f6fb); }
.picker-item.is-active,
.picker-item.is-active:hover { background: var(--selected); }
.picker-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.picker-item .data-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}
.picker-item .picker-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.picker-item .tag { margin-left: 0; background: #e7e9ed; }
.picker-item .data-meta { margin-top: 2px; font-size: 12px; line-height: 1.35; }
.history-cards { gap: 4px; }
.history-card + .history-card::before,
#packSiteList .picker-item + .picker-item::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 10px;
  right: 10px;
  height: 1px;
  background: var(--line);
  pointer-events: none;
}
#packSiteList .picker-item { position: relative; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 20;
  width: max-content;
  max-width: min(420px, calc(100vw - 32px));
  box-sizing: border-box;
  overflow-wrap: anywhere;
  padding: 10px 16px;
  border-radius: 8px;
  background: #1c1f24;
  color: #fff;
  box-shadow: 0 8px 24px rgba(28, 31, 36, 0.18);
}
.toast.is-error { background: var(--bad); }
.form, .card { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
input, select, textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  color: inherit;
  background: var(--panel);
}
textarea { min-height: 88px; resize: vertical; }
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible {
  outline: none;
  border-color: var(--line);
  box-shadow: none;
}
.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 6px;
  padding: 5px 10px;
  font: inherit;
  cursor: pointer;
}
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn-primary:hover { background: #1648b3; }
.btn-text {
  display: inline-block;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 5px 8px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.btn-text:hover { background: var(--hover); color: var(--ink); }
.btn-text:focus-visible,
.btn:focus-visible,
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.link { margin-top: 12px; border: 0; background: transparent; color: var(--accent); cursor: pointer; padding: 0; font: inherit; }
.error { color: var(--bad); margin: 12px 0 0; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 12px 0; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline > * { flex: 1; }
.side-head { margin: 0; }
.side-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.011em;
}
#historySideHead .card-menu {
  position: relative;
  top: auto;
  right: auto;
  flex: none;
}
#historySideHead .card-menu-panel { top: calc(100% + 4px); }
.icon-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.history-card,
.timeline-item {
  appearance: none;
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: var(--panel);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.timeline-item:hover { background: var(--surface-soft,#f3f6fb); }
.history-card:hover { background: var(--surface-soft,#f3f6fb); }
.timeline-item.is-active {
  background: #e8f0fe;
  box-shadow: inset 3px 0 0 var(--accent);
}
.timeline-item.is-active:hover { background: #dce7fb; }
.history-card.is-active,
.history-card.is-active:hover { background: #e8f0fe; box-shadow: none; }
.history-card:focus-visible,
.timeline-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.history-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.history-card-top .history-time {
  margin: 0 0 0 auto;
  flex: none;
  white-space: nowrap;
}
.history-title {
  min-width: 0;
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-time, .history-path {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.history-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  row-gap: 2px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--panel);
  transition: background-color 0.12s ease;
}
.history-card .history-card-top { display: contents; }
.history-card .history-title {
  grid-column: 1 / -1;
  grid-row: 1;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}
.history-card .history-path {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}
.history-card .history-time {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}
.history-stage { display: flex; flex-direction: column; min-height: 100%; }
.history-back-row { display: none; }
.history-placeholder { margin: 48px 0 0; }
.history-frame {
  width: 100%;
  height: calc(100vh - 240px);
  min-height: 420px;
  margin-top: 8px;
  border: 0;
  border-radius: 0;
  background: var(--panel);
}
.history-task {
  line-height: 1.6;
  margin-top: 8px;
  padding: 4px 0 0;
  border: 0;
  background: transparent;
}
.history-task h4 { margin: 16px 0 6px; font-size: 14px; }
.history-task h4:first-child { margin-top: 0; }
.history-task p { margin: 0; white-space: pre-wrap; }
.history-task ul { margin: 0; padding-left: 18px; }
.artifact-row { margin-top: 24px; }
.artifact-section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 14px; font-weight: 600; }
.artifact-count { font-size: 12px; font-weight: 400; color: var(--muted); }
.artifact-list { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.artifact-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px 16px; }
.artifact-card + .artifact-card { border-top: 1px solid var(--line); }
.artifact-card:hover { background: var(--surface-soft,#fafbfc); }
.artifact-file-icon { display: grid; place-items: center; width: 36px; height: 40px; flex: none; border-radius: 8px; background: #f0f4fb; color: #5574a7; }
.artifact-file-icon > .ui-icon { width: 21px; height: 21px; }
.artifact-card-copy { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.artifact-card-name { overflow: hidden; font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.artifact-card-size { color: var(--muted); font-size: 12px; }
.artifact-card-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.ui-icon { display: block; width: 17px; height: 17px; flex: none; }
.report-save-slot { display: flex; }
.btn.report-icon-button { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--muted); text-decoration: none; cursor: pointer; }
.btn.report-icon-button:hover { color: var(--ink); background: var(--hover); }
.btn.report-icon-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.report-icon-button:disabled { cursor: default; opacity: .55; }
.btn.report-icon-button.is-saved { color: var(--accent); opacity: 1; background: #f4f7ff; }
@media (max-width: 480px) {
  .artifact-card { gap: 10px; padding: 12px; }
  .artifact-card-actions { gap: 4px; }
  .artifact-file-icon { width: 30px; height: 34px; }
  .artifact-card-name { font-size: 12px; }
  .artifact-card-size { font-size: 11px; }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
}
.page-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.011em; }
.page-head-sub { margin-bottom: 0; }
.page-head-sub h2 { font-size: 13px; }
.page-head .help { margin: 4px 0 0; font-size: 13px; }
.workspace-page-head { min-height: 32px; align-items: center; margin: 0 0 12px; }
.workspace-page-head h2 { margin: 0; font-size: 16px; font-weight: 600; line-height: 24px; letter-spacing: -0.011em; }
.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}
.dashboard-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.dashboard-content { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dashboard-top { min-width: 0; }
.dashboard-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.module.dashboard-extension { padding: 0; }
.dashboard-extension-chrome { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--hover); border-radius: 7px 7px 0 0; }
.dashboard-extension-dots { display: flex; gap: 4px; }
.dashboard-extension-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); opacity: .45; }
.dashboard-extension-address { flex: 1; padding: 3px 12px; border-radius: 5px; background: var(--panel); color: var(--muted); font-size: 10px; }
.dashboard-extension-body { padding: 18px; }
.dashboard-extension-intro { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dashboard-extension-intro > div { min-width: 0; }
.dashboard-extension-art { display: block; flex: none; width: 72px; height: 80px; }
.dashboard-extension h2 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.dashboard-extension .help { margin: 0; line-height: 1.7; }
.dashboard-extension-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.dashboard-extension-actions a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.dashboard-extension .dashboard-extension-note { margin-top: 12px; font-size: 11px; }
.dashboard-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dashboard-stat { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px; color: var(--ink); text-decoration: none; }
.dashboard-stat + .dashboard-stat { border-left: 1px solid var(--line); }
.dashboard-stat > span { font-size: 12px; color: var(--muted); }
.dashboard-stat strong { font-size: 26px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.dashboard-stat small { font-size: 11px; color: var(--muted); line-height: 1.6; }
.dashboard-stat:hover { background: var(--wash); }
.dashboard-stat:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.dashboard-stat.is-warning strong { color: #b25b54; }
.dashboard-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dashboard-guide-title { font-size: 14px; margin: 0 0 12px; }
.dashboard-guide-step { margin: 0 18px 8px 0; }
.dashboard-item-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 5px; font-size: 12px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.dashboard-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.dashboard-group-head h3 { margin: 0; font-size: 12px; font-weight: 600; }
.dashboard-group-head a { font-size: 12px; color: var(--muted); }
.dashboard-warning, .dashboard-updated { font-size: 12px; line-height: 1.6; margin: 8px 0 0; overflow-wrap: anywhere; }
.dashboard-warning { color: #a45b36; }
.dashboard-updated { color: var(--muted); font-size: 11px; }
@media (max-width: 760px) {
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-stat { padding: 12px; }
  .dashboard-stat:nth-child(3) { grid-column: 1 / -1; border-left: 0; }
  .dashboard-stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .dashboard-stat strong { font-size: 24px; }
}
.module {
  min-width: 0;
  padding: 12px 14px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.module .timeline-item,
.module .compact-item { background: var(--surface-soft,#f7f8f9); }
.module .timeline-item:hover,
.module .compact-item:hover { background: #eef0f3; }
.module .tag { background: var(--panel); }
.timeline { display: flex; flex-direction: column; gap: 4px; }
.compact-list { display: flex; flex-direction: column; gap: 4px; }
.compact-item {
  appearance: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px 10px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: var(--panel);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease;
}
.compact-item:hover { background: var(--surface-soft,#f3f6fb); }
.compact-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.compact-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compact-meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.dashboard .module > .page-head { align-items: center; margin-bottom: 12px; }
.dashboard .module > .page-head h2 { font-size: 14px; }
.dashboard .module > .page-head .btn-text { flex: none; color: var(--muted); font-size: 12px; text-decoration: none; }
.dashboard .module > .page-head .btn-text:hover { color: var(--accent); }
.dashboard .timeline, .dashboard .compact-list { gap: 0; }
.dashboard-item { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; padding: 14px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; transition: background-color .15s ease; }
.dashboard-item + .dashboard-item { border-top: 1px solid #f0f1f4; }
.dashboard-item:hover { background: var(--wash); }
.dashboard-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--wash); }
.dashboard-item-icon { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 10px; background: var(--wash); color: #5279c6; font-size: 15px; font-weight: 600; }
.dashboard-item-icon svg { width: 21px; height: 21px; }
.dashboard-item-icon-memo { color: #7786a5; background: #f1f3f8; }
.dashboard-item-copy { flex: 1; min-width: 0; }
.dashboard-item-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; font-weight: 600; line-height: 1.6; }
.dashboard-item-meta { display: flex; align-items: center; gap: 12px; margin-top: 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: 12px; line-height: 18px; }
.dashboard-item-meta:has(.dashboard-item-status) { flex-wrap: wrap; row-gap: 4px; }
.dashboard-item-meta:not(:has(.dashboard-item-status)) { display: block; }
.dashboard-item-status { display: inline-flex; align-items: center; gap: 5px; color: #487f6d; }
.dashboard-item-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.dashboard-item-status[data-state="failed"] { color: #b25b54; }
.dashboard-item-status[data-state="cancelled"] { color: var(--muted); }
.dashboard-item-status[data-state="queued"], .dashboard-item-status[data-state="running"], .dashboard-item-status[data-state="validating"], .dashboard-item-status[data-state="cancelling"] { color: #5279c6; }
.dashboard-item-arrow { flex: none; color: #a5adba; font-size: 20px; transition: color .15s ease, transform .15s ease; }
.dashboard-item:hover .dashboard-item-arrow { color: var(--accent); transform: translateX(2px); }
@media (prefers-reduced-motion: reduce) { .dashboard-item, .dashboard-item-arrow { transition: none; } .dashboard-item:hover .dashboard-item-arrow { transform: none; } }
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.site-nav-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 4px 0 16px; }
.site-nav-toolbar .help { margin: 0; }
.site-nav-toolbar input { width: 280px; max-width: 50%; background: var(--panel); }
.site-nav-list { display: flex; flex-direction: column; gap: 8px; }
.site-nav-row { display: flex; align-items: center; gap: 16px; min-width: 0; padding-right: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.site-nav-row:hover { border-color: #cdd7ed; }
.site-nav-link { display: flex; flex: 1; align-items: center; gap: 16px; min-width: 0; padding: 18px 20px; color: inherit; text-decoration: none; border-radius: 10px; }
.site-nav-link:hover { background: var(--wash); }
.site-nav-icon { display: grid; place-items: center; flex: 0 0 40px; height: 40px; margin: 0; border: 1px solid #dce5f8; border-radius: 12px; background: var(--wash); color: var(--accent); font-size: 18px; font-weight: 600; }
.site-nav-icon.has-favicon { background: var(--panel); border-color: var(--line); }
.site-nav-icon img { display: block; width: 24px; height: 24px; object-fit: contain; }
.site-nav-copy { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr); align-items: center; gap: 20px; flex: 1; min-width: 0; }
.site-nav-name, .site-nav-url { margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.site-nav-name { font-size: 14px; font-weight: 600; }
.site-nav-url { color: var(--muted); font-size: 12px; }
.site-nav-arrow { flex: none; margin: 0; color: var(--muted); font-size: 18px; }
.site-nav-memos { flex: none; padding: 6px 10px; border-radius: 6px; color: var(--muted); font-size: 12px; text-decoration: none; }
.site-nav-memos:hover { color: var(--accent); background: var(--wash); }
.site-nav-row > .card-menu { position: relative; top: auto; right: auto; flex: none; }
.site-nav-link:focus-visible, .site-nav-memos:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.site-nav-empty { padding: 40px 24px; margin: 0; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }
.entity-card {
  position: relative;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.entity-card:hover { border-color: #d5d8de; }
.split-main .entity-card { background: var(--surface-soft,#f7f8f9); border-color: transparent; }
.split-main .entity-card:hover { background: #eef0f3; }
.entity-card-main {
  appearance: none;
  display: block;
  width: 100%;
  padding: 12px 36px 12px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.entity-card-main:hover { background: transparent; }
.entity-card-main:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.entity-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.entity-name {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.entity-meta, .entity-note {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.entity-note { margin-top: 8px; color: var(--ink); }
.card-menu { position: absolute; top: 8px; right: 6px; }
.icon-btn:hover { background: rgba(28, 31, 36, 0.06); color: var(--ink); }
.card-menu-panel {
  position: absolute;
  top: 32px;
  right: 0;
  z-index: 5;
  min-width: 112px;
  padding: 6px;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(23, 24, 26, 0.08), 0 0 0 1px rgba(23, 24, 26, 0.04);
}
.card-menu-item {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.card-menu-item:hover { background: var(--bg); }
.card-menu-item.is-danger { color: var(--bad); }
.report-head-frame {
  position: sticky;
  top: 69px;
  z-index: 3;
  margin: -17px -19px 0;
  background: var(--bg);
}
.report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}
.report-head-frame::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 20px;
  background: var(--bg);
  pointer-events: none;
}
.report-copy { min-width: 0; }
.report-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.report-title-row h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.011em;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.report-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.report-meta-row .help {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.report-meta-row time { flex: none; }
.report-time-short { display: none; }
.report-head .btn {
  flex: none;
  height: 28px;
  padding: 0 10px;
  border-color: transparent;
  background: #eceef1;
  line-height: 26px;
}
.report-head .btn:hover { background: #e2e4e8; }
.dashboard-recent { display: flex; flex-direction: column; align-self: stretch; }
.dashboard-recent .timeline.is-empty { flex: 1; justify-content: center; }
.empty-state { display: flex; align-items: center; gap: 8px; padding: 20px 0 12px; min-height: 180px; }
.empty-state > img { flex: none; width: 112px; height: auto; }
.empty-state-copy { min-width: 0; }
.empty-state h3 { margin: 0 0 7px; font-size: 14px; font-weight: 600; }
.empty-state .help { margin: 0; font-size: 12px; line-height: 1.8; color: var(--muted); }
.empty-state .btn { margin-top: 14px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.empty-state-action { background: var(--wash); color: var(--accent); border-color: transparent; }
.empty-state-action:hover { background: #e1e9fb; }
.empty-state-hero { flex-direction: column; gap: 20px; text-align: center; padding: 28px 20px 38px; min-height: 390px; justify-content: center; }
.empty-state-hero > img { width: 216px; }
.empty-state-hero .empty-state-copy { max-width: 300px; }
.empty-state-hero h3 { font-size: 16px; }
.empty-state-hero .btn { margin-top: 20px; }
.stack-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  display: inline-block;
  flex: none;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 18px;
  vertical-align: 1px;
}
.entity-top .tag,
.compact-item .tag,
.history-card-top .tag { margin-left: 0; }
.pack-toolbar { margin: 0 0 8px; min-height: 32px; align-items: center; }
.pack-toolbar h2 {
  margin: 0;
}
.site-url, .readonly-text, .readonly-block { margin: 4px 0 0; color: var(--ink); white-space: pre-wrap; }
.request-readout { margin: 4px 0 0; padding-left: 18px; }
.requests {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}
.requests > .row > span { font-size: 13px; }
.request-row > input { font-size: 13px; }
.request-row > input[data-role="label"] {
  flex: 0 1 160px;
  width: auto;
  min-width: 112px;
}
.request-row > input[data-role="path"] {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}
.request-row > .btn { flex: none; align-self: center; }
.dialog .btn,
.dialog .btn-text {
  height: 28px;
  padding: 0 10px;
  font-size: 13px;
  line-height: 28px;
  white-space: nowrap;
}
.data-list { margin-top: 4px; }
.data-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.data-main { min-width: 0; }
.data-title { font-weight: 600; }
.data-meta {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-actions { display: flex; gap: 8px; flex: none; }
.dialog-fields { display: flex; flex-direction: column; gap: 12px; }
.field-label { color: var(--muted); font-size: 13px; }
.dialog {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
}
.dialog-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(28, 31, 36, 0.45);
  cursor: pointer;
}
.dialog-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  max-height: min(82vh, 760px);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(23, 24, 26, 0.12);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: none;
  padding: 14px 16px 12px;
}
.dialog-head h2 { font-size: 14px; font-weight: 600; letter-spacing: -0.011em; }
#dialogBody {
  min-height: 0;
  overflow: auto;
  padding: 0 16px 16px;
}
.dialog-field { display: flex; flex-direction: column; gap: 6px; }
.dialog-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
}
.dialog-field-head .btn { flex: none; }
.dialog .btn-text,
.confirm-dialog .btn-text { background: #eceef1; }
.dialog .btn-text:hover,
.confirm-dialog .btn-text:hover { background: #e2e4e8; color: var(--ink); }
.dialog-fields label,
.dialog-fields .requests > .row > span { font-weight: 600; }
.dialog-fields input,
.dialog-fields select,
.dialog-fields textarea { font-weight: 400; }
.confirm-dialog {
  width: min(400px, calc(100% - 48px));
  padding: 20px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(23, 24, 26, 0.18);
}
.confirm-dialog::backdrop { background: rgba(28, 31, 36, 0.45); }
.confirm-dialog h2 { margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.confirm-dialog .readonly-block { margin-bottom: 16px; }
.mobile-site-filter { display: none; }
.pack-group + .pack-group { margin-top: 24px; }
.pack-group h3 { font-size: 14px; font-weight: 600; }
.site-filter-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
#packSiteFilterValue { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-filter-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 12;
  max-height: min(320px, 50vh);
  overflow: auto;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(23, 24, 26, 0.12);
}
.site-filter-options .picker-item { white-space: normal; overflow-wrap: anywhere; }
.site-filter-options .picker-item[aria-selected="true"] { background: var(--selected); }
.site-filter-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 760px) {
  .top-inner { gap: 8px; }
  .brand { flex: none; gap: 6px; }
  .account-bar { max-width: 55%; }
  .top-nav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 -2px 12px rgba(23, 24, 26, 0.04);
  }
  .top-nav .nav-item { flex-direction: column; gap: 4px; padding: 6px 4px; text-align: center; }
  .top-nav .nav-icon { width: 20px; height: 20px; }
  .console-shell, .invite-admin { margin-top: 16px; padding: 0 16px calc(80px + env(safe-area-inset-bottom)); }
  #packSplit > .pack-site-sidebar { display: none; }
  .mobile-site-filter { display: flex; position: relative; flex-direction: column; gap: 6px; }
  .pack-toolbar { flex-wrap: wrap; gap: 8px; }
  .dashboard, .card-grid { grid-template-columns: 1fr; }
  .empty-state-hero { min-height: 320px; padding: 16px 16px 28px; }
  .empty-state-hero > img { width: 180px; }
  .site-nav-toolbar { flex-wrap: wrap; gap: 12px; }
  .site-nav-toolbar input { width: 100%; max-width: none; }
  .site-nav-row { gap: 4px; padding-right: 8px; }
  .site-nav-link { gap: 12px; padding: 14px 10px; }
  .site-nav-copy { display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
  .site-nav-arrow { display: none; }
  .site-nav-memos { padding: 6px; }
  .compact-item { grid-template-columns: minmax(0, 1fr) auto; }
  .compact-meta { grid-column: 1; }
  .split { grid-template-columns: 1fr; min-height: 0; }
  .split-side {
    max-height: 320px;
  }
  #panel-history .split-side { max-height: none; }
  #panel-history .history-stage { display: none; }
  #panel-history.has-selected-record .split-side { display: none; }
  #panel-history.has-selected-record .history-stage { display: flex; }
  #panel-history .report-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 8px; }
  #panel-history .report-copy { display: contents; }
  #panel-history .history-back-row, #panel-history .report-title-row { grid-column: 1 / -1; }
  #panel-history .report-meta-row { grid-column: 1; margin-top: 0; gap: 8px; min-width: 0; }
  #panel-history .report-meta-row time { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #panel-history .report-meta-row .help { flex: none; }
  #panel-history .report-time-full { display: none; }
  #panel-history .report-time-short { display: inline; }
  #panel-history .report-actions { grid-column: 2; grid-row: 3; justify-self: end; }
  .history-back-row { display: flex; flex-basis: 100%; }
  .history-frame { height: 480px; }
}

.invite-admin h3 { margin: 0; font-size: 16px; }
.invite-admin .module { margin-bottom: 20px; }
.invite-create-form { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 16px; margin-top: 18px; }
.invite-create-form label { min-width: 170px; }
.invite-create-form > button { margin-top: 24px; }
.invite-created { margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--selected); }
.invite-created input { width: 100%; max-width: 430px; font-family: monospace; }
.invite-created button { margin-top: 12px; margin-right: 8px; }
.invite-table-wrap { overflow-x: auto; }
.invite-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.invite-table th, .invite-table td { padding: 14px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.invite-table th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.invite-table td { overflow-wrap: anywhere; min-width: 90px; }
.invite-table td:first-child { min-width: 210px; }
.invite-actions { white-space: nowrap; }
.invite-actions button + button { margin-left: 12px; }
.invite-status-active { color: #27764b; }
.invite-status-disabled, .invite-status-expired, .invite-status-exhausted { color: var(--muted); }
.invite-usage .help { overflow-wrap: anywhere; }
.account-panel a.account-action { display: block; text-decoration: none; }
@media (max-width: 760px) {
  .invite-create-form { flex-direction: column; gap: 12px; }
  .invite-create-form label { width: 100%; }
  .invite-create-form > button { margin-top: 0; }
  .invite-created input { font-size: 13px; }
}

@media (max-width: 760px) {
  .invite-table, .invite-table tbody, .invite-table tr, .invite-table td { display: block; width: 100%; }
  .invite-table thead { display: none; }
  .invite-table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .invite-table tr:last-child { border-bottom: 0; }
  .invite-table td, .invite-table td:first-child { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 8px; min-width: 0; padding: 6px 0; border: 0; }
  .invite-table td::before { content: attr(data-label); color: var(--muted); }
  .invite-table .invite-actions { display: flex; flex-wrap: wrap; align-items: center; }
  .invite-table .invite-actions::before { width: 86px; flex: none; }
  .invite-table .invite-actions button + button { margin-left: 0; }
}

.credit-balance { color: var(--muted); margin: 18px 0; }
.credit-balance strong { font-size: 32px; color: var(--ink); margin-right: 6px; }
.credit-item { padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.credit-item:last-child { border-bottom: 0; }
.credit-item p { margin: 6px 0; }
.credit-item a { font-size: 13px; }

.credit-table-scroll { overflow-x: auto; margin-top: 14px; }
.credit-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.credit-table th, .credit-table td { padding: 14px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.credit-table th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.credit-table th:first-child { width: 42%; }
.credit-table th:nth-child(2) { width: 26%; }
.credit-table th:nth-child(3) { width: 14%; }
.credit-table th:nth-child(4) { width: 18%; }
.credit-table .credit-number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.credit-table .help { margin: 6px 0 0; font-size: 12px; }
.credit-execution-table { min-width: 640px; }
.credit-table tbody tr:last-child td { border-bottom: 0; }

.report-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.history-stage.is-chat {
  position: sticky;
  top: 69px;
  height: calc(100dvh - 92px);
  min-height: 0;
  overflow: hidden;
  padding: 0;
}
.report.is-chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.report.is-chat > .report-head-frame { position: relative; top: auto; flex: none; margin: 0; }
.report.is-chat .report-head { border: 0; border-radius: 0; }
.report.is-chat .report-head-frame::before { display: none; }
.report.is-chat .report-conversation { flex: 1; height: auto; }
.report.is-chat > #historyReportPanel { display: none; }
.report-conversation { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.conversation-header { flex: none; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.conversation-header .help { margin: 0; font-size: 12px; }
.conversation-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 20px; background: var(--surface-soft,#fafbfc); }
.conversation-empty { max-width: 320px; margin: 64px auto; text-align: center; color: var(--muted); line-height: 1.8; }
.conversation-turns { display: flex; flex-direction: column; gap: 24px; }
.conversation-message-row { display: flex; align-items: flex-start; gap: 10px; }
.conversation-message-row.is-user { flex-direction: row-reverse; }
.conversation-avatar { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #eaf0fd; color: var(--accent); font-size: 12px; font-weight: 600; }
.is-assistant .conversation-avatar { background: transparent; }
.conversation-avatar img { display: block; width: 80%; height: 80%; object-fit: contain; }
.is-user .conversation-avatar { background: #e9edf3; color: #53627a; }
.conversation-message-body { max-width: calc(100% - 64px); min-width: 0; }
.conversation-time { display: block; font-size: 11px; color: var(--muted); margin: 0 0 6px; }
.is-user .conversation-time { text-align: right; }
.conversation-bubble { padding: 12px 15px; border: 1px solid var(--line); border-radius: 0 12px 12px 12px; background: var(--panel); line-height: 1.8; }
.is-user .conversation-bubble { background: #eaf1ff; border-color: #dce7fc; border-radius: 12px 0 12px 12px; }
.conversation-message { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.conversation-status { margin: 0 0 8px; }
.conversation-status:last-child { margin-bottom: 0; }
.conversation-attachment { display: block; margin-top: 10px; }
.conversation-composer { flex: none; padding: 12px 20px 16px; border-top: 1px solid var(--line); background: var(--panel); }
.conversation-composer > .help { margin: 0 0 10px; font-size: 12px; }
#conversationForm { cursor: text; display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 8px; border: 1px solid #dfe3e9; border-radius: 20px; background: var(--panel); box-shadow: 0 2px 8px rgba(23, 24, 26, .04); transition: border-color .15s, box-shadow .15s; }
#conversationForm:focus-within { border-color: var(--line); box-shadow: none; background: var(--input-focus); }
.conversation-input-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#conversationMessage { display: block; width: 100%; height: 28px; min-height: 28px; max-height: 160px; margin: 0; padding: 0 4px; border: 0; border-radius: 0; outline: none; box-shadow: none; background: transparent; resize: none; overflow-y: auto; line-height: 1.7; }
#conversationMessage:focus, #conversationMessage:focus-visible { outline: none; border: 0; box-shadow: none; }
.conversation-actions { display: flex; justify-content: flex-end; align-items: center; min-height: 36px; }
#conversationSend { display: grid; place-items: center; position: relative; flex: none; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: #17181a; cursor: pointer; transition: background .15s; }
#conversationSend:hover:not(:disabled) { background: #35373b; }
#conversationSend:disabled { background: #e6e8ec; color: #a2a8b2; cursor: default; }
#conversationSend:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.conversation-stop-icon { display: none; width: 12px; height: 12px; border-radius: 2px; background: currentColor; }
@media (max-width: 760px) {
  .report-actions { gap: 6px; }
  .history-stage.is-chat { top: 64px; height: calc(100dvh - 160px - env(safe-area-inset-bottom)); }
  .conversation-header { padding: 12px; }
  .conversation-scroll { padding: 20px 12px; }
  .conversation-message-body { max-width: calc(100% - 40px); }
  .conversation-message-row { gap: 8px; }
  .conversation-avatar { width: 26px; height: 26px; }
  .conversation-bubble { padding: 10px 12px; }
  .conversation-composer { padding: 10px 12px 12px; }
  #conversationMessage { resize: none; }
}

.conversation-markdown { overflow-wrap: anywhere; }
.conversation-markdown > :first-child { margin-top: 0; }
.conversation-markdown > :last-child { margin-bottom: 0; }
.conversation-markdown p { margin: 0 0 12px; }
.conversation-markdown h1, .conversation-markdown h2, .conversation-markdown h3,
.conversation-markdown h4, .conversation-markdown h5, .conversation-markdown h6 { margin: 20px 0 10px; line-height: 1.5; font-size: 14px; font-weight: 600; }
.conversation-markdown ul, .conversation-markdown ol { margin: 8px 0 14px; padding-left: 22px; }
.conversation-markdown li { margin: 5px 0; }
.conversation-markdown code { padding: 2px 5px; border-radius: 4px; background: #eef1f5; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.conversation-markdown pre { max-width: 100%; margin: 12px 0; padding: 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft,#f7f8fa); }
.conversation-markdown pre code { padding: 0; background: none; white-space: pre; }
.conversation-markdown table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 12px 0; font-size: 12px; }
.conversation-markdown th, .conversation-markdown td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; }
.conversation-markdown th { background: var(--surface-soft,#f4f6f9); font-weight: 600; }
.conversation-markdown details { margin: 12px 0; }
.conversation-markdown summary { cursor: pointer; font-weight: 600; }

#conversationSend.is-running .conversation-send-icon { display: none; }
#conversationSend.is-running .conversation-stop-icon { display: block; }
#conversationSend.is-waiting .conversation-stop-icon { display: none; }
#conversationSend.is-waiting::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: conversation-spin .8s linear infinite; }
@keyframes conversation-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #conversationSend.is-running::before { animation: none; } }

/* Shared page and compact empty states. */
.empty-state-page { flex-direction: column; justify-content: center; gap: 18px; min-height: 360px; padding: 36px 24px; text-align: center; }
.empty-state-page > img { width: 180px; }
.empty-state-page .empty-state-copy { max-width: 340px; }
.empty-state-page h3 { font-size: 16px; }
.empty-state-page .btn { margin-top: 20px; }
.card-grid.is-empty { display: block; }
.invite-admin .empty-state-page { min-height: 220px; }
.invite-admin .empty-state-compact { min-height: 120px; gap: 20px; padding: 16px 8px; }
.site-nav-list > .empty-state { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.memo-page-head input { width: 280px; max-width: 65%; background: var(--panel); }
.history-sidebar { gap: 14px; z-index: 4; }
.history-filters { display: flex; flex-direction: column; gap: 8px; }
.history-filters input, .history-status-button { width: 100%; min-width: 0; font: inherit; background: var(--surface-soft,#fafbfe); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; color: var(--ink); }
.history-filters input:focus, .history-filters input:focus-visible, .history-status-button:focus, .history-status-button:focus-visible { outline: none; border-color: var(--line); box-shadow: none; background: var(--panel); }
.history-status-filter { position: relative; }
.history-status-button { display: flex; align-items: center; justify-content: space-between; cursor: pointer; text-align: left; }
.history-status-button:hover { background: var(--surface-soft,#f3f5f9); }
.history-status-chevron { color: var(--muted); }
.history-status-button[aria-expanded="true"] .history-status-chevron { transform: rotate(180deg); }
.history-status-options { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 6; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); box-shadow: 0 8px 24px rgba(23, 24, 26, .1); }
.history-status-options button { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; border-radius: 5px; padding: 9px 10px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.history-status-options button:hover, .history-status-options button:focus-visible { background: var(--surface-soft,#f3f5f9); outline: none; }
.history-status-options button[aria-selected="true"] { background: var(--wash); color: var(--accent); }
.history-status-options button[aria-selected="true"]::after { content: "✓"; }
#historyList { gap: 6px; }
#historyList .history-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px 8px; border: 1px solid transparent; border-radius: 9px; }
#historyList .history-card + .history-card::before { display: none; }
#historyList .history-card.is-active { background: var(--wash); border-color: #d4e1fb; box-shadow: none; }
.history-record-copy { flex: 1; min-width: 0; }
#historyList .history-card-top { display: block; }
#historyList .history-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; line-height: 1.6; font-weight: 600; }
.history-record-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: 11px; }
#historyList .history-time { font-size: 11px; white-space: nowrap; }
.history-cards .empty-state { min-height: 180px; padding: 16px 0; }
.history-cards .empty-state img { display: none; }
.history-placeholder { margin: 0; }
.report-head { align-items: center; }
.report-meta-row { gap: 12px; margin-top: 8px; font-size: 12px; }
.report-meta-row .help { font-size: 12px; }
.report-head #deleteHistory { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.report-head #deleteHistory:hover { color: var(--bad); background: #fff5f4; border-color: #efcac6; }
#packSiteList { gap: 6px; }
#packSiteList .picker-item { display: flex; align-items: center; gap: 10px; padding: 12px 10px; border: 1px solid transparent; border-radius: 9px; transition: background-color .15s ease, border-color .15s ease; }
#packSiteList .picker-item + .picker-item::before { display: none; }
#packSiteList .picker-item.is-active { border-color: #d4e1fb; background: var(--wash); }
.memo-site-icon { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 8px; background: #f1f3f7; color: #7b879d; font-size: 14px; font-weight: 600; }
.is-active .memo-site-icon { color: var(--accent); background: #e1eafb; }
.memo-site-copy { flex: 1; min-width: 0; }
#packSiteList .picker-item .data-title { font-weight: 600; }
#packSiteList .data-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; color: var(--muted); }
.memo-site-count { display: grid; place-items: center; flex: none; min-width: 23px; padding: 1px 6px; border-radius: 6px; color: var(--muted); background: #f1f3f7; font-size: 11px; }
.is-active .memo-site-count { background: #dfe9fc; color: var(--accent); }
.memo-group-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.memo-group-heading h3 { overflow-wrap: anywhere; }
.memo-group-count { flex: none; color: var(--muted); font-size: 12px; }
.pack-group + .pack-group { padding-top: 24px; border-top: 1px solid var(--line); }
.pack-group .card-grid { gap: 12px; }
.pack-group .entity-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; transition: border-color .15s ease, box-shadow .15s ease; }
.pack-group .entity-card:hover { background: var(--panel); border-color: #b8cbed; box-shadow: 0 3px 12px rgba(35, 65, 115, .06); }
.pack-group .entity-card-main { padding: 18px 16px 14px; height: 100%; }
.pack-group .entity-top { padding-right: 22px; min-height: 28px; }
.pack-group .entity-name { font-size: 14px; }
.pack-group .entity-top .tag { font-size: 10px; background: var(--surface-soft,#f3f5f8); }
.pack-group .entity-meta { margin-top: 10px; font-size: 12px; }
.entity-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 10px 0 0; font-size: 12px; line-height: 1.7; color: var(--muted); }
.pack-group .entity-note { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 12px; margin-top: 14px; border-top: 1px solid #f0f1f4; font-size: 12px; color: var(--muted); }
.entity-open-hint { flex: none; color: #8391a9; }
.entity-card:hover .entity-open-hint { color: var(--accent); }
.pack-group .card-menu { top: 18px; right: 10px; }
@media (min-width: 761px) { .pack-site-sidebar { position: sticky; top: 69px; } }
@media (prefers-reduced-motion: reduce) { #packSiteList .picker-item, .pack-group .entity-card { transition: none; } }
@media (max-width: 760px) {
  .empty-state-page { min-height: 300px; padding: 24px 16px; }
}

/* Library reuses the console's quiet panels, typography and report renderer. */
.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; }
.library-summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.library-summary p { margin: 0; }
.library-filters { display: grid; grid-template-columns: minmax(220px, 1.8fr) repeat(3, minmax(100px, 1fr)); gap: 8px; padding-bottom: 16px; }
.library-filters label { min-width: 0; }
.library-search { display: flex; align-items: center; gap: 8px; min-width: 0; background: var(--surface-soft,#fafbfe); border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; }
.library-search:focus-within { background: var(--panel); }
.library-search-icon { color: var(--muted); font-size: 19px; line-height: 1; }
.library-search input { width: 100%; min-width: 0; padding: 8px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font: inherit; }
.library-search input:focus { background: transparent; }
.library-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.library-search-clear { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; flex: none; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font: inherit; font-size: 18px; cursor: pointer; }
.library-search-clear:hover { background: var(--hover); color: var(--ink); }
.library-filter { position: relative; min-width: 0; }
.library-filter-button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; height: 36px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft,#fafbfe); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.library-filter-button > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-filter-button:hover, .library-filter-button[aria-expanded="true"] { background: var(--surface-soft,#f3f5f9); }
.library-filter-button.has-value { background: var(--wash); border-color: #d4e1fb; }
.library-filter-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.library-filter-chevron { display: grid; place-items: center; flex: 0 0 16px; width: 16px; height: 16px; color: var(--muted); transform-origin: center; }
.library-filter-button[aria-expanded="true"][aria-haspopup="listbox"] .library-filter-chevron { transform: rotate(180deg); }
.library-filter-popover { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); box-shadow: 0 8px 24px rgba(23,24,26,.1); }
.library-filter-options { max-height: 280px; overflow-y: auto; overscroll-behavior: contain; }
.library-filter-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); font: inherit; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.library-filter-option:hover, .library-filter-option:focus-visible { background: var(--surface-soft,#f3f5f9); outline: none; }
.library-filter-option[aria-selected="true"] { background: var(--wash); color: var(--accent); }
.library-filter-option[aria-selected="true"]::after { content: "✓"; flex: none; }
.library-option-search { width: 100%; margin-bottom: 5px; padding: 8px 10px; font-size: 12px; }
.library-option-empty { color: var(--muted); padding: 8px 10px; font-size: 12px; margin: 0; }
.library-calendar { left: auto; width: min(286px, calc(100vw - 48px)); padding: 12px; }
.library-calendar-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; font-weight: 500; }
.library-calendar-nav { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--ink); font: inherit; font-size: 22px; cursor: pointer; }
.library-calendar-week, .library-calendar-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.library-calendar-week { color: var(--muted); font-size: 11px; text-align: center; padding-bottom: 6px; }
.library-calendar-day { width: 100%; height: 32px; padding: 0; margin: 1px 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }
.library-calendar-day.is-outside { color: #9ca3af; }
.library-calendar-nav:hover, .library-calendar-day:hover { background: var(--hover); }
.library-calendar-day[aria-current="date"] { border-color: #d4e1fb; color: var(--accent); }
.library-calendar-day[aria-selected="true"] { background: var(--accent); color: #fff; }
.library-calendar-day:focus-visible, .library-calendar-nav:focus-visible, .library-search-clear:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.library-calendar-footer { display: flex; justify-content: space-between; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.library-calendar-footer .btn-text { font-size: 12px; }
.library-filter-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.library-filter-actions .btn { min-width: 72px; }
#libraryFilters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 14px; }
#libraryFilters .library-search { flex: 1 1 260px; height: 34px; max-width: 360px; }
.library-active-filters { display: contents; }
.library-active-filters .library-filter { display: flex; align-items: center; flex: 0 1 auto; max-width: 300px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.library-active-filters .library-filter-button { height: 32px; width: auto; min-width: 0; max-width: 264px; border: 0; background: transparent; font-size: 12px; padding: 6px 8px; }
.library-active-filters .library-filter-button.has-value { color: var(--accent); }
.library-filter-remove { flex: none; width: 26px; height: 26px; padding: 0; margin-right: 2px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; font-size: 16px; cursor: pointer; }
.library-filter-remove:hover { background: var(--hover); color: var(--ink); }
.library-active-filters .library-filter-popover { right: auto; min-width: 220px; max-width: min(320px, calc(100vw - 48px)); }
.library-active-filters .library-calendar { width: min(286px, calc(100vw - 48px)); }
.library-filter-picker { position: relative; flex: none; }
.library-add-filter { height: 34px; border-style: dashed; color: var(--muted); background: transparent; }
.library-filter-menu { position: absolute; top: calc(100% + 6px); left: 0; width: 190px; z-index: 25; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); box-shadow: 0 8px 24px rgba(23,24,26,.1); }
.library-filter-menu button { display: block; width: 100%; border: 0; padding: 9px 10px; border-radius: 5px; text-align: left; font: inherit; color: var(--ink); background: transparent; cursor: pointer; }
.library-filter-menu button:hover, .library-filter-menu button:focus-visible { background: var(--hover); outline: none; }
.library-filter-menu button:disabled { color: var(--muted); opacity: .5; cursor: default; }
#libraryFilters .library-filter-actions { margin-left: auto; }
@media(max-width:760px) {
  #libraryFilters .library-search { flex-basis: 100%; max-width: none; }
  #libraryFilters { position: relative; }
  .library-active-filters .library-filter { position: static; }
  .library-active-filters .library-filter-popover { left: 0; right: 0; top: 100%; max-width: none; }
  .library-active-filters .library-calendar { width: min(286px, calc(100vw - 48px)); left: auto; }
  .library-filter-menu { left: auto; right: 0; }
}
.library-list-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.library-grouping { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.library-grouping button[aria-pressed="true"] { background: var(--wash); color: var(--accent); border-color: #d4e1fb; }
.library-group { min-width: 0; }
.library-group + .library-group { margin-top: 16px; }
.library-group-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 2px 12px; }
.library-group-heading h4 { min-width: 0; margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.library-group-items { display: flex; flex-direction: column; gap: var(--library-card-gap); }
.library-list .library-group-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--library-card-min-width), 100%), 1fr)); align-content: start; }
.library-list .library-card { flex-direction: column; border-color: var(--line); background: var(--panel); }
.library-list .library-card:hover { background: var(--hover); }
.library-list .library-card.is-active { border-color: #d4e1fb; background: var(--wash); }
.library-list .library-card-copy { width: 100%; }
.library-list .library-empty { grid-column: 1 / -1; }
.library-layout { display: block; }
.library-sidebar, .library-detail { min-width: 0; }
.library-drawer { position: fixed; inset: 0 0 0 auto; width: min(760px, 74vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; box-shadow: -12px 0 40px rgba(23,24,26,.12); }
.library-drawer[open] { display: flex; flex-direction: column; }
.library-drawer::backdrop { background: rgba(23,24,26,.28); }
.library-drawer[data-size="small"] { width: min(520px, calc(100vw - 24px)); }
.library-drawer[data-size="large"] { width: 100vw; }
.library-drawer-sizes { display: flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft,#fafbfc); }
.library-drawer-sizes .btn-text { min-width: 30px; padding: 4px 8px; font-size: 12px; }
.library-drawer-sizes [aria-pressed="true"] { color: var(--accent); background: var(--wash); }
.library-close-icon { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 6px; }
.library-close-icon .ui-icon { width: 18px; height: 18px; }
.library-close-icon:hover { background: var(--hover); color: var(--ink); }
.library-drawer-open { overflow: hidden; }
.library-drawer-toolbar { display: flex; align-items: center; justify-content: space-between; flex: none; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.library-drawer-tools { display: flex; align-items: center; gap: 12px; }
.library-drawer-toolbar strong { font-size: 13px; font-weight: 600; }
.library-detail-notice { margin: 12px 24px 0; }
.library-detail-title { display: flex; align-items: flex-start; gap: 8px; }
.library-detail-title .library-file-icon { margin-top: 2px; }
.library-information { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.library-information > summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.library-information > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.library-sidebar { position: static; }
.library-results { min-width: 0; }
.library-sidebar h3 { font-size: 13px; font-weight: 600; margin: 0; }
.library-list { --library-card-min-width: 220px; --library-card-gap: 6px; display: flex; flex-direction: column; gap: 6px; min-height: 160px; }
.library-card { display: flex; align-items: flex-start; gap: 10px; width: 100%; border: 1px solid transparent; border-radius: 9px; background: transparent; padding: 12px 10px; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.library-card:hover { background: var(--hover); }
.library-card.is-active { border-color: #d4e1fb; background: var(--wash); }
.library-card:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.library-card-title { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.library-card-title strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; min-width: 0; line-height: 20px; max-height: 40px; overflow: hidden; text-overflow: ellipsis; }
.library-file-icon { display: inline-flex; align-items: center; flex: 0 0 16px; width: 16px; height: 20px; color: var(--muted); }
.library-file-icon .ui-icon { width: 16px; height: 16px; }
.library-file-icon.is-code { color: #ad761f; }
.library-file-icon.is-table { color: #23845c; }
.library-file-icon.is-markdown { color: #436ac3; }
.library-file-icon.is-pdf { color: #c04d4d; }
.library-file-icon.is-image { color: #8c5ac1; }
.library-file-icon.is-archive { color: #9d7635; }
.library-file-icon.is-audio, .library-file-icon.is-video { color: #b2588d; }
.library-file-icon.is-reply { color: #368c99; }
.library-file-icon.is-text { color: #59739b; }
.library-card-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.library-card-copy strong { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.library-card .help { font-size: 11px; }
.library-source-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.library-tags { color: var(--accent); font-size: 11px; overflow-wrap: anywhere; }
.library-pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-left: auto; flex-shrink: 0; }
.library-pagination .btn-text { font-size: 12px; }
.credit-pagination { margin: 12px 0 0; justify-content: flex-end; flex-wrap: wrap; }
.credit-pagination[hidden] { display: none; }
.library-detail { padding: 24px; overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.library-detail-head h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.library-detail-actions { flex-wrap: wrap; margin: 16px 0 12px; }
.library-detail-actions a.btn, .library-detail-actions a.btn:hover { text-decoration: none; }
.library-retention { background: var(--surface-soft,#f7f8fa); border-radius: 7px; padding: 10px 12px; line-height: 1.7; }
.library-provenance { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 8px 12px; padding: 16px 0; margin: 0; font-size: 12px; }
.library-provenance dt { color: var(--muted); }
.library-provenance dd { margin: 0; overflow-wrap: anywhere; }
.library-editor { padding: 16px 0; border-top: 1px solid var(--line); }
.library-editor h4, .library-preview h4 { margin: 0; font-size: 13px; font-weight: 600; }
.library-editor label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.library-editor input, .library-editor textarea { width: 100%; }
.library-remove { color: var(--bad); }
.library-preview { margin-top: 20px; min-width: 0; }
.library-format-preview { min-width: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.library-preview-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface-soft,#fafbfc); }
.library-preview-modes { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.library-preview-modes .btn-text { font-size: 12px; }
.library-preview-modes .btn-text[aria-pressed="true"] { color: var(--accent); background: var(--wash); }
.library-preview-status { margin: 0; font-size: 11px; }
.library-preview-loading, .library-preview-content > .error, .library-preview-content > .btn { margin: 16px; }
.library-code-preview { margin: 0; padding: 16px; overflow: auto; max-height: 60dvh; min-height: 180px; white-space: pre; tab-size: 2; background: var(--surface-soft,#fafbfc); color: #354154; font: 12px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace; }
.library-code-preview.is-wrapped { white-space: pre-wrap; overflow-wrap: anywhere; }
.library-json-tree { padding: 14px 16px; max-height: 60dvh; overflow: auto; font: 12px/1.9 ui-monospace, SFMono-Regular, Menlo, monospace; }
.library-json-node > summary { cursor: pointer; white-space: nowrap; }
.library-json-children { margin-left: 7px; padding-left: 16px; border-left: 1px solid var(--line); }
.library-json-key { color: #46618d; }
.library-json-string { color: #36815b; }
.library-json-number { color: #af7625; }
.library-json-boolean { color: #8954b6; }
.library-json-null { color: var(--muted); }
.library-json-value { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto; }
.library-json-node > summary:focus-visible, .library-table-scroll:focus-visible, .library-code-preview:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.library-table-scroll { max-height: 60dvh; overflow: auto; overscroll-behavior: contain; }
.library-data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; line-height: 1.6; }
.library-data-table th, .library-data-table td { min-width: 110px; max-width: 320px; padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; }
.library-data-table td { min-width: 100px; }
.library-data-table td:has(.library-cell-text) { min-width: 260px; }
.library-cell-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; width: 100%; max-width: 320px; max-height: 4.8em; overflow: hidden; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer; }
.library-cell-text[aria-expanded="true"] { display: block; max-height: none; }
.library-cell-text:hover { color: var(--accent); }
.library-data-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-soft,#f3f5f8); font-weight: 600; white-space: nowrap; }
.library-data-table tbody tr:nth-child(even) { background: var(--surface-soft,#fafbfc); }
.library-data-table tbody tr:hover { background: var(--wash); }
.library-data-table .library-row-number { position: sticky; left: 0; z-index: 1; min-width: 38px; width: 38px; color: var(--muted); text-align: center; background: var(--surface-soft,#f7f8fa); font-weight: 400; }
.library-data-table thead .library-row-number { z-index: 3; }
.library-table-scroll + .help { margin: 10px 12px; font-size: 11px; }
.library-reading-canvas { padding: 20px; font-size: 14px; line-height: 1.75; }
.library-figure-canvas { padding: 20px; overflow: auto; background: var(--panel); }
.library-preview-unavailable { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 220px; padding: 32px; border: 1px dashed var(--line); border-radius: 9px; background: var(--surface-soft,#fafbfc); text-align: center; }
.library-preview-unavailable .library-file-icon, .library-preview-unavailable .ui-icon { width: 36px; height: 36px; }
.library-preview-unavailable p { max-width: 360px; margin: 0; line-height: 1.7; }
.library-preview-fallback > .help { padding: 0 16px; }
.library-preview-empty { padding: 24px; color: var(--muted); text-align: center; }
@media(max-width:760px) { .library-reading-canvas, .library-figure-canvas { padding: 12px; } .library-preview-toolbar { gap: 4px; } }
.library-empty { display: flex; flex-direction: column; justify-content: center; min-height: 200px; padding: 20px; text-align: center; }
.library-empty strong { font-size: 14px; font-weight: 500; }
.library-empty p { line-height: 1.8; }
.library-save { font-size: 12px; }
@media (max-width: 760px) {
  .library-sidebar { position: static; }
  .library-list { max-height: none; }
  .library-drawer, .library-drawer[data-size] { width: 100vw; border-left: 0; }
  .library-drawer-sizes { display: none; }
  .library-detail { padding: 16px; }
  .library-drawer-toolbar { padding: 12px 16px; }
    .library-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-search { grid-column: 1 / -1; }
  .library-provenance { grid-template-columns: 76px minmax(0,1fr); gap: 8px; }
  .library-summary { flex-direction: column; }
}

.report-head .btn.report-icon-button { width: 32px; height: 32px; padding: 0; line-height: 1; border-color: var(--line); background: var(--panel); }
.report-head .btn.report-icon-button:hover { background: var(--hover); }
.report-head #deleteHistory:hover { color: var(--bad); background: #fff5f4; border-color: #efcac6; }

/* Report deletion confirmation; matches the console without a browser alert. */
.report-delete-dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100vh - 32px); overflow: auto; padding: 24px; font: inherit; }
.report-delete-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.report-delete-heading > h2 { margin: 0; font-size: 17px; font-weight: 600; }
.report-delete-badge { display: grid; place-items: center; width: 36px; height: 36px; flex: none; background: #fff1f0; color: var(--bad); border-radius: 10px; }
.report-delete-badge > .ui-icon { width: 19px; height: 19px; }
.report-delete-name { margin: 0 0 16px; padding: 12px; font-size: 13px; font-weight: 500; line-height: 1.6; background: var(--surface-soft,#f7f8f9); border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.report-delete-description { margin: 0; font-size: 13px; line-height: 1.7; }
.report-delete-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.report-delete-error { margin: 12px 0 0; font-size: 13px; line-height: 1.6; }
.report-delete-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.report-delete-actions > .btn { min-height: 32px; padding: 5px 14px; font-size: 13px; }
.report-delete-actions > .report-delete-confirm { color: #fff; border-color: var(--bad); background: var(--bad); }
.report-delete-actions > .report-delete-confirm:hover { background: #a81d1a; border-color: #a81d1a; }
.report-delete-actions > .btn:disabled { cursor: default; opacity: .55; }
@media (max-width: 480px) { .report-delete-dialog { padding: 20px; } }
.request-row { flex-wrap:wrap; }.request-row .memo-request-rules { width:100%; font-size:12px; }.memo-request-rules textarea { font-family:ui-monospace,monospace; min-height:80px; }

/* Site maintenance lives alongside Memo filtering; controls remain separate. */
.memo-page-tools { display:flex; align-items:center; justify-content:flex-end; gap:12px; min-width:0; flex:1; }
.memo-page-tools #memoSearch { max-width:none; min-width:0; }
#addSiteMenu, #addMobileSiteMenu { flex:none; }
.pack-site-sidebar > .side-head { justify-content:space-between; align-items:center; }
.memo-site-row { display:flex; align-items:center; gap:4px; border:1px solid transparent; border-radius:9px; padding-right:4px; }
.memo-site-row.is-active { border-color:#d4e1fb; background:var(--wash); }
#packSiteList .memo-site-row .picker-item { flex:1; min-width:0; border:0; background:transparent; }
.memo-site-row .card-menu { flex:none; }.memo-site-row .icon-btn { width:28px; height:28px; }
.mobile-site-filter-row { display:flex; align-items:center; gap:8px; }.mobile-site-filter-row > .site-filter-button { flex:1; min-width:0; }
#packMobileSiteActions:empty { display:none; }
.card-menu-panel.is-floating { position:fixed; inset:auto; margin:0; border:1px solid var(--line); max-height:calc(100vh - 24px); overflow:auto; }
.card-menu-item { text-decoration:none; font:inherit; text-align:left; cursor:pointer; }
@media (max-width:760px) {
  .memo-page-head { align-items:flex-start; flex-wrap:wrap; gap:12px; }
  .memo-page-tools { flex-basis:100%; justify-content:space-between; gap:8px; }
  .memo-page-tools #memoSearch { flex:1; width:0; }
}
#addSiteMenu > .card-menu,#addMobileSiteMenu > .card-menu,.memo-site-row > .card-menu,#packMobileSiteActions > .card-menu { position:relative; top:auto; right:auto; }
.site-list-search { width:100%; min-width:0; padding:8px 10px; border:1px solid var(--line); border-radius:7px; background:var(--surface-soft,#fafbfe); color:var(--ink); font:inherit; font-size:12px; }
.site-filter-options .site-list-search { margin-bottom:6px; }.memo-site-row[hidden] { display:none; }

/* Records workspace: date groups, adjustable list, and persistent report tabs. */
#historySplit { grid-template-columns: minmax(240px, min(var(--history-sidebar-width, 292px), calc(100% - 380px))) minmax(0, 1fr); gap: 20px; }
.history-sidebar { position: relative; }
.history-resize { position: absolute; top: 0; bottom: 0; right: -17px; width: 12px; cursor: col-resize; touch-action: none; }
.history-resize::after { content: ""; position: absolute; top: 20px; bottom: 20px; left: 5px; width: 2px; border-radius: 2px; background: transparent; }
.history-resize:hover::after, .history-resize.is-resizing::after, .history-resize:focus-visible::after { background: #b7c6de; }
.history-resize:focus-visible { outline: 1px solid var(--accent); border-radius: 4px; }
.history-date-group { margin: 16px 8px 2px; color: var(--muted); font-size: 11px; font-weight: 500; }
.history-date-group:first-child { margin-top: 0; }
#historyList { gap: 4px; scroll-padding-block: 8px; }
#historyList .history-card { padding: 12px 10px; }
#historyList .history-title { line-height: 1.65; font-size: 13px; }
.report-tabs { display: flex; gap: 24px; padding: 0 20px; background: var(--panel); border: 1px solid var(--line); border-top: 0; }
.report-tabs button { position: relative; appearance: none; padding: 11px 2px 12px; border: 0; background: transparent; font: inherit; color: var(--muted); cursor: pointer; }
.report-tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.report-tabs button[aria-selected="true"]::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--ink); border-radius: 2px; }
.report-tabs button:hover:not(:disabled) { color: var(--ink); }
.report-tabs button:disabled { opacity: .45; cursor: default; }
.report-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: 4px; }
.report.is-chat .report-tabs { border-right: 0; border-left: 0; }
#historyReportPanel { outline-offset: 4px; padding-top: 16px; }
#historyReportPanel > .history-task { margin-top: 0; padding: 0; }
#historyReportPanel > .history-task > .report-preview { margin-top: 0 !important; }
#historyFilesPanel { padding-top: 16px; outline-offset: 4px; }
#historyFilesPanel > .artifact-row { margin-top: 0; }
@media (max-width: 760px) {
  #historySplit { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .history-resize { display: none; }
  .report-tabs { padding: 0 18px; }
  .history-date-group { margin-top: 18px; font-size: 12px; }
  .report.is-chat .report-head { padding: 16px 18px 12px; }
}

.library-load-more { display: block; margin: 24px auto; }
.library-load-more[hidden] { display: none; }

.conversation-message-actions { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.conversation-message-actions .report-icon-button { width: 30px; height: 30px; padding: 6px; border: 0; background: transparent; color: var(--muted); }
.conversation-message-actions .report-icon-button:hover { background: var(--hover); color: var(--ink); }

.credit-batch-table { min-width: 660px; }
.credit-batch-table th:first-child { width: 16%; }
.credit-batch-table th:nth-child(2), .credit-batch-table th:nth-child(3) { width: 16%; }
.credit-batch-table th:nth-child(4), .credit-batch-table th:nth-child(5) { width: 26%; }
.preset-picker-row { display:flex; justify-content:space-between; gap:20px; padding:16px 0; border-bottom:1px solid var(--line,#e5e7eb); }
.preset-picker-row > div:first-child { min-width:0; overflow-wrap:anywhere; }
.preset-picker-row h3 { margin:0 0 8px; font-size:15px; }
.preset-picker-row .admin-module-actions { display:flex; gap:8px; align-items:center; flex-shrink:0; }
.preset-picker-filters { display:flex; gap:12px; flex-wrap:wrap; }
.preset-picker-filters .library-search { width:240px; max-width:100%; }
.preset-picker-filters .library-filter { width:200px; max-width:100%; }
.preset-picker-filters ~ .data-list pre { white-space:pre-wrap; overflow-wrap:anywhere; }
@media(max-width:760px) { .memo-page-tools { flex-wrap:wrap; justify-content:flex-end; }.preset-picker-row { flex-direction:column; gap:8px; }.preset-picker-row .admin-module-actions { justify-content:flex-end; }.preset-picker-filters .library-search,.preset-picker-filters .library-filter { width:100%; } }
.preset-dialog { width:min(760px,calc(100vw - 32px)); max-width:none; max-height:calc(100dvh - 32px); overflow:auto; font:inherit; }
.preset-dialog > .page-head { position:sticky; top:-20px; padding:12px 0; background:var(--panel); z-index:2; gap:16px; }
.preset-dialog > .page-head h2 { margin:0; }
.preset-dialog pre { white-space:pre-wrap; overflow-wrap:anywhere; }
.preset-dialog .dialog-actions { display:flex; justify-content:flex-end; gap:12px; }
.preset-dialog .preset-field { display:grid; gap:8px; }
.preset-dialog .preset-field input,.preset-dialog .preset-field textarea { width:100%; box-sizing:border-box; }
.preset-picker-status:empty,.preset-picker-result:empty { display:none; }

/* Memo content fields are shared by platform presets and custom Memos. */
.memo-content-editor { display:flex; flex-direction:column; gap:16px; }
.preset-field { display:grid; gap:8px; min-width:0; }
.preset-field textarea { resize:vertical; min-height:90px; }
.preset-request { min-width:0; padding:16px; margin:16px 0; border:1px solid var(--line,#e5e7eb); border-radius:8px; display:grid; gap:12px; }
.preset-field input,.preset-field textarea { width:100%; box-sizing:border-box; font:inherit; font-weight:400; padding:10px 12px; border:1px solid var(--line,#e5e7eb); border-radius:6px; }
.preset-editor-section { display:grid; gap:14px; background:var(--panel); border:1px solid var(--line,#e5e7eb); border-radius:8px; padding:20px; min-width:0; }
.preset-editor-section h3,.preset-section-title { font-size:14px; font-weight:600; }
.preset-editor-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; min-width:0; }
.preset-grid-full { grid-column:1/-1; }
.preset-editor-section .preset-field { font-weight:600; }
.preset-editor-section .preset-field textarea { min-height:64px; }
.preset-editor-section .preset-field [name="analysisInstructions"] { min-height:144px; }
.preset-editor-section .library-filter { width:100%; }
.preset-page-section { display:block; }
.memo-content-editor .preset-page-section > summary { padding:0; cursor:pointer; }
.preset-page-section > summary > .help { float:right; margin:0; font-size:12px; font-weight:400; }
.preset-page-section[open] > summary { margin-bottom:16px; }
.preset-section-head { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.preset-editor-section > .help { margin:0; font-size:12px; }
.preset-requests .preset-request { margin:0 0 12px; padding:16px; background:var(--surface-soft,#fafbfc); }
.preset-requests .preset-request:last-child { margin-bottom:0; }
.preset-requests .preset-request > .btn { justify-self:end; }
.preset-editor-section .library-filter-button { font-weight:400; }
@media(max-width:600px) { .preset-editor-grid { grid-template-columns:minmax(0,1fr); }.preset-editor-section { padding:16px; }.preset-page-section > summary > .help { float:none; display:block; margin-top:6px; }.preset-section-head { flex-wrap:wrap; } }


/* Account appearance preference, shared across console and administration. */
:root[data-theme="dark"] {
  color-scheme:dark;
  --bg:#14171c;
  --panel:#1d222a;
  --paper:#1d222a;
  --ink:#e7eaf0;
  --muted:#a1aab9;
  --line:#343b48;
  --accent:#83aaff;
  --bad:#ff918b;
  --wash:#25334d;
  --hover:#2a313c;
  --selected:#283b5e;
  --surface-soft:#232a34;
}
.account-theme { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:12px; padding-top:12px; border-top:1px solid var(--line); }
.account-theme-choices { display:flex; gap:3px; padding:3px; background:var(--bg); border:1px solid var(--line); border-radius:7px; }
.account-theme-choices button { appearance:none; border:1px solid transparent; border-radius:5px; padding:5px 12px; font:inherit; color:var(--muted); background:transparent; cursor:pointer; }
.account-theme-choices button[aria-pressed="true"] { background:var(--panel); border-color:var(--line); color:var(--ink); box-shadow:0 1px 3px rgba(0,0,0,.08); }
.account-theme-choices button:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
:root[data-theme="dark"] :is(input,textarea,select) { color:var(--ink); background:var(--panel); }
:root[data-theme="dark"] .btn-primary { background:#366ee8; color:#fff; }
:root[data-theme="dark"] .btn-primary:hover { background:#447cf2; }
:root[data-theme="dark"] .nav-item.is-active { background:var(--hover); color:var(--ink); }
:root[data-theme="dark"] .account-avatar { background:var(--selected); }
:root[data-theme="dark"] .preset-meta-status { background:#303844; color:#c0c9d8; }
:root[data-theme="dark"] .preset-meta-status.is-published { background:#203e30; color:#8bd4a6; }
:root[data-theme="dark"] .preset-meta-status.is-draft { background:#443820; color:#edc675; }
:root[data-theme="dark"] .preset-meta-status.is-paused { background:#492b28; color:#ffa99b; }
:root[data-theme="dark"] .empty-state-illustration { opacity:.8; }

/* Shared modal shell; drawers retain their independent layout. */
.ui-dialog { width:min(640px,calc(100vw - 32px)); max-width:none; max-height:calc(100dvh - 32px); padding:0; overflow:hidden; border:1px solid var(--line); border-radius:10px; background:var(--panel); color:var(--ink); font:inherit; box-shadow:0 16px 48px rgba(0,0,0,.24); }
.ui-dialog[open] { display:flex; flex-direction:column; }
.ui-dialog-confirm { width:min(440px,calc(100vw - 32px)); }
.ui-dialog-form { width:min(520px,calc(100vw - 32px)); }
.ui-dialog::backdrop { background:rgba(16,20,28,.48); }
body:has(.ui-dialog[open]) { overflow:hidden; }
.ui-dialog-header { display:flex; align-items:center; justify-content:space-between; flex:none; gap:16px; padding:12px 20px; min-height:56px; border-bottom:1px solid var(--line); }
.ui-dialog-header h2 { margin:0; font-size:15px; font-weight:600; line-height:22px; }
.ui-dialog-header .btn { padding:6px 10px; font-size:13px; }
.ui-dialog-body { overflow:auto; min-height:0; padding:20px; overflow-wrap:anywhere; }
.ui-dialog-body h3 { margin:0 0 8px; font-size:13px; font-weight:600; }
.ui-dialog-body pre { white-space:pre-wrap; overflow-wrap:anywhere; }
.ui-dialog-body > .help:last-child { margin:16px 0 0; }
.ui-dialog-message { margin:0; line-height:1.7; }
.ui-dialog-footer { display:flex; justify-content:flex-end; align-items:center; flex-wrap:wrap; gap:8px; flex:none; padding:12px 20px; border-top:1px solid var(--line); background:var(--panel); }
.ui-dialog .preset-field { display:grid; gap:8px; }
.ui-dialog .preset-field input,.ui-dialog .preset-field textarea { width:100%; box-sizing:border-box; }
@media(max-width:480px) { .ui-dialog-header,.ui-dialog-footer { padding:12px 16px; }.ui-dialog-body { padding:16px; }.ui-dialog .admin-details { grid-template-columns:100px minmax(0,1fr); } }

.ui-dialog .admin-details { margin:0; }

/* Neutral input focus: no colored border, ring or shadow. */
:root { --input-focus: #f1f2f4; }
:root[data-theme="dark"] { --input-focus: #282e37; }
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus { outline: none !important; border-color: var(--line) !important; box-shadow: none !important; background-color: var(--input-focus); }
.library-search:focus-within { background: var(--input-focus); }
.library-search input:focus, #conversationMessage:focus { background: transparent; }
#conversationForm:focus-within { border-color: var(--line); box-shadow: none; background: var(--input-focus); }
dialog.dialog { inset: 0; width: min(640px, calc(100vw - 32px)); height: fit-content; max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible; }
dialog.dialog:not([open]) { display: none; }
dialog.dialog::backdrop { background: rgba(28,31,36,.45); }
dialog.dialog .dialog-panel { width: 100%; max-height: calc(100dvh - 32px); }
body:has(dialog.dialog[open]) { overflow: hidden; }

/* Account security uses shared form controls and layout tokens. */
.account-security .form { max-width: 440px; }
.account-security .module { max-width: 720px; }
.account-security hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

/* Shared accessible switch, themed for console and admin pages. */
.ui-switch { display: inline-flex; align-items: center; flex: 0 0 auto; width: 44px; height: 26px; padding: 3px; border: 1px solid var(--muted); border-radius: 99px; background: var(--hover); cursor: pointer; }
.ui-switch > span { width: 18px; height: 18px; border-radius: 50%; background: var(--muted); }
.ui-switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.ui-switch[aria-checked="true"] > span { transform: translateX(18px); background: var(--panel); }
.ui-switch:hover { box-shadow: 0 0 0 3px var(--selected); }
.ui-switch:active { opacity: .8; }
.ui-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ui-switch:disabled { opacity: .5; cursor: wait; }

/* Independent capture management reuses console controls and the shared dialog shell. */
.capture-actions,.capture-row-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.capture-notice { margin:0 0 20px; }
.capture-filters { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.capture-filters .library-search { flex:1 1 240px; }
.capture-filters > .library-filter { flex:0 1 200px; min-width:150px; }
.capture-table { width:100%; table-layout:fixed; border-collapse:collapse; font-size:13px; }
.capture-table th, .capture-table td { padding:14px 10px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; overflow-wrap:anywhere; }
.capture-table thead th { background:var(--hover); color:var(--muted); font-weight:500; }
.capture-table thead th:nth-child(1) { width:24%; }
.capture-table thead th:nth-child(2) { width:15%; }
.capture-table thead th:nth-child(3) { width:27%; }
.capture-table thead th:nth-child(4) { width:9%; }
.capture-table thead th:nth-child(5) { width:25%; }
.capture-table tbody tr:last-child > * { border-bottom:0; }
.capture-table tbody tr:hover { background:var(--hover); }
.capture-table .capture-name { font-weight:400; }
.capture-name-title { font-weight:600; font-size:14px; }
.capture-table .help, .capture-table .error { margin:6px 0 0; font-size:12px; }
.capture-description { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.capture-page-url { color:var(--muted); }
.capture-request-count { font-variant-numeric:tabular-nums; }
.capture-row-actions .btn { font-size:12px; white-space:nowrap; }
@media (max-width:760px) {
  .capture-table, .capture-table tbody, .capture-table tr { display:block; }
  .capture-table thead { display:none; }
  .capture-table tr { padding:12px 0; border-bottom:1px solid var(--line); }
  .capture-table tr:last-child { border-bottom:0; }
  .capture-table th, .capture-table td { display:block; border:0; padding:6px 0; }
  .capture-table td::before { content:attr(data-label); display:block; color:var(--muted); font-size:12px; margin-bottom:4px; }
}
.capture-page .library-filter-popover { max-width:calc(100vw - 64px); }
.ui-dialog-drawer { position:fixed; inset:0 0 0 auto; width:min(760px,100vw); height:100dvh; max-height:100dvh; margin:0; border-radius:0; }
.ui-dialog-drawer .ui-dialog-body { flex:1; }
.ui-dialog-drawer .library-filter { width:100%; }
.capture-form-error { margin:0 0 16px; }
@media(max-width:760px) {
  .capture-page .workspace-page-head { align-items:flex-start; flex-wrap:wrap; gap:12px; }
  .capture-actions { width:100%; }
  .capture-filters .library-search { flex-basis:100%; }
  .capture-filters > .library-filter { flex:1 1 120px; min-width:0; }
  .ui-dialog-drawer { width:100vw; border:0; }
}

.record-progress { border:1px solid var(--line); border-radius:10px; margin:0 0 20px; background:var(--panel); }
.record-progress-summary { display:flex; align-items:center; gap:12px; padding:16px; list-style:none; cursor:pointer; }
.record-progress-summary::-webkit-details-marker { display:none; }
.record-progress-summary:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:10px; }
.record-progress-state,.record-progress-elapsed { font-size:12px; color:var(--muted); }
.record-progress-elapsed { margin-left:auto; white-space:nowrap; }
.record-progress-chevron { color:var(--muted); }
.record-progress[open] .record-progress-chevron { transform:rotate(180deg); }
.record-progress-body { padding:0 16px 16px; }
.record-progress-phases { list-style:none; padding:0; margin:0 0 16px; display:flex; gap:8px; }
.record-progress-phases li { flex:1; border-top:3px solid var(--line); padding-top:8px; font-size:12px; color:var(--muted); }
.record-progress-phases .is-current { border-color:var(--accent); color:var(--accent); font-weight:600; }
.record-progress-phases .is-complete { border-color:var(--accent); }
.record-progress-events { list-style:none; margin:12px 0 0; padding:0; max-height:300px; overflow:auto; }
.record-progress-events li { display:flex; gap:12px; margin:8px 0; font-size:12px; line-height:1.6; }
.record-progress-events time { flex:none; color:var(--muted); }
.record-progress-events span,.record-progress-latest,.record-progress-notice { overflow-wrap:anywhere; }
@media(max-width:760px) { .record-progress-summary { padding:12px; gap:8px; flex-wrap:wrap; } .record-progress-body { padding:0 12px 12px; } }

.dashboard-guide-products { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
.dashboard-guide-products h3,.dashboard-method-preview h3 { font-size:14px; margin:0 0 8px; }
.dashboard-guide-products p { margin:0 0 14px; }
.dashboard-method-preview { padding:12px 0; border-bottom:1px solid var(--line); overflow-wrap:anywhere; }
.dashboard-method-preview:first-child { padding-top:0; }
.dashboard-method-preview:last-child { border-bottom:0; }
@media(max-width:760px) { .dashboard-guide-products { grid-template-columns:1fr; gap:20px; } }

.record-progress-wrapper { position: relative; }
.record-progress-wrapper .record-progress-summary { padding-right: 110px; flex-wrap: wrap; }
.record-progress-cancel { position: absolute; top: 10px; right: 12px; }

.dashboard-recent > .page-head { gap: 8px; }
.dashboard-recent > .page-head > a.btn { margin-left: auto; }

/* Overview actions share the existing empty-state accent treatment. */
#panel-dashboard :is(.btn, .btn-text) {
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--wash);
  color: var(--accent);
  border-color: transparent;
  text-decoration: none;
}
#panel-dashboard :is(.btn, .btn-text):hover {
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
  color: var(--accent);
}
#panel-dashboard :is(.btn, .btn-text):disabled { opacity: .55; cursor: default; }

.capture-pagination { justify-content:flex-end; flex-wrap:wrap; margin-top:16px; }
.capture-pagination .help { margin:0; font-size:12px; }

/* Main navigation pages share the outer shell spacing. */
.console-shell > .analysis-memos-workspace, .console-shell > .capture-page { max-width:none; margin:0; padding:0; }
