:root {
  --bg: #1a1a1a;
  --panel: #1e1e1e;
  --card: #242424;
  --text: #e0e0e0;
  --muted: #888;
  --blue: #4ea6ff;
  --accent: #2d3a55;
  --accent-hover: #3d4a65;
  --border: #333;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
               "Malgun Gothic", sans-serif;
  min-height: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-left { display: flex; align-items: baseline; gap: 14px; }
.topbar-left h1 { font-size: 20px; font-weight: 700; margin: 0; }
.back-link {
  color: var(--blue);
  text-decoration: none;
  font-size: 13px;
}
.back-link:hover { text-decoration: underline; }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.me {
  font-size: 12px;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
}
#logout-btn {
  background: var(--accent);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
#logout-btn:hover { background: var(--accent-hover); }

.content {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.menu-item:hover {
  background: var(--accent);
  border-color: var(--blue);
}

.menu-icon {
  font-size: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border-radius: 8px;
  flex-shrink: 0;
}

.menu-body { flex: 1; min-width: 0; }
.menu-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.menu-sub { font-size: 13px; color: var(--muted); }

.menu-arrow {
  font-size: 24px;
  color: var(--muted);
  font-weight: 300;
}

.force-banner {
  background: rgba(247, 163, 80, 0.18);
  border: 1px solid #f7a350;
  color: #ffe2c0;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 18px;
  text-align: center;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px 24px;
  margin-bottom: 18px;
}
.card h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: var(--text);
}

.pw-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pw-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pw-form label > span {
  font-size: 13px;
  color: var(--muted);
}
.pw-form input[type="password"],
.pw-form input[type="text"] {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 9px 40px 9px 12px;   /* room for the toggle button on the right */
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}
.pw-form input:focus {
  outline: none;
  border-color: var(--blue);
}

.pw-input-wrap {
  position: relative;
  display: block;
}
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
}
.pw-toggle:hover {
  background: var(--accent);
  border-color: var(--border);
}
.pw-toggle.on {
  color: var(--blue);
}
.pw-form .hint {
  font-size: 11px;
  color: var(--muted);
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}
#submit-btn {
  background: var(--accent);
  color: var(--text);
  border: 1px solid var(--blue);
  padding: 9px 22px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
#submit-btn:hover { background: var(--accent-hover); }
#submit-btn:disabled { opacity: 0.5; cursor: wait; }
.form-msg { font-size: 13px; }
.form-msg.ok  { color: var(--blue); }
.form-msg.err { color: #ff8080; }
