/* Create (+) menu and search box in the topbar — tokens and menu styling come from style.css */
.create-menu { position: relative; display: inline-flex; }
.create-btn { width: 36px; height: 36px; border-radius: var(--radius-sm); border: 0; background: var(--accent); color: #fff; font-size: 1.3rem; line-height: 1; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); box-shadow: var(--shadow-1); }
.create-btn:hover { background: var(--accent-600); }
.create-btn:active { transform: scale(.96); }
.create-menu.open .create-btn { background: var(--accent-600); }
/* on the charcoal bar the button takes the lighter bronze of the logo, with a charcoal plus */
.topbar .create-btn { background: #c48f58; color: #222426; }
.topbar .create-btn:hover, .topbar .create-menu.open .create-btn { background: #d3a06b; }
.create-menu .menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; }
.create-menu.open .menu { display: block; }
.create-menu .menu a, .create-menu .menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font: inherit; font-size: 14px; background: none; border: 0; cursor: pointer; }
.create-menu .menu a:hover, .create-menu .menu button:hover { background: var(--surface-3); }
.create-menu .menu button { border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-sm) var(--radius-sm); margin-top: 4px; padding-top: 10px; color: var(--muted); font-size: var(--fs-sm); }
.create-menu .menu button[disabled] { color: var(--green-fg); cursor: default; background: none; }
.topbar-search { position: relative; display: inline-flex; align-items: center; }
.topbar-search .icon { position: absolute; left: 10px; color: rgba(255, 255, 255, .7); pointer-events: none; }
.topbar-search input { width: 220px; height: 34px; padding: 0 12px 0 32px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .1); color: #fff; font: inherit; font-size: 14px; transition: background var(--t-fast) var(--ease), width var(--t) var(--ease), border-color var(--t-fast); }
.topbar-search input::placeholder { color: rgba(255, 255, 255, .65); }
.topbar-search input::-webkit-search-cancel-button { filter: invert(1); }
.topbar-search input:focus { outline: none; box-shadow: var(--focus); background: #fff; color: var(--text); border-color: #fff; width: 280px; }
.topbar-search input:focus::placeholder { color: var(--text-faint); }
.topbar-search input:focus + .icon, .topbar-search:focus-within .icon { color: var(--muted); }
.sidebar .mobile-search { margin: 4px 0 8px; }
.sidebar .mobile-search input { height: 44px; font-size: 16px; border-radius: var(--radius-sm); }  /* 16px: iPhones zoom into smaller text */

/* dashboards */
.shortcuts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--s-4); }
.queue li .kind { display: inline-block; min-width: 3.6rem; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.stat.warn .value { color: var(--red); }
.customise ol { list-style: none; padding: 0; margin: 0 0 var(--s-3); }
.customise ol li { display: flex; gap: var(--s-2); align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.customise ol li:last-child { border-bottom: 0; }
.customise ol li .grow { flex: 1; }
.customise ol li label { margin: 0; color: inherit; font-weight: 500; }
.customise form.row { align-items: flex-end; }
.customise .row > .field { margin-bottom: 0; }
.customise .btn.sm { padding: 0 8px; height: 26px; }
.customise .status { font-size: var(--fs-sm); color: var(--green-fg); margin-left: var(--s-2); }

/* access matrix / preview */
.matrix td.level, .matrix th.level { text-align: center; width: 90px; }
.matrix td.level .lvl { white-space: nowrap; }
.lvl.mixed { background: var(--amber-bg); color: var(--amber-fg); }  /* a section whose pages are at different levels */
.matrix label.radio { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; color: var(--text); font-size: var(--fs-sm); margin: 0 6px; }
.matrix label.radio input { width: auto; margin: 0; }
.diff li { font-size: 14px; padding: 3px 0; }
.diff .was { text-decoration: line-through; color: var(--muted); }
.access-tabs { margin-bottom: var(--s-4); }
.preview-box h2 { margin-bottom: 4px; }

/* .seg: a row of radio buttons drawn as one segmented switch (No access | Can see | Can edit).
   <span class="seg" role="radiogroup"><label><input type="radio" name="x" value="view"><span class="view">Can see</span></label>…</span>
   The input covers its segment, so the whole segment is the 40px touch target and the keyboard still reaches it.
   The chosen segment takes the colour of the matching .lvl chip (none grey, view blue, edit green, inherit charcoal). */
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.seg label { position: relative; margin: 0; cursor: pointer; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg label > span { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 4px 12px; font-size: var(--fs-sm); font-weight: 600; line-height: 1.2; text-align: center; color: var(--text-2); border-left: 1px solid var(--line-strong); transition: background var(--t-fast) var(--ease); }
.seg label:first-child > span { border-left: 0; }
.seg label:hover > span { background: var(--surface-3); }
.seg input:checked + span { background: var(--surface-3); color: var(--text); box-shadow: inset 0 -3px 0 var(--muted); }
.seg input:checked + span.view { background: var(--blue-bg); color: var(--blue-fg); box-shadow: inset 0 -3px 0 var(--blue); }
.seg input:checked + span.edit { background: var(--green-bg); color: var(--green-fg); box-shadow: inset 0 -3px 0 var(--green); }
.seg input:checked + span.inherit { background: var(--brand-50); color: var(--brand); box-shadow: inset 0 -3px 0 var(--brand); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
/* a switch that cannot be pressed (the section switch of the module picker until access.js enables it) */
.seg input:disabled { cursor: not-allowed; }
.seg input:disabled + span, .seg label:hover > input:disabled + span { color: var(--text-faint); background: var(--surface-2); box-shadow: none; }

/* Module picker (templates/access/_module_picker.html): one .perm-cat per section of the left menu. The head holds
   the section's name, its state badge and the switch for all of its pages; details.perm-cat-pages holds one row
   per page. On phones the switch drops under the name and takes the full width; nothing scrolls sideways. */
.perm-cat { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s-3); margin-bottom: var(--s-2); background: var(--surface); }
.perm-cat-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3); flex-wrap: wrap; }
.perm-cat-name { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; min-width: 0; }
.perm-cat-pages { margin-top: var(--s-2); }
.perm-cat-pages > summary { padding: 6px 0; }
.perm-list { list-style: none; margin: var(--s-1) 0 0; padding: 0; }
.perm-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3); flex-wrap: wrap; padding: var(--s-2) 0; border-top: 1px solid var(--line); font-size: 14px; }
.perm-name { min-width: 0; flex: 1 1 160px; }
.perm-more > summary { padding: 6px 0; }
.perm-plain { margin: 0 0 var(--s-2); }
.perm-plain[hidden] { display: none; }
.perm-cap { display: block; }

/* Access summary (templates/access/_summary.html): three lists, Can edit / Can see only / No access, side by side
   on a wide screen and stacked on a phone. Each is a plain list of the menu's sections. */
.access-lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
.access-list { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s-3); background: var(--surface); min-width: 0; }
.access-list.none { background: var(--surface-2); }
.access-list-head { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; margin-bottom: var(--s-2); }
.access-list ul, .plain-list { list-style: none; margin: 0; padding: 0; }
.access-list li { padding: 3px 0; font-size: 14px; overflow-wrap: anywhere; }
.plain-list li { padding: 2px 0; }
.banner .plain-list { margin-top: 4px; font-weight: 500; }
.affected .diff { list-style: none; margin: 4px 0 0; padding: 0; }
.confirm-actions { margin-top: var(--s-4); }
@media (max-width: 900px) { .access-lists { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .perm-cat-head .seg, .perm-list .seg { display: grid; width: 100%; }
  .seg label > span { padding: 4px 6px; }
}

/* The Projects control (templates/access/_project_picker.html): which projects a person is on. A <fieldset> built
   from kit pieces only: a .seg for "Only these projects / All projects, including future ones", then the projects
   as .check rows (in a .scroll-list when there are many, with a .search-input above it that access.js shows).
   The rules here only make the pieces sit right together: the switch takes the full width on a phone, and a part
   access.js puts away (the switch for a portal that is not the builder team, the list under "All projects")
   really goes, although .checks and .scroll-list set their own display. */
.project-pick { margin-top: var(--s-3); }
.project-pick .field { margin-bottom: var(--s-2); }
.project-pick [hidden] { display: none; }
.project-pick .check > span { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 700px) { .project-pick .seg { display: grid; width: 100%; } }

/* Phones: the topbar box goes away (the drawer has its own search); access.css loads after style.css, so the hide lives here. */
@media (max-width: 700px) { .topbar-search { display: none; } }

/* "Find someone already in Takteam" on the invite form (static/person_picker.js). A list of tap-size rows under the
   box (44px or more each), keyboard friendly: .active is the row the arrow keys are on. Rows that cannot be
   picked (already on this project) are greyed out. */
.person-picker { position: relative; max-width: 560px; }
.person-picker input[type=search] { width: 100%; }
.picker-list { list-style: none; margin: var(--s-1) 0 0; padding: var(--s-1); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); max-height: 360px; overflow-y: auto; }
.picker-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-3); align-items: center; min-height: 44px; padding: var(--s-2) var(--s-3); border-radius: var(--radius-xs); cursor: pointer; }
.picker-row + .picker-row { border-top: 1px solid var(--line); }
.picker-row:hover, .picker-row.active { background: var(--accent-50); }
.picker-row.disabled { cursor: default; color: var(--muted); background: none; }
.picker-name { font-weight: 600; overflow-wrap: anywhere; }
.picker-meta { grid-column: 1; font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.picker-tag { grid-column: 2; grid-row: 1 / span 2; font-size: var(--fs-xs); color: var(--muted); text-align: right; max-width: 14em; }
@media (max-width: 700px) {
  .picker-row { grid-template-columns: minmax(0, 1fr); }
  .picker-tag { grid-column: 1; grid-row: auto; text-align: left; max-width: none; }
}
