/* Shared theme. Colours from xl-vps. */
:root {
  --bg: #0f1115;
  --panel: #161a22;
  --panel-2: #1d2230;
  --border: #2a3142;
  --text: #e6e8ee;
  --muted: #8b94a7;
  --accent: #7c9cff;
  --accent-2: #4d6dff;
  --ok: #58c97a;
  --warn: #f3b454;
  --err: #ef6b6b;
  --add-bg: rgba(88, 201, 122, 0.14);
  --add-strong: rgba(88, 201, 122, 0.38);
  --del-bg: rgba(239, 107, 107, 0.14);
  --del-strong: rgba(239, 107, 107, 0.38);
  --cell-hover: #232b3d;
  --cell-edit: #1f2a44;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); }
.muted { color: var(--muted); }
.error { color: var(--err); }
[hidden] { display: none !important; }

header {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
header h1 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: 0.4px; }
header h1 a { color: var(--text); text-decoration: none; }
header h1 span { color: var(--accent); }
.tool-title { color: var(--muted); font-size: 14px; }
.tool-title:not(:empty)::before { content: "/ "; }
.spacer { flex: 1; }

button, .btn, select, input[type="text"], input[type="search"], input[type="number"] {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font: inherit;
  font-size: 13px;
}
button, .btn { cursor: pointer; transition: background 0.15s, border-color 0.15s; white-space: nowrap; }
button:hover, .btn:hover { background: var(--cell-hover); border-color: #3a4358; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary, .btn.primary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--accent); border-color: var(--accent); }
button.active { border-color: var(--accent); color: var(--accent); }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -1px; }
label.check { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); cursor: pointer; }

textarea, .code {
  font: 13px/1.5 var(--mono);
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  resize: none;
  tab-size: 2;
}

main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tool { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.toolbar .group { display: inline-flex; gap: 0; }
.toolbar .group > * { border-radius: 0; margin-left: -1px; }
.toolbar .group > :first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.toolbar .group > :last-child { border-radius: 0 6px 6px 0; }
.toolbar .status { font-size: 12px; color: var(--muted); }
.empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: var(--muted); padding: 24px; text-align: center;
}

.landing { padding: 32px 24px; max-width: 1100px; margin: 0 auto; width: 100%; overflow: auto; }
.hero { text-align: center; padding: 28px 16px 36px; border: 2px dashed var(--border); border-radius: 12px; margin-bottom: 24px; }
.hero h2 { margin: 0 0 8px; font-size: 22px; }
.hero p { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.card {
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}
.card:hover { border-color: var(--accent-2); background: var(--panel-2); }
.card strong { font-size: 15px; }
.card .muted { font-size: 13px; }
.badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--warn); border: 1px solid var(--warn); border-radius: 4px; padding: 0 4px;
}
.notice {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 16px; background: #2a2414; color: var(--warn); border-bottom: 1px solid #4a3d1a;
}

#drop-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 17, 21, 0.85);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
#drop-overlay div {
  padding: 40px 60px; border: 2px dashed var(--accent); border-radius: 16px;
  font-size: 20px; color: var(--accent);
}
#toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px);
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 16px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  max-width: calc(100vw - 32px); z-index: 200;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { border-color: var(--err); color: var(--err); }

@media (max-width: 640px) {
  header { padding: 8px 12px; }
  .toolbar { padding: 8px 12px; }
  .landing { padding: 16px 12px; }
  .hero { padding: 20px 12px 24px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}

