:root {
  --tgs-accent: #3b5bdb;
}

body > header.container {
  padding-block: 1rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
  margin-bottom: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-mark {
  font-size: 1.15em;
  line-height: 1;
}

.user-bar {
  font-size: 0.9em;
  color: var(--pico-muted-color);
}

.user-bar a {
  color: inherit;
}

/* --- toolbar / search --- */

.toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 32rem;
}

.search-wrap::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  width: 0.9rem;
  height: 0.9rem;
  transform: translateY(-50%);
  background: var(--pico-muted-color);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat center / contain;
  pointer-events: none;
}

.search-wrap input[type="search"] {
  padding-left: 2.1rem;
  margin-bottom: 0;
}

/* --- htmx loading indicator --- */

.spinner {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--pico-muted-border-color);
  border-top-color: var(--tgs-accent);
  border-radius: 50%;
  animation: tgs-spin 0.6s linear infinite;
  flex-shrink: 0;
}

@keyframes tgs-spin {
  to { transform: rotate(360deg); }
}

/* --- breadcrumb --- */

.breadcrumb {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.crumb-sep::after {
  content: "\203A";
  margin: 0 0.4em;
  color: var(--pico-muted-color);
}

.crumb-current {
  font-weight: 600;
  color: var(--pico-color);
}

/* --- result count --- */

.result-meta {
  color: var(--pico-muted-color);
  font-size: 0.85em;
  margin-bottom: 0.5rem;
}

.result-meta-truncated {
  color: var(--pico-form-element-invalid-active-border-color, #c05621);
}

/* --- table --- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
}

.table-wrap table {
  margin-bottom: 0;
}

.table-wrap thead th {
  position: sticky;
  top: 0;
  background: var(--pico-card-background-color);
  z-index: 1;
  white-space: nowrap;
}

.table-wrap thead th a {
  color: var(--pico-color);
  text-decoration: none;
}

.table-wrap thead th a:hover {
  color: var(--tgs-accent);
}

.table-wrap tbody tr:hover {
  background: var(--pico-table-row-stripe-background-color, rgba(128, 128, 128, 0.06));
}

table td {
  vertical-align: top;
}

.col-size,
.col-modified {
  white-space: nowrap;
  color: var(--pico-muted-color);
  font-size: 0.92em;
}

.col-size {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.file-icon {
  vertical-align: -3px;
  margin-right: 0.4em;
}

.empty-state {
  text-align: center;
  color: var(--pico-muted-color);
  padding: 2rem 1rem;
}

/* --- login --- */

.login-shell {
  min-height: calc(100vh - 8rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 24rem;
}

.login-mark {
  font-size: 2rem;
  text-align: center;
  display: block;
  margin-bottom: 0.5rem;
}

.login-card h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-error {
  color: var(--pico-del-color);
  font-size: 0.9em;
}

/* --- portal --- */

.grid article h4 {
  margin-bottom: 0.5rem;
}

.grid article ul {
  margin: 0;
  padding-left: 1.25rem;
}

/* --- assign / settings admin pages --- */

#picker-toolbar input[type="search"] {
  margin-bottom: 0.75rem;
}

#picker-results table td:last-child,
#assign-results table td:last-child {
  text-align: right;
  white-space: nowrap;
}

#picker-results table td:last-child form,
#assign-results table td:last-child form {
  display: inline;
}

#assign-form-wrap select {
  margin-bottom: 0.75rem;
}
