/*
 * The spec as a board (Kiln/UI/StoryMapView.swift): the journey's steps left to right, and under each step the rules
 * that hold there. A card shows the rule and a word on its state; open it for why it matters, its examples as
 * sentences, and anything the analyst noticed. On a phone the steps stack.
 */
.spec-panel { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.spec-panel-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px;
  padding: 10px 18px; background: var(--paper); border-bottom: 1px solid var(--rule);
}
.spec-panel-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.spec-panel-body { flex: 1 1 auto; min-height: 0; }
@media (max-width: 599px) {
  .spec-panel-head { padding: 10px 16px; }
}

/* The dotted paper the board sits on (DotGrid). */
.dotted {
  background-color: var(--canvas);
  background-image: radial-gradient(color-mix(in srgb, var(--ink-faint) 38%, transparent) 0.8px, transparent 0.9px);
  background-size: 20px 20px;
  background-position: 10px 10px;
}

.board-wrap { padding: 22px 24px 28px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (max-width: 599px) {
  .board-wrap { padding: 16px; }
}

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px); gap: 16px; align-items: start; overflow-x: auto; padding-bottom: 6px; }
@media (max-width: 719px) {
  .board { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); overflow-x: visible; }
}

.step { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.step-head { display: flex; align-items: flex-start; gap: 9px; padding: 0 4px 2px; }
.step-number {
  display: inline-grid; place-items: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text);
  font-size: 12px; font-weight: 650;
}
.step-title { font-size: 15.5px; font-weight: 600; line-height: 1.3; }
.step-empty { display: grid; place-items: center; height: 64px; border: 1.5px dashed color-mix(in srgb, var(--ink-faint) 50%, transparent); border-radius: var(--radius); color: var(--ink-soft); font-size: 13px; }

/* One rule (RuleCard): closed, its words and a line on its state; open, everything about it. */
.rule-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.rule-card > summary { list-style: none; cursor: pointer; padding: 14px; display: flex; flex-direction: column; gap: 9px; border-radius: inherit; }
.rule-card > summary::-webkit-details-marker { display: none; }
.rule-card > summary:hover { background: color-mix(in srgb, var(--ink) 2.5%, transparent); }
.rule-title { font-size: 14.5px; font-weight: 600; line-height: 1.45; }
.rule-statuses { display: flex; flex-direction: column; gap: 3px; }
.rule-status { --tint: var(--wait-text); display: flex; align-items: flex-start; gap: 6px; color: var(--tint); font-size: 12.5px; font-weight: 550; line-height: 1.4; }
.rule-status::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 0.45em; border-radius: 50%; background: currentColor; }
.rule-status--alert { --tint: var(--alert); }
.rule-status--info { --tint: var(--info); }
.rule-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-soft); }
.rule-meta-assumed { color: var(--info); }
.rule-chevron { margin-left: auto; width: 13px; height: 13px; color: var(--ink-faint); transition: transform 0.2s ease; }
.rule-card[open] .rule-chevron { transform: rotate(180deg); }
.rule-detail { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.rule-because { font-size: 13.5px; font-style: italic; color: var(--ink-soft); }

/* An example read as one sentence: "Given …, when …, then …." (ExampleSentence). */
.example { padding: 10px 11px; border-radius: var(--radius-small); background: var(--inset); display: flex; flex-direction: column; gap: 4px; }
.example-title { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-soft); }
.example-sentence { font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.example-sentence b { font-weight: 650; }

/* Something the analyst noticed, in plain words (FlagNote). */
.flag { --tint: var(--wait); --tint-text: var(--wait-text); display: flex; align-items: flex-start; gap: 8px; padding: 10px; border-radius: var(--radius-small); background: color-mix(in srgb, var(--tint) 9%, transparent); }
.flag svg { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--tint-text); }
.flag-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.flag-title { font-size: 12.5px; font-weight: 600; color: var(--tint-text); }
.flag-words { font-size: 13px; color: var(--ink); }
.flag-today { font-size: 12.5px; color: var(--ink-soft); }
.flag--clash, .flag--outside { --tint: var(--alert); --tint-text: var(--alert); }
.flag--tip, .flag--assumed { --tint: var(--info); --tint-text: var(--info); }

/* Questions on the board: the open ones first, before the steps. */
.board-questions { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; max-width: 980px; }

/* What the board looks like before there's anything on it (EmptyMap). */
.empty-map { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 56px 24px; text-align: center; }
.empty-map-sketch { display: flex; gap: 14px; opacity: 0.8; }
.empty-map-column { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-map-column span { display: block; width: 130px; height: 56px; border: 1.5px dashed color-mix(in srgb, var(--ink-faint) 50%, transparent); border-radius: 10px; }
.empty-map-column span:first-child { width: 90px; height: 10px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--ink-faint) 30%, transparent); }
.empty-map-title { font-size: 16px; font-weight: 600; }
.empty-map p { max-width: 380px; font-size: 14px; color: var(--ink-soft); }
@media (max-width: 599px) {
  .empty-map-column span { width: 80px; }
  .empty-map-column:nth-child(3) { display: none; }
}

/* The design step and the build stage fill these later (W3 and W4). */
.designs:empty, .stage:empty { display: none; }

/* Every saved change to the feature, newest first. */
.history { list-style: none; display: flex; flex-direction: column; }
.history-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--rule); }
.history-item:first-child { border-top: 0; padding-top: 0; }
.history-dot { flex: none; width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.history-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; }
.history-when { font-size: 12.5px; color: var(--ink-soft); }
