:root {
  --ink: #10201d;
  --muted: #63746f;
  --line: #d9e4e1;
  --soft-line: #e8efed;
  --bg: #f6f9f8;
  --panel: #ffffff;
  --panel-strong: #fbfffd;
  --panel-tint: #f0f8f5;
  --cyan: #20a6c8;
  --amber: #f59e0b;
  --green-950: #003d33;
  --green-900: #00483c;
  --green-800: #005b4e;
  --green-700: #00715e;
  --green-600: #0a8f75;
  --green-100: #e8f6f2;
  --green-50: #f2fbf8;
  --orange: #f97316;
  --red: #e54848;
  --blue: #2d6cdf;
  --shadow: 0 16px 40px rgba(0, 49, 42, 0.1);
  --shadow-lift: 0 18px 42px rgba(0, 49, 42, 0.16);
  --ring: 0 0 0 3px rgba(32, 166, 200, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(32, 166, 200, 0.08), transparent 34%),
    linear-gradient(180deg, #f3f8f7, #edf5f3);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
select,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
a,
select,
textarea,
input {
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease,
    opacity 0.16s ease;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible,
[contenteditable="true"]:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

#app {
  display: grid;
  grid-template-columns: 188px 1fr;
  min-width: 1280px;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 18px 12px 20px;
  background:
    radial-gradient(circle at 78% 36%, rgba(23, 160, 132, 0.18), transparent 28%),
    linear-gradient(180deg, var(--green-900), #00372f 72%, #002d28);
  color: #e9fffa;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

.brand {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  min-height: 54px;
  margin-bottom: 22px;
  gap: 10px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
}

.brand strong {
  display: block;
  font-size: 17px;
  line-height: 1.1;
  color: #fff;
}

.brand span,
.team-card span {
  display: block;
  margin-top: 4px;
  color: rgba(234, 255, 250, 0.78);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(238, 255, 251, 0.86);
  text-align: left;
  font-weight: 700;
}

.nav-item .icon {
  width: 20px;
  height: 20px;
  color: rgba(238, 255, 251, 0.9);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(22, 174, 144, 0.95), rgba(11, 135, 113, 0.9));
  color: #fff;
  box-shadow: 0 12px 28px rgba(0, 26, 20, 0.22);
}

.team-card {
  display: grid;
  grid-template-columns: 36px 1fr 16px;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 13px 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #dbeafe;
  color: var(--green-900);
  font-weight: 800;
}

.avatar.mini {
  width: 28px;
  height: 28px;
}

.chevron {
  color: rgba(255, 255, 255, 0.8);
}

.app-shell {
  min-width: 0;
  min-height: 100vh;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.top-left,
.top-actions,
.rail-title,
.panel-head,
.section-title,
.footer-actions {
  display: flex;
  align-items: center;
}

.top-left {
  gap: 14px;
}

.top-left h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}

.top-actions {
  gap: 12px;
}

.icon-btn,
.round-icon {
  display: grid;
  place-items: center;
  position: relative;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1f312d;
}

.round-icon em {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: #ef3333;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  line-height: 16px;
}

.select-line,
.field {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.select-line span,
.field span {
  padding: 0 14px;
  color: #455852;
  border-right: 1px solid var(--soft-line);
}

.select-line select,
.field select {
  width: 150px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  outline: none;
  background: transparent;
  color: #1d302b;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #253632;
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--green-800);
  font-weight: 700;
}

.btn.primary {
  border-color: var(--green-800);
  background: linear-gradient(180deg, #00755f, #005b4b);
  color: #fff;
}

.page {
  height: calc(100vh - 60px);
  padding: 18px;
  overflow: auto;
}

.workspace {
  display: grid;
  align-items: start;
  gap: 16px;
}

.three-col,
.kb-layout,
.script-layout,
.image-layout,
.review-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.kb-layout,
.script-layout,
.image-layout {
  grid-template-columns: 318px minmax(0, 1fr) 300px;
}

.script-layout {
  grid-template-columns: 270px minmax(0, 1fr) 300px;
}

.image-layout {
  grid-template-columns: 260px minmax(0, 1fr) 300px;
}

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

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

.main-wide,
.main-editor,
.left-column,
.right-rail {
  min-width: 0;
}

.panel,
.right-rail,
.notice,
.filterbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(0, 65, 53, 0.03);
}

.panel {
  padding: 16px;
  margin-bottom: 14px;
}

.panel-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

h2,
h3,
p {
  margin: 0;
}

.panel h2,
.right-rail h2 {
  font-size: 16px;
  font-weight: 800;
}

.panel h3 {
  font-size: 14px;
  font-weight: 800;
}

.panel-head span,
.panel-head a,
.section-title a,
small {
  color: var(--green-700);
  font-size: 12px;
  text-decoration: none;
}

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 14px;
  margin-bottom: 14px;
  border-color: #ffbf8a;
  background: #fff7ed;
  color: #d65f00;
  font-weight: 700;
}

.pipeline {
  padding-bottom: 18px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.step {
  position: relative;
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: 7px;
  background: linear-gradient(180deg, #f7fcfa, #fff);
}

button.step {
  width: 100%;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}

.step b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--green-700);
  color: #fff;
}

.step strong,
.step span {
  display: block;
}

.step span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.metric-grid.wide {
  grid-template-columns: repeat(6, 1fr);
}

.metric {
  min-height: 86px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric span,
.metric em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.metric strong {
  display: block;
  margin: 8px 0;
  font-size: 26px;
  line-height: 1;
  font-weight: 800;
}

.green {
  color: #008767 !important;
}

.orange {
  color: var(--orange) !important;
}

.red {
  color: var(--red) !important;
}

.blue {
  color: var(--blue) !important;
}

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

.data-table th,
.data-table td {
  height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  vertical-align: middle;
  text-align: left;
}

.data-table th {
  background: #f8fbfa;
  color: #4b5f5a;
  font-weight: 800;
}

.data-table td {
  color: #263b36;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid #c9e9e1;
  border-radius: 5px;
  background: var(--green-100);
  color: var(--green-800);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tag.orange {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #ea580c !important;
}

.tag.red {
  border-color: #fecaca;
  background: #fff1f2;
  color: #dc2626 !important;
}

.tag.blue {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #2563eb !important;
}

.tag.gray {
  border-color: #e5e7eb;
  background: #f8fafc;
  color: #64748b !important;
}

.material-strip {
  margin-bottom: 0;
}

.thumb-row,
.image-grid,
.bottom-panels,
.charts-row,
.settings-grid {
  display: grid;
  gap: 12px;
}

.thumb-row {
  grid-template-columns: repeat(4, 1fr);
}

.material-card {
  position: relative;
  min-height: 120px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e9f4f0;
}

.material-card::before,
.mock-photo::before,
.device::before {
  content: "";
  position: absolute;
}

.material-card::before {
  inset: 0;
  background:
    radial-gradient(circle at 70% 38%, rgba(255, 255, 255, 0.78) 0 12%, transparent 13%),
    linear-gradient(135deg, rgba(0, 95, 79, 0.2), rgba(255, 255, 255, 0.72));
}

.material-card span,
.material-card em {
  position: absolute;
  left: 12px;
  z-index: 1;
}

.material-card span {
  bottom: 32px;
  color: #fff;
  font-weight: 800;
  text-shadow: 0 1px 8px rgba(0, 30, 24, 0.5);
}

.material-card em {
  bottom: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-style: normal;
  font-size: 12px;
}

.right-rail {
  position: sticky;
  top: 18px;
  padding: 16px;
}

.rail-title {
  justify-content: space-between;
  margin-bottom: 12px;
}

.rail-title h2 {
  margin-right: auto;
  margin-left: 8px;
}

.rail-title button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--green-700);
  font-size: 12px;
  font-weight: 700;
}

.ai-card {
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fff;
}

.ai-card.risk {
  border-color: #fecaca;
  background: #fff7f7;
}

.ai-card h3 {
  margin-bottom: 10px;
}

.ai-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: #40534e;
  line-height: 1.55;
  font-size: 12px;
}

.optimize-list {
  display: grid;
  gap: 10px;
}

.optimize-list div {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 10px;
}

.optimize-list img {
  width: 58px;
  height: 42px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.optimize-list span {
  color: #40534e;
  font-size: 12px;
  line-height: 1.45;
}

.optimize-list a {
  margin-top: 4px;
  color: var(--green-700);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.left-column {
  display: grid;
  gap: 14px;
}

.left-column .panel {
  margin-bottom: 0;
}

.search {
  width: 100%;
  height: 36px;
  margin-bottom: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.product-row {
  display: grid;
  grid-template-columns: 24px 40px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 8px;
  border: 1px solid transparent;
  border-bottom-color: var(--soft-line);
  width: 100%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.product-row.active {
  border-color: var(--green-700);
  background: #f3fbf8;
}

.radio {
  width: 16px;
  height: 16px;
  border: 1px solid #b7c8c3;
  border-radius: 50%;
}

.product-row.active .radio {
  border: 5px solid var(--green-700);
}

.device {
  position: relative;
  width: 28px;
  height: 38px;
  border-radius: 7px;
  background: #111827;
}

.device::before {
  inset: 7px;
  border-radius: 4px;
  background: #eefcf8;
}

.product-row strong,
.product-row em {
  display: block;
}

.product-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.guide {
  color: #40534e;
  line-height: 1.8;
  background: linear-gradient(180deg, #fff, #fffaf5);
}

.product-title {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--soft-line);
}

.product-title h2 {
  font-size: 17px;
  line-height: 1.2;
}

.product-title em {
  margin-left: auto;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  border-bottom: 1px solid var(--soft-line);
  margin-bottom: 14px;
}

.tabs button {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #435852;
  font-weight: 800;
}

.tabs button.active {
  color: var(--green-800);
  border-bottom-color: var(--green-700);
}

.spacer {
  flex: 1;
}

.kb-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--soft-line);
}

.section-title {
  justify-content: space-between;
  margin-bottom: 10px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.text-box {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #30443f;
  line-height: 1.7;
}

.param-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.param-grid div {
  display: grid;
  grid-template-columns: 150px 1fr;
  min-height: 42px;
  border-right: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
}

.param-grid span,
.param-grid strong {
  padding: 11px 14px;
}

.param-grid span {
  background: #f8fbfa;
  color: var(--muted);
}

.filterbar,
.planning-board {
  padding: 12px;
  margin-bottom: 14px;
}

.filterbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.filterbar .filter-line {
  min-height: 34px;
  width: auto;
}

.filterbar .filter-line b {
  width: 78px;
}

.filterbar .field {
  width: 260px;
  margin-bottom: 0;
}

.filter-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
}

.filter-line b {
  width: 82px;
  color: #2f423d;
}

.filter-line button,
.duration button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: #445852;
}

.filter-line button.active,
.duration button.active {
  border-color: var(--green-600);
  background: var(--green-100);
  color: var(--green-800);
  font-weight: 800;
}

.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 4px;
  color: #40534e;
  font-size: 12px;
}

.check-row input {
  accent-color: var(--green-700);
}

.topic-matrix {
  display: grid;
  grid-template-columns: 74px repeat(6, minmax(0, 1fr));
  border: 1px solid var(--soft-line);
  border-right: 0;
  border-bottom: 0;
}

.matrix-head,
.matrix-group,
.matrix-cell {
  border-right: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
}

.matrix-head {
  min-height: 38px;
  padding: 11px 8px;
  background: #f8fbfa;
  color: #40534e;
  font-size: 12px;
  font-weight: 800;
}

.matrix-group {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  min-height: 132px;
  padding: 10px 8px;
  background: #fbfefd;
  color: var(--green-800);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.matrix-cell {
  min-height: 132px;
  padding: 10px 9px;
  background: #fff;
}

.matrix-cell strong {
  display: block;
  min-height: 34px;
  color: #132b25;
  font-size: 12px;
  line-height: 1.4;
}

.matrix-cell p {
  margin-top: 6px;
  color: #667873;
  font-size: 11px;
  line-height: 1.35;
}

.matrix-cell .tag {
  margin-top: 8px;
  min-height: 20px;
  padding: 0 7px;
  font-size: 11px;
}

.selected-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding-top: 12px;
  color: #40534e;
}

.selected-tags button {
  margin-left: auto;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--green-700);
  font-weight: 800;
}

.field {
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
}

.field select {
  flex: 1;
  width: auto;
}

.duration {
  display: flex;
  gap: 8px;
  margin: 8px 0 16px;
}

.check {
  display: block;
  margin: 10px 0;
  color: #40534e;
}

.brand-assets {
  padding: 10px 0 4px;
}

.brand-assets .section-title {
  margin-bottom: 9px;
}

.brand-assets > div:nth-child(2) {
  display: flex;
  gap: 9px;
}

.brand-assets .mini-thumb {
  width: 58px;
  height: 44px;
}

.brand-assets p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  word-spacing: 8px;
}

.template {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  min-height: 66px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.template.active {
  border-color: var(--green-700);
  box-shadow: inset 3px 0 0 var(--green-700);
}

.template b {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #fff7ed;
  color: var(--orange);
}

.template span {
  color: var(--muted);
  font-size: 12px;
}

.script-blocks {
  display: grid;
  gap: 10px;
}

.script-seg {
  display: grid;
  grid-template-columns: 128px 1fr;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.script-seg b {
  padding: 13px;
  background: #f8fbfa;
  color: var(--green-800);
}

.script-seg b span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
}

.script-seg p {
  padding: 13px;
  line-height: 1.6;
  outline: none;
}

.sub {
  margin-top: 18px;
}

.score-box h3 {
  margin-bottom: 12px;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 124px;
  height: 124px;
  margin: 8px auto 10px;
  border-radius: 50%;
  background: conic-gradient(var(--green-600) var(--score), #e7efed 0);
  position: relative;
}

.score-ring::after {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: #fff;
}

.score-ring strong,
.score-ring span {
  position: relative;
  z-index: 1;
}

.score-ring strong {
  font-size: 34px;
}

.score-ring span {
  align-self: end;
  margin-bottom: 30px;
  margin-left: -8px;
  color: var(--muted);
  font-size: 12px;
}

.score-box p {
  text-align: center;
  color: #40534e;
}

.bars {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}

.bars label {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 30px;
  gap: 8px;
  color: #40534e;
  font-size: 12px;
}

.bars i {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 2px;
  background: var(--green-700);
}

.review-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px 260px;
  gap: 14px;
}

.paste-box textarea,
.prompt-box textarea {
  width: 100%;
  min-height: 248px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  resize: vertical;
  line-height: 1.85;
}

.paste-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.risk-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.risk-card {
  padding: 10px 6px;
  border: 1px solid;
  border-radius: 6px;
  text-align: center;
}

.risk-card span,
.risk-card strong {
  display: block;
}

.risk-card strong {
  margin-top: 4px;
  font-size: 24px;
}

.risk-card.red {
  border-color: #fecaca;
  background: #fff1f2;
}

.risk-card.orange {
  border-color: #fed7aa;
  background: #fff7ed;
}

.risk-card.green {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.risk-list {
  display: grid;
  gap: 7px;
}

.risk-list div {
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  color: #40534e;
  font-size: 12px;
}

.risk-list .warn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  position: relative;
}

.compare-grid::after {
  content: "→\A→\A→";
  white-space: pre;
  position: absolute;
  left: 50%;
  top: 56px;
  transform: translateX(-50%);
  color: var(--green-700);
  font-size: 22px;
  line-height: 58px;
}

.compare-grid > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.script-lines {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding-left: 24px;
  line-height: 1.75;
}

.script-lines li {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--soft-line);
}

.estimate-row {
  display: flex;
  gap: 36px;
  margin: 16px 0;
  padding: 13px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
}

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

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

.mock-photo {
  position: relative;
  height: 210px;
  overflow: hidden;
  background:
    linear-gradient(140deg, rgba(0, 91, 78, 0.18), transparent 45%),
    linear-gradient(180deg, #eef8f5, #ffffff);
}

.mock-photo::before {
  width: 130px;
  height: 130px;
  right: 12%;
  bottom: 18%;
  border-radius: 24px;
  background:
    radial-gradient(circle at 35% 35%, #fff 0 14%, transparent 15%),
    linear-gradient(160deg, #0b705f, #cdeee6);
  box-shadow: 0 18px 36px rgba(0, 60, 50, 0.15);
}

.mock-photo::after {
  content: "";
  position: absolute;
  left: 12%;
  bottom: 10%;
  width: 155px;
  height: 62px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 22% 42%, #0c6657 0 8%, transparent 9%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(232, 247, 243, 0.9));
  box-shadow: 0 12px 28px rgba(0, 60, 50, 0.12);
}

.shot-2 .mock-photo {
  background:
    radial-gradient(circle at 28% 38%, rgba(0, 113, 94, 0.18) 0 12%, transparent 13%),
    linear-gradient(135deg, #fff8f0, #eef8f5 70%);
}

.shot-2 .mock-photo::after {
  width: 190px;
  background:
    radial-gradient(circle at 18% 36%, #b7c7d2 0 10%, transparent 11%),
    radial-gradient(circle at 37% 36%, #e5b08c 0 10%, transparent 11%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(238, 248, 246, 0.92));
}

.shot-3 .mock-photo {
  background:
    linear-gradient(90deg, rgba(45, 108, 223, 0.12), transparent 45%),
    linear-gradient(180deg, #f8fffd, #e7f4f0);
}

.shot-3 .mock-photo::before {
  border-radius: 18px;
  transform: rotate(-8deg);
}

.shot-4 .mock-photo {
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.12), transparent 40%),
    linear-gradient(180deg, #ffffff, #edf7f4);
}

.shot-4 .mock-photo::after {
  width: 175px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 91, 78, 0.18) 0 8px, transparent 8px 18px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(232, 247, 243, 0.9));
}

.mock-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mock-photo:has(img)::before,
.mock-photo:has(img)::after {
  display: none;
}

.image-card > div:last-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
}

.image-actions {
  display: flex;
  gap: 10px;
  margin: 10px 0 14px;
}

.image-actions .btn {
  min-width: 106px;
}

.prompt-box {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  font-weight: 800;
}

.prompt-box textarea {
  min-height: 88px;
  font-weight: 400;
}

.charts-row {
  grid-template-columns: 1.35fr 0.8fr 0.8fr;
  margin-bottom: 14px;
}

.chart-card {
  min-height: 245px;
  margin-bottom: 0;
}

.line-chart {
  width: 100%;
  height: 205px;
}

.line-chart .grid path {
  stroke: #dbe5e2;
  stroke-dasharray: 4 4;
}

.blue-line,
.green-line,
.orange-line {
  fill: none;
  stroke-width: 3;
}

.blue-line {
  stroke: #2d6cdf;
}

.green-line {
  stroke: var(--green-700);
}

.orange-line {
  stroke: #fb8500;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
}

.donut {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: conic-gradient(#006d5b 0 36%, #2d6cdf 36% 62%, #fb8500 62% 81%, #50b3c8 81% 100%);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  background: #fff;
}

.donut-wrap ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 16px;
  color: #40534e;
  font-size: 12px;
}

.funnel {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 30px;
}

.funnel div {
  width: var(--w);
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #b6d8d1;
  background: #eaf7f4;
  clip-path: polygon(0 0, 100% 0, 90% 100%, 10% 100%);
  color: var(--green-800);
}

.bottom-panels,
.settings-grid {
  grid-template-columns: repeat(3, 1fr);
}

.small-panel {
  min-height: 180px;
  margin-bottom: 0;
}

.mini-thumb {
  display: block;
  width: 44px;
  height: 32px;
  border-radius: 5px;
  border: 1px solid #cfe0dc;
  background:
    radial-gradient(circle at 72% 34%, #fff 0 13%, transparent 14%),
    linear-gradient(135deg, #0b705f, #cdeee6);
}

.mini-2 {
  background:
    radial-gradient(circle at 30% 40%, #d3dce2 0 12%, transparent 13%),
    radial-gradient(circle at 48% 42%, #e7b890 0 12%, transparent 13%),
    linear-gradient(135deg, #fff7ed, #dff3ee);
}

.mini-3 {
  background:
    linear-gradient(135deg, rgba(45, 108, 223, 0.35), transparent 45%),
    linear-gradient(135deg, #eaf7f4, #fff);
}

.mini-4 {
  background:
    repeating-linear-gradient(90deg, rgba(0, 91, 78, 0.25) 0 4px, transparent 4px 10px),
    #f7fbfa;
}

.mini-5 {
  background:
    radial-gradient(circle at 38% 38%, #1f2937 0 12%, transparent 13%),
    linear-gradient(135deg, #f0fdf4, #fff);
}

.shot-thumb {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 8px;
  min-width: 118px;
}

.shot-thumb img {
  width: 58px;
  height: 44px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid #d7e4e1;
}

.shot-thumb em {
  color: #40534e;
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.settings-panel {
  max-width: 980px;
}

.setting {
  min-height: 130px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
}

.setting strong,
.setting span,
.setting p {
  display: block;
}

.setting span {
  margin: 10px 0;
  color: var(--green-800);
  font-weight: 800;
}

.setting p {
  color: var(--muted);
  line-height: 1.7;
}

.footer-actions {
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 50;
  transform: translate(-50%, 12px);
  padding: 12px 18px;
  border-radius: 8px;
  background: rgba(0, 62, 52, 0.95);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: 0.18s ease;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.btn[disabled],
.btn.is-loading {
  cursor: wait;
  opacity: 0.58;
  pointer-events: none;
}

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

.workspace-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 31, 27, 0.36);
  backdrop-filter: blur(2px);
}

.workspace-modal-panel {
  position: relative;
  width: min(720px, calc(100vw - 48px));
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
}

.modal-body {
  display: grid;
  gap: 12px;
  color: #30443e;
  line-height: 1.72;
}

.modal-body pre {
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfa;
  white-space: pre-wrap;
}

.secret-status {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfa;
  color: #30443e;
  font-weight: 700;
}

.secret-form {
  display: grid;
  gap: 12px;
}

.secret-form label {
  display: grid;
  gap: 6px;
  color: #30443e;
  font-weight: 700;
}

.secret-form input {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  background: #fff;
  color: var(--ink);
}

.secret-form input:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(0, 113, 94, 0.12);
}

.secret-note {
  color: var(--muted);
  line-height: 1.7;
}

.secret-setting .tag {
  margin-left: 6px;
}

/* Interaction and polish layer */
.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 18%),
    linear-gradient(180deg, var(--green-950), #003f36 58%, #022824);
}

.brand-mark {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 12px 26px rgba(0, 20, 16, 0.24);
}

.nav-item {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.nav-item::before {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: -1;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transform: translateX(-6px);
  transition: 0.18s ease;
}

.nav-item:hover::before,
.nav-item:focus-visible::before {
  opacity: 1;
  transform: translateX(0);
}

.nav-item:hover {
  color: #fff;
}

.nav-item.active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 3px;
  height: 20px;
  border-radius: 0 2px 2px 0;
  background: #9ff7e6;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: auto;
  min-height: 66px;
  padding-top: 10px;
  padding-bottom: 10px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(0, 65, 53, 0.08), 0 10px 30px rgba(0, 45, 38, 0.05);
}

.topbar > div:first-child p {
  margin: 0 0 4px;
  color: var(--green-700);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.topbar h1,
.top-left h1 {
  letter-spacing: 0;
  line-height: 1.15;
}

.top-actions select,
.select-line,
.field,
.search,
.paste-box textarea,
.prompt-box textarea,
.text-box {
  border-color: #cbdcd8;
  background: linear-gradient(180deg, #fff, #fbfefd);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.top-actions select:hover,
.select-line:hover,
.field:hover,
.search:hover,
.paste-box textarea:hover,
.prompt-box textarea:hover {
  border-color: #9ccac1;
}

.top-actions select {
  min-height: 36px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #18352f;
  font-weight: 800;
}

.page {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 220px),
    transparent;
}

.workspace {
  animation: page-enter 0.28s ease both;
}

.panel,
.right-rail,
.notice,
.filterbar {
  border-color: rgba(190, 212, 207, 0.9);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.panel {
  position: relative;
  overflow: clip;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--green-700), var(--cyan), transparent 76%);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.panel:hover::before,
.right-rail:hover::before {
  opacity: 0.7;
}

.panel:hover,
.right-rail:hover,
.image-card:hover,
.metric:hover,
.ai-card:hover,
.template:hover,
.product-row:hover {
  border-color: #a8cbc4;
  box-shadow: var(--shadow-lift);
}

.panel,
.right-rail,
.image-card,
.metric,
.ai-card,
.template,
.product-row,
.step,
.matrix-cell {
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.panel-head h2,
.right-rail h2 {
  color: #0d2924;
}

.panel-head h2::after,
.rail-title h2::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  margin-top: 7px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--green-600), var(--cyan));
}

.btn,
.filter-line button,
.duration button,
.selected-tags button,
.tabs button,
.round-icon,
.icon-btn {
  user-select: none;
}

.btn {
  min-height: 38px;
  border-color: #bfd5d0;
  background: linear-gradient(180deg, #fff, #f5fbf9);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85), 0 8px 16px rgba(0, 60, 50, 0.04);
}

.btn:hover {
  border-color: var(--green-600);
  color: var(--green-900);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 70, 59, 0.12);
}

.btn:active,
.nav-item:active,
.step:active,
.template:active,
.product-row:active {
  transform: translateY(0) scale(0.99);
}

.btn.primary {
  border-color: #006a58;
  background: linear-gradient(180deg, #068c76, #005a4c);
  box-shadow: 0 12px 24px rgba(0, 92, 76, 0.2);
}

.btn.primary:hover {
  color: #fff;
  background: linear-gradient(180deg, #0a9a82, #006250);
}

.btn.ghost {
  background: transparent;
  box-shadow: none;
}

.btn.danger {
  border-color: #fecaca;
  color: #b42318;
  background: #fff7f7;
}

.round-icon:hover,
.icon-btn:hover {
  background: var(--green-100);
  color: var(--green-900);
}

.notice {
  border-color: #ffd29e;
  background:
    linear-gradient(90deg, rgba(249, 115, 22, 0.12), rgba(255, 255, 255, 0.9)),
    #fffaf3;
}

.step {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(244, 251, 248, 0.95)),
    #fff;
}

.step::after {
  content: "";
  position: absolute;
  inset: auto 14px 12px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green-600), var(--cyan));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease;
}

.step:hover {
  border-color: #88beb4;
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(0, 74, 62, 0.12);
}

.step:hover::after {
  transform: scaleX(1);
}

.step:hover b {
  background: linear-gradient(145deg, var(--green-700), var(--cyan));
}

.metric {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(240, 248, 245, 0.85)),
    #fff;
}

.metric:hover {
  transform: translateY(-2px);
}

.metric strong {
  background: linear-gradient(90deg, var(--green-900), #1c6da8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.data-table th {
  background: linear-gradient(180deg, #f3faf7, #eaf4f1);
}

.data-table tbody tr {
  transition: background-color 0.14s ease, box-shadow 0.14s ease;
}

.data-table tbody tr:hover {
  background: #f4fbf8;
  box-shadow: inset 3px 0 0 var(--green-600);
}

.tag {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.right-rail {
  top: 84px;
}

.right-rail::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--green-600));
  opacity: 0.65;
}

.rail-title button:hover {
  color: var(--green-900);
  transform: translateY(-1px);
}

.ai-card {
  background:
    linear-gradient(180deg, #fff, #fbfefd);
}

.ai-card.risk {
  background: linear-gradient(180deg, #fff, #fff6f4);
}

.tabs button {
  position: relative;
  border-radius: 6px 6px 0 0;
}

.tabs button:hover {
  background: #f3faf7;
  color: var(--green-900);
}

.tabs button.active {
  background: linear-gradient(180deg, #f2fbf8, #fff);
}

.filter-line button:hover,
.duration button:hover {
  border-color: var(--green-600);
  background: #f2fbf8;
  color: var(--green-900);
  transform: translateY(-1px);
}

.filter-line button.active,
.duration button.active {
  box-shadow: inset 0 0 0 1px rgba(0, 113, 94, 0.16), 0 8px 18px rgba(0, 92, 76, 0.08);
}

.topic-matrix {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--soft-line);
}

.matrix-head {
  background: linear-gradient(180deg, #f4faf8, #eaf4f1);
}

.matrix-cell:hover {
  position: relative;
  z-index: 1;
  background: #f7fdfb;
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(0, 72, 60, 0.12);
}

.template:hover,
.product-row:hover {
  transform: translateX(2px);
}

.script-seg {
  background: #fff;
}

.script-seg:hover {
  border-color: #9ccac1;
  box-shadow: 0 10px 24px rgba(0, 60, 50, 0.08);
}

.script-seg p:focus {
  background: #fbfffd;
}

.image-card:hover {
  transform: translateY(-2px);
}

.mock-photo img {
  transition: transform 0.32s ease, filter 0.32s ease;
}

.image-card:hover .mock-photo img {
  transform: scale(1.035);
  filter: saturate(1.06) contrast(1.03);
}

.score-ring {
  box-shadow: inset 0 0 0 1px rgba(0, 80, 67, 0.08), 0 14px 28px rgba(0, 74, 62, 0.12);
}

.workspace-modal {
  animation: modal-fade 0.16s ease both;
}

.workspace-modal-panel {
  box-shadow: 0 24px 70px rgba(0, 31, 26, 0.26);
  animation: modal-rise 0.2s ease both;
}

.toast {
  background: linear-gradient(180deg, rgba(0, 79, 66, 0.98), rgba(0, 51, 43, 0.98));
  box-shadow: 0 16px 40px rgba(0, 45, 38, 0.24);
}

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

@keyframes modal-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-rise {
  from {
    transform: translateY(10px) scale(0.985);
  }
  to {
    transform: translateY(0) scale(1);
  }
}

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

@media (max-width: 1500px) {
  #app {
    grid-template-columns: 178px 1fr;
  }

  .kb-layout,
  .script-layout,
  .image-layout {
    grid-template-columns: 300px minmax(0, 1fr) 288px;
  }

  .script-layout {
    grid-template-columns: 258px minmax(0, 1fr) 288px;
  }

  .image-layout {
    grid-template-columns: 250px minmax(0, 1fr) 288px;
  }

  .three-col,
  .review-layout {
    grid-template-columns: minmax(0, 1fr) 288px;
  }

  .topbar {
    padding: 0 20px;
  }

  .metric-grid.wide {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  html,
  body,
  #app {
    height: auto;
    min-height: 100%;
  }

  #app {
    grid-template-columns: 68px minmax(0, 1fr);
    min-width: 0;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 100vh;
    padding: 12px 8px;
  }

  .brand {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 46px;
    margin-bottom: 14px;
  }

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

  .brand > div:not(.brand-mark),
  .nav-item span,
  .team-card {
    display: none;
  }

  .nav {
    gap: 8px;
  }

  .nav-item {
    grid-template-columns: 1fr;
    place-items: center;
    height: 46px;
    padding: 0;
    border-radius: 10px;
  }

  .nav-item .icon {
    width: 22px;
    height: 22px;
  }

  .app-shell {
    width: 100%;
    max-width: calc(100vw - 68px);
    overflow: visible;
  }

  .topbar {
    align-items: flex-start;
    height: auto;
    min-height: 60px;
    padding: 12px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .top-left {
    width: 100%;
    gap: 8px;
  }

  .top-left h1 {
    font-size: 22px;
    line-height: 1.15;
  }

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .select-line {
    flex: 1 1 128px;
    max-width: 100%;
    min-width: 0;
  }

  .select-line span {
    padding: 0 10px;
  }

  .select-line select {
    width: 100%;
    min-width: 0;
  }

  .top-actions .btn {
    flex: 1 1 128px;
    min-width: 0;
    max-width: 100%;
    padding-inline: 10px;
    white-space: nowrap;
  }

  .top-actions .btn.primary {
    flex-basis: 100%;
  }

  .user-chip,
  .round-icon {
    display: none;
  }

  .page {
    height: auto;
    min-height: calc(100vh - 84px);
    padding: 12px;
    overflow-x: hidden;
  }

  .notice,
  .panel,
  .ai-card,
  .setting,
  .metric,
  .step {
    overflow-wrap: anywhere;
  }

  .notice {
    display: block;
    min-width: 0;
    padding: 10px 12px;
    line-height: 1.55;
  }

  .notice .icon {
    display: inline-block;
    margin-right: 6px;
    vertical-align: -4px;
  }

  .three-col,
  .kb-layout,
  .script-layout,
  .image-layout,
  .review-layout,
  .single {
    grid-template-columns: minmax(0, 1fr);
  }

  .steps,
  .metric-grid,
  .metric-grid.wide,
  .cards-grid,
  .settings-grid,
  .shot-grid,
  .thumb-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel,
  .main-editor,
  .left-column,
  .right-rail {
    max-width: 100%;
    overflow-x: auto;
  }

  .panel-head {
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
  }

  .footer-actions,
  .image-actions,
  .paste-foot {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .footer-actions .btn,
  .image-actions .btn,
  .paste-foot .btn {
    flex: 1 1 140px;
  }

  .data-table,
  table {
    min-width: 620px;
  }

  .script-tabs,
  .tabs {
    overflow-x: auto;
    white-space: nowrap;
  }

  .script-seg {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  #app {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .sidebar {
    padding: 10px 6px;
  }

  .app-shell {
    max-width: calc(100vw - 58px);
  }

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

  .nav-item {
    height: 42px;
  }

  .topbar {
    padding: 10px;
  }

  .top-left h1 {
    font-size: 20px;
  }

  .btn {
    min-height: 34px;
    padding: 0 10px;
  }
}
