:root {
  --brand: #176bff;
  --brand-soft: #edf4ff;
  --brand-hover: #0d5ee8;
  --ink: #1f2733;
  --ink-secondary: #626d7c;
  --ink-muted: #929cab;
  --line: #e7ebf0;
  --surface: #ffffff;
  --canvas: #f5f7fa;
  --success: #15a66d;
  --rail-width: 88px;
  --sidebar-width: 300px;
  --header-height: 68px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(23, 107, 255, 0.42);
  outline-offset: 2px;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--rail-width) var(--sidebar-width) minmax(0, 1fr);
  width: 100%;
  height: 100%;
  background: var(--canvas);
  transition: grid-template-columns 180ms ease;
}

.global-rail {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: 1px 0 8px rgba(31, 39, 51, 0.02);
}

.brand {
  display: flex;
  height: 78px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.brand-mark,
.loading-logo {
  display: block;
  width: 34px;
  height: 34px;
}

.global-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  padding: 10px 9px;
  overflow-y: auto;
  scrollbar-width: none;
}

.global-nav::-webkit-scrollbar {
  display: none;
}

.global-nav-item {
  position: relative;
  display: flex;
  min-height: 63px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #667182;
  border-radius: 9px;
  font-size: 12px;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}

.global-nav-item:hover {
  color: var(--brand);
  background: #f5f8fd;
}

.global-nav-item.active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 650;
}

.global-nav-item.active::before {
  position: absolute;
  left: -9px;
  width: 3px;
  height: 24px;
  background: var(--brand);
  border-radius: 0 3px 3px 0;
  content: "";
}

.rail-bottom {
  margin: 8px 9px 0;
}

.user-entry {
  min-height: 58px;
  margin: 4px 9px 10px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.user-avatar {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #176bff, #37a9e6);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.user-menu {
  position: fixed;
  z-index: 130;
  bottom: 16px;
  left: 78px;
  width: 280px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 18px 48px rgba(25, 35, 50, 0.18);
}

.user-menu[hidden] {
  display: none;
}

.user-menu header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line-soft);
}

.user-menu header div {
  display: grid;
  gap: 3px;
}

.user-menu header small,
.user-menu dt {
  color: var(--ink-muted);
  font-size: 11px;
}

.user-menu dl {
  display: grid;
  gap: 9px;
  margin: 13px 0;
}

.user-menu dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.user-menu dd {
  margin: 0;
  overflow: hidden;
  color: var(--ink-secondary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu > button {
  display: flex;
  width: 100%;
  height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #d83b45;
  background: #fff8f8;
  border: 1px solid #f4d5d8;
  border-radius: 7px;
  cursor: pointer;
}

.user-menu > button svg {
  width: 16px;
  height: 16px;
}

.legacy-switch {
  min-height: 54px;
  margin: 4px 9px 12px;
  color: #5e6a7a;
  background: #f7f9fc;
  border: 1px solid #edf0f4;
}

.project-sidebar {
  position: relative;
  z-index: 20;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: visible;
  background: var(--surface);
  border-right: 1px solid var(--line);
  transition: opacity 160ms ease, transform 180ms ease;
}

.report-navigation,
.tool-navigation {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.report-navigation[hidden],
.tool-navigation[hidden] {
  display: none;
}

.tool-heading {
  display: grid;
  min-height: 76px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}

.tool-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #176bff, #6f94ff);
  border-radius: 10px;
  box-shadow: 0 5px 14px rgba(23, 107, 255, 0.18);
  font-size: 13px;
  font-weight: 700;
}

.tool-heading > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.tool-heading strong {
  font-size: 15px;
  font-weight: 650;
}

.tool-heading small {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-section-label {
  padding: 18px 18px 8px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.tool-menu {
  min-height: 0;
  flex: 1;
  padding: 0 10px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: #dfe4eb transparent;
  scrollbar-width: thin;
}

.tool-menu-item {
  display: grid;
  width: 100%;
  min-height: 42px;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  color: var(--ink-secondary);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
}

.tool-menu-item:hover,
.tool-menu-item.active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 620;
}

.tool-menu-item svg {
  width: 18px;
}

.tool-navigation .sidebar-footer {
  flex: none;
  justify-content: flex-end;
}

.project-heading {
  position: relative;
  padding: 13px 14px 9px;
  border-bottom: 1px solid #f0f2f5;
}

.project-picker {
  display: grid;
  width: 100%;
  min-height: 52px;
  grid-template-columns: 38px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.project-picker:hover {
  background: #f6f8fb;
}

.project-picker > svg {
  width: 17px;
  color: var(--ink-muted);
  transition: transform 160ms ease;
}

.project-picker[aria-expanded="true"] > svg {
  transform: rotate(180deg);
}

.project-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #176bff, #6f94ff);
  border-radius: 9px;
  box-shadow: 0 5px 14px rgba(23, 107, 255, 0.2);
  font-size: 15px;
  font-weight: 700;
}

.project-picker-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.project-picker-copy strong,
.project-picker-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-picker-copy strong {
  font-size: 15px;
  font-weight: 650;
}

.project-picker-copy small {
  color: var(--ink-muted);
  font-size: 11px;
}

.project-menu {
  position: absolute;
  z-index: 80;
  top: 70px;
  right: 14px;
  left: 14px;
  max-height: min(520px, calc(100vh - 100px));
  padding: 6px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 44px rgba(37, 47, 66, 0.16);
}

.project-menu[hidden] {
  display: none;
}

.project-option {
  display: grid;
  width: 100%;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 8px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
}

.project-option:hover,
.project-option.selected {
  background: var(--brand-soft);
}

.project-option-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--brand);
  background: #fff;
  border: 1px solid #dbe7ff;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
}

.project-option span:nth-child(2) {
  overflow: hidden;
  font-size: 13px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-option small {
  color: var(--ink-muted);
  font-size: 11px;
}

.sidebar-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.sidebar-tab {
  position: relative;
  height: 44px;
  color: var(--ink-secondary);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 13px;
}

.sidebar-tab.active {
  color: var(--brand);
  font-weight: 650;
}

.sidebar-tab.active::after {
  position: absolute;
  right: 25%;
  bottom: -1px;
  left: 25%;
  height: 2px;
  background: var(--brand);
  border-radius: 2px 2px 0 0;
  content: "";
}

.report-search {
  position: relative;
  display: flex;
  align-items: center;
  margin: 14px;
}

.report-search > svg {
  position: absolute;
  left: 10px;
  width: 17px;
  color: #9ba5b3;
  pointer-events: none;
}

.report-search input {
  width: 100%;
  height: 36px;
  padding: 0 37px 0 34px;
  color: var(--ink);
  background: #f7f9fb;
  border: 1px solid #edf0f4;
  border-radius: 7px;
  font-size: 13px;
  outline: none;
  transition: border 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.report-search input:focus {
  background: #fff;
  border-color: #8ab5ff;
  box-shadow: 0 0 0 3px rgba(23, 107, 255, 0.08);
}

.report-search kbd {
  position: absolute;
  right: 9px;
  min-width: 20px;
  padding: 2px 5px;
  color: var(--brand);
  background: #eaf2ff;
  border: 0;
  border-radius: 9px;
  font-size: 10px;
  text-align: center;
}

.report-tree {
  flex: 1;
  padding: 0 10px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: #dfe4eb transparent;
  scrollbar-width: thin;
}

.tree-folder {
  margin-bottom: 3px;
}

.folder-toggle {
  display: grid;
  width: 100%;
  min-height: 38px;
  grid-template-columns: 18px 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  color: #485365;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
}

.folder-toggle:hover {
  background: #f5f7fa;
}

.folder-toggle .chevron {
  width: 15px;
  transition: transform 140ms ease;
}

.folder-toggle .folder-icon {
  width: 18px;
  color: #718096;
}

.folder-toggle strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-toggle small {
  color: #9ba5b3;
  font-size: 11px;
}

.tree-folder.collapsed .folder-toggle .chevron {
  transform: rotate(-90deg);
}

.tree-folder.collapsed .folder-reports {
  display: none;
}

.folder-reports {
  position: relative;
  margin: 1px 0 5px 28px;
  padding-left: 7px;
}

.folder-reports::before {
  position: absolute;
  top: 1px;
  bottom: 3px;
  left: 0;
  width: 1px;
  background: #edf0f4;
  content: "";
}

.report-link {
  display: grid;
  width: 100%;
  min-height: 36px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
  padding: 6px 7px;
  color: #576273;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}

.report-link:hover {
  color: var(--brand);
  background: #f4f8ff;
}

.report-link.active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 620;
}

.report-link svg {
  width: 16px;
  color: currentColor;
}

.report-link span {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-link small {
  color: #a4adba;
  font-size: 10px;
}

.tree-empty {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 30px;
  color: var(--ink-muted);
  text-align: center;
}

.tree-empty svg {
  width: 34px;
  height: 34px;
  opacity: 0.55;
}

.tree-empty strong {
  color: var(--ink-secondary);
  font-size: 13px;
}

.tree-empty small {
  font-size: 11px;
  line-height: 1.6;
}

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

.sidebar-footer button,
.workspace-actions button,
.mobile-menu {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #697586;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
}

.sidebar-footer button:hover,
.workspace-actions button:hover,
.mobile-menu:hover {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: #dce8ff;
}

.sidebar-footer svg,
.workspace-actions svg,
.mobile-menu svg {
  width: 18px;
}

.report-workspace {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: var(--header-height) minmax(0, 1fr);
  overflow: hidden;
}

.system-home {
  min-width: 0;
  min-height: 0;
  padding: 34px 40px 48px;
  overflow-y: auto;
  background: var(--canvas);
}

.system-home[hidden] {
  display: none;
}

body.system-home-view .app-shell {
  grid-template-columns: var(--rail-width) 0 minmax(0, 1fr);
}

body.system-home-view .project-sidebar,
body.system-home-view .workspace-header,
body.system-home-view .report-stage {
  display: none;
}

body.system-home-view .report-workspace {
  grid-column: 2 / -1;
  grid-template-rows: minmax(0, 1fr);
}

.system-home-header {
  display: flex;
  max-width: 1440px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin: 0 auto 28px;
}

.system-home-eyebrow {
  margin-bottom: 9px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.system-home-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 680;
  letter-spacing: -0.03em;
}

.system-home-header p {
  margin: 10px 0 0;
  color: var(--ink-muted);
  font-size: 14px;
}

.home-view-tabs {
  display: flex;
  max-width: 1440px;
  gap: 6px;
  margin: 0 auto 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.home-view-tabs button {
  height: 36px;
  padding: 0 17px;
  color: var(--ink-secondary);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 620;
}

.home-view-tabs button.active {
  color: var(--brand);
  background: var(--brand-soft);
}

.system-home-actions,
.system-modal-card footer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-action,
.secondary-action,
.danger-action,
.icon-action {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 620;
}

.primary-action {
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
}

.primary-action:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.secondary-action {
  color: #4f5b6d;
  background: #fff;
  border: 1px solid #dfe5ec;
}

.secondary-action:hover {
  color: var(--brand);
  border-color: #9bbdff;
}

.danger-action {
  color: #d83b45;
  background: #fff;
  border: 1px solid #f2c8cc;
}

.primary-action svg,
.secondary-action svg {
  width: 17px;
  height: 17px;
}

.system-home-toolbar {
  display: flex;
  max-width: 1440px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto 18px;
}

.system-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 620;
}

.system-switcher select,
.system-modal-card select {
  height: 40px;
  min-width: 220px;
  padding: 0 34px 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  outline: none;
}

.system-edit {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--ink-muted);
  background: #fff;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  cursor: pointer;
}

.system-edit:hover {
  color: var(--brand);
  border-color: #9bbdff;
}

.system-edit svg {
  width: 17px;
  height: 17px;
}

.system-home-toolbar > span {
  color: var(--ink-muted);
  font-size: 12px;
}

.home-filters {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
}

.home-filters > select {
  height: 40px;
  min-width: 180px;
  padding: 0 34px 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
}

.system-search {
  position: relative;
  display: flex;
  width: min(420px, 100%);
  align-items: center;
}

.system-search svg {
  position: absolute;
  left: 13px;
  width: 17px;
  color: #99a4b2;
  pointer-events: none;
}

.system-search input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 39px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #e1e6ed;
  border-radius: 8px;
  outline: none;
}

.system-search input:focus {
  border-color: #91b7ff;
  box-shadow: 0 0 0 3px rgba(23, 107, 255, 0.08);
}

.system-grid {
  display: grid;
  max-width: 1440px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  margin: 0 auto;
}

.system-grid.dashboard-list-mode {
  grid-template-columns: 1fr;
  gap: 10px;
}

.dashboard-list-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.dashboard-list-item:hover {
  border-color: #cddcff;
  box-shadow: 0 6px 18px rgba(31, 64, 124, 0.06);
}

.dashboard-list-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 8px;
}

.dashboard-list-icon svg {
  width: 19px;
  height: 19px;
}

.dashboard-list-item h2 {
  margin: 0 0 5px;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 640;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-list-item p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 12px;
}

.system-card {
  position: relative;
  min-height: 188px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 3px 14px rgba(31, 39, 51, 0.04);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.system-card:hover {
  border-color: #cddcff;
  box-shadow: 0 8px 24px rgba(31, 64, 124, 0.08);
  transform: translateY(-1px);
}

.system-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.system-card-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #176bff, #6f94ff);
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
}

.system-card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.system-manage,
.system-delete {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #7b8797;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.system-manage:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.system-delete:hover {
  color: #d83b45;
  background: #fff1f2;
}

.system-manage svg,
.system-delete svg {
  width: 17px;
  height: 17px;
}

.system-card h2 {
  margin: 16px 0 6px;
  font-size: 16px;
  font-weight: 650;
}

.system-card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-muted);
  font-size: 12px;
}

.system-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid #f0f2f5;
}

.system-card-footer span {
  color: var(--ink-secondary);
  font-size: 12px;
}

.system-open {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--brand);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 620;
}

.system-open svg {
  width: 15px;
}

.system-empty {
  grid-column: 1 / -1;
  padding: 70px 24px;
  color: var(--ink-muted);
  background: #fff;
  border: 1px dashed #dce2ea;
  border-radius: 10px;
  text-align: center;
}

.home-pagination {
  display: flex;
  max-width: 1440px;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin: 20px auto 0;
}

.home-page-size,
.home-page-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.home-page-size {
  margin-right: 6px;
  color: var(--ink-muted);
  font-size: 12px;
}

.home-page-size select {
  height: 34px;
  padding: 0 28px 0 10px;
  color: var(--ink-secondary);
  background: #fff;
  border: 1px solid #dfe5ec;
  border-radius: 7px;
}

.home-pagination button {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  color: var(--ink-secondary);
  background: #fff;
  border: 1px solid #dfe5ec;
  border-radius: 7px;
  cursor: pointer;
}

.home-pagination button.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.home-pagination button:disabled {
  color: #b8c0cc;
  background: #f6f8fa;
  cursor: not-allowed;
}

.system-modal {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.system-modal[hidden] {
  display: none;
}

.system-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 27, 38, 0.42);
  backdrop-filter: blur(2px);
}

.system-modal-card {
  position: relative;
  display: grid;
  width: min(480px, 100%);
  gap: 18px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(25, 35, 50, 0.2);
}

.system-modal-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.system-modal-card h2 {
  margin: 0;
  font-size: 18px;
}

.system-modal-card header p {
  margin: 7px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
}

.icon-action {
  width: 32px;
  min-height: 32px;
  padding: 0;
  color: #7a8595;
  background: transparent;
  border: 0;
}

.system-modal-card > label {
  display: grid;
  gap: 8px;
  color: #4f5a6a;
  font-size: 13px;
  font-weight: 600;
}

.system-modal-card > label input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #dfe5ec;
  border-radius: 7px;
  outline: none;
  font-weight: 400;
}

.system-modal-card > label input:focus {
  border-color: #91b7ff;
  box-shadow: 0 0 0 3px rgba(23, 107, 255, 0.08);
}

.system-modal-card footer {
  grid-template-columns: auto 1fr auto auto;
  padding-top: 3px;
}

.workspace-header {
  position: relative;
  z-index: 10;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 20px 0 22px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 5px rgba(27, 35, 47, 0.02);
}

.workspace-title-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.workspace-title-group > div {
  min-width: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #9aa4b2;
  font-size: 10px;
  line-height: 1;
}

.breadcrumb i {
  font-style: normal;
}

.workspace-title-group h1 {
  max-width: min(620px, 47vw);
  margin: 5px 0 0;
  overflow: hidden;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  color: var(--success);
  background: #effaf6;
  border: 1px solid #d6f1e7;
  border-radius: 14px;
  font-size: 11px;
}

.status-pill[hidden] {
  display: none !important;
}

.status-pill i {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(21, 166, 109, 0.1);
}

.workspace-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
}

.workspace-actions button.is-favorite {
  color: #f7a928;
}

.workspace-actions button[hidden] {
  display: none !important;
}

.workspace-actions button.is-favorite svg {
  fill: currentColor;
}

.workspace-actions .complete-mode {
  display: inline-grid;
  width: auto;
  grid-auto-flow: column;
  grid-template-columns: 18px auto;
  gap: 6px;
  padding: 0 11px;
}

.complete-mode span {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.mobile-menu {
  display: none;
}

.report-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  margin: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e9edf2;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(32, 45, 62, 0.04);
}

body.tool-view .report-stage {
  margin: 0;
  background: var(--canvas);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#report-frame {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  border: 0;
}

.project-empty {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-secondary);
  background: #fff;
}

.project-empty[hidden] {
  display: none;
}

.project-empty > svg {
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  color: var(--brand);
}

.project-empty h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 18px;
}

.project-empty p {
  margin: 0 0 22px;
  color: var(--ink-muted);
  font-size: 13px;
}

.frame-loading {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-secondary);
  background: #fff;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.frame-loading.hidden {
  visibility: hidden;
  opacity: 0;
}

.frame-loading .loading-logo {
  margin-bottom: 6px;
  animation: loading-breathe 1.4s ease-in-out infinite;
}

.frame-loading strong {
  font-size: 14px;
  font-weight: 600;
}

.frame-loading small {
  color: var(--ink-muted);
  font-size: 11px;
}

@keyframes loading-breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.6; }
  50% { transform: scale(1.05); opacity: 1; }
}

.mobile-backdrop {
  position: fixed;
  z-index: 15;
  inset: 0;
  display: none;
  background: rgba(20, 28, 40, 0.36);
  backdrop-filter: blur(2px);
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 11px 15px;
  color: #fff;
  background: rgba(31, 39, 51, 0.94);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(19, 29, 43, 0.2);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

body.nav-collapsed .app-shell {
  grid-template-columns: var(--rail-width) 0 minmax(0, 1fr);
}

body.nav-collapsed .project-sidebar {
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-12px);
}

body.nav-collapsed .mobile-menu {
  display: grid;
}

@media (max-width: 980px) {
  :root {
    --rail-width: 72px;
    --sidebar-width: 286px;
  }

  .global-nav-item {
    min-height: 58px;
  }

  .workspace-title-group h1 {
    max-width: 44vw;
  }
}

@media (max-width: 760px) {
  :root {
    --rail-width: 0px;
    --header-height: 61px;
  }

  .app-shell,
  body.nav-collapsed .app-shell {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .global-rail {
    display: none;
  }

  .project-sidebar {
    position: fixed;
    z-index: 25;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 320px);
    box-shadow: 10px 0 30px rgba(26, 35, 48, 0.16);
    transform: translateX(-105%);
  }

  body.mobile-nav-open .project-sidebar,
  body.nav-collapsed.mobile-nav-open .project-sidebar {
    overflow: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }

  body.mobile-nav-open .mobile-backdrop {
    display: block;
  }

  .mobile-menu,
  body.nav-collapsed .mobile-menu {
    display: grid;
  }

  .workspace-header {
    padding: 0 10px;
  }

  .workspace-title-group {
    gap: 7px;
  }

  .workspace-title-group h1 {
    max-width: 48vw;
    margin-top: 3px;
    font-size: 15px;
  }

  .breadcrumb {
    display: none;
  }

  .status-pill {
    display: none;
  }

  .workspace-actions button:first-child {
    display: none;
  }

  .workspace-actions .complete-mode {
    width: 34px;
    grid-template-columns: 18px;
    padding: 0;
  }

  .complete-mode span {
    display: none;
  }

  .report-stage {
    margin: 6px;
    border-radius: 6px;
  }

  .system-home {
    padding: 24px 16px 36px;
  }

  .system-home-header {
    flex-direction: column;
    gap: 20px;
  }

  .system-home-actions,
  .system-home-actions button,
  .system-search {
    width: 100%;
  }

  .system-home-actions button {
    flex: 1;
  }

  .system-home-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .system-grid {
    grid-template-columns: 1fr;
  }

  .system-modal-card footer {
    grid-template-columns: 1fr 1fr;
  }

  .system-modal-card footer > span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
