/* All the Mods 10 - To the Sky :: dark green glass theme */

:root {
  --green-100: #d6fbe8;
  --green-300: #6ee7b7;
  --green-400: #34d399;
  --green-500: #10b981;
  --green-600: #059669;

  --bg-0: #03100c;
  --bg-1: #061a13;

  --text: #e4f4ec;
  --muted: #8ba79b;
  --accent: var(--green-400);
  --ok: var(--green-400);
  --warn: #f2c14e;
  --err: #ff7a7a;

  --glass: linear-gradient(158deg, rgba(255, 255, 255, .068), rgba(255, 255, 255, .022));
  --glass-strong: linear-gradient(158deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .035));
  --glass-border: rgba(180, 255, 222, .14);
  --glass-border-soft: rgba(180, 255, 222, .08);
  --blur: blur(18px) saturate(150%);
  --shadow: 0 10px 34px rgba(0, 0, 0, .46), inset 0 1px 0 rgba(255, 255, 255, .07);
  --shadow-soft: 0 4px 18px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .05);
  --glow: 0 0 0 1px rgba(52, 211, 153, .35), 0 0 22px rgba(16, 185, 129, .22);

  --ink: rgba(3, 14, 10, .55);
  --ink-deep: rgba(2, 10, 7, .72);

  --radius: 14px;
  --radius-sm: 10px;

  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --editor-size: 12.5px;
  --editor-line: 1.6;
  --editor-pad: 12px;
}

* { box-sizing: border-box; }
/* "display: flex" of the views is stronger than the browser rule for [hidden] */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-color: var(--bg-0);
  background-image:
    radial-gradient(1100px 720px at 12% -10%, rgba(16, 185, 129, .22), transparent 62%),
    radial-gradient(900px 620px at 108% 6%, rgba(5, 150, 105, .18), transparent 58%),
    radial-gradient(1000px 620px at 50% 104%, rgba(52, 211, 153, .13), transparent 62%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 50%, var(--bg-0) 100%);
  background-attachment: fixed;
}

::selection { background: rgba(52, 211, 153, .28); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(110, 231, 183, .16);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(110, 231, 183, .3); background-clip: content-box; }

/* ------------------------------------------------------------- structure -- */

header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(6, 26, 19, .82), rgba(6, 26, 19, .55));
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-border-soft);
}
header h1 {
  font-size: 16px;
  margin: 0;
  font-weight: 650;
  letter-spacing: -.01em;
  background: linear-gradient(96deg, var(--green-100), var(--green-300));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h2 { font-size: 15px; margin: 0 0 2px; font-weight: 650; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 12px; }
.spacer { flex: 1 1 auto; }

main {
  padding: 18px 20px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ----------------------------------------------------------------- tabs -- */

nav.tabs {
  position: sticky;
  top: 62px;
  z-index: 19;
  display: flex;
  gap: 4px;
  padding: 8px 20px;
  background: rgba(4, 18, 13, .55);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-border-soft);
}
nav.tabs button {
  position: relative;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 8px 15px;
  cursor: pointer;
  border-radius: 99px;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
nav.tabs button:hover { color: var(--text); background: rgba(255, 255, 255, .045); }
nav.tabs button[aria-selected="true"] {
  color: #04150f;
  background: linear-gradient(140deg, var(--green-300), var(--green-500));
  border-color: rgba(214, 251, 232, .32);
  box-shadow: 0 4px 16px rgba(16, 185, 129, .3);
}

/* --------------------------------------------------------------- badges -- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 99px;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px rgba(139, 167, 155, .16); }
.state-running .dot { background: var(--green-400); box-shadow: 0 0 0 3px rgba(52, 211, 153, .2), 0 0 12px var(--green-400); }
.state-starting .dot, .state-stopping .dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(242, 193, 78, .18); animation: pulse 1.2s infinite; }
.state-stopped .dot { background: var(--err); box-shadow: 0 0 0 3px rgba(255, 122, 122, .16); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* -------------------------------------------------------------- buttons -- */

button {
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .12s ease;
}
button:hover:not(:disabled) {
  background: var(--glass-strong);
  border-color: rgba(110, 231, 183, .4);
  box-shadow: var(--shadow-soft), 0 0 18px rgba(16, 185, 129, .16);
}
button:active:not(:disabled) { transform: translateY(1px); }
button:focus-visible { outline: none; box-shadow: var(--glow); }
button:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }

button.primary {
  color: #04150f;
  background: linear-gradient(140deg, var(--green-300), var(--green-500));
  border-color: rgba(214, 251, 232, .3);
  box-shadow: 0 6px 20px rgba(16, 185, 129, .32), inset 0 1px 0 rgba(255, 255, 255, .28);
}
button.primary:hover:not(:disabled) {
  background: linear-gradient(140deg, #8af0c4, var(--green-400));
  box-shadow: 0 8px 26px rgba(16, 185, 129, .42), inset 0 1px 0 rgba(255, 255, 255, .3);
}
button.danger {
  color: #ffe3e3;
  background: linear-gradient(150deg, rgba(220, 80, 80, .34), rgba(150, 40, 40, .26));
  border-color: rgba(255, 138, 138, .3);
}
button.danger:hover:not(:disabled) {
  background: linear-gradient(150deg, rgba(235, 95, 95, .46), rgba(170, 48, 48, .34));
  border-color: rgba(255, 138, 138, .5);
  box-shadow: var(--shadow-soft), 0 0 18px rgba(220, 80, 80, .22);
}
button.small { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
button.link { background: none; border: none; box-shadow: none; color: var(--green-300); padding: 4px 6px; }

/* Links that should look like a button (the download in the editor head) */
a.small {
  display: inline-flex;
  align-items: center;
  font: inherit;
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
  color: var(--text);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 6px 11px;
  box-shadow: var(--shadow-soft);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
a.small:hover {
  background: var(--glass-strong);
  border-color: rgba(110, 231, 183, .4);
  box-shadow: var(--shadow-soft), 0 0 18px rgba(16, 185, 129, .16);
}

/* --------------------------------------------------------------- inputs -- */

input[type="text"], input[type="password"], input[type="number"], select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--ink);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  min-width: 0;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input::placeholder { color: rgba(139, 167, 155, .7); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(110, 231, 183, .55);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .16);
  background: var(--ink-deep);
}
input:disabled, select:disabled { opacity: .5; cursor: not-allowed; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--green-300) 50%), linear-gradient(135deg, var(--green-300) 50%, transparent 50%);
  background-position: calc(100% - 17px) calc(50% + 1px), calc(100% - 12px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}
select option { background: #062017; color: var(--text); }

label.check { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; cursor: pointer; }

/* Drawn by hand instead of accent-color, so the boxes belong to the glass look
   instead of being whatever the operating system paints */
input[type="checkbox"], input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 0;
  position: relative;
  border: 1px solid var(--glass-border);
  border-radius: 5px;
  background: rgba(255, 255, 255, .035);
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:hover, input[type="radio"]:hover {
  border-color: rgba(110, 231, 183, .5);
  background: rgba(16, 185, 129, .12);
}
input[type="checkbox"]:checked, input[type="radio"]:checked {
  background: var(--green-500);
  border-color: var(--green-400);
}
/* The tick: two borders of a rotated box */
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #04261b;
  border-width: 0 2px 2px 0;
  transform: rotate(43deg);
}
input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #04261b;
}
input[type="checkbox"]:indeterminate {
  background: rgba(16, 185, 129, .45);
  border-color: var(--green-400);
}
input[type="checkbox"]:indeterminate::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 7px;
  height: 2px;
  border-radius: 1px;
  background: #04261b;
}
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .3);
}
input[type="checkbox"]:disabled, input[type="radio"]:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ---------------------------------------------------------------- cards -- */

.card {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; color: var(--green-300); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.field .note { font-size: 11px; color: var(--muted); font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
form.stack { display: flex; flex-direction: column; gap: 14px; }
/* Buttons at the end of a form keep their own width instead of filling a grid cell */
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 9px; }

.notice { font-size: 12px; color: var(--muted); min-height: 18px; }
.notice.error { color: var(--err); }
.notice.ok { color: var(--green-400); }
.hint { font-size: 12px; color: var(--muted); }
.hint strong { color: var(--warn); font-weight: 600; }

/* --------------------------------------------------------------- modals -- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: rgba(2, 10, 7, .68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-box {
  width: 100%;
  max-width: 460px;
  max-height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 20px 22px;
  background: linear-gradient(158deg, rgba(14, 42, 32, .97), rgba(8, 26, 20, .97));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}
/* The editor gets nearly the whole window, that is the point of moving it here */
.modal-box.modal-wide {
  max-width: 1500px;
  width: 95vw;
  height: 92vh;
  padding: 16px 18px;
}
.modal-box.modal-wide .editor-panel { flex: 1 1 auto; min-height: 0; }
.modal-box.modal-wide .editor { flex: 1 1 auto; min-height: 0; }
.modal-box.modal-wide .logview { flex: 1 1 auto; min-height: 0; }
#btn-editor-close { font-size: 17px; line-height: 1; padding: 4px 11px; }
#ask-error:empty { display: none; }
@media (max-width: 760px) {
  .modal { padding: 12px; }
  .modal-box.modal-wide { width: 100%; height: 96vh; }
}

/* ---------------------------------------------------------------- audit -- */

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--green-300);
}
.live .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-400);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .live .dot { animation: none; } }

.audit-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin: 2px 0 12px;
}
.audit-filters input[type="search"] { flex: 1 1 240px; min-width: 0; }
.audit-filters select { flex: 0 0 auto; width: auto; min-width: 150px; }
.audit-filters .sub { margin-left: auto; white-space: nowrap; }

table.audit td { vertical-align: top; }
table.audit td.when {
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
table.audit td.who { white-space: nowrap; font-weight: 500; }
table.audit .words { color: var(--text); }
.audit-row { border-left: 2px solid transparent; }
.audit-row.tone-ok { border-left-color: rgba(16, 185, 129, .55); }
.audit-row.tone-warn { border-left-color: var(--warn); }
.audit-row.tone-warn td.who, .audit-row.tone-warn .words { color: #f6dda2; }
.audit-row.tone-danger { border-left-color: var(--err); }
.audit-row.tone-danger td.who, .audit-row.tone-danger .words { color: #f3b0b0; }

/* The group an action belongs to */
.kind {
  display: inline-block;
  margin-right: 9px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .07);
  color: var(--muted);
}
.kind.k-server { background: rgba(16, 185, 129, .16); color: var(--green-300); }
.kind.k-login, .kind.k-logout { background: rgba(125, 211, 252, .15); color: #9fd8f5; }
.kind.k-user, .kind.k-totp { background: rgba(167, 139, 250, .16); color: #c4b5fd; }
.kind.k-file { background: rgba(240, 182, 127, .16); color: #f0c79b; }
.kind.k-backup, .kind.k-restart { background: rgba(94, 234, 212, .14); color: #7fdbcb; }
.kind.k-sftp, .kind.k-link { background: rgba(190, 190, 255, .13); color: #b9bdf0; }

/* ------------------------------------------------- steam and discord login -- */

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.or::before, .or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--glass-border-soft);
}

.provider-buttons { display: flex; flex-direction: column; gap: 9px; }
.provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 16px;
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .14s ease, border-color .14s ease, transform .14s ease;
}
.provider:hover { background: rgba(255, 255, 255, .08); transform: translateY(-1px); }
.provider svg { opacity: .95; }
/* The two marks are real SVG (see icons.js): a CSS mask cropped the shape */
.provider.steam { border-color: rgba(102, 192, 244, .45); color: #9bd4f5; }
.provider.steam:hover { border-color: rgba(102, 192, 244, .8); }
.provider.discord { border-color: rgba(88, 101, 242, .5); color: #aab2f7; }
.provider.discord:hover { border-color: rgba(88, 101, 242, .85); }

/* One connected account on the account page */
.link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .03);
}
.link-row .who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.link-row .who strong { font-size: 13px; font-weight: 600; }
.link-row .who .sub { font-size: 11px; color: var(--muted); word-break: break-all; }
.link-row .spacer { flex: 1; }

/* A secret that is shown exactly once, so it should be hard to overlook */
.secret {
  margin: 0 0 13px;
  padding: 13px 15px;
  border: 1px solid rgba(242, 193, 78, .4);
  border-radius: var(--radius-sm);
  background: rgba(242, 193, 78, .08);
}
.secret label { color: var(--warn); }
.secret .filename { font-size: 15px; letter-spacing: .04em; color: #f6dda2; }

.card h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--green-300);
}

/* ---------------------------------------------------------------- table -- */

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--glass-border-soft); }
th { color: var(--green-300); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: rgba(255, 255, 255, .03); }
tbody tr:last-child td { border-bottom: none; }
td.actions { text-align: right; white-space: nowrap; }

/* -------------------------------------------------------------- console -- */

#console {
  background: var(--ink-deep);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 0 60px rgba(16, 185, 129, .05);
  padding: 12px 14px;
  height: 62vh;
  min-height: 260px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: var(--editor-size);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
#console div { padding: 0 2px; border-radius: 3px; }
.l-warn { color: var(--warn); }
.l-err { color: var(--err); }
.l-sup { color: var(--green-300); font-weight: 600; }

.cmdrow { display: flex; gap: 8px; }
.cmdrow input { flex: 1 1 auto; font-family: var(--font-mono); font-size: 13px; }

/* ---------------------------------------------------------------- files -- */

/* The browser has the page to itself, the editor opens over it in a modal */
.files-layout { display: block; }
.browser {
  width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.browser-head {
  padding: 10px;
  border-bottom: 1px solid var(--glass-border-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.browser-head button.small { padding: 6px 8px; letter-spacing: -.01em; }
.crumbs {
  padding: 9px 12px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--glass-border-soft);
  word-break: break-all;
}
.crumbs a { color: var(--green-300); text-decoration: none; cursor: pointer; }
.crumbs a:hover { text-decoration: underline; }
.entries {
  flex: 1 1 auto;
  overflow-y: auto;
  height: 62vh;
  padding: 7px 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.entry {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  padding: 0 6px 0 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  transition: background .13s ease, border-color .13s ease;
}
.entry:hover { background: rgba(255, 255, 255, .045); border-color: var(--glass-border-soft); }
.entry.active {
  background: linear-gradient(120deg, rgba(16, 185, 129, .22), rgba(16, 185, 129, .07));
  border-color: rgba(110, 231, 183, .34);
}
.entry-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 2px;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  text-align: left;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}
.entry-main:hover { background: none; border-color: transparent; box-shadow: none; }
/* The global button rule brings a backdrop-filter. Clearing only the background
   leaves that blur behind, which is what painted the odd frosted pill on every
   row. It has to be switched off explicitly. */
.entry-main, .entry .act {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.entry .icon {
  flex: 0 0 auto;
  width: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.entry.dir .icon { color: var(--green-400); }
.entry.dir .name { font-weight: 500; }
.entry .name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry .size {
  flex: 0 0 auto;
  width: 92px;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  padding-left: 10px;
}
.entry .modified {
  flex: 0 0 auto;
  width: 150px;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-left: 14px;
}
/* Every row keeps the same three buttons, so nothing jumps around and a
   folder is exactly as wide as a file */
.entry .actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 3px;
  padding-left: 12px;
}
.entry.disabled .entry-main { opacity: .42; }
.entry .act {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  opacity: .42;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  border-radius: 7px;
  text-decoration: none;
  line-height: 1;
  transition: color .14s ease, background .14s ease, opacity .14s ease;
}
.entry:hover .act, .entry:focus-within .act { opacity: 1; }
.entry .act:focus-visible { opacity: 1; outline: none; box-shadow: var(--glow); }
.entry .act:hover { color: var(--green-300); background: rgba(16, 185, 129, .18); border-color: transparent; box-shadow: none; }
.entry .act.remove:hover { color: var(--err); background: rgba(220, 80, 80, .18); }
.browser-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-top: 1px solid var(--glass-border-soft);
  min-height: 38px;
}
.dropzone {
  outline: 2px dashed var(--green-400);
  outline-offset: -5px;
  background: rgba(16, 185, 129, .07);
}

/* Multiple selection in the file list */
.select-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--glass-border-soft);
  background: rgba(255, 255, 255, .025);
}
.select-bar.active { background: linear-gradient(120deg, rgba(16, 185, 129, .18), rgba(16, 185, 129, .06)); }
.select-bar #select-count { color: var(--muted); font-size: 12px; }
.select-bar.active #select-count { color: var(--green-300); font-weight: 600; }
.entry .pick { margin: 0; }
.entry.picked { background: linear-gradient(120deg, rgba(16, 185, 129, .14), rgba(16, 185, 129, .04)); }
.entry.picked.active { background: linear-gradient(120deg, rgba(16, 185, 129, .26), rgba(16, 185, 129, .1)); }

.editor-panel { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.editor-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filename { font-family: var(--font-mono); font-size: 13px; word-break: break-all; color: var(--green-100); }
.filename .dirty { color: var(--warn); }

/* Toolbar above the editor and above the log view */
.editor-toolbar, .log-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
}
.log-toolbar input[type="text"] { flex: 1 1 180px; max-width: 320px; font-size: 12px; padding: 6px 10px; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, .04);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted);
}
.chip.level-error { color: var(--err); border-color: rgba(255, 122, 122, .35); background: rgba(255, 122, 122, .1); }
.chip.level-warn { color: var(--warn); border-color: rgba(242, 193, 78, .35); background: rgba(242, 193, 78, .1); }

.segmented { display: inline-flex; border-radius: 8px; overflow: hidden; border: 1px solid var(--glass-border); }
.segmented button {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--muted);
}
.segmented button + button { border-left: 1px solid var(--glass-border); }
.segmented button[aria-pressed="true"] {
  color: #04150f;
  background: linear-gradient(140deg, var(--green-300), var(--green-500));
}
.segmented button:hover:not([aria-pressed="true"]) { color: var(--text); background: rgba(255, 255, 255, .05); }

/* Read only view for logs, with the level of every line */
.logview {
  height: 62vh;
  min-height: 260px;
  overflow: auto;
  background: var(--ink-deep);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: var(--editor-size);
  line-height: var(--editor-line);
}
.logview .row { display: flex; gap: 10px; padding: 0 12px; white-space: pre-wrap; word-break: break-word; }
.logview .row:hover { background: rgba(255, 255, 255, .04); }
.logview .no { flex: 0 0 auto; min-width: 54px; text-align: right; color: rgba(139, 167, 155, .5); user-select: none; }
.logview .txt { flex: 1 1 auto; }
.logview .row.error { background: rgba(255, 122, 122, .1); box-shadow: inset 3px 0 0 var(--err); }
.logview .row.error .txt { color: #ffb3b3; }
.logview .row.warn { background: rgba(242, 193, 78, .08); box-shadow: inset 3px 0 0 var(--warn); }
.logview .row.warn .txt { color: #f6dda2; }
.logview .row.trace .txt { color: #c98d8d; }
.logview .row.found { outline: 1px solid var(--green-400); outline-offset: -1px; }
.logview .empty { padding: 14px; color: var(--muted); }

/* SFTP card */
.sftp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.sftp-item { display: flex; flex-direction: column; gap: 4px; }
.sftp-item .label { font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: var(--green-300); font-weight: 700; }
.sftp-item .value {
  font-family: var(--font-mono);
  font-size: 13px;
  word-break: break-all;
  background: var(--ink);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 7px 10px;
}
.sftp-item .value.wide { grid-column: 1 / -1; }

.editor {
  display: flex;
  height: 62vh;
  min-height: 260px;
  background: var(--ink-deep);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.gutter {
  flex: 0 0 auto;
  padding: var(--editor-pad) 9px var(--editor-pad) 12px;
  background: rgba(2, 10, 7, .55);
  border-right: 1px solid var(--glass-border-soft);
  color: rgba(139, 167, 155, .55);
  text-align: right;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: var(--editor-size);
  line-height: var(--editor-line);
  white-space: pre;
  user-select: none;
}
.editor-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
.editor-wrap > pre, .editor-wrap > textarea {
  margin: 0;
  padding: var(--editor-pad);
  font-family: var(--font-mono);
  font-size: var(--editor-size);
  line-height: var(--editor-line);
  white-space: pre;
  word-wrap: normal;
  tab-size: 4;
  -moz-tab-size: 4;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.editor-wrap > pre { position: absolute; inset: 0; overflow: hidden; pointer-events: none; color: var(--text); }
.editor-wrap > textarea {
  position: absolute; inset: 0; width: 100%; height: 100%;
  overflow: auto; resize: none; color: transparent; caret-color: var(--green-300);
}
.editor-wrap > textarea:focus { outline: none; box-shadow: none; background: transparent; }
.editor-wrap > textarea::selection { background: rgba(52, 211, 153, .3); color: transparent; }
.editor.plain > pre { display: none; }
.editor.plain > .editor-wrap > textarea { color: var(--text); }
/* Wrapping long lines, switched on in the toolbar */
.editor.wrap > pre, .editor.wrap > .editor-wrap > textarea {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.editor.wrap > .gutter { display: none; }

.t-c { color: #5d7d70; font-style: italic; }
.t-k { color: #6ee7b7; }
.t-s { color: #b9e88a; }
.t-n { color: #f0b67f; }
.t-b { color: #7dd3fc; }
.t-p { color: #7b9a8c; }
.t-h { color: var(--warn); font-weight: 600; }
.t-e { color: var(--err); font-weight: 700; }
.t-w { color: var(--warn); font-weight: 700; }

/* ------------------------------------------------- login and installer -- */

.centered {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
}
.sheet { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 16px; }
/* The two fields of the login form need room to breathe */
#password-fields { display: flex; flex-direction: column; gap: 18px; margin-bottom: 20px; }
#code-field { margin-bottom: 20px; }
.sheet form.card { gap: 0; }
.sheet form.card .notice { margin-top: 10px; }
.sheet.wide { max-width: 760px; }
.brand { text-align: center; }
.brand h1 {
  font-size: 22px;
  margin: 0;
  font-weight: 700;
  letter-spacing: -.02em;
  background: linear-gradient(96deg, var(--green-100), var(--green-300) 55%, var(--green-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand .sub { margin-top: 6px; }
.steps { gap: 18px; }
.step-title {
  font-size: 11px;
  color: var(--green-300);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px;
}
.radios { display: flex; flex-wrap: wrap; gap: 9px; }
.radios label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 9px 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass);
  font-size: 13px;
  transition: border-color .16s ease, background .16s ease;
}
.radios label:hover { border-color: rgba(110, 231, 183, .4); background: var(--glass-strong); }
.radios label:has(input:checked) {
  border-color: rgba(110, 231, 183, .6);
  background: linear-gradient(140deg, rgba(16, 185, 129, .22), rgba(16, 185, 129, .08));
  box-shadow: 0 0 18px rgba(16, 185, 129, .16);
}
.radios label.disabled { opacity: .4; cursor: not-allowed; }
.divider { border: none; border-top: 1px solid var(--glass-border-soft); margin: 2px 0; }

/* The QR code for the authenticator app. It keeps a white quiet zone, because
   scanners need the light border and a dark theme would swallow it. */
.totp-layout { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.qr {
  flex: 0 0 auto;
  background: #fff;
  padding: 12px;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .4);
  line-height: 0;
}
.qr svg { display: block; width: 196px; height: 196px; image-rendering: pixelated; }

/* ------------------------------------------------------------- account ---- */

.avatar-box { flex: 0 0 auto; position: relative; width: 112px; height: 112px; }
.avatar-box img, .avatar-fallback {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(110, 231, 183, .35);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .4);
}
.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #04150f;
  background: linear-gradient(140deg, var(--green-300), var(--green-600));
}
.avatar-box img:not([hidden]) + .avatar-fallback { display: none; }

/* The small round picture in the header and in the user table */
.avatar-small {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(110, 231, 183, .3);
  vertical-align: middle;
  margin-right: 7px;
}
.badge .avatar-small { width: 20px; height: 20px; margin: -2px 0 -2px -4px; }

/* ----------------------------------------------------------- responsive -- */

@media (max-width: 860px) {
  /* Without a mouse there is no hover, so the actions stay visible */
  .entry .act { opacity: 1; }
  .files-layout { flex-direction: column; }
  .browser { flex: 1 1 auto; }
  .entries { height: 28vh; }
  .editor { height: 46vh; }
  .grid2 { grid-template-columns: 1fr; }
  nav.tabs { top: 0; position: static; }
}
@media (max-width: 640px) {
  header { padding: 12px 14px; }
  nav.tabs { padding: 8px 12px; }
  main { padding: 14px 12px 20px; }
  .toolbar button { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
