:root {
  --bg: #0b1210;
  --bg-2: #101916;
  --panel: #1d2a24;
  --panel-2: #22332b;
  --panel-3: #111b17;
  --field: #0d1713;
  --line: rgba(210, 225, 216, .15);
  --line-strong: rgba(210, 225, 216, .25);
  --ink: #f2fbf6;
  --muted: #a7b8af;
  --muted-2: #7f9289;
  --brand: #4aaa68;
  --brand-light: #75dfa0;
  --brand-dark: #2d7f48;
  --accent: #76ffbc;
  --warn: #d6b66a;
  --danger: #d67468;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 16px 36px rgba(0, 0, 0, .2);
  --shadow-soft: 0 10px 26px rgba(0, 0, 0, .18);
  --inner-light: inset 0 1px 0 rgba(255, 255, 255, .055);
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(117, 223, 160, .45) rgba(6, 14, 11, .74);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(6, 14, 11, .78);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  min-height: 40px;
  border: 2px solid rgba(6, 14, 11, .78);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(117, 223, 160, .64), rgba(74, 170, 104, .44));
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(143, 245, 184, .78), rgba(74, 170, 104, .58));
}

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

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, .024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .02) 1px, transparent 1px),
    radial-gradient(circle at 25% 0%, rgba(74, 170, 104, .16), transparent 34%),
    #07100d;
  background-size: 24px 24px, 24px 24px, auto, auto;
  font-family: "MiSans", "HarmonyOS Sans SC", "Source Han Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(107, 213, 142, .16), 0 0 0 1px rgba(117, 223, 160, .48);
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.window {
  min-height: 100vh;
}

.app-view {
  min-height: 100vh;
  height: 100vh;
  display: grid;
  grid-template-rows: 44px 1fr;
  overflow: hidden;
}

.app-view[hidden],
.login-screen[hidden] {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 10%, rgba(117, 223, 160, .22), transparent 32%),
    linear-gradient(135deg, rgba(214, 182, 106, .08), transparent 36%),
    #07100d;
}

.login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), transparent 120px),
    rgba(29, 42, 36, .96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .34), var(--inner-light);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-brand strong,
.login-brand small {
  display: block;
}

.login-brand small,
.login-copy p,
.login-hint {
  color: var(--muted);
}

.login-copy span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
}

.login-copy h1 {
  margin: 8px 0;
}

.login-copy p,
.login-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
}

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

.form-error {
  padding: 9px 10px;
  color: #ffd3ce;
  border: 1px solid rgba(214, 116, 104, .34);
  border-radius: var(--radius-sm);
  background: rgba(92, 29, 24, .34);
  font-size: 13px;
}

.login-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.titlebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) minmax(150px, auto);
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), transparent),
    #060c0a;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
}

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

.brand-mark,
.member-avatar {
  display: grid;
  place-items: center;
  color: #062016;
  background: linear-gradient(140deg, #ccffd9, #4aaa68 72%, #246f42);
  font-weight: 850;
}

.brand-mark {
  width: 25px;
  height: 25px;
  border-radius: 8px;
  font-size: 13px;
}

.brand strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.title-path {
  justify-self: center;
  color: #d9e7df;
  font-size: 13px;
}

.titlebar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.member-btn {
  height: 32px;
  width: min(176px, 18vw);
  min-width: 148px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 3px 9px 3px 4px;
  color: var(--ink);
  border: 1px solid rgba(117, 223, 160, .22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), transparent),
    rgba(14, 34, 24, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  text-align: left;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.member-btn:hover {
  border-color: rgba(117, 223, 160, .42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .07), transparent),
    rgba(18, 46, 31, .82);
}

.member-avatar {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  font-size: 12px;
}

.member-btn strong,
.member-btn small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-btn strong {
  font-size: 12px;
  line-height: 15px;
}

.member-btn small {
  color: var(--muted);
  font-size: 10px;
  line-height: 12px;
}

.window-actions {
  display: flex;
  gap: 6px;
}

.window-actions span {
  width: 34px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .07);
}

.app-shell {
  min-height: calc(100vh - 44px);
  height: calc(100vh - 44px);
  display: grid;
  grid-template-columns: 222px minmax(0, 1fr);
  overflow: hidden;
}

.sidebar {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  padding: 16px 10px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(74, 170, 104, .08), transparent 68%),
    rgba(14, 23, 19, .96);
  overflow: auto;
}

.nav {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.nav-btn {
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: #dcebe4;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, .045);
  transform: translateX(1px);
}

.nav-btn.active {
  border-color: rgba(107, 213, 142, .26);
  background:
    linear-gradient(90deg, rgba(74, 170, 104, .28), rgba(74, 170, 104, .08)),
    rgba(255, 255, 255, .025);
  box-shadow: inset 3px 0 0 var(--brand-light);
}

.nav-ico {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #dcfff0;
  font-size: 14px;
}

.badge {
  min-width: 22px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 999px;
  color: #e9fff2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .12), transparent),
    rgba(74, 170, 104, .58);
  font-size: 11px;
  font-weight: 820;
}

.mini-btn {
  min-width: 28px;
  height: 28px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .05);
  transition: border-color .16s ease, background .16s ease;
}

.mini-btn:hover {
  border-color: rgba(117, 223, 160, .34);
  background: rgba(255, 255, 255, .08);
}

.workspace {
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0 22px 14px;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 44px;
  z-index: 9;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 13, .92);
  backdrop-filter: blur(10px);
}

.section-title {
  position: relative;
  min-width: 0;
  padding-left: 14px;
}

.section-title::before,
.panel-head strong::before {
  width: 4px;
  border-radius: 999px;
  background: var(--brand-light);
  content: "";
}

.section-title::before {
  position: absolute;
  top: 8px;
  bottom: 10px;
  left: 0;
}

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

h1 {
  margin-bottom: 4px;
  font-size: 27px;
  line-height: 32px;
}

h2 {
  margin: 0;
  font-size: 24px;
  line-height: 30px;
}

.section-title p {
  margin: 0;
  color: #c1d3ca;
  font-size: 13px;
}

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

.icon-btn,
.ghost-btn,
.primary-btn,
.secondary-btn {
  min-height: 34px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .045);
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.icon-btn {
  width: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.ghost-btn:hover,
.secondary-btn:hover,
.icon-btn:hover {
  border-color: rgba(117, 223, 160, .36);
  background: rgba(255, 255, 255, .075);
}

.primary-btn {
  border-color: rgba(117, 223, 160, .36);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .12), transparent 38%),
    linear-gradient(180deg, var(--brand-light), var(--brand-dark));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 9px 18px rgba(0, 0, 0, .18);
  font-weight: 760;
}

.primary-btn:hover {
  transform: translateY(-1px);
}

.content {
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  padding-top: 10px;
  overflow: hidden;
}

.screen {
  display: none;
  min-height: 0;
}

.screen.active {
  display: block;
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.screen[data-screen="script"].active {
  overflow: hidden;
}

.script-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.08fr) minmax(440px, .92fr);
  gap: 14px;
  height: 100%;
  min-height: 0;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 80px),
    rgba(29, 42, 36, .94);
  box-shadow: var(--inner-light), var(--shadow-soft);
  overflow: hidden;
}

.panel-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .04), transparent),
    rgba(255, 255, 255, .018);
}

.panel-head strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

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

.panel-body {
  padding: 12px;
}

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

.field {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.field span,
.field label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
}

.wide,
.full {
  grid-column: span 2;
}

.control,
.prompt {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--field);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.control:hover,
.prompt:hover {
  border-color: rgba(210, 225, 216, .22);
  background: #0b1712;
}

.control {
  min-height: 36px;
  padding: 0 12px;
}

select.control {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--brand-light) 50%),
    linear-gradient(135deg, var(--brand-light) 50%, transparent 50%),
    var(--field);
  background-position: calc(100% - 17px) 14px, calc(100% - 12px) 14px, 0 0;
  background-size: 5px 5px, 5px 5px, auto;
  background-repeat: no-repeat;
}

.prompt {
  min-height: 180px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.68;
  text-rendering: geometricPrecision;
}

.script-editor-panel,
.shot-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.script-editor-panel .panel-body {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.script-fields {
  min-height: 0;
  grid-template-rows: max-content max-content minmax(0, 1fr);
}

.script-fields .field.full {
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

.script-editor {
  min-height: 0;
  height: 100%;
  resize: none;
  overflow: auto;
}

.script-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.shot-panel .panel-body {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.shot-list {
  min-height: 0;
  margin-top: 10px;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding-right: 3px;
}

.shot-empty,
.library-empty {
  min-height: 132px;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  border: 1px dashed rgba(210, 225, 216, .15);
  border-radius: var(--radius);
  background: rgba(8, 18, 14, .46);
  text-align: center;
  line-height: 1.8;
}

.shot-item {
  position: relative;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .026), transparent 62px),
    rgba(12, 22, 18, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.shot-item::before {
  position: absolute;
  inset: 12px auto 12px 0;
  width: 3px;
  border-radius: 999px;
  background: rgba(117, 223, 160, .55);
  content: "";
}

.shot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding-left: 3px;
}

.shot-head strong {
  color: #edf8f2;
  font-size: 13px;
  letter-spacing: .01em;
}

.shot-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 9px;
}

.shot-prompt {
  grid-column: 1 / -1;
  min-height: 86px;
  max-height: 142px;
  padding: 10px 11px;
  line-height: 1.58;
}

.prompt-library-hero {
  min-width: 0;
  max-width: 100%;
  margin-bottom: 10px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(25, 230, 140, .14), rgba(10, 18, 15, .94) 42%, rgba(10, 18, 15, .98)),
    radial-gradient(circle at 8% 0%, rgba(154, 255, 208, .16), transparent 36%);
  box-shadow: var(--inner-light), var(--shadow);
}

.prompt-library-hero > div:first-child {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.atom-library-hero > div:first-child {
  display: grid;
  align-items: start;
  gap: 4px;
}

.atom-library-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

.prompt-library-sync {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.prompt-library-sync strong {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(6, 16, 12, .82);
  font-size: 22px;
}

.version-pill,
.sync-note {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #e9fff2;
  background: rgba(6, 16, 12, .82);
}

.sync-note {
  color: var(--muted);
  font-size: 12px;
}

.library-toolbar {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(150px, 220px) minmax(150px, 220px) minmax(140px, 190px);
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid rgba(119, 255, 188, .16);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(24, 45, 36, .88), rgba(9, 17, 14, .96)),
    linear-gradient(180deg, rgba(25, 230, 140, .08), transparent);
  box-shadow: var(--inner-light), var(--shadow);
}

.atom-toolbar {
  grid-template-columns: minmax(420px, 1fr) minmax(150px, 220px);
}

.search {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  color: #8eeec2;
}

.search .control {
  grid-column: 1 / -1;
  padding-left: 40px;
}

.field-icon {
  z-index: 1;
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  pointer-events: none;
}

.search input {
  grid-row: 1;
}

.filter-summary {
  margin: -4px 0 14px;
  padding: 9px 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 18, 14, .72);
  font-size: 12px;
}

.filter-summary button {
  margin-left: 8px;
  padding: 0;
  color: var(--accent);
  background: transparent;
}

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

.inspiration-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(29, 42, 36, .94);
  box-shadow: var(--inner-light), var(--shadow);
}

.inspiration-cover {
  min-height: 96px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .10), transparent 42%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 14px),
    linear-gradient(135deg, #202d27, #334d39 58%, #5fbd77);
}

.inspiration-card.tone-2 .inspiration-cover {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .10), transparent 42%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 14px),
    linear-gradient(135deg, #202d27, #38584b 58%, #6cae91);
}

.inspiration-card.tone-3 .inspiration-cover {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .10), transparent 42%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 14px),
    linear-gradient(135deg, #202d27, #4a5651 58%, #7f9188);
}

.inspiration-cover span,
.asset-badge,
.tag {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  color: #d8f8e2;
  border: 1px solid rgba(210, 225, 216, .16);
  border-radius: 999px;
  background: rgba(17, 24, 21, .66);
  font-size: 12px;
}

.inspiration-cover b {
  font-size: 20px;
}

.inspiration-body {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.asset-title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.asset-title-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  line-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-badge.video {
  color: #042116;
  background: linear-gradient(180deg, var(--brand-light), var(--brand));
  border-color: transparent;
  font-weight: 800;
}

.inspiration-body p {
  min-height: 66px;
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  color: #c7d6cf;
  font-size: 13px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.asset-tags,
.prompt-card-actions,
.inspiration-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.asset-tags span {
  min-height: 23px;
  padding: 0 8px;
  border: 1px solid rgba(119, 255, 188, .16);
  border-radius: 999px;
  color: #c9ffe8;
  background: rgba(8, 20, 15, .82);
  font-size: 12px;
}

.inspiration-meta {
  color: var(--muted);
  font-size: 12px;
}

.prompt-card-actions {
  display: grid;
  grid-template-columns: 1fr;
}

.secondary-btn,
.inspiration-use {
  width: 100%;
}

.atom-library-stats {
  min-width: 360px;
  display: grid;
  grid-template-columns: repeat(3, minmax(84px, 1fr));
  gap: 8px;
}

.atom-library-stats div {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(210, 225, 216, .13);
  border-radius: var(--radius-sm);
  background: rgba(8, 18, 14, .58);
}

.atom-library-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.atom-library-stats strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atom-library-list {
  display: block;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(10, 18, 15, .84);
  box-shadow: var(--inner-light), var(--shadow);
}

.atom-list-head,
.atom-list-row {
  display: grid;
  grid-template-columns: 72px minmax(340px, 1fr) minmax(150px, 210px) 112px 140px;
  align-items: stretch;
}

.atom-list-head {
  min-height: 40px;
  color: #8ea199;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 27, 22, .96);
  font-size: 11px;
  font-weight: 760;
}

.atom-list-head span,
.atom-list-index,
.atom-list-main,
.atom-list-industry,
.atom-list-status,
.atom-list-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 11px 14px;
  border-right: 1px solid rgba(210, 225, 216, .09);
}

.atom-list-head span:last-child,
.atom-list-actions {
  border-right: 0;
}

.atom-list-row {
  position: relative;
  min-height: 78px;
  border-bottom: 1px solid rgba(210, 225, 216, .095);
  background: rgba(13, 22, 18, .62);
}

.atom-list-row:hover {
  background:
    linear-gradient(90deg, rgba(74, 170, 104, .085), transparent 48%),
    rgba(18, 30, 24, .76);
}

.atom-list-index {
  justify-content: center;
  color: #9fbaad;
  background: rgba(255, 255, 255, .018);
  font-size: 12px;
  font-weight: 820;
}

.atom-list-main {
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

.atom-list-main strong {
  color: var(--ink);
  font-size: 14px;
}

.atom-list-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.atom-list-tags span,
.atom-list-tags.is-empty,
.atom-list-industry span {
  min-height: 21px;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  color: #adc5ba;
  border: 1px solid rgba(210, 225, 216, .10);
  border-radius: 4px;
  background: rgba(255, 255, 255, .026);
  font-size: 11px;
}

.atom-list-status {
  gap: 7px;
  color: #c7f7d5;
  font-size: 12px;
  font-weight: 760;
}

.atom-list-status i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(107, 213, 142, .10);
}

.atom-list-row.is-disabled .atom-list-status {
  color: #9ca9a3;
}

.atom-list-row.is-disabled .atom-list-status i {
  background: #7f9188;
}

.atom-list-actions {
  justify-content: center;
}

.prompt-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}

.prompt-detail-modal.show,
.loading-modal.show {
  display: block;
}

body.is-modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .62);
}

.prompt-detail-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(820px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .46);
}

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

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

.prompt-detail-body {
  min-width: 0;
  overflow: auto;
  padding: 14px;
}

.prompt-detail-text {
  white-space: pre-wrap;
  color: #d9e8e0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  line-height: 1.75;
}

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

.loading-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: none;
}

.loading-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(360px, calc(100vw - 32px));
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 24px 24px 22px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(117, 223, 160, .34);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .06), transparent 82px),
    rgba(17, 29, 24, .98);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .52), inset 0 1px 0 rgba(255, 255, 255, .08);
  text-align: center;
}

.loading-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(210, 225, 216, .16);
  border-top-color: var(--brand-light);
  border-radius: 999px;
  animation: spin .84s linear infinite;
}

.loading-dialog strong {
  color: #f1fff8;
  font-size: 17px;
}

.loading-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  max-width: min(360px, calc(100vw - 36px));
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid rgba(117, 223, 160, .32);
  border-radius: var(--radius);
  background: rgba(9, 17, 14, .96);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

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

@media (max-width: 1180px) {
  .app-view {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .app-shell {
    height: auto;
    min-height: calc(100vh - 44px);
    overflow: visible;
  }

  .sidebar,
  .workspace,
  .content,
  .screen.active,
  .screen[data-screen="script"].active {
    overflow: visible;
  }

  .workspace {
    display: block;
    min-height: 0;
  }

  .script-layout,
  .prompt-library-hero {
    grid-template-columns: 1fr;
  }

  .script-layout {
    height: auto;
  }

  .script-editor-panel,
  .shot-panel,
  .script-editor-panel .panel-body,
  .shot-panel .panel-body {
    display: block;
    min-height: 0;
  }

  .script-fields {
    grid-template-rows: none;
  }

  .inspiration-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }

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

  .atom-toolbar {
    grid-template-columns: 1fr 220px;
  }

  .script-editor,
  .shot-panel .panel-body {
    min-height: 0;
  }

  .script-editor {
    height: auto;
    min-height: 320px;
    resize: vertical;
  }

  .shot-list {
    min-height: 160px;
    overflow: visible;
    padding-right: 0;
  }

  .shot-prompt {
    min-height: 116px;
    max-height: 260px;
  }
}

@media (max-width: 860px) {
  .app-view {
    grid-template-rows: auto 1fr;
  }

  .titlebar {
    position: static;
    grid-template-columns: 1fr;
    height: auto;
    padding: 10px 12px;
  }

  .title-path,
  .window-actions {
    display: none;
  }

  .titlebar-right {
    justify-content: stretch;
  }

  .member-btn {
    width: 100%;
  }

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 12;
    display: block;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding-bottom: 2px;
  }

  .nav-btn {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0 8px;
  }

  .nav-ico {
    display: none;
  }

  .nav-btn span:nth-child(2) {
    white-space: nowrap;
    text-align: center;
  }

  .nav-btn .badge {
    display: none;
  }

  .workspace {
    padding: 0 28px 16px 12px;
  }

  .topbar {
    position: static;
    flex-direction: column;
    align-items: stretch;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 42px 1fr 1fr;
  }

  .field-grid,
  .wide,
  .full {
    grid-template-columns: 1fr;
    grid-column: span 1;
  }

  .script-layout,
  .library-toolbar,
  .atom-toolbar,
  .prompt-library-hero,
  .atom-library-stats {
    grid-template-columns: 1fr;
  }

  .prompt-library-hero > div:first-child,
  .atom-library-stats {
    min-width: 0;
    width: min(100%, calc(100vw - 60px));
  }

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

  .prompt-library-sync {
    align-items: stretch;
    flex-direction: column;
  }

  .prompt-library-sync strong,
  .version-pill,
  .sync-note {
    justify-content: center;
  }

  .script-editor {
    min-height: 280px;
  }

  .atom-list-head {
    display: none;
  }

  .atom-list-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .atom-list-main,
  .atom-list-industry,
  .atom-list-status,
  .atom-list-actions {
    grid-column: 2;
    border-right: 0;
  }

  .atom-list-industry,
  .atom-list-status,
  .atom-list-actions {
    padding-top: 0;
  }
}

@media (max-width: 520px) {
  .login-actions,
  .top-actions {
    grid-template-columns: 1fr;
  }

  .shot-fields,
  .prompt-card-actions {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 22px;
  }
}
