*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { background: #1a1a1a; color: #ddd; font-family: 'IBM Plex Mono', monospace; font-size: 14px; }
main { max-width: 860px; margin: 0 auto; padding: 24px 16px 60px; }
header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
h1 { font-size: 20px; font-weight: 600; color: #fff; }
h1::before { content: "✏️ "; }

button {
  font-family: inherit; font-size: 13px; padding: 9px 14px; border-radius: 7px; cursor: pointer;
  border: 1px solid #e85d2f; background: #e85d2f; color: #fff;
}
button:hover { filter: brightness(1.1); }
button.ghost { background: transparent; border-color: #444; color: #aaa; }
button.small { padding: 5px 10px; font-size: 12px; }
button.danger { background: transparent; border-color: #5a2a1c; color: #ff8a65; }
input {
  font-family: inherit; font-size: 14px; padding: 9px 12px; border-radius: 7px;
  border: 1px solid #3a3a3a; background: #111; color: #fff; min-width: 0;
}
input:focus { outline: 2px solid #e85d2f; outline-offset: 0; }

#login-form { display: flex; flex-direction: column; gap: 10px; max-width: 320px; }
.msg { color: #ff8a65; min-height: 1.2em; font-size: 13px; }

#new-room { display: flex; gap: 8px; margin-bottom: 20px; }
#new-room input { flex: 1; }

.room { background: #222; border: 1px solid #2e2e2e; border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.room-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.room-name { font-weight: 600; color: #fff; font-size: 15px; }
.room-sub { color: #777; font-size: 12px; margin-top: 4px; }
.badge { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 99px; margin-left: 6px; vertical-align: 1px; }
.badge.dirty { background: rgba(234,179,8,.15); color: #eab308; }
.room-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.link-row { display: flex; gap: 6px; margin-top: 10px; }
.link-row input { flex: 1; font-size: 12px; color: #aaa; }
details { margin-top: 10px; }
summary { cursor: pointer; color: #aaa; font-size: 12px; }
.arch { list-style: none; margin-top: 6px; }
.arch a { display: flex; justify-content: space-between; padding: 6px 8px; border-radius: 6px; color: #ddd; text-decoration: none; font-size: 12px; }
.arch a:hover { background: #2a2a2a; }
.empty { color: #666; font-size: 13px; }

#toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(60px);
  background: #111; color: #fff; padding: 9px 18px; border-radius: 8px; font-size: 12px;
  border: 1px solid #333; opacity: 0; transition: all .3s; pointer-events: none; white-space: nowrap;
}
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

@media (max-width: 520px) {
  #new-room { flex-direction: column; }
}
