/* The card bar on the board (cards.js): ink on paper like the rest of the page. Cards are parts of the page,
   divided by rules, never boxes floating over it: no shadows, no rounded corners. The five renderings sit in
   l-panel (细线格): two columns divided by hairlines. */

.cards-bar { display: flex; align-items: baseline; gap: 12px; margin-top: 18px; padding-top: 6px; border-top: 1px solid var(--ink); }
.cards-bar .group-h { margin: 0; }
.cards-bar .grow { flex: 1; }
.cards-bar [aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.cards-bar .linkbtn:not([aria-pressed="true"]) { color: var(--ink2); }
.cards-add { margin: 8px 0 4px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.cards-add .actions { display: flex; gap: 14px; align-items: baseline; margin-top: 8px; }

.card .ch { display: flex; align-items: baseline; gap: 10px; }
.card .title { font-family: var(--sc); letter-spacing: .1em; font-size: 13px; color: var(--ink); white-space: nowrap; }
.card .meta { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink3); white-space: nowrap; }
/* A card is one line until it is opened: its title, then what its view sums it up as. */
.card .fold { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; padding: 0; background: none; border: 0; text-align: left; }
.card .fold::before { content: "▸"; font-family: var(--mono); font-size: 10.5px; color: var(--ink2); }
.card .fold[aria-expanded="true"]::before { content: "▾"; }
.card .fold:hover .title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.card .sum { min-width: 0; font-size: 12.5px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.open .sum { color: var(--ink3); }
.card .ctools { display: inline-flex; gap: 8px; margin-left: 10px; font-size: 12.5px; }
.card .cb { min-width: 0; }

/* 细线格: two columns; each cell draws its right and lower hairline, the grid the upper and left. */
.l-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); margin-top: 8px; }
.l-panel .card { padding: 9px 12px 11px; min-width: 0; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.l-panel .card.wide { grid-column: span 2; }
.l-panel .card:not(.open) { padding: 6px 12px 7px; }
.l-panel .card.open .ch { margin-bottom: 6px; }

/* The five renderings. */
.c-number .v { font-family: var(--serif); font-size: 36px; line-height: 1.1; }
.c-number .u { margin-left: 6px; color: var(--ink2); font-size: 13px; }
.c-number .s { font-size: 12.5px; color: var(--ink2); }

.c-bar .r { display: grid; grid-template-columns: 3.2em minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 3px 0; }
.c-bar .l { font-size: 13px; color: var(--ink2); }
.c-bar .track { height: 7px; border: 1px solid var(--ink3); }
.c-bar .fill { display: block; height: 100%; width: calc(var(--f) * 100%); background: var(--ink2); }
.c-bar .v { font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
.c-bar .note { grid-column: 2 / -1; font-size: 11.5px; color: var(--ink3); }
.c-bar .foot { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0 0; font-size: 12.5px; }
.c-bar .foot dt { color: var(--ink2); }
.c-bar .foot dd { margin: 0; }

.c-grid table { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; }
.c-grid th { font-weight: 400; color: var(--ink2); text-align: left; padding: 3px 6px 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-grid thead th { font-family: var(--mono); font-size: 11px; border-bottom: 1px solid var(--rule); }
.c-grid tbody th { width: 34%; }
.c-grid td { padding: 3px 6px; border-bottom: 1px dotted var(--rule); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-grid td.t-free::before { content: "·"; color: var(--ink3); }
.c-grid td.t-mine { font-weight: 700; background: var(--wash); box-shadow: inset 2px 0 var(--ink); }
.c-grid td.t-live { font-style: italic; text-decoration: underline dotted; text-underline-offset: 3px; }
.c-grid td.t-watch { color: var(--ink2); }
.c-grid td.t-ok { color: var(--ink2); }
.c-grid td.t-down::before { content: "✕ "; font-family: var(--mono); font-size: 10.5px; }
.c-grid td.t-down, .c-grid td.t-wrap { white-space: normal; overflow-wrap: anywhere; }
.c-grid .note { margin-top: 6px; font-size: 11.5px; color: var(--ink3); }

.c-time { list-style: none; margin: 0; padding: 0; }
.c-time li { display: grid; grid-template-columns: 3.4em minmax(0, 1fr); gap: 0 10px; padding: 3px 0; border-bottom: 1px dotted var(--rule); }
.c-time li:last-child { border-bottom: 0; }
.c-time .at { font-family: var(--mono); font-size: 11.5px; color: var(--ink2); padding-top: 2px; }
.c-time .tx { font-size: 13.5px; }
.c-time .sub { grid-column: 2; font-size: 12px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-time li.t-next .tx { font-weight: 700; }
.c-time li.t-next .at::before { content: "▸ "; }
.c-time li.t-live .tx { font-style: italic; }
.c-time li.t-text .sub { white-space: pre-wrap; overflow: auto; max-height: 16em; font-family: var(--mono); font-size: 11.5px; }
.c-time li.t-text .tx { overflow-wrap: anywhere; }
.c-time li.fold { display: block; font-size: 12.5px; }
.c-time li.t-past .tx, .c-time li.t-past .at { color: var(--ink2); }

.c-chain .run { padding: 5px 0 7px; border-bottom: 1px dotted var(--rule); }
.c-chain .run:last-child { border-bottom: 0; }
.c-chain .rh { display: flex; gap: 10px; align-items: baseline; font-size: 13px; }
.c-chain .rh .o { color: var(--ink2); }
.c-chain .rh .t { margin-left: auto; font-family: var(--mono); font-size: 11.5px; }
.c-chain .segs { display: flex; height: 12px; margin: 4px 0 3px; width: calc(var(--len) * 100%); border: 1px solid var(--ink3); }
.c-chain .seg { flex: var(--w) 1 0; min-width: 2px; border-right: 1px solid var(--bg); }
.c-chain .seg:last-child { border-right: 0; }
.c-chain .seg i { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.c-chain .seg.k0 { background: var(--ink); }
.c-chain .seg.k1 { background: var(--ink3); }
.c-chain .seg.k2 { background: var(--ink2); }
.c-chain .legend { display: flex; flex-wrap: wrap; gap: 2px 12px; font-family: var(--mono); font-size: 10.5px; color: var(--ink2); }

/* The owner's acts: plain links at the end of a line or under a card; a form opens under the card and runs only on
   its second click. */
.c-time .act-links { grid-column: 2; display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12.5px; }
.c-grid tr.has-acts > * { border-bottom: 0; }
.c-grid tr.act-line td { padding: 0 6px 4px 34%; white-space: normal; font-size: 12.5px; }
.c-grid tr.act-line .linkbtn + .linkbtn { margin-left: 12px; }
.card-acts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; padding-top: 6px; border-top: 1px dotted var(--rule); font-size: 13px; }
.card .act-links [aria-pressed], .card .act-line [aria-pressed="true"], .card-acts [aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.act-form { margin-top: 8px; padding: 8px 0 2px 12px; border-left: 2px solid var(--ink); }
.act-form .field { display: grid; gap: 2px; margin-bottom: 8px; font-size: 12.5px; color: var(--ink2); }
.act-form input, .act-form select, .act-form textarea { font: inherit; font-size: 13.5px; color: var(--ink); background: var(--bg); border: 1px solid var(--ink3); padding: 4px 6px; border-radius: 0; }
.act-form textarea { font-family: var(--mono); font-size: 12px; resize: vertical; }
.act-form .confirm { margin: 4px 0 6px; font-size: 13.5px; }
.act-form .err { margin: 0 0 6px; color: var(--ink); font-weight: 700; }
.act-form .actions { display: flex; gap: 14px; align-items: baseline; }
.cnote { margin: 8px 0 0; font-family: var(--mono); font-size: 11.5px; color: var(--ink2); white-space: pre-wrap; }
.draft-card { margin: 6px 0; padding: 8px 0 8px 12px; border-left: 1px solid var(--rule); }
.draft-card .hd { display: flex; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.draft-card .hd .title { font-family: var(--sc); letter-spacing: .1em; font-size: 13px; }

/* The owner's controls (controls.js): a name, the control itself, and a word about it, one row each. A choice is
   the page's own (.seg): the one in force underlined. Fields are a line to write on, as on the settings page. */
.ctl-row { display: grid; grid-template-columns: minmax(0, 11.5em) minmax(0, auto) minmax(0, 1fr); align-items: baseline; gap: 2px 14px; padding: 5px 0; border-bottom: 1px dotted var(--rule); font-size: 13.5px; }
.ctl-row:last-child { border-bottom: 0; }
.ctl-row .nm { color: var(--ink2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctl-row .ct { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctl-row .seg { gap: 12px; flex-wrap: wrap; }
.ctl-row .seg button { font-size: 13.5px; }
.ctl-row .act-links { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12.5px; }
.ctl-row > .act-form, .ctl-row > .cnote, .ctl-row > .act-links > .act-form, .ctl-row > .act-links > .cnote { grid-column: 1 / -1; flex-basis: 100%; }
.ctl-row > .seg ~ .dt { grid-column: 2 / -1; }
.card .cb > .note { margin-top: 6px; font-size: 11.5px; color: var(--ink3); }
.ctl-row.mem { grid-template-columns: minmax(0, 11.5em) minmax(0, 1fr) auto; }
.dt { font-size: 12.5px; color: var(--ink2); min-width: 0; }
.ctl select, .ctl input, .mem-add select, .mem-add input, .cast input[type="time"] { min-width: 0; padding: 1px 2px; border: 0; border-bottom: 1px solid var(--ink3); border-radius: 0; background: var(--bg); font-size: 13.5px; outline: none; }
.ctl select:focus, .ctl input:focus, .mem-add select:focus, .mem-add input:focus, .cast input:focus { border-bottom-color: var(--ink); }
.ctl input[type="number"] { width: 6.5em; font-family: var(--mono); font-size: 12.5px; }
.ctl input[type="time"], .cast input[type="time"] { font-family: var(--mono); font-size: 12.5px; }
.ctl .pair { display: inline-flex; align-items: baseline; gap: 8px; color: var(--ink2); }
.ctl-row.dirty .nm { color: var(--ink); font-weight: 700; }
.ctl-row.dirty .nm::after { content: " ·"; }
.savebar { display: flex; align-items: baseline; gap: 12px; margin-top: 6px; padding: 7px 0 3px; border-top: 1px solid var(--ink); font-size: 13.5px; }
.savebar .n { font-family: var(--sc); letter-spacing: .1em; }
.savebar .grow { flex: 1; }
.card .err { margin: 6px 0 0; font-size: 13px; font-weight: 700; }
.mem-add { display: grid; grid-template-columns: 7em 9em minmax(0, 1fr) auto; align-items: baseline; gap: 10px; margin-top: 8px; }

/* Her settings: a name opens into its text. */
.set-edit { padding: 2px 0 10px; }
.set-edit textarea, .cast textarea { display: block; width: 100%; padding: 6px 8px; border: 1px solid var(--ink3); border-radius: 0; background: transparent; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; resize: vertical; outline: none; }
.set-edit textarea:focus, .cast textarea:focus { border-color: var(--ink); }
.set-edit .actions, .cast .actions { display: flex; align-items: baseline; gap: 14px; margin-top: 8px; }
.chips-pick { display: flex; flex-wrap: wrap; gap: 4px 16px; padding-bottom: 8px; border-bottom: 1px dotted var(--rule); }
.chips-pick button { background: none; border: 0; padding: 1px 0; font-size: 13.5px; color: var(--ink2); border-bottom: 1px solid transparent; }
.chips-pick button.on { color: var(--ink); border-bottom-color: var(--ink); }
.chips-pick .mk { font-size: 11.5px; color: var(--ink3); }
.set-h { display: flex; align-items: baseline; gap: 12px; margin: 8px 0 4px; font-size: 13.5px; }
.set-h .nm { font-weight: 700; }

/* A broadcast: the words, the day, the clock. */
.cast { padding-bottom: 8px; }
.cast textarea { font-family: var(--serif); font-size: 14px; }
.cast-when { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.cast + .c-time { border-top: 1px dotted var(--rule); padding-top: 4px; }

/* The top of the board: what waits for the person's word, each with what to do; the rest behind one line. */
.todo { margin: 8px 0 10px; padding: 2px 0 4px 12px; border-left: 2px solid var(--ink); }
.todo-h { display: flex; align-items: baseline; gap: 12px; }
.todo-h .what { font-size: 15px; font-weight: 700; }
.todo-h .when { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--ink2); }
.todo-d { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.todo-do { margin: 2px 0 0; font-size: 12.5px; color: var(--ink2); }
.todo .act-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-top: 6px; font-size: 13.5px; }
.todo .act-links > .act-form, .todo .act-links > .cnote { flex-basis: 100%; }
.others { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 4px 12px; width: 100%; margin-top: 6px; padding: 7px 0; background: none; border: 0; border-top: 1px dotted var(--ink3); border-bottom: 1px dotted var(--ink3); text-align: left; }
.others:hover { background: var(--wash); }
.others .lv { font-family: var(--sc); font-size: 12.5px; letter-spacing: .1em; color: var(--ink2); }
.others .sum { font-size: 13px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.others .when { font-family: var(--sc); font-size: 12.5px; letter-spacing: .1em; color: var(--ink2); }
