:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-2: #eef3ef;
  --ink: #17211c;
  --muted: #607067;
  --line: #d9e0da;
  --accent: #08756b;
  --accent-2: #c8502f;
  --accent-3: #365fa7;
  --accent-4: #d4a029;
  --danger: #b83535;
  --ok: #218052;
  --shadow: 0 18px 52px rgba(28, 40, 35, 0.09);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body.login-mode {
  background:
    radial-gradient(circle at 15% 20%, rgba(51, 227, 206, 0.2), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(200, 80, 47, 0.15), transparent 28%),
    linear-gradient(135deg, #06090d 0%, #101923 44%, #0b0f15 100%);
}

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

button {
  cursor: pointer;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  width: min(1180px, 100%);
  min-height: min(720px, calc(100vh - 64px));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(202, 236, 230, 0.22);
  border-radius: 18px;
  background: rgba(11, 17, 24, 0.72);
  box-shadow: 0 28px 110px rgba(0, 0, 0, 0.48);
}

.login-visual {
  position: relative;
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: 34px;
  background:
    linear-gradient(90deg, rgba(5, 9, 14, 0.2), rgba(5, 9, 14, 0.75)),
    #0b1118;
  color: #fff;
}

.login-visual::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 8, 13, 0.72) 0%, rgba(5, 8, 13, 0.34) 42%, rgba(5, 8, 13, 0.08) 70%),
    linear-gradient(0deg, rgba(5, 8, 13, 0.82), transparent 45%);
  content: "";
  pointer-events: none;
}

.login-map-stage,
.login-grid-floor,
.login-city-plane {
  position: absolute;
  inset: 0;
}

.login-map-stage {
  overflow: hidden;
  background:
    radial-gradient(circle at 68% 18%, rgba(81, 214, 231, 0.22), transparent 22%),
    radial-gradient(circle at 18% 75%, rgba(96, 237, 205, 0.16), transparent 26%),
    linear-gradient(140deg, #070a10, #111925 55%, #05080c);
  perspective: 900px;
}

.login-map-stage::before {
  position: absolute;
  inset: -18%;
  background:
    linear-gradient(115deg, transparent 0 42%, rgba(255, 255, 255, 0.18) 49%, transparent 52%),
    radial-gradient(circle at 50% 48%, rgba(93, 241, 218, 0.12), transparent 42%);
  content: "";
  filter: blur(16px);
  opacity: 0.55;
  transform: translateX(-12%);
  animation: loginLightSweep 8s ease-in-out infinite;
}

.login-grid-floor {
  left: -18%;
  top: -10%;
  width: 138%;
  height: 130%;
  background:
    linear-gradient(90deg, rgba(86, 247, 219, 0.1) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.34;
  transform: rotateX(62deg) rotateZ(-17deg) translate3d(-4%, 10%, -100px) scale(1.18);
  transform-origin: center;
  animation: loginGridFlow 9s linear infinite;
}

.login-city-plane {
  transform: rotateX(61deg) rotateZ(-17deg) translate3d(-5%, 6%, 0) scale(1.08);
  transform-origin: center;
  animation: loginCityDrift 15s ease-in-out infinite alternate;
}

.city-block {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--d);
  border: 1px solid rgba(199, 217, 226, 0.18);
  border-radius: 6px;
  background:
    linear-gradient(145deg, rgba(49, 57, 72, 0.95), rgba(13, 18, 27, 0.98)),
    #151b25;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.38);
}

.city-block::before {
  position: absolute;
  right: -1px;
  bottom: 100%;
  left: -1px;
  height: var(--h);
  border: 1px solid rgba(203, 223, 231, 0.14);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 12px, rgba(116, 151, 169, 0.17) 12px 14px),
    linear-gradient(90deg, rgba(38, 47, 62, 0.96), rgba(7, 10, 16, 0.98));
  content: "";
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.b1 { --x: 4%; --y: 18%; --w: 84px; --d: 74px; --h: 118px; }
.b2 { --x: 18%; --y: 10%; --w: 92px; --d: 62px; --h: 172px; }
.b3 { --x: 34%; --y: 17%; --w: 70px; --d: 92px; --h: 126px; }
.b4 { --x: 52%; --y: 8%; --w: 118px; --d: 82px; --h: 156px; }
.b5 { --x: 73%; --y: 15%; --w: 86px; --d: 78px; --h: 132px; }
.b6 { --x: 86%; --y: 25%; --w: 128px; --d: 88px; --h: 194px; }
.b7 { --x: 8%; --y: 42%; --w: 134px; --d: 84px; --h: 88px; }
.b8 { --x: 27%; --y: 38%; --w: 96px; --d: 96px; --h: 210px; }
.b9 { --x: 43%; --y: 45%; --w: 120px; --d: 82px; --h: 132px; }
.b10 { --x: 64%; --y: 39%; --w: 86px; --d: 116px; --h: 176px; }
.b11 { --x: 81%; --y: 49%; --w: 126px; --d: 76px; --h: 102px; }
.b12 { --x: 15%; --y: 68%; --w: 156px; --d: 96px; --h: 78px; }
.b13 { --x: 38%; --y: 70%; --w: 92px; --d: 124px; --h: 154px; }
.b14 { --x: 56%; --y: 67%; --w: 148px; --d: 86px; --h: 112px; }
.b15 { --x: 76%; --y: 72%; --w: 106px; --d: 112px; --h: 150px; }
.b16 { --x: 91%; --y: 64%; --w: 96px; --d: 94px; --h: 114px; }

.map-node {
  position: absolute;
  z-index: 1;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(236, 249, 255, 0.58);
  border-radius: 50%;
  color: #f8fbff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.8);
  animation: loginNodePulse 2.8s ease-in-out infinite;
}

.map-node::before {
  position: absolute;
  inset: 9px 4px auto;
  height: 92px;
  background: linear-gradient(180deg, rgba(104, 232, 241, 0.44), rgba(104, 232, 241, 0));
  content: "";
  filter: blur(10px);
  opacity: 0.75;
  transform: translateY(23px);
}

.map-node::after {
  position: relative;
  content: attr(data-label);
}

.node-a { left: 13%; top: 35%; animation-delay: -0.4s; }
.node-b { right: 18%; top: 24%; animation-delay: -1.2s; }
.node-c { right: 11%; bottom: 24%; animation-delay: -2s; }
.node-d { left: 48%; bottom: 31%; animation-delay: -1.7s; }

.scan-line {
  position: absolute;
  top: 8%;
  bottom: 6%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(221, 250, 255, 0.82), transparent);
  box-shadow: 0 0 18px rgba(134, 245, 255, 0.72);
  opacity: 0.72;
  animation: loginScan 6.5s ease-in-out infinite;
}

.scan-a { left: 37%; }
.scan-b { left: 76%; animation-delay: -3.1s; }

.login-stat-card {
  position: absolute;
  top: 18%;
  right: 8%;
  z-index: 2;
  display: grid;
  width: min(460px, 55%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 26px;
  padding: 24px 28px;
  border: 1px solid rgba(225, 242, 249, 0.16);
  border-radius: 18px;
  background: rgba(31, 39, 52, 0.58);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
  animation: loginPanelFloat 6.2s ease-in-out infinite;
}

.login-stat-card small {
  display: block;
  color: rgba(233, 243, 247, 0.58);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.login-stat-card strong {
  display: block;
  margin-top: 6px;
  color: #f8fbff;
  font-size: clamp(18px, 2.6vw, 26px);
  line-height: 1;
}

.login-brand {
  position: relative;
  z-index: 3;
  display: flex;
  gap: 14px;
  align-items: center;
}

.login-brand .eyebrow {
  color: rgba(255, 255, 255, 0.7);
}

.login-brand h1 {
  margin: 3px 0 0;
  font-size: 20px;
}

.login-command {
  position: relative;
  z-index: 3;
  display: grid;
  max-width: 560px;
  gap: 14px;
  padding-bottom: 18px;
}

.login-command span {
  width: fit-content;
  padding: 6px 10px;
  border: 1px solid rgba(107, 248, 219, 0.32);
  border-radius: 999px;
  background: rgba(8, 117, 107, 0.15);
  color: rgba(188, 255, 242, 0.9);
  font-size: 12px;
  font-weight: 850;
}

.login-command strong {
  max-width: 720px;
  color: #f8fbff;
  font-size: clamp(34px, 4.8vw, 58px);
  line-height: 1.04;
  letter-spacing: 0;
  text-shadow: 0 0 32px rgba(255, 255, 255, 0.22);
}

.login-command p {
  max-width: 560px;
  margin: 0;
  color: rgba(232, 240, 244, 0.78);
  font-size: 15px;
  line-height: 1.7;
}

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

.login-action-row span:first-child {
  border-color: rgba(101, 244, 214, 0.62);
  background: linear-gradient(135deg, #55e8de, #5ee29d);
  color: #06120f;
  box-shadow: 0 0 24px rgba(82, 232, 211, 0.25);
}

.login-action-row span:last-child {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(244, 248, 250, 0.84);
}

.login-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 38px;
  border-left: 1px solid rgba(218, 240, 236, 0.13);
  background:
    linear-gradient(180deg, rgba(19, 29, 40, 0.88), rgba(11, 16, 23, 0.92)),
    #101820;
  color: #f7fbf8;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.04);
}

.login-card h2 {
  margin: 6px 0 10px;
  color: #f7fbf8;
  font-size: 34px;
}

.login-card p {
  margin: 0;
  color: rgba(226, 238, 234, 0.68);
  line-height: 1.65;
}

.login-card .eyebrow {
  color: rgba(109, 244, 218, 0.82);
}

.login-card .field span {
  color: rgba(224, 238, 234, 0.7);
  font-size: 12px;
  font-weight: 850;
}

.login-card input {
  border-color: rgba(225, 241, 237, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: #f8fbff;
  outline: none;
}

.login-card input::placeholder {
  color: rgba(225, 239, 235, 0.38);
}

.login-card input:focus {
  border-color: rgba(97, 237, 211, 0.7);
  box-shadow: 0 0 0 3px rgba(82, 232, 211, 0.12);
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.login-submit {
  width: 100%;
  min-height: 46px;
  box-shadow: 0 14px 32px rgba(8, 117, 107, 0.28);
}

.login-error {
  padding: 10px 12px;
  border: 1px solid rgba(255, 119, 119, 0.28);
  border-radius: var(--radius);
  background: rgba(184, 53, 53, 0.18);
  color: #ffb7b7 !important;
  font-weight: 800;
}

.login-hint {
  display: grid;
  gap: 4px;
  margin-top: 20px;
  padding: 12px;
  border: 1px solid rgba(225, 241, 237, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.login-hint span {
  color: rgba(109, 244, 218, 0.82);
  font-size: 12px;
  font-weight: 800;
}

.login-hint strong {
  color: rgba(246, 251, 248, 0.82);
}

@keyframes loginCityDrift {
  0% {
    transform: rotateX(61deg) rotateZ(-17deg) translate3d(-7%, 8%, 0) scale(1.08);
  }

  100% {
    transform: rotateX(61deg) rotateZ(-17deg) translate3d(4%, -2%, 0) scale(1.16);
  }
}

@keyframes loginGridFlow {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 72px 72px;
  }
}

@keyframes loginLightSweep {
  0%,
  100% {
    opacity: 0.36;
    transform: translateX(-28%);
  }

  50% {
    opacity: 0.72;
    transform: translateX(22%);
  }
}

@keyframes loginNodePulse {
  0%,
  100% {
    box-shadow:
      0 0 0 0 rgba(91, 235, 220, 0.35),
      0 0 24px rgba(222, 248, 255, 0.54);
    transform: translateY(0);
  }

  50% {
    box-shadow:
      0 0 0 12px rgba(91, 235, 220, 0),
      0 0 34px rgba(222, 248, 255, 0.82);
    transform: translateY(-6px);
  }
}

@keyframes loginPanelFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(14px, -12px, 0);
  }
}

@keyframes loginScan {
  0%,
  100% {
    opacity: 0.18;
    transform: translateX(-18px);
  }

  50% {
    opacity: 0.76;
    transform: translateX(18px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-map-stage::before,
  .login-grid-floor,
  .login-city-plane,
  .map-node,
  .scan-line,
  .login-stat-card {
    animation: none;
  }
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 18px;
  align-items: center;
  min-height: 78px;
  overflow: visible;
  padding: 12px 22px;
  color: #f6fbf8;
  background:
    linear-gradient(135deg, rgba(8, 117, 107, 0.98), rgba(30, 65, 74, 0.99)),
    #17494b;
  box-shadow: 0 14px 34px rgba(23, 73, 75, 0.18);
}

.brand-block {
  flex: 0 0 250px;
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

.eyebrow,
.panel-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.rail .eyebrow {
  color: rgba(255, 255, 255, 0.65);
}

.brand-block h1,
.topbar h2 {
  margin: 3px 0 0;
}

.brand-block h1 {
  color: #fff;
  font-size: 18px;
}

.step-list {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(6, minmax(112px, 1fr));
  gap: 8px;
  min-width: 0;
}

.step-button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  min-height: 54px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.76);
  text-align: left;
}

.step-button:hover,
.step-button.active {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.step-button.complete .step-index {
  background: #e9b64a;
  color: #26312d;
}

.step-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 800;
}

.step-index svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.step-title {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
}

.step-desc {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.3;
}

.workspace {
  min-width: 0;
  padding: 20px 22px 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.topbar h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.role-switch {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 5px 20px rgba(38, 55, 49, 0.05);
}

.role-switch span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

select {
  min-height: 32px;
  padding: 5px 34px 5px 10px;
}

.ghost-button,
.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 7px;
  font-weight: 800;
}

.ghost-button,
.secondary-button,
.icon-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

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

.danger-button {
  border: 1px solid #ffd7d7;
  background: #fff0f0;
  color: var(--danger);
}

.ghost-button,
.primary-button,
.secondary-button,
.danger-button {
  padding: 0 14px;
}

.icon-button {
  width: 40px;
  padding: 0;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.main-panel,
.context-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.main-panel {
  min-height: calc(100vh - 188px);
  padding: 22px;
}

.side-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  position: static;
}

.context-card {
  padding: 12px;
}

.context-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
}

.context-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.context-row dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.context-row dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
}

.activity-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.activity-list li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.activity-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
}

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

.section-head h3 {
  margin: 4px 0 6px;
  font-size: 24px;
}

.section-head p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.locator-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.selector-block {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.selector-block h4 {
  margin: 0 0 10px;
  font-size: 16px;
}

.option-grid {
  display: grid;
  gap: 7px;
}

.option-button {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.option-button:hover,
.option-button.selected {
  border-color: color-mix(in srgb, var(--accent), white 25%);
  background: #ecf8f5;
}

.option-main {
  min-width: 0;
}

.option-title {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
}

.option-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.option-pill,
.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.summary-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary-item strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.action-row.no-margin {
  margin-top: 0;
}

.library-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) repeat(4, minmax(120px, 0.7fr));
  gap: 10px;
  margin-bottom: 16px;
}

.library-toolbar input,
.library-toolbar select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
}

.creative-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.metric-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.creative-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-height: 650px;
  overflow: auto;
  padding-right: 5px;
}

.creative-card {
  display: grid;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.creative-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 117, 107, 0.14);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 0;
  overflow: hidden;
  background: #dae8e2;
}

.thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.28), transparent 34%),
    var(--thumb-bg);
}

.thumb::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 32px;
  height: 32px;
  clip-path: polygon(28% 18%, 28% 82%, 84% 50%);
  background: rgba(255, 255, 255, 0.88);
}

.thumb-lines {
  position: absolute;
  left: 12px;
  right: 54px;
  bottom: 12px;
  z-index: 1;
  display: grid;
  gap: 6px;
}

.thumb-lines span {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
}

.thumb-lines span:nth-child(2) {
  width: 68%;
}

.creative-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.creative-title {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.3;
}

.creative-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.creative-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.creative-footer span:first-child {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.score {
  color: var(--accent);
  font-weight: 900;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.82fr);
  gap: 16px;
  align-items: start;
}

.workbench-build-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.product-pick-panel,
.reference-panel,
.content-preview-block {
  min-width: 0;
}

.workbench-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.product-choice-button,
.workbench-creative-button {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.product-choice-button:hover,
.product-choice-button.selected,
.workbench-creative-button:hover,
.workbench-creative-button.selected {
  border-color: var(--accent);
  background: #ecf8f5;
  box-shadow: 0 0 0 3px rgba(8, 117, 107, 0.1);
}

.product-choice-button strong,
.product-choice-button span,
.product-choice-button small,
.workbench-creative-button strong,
.workbench-creative-button span,
.workbench-creative-button small {
  display: block;
  overflow-wrap: anywhere;
}

.product-choice-button span,
.product-choice-button small,
.workbench-creative-button span,
.workbench-creative-button small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.workbench-creative-button .creative-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.workbench-creative-button .creative-chip-row .tag-pill,
.workbench-creative-button .creative-chip-row .selection-mark {
  display: inline-flex;
}

.workbench-creative-button .selection-mark {
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

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

.reference-column {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.mini-section-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.mini-section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-creative-list {
  display: grid;
  gap: 8px;
  max-height: 390px;
  overflow: auto;
  padding-right: 4px;
}

.revision-field {
  margin-top: 12px;
}

.revision-field textarea {
  min-height: 86px;
}

.content-preview-block {
  position: static;
}

.preview-mode-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.preview-mode-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-weight: 850;
}

.preview-mode-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.preview-dialog {
  display: grid;
  gap: 12px;
  min-height: 420px;
  padding: 14px;
  border: 1px solid #c7d8d1;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #ffffff, #f6faf8);
}

.preview-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.preview-summary span {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

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

.shot-preview-list article,
.copy-preview-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.shot-preview-list p,
.copy-preview-card p,
.copy-preview-card small {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.workbench-side {
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.generation-status {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #c7d8d1;
  border-radius: var(--radius);
  background: #fff;
}

.generation-status span {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eaf8f5;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

.generation-status span.done {
  background: #f6eed6;
  color: #8a6714;
}

.generation-status small {
  color: var(--muted);
  line-height: 1.45;
}

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

.responsible-item {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.responsible-item.selected {
  border-color: var(--accent);
  background: #ecf8f5;
}

.responsible-item strong,
.responsible-item span,
.responsible-item small {
  display: block;
  overflow-wrap: anywhere;
}

.responsible-item span,
.responsible-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.editor-block,
.preview-block,
.task-board,
.data-table-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.editor-block,
.preview-block {
  padding: 16px;
}

.editor-block h4,
.preview-block h4,
.task-board h4,
.data-table-card h4 {
  margin: 0 0 12px;
  font-size: 16px;
}

.prompt-grid {
  display: grid;
  gap: 12px;
}

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

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.field textarea,
.field input,
.field select {
  width: 100%;
  padding: 10px 11px;
}

.field textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.6;
}

.script-output {
  width: 100%;
  min-height: 260px;
  padding: 14px;
  border: 1px dashed #b9c9c0;
  border-radius: var(--radius);
  background: #fff;
  color: #26342f;
  line-height: 1.65;
  white-space: pre-line;
  resize: vertical;
}

.script-editor {
  font-family: inherit;
}

.preview-frame {
  position: relative;
  display: grid;
  min-height: 420px;
  overflow: hidden;
  align-content: end;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--preview-bg);
}

.preview-frame::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 7px;
}

.phone-safe {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.caption-chip {
  width: fit-content;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
  color: #15231e;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.caption-large {
  max-width: 95%;
  margin: 0;
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.36);
}

.caption-sub {
  max-width: 96%;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.review-layout,
.production-layout,
.data-layout {
  display: grid;
  gap: 16px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.review-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.review-card h4 {
  margin: 0 0 8px;
}

.review-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  margin-bottom: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #edf5f2;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

.comment-box {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.comment-box textarea {
  min-height: 96px;
  padding: 10px;
  resize: vertical;
}

.task-board {
  padding: 16px;
}

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

.task-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.task-card strong {
  display: block;
  overflow-wrap: anywhere;
}

.task-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.permission-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.permission-card strong {
  display: block;
}

.permission-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.data-kpi {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.data-kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.data-kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
}

.data-table-card {
  padding: 16px;
}

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

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

td {
  font-size: 14px;
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 28px;
  border: 1px dashed #b8c8bf;
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.creative-grid .empty-state {
  grid-column: 1 / -1;
}

.empty-state strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
}

.role-card-body {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.role-card-body strong {
  display: block;
  font-size: 15px;
}

.role-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.role-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

button:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.block-title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.block-title-row h4 {
  margin: 0;
}

.option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: stretch;
}

.remove-option,
.menu-option {
  color: var(--danger);
}

.menu-option {
  color: var(--accent);
}

.category-filter {
  width: 100%;
  min-height: 38px;
  margin-bottom: 10px;
  padding: 7px 10px;
}

.inline-add-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 8px;
  margin-top: 12px;
}

.inline-add-grid input {
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
}

.product-detail-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.compact-head {
  margin-bottom: 14px;
}

.product-detail-grid,
.metric-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.product-detail-grid .field:nth-child(n + 5) {
  grid-column: span 2;
}

.custom-field-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.custom-field-list {
  display: grid;
  gap: 8px;
}

.custom-field-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.55fr) minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
}

.custom-field-row input {
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
}

.empty-mini {
  padding: 12px;
  border: 1px dashed #c5d1ca;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
}

.home-dashboard {
  display: grid;
  gap: 16px;
}

.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  overflow: hidden;
  padding: 24px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(8, 117, 107, 0.92), rgba(31, 45, 70, 0.94)),
    #17283a;
  color: #fff;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.38;
}

.home-hero > * {
  position: relative;
  z-index: 1;
}

.home-hero .eyebrow,
.home-hero p {
  color: rgba(255, 255, 255, 0.72);
}

.home-hero h3 {
  margin: 8px 0;
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.05;
}

.home-hero p {
  max-width: 680px;
  margin: 0;
  line-height: 1.65;
}

.signal-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: center;
  min-height: 210px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
}

.signal-board span {
  min-height: 58px;
  border-radius: 7px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.08);
}

.signal-board span:nth-child(2) {
  background:
    linear-gradient(160deg, rgba(212, 160, 41, 0.75), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.08);
}

.signal-board span:nth-child(3) {
  background:
    linear-gradient(160deg, rgba(54, 95, 167, 0.75), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.08);
}

.signal-board strong,
.signal-board small {
  grid-column: 1 / -1;
  text-align: center;
}

.signal-board strong {
  font-size: 42px;
  line-height: 1;
}

.signal-board small {
  color: rgba(255, 255, 255, 0.64);
  font-weight: 900;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.asset-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
}

.dashboard-kpi {
  min-width: 0;
  padding: 16px;
  border: 1px solid #bfd0c7;
  border-radius: var(--radius);
  background: #fff;
}

.dashboard-kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.dashboard-kpi strong {
  display: block;
  margin-top: 5px;
  font-size: 28px;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.home-grid-single {
  grid-template-columns: 1fr;
}

.dark-board {
  background:
    linear-gradient(135deg, rgba(24, 35, 48, 0.96), rgba(28, 68, 70, 0.94)),
    #1b2835;
  color: #fff;
}

.dark-board h4 {
  color: #fff;
}

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

.home-task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.home-task-card strong,
.home-task-card span {
  display: block;
  overflow-wrap: anywhere;
}

.home-task-card span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.67);
  font-size: 13px;
  line-height: 1.45;
}

.pipeline-meter {
  display: grid;
  gap: 8px;
}

.pipeline-dot {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.pipeline-dot span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-2);
  font-weight: 900;
}

.pipeline-dot.on span {
  background: var(--accent);
  color: #fff;
}

.pipeline-dot strong {
  overflow-wrap: anywhere;
}

.creative-library-layout {
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.filter-rail {
  display: grid;
  gap: 10px;
  max-height: 650px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.filter-group {
  display: grid;
  gap: 8px;
}

.filter-group strong {
  color: var(--muted);
  font-size: 12px;
}

.filter-group div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.filter-chip.active {
  border-color: var(--accent);
  background: #e9f7f4;
  color: var(--accent);
}

.check-card {
  display: grid;
  gap: 10px;
}

.check-card.yes {
  border-color: #b9d8c8;
  background: #f5fbf7;
}

.check-card.no {
  border-color: #f0c6bd;
  background: #fff8f5;
}

.check-card .secondary-button {
  width: fit-content;
}

.production-task {
  display: grid;
  gap: 12px;
}

.production-task.done {
  border-color: #b9d8c8;
  background: #f5fbf7;
}

.metric-edit-grid {
  margin-bottom: 14px;
}

.asset-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(140px, 0.3fr) minmax(150px, 0.35fr);
  gap: 10px;
  margin-bottom: 14px;
}

.asset-toolbar input,
.asset-toolbar select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
}

.asset-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.6fr);
  gap: 16px;
  align-items: start;
}

.asset-list-panel,
.asset-detail-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.asset-list {
  display: grid;
  gap: 10px;
  max-height: 720px;
  overflow: auto;
  padding-right: 4px;
}

.asset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.asset-row.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 117, 107, 0.12);
}

.asset-row h4,
.version-card h4 {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

.asset-row p,
.version-card p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.asset-row-actions {
  display: grid;
  gap: 8px;
  min-width: 150px;
}

.version-stack {
  display: grid;
  gap: 10px;
}

.version-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.version-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.version-metrics span {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.role-manager {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.role-manager-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.role-list-editor {
  display: grid;
  gap: 8px;
}

.role-editor-item {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 60px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.role-editor-item.active {
  border-color: var(--accent);
  background: #eaf8f5;
  box-shadow: 0 0 0 3px rgba(8, 117, 107, 0.11);
}

.role-editor-item strong,
.role-editor-item span {
  display: block;
  overflow-wrap: anywhere;
}

.role-editor-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.role-editor-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.role-editor-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.role-task-field {
  grid-column: 1 / -1;
}

.permission-grid-editor {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.permission-toggle {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.permission-toggle.checked {
  border-color: #aed7ca;
  background: #ecf8f5;
}

.permission-toggle input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.permission-toggle strong,
.permission-toggle small {
  display: block;
  overflow-wrap: anywhere;
}

.permission-toggle strong {
  font-size: 13px;
}

.permission-toggle small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.account-settings {
  display: grid;
  gap: 16px;
}

.account-grid {
  display: grid;
  gap: 14px;
}

.account-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.account-card h4 {
  margin: 0 0 12px;
}

.account-login-grid,
.subaccount-form {
  display: grid;
  gap: 10px;
}

.account-login-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
}

.account-login-card {
  background:
    linear-gradient(135deg, rgba(8, 117, 107, 0.08), rgba(54, 95, 167, 0.06)),
    #fbfcfb;
}

.subaccount-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.account-current {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.account-current span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.account-list-card {
  background: #fff;
}

.account-list {
  display: grid;
  gap: 9px;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.22fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.account-row.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 117, 107, 0.12);
}

.account-row strong,
.account-row span {
  display: block;
  overflow-wrap: anywhere;
}

.account-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.account-role-badge {
  display: inline-flex !important;
  width: fit-content;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  margin-top: 0 !important;
  padding: 5px 9px;
  border: 1px solid rgba(8, 117, 107, 0.18);
  border-radius: 999px;
  background: rgba(8, 117, 107, 0.08);
  color: var(--accent) !important;
  font-size: 12px !important;
  font-weight: 850;
  white-space: nowrap;
}

.account-edit-panel {
  display: grid;
  gap: 12px;
  margin-top: -2px;
  padding: 14px;
  border: 1px solid rgba(8, 117, 107, 0.22);
  border-radius: var(--radius);
  background: #f8fbfa;
  box-shadow: 0 10px 28px rgba(28, 40, 35, 0.06);
}

.account-edit-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.account-edit-actions span {
  margin-right: auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(18, 28, 25, 0.52);
}

.modal-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(720px, 100%);
  max-height: min(860px, calc(100vh - 36px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 28px 90px rgba(18, 28, 25, 0.28);
}

.wide-modal {
  width: min(920px, 100%);
}

.extra-wide-modal {
  width: min(1120px, 100%);
}

.modal-head,
.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-head h3 {
  margin: 4px 0 0;
  font-size: 22px;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.modal-body {
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

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

.span-all {
  grid-column: 1 / -1;
}

.check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-check-list {
  padding: 0;
}

.creative-tag-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.creative-tag-group {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.creative-tag-group > strong {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.tag-group-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.tag-group-add-row input {
  min-width: 0;
  min-height: 34px;
  padding: 7px 9px;
}

.mini-check {
  display: inline-flex;
  position: relative;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.mini-check input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.mini-check:has(input:checked) {
  border-color: var(--accent);
  background: #e9f7f4;
  color: var(--accent);
}

.mini-check span {
  display: block;
}

.board-toolbar,
.asset-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(150px, 0.32fr) auto;
  gap: 10px;
  margin-bottom: 12px;
}

.board-toolbar input,
.board-toolbar select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
}

.column-config {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.compact-add {
  grid-template-columns: minmax(180px, 1fr) auto;
}

.video-board {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  background: #fbfcfb;
}

.video-board-table {
  min-width: 980px;
}

.board-row {
  display: grid;
  grid-template-columns: var(--board-cols);
  gap: 0;
  align-items: stretch;
  width: 100%;
  min-height: 58px;
  padding: 0;
  appearance: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.board-row > span {
  display: flex;
  min-height: 58px;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 11px 10px;
  border-right: 1px solid var(--line);
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.45;
}

.board-row > span:last-child {
  align-items: flex-start;
  border-right: 0;
}

.board-head {
  background: #eef3ef;
  color: var(--muted);
  font-weight: 900;
}

.board-head > span {
  min-height: 42px;
}

.board-product {
  cursor: pointer;
  background: #ecf8f5;
}

.board-mother {
  background: #f8fbfa;
}

.board-product strong,
.board-mother strong,
.board-version strong {
  display: block;
}

.board-product small,
.board-mother small,
.board-version small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.board-product > span:first-child {
  border-left: 4px solid var(--accent);
}

.board-title-cell {
  display: flex;
  flex-direction: row;
  gap: 9px;
  align-items: center;
  justify-content: flex-start;
}

.board-title-stack {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 3px;
}

.board-title-stack small {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.inline-disclosure {
  display: grid;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--accent);
  font-weight: 900;
}

.mother-name-input {
  width: 100%;
  min-height: 30px;
  padding: 4px 6px;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  font-weight: 850;
}

.mother-name-input:hover,
.mother-name-input:focus {
  border-color: var(--line);
  background: #fff;
  outline: 0;
}

.mother-name-input:disabled {
  opacity: 1;
  color: var(--ink);
}

.video-title-input {
  width: 100%;
  min-height: 30px;
  margin-top: 4px;
  padding: 4px 6px;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
}

.video-title-input:hover,
.video-title-input:focus {
  border-color: var(--line);
  background: #fff;
  outline: 0;
}

.video-title-input:disabled {
  opacity: 1;
  color: var(--ink);
}

.board-readonly-pill {
  font-style: normal;
  color: #2f4038;
}

.board-cell-input {
  width: 100%;
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 13px;
}

.board-cell-input:hover,
.board-cell-input:focus {
  border-color: var(--accent);
  background: #fff;
  outline: 0;
}

.board-cell-input:disabled {
  opacity: 1;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
}

.version-detail-link {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 900;
  text-align: left;
}

.version-detail-link:hover {
  text-decoration: underline;
}

.board-row .secondary-button {
  min-height: 32px;
  padding: 0 10px;
}

.board-group .board-mother > span:first-child {
  padding-left: 22px;
}

.board-version {
  background: #fff;
}

.board-version > span:first-child {
  padding-left: 58px;
}

.board-empty-version > span:first-child {
  color: var(--muted);
  font-weight: 700;
}

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

.detail-section-wide {
  grid-column: 1 / -1;
}

.detail-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.detail-section h4 {
  margin: 0 0 12px;
}

.publish-return-section {
  background: #f8fbfa;
}

.publish-return-top {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.return-kpi-grid,
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.return-kpi,
.analysis-card {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.return-kpi span,
.analysis-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.return-kpi strong,
.analysis-card strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.return-kpi small,
.analysis-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

.return-reminder {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.return-reminder strong,
.return-reminder span,
.return-reminder em {
  display: block;
  overflow-wrap: anywhere;
}

.return-reminder strong {
  font-size: 13px;
}

.return-reminder span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.return-reminder em,
.return-status {
  margin-top: 6px;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.return-reminder.done,
.return-status.done {
  color: var(--ok);
}

.return-reminder.due,
.return-status.due {
  color: var(--danger);
}

.return-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.return-snapshot-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.return-snapshot-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.return-snapshot-head h5 {
  margin: 0;
  font-size: 15px;
}

.return-snapshot-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.return-data-table {
  overflow: auto;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.return-data-row {
  display: grid;
  grid-template-columns: 76px 88px repeat(6, minmax(105px, 1fr)) 104px;
  min-width: 980px;
  border-bottom: 1px solid var(--line);
}

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

.return-data-row > span {
  min-width: 0;
  padding: 9px 8px;
  border-right: 1px solid var(--line);
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.35;
}

.return-data-row > span:last-child {
  border-right: 0;
}

.return-data-head {
  background: #eef3ef;
  color: var(--muted);
  font-weight: 900;
}

.return-data-row input {
  width: 100%;
  min-height: 32px;
  padding: 6px 7px;
  font-size: 12px;
}

.detail-board-field-table {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.detail-board-field-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.45fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.detail-board-field-row:last-child {
  border-bottom: 0;
}

.detail-board-field-row > span,
.detail-board-field-row > input {
  min-width: 0;
  padding: 9px 10px;
}

.detail-board-field-row > span {
  display: flex;
  align-items: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.detail-board-field-head {
  background: #eef3ef;
  color: var(--muted);
  font-weight: 900;
}

.detail-board-field-head > span:last-child {
  border-right: 0;
}

.detail-board-field-row > input {
  min-height: 38px;
  border: 0;
  background: transparent;
  font-size: 13px;
}

.detail-board-field-row > input:focus {
  outline: 2px solid rgba(8, 117, 107, 0.16);
  outline-offset: -2px;
}

.return-metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.custom-return-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.custom-return-list {
  display: grid;
  gap: 8px;
}

.custom-return-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) repeat(3, minmax(88px, 1fr)) 40px;
  gap: 8px;
}

.custom-return-row input {
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
}

.muted-line {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.analysis-summary {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.project-info-section {
  background: #fff;
}

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

.modal-danger-zone {
  margin-right: auto;
}

.toggle-grid,
.production-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.boolean-toggle,
.production-detail-button {
  display: grid;
  gap: 5px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.boolean-toggle strong {
  font-size: 22px;
}

.boolean-toggle.yes,
.production-detail-button.done {
  border-color: #b9d8c8;
  background: #f2faf6;
}

.boolean-toggle.no {
  border-color: #efcbc2;
  background: #fff8f5;
}

.production-detail-button span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.detail-dl {
  display: grid;
  gap: 9px;
  margin: 0;
}

.detail-dl div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px;
}

.detail-dl dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.detail-dl dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .login-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-visual {
    min-height: 540px;
  }

  .login-stat-card {
    top: 16%;
    width: min(440px, 62%);
  }

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

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

  .brand-block {
    flex-basis: auto;
  }

  .step-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .content-grid,
  .workbench-grid,
  .home-grid,
  .asset-layout,
  .role-manager-grid,
  .account-grid {
    grid-template-columns: 1fr;
  }

  .responsible-list,
  .video-detail-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content-preview-block {
    position: static;
  }

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

  .creative-library-layout {
    grid-template-columns: 1fr;
  }

  .filter-rail {
    max-height: none;
  }
}

@media (max-width: 860px) {
  .login-page {
    padding: 16px;
  }

  .login-shell {
    min-height: calc(100vh - 32px);
  }

  .login-visual,
  .login-card {
    padding: 24px;
  }

  .login-visual {
    min-height: 500px;
  }

  .login-command strong {
    font-size: clamp(31px, 11vw, 44px);
  }

  .login-stat-card {
    top: 18%;
    right: 18px;
    width: min(360px, calc(100% - 36px));
    gap: 12px;
    padding: 16px;
  }

  .map-node {
    width: 38px;
    height: 38px;
    font-size: 9px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    height: auto;
  }

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

  .workspace {
    padding: 18px;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .role-switch {
    width: 100%;
  }

  .role-switch select {
    flex: 1;
    min-width: 0;
  }

  .side-panel,
  .reference-layout,
  .workbench-product-grid,
  .locator-grid,
  .summary-strip,
  .library-toolbar,
  .creative-stats,
  .review-grid,
  .task-grid,
  .permission-grid,
  .data-grid,
  .dashboard-kpis,
  .asset-stats,
  .product-detail-grid,
  .metric-edit-grid,
  .publish-return-top,
  .return-kpi-grid,
  .return-reminder-grid,
  .return-snapshot-grid,
  .analysis-grid,
  .creative-tag-groups,
  .inline-add-grid,
  .asset-toolbar,
  .board-toolbar,
  .modal-form-grid,
  .home-hero {
    grid-template-columns: 1fr;
  }

  .product-detail-grid .field:nth-child(n + 5) {
    grid-column: span 1;
  }

  .custom-field-row,
  .asset-row,
  .home-task-card,
  .role-editor-fields,
  .permission-grid-editor,
  .account-login-grid,
  .subaccount-form,
	  .account-row,
  .toggle-grid,
  .production-detail-grid,
  .custom-return-row,
  .tag-group-add-row,
	  .detail-dl div {
    grid-template-columns: 1fr;
  }

  .account-role-badge {
    width: fit-content;
  }

  .account-edit-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .account-edit-actions span {
    margin-right: 0;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal-card {
    max-height: calc(100vh - 20px);
  }

  .asset-row-actions {
    min-width: 0;
  }

  .creative-grid {
    grid-template-columns: 1fr;
    max-height: none;
  }
}

@media (max-width: 520px) {
  .login-page {
    padding: 10px;
  }

  .login-shell {
    min-height: calc(100vh - 20px);
    border-radius: 12px;
  }

  .login-visual {
    min-height: 460px;
    padding: 20px;
  }

  .login-card {
    padding: 22px 18px;
  }

  .login-brand h1 {
    font-size: 16px;
  }

  .login-command {
    gap: 11px;
  }

  .login-command strong {
    font-size: 30px;
  }

  .login-stat-card {
    grid-template-columns: 1fr 1fr;
    top: 92px;
    gap: 10px;
    padding: 13px;
  }

  .login-stat-card strong {
    font-size: 16px;
  }

  .login-action-row span {
    width: 100%;
    justify-content: center;
  }

  .workspace {
    padding: 12px;
  }

  .main-panel {
    padding: 15px;
  }

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

  .caption-large {
    font-size: 21px;
  }
}
