:root {
  color-scheme: light;
  --ink: #17201e;
  --ink-soft: #5f6865;
  --ink-faint: #8c9491;
  --paper: #f4f2ed;
  --panel: #fbfaf7;
  --white: #ffffff;
  --line: #deddd7;
  --line-soft: #ebe9e4;
  --coral: #ff5148;
  --coral-dark: #df3832;
  --coral-soft: #fff0ed;
  --lime: #d8ed69;
  --lime-soft: #f3f8d7;
  --charcoal: #171c1b;
  --green: #2f8a62;
  --amber: #b56d16;
  --red: #bf3734;
  --shadow-sm: 0 1px 2px rgb(20 28 26 / 5%), 0 3px 10px rgb(20 28 26 / 4%);
  --shadow-md: 0 12px 35px rgb(20 28 26 / 11%), 0 2px 8px rgb(20 28 26 / 5%);
  --shadow-lg: 0 28px 80px rgb(20 28 26 / 18%), 0 7px 22px rgb(20 28 26 / 8%);
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --topbar-height: 74px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Yu Gothic UI",
    "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  overflow: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button,
input[type="color"],
input[type="range"] {
  cursor: pointer;
}

button {
  border: 0;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgb(255 81 72 / 24%);
  outline-offset: 2px;
}

::selection {
  background: rgb(216 237 105 / 75%);
  color: var(--charcoal);
}

.app-shell {
  height: 100dvh;
  min-height: 620px;
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 240px minmax(280px, 1fr) auto;
  align-items: center;
  height: var(--topbar-height);
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgb(251 250 247 / 92%);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--coral);
  color: var(--charcoal);
  box-shadow: inset 0 0 0 1px rgb(23 28 27 / 7%);
}

.brand-mark svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.2;
}

.brand-mark svg rect {
  fill: var(--charcoal);
  stroke: var(--charcoal);
}

.brand-mark svg path:first-of-type {
  fill: var(--white);
  stroke: var(--white);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-copy strong {
  font-size: 16px;
  font-weight: 820;
  letter-spacing: -0.03em;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.project-title-field {
  position: relative;
  justify-self: center;
  width: min(440px, 100%);
}

.project-title-field label {
  position: absolute;
  top: 8px;
  left: 14px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.project-title-field input {
  width: 100%;
  height: 52px;
  padding: 21px 138px 7px 13px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 710;
  text-overflow: ellipsis;
  transition: 160ms ease;
}

.project-title-field input:hover,
.project-title-field input:focus {
  border-color: var(--line);
  background: var(--white);
}

.save-indicator {
  position: absolute;
  top: 50%;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 650;
  pointer-events: none;
  transform: translateY(-50%);
}

.save-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgb(47 138 98 / 10%);
}

.save-indicator.is-saving .save-dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgb(181 109 22 / 11%);
}

.save-indicator.has-error .save-dot {
  background: var(--red);
}

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

.button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease,
    box-shadow 150ms ease;
}

.button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  border-color: var(--charcoal);
  background: var(--charcoal);
  color: var(--white);
  box-shadow: 0 3px 8px rgb(23 28 27 / 12%);
}

.button-primary:hover:not(:disabled) {
  border-color: #2d3432;
  background: #2d3432;
  box-shadow: 0 7px 16px rgb(23 28 27 / 16%);
}

.button-primary svg {
  color: var(--lime);
}

.button-secondary {
  border-color: var(--line);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.button-secondary:hover:not(:disabled),
.button-ghost:hover:not(:disabled) {
  border-color: #c9c8c2;
  background: var(--white);
}

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

.button-compact {
  padding: 0 9px;
}

.button-large {
  min-height: 46px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 13px;
}

.workspace-layout {
  display: grid;
  grid-template-columns: 226px minmax(360px, 1fr) 328px;
  height: calc(100dvh - var(--topbar-height));
  min-height: 546px;
}

.project-rail,
.inspector-panel,
.board-main {
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.project-rail,
.inspector-panel {
  scrollbar-width: thin;
  scrollbar-color: #d0cec8 transparent;
}

.project-rail {
  padding: 21px 17px 18px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.rail-section {
  padding: 0 1px 20px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 820;
  letter-spacing: 0.16em;
  line-height: 1.2;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.metric {
  display: flex;
  min-height: 64px;
  flex-direction: column;
  justify-content: center;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: var(--white);
}

.metric strong {
  color: var(--ink);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 810;
  letter-spacing: -0.04em;
  line-height: 1;
}

.metric span {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
}

.storage-state {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 620;
}

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

.storage-state.is-ready .status-icon {
  background: var(--green);
}

.storage-state.is-warning .status-icon {
  background: var(--amber);
}

.rail-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.rail-button {
  display: grid;
  width: 100%;
  grid-template-columns: 34px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 9px;
  padding: 8px 6px;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  transition: background 150ms ease;
}

.rail-button:hover:not(:disabled) {
  background: var(--white);
}

.rail-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.rail-button-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
}

.rail-button-icon.coral {
  background: var(--coral-soft);
  color: var(--coral-dark);
}

.rail-button-icon.lime {
  background: var(--lime-soft);
  color: #697a19;
}

.rail-button-icon svg {
  width: 18px;
  height: 18px;
}

.rail-button > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.rail-button strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 730;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-button small {
  overflow: hidden;
  margin-top: 1px;
  color: var(--ink-faint);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-button .chevron {
  width: 14px;
  height: 14px;
  color: var(--ink-faint);
}

.workflow-guide ol {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.workflow-guide li {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: start;
  gap: 8px;
}

.workflow-guide li > span {
  color: var(--coral-dark);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.workflow-guide p {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.workflow-guide strong {
  font-size: 11px;
  font-weight: 730;
  line-height: 1.25;
}

.workflow-guide small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9px;
}

.privacy-note {
  display: grid;
  grid-template-columns: 23px 1fr;
  gap: 9px;
  padding: 12px;
  border: 1px solid #dce3b2;
  border-radius: 12px;
  background: #f6f8e9;
  color: #4d571e;
}

.privacy-note > svg {
  width: 21px;
  height: 21px;
  margin-top: 1px;
  stroke-width: 1.9;
}

.privacy-note strong {
  display: block;
  font-size: 10px;
  font-weight: 780;
}

.privacy-note p {
  margin: 3px 0 0;
  color: #737b4e;
  font-size: 9px;
  line-height: 1.55;
}

.text-button {
  padding: 5px 1px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

.text-button:hover {
  text-decoration-color: currentColor;
}

.danger-text {
  margin-top: 14px;
  color: var(--red);
}

.board-main {
  position: relative;
  padding: 27px 30px 48px;
  background-color: var(--paper);
  background-image: radial-gradient(rgb(23 32 30 / 5%) 0.7px, transparent 0.7px);
  background-size: 14px 14px;
}

.board-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.board-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(23px, 2vw, 30px);
  font-weight: 820;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.board-heading > div > p:last-child {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.processing-banner {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 130px;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  overflow: hidden;
  border: 1px solid #d7dda9;
  border-radius: 12px;
  margin-bottom: 14px;
  background: #f6f9e8;
}

.processing-banner[hidden] {
  display: none;
}

.processing-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  background: var(--lime);
}

.processing-icon span {
  width: 13px;
  height: 13px;
  border: 2px solid rgb(23 28 27 / 24%);
  border-top-color: var(--charcoal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.processing-banner > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.processing-banner strong {
  font-size: 11px;
  font-weight: 750;
}

.processing-banner span:not(.processing-icon span, .processing-track span) {
  color: #737b4e;
  font-size: 9px;
}

.processing-track {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #dfe4bd;
}

.processing-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--charcoal);
  transition: width 250ms ease;
}

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

.board-surface {
  position: relative;
  min-height: calc(100% - 96px);
  border-radius: var(--radius-lg);
}

.empty-state {
  display: flex;
  min-height: min(620px, calc(100dvh - 190px));
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 36px 24px;
  border: 1px dashed #cccbc4;
  border-radius: var(--radius-lg);
  background: rgb(251 250 247 / 62%);
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease;
}

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

.empty-visual {
  position: relative;
  width: 180px;
  height: 196px;
  margin-bottom: 21px;
}

.mock-card {
  position: absolute;
  top: 0;
  left: 50%;
  display: flex;
  width: 92px;
  aspect-ratio: 9 / 16;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 7px;
  overflow: hidden;
  border: 4px solid var(--white);
  border-radius: 13px;
  background: var(--charcoal);
  box-shadow: var(--shadow-md);
  color: var(--white);
  transform-origin: 50% 100%;
}

.mock-card::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #e37a61, #7e3048 46%, #282d49);
  content: "";
}

.mock-card > span {
  position: relative;
  z-index: 1;
  padding: 3px 5px;
  border-radius: 4px;
  background: rgb(17 24 39 / 80%);
  font-size: 6px;
  font-weight: 800;
  line-height: 1.3;
}

.mock-card-back {
  transform: translateX(-100%) rotate(-9deg) translateY(14px);
}

.mock-card-back::before {
  background: linear-gradient(145deg, #8bb5b3, #2c6261 55%, #172927);
}

.mock-card-mid {
  transform: translateX(0) rotate(9deg) translateY(14px);
}

.mock-card-mid::before {
  background: linear-gradient(145deg, #ead27a, #ac632c 55%, #542e26);
}

.mock-card-front {
  z-index: 2;
  transform: translateX(-50%);
}

.mock-play {
  position: absolute;
  top: 43%;
  left: 50%;
  z-index: 2;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: 50%;
  background: rgb(255 255 255 / 18%);
  backdrop-filter: blur(5px);
  transform: translate(-50%, -50%);
}

.mock-play svg {
  width: 13px;
  height: 13px;
  fill: var(--white);
  stroke: var(--white);
}

.empty-state h2 {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 27px);
  font-weight: 810;
  letter-spacing: -0.04em;
}

.empty-description {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
}

.empty-actions {
  display: flex;
  gap: 9px;
  margin-top: 23px;
}

.drop-hint {
  margin-top: 13px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 620;
}

.clip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(218px, 260px));
  align-items: start;
  gap: 20px;
}

.clip-card {
  position: relative;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.clip-card:hover {
  border-color: #cac9c2;
  box-shadow: 0 13px 28px rgb(23 32 30 / 9%), 0 2px 6px rgb(23 32 30 / 4%);
  transform: translateY(-2px);
}

.clip-card.is-selected {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgb(255 81 72 / 12%), 0 13px 30px rgb(23 32 30 / 10%);
}

.clip-card.is-dragging {
  opacity: 0.42;
  transform: scale(0.98);
}

.clip-card.is-drop-target::after {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -11px;
  width: 3px;
  border-radius: 99px;
  background: var(--coral);
  content: "";
}

.card-topline {
  display: grid;
  grid-template-columns: auto 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 3px 7px;
}

.sequence-chip {
  display: inline-flex;
  height: 23px;
  align-items: center;
  padding: 0 7px;
  border-radius: 7px;
  background: var(--charcoal);
  color: var(--white);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: 0.05em;
}

.drag-handle,
.mini-button,
.icon-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-faint);
  transition: 140ms ease;
}

.drag-handle {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 7px;
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle:hover,
.mini-button:hover:not(:disabled),
.icon-button:hover {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

.drag-handle svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.clip-name {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 670;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip-status-pill {
  display: inline-flex;
  height: 20px;
  align-items: center;
  padding: 0 6px;
  border-radius: 99px;
  background: #edf5f0;
  color: var(--green);
  font-size: 8px;
  font-weight: 760;
}

.clip-status-pill.is-processing {
  background: var(--lime-soft);
  color: #6f7f24;
}

.clip-status-pill.is-missing,
.clip-status-pill.is-error {
  background: var(--coral-soft);
  color: var(--red);
}

.frame-stage {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 9 / 16;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: #101312;
  container-type: inline-size;
  isolation: isolate;
}

.frame-stage::after {
  position: absolute;
  inset: 0;
  z-index: 4;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.thumbnail-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  background: #101312;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
}

.thumbnail-image.fit-cover {
  object-fit: cover;
}

.thumbnail-image.fit-contain {
  object-fit: contain;
}

.stage-placeholder {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  background:
    radial-gradient(circle at 70% 22%, rgb(255 81 72 / 22%), transparent 30%),
    linear-gradient(145deg, #242a28, #101312 70%);
  color: rgb(255 255 255 / 60%);
  text-align: center;
}

.stage-placeholder svg {
  width: 31px;
  height: 31px;
  stroke-width: 1.4;
}

.stage-placeholder strong {
  color: rgb(255 255 255 / 82%);
  font-size: 10px;
}

.stage-placeholder small {
  max-width: 150px;
  color: rgb(255 255 255 / 48%);
  font-size: 8px;
  line-height: 1.55;
}

.stage-placeholder.is-processing::before {
  width: 28px;
  height: 28px;
  border: 2px solid rgb(255 255 255 / 17%);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
  content: "";
}

.stage-relink-button {
  position: absolute;
  right: 50%;
  bottom: 18px;
  z-index: 6;
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 8px;
  background: rgb(255 255 255 / 12%);
  color: var(--white);
  font-size: 8px;
  font-weight: 740;
  backdrop-filter: blur(7px);
  transform: translateX(50%);
}

.stage-relink-button:hover {
  background: rgb(255 255 255 / 20%);
}

.caption-layer {
  position: absolute;
  z-index: 5;
  display: block;
  width: max-content;
  min-width: 12cqw;
  max-width: var(--caption-max-width, 86%);
  padding: 0.38em 0.52em 0.42em;
  border: 1px solid transparent;
  border-radius: 0.28em;
  background: var(--caption-background, rgb(17 24 39 / 72%));
  color: var(--caption-color, #fff);
  font-size: clamp(10px, var(--caption-font-size, 8cqw), 48px);
  font-weight: var(--caption-font-weight, 800);
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-align: var(--caption-align, center);
  text-shadow: var(--caption-shadow, 0 1px 4px rgb(0 0 0 / 65%));
  white-space: pre-wrap;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform: translate(-50%, -50%);
  transition: box-shadow 130ms ease, border-color 130ms ease;
}

.caption-layer:active {
  cursor: grabbing;
}

.clip-card.is-selected .caption-layer {
  border-color: rgb(255 255 255 / 65%);
  box-shadow: 0 0 0 2px rgb(255 81 72 / 80%);
}

.caption-layer.is-dragging {
  box-shadow: 0 0 0 3px var(--lime), 0 8px 24px rgb(0 0 0 / 30%);
}

.caption-layer.is-empty {
  border-style: dashed;
  color: rgb(255 255 255 / 62%);
  font-size: 6cqw;
}

.card-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 3px 0;
}

.source-meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.25;
}

.source-meta strong {
  overflow: hidden;
  font-size: 10px;
  font-weight: 730;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-meta small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.card-actions {
  display: flex;
  gap: 3px;
}

.mini-button {
  width: 27px;
  height: 27px;
  padding: 0;
  border-radius: 8px;
}

.mini-button:disabled {
  cursor: default;
  opacity: 0.28;
}

.mini-button svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.inspector-panel {
  position: relative;
  border-left: 1px solid var(--line);
  background: var(--panel);
}

.inspector-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 20px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: rgb(251 250 247 / 94%);
  backdrop-filter: blur(12px);
}

.inspector-header .eyebrow {
  margin-bottom: 4px;
}

.inspector-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 780;
  letter-spacing: -0.025em;
}

.shortcut-badge {
  display: inline-flex;
  height: 22px;
  align-items: center;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink-faint);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8px;
}

.inspector-content {
  padding: 19px 20px 35px;
}

.inspector-empty {
  display: flex;
  min-height: 350px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--ink-faint);
  text-align: center;
}

.inspector-empty-icon {
  position: relative;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.inspector-empty-icon::after {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 22px;
  height: 22px;
  border: 3px solid var(--panel);
  border-radius: 50%;
  background: var(--coral);
  content: "+";
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  line-height: 19px;
}

.inspector-empty-icon svg {
  width: 31px;
  height: 31px;
  color: var(--ink-soft);
}

.inspector-empty h3 {
  margin: 19px 0 5px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}

.inspector-empty p {
  max-width: 230px;
  margin: 0;
  font-size: 10px;
  line-height: 1.65;
}

.selected-source {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  margin-bottom: 21px;
  background: var(--white);
}

.source-file-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: var(--coral-soft);
  color: var(--coral-dark);
}

.source-file-icon svg {
  width: 18px;
  height: 18px;
}

.selected-source-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.selected-source-copy strong {
  overflow: hidden;
  font-size: 10px;
  font-weight: 730;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.inspector-section {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 20px;
}

.inspector-section:last-of-type {
  border-bottom: 0;
}

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

.section-heading h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 780;
}

.section-heading span {
  color: var(--ink-faint);
  font-size: 8px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 7px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 710;
}

.field-label output {
  color: var(--ink-faint);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.caption-textarea {
  width: 100%;
  min-height: 95px;
  padding: 11px 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.6;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.caption-textarea:hover,
.caption-textarea:focus {
  border-color: #c4c3bd;
}

.caption-textarea:focus {
  box-shadow: 0 0 0 3px rgb(255 81 72 / 10%);
  outline: 0;
}

.field-hint {
  margin: 6px 0 0;
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.5;
}

.inspector-error {
  padding: 9px 10px;
  border: 1px solid #ecd0cd;
  border-radius: 9px;
  margin: -9px 0 16px;
  background: #fff5f3;
  color: var(--red);
}

.control-stack {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px;
  align-items: center;
  gap: 9px;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  margin: 0;
  border-radius: 99px;
  appearance: none;
  background: linear-gradient(to right, var(--charcoal) var(--range-progress, 50%), #deddd8 var(--range-progress, 50%));
}

input[type="range"]::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  border: 3px solid var(--white);
  border-radius: 50%;
  appearance: none;
  background: var(--charcoal);
  box-shadow: 0 0 0 1px #b8b7b1, 0 2px 4px rgb(0 0 0 / 12%);
}

input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--charcoal);
  box-shadow: 0 0 0 1px #b8b7b1;
}

.number-readout,
.time-input {
  height: 31px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink-soft);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(var(--segments, 2), 1fr);
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #eeede8;
}

.segmented-control button {
  min-height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
}

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

.segmented-control button.is-active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 5px rgb(23 32 30 / 9%);
}

.position-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.position-grid .field-label {
  margin-bottom: 5px;
}

.center-button {
  width: 100%;
  min-height: 33px;
  margin-top: 9px;
  border: 1px dashed #cbc9c3;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 690;
}

.center-button:hover {
  border-style: solid;
  background: var(--white);
  color: var(--ink);
}

.style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 10px;
}

.color-field {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.color-field input[type="color"] {
  width: 32px;
  height: 32px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
}

.color-field span {
  overflow: hidden;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8px;
  text-overflow: ellipsis;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
}

.toggle-row > span {
  display: flex;
  flex-direction: column;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 690;
}

.toggle-row small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 500;
}

.toggle {
  position: relative;
  width: 36px;
  height: 21px;
  flex: 0 0 auto;
}

.toggle input {
  position: absolute;
  opacity: 0;
}

.toggle span {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: #d6d5cf;
  transition: 160ms ease;
}

.toggle span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 4px rgb(0 0 0 / 20%);
  content: "";
  transition: 160ms ease;
}

.toggle input:checked + span {
  background: var(--charcoal);
}

.toggle input:checked + span::after {
  transform: translateX(15px);
}

.toggle input:focus-visible + span {
  outline: 3px solid rgb(255 81 72 / 24%);
  outline-offset: 2px;
}

.frame-controls {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 8px;
}

.frame-controls .button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 9px;
}

.relink-wide {
  width: 100%;
  margin-top: 8px;
}

.danger-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid #ecd0cd;
  border-radius: 9px;
  background: #fff8f7;
  color: var(--red);
  font-size: 9px;
  font-weight: 700;
}

.danger-button:hover {
  border-color: #dda9a5;
  background: var(--coral-soft);
}

.danger-button svg {
  width: 14px;
  height: 14px;
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgb(23 28 27 / 72%);
  backdrop-filter: blur(9px);
}

.drop-overlay[hidden] {
  display: none;
}

.drop-overlay > div {
  display: flex;
  width: min(460px, calc(100vw - 40px));
  min-height: 250px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 2px dashed rgb(255 255 255 / 55%);
  border-radius: 25px;
  background: rgb(255 255 255 / 10%);
  color: var(--white);
}

.drop-overlay svg {
  width: 50px;
  height: 50px;
  margin-bottom: 14px;
  color: var(--lime);
  stroke-width: 1.5;
}

.drop-overlay strong {
  font-size: 19px;
  font-weight: 780;
}

.drop-overlay span {
  margin-top: 6px;
  color: rgb(255 255 255 / 64%);
  font-size: 10px;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: flex;
  width: min(360px, calc(100vw - 36px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 9px 10px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 12px;
  background: rgb(23 28 27 / 96%);
  color: var(--white);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 220ms ease both;
}

.toast.is-leaving {
  animation: toast-out 180ms ease both;
}

.toast-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  background: var(--lime);
  color: var(--charcoal);
  font-size: 12px;
  font-weight: 850;
}

.toast.is-error .toast-icon {
  background: var(--coral);
  color: var(--white);
}

.toast-message {
  font-size: 10px;
  font-weight: 650;
}

.toast button {
  padding: 5px 7px;
  border-radius: 7px;
  background: rgb(255 255 255 / 10%);
  color: var(--white);
  font-size: 9px;
  font-weight: 700;
}

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

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

.help-dialog {
  width: min(700px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}

.help-dialog::backdrop {
  background: rgb(23 28 27 / 58%);
  backdrop-filter: blur(6px);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.dialog-header .eyebrow {
  margin-bottom: 5px;
}

.dialog-header h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 810;
  letter-spacing: -0.035em;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
}

.icon-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.guide-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 22px 26px 13px;
}

.guide-cards article {
  min-height: 175px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--white);
}

.guide-cards article > span {
  display: inline-flex;
  height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--coral-soft);
  color: var(--coral-dark);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.guide-cards h3 {
  margin: 20px 0 7px;
  font-size: 13px;
  font-weight: 760;
}

.guide-cards p,
.guide-note p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.7;
}

.guide-note {
  margin: 0 26px;
  padding: 13px 15px;
  border: 1px solid #dce3b2;
  border-radius: 12px;
  background: #f6f8e9;
}

.guide-note strong {
  display: block;
  margin-bottom: 3px;
  color: #4d571e;
  font-size: 10px;
}

.guide-note p {
  color: #737b4e;
}

.dialog-done {
  float: right;
  margin: 18px 26px 24px;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 205px minmax(260px, 1fr) auto;
  }

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

  .project-rail {
    display: none;
  }

  .clip-grid {
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  }
}

@media (max-width: 860px) {
  :root {
    --topbar-height: 66px;
  }

  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100dvh;
  }

  .topbar {
    position: sticky;
    top: 0;
    grid-template-columns: auto minmax(120px, 1fr) auto;
    height: var(--topbar-height);
    padding: 0 12px;
  }

  .brand-copy {
    display: none;
  }

  .project-title-field {
    width: 100%;
  }

  .project-title-field input {
    height: 46px;
    padding-right: 12px;
  }

  .save-indicator {
    display: none;
  }

  .desktop-label {
    display: none;
  }

  .top-actions .button-ghost {
    display: inline-flex;
    width: 38px;
    padding: 0;
  }

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

  .board-main,
  .inspector-panel {
    overflow: visible;
  }

  .board-main {
    min-height: calc(100dvh - var(--topbar-height));
    padding: 22px 16px 32px;
  }

  .inspector-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .inspector-header {
    position: static;
  }

  .inspector-content {
    max-width: 620px;
    margin: 0 auto;
  }

  .empty-state {
    min-height: 540px;
  }
}

@media (max-width: 560px) {
  .topbar {
    grid-template-columns: auto minmax(70px, 1fr) auto;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .project-title-field label {
    display: none;
  }

  .project-title-field input {
    height: 40px;
    padding: 0 8px;
    font-size: 12px;
  }

  .top-actions .button-primary {
    width: 40px;
    min-height: 40px;
    padding: 0;
    font-size: 0;
  }

  .top-actions .button-primary svg {
    width: 19px;
    height: 19px;
  }

  .board-heading {
    align-items: center;
  }

  .board-heading > div > p:last-child {
    display: none;
  }

  .board-heading h1 {
    font-size: 22px;
  }

  .processing-banner {
    grid-template-columns: 31px minmax(0, 1fr);
  }

  .processing-track {
    display: none;
  }

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

  .clip-card {
    padding: 6px;
    border-radius: 14px;
  }

  .card-topline {
    grid-template-columns: auto 20px minmax(0, 1fr);
    gap: 4px;
  }

  .clip-status-pill {
    display: none;
  }

  .drag-handle {
    width: 20px;
  }

  .source-meta small {
    display: none;
  }

  .card-footer {
    min-height: 37px;
    padding-top: 6px;
  }

  .mini-button {
    width: 24px;
    height: 24px;
  }

  .empty-state {
    min-height: calc(100dvh - 155px);
    padding-right: 16px;
    padding-left: 16px;
  }

  .empty-visual {
    transform: scale(0.85);
    margin-bottom: 5px;
  }

  .empty-description br {
    display: none;
  }

  .empty-actions {
    width: 100%;
    flex-direction: column;
  }

  .guide-cards {
    grid-template-columns: 1fr;
  }

  .guide-cards article {
    min-height: 0;
  }

  .help-dialog {
    max-height: calc(100dvh - 24px);
    overflow: auto;
  }
}

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