:root {
  --bg: #131825;
  --card-bg: #212936;
  --fg: #c1c4c1;
  --muted: #6c757d;
  --accent: #5ec269;
  --accent-hover: #4b9b54;
  --accent-focus-border: #afe1b4;
  --accent-focus-shadow: rgba(94, 194, 105, 0.25);
  --border: #dee2e6;
  --border-dark: #2e3a4e;
  --error: #dc3545;
  --error-bg: rgba(220, 53, 69, 0.1);
  --notice: #5ec269;
  --notice-bg: rgba(94, 194, 105, 0.1);
  --input-bg: #131825;
  --link: #5ec269;
  --link-hover: #4b9b54;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
               "Noto Sans", "Liberation Sans", Arial, sans-serif,
               "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.card {
  background: var(--card-bg);
  border-radius: 0.5rem;
  padding: 2rem 2.25rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.card-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.logo svg {
  width: 72px;
  height: auto;
}

h1 {
  font-size: 1.4rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.25rem;
}

.subtitle {
  font-size: 0.875rem;
  color: var(--muted);
}

.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.875rem;
  color: var(--fg);
  margin-bottom: 0.375rem;
}

input[type="email"],
input[type="text"] {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  color: var(--fg);
  background: var(--input-bg);
  border: 1px solid var(--border-dark);
  border-radius: 0.375rem;
  outline: none;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  -webkit-appearance: none;
  appearance: none;
}

input[type="email"]::placeholder,
input[type="text"]::placeholder {
  color: var(--muted);
  opacity: 1;
}

input[type="email"]:focus,
input[type="text"]:focus {
  border-color: var(--accent-focus-border);
  box-shadow: 0 0 0 0.2rem var(--accent-focus-shadow);
}

input[type="email"]:disabled,
input[type="text"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out, opacity 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.link-btn {
  background: none;
  color: var(--link);
  border: none;
  padding: 0;
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}

.link-btn:hover:not(:disabled) {
  color: var(--link-hover);
  text-decoration: underline;
}

.link-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.divider {
  border: none;
  border-top: 1px solid var(--border-dark);
  margin: 1.25rem 0;
}

.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 0.75rem; }

.inline-msg {
  margin-top: 0.5rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  border-radius: 0.375rem;
  border: 1px solid transparent;
}
.inline-msg.error {
  background: var(--error-bg);
  border-color: var(--error);
  color: #f87171;
}
.inline-msg.notice {
  background: var(--notice-bg);
  border-color: var(--accent);
  color: var(--accent);
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: auto;
  padding: 0.3rem 0.65rem;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.tool-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-dark);
  border-radius: 0.5rem;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
}

.tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.tool-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

.tool-notes {
  font-size: 0.8125rem;
  color: var(--fg);
  opacity: 0.82;
  margin: 0.35rem 0 0.5rem;
  white-space: pre-wrap;
}

.tool-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.tool-meta-label {
  display: inline-block;
  min-width: 3.25rem;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  margin-right: 0.5rem;
}

.tool-sha {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tool-sha code {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-dark);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  color: #d7dce0;
  word-break: break-all;
  flex: 1 1 auto;
  min-width: 0;
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--border-dark);
  color: var(--muted);
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.7rem;
  cursor: pointer;
}
.copy-btn:hover { color: var(--fg); border-color: rgba(255,255,255,0.2); }

.tool-expires {
  font-size: 0.75rem;
  color: var(--muted);
}
.tool-expires.soon { color: #f0ad4e; }

.tool-size {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-left: 0.5rem;
  white-space: nowrap;
}

.tools-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  padding: 1.25rem 0.5rem;
  border: 1px dashed var(--border-dark);
  border-radius: 0.5rem;
}

.session-info {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.session-info > span { color: var(--fg); }

.btn.is-starting {
  pointer-events: none;
  opacity: 0.75;
}

