/* ===== The Platform tab: the Admin tab's "B: Settings console" =====
   (John, Nov 11: "platform page also needs the same facelift the admin
   page got"; Nov 12: "Apply look B as built, phones too".) Its markup uses
   css/admin.css's classes, which are the look: the rail and its groups, a
   page's head (its group over its <h2>, its main buttons on the right),
   the panels and toolbars, and on a phone the one list above the page.
   This sheet has what admin.css keeps to #admin-panel (the rail's width, a
   page's padding, the phone's layout) and Platform's own: wider pages for
   its lists, its tables as panels, Erasures' parts as panels. In a window
   of 1200px or less (beside the rail, Teams' seven columns and Items'
   eight don't fit; on a phone neither) each table row is a block of lines,
   each cell named by its column (dom.js labelCells), and the Symbol
   Library's list sits over its editor, so nothing runs sideways. The
   page's own tokens and font only. */

#platform-panel { font-weight: 400; }

/* --- The rail --- */
#platform-panel .admin-rail {
  width: 240px;
  gap: 0;
  padding: 18px 12px;
  overflow-y: auto;
}

/* --- A page --- */
#platform-panel .section-content { padding: 28px 40px 48px; }
/* Its lists keep their room; its words a readable line. */
#platform-panel .admin-sec { max-width: 1240px; }
#platform-panel .admin-sec-hint { max-width: 860px; }
#platform-panel .hint { font-size: 12.5px; line-height: 1.45; color: var(--text-dim); }
#platform-panel .hint.error { color: var(--danger-text); }
#platform-panel .admin-box { margin-bottom: 16px; }
#platform-panel .platform-signin-emails { margin-bottom: 16px; background: var(--panel); }
#platform-panel .platform-teams-list,
#platform-panel .items-admin-list { max-width: none; }

/* Its tables (Teams, Feedback, Model requests, Errors, Erasures' log):
   panels of rows, as Admin's people. */
#platform-panel .people-table { background: var(--panel); }
#platform-panel .people-table th { padding: 10px 12px; background: none; }
#platform-panel .people-table td { padding: 12px; vertical-align: top; }

/* Items: its eight columns fit the page from 1201px (Edit was past the
   list's edge at any width): the headings and an item's number wrap, its
   description (whole in its title) and symbol are cut shorter. */
#platform-panel .items-admin-table th { white-space: normal; }
#platform-panel .items-admin-table .items-num-cell { min-width: 150px; white-space: normal; }
#platform-panel .items-desc-cell { max-width: 200px; }
#platform-panel .items-symbol-cell { max-width: 140px; }

/* Symbol Library: the list as wide as its column, its long names cut short
   (each whole in its title), so the editor has the room. */
#platform-panel .symbol-admin-list-col { flex: 0 0 320px; min-width: 0; }

/* Erasures (platformErasures.js): each of its parts a panel, its name on
   top; the log's table inside one, edge to edge. */
#platform-erasures > .hint { margin: 0 2px 12px; }
#platform-erasures > .hint:empty { margin: 0; }
#platform-erasures > .erasures-section {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
#platform-erasures > .erasures-section > .account-subhead { margin: 0 0 8px; font-size: 14px; }
#platform-erasures > .erasures-section > :last-child { margin-bottom: 0; }
#platform-erasures .erasures-section > .people-table {
  width: calc(100% + 32px);
  margin: 8px -16px -14px;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  background: none;
}

/* --- 1200px or less: a narrower computer window (the rail beside the
   page) and a phone. Each table row is a block of lines, its cells named
   but its first (the row's name), and the Symbol Library's list sits over
   its editor. --- */
@media (max-width: 1200px) {
  #platform-panel .people-table thead,
  #platform-panel .items-admin-table thead { display: none; }
  #platform-panel .people-table,
  #platform-panel .people-table tbody,
  #platform-panel .people-table tr,
  #platform-panel .people-table td { display: block; }
  #platform-panel .people-table tr { padding: 8px 0; }
  #platform-panel .people-table tr + tr { border-top: 1px solid var(--border); }
  #platform-panel .people-table td { padding: 3px 16px; border: 0; text-align: left; }
  #platform-panel .people-table td:empty { display: none; }
  #platform-panel .people-table td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; color: var(--text-dim); }
  #platform-panel .people-table .people-actions { white-space: normal; padding-top: 6px; }
  #platform-panel .people-table .people-action { margin: 2px 6px 2px 0; }
  #platform-erasures .erasures-section > .people-table { width: auto; margin: 8px 0 0; border: 1px solid var(--border); border-radius: var(--radius); }

  #platform-panel .items-admin-table,
  #platform-panel .items-admin-table tbody,
  #platform-panel .items-admin-table tr { display: block; }
  #platform-panel .items-admin-table tr { padding: 8px 0; border-top: 1px solid var(--border); }
  #platform-panel .items-admin-table tr:first-child { border-top: 0; }
  #platform-panel .items-admin-table tr.items-editor-row { padding-top: 0; border-top: 0; }
  #platform-panel .items-admin-table td { display: block; min-width: 0; max-width: none; padding: 2px 0; border: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
  #platform-panel .items-admin-table td:empty { display: none; }
  #platform-panel .items-admin-table td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; color: var(--text-dim); }
  #platform-panel .items-editor-row > td { padding: 0; }
  /* An item's Save and Cancel keep their words; the note beside them wraps
     under them. */
  #platform-panel .items-editor-actions { flex-wrap: wrap; }
  #platform-panel .items-editor-actions > button { flex: none; }

  #platform-panel .symbol-admin { flex-direction: column; }
  #platform-panel .symbol-admin-list-col { flex: none; }
  #platform-panel .symbol-admin-list { flex: none; max-height: 50vh; }
}

/* --- Phone: the rail is one list above the page (admin.css's
   .admin-picker), and the whole tab scrolls. --- */
@media (max-width: 700px) {
  #platform-panel { flex-direction: column; overflow-y: auto; }
  #platform-panel .admin-rail { display: none; }
  #platform-panel .section-content { overflow-y: visible; padding: 14px 16px 28px; }
  #platform-panel .people-table td { padding: 3px 14px; }
  #platform-erasures > .erasures-section { padding: 11px 14px; }
}
