/* ====================================================================
   PrivateHub – Eagle Theme
   Inspiriert vom 3D-Shop Design: Eagle-Blau, Glass, Pill-Buttons, Glow.
   ==================================================================== */

:root {
  color-scheme: dark;

  /* Eagle-Akzent */
  --eagle: 12 140 231;            /* RGB-Triplet für rgb()/rgba() */
  --eagle-400: #36a7f6;
  --eagle-500: #0c8ce7;
  --eagle-600: #006fc5;
  --eagle-300: #b9dffd;

  /* Surfaces */
  --bg: #121316;                  /* dark-950 */
  --bg-2: #1e1f23;                /* dark-900 */
  --bg-3: #2a2c30;                /* dark-800 */

  /* Glass */
  --glass: rgba(255, 255, 255, 0.05);
  --glass-strong: rgba(255, 255, 255, 0.10);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* Text */
  --text: #ffffff;
  --text-muted: #9fa2a9;
  --text-subtle: #6b6f78;

  /* Status */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Effekte */
  --glow: 0 0 40px -8px rgb(var(--eagle) / 0.6);
  --shadow-card: 0 12px 40px -12px rgba(0, 0, 0, 0.55);
  --shadow-modal: 0 32px 80px -16px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,255,255,0.04);
  --ring: 0 0 0 1px rgb(var(--eagle) / 0.5), 0 0 0 4px rgb(var(--eagle) / 0.15);

  /* Radien */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  /* Fonts */
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11', 'cv09';
}

/* Subtiler Eagle-Glow oben (radial) */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 600px;
  background: radial-gradient(
    ellipse 80% 60% at 50% 0%,
    rgba(12, 140, 231, 0.12),
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

a { color: var(--eagle-400); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--eagle-300); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 8px;
}
h1 { font-size: 28px; letter-spacing: -0.035em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

p { margin: 0 0 12px; }

code, pre {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

::selection { background: rgb(var(--eagle) / 0.3); color: var(--text); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.error { color: var(--danger); }

[hidden] { display: none !important; }

/* ====================================================================
   Topbar
   ==================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: rgba(18, 19, 22, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand svg { color: var(--eagle-400); }

#nav-right { display: flex; align-items: center; gap: 10px; }

/* ====================================================================
   Layout
   ==================================================================== */
.container {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 32px auto;
  padding: 0 32px;
}
.container.narrow { max-width: 460px; margin-top: 80px; }

.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.spread { justify-content: space-between; }
/* Im "spread"-Layout: Buttons im letzten Container nebeneinander halten */
.row.spread > div:last-child {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.row.spread > div:first-child { min-width: 0; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 13px;
}
.back-link:hover { color: var(--text); }

/* ====================================================================
   Cards
   ==================================================================== */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

/* ====================================================================
   Forms / Inputs
   ==================================================================== */
form label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
form label input[type=checkbox] {
  margin-right: 6px;
  vertical-align: middle;
}

input[type=text],
input[type=password],
input[type=date],
input[type=email],
input[type=number],
input[type=file],
textarea,
select {
  display: block;
  width: 100%;
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  margin-top: 6px;
  font-size: 14px;
  font-family: inherit;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input::placeholder, textarea::placeholder {
  color: var(--text-subtle);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgb(var(--eagle) / 0.5);
  box-shadow: var(--ring);
  background: rgba(255, 255, 255, 0.07);
}
input.invalid, textarea.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
  animation: shake 0.3s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

textarea {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
  min-height: 120px;
}

/* File-Input native ausblenden, wenn nicht in Dropzone (Fallback-Style) */
.tab-panel input[type=file]:not(.dropzone input) {
  background: var(--glass);
  border: 1px dashed var(--border-strong);
  padding: 14px;
  border-radius: var(--radius);
  cursor: pointer;
}

/* ====================================================================
   Buttons
   ==================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 22px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active { transform: scale(0.97); }

.btn.small {
  height: 32px;
  padding: 0 14px;
  font-size: 12.5px;
}

/* Primary: white pill -> blue + glow on hover */
.btn-primary {
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) {
  background: var(--eagle-400);
  color: var(--text);
  box-shadow: var(--glow);
}

/* Secondary / Ghost: glass */
.btn-ghost,
.btn-secondary {
  background: var(--glass);
  color: var(--text);
  border-color: var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.btn-ghost:hover:not(:disabled),
.btn-secondary:hover:not(:disabled) {
  background: var(--glass-strong);
  border-color: var(--border-strong);
}

/* Danger: red, etwas weniger pillig (rounded) */
.btn-danger {
  background: rgba(239, 68, 68, 0.95);
  color: var(--text);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  box-shadow: 0 0 32px -8px rgba(239, 68, 68, 0.6);
}

/* ====================================================================
   Key-Form (Landing)
   ==================================================================== */
.key-form { display: flex; gap: 8px; margin-top: 14px; }
.key-form input {
  flex: 1;
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 14px;
}

/* ====================================================================
   Project Grid
   ==================================================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.project-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(var(--eagle) / 0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.project-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.project-card:hover::before { opacity: 1; }
.project-card h3 {
  font-size: 16px;
  margin: 0 0 6px;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
.project-card .meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 14px;
  margin-top: 16px;
}

/* ====================================================================
   Tabs
   ==================================================================== */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 24px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.tab.active {
  color: var(--text);
  border-bottom-color: var(--eagle-500);
}
.tab:hover { color: var(--text); }

.tab-panel { animation: fadeIn 0.2s ease; }
.vtab-panel { animation: fadeIn 0.2s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ====================================================================
   Filebrowser (Tree + Preview)
   ==================================================================== */
.filebrowser {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-height: 540px;
  overflow: hidden;
}
.tree {
  border-right: 1px solid var(--border);
  padding: 12px 8px;
  overflow-y: auto;
  max-height: 75vh;
  font-size: 13px;
}
.tree ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tree > ul { padding-left: 0; }
.tree ul ul {
  padding-left: 12px;
  margin-left: 8px;
  border-left: 1px solid var(--border);
}
.tree li {
  position: relative;
  user-select: none;
  white-space: nowrap;
}
.tree li > .label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  transition: background 0.1s;
}
.tree li > .label:hover { background: var(--glass); }
.tree li.selected > .label {
  background: rgb(var(--eagle) / 0.15);
  color: var(--text);
}
.tree li.dir > .label::before {
  content: '';
  width: 0; height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  flex-shrink: 0;
  opacity: 0.6;
  transition: transform 0.12s;
}
.tree li.dir.open > .label::before { transform: rotate(90deg) translateX(1px); }
.tree li.file > .label { padding-left: 22px; }
.tree li ul { display: none; }
.tree li.dir.open > ul { display: block; }

.preview {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 75vh;
}
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  font-size: 12.5px;
}
.preview pre {
  margin: 0;
  padding: 18px;
  overflow: auto;
  background: var(--bg);
  flex: 1;
}
.preview pre code { background: transparent; padding: 0; }
.preview #vw-file-render {
  padding: 24px 32px;
  overflow: auto;
  flex: 1;
}
.preview #vw-file-render h1,
.preview #vw-file-render h2 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.preview #vw-file-render code {
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12.5px;
}
.preview #vw-file-render pre {
  background: var(--bg);
  padding: 14px;
  border-radius: var(--radius-sm);
}
.preview #vw-file-render img { max-width: 100%; border-radius: var(--radius-sm); }
.preview #vw-file-render table { border-collapse: collapse; }
.preview #vw-file-render th, .preview #vw-file-render td {
  border: 1px solid var(--border);
  padding: 8px 12px;
}
.preview #vw-file-render a { color: var(--eagle-400); }

/* ====================================================================
   Tables
   ==================================================================== */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.data-table tbody tr { transition: background 0.1s; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }

/* ====================================================================
   Key-Display (nach Erzeugung)
   ==================================================================== */
.key-display {
  margin-top: 18px;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 14px;
  word-break: break-all;
  position: relative;
}
.key-display .key-text {
  color: var(--success);
  font-weight: 700;
  letter-spacing: 1.5px;
}
.key-display .copy-btn { position: absolute; top: 10px; right: 10px; }
.key-display .hint {
  display: block;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  margin-top: 10px;
}

/* ====================================================================
   Badges
   ==================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
}
.badge.ok { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge.bad { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* ====================================================================
   Upload-Tab
   ==================================================================== */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 8px;
}
.upload-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
}
.upload-card-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.upload-card-head h3 { margin: 0 0 4px; font-size: 16px; }
.upload-card-head p { margin: 0; line-height: 1.5; }

.upload-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 700;
  background: var(--glass);
  color: var(--text);
  user-select: none;
}
.upload-icon.primary {
  background: rgb(var(--eagle) / 0.15);
  color: var(--eagle-400);
}
.upload-icon.danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.dropzone-form { display: flex; flex-direction: column; gap: 14px; }

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 22px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  min-height: 140px;
}
.dropzone:hover {
  border-color: rgb(var(--eagle) / 0.5);
  background: rgb(var(--eagle) / 0.04);
}
.dropzone.is-dragover {
  border-color: var(--eagle-500);
  border-style: solid;
  background: rgb(var(--eagle) / 0.10);
  box-shadow: var(--glow);
}
.dropzone.has-file {
  border-color: rgba(34, 197, 94, 0.5);
  border-style: solid;
  background: rgba(34, 197, 94, 0.06);
}
.dropzone input[type=file] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  padding: 0;
  border: none;
}
.dz-icon { font-size: 28px; line-height: 1; opacity: 0.85; }
.dz-text { font-size: 14px; font-weight: 500; }
.dz-filename {
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.dz-filename:empty { display: none; }

.field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.field-label { font-size: 13px; color: var(--text-muted); }
.field input { margin-top: 0; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  margin: 0;
  user-select: none;
  width: fit-content;
}
.toggle input[type=checkbox] {
  width: 16px; height: 16px;
  margin: 0;
  accent-color: var(--eagle-500);
  cursor: pointer;
}
.toggle:hover { color: var(--text); }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

@media (min-width: 900px) {
  .upload-grid { grid-template-columns: 1fr 1fr; }
  .upload-card:last-child { grid-column: 1 / -1; }
}

/* ====================================================================
   Changelog
   ==================================================================== */
#changelog-list,
#vw-changelog-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.changelog-entry {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  position: relative;
}
.changelog-entry .ce-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}
.changelog-entry .ce-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.changelog-entry .ce-title.untitled {
  color: var(--text-muted);
  font-weight: 500;
  font-style: italic;
}
.changelog-entry .ce-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.changelog-entry .ce-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.changelog-entry .ce-body {
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
}
.changelog-entry .ce-body p:first-child { margin-top: 0; }
.changelog-entry .ce-body p:last-child { margin-bottom: 0; }
.changelog-entry .ce-body code {
  background: var(--bg-3);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 12.5px;
}
.changelog-entry .ce-body pre {
  background: var(--bg);
  padding: 12px 16px;
  border-radius: var(--radius);
  overflow-x: auto;
}
.changelog-entry .ce-body ul,
.changelog-entry .ce-body ol { padding-left: 22px; }
.changelog-entry .ce-body a { color: var(--eagle-400); }
.changelog-entry .ce-body blockquote {
  border-left: 3px solid var(--border-strong);
  padding-left: 14px;
  color: var(--text-muted);
  margin: 10px 0;
}

#vw-changelog-list .changelog-entry .ce-actions { display: none; }

.ce-version {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ce-version.deleted {
  border-style: dashed;
  opacity: 0.7;
}
.version-tag {
  display: inline-block;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  background: rgb(var(--eagle) / 0.15);
  color: var(--eagle-400);
  border-radius: var(--radius-pill);
}
.ce-version.deleted .version-tag {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}
.ce-version-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.empty-hint {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

/* ====================================================================
   Modal
   ==================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: modalFadeIn 0.18s ease-out;
}
.modal-backdrop.closing { animation: modalFadeOut 0.18s ease-out forwards; }
@keyframes modalFadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes modalFadeOut { from { opacity: 1 } to { opacity: 0 } }

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  box-shadow: var(--shadow-modal);
  animation: modalSlideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-tone {
  width: 44px; height: 44px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
  background: var(--glass);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-tone-success { background: rgba(34, 197, 94, 0.15); }
.modal-tone-error { background: rgba(239, 68, 68, 0.15); }

.modal-title {
  font-size: 19px;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--text);
}
.modal-message {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 20px;
}

.modal-form { display: flex; flex-direction: column; gap: 14px; }
.modal-field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.modal-field-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.modal-field input,
.modal-field textarea { margin-top: 0; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}

/* ====================================================================
   Toast
   ==================================================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 18px 12px 16px;
  box-shadow: var(--shadow-card);
  pointer-events: auto;
  min-width: 240px;
  max-width: 380px;
  font-size: 13.5px;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.hide { transform: translateX(120%); opacity: 0; }
.toast-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.toast-success .toast-dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.toast-error .toast-dot { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.toast-info .toast-dot { background: var(--eagle-500); box-shadow: 0 0 8px var(--eagle-500); }
.toast-msg { flex: 1; line-height: 1.4; }

/* ====================================================================
   Mobile
   ==================================================================== */
@media (max-width: 720px) {
  .topbar { padding: 12px 18px; }
  .container { padding: 0 18px; margin: 20px auto; }
  .filebrowser { grid-template-columns: 1fr; }
  .tree {
    max-height: 35vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .modal-card { padding: 24px; }
  .toast-container { top: 12px; right: 12px; left: 12px; }
  .toast { min-width: 0; max-width: none; }
}

/* ====================================================================
   Reduced Motion
   ==================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
