/* The plugins section: a plugin's view beside the Markdown file it reads and writes. */
.plugins { max-width: 1180px; margin: 150px auto 0; padding: 0 24px; }
.plugins > header { text-align: center; }
.plugins h2 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: clamp(2.4rem, 5vw, 3.8rem); line-height: 1; letter-spacing: -0.02em; }
.plugins h2 em { color: var(--teal); }
.plugins h2 span { display: block; color: var(--muted); }
.plugins > header p { max-width: 34rem; margin: 1rem auto 0; color: var(--muted); font-size: 1.05rem; line-height: 1.55; }

.ptabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 2.2rem 0 1.4rem; }
.ptabs button {
  font: inherit;
  font-size: 0.9rem;
  height: 38px;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ptabs button:hover { color: var(--fg); }
.ptabs button[aria-selected="true"] { background: var(--fg); border-color: var(--fg); color: var(--paper); }

.stage {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  grid-template-rows: 100%;
  /* Fixed, so switching plugins doesn't move the page: a longer file scrolls. */
  height: 500px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 40px 80px -40px rgba(var(--shade), 0.3);
}
.view { position: relative; padding: 26px; min-width: 0; overflow: auto; }
.view .hint { position: absolute; right: 18px; bottom: 14px; font-size: 0.78rem; color: var(--faint); }
.source { background: var(--well); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.source .file { display: flex; align-items: center; gap: 0.5rem; height: 42px; padding: 0 18px; border-bottom: 1px solid var(--line); font-size: 0.8rem; color: var(--muted); }
.source .file b { font-weight: 500; color: var(--fg); }
.source pre {
  flex: 1;
  margin: 0;
  padding: 16px 0;
  overflow: auto;
  font: 0.8rem/1.75 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color: color-mix(in srgb, var(--fg) 82%, transparent);
  font-variant-ligatures: none;
}
.source pre div { padding: 0 18px; white-space: pre-wrap; word-break: break-word; transition: background 1.2s; }
.source pre div.changed { background: color-mix(in srgb, var(--teal) 16%, transparent); transition: none; }
.md-h { color: var(--fg); font-weight: 600; }
.md-fm { color: var(--faint); }
.md-box { color: var(--teal); }
.md-date { color: var(--orange); }
.md-link { color: var(--violet); }
.md-kw { color: var(--violet); font-weight: 600; }
.md-dim { color: var(--faint); }

.vtitle { font-family: "Instrument Serif", Georgia, serif; font-size: 1.7rem; line-height: 1; margin-bottom: 18px; }
.vtitle small { font-family: Inter, sans-serif; font-size: 0.8rem; color: var(--muted); margin-left: 0.5rem; }

/* Kanban */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: start; }
.lane { background: var(--well); border-radius: 12px; padding: 10px; min-height: 220px; transition: background 0.15s; }
.lane.over { background: var(--teal-wash); }
.lane h4 { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin: 2px 4px 10px; display: flex; justify-content: space-between; }
.card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  margin-bottom: 8px;
  font-size: 0.86rem;
  line-height: 1.35;
  cursor: grab;
  user-select: none;
  touch-action: none;
  box-shadow: 0 1px 2px rgba(var(--shade), 0.06);
}
.card.done { color: var(--faint); text-decoration: line-through; }
.card.dragging { position: fixed; z-index: 50; pointer-events: none; cursor: grabbing; box-shadow: 0 18px 40px -10px rgba(var(--shade), 0.35); transform: rotate(2deg); }
.card.placeholder { background: transparent; border: 1px dashed var(--line-strong); box-shadow: none; color: transparent; }

/* Tasks */
.tgroup { margin-bottom: 16px; }
.tgroup h4 { font-size: 0.82rem; color: var(--faint); font-weight: 500; margin-bottom: 6px; }
.task { display: flex; align-items: center; gap: 0.7rem; padding: 8px 4px; border-bottom: 1px solid var(--rule); font-size: 0.92rem; cursor: pointer; }
.task input { appearance: none; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; cursor: pointer; flex: none; margin: 0; }
.task input:checked { background: var(--teal); border-color: var(--teal); }
.task input:checked::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.task.done .t { color: var(--faint); text-decoration: line-through; }
.task .due { margin-left: auto; font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; background: var(--well); color: var(--muted); white-space: nowrap; }
.task .due.late { background: var(--orange-wash); color: var(--orange); }
.task .prio { color: var(--orange); font-size: 0.75rem; }

/* Dataview */
.dv-filters { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.dv-filters button { font: inherit; font-size: 0.8rem; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.dv-filters button.on { background: var(--teal-wash); border-color: var(--teal-edge); color: var(--teal); }
.dv { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.dv th { text-align: left; font-weight: 500; font-size: 0.78rem; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; white-space: nowrap; }
.dv th:hover { color: var(--fg); }
.dv th .arrow { color: var(--teal); margin-left: 3px; }
.dv td { padding: 9px 10px; border-bottom: 1px solid var(--rule); }
.dv td:first-child { color: var(--violet); }
.dv .stars { color: #d39b2a; letter-spacing: 1px; }
.dv tr { transition: opacity 0.2s; }

/* Graph */
.graph { position: absolute; inset: 0; user-select: none; -webkit-user-select: none; }
.graph svg { width: 100%; height: 100%; display: block; touch-action: none; }
.graph line { stroke: var(--line); stroke-width: 1.2; transition: stroke 0.2s; }
.graph line.hot { stroke: var(--teal); stroke-width: 1.8; }
.graph circle { fill: var(--line-strong); cursor: grab; transition: fill 0.2s; }
.graph g.node.hot circle, .graph g.node.sel circle { fill: var(--teal); }
.graph g.node.sel circle { stroke: var(--teal-edge); stroke-width: 6; }
.graph text { font-size: 11px; fill: var(--muted); pointer-events: none; text-anchor: middle; }
.graph g.node.sel text { fill: var(--fg); font-weight: 600; }

/* Excalidraw */
.source pre.nowrap div { white-space: pre; word-break: normal; width: max-content; min-width: 100%; }
.xtools { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; padding: 4px; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 4px 14px -6px rgba(var(--shade), 0.2); z-index: 1; }
.xtools button { font: inherit; font-size: 0.8rem; padding: 5px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.xtools button:hover { background: var(--well); }
.xtools button.on { background: var(--teal-wash); color: var(--teal); }
.xboard { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 22px 22px; }
.xboard path { fill: none; stroke: var(--fg); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.xboard text { font: 1.5rem Caveat, "Comic Sans MS", cursive; fill: var(--fg); text-anchor: middle; }
.more { margin-top: 1.6rem; text-align: center; color: var(--muted); font-size: 0.92rem; line-height: 2; }
.more span { display: inline-block; padding: 0 0.7rem; border: 1px solid var(--line); border-radius: 999px; margin: 0 2px; font-size: 0.82rem; line-height: 1.9; }

@media (max-width: 860px) {
  .stage { grid-template-columns: 1fr; grid-template-rows: 400px 300px; height: auto; }
  .source { border-left: 0; border-top: 1px solid var(--line); }
  .view { padding: 18px; }
  .board { gap: 8px; }
  .lane { padding: 7px; }
  .card { font-size: 0.78rem; padding: 7px 8px; }
  .plugins { margin-top: 100px; }
  .ptabs { gap: 4px; }
  .ptabs button { height: 34px; padding: 0 0.75rem; font-size: 0.82rem; }
}
