@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&display=swap");

:root {
  color-scheme: light;
  --bg: #eef2f6;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --ink: #17202a;
  --muted: #64748b;
  --line: #d7dee8;
  --line-strong: #aab8c8;
  --green: #0f766e;
  --green-soft: #d9f4ef;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --red: #b42318;
  --red-soft: #fee4e2;
  --amber: #a16207;
  --amber-soft: #fef3c7;
  --violet: #6d28d9;
  --violet-soft: #ede9fe;
  --gray-soft: #eef2f7;
  --shadow: 0 18px 45px rgba(34, 48, 73, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Noto Sans JP",
    "Noto Sans CJK JP",
    "Hiragino Kaku Gothic ProN",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

body.auth-pending {
  overflow: hidden;
}

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

button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease,
    background 140ms ease;
}

button:hover {
  border-color: var(--line-strong);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(238, 242, 246, 0.88), rgba(238, 242, 246, 0.94)),
    linear-gradient(rgba(23, 32, 42, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 42, 0.045) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-size: 24px;
}

.login-description {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.login-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

.login-card button {
  padding: 11px 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.login-error {
  min-height: 18px;
  margin-bottom: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.topbar {
  display: grid;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(230px, 290px) minmax(280px, 430px) auto;
  align-items: center;
  gap: 18px;
  padding: 13px 18px 12px;
}

.brand-block {
  min-width: 0;
}

.project-kicker,
.toolbar-kicker {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.2;
}

#projectTitle {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2 {
  margin-bottom: 12px;
  font-size: 16px;
}

h3 {
  margin-bottom: 8px;
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.mode-tabs {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
  background: rgba(248, 250, 252, 0.96);
  scrollbar-width: none;
}

.mode-tabs::-webkit-scrollbar {
  display: none;
}

.mode-tab {
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  min-width: 104px;
  padding: 10px 16px;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.mode-tab.is-active {
  border-bottom-color: var(--green);
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.logout-button {
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 800;
}

.search-box,
.series-box {
  display: grid;
  grid-template-columns: auto minmax(220px, 320px);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-area {
  position: relative;
  min-width: 0;
}

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

.series-box {
  grid-template-columns: auto minmax(180px, 240px);
}

.search-box input,
.series-box select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

.workspace {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 310px;
  gap: 10px;
  padding: 10px;
  min-height: 0;
  overflow: hidden;
}

.left-panel,
.board-panel,
.inspector {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(34, 48, 73, 0.08);
}

.left-panel,
.inspector {
  overflow: auto;
}

.left-panel {
  padding: 14px;
}

.summary-panel,
.filter-panel,
.issue-panel,
.recent-panel,
.detail-section {
  padding: 0 0 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.summary-panel:last-child,
.filter-panel:last-child,
.issue-panel:last-child,
.recent-panel:last-child,
.detail-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.summary-grid div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.summary-grid span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.summary-grid strong {
  display: block;
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

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

.filter-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
}

.filter-panel input {
  accent-color: var(--green);
}

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

.issue-row {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.issue-row strong {
  font-size: 13px;
}

.issue-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.board-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

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

.board-toolbar h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.toolbar-actions button,
.dialog-actions button {
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

.graph-viewport {
  min-height: 420px;
  overflow: auto;
  background:
    linear-gradient(rgba(23, 32, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 42, 0.035) 1px, transparent 1px),
    #fbfcfe;
  background-size: 28px 28px;
}

.graph-surface {
  position: relative;
  min-width: 1180px;
  min-height: 820px;
  transform-origin: 0 0;
}

.edge-layer,
.node-layer {
  position: absolute;
  inset: 0;
}

.edge-layer {
  pointer-events: auto;
  overflow: visible;
}

.edge-path {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 2;
  opacity: 0.78;
}

.edge-path.edge-positive {
  stroke: var(--green);
}

.edge-path.edge-conflict {
  stroke: var(--red);
}

.edge-path.edge-suspicion {
  stroke: var(--amber);
}

.edge-path.edge-document {
  stroke: var(--blue);
  stroke-dasharray: 6 5;
}

.edge-path.edge-asset,
.edge-path.edge-item {
  stroke: #7c8aa3;
  stroke-dasharray: 4 5;
}

.edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 14;
  cursor: pointer;
}

.edge-path.is-selected {
  stroke-width: 4;
  opacity: 1;
}

.edge-path.is-dim,
.graph-node.is-dim {
  opacity: 0.22;
}

.graph-node {
  position: absolute;
  display: grid;
  gap: 4px;
  align-content: center;
  min-height: 68px;
  padding: 10px;
  border: 2px solid #fff;
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
  user-select: none;
}

.graph-node .node-type {
  color: rgba(23, 32, 42, 0.58);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.graph-node .node-title {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.graph-node .node-subtitle {
  overflow: hidden;
  color: var(--muted);
  display: -webkit-box;
  font-size: 11px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.graph-node.node-character {
  background: #fff;
  border-color: #cbd5e1;
}

.graph-node.node-character::before {
  content: attr(data-initial);
  position: absolute;
  top: -24px;
  left: 12px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
}

.graph-node.node-case {
  background: var(--green-soft);
  border-color: #99f6e4;
}

.graph-node.node-asset {
  background: var(--blue-soft);
  border-color: #bfdbfe;
}

.graph-node.node-item {
  background: var(--amber-soft);
  border-color: #fde68a;
}

.graph-node.node-event {
  background: var(--violet-soft);
  border-color: #ddd6fe;
}

.graph-node.node-document {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.graph-node.node-document.node-status-draft {
  background: #eff6ff;
  border-color: #93c5fd;
}

.graph-node.node-document.node-status-missing {
  background: #fff1f2;
  border-color: #fda4af;
}

.graph-node.node-document.node-status-reference {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.graph-node.is-selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(23, 32, 42, 0.12), var(--shadow);
}

.graph-node.is-match {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16), var(--shadow);
}

.timeline-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel-soft);
}

.timeline-card {
  min-height: 92px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.timeline-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.timeline-card span,
.timeline-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.timeline-card p {
  margin-bottom: 0;
}

.inspector {
  padding: 14px;
}

.inspector-header {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.inspector-kicker {
  margin-bottom: 5px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.inspector h2 {
  margin-bottom: 8px;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.inspector-summary {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.meta-list,
.link-list,
.relation-list,
.asset-list {
  min-width: 0;
  display: grid;
  gap: 8px;
  margin: 0;
}

.meta-list div {
  display: grid;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-soft);
}

.meta-list dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.meta-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.status-pill,
.type-pill {
  display: inline-flex;
  width: max-content;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.status-reviewed {
  background: var(--green-soft);
  color: var(--green);
}

.status-issue,
.status-attention {
  background: var(--red-soft);
  color: var(--red);
}

.status-draft {
  background: var(--gray-soft);
  color: var(--muted);
}

.status-complete {
  background: var(--green-soft);
  color: var(--green);
}

.status-missing {
  background: var(--red-soft);
  color: var(--red);
}

.status-reference {
  background: var(--blue-soft);
  color: var(--blue);
}

.type-pill {
  background: var(--blue-soft);
  color: var(--blue);
}

.link-list a,
.relation-list button,
.asset-list button {
  min-width: 0;
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.link-list span,
.relation-list span,
.asset-list span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.link-list strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.edit-form {
  display: grid;
  gap: 10px;
}

.edit-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.edit-form input,
.edit-form textarea,
.edit-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}

.edit-form textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.edit-form button {
  padding: 10px 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.empty-state {
  display: grid;
  gap: 12px;
  color: var(--muted);
}

.import-dialog {
  width: min(760px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.import-dialog::backdrop {
  background: rgba(15, 23, 42, 0.44);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 0;
}

.dialog-header button {
  padding: 7px 10px;
}

.import-dialog textarea {
  display: block;
  width: calc(100% - 28px);
  min-height: 280px;
  margin: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  resize: vertical;
}

.dialog-actions {
  display: flex;
  gap: 8px;
  padding: 0 14px 14px;
}

.import-message {
  min-height: 20px;
  margin: 0;
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 13px;
}

.graph-viewport.is-play-mode {
  padding: 22px;
  scroll-behavior: smooth;
  background: #e8edf2;
}

.play-document-view {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.play-document-nav {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid #ccd5df;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(28, 38, 53, 0.1);
  backdrop-filter: blur(12px);
}

.play-document-tabs {
  min-width: 0;
  display: flex;
  flex: 1;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.play-document-tab {
  min-width: 118px;
  display: grid;
  gap: 2px;
  flex: 0 0 auto;
  padding: 8px 10px;
  text-align: left;
}

.play-document-tab span {
  font-size: 12px;
  font-weight: 800;
}

.play-document-tab small {
  color: var(--muted);
  font-size: 10px;
}

.play-document-tab.is-active {
  border-color: #17202a;
  background: #17202a;
  color: #fff;
}

.play-document-tab.is-active small {
  color: #cbd5e1;
}

.play-print-button,
.inspector-action-button {
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.play-sheet {
  width: min(960px, 100%);
  margin: 0 auto 32px;
  overflow: hidden;
  border: 1px solid #cbd4de;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(25, 36, 51, 0.13);
}

.play-cover {
  min-height: 390px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 48px;
  color: #fff;
  background-position: center;
  background-size: cover;
}

.play-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 16, 0.66);
}

.play-cover > div {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

img[data-web-original] { height: auto; }

.play-eyebrow,
.play-section-heading p {
  margin: 0 0 9px;
  color: #76d1dc;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.play-cover h2 {
  margin-bottom: 14px;
  font-size: 40px;
  line-height: 1.18;
}

.play-cover p:last-child {
  margin-bottom: 0;
  color: #dce5ed;
  line-height: 1.75;
}

.play-contact-section {
  padding: 42px 48px 52px;
}

.play-contact-section + .play-contact-section {
  border-top: 1px solid #dbe2e9;
}

.play-section-heading {
  margin-bottom: 22px;
}

.play-section-heading p {
  color: #168297;
}

.play-section-heading h3 {
  margin: 0;
  font-size: 24px;
}

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

.web-document-card {
  min-width: 0;
  display: grid;
  grid-template-rows: 220px auto;
  overflow: hidden;
  padding: 0;
  border-color: #d7dee8;
  text-align: left;
  background: #fff;
}

.web-document-card:hover {
  border-color: var(--document-accent, #168297);
}

.web-document-visual {
  overflow: hidden;
  background: #111721;
}

.web-document-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 22%;
}

.rulebook-card .web-document-visual img {
  object-position: center;
}

.web-document-copy {
  min-height: 112px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 15px;
  border-top: 4px solid var(--document-accent, #168297);
}

.web-document-copy small {
  color: var(--document-accent, #168297);
  font-size: 10px;
  font-weight: 900;
}

.web-document-copy strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.web-document-copy span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

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

.asset-contact-item {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #d7dee8;
  border-radius: 7px;
  background: #f6f8fa;
}

.asset-contact-item a {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.asset-contact-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #11151c;
}

.asset-contact-item figcaption {
  padding: 10px 12px;
  color: #344256;
  font-size: 12px;
  font-weight: 800;
}

.card-asset-catalog-header {
  min-height: 260px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  padding: 38px 44px;
  border-top: 8px solid #168b8b;
  color: #fff;
  background: #0b0d10;
}

.card-asset-catalog-header > div {
  max-width: 650px;
}

.card-asset-catalog-header h2,
.card-asset-detail-cover h2 {
  margin: 0 0 14px;
  overflow-wrap: anywhere;
  font-size: 34px;
  line-height: 1.2;
}

.card-asset-catalog-header > div > p:last-child,
.card-asset-detail-cover > div > p {
  margin: 0;
  color: #cbd5df;
  font-size: 13px;
  line-height: 1.75;
}

.card-asset-catalog-header dl {
  min-width: 210px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.card-asset-catalog-header dl div {
  border-top: 2px solid #168b8b;
  padding-top: 9px;
}

.card-asset-catalog-header dt,
.card-asset-meta dt {
  color: #8f9baa;
  font-size: 9px;
  font-weight: 800;
}

.card-asset-catalog-header dd {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 900;
}

.card-asset-catalog-body {
  padding: 34px;
  background: #f4f6f8;
}

.card-asset-catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.card-asset-entry {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(98px, auto);
  overflow: hidden;
  padding: 0;
  border: 1px solid #d1d8e0;
  border-radius: 6px;
  text-align: left;
  background: #fff;
}

.card-asset-entry:hover,
.card-asset-entry:focus-visible {
  border-color: var(--card-accent);
  box-shadow: 0 8px 20px rgba(23, 32, 42, 0.12);
}

.card-asset-entry img {
  width: 100%;
  aspect-ratio: 744 / 1039;
  display: block;
  object-fit: cover;
  background: #0b0d10;
}

.card-asset-entry > span {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 13px;
  border-top: 4px solid var(--card-accent);
}

.card-asset-entry small,
.card-asset-entry em {
  color: var(--card-accent);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.card-asset-entry strong {
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.45;
}

.card-asset-entry em {
  color: #788494;
  font-weight: 700;
}

.card-asset-detail-cover {
  min-height: 540px;
  display: grid;
  grid-template-columns: minmax(260px, 38%) minmax(0, 1fr);
  color: #fff;
  background: #0b0d10;
}

.card-asset-detail-cover > img {
  width: 100%;
  height: 100%;
  min-height: 540px;
  display: block;
  object-fit: contain;
  padding: 24px;
  background: #171b21;
}

.card-asset-detail-cover > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 44px;
  border-left: 6px solid var(--document-accent);
}

.card-asset-detail-cover .play-eyebrow {
  color: var(--document-accent);
}

.card-asset-meta {
  display: grid;
  gap: 10px;
  margin: 26px 0 0;
}

.card-asset-meta div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.card-asset-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 800;
}

.card-asset-detail-nav button {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #d6dde5;
  border-radius: 6px;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  background: #fff;
}

.card-asset-direct-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--document-accent);
  font-size: 12px;
  font-weight: 900;
}

.handout-cover {
  min-height: 500px;
  display: grid;
  grid-template-columns: minmax(300px, 42%) minmax(0, 1fr);
  background: #10151d;
  color: #fff;
}

.handout-cover > img {
  width: 100%;
  height: 100%;
  min-height: 500px;
  display: block;
  object-fit: cover;
  object-position: center top;
}

.handout-cover-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 44px;
  border-left: 6px solid var(--document-accent);
}

.handout-cover-copy .play-eyebrow {
  color: var(--document-accent);
}

.handout-cover-copy h2 {
  margin: 0;
  font-size: 36px;
  line-height: 1.12;
  white-space: nowrap;
}

.handout-cover-copy h2.is-long {
  font-size: 25px;
}

.handout-real-name {
  margin: 10px 0 24px;
  color: #e2e8f0;
  font-size: 22px;
  font-weight: 700;
}

.handout-summary {
  display: flex;
  gap: 22px;
  margin: 0 0 24px;
}

.handout-summary div {
  min-width: 0;
}

.handout-summary dt {
  margin-bottom: 3px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
}

.handout-summary dd {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.handout-warning {
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.65;
}

.handout-toc {
  position: sticky;
  top: 78px;
  z-index: 8;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 11px 24px;
  border-bottom: 1px solid #d9e0e7;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.handout-toc a {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #d6dde5;
  border-radius: 6px;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
}

.handout-body {
  padding: 18px 54px 24px;
}

.play-prose-section {
  position: relative;
  padding: 42px 0 48px 78px;
  border-bottom: 1px solid #dce3ea;
  scroll-margin-top: 140px;
}

.play-prose-section:last-child {
  border-bottom: 0;
}

.play-section-number {
  position: absolute;
  top: 44px;
  left: 0;
  margin: 0;
  color: var(--document-accent, #168297);
  font-size: 13px;
  font-weight: 900;
}

.play-prose-section > h3 {
  margin-bottom: 22px;
  font-size: 25px;
}

.play-prose {
  color: #273445;
  font-family:
    "Noto Sans JP",
    "Noto Sans CJK JP",
    "Hiragino Kaku Gothic ProN",
    sans-serif;
  font-size: 16px;
  line-height: 2;
}

.play-prose p {
  margin: 0 0 1.2em;
}

.play-prose p:last-child {
  margin-bottom: 0;
}

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

.handout-relations,
.handout-items {
  display: grid;
  gap: 0;
}

.handout-relations > section,
.handout-items > section {
  padding: 24px 0;
  border-top: 1px solid #e1e6ec;
}

.handout-relations h4,
.handout-items h4 {
  margin: 0 0 10px;
  color: var(--document-accent);
  font-size: 17px;
}

.play-document-footer {
  padding: 22px 54px;
  border-top: 1px solid #dce3ea;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.rulebook-cover {
  min-height: 470px;
}

.rulebook-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 24px;
}

.rulebook-facts span {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 6px;
  background: rgba(7, 10, 16, 0.5);
  font-size: 11px;
  font-weight: 800;
}

.rulebook-toc {
  top: 78px;
}

.rule-list {
  margin: 0;
  padding-left: 1.4em;
  color: #273445;
  line-height: 1.9;
}

.rule-list li + li {
  margin-top: 12px;
}

.rule-flow-list {
  border-top: 1px solid #dce3ea;
}

.rule-flow-list > section {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid #dce3ea;
}

.rule-flow-list > section > span {
  color: #168297;
  font-size: 11px;
  font-weight: 900;
}

.rule-flow-list h4,
.rule-flow-list p {
  margin: 0;
}

.rule-flow-list h4 {
  margin-bottom: 6px;
  font-size: 15px;
}

.rule-flow-list p,
.rule-lead {
  color: #5a687b;
  font-size: 13px;
  line-height: 1.75;
}

.rule-card-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #dce3ea;
  border-left: 1px solid #dce3ea;
}

.rule-card-table > div {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid #dce3ea;
  border-bottom: 1px solid #dce3ea;
}

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

.rule-card-table strong {
  margin-bottom: 4px;
  font-size: 13px;
}

.rule-card-table span {
  color: #168297;
  font-size: 10px;
  font-weight: 800;
}

.rule-card-table p {
  margin: 10px 0 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.6;
}

.ending-branches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.ending-branches section {
  padding: 20px;
  border: 1px solid #d4dce5;
  border-radius: 7px;
  background: #f7f9fb;
}

.ending-branches p {
  margin: 0 0 7px;
  color: #168297;
  font-size: 10px;
  font-weight: 900;
}

.ending-branches h4 {
  margin: 0 0 10px;
}

.ending-branches span {
  color: #5d6b7d;
  font-size: 12px;
  line-height: 1.65;
}

.rule-checklist {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rule-checklist li {
  display: grid;
  grid-template-columns: 21px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: #344256;
  line-height: 1.65;
}

.rule-checklist li > span {
  width: 20px;
  height: 20px;
  border: 2px solid #9aa8b9;
  border-radius: 4px;
}

.document-access-banner {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 18px 48px;
  border-bottom: 1px solid #cbd6df;
  background: #eef7f7;
}

.document-access-banner > span {
  color: #167886;
  font-size: 11px;
  font-weight: 900;
}

.document-access-banner strong,
.document-access-banner p {
  display: block;
  margin: 0;
}

.document-access-banner strong {
  margin-bottom: 3px;
  color: #203044;
  font-size: 13px;
}

.document-access-banner p {
  color: #5d6d7f;
  font-size: 11px;
  line-height: 1.55;
}

.document-access-banner.is-safe {
  border-color: #bedfd8;
  background: #edf8f4;
}

.document-access-banner.is-spoiler {
  border-color: #e3c2c8;
  background: #fbf0f2;
}

.document-access-banner.is-spoiler > span {
  color: #9c3348;
}

.document-access-banner.is-review {
  border-color: #e3d3ad;
  background: #faf6eb;
}

.document-access-banner.is-review > span {
  color: #806225;
}

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

.story-cast-grid > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #d7dfe7;
  border-top: 4px solid var(--document-accent);
  border-radius: 7px;
}

.story-cast-grid img {
  width: 48px;
  height: 48px;
  grid-row: 1 / 3;
  border-radius: 50%;
  object-fit: cover;
  background: #e9edf2;
}

.story-cast-grid strong {
  align-self: end;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.story-cast-grid span {
  align-self: start;
  color: #64748b;
  font-size: 10px;
}

.document-route-button {
  margin-top: 20px;
  padding: 10px 14px;
  border-color: #168297;
  color: #fff;
  background: #168297;
  font-size: 12px;
  font-weight: 800;
}

.script-passages {
  border-top: 1px solid #d8e0e7;
}

.script-passage {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 22px;
  padding: 24px 0;
  border-bottom: 1px solid #d8e0e7;
}

.script-passage > div:first-child {
  display: grid;
  align-content: start;
  gap: 5px;
}

.script-passage > div:first-child span {
  color: #8794a5;
  font-size: 10px;
  font-weight: 900;
}

.script-passage > div:first-child strong {
  overflow-wrap: anywhere;
  color: #34526b;
  font-size: 12px;
}

.script-passage.is-gm > div:first-child strong {
  color: #a04435;
}

.script-passage .play-prose {
  font-size: 15px;
  line-height: 1.9;
}

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

.script-card-grid a,
.research-page-grid a {
  position: relative;
  min-width: 0;
  display: block;
  overflow: hidden;
  border: 1px solid #d6dee6;
  border-radius: 7px;
  background: #10151c;
}

.script-card-grid img,
.research-page-grid img {
  width: 100%;
  height: 260px;
  display: block;
  object-fit: contain;
}

.script-card-grid span,
.research-page-grid span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  color: #fff;
  background: rgba(8, 13, 19, 0.8);
  font-size: 10px;
  font-weight: 900;
}

.research-document {
  padding: 28px;
  border: 1px solid #cfd8df;
  border-radius: 7px;
  background: #f8faf9;
}

.phase-guide-list {
  border-top: 1px solid #d8e0e7;
}

.phase-guide-list > section {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 62px;
  gap: 14px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid #d8e0e7;
}

.phase-guide-list > section > span {
  color: #168297;
  font-size: 10px;
  font-weight: 900;
}

.phase-guide-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.phase-guide-heading h4 {
  margin: 0;
  font-size: 14px;
}

.phase-guide-heading em {
  padding: 3px 6px;
  border-radius: 4px;
  color: #4b5d70;
  background: #e9eef3;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.phase-guide-list p,
.phase-guide-list small {
  margin: 0;
  color: #637185;
  font-size: 11px;
  line-height: 1.65;
}

.phase-guide-list small {
  display: block;
  margin-top: 5px;
  color: #8a5b2a;
  font-weight: 800;
}

.phase-guide-list button {
  padding: 7px 8px;
  font-size: 10px;
  font-weight: 800;
}

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

.document-route-grid.compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.document-route-grid button {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 14px;
  text-align: left;
}

.document-route-grid span {
  color: #168297;
  font-size: 9px;
  font-weight: 900;
}

.document-route-grid strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.ending-script-section.is-true {
  --document-accent: #168297;
}

.ending-script-section.is-bad {
  --document-accent: #9c3348;
}

.map-document-header {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  min-height: 420px;
  color: #fff;
  background: #10161d;
}

.map-document-header > div {
  align-self: end;
  padding: 36px;
}

.map-document-header h2 {
  margin-bottom: 14px;
  font-size: 32px;
  white-space: nowrap;
}

.map-document-header p:last-child {
  color: #cfd8e1;
  font-size: 13px;
  line-height: 1.75;
}

.map-document-header > img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

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

.map-variant-grid figure {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #d6dee6;
  border-radius: 7px;
}

.map-variant-grid a,
.map-variant-grid img {
  display: block;
}

.map-variant-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.map-variant-grid figcaption {
  display: grid;
  gap: 3px;
  padding: 12px;
}

.map-variant-grid figcaption strong {
  font-size: 12px;
}

.map-variant-grid figcaption span {
  color: #68778a;
  font-size: 10px;
}

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

.material-groups section {
  padding: 18px;
  border: 1px solid #d5dee6;
  border-radius: 7px;
}

.material-groups span,
.material-groups strong {
  display: block;
}

.material-groups span {
  margin-bottom: 6px;
  color: #168297;
  font-size: 9px;
  font-weight: 900;
}

.material-groups strong {
  font-size: 13px;
  line-height: 1.5;
}

.material-groups p {
  margin: 8px 0 0;
  color: #68778a;
  font-size: 11px;
  line-height: 1.65;
}

.coverage-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  margin-bottom: 18px;
  padding: 14px;
  border-left: 4px solid #168297;
  background: #f1f6f7;
}

.coverage-summary strong {
  font-size: 24px;
}

.coverage-summary span,
.coverage-summary em {
  color: #526276;
  font-size: 11px;
  font-style: normal;
}

.coverage-summary em {
  margin-left: auto;
  color: #806225;
}

.coverage-table {
  border-top: 1px solid #d8e0e7;
  border-left: 1px solid #d8e0e7;
}

.coverage-table-head,
.coverage-table-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) minmax(160px, 1.35fr) 72px minmax(170px, 1.5fr);
}

.coverage-table-head > *,
.coverage-table-row > * {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid #d8e0e7;
  border-bottom: 1px solid #d8e0e7;
  overflow-wrap: anywhere;
}

.coverage-table-head {
  color: #fff;
  background: #344355;
  font-size: 10px;
  font-weight: 900;
}

.coverage-table-row {
  color: #536276;
  font-size: 10px;
  line-height: 1.55;
}

.coverage-table-row strong {
  color: #273649;
  font-size: 10px;
}

.coverage-table-row em {
  font-style: normal;
  font-weight: 900;
}

.coverage-table-row em.is-complete {
  color: #17705f;
}

.coverage-table-row em.is-review {
  color: #946b20;
}

.material-review-list li > span {
  border-color: #b89652;
}

.icon-command {
  min-width: 88px;
  padding: 9px 11px;
  font-size: 12px;
  font-weight: 800;
}

.search-results {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 80;
  width: min(520px, 78vw);
  max-height: min(520px, 68vh);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.2);
}

.search-results button {
  width: 100%;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 2px 10px;
  padding: 10px;
  border: 0;
  text-align: left;
  box-shadow: none;
}

.search-results button + button {
  border-top: 1px solid var(--gray-soft);
}

.search-results button:hover,
.search-results button:focus-visible {
  background: var(--panel-soft);
}

.search-results button span {
  grid-row: 1 / 3;
  align-self: center;
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
}

.search-results button strong,
.search-results button small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-results button strong {
  font-size: 13px;
}

.search-results button small,
.search-empty {
  color: var(--muted);
  font-size: 11px;
}

.search-empty {
  padding: 18px;
  text-align: center;
}

.panel-heading,
.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading h2,
.section-heading-row h3 {
  margin: 0;
}

.health-label {
  padding: 4px 7px;
  border-radius: 5px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 10px;
  font-weight: 900;
}

.health-label.is-complete {
  background: var(--green-soft);
  color: var(--green);
}

.project-health {
  padding: 13px 0 10px;
}

.health-track,
.readiness-track {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #e4e9ef;
}

.health-track span,
.readiness-track span {
  height: 100%;
  display: block;
  background: var(--green);
}

.project-health p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 7px 0 0;
}

.project-health p strong {
  font-size: 15px;
}

.project-health p span {
  color: var(--muted);
  font-size: 10px;
}

.filter-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 4px;
}

.filter-presets button,
.panel-link {
  padding: 6px 5px;
  font-size: 10px;
  font-weight: 800;
}

.panel-link {
  border: 0;
  color: var(--green);
  background: transparent;
  box-shadow: none;
}

.issue-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.issue-row-meta em {
  color: var(--red);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.issue-row-meta small {
  color: var(--muted);
  font-size: 10px;
}

.recent-list {
  display: grid;
  gap: 5px;
}

.recent-list button {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 0;
  text-align: left;
  box-shadow: none;
}

.recent-list button:hover {
  background: var(--panel-soft);
}

.recent-list span {
  color: var(--green);
  font-size: 9px;
  font-weight: 900;
}

.recent-list strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-empty {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.tool-group {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.tool-group button {
  min-width: 38px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.tool-group button + button {
  border-left: 1px solid var(--line);
}

.dashboard-view,
.task-board-view {
  min-height: 100%;
  background: #f4f7fa;
}

.dashboard-shell,
.task-workspace {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.dashboard-status-band,
.task-overview-band {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  padding: 26px 28px;
  border-top: 6px solid var(--green);
  background: #111820;
  color: #fff;
}

.dashboard-status-band > div:first-child,
.task-overview-band > div:first-child {
  max-width: 720px;
}

.dashboard-eyebrow,
.section-heading-row p {
  margin: 0 0 5px;
  color: #54c5b9;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-status-band h2,
.task-overview-band h2 {
  margin: 0 0 8px;
  font-size: 25px;
}

.dashboard-status-band > div:first-child > p:last-child,
.task-overview-band > div:first-child > span {
  color: #b8c3cf;
  font-size: 12px;
  line-height: 1.65;
}

.dashboard-source {
  min-width: 190px;
  display: grid;
  gap: 5px;
  padding-left: 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.dashboard-source span,
.dashboard-source a {
  color: #8ea0b2;
  font-size: 10px;
}

.dashboard-source strong {
  font-size: 12px;
}

.dashboard-source a {
  color: #54c5b9;
  font-weight: 800;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-right: 1px solid var(--line);
}

.dashboard-kpi {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 17px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
  background: #fff;
  box-shadow: none;
}

.dashboard-kpi span,
.dashboard-kpi small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.dashboard-kpi strong {
  overflow-wrap: anywhere;
  font-size: 24px;
}

.dashboard-kpi.tone-alert {
  border-top: 3px solid var(--red);
}

.dashboard-kpi.tone-watch {
  border-top: 3px solid var(--amber);
}

.dashboard-kpi.tone-good {
  border-top: 3px solid var(--green);
}

.dashboard-kpi.tone-neutral {
  border-top: 3px solid var(--line-strong);
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(270px, 0.85fr);
  gap: 14px;
  margin-top: 14px;
}

.dashboard-worklist,
.dashboard-readiness,
.dashboard-deliverables,
.dashboard-character-section {
  border: 1px solid var(--line);
  padding: 18px;
  background: #fff;
}

.section-heading-row {
  margin-bottom: 14px;
}

.section-heading-row button {
  padding: 7px 9px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.dashboard-task-list {
  border-top: 1px solid var(--line);
}

.dashboard-task-row {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(64px, auto) minmax(66px, auto);
  align-items: center;
  gap: 10px;
  padding: 11px 4px;
  border: 0;
  border-bottom: 1px solid var(--gray-soft);
  border-radius: 0;
  text-align: left;
  box-shadow: none;
}

.dashboard-task-row:hover {
  background: var(--panel-soft);
}

.dashboard-task-row > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dashboard-task-row strong,
.dashboard-task-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-task-row strong {
  font-size: 12px;
}

.dashboard-task-row small,
.task-row-owner,
.task-row-status {
  color: var(--muted);
  font-size: 10px;
}

.priority-mark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--gray-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.priority-s,
.priority-a {
  background: var(--red-soft);
  color: var(--red);
}

.priority-b {
  background: var(--amber-soft);
  color: var(--amber);
}

.readiness-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px 36px;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--gray-soft);
}

.readiness-row > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.readiness-row strong {
  font-size: 11px;
}

.readiness-row span,
.readiness-row b {
  color: var(--muted);
  font-size: 10px;
}

.readiness-row b {
  text-align: right;
}

.dashboard-deliverables,
.dashboard-character-section {
  margin-top: 14px;
}

.deliverable-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.deliverable-item {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  text-align: left;
  background: #fff;
  box-shadow: none;
}

.deliverable-item:hover {
  background: var(--panel-soft);
  text-decoration: none;
}

.deliverable-item span {
  color: var(--green);
  font-size: 9px;
  font-weight: 900;
}

.deliverable-item strong {
  font-size: 13px;
}

.deliverable-item small {
  color: var(--muted);
  font-size: 10px;
}

.character-quick-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.character-quick-link {
  min-width: 0;
  display: grid;
  grid-template-rows: 74px auto auto;
  gap: 5px;
  overflow: hidden;
  padding: 0 0 10px;
  border-top: 4px solid var(--character-accent);
  text-align: center;
}

.character-quick-link img,
.character-quick-link > span {
  width: 100%;
  height: 74px;
  display: grid;
  place-items: center;
  object-fit: cover;
  object-position: center 18%;
  background: #e9eef3;
}

.character-quick-link strong,
.character-quick-link small {
  padding: 0 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-quick-link strong {
  font-size: 11px;
}

.character-quick-link small {
  color: var(--muted);
  font-size: 9px;
}

.task-overview-band {
  align-items: center;
}

.task-progress {
  min-width: 180px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 3px 8px;
}

.task-progress strong {
  font-size: 25px;
}

.task-progress span {
  color: #b8c3cf;
  font-size: 11px;
}

.task-progress > div {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
}

.task-progress i {
  height: 100%;
  display: block;
  background: #54c5b9;
}

.task-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fff;
}

.task-filter-tabs,
.task-selectors {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
}

.task-filter-tabs button {
  flex: 0 0 auto;
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 800;
}

.task-filter-tabs button span {
  color: var(--muted);
  font-size: 9px;
}

.task-filter-tabs button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.task-filter-tabs button.is-active span {
  color: #cbd5e1;
}

.task-selectors label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.task-selectors select,
.task-selectors button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
  font-size: 11px;
}

.task-table {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.task-table-head,
.task-table-row {
  display: grid;
  grid-template-columns: 44px minmax(260px, 1fr) minmax(110px, 150px) 112px 34px;
  align-items: center;
  gap: 10px;
}

.task-table-head {
  min-height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #eef2f6;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.task-table-row {
  min-height: 76px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-soft);
}

.task-table-row:last-child {
  border-bottom: 0;
}

.task-table-row:hover {
  background: #fbfcfd;
}

.task-title-button {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 0;
  border: 0;
  text-align: left;
  background: transparent;
  box-shadow: none;
}

.task-title-button strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.task-title-button small {
  overflow: hidden;
  color: var(--muted);
  display: -webkit-box;
  font-size: 10px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-title-button em {
  color: var(--green);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.task-assignment {
  display: grid;
  gap: 3px;
}

.task-assignment strong {
  font-size: 11px;
}

.task-assignment small {
  color: var(--muted);
  font-size: 9px;
}

.task-status-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 800;
}

.status-todo {
  background: #f8fafc;
  color: var(--muted);
}

.status-review {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-working {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-done {
  background: var(--green-soft);
  color: var(--green);
}

.task-detail-button {
  width: 30px;
  height: 30px;
  padding: 0;
  font-weight: 900;
}

.task-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 42px 20px;
  color: var(--muted);
}

.task-empty button {
  padding: 8px 10px;
}

.edit-form-row {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 8px;
}

.dialog-close {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 20px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 15px;
  border-radius: 7px;
  background: #111820;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

body.dashboard-mode .filter-panel,
body.task-mode .filter-panel {
  display: none;
}

body.inspector-collapsed .workspace {
  grid-template-columns: 240px minmax(0, 1fr);
}

body.inspector-collapsed .inspector {
  display: none;
}

@media (max-width: 1180px) {
  .topbar-main {
    grid-template-columns: minmax(210px, 1fr) minmax(190px, 240px) minmax(240px, 1fr) auto;
    gap: 10px;
  }

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

  .inspector {
    grid-column: 1 / -1;
    max-height: 420px;
  }

  body.inspector-collapsed .workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }

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

  .character-quick-grid {
    grid-template-columns: repeat(4, minmax(92px, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    height: auto;
  }

  .topbar {
    width: 100%;
    min-width: 0;
    align-items: flex-start;
    flex-direction: column;
    overflow: visible;
  }

  .topbar-main {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }

  .brand-block {
    grid-column: 1;
    grid-row: 1;
  }

  .topbar-actions {
    width: auto;
    grid-column: 2;
    grid-row: 1;
  }

  .series-box,
  .search-area {
    width: 100%;
    grid-column: 1 / -1;
  }

  .series-box {
    grid-row: 2;
  }

  .search-area {
    grid-row: 3;
  }

  .brand-block,
  .topbar-actions,
  .series-box,
  .search-box {
    min-width: 0;
    max-width: 100%;
  }

  .brand-block {
    width: 100%;
  }

  #projectTitle {
    overflow: visible;
    font-size: 14px;
    line-height: 1.25;
    text-overflow: clip;
    white-space: normal;
    word-break: keep-all;
  }

  .topbar-actions,
  .search-box {
    max-width: 100%;
  }

  .mode-tabs {
    width: 100%;
    justify-content: flex-start;
  }

  .search-box,
  .series-box {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .search-box input,
  .series-box select {
    min-width: 0;
    max-width: 100%;
  }

  .workspace {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
    padding: 10px;
  }

  body.inspector-collapsed .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .left-panel,
  .board-panel,
  .inspector {
    width: 100%;
    min-width: 0;
  }

  .left-panel {
    order: 2;
  }

  .board-panel {
    min-height: 560px;
  }

  body.dashboard-mode .board-panel,
  body.task-mode .board-panel {
    min-height: 0;
  }

  .board-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-actions {
    justify-content: flex-start;
  }

  .dashboard-shell,
  .task-workspace {
    padding: 10px;
  }

  .dashboard-status-band,
  .task-overview-band {
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
    padding: 22px;
  }

  .dashboard-source {
    padding-top: 14px;
    padding-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 0;
  }

  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }

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

  .character-quick-grid {
    grid-template-columns: repeat(3, minmax(86px, 1fr));
  }

  .dashboard-task-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
  }

  .task-row-owner {
    display: none;
  }

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

  .task-filter-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .task-filter-tabs button {
    min-width: 0;
  }

  .task-selectors {
    flex-wrap: wrap;
  }

  .task-table-head {
    display: none;
  }

  .task-table-row {
    grid-template-columns: 30px minmax(0, 1fr) 34px;
    gap: 8px;
  }

  .task-assignment,
  .task-status-select {
    grid-column: 2;
  }

  .task-detail-button {
    grid-column: 3;
    grid-row: 1;
  }

  .graph-viewport.is-play-mode {
    padding: 10px;
  }

  .play-document-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .play-print-button {
    width: 100%;
  }

  .play-cover,
  .play-contact-section {
    padding: 30px 24px;
  }

  .play-cover h2 {
    font-size: 32px;
  }

  .web-document-grid,
  .asset-contact-grid,
  .card-asset-catalog-grid,
  .rule-card-table,
  .ending-branches,
  .story-cast-grid,
  .script-card-grid,
  .research-page-grid,
  .document-route-grid,
  .document-route-grid.compact-grid,
  .map-variant-grid,
  .material-groups {
    grid-template-columns: 1fr;
  }

  .document-access-banner {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 16px 24px;
  }

  .script-passage {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .script-passage > div:first-child {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .phase-guide-list > section {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .phase-guide-list > section > button {
    grid-column: 2;
    width: max-content;
  }

  .map-document-header {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .map-document-header > div {
    padding: 30px 24px;
  }

  .map-document-header > img {
    min-height: 280px;
  }

  .coverage-summary em {
    width: 100%;
    margin-left: 0;
  }

  .coverage-table-head {
    display: none;
  }

  .coverage-table-row {
    grid-template-columns: minmax(0, 1fr) 78px;
  }

  .coverage-table-row > :nth-child(2),
  .coverage-table-row > :nth-child(4) {
    grid-column: 1 / 3;
  }

  .coverage-table-row > :nth-child(2) {
    grid-row: 2;
  }

  .coverage-table-row > :nth-child(4) {
    grid-row: 3;
  }

  .card-asset-catalog-header {
    align-items: stretch;
    flex-direction: column;
    padding: 30px 24px;
  }

  .card-asset-catalog-header dl {
    min-width: 0;
  }

  .card-asset-catalog-body {
    padding: 18px;
  }

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

  .card-asset-detail-cover > img {
    height: auto;
    min-height: 0;
    max-height: 520px;
  }

  .card-asset-detail-cover > div {
    padding: 30px 24px;
    border-top: 6px solid var(--document-accent);
    border-left: 0;
  }

  .handout-cover {
    grid-template-columns: 1fr;
  }

  .handout-cover > img {
    height: 420px;
    min-height: 420px;
  }

  .handout-cover-copy {
    padding: 30px 24px;
    border-top: 6px solid var(--document-accent);
    border-left: 0;
  }

  .handout-cover-copy h2 {
    font-size: 34px;
  }

  .handout-cover-copy h2.is-long {
    font-size: 30px;
  }

  .handout-toc {
    top: 0;
  }

  .handout-body {
    padding: 8px 24px 20px;
  }

  .play-prose-section {
    padding: 36px 0 42px;
    scroll-margin-top: 250px;
  }

  .play-section-number {
    position: static;
    margin-bottom: 8px;
  }

  .play-prose-section > h3 {
    font-size: 22px;
  }
}

@media (max-width: 520px) {
  .icon-command {
    min-width: 0;
  }

  .logout-button {
    padding-inline: 8px;
  }

  .dashboard-kpis,
  .deliverable-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-worklist,
  .dashboard-readiness,
  .dashboard-deliverables,
  .dashboard-character-section {
    padding: 14px;
  }

  .dashboard-task-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .task-row-status {
    grid-column: 2;
  }

  .character-quick-grid {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }

  .search-results {
    right: auto;
    left: 0;
    width: 100%;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }

  body.play-mode {
    background: #fff;
  }

  body.play-mode .topbar,
  body.play-mode .left-panel,
  body.play-mode .inspector,
  body.play-mode .board-toolbar,
  body.play-mode .play-document-nav,
  body.play-mode .timeline-strip {
    display: none !important;
  }

  body.play-mode .app-shell,
  body.play-mode .workspace,
  body.play-mode .board-panel,
  body.play-mode .graph-viewport,
  body.play-mode .play-document-view {
    width: 100%;
    height: auto;
    min-height: 0;
    display: block;
    overflow: visible;
    padding: 0;
    margin: 0;
    border: 0;
    background: #fff;
    box-shadow: none;
  }

  body.play-mode .play-sheet {
    width: 100%;
    margin: 0;
    border: 0;
    box-shadow: none;
  }

  body.play-mode .handout-toc {
    display: none;
  }

  body.play-mode .play-prose-section,
  body.play-mode .web-document-card,
  body.play-mode .asset-contact-item,
  body.play-mode .ending-branches section {
    break-inside: avoid;
  }
}
