/* ===========================================================================
   SolutionsCoding -- 画面イメージ: the admin console of the organisation's
   rule pack (.cd-demo > .cd-tabs + .dc-ui--coding). Loaded after
   home-prototype.css; built on the shared .dc-ui frame like
   solutions-chatops-mock.css.
     coding-mock.css    tokens, tab bar, window chrome, rail, shared row /
                        pill / note parts, motion (this file)
     coding-mock-2.css  what each of the 6 panels shows + responsive
     coding-mock.js     count-up of the 3 numbers on tab 5 (利用状況) only
   Tabs: home-motion.js (.dc-ui-tabs / .dc-ui-tab[aria-controls] /
   .dc-ui-panel.is-active). The rail row follows the open tab with :has();
   without :has it keeps row 1 marked. No JS: no tab bar, every panel shows.
   Motion: the window latches once (data-io + data-cd-latch, coding-sections.js)
   and every panel that is shown -- first reveal or tab switch -- plays its own
   short "sentence": panel fade + 6px rise, rows rise 40ms apart, status pills
   pop, panel-specific beats. Start states live only under html.cd-motion, so
   no JS / reduced motion / print show the final frame.
   Type floor (owner rule 2026-10-04): Japanese >= 13px, Latin >= 12px, so
   every label / meta / pill / tag is 13px; row names 14px, panel titles 16px.
   =========================================================================== */
.cd-demo {
  --acc: #B8531A; --acc-ink: #9A4413; --tint: #FBEFE7; --edge: #E8C2A8;
  --cd-mk: #E07A3E;                          /* orange on navy, marks only (4.9:1) */
  --cd-ok: #2A7240; --cd-ok-bg: #EAF5EC;     /* 5.2:1 */
  --cd-kn: #1D5E94; --cd-kn-bg: #E8F0F8;     /* 5.9:1 */
  --cd-neu: #46566A; --cd-neu-bg: #EEF1F4;   /* 6.6:1 */
  --cd-ln: #E3E6EA; --cd-ln2: #EEF1F4; --cd-frame: #C9D3DD;
  --cd-row: 40px;                            /* rail row height (mark steps by it) */
}

/* ---- lead, caption ------------------------------------------------------- */
.cd-mock-lead { margin: 12px 0 clamp(28px, 3vw, 40px); max-width: 40em; font-family: 'Noto Sans JP', sans-serif; font-size: 16px; line-height: 2; color: var(--muted); }
.cd-demo .dc-ui-cap { color: var(--muted); }   /* 5.2:1 on the section tint; shared #7E93A8 is 3:1 */
@supports not (word-break: auto-phrase) { .cd-mock-lead, .cd-demo .dc-ui-cap, .cd-mock-say__i { word-break: keep-all; } }

/* ---- what this screen is: one plain line per tab, above the window -------- */
/* All six share one grid cell (the tallest sets the height), so switching
   tabs never moves the window; the open tab's line shows. No JS: hidden
   (the tabs are hidden too and all panels show). */
.cd-mock-say { display: grid; margin: 0 0 18px; }
html:not(.js) .cd-mock-say { display: none; }
@supports not selector(:has(*)) { .cd-mock-say { display: none; } }   /* cannot follow the tab: no empty gap */
.cd-mock-say__i { grid-area: 1 / 1; align-self: start; display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--acc); font-family: 'Noto Sans JP', sans-serif; visibility: hidden; opacity: 0; }
.cd-mock-say__h { font-size: 16px; font-weight: 700; line-height: 1.75; color: var(--navy); }
.cd-mock-say__h em { font-style: normal; color: var(--acc-ink); }
.cd-mock-say__d { font-size: 14px; line-height: 1.9; color: var(--ink); }
.cd-demo:has(#panel-coding-1.is-active) [data-say="1"], .cd-demo:has(#panel-coding-2.is-active) [data-say="2"],
.cd-demo:has(#panel-coding-3.is-active) [data-say="3"], .cd-demo:has(#panel-coding-4.is-active) [data-say="4"],
.cd-demo:has(#panel-coding-5.is-active) [data-say="5"], .cd-demo:has(#panel-coding-6.is-active) [data-say="6"] { visibility: visible; opacity: 1; }
html.cd-motion .cd-mock-say__i { transition: opacity 0.25s ease, visibility 0.25s; }

/* ---- tab bar (page-level control, outside the window) --------------------- */
html:not(.js) .cd-tabs { display: none; }   /* no JS: all 6 panels show */
.cd-tabs.dc-ui-tabs { display: flex; flex-wrap: nowrap; gap: 8px; margin: 0 0 16px; }
.cd-tabs .dc-ui-tab { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 52px; padding: 8px 10px; border: 1px solid var(--acc); border-radius: 10px; background: var(--white); box-shadow: 0 2px 0 var(--edge); font-size: 14px; color: var(--navy); word-break: keep-all; transition: background-color var(--dur-3) var(--ease-out), color var(--dur-3) var(--ease-out), box-shadow var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out); }
.cd-tabs .dc-ui-tab svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.cd-tabs .dc-ui-tab.is-on { background: var(--acc); color: var(--white); box-shadow: inset 0 2px 0 rgba(0,0,0,0.18); cursor: default; }   /* #FFF on acc 4.9:1, bold 14px */
@media (hover: hover) and (pointer: fine) {
  .cd-tabs .dc-ui-tab:not(.is-on):hover { transform: translateY(-1px); background: var(--tint); box-shadow: 0 3px 0 var(--edge), 0 6px 14px rgba(16,42,67,0.12); }
}
.cd-tabs .dc-ui-tab:not(.is-on):active { transform: translateY(1px); box-shadow: 0 1px 0 var(--edge); }

/* ---- window chrome ---------------------------------------------------------- */
.dc-ui--coding { border-color: var(--cd-frame); border-radius: 10px; word-break: auto-phrase; overflow-wrap: break-word; }
.dc-ui--coding .dc-ui-bar { gap: 12px; height: 46px; padding: 0 14px; }
.cd-mock-brand { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.cd-mock-brand svg { width: 22px; height: 22px; flex: 0 0 22px; display: block; }
.dc-ui--coding .dc-ui-bar .cd-mock-brand b { margin: 0; font-size: 14px; letter-spacing: 0.04em; color: var(--white); }
.cd-mock-where { padding-left: 12px; border-left: 1px solid rgba(255,255,255,0.2); font-size: 13px; color: rgba(255,255,255,0.78); white-space: nowrap; }
.cd-mock-org { display: inline-flex; align-items: center; gap: 6px; height: 26px; margin-left: auto; padding: 0 9px; border-radius: 6px; background: rgba(255,255,255,0.1); font-size: 13px; color: rgba(255,255,255,0.88); white-space: nowrap; }
.cd-mock-org svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.cd-mock-me { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px rgba(255,255,255,0.22); font-size: 13px; font-weight: 700; color: var(--white); }

.dc-ui--coding .dc-ui-body { grid-template-columns: 216px minmax(0, 1fr); }
/* rail = the product's own navy sidebar (as in the hero film); flat, not pressable */
.dc-ui--coding .dc-ui-rail { position: relative; display: flex; flex-direction: column; padding: 16px 0 0; border-right: 0; background: var(--navy); }
.dc-ui--coding .dc-ui-rail > p.cd-rail-foot { display: flex; align-items: center; gap: 8px; height: auto; margin-top: auto; padding: 12px 18px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 13px; font-weight: 500; letter-spacing: 0.02em; line-height: 1.6; color: rgba(255,255,255,0.74); }
.dc-ui--coding .dc-ui-rail > p { height: 28px; margin: 0; padding: 0 18px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; line-height: 20px; color: rgba(255,255,255,0.66); }
.dc-ui--coding .dc-ui-rail > span { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; height: var(--cd-row); padding: 0 16px 0 21px; font-size: 13px; font-weight: 500; line-height: 1.4; color: rgba(255,255,255,0.74); white-space: nowrap; }
.dc-ui--coding .dc-ui-rail > span svg { width: 15px; height: 15px; flex: 0 0 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
/* one mark that moves to the open tab's row (--k). Without :has: row 1. */
.cd-rail-mark { position: absolute; top: 44px; left: 8px; right: 8px; height: var(--cd-row); border-radius: 6px; background: rgba(255,255,255,0.12); transform: translateY(calc(var(--k, 0) * var(--cd-row))); }
.cd-rail-mark::before { content: ""; position: absolute; top: 9px; bottom: 9px; left: 0; width: 3px; border-radius: 3px; background: var(--cd-mk); }
.dc-ui--coding .dc-ui-rail [data-rail="1"] { color: var(--white); }
.dc-ui--coding:has(.dc-ui-panel.is-active:not(#panel-coding-1)) .dc-ui-rail [data-rail="1"] { color: rgba(255,255,255,0.74); }
.dc-ui--coding:has(#panel-coding-2.is-active) { --k: 1; }
.dc-ui--coding:has(#panel-coding-3.is-active) { --k: 2; }
.dc-ui--coding:has(#panel-coding-4.is-active) { --k: 3; }
.dc-ui--coding:has(#panel-coding-5.is-active) { --k: 4; }
.dc-ui--coding:has(#panel-coding-6.is-active) { --k: 5; }
.dc-ui--coding:has(#panel-coding-2.is-active) [data-rail="2"], .dc-ui--coding:has(#panel-coding-3.is-active) [data-rail="3"],
.dc-ui--coding:has(#panel-coding-4.is-active) [data-rail="4"], .dc-ui--coding:has(#panel-coding-5.is-active) [data-rail="5"],
.dc-ui--coding:has(#panel-coding-6.is-active) [data-rail="6"] { color: var(--white); }

/* ---- main area, panel frame, head, note ------------------------------------ */
.dc-ui--coding .dc-ui-main { display: flex; flex-direction: column; padding: 0; background: var(--white); container: cdm / inline-size; }
.dc-ui--coding .dc-ui-panel { position: relative; flex: 1 0 auto; padding: 0 24px 22px; }
.dc-ui--coding .dc-ui-panel:focus-visible { outline: 2px solid var(--navy); outline-offset: -2px; }
html.js .dc-ui--coding .dc-ui-panel.is-active { display: flex; flex-direction: column; }
html.js .dc-ui--coding .dc-ui-panel.is-active::after { content: ""; order: 1; flex: 1 0 18px; }   /* bottom air */
.cd-mock-head { display: flex; align-items: center; gap: 10px; min-height: 56px; margin: 0 -24px 16px; padding: 10px 24px; border-bottom: 1px solid var(--cd-ln); }
.cd-mock-head b { font-size: 16px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.cd-mock-n { padding: 0 8px; border-radius: 999px; background: var(--cd-neu-bg); font-size: 13px; font-weight: 700; line-height: 24px; color: var(--cd-neu); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cd-mock-meta { margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cd-mock-sub { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); }
.cd-mock-sub span { font-weight: 400; letter-spacing: 0; }

/* ---- pills, avatars, tags ---------------------------------------------------- */
.cd-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 9px; border-radius: 999px; background: var(--cd-neu-bg); font-size: 13px; font-weight: 700; line-height: 1; color: var(--cd-neu); white-space: nowrap; }
.cd-pill::before { content: ""; flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cd-pill[data-tone="ok"] { background: var(--cd-ok-bg); color: var(--cd-ok); }
.cd-pill[data-tone="warn"] { background: var(--tint); color: var(--acc-ink); }
.cd-pill[data-tone="warn"]::before { border-radius: 1px; }   /* square = blocked, not only colour */
.cd-av { display: inline-grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); font-size: 13px; font-weight: 700; line-height: 1; color: var(--white); }
.cd-av[data-c="2"] { background: var(--blue); }
.cd-av[data-c="3"] { background: var(--acc-ink); }
.cd-av[data-c="4"] { background: var(--cd-neu); }
.cd-tag { display: inline-block; padding: 0 7px; border-radius: 4px; background: var(--tint); font-size: 13px; font-weight: 700; line-height: 24px; color: var(--acc-ink); white-space: nowrap; }   /* 5.8:1 */

/* ---- motion ------------------------------------------------------------------
   --cd-mock-lag holds the panel back 280ms on the first reveal only, so the window
   arrives first and the data follows. .cd-first is in the markup; coding-mock.js
   removes it 1.4s after the reveal or at the first tab switch, whichever comes
   first, so a tab switch always plays at once (no registered-property trick). -- */
@keyframes cd-mock-panel { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes cd-mock-row { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes cd-mock-write { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes cd-mock-slide { from { opacity: 0; transform: translate(var(--sx, 0px), var(--sy, 10px)); } to { opacity: 1; transform: none; } }
@keyframes cd-mock-pop { 0% { opacity: 0; transform: scale(0.6); } 70% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: none; } }
@keyframes cd-mock-growx { from { transform: scaleX(0); } to { transform: none; } }
@keyframes cd-mock-growy { from { transform: scaleY(0); } to { transform: none; } }
@keyframes cd-mock-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cd-mock-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

html.cd-motion .dc-ui--coding { --cd-mock-lag: 0s; }
html.cd-motion .dc-ui--coding.cd-first { --cd-mock-lag: 280ms; }
html.cd-motion .dc-ui--coding[data-cd-latch]:not(.cd-seen) { opacity: 0; transform: translateY(12px); }
html.cd-motion .dc-ui--coding.cd-seen { transition: opacity var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out); }
html.cd-motion .dc-ui--coding.cd-seen .dc-ui-panel.is-active { animation: cd-mock-panel var(--dur-3) var(--ease-out) var(--cd-mock-lag) both; }
html.cd-motion .dc-ui--coding.cd-seen .dc-ui-panel.is-active .cd-mock-in { animation: cd-mock-row 0.35s var(--ease-out) calc(var(--cd-mock-lag) + 60ms + var(--r, 0) * 40ms) both; }
html.cd-motion .dc-ui--coding.cd-seen .dc-ui-panel.is-active .cd-mock-in .cd-pill { animation: cd-mock-pop 0.35s var(--ease-out) calc(var(--cd-mock-lag) + 220ms + var(--r, 0) * 40ms) both; }
/* the rail mark draws itself on the first reveal, then glides between rows */
html.cd-motion .dc-ui--coding.cd-seen .cd-rail-mark { animation: cd-mock-fade 0.3s var(--ease-out) var(--cd-mock-lag) both; transition: transform var(--dur-3) var(--ease-soft); }
html.cd-motion .dc-ui--coding.cd-seen .cd-rail-mark::before { animation: cd-mock-growy 0.3s var(--ease-out) calc(var(--cd-mock-lag) + 80ms) both; }
html.cd-motion .dc-ui--coding.cd-seen .dc-ui-rail > span { transition: color var(--dur-3) var(--ease-soft); }
/* keyboard focus landed inside before or during the first reveal (coding-sections.js,
   keyboard only): show it at once, so focus never sits on an invisible panel. This
   keyboard visitor then switches tabs without motion; mouse visitors keep it. */
.dc-ui--coding.cd-now, .dc-ui--coding.cd-now * { transition: none !important; }
html.cd-motion .dc-ui--coding.cd-now :is(.dc-ui-panel.is-active, .dc-ui-panel.is-active *, .cd-rail-mark, .cd-rail-mark::before) { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .cd-tabs .dc-ui-tab { transition: none; }
}
