/* Available points sit beside the avatar in the same header row. */
.topbar .topbar-credit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-left: 16px;
  border-left: 1px solid #343438;
  color: #f2f2f3;
  white-space: nowrap;
  flex-shrink: 0;
}
.topbar-credit svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.topbar .topbar-points {
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
@media (max-width: 600px) {
  .topbar .topbar-credit {
    padding-left: 8px;
    gap: 5px;
  }
  .topbar .topbar-points {
    font-size: 14px;
  }
  .topbar .topright {
    max-width: 80%;
  }
  .topbar .profile strong {
    max-width: 75px;
  }
}

/* Database viewer: fixed column widths prevent long values from overlapping. */
.database-toolbar {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(170px, 220px) minmax(240px, 1fr) auto auto;
  align-items: end;
}
.database-toolbar > div {
  min-width: 0;
}
.database-toolbar select,
.database-toolbar input {
  min-width: 0;
  width: 100%;
}
.database-toolbar .database-search {
  min-width: 0;
}
.database-toolbar:not(:has(.database-category)) {
  grid-template-columns: minmax(170px, 220px) minmax(240px, 1fr) auto auto;
}
.database-summary {
  flex-wrap: wrap;
  gap: 10px 16px;
}
.database-summary small {
  margin-left: auto;
  color: #93939f;
  font-size: 12px;
}
.database-panel {
  padding: 0;
  overflow: hidden;
}
.database-table {
  overflow: auto;
  max-width: 100%;
  max-height: min(65vh, 720px);
  scrollbar-gutter: stable;
}
.database-table:focus-visible {
  outline: 2px solid #b9d883;
  outline-offset: -2px;
}
.database-table table {
  table-layout: fixed;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.database-table th {
  background: #28282d;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  padding: 15px 16px;
}
.database-table th small {
  font-family: ui-monospace, monospace;
  font-size: 11px;
}
.database-table td {
  max-width: none;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.65;
  padding: 16px;
  border-bottom: 1px solid #343439;
}
.database-table tbody tr:hover {
  background: #2b2d28;
}
.database-table .database-value {
  display: block;
  overflow-wrap: anywhere;
}
.database-table .database-cell {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  width: 100%;
  max-width: none;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  overflow: hidden;
  line-height: 1.65;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
  color: #d1d4cc;
  text-decoration: underline dotted #8a9770;
  text-underline-offset: 4px;
}
.database-table .database-cell:hover {
  color: #d9efac;
}
@media (max-width: 1100px) {
  .database-toolbar,
  .database-toolbar:not(:has(.database-category)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .database-toolbar .database-search {
    grid-column: 1 / -1;
  }
  .database-toolbar button {
    min-height: 44px;
  }
}
@media (max-width: 600px) {
  .database-toolbar,
  .database-toolbar:not(:has(.database-category)) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
  }
  .database-toolbar > div {
    width: auto;
  }
  .database-summary small {
    width: 100%;
    margin-left: 0;
  }
  .database-table {
    max-height: 60vh;
  }
  .database-pagination {
    gap: 10px;
  }
  .database-pagination button {
    flex: 1;
  }
}

.library-class-picker { position: relative; width: min(340px, 100%); }
.library-class-picker > summary { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:13px 15px; border:1px solid var(--border); border-radius:10px; background:#232426; cursor:pointer; list-style:none; }
.library-class-picker summary::-webkit-details-marker { display:none; }
.library-class-picker > summary:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.library-class-dropdown { position:absolute; top:calc(100% + 6px); left:0; width:100%; max-height:min(420px,55vh); overflow:auto; z-index:15; padding:7px; border:1px solid #41443a; border-radius:12px; background:#222522; box-shadow:0 12px 32px #0006; }
.library-class-dropdown > details > summary { display:flex; align-items:center; justify-content:space-between; gap:12px; cursor:pointer; padding:12px; border-radius:8px; }
.library-class-dropdown > details > summary::before { content:'▸'; }
.library-class-dropdown > details[open] > summary::before { content:'▾'; }
.library-class-dropdown > details[open] > summary { background:#343a2f; }
.library-class-dropdown small { color:#a8b49b; font-size:11px; }
.library-class-dropdown [data-class-members] { padding:4px 0 6px 16px; }
.library-class-dropdown button { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; padding:11px 12px; border-radius:8px; text-align:left; }
.library-class-dropdown button:hover, .library-class-dropdown button[aria-pressed=true] { background:#424c33; color:#ddf3b1; }

.library-date-group { margin: 28px 0 34px; }
.library-date-group h2 { display:flex; align-items:center; gap:12px; margin:0 0 16px; font-size:17px; font-weight:600; color:#ededee; }
.library-date-group h2 small { font-size:12px; font-weight:400; color:var(--muted); }
.library-date-group .library-grid { margin-top:0; }

.project-studio-kicker { display:inline-flex; align-items:center; gap:12px; letter-spacing:2px; color:#a7ae99; }
.project-studio-mark { display:grid; place-items:center; width:32px; height:32px; color:#d3ef8c; border:1px solid #9db5583b; border-radius:10px 10px 10px 3px; background:linear-gradient(135deg,#bada6d18,#7fbdb208); transform:rotate(-6deg); }
.project-studio-mark svg { width:16px; height:16px; transform:rotate(6deg); }
.workspace-heading .project-studio-title { position:relative; display:table; margin:16px 0 20px; font-weight:650; letter-spacing:.025em; }
.project-studio-title::after { content:''; position:absolute; left:0; bottom:-9px; width:72%; height:3px; border-radius:100%; background:linear-gradient(90deg,#c8e58d,#85b7b270,transparent); transform:rotate(-2deg); }
@media(max-width:700px) { .project-studio-kicker { font-size:9px; letter-spacing:1.2px; gap:8px; } .project-studio-mark { width:27px; height:27px; } }

/* School operations: compact, consistent buttons with a separate destructive action. */
.school-row-actions{gap:8px;flex-wrap:wrap}
.school-row-actions .secondary{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:38px;border-radius:10px;padding:8px 12px;font-size:13px;transition:background .18s,border-color .18s}
.school-row-actions .secondary svg{width:15px;height:15px;flex:none}
.school-row-actions .school-edit-button{background:#bcd87712;border-color:#bcd87738;color:#d0e7a5}
.school-row-actions .school-edit-button:hover{background:#bcd87724;border-color:#bcd87770}
.school-clear-button{background:transparent;border-color:#dc99992e;color:#d8a6a6}
.school-clear-button:hover:not(:disabled){background:#bc555518;border-color:#dc99996b}
.school-clear-button:disabled{opacity:.35;cursor:not-allowed}

/* Sidebar groups keep related management destinations together. */
.sidebar-group{margin:5px 0;border-radius:11px}
.sidebar-group summary{list-style:none;display:flex;align-items:center;gap:12px;padding:13px 14px;min-height:46px;color:#a5a5ab;cursor:pointer;border-radius:9px;font-size:14px;user-select:none}
.sidebar-group summary::-webkit-details-marker{display:none}
.sidebar-group summary:hover{background:#252527;color:#fff}
.sidebar-group summary:focus-visible{outline:2px solid #bedb72;outline-offset:2px}
.sidebar-group summary>svg:first-child{width:19px;height:19px;flex:none}
.sidebar-group summary .sidebar-chevron{width:14px;height:14px;margin-left:auto;transition:transform .18s}
.sidebar-group[open] summary .sidebar-chevron{transform:rotate(90deg)}
.sidebar-group.has-current>summary{color:#d2e6a7}
.sidebar-group-items{margin:2px 0 9px 23px;padding:1px 0 1px 9px;border-left:1px solid #414638}
.sidebar-group-items .nav{padding:10px 11px;gap:9px;font-size:13px;position:relative}
.sidebar-group-items .nav svg{width:16px;height:16px;flex:none}
.sidebar-group-items .nav.active:before{left:-10px;width:2px;height:18px;background:#ccff00}
@media(max-width:700px){
  .sidebar nav{display:block;overflow-x:visible;padding-bottom:12px}
  .sidebar nav>.nav{display:inline-flex;width:auto;margin:2px}
  .sidebar-group{width:100%;margin-top:5px;background:#ffffff03;border:1px solid #ffffff08}
  .sidebar-group summary{min-height:44px;padding:10px 12px;font-size:13px}
  .sidebar .sidebar-group-items .nav{display:flex;width:100%;margin:3px 0;padding:10px 12px}
}

.school-credit-settings{display:flex;align-items:center;justify-content:space-between;gap:20px;border-top:1px solid #ffffff10;margin-top:26px;padding-top:20px}
.school-credit-settings h3{font-size:14px;color:#d3b5b5;margin:0 0 7px;font-weight:550}
.school-credit-settings p{font-size:12px;color:#98989e;line-height:1.8;margin:0}
.school-credit-settings .school-clear-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;flex:none;padding:10px 13px;border-radius:10px;font-size:12px}
.school-credit-settings .school-clear-button svg{width:15px;height:15px}
@media(max-width:500px){.school-credit-settings{align-items:flex-start;flex-direction:column;gap:14px}}

/* Library actions stay outside native video controls. */
.library-card{position:relative}.library-card:has(.project-action-menu:not([hidden])){z-index:5}.library-actions .project-more{opacity:1;min-width:36px;min-height:36px;background:#181b21dc;border:1px solid #ffffff24;color:#e5e9ee}.library-delete-notice{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px;margin:0 0 24px;border:1px solid #ffffff18;border-radius:12px;background:#23272c;color:#d0d7df;font-size:13px}.library-delete-notice button{white-space:nowrap}
