/* Portable management theme. Apple-inspired spacing and neutral settings rows;
   project identity stays in semantic tokens, the host adapter and local Outfit fonts. */
.mg-workspace, .mg-modal {
  --mg-accent: var(--primary);
  --mg-canvas: var(--canvas);
  --mg-surface: var(--raised);
  --mg-text: var(--ink);
  --mg-muted: var(--ink2);
  --mg-border: var(--line);
  --mg-card-radius: var(--r-card, 18px);
  --mg-input-radius: var(--r-control, 11px);
  font-family: var(--font);
  color: var(--mg-text);
  letter-spacing: 0;
}
.mg-workspace { padding-bottom:48px; }
.mg-source { display:block; padding:0; margin:0 0 16px; border:0; border-radius:0; font-size:11px; color:var(--mg-muted); }
.mg-source > summary { display:flex; align-items:center; gap:7px; width:fit-content; cursor:pointer; list-style:none; min-height:32px; }
.mg-source > summary::-webkit-details-marker { display:none; }
.mg-source > div { display:flex; flex-wrap:wrap; gap:12px; padding:6px 0 12px; }
.mg-summary { display:flex; flex-wrap:wrap; gap:8px 24px; margin:0 0 24px; padding:0 0 20px; border-bottom:1px solid var(--mg-border); }
.mg-summary .mg-stat { display:inline-flex; align-items:baseline; gap:7px; padding:0; border:0; background:transparent; border-radius:0; }
.mg-summary .mg-stat strong { display:inline; font-size:16px; line-height:1.4; font-weight:600; margin:0; }
.mg-summary .mg-stat span { font-size:12px; color:var(--mg-muted); }
.mg-toolbar { gap:12px; margin-bottom:28px; }
.mg-toolbar .search-input { max-width:360px; min-height:44px; border-radius:100px; background:var(--mg-surface); border-color:var(--mg-border); }
.mg-toolbar .mg-actions { margin-left:auto; }
.mg-explorer { grid-template-columns:minmax(240px, 300px) minmax(0,1fr); gap:36px; }
.mg-index { padding:0; background:transparent; border-radius:0; max-height:74vh; }
.mg-index-item { padding:17px 14px; border-radius:11px; margin:0 0 3px; }
.mg-index-item[aria-current="true"] { box-shadow:none; background:var(--sel-soft); }
.mg-index-item strong { font-size:14px; font-weight:600; line-height:1.45; margin:0 0 5px; }
.mg-index-item small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; line-height:1.5; margin-bottom:8px; }
.mg-index-item .mg-pill { padding:0; background:transparent; border-radius:0; font-size:11px; }
.mg-detail > .mg-heading { margin-bottom:12px; }
.mg-heading h2 { font-size:24px; line-height:1.25; font-weight:600; letter-spacing:-.02em; }
.mg-heading h3 { font-size:16px; font-weight:600; }
.mg-meta { margin:6px 0 24px; font-size:12px; }
.mg-kicker { color:var(--mg-muted); font-family:inherit; font-size:11px; margin-top:5px; }
.mg-card { background:transparent; border-radius:0; border-bottom:1px solid var(--mg-border); padding:24px 0; margin:0; }
.mg-card > .mg-heading { margin-bottom:14px; }
.mg-card h3 { font-size:15px; }
.mg-bullets { font-size:14px; line-height:1.6; }
.mg-muted { font-size:12px; line-height:1.6; }
.mg-kv { font-size:13px; line-height:1.6; gap:10px 20px; }
.mg-section, .mg-disclosure { border:0; border-bottom:1px solid var(--mg-border); border-radius:0; background:transparent; margin:0; overflow:visible; }
.mg-section > summary, .mg-disclosure > summary { padding:19px 0; font-size:14px; font-weight:400; line-height:1.5; min-height:56px; cursor:pointer; }
.mg-section > summary { font-size:15px; font-weight:600; }
.mg-disclosure[open] > summary { border-bottom:0; }
.mg-section-body, .mg-disclosure > .mg-disclosure-body { padding:0 0 24px; }
.mg-disclosure .mg-disclosure { background:transparent; }
.mg-section-body > .mg-actions { margin-top:16px; }
.mg-tabs { gap:4px; margin:24px 0 8px; padding-bottom:12px; }
.mg-tab { font-size:13px; padding:9px 14px; min-height:40px; }
.mg-pill { font-size:11px; font-weight:400; background:var(--surface); padding:4px 8px; }
.mg-pill.pass { background:color-mix(in srgb,var(--pass-ink) 9%,transparent); color:var(--pass-ink); }
.mg-pill.fail { background:color-mix(in srgb,var(--fail-ink) 9%,transparent); color:var(--fail-ink); }
.mg-pill.warn { background:color-mix(in srgb,var(--skip-ink) 9%,transparent); color:var(--skip-ink); }
.mg-pill.active { background:var(--sel-soft); color:var(--primary-ink); }
.mg-board { gap:20px; grid-template-columns:repeat(4,minmax(200px,1fr)); }
.mg-column { background:var(--surface); padding:16px 12px; border-radius:var(--mg-card-radius); }
.mg-column-title { padding:0 4px 18px; font-size:12px; font-weight:600; }
.mg-ticket { border:0; background:var(--mg-surface); padding:16px; border-radius:11px; }
.mg-ticket h3 { font-size:14px; line-height:1.5; font-weight:600; margin:0 0 8px; }
.mg-ticket .mg-muted { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* Fields shown only for one choice (e.g. the original bug of a duplicate): .form-group's flex must not undo [hidden]. */
#mg-editor [hidden] { display:none; }
/* Implementations grouped by release, and inside a release by its parts. */
.mg-groups { display:grid; gap:16px; }
.mg-group { background:var(--surface); border-radius:var(--mg-card-radius); padding:4px 16px 16px; }
.mg-group > summary { display:flex; align-items:baseline; justify-content:space-between; gap:12px; padding:14px 0 12px; cursor:pointer; list-style:none; }
.mg-group > summary::-webkit-details-marker { display:none; }
.mg-group-title { font-size:15px; font-weight:600; }
.mg-group > summary .mg-muted { font-size:12px; white-space:nowrap; }
.mg-group-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:10px; }
.mg-group-list .mg-ticket { margin:0; }
.mg-group-list .mg-ticket .mg-meta { margin-bottom:6px; }
@media(max-width:640px) { .mg-group { padding:2px 12px 12px; } .mg-group-list { grid-template-columns:1fr; } }
.mg-notice { border:0; border-radius:11px; background:var(--surface); padding:14px 16px; font-size:12px; }
.mg-notice.error { color:var(--fail-ink); }
.mg-link { text-decoration:none; color:var(--primary-ink); }
.mg-link:hover { text-decoration:underline; }
.mg-workspace .btn, .mg-modal .btn { box-shadow:none; font-weight:400; min-height:40px; }
.mg-workspace .btn:active, .mg-modal .btn:active { transform:scale(.97); }
.mg-workspace :focus-visible, .mg-modal :focus-visible { outline:2px solid var(--mg-accent); outline-offset:3px; }
.mg-form { gap:20px; }
.mg-form input, .mg-form select, .mg-form textarea { border:1px solid var(--mg-border); border-radius:var(--mg-input-radius); background-color:var(--mg-surface); color:var(--mg-text); padding:12px 14px; font-size:15px; }
.mg-form input:not([type="checkbox"]), .mg-form select { height:auto; min-height:46px; }
.mg-form textarea { min-height:90px; }
/* Keep the shared chevron so a choice never looks like a text field. */
.mg-form select { padding-right:40px; background-position:right 14px center; text-overflow:ellipsis; }
.mg-form .form-group > label { font-weight:400; font-size:13px; margin-bottom:8px; }
.mg-form small { font-size:11px; line-height:1.5; }
.mg-file-picker { display:flex; align-items:center; flex-wrap:wrap; gap:10px 14px; }
.mg-file-choice { position:relative; display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:10px 16px; border:1px solid var(--mg-border); border-radius:var(--mg-input-radius); background:var(--mg-surface); font-size:13px; cursor:pointer; }
.mg-file-choice:focus-within { outline:2px solid var(--mg-accent); outline-offset:3px; }
.mg-form .mg-file-choice input { position:absolute; inset:0; width:100%; height:100%; opacity:0; padding:0; min-height:0; cursor:pointer; }
.mg-file-picker > small { min-width:0; overflow-wrap:anywhere; color:var(--mg-muted); }
.mg-form-advanced { grid-column:1/-1; border-top:1px solid var(--mg-border); }
.mg-form-advanced > summary { padding:18px 0; color:var(--primary-ink); cursor:pointer; font-size:13px; min-height:48px; }
.mg-form-advanced > .mg-form { padding:8px 0 16px; }
.mg-form-actions { padding-top:20px; }
.mg-person { position:relative; }
.mg-person-control { position:relative; }
.mg-person-control > input { width:100%; padding-right:42px; }
.mg-person-clear { position:absolute; right:4px; top:3px; width:40px; height:40px; display:flex; align-items:center; justify-content:center; border:0; background:transparent; color:var(--mg-muted); border-radius:8px; cursor:pointer; }
.mg-person-options { position:absolute; left:0; right:0; top:49px; z-index:25; max-height:240px; overflow:auto; border:1px solid var(--mg-border); border-radius:11px; background:var(--mg-surface); padding:4px; }
.mg-person-options > button { width:100%; padding:11px 10px; display:block; text-align:left; border:0; border-radius:7px; background:transparent; color:var(--mg-text); font:inherit; font-size:14px; cursor:pointer; min-height:44px; }
.mg-person-options > button[aria-selected="true"], .mg-person-options > button:hover { background:var(--sel-soft); }
.mg-person-options small { margin-top:2px; font-size:11px; overflow-wrap:anywhere; }
.mg-person-clear[hidden], .mg-person-options[hidden] { display:none; }
.mg-person [data-mg-person-search]::-webkit-search-cancel-button { display:none; }
#detail-modal:has(.mg-modal) .modal-content { border-radius:18px; box-shadow:none; }
.mg-modal .mg-section-label { white-space:pre-line; line-height:1.6; }
@media(max-width:1100px) { .mg-explorer { grid-template-columns:230px minmax(0,1fr); gap:24px; } }
@media(max-width:960px) { .mg-explorer { grid-template-columns:1fr; gap:28px; } .mg-index { max-height:280px; border-bottom:1px solid var(--mg-border); } }
@media(max-width:640px) {
  .mg-summary { gap:8px 18px; padding-bottom:18px; margin-bottom:20px; }
  .mg-summary .mg-stat strong { font-size:14px; }
  .mg-summary .mg-stat span { font-size:11px; }
  .mg-heading h2 { font-size:22px; }
  .mg-toolbar > .mg-actions { width:auto; margin-left:0; }
  .mg-toolbar .mg-actions { flex-wrap:wrap; }
  .mg-form { grid-template-columns:1fr; gap:18px; }
  .mg-form input, .mg-form select, .mg-form textarea { font-size:16px; }
  .mg-workspace .btn, .mg-modal .btn, .mg-tab { min-height:44px; }
  .mg-card { padding:20px 0; }
  #detail-modal:has(.mg-modal) { align-items:flex-end; }
  #detail-modal:has(.mg-modal) .modal-content { border-radius:18px 18px 0 0; height:auto; max-height:calc(100dvh - 24px); min-height:0; }
  #detail-modal:has(.mg-modal) .sheet-header::before { content:''; width:36px; height:4px; border-radius:100px; background:var(--line-strong); position:absolute; top:8px; left:calc(50% - 18px); }
  #detail-modal:has(.mg-modal) .sheet-header { position:relative; padding-top:24px; }
}
/* Shared admin language preference; uses the existing form and typography tokens. */
.admin-language-control { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.admin-language-control label { font-size:12px; font-weight:600; color:var(--muted); }
.admin-language-control select { min-width:0; min-height:44px; flex:1; padding:8px 12px; border:1px solid var(--line); border-radius:var(--r-control); color:var(--ink); background:var(--surface); font:inherit; }
.sidebar-footer .admin-language-control { margin-bottom:12px; padding:0 4px; }
.topbar-language { display:none; }
.theme-opt { min-width:0; padding:0 4px; gap:4px; font-size:12px; }
@media (min-width:640px) and (max-width:1023px) {
  .sidebar .admin-language-control { display:none; }
  .topbar-language { display:flex; margin-bottom:0; }
  .topbar-language select { min-width:120px; }
  .theme-switch { flex:none; }
  .theme-opt { flex:0 0 32px; }
}
.mg-content-notice { margin:0 0 18px; color:var(--mg-muted); font-size:12px; line-height:1.5; }
/* Readable release/bug details: key facts first, chips for where, a release progress line. */
.mg-index-meta { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.mg-chip { display:inline-flex; align-items:center; min-height:22px; padding:2px 8px; border-radius:100px; background:var(--surface); color:var(--mg-muted); font-size:11px; line-height:1.4; white-space:nowrap; }
.mg-chip.fail { background:color-mix(in srgb,var(--fail-ink) 9%,transparent); color:var(--fail-ink); }
.mg-meta { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; }
.mg-facts { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:16px 24px; margin:0 0 8px; padding:4px 0 20px; border-bottom:1px solid var(--mg-border); }
.mg-facts > div { min-width:0; }
.mg-facts dt { font-size:11px; color:var(--mg-muted); margin:0 0 4px; }
.mg-facts dd { margin:0; font-size:14px; line-height:1.45; overflow-wrap:anywhere; white-space:pre-line; }
.mg-card .mg-facts { border-bottom:0; padding-bottom:4px; }
.mg-compare .mg-facts { grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); padding-top:12px; }
.mg-description p { margin:0 0 10px; font-size:15px; line-height:1.6; overflow-wrap:anywhere; white-space:pre-line; }
.mg-subhead { font-size:13px; font-weight:600; margin:18px 0 6px; }
.mg-steps { display:flex; flex-wrap:wrap; gap:6px; list-style:none; padding:0; margin:0 0 8px; counter-reset:step; }
.mg-steps li { display:flex; align-items:center; gap:6px; padding:6px 12px 6px 8px; border-radius:100px; background:var(--surface); color:var(--mg-muted); font-size:12px; counter-increment:step; }
.mg-steps li::before { content:counter(step); display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border-radius:50%; background:var(--mg-border); color:var(--mg-text); font-size:10px; }
.mg-steps li.done { color:var(--pass-ink); }
.mg-steps li.done::before { content:'✓'; background:color-mix(in srgb,var(--pass-ink) 16%,transparent); color:var(--pass-ink); }
.mg-steps li.current { background:var(--sel-soft); color:var(--primary-ink); font-weight:600; }
.mg-steps li.current::before { background:var(--mg-accent); color:#fff; }
.mg-build { padding:16px 0; border-bottom:1px solid var(--mg-border); }
.mg-build-head { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:4px 12px; font-size:14px; }
.mg-build .mg-meta { margin:8px 0 4px; }
.mg-version { display:grid; gap:8px; }
.mg-version-other[hidden] { display:none; }
.mg-checks { border:1px solid var(--mg-border); border-radius:var(--mg-input-radius); background:var(--mg-surface); padding:6px; }
.mg-form .mg-checks-filter { width:100%; min-height:40px; margin:0 0 6px; padding:8px 12px; font-size:14px; }
.mg-checks-list { max-height:232px; overflow:auto; }
.mg-check { display:flex; align-items:flex-start; gap:10px; padding:9px 8px; border-radius:7px; font-size:14px; line-height:1.4; cursor:pointer; }
.mg-check:hover { background:var(--sel-soft); }
.mg-check[hidden] { display:none; }
.mg-form .mg-check input { width:18px; height:18px; min-height:0; margin:1px 0 0; padding:0; flex:none; accent-color:var(--mg-accent); }
.mg-check span { min-width:0; overflow-wrap:anywhere; }
/* Phone: stacked list → detail, two facts per row, full-width search. */
.mg-to-list { display:none; }
@media(max-width:960px) {
  .mg-detail { scroll-margin-top:12px; }
  .mg-to-list { display:inline-flex; align-items:center; gap:6px; min-height:44px; padding:0; margin:0 0 8px; border:0; background:transparent; color:var(--primary-ink); font:inherit; font-size:13px; cursor:pointer; }
}
@media(max-width:640px) {
  .mg-toolbar .search-input { flex:1 1 100%; max-width:none; }
  .mg-toolbar .mg-filter { display:flex; align-items:center; gap:8px; flex:1 1 calc(50% - 6px); min-width:0; }
  .mg-toolbar .mg-filter select { flex:1; min-width:0; width:100%; }
  .mg-toolbar > .mg-actions { width:100%; margin-left:0; }
  .mg-toolbar > .mg-actions .btn { flex:1; justify-content:center; }
  .mg-facts { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 16px; }
  .mg-heading h2 { overflow-wrap:anywhere; }
  .mg-steps li { padding:5px 10px 5px 6px; font-size:11px; }
  .mg-build-head { flex-direction:column; }
  .mg-checks-list { max-height:200px; }
  .mg-check { min-height:44px; align-items:center; }
}
/* Attachments: a growing list with remove buttons; a drop target while dragging files over it. */
.mg-file-picker.dragging { outline:2px dashed var(--mg-accent); outline-offset:6px; border-radius:var(--mg-input-radius); }
.mg-file-picker > small:has(.mg-file-list) { flex-basis:100%; }
.mg-file-list { list-style:none; margin:0; padding:0; display:grid; gap:6px; }
.mg-file-list li { display:flex; align-items:center; gap:10px; min-height:40px; padding:6px 6px 6px 12px; border:1px solid var(--mg-border); border-radius:var(--mg-input-radius); background:var(--mg-surface); font-size:13px; color:var(--mg-text); }
.mg-file-list li span { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mg-file-list li small { color:var(--mg-muted); font-size:11px; white-space:nowrap; }
.mg-file-remove { width:36px; height:36px; flex:none; border:0; border-radius:8px; background:transparent; color:var(--mg-muted); font-size:20px; line-height:1; cursor:pointer; }
.mg-file-remove:hover { background:var(--sel-soft); color:var(--fail-ink); }
@media(max-width:640px) { .mg-file-remove { width:44px; height:44px; } }
/* Attachment cards: picture or kind icon, name and size. */
.mg-attachments { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; margin:12px 0 4px; }
.mg-attachment { display:grid; grid-template-rows:96px auto auto; gap:4px; padding:8px; border:1px solid var(--mg-border); border-radius:12px; background:var(--mg-surface); color:var(--mg-text); font:inherit; text-align:left; cursor:pointer; min-width:0; }
.mg-attachment:hover { border-color:var(--mg-accent); }
.mg-attachment-thumb { display:flex; align-items:center; justify-content:center; border-radius:8px; background:var(--surface); color:var(--mg-muted); overflow:hidden; }
.mg-attachment-thumb img { width:100%; height:100%; object-fit:cover; }
.mg-attachment-name { font-size:12px; line-height:1.35; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mg-attachment small { font-size:11px; color:var(--mg-muted); }
@media(max-width:640px) { .mg-attachments { grid-template-columns:repeat(2,minmax(0,1fr)); } }
