:root {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  color: #0f172a;
  background: #0f172a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1e293b, #0f172a);
  color: inherit;
}

.page {
  /* width: min(1200px, 96vw);
  margin: 0 auto;
  padding: 2rem 0; */
  width: auto;
  margin: 0 auto;
  padding: 2rem 4rem;
}

.card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2rem;
  color: #e2e8f0;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.4);
}

label {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  gap: 0.25rem;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.75rem;
  background: rgb(142 152 175 / 80%);
  color: #f8fafc;
}

button {
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #0f172a;
  font-weight: 600;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.danger {
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff;
}

.hint {
  font-size: 0.9rem;
  color: #94a3b8;
}

.hidden {
  display: none;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #e2e8f0;
  margin-bottom: 1.5rem;
}

.toolbar-actions {
  display: flex;
  gap: 0.5rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 1rem;
}

.panel {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1rem;
  color: #e2e8f0;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

li button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: inherit;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

li button.file {
  border-color: rgba(59, 130, 246, 0.4);
}

li button.directory {
  border-color: rgba(16, 185, 129, 0.4);
}

textarea {
  flex: 1;
  resize: none;
  margin-top: 0.75rem;
  background: rgba(2, 6, 23, 0.9);
  border-radius: 12px;
}

.preview {
  margin-top: auto;
  text-align: center;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.preview img {
  max-width: 100%;
  border-radius: 12px;
  margin-top: 0.5rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.5rem;
}

.mini-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.mini-form input[type='text'],
.mini-form input[type='file'] {
  flex: 1;
}

.mini-form button {
  white-space: nowrap;
}

#status {
  min-height: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

#status.error {
  color: #fca5a5;
}

#status.success {
  color: #4ade80;
}

#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: auto;
}

.toast.visible {
  transform: translateX(0);
  opacity: 1;
}

.toast-success {
  border-color: rgba(74, 222, 128, 0.5);
}

.toast-error {
  border-color: rgba(248, 113, 113, 0.6);
}

@media (max-width: 992px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: auto;
  }
}

#rog-editor {
  margin-top: 2rem;
}

.rog-toolbar h2 {
  margin: 0;
}

.rog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.rog-panel {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stack-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.6);
}

.stack-item h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.stack-item textarea {
  min-height: 120px;
}

.stack-item .actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.stack-item .inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem;
}

.stack-item small {
  color: #94a3b8;
}

