:root {
  --bg: #f2f4f0;
  --surface: #ffffff;
  --surface-soft: #f8f9f6;
  --surface-strong: #e8ece5;
  --ink: #19211c;
  --ink-soft: #5d685f;
  --ink-faint: #849087;
  --line: #d9dfd8;
  --line-strong: #c5cec5;
  --green: #1d6b52;
  --green-deep: #134e3c;
  --green-soft: #e3f0e9;
  --amber: #a96018;
  --amber-soft: #faecd8;
  --red: #b8473e;
  --red-soft: #f9e7e4;
  --blue: #326a8d;
  --blue-soft: #e6eff5;
  --shadow: 0 10px 28px rgba(28, 38, 31, 0.08);
  --radius: 8px;
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(25, 33, 28, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 33, 28, 0.028) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(29, 107, 82, 0.38);
  outline-offset: 2px;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.app-header {
  min-height: 76px;
  padding: 12px 22px;
  display: grid;
  grid-template-columns: minmax(290px, 1fr) auto minmax(290px, 1fr);
  align-items: center;
  gap: 20px;
  background: rgba(250, 251, 248, 0.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid #bcd1c6;
  background: var(--green-soft);
  color: var(--green);
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.brand-mark .icon {
  width: 25px;
  height: 25px;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.13em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 3px 0 0;
  font-size: 19px;
  line-height: 1.15;
  letter-spacing: 0;
}

.main-tabs {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  background: #eef1ec;
  gap: 2px;
}

.tab-button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  min-height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.tab-button:hover {
  color: var(--ink);
}

.tab-button.is-active {
  background: var(--surface);
  color: var(--green-deep);
  box-shadow: 0 1px 4px rgba(24, 34, 27, 0.1);
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.button,
.icon-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 7px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.button:hover,
.icon-button:hover {
  background: var(--surface-soft);
  border-color: #aebbb0;
}

.button:active,
.icon-button:active {
  transform: translateY(1px);
}

.button {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

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

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

.button-danger {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.button-danger:hover {
  color: #fff;
  background: #97352f;
  border-color: #97352f;
}

.button-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
}

.button-ghost:hover {
  background: var(--surface-strong);
  border-color: transparent;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: var(--ink-soft);
}

.workspace {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: clamp(320px, 19vw, 356px) minmax(0, 1fr);
}

.library-panel {
  min-height: calc(100vh - 76px);
  padding: 20px 14px 14px;
  border-right: 1px solid var(--line);
  background: rgba(248, 249, 246, 0.78);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
}

.project-section {
  min-height: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-heading,
.library-heading {
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.project-heading-toggle {
  min-width: 0;
  padding: 2px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}

.project-heading-toggle:hover {
  background: var(--surface-strong);
}

.project-heading-copy {
  min-width: 0;
}

.project-heading-title,
.library-heading h2 {
  display: block;
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
}

.section-chevron {
  width: 14px;
  height: 14px;
  color: var(--ink-faint);
  transform: rotate(90deg);
  transition: transform 150ms ease;
}

.project-section.is-collapsed {
  gap: 0;
  padding-bottom: 8px;
}

.project-section.is-collapsed .section-chevron {
  transform: rotate(0);
}

.project-heading .icon-button {
  width: 31px;
  height: 31px;
}

.project-list {
  max-height: 188px;
  padding: 1px 3px 2px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  scrollbar-width: thin;
}

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

.project-card {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.58);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.project-card:hover {
  border-color: #aebbb0;
  background: rgba(255, 255, 255, 0.86);
}

.project-card.is-active {
  border-color: #83a898;
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--green);
}

.project-select {
  min-width: 0;
  min-height: 50px;
  padding: 7px 5px 7px 10px;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  text-align: left;
  cursor: pointer;
  flex: 1;
}

.project-select > .icon {
  width: 17px;
  height: 17px;
  color: var(--ink-faint);
}

.project-card.is-active .project-select > .icon {
  color: var(--green);
}

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

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

.project-copy strong {
  font-size: 12px;
  line-height: 1.4;
}

.project-copy small {
  color: var(--ink-faint);
  font-size: 10px;
}

.project-count {
  min-width: 20px;
  height: 19px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
}

.project-card-actions {
  width: 29px;
  border-left: 1px solid #edf0eb;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 140ms ease;
}

.project-card:hover .project-card-actions,
.project-card:focus-within .project-card-actions,
.project-card.is-active .project-card-actions {
  opacity: 1;
}

.project-card-actions .icon-button {
  width: 25px;
  height: 23px;
  border: 0;
  border-radius: 4px;
  background: transparent;
}

.project-card-actions .icon-button:hover {
  background: var(--surface-strong);
}

.project-card-actions .project-delete:hover {
  background: var(--red-soft);
  color: var(--red);
}

.project-card-actions .icon {
  width: 13px;
  height: 13px;
}

.count-badge {
  min-width: 29px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  display: inline-grid;
  place-items: center;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.domain-switch {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #eef1ec;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
}

.domain-button {
  min-width: 0;
  min-height: 32px;
  padding: 0 5px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}

.domain-button span {
  color: var(--ink-faint);
  font-weight: 600;
}

.domain-button:hover {
  color: var(--ink);
}

.domain-button.is-active {
  background: var(--surface);
  color: var(--green-deep);
  box-shadow: 0 1px 4px rgba(24, 34, 27, 0.09);
}

.domain-button.is-active span {
  color: var(--green);
}

.search-box {
  min-height: 39px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-faint);
}

.search-box:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29, 107, 82, 0.08);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search-box input::placeholder {
  color: #99a29a;
}

.search-box-compact {
  min-height: 36px;
}

.filter-row {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: 7px;
}

.filter-row select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 6px;
  border-color: var(--line);
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.78);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.filter-row select:focus-visible {
  outline: none;
  border-color: #83a898;
  box-shadow: 0 0 0 3px rgba(29, 107, 82, 0.08);
}

select,
input,
textarea {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
}

select,
input {
  min-height: 38px;
  padding: 0 10px;
}

textarea {
  padding: 9px 10px;
  resize: vertical;
}

select:hover,
input:hover,
textarea:hover {
  border-color: #aebbb0;
}

.scene-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
}

.scene-group-heading {
  min-height: 28px;
  padding: 3px 5px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.scene-group-heading b {
  min-width: 22px;
  height: 19px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-faint);
  font-size: 9px;
}

.scene-card {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.scene-card:hover {
  border-color: #aebbb0;
  background: var(--surface);
}

.scene-card.is-active {
  border-color: #83a898;
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--green), 0 4px 14px rgba(29, 107, 82, 0.07);
}

.scene-card-longitudinal .category-label {
  color: var(--blue);
}

.scene-card-base .category-label {
  color: #776b58;
}

.scene-card-base.is-active {
  border-color: #b9ae9b;
  box-shadow: inset 3px 0 0 #7f735f, 0 4px 14px rgba(92, 82, 65, 0.07);
}

.scene-card-longitudinal.is-active {
  border-color: #8baec3;
  box-shadow: inset 3px 0 0 var(--blue), 0 4px 14px rgba(50, 106, 141, 0.07);
}

.scene-card-top,
.scene-card-meta,
.scene-card-footer {
  display: flex;
  align-items: center;
  gap: 7px;
}

.scene-card-top {
  justify-content: space-between;
}

.scene-card-title {
  margin: 8px 0 5px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.scene-card-description {
  margin: 0 0 10px;
  min-height: 20px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.scene-card-meta {
  color: var(--ink-faint);
  font-size: 11px;
  flex-wrap: wrap;
}

.scene-card-footer {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #edf0eb;
  justify-content: space-between;
}

.scene-card-footer span {
  color: var(--ink-faint);
  font-size: 11px;
}

.category-label {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
  flex: 0 0 auto;
}

.status-dot.stage-pending {
  background: var(--amber);
}

.status-dot.stage-testing {
  background: var(--blue);
}

.status-dot.stage-verified {
  background: var(--green);
}

.status-dot.stage-archived {
  background: #8d948e;
}

.storage-note {
  padding: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.45;
}

.storage-note .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

.content-panel {
  min-width: 0;
  padding: 24px;
}

.view-panel {
  max-width: 1500px;
  margin: 0 auto;
}

.project-context {
  min-height: 106px;
  margin-bottom: 20px;
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background:
    linear-gradient(105deg, rgba(227, 240, 233, 0.76), rgba(255, 255, 255, 0.88) 58%),
    var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.project-context-main {
  min-width: 0;
}

.project-context-title {
  margin: 4px 0 5px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.project-context-title h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.vehicle-pill,
.project-pill {
  min-height: 24px;
  padding: 2px 9px;
  border: 1px solid #c3d6cb;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--green-deep);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.vehicle-pill .icon,
.project-pill .icon {
  width: 13px;
  height: 13px;
}

.project-context-description {
  max-width: 800px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.project-context-side {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
}

.project-export-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.project-export-button {
  min-height: 34px;
  padding: 0 10px;
  border-color: #c7d7cd;
  background: rgba(255, 255, 255, 0.78);
  color: var(--green-deep);
  font-size: 12px;
}

.project-export-button:hover {
  border-color: #9fc4b2;
  background: var(--green-soft);
}

.project-export-button .icon {
  width: 15px;
  height: 15px;
}

.project-export-button[data-action="export-project-pdf"] {
  color: #2c5c78;
  border-color: #c3d5df;
}

.project-export-button[data-action="export-project-pdf"]:hover {
  border-color: #9ebdce;
  background: var(--blue-soft);
}

.project-stats {
  display: flex;
  border: 1px solid #d5e1da;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.64);
  overflow: hidden;
}

.project-stat {
  min-width: 72px;
  padding: 8px 11px;
  border-right: 1px solid #dfe7e1;
}

.project-stat:last-child {
  border-right: 0;
}

.project-stat span,
.project-stat strong {
  display: block;
}

.project-stat span {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.project-stat strong {
  margin-top: 2px;
  font-size: 17px;
  line-height: 1.1;
}

.empty-detail,
.empty-list {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink-soft);
}

.empty-detail {
  min-height: 460px;
  padding: 40px;
  display: grid;
  place-items: center;
  text-align: center;
}

.empty-state-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--green);
}

.empty-state-icon .icon {
  width: 25px;
  height: 25px;
}

.empty-detail h2 {
  margin-bottom: 8px;
}

.empty-detail p {
  max-width: 430px;
  margin-bottom: 18px;
  color: var(--ink-faint);
}

.empty-list {
  padding: 26px 16px;
  text-align: center;
  font-size: 12px;
}

.typical-issue-guide {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.issue-guide-heading {
  min-height: 58px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.issue-guide-heading h3 {
  margin: 3px 0 0;
  font-size: 18px;
}

.issue-guide-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.issue-add-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

.issue-add-button .icon {
  width: 14px;
  height: 14px;
}

.issue-table-wrap {
  overflow-x: auto;
  scrollbar-width: thin;
}

.issue-guide-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.issue-guide-table th {
  padding: 9px 12px;
  border-right: 1px solid #d7e0da;
  border-bottom: 1px solid var(--line);
  background: #eaf0eb;
  color: var(--ink-soft);
  text-align: left;
  font-size: 11px;
  font-weight: 750;
}

.issue-guide-table th:nth-child(1) {
  width: 17%;
}

.issue-guide-table th:nth-child(2) {
  width: 22%;
}

.issue-guide-table th:nth-child(3) {
  width: 23%;
}

.issue-guide-table th:nth-child(4) {
  width: 30%;
}

.issue-guide-table th:nth-child(5) {
  width: 8%;
}

.issue-guide-table th:last-child,
.issue-guide-table td:last-child {
  border-right: 0;
}

.issue-guide-table td {
  padding: 11px 12px;
  border-right: 1px solid #edf0ed;
  border-bottom: 1px solid #edf0ed;
  color: var(--ink-soft);
  line-height: 1.55;
  vertical-align: top;
  overflow-wrap: anywhere;
}

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

.issue-guide-table tbody tr:hover {
  background: #f8faf7;
}

.issue-symptom {
  color: var(--ink) !important;
  font-weight: 700;
}

.issue-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.issue-signal {
  padding: 2px 6px;
  border: 1px solid #dbe4de;
  border-radius: 4px;
  background: #f5f8f4;
  color: #3f5c4c;
  font-size: 10px;
  line-height: 1.45;
}

.issue-actions {
  margin: 0;
  padding-left: 16px;
}

.issue-actions li + li {
  margin-top: 3px;
}

.issue-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.issue-action-button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.issue-action-button:hover {
  background: var(--surface-strong);
  color: var(--ink);
}

.issue-action-button.issue-delete:hover {
  background: var(--red-soft);
  color: var(--red);
}

.issue-action-button .icon {
  width: 14px;
  height: 14px;
}

.issue-empty {
  padding: 22px 12px !important;
  color: var(--ink-faint) !important;
  text-align: center;
}

.scenario-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.scenario-title-block {
  min-width: 0;
}

.scenario-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.scenario-title-row h2 {
  margin: 0;
  font-size: clamp(23px, 2vw, 30px);
  line-height: 1.18;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.scenario-title-row .project-pill {
  max-width: 100%;
}

.domain-pill {
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
}

.domain-lateral {
  border: 1px solid #b4d3c3;
  background: var(--green-soft);
  color: var(--green-deep);
}

.domain-base {
  border: 1px solid #d9d0c2;
  background: #f0ece5;
  color: #655c4e;
}

.domain-longitudinal {
  border: 1px solid #b8d0e0;
  background: var(--blue-soft);
  color: var(--blue);
}

.scenario-subtitle {
  margin: 8px 0 0;
  max-width: 820px;
  color: var(--ink-soft);
  line-height: 1.65;
}

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

.status-pill,
.risk-pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  border-radius: 20px;
  padding: 2px 9px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 650;
}

.status-pill {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.status-pill.verified {
  color: var(--green-deep);
  border-color: #b4d3c3;
  background: var(--green-soft);
}

.status-pill.testing {
  color: var(--blue);
  border-color: #b8d0e0;
  background: var(--blue-soft);
}

.status-pill.pending {
  color: var(--amber);
  border-color: #e8c99f;
  background: var(--amber-soft);
}

.risk-pill {
  background: #eef1ec;
  color: var(--ink-soft);
}

.risk-pill.risk-high {
  background: var(--red-soft);
  color: var(--red);
}

.risk-pill.risk-medium {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag {
  background: #eef1ec;
  color: var(--ink-soft);
  font-weight: 550;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 14px;
}

.overview-item {
  min-height: 72px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.overview-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.overview-item strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 14px;
}

.metric {
  min-height: 58px;
  padding: 10px 13px;
  border-left: 3px solid var(--green);
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric span {
  color: var(--ink-faint);
  font-size: 11px;
}

.metric strong {
  font-size: 21px;
  line-height: 1;
}

.parameter-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 3px 15px rgba(28, 38, 31, 0.035);
}

.panel-heading {
  min-height: 60px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.panel-heading h3 {
  margin: 2px 0 0;
  font-size: 16px;
}

.panel-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.param-search {
  width: 210px;
  min-height: 34px;
}

.table-wrap {
  overflow-x: auto;
}

.parameter-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.parameter-table th {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #f6f8f4;
  color: var(--ink-faint);
  font-size: 10px;
  text-align: left;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.parameter-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf0eb;
  vertical-align: top;
}

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

.parameter-table tbody tr:hover {
  background: #fbfcfa;
}

.parameter-table th:nth-child(1) {
  width: 22%;
}

.parameter-table th:nth-child(2) {
  width: 10%;
}

.parameter-table th:nth-child(3) {
  width: 18%;
}

.parameter-table th:nth-child(4) {
  width: 16%;
}

.parameter-table th:nth-child(5) {
  width: 22%;
}

.parameter-table th:nth-child(6) {
  width: 12%;
}

.signal-name {
  margin-bottom: 3px;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--green-deep);
  overflow-wrap: anywhere;
}

.signal-label {
  color: var(--ink-faint);
  font-size: 11px;
}

.parameter-image-empty {
  width: 100%;
  min-height: 54px;
  padding: 6px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  cursor: pointer;
}

.parameter-image-empty:hover {
  border-color: #9eb5a7;
  background: var(--green-soft);
  color: var(--green-deep);
}

.parameter-image-empty .icon {
  width: 14px;
  height: 14px;
}

.parameter-image-cell {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.parameter-image-preview {
  width: 74px;
  height: 50px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-soft);
  overflow: hidden;
  cursor: zoom-in;
}

.parameter-image-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.parameter-image-actions {
  padding-top: 3px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.parameter-image-actions button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green-deep);
  font-size: 10px;
  cursor: pointer;
}

.parameter-image-actions button:hover {
  text-decoration: underline;
}

.parameter-image-actions .parameter-image-delete {
  color: var(--red);
}

.group-text,
.rule-text,
.cell-note {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.value-text {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.value-unit {
  color: var(--ink-faint);
  font-weight: 400;
}

.empty-value {
  color: #a2aba3;
  font-weight: 400;
}

.limit-text {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.row-actions {
  display: grid;
  grid-template-columns: repeat(2, 29px);
  justify-content: flex-end;
  gap: 2px;
}

.row-actions .icon-button {
  width: 29px;
  height: 29px;
  border-color: transparent;
  background: transparent;
  color: var(--ink-faint);
}

.row-actions .icon-button:hover {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.row-actions .icon-button:disabled {
  border-color: transparent;
  background: transparent;
  color: #c7cec8;
  cursor: default;
  transform: none;
}

.row-actions .delete-button:hover {
  color: var(--red);
  border-color: #eccdc9;
  background: var(--red-soft);
}

.row-actions .icon {
  width: 15px;
  height: 15px;
}

.empty-table {
  padding: 34px 20px;
  text-align: center;
  color: var(--ink-faint);
}

.image-panel {
  margin-top: 14px;
}

.image-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.image-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  overflow: hidden;
}

.image-open {
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  display: block;
  background: #e9ece7;
  cursor: zoom-in;
  overflow: hidden;
}

.image-open img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 180ms ease;
}

.image-open:hover img {
  transform: scale(1.02);
}

.image-card-body {
  padding: 10px;
}

.image-card-title {
  min-height: 36px;
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.image-card-meta {
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.45;
}

.image-card-actions {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid #e6eae4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.image-card-actions .image-caption-button {
  min-height: 29px;
  padding: 0 5px;
  font-size: 10px;
}

.image-card-actions .icon-button {
  width: 29px;
  height: 29px;
}

.image-drop-empty {
  width: calc(100% - 28px);
  min-height: 142px;
  margin: 14px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  cursor: pointer;
}

.image-drop-empty:hover {
  border-color: #9eb9ac;
  background: #f7fbf8;
}

.image-drop-empty .empty-state-icon {
  width: 38px;
  height: 38px;
  margin: 0 0 3px;
}

.image-drop-empty .empty-state-icon .icon {
  width: 19px;
  height: 19px;
}

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

.image-drop-empty > span:last-child {
  color: var(--ink-faint);
  font-size: 11px;
}

.detail-lower {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  margin-top: 14px;
}

.info-panel {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
}

.info-panel h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.info-panel p {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  position: relative;
  padding: 0 0 12px 17px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.activity-item::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #96b6a6;
}

.activity-item::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 15px;
  bottom: 0;
  width: 1px;
  background: #dfe5df;
}

.activity-item:last-child {
  padding-bottom: 0;
}

.activity-item:last-child::after {
  display: none;
}

.activity-time {
  display: block;
  color: var(--ink-faint);
  font-size: 10px;
}

.manual-hero {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(227, 240, 233, 0.88), rgba(255, 255, 255, 0.9) 62%),
    var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
}

.manual-hero h2 {
  margin: 4px 0 8px;
  font-size: 28px;
}

.manual-intro {
  max-width: 690px;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.principle-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  border: 1px solid #cfddd4;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  overflow: hidden;
  flex: 0 0 auto;
}

.principle-strip div {
  padding: 12px 14px;
  border-right: 1px solid #dbe4de;
}

.principle-strip div:last-child {
  border-right: 0;
}

.principle-strip strong,
.principle-strip span {
  display: block;
}

.principle-strip strong {
  font-size: 18px;
}

.principle-strip span {
  color: var(--ink-faint);
  font-size: 10px;
  white-space: nowrap;
}

.manual-domain-switch {
  width: fit-content;
  margin-top: 14px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #eef1ec;
  display: flex;
  gap: 2px;
}

.manual-domain-button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}

.manual-domain-button.is-active {
  background: var(--surface);
  color: var(--green-deep);
  box-shadow: 0 1px 4px rgba(24, 34, 27, 0.09);
}

.manual-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.manual-nav {
  align-self: start;
  position: sticky;
  top: 96px;
}

.manual-group-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.manual-nav-section {
  padding: 12px 10px 4px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.group-filter {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.group-filter:hover {
  background: rgba(255, 255, 255, 0.72);
}

.group-filter.is-active {
  background: var(--surface);
  color: var(--green-deep);
  box-shadow: inset 3px 0 0 var(--green);
  font-weight: 650;
}

.group-filter span {
  color: var(--ink-faint);
  font-size: 10px;
}

.manual-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 10px;
}

.manual-toolbar h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

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

.catalog-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.catalog-card {
  min-height: 176px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.83);
  display: flex;
  flex-direction: column;
}

.catalog-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.catalog-card .signal-name {
  margin-top: 8px;
}

.catalog-card h4 {
  margin: 0;
  font-size: 13px;
}

.catalog-card p {
  margin: 9px 0 12px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.catalog-recommendation {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #edf0eb;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.catalog-recommendation span {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.catalog-recommendation strong {
  font-size: 11px;
  line-height: 1.5;
  font-weight: 600;
}

.catalog-recommendation .icon-button {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}

.rule-band {
  margin-top: 22px;
  padding: 17px;
  border: 1px solid #e2d5bf;
  border-radius: 8px;
  background: #fdf8ef;
}

.rule-band-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #744613;
}

.rule-band-heading h3 {
  margin: 0 0 3px;
  font-size: 14px;
}

.rule-band-heading p {
  margin: 0;
  color: #7c5d36;
  font-size: 12px;
}

.rule-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.rule-card {
  padding: 11px;
  border: 1px solid #eadfcb;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.58);
}

.rule-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
}

.rule-card span {
  color: #80633d;
  font-size: 10px;
  line-height: 1.5;
}

.modal {
  width: min(680px, calc(100vw - 28px));
  max-height: min(860px, calc(100vh - 34px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(20, 29, 23, 0.28);
  overflow: auto;
}

.modal-wide {
  width: min(760px, calc(100vw - 28px));
}

.modal-compact {
  width: min(410px, calc(100vw - 28px));
  padding: 24px;
  text-align: center;
}

.image-dialog {
  width: min(900px, calc(100vw - 28px));
}

.image-dialog-preview {
  max-height: min(56vh, 580px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #eef1ec 25%, transparent 25%),
    linear-gradient(-45deg, #eef1ec 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef1ec 75%),
    linear-gradient(-45deg, transparent 75%, #eef1ec 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.image-dialog-preview img {
  max-width: 100%;
  max-height: min(56vh, 580px);
  display: block;
  object-fit: contain;
}

.image-dialog-meta {
  margin: 9px 0 13px;
  color: var(--ink-faint);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.modal::backdrop {
  background: rgba(21, 29, 24, 0.46);
  backdrop-filter: blur(2px);
}

.modal form {
  padding: 20px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.modal-header h2 {
  margin: 3px 0 0;
  font-size: 21px;
}

.dialog-close {
  border-color: transparent;
  background: transparent;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.field > span b {
  color: var(--red);
}

.field small {
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.5;
}

.field-span-2 {
  grid-column: span 2;
}

.catalog-picker {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #d4e2da;
  border-radius: 7px;
  background: #f4f9f6;
}

.catalog-picker span {
  color: var(--green-deep);
}

.project-migration-field {
  padding: 12px;
  border: 1px solid #d4e2da;
  border-radius: 7px;
  background: #f4f9f6;
}

.project-migration-field > span {
  color: var(--green-deep);
}

.project-target {
  padding: 11px 12px;
  border: 1px solid #d4e2da;
  border-radius: 7px;
  background: #f4f9f6;
}

.project-target strong {
  display: flex;
  align-items: center;
  min-height: 23px;
  color: var(--green-deep);
  font-size: 13px;
}

.modal-actions {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-compact .modal-actions {
  justify-content: center;
}

.confirm-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 13px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  display: grid;
  place-items: center;
}

.confirm-icon .icon {
  width: 22px;
  height: 22px;
}

.modal-compact h2 {
  margin-bottom: 8px;
  font-size: 19px;
}

.modal-compact p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: min(390px, calc(100vw - 36px));
  padding: 11px 14px;
  border: 1px solid #b9d4c6;
  border-radius: 7px;
  background: #f3faf6;
  color: var(--green-deep);
  box-shadow: var(--shadow);
  font-size: 12px;
  pointer-events: auto;
  animation: toast-in 180ms ease-out;
}

.toast.is-error {
  border-color: #e5c3be;
  background: #fff5f3;
  color: var(--red);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: minmax(240px, 1fr) auto auto;
  }

  .workspace {
    grid-template-columns: 264px minmax(0, 1fr);
  }

  .content-panel {
    padding: 18px;
  }

  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-context {
    align-items: flex-start;
  }

  .project-context-side {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }

  .project-export-actions {
    order: 2;
  }

  .catalog-list {
    grid-template-columns: 1fr;
  }

  .rule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  .app-header {
    position: relative;
    min-height: 0;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .main-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
  }

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

  .library-panel {
    height: auto;
    min-height: 0;
    max-height: none;
    position: relative;
    top: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .project-list {
    max-height: 220px;
  }

  .scene-list {
    max-height: 310px;
  }

  .content-panel {
    padding: 16px;
  }

  .project-context {
    align-items: center;
  }

  .project-context-side {
    flex-direction: row;
    align-items: center;
  }

  .manual-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .principle-strip {
    width: 100%;
  }

  .detail-lower {
    grid-template-columns: 1fr;
  }

  .manual-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .manual-layout > *,
  .manual-nav,
  .manual-toolbar,
  .catalog-list,
  .catalog-card {
    min-width: 0;
  }

  .manual-nav {
    position: static;
    width: 100%;
  }

  .manual-group-list {
    flex-direction: row;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 4px;
  }

  .manual-domain-switch {
    max-width: 100%;
    overflow-x: auto;
  }

  .manual-nav-section {
    flex: 0 0 auto;
    align-self: center;
    padding: 0 5px;
  }

  .group-filter {
    width: auto;
    flex: 0 0 auto;
  }
}

@media (max-width: 680px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-header {
    width: 100%;
    padding: 11px 13px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .brand-block {
    min-width: 0;
  }

  .brand-block > div:last-child {
    min-width: 0;
  }

  .brand-block h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .eyebrow {
    display: none;
  }

  h1 {
    margin: 0;
    font-size: 17px;
  }

  .header-actions {
    gap: 5px;
    min-width: 0;
  }

  .header-actions .icon-button {
    width: 34px;
    height: 34px;
  }

  .header-actions .button {
    width: 34px;
    min-height: 34px;
    padding: 0;
  }

  .header-actions .button-label {
    display: none;
  }

  .main-tabs {
    width: 100%;
    min-width: 0;
  }

  .tab-button {
    min-width: 0;
    flex: 1;
    justify-content: center;
    padding-inline: 8px;
  }

  .content-panel,
  .library-panel {
    padding-left: 12px;
    padding-right: 12px;
  }

  .scenario-header {
    flex-direction: column;
    gap: 14px;
  }

  .scenario-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .scenario-actions .button {
    flex: 1;
  }

  .project-context {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .project-context-title h2 {
    font-size: 20px;
  }

  .project-context-side {
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .project-export-actions {
    width: 100%;
    order: 1;
  }

  .project-export-button {
    flex: 1;
  }

  .project-stats {
    flex: 1;
  }

  .project-stat {
    min-width: 0;
    flex: 1;
    padding: 8px;
  }

  .overview-grid,
  .metric-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric:last-child {
    grid-column: span 2;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-heading-actions {
    width: 100%;
  }

  .param-search {
    width: auto;
    flex: 1;
  }

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

  .field-span-2 {
    grid-column: span 1;
  }

  .modal form {
    padding: 16px;
  }

  .manual-hero {
    padding: 17px;
  }

  .manual-hero h2 {
    font-size: 23px;
  }

  .principle-strip {
    grid-template-columns: 1fr;
  }

  .principle-strip div {
    border-right: 0;
    border-bottom: 1px solid #dbe4de;
  }

  .principle-strip div:last-child {
    border-bottom: 0;
  }

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

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

  .image-dialog-preview,
  .image-dialog-preview img {
    max-height: 45vh;
  }

  .table-wrap {
    overflow: visible;
  }

  .parameter-table,
  .parameter-table tbody,
  .parameter-table tr,
  .parameter-table td {
    display: block;
    width: 100%;
  }

  .parameter-table thead {
    display: none;
  }

  .parameter-table tr {
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }

  .parameter-table tr:last-child {
    border-bottom: 0;
  }

  .parameter-table td {
    min-height: 0;
    padding: 4px 0;
    border: 0;
  }

  .parameter-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--ink-faint);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
  }

  .parameter-table td:first-child::before {
    display: none;
  }

  .parameter-table td:last-child {
    margin-top: 8px;
  }

  .row-actions {
    justify-content: start;
  }

  .row-actions .icon-button {
    border-color: var(--line);
    background: var(--surface-soft);
  }
}

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

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  padding: 24px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(19, 78, 60, 0.94), rgba(25, 54, 66, 0.96)),
    var(--green-deep);
}

.auth-gate::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.auth-panel {
  position: relative;
  width: min(430px, 100%);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 10px;
  background: #fbfcf9;
  box-shadow: 0 28px 90px rgba(8, 27, 20, 0.35);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.auth-brand h1 {
  margin-top: 4px;
  font-size: 18px;
}

.auth-heading {
  margin: 25px 0 20px;
}

.auth-heading h2 {
  margin: 7px 0 7px;
  font-size: 27px;
  line-height: 1.2;
}

.auth-heading p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form input {
  min-height: 44px;
}

.auth-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 3px;
}

.local-migration-panel {
  padding: 14px;
  border: 1px solid #d3e2d9;
  border-radius: 8px;
  background: #f3f8f5;
}

.local-migration-panel > p:first-child {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.local-migration-help {
  margin: 12px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.6;
}

.form-error {
  margin: -3px 0 0;
  padding: 9px 11px;
  border: 1px solid #e6c5c0;
  border-radius: 7px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
}

.auth-footer {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink-faint);
  font-size: 10px;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.user-menu {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sync-meta {
  width: 92px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  line-height: 1.25;
}

.sync-meta small {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.sync-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.sync-status[data-state="pending"]::before,
.sync-status[data-state="saving"]::before {
  background: var(--amber);
}

.sync-status[data-state="error"] {
  color: var(--red);
}

.sync-status[data-state="error"]::before {
  background: var(--red);
}

.user-chip {
  min-width: 0;
  max-width: 190px;
  min-height: 42px;
  padding: 4px 9px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.user-chip:hover {
  border-color: #aebbb0;
  background: #f2f5f1;
}

.user-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid #b8d0c3;
  border-radius: 7px;
  background: var(--green-soft);
  color: var(--green-deep);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.user-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.user-copy strong,
.user-copy small {
  max-width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy strong {
  font-size: 11px;
}

.user-copy small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
}

.save-conflict-banner {
  position: fixed;
  top: 88px;
  right: 20px;
  z-index: 30;
  width: min(520px, calc(100vw - 40px));
  padding: 12px 13px;
  border: 1px solid #dfb56f;
  border-radius: 8px;
  background: #fff8e9;
  color: #744810;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.save-conflict-banner > div {
  min-width: 0;
}

.save-conflict-banner strong,
.save-conflict-banner span {
  display: block;
}

.save-conflict-banner strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.save-conflict-banner span {
  font-size: 10px;
  line-height: 1.5;
}

.save-conflict-banner .button {
  min-height: 32px;
  flex: 0 0 auto;
  font-size: 11px;
}

.account-dialog {
  width: min(820px, calc(100vw - 28px));
}

.account-dialog-body {
  padding: 20px;
}

.account-dialog form {
  padding: 0;
}

.account-profile {
  padding: 13px;
  border: 1px solid #d3e2d9;
  border-radius: 8px;
  background: #f4f8f5;
  display: flex;
  align-items: center;
  gap: 11px;
}

.account-profile-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  display: grid;
  place-items: center;
}

.account-profile > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

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

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

.account-profile span {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10px;
}

.account-profile-role {
  text-align: right;
}

.account-profile-role strong {
  color: var(--green-deep);
}

.account-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.account-section-heading {
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.account-section-heading h3 {
  margin: 0;
  font-size: 15px;
}

.account-section-heading p {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.55;
}

.account-form-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.create-user-form {
  margin-bottom: 14px;
  padding: 12px !important;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 130px auto;
  align-items: end;
  gap: 9px;
}

.create-user-form .button {
  min-height: 38px;
  padding-inline: 12px;
}

.account-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.account-row {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 7px 14px;
  align-items: center;
}

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

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

.account-row-main strong,
.account-row-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-row-main strong {
  font-size: 12px;
}

.account-row-main span {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10px;
}

.account-row-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.account-row-controls select {
  min-height: 32px;
  width: 94px;
  font-size: 10px;
}

.account-row-controls .button {
  min-height: 32px;
  padding-inline: 9px;
  font-size: 10px;
}

.account-row-controls button:disabled,
.account-row-controls select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.account-row-meta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-faint);
  font-size: 9px;
}

.account-state {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.account-state.is-active {
  border-color: #bfd7ca;
  background: var(--green-soft);
  color: var(--green-deep);
}

.account-empty {
  padding: 24px;
  color: var(--ink-faint);
  text-align: center;
  font-size: 11px;
}

.account-empty.is-error {
  color: var(--red);
}

.password-reset-dialog form {
  display: flex;
  flex-direction: column;
  gap: 13px;
  text-align: left;
}

.password-reset-dialog h2 {
  margin-bottom: 0;
  text-align: center;
}

.password-reset-target {
  margin: -5px 0 2px;
  color: var(--ink-soft);
  font-size: 11px;
  text-align: center;
}

.password-reset-dialog .modal-actions {
  margin-top: 4px;
}

.platform-toast-region {
  bottom: 74px;
}

body[data-can-edit="false"] #newProjectButton,
body[data-can-edit="false"] #newScenarioButton,
body[data-can-edit="false"] #importButton,
body[data-can-edit="false"] .project-card-actions,
body[data-can-edit="false"] .scenario-actions,
body[data-can-edit="false"] [data-action="edit-project"],
body[data-can-edit="false"] [data-action="add-parameter"],
body[data-can-edit="false"] [data-action="add-images"],
body[data-can-edit="false"] [data-action="insert-parameter-image"],
body[data-can-edit="false"] [data-action="delete-parameter-image"],
body[data-can-edit="false"] .image-card-actions,
body[data-can-edit="false"] .image-drop-empty,
body[data-can-edit="false"] .parameter-image-empty,
body[data-can-edit="false"] .parameter-image-actions,
body[data-can-edit="false"] [data-add-catalog],
body[data-can-edit="false"] [data-issue-action],
body[data-can-edit="false"] .issue-guide-actions,
body[data-can-edit="false"] #imageMetaForm .field,
body[data-can-edit="false"] #imageMetaForm button[type="submit"],
body[data-can-edit="false"] .row-actions {
  display: none !important;
}

body[data-can-edit="false"] .parameter-table th:last-child,
body[data-can-edit="false"] .parameter-table td:last-child,
body[data-can-edit="false"] .issue-guide-table th:last-child,
body[data-can-edit="false"] .issue-guide-table td:last-child {
  display: none !important;
}

@media (max-width: 1180px) {
  .sync-meta {
    display: none;
  }

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

  .create-user-form .button {
    grid-column: span 2;
  }
}

@media (max-width: 880px) {
  .user-chip {
    max-width: 150px;
  }

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

  .account-row-controls {
    flex-wrap: wrap;
  }

  .account-row-meta {
    grid-column: 1;
  }
}

@media (max-width: 680px) {
  .auth-gate {
    padding: 14px;
  }

  .auth-panel {
    padding: 21px;
  }

  .auth-heading h2 {
    font-size: 23px;
  }

  .user-menu {
    gap: 4px;
  }

  .user-chip {
    width: 34px;
    min-height: 34px;
    padding: 0;
    justify-content: center;
  }

  .user-avatar {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .user-copy {
    display: none;
  }

  .save-conflict-banner {
    top: 122px;
    right: 12px;
    width: calc(100vw - 24px);
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .account-dialog-body {
    padding: 16px;
  }

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

  .create-user-form .button {
    grid-column: 1;
  }

  .account-profile {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .account-profile-role {
    width: 100%;
    padding-left: 49px;
    text-align: left;
  }

  .account-row-controls select,
  .account-row-controls .button {
    flex: 1 1 100px;
  }

  .platform-toast-region {
    bottom: 12px;
  }
}
