/* ── Managing a loca, its extensions, its board, Care, a private
   conversation and the kinds of message in the feed, as the design boards
   draw them (ManageLoca, EditLoca, Extensions, DeleteLoca, Board,
   TasksList, Care, Direct, MessageKinds). Loaded after styles.css and the
   theme files. Theme tokens only, so Loca, Calm and Console each draw it in
   their own colours; plain selectors, no nesting (the desktop's WebKitGTK).
   Ids raise the weight where an older rule in styles.css would win. */

/* ── one button and field vocabulary for these pages ───────────────────── */
#adminbar button, #extCreate .btn, #extManage .btn, #locaDelete .btn, #taskView .btn,
#taskView .taskviewacts button, #boardPanel .tacts button, #dmBar .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--txt); font-weight: 500; font-size: 14px; font-family: inherit;
  white-space: nowrap; cursor: pointer; }
#adminbar button:hover, #extCreate .btn:hover, #extManage .btn:hover, #locaDelete .btn:hover, #taskView .btn:hover,
#taskView .taskviewacts button:hover, #boardPanel .tacts button:hover, #dmBar .btn:hover {
  border-color: var(--dim); color: var(--txt); }
#adminbar button:focus-visible, #extCreate .btn:focus-visible, #extManage .btn:focus-visible,
#locaDelete .btn:focus-visible, #taskView .btn:focus-visible, #taskView .taskviewacts button:focus-visible,
#boardPanel .tacts button:focus-visible, #dmBar .btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
#adminbar button:disabled, #extCreate .btn:disabled, #extManage .btn:disabled, #locaDelete .btn:disabled,
#taskView .btn:disabled { opacity: .5; cursor: default; }
#extCreate .btn.primary, #adminbar #applySettings,
#taskView .taskviewacts button[data-tact="go"], #taskView .taskviewacts button[data-tact="take"],
#taskView .taskviewacts button[data-tact="done"],
#boardPanel .tacts button[data-tact="go"], #boardPanel .tacts button[data-tact="take"],
#boardPanel .tacts button[data-tact="done"], #boardPanel #tkCreate {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
#extCreate .btn.primary:hover, #adminbar #applySettings:hover, #boardPanel #tkCreate:hover,
#taskView .taskviewacts button[data-tact="go"]:hover, #taskView .taskviewacts button[data-tact="take"]:hover,
#taskView .taskviewacts button[data-tact="done"]:hover, #boardPanel .tacts button[data-tact="go"]:hover,
#boardPanel .tacts button[data-tact="take"]:hover, #boardPanel .tacts button[data-tact="done"]:hover {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent); opacity: .9; }

#adminbar input, #adminbar select, #extCreate input:not([type=radio]):not([type=checkbox]), #extCreate select,
#extCreate textarea, #locaDelete input, #taskView input, #boardTools select,
#boardPanel #taskCreate input {
  box-sizing: border-box; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--txt); font-size: 15px; font-family: inherit; color-scheme: var(--scheme); }
#extCreate textarea { height: auto; min-height: 64px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
#adminbar input:focus, #adminbar select:focus, #extCreate input:focus, #extCreate select:focus,
#extCreate textarea:focus, #locaDelete input:focus, #taskView input:focus, #boardTools select:focus,
#boardPanel #taskCreate input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--line); }

/* ── Manage # loca: the properties sheet at the right edge ─────────────── */
#adminbar.on.open { display: block; }
#adminbar { position: fixed; z-index: 70; top: 0; right: 0; bottom: 0; left: auto;
  width: min(520px, 100vw); height: 100vh; height: 100dvh; max-height: none; box-sizing: border-box;
  padding: 0; border: 0; border-left: 1px solid var(--line); border-radius: 0;
  background: var(--panel); color: var(--txt); font-size: 14px; font-family: inherit; overflow-y: auto;
  box-shadow: -12px 0 30px color-mix(in srgb, var(--txt) 12%, transparent); }
#adminbar .adminhead { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: 20px 24px; border-bottom: 1px solid var(--line); background: var(--panel); }
#adminbar .admintitle { margin: 0; min-width: 0; font-weight: 600; font-size: 19px; font-family: inherit; color: var(--txt);
  overflow-wrap: anywhere; }
#adminbar .adminroom { font-family: var(--mono); font-weight: 600; }
#adminbar #adminClose { margin-left: auto; flex: 0 0 auto; width: 36px; height: 36px; padding: 0; border: 0;
  background: transparent; color: var(--muted); font-size: 22px; line-height: 1; }
#adminbar #adminClose:hover { background: var(--panel2); color: var(--txt); }
#adminbar .propertygroup { margin: 0; padding: 20px 24px 0; border: 0; border-radius: 0; background: transparent; }
#adminbar .propertygroup + .propertygroup { margin-top: 8px; border-top: 1px solid var(--line); }
#adminbar .propertygroup summary { display: block; position: relative; padding: 0 28px 0 0; list-style: none;
  color: var(--txt); font-weight: 600; font-size: 15px; font-family: inherit; letter-spacing: 0; cursor: pointer; }
#adminbar .propertygroup summary::-webkit-details-marker { display: none; }
#adminbar .propertygroup summary::after { content: "▾"; position: absolute; right: 4px; top: 0;
  color: var(--dim); font-size: 13px; transform: rotate(-90deg); transition: transform .15s ease; }
#adminbar .propertygroup[open] summary::after { transform: none; }
#adminbar .propertygroup summary small { display: block; margin: 2px 0 0; color: var(--dim);
  font-size: 13px; font-weight: 400; letter-spacing: 0; }
#adminbar .propertygroup[open] summary { color: var(--txt); border-bottom: 0; }
#adminbar .propertyfields { display: flex; flex-direction: column; gap: 18px; padding: 16px 0 4px; }
#adminbar .propertyfield { gap: 6px; padding: 0; border: 0; border-radius: 0; background: transparent; }
#adminbar .propertyfield .fieldlabel { color: var(--txt); font-size: 14px; font-weight: 500;
  letter-spacing: 0; text-transform: none; }
#adminbar .propertyfield .fieldhelp { color: var(--dim); font-size: 13px; line-height: 1.45; }
#adminbar .propertyfield .fieldcontrol { gap: 8px; }
#adminbar .fieldcontrol input, #adminbar .fieldcontrol select { height: 38px; font-size: 14px; }
#adminbar input.wide { flex: 1 1 200px; min-width: 0; }
#adminbar .locked { color: var(--dim); font-size: 13px; }
/* Ending this loca: last, in a red-tinted box. */
#adminbar .propertyfield.lifecycle { order: 99; gap: 10px; padding: 16px; border: 1px solid color-mix(in srgb, var(--bad) 32%, var(--line));
  border-radius: 12px; background: color-mix(in srgb, var(--bad) 6%, var(--panel)); }
#adminbar .propertyfield.lifecycle .fieldlabel { color: var(--bad); font-size: 15px; font-weight: 600; }
#adminbar .propertyfield.lifecycle .fieldcontrol button { min-width: 92px; height: 34px; font-size: 13px; }
#adminbar .propertyfield.lifecycle .fieldhelp { color: var(--muted); font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none; }
/* .lifecycle is also This Loca's open/closed pill (styles.css): not here. */
#adminbar .propertyfield.lifecycle { flex: 0 1 auto; color: var(--txt); font-size: 14px; letter-spacing: 0; text-transform: none; white-space: normal; }
#adminbar #deleteLocaBtn { background: var(--bad); border-color: var(--bad); color: var(--on-bad); font-weight: 600; }
#adminbar #deleteLocaBtn:hover { background: var(--bad); color: var(--on-bad); opacity: .9; }
#adminbar #sealLocaBtn { color: var(--txt); border-color: var(--line); background: var(--panel); }
#adminbar .propertyfooter { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center;
  justify-content: flex-end; gap: 10px; margin-top: 22px; padding: 14px 24px; border-top: 1px solid var(--line);
  background: var(--panel); }
#adminbar #adminNote { order: -1; margin-right: auto; color: var(--dim); font-size: 13px; }
#adminbar #applySettings { height: 38px; padding: 0 18px; }
/* Who can talk, Live and Pages: the board's first sections, always in
   view above the two groups. */
#adminbar .propertysection { display: block; min-width: 0; margin: 0; padding: 20px 24px 0; border: 0; }
#adminbar .propertysection + .propertygroup { margin-top: 12px; border-top: 1px solid var(--line); }
#adminbar .propertyhead { margin: 0 0 10px; padding: 0; color: var(--txt); font-size: 15px; font-weight: 600; font-family: inherit; }
#adminbar .modesection > legend { float: left; width: 100%; }
#adminbar .moderadios { clear: both; display: flex; flex-direction: column; gap: 10px; }
#adminbar .moderadio { display: flex; align-items: flex-start; gap: 10px; color: var(--txt); font-size: 14px; cursor: pointer; }
#adminbar .moderadio input { flex: 0 0 auto; width: 16px; height: 16px; margin: 2px 0 0; padding: 0; border: 0;
  accent-color: var(--accent); cursor: pointer; }
#adminbar .moderadio > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#adminbar .moderadio b { font-weight: 600; }
#adminbar .moderadio small { color: var(--muted); font-size: 13px; line-height: 1.4; }
#adminbar .modenames { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 0 26px; }
#adminbar .modenames .fieldlabel { color: var(--txt); font-size: 14px; font-weight: 500; }
#adminbar .modenames input { height: 38px; font-size: 14px; }
#adminbar .liverow { display: flex; align-items: center; gap: 12px; color: var(--txt); font-size: 14px; }
#adminbar .liverow b { font-weight: 600; }
#adminbar .liverowhint { color: var(--muted); }
/* A switch: a pill with its knob, on in the accent. */
#adminbar .propswitch, #extManage .extswitchtrack { position: relative; flex: 0 0 auto; box-sizing: border-box;
  width: 40px; height: 24px; padding: 0; border: 0; border-radius: 12px; background: var(--dim); cursor: pointer; }
#adminbar .propswitch::before, #extManage .extswitchtrack::before { content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--panel); transition: transform .15s ease; }
#adminbar .propswitch[aria-checked="true"], #extManage .extswitch[aria-checked="true"] .extswitchtrack { background: var(--accent); }
#adminbar .propswitch[aria-checked="true"]::before, #extManage .extswitch[aria-checked="true"] .extswitchtrack::before {
  transform: translateX(16px); background: var(--on-accent); }
#adminbar .propswitch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#adminbar .pagechips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#adminbar .pagechip { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 16px; background: var(--panel); color: var(--txt); font-size: 14px; font-weight: 400; }
#adminbar .pagechip:hover { border-color: var(--dim); }
#adminbar .pagesnone { color: var(--muted); font-size: 14px; }
#adminbar .pagesmanage { height: 30px; padding: 0 4px; border: 0; background: transparent; color: var(--txt);
  font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
#adminbar .pagesmanage:hover { color: var(--accent); }
#adminbar .propertysection > .fieldhelp { display: block; margin-top: 8px; color: var(--dim); font-size: 13px; }

/* ── the dialogs: open or edit a loca, extensions, delete, a task ───────── */
#extCreate .extbackdrop, #extManage .extbackdrop, #locaDelete .extbackdrop, #taskView .extbackdrop {
  background: color-mix(in srgb, var(--txt) 34%, transparent); }
#extCreate .extcard, #extManage .extcard, #locaDelete .extcard, #taskView .extcard {
  padding: 0 24px; border: 0; border-radius: 16px; background: var(--panel); color: var(--txt);
  font-size: 14px; font-family: inherit;
  box-shadow: 0 24px 60px color-mix(in srgb, var(--txt) 25%, transparent); }
#extCreate .extcard h2, #extManage .extcard h2, #taskView .extcard h2 {
  margin: 0 -24px; padding: 18px 24px; border-bottom: 1px solid var(--line);
  font-weight: 600; font-size: 19px; font-family: inherit; color: var(--txt); }
#extCreate .extcard h2 small, #extManage .extcard h2 small, #locaDelete .extcard h2 small {
  margin-left: 4px; color: var(--muted); font-weight: 600; font-family: var(--mono); font-size: .85em; }
#extCreate .extactions, #extManage .extactions, #taskView .extactions {
  position: sticky; bottom: 0; z-index: 1; margin: 20px -24px 0; padding: 14px 24px; gap: 10px;
  border-top: 1px solid var(--line); background: var(--panel); }
#extCreate .extactions .btn, #extManage .extactions .btn, #taskView .extactions .btn { height: 40px; padding: 0 16px; }
#extCreate .extnote, #extManage .extnote, #locaDelete .extnote, #taskView .extnote {
  color: var(--dim); font-size: 13px; line-height: 1.5; }
#extCreate .exterror, #extManage .exterror, #locaDelete .exterror { font-size: 14px; }
/* The × in a dialog's header: the same as Cancel / Close. */
#extCreate .extx, #extManage .extx { position: absolute; top: 12px; right: 14px; z-index: 2; display: grid; place-items: center;
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  font-size: 22px; line-height: 1; font-family: inherit; cursor: pointer; }
#extCreate .extx:hover, #extManage .extx:hover { background: var(--panel2); color: var(--txt); }
#extCreate .extx:focus-visible, #extManage .extx:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#extCreate #extCreateTitle, #extManage #extManageTitle { padding-right: 64px; }

/* Open a new loca / Edit its identity: two columns, as EditLoca. */
#extCreate .extcard { width: min(760px, 100%); }
#extCreateForm { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; align-content: start; }
#extCreateForm > * { grid-column: 1 / -1; margin-top: 0; margin-bottom: 0; }
#extCreateForm > h2 { order: 0; }
#extCreateForm > #locaPreset { order: 1; }
#extCreateForm #locaIdentityFields { display: contents; }
#extCreateForm #locaTitleField { order: 2; grid-column: auto; }
#extCreateForm > label[for="extCreateName"] { order: 3; grid-column: auto; }
#extCreateForm:has(#locaTitleField.hidden) > label[for="extCreateName"] { grid-column: 1 / -1; }
#extCreateForm label[for="locaDesc"] { order: 4; grid-column: 1 / -1; }
#extCreateForm #locaIconPick { order: 5; grid-column: auto; }
#extCreateForm #locaColorPick { order: 6; grid-column: auto; }
#extCreateForm > #extCreateGroupField { order: 7; grid-column: auto; margin-top: 0; }
#extCreateForm .identrow { order: 8; grid-column: auto; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
#extCreateForm:has(#extCreateGroupField.hidden) .identrow { grid-column: 1 / -1; grid-template-columns: 160px minmax(0, 1fr); }
#extCreateForm #locaLabelsNote { order: 9; grid-column: 1 / -1; margin-top: -10px; }
#extCreateForm > #extCreateExtensions { order: 10; }
#extCreateForm > #extCreateTabs { order: 11; }
#extCreateForm > #locaIdentityNote { order: 12; }
#extCreateForm > #extCreateError { order: 13; }
#extCreateForm > .extactions { order: 14; margin-top: 2px; }
#extCreate .extfield { gap: 6px; min-width: 0; }
#extCreate .extfield > span, #extCreate .identpick legend, #extCreate .extsectionhead {
  margin: 0; color: var(--txt); font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; }
#extCreate .identpick legend { margin-bottom: 8px; }
#extCreate .identnote, #extCreate .identcount, #extCreate .extgroupnote { margin: 0; color: var(--dim); font-size: 12px; line-height: 1.45; }
#extCreate .identcount { align-self: flex-end; }
#extCreate #extCreateName:disabled { background: var(--bg); color: var(--muted); font-family: var(--mono); opacity: 1; }
#extCreate .extfield input:disabled, #extCreate .extfield textarea:disabled { opacity: .75; }
#extCreate .identopts { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
#extCreate .identopt { display: flex; }
#extCreate .identswatch { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--muted); }
#extCreate .identopt input:checked + .identswatch { border: 2px solid var(--txt); box-shadow: none; color: var(--txt);
  background: color-mix(in srgb, var(--loca-c, var(--txt)) 14%, var(--panel)); }
#extCreate #locaColorOpts { display: flex; flex-wrap: wrap; gap: 8px; }
#extCreate #locaColorOpts .identswatch { width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: var(--loca-c, var(--panel)); }
#extCreate #locaColorOpts .identswatch.none { border: 1px dashed var(--line); background: var(--panel); color: var(--dim); }
#extCreate #locaColorOpts .identdot { display: none; }
#extCreate #locaColorOpts .identopt input:checked + .identswatch { border: 0;
  box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--txt); }
#extCreate #locaColorOpts .identopt input:checked + .identswatch.none { border: 1px dashed var(--line); }
#extCreate .presetopts { gap: 10px; }
#extCreate .presetopt, #extCreate .extrow { gap: 12px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--panel); }
#extCreate .presetopt:has(input:checked) { border: 1.5px solid var(--txt); }
#extCreate .extrow + .extrow { margin-top: 8px; }
#extCreate .extrowtext b { font-size: 15px; font-weight: 600; }
#extCreate .extrowtext small { color: var(--dim); font-size: 13px; line-height: 1.45; }
#extCreate .extrow input, #extCreate .presetopt input { width: 16px; height: 16px; accent-color: var(--accent); }
#extCreate .extsection { padding: 12px 14px; border-radius: 10px; background: var(--bg); }
#extCreate .extsectionhead { margin-bottom: 10px; }
#extCreate .extgrouplabel { margin: 0 0 6px; color: var(--dim); font-size: 12px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; }
#extCreate .exttabs { color: var(--muted); font-size: 14px; }
/* Edit loca: seven icons and "+N" for the rest (identity.js). */
#extCreate .identpick.collapsed .identopt.identmore { display: none; }
#extCreate #locaIconMore { display: none; }
#extCreate .identpick.collapsed #locaIconMore { display: flex; align-items: center; justify-content: center; height: 36px;
  padding: 0; border: 1px dashed var(--line); border-radius: 8px; background: var(--panel); color: var(--muted);
  font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer; }
#extCreate .identpick.collapsed #locaIconMore:hover { border-color: var(--dim); color: var(--txt); }
#extCreate #locaIconMore:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Edit loca › Pages: one line, and the way to the extensions. */
#extCreateForm > #locaIdentityPages { order: 11; }
#extCreate .identpages { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 12px 14px; border-radius: 10px; background: var(--bg); color: var(--muted); font-size: 14px; }
#extCreate .identpages b { color: var(--txt); font-weight: 600; }
#extCreate .identpages .extlink { color: var(--txt); font-size: 14px; font-weight: 500; font-family: inherit; text-decoration: underline;
  text-underline-offset: 3px; }
#extCreate .identpages .extlink:hover { color: var(--accent); }

/* Extensions of a loca: the note first, one row per extension. */
#extManage .extcard { display: flex; flex-direction: column; width: min(720px, 100%); }
#extManage .extcard > h2 { order: 0; }
#extManage #extManageNote { order: 1; margin: 14px 0 0; color: var(--dim); font-size: 14px; }
#extManage #extManageList { order: 2; display: flex; flex-direction: column; gap: 10px; margin: 14px 0 0; }
#extManage #boardOffAsk { order: 3; }
#extManage #extManageError { order: 4; }
#extManage .extcard > .extactions { order: 5; }
#extManage .extitem { gap: 14px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); }
#extManage .extitem + .extitem { margin-top: 0; }
#extManage .extitem.fixed { opacity: 1; background: var(--bg); }
#extManage .extrowtext b { font-size: 15px; font-weight: 600; }
#extManage .extrowtext small { color: var(--dim); font-size: 13px; line-height: 1.45; }
#extManage .extitem .btn { min-width: 92px; height: 34px; font-size: 13px; }
#extManage .extitem .btn.extadded { background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--txt); }
#extManage .extitem .btn.extadded:hover, #extManage .extitem .btn.extadded:focus-visible {
  background: color-mix(in srgb, var(--bad) 8%, var(--panel)); border-color: var(--bad); color: var(--bad); }
#extManage .extitem .btn.primary { background: var(--panel); border-color: var(--line); color: var(--txt); }
#extManage .extitem .btn svg { width: 14px; height: 14px; }
#extManage .extstate { font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--dim); }
#extManage .extstate.on { color: var(--txt); font-weight: 500; }
/* Each extension an On/Off switch: the add/remove button itself; its
   words are for screen readers, the switch says On or Off. */
#extManage .extswitch { position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px;
  min-width: 84px; height: 34px; padding: 0 2px; border: 0; background: transparent; color: var(--muted);
  font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
#extManage .extswitch::after { content: "Off"; min-width: 24px; text-align: left; }
#extManage .extswitch[aria-checked="true"] { color: var(--txt); }
#extManage .extswitch[aria-checked="true"]::after { content: "On"; }
#extManage .extswitch .extswitchword { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#extManage .extswitch:hover .extswitchtrack { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
#extManage .extswitch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
#extManage .extswitch:disabled { opacity: .5; cursor: default; }
#extManage #boardOffAsk:not(.hidden) { margin: 14px 0 0; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--warn) 32%, var(--line));
  border-radius: 10px; background: color-mix(in srgb, var(--warn) 8%, var(--panel)); color: var(--muted); }
#extManage #boardOffAsk .extnote { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
#extManage #boardOffAsk .extactions { position: static; margin: 10px 0 0; padding: 0; border: 0; background: transparent; }

/* Delete # loca? — one column of choices, the zip first. */
#locaDelete .extcard { display: flex; flex-direction: column; gap: 14px; width: min(560px, 100%); padding: 24px; }
#locaDelete .extcard h2 { margin: 0; padding: 0; border: 0; font-weight: 600; font-size: 20px; font-family: inherit; color: var(--txt); }
#locaDelete .extcard h2 small { margin-left: 0; color: var(--txt); font-size: 1em; }
#locaDelete .extcard > p.extnote:first-of-type { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
#locaDelete label.extnote { margin: 0 0 -8px; color: var(--txt); font-size: 14px; }
#locaDelete #locaDeleteName { height: 42px; margin: 0; font-family: var(--mono); }
#locaDelete #locaDeleteStatus { margin: 0; }
#locaDelete #locaDeleteStatus:empty { display: none; }
#locaDelete .extactions { flex-direction: column-reverse; align-items: stretch; gap: 10px; margin: 0; padding: 0; border: 0; }
#locaDelete .extactions .btn { width: 100%; height: 46px; border-radius: 10px; font-size: 15px; font-weight: 600; }
#locaDelete #locaDeleteArchive { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
#locaDelete #locaDeleteOnly { background: color-mix(in srgb, var(--bad) 7%, var(--panel));
  border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); color: var(--bad); }
#locaDelete #locaDeleteCancel { height: 40px; border: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; }
#locaDelete #locaDeleteCancel:hover { color: var(--txt); }
#locaDelete .locadeletefoot { margin: 0; color: var(--dim); font-size: 13px; text-align: center; }

/* One task (taskview.js): number, title, its facts, review history, acts. */
#taskView .extcard { width: min(560px, 100%); }
#taskView #taskViewTitle { font-size: 18px; }
#taskView #taskViewBody { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; }
#taskView .taskfacts { grid-template-columns: 110px minmax(0, 1fr); gap: 6px 10px; margin: 0; font-size: 14px; }
#taskView .taskfacts dt { color: var(--dim); }
#taskView .taskviewacts { gap: 8px; margin: 0; }
#taskView .taskreassign { gap: 8px; font-size: 14px; color: var(--muted); }
#taskView .taskreassign input { height: 36px; margin-left: 6px; }
#taskView .sectionlabel { margin: 4px 0 0; color: var(--txt); font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; }
#taskView .taskhistory, #boardPanel .taskhistory { list-style: decimal; margin: 0; padding-left: 18px; gap: 6px; color: var(--muted); font-size: 14px; }
#taskView .taskhistory li, #boardPanel .taskhistory li { border-left: 0; padding: 0; }
#taskView .taskhistory time { font-family: var(--mono); font-size: 12px; }
#taskView .taskhistorytext { color: var(--dim); }

/* ── the Loca Board: toolbar, four columns of cards, the list ──────────── */
#boardPanel:not(.hidden) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start;
  column-gap: 14px; padding: 20px 28px; }
#boardPanel > .sectionlabel { grid-column: 1 / -1; grid-row: 1; margin: 0 0 4px; color: var(--txt);
  font-size: 15px; font-weight: 600; letter-spacing: 0; text-transform: none; }
#boardPanel > .sectionhelp { grid-column: 1 / -1; grid-row: 2; margin: 0 0 14px; color: var(--dim); font-size: 13px; }
#boardPanel > #boardTools { grid-column: 1; grid-row: 3; }
#boardPanel > #taskCreate { grid-column: 2; grid-row: 3; align-self: start; margin: 0; }
#boardPanel > #taskCreate[open] { grid-column: 1 / -1; grid-row: 4; }
#boardPanel > #taskList { grid-column: 1 / -1; grid-row: 5; min-width: 0; }
#boardTools { gap: 10px 14px; margin: 0 0 16px; color: var(--dim); font-size: 13px; }
#boardTools label { gap: 8px; }
#boardTools select { height: 34px; padding: 0 8px; font-size: 13px; }
#boardTools .boardmine input { width: 16px; height: 16px; accent-color: var(--accent); }
#boardTools .boardviewswitch, #taskList .boardstages { border: 1px solid var(--line); border-radius: 8px; }
#boardTools .boardviewswitch button, #taskList .boardstages button { height: 34px; padding: 0 14px;
  background: var(--panel); color: var(--muted); font-weight: 500; font-size: 13px; font-family: inherit; }
#boardTools .boardviewswitch button.selected, #taskList .boardstages button.selected {
  background: var(--accent); color: var(--on-accent); }
#boardPanel #taskCreate summary { display: inline-flex; align-items: center; height: 36px; padding: 0 14px;
  border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 14px; font-family: inherit;
  list-style: none; cursor: pointer; white-space: nowrap; }
#boardPanel #taskCreate summary::-webkit-details-marker { display: none; }
#boardPanel #taskCreate summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#boardPanel #taskCreate[open] summary { background: var(--panel); color: var(--txt); border: 1px solid var(--line); }
#boardPanel #taskCreate .newnote { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 18px; padding: 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
#boardPanel #taskCreate .newnote input { flex: 1 1 220px; width: auto; margin: 0; }
#boardPanel #tkCreate { height: 40px; }

#taskList .taskboard { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: start; }
#taskList .taskboard.onestage { grid-template-columns: minmax(0, 1fr); }
#taskList .boardcol { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--panel2) 55%, var(--panel)); }
#taskList .boardhead { margin: 0; padding: 2px 4px; color: var(--dim); font-size: 13px; font-weight: 600;
  letter-spacing: 0; text-transform: none; }
#taskList .taskboard .task { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 8px; margin: 0;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
#taskList .boardcol[data-column="review"] .task { border: 1.5px solid var(--txt); }
#taskList .boardcol[data-column="done"] .task { opacity: .85; }
#taskList .task .tid { color: var(--dim); font: 12px var(--mono); }
#taskList .task .ttitle { color: var(--txt); font-size: 14px; font-weight: 500; line-height: 1.4; }
#taskList .task .ttitle .tmeta { margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 400; }
#taskList .taskboard .task .tchip { order: 2; align-self: flex-start; margin: 0; }
#taskList .taskboard .task .tacts { order: 3; justify-content: flex-start; gap: 6px; }
#taskList .taskboard .task .tacts:empty { display: none; }
#taskList .tchip, #taskView .tchip { padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; letter-spacing: 0; }
#taskList .tchip.review, #taskView .tchip.review { background: color-mix(in srgb, var(--gold) 12%, transparent); color: var(--gold); }
#boardPanel .tacts button { height: 30px; padding: 0 10px; margin: 0; font-size: 13px; }
/* The list: one bordered table of rows. */
#taskList .boardlist { gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
#taskList .boardlist .task { gap: 14px; margin: 0; padding: 10px 14px; border: 0; border-top: 1px solid var(--line);
  border-radius: 0; background: transparent; font-size: 14px; }
#taskList .boardlist .task:first-child { border-top: 0; }
#taskList .boardlist .task:hover { background: var(--bg); }
#taskList .boardlist .task .tid { flex: 0 0 40px; font-size: 13px; }
#taskList .boardlist .task .tacts { display: flex; gap: 6px; }
#taskList .boardlist > .sysline { padding: 14px; }
@media (max-width: 760px) {
  #boardPanel:not(.hidden) { padding: 16px; }
  #extCreateForm { grid-template-columns: minmax(0, 1fr); }
  #extCreateForm > *, #extCreateForm #locaTitleField, #extCreateForm > label[for="extCreateName"],
  #extCreateForm #locaIconPick, #extCreateForm #locaColorPick, #extCreateForm > #extCreateGroupField,
  #extCreateForm .identrow { grid-column: 1 / -1; }
}

/* ── Care: the Building's rank home, in the Care colour ────────────────── */
.main.carehome .top { background: color-mix(in srgb, var(--iye) 6%, var(--panel)); }
.main.carehome .top .rname { color: var(--iye); }
.main.carehome .ravatar, .main.dm .ravatar { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px;
  box-sizing: border-box; border-radius: 9px; font: 700 15px var(--mono); }
.main.carehome .ravatar { background: var(--iye-deep); border: 1.5px solid color-mix(in srgb, var(--iye) 40%, transparent); color: var(--iye); }
/* The caretaker's own lines wear its colour on the face and the name. */
#feed .row:has(.caretakertag) .face-agent { background: var(--iye-deep); border-color: color-mix(in srgb, var(--iye) 40%, transparent); color: var(--iye); }
#feed .row:has(.caretakertag) .sender.agent { color: var(--iye); }
#feed .caretakertag { padding: 0 6px; border-radius: 5px; background: transparent; font-size: 11px; font-weight: 500;
  letter-spacing: 0; text-transform: none; }
#feed .caretakertag::before { content: none; }

/* ── a private conversation: the other side's face, the privacy line under
   the composer ───────────────────────────────────────────────────────── */
.main.dm .top .rname::before { content: ""; }
.main.dm .ravatar { background: color-mix(in srgb, var(--human) 10%, var(--panel)); border: 1.5px solid color-mix(in srgb, var(--human) 38%, transparent);
  color: var(--human); border-radius: 50%; font-weight: 600; font-size: 13px; font-family: inherit; }
.main.dm[data-dm-peer="agent"] .ravatar { background: color-mix(in srgb, var(--agent) 12%, var(--panel));
  border-color: color-mix(in srgb, var(--agent) 38%, transparent); color: var(--agent); border-radius: 9px; font: 700 15px var(--mono); }
.main.dm #dmBar { order: 1; margin: -2px 28px 16px; padding: 0; border: 0; border-radius: 0; background: transparent;
  color: var(--dim); font-size: 12px; line-height: 1.5; }
.main.dm #dmBar b { color: var(--muted); }
.main.dm #dmBar .btn { height: 30px; padding: 0 10px; font-size: 12px; }
/* Under the name, what Care or a private conversation is; in the composer,
   where the words go (dm.js renderRoomNote). */
.top .roomnote { font-size: 13px; line-height: 18px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer .composerchip { flex: 0 0 auto; align-self: center; padding: 3px 8px; border-radius: 5px; white-space: nowrap;
  background: var(--panel2); color: var(--muted); font: 600 13px var(--mono); }
.main.carehome .composer .composerchip { background: var(--iye-deep); color: var(--iye); }
.main.dm .composer .composerchip { border-radius: 10px; font-family: inherit; font-weight: 500; font-size: 12px; }
:root:not([data-layout="classic"]) .composer .composerchip { order: 2; }

/* ── the kinds of message in the feed ─────────────────────────────────── */
/* Reactions: chips with the mark and its count; yours is highlighted. */
#feed .reactions { gap: 6px; margin-top: 8px; }
#feed .reactions:empty { margin-top: 0; }
#feed .reactionchip { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 15px; background: var(--panel); color: var(--muted);
  font-weight: 500; font-size: 13px; font-family: inherit; line-height: 1; }
#feed .reactionchip span { margin: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
#feed .reactionchip:hover { border-color: var(--dim); color: var(--txt); }
#feed .reactionchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#feed .reactionchip.mine { border: 1.5px solid var(--agent); background: color-mix(in srgb, var(--agent) 12%, var(--panel)); color: var(--agent); }
#feed .reactionpicker { gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--txt) 14%, transparent); }
#feed .reactionpicker button { width: 32px; height: 32px; font-size: 16px; }
#feed .reactionpicker button:hover, #feed .reactionpicker button:focus-visible { background: var(--panel2); outline: 0; }
/* The dashed "+" after the chips opens the same picker; under them, a quiet
   line names who reacted with each mark. */
#feed .reactadd { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 30px; padding: 0;
  border: 1px dashed color-mix(in srgb, var(--dim) 60%, var(--line)); border-radius: 15px; background: transparent;
  color: var(--muted); font-family: inherit; font-size: 15px; line-height: 1; cursor: pointer; }
#feed .reactadd:hover { border-style: solid; border-color: var(--dim); color: var(--txt); }
#feed .reactadd:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#feed .reactwho { flex: 1 0 100%; color: var(--muted); font-size: 12px; line-height: 1.4; }
/* A GitHub pull request, issue or commit the words link to: a compact card
   built from its address (chat.js fetches nothing). */
#feed .linkcards { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
#feed .linkcard { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; box-sizing: border-box;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--txt);
  font-size: 14px; line-height: 1.3; text-decoration: none; }
#feed .linkcard:hover { border-color: var(--dim); }
#feed .linkcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#feed .linkcard .lcicon { flex: 0 0 auto; color: var(--muted); }
#feed .linkcard[data-linkkind="pull"] .lcicon { color: var(--human); }
#feed .linkcard[data-linkkind="issue"] .lcicon { color: var(--iye); }
#feed .linkcard .lckind { flex: 0 0 auto; color: var(--muted); }
#feed .linkcard .lcrepo { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted);
  font: 13px var(--mono); }
#feed .linkcard b { flex: 0 0 auto; font-weight: 600; }
#feed .linkcard .lcsha { flex: 0 0 auto; font: 600 13px var(--mono); }
/* A quoted reply: the words it answers, above its own. */
#feed .quote { max-width: 560px; margin: 2px 0 6px; padding: 5px 10px; border-left: 3px solid var(--line);
  border-radius: 0 8px 8px 0; background: color-mix(in srgb, var(--panel2) 55%, transparent); color: var(--muted);
  font-size: 13px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#feed .quote:hover { border-left-color: var(--dim); color: var(--txt); }
/* System lines and the day between messages. */
#feed .sysline { align-self: center; max-width: min(90%, 640px); margin: 6px auto; padding: 4px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--panel2) 70%, transparent); color: var(--dim); font-size: 13px; line-height: 1.45; }
#feed .daychip { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; color: var(--dim); font-size: 12px; font-weight: 500; }
#feed .daychip::before, #feed .daychip::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
/* An announcement: the gold mark of the Building, said once above it. */
#feed .row.announce { border-radius: 10px; background: color-mix(in srgb, var(--gold) 7%, transparent);
  box-shadow: inset 3px 0 0 var(--gold); }
#feed .row.announce .bubble::before { content: "Announcement"; display: block; margin-bottom: 2px; color: var(--gold);
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
/* A reminder: the warn tint chatsurface.css gives it, with its edge. */
#feed .row.locareminder { box-shadow: inset 3px 0 0 var(--warn); }
/* Attachments: image tiles and file cards. */
#feed .attachments { gap: 10px; margin-top: 8px; }
#feed .attachimg { width: 200px; height: 130px; max-width: 100%; object-fit: cover; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); }
#feed .attachchip { display: inline-grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 10px; row-gap: 0;
  align-items: center; align-self: flex-end; max-width: min(100%, 360px); min-height: 52px; box-sizing: border-box;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  color: var(--txt); font-size: 14px; font-family: inherit; text-align: left; }
#feed .attachchip:hover { border-color: var(--dim); }
#feed .attachchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#feed .attachchip .aglyph { grid-column: 1; grid-row: 1 / 3; display: grid; place-items: center; width: 30px; height: 36px;
  border-radius: 4px; background: var(--panel2); color: var(--muted); font-weight: 600; font-size: 9px; font-family: inherit; letter-spacing: .02em; }
#feed .attachchip[data-ext="pdf"] .aglyph { background: var(--bad); color: var(--on-bad); }
#feed .attachchip .aname { grid-column: 2; grid-row: 1; font-weight: 600; line-height: 1.3; }
#feed .attachchip .asize { grid-column: 2; grid-row: 2; color: var(--dim); font-size: 12px; }
#feed .attachchip > span:last-child { grid-column: 3; grid-row: 1 / 3; color: var(--dim); font-size: 12px; }
#feed .attachchip:hover > span:last-child { color: var(--txt); }
/* Tables and code in a message. */
#feed .markdown .tablewrap { max-width: 620px; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
#feed .markdown table { font-size: 14px; }
#feed .markdown th, #feed .markdown td { padding: 8px 12px; border-right: 0; border-bottom: 0; border-top: 1px solid var(--line); white-space: normal; }
#feed .markdown thead th { border-top: 0; background: var(--panel2); color: var(--txt); font-weight: 600; }
#feed .markdown pre.code { max-width: 620px; margin: 8px 0; padding: 12px 14px; border: 0; border-radius: 10px;
  background: var(--panel2); color: var(--txt); font: 13px/1.6 var(--mono); }
:root[data-scheme="light"] #feed .markdown pre.code { background: var(--txt); color: var(--bg); }

/* On a dark theme a shade is the ground's own colour, deeper: the text
   colour would light it up instead. */
:root[data-scheme="dark"] #extCreate .extbackdrop, :root[data-scheme="dark"] #extManage .extbackdrop,
:root[data-scheme="dark"] #locaDelete .extbackdrop, :root[data-scheme="dark"] #taskView .extbackdrop {
  background: color-mix(in srgb, var(--bg) 78%, transparent); }
:root[data-scheme="dark"] #extCreate .extcard, :root[data-scheme="dark"] #extManage .extcard,
:root[data-scheme="dark"] #locaDelete .extcard, :root[data-scheme="dark"] #taskView .extcard {
  border: 1px solid var(--line); box-shadow: 0 24px 60px color-mix(in srgb, var(--bg) 80%, transparent); }
:root[data-scheme="dark"] #adminbar { box-shadow: -12px 0 30px color-mix(in srgb, var(--bg) 70%, transparent); }
:root[data-scheme="dark"] #feed .reactionpicker { box-shadow: 0 6px 18px color-mix(in srgb, var(--bg) 70%, transparent); }

/* On a phone the sheet rises from the bottom and leaves the header (and
   its menu button) reachable. */
@media (max-width: 760px) {
  #adminbar { top: auto; height: auto; max-height: 72vh; max-height: 72dvh; width: 100vw;
    border-left: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; }
}
