:root {
  --accent: #3b4ca8; --accent-light: #eef0fa; --accent-dark: #2d3a85;
  --dark: #1f2437; --gray: #6b7280; --border: #e2e5f0;
  --danger: #b91c1c; --ok: #047857;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  background: #f4f5fa; color: var(--dark); font-size: 14px; line-height: 1.6;
}
.topbar { background: var(--dark); color: #fff; padding: 10px 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 16px; }
.logo .beta { color: #9daaf0; font-size: 11px; vertical-align: super; }
.spacer { flex: 1; }
.topinfo { font-size: 12px; color: #cbd2f5; }

.btn { border: none; border-radius: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer; font-family: inherit; font-weight: 600; transition: opacity .15s; }
.btn:hover { opacity: .85; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: #cbd2f5; border: 1px solid #4a5578; }
.btn-light { background: #fff; color: var(--accent); border: 1px solid var(--border); }
.btn-danger { background: #fdeaea; color: var(--danger); border: 1px solid #f5c6c6; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn.wide { width: 100%; padding: 11px; font-size: 14px; }
.btn.link { background: none; color: var(--accent); font-weight: 500; text-decoration: underline; padding: 8px 0; display: block; margin: 6px auto 0; }

.layout { display: flex; gap: 16px; padding: 16px; max-width: 1400px; margin: 0 auto; align-items: flex-start; }
.app-pane { flex: 1.2; min-width: 340px; max-width: 720px; margin: 0 auto; }
.server-pane { flex: 1; min-width: 300px; position: sticky; top: 16px; }
@media (max-width: 900px) { .layout { flex-direction: column; } .server-pane { position: static; width: 100%; } }

.card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 22px; margin-bottom: 16px; }
.card h2 { font-size: 16px; margin-bottom: 12px; }
.auth-card { max-width: 460px; margin: 40px auto; }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; background: var(--accent-light); border-radius: 10px; padding: 4px; }
.tab { flex: 1; border: none; background: transparent; padding: 9px; border-radius: 8px; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--gray); cursor: pointer; }
.tab.active { background: #fff; color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.hint { font-size: 12px; color: var(--gray); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--gray); margin-bottom: 4px; }
input, textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 14px; font-family: inherit; background: #fafbff; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; min-height: 110px; }
.searchbox { margin-bottom: 12px; }

.strength { height: 6px; background: var(--border); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.strength div { height: 100%; width: 0; border-radius: 3px; background: var(--danger); transition: width .2s, background .2s; }

.banner { border-radius: 10px; padding: 10px 14px; font-size: 12.5px; margin-bottom: 14px; }
.banner.info { background: var(--accent-light); color: var(--accent-dark); }
.banner.ok { background: #e7f6ef; color: var(--ok); }

.recovery-box { background: var(--accent-light); border: 1px dashed var(--accent); border-radius: 10px; padding: 14px; text-align: center; margin: 10px 0; }
.recovery-box code { font-size: 17px; font-weight: 700; letter-spacing: 1px; color: var(--accent-dark); word-break: break-all; }

.note-item { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; cursor: pointer; transition: border-color .15s; }
.note-item:hover { border-color: var(--accent); }
.note-item.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-light); }
.note-item h3 { font-size: 14px; margin-bottom: 2px; }
.note-item p { font-size: 12px; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-item .meta { font-size: 11px; color: #9aa1b5; margin-top: 4px; }
.note-item .lockmark { color: var(--ok); font-size: 11px; }

.server-card { background: #171b2b; color: #cdd3ea; border-radius: 14px; padding: 18px; }
.server-card h2 { color: #fff; font-size: 15px; margin-bottom: 4px; }
.server-card .sub { font-size: 11.5px; color: #8b93b8; margin-bottom: 12px; }
.server-json { background: #0d101c; border-radius: 10px; padding: 12px; font-family: "SF Mono", Menlo, monospace; font-size: 10.5px; line-height: 1.5; max-height: 480px; overflow: auto; white-space: pre-wrap; word-break: break-all; color: #7ee0a3; }
.server-json .k { color: #8ab8ff; }
.server-stat { display: flex; gap: 14px; margin-top: 10px; font-size: 11.5px; color: #8b93b8; flex-wrap: wrap; }
.server-stat b { color: #fff; }

.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 38px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.12); z-index: 50; min-width: 240px; overflow: hidden; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: none; padding: 11px 16px; font-family: inherit; font-size: 13px; cursor: pointer; color: var(--dark); }
.menu button:hover { background: var(--accent-light); }
.menu button.danger { color: var(--danger); }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.secret-row { display: flex; gap: 8px; align-items: center; }
.secret-row input { flex: 1; }
.hidden { display: none !important; }
.msg { font-size: 12.5px; margin-top: 8px; min-height: 18px; }
.msg.err { color: var(--danger); } .msg.ok { color: var(--ok); }
.footer-note { text-align: center; font-size: 11.5px; color: #9aa1b5; padding: 10px 16px 30px; }
.footer-note a { color: #6b7280; }
