:root {
  color: #18211f;
  background: #f4f6f3;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; padding: 24px; }
main { width: min(1080px, 100%); margin: 0 auto; }
body:has(#connect:not([hidden])) { min-height: 100dvh; display: grid; place-items: center; }
body:has(#connect:not([hidden])) main { width: min(540px, 100%); }
body:has(#connect:not([hidden])) header { justify-content: center; }
header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
h1 { margin: 0; font-size: 26px; overflow-wrap: anywhere; }
h2 { margin: 0 0 16px; font-size: 18px; }
.panel { border: 1px solid #d6ddd6; border-radius: 8px; background: #fff; padding: 20px; margin-bottom: 18px; }
#connect { display: grid; gap: 12px; max-width: 540px; margin-bottom: 0; }
input, textarea { width: 100%; min-width: 0; border: 1px solid #a6b3a8; border-radius: 6px; padding: 10px 12px; font: inherit; }
textarea { display: block; min-height: 340px; resize: vertical; font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; line-height: 1.55; margin-bottom: 12px; }
button { border: 0; border-radius: 6px; background: #1f6f68; color: #fff; padding: 10px 14px; font: inherit; cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid #1f6f68; outline-offset: 3px; }
#status {
  position: fixed; z-index: 1000; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); width: max-content; max-width: min(560px, calc(100% - 32px));
  margin: 0; padding: 12px 20px; border-radius: 8px; background: #1f6f68; color: #fff;
  box-shadow: 0 6px 24px #18211f33; overflow-wrap: anywhere; pointer-events: none;
}
#status[data-error="true"] { background: #a32323; }
.links { display: grid; gap: 12px; }
.link-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
@media (max-width: 600px) {
  body { padding: 14px; }
  .panel { padding: 16px; }
  .link-row { grid-template-columns: minmax(0, 1fr) auto; }
  .link-row label { grid-column: 1 / -1; }
}
