/* What sits over a screen: the side drawer, the large editor, the small dialog, the account menu and the toast. Tokens only. */

.scrim { position: absolute; inset: 0; z-index: 40; background: color-mix(in srgb, var(--navy) 42%, transparent); animation: fade-in .15s ease; }

.drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  width: 600px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--card);
  box-shadow: var(--shadow-drawer);
  animation: slide-in .2s cubic-bezier(.2, .7, .3, 1);
}

.editor {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 41;
  width: 900px;
  max-width: calc(100% - 28px);
  max-height: 90%;
  display: flex;
  flex-direction: column;
  border-radius: 5px;
  background: var(--card);
  box-shadow: var(--shadow-modal);
  transform: translate(-50%, -50%);
  animation: pop-in .16s ease;
}

/* Head, body and foot of a drawer or an editor. */
.dh { display: flex; align-items: flex-start; gap: 12px; padding: 15px 18px; flex-shrink: 0; border-bottom: 1px solid var(--rule); }
.dh__title { flex: 1; min-width: 0; }
.db { flex: 1; padding: 18px; overflow-y: auto; }
.df { display: flex; align-items: center; gap: 8px; padding: 13px 18px; flex-shrink: 0; border-top: 1px solid var(--rule); background: var(--footer); }
.df__spacer { flex: 1; }

/* The small dialog: change password and confirmations. */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: color-mix(in srgb, var(--navy) 55%, transparent);
}
.modal {
  width: min(470px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 24px;
  border-radius: 5px;
  background: var(--card);
  box-shadow: var(--shadow-dialog);
  font-size: 14px;
}
.modal h2 { margin: 0 0 7px; font-size: 21px; }
.modal__text { margin: 0 0 18px; font-size: 13px; line-height: 1.55; color: var(--muted); }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal__actions .btn { height: 38px; padding: 0 14px; border-radius: 5px; font-weight: 700; }

/* A form in a dialog, such as adding a journey: the editor's head, body and foot, at the size of a single form. */
.modal-editor {
  width: min(640px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 5px;
  background: var(--card);
  box-shadow: var(--shadow-modal);
  font-size: 14px;
  color: var(--text);
  animation: fade-in .16s ease;
}
.modal-editor__title { margin-top: 3px; font-size: 17px; }
.modal-editor__sub { margin-top: 2px; font-size: 12px; color: var(--muted); }

/* The account menu under the name in the top bar. */
.menu {
  position: absolute;
  top: 42px;
  right: 0;
  z-index: 45;
  width: 250px;
  max-height: calc(100vh - 60px);
  padding: 5px;
  overflow: hidden auto;
  border-radius: 5px;
  background: var(--card);
  box-shadow: var(--shadow-menu);
  color: var(--text);
}
.menu[hidden] { display: none; }
.menu__who { margin-bottom: 4px; padding: 9px 11px; border-bottom: 1px solid var(--rule); }
.menu__who strong { display: block; font-size: 13px; }
.menu__who span { font-size: 11.5px; color: var(--muted); }
.menu__workspace { padding: 8px 11px 4px; }
.menu__cap { display: block; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.menu__value { display: block; font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.menu__group { margin: 5px 0 0; padding-top: 5px; border-top: 1px solid var(--rule); }
.mb3 .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border-radius: 5px; font-size: 13px; text-align: left; color: var(--text); }
.mb3 .menu button:hover { background: var(--sunk); }
/* The module kept in the account menu (People): links that look like the menu's buttons. */
.menu__cap--group { padding: 4px 11px 3px; }
.mb3 .menu a { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 5px; font-size: 13px; color: var(--text); text-decoration: none; }
.mb3 .menu a:hover { background: var(--sunk); }
.mb3 .menu a[aria-current="page"] { font-weight: 700; background: var(--sunk); }
.mb3 .menu a.is-soon { color: var(--muted); }
.mb3 .menu a .soon-tag { margin-left: auto; }

/* Short confirmations. */
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 1200; display: grid; gap: 8px; }
.toast {
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 5px;
  background: var(--navy);
  color: var(--on-navy);
  box-shadow: var(--shadow-toast);
  font-family: var(--ui);
  font-size: 13px;
  animation: fade-in .16s ease;
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(26px); opacity: .4; } }
@keyframes pop-in { from { transform: translate(-50%, -47%) scale(.98); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .scrim, .drawer, .editor, .modal-editor, .toast { animation: none; }
}
