:root {
  color-scheme: light;
  font-family: Maco, system-ui, sans-serif;
  color: #202322;
  background: #fff;
  --ink: #202322;
  --black: #030303;
  --muted: #686c69;
  --tile: #f5f3ee;
  --line: #e4e2dc;
  --error: #a52e23;
  --gutter: 24px;
  --masthead: 60px;
  --content: 420px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
body:has(.site-menu:not([hidden])) { overflow: hidden; }
button, input, select, textarea { color: inherit; font: inherit; }
button { border: 0; background: transparent; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #3475bf; outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
p, h1, h2, pre, ul { margin: 0; }
h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 34px;
  text-align: center;
  text-wrap: balance;
}
h2 { font-size: 16px; font-weight: 600; line-height: 22px; }
form { margin: 0; }
fieldset { min-inline-size: 0; margin: 0; padding: 10px 16px 14px; border: 0; }
fieldset legend { padding: 0; font-weight: 600; font-size: 14px; }
details > summary { cursor: pointer; }
img { display: block; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.masthead {
  position: sticky;
  z-index: 2;
  top: 0;
  height: var(--masthead);
  border-bottom: 1px solid #e1e5e3;
  background: #fff;
}
.masthead-inner {
  display: flex;
  height: 100%;
  max-width: 1120px;
  padding-inline: var(--gutter);
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.brand-wordmark { width: 86.84375px; height: 22px; }
.masthead-actions { display: flex; align-items: center; gap: 8px; }
.masthead-signout {
  position: relative;
  min-height: 44px;
  padding: 0 12px;
  color: #bf251e;
  font-size: 14px;
  white-space: nowrap;
}
.masthead-signout::before {
  position: absolute;
  inset: 6px 0;
  content: "";
  border: 1px solid currentColor;
  border-radius: 999px;
  pointer-events: none;
}
.menu-toggle { position: relative; width: 44px; height: 44px; padding: 0; border-radius: 22px; }
.menu-toggle span {
  position: absolute;
  inset-inline-start: 12px;
  top: 18px;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 315ms ease;
}
.menu-toggle span + span { top: 24px; }
.menu-toggle[aria-expanded="true"] span { transform: translateY(3px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span + span { transform: translateY(-3px) rotate(-45deg); }

.site-menu {
  position: absolute;
  inset: var(--masthead) 0 auto;
  height: calc(100vh - var(--masthead));
  height: calc(100dvh - var(--masthead));
  overflow: auto;
  background: #fff;
  animation: menu-open 315ms linear both;
}
.menu-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding: 16px calc(var(--gutter) + 8px) 32px;
}
.menu-inner > :is(a, button) {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  text-align: start;
  text-decoration: none;
  font-size: 24px;
  font-weight: 600;
  line-height: 30px;
  letter-spacing: -.03em;
  animation: menu-item 178ms ease-out 175ms both;
}
.menu-inner > :nth-child(2) { animation-delay: 206ms; }
.menu-inner > :nth-child(3) { animation-delay: 237ms; }
.menu-inner > :nth-child(n+4) { animation-delay: 268ms; }
.menu-inner a[aria-current='page'] { color: var(--muted); }
.menu-account {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
  color: var(--muted);
  font-size: 14px;
}
.menu-email { min-width: 0; overflow-wrap: anywhere; }
.menu-account button { min-height: 44px; padding: 0; color: #bf251e; white-space: nowrap; }
@keyframes menu-open {
  0% { clip-path: inset(0 0 99.9%); opacity: 0; }
  17.5% { clip-path: inset(0 0 89%); opacity: .8; }
  33.3% { clip-path: inset(0 0 71%); opacity: .95; }
  49.2% { clip-path: inset(0 0 48%); opacity: .97; }
  65% { clip-path: inset(0 0 26%); opacity: .98; }
  81% { clip-path: inset(0 0 9%); opacity: .99; }
  100% { clip-path: inset(0); opacity: 1; }
}
@keyframes menu-item {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.scene {
  display: grid;
  min-height: calc(100vh - var(--masthead));
  min-height: calc(100svh - var(--masthead));
  align-items: start;
  padding: 24px var(--gutter) 32px;
}
.scene.centered { align-items: center; padding-bottom: 40px; }
.scene-inner { width: min(100%, var(--content)); min-width: 0; margin-inline: auto; }
.scene-inner > h1 { margin-bottom: 22px; }
.why-sign-in > p { margin: 0 0 24px; line-height: 1.55; }
.directory h1 { padding-inline: 16px; text-align: start; }
.with-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.with-icon img { flex: none; object-fit: contain; }
#login {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  padding: 0;
  overflow: clip;
}
.login-heading {
  grid-area: 1 / 1;
  width: min(calc(100% - 2 * var(--gutter)), var(--content));
  padding-block: 32px clamp(16px, 3vw, 24px);
  padding-block-start: clamp(32px, calc(42svh - 31vw - 58px), 224px);
}
.login-heading > h1 { margin-bottom: 0; }
.signin-art {
  grid-area: 2 / 1;
  pointer-events: none;
}
.signin-art > svg { display: block; width: 100%; height: auto; }
.signin-poster {
  width: min(100%, 402px);
  height: auto;
  margin-inline: auto;
}
.login-content {
  grid-area: 1 / 1 / 3 / 2;
  position: relative;
  display: grid;
  align-items: end;
  min-height: max(260px, calc(100vh - var(--masthead)));
  min-height: max(260px, calc(100svh - var(--masthead)));
  padding: 24px var(--gutter) clamp(32px, 16svh, 144px);
  pointer-events: none;
}
.login-options {
  display: grid;
  gap: 10px;
  pointer-events: auto;
}

.pill {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 50px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  gap: 8px;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  text-align: center;
  text-decoration: none;
}
.pill.primary { color: #fff; background: var(--black); }
.pill.secondary { background: var(--tile); }
.pill.outlined { color: var(--black); border-color: #111; background: #fff; }
.pill:disabled { color: #626460; background: #edebe8; border-color: transparent; }
.login-options .pill { font-weight: 400; }
.login-options .google-button { border-color: #767a77; }
.login-options .pill:disabled { opacity: .55; }
.login-options .outlined[aria-busy="true"] {
  background: #fff;
  color: var(--black);
  border-color: #111;
  opacity: 1;
  cursor: wait;
}
.login-options .google-button[aria-busy="true"] { border-color: #767a77; }
.login-icon { display: grid; place-items: center; flex: 0 0 20px; height: 20px; }
.login-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: login-spin .8s linear infinite;
}
[aria-busy="true"] .login-spinner { display: block; }
[aria-busy="true"] .google-mark { display: none; }
.passkey-label { position: relative; }
.passkey-label .login-spinner { position: absolute; inset: calc(50% - 9px) calc(100% + 8px) auto auto; }
@keyframes login-spin { to { transform: rotate(1turn); } }
.pill.back { padding-inline: 44px; }
.pill.back::before {
  position: absolute;
  inset-inline-start: 16px;
  width: 16px;
  height: 16px;
  content: "";
  background: center / contain no-repeat url("/cli/assets/flow/back.svg");
}
.text-button {
  justify-self: center;
  padding: 8px 16px;
  min-height: 36px;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 14px;
}

.steps { display: grid; gap: 16px; }
.fields { display: grid; gap: 14px; }
.manual-fields { gap: 10px; }
.manual-fields > .form-actions { gap: 12px; margin-top: 2px; }
#mailbox-setup.has-warning .manual-fields { gap: 13px; }
#mailbox-setup.has-warning .form-actions { gap: 16px; }
.hint { color: var(--muted); font-size: 14px; line-height: 1.5; }
.inset { padding-inline: 16px; }
.notice, .manual-warning {
  margin-bottom: 16px;
  padding-inline: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.notice.error, .manual-warning { color: var(--error); }
.manual-warning p { margin-top: 3px; }
.login-heading .notice { margin-top: 10px; margin-bottom: 0; text-align: center; }
.separator { color: #777b7b; font-size: 12px; line-height: 16px; text-align: center; }

.tile { overflow: hidden; background: var(--tile); border-radius: 26px; }
.tile-row {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  gap: 16px;
  padding: 8px 20px;
  text-align: left;
  font-size: 16px;
  line-height: 22px;
}
.tile-row img { flex: 0 0 auto; object-fit: contain; }
.tile-row span:not(.chevron) { min-width: 0; overflow-wrap: anywhere; }
.divided > .tile-row + .tile-row { position: relative; }
.divided > .tile-row + .tile-row::before {
  content: "";
  position: absolute;
  inset: 0 16px auto;
  height: 1px;
  background: var(--line);
}
.tile-row:focus-visible { outline-offset: -3px; }
.chevron {
  flex: 0 0 16px;
  height: 16px;
  margin-inline-start: auto;
  background: center / contain no-repeat url("/cli/assets/flow/chevron.svg");
}
:is(#mailboxes, #device-mailboxes):not(:empty) + .add-mailbox { position: relative; }
:is(#mailboxes, #device-mailboxes):not(:empty) + .add-mailbox::before {
  position: absolute;
  inset: 0 16px auto 60px;
  content: "";
  height: 1px;
  background: var(--line);
}
.mail-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: #555e59;
  background: #e5e8e3;
  font-size: 15px;
}

.custom-row { min-height: 44px; padding-inline: 12px; gap: 12px; }
.provider-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  margin: 14px 0 16px;
  padding: 0 14px;
  border-radius: 22px;
  background: #e8e8e8;
}
.provider-search:focus-within { outline: 2px solid #3475bf; outline-offset: 2px; }
.provider-search input {
  width: 100%;
  border: 0;
  padding: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
}
.provider-search input::placeholder { opacity: 1; color: #595c5b; }
.provider-group + .provider-group { margin-top: 14px; }
.provider-group h2 { margin: 0 16px 6px; color: #6d7375; font-size: 12px; font-weight: 400; line-height: 16px; }
.directory .back { margin-top: 20px; }

.field { display: grid; gap: 8px; min-width: 0; }
.field > span { padding-inline: 16px; color: var(--muted); font-size: 12px; line-height: 16px; }
.field > :is(input, select), .select-field {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 10px 16px;
  border: 0;
  border-radius: 20px;
  background: var(--tile);
  font-size: 16px;
  line-height: 22px;
}
input::placeholder { color: #707470; opacity: 1; }
.field-with-action { position: relative; }
.field-with-action input { padding-inline-end: 54px; }
.field-action {
  position: absolute;
  inset: auto 0 0 auto;
  display: grid;
  place-items: center;
  width: 48px;
  height: 52px;
  padding: 0;
  border-radius: 20px;
}
.select-field {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.select-field select {
  appearance: none;
  min-width: 0;
  max-width: 54%;
  padding: 2px 28px 2px 2px;
  border: 0;
  border-radius: 6px;
  background: right center / 16px no-repeat url("/cli/assets/flow/chevron.svg");
  color: var(--muted);
  font-size: 14px;
  text-align: end;
  text-align-last: end;
  text-overflow: ellipsis;
  cursor: pointer;
}
.server-fields { display: grid; gap: 10px; }
.server-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(74px, 25.4%); gap: 12px; }
.server-grid input[type="number"] { appearance: textfield; }
.server-grid input::-webkit-inner-spin-button,
.server-grid input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.provider-guide { margin: 6px 16px 0; color: #505954; font-size: 13px; line-height: 20px; }
.provider-guide summary {
  display: flex;
  width: fit-content;
  list-style: none;
  align-items: center;
  gap: 8px;
}
.provider-guide summary::-webkit-details-marker { display: none; }
.provider-guide p { margin-top: 6px; }
.provider-guide a { display: inline-block; margin-top: 2px; text-underline-offset: 3px; }
.provider-guide .text-button { display: block; padding-inline: 0; font-size: inherit; }

input[type="checkbox"] {
  appearance: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin: 0;
  flex: none;
  border: 1.5px solid #878c87;
  border-radius: 4px;
  cursor: pointer;
}
input[type="checkbox"]:checked { background: var(--black); border-color: var(--black); }
input[type="checkbox"]:checked::after {
  content: "";
  width: 8px;
  height: 4px;
  margin-top: -2px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}
@media (forced-colors: active) {
  input[type="checkbox"] { appearance: auto; }
  input[type="checkbox"]:checked::after { display: none; }
}
.mailbox-row input[type="checkbox"] { margin-inline-start: auto; }
.mailbox-row, .check-row, .permission { cursor: pointer; }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.check-row input[type="checkbox"] { width: 16px; height: 16px; flex-basis: 16px; margin-inline-end: 4px; }
.code-panel {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--tile);
  font-size: 14px;
}
#device-code { color: #d83a40; font: 600 24px/30px ui-monospace, monospace; }
.device-list { display: grid; gap: 16px; }
.device-mailbox-bubble { padding-block: 4px; }
#device-mailboxes .tile-row { padding-inline: 16px; gap: 12px; }
#device-mailboxes .tile-row, #device-add-mailbox { font-size: 17px; letter-spacing: -.43px; }
#device-mailboxes :is(img, .mail-icon) { margin-inline: 4px; }
#device-mailboxes input[type="checkbox"] { margin-inline-end: 3px; }
#device-add-mailbox { padding-inline-start: 24px; gap: 22px; }
.device-access-details { display: grid; gap: 12px; }
.device-access-name .field { gap: 16px; }
.device-access-name .field > span { color: var(--ink); font-size: 16px; font-weight: 600; }
#device-form .form-actions { gap: 12px; }
.permission { display: flex; align-items: start; gap: 8px; padding-block: 4px; font-size: 14px; }
#device-wait .pill { margin-top: 16px; }
.device-result-content {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}
.device-result-content > h1 { margin-bottom: 0; }
.device-result-content > .pill { margin-top: 4px; }
#device-result[data-expired] .device-result-content { gap: 8px; }
#device-result[data-expired] .device-result-content > h1, #device-title { letter-spacing: normal; }
#device-result[data-expired] #device-guidance { max-width: 258px; padding: 0; line-height: 20px; }
#device-result[data-expired] #back-to-agent { margin-top: 14px; }
.device-success-mark {
  display: none;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--tile);
}
#device-result[data-approved] .device-success-mark { display: grid; }
.device-success-mark::after {
  content: "";
  width: 20px;
  height: 10px;
  margin-top: -4px;
  border: solid var(--ink);
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}

#agent-prompt-details { margin-inline: 16px; }
#agent-prompt {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  line-height: 1.4;
  resize: vertical;
}
.entries { list-style: none; padding: 0 16px; }
.entries li { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding-block: 12px; }
.entries li + li { border-top: 1px solid var(--line); }
.entry-text { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.entry-text small { font-size: 12px; line-height: 1.4; color: var(--muted); }
.authorized-entries .text-button {
  position: relative;
  isolation: isolate;
  flex: none;
  min-height: 44px;
  padding: 8px 10px;
  color: #bf251e;
  text-decoration: none;
}
.authorized-entries .text-button::before {
  position: absolute;
  z-index: -1;
  inset: 8px 0;
  content: "";
  border-radius: 999px;
  background: #e9e7e3;
}
.authorized-entries li:has(.text-button) { padding-block: 4px; }

dialog {
  width: min(calc(100% - 2 * var(--gutter)), var(--content));
  max-height: calc(100% - 2 * var(--gutter));
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  background: #fff;
}
dialog[open] { display: grid; gap: 16px; }
dialog::backdrop { background: #20232260; }
dialog p { line-height: 1.5; }
dialog > .notice { margin-bottom: 0; }
.dialog-head, .button-row { display: flex; align-items: center; gap: 8px; }
.dialog-head { justify-content: space-between; }
.dismiss { border-radius: 20px; width: 40px; height: 40px; font-size: 22px; }
pre { padding: 12px; border-radius: 12px; background: var(--tile); white-space: pre-wrap; overflow-wrap: anywhere; }

@media (hover: hover) {
  .site-menu :is(a, button):hover { text-decoration: underline; text-underline-offset: 4px; }
  .authorized-entries .text-button:hover::before { background: #e2dfda; }
  .tile-row:hover, .pill.secondary:hover { background: #eceae4; }
  .pill.primary:not(:disabled):hover { background: #282a29; }
}
@media (min-width: 720px) {
  .masthead-inner { padding-inline: 32px; }
  .site-menu {
    inset-inline-start: auto;
    inset-inline-end: max(32px, calc((100vw - 1056px) / 2));
    width: 320px;
    height: auto;
    max-height: calc(100dvh - var(--masthead) - 16px);
    border: 1px solid var(--line);
    border-block-start: 0;
    border-radius: 0 0 24px 24px;
  }
}
@media (max-width: 350px) {
  :root { --gutter: 16px; }
  h1 { font-size: 25px; line-height: 31px; }
  .custom-row { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-menu, .menu-inner > :is(a, button), .login-spinner { animation: none; }
  .menu-toggle span { transition: none; }
}
