:root {
  --hq-sidebar: 280px;
  --hq-topbar: 76px;
  --hq-red: #a8322d;
  --hq-red-dark: #882521;
  --hq-red-soft: #f7eae9;
  --hq-red-soft-2: #fcf6f5;
  --hq-ink: #111827;
  --hq-text: #344054;
  --hq-muted: #697386;
  --hq-faint: #98a2b3;
  --hq-canvas: #f4f6f8;
  --hq-surface: #ffffff;
  --hq-surface-alt: #f8f9fb;
  --hq-line: #e3e7ec;
  --hq-line-strong: #d6dce3;
  --hq-green: #317a58;
  --hq-green-soft: #eaf5ee;
  --hq-blue: #3568a8;
  --hq-blue-soft: #eaf1f8;
  --hq-gold: #a66a18;
  --hq-gold-soft: #fff3da;
  --hq-danger: #b42318;
  --hq-danger-soft: #fcecea;
  --hq-radius: 8px;
  --hq-focus: 0 0 0 3px rgba(168, 50, 45, 0.14);
}

html:has(body.hq-app-page),
body.hq-app-page {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0 !important;
  overflow: hidden;
  background: var(--hq-canvas) !important;
}

body.hq-app-page,
body.hq-app-page button,
body.hq-app-page input,
body.hq-app-page textarea,
body.hq-app-page select {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif !important;
  letter-spacing: 0 !important;
}

body.hq-app-page * {
  box-sizing: border-box;
}

body.hq-app-page [hidden] {
  display: none !important;
}

body.hq-app-page a {
  color: inherit;
  text-decoration: none;
}

body.hq-app-page button,
body.hq-app-page input,
body.hq-app-page textarea,
body.hq-app-page select {
  font-size: inherit;
}

body.hq-app-page button {
  cursor: pointer;
  text-transform: none !important;
  box-shadow: none !important;
}

body.hq-app-page button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

body.hq-app-page :focus-visible {
  outline: 2px solid var(--hq-red) !important;
  outline-offset: 2px;
}

body.hq-app-page ::selection {
  color: var(--hq-ink);
  background: #f0cdca;
}

body.hq-app-page * {
  scrollbar-width: thin;
  scrollbar-color: #b7bec8 transparent;
}

body.hq-app-page *::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

body.hq-app-page *::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 10px;
  background: #b7bec8;
  background-clip: content-box;
}

.hq-app {
  position: relative;
  display: grid;
  grid-template-columns: var(--hq-sidebar) minmax(0, 1fr);
  grid-template-rows: var(--hq-topbar) minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  color: var(--hq-text);
  background: var(--hq-canvas);
  font-size: 15px;
  line-height: 1.5;
  transition: grid-template-columns 180ms ease-out;
}

.hq-topbar {
  position: relative;
  z-index: 50;
  grid-column: 1 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: var(--hq-sidebar) minmax(0, 1fr);
  min-width: 0;
  background: var(--hq-surface);
  border-bottom: 1px solid var(--hq-line);
  transition: grid-template-columns 180ms ease-out;
}

.hq-brand-zone,
.hq-topbar-main {
  display: flex;
  align-items: center;
  min-width: 0;
  height: var(--hq-topbar);
}

.hq-brand-zone {
  gap: 14px;
  padding: 0 22px;
}

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

.hq-brand-mark,
.hq-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.hq-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: #fff;
  background: var(--hq-red);
  font-size: 17px;
  font-weight: 800;
}

.hq-brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.hq-brand-copy strong {
  overflow: hidden;
  color: var(--hq-ink);
  font-size: 18px;
  font-weight: 750;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hq-brand-copy small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--hq-muted);
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hq-topbar-main {
  gap: 14px;
  padding: 0 26px;
}

.hq-icon-button,
.hq-mobile-menu {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--hq-muted);
  background: transparent !important;
  border: 0 !important;
  border-radius: 7px;
  transition: color 150ms ease-out, background 150ms ease-out;
}

.hq-icon-button:hover,
.hq-mobile-menu:hover {
  color: var(--hq-ink);
  background: var(--hq-surface-alt);
}

.hq-icon-button .dashicons,
.hq-mobile-menu .dashicons {
  width: 21px;
  height: 21px;
  font-size: 21px;
}

.hq-mobile-menu {
  display: none;
}

.hq-command {
  position: relative;
  display: flex;
  flex: 1 1 560px;
  align-items: center;
  max-width: 660px;
  min-width: 220px;
  height: 42px;
  color: var(--hq-muted);
  background: #f7f8fa;
  border: 1px solid var(--hq-line);
  border-radius: 8px;
}

.hq-command:focus-within {
  background: #fff;
  border-color: #c98b87;
  box-shadow: var(--hq-focus);
}

.hq-command > .dashicons {
  width: 20px;
  height: 20px;
  margin-left: 14px;
  font-size: 20px;
}

.hq-command input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 12px;
  color: var(--hq-ink);
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.hq-command input::placeholder {
  color: #8b95a5;
  opacity: 1;
}

.hq-command kbd,
.hq-knowledge-search kbd {
  margin-right: 10px;
  padding: 2px 7px;
  color: var(--hq-muted);
  background: #fff;
  border: 1px solid var(--hq-line-strong);
  border-radius: 5px;
  font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.hq-command-results {
  position: absolute;
  z-index: 80;
  top: calc(100% + 9px);
  left: 0;
  right: 0;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--hq-line);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(16, 24, 40, 0.14);
}

.hq-command-results a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: 6px;
}

.hq-command-results a:hover,
.hq-command-results a.is-current {
  background: var(--hq-surface-alt);
}

.hq-command-results a > .dashicons {
  color: var(--hq-red);
}

.hq-command-results a > span:last-child {
  display: flex;
  flex-direction: column;
  color: var(--hq-ink);
  font-size: 13px;
  font-weight: 650;
}

.hq-command-results small {
  color: var(--hq-muted);
  font-size: 11px;
  font-weight: 400;
}

.hq-org-switch,
.hq-profile-button {
  display: flex;
  align-items: center;
  color: var(--hq-text);
  background: transparent !important;
  border: 0 !important;
}

.hq-org-switch {
  min-width: 205px;
  gap: 10px;
  padding: 4px 6px;
  text-align: left;
  border-radius: 6px;
}

.hq-org-switch:hover,
.hq-profile-button:hover {
  background: var(--hq-surface-alt);
}

.hq-org-switch > .dashicons:first-child {
  color: var(--hq-ink);
}

.hq-org-switch > span:nth-child(2) {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.hq-org-switch strong {
  overflow: hidden;
  color: var(--hq-ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hq-org-switch small {
  color: var(--hq-muted);
  font-size: 11px;
}

.hq-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.hq-runtime {
  display: inline-flex;
  align-items: center;
  height: 34px;
  gap: 6px;
  padding: 0 10px;
  color: var(--hq-green);
  background: var(--hq-green-soft);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.hq-runtime .dashicons {
  width: 16px;
  height: 16px;
  font-size: 16px;
}

.hq-notification-button {
  position: relative;
}

.hq-notification-button i {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  background: var(--hq-red);
  border: 2px solid #fff;
  border-radius: 50%;
}

.hq-profile-button {
  gap: 8px;
  padding: 4px 6px;
  border-radius: 7px;
}

.hq-avatar {
  width: 34px;
  height: 34px;
  color: var(--hq-red-dark);
  background: var(--hq-red-soft);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 750;
}

.hq-avatar.is-blue { color: var(--hq-blue); background: var(--hq-blue-soft); }
.hq-avatar.is-green { color: var(--hq-green); background: var(--hq-green-soft); }
.hq-avatar.is-gold { color: var(--hq-gold); background: var(--hq-gold-soft); }

.hq-profile-name {
  max-width: 92px;
  overflow: hidden;
  color: var(--hq-ink);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hq-profile-button > .dashicons,
.hq-org-switch > .dashicons:last-child {
  width: 15px;
  height: 15px;
  font-size: 15px;
}

.hq-sidebar {
  position: relative;
  z-index: 30;
  grid-column: 1;
  grid-row: 2;
  display: flex;
  min-height: 0;
  flex-direction: column;
  background: var(--hq-surface);
  border-right: 1px solid var(--hq-line);
  overflow: hidden;
}

.hq-sidebar-inner {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 16px 24px;
}

.hq-new-task {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  gap: 9px;
  color: var(--hq-red-dark) !important;
  background: var(--hq-red-soft-2);
  border: 1px solid #dfb9b6;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 700;
  transition: color 150ms ease-out, background 150ms ease-out, border-color 150ms ease-out;
}

.hq-new-task:hover {
  color: #fff !important;
  background: var(--hq-red);
  border-color: var(--hq-red);
}

.hq-new-task .dashicons {
  width: 19px;
  height: 19px;
  font-size: 19px;
}

.hq-navigation {
  margin-top: 20px;
}

.hq-nav-group + .hq-nav-group {
  margin-top: 24px;
}

.hq-nav-label {
  margin: 0 10px 8px;
  color: var(--hq-faint);
  font-size: 11px;
  font-weight: 700;
}

.hq-nav-item {
  display: flex;
  align-items: center;
  height: 44px;
  gap: 12px;
  padding: 0 12px;
  color: #4b5565 !important;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  transition: color 150ms ease-out, background 150ms ease-out;
}

.hq-nav-item + .hq-nav-item {
  margin-top: 3px;
}

.hq-nav-item:hover {
  color: var(--hq-ink) !important;
  background: var(--hq-surface-alt);
}

.hq-nav-item.is-active {
  color: var(--hq-red-dark) !important;
  background: var(--hq-red-soft);
}

.hq-nav-item > .dashicons {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  font-size: 20px;
}

.hq-nav-text {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hq-nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  color: var(--hq-red-dark);
  background: #fff;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.hq-sidebar-footer {
  display: flex;
  align-items: center;
  min-height: 72px;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--hq-line);
}

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

.hq-avatar-small {
  width: 34px;
  height: 34px;
}

.hq-role > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hq-role strong {
  color: var(--hq-ink);
  font-size: 13px;
  font-weight: 700;
}

.hq-role small {
  color: var(--hq-muted);
  font-size: 11px;
}

.hq-sidebar-scrim {
  display: none;
}

.hq-main {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--hq-canvas);
}

.hq-page {
  width: 100%;
  max-width: 1600px;
  min-height: 100%;
  margin: 0 auto;
  padding: 38px 46px 64px;
}

.hq-page-heading {
  display: flex;
  align-items: flex-start;
  min-height: 80px;
  margin-bottom: 26px;
}

.hq-page-heading h1 {
  margin: 0;
  color: var(--hq-ink);
  font-size: 30px;
  line-height: 1.25;
  font-weight: 750;
}

.hq-page-heading p,
.hq-panel-header p,
.hq-section-heading p {
  margin: 6px 0 0;
  color: var(--hq-muted);
  font-size: 13px;
}

.hq-page-heading-actions {
  justify-content: space-between;
  gap: 28px;
}

.hq-heading-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hq-current-date {
  color: var(--hq-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hq-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  gap: 7px;
  padding: 0 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 150ms ease-out, background 150ms ease-out, border-color 150ms ease-out;
}

.hq-button .dashicons {
  width: 17px;
  height: 17px;
  font-size: 17px;
}

.hq-button-primary {
  color: #fff !important;
  background: var(--hq-red);
  border: 1px solid var(--hq-red);
}

.hq-button-primary:hover {
  background: var(--hq-red-dark);
  border-color: var(--hq-red-dark);
}

.hq-button-secondary {
  color: var(--hq-text) !important;
  background: #fff;
  border: 1px solid var(--hq-line-strong);
}

.hq-button-secondary:hover {
  color: var(--hq-ink) !important;
  background: var(--hq-surface-alt);
  border-color: #b9c1cb;
}

.hq-button-danger {
  color: var(--hq-danger) !important;
  background: #fff;
  border: 1px solid #e6aaa5;
}

.hq-button-danger:hover {
  background: var(--hq-danger-soft);
}

.hq-button-quiet {
  min-height: 34px;
  color: var(--hq-red-dark) !important;
  background: transparent;
  border: 0;
}

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

.hq-panel {
  background: var(--hq-surface);
  border: 1px solid var(--hq-line);
  border-radius: var(--hq-radius);
}

.hq-panel-header,
.hq-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 20px;
  padding: 17px 22px;
}

.hq-panel-header {
  border-bottom: 1px solid var(--hq-line);
}

.hq-panel-header h2,
.hq-section-heading h2 {
  margin: 0;
  color: var(--hq-ink);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 750;
}

.hq-panel-header a,
.hq-section-heading a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--hq-red-dark) !important;
  font-size: 12px;
  font-weight: 700;
}

.hq-focus-band {
  display: flex;
  align-items: center;
  min-height: 86px;
  gap: 15px;
  margin-bottom: 22px;
  padding: 17px 20px;
  background: var(--hq-red-soft-2);
  border-top: 1px solid #ead2cf;
  border-bottom: 1px solid #ead2cf;
}

.hq-focus-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--hq-red-dark);
  background: var(--hq-red-soft);
  border-radius: 7px;
}

.hq-focus-band > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.hq-focus-band strong {
  color: var(--hq-ink);
  font-size: 15px;
}

.hq-focus-band span:not(.hq-focus-icon):not(.dashicons) {
  margin-top: 3px;
  color: var(--hq-muted);
  font-size: 12px;
}

.hq-focus-band > a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--hq-red-dark) !important;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.hq-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.75fr);
  gap: 22px;
}

.hq-tabs {
  display: flex;
  align-items: center;
  min-height: 51px;
  gap: 4px;
  padding: 7px 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--hq-line);
}

.hq-tabs button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 34px;
  gap: 7px;
  padding: 0 11px;
  color: var(--hq-muted);
  background: transparent !important;
  border: 0 !important;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 650;
}

.hq-tabs button:hover {
  color: var(--hq-ink);
  background: var(--hq-surface-alt) !important;
}

.hq-tabs button.is-active {
  color: var(--hq-red-dark);
  background: var(--hq-red-soft) !important;
}

.hq-tabs button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  color: inherit;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.hq-task-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 18px;
  align-items: center;
  min-height: 92px;
  gap: 14px;
  padding: 15px 19px;
  border-bottom: 1px solid var(--hq-line);
  transition: background 150ms ease-out;
}

.hq-task-row:last-child {
  border-bottom: 0;
}

.hq-task-row:hover {
  background: var(--hq-surface-alt);
}

.hq-task-leading,
.hq-file-icon,
.hq-action-icon,
.hq-history-type,
.hq-review-kind,
.hq-document-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hq-task-leading {
  width: 40px;
  height: 40px;
  border-radius: 7px;
}

.hq-task-leading.is-warning { color: var(--hq-gold); background: var(--hq-gold-soft); }
.hq-task-leading.is-review { color: var(--hq-red-dark); background: var(--hq-red-soft); }
.hq-task-leading.is-info { color: var(--hq-blue); background: var(--hq-blue-soft); }
.hq-task-leading.is-success { color: var(--hq-green); background: var(--hq-green-soft); }

.hq-task-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hq-task-copy strong {
  overflow: hidden;
  color: var(--hq-ink);
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hq-task-copy small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--hq-muted);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hq-task-copy em {
  width: max-content;
  max-width: 100%;
  margin-top: 7px;
  padding: 2px 7px;
  overflow: hidden;
  color: var(--hq-gold);
  background: var(--hq-gold-soft);
  border-radius: 5px;
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hq-task-copy em.is-info { color: var(--hq-blue); background: var(--hq-blue-soft); }
.hq-task-copy em.is-success { color: var(--hq-green); background: var(--hq-green-soft); }

.hq-task-time {
  color: var(--hq-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.hq-task-row > .dashicons:last-child {
  color: var(--hq-faint);
}

.hq-action-list a {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 18px;
  align-items: center;
  min-height: 78px;
  gap: 13px;
  margin: 0 18px;
  border-bottom: 1px solid var(--hq-line);
}

.hq-action-list a:hover strong {
  color: var(--hq-red-dark);
}

.hq-action-icon {
  width: 40px;
  height: 40px;
  color: var(--hq-red-dark);
  background: var(--hq-red-soft);
  border-radius: 7px;
}

.hq-action-list a > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hq-action-list strong {
  color: var(--hq-ink);
  font-size: 13px;
  font-weight: 700;
  transition: color 150ms ease-out;
}

.hq-action-list small {
  margin-top: 2px;
  color: var(--hq-muted);
  font-size: 11px;
}

.hq-action-list > a > .dashicons:last-child {
  color: var(--hq-faint);
}

.hq-panel-status {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 68px;
  gap: 10px;
  padding: 12px 20px;
  background: var(--hq-surface-alt);
  border-radius: 0 0 var(--hq-radius) var(--hq-radius);
}

.hq-panel-status > .dashicons { color: var(--hq-green); }
.hq-panel-status > span:nth-child(2) { display: flex; flex-direction: column; }
.hq-panel-status strong { color: var(--hq-ink); font-size: 12px; }
.hq-panel-status small { color: var(--hq-muted); font-size: 11px; }
.hq-panel-status em { padding: 3px 7px; color: var(--hq-green); background: var(--hq-green-soft); border-radius: 5px; font-size: 11px; font-style: normal; }

.hq-section-block {
  margin-top: 32px;
}

.hq-section-heading {
  min-height: 68px;
  padding: 8px 0 13px;
}

.hq-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--hq-line);
  border-radius: var(--hq-radius);
}

.hq-table {
  width: 100%;
  min-width: 850px;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  table-layout: auto;
}

.hq-table thead {
  background: var(--hq-surface-alt);
}

.hq-table th,
.hq-table td {
  height: 58px;
  padding: 10px 16px;
  color: var(--hq-muted);
  border: 0;
  border-bottom: 1px solid var(--hq-line);
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
  white-space: nowrap;
}

.hq-table th {
  height: 42px;
  color: var(--hq-muted);
  font-size: 11px;
  font-weight: 700;
}

.hq-table tbody tr:last-child td {
  border-bottom: 0;
}

.hq-table tbody tr:hover {
  background: #fafbfc;
}

.hq-table td:first-child {
  min-width: 270px;
}

.hq-table td > a,
.hq-member {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hq-table td > a > span:last-child,
.hq-member > span:last-child {
  display: flex;
  flex-direction: column;
}

.hq-table td strong {
  color: var(--hq-ink);
  font-size: 12px;
}

.hq-table td small {
  margin-top: 2px;
  color: var(--hq-muted);
  font-size: 11px;
}

.hq-file-icon {
  width: 34px;
  height: 34px;
  color: var(--hq-red-dark);
  background: var(--hq-red-soft);
  border-radius: 6px;
}

.hq-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  height: 26px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.hq-status.is-success { color: var(--hq-green); background: var(--hq-green-soft); }
.hq-status.is-warning { color: var(--hq-gold); background: var(--hq-gold-soft); }
.hq-status.is-info { color: var(--hq-blue); background: var(--hq-blue-soft); }
.hq-status.is-danger { color: var(--hq-danger); background: var(--hq-danger-soft); }

/* Smart creation */
.hq-create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 24px;
}

.hq-intent-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.hq-intent-tabs button {
  display: flex;
  align-items: center;
  min-height: 84px;
  gap: 13px;
  padding: 14px 16px;
  color: var(--hq-text);
  text-align: left;
  background: #fff;
  border: 1px solid var(--hq-line);
  border-radius: 8px;
}

.hq-intent-tabs button:hover {
  border-color: #c4cad2;
}

.hq-intent-tabs button.is-active {
  color: var(--hq-red-dark);
  background: var(--hq-red-soft-2);
  border-color: #d8a7a3;
}

.hq-intent-tabs button > .dashicons {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  color: var(--hq-red-dark);
  font-size: 24px;
}

.hq-intent-tabs button > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hq-intent-tabs strong { color: var(--hq-ink); font-size: 13px; }
.hq-intent-tabs small { margin-top: 3px; color: var(--hq-muted); font-size: 11px; }

.hq-composer {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--hq-line-strong);
  border-radius: 8px;
}

.hq-composer:focus-within {
  border-color: #c17873;
  box-shadow: var(--hq-focus);
}

.hq-composer textarea {
  display: block;
  width: 100%;
  min-height: 178px;
  padding: 20px;
  resize: vertical;
  color: var(--hq-ink);
  background: #fff;
  border: 0;
  outline: 0 !important;
  box-shadow: none !important;
  font-size: 15px;
  line-height: 1.7;
}

.hq-composer textarea::placeholder {
  color: #98a2b3;
}

.hq-upload-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 16px 12px;
}

.hq-upload-list span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 230px;
  padding: 5px 8px;
  color: var(--hq-text);
  background: var(--hq-surface-alt);
  border: 1px solid var(--hq-line);
  border-radius: 5px;
  font-size: 11px;
}

.hq-upload-list span em {
  overflow: hidden;
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hq-composer-controls {
  display: flex;
  align-items: center;
  min-height: 64px;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--hq-line);
}

.hq-composer-tools {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.hq-tool-button,
.hq-policy-toggle,
.hq-select-control {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  height: 34px;
  gap: 6px;
  padding: 0 9px;
  color: var(--hq-text);
  background: transparent !important;
  border: 0 !important;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 650;
}

.hq-tool-button:hover,
.hq-select-control:hover {
  background: var(--hq-surface-alt);
}

.hq-policy-toggle.is-active {
  color: var(--hq-green);
  background: var(--hq-green-soft) !important;
}

.hq-segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--hq-surface-alt);
  border-radius: 7px;
}

.hq-segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  gap: 5px;
  padding: 0 9px;
  color: var(--hq-muted);
  background: transparent !important;
  border: 0 !important;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 650;
}

.hq-segmented button.is-active {
  color: var(--hq-ink);
  background: #fff !important;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.1);
}

.hq-select-control select {
  max-width: 80px;
  height: 28px;
  padding: 0 18px 0 0;
  color: var(--hq-text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12px;
  font-weight: 650;
  opacity: 1 !important;
  visibility: visible !important;
  appearance: auto !important;
}

.hq-submit-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: #fff;
  background: var(--hq-red);
  border: 0;
  border-radius: 50%;
}

.hq-submit-button:hover { background: var(--hq-red-dark); }
.hq-submit-button.is-loading { cursor: wait; opacity: 0.68; }

.hq-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 39px;
  gap: 16px;
  padding: 7px 16px;
  color: var(--hq-muted);
  background: var(--hq-surface-alt);
  border-top: 1px solid var(--hq-line);
  font-size: 11px;
}

.hq-composer-footer > span:first-child {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--hq-green);
}

.hq-inline-feedback {
  margin-top: 10px;
  padding: 10px 12px;
  color: var(--hq-green);
  background: var(--hq-green-soft);
  border-radius: 6px;
  font-size: 12px;
}

.hq-scenarios {
  margin-top: 26px;
}

.hq-scenario-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.hq-scenario-grid button {
  display: flex;
  align-items: center;
  min-height: 70px;
  gap: 9px;
  padding: 11px 12px;
  color: var(--hq-text);
  text-align: left;
  background: #fff;
  border: 1px solid var(--hq-line);
  border-radius: 7px;
}

.hq-scenario-grid button:hover {
  border-color: #c49a96;
  background: var(--hq-red-soft-2);
}

.hq-scenario-grid button > .dashicons {
  flex: 0 0 auto;
  color: var(--hq-red-dark);
}

.hq-scenario-grid button > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hq-scenario-grid strong { color: var(--hq-ink); font-size: 12px; }
.hq-scenario-grid small { margin-top: 2px; color: var(--hq-muted); font-size: 11px; }

.hq-create-history {
  overflow: hidden;
}

.hq-history-list a {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 78px;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--hq-line);
}

.hq-history-list a:hover { background: var(--hq-surface-alt); }

.hq-history-type {
  width: 38px;
  height: 38px;
  color: var(--hq-red-dark);
  background: var(--hq-red-soft);
  border-radius: 7px;
}

.hq-history-type.is-video { color: var(--hq-blue); background: var(--hq-blue-soft); }
.hq-history-type.is-image { color: var(--hq-green); background: var(--hq-green-soft); }
.hq-history-list a > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.hq-history-list strong { overflow: hidden; color: var(--hq-ink); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.hq-history-list small, .hq-history-list em { margin-top: 2px; color: var(--hq-muted); font-size: 11px; font-style: normal; }

.hq-create-note {
  display: flex;
  gap: 10px;
  margin: 18px;
  padding: 12px;
  color: var(--hq-blue);
  background: var(--hq-blue-soft);
  border-radius: 6px;
}

.hq-create-note p { display: flex; flex-direction: column; margin: 0; }
.hq-create-note strong { font-size: 11px; }
.hq-create-note span:last-child { margin-top: 2px; color: #58708e; font-size: 11px; }

/* Lists, review and tasks */
.hq-heading-stats {
  display: flex;
  align-items: center;
  gap: 24px;
}

.hq-heading-stats span {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--hq-muted);
  font-size: 12px;
}

.hq-heading-stats strong { color: var(--hq-ink); font-size: 22px; font-variant-numeric: tabular-nums; }
.hq-heading-stats span.is-warning strong { color: var(--hq-gold); }

.hq-list-toolbar {
  display: flex;
  align-items: center;
  min-height: 58px;
  gap: 10px;
  margin-bottom: 14px;
  padding: 7px 8px 7px 4px;
  background: #fff;
  border: 1px solid var(--hq-line);
  border-radius: 8px;
}

.hq-list-toolbar .hq-tabs {
  flex: 1;
  border: 0;
  padding: 0 4px;
}

.hq-filter-search {
  display: flex;
  align-items: center;
  width: 240px;
  height: 38px;
  gap: 7px;
  padding: 0 10px;
  color: var(--hq-muted);
  background: var(--hq-surface-alt);
  border: 1px solid var(--hq-line);
  border-radius: 7px;
}

.hq-filter-search:focus-within {
  background: #fff;
  border-color: #c98b87;
  box-shadow: var(--hq-focus);
}

.hq-filter-search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  color: var(--hq-ink);
  background: transparent;
  border: 0;
  outline: 0 !important;
  box-shadow: none !important;
  font-size: 12px;
}

.hq-filter-button {
  display: inline-flex;
  align-items: center;
  height: 38px;
  gap: 6px;
  padding: 0 11px;
  color: var(--hq-text);
  background: #fff;
  border: 1px solid var(--hq-line);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
}

.hq-filter-button:hover { background: var(--hq-surface-alt); }

.hq-review-list {
  overflow: hidden;
}

.hq-review-row {
  display: grid;
  grid-template-columns: 44px minmax(250px, 1.5fr) minmax(150px, 0.65fr) minmax(130px, 0.55fr) 18px;
  align-items: center;
  width: 100%;
  min-height: 104px;
  gap: 16px;
  padding: 17px 20px;
  color: var(--hq-text);
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--hq-line);
}

.hq-review-row:last-child { border-bottom: 0; }
.hq-review-row:hover, .hq-review-row.is-selected { background: #fafbfc; }

.hq-review-kind {
  width: 44px;
  height: 44px;
  color: var(--hq-red-dark);
  background: var(--hq-red-soft);
  border-radius: 7px;
}

.hq-review-kind.is-video { color: var(--hq-blue); background: var(--hq-blue-soft); }
.hq-review-kind.is-image { color: var(--hq-green); background: var(--hq-green-soft); }

.hq-review-main,
.hq-review-source,
.hq-review-deadline {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hq-review-main strong { overflow: hidden; color: var(--hq-ink); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.hq-review-main small { margin-top: 3px; overflow: hidden; color: var(--hq-muted); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.hq-review-main em { width: max-content; max-width: 100%; margin-top: 8px; padding: 2px 7px; overflow: hidden; color: var(--hq-gold); background: var(--hq-gold-soft); border-radius: 5px; font-size: 11px; font-style: normal; white-space: nowrap; text-overflow: ellipsis; }
.hq-review-main em.is-success { color: var(--hq-green); background: var(--hq-green-soft); }
.hq-review-source small, .hq-review-deadline small { color: var(--hq-muted); font-size: 11px; }
.hq-review-source strong, .hq-review-deadline strong { margin-top: 3px; color: var(--hq-text); font-size: 12px; }
.hq-review-deadline strong.is-warning { color: var(--hq-gold); }
.hq-review-deadline strong.is-danger { color: var(--hq-danger); }
.hq-review-row > .dashicons { color: var(--hq-faint); }

.hq-detail-drawer {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  display: flex;
  width: min(480px, 92vw);
  height: 100vh;
  flex-direction: column;
  background: #fff;
  box-shadow: -20px 0 50px rgba(16, 24, 40, 0.16);
  transform: translateX(105%);
  transition: transform 180ms ease-out;
}

.hq-detail-drawer.is-open { transform: translateX(0); }

.hq-detail-drawer > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 92px;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--hq-line);
}

.hq-detail-drawer h2 { margin: 0; color: var(--hq-ink); font-size: 18px; }
.hq-detail-drawer header p { margin: 5px 0 0; color: var(--hq-muted); font-size: 11px; }
.hq-detail-body { flex: 1; overflow-y: auto; padding: 4px 24px 24px; }
.hq-detail-body section { padding: 22px 0; border-bottom: 1px solid var(--hq-line); }
.hq-detail-body h3 { margin: 0 0 12px; color: var(--hq-ink); font-size: 13px; }
.hq-detail-body p { margin: 0; color: var(--hq-text); font-size: 12px; line-height: 1.8; }
.hq-risk-summary { display: flex; gap: 10px; padding: 12px; color: var(--hq-gold); background: var(--hq-gold-soft); border-radius: 6px; }
.hq-risk-summary p { display: flex; flex-direction: column; }
.hq-risk-summary strong { color: var(--hq-gold); font-size: 12px; }
.hq-risk-summary small { margin-top: 2px; color: #80633b; font-size: 11px; }
.hq-detail-body textarea { width: 100%; padding: 12px; resize: vertical; color: var(--hq-ink); background: #fff; border: 1px solid var(--hq-line-strong); border-radius: 7px; outline: 0; font-size: 12px; line-height: 1.7; }
.hq-detail-body textarea:focus { border-color: #c98b87; box-shadow: var(--hq-focus); }
.hq-detail-drawer > footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--hq-line); }

.hq-detail-scrim {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: none;
  background: rgba(17, 24, 39, 0.32);
}

.hq-detail-scrim.is-open { display: block; }

.hq-toast {
  position: fixed;
  z-index: 120;
  right: 28px;
  bottom: 28px;
  min-width: 260px;
  padding: 13px 16px;
  color: #fff;
  background: #26313b;
  border-radius: 7px;
  box-shadow: 0 14px 30px rgba(16, 24, 40, 0.22);
  font-size: 12px;
}

.hq-task-table .hq-table td:first-child { min-width: 330px; }

.hq-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 8px 14px;
  color: var(--hq-muted);
  border-top: 1px solid var(--hq-line);
  font-size: 11px;
}

.hq-table-footer > div { display: flex; gap: 4px; }
.hq-table-footer button { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 7px; color: var(--hq-muted); background: #fff; border: 1px solid var(--hq-line); border-radius: 5px; }
.hq-table-footer button.is-current { color: var(--hq-red-dark); background: var(--hq-red-soft); border-color: #dbafac; }

/* Factory */
.hq-factory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: start;
  gap: 24px;
}

.hq-generation-panel,
.hq-generation-queue {
  overflow: hidden;
}

.hq-engine-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--hq-green);
  font-size: 11px;
  font-weight: 650;
}

.hq-engine-status i {
  width: 7px;
  height: 7px;
  background: var(--hq-green);
  border-radius: 50%;
}

.hq-generation-body {
  padding: 20px 22px 10px;
}

.hq-field {
  margin-bottom: 20px;
}

.hq-field > label,
.hq-parameter-grid label > span {
  display: block;
  margin-bottom: 8px;
  color: var(--hq-ink);
  font-size: 12px;
  font-weight: 700;
}

.hq-segmented-wide {
  width: 100%;
}

.hq-segmented-wide button {
  flex: 1;
}

.hq-field textarea {
  width: 100%;
  padding: 13px 14px;
  resize: vertical;
  color: var(--hq-ink);
  background: #fff;
  border: 1px solid var(--hq-line-strong);
  border-radius: 7px;
  outline: 0;
  font-size: 13px;
  line-height: 1.7;
}

.hq-field textarea:focus { border-color: #c98b87; box-shadow: var(--hq-focus); }

.hq-field-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 6px;
  color: var(--hq-muted);
  font-size: 11px;
}

.hq-upload-zone {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 82px;
  gap: 12px;
  padding: 12px 14px;
  background: var(--hq-surface-alt);
  border: 1px dashed #bfc7d1;
  border-radius: 7px;
}

.hq-upload-zone > .dashicons { color: var(--hq-red-dark); font-size: 25px; }
.hq-upload-zone > span:nth-child(2) { display: flex; flex-direction: column; }
.hq-upload-zone strong { color: var(--hq-ink); font-size: 12px; }
.hq-upload-zone small { margin-top: 2px; color: var(--hq-muted); font-size: 11px; }
.hq-upload-zone button { height: 32px; padding: 0 10px; color: var(--hq-text); background: #fff; border: 1px solid var(--hq-line-strong); border-radius: 6px; font-size: 11px; font-weight: 650; }

.hq-parameter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.hq-parameter-grid label {
  min-width: 0;
}

.hq-parameter-grid select {
  display: block !important;
  width: 100%;
  height: 38px;
  padding: 0 9px;
  color: var(--hq-text);
  background: #fff;
  border: 1px solid var(--hq-line-strong);
  border-radius: 6px;
  font-size: 11px;
  opacity: 1 !important;
  visibility: visible !important;
  appearance: auto !important;
}

.hq-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0 4px;
  border-top: 1px solid var(--hq-line);
}

.hq-toggle-row > span { display: flex; flex-direction: column; }
.hq-toggle-row strong { color: var(--hq-ink); font-size: 12px; }
.hq-toggle-row small { margin-top: 2px; color: var(--hq-muted); font-size: 11px; }

.hq-switch {
  position: relative;
  width: 38px;
  height: 22px;
  padding: 2px;
  background: #c6ccd4;
  border: 0;
  border-radius: 12px;
  transition: background 150ms ease-out;
}

.hq-switch i {
  display: block;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.18);
  transition: transform 150ms ease-out;
}

.hq-switch[aria-checked="true"] { background: var(--hq-red); }
.hq-switch[aria-checked="true"] i { transform: translateX(16px); }

.hq-generation-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 20px;
  padding: 13px 22px;
  background: var(--hq-surface-alt);
  border-top: 1px solid var(--hq-line);
}

.hq-generation-footer > span { display: inline-flex; align-items: center; gap: 6px; color: var(--hq-green); font-size: 11px; }

.hq-queue-list {
  padding: 0 18px;
}

.hq-queue-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 13px;
  padding: 18px 0;
  border-bottom: 1px solid var(--hq-line);
}

.hq-video-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 64px;
  overflow: hidden;
  color: #fff;
  background: #374151;
  border-radius: 6px;
}

.hq-video-preview > .dashicons { width: 24px; height: 24px; font-size: 24px; }
.hq-video-preview > span:last-child { position: absolute; right: 5px; bottom: 4px; padding: 1px 4px; background: rgba(17, 24, 39, 0.72); border-radius: 3px; font-size: 11px; }
.hq-preview-red { background: #7f2f2a; }
.hq-preview-blue { background: #365e7e; }
.hq-preview-gray { background: #48515e; }

.hq-queue-copy { display: flex; flex-direction: column; min-width: 0; }
.hq-queue-copy > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hq-queue-copy strong { overflow: hidden; color: var(--hq-ink); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.hq-queue-copy small, .hq-queue-copy em { margin-top: 4px; color: var(--hq-muted); font-size: 11px; font-style: normal; }
.hq-progress { height: 5px; margin-top: 10px; overflow: hidden; background: #e5e9ee; border-radius: 3px; }
.hq-progress i { display: block; height: 100%; background: var(--hq-blue); border-radius: 3px; }

.hq-queue-all {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  gap: 5px;
  color: var(--hq-red-dark) !important;
  font-size: 11px;
  font-weight: 700;
}

/* Knowledge */
.hq-knowledge-search {
  display: flex;
  align-items: center;
  width: 100%;
  height: 56px;
  gap: 10px;
  margin-bottom: 20px;
  padding: 0 16px;
  color: var(--hq-muted);
  background: #fff;
  border: 1px solid var(--hq-line-strong);
  border-radius: 8px;
}

.hq-knowledge-search:focus-within { border-color: #c98b87; box-shadow: var(--hq-focus); }
.hq-knowledge-search > .dashicons { width: 22px; height: 22px; font-size: 22px; }
.hq-knowledge-search input { flex: 1; min-width: 0; height: 100%; padding: 0; color: var(--hq-ink); background: transparent; border: 0; outline: 0 !important; box-shadow: none !important; font-size: 14px; }
.hq-knowledge-search kbd { margin-right: 0; }

.hq-knowledge-layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

.hq-knowledge-categories {
  padding: 12px 0;
}

.hq-knowledge-categories h2 {
  margin: 0 12px 10px;
  color: var(--hq-ink);
  font-size: 13px;
}

.hq-knowledge-categories nav button {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  height: 44px;
  gap: 10px;
  padding: 0 12px;
  color: var(--hq-muted);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 7px;
}

.hq-knowledge-categories nav button:hover { color: var(--hq-ink); background: #fff; }
.hq-knowledge-categories nav button.is-active { color: var(--hq-red-dark); background: var(--hq-red-soft); }
.hq-knowledge-categories nav span { font-size: 12px; font-weight: 650; }
.hq-knowledge-categories nav em { font-size: 11px; font-style: normal; font-variant-numeric: tabular-nums; }

.hq-sync-summary {
  display: flex;
  gap: 9px;
  margin: 22px 9px 0;
  padding: 12px;
  color: var(--hq-green);
  background: var(--hq-green-soft);
  border-radius: 7px;
}

.hq-sync-summary p { display: flex; flex-direction: column; margin: 0; }
.hq-sync-summary strong { font-size: 11px; }
.hq-sync-summary small { margin-top: 2px; color: #547361; font-size: 11px; }

.hq-sort-control {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--hq-muted);
  font-size: 11px;
}

.hq-sort-control select { height: 32px; padding: 0 7px; color: var(--hq-text); background: #fff; border: 1px solid var(--hq-line); border-radius: 5px; font-size: 11px; }

.hq-document-list { overflow: hidden; }

.hq-document-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--hq-line);
}

.hq-document-row:last-child { border-bottom: 0; }
.hq-document-row:hover { background: #fafbfc; }
.hq-document-icon { width: 42px; height: 42px; color: var(--hq-blue); background: var(--hq-blue-soft); border-radius: 7px; }
.hq-document-icon.is-template { color: var(--hq-red-dark); background: var(--hq-red-soft); }
.hq-document-icon.is-review { color: var(--hq-green); background: var(--hq-green-soft); }
.hq-document-row h3 { margin: 0; color: var(--hq-ink); font-size: 14px; }
.hq-document-row p { max-width: 74ch; margin: 5px 0 9px; color: var(--hq-muted); font-size: 11px; line-height: 1.7; }
.hq-document-row footer { display: flex; flex-wrap: wrap; gap: 14px; color: var(--hq-faint); font-size: 11px; }

/* Assets */
.hq-asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.hq-asset-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--hq-line);
  border-radius: 8px;
  transition: border-color 150ms ease-out, transform 150ms ease-out;
}

.hq-asset-card:hover {
  border-color: #bdc4cd;
  transform: translateY(-2px);
}

.hq-asset-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  color: #fff;
  background: #44505d;
}

.hq-asset-preview > .dashicons { width: 40px; height: 40px; font-size: 40px; }
.hq-asset-preview > em { position: absolute; right: 10px; bottom: 9px; padding: 3px 6px; color: #fff; background: rgba(17, 24, 39, 0.72); border-radius: 4px; font-size: 11px; font-style: normal; }
.hq-asset-red { background: #7f302b; }
.hq-asset-blue { background: #365d79; }

.hq-document-preview,
.hq-poster-preview,
.hq-warning-preview {
  flex-direction: column;
  text-align: center;
}

.hq-document-preview { color: var(--hq-ink); background: #f0eee9; }
.hq-document-preview > .dashicons { width: 28px; height: 28px; margin-bottom: 10px; color: var(--hq-red-dark); font-size: 28px; }
.hq-document-preview strong { font-size: 15px; line-height: 1.5; }
.hq-document-preview small { margin-top: 8px; color: var(--hq-muted); font-size: 11px; }
.hq-poster-preview { align-items: flex-start; padding: 28px; text-align: left; background: #9b302b; }
.hq-poster-preview span { font-size: 11px; }
.hq-poster-preview strong { margin-top: 8px; font-size: 24px; line-height: 1.35; }
.hq-poster-preview small { margin-top: auto; font-size: 11px; }
.hq-warning-preview { background: #514942; }
.hq-warning-preview > .dashicons { width: 26px; height: 26px; margin-bottom: 8px; color: #f1c66e; font-size: 26px; }
.hq-warning-preview strong { color: #fff; font-size: 23px; line-height: 1.35; }
.hq-warning-preview small { margin-top: 7px; color: #e5d4b3; font-size: 11px; }

.hq-asset-copy { padding: 15px 16px 13px; }
.hq-asset-copy h2 { margin: 0; overflow: hidden; color: var(--hq-ink); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.hq-asset-copy p { margin: 4px 0 13px; color: var(--hq-muted); font-size: 11px; }
.hq-asset-copy footer { display: flex; align-items: center; gap: 9px; }
.hq-asset-copy time { margin-left: auto; color: var(--hq-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.hq-asset-copy .hq-icon-button { width: 30px; height: 30px; }

/* Organization */
.hq-org-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

.hq-org-tree,
.hq-member-panel {
  overflow: hidden;
}

.hq-org-tree nav { padding: 8px; }
.hq-org-tree nav button { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; width: 100%; min-height: 58px; gap: 9px; padding: 8px 10px; color: var(--hq-muted); text-align: left; background: transparent; border: 0; border-radius: 7px; }
.hq-org-tree nav button:hover { background: var(--hq-surface-alt); }
.hq-org-tree nav button.is-active { color: var(--hq-red-dark); background: var(--hq-red-soft); }
.hq-org-tree nav button > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.hq-org-tree nav strong { overflow: hidden; color: var(--hq-ink); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.hq-org-tree nav small { margin-top: 2px; color: var(--hq-muted); font-size: 11px; }
.hq-org-tree nav em { font-size: 11px; font-style: normal; }

.hq-member-panel .hq-panel-header .hq-filter-search { width: 210px; }

.hq-role-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--hq-line);
}

.hq-role-summary span { display: flex; align-items: center; justify-content: space-between; min-height: 58px; gap: 8px; padding: 10px 16px; border-right: 1px solid var(--hq-line); }
.hq-role-summary span:last-child { border-right: 0; }
.hq-role-summary strong { color: var(--hq-text); font-size: 11px; }
.hq-role-summary em { color: var(--hq-red-dark); font-size: 11px; font-style: normal; font-weight: 700; }

.hq-member-table { border: 0; border-radius: 0; }
.hq-member .hq-avatar { width: 34px; height: 34px; }

/* Popovers */
.hq-popover {
  position: fixed;
  z-index: 130;
  top: 66px;
  width: 330px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--hq-line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.16);
}

.hq-notification-popover { right: 92px; }
.hq-profile-popover { right: 24px; width: 220px; }
.hq-popover-heading { display: flex; align-items: center; justify-content: space-between; min-height: 52px; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--hq-line); }
.hq-popover-heading strong { color: var(--hq-ink); font-size: 12px; }
.hq-popover-heading span { color: var(--hq-muted); font-size: 11px; }
.hq-popover > a { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 14px; border-bottom: 1px solid var(--hq-line); }
.hq-popover > a:last-child { border-bottom: 0; }
.hq-popover > a:hover { background: var(--hq-surface-alt); }
.hq-popover > a > span:nth-child(2) { display: flex; flex-direction: column; }
.hq-popover > a strong { color: var(--hq-ink); font-size: 11px; }
.hq-popover > a small { margin-top: 2px; color: var(--hq-muted); font-size: 11px; }
.hq-status-dot { width: 8px; height: 8px; border-radius: 50%; }
.hq-status-dot.is-warning { background: var(--hq-gold); }
.hq-status-dot.is-success { background: var(--hq-green); }

/* Collapsed sidebar */
.hq-app.is-sidebar-collapsed {
  --hq-sidebar: 88px;
}

.hq-app.is-sidebar-collapsed .hq-brand-copy,
.hq-app.is-sidebar-collapsed .hq-new-task span:last-child,
.hq-app.is-sidebar-collapsed .hq-nav-label,
.hq-app.is-sidebar-collapsed .hq-nav-text,
.hq-app.is-sidebar-collapsed .hq-nav-count,
.hq-app.is-sidebar-collapsed .hq-role > span:last-child,
.hq-app.is-sidebar-collapsed .hq-sidebar-footer > .hq-icon-button {
  display: none;
}

.hq-app.is-sidebar-collapsed .hq-brand-zone {
  justify-content: center;
  gap: 8px;
  padding: 0 9px;
}

.hq-app.is-sidebar-collapsed .hq-brand {
  flex: 0 0 auto;
}

.hq-app.is-sidebar-collapsed .hq-brand-mark {
  width: 38px;
  height: 38px;
}

.hq-app.is-sidebar-collapsed .hq-sidebar-toggle {
  width: 30px;
}

.hq-app.is-sidebar-collapsed .hq-sidebar-inner {
  padding: 22px 14px;
}

.hq-app.is-sidebar-collapsed .hq-new-task,
.hq-app.is-sidebar-collapsed .hq-nav-item {
  width: 44px;
  margin-left: auto;
  margin-right: auto;
  padding: 0;
  justify-content: center;
}

.hq-app.is-sidebar-collapsed .hq-navigation {
  margin-top: 18px;
}

.hq-app.is-sidebar-collapsed .hq-nav-group + .hq-nav-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--hq-line);
}

.hq-app.is-sidebar-collapsed .hq-sidebar-footer {
  justify-content: center;
  padding: 12px;
}

.hq-app.is-sidebar-collapsed .hq-role {
  flex: 0 0 auto;
}

@media (max-width: 1380px) {
  :root { --hq-sidebar: 250px; }
  .hq-page { padding: 32px 32px 56px; }
  .hq-org-switch { min-width: 176px; }
  .hq-org-switch small { display: none; }
  .hq-runtime { display: none; }
  .hq-scenario-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hq-create-layout { grid-template-columns: minmax(0, 1fr) 310px; }
  .hq-factory-layout { grid-template-columns: minmax(0, 1fr) 350px; }
}

@media (max-width: 1120px) {
  .hq-command kbd,
  .hq-profile-name,
  .hq-profile-button > .dashicons { display: none; }
  .hq-org-switch { min-width: 44px; width: 44px; justify-content: center; padding: 0; }
  .hq-org-switch > span:nth-child(2),
  .hq-org-switch > .dashicons:last-child { display: none; }
  .hq-dashboard-grid,
  .hq-create-layout,
  .hq-factory-layout,
  .hq-org-layout { grid-template-columns: minmax(0, 1fr); }
  .hq-start-panel,
  .hq-create-history,
  .hq-generation-queue { max-width: none; }
  .hq-asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hq-parameter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hq-review-row { grid-template-columns: 44px minmax(260px, 1fr) minmax(140px, 0.55fr) 18px; }
  .hq-review-deadline { display: none; }
}

@media (max-width: 820px) {
  :root { --hq-topbar: 64px; }
  .hq-app { grid-template-columns: minmax(0, 1fr); }
  .hq-topbar { grid-template-columns: minmax(0, 1fr); }
  .hq-brand-zone { display: none; }
  .hq-topbar-main { padding: 0 14px; }
  .hq-mobile-menu { display: inline-flex; }
  .hq-command { max-width: none; flex-basis: auto; }
  .hq-command input { font-size: 12px; }
  .hq-org-switch { display: none; }
  .hq-sidebar { position: fixed; z-index: 80; top: 0; bottom: 0; left: 0; width: min(286px, 86vw); padding-top: 8px; border-right: 0; box-shadow: 18px 0 46px rgba(16, 24, 40, 0.18); transform: translateX(-105%); transition: transform 180ms ease-out; }
  .hq-app.is-mobile-nav-open .hq-sidebar { transform: translateX(0); }
  .hq-sidebar-scrim { position: fixed; z-index: 70; inset: 0; width: 100%; height: 100%; padding: 0; background: rgba(17, 24, 39, 0.34); border: 0; }
  .hq-app.is-mobile-nav-open .hq-sidebar-scrim { display: block; }
  .hq-main { grid-column: 1; }
  .hq-page { padding: 28px 20px 48px; }
  .hq-page-heading { min-height: 0; margin-bottom: 22px; }
  .hq-page-heading h1 { font-size: 25px; }
  .hq-page-heading-actions { align-items: flex-start; }
  .hq-heading-actions { align-items: flex-end; flex-direction: column-reverse; gap: 8px; }
  .hq-current-date { font-size: 11px; }
  .hq-focus-band { align-items: flex-start; }
  .hq-focus-band > a { align-self: center; }
  .hq-intent-tabs { grid-template-columns: 1fr; }
  .hq-intent-tabs button { min-height: 66px; }
  .hq-scenario-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hq-composer-controls { align-items: flex-end; }
  .hq-composer-tools { flex-wrap: wrap; }
  .hq-list-toolbar { align-items: stretch; flex-wrap: wrap; }
  .hq-list-toolbar .hq-tabs { width: 100%; order: 1; }
  .hq-list-toolbar .hq-filter-search { flex: 1; order: 2; }
  .hq-list-toolbar > .hq-icon-button,
  .hq-list-toolbar > .hq-filter-button { order: 2; }
  .hq-review-row { grid-template-columns: 40px minmax(0, 1fr) 18px; min-height: 96px; padding: 14px; }
  .hq-review-source { display: none; }
  .hq-review-main em { margin-top: 6px; }
  .hq-knowledge-layout { grid-template-columns: 1fr; }
  .hq-knowledge-categories nav { display: flex; gap: 6px; overflow-x: auto; }
  .hq-knowledge-categories nav button { flex: 0 0 auto; width: auto; padding: 0 10px; }
  .hq-knowledge-categories nav button .dashicons,
  .hq-knowledge-categories nav button em { display: none; }
  .hq-sync-summary { display: none; }
  .hq-role-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hq-role-summary span:nth-child(2) { border-right: 0; }
  .hq-role-summary span:nth-child(-n+2) { border-bottom: 1px solid var(--hq-line); }
}

@media (max-width: 560px) {
  .hq-topbar-main { gap: 7px; padding: 0 10px; }
  .hq-command { height: 40px; min-width: 0; }
  .hq-command > .dashicons { margin-left: 10px; }
  .hq-command input { padding: 0 8px; }
  .hq-profile-button { padding: 2px; }
  .hq-profile-button .hq-avatar { width: 32px; height: 32px; }
  .hq-notification-button { width: 34px; }
  .hq-top-actions { display: none; }
  .hq-page { padding: 24px 14px 42px; }
  .hq-page-heading-actions { flex-direction: column; gap: 14px; }
  .hq-heading-actions { width: 100%; align-items: flex-start; flex-direction: column-reverse; }
  .hq-heading-actions .hq-button,
  .hq-page-heading-actions > .hq-button { width: 100%; }
  .hq-heading-stats { align-self: stretch; justify-content: flex-start; }
  .hq-focus-band { display: grid; grid-template-columns: 38px minmax(0, 1fr); padding: 14px; }
  .hq-focus-band > a { grid-column: 2; justify-self: start; margin-top: 4px; }
  .hq-dashboard-grid { gap: 14px; }
  .hq-panel-header { min-height: 68px; padding: 14px 16px; }
  .hq-tabs { padding-left: 8px; padding-right: 8px; }
  .hq-task-row { grid-template-columns: 36px minmax(0, 1fr) 16px; gap: 10px; padding: 13px 14px; }
  .hq-task-leading { width: 36px; height: 36px; }
  .hq-task-time { display: none; }
  .hq-action-list a { margin: 0 14px; }
  .hq-section-block { margin-top: 24px; }
  .hq-create-layout { gap: 16px; }
  .hq-intent-tabs { gap: 8px; }
  .hq-composer textarea { min-height: 154px; padding: 16px; font-size: 14px; }
  .hq-composer-controls { padding: 9px 10px; }
  .hq-tool-button { padding: 0 6px; }
  .hq-policy-toggle { display: none; }
  .hq-select-control { margin-left: auto; }
  .hq-composer-footer > span:last-child { display: none; }
  .hq-scenario-grid { grid-template-columns: 1fr; }
  .hq-scenario-grid button { min-height: 62px; }
  .hq-list-toolbar .hq-tabs { overflow-x: auto; }
  .hq-filter-search { width: auto; }
  .hq-review-row { grid-template-columns: 36px minmax(0, 1fr) 16px; gap: 10px; }
  .hq-review-kind { width: 36px; height: 36px; }
  .hq-factory-layout { gap: 16px; }
  .hq-generation-body { padding: 16px 14px 8px; }
  .hq-upload-zone { grid-template-columns: 28px minmax(0, 1fr); }
  .hq-upload-zone button { grid-column: 2; width: max-content; }
  .hq-parameter-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .hq-generation-footer { align-items: flex-start; flex-direction: column; padding: 14px; }
  .hq-generation-footer .hq-button { width: 100%; }
  .hq-queue-list { padding: 0 14px; }
  .hq-knowledge-search { height: 50px; }
  .hq-knowledge-search kbd { display: none; }
  .hq-document-row { grid-template-columns: 38px minmax(0, 1fr); padding: 16px 14px; }
  .hq-document-icon { width: 38px; height: 38px; }
  .hq-document-row .hq-button { grid-column: 2; justify-self: start; }
  .hq-asset-grid { grid-template-columns: 1fr; gap: 14px; }
  .hq-asset-preview { aspect-ratio: 16 / 8; }
  .hq-member-panel .hq-panel-header { align-items: flex-start; flex-direction: column; }
  .hq-member-panel .hq-panel-header .hq-filter-search { width: 100%; }
  .hq-notification-popover { right: 10px; width: calc(100vw - 20px); }
  .hq-profile-popover { right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .hq-app,
  .hq-topbar,
  .hq-sidebar,
  .hq-detail-drawer,
  .hq-switch,
  .hq-switch i,
  .hq-asset-card {
    transition: none !important;
  }
}
