/* client/style.css */
#server-bar {
  flex: none;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -8px 0 10px;
  padding: 0 8px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 13px;
  z-index: 510;
}
#server-bar button,
#server-drawer button,
dialog button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--card);
  color: var(--ink);
  padding: 7px 11px;
}
#server-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 38vw;
}
#server-status {
  margin-left: auto;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}
#server-drawer {
  position: fixed;
  top: 63px;
  left: 30px;
  bottom: 28px;
  width: 330px;
  z-index: 505;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 12px 40px #0004;
  overflow: hidden;
}
#server-drawer[hidden] {
  display: none;
}
.server-drawer-head {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--calc);
  border-bottom: 1px solid var(--rule);
}
#server-drawer nav {
  padding: 6px;
  border-bottom: 1px solid var(--rule);
}
#server-drawer nav button {
  display: block;
  text-align: left;
  width: 100%;
  border: 0;
  border-radius: 3px;
}
#server-drawer button:hover {
  background: var(--calc);
}
#server-drawer button:disabled {
  opacity: .4;
  cursor: default;
}
.server-search {
  font-size: 11px;
  color: var(--muted);
  padding: 12px;
  display: grid;
  gap: 6px;
}
.server-search input,
dialog input {
  font: inherit;
  padding: 9px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  width: 100%;
}
#server-list {
  overflow: auto;
  flex: 1;
  padding: 0 6px 10px;
}
#server-list .server-project {
  display: grid;
  gap: 5px;
  text-align: left;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--rule-hair);
  border-radius: 0;
  padding: 12px 8px;
}
.server-project strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.server-project span {
  font-size: 11px;
  color: var(--muted);
}
.server-project.selected {
  background: var(--calc) !important;
  box-shadow: inset 3px 0 var(--amber);
}
.server-online {
  color: #4a9f7b !important;
}
.server-empty {
  padding: 12px;
  color: var(--muted);
  line-height: 1.6;
}
#server-welcome {
  position: fixed;
  inset: 64px 0 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px 40px 30px 370px;
  text-align: center;
  color: var(--muted);
}
#server-welcome h1 {
  color: var(--ink);
  font-size: 28px;
}
#server-welcome p {
  max-width: 520px;
  line-height: 1.6;
}
body.server-mode:not(.server-active) > .sheet,
body.server-mode:not(.server-active) > .proj-tab,
body.server-mode:not(.server-active) > .lib-tab,
body.server-mode:not(.server-active) > aside:not(#server-drawer) {
  visibility: hidden;
}
body.server-active #server-welcome {
  display: none;
}
#server-message {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 610;
  max-width: 80vw;
  padding: 8px 14px;
  background: var(--card);
  border-radius: 4px;
  box-shadow: 0 2px 10px #0003;
  font-size: 12px;
}
#server-message:empty {
  display: none;
}
.error,
#server-login-error {
  color: #d46b61 !important;
}
#server-people {
  display: flex;
  gap: 5px;
}
.server-person {
  border-left: 3px solid var(--peer);
  padding: 2px 6px;
  font-size: 11px;
  background: var(--calc);
}
#server-cursors {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
  overflow: hidden;
}
.server-cursor {
  position: absolute;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 2px var(--card);
  white-space: nowrap;
}
.server-field {
  position: absolute;
  border: 2px solid;
  border-radius: 3px;
}
dialog {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 26px;
  background: var(--card);
  color: var(--ink);
  width: min(420px, 90vw);
  box-shadow: 0 20px 70px #0006;
  font-family: var(--f-sans);
}
dialog::backdrop {
  background: #101a24b8;
}
dialog h2 {
  margin: 0 0 12px;
}
dialog label {
  display: grid;
  gap: 7px;
  margin: 16px 0;
  font-size: 13px;
}
dialog label[hidden] {
  display: none;
}
dialog p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.server-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
dialog button[type=submit] {
  background: #1f3b4d;
  color: white;
  border-color: #1f3b4d;
}
@media (max-width: 750px) {
  #server-bar {
    gap: 7px;
  }
  #server-title {
    max-width: 25vw;
    font-size: 11px;
  }
  #server-status {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #server-people {
    display: none;
  }
  #server-drawer {
    left: 10px;
    width: min(330px, calc(100vw - 20px));
  }
  #server-welcome {
    padding: 30px;
  }
  #server-signout {
    max-width: 100px;
    overflow: hidden;
    white-space: nowrap;
  }
}
@media print {
  #server-bar,
  #server-drawer,
  #server-welcome,
  #server-message,
  #server-cursors,
  dialog {
    display: none !important;
  }
}
