:root {
  --bg: #f0f4fa;
  --bg-accent: #e8eef8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #dbe3ef;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.35);
  --warn: #d97706;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 12px;
  --font: "Segoe UI", system-ui, sans-serif;
  --mono: Consolas, "Courier New", monospace;
  --glow-sm: 0 0 12px rgba(59, 130, 246, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
  --glow-md: 0 0 20px rgba(59, 130, 246, 0.18), 0 4px 16px rgba(15, 23, 42, 0.08);
  --glow-focus: 0 0 0 3px rgba(59, 130, 246, 0.2), 0 0 16px rgba(59, 130, 246, 0.25);
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes softPulse {
  0%, 100% { box-shadow: var(--glow-sm); }
  50% { box-shadow: var(--glow-md); }
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  background: linear-gradient(145deg, #f8fafc 0%, #eef2ff 45%, #f0f9ff 100%);
  color: var(--text);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  animation: fadeIn 0.4s ease;
}

.header h1 {
  margin: 0 0 4px;
  font-size: 1.75rem;
  color: #0f172a;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.header-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  background: var(--surface);
  box-shadow: var(--glow-sm);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: var(--glow-md);
  transform: translateY(-1px);
}

.nav-link.active {
  color: var(--primary);
  border-color: rgba(59, 130, 246, 0.5);
  background: #eff6ff;
  box-shadow: var(--glow-md);
}

.hint {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.token-ok {
  color: var(--success);
}

.test-log-list {
  max-height: 240px;
}

.offline-hint {
  margin: -8px 0 20px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(220, 38, 38, 0.25);
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.9rem;
  line-height: 1.6;
  box-shadow: 0 0 16px rgba(220, 38, 38, 0.1);
  animation: fadeIn 0.3s ease;
}

.offline-hint code {
  font-family: var(--mono);
  font-size: 0.85rem;
  background: #fff;
  padding: 1px 4px;
  border-radius: 4px;
}

.offline-hint a {
  color: var(--primary);
}

.stats dd.mono {
  font-size: 0.9rem;
  font-weight: 500;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  transition: var(--transition);
}

td:has(> .badge) {
  width: 1%;
  white-space: nowrap;
}

.badge-online {
  background: #ecfdf5;
  color: var(--success);
  border: 1px solid rgba(22, 163, 74, 0.3);
  box-shadow: 0 0 12px rgba(22, 163, 74, 0.2);
  animation: softPulse 3s ease-in-out infinite;
}

.badge-offline {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.3);
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.15);
}

.mono {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--glow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  animation: fadeIn 0.45s ease backwards;
}

.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(4) { animation-delay: 0.15s; }

.card:hover {
  box-shadow: var(--glow-md);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Removed legacy sidebar stack — see mobile shell section at file end */

h2 {
  margin: 0 0 16px;
  font-size: 1.1rem;
  color: #0f172a;
}

label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

input[type="text"]:not(.ui-input-field),
input[type="password"]:not(.ui-input-field),
input[type="search"]:not(.ui-input-field),
input[type="number"]:not(.ui-input-field),
input[type="date"]:not(.ui-input-field),
input[type="url"]:not(.ui-input-field),
input[type="email"]:not(.ui-input-field),
textarea:not(.ui-input-field),
select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  resize: vertical;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: var(--transition);
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input:focus:not(.ui-input-field),
textarea:focus:not(.ui-input-field),
select:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.14);
  background: #fff;
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  border: 1px solid #cbd5e1;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: middle;
  appearance: none;
  -webkit-appearance: none;
  transition: var(--transition);
}

input[type="checkbox"] {
  border-radius: 5px;
}

input[type="radio"] {
  border-radius: 999px;
}

input[type="checkbox"]:hover,
input[type="radio"]:hover {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08), inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  border-color: var(--primary);
  background-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.14);
}

input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.5 6.2L5 8.5L9.5 3.5' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 12px 12px;
}

input[type="radio"]:checked {
  background-image: radial-gradient(circle, #fff 0 34%, transparent 38%);
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.btn {
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  box-shadow: var(--glow-sm);
  transition: var(--transition);
}

.btn:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: var(--glow-md);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.btn.primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.35), 0 2px 8px rgba(37, 99, 235, 0.2);
}

.btn.primary:hover {
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.45), 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn.warn {
  background: #fffbeb;
  border-color: rgba(217, 119, 6, 0.35);
  color: var(--warn);
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.15);
}

.btn.ghost {
  background: transparent;
  box-shadow: none;
}

.btn.ghost:hover {
  background: var(--surface-2);
  box-shadow: var(--glow-sm);
}

.btn.danger {
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.3);
  color: var(--danger);
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.12);
}

.btn.small {
  padding: 5px 10px;
  font-size: 0.8rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
}

.stats div {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--glow-sm);
  transition: var(--transition);
}

.stats div:hover {
  box-shadow: var(--glow-md);
}

.stats dt {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.stats dd {
  margin: 4px 0 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
}

.stats dd.is-online {
  color: var(--success);
}

.code-block {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  min-height: 80px;
  box-shadow: inset 0 1px 4px rgba(15, 23, 42, 0.04);
}

.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
}

.scroll-table-wrap {
  max-height: 480px;
  overflow-y: auto;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.scroll-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.section-search:not(.ui-input-field) {
  min-width: 180px;
  max-width: 260px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--text);
  transition: var(--transition);
}

.section-search:not(.ui-input-field):focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--glow-focus);
}

.section-search:not(.ui-input-field)::placeholder {
  color: var(--muted);
}

.section-search-wide:not(.ui-input-field) {
  min-width: 220px;
  max-width: 360px;
  flex: 1 1 220px;
}

.account-note-cell {
  max-width: 180px;
}

.account-note {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 500;
  background: var(--surface-2);
}

tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: #f8fafc;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 24px !important;
}

.col-check {
  width: 40px;
  text-align: center;
}

.col-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

.message-actions > .ui-input,
.message-actions input[type="text"]:not(.ui-input-field),
.message-actions select {
  flex: 1;
  min-width: 160px;
  width: auto;
  margin-top: 0;
}

.message-actions select {
  min-width: 220px;
}

.action-row {
  margin-top: 8px;
}

#actionCommand {
  flex: 1;
  min-width: 220px;
}

.reply-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(70vh, 640px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reply-list > li {
  margin: 0;
  padding: 0;
  font-size: 13px;
}

.reply-list > li.empty {
  padding: 24px 12px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.reply-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface, #fff);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.reply-item[open] {
  box-shadow: var(--glow-sm);
}

.reply-item[open] .reply-chevron {
  transform: rotate(90deg);
}

.reply-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
  user-select: none;
  transition: background var(--transition);
}

.reply-summary::-webkit-details-marker {
  display: none;
}

.reply-summary::marker {
  content: '';
}

.reply-summary:hover {
  background: var(--surface-2, #f8fafc);
}

.reply-route {
  display: inline-flex;
  flex: 1 1 320px;
  min-width: 0;
  align-items: baseline;
  gap: 5px;
  color: var(--text);
}

.reply-route-label {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 11px;
}

.reply-route-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.reply-route-device {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
}

.reply-route-device::before {
  content: '(';
}

.reply-route-device::after {
  content: ')';
}

.reply-route-arrow {
  flex-shrink: 0;
  margin: 0 2px;
  color: var(--muted);
}

.reply-time {
  flex-shrink: 0;
}

.reply-chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--muted);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.reply-type {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.reply-type-reply {
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.reply-type-action {
  color: #059669;
  background: #ecfdf5;
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.reply-type-action.fail {
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.reply-body {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
  color: var(--text);
  background: var(--surface-2, #f8fafc);
}

.reply-sent-preview {
  flex: 1 1 100%;
  color: var(--text);
  font-family: Consolas, 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.reply-ref {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}

.reply-block + .reply-block {
  margin-top: 10px;
}

.reply-block-label {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--font-sans, system-ui, sans-serif);
}

.reply-block-pre {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.5;
}

.client-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.client-timing {
  white-space: nowrap;
}

.client-timing-main {
  display: block;
}

.client-timing-sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted, #8b949e);
}

.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 480px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.log-list li {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  background: var(--surface);
  transition: background var(--transition);
}

.log-list li:hover {
  background: #fafbff;
}

.log-list .log-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-head {
  display: grid;
  grid-template-columns: auto auto auto 1fr;
  gap: 8px 10px;
  align-items: baseline;
}

.log-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-api {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #2563eb;
}

.log-req-preview {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  word-break: break-all;
  line-height: 1.35;
}

.log-req-hint {
  color: var(--warn);
  font-family: var(--sans, inherit);
}

.log-details {
  margin-left: 0;
}

.log-details[open] {
  animation: fadeIn 0.25s ease;
}

.log-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.82rem;
  user-select: none;
  padding: 4px 0;
  transition: color var(--transition);
}

.log-details summary:hover {
  color: var(--primary);
}

.log-raw-wrap {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.log-raw-block {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--glow-sm);
}

.log-raw-label {
  padding: 6px 10px;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.log-raw-pre {
  margin: 0;
  padding: 10px 12px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 280px;
  overflow-y: auto;
  color: #334155;
}

.log-list .time {
  color: var(--muted);
  font-family: var(--mono);
  flex-shrink: 0;
}

.source-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  box-shadow: 0 0 8px rgba(15, 23, 42, 0.04);
}

.log-source-api .source-tag { color: #2563eb; border-color: rgba(59, 130, 246, 0.35); background: #eff6ff; }
.log-source-websocket .source-tag { color: #16a34a; border-color: rgba(22, 163, 74, 0.35); background: #ecfdf5; }
.log-source-login .source-tag { color: #7c3aed; border-color: rgba(124, 58, 237, 0.35); background: #f5f3ff; }
.log-source-operation .source-tag { color: #d97706; border-color: rgba(217, 119, 6, 0.35); background: #fffbeb; }
.log-source-admin .source-tag { color: #6b7280; border-color: rgba(107, 114, 128, 0.35); background: #f9fafb; }

.log-device,
.log-ip {
  font-size: 0.78rem;
  color: var(--muted);
}

.ip-cell {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.ip-cell > .mono {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

td:has(> .ip-cell) {
  min-width: 0;
  vertical-align: top;
}

.ip-loc {
  display: block;
  font-size: 0.78rem;
  color: #6366f1;
  margin-top: 2px;
}

.log-filters select {
  width: auto;
  margin-top: 0;
}

.log-filters .input-inline {
  width: 160px;
  margin-top: 0;
}

.log-section-head {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.log-section-head > h2 {
  margin: 0;
  flex: 0 0 auto;
}

.log-section-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 0 0 auto;
}

.log-total-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: normal;
}

.log-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1 1 320px;
  justify-content: flex-end;
  min-width: 0;
}

.log-search-input {
  min-width: 200px;
  max-width: none;
  flex: 1 1 200px;
}

.log-toolbar-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.toolbar-filters {
  position: relative;
  flex: 0 0 auto;
}

.toolbar-filters > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.toolbar-filters > summary::-webkit-details-marker {
  display: none;
}

.toolbar-filters-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  overflow: visible;
}

.toolbar-filters-panel .input-inline,
.toolbar-filters-panel .ui-select {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.input-inline,
.log-toolbar .input-inline,
.log-toolbar select:not(.ui-select-native) {
  width: auto;
  min-width: 110px;
  max-width: 180px;
  margin-top: 0;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: var(--transition);
}

.log-toolbar .ui-select {
  width: auto;
  min-width: 110px;
  max-width: 180px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.input-inline:focus,
.log-toolbar select:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.14);
  background: #fff;
}

.date-input {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.date-input::placeholder {
  color: #94a3b8;
  font-family: var(--font);
  letter-spacing: 0;
}

.ui-select {
  position: relative;
  display: inline-flex;
  min-width: 110px;
  max-width: 180px;
}

.ui-select-trigger {
  width: 100%;
  margin: 0;
  padding: 7px 28px 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M2.2 4.2 6 8l3.8-3.8 1.1 1.1L6 10.2 1.1 5.3z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.ui-select-trigger:hover,
.ui-select.is-open .ui-select-trigger {
  border-color: rgba(59, 130, 246, 0.55);
  background-color: #fff;
}

.ui-select-trigger:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.14);
}

.ui-select-trigger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ui-select-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.ui-select.is-open .ui-select-menu {
  display: block;
}

.ui-select-menu.is-floating {
  position: fixed;
  z-index: 1200;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  overflow-y: auto;
}

.ui-select-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
}

.ui-select-option:hover:not(.is-selected):not(:disabled) {
  background: #f8fafc;
}

.ui-select-option.is-selected {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 500;
}

.ui-select-option.is-selected:hover:not(:disabled) {
  background: #dbeafe;
}

.ui-select-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ui-select-native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.ui-input {
  display: flex;
  align-items: stretch;
  width: 100%;
  margin-top: 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: var(--transition);
}

.ui-input-field {
  flex: 1;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: none !important;
  border-radius: inherit;
  background: transparent !important;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  box-shadow: none !important;
  outline: none;
  resize: vertical;
}

.ui-input-field:focus {
  outline: none;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.ui-input:focus-within,
.ui-input.is-focused {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.14);
  background: #fff;
}

.ui-input.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ui-input.is-disabled .ui-input-field {
  cursor: not-allowed;
}

.ui-input--inline {
  width: auto;
  min-width: 110px;
  max-width: 180px;
  margin-top: 0;
}

.ui-input--inline .ui-input-field {
  padding: 7px 10px;
  font-size: 0.85rem;
}

.ui-input--date {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
  margin-top: 0;
}

.ui-input--date .ui-input-field {
  padding: 7px 10px;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.ui-input--date .ui-input-field::placeholder {
  color: #94a3b8;
  font-family: var(--font);
  letter-spacing: 0;
}

.ui-input--search {
  min-width: 180px;
  max-width: 260px;
  margin-top: 0;
  background: var(--surface);
}

.ui-input--search .ui-input-field,
.ui-input--search-wide .ui-input-field {
  padding: 7px 12px;
  font-size: 0.85rem;
  background: transparent;
}

.ui-input--search-wide {
  min-width: 220px;
  max-width: 360px;
  flex: 1 1 220px;
  margin-top: 0;
}

.ui-input--search .ui-input-field::placeholder,
.ui-input--search-wide .ui-input-field::placeholder {
  color: var(--muted);
}

.ui-input--field {
  margin-top: 0;
  background: #fff;
  box-shadow: none;
}

.ui-input--field .ui-input-field {
  padding: 9px 12px;
  font-size: 0.9rem;
}

.ui-input-field[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.ui-input-field[type="number"]::-webkit-inner-spin-button,
.ui-input-field[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

label > .ui-input {
  margin-top: 6px;
}

.admin-form .field .ui-input {
  margin-top: 0;
}

.admin-form .field-narrow .ui-input {
  max-width: 132px;
}

.admin-form .field-narrow .ui-input-field {
  text-align: center;
}

.toolbar-filters-panel .ui-input {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.log-toolbar .ui-input--inline,
.log-toolbar-filters .ui-input--inline {
  width: auto;
  min-width: 110px;
  max-width: 180px;
  margin: 0;
}

.log-toolbar-filters .ui-input--inline {
  min-width: 120px;
}

.client-release-notes-label .ui-input {
  margin-top: 6px;
}

.client-release-notes-label .ui-input-field {
  min-height: 160px;
}

.oss-form-grid label > .ui-input {
  margin-top: 6px;
}

.section-head .ui-input--search,
.section-head .ui-input--search-wide {
  margin-top: 0;
}

@media (max-width: 720px) {
  .section-head .ui-input--search,
  .ui-input--search,
  .ui-input--search-wide {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}

.log-toolbar-filters select,
.log-toolbar-filters .input-inline {
  width: auto;
  min-width: 120px;
  max-width: 180px;
  margin-top: 0;
}

.toolbar-delete {
  position: relative;
}

.toolbar-delete > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.toolbar-delete > summary::-webkit-details-marker {
  display: none;
}

.toolbar-delete-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  min-width: 280px;
}

.toolbar-delete-panel .date-input {
  margin: 0;
}

.toolbar-delete-sep {
  color: var(--muted);
  font-size: 0.82rem;
  user-select: none;
}

.btn.danger-text,
.danger-text {
  color: #b91c1c;
}

.log-delete-bar {
  display: none;
}

.log-delete-label {
  display: none;
}

.log-date-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.log-date-range input[type="date"] {
  width: 128px;
  margin: 0;
  padding: 7px 4px;
  font-size: 0.85rem;
  border: none;
  background: transparent;
  box-shadow: none;
}

.log-date-range input[type="date"]:focus {
  outline: none;
  box-shadow: none;
}

.log-date-sep {
  color: var(--muted);
  font-size: 0.85rem;
  user-select: none;
}

.log-clear-all-btn {
  display: none;
}

@media (max-width: 640px) {
  .toolbar-delete-panel {
    position: static;
    width: 100%;
    min-width: 0;
    box-shadow: none;
    border: 1px dashed var(--border);
    margin-top: 4px;
  }

  .log-toolbar {
    justify-content: stretch;
  }

  .log-search-input {
    max-width: none;
    width: 100%;
  }
}

.block-form {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.custom-duration-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.custom-duration-wrap input:not(.ui-input-field) {
  width: 72px;
}

.custom-duration-wrap select {
  width: auto;
  margin-top: 0;
}

.log-list .level-info { color: var(--success); }
.log-list .level-warn { color: var(--warn); }
.log-list .level-error { color: var(--danger); }

.log-filters select {
  box-shadow: var(--glow-sm);
}

.log-filters select:hover {
  box-shadow: var(--glow-md);
}

.log-section {
  position: relative;
}

.log-head {
  grid-template-columns: auto auto auto 1fr auto;
  cursor: default;
}

.log-source-client .log-head {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: start;
}

.log-head > .btn {
  justify-self: end;
  width: auto;
}

.log-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
  align-self: start;
  flex-shrink: 0;
}

.log-list .log-item {
  cursor: pointer;
}

.log-list .log-item:hover {
  background: #f0f7ff !important;
}

.log-list .log-item.active {
  background: #eff6ff !important;
  box-shadow: inset 3px 0 0 var(--primary);
}

.log-load-more {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 12px;
  border-bottom: none;
  background: transparent;
  user-select: none;
}

.log-load-more[hidden] {
  display: none;
}

.login-log-table .log-load-more td,
.scroll-table-wrap .log-load-more td,
table tr.log-load-more td {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 12px;
  border-bottom: none;
  background: transparent;
}

.login-log-table {
  table-layout: fixed;
}

.login-log-table th:nth-child(4),
.login-log-table th:nth-child(5) {
  width: 12%;
  min-width: 108px;
}

.login-log-table td:has(> .ip-cell) {
  min-width: 0;
  max-width: 0;
  vertical-align: top;
}

.login-log-table .login-log-msg {
  word-break: break-word;
}

.error-log-table th:nth-child(1) { width: 10%; min-width: 108px; }
.error-log-table th:nth-child(2) { width: 6%; min-width: 56px; }
.error-log-table th:nth-child(3) { width: 10%; min-width: 96px; }
.error-log-table th:nth-child(4) { width: 28%; }
.error-log-table th:nth-child(5) { width: 9%; min-width: 108px; }
.error-log-table th:nth-child(6) { width: 7%; min-width: 72px; }
.error-log-table th:nth-child(7) { width: 10%; min-width: 96px; }
.error-log-table th:nth-child(8) { width: 11%; min-width: 120px; }
.error-log-table th:nth-child(9) { width: 10%; min-width: 108px; }
.error-log-table th:nth-child(10) { width: 48px; min-width: 48px; }

.error-log-table .login-log-msg,
.error-log-table .error-log-code,
.error-log-table .error-log-device,
.error-log-table .error-log-api {
  min-width: 0;
  max-width: 0;
  overflow: hidden;
  vertical-align: top;
}

.error-log-table .log-cell-clip {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-log-table .level-info { color: var(--success); }
.login-log-table .level-warn { color: var(--warn); }
.login-log-table .level-error { color: var(--danger); }

.login-log-table tr.log-item:hover {
  background: #f0f7ff;
}

.log-msg {
  display: block;
}

.log-toast {
  position: absolute;
  top: 58px;
  right: 20px;
  z-index: 5;
  padding: 8px 14px;
  border-radius: 8px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 0.82rem;
  box-shadow: var(--glow-md);
  animation: fadeIn 0.2s ease;
}

.new-logs-banner {
  display: block;
  width: calc(100% - 8px);
  margin: 0 4px 8px;
  padding: 8px 12px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 8px;
  background: #eff6ff;
  color: var(--primary);
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: var(--glow-sm);
  transition: var(--transition);
}

.new-logs-banner:hover {
  box-shadow: var(--glow-md);
  transform: translateY(-1px);
}

.log-detail-window {
  position: fixed;
  left: 0;
  top: 0;
  width: 420px;
  height: 480px;
  min-width: 300px;
  min-height: 260px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  z-index: 200;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.16), 0 0 24px rgba(59, 130, 246, 0.12);
  overflow: hidden;
  resize: both;
}

.log-detail-window[hidden] {
  display: none !important;
  pointer-events: none;
}

.log-detail-window:not([hidden]) {
  display: flex;
  animation: popInWindow 0.2s ease;
}

.log-detail-window.dragging {
  opacity: 0.96;
  box-shadow: 0 20px 56px rgba(15, 23, 42, 0.22), 0 0 32px rgba(59, 130, 246, 0.18);
  transition: none;
}

@keyframes popInWindow {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.log-window-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #f8fafc, #eef2ff);
  border-bottom: 1px solid var(--border);
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}

.log-window-titlebar h3 {
  margin: 0;
  font-size: 0.92rem;
  color: #0f172a;
  pointer-events: none;
}

.log-window-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.log-window-close {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--glow-sm);
  transition: var(--transition);
}

.log-window-close:hover {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.35);
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.15);
}

.log-window-body {
  flex: 1;
  overflow: auto;
  padding: 12px;
  min-height: 0;
}

.log-panel-meta {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.log-detail-window .log-raw-block {
  margin-bottom: 10px;
}

.log-detail-window .log-raw-pre {
  max-height: 180px;
}

.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  box-sizing: border-box;
}

.login-card {
  width: 100%;
  max-width: 400px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--glow-md);
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  line-height: 1.3;
}

.login-card .subtitle {
  margin: 0;
  line-height: 1.5;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--muted);
}

.login-form input:not(.ui-input-field):not([type="checkbox"]) {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: var(--transition);
}

.login-form input:not(.ui-input-field):not([type="checkbox"]):focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.14);
  background: #fff;
}

.login-form .ui-input {
  margin-top: 0;
}

.login-form label > .ui-input {
  margin-top: 0;
}

.login-form .ui-input-field {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 10px 12px;
  font-size: 0.95rem;
}

.login-submit {
  width: 100%;
  margin-top: 4px;
}

.login-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.88rem;
}

.login-form .remember-me {
  align-self: flex-start;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--text);
  cursor: pointer;
}

.login-form .remember-me input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

@media (max-width: 480px) {
  .login-card {
    padding: 24px;
  }
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.user-name {
  color: var(--text);
  font-weight: 500;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border: 1px solid color-mix(in srgb, var(--role-color, #546e7a) 42%, var(--border));
  border-radius: 6px;
  background: color-mix(in srgb, var(--role-color, #546e7a) 12%, transparent);
  color: var(--role-color, #546e7a);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}

.role-badge.table-role-badge {
  font-size: 0.72rem;
  padding: 1px 7px;
}

.role-color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--role-color, #546e7a);
  vertical-align: -1px;
}

.inline-form input[type="color"] {
  width: 52px;
  height: 38px;
  padding: 4px;
  cursor: pointer;
}

.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(4px);
}

.admin-modal-backdrop[hidden] {
  display: none;
}

.admin-modal {
  width: min(460px, 100%);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  animation: fadeIn 0.16s ease;
}

.admin-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 10px;
}

.admin-modal-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.admin-modal-body {
  display: grid;
  gap: 14px;
  padding: 10px 20px 20px;
}

.admin-modal-body .field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-modal-body input[type="text"]:not(.ui-input-field) {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
}

.identity-color-field input[type="color"] {
  width: 64px;
  height: 40px;
  padding: 4px;
  cursor: pointer;
}

.identity-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.identity-preview .section-hint {
  margin: 0;
}

.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.section-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.block-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.block-settings-row h2 {
  margin: 0 0 6px;
}

.block-settings-row .section-hint {
  margin: 0;
  line-height: 1.5;
}

.block-add-head {
  margin-bottom: 8px;
}

.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 92px;
  min-height: 40px;
  cursor: pointer;
  user-select: none;
}

.toggle-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  display: inline-flex;
  align-items: center;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
  padding: 3px;
  border: 1px solid #94a3b8;
  border-radius: 12px;
  background: #e2e8f0;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.toggle-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
  transition: transform var(--transition);
}

.toggle-control input:checked + .toggle-track {
  background: var(--success);
  border-color: var(--success);
}

.toggle-control input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px);
}

.toggle-control input:focus-visible + .toggle-track {
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.toggle-control input:disabled + .toggle-track,
.toggle-control:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.6;
}

.toggle-label {
  min-width: 42px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 640px) {
  .block-settings-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

.one-time-api-key-result {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}

.one-time-api-key-result .warn-hint {
  color: #a15c00;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.inline-form input:not([type="checkbox"]):not([type="radio"]):not(.ui-input-field),
.inline-form select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  min-width: 140px;
}

.inline-form > .ui-input,
.inline-form > .ui-select,
.block-form > .ui-input,
.block-form > .ui-select {
  width: auto;
  min-width: 140px;
  margin-top: 0;
  flex: 0 1 auto;
}

.block-form .custom-duration-wrap > .ui-input {
  width: 72px;
  min-width: 72px;
}

.section-head-actions > .ui-input--search,
.section-head-actions > .ui-input--search-wide {
  flex: 0 1 auto;
}

.api-key-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2) 0%, #fff 60%);
  box-shadow: var(--glow-sm);
}

.api-key-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

.ak-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 180px;
  min-width: 150px;
  margin: 0;
}

.ak-field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.ak-field-label em {
  font-style: normal;
  font-weight: 400;
  color: #94a3b8;
  font-size: 0.74rem;
}

.ak-field-narrow {
  flex: 0 0 110px;
  min-width: 90px;
}

.ak-field-narrow input {
  text-align: center;
}

.ak-field-grow {
  flex: 3 1 340px;
}

.ak-field-duration {
  flex: 1 1 220px;
}

/* Auto-hide a field wrapper when its input is toggled hidden by JS */
.ak-field:has(> input[hidden]) {
  display: none;
}

.api-key-form input:not([type="checkbox"]) {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.api-key-form input:not([type="checkbox"]):focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.api-key-form input::placeholder {
  color: #b2bccd;
}

.api-key-form input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--surface-2);
}

.api-key-creator-hint {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--primary-hover);
}

.api-key-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding-top: 2px;
}

.api-key-form-actions .api-key-creator-hint {
  margin: 0;
  margin-right: auto;
}

.api-key-form-actions .btn {
  min-width: 148px;
}

@media (max-width: 640px) {
  .api-key-form {
    padding: 14px;
  }

  .ak-field,
  .ak-field-narrow,
  .ak-field-grow,
  .ak-field-duration {
    flex: 1 1 100%;
    min-width: 0;
  }

  .api-key-form-actions .btn {
    width: 100%;
  }
}

.api-key-banner {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: #eff6ff;
  font-size: 0.88rem;
  word-break: break-all;
}

.api-key-banner code {
  display: block;
  margin-top: 6px;
  padding: 8px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.api-key-result-modal {
  width: min(720px, calc(100vw - 32px));
}

.permissions-modal {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100dvh - 36px);
  display: flex;
  flex-direction: column;
}

.permissions-modal-body {
  overflow: auto;
  max-height: min(68dvh, 720px);
  padding-top: 0;
}

.permissions-modal-tabs {
  display: flex;
  gap: 6px;
  padding: 0 20px 12px;
  border-bottom: 1px solid var(--border);
}

.permissions-modal-tab {
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  cursor: pointer;
  transition: var(--transition);
}

.permissions-modal-tab:hover {
  color: var(--primary);
  background: var(--surface-2);
}

.permissions-modal-tab.active {
  color: var(--primary);
  background: #eff6ff;
  border-color: rgba(59, 130, 246, 0.22);
  font-weight: 600;
}

.permissions-modal-panel-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.permissions-modal-footer {
  padding: 0 20px 18px;
  margin-top: 0;
}

.api-key-result-text {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: 0.85rem;
  line-height: 1.8;
  white-space: pre;
  overflow-x: auto;
  word-break: normal;
}

#createApiKeyBatchCount {
  width: 88px;
  min-width: 88px;
}

.api-access-card {
  overflow: hidden;
}

.api-access-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid rgba(22, 163, 74, 0.22);
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  transition: border-color var(--transition), background var(--transition);
}

.api-access-status.is-disabled {
  border-color: rgba(217, 119, 6, 0.28);
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.api-access-status-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.api-access-status-copy {
  min-width: 0;
}

.api-access-status-copy strong {
  display: block;
  font-size: 1rem;
  color: #14532d;
}

.api-access-status.is-disabled .api-access-status-copy strong {
  color: #92400e;
}

.api-access-indicator {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.18);
}

.api-access-indicator.is-off {
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.18);
}

.api-access-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.api-access-actions .is-hidden,
.api-access-actions [hidden] {
  display: none !important;
}

.api-disabled-reason {
  margin: 6px 0 0;
  color: #b45309;
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
}

.dashboard-overview .dashboard-actions {
  margin-top: 16px;
}

.dashboard-api-status {
  margin-top: 4px;
}

.dashboard-api-manage-hint {
  margin-top: 12px;
  margin-bottom: 0;
}

.dashboard-api-manage-hint a {
  color: var(--primary);
  text-decoration: none;
}

.dashboard-api-manage-hint a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .api-access-status {
    flex-direction: column;
    align-items: stretch;
  }

  .api-access-actions {
    justify-content: flex-end;
  }
}

.actions-inline {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.actions-cell {
  width: 1%;
  white-space: nowrap;
}

.action-menu {
  position: relative;
  display: inline-flex;
}

.action-menu-trigger {
  min-width: 32px;
  padding: 5px 8px;
  line-height: 1;
}

.action-menu-trigger-icon {
  display: block;
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: -1px;
}

.action-menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 50;
  min-width: 148px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--glow-md);
  animation: fadeIn 0.15s ease;
}

.action-menu-panel.is-floating {
  position: fixed;
  z-index: 1200;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  overflow-y: auto;
}

.action-menu-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.action-menu-item:hover {
  background: var(--surface-2);
}

.action-menu-item.warn-text {
  color: var(--warn);
}

.action-menu-item.danger-text {
  color: var(--danger);
}

.action-menu-item.primary-text {
  color: var(--primary);
}

.action-menu-divider {
  height: 1px;
  margin: 4px 0;
  background: var(--border);
}

.api-key-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.api-key-cell code {
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.82rem;
  word-break: break-all;
  cursor: text;
}

.api-key-unavailable {
  color: var(--muted);
  font-size: 0.85rem;
}

.log-filter-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  background: #eff6ff;
  font-size: 0.85rem;
}

.log-toolbar .log-filter-badge {
  margin-bottom: 0;
}

.log-filter-badge span {
  flex: 1;
  min-width: 0;
}

/* Sidebar layout */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: var(--glow-sm);
}

.sidebar-brand {
  padding: 20px 16px 12px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #0f172a;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.sidebar-link:hover {
  background: var(--surface-2);
  color: var(--primary);
}

.sidebar-link.active {
  background: #eff6ff;
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-icon {
  width: 18px;
  text-align: center;
  opacity: 0.85;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.sidebar-footer .nav-link {
  display: block;
  margin-top: 8px;
  text-align: center;
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 {
  margin: 0;
  font-size: 1.35rem;
  color: #0f172a;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.page-content {
  flex: 1;
  padding: 24px;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.page-content {
  transition: opacity 0.15s ease;
}

.page-content.is-swapping {
  opacity: 0.35;
  pointer-events: none;
}

.page-content.page-enter {
  animation: pageEnter 0.18s ease;
}

@keyframes pageEnter {
  from { opacity: 0.35; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-content > .card {
  margin-bottom: 0;
}

.section-head-actions {
  margin-top: 0;
  align-items: center;
  flex: 1 1 280px;
  justify-content: flex-end;
  gap: 8px;
}

.client-message-panel {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.client-message-panel .message-actions,
.client-message-panel .action-row {
  margin-top: 0;
}

.clients-page,
.accounts-page {
  gap: 16px;
}

.clients-page-tabs,
.accounts-page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.clients-page-tabs .page-tab,
.accounts-page-tabs .page-tab {
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.clients-page-tabs .page-tab:hover,
.accounts-page-tabs .page-tab:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.clients-page-tabs .page-tab.active,
.accounts-page-tabs .page-tab.active {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: rgba(59, 130, 246, 0.35);
  font-weight: 600;
}

.clients-tab-panels,
.accounts-tab-panels {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.clients-tab-panel[hidden],
.accounts-tab-panel[hidden] {
  display: none !important;
}

.account-keys-head {
  margin-top: 24px;
}

.permissions-user-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.permissions-user-picker .ui-select {
  flex: 1 1 320px;
  min-width: min(100%, 320px);
  max-width: 420px;
}

.permissions-user-picker select {
  min-width: 280px;
  max-width: 100%;
}

.permissions-user-picker--enhanced .permissions-user-query,
.permissions-user-picker--enhanced .ui-input:has(.permissions-user-query) {
  flex: 1 1 280px;
  min-width: min(100%, 280px);
  max-width: 420px;
}

.permissions-selected-user {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.permissions-user-id {
  font-size: 0.82rem;
  color: var(--muted);
}

.permissions-editor-placeholder {
  margin-top: 20px;
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fafbfc;
}

.permissions-editor {
  margin-top: 20px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.permissions-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 12px 0 14px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.permissions-editor-toolbar-hint {
  margin: 0;
  flex: 1 1 240px;
}

.permissions-section-head {
  margin-top: 20px;
  margin-bottom: 0;
}

.permissions-section-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.permissions-advanced-card {
  margin-top: 16px;
}

.permissions-advanced-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  user-select: none;
}

.permissions-advanced-summary::-webkit-details-marker {
  display: none;
}

.permissions-advanced-summary small {
  font-weight: normal;
  color: var(--muted);
  font-size: 0.85rem;
}

.permissions-advanced-body {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.ui-select--user .ui-select-trigger {
  display: flex;
  align-items: center;
}

.ui-select--user .ui-select-menu {
  left: 0;
  right: auto;
  min-width: 100%;
  width: max-content;
  max-width: min(420px, calc(100vw - 48px));
}

.ui-select-option-user {
  padding: 9px 12px;
}

.ui-select-option-user .ui-select-option-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.ui-select--user .ui-select-trigger .ui-select-option-main {
  padding-right: 14px;
}

.ui-select-option-user .ui-select-option-label,
.ui-select--user .ui-select-trigger .ui-select-option-label {
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-select-option-user .ui-select-option-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ui-select-role-badge {
  font-size: 0.7rem;
  padding: 1px 7px;
}

.ui-select-option-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 6px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

.ui-select-option.is-selected::before {
  content: '✓';
  display: inline-block;
  width: 14px;
  margin-right: 2px;
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ui-select-option-user.is-selected {
  display: flex;
  align-items: center;
}

.ui-select-option-user.is-selected .ui-select-option-main {
  flex: 1;
  min-width: 0;
}

.role-badge.permissions-role-badge {
  border-radius: 999px;
  font-size: 0.78rem;
}

.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.permissions-keys-grid {
  max-height: 320px;
  overflow: auto;
  padding: 4px;
}

.permissions-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.9rem;
  cursor: pointer;
}

.permissions-option input {
  margin: 0;
}

.permissions-select-all {
  margin-bottom: 12px;
}

.permissions-empty-hint {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.permissions-empty-hint a {
  color: #b45309;
  font-weight: 500;
}

.permission-create-form {
  margin-bottom: 16px;
}

.permissions-feature-option span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}

.perm-feature-desc {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: normal;
}

.perm-custom-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 500;
}

.client-table-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
}

.admin-form {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.admin-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-form .field > span {
  font-weight: 500;
  line-height: 1.3;
}

.admin-form .field input:not(.ui-input-field),
.admin-form .field select,
.admin-form .field textarea:not(.ui-input-field) {
  width: 100%;
  margin-top: 0;
  padding: 9px 12px;
  font-size: 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: none;
}

.admin-form .field input:not(.ui-input-field):focus,
.admin-form .field select:focus,
.admin-form .field textarea:not(.ui-input-field):focus {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.admin-form .field-wide {
  grid-column: 1 / -1;
}

.admin-form .field-narrow {
  max-width: 132px;
}

.admin-form .field-narrow input {
  text-align: center;
}

.admin-form .inline-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-form .inline-field input {
  flex: 1;
}

.admin-form textarea {
  min-height: 110px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.admin-form .checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.admin-form .checkbox-field input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.admin-form .checkbox-field > span {
  font-weight: 400;
}

.admin-form .form-actions {
  margin-top: 14px;
}

@media (max-width: 760px) {
  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-form .field-narrow {
    max-width: none;
  }

  .admin-form .field-narrow input {
    text-align: left;
  }
}

.client-replies-card .reply-list {
  margin-top: 4px;
  padding: 4px;
}

.shell-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  padding: 10px 16px;
  background: #0f172a;
  color: #fff;
  border-radius: 8px;
  font-size: 0.88rem;
  box-shadow: var(--glow-md);
  max-width: min(420px, calc(100vw - 32px));
}


.account-form-grid {
  max-width: 520px;
}

.create-user-form {
  margin-bottom: 12px;
}

.create-user-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  margin-bottom: 16px;
}

.create-user-search {
  flex: 1 1 220px;
  max-width: 320px;
  min-width: 180px;
  margin-left: auto;
}

.create-user-form .admin-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.create-user-form .field-narrow {
  max-width: none;
}

.create-user-form .field-narrow input[type="color"] {
  width: 100%;
  height: 38px;
  padding: 4px;
  cursor: pointer;
}

.accounts-user-table-wrap {
  max-height: min(560px, calc(100vh - 320px));
}

.account-password-card {
  overflow: hidden;
}

.config-files-card {
  padding: 0;
  overflow: hidden;
}

.oss-config-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--glow-sm);
}

.oss-config-page {
  max-width: none;
  width: 100%;
  gap: 16px;
}

.oss-config-layout {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
  min-height: min(720px, calc(100vh - 220px));
  border-radius: 16px;
}

.oss-config-sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
}

.oss-category-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px 8px;
  flex: 1;
  overflow: auto;
}

.oss-category-nav-foot {
  padding: 8px 12px 16px;
  border-top: 1px solid var(--border);
}

.oss-add-category-btn {
  width: 100%;
}

.oss-category-tab-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 8px;
}

.oss-category-tab-wrap.active .oss-category-tab {
  background: #eff6ff;
  border-color: rgba(59, 130, 246, 0.35);
  color: #1d4ed8;
  font-weight: 600;
}

.oss-category-delete {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.oss-category-delete:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.oss-category-title-edit {
  margin-bottom: 0;
  flex: 1;
  min-width: 180px;
}

.oss-category-title-edit input {
  margin-top: 4px;
  font-weight: 600;
}

.oss-category-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.oss-category-tab.active {
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
}

.oss-category-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oss-category-tab:hover {
  background: var(--surface);
  border-color: var(--border);
}

.oss-category-tab.active {
  background: #eff6ff;
  border-color: rgba(59, 130, 246, 0.35);
  color: #1d4ed8;
  font-weight: 600;
}

.oss-category-icon {
  width: 1.1rem;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.85;
}

.oss-category-body {
  padding: 20px 24px;
  min-width: 0;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.oss-category-panel h2 {
  margin-top: 0;
}

.oss-category-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.oss-subsection-head {
  margin-top: 24px;
  margin-bottom: 12px;
}

.oss-path-fields-spaced {
  margin-top: 16px;
}

.oss-config-toolbar-copy {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.oss-config-toolbar-copy .section-hint {
  margin-bottom: 0;
  line-height: 1.65;
}

.oss-config-toolbar .actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.oss-missing-hint {
  margin: 0;
  color: #b45309;
}

.oss-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}

.oss-form-grid label {
  margin-bottom: 0;
}

.client-release-card {
  max-width: 720px;
}

.client-release-form {
  margin-top: 16px;
}

.client-release-notes-label {
  grid-column: 1 / -1;
}

.client-release-notes-label textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  margin-top: 6px;
}

.client-release-checkbox {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-release-gap-hint {
  grid-column: 1 / -1;
  margin: -4px 0 0;
}

.client-release-download-hint {
  grid-column: 1 / -1;
  margin: -4px 0 0;
}

.secrets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  margin-top: 16px;
}

.secret-panel h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.secret-panel label {
  display: block;
  margin-top: 12px;
}

.secret-panel textarea {
  width: 100%;
  margin-top: 6px;
  resize: vertical;
  min-height: 96px;
}

.secret-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.secret-upload-field {
  margin-top: 12px;
}

.secret-upload-title {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.file-input-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.file-input-trigger {
  position: relative;
  display: inline-flex;
  margin: 0;
  cursor: pointer;
}

.file-input-trigger input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-input-name {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: min(100%, 280px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-input-name.has-file {
  color: var(--text);
}

.client-release-actions {
  margin-top: 20px;
}

.client-release-meta {
  margin-top: 12px;
}

.oss-path-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.oss-path-row {
  margin-bottom: 0;
}

.oss-path-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 0.9rem;
}

.oss-path-hint {
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.oss-path-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.oss-path-input-wrap input,
.oss-path-input-wrap .ui-input {
  margin-top: 0;
  flex: 1;
  min-width: 0;
}

.oss-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  cursor: default;
}

.oss-table-wrap.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.oss-table-wrap.is-dragging input,
.oss-table-wrap.is-dragging button,
.oss-table-wrap.is-dragging label {
  pointer-events: none;
}

.oss-table {
  table-layout: fixed;
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
}

.oss-table-boot {
  width: 100%;
  min-width: 1080px;
}

.oss-table th,
.oss-table td {
  vertical-align: middle;
  padding: 9px 8px;
}

.oss-table th {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.oss-table-resizable th {
  position: relative;
}

.oss-column-resizer {
  position: absolute;
  z-index: 3;
  top: 0;
  right: -5px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.oss-column-resizer::after {
  content: "|";
  position: absolute;
  top: 50%;
  left: 50%;
  color: #a8b7ca;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  transform: translate(-50%, -50%);
  transition: color 120ms ease, transform 120ms ease;
}

.oss-column-resizer:hover::after,
.oss-table-wrap.is-column-resizing .oss-column-resizer.is-active::after {
  color: var(--primary);
  transform: translate(-50%, -50%) scaleY(1.18);
}

.oss-table-wrap.is-column-resizing,
.oss-table-wrap.is-column-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.oss-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.oss-table col.oss-col-enable { width: 52px; }
.oss-table col.oss-col-key { width: 96px; }
.oss-table col.oss-col-file { width: 28%; }
.oss-table col.oss-col-label { width: 112px; }
.oss-table col.oss-col-path { width: auto; }
.oss-table col.oss-col-vendor { width: 88px; }
.oss-table col.oss-col-devprg { width: 168px; }
.oss-table col.oss-col-digest { width: 168px; }
.oss-table col.oss-col-sign { width: 168px; }
.oss-table col.oss-col-md5 { width: 200px; }
.oss-table col.oss-col-suffix { width: 112px; }
.oss-table col.oss-col-actions { width: 72px; }
.oss-table col.oss-col-actions-sort { width: 112px; }

.oss-table-boot col.oss-col-label { width: 130px; }
.oss-table-boot col.oss-col-path { width: 240px; }
.oss-table-boot col.oss-col-vendor { width: 150px; }
.oss-table-boot col.oss-col-file { width: 300px; }
.oss-table-boot col.oss-col-md5 { width: 220px; }
.oss-table-boot col.oss-col-access { width: 210px; }
.oss-table-boot col.oss-col-memory { width: 78px; }

.oss-subsection-head {
  margin-top: 24px;
}

#lenovoRootProfileBody input {
  min-width: 130px;
}

.oss-boot-access-users {
  margin-top: 6px;
}

.oss-boot-access-users summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.76rem;
}

.oss-boot-access-users .permissions-grid {
  max-height: 180px;
  margin-top: 6px;
  overflow: auto;
}

.oss-enabled-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: 100%;
  color: inherit;
  font-size: inherit;
}

.oss-enabled-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.oss-table input:not([type="checkbox"]):not([type="radio"]):not(.ui-input-field) {
  margin-top: 0;
  min-width: 0;
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  background: #fff;
}

.oss-table .ui-input {
  margin-top: 0;
  min-width: 0;
  width: 100%;
  background: #fff;
  box-shadow: none;
}

.oss-table .ui-input-field {
  min-height: 36px;
  padding: 7px 9px;
  background: transparent;
}

.oss-table-path {
  display: flex;
  gap: 6px;
  align-items: stretch;
  min-width: 0;
}

.oss-table-path input,
.oss-table-path .ui-input {
  flex: 1;
  min-width: 0;
  margin-top: 0;
  width: auto;
}

.oss-table-path .btn {
  flex-shrink: 0;
  white-space: nowrap;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
}

.oss-enabled-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  white-space: nowrap;
}

.oss-enabled-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.oss-table-actions {
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}

.oss-table-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.oss-table-actions .oss-drag-handle {
  min-width: 0;
  padding: 0 8px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.oss-table-actions .oss-drag-handle:active {
  cursor: grabbing;
}

.oss-table tbody.is-row-dragging {
  cursor: grabbing;
}

.oss-table tbody tr.is-dragging {
  opacity: 0.45;
}

.oss-picker {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.oss-picker-dialog {
  width: min(560px, 100%);
  max-height: min(80vh, 640px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--glow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.oss-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.oss-picker-head h3 {
  margin: 0;
  font-size: 1rem;
}

.oss-picker-breadcrumb {
  padding: 10px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.oss-crumb {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 0 2px;
  font-size: inherit;
}

.oss-crumb-sep {
  color: var(--muted);
  margin: 0 2px;
}

.oss-picker-loading,
.oss-picker-list .empty {
  padding: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.oss-picker-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow: auto;
  flex: 1;
}

.oss-picker-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
}

.oss-picker-item:hover {
  background: var(--surface-2);
}

.oss-picker-select {
  color: #1d4ed8;
}

.oss-picker-foot {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.oss-picker-foot input {
  margin-top: 0;
  flex: 1;
}

@media (max-width: 1024px) {
  .oss-config-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .oss-config-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .oss-category-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 12px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .oss-category-nav-foot {
    padding: 10px 12px 12px;
  }

  .oss-category-tab-wrap {
    flex: 0 0 auto;
    min-width: 0;
  }

  .oss-category-tab {
    white-space: nowrap;
  }

  .oss-add-category-btn {
    width: auto;
    min-width: 120px;
  }
}

@media (max-width: 900px) {
  .oss-table {
    min-width: 640px;
  }

  .oss-path-input-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .oss-path-input-wrap .btn {
    width: 100%;
  }
}

@media (max-width: 899px) {
  .page-content.oss-config-page {
    padding: 12px;
    gap: 12px;
  }

  .oss-config-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  .oss-config-toolbar-copy {
    flex: 0 0 auto;
  }

  .oss-config-toolbar .actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 8px;
    margin-top: 0;
  }

  .oss-config-toolbar .actions .btn {
    width: 100%;
    min-height: 44px;
  }

  .oss-config-layout {
    min-height: 0;
    border-radius: 14px;
  }

  .oss-config-sidebar {
    background: #f8fbff;
  }

  .oss-category-nav {
    padding: 10px;
    gap: 8px;
    scrollbar-width: none;
  }

  .oss-category-nav::-webkit-scrollbar {
    display: none;
  }

  .oss-category-nav-foot {
    padding: 0 10px 10px;
    border-top: 0;
  }

  .oss-add-category-btn {
    width: 100%;
    min-height: 40px;
  }

  .oss-category-tab {
    min-height: 40px;
    padding: 9px 12px;
    border-color: var(--border);
    background: #fff;
    box-shadow: var(--glow-sm);
  }

  .oss-category-body {
    padding: 14px;
  }

  .oss-category-panel h2 {
    font-size: 1.05rem;
    margin-bottom: 8px;
  }

  .oss-category-panel .section-head .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 0;
  }

  .oss-category-panel .section-head .actions .btn,
  .oss-category-panel .section-head > .btn {
    width: 100%;
  }

  .oss-form-grid {
    gap: 12px;
  }

  .oss-path-row {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--glow-sm);
  }

  .oss-path-label {
    margin-bottom: 10px;
    font-weight: 600;
  }

  .oss-path-hint {
    display: block;
    margin: 4px 0 0;
    line-height: 1.45;
  }

  .oss-path-input-wrap {
    display: grid;
    grid-template-columns: 1fr;
  }

  .oss-enabled-toggle {
    width: 100%;
    justify-content: flex-start;
  }

  .oss-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
    cursor: default;
  }

  .oss-table-wrap.is-dragging {
    cursor: default;
  }

  .oss-table,
  .oss-table thead,
  .oss-table tbody,
  .oss-table tr,
  .oss-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .oss-table,
  .oss-table-boot {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .oss-table colgroup,
  .oss-table thead {
    display: none;
  }

  .oss-column-resizer {
    display: none;
  }

  .oss-table tbody tr {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--glow-sm);
  }

  .oss-table tbody tr:nth-child(even) {
    background: #fff;
  }

  .oss-table td {
    padding: 8px 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  }

  .oss-table td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .oss-table td::before {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
  }

  .oss-table td[colspan] {
    border-bottom: 0;
    text-align: center;
  }

  .oss-table td[colspan]::before {
    content: none;
  }

  .oss-table-boot td:nth-child(1)::before,
  .oss-table-flavors td:nth-child(1)::before,
  .oss-table-supplement td:nth-child(1)::before,
  .oss-table-quick td:nth-child(1)::before,
  .oss-table-custom td:nth-child(1)::before { content: "启用"; }
  .oss-table-boot td:nth-child(2)::before { content: "显示"; }
  .oss-table-boot td:nth-child(3)::before { content: "OSS 路径"; }
  .oss-table-boot td:nth-child(4)::before { content: "厂商 / 类型"; }
  .oss-table-boot td:nth-child(5)::before { content: "引导文件"; }
  .oss-table-boot td:nth-child(6)::before { content: "MD5"; }
  .oss-table-boot td:nth-child(7)::before { content: "排序"; }
  .oss-table-flavors td:nth-child(2)::before,
  .oss-table-quick td:nth-child(2)::before { content: "标识"; }
  .oss-table-flavors td:nth-child(3)::before,
  .oss-table-quick td:nth-child(3)::before,
  .oss-table-custom td:nth-child(2)::before { content: "显示名"; }
  .oss-table-flavors td:nth-child(4)::before { content: "KO 目录前缀"; }
  .oss-table-flavors td:nth-child(5)::before { content: "KSU Init"; }
  .oss-table-flavors td:nth-child(6)::before { content: "文件名后缀"; }
  .oss-table-flavors td:nth-child(7)::before,
  .oss-table-supplement td:nth-child(5)::before,
  .oss-table-quick td:nth-child(6)::before,
  .oss-table-custom td:nth-child(4)::before { content: "操作"; }
  .oss-table-supplement td:nth-child(2)::before { content: "本地文件"; }
  .oss-table-supplement td:nth-child(3)::before,
  .oss-table-quick td:nth-child(4)::before,
  .oss-table-custom td:nth-child(3)::before { content: "OSS 路径"; }
  .oss-table-supplement td:nth-child(4)::before,
  .oss-table-quick td:nth-child(5)::before { content: "MD5"; }

  .oss-enabled-cell {
    justify-content: flex-start;
    min-height: 0;
  }

  .oss-table input {
    min-height: 42px;
    font-size: 16px;
  }

  .oss-table-path {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .oss-table-path .btn {
    width: 100%;
    min-height: 40px;
  }

  .oss-table-actions {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    text-align: left;
    white-space: normal;
  }

  .oss-table-actions .btn {
    flex: 1 1 72px;
    min-height: 40px;
  }

  .oss-table-actions .oss-drag-handle {
    flex: 0 0 44px;
  }
}

@media (max-width: 768px) {
  .page-content.oss-config-page {
    padding: 16px;
  }

  .oss-config-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .oss-config-toolbar .actions {
    width: 100%;
    justify-content: stretch;
  }

  .oss-config-toolbar .actions .btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  .oss-category-body {
    padding: 16px;
  }

  .oss-category-panel .section-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .oss-category-tab {
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  .oss-table {
    min-width: 560px;
  }

  .oss-config-page .oss-table {
    min-width: 0;
  }

  .oss-picker {
    padding: 12px;
  }

  .oss-picker-foot {
    flex-direction: column;
    align-items: stretch;
  }
}

.cloud-files-browse-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(400px, 48vh);
  margin-bottom: 4px;
}

.cloud-files-browse-panel .oss-picker-list {
  flex: 1;
  min-height: 180px;
  max-height: none;
}

#browseList .oss-picker-item.is-selected {
  background: #eff6ff;
  color: #1d4ed8;
}

.cloud-files-path-cell {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-rule-body {
  padding: 16px;
  overflow: auto;
}

.cloud-rule-mode-hint {
  margin: 0 0 8px;
}

.cloud-rule-mode-grid {
  margin-bottom: 12px;
}

.cloud-rule-users-head {
  margin-top: 4px;
  margin-bottom: 8px;
}

.cloud-rule-users-head h2 {
  margin: 0;
  font-size: 1rem;
}

.cloud-rule-body .checkbox-field {
  margin-bottom: 12px;
}

/* —— Mobile shell: drawer nav, touch targets, stacked forms —— */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

body.sidebar-open {
  overflow: hidden;
}

body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.topbar-menu-btn {
  display: none;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
}

.topbar-menu-icon {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

@media (max-width: 899px) {
  .app-shell {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .topbar-menu-btn {
    display: inline-flex;
  }

  .topbar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 12px;
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .topbar-menu-btn {
    order: 0;
  }

  .topbar > div:nth-child(2) {
    order: 1;
    flex: 1 1 calc(100% - 56px);
    min-width: 0;
  }

  .topbar-right {
    order: 2;
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .topbar h1 {
    font-size: 1.15rem;
  }

  .topbar .subtitle {
    font-size: 0.82rem;
  }

  .user-label {
    max-width: 50vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(288px, 88vw);
    height: 100%;
    height: 100dvh;
    z-index: 200;
    transform: translateX(-108%);
    transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(15, 23, 42, 0.18);
  }

  .sidebar-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .sidebar-link {
    min-height: 44px;
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  .main-area {
    width: 100%;
    max-width: 100vw;
    min-height: 100dvh;
  }

  .page-content {
    width: 100%;
    max-width: 100vw;
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    gap: 20px;
  }

  .card {
    padding: 16px;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .section-head-actions,
  .section-head .section-search,
  .section-search,
  .section-search-wide {
    width: 100%;
    max-width: none;
    min-width: 0;
    flex: 0 0 auto;
  }

  .section-head-actions {
    justify-content: stretch;
  }

  .section-head-actions .btn,
  .section-head-actions .ui-select,
  .section-head-actions input,
  .section-head-actions select {
    flex: 0 0 auto;
  }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .inline-form input:not([type="checkbox"]):not([type="radio"]),
  .inline-form select,
  .inline-form .btn,
  .inline-form .ui-select {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: 0 0 auto;
  }

  .custom-duration-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(92px, auto);
    width: 100%;
  }

  .custom-duration-wrap input,
  .custom-duration-wrap select,
  .custom-duration-wrap .ui-select {
    width: 100%;
    min-width: 0;
  }

  .message-actions,
  .admin-form .inline-field {
    flex-direction: column;
    align-items: stretch;
  }

  .message-actions input[type="text"],
  .message-actions select,
  .message-actions .ui-select,
  #actionCommand {
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
  }

  .message-actions .btn,
  .admin-form .inline-field .btn {
    width: 100%;
  }

  .clients-page-tabs,
  .accounts-page-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .clients-page-tabs::-webkit-scrollbar,
  .accounts-page-tabs::-webkit-scrollbar {
    display: none;
  }

  .clients-page-tabs .page-tab,
  .accounts-page-tabs .page-tab {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 10px 14px;
  }

  .btn {
    min-height: 40px;
    padding: 10px 14px;
  }

  .btn.small {
    min-height: 36px;
    padding: 8px 12px;
  }

  .action-menu-trigger {
    min-width: 44px;
    min-height: 44px;
    padding: 10px 12px;
  }

  .action-menu-item {
    min-height: 44px;
    padding: 12px 14px;
    font-size: 0.9rem;
  }

  .action-menu-panel {
    position: fixed;
    left: 16px !important;
    right: 16px !important;
    top: auto !important;
    bottom: max(16px, env(safe-area-inset-bottom)) !important;
    min-width: 0;
    max-height: min(60vh, 420px);
    overflow-y: auto;
    z-index: 250;
  }

  .log-toolbar {
    flex-direction: column;
    align-items: stretch;
    flex: 0 0 auto;
    gap: 8px;
  }

  .log-toolbar-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .log-toolbar .input-inline,
  .log-toolbar select,
  .log-toolbar .ui-select {
    width: 100%;
    max-width: none;
    flex: 0 0 auto;
    min-height: 40px;
  }

  .log-search-input {
    flex: 0 0 auto;
    min-width: 0;
    height: 42px;
    min-height: 42px;
    margin-top: 0;
  }

  .permissions-user-picker,
  .permissions-user-picker--enhanced {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .permissions-user-picker .ui-select,
  .permissions-user-picker--enhanced .permissions-user-query {
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
  }

  .permissions-user-picker .btn,
  .permissions-user-picker input,
  .permissions-user-picker select {
    width: 100%;
    flex: 0 0 auto;
  }

  .permissions-editor-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .permissions-editor-toolbar .btn {
    width: 100%;
  }

  .oss-config-toolbar .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .oss-config-toolbar .actions .btn {
    width: 100%;
  }

  .shell-toast {
    left: 16px;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    text-align: center;
  }

  .log-detail-window {
    left: 12px !important;
    top: 12px !important;
    width: calc(100vw - 24px) !important;
    height: calc(100dvh - 24px) !important;
    max-width: none;
    max-height: none;
    resize: none;
  }

  input[type="text"]:not(.ui-input-field),
  input[type="password"]:not(.ui-input-field),
  input[type="search"]:not(.ui-input-field),
  input[type="number"]:not(.ui-input-field),
  input[type="date"]:not(.ui-input-field),
  input[type="url"]:not(.ui-input-field),
  input[type="email"]:not(.ui-input-field),
  textarea:not(.ui-input-field),
  select,
  .inline-form input:not([type="checkbox"]):not([type="radio"]):not(.ui-input-field),
  .inline-form select {
    font-size: 16px;
  }

  .reply-summary {
    font-size: 11px;
    gap: 6px;
  }

  .log-list {
    max-height: none;
    overflow-y: visible;
    border: 0;
    background: transparent;
    gap: 10px;
  }

  .log-list li {
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--glow-sm);
  }

  .log-list .log-item {
    padding: 12px;
  }

  .log-head,
  .log-source-client .log-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .log-head > .btn,
  .log-head-actions {
    justify-self: stretch;
    width: 100%;
  }

  .log-head-actions {
    flex-direction: row;
    justify-content: stretch;
  }

  .log-head-actions > .btn {
    flex: 1;
  }

  .log-body,
  .log-msg,
  .log-device,
  .log-api,
  .log-ip,
  .log-req-preview {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .log-ip {
    line-height: 1.45;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .table-wrap:not(.keep-table-mobile) {
    overflow-x: visible;
  }

  .table-wrap.scroll-table-wrap:not(.keep-table-mobile) {
    max-height: none;
    overflow-y: visible;
    border: 0;
    background: transparent;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) {
    border-collapse: separate;
    border-spacing: 0 10px;
    font-size: 0.86rem;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) tbody,
  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) tr,
  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) td {
    display: block;
    width: 100%;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) tbody tr {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--glow-sm);
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) tbody tr:hover {
    background: var(--surface);
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) td {
    display: grid;
    grid-template-columns: minmax(72px, 28%) minmax(0, 1fr);
    gap: 8px 10px;
    align-items: start;
    padding: 8px 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    text-align: left;
    overflow-wrap: anywhere;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) td:last-child {
    border-bottom: 0;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 600;
    text-align: left;
    min-width: 0;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) td[data-label=""]::before,
  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) td:not([data-label])::before,
  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) td.empty::before,
  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) td[data-mobile-full-row="true"]::before {
    content: none;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) td.empty,
  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) td[data-mobile-full-row="true"] {
    display: block;
    padding: 22px 12px !important;
    border-bottom: 0;
    text-align: center;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) .col-check {
    text-align: left;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) .actions-cell,
  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) .client-actions {
    white-space: normal;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) .actions-inline,
  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) .client-actions,
  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) .api-key-cell {
    justify-content: flex-start;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) .api-key-cell {
    flex-wrap: wrap;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) .api-key-cell code {
    max-width: 100%;
    text-align: left;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) .mono,
  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) code {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) .ip-cell {
    text-align: left;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) .ip-cell > .mono {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) input,
  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) select,
  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) textarea {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .topbar h1 {
    font-size: 1.05rem;
  }

  .permissions-grid {
    grid-template-columns: 1fr;
  }
}

.my-files-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.2rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.my-files-breadcrumb strong {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-files-quota-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
  margin: 0.5rem 0 0.75rem;
}

.my-files-quota-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  transition: width 0.2s ease;
}

.my-files-dropzone {
  border: 1.5px dashed rgba(37, 99, 235, 0.35);
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.04);
  padding: 1.25rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  outline: none;
}

.my-files-dropzone:hover,
.my-files-dropzone:focus-visible {
  border-color: rgba(37, 99, 235, 0.65);
  background: rgba(37, 99, 235, 0.07);
}

.my-files-dropzone.is-dragover {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.12);
}

.my-files-dropzone.is-uploading {
  opacity: 0.7;
  pointer-events: none;
}

.my-files-dropzone-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.my-files-dropzone-inner strong {
  color: var(--text);
  font-weight: 600;
}

.my-files-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0.85rem 0 0.5rem;
}

.my-files-link-form {
  margin-bottom: 0.85rem;
  padding: 0.85rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.my-files-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.my-files-empty {
  padding: 1.25rem 0.75rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.my-files-item {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 0.55rem 0.65rem;
  align-items: center;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  cursor: grab;
}

.my-files-item[data-type="folder"] .my-files-item-main {
  cursor: pointer;
}

.my-files-item.is-dragging {
  opacity: 0.45;
}

.my-files-item.is-drag-over {
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.my-files-drag {
  color: rgba(15, 23, 42, 0.35);
  font-size: 0.85rem;
  letter-spacing: -0.12em;
  user-select: none;
}

.my-files-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
}

.my-files-badge.is-file {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
}

.my-files-badge.is-folder {
  color: #b45309;
  background: rgba(245, 158, 11, 0.14);
}

.my-files-badge.is-link {
  color: #047857;
  background: rgba(16, 185, 129, 0.14);
}

.my-files-item-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.my-files-item-main strong {
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-files-item-sub {
  color: var(--muted);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-files-item-actions {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .my-files-item {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .my-files-item-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

/* Mobile layout hardening */
@media (max-width: 899px) {
  .topbar-right {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    gap: 8px 12px;
  }

  .topbar-right #currentUserLabel {
    min-width: 0;
    max-width: 100%;
    justify-self: start;
  }

  .topbar-right #logoutBtn {
    justify-self: end;
  }

  .topbar-right #serverTime {
    grid-column: 1 / -1;
    justify-self: end;
    max-width: 100%;
    text-align: right;
    white-space: normal;
  }

  .oss-config-layout,
  .oss-config-sidebar,
  .oss-category-nav,
  .oss-category-nav-foot,
  .oss-category-body,
  .oss-category-panel,
  .oss-form-grid {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .oss-category-nav,
  .oss-category-nav-foot {
    flex: 0 0 auto;
  }

  .oss-category-body,
  .oss-category-panel {
    overflow-wrap: anywhere;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) td,
  .login-log-table td:has(> .ip-cell),
  .error-log-table .login-log-msg,
  .error-log-table .error-log-code,
  .error-log-table .error-log-device,
  .error-log-table .error-log-api {
    width: 100%;
    min-width: 0;
    max-width: none;
    overflow: visible;
  }

  .error-log-table .log-cell-clip {
    white-space: normal;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) td::before {
    overflow-wrap: normal;
    word-break: keep-all;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) .ip-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    width: 100%;
    min-width: 0;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) .ip-cell > .mono,
  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) .ip-loc {
    width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .account-note-cell,
  .cloud-files-path-cell {
    max-width: none;
  }

  .account-note,
  .cloud-files-path-cell {
    white-space: normal;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }

  .oss-picker-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
  }

  .oss-crumb {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 6px 4px;
  }

  .permissions-modal-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .permissions-modal-tabs::-webkit-scrollbar {
    display: none;
  }

  .permissions-modal-tab {
    flex: 0 0 auto;
    min-height: 40px;
  }
}

@media (max-width: 480px) {
  .page-content {
    padding: 12px;
    gap: 16px;
  }

  .card {
    padding: 14px;
  }

  .clients-page-tabs,
  .accounts-page-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .clients-page-tabs .page-tab,
  .accounts-page-tabs .page-tab {
    width: 100%;
    min-width: 0;
    padding: 9px 8px;
    white-space: normal;
  }

  .admin-modal-backdrop {
    align-items: flex-end;
    padding: max(12px, env(safe-area-inset-top)) 0 0;
  }

  .admin-modal,
  .api-key-result-modal,
  .permissions-modal {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - max(12px, env(safe-area-inset-top)));
    border-radius: 18px 18px 0 0;
    overflow: hidden;
  }

  .admin-modal-body,
  .permissions-modal-body {
    min-width: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .admin-modal-actions,
  .permissions-modal-footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-modal-actions .btn,
  .permissions-modal-footer .btn {
    width: 100%;
  }

  .oss-picker {
    align-items: flex-end;
    padding: max(12px, env(safe-area-inset-top)) 0 0;
  }

  .oss-picker-dialog {
    width: 100%;
    max-height: calc(100dvh - max(12px, env(safe-area-inset-top)));
    border-radius: 18px 18px 0 0;
  }

  .oss-table {
    min-width: 0;
  }
}

@media (max-width: 360px) {
  .topbar {
    padding-left: 12px;
    padding-right: 12px;
  }

  .login-page {
    padding: 12px;
  }

  .login-card {
    padding: 20px;
  }

  .table-wrap:not(.keep-table-mobile) table:not(.oss-table) td {
    grid-template-columns: minmax(68px, 32%) minmax(0, 1fr);
    gap: 8px;
  }
}

/* Personal boot guide configuration */
.my-guides-card .section-head {
  align-items: flex-start;
}

.my-guides-card .section-head .section-hint {
  margin: 0.35rem 0 0;
}

.my-guides-form-grid {
  grid-template-columns: minmax(180px, 0.8fr) minmax(280px, 1.5fr) minmax(180px, 0.7fr);
}

.my-guides-public-field {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
}

.my-guides-public-control {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.my-guides-public-control input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

.my-guides-public-field small {
  color: var(--muted);
  line-height: 1.4;
}

.my-guide-item {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.my-guide-item .my-files-drag {
  cursor: grab;
}

.my-guide-item.is-dragging .my-files-drag {
  cursor: grabbing;
}

.my-files-badge.is-guide-public {
  color: #047857;
  background: rgba(16, 185, 129, 0.13);
}

.my-files-badge.is-guide-private {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.12);
}

@media (max-width: 899px) {
  .my-guides-form-grid {
    grid-template-columns: 1fr;
  }

  .my-guide-item {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .my-guide-item .my-files-item-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}


/* Collapsible Oplus-only boot guide fields */
.oss-boot-oplus-fields {
  margin-top: 8px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.035);
}

.oss-boot-oplus-fields summary {
  padding: 7px 9px;
  color: #315f9b;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.oss-boot-oplus-fields[open] summary {
  border-bottom: 1px solid rgba(37, 99, 235, 0.12);
}

.oss-boot-oplus-fields-grid {
  display: grid;
  gap: 8px;
  padding: 9px;
}

.oss-boot-oplus-fields-grid label {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.76rem;
}

.oss-boot-oplus-fields-grid input {
  min-width: 0;
  margin: 0;
}
