/* The sign-in page and the editor, on top of wiki.css. */

button.primary, .signin button {
  height: 34px;
  padding: 0 16px;
  border: 1px solid #36c;
  border-radius: 2px;
  background: #36c;
  color: #fff;
  font: 600 14px var(--sans);
  cursor: pointer;
}
button.primary:hover, .signin button:hover { background: #447ff5; }
button.primary:disabled { opacity: 0.5; cursor: default; }
.tools button, button.danger {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #a2a9b1;
  border-radius: 2px;
  background: var(--panel);
  color: var(--text);
  font: 13px var(--sans);
  cursor: pointer;
}
.tools button:hover { background: #fff; border-color: #72777d; }
button.danger { color: var(--stub); }
button.danger:hover:not(:disabled) { border-color: var(--stub); background: #fff; }
button.danger:disabled { opacity: 0.45; cursor: default; }

/* ------------------------------------------------------------------------------------------------- sign in */

.signin-page { display: grid; place-items: start center; padding: 10vh 16px; }
.signin {
  width: min(400px, 100%);
  padding: 22px 26px 26px;
  background: #fff;
  border: 1px solid var(--line);
}
.signin .logo { margin-bottom: 14px; }
.signin h1 { margin: 0 0 4px; font: 400 28px var(--serif); }
.signin .hint { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.signin label { display: block; margin: 0 0 12px; font-weight: 600; font-size: 14px; }
.signin input {
  display: block;
  width: 100%;
  height: 36px;
  margin-top: 4px;
  padding: 0 10px;
  border: 1px solid #a2a9b1;
  border-radius: 2px;
  font: 15px var(--sans);
}
.signin input:focus { outline: none; border-color: var(--link); box-shadow: inset 0 0 0 1px var(--link); }
.signin button { width: 100%; height: 38px; margin-top: 6px; }
.problem { margin: 0 0 14px; padding: 8px 10px; background: #fee7e6; border: 1px solid #d33; color: #b32424; font-size: 14px; }

/* -------------------------------------------------------------------------------------------------- editor */

body.editing .where { color: var(--muted); font-size: 13px; }
body.editing .where code { font: 13px var(--mono); }
.epage { padding: 14px 20px 20px; }
.econtent { padding: 16px 20px 18px; min-height: 0; }
.econtent > .title { margin-bottom: 12px; }
.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom: 0;
  font-size: 13px;
}
.tools .label { margin-right: 4px; color: var(--muted); }
.tools .help { margin-left: auto; }

.panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: calc(100vh - 290px); min-height: 420px; border: 1px solid var(--line); }
.source { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
#text {
  flex: 1;
  width: 100%;
  min-height: 0;
  padding: 12px 14px 40px;
  border: 0;
  resize: none;
  color: var(--text);
  background: #fff;
  font: 14px/1.6 var(--mono);
  tab-size: 2;
}
#text:focus { outline: none; box-shadow: inset 0 0 0 2px #a3c4ee; }
.problems { max-height: 34%; overflow: auto; margin: 0; padding: 0; list-style: none; border-top: 1px solid #d33; background: #fee7e6; font-size: 13px; }
.problems button { display: block; width: 100%; padding: 5px 12px; border: 0; border-bottom: 1px solid #f5c2c0; background: none; text-align: left; color: #b32424; font: inherit; cursor: pointer; }
.problems button:hover { background: #fdd; }
.problems button span { color: var(--muted); margin-right: 8px; }

.preview { overflow: auto; padding: 10px 18px 30px; }
.plabel { margin: 0 0 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.preview .title { font-size: 28px; margin-bottom: 14px; }

.savebar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; font-size: 14px; }
.summary { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 260px; max-width: 560px; font-weight: 600; }
.summary input { flex: 1; height: 34px; padding: 0 10px; border: 1px solid #a2a9b1; border-radius: 2px; font: 14px var(--sans); }
.summary input:focus { outline: none; border-color: var(--link); box-shadow: inset 0 0 0 1px var(--link); }
.status { color: var(--muted); }
.status.warn { color: #ac6600; }
.status.bad { color: var(--stub); }
.status.ok { color: #14866d; }
#delete { margin-left: auto; }

.picker { position: fixed; inset: 0; z-index: 30; display: grid; place-items: start center; padding-top: 12vh; background: rgba(32, 33, 34, 0.3); }
.pick-box {
  width: min(560px, calc(100vw - 32px));
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  padding: 14px;
  background: #fff;
  border: 1px solid #a2a9b1;
  border-radius: 2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.pick-box.wide { width: min(720px, calc(100vw - 32px)); }
.ptitle { margin: 0 0 8px; font-weight: 600; }
.pick-box input { height: 34px; padding: 0 10px; border: 1px solid #a2a9b1; border-radius: 2px; font: 15px var(--sans); }
.pick-box input:focus { outline: none; border-color: var(--link); box-shadow: inset 0 0 0 1px var(--link); }
.pick-box ul { flex: 1; overflow: auto; margin: 8px 0 0; padding: 0; list-style: none; }
.pick-box li button {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 5px 8px;
  border: 0;
  border-bottom: 1px solid var(--soft-line);
  background: none;
  text-align: left;
  font: 14px var(--sans);
  color: var(--text);
  cursor: pointer;
}
.pick-box li button:hover, .pick-box li button[aria-selected="true"] { background: #eaf3ff; }
.pick-box li img, .pick-box .noicon { width: 28px; height: 28px; }
.pick-box .num { color: var(--muted); }
.pick-box code { font: 12px var(--mono); color: var(--muted); }
#hist-list button { grid-template-columns: 1fr auto; }
#hist-list .when { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.pick-box .none { padding: 10px 8px; color: var(--muted); }
.pick-foot { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.pick-foot kbd { font: 11px var(--mono); padding: 0 4px; border: 1px solid var(--line); border-radius: 2px; margin: 0 2px; }

@media (max-width: 900px) {
  .epage { padding: 10px 0 0; }
  .panes { grid-template-columns: minmax(0, 1fr); height: auto; }
  .source { border-right: 0; border-bottom: 1px solid var(--line); }
  #text { min-height: 55vh; }
  .preview { max-height: none; }
}
