:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  --breakpoint-lg: 1200px;
  --breakpoint-md: 800px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #0f172a;
  color: #e2e8f0;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid #334155;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

a {
  color: #93c5fd;
}

.subtle,
small {
  color: #94a3b8;
}

.actions,
.browser-toolbar,
.button-row,
.section-title-row,
.row-actions,
.node-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 2fr) repeat(3, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.panel {
  background: #1e293b;
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

.explorer-panel {
  grid-row: span 3;
}

.panel-header {
  border-bottom: 1px solid #334155;
  padding-bottom: 0.75rem;
}

.panel-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: #94a3b8;
  font-size: 0.95rem;
}

.tree {
  overflow: auto;
  min-height: 320px;
}

.browser-toolbar {
  margin-top: 0.75rem;
}

.tree .node {
  border-left: 1px solid #64748b;
  margin-left: 0.5rem;
  padding-left: 0.5rem;
  margin-top: 0.4rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.node-label {
  font-weight: 600;
}

.tree .children {
  margin-left: 1rem;
  flex-basis: 100%;
}

button,
input,
textarea,
select {
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #475569;
  border-radius: 0.4rem;
  padding: 0.5rem 0.65rem;
  width: 100%;
}

button {
  width: auto;
  cursor: pointer;
}

button.danger {
  border-color: #dc2626;
  color: #fecaca;
}

.card-form {
  padding: 0.9rem;
  border: 1px solid #334155;
  border-radius: 0.75rem;
}

.stacked {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.data-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.data-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #334155;
  border-radius: 0.6rem;
  background: rgba(15, 23, 42, 0.5);
}

.clickable-card {
  cursor: pointer;
}

.clickable-card:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.data-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.palace-path {
  word-break: break-all;
}

.status {
  min-height: 1.5rem;
}

.success {
  color: #86efac;
}

.error {
  color: #fca5a5;
}

.notice {
  border: 1px solid #f59e0b;
  background: rgba(120, 53, 15, 0.35);
  color: #fde68a;
  border-radius: 0.75rem;
  padding: 0.75rem;
}

.command-output {
  margin: 0;
  padding: 0.75rem;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.75);
  min-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.hidden {
  display: none;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.card {
  width: min(420px, 92vw);
  background: #1e293b;
  padding: 1.2rem;
  border-radius: 0.5rem;
}

.card form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

@media (max-width: var(--breakpoint-lg)) {
  .layout {
    grid-template-columns: 1fr 1fr;
  }

  .explorer-panel {
    grid-row: auto;
    grid-column: span 2;
  }
}

@media (max-width: var(--breakpoint-md)) {
  header,
  .data-item {
    flex-direction: column;
  }

  .layout {
    display: flex;
    flex-direction: column;
  }
}
