:root {
  color-scheme: light;
  --bg: #fff;
  --text: #000;
  --muted: #555;
  --line: #d9d9d9;
  --soft: #f5f5f5;
  --button-bg: #000;
  --button-text: #fff;
  --card-bg: #fff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

:root.dark {
  color-scheme: dark;
  --bg: #000;
  --text: #fff;
  --muted: #aaa;
  --line: #333;
  --soft: #101010;
  --button-bg: #fff;
  --button-text: #000;
  --card-bg: #000;
  --shadow: 0 1px 2px rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "Helvetica Neue", Helvetica, sans-serif;
  line-height: 1.35;
}

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

button,
.button {
  border: 1px solid var(--text);
  background: var(--button-bg);
  color: var(--button-text);
  padding: 9px 13px;
  min-height: 40px;
  cursor: pointer;
}

button.secondary,
.button.secondary {
  background: var(--bg);
  color: var(--text);
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  padding: 10px;
  border-radius: 0;
}

textarea {
  min-height: 160px;
  resize: vertical;
}

label {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

a {
  color: inherit;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar,
.project-header,
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 22px;
}

.brand {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 14px;
}

.login {
  max-width: 380px;
  margin: 20vh auto 0;
}

.login h1 {
  font-size: 34px;
  font-weight: 500;
  margin: 0 0 18px;
}

.error {
  color: #b00020;
  margin: 10px 0 0;
}

:root.dark .error {
  color: #ff8a8a;
}

.projects {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 28px;
}

.panel {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

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

.project-item {
  width: 100%;
  text-align: left;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 12px;
}

.project-item.active {
  border-color: var(--text);
}

.project-name {
  font-size: 18px;
  font-weight: 500;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(310px, 380px) 1fr;
  gap: 28px;
}

.project-header {
  justify-content: space-between;
  margin-bottom: 18px;
}

.project-title {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 0 4px;
  font-size: 30px;
  font-weight: 500;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tabs button {
  background: var(--bg);
  color: var(--text);
  border-color: var(--line);
}

.tabs button.active {
  border-color: var(--text);
}

.card-form {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 20px;
}

.board-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.scene-card {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--text);
  min-height: 150px;
  padding: 14px;
  text-align: left;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.scene-card.suggested {
  border-style: dashed;
}

.scene-card.locked {
  border-width: 2px;
}

.card-title {
  font-size: 17px;
  font-weight: 500;
}

.card-line {
  font-size: 18px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.card-tools {
  display: flex;
  gap: 6px;
}

.card-tools button {
  padding: 4px 8px;
  min-height: 28px;
  background: var(--bg);
  color: var(--text);
  border-color: var(--line);
}

.empty {
  border: 1px solid var(--line);
  min-height: 160px;
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 28px;
}

.modal {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 10;
  overflow: auto;
}

.modal-inner {
  width: min(900px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 26px 0 60px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.modal h2 {
  font-size: clamp(32px, 7vw, 74px);
  line-height: 1.02;
  font-weight: 500;
  margin: 0;
}

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

.detail-block {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  min-height: 80px;
}

.detail-block strong {
  display: block;
  margin-bottom: 6px;
}

.display-body {
  overflow-x: hidden;
}

.display-shell {
  min-height: 100vh;
  padding: 28px;
}

.display-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 24px;
}

.display-title {
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 500;
}

.display-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.display-card {
  min-height: 210px;
  border: 2px solid var(--text);
  padding: 20px;
  background: var(--card-bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.display-card .card-line {
  font-size: clamp(24px, 2.2vw, 40px);
  line-height: 1.12;
}

.display-full {
  position: fixed;
  inset: 0;
  background: var(--bg);
  color: var(--text);
  z-index: 20;
  padding: 42px;
  overflow: auto;
}

.display-full h1 {
  font-size: clamp(44px, 8vw, 118px);
  line-height: 0.98;
  font-weight: 500;
  margin: 0 0 28px;
}

.display-full p {
  font-size: clamp(24px, 3vw, 46px);
  max-width: 1100px;
}

@media (max-width: 860px) {
  .projects,
  .workspace {
    grid-template-columns: 1fr;
  }

  .project-header,
  .board-actions,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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