:root {
  color-scheme: light;
  --paper: #f5f4f0;
  --surface: #fffefa;
  --ink: #171c2c;
  --muted: #565d6d;
  --line: #dedfdc;
  --control-line: #969eaf;
  --accent: #253fcb;
  --accent-deep: #1b2c9a;
  --accent-tint: #e9edff;
  --display: Georgia, "Times New Roman", serif;
  --radius: 12px;
  --gutter: clamp(1rem, 4vw, 4rem);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
p,
form {
  margin: 0;
}

h1,
h2 {
  line-height: 1.12;
}

h1 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -.055em;
}

h3 {
  line-height: 1.3;
}

a {
  color: var(--accent-deep);
  text-underline-offset: .19em;
}

a:hover {
  text-decoration-thickness: 2px;
}

button,
input,
select {
  font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

button,
summary {
  cursor: pointer;
}

input:not([type="hidden"], [type="checkbox"]),
select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: .55rem .75rem;
  border: 1px solid var(--control-line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

select {
  padding-inline-end: .5rem;
}

input::placeholder {
  color: var(--muted);
}

.sub,
small {
  color: var(--muted);
}

.label {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.primary,
.secondary,
.quiet,
.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .5rem .95rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 690;
  text-align: center;
  text-decoration: none;
}

.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.primary:hover {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
}

.secondary {
  border-color: var(--control-line);
  background: var(--surface);
  color: var(--accent-deep);
}

.quiet {
  background: transparent;
  color: var(--accent-deep);
}

.secondary:hover,
.quiet:hover {
  background: var(--accent-tint);
}

.danger {
  border-color: #e1a6a4;
  background: #fff0ee;
  color: #8d2828;
}

.danger:hover {
  background: #f9ddda;
}

.fit {
  justify-self: start;
}

.stack,
.stack label,
.summary label {
  display: grid;
  min-width: 0;
}

.stack {
  gap: 1rem;
}

.stack label,
.summary label {
  gap: .35rem;
  font-size: .875rem;
  font-weight: 650;
}

.stack input,
.stack select,
.summary input {
  font-weight: 450;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.alert {
  margin-block: .9rem;
  padding: .75rem .9rem;
  border: 1px solid #e1a6a4;
  border-radius: 8px;
  background: #fff0ee;
  color: #8d2828;
  font-size: .9rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  width: fit-content;
  color: inherit;
  font-size: 1.125rem;
  font-weight: 760;
  letter-spacing: -.035em;
  text-decoration: none;
}

.mark {
  position: relative;
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
}

.mark i,
.large-envelope {
  position: relative;
  overflow: hidden;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}

.mark i {
  width: 19px;
  height: 13px;
}

.mark i::after,
.large-envelope::after {
  position: absolute;
  left: 50%;
  width: 70%;
  aspect-ratio: 1;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: translate(-50%, -60%) rotate(45deg);
}

.gate {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100svh;
  background: var(--surface);
}

.cover {
  --cover-gutter: clamp(2rem, 6vw, 7rem);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(2rem, 7vh, 5rem);
  min-width: 0;
  overflow: hidden;
  padding: clamp(2rem, 5vh, 4rem) var(--cover-gutter);
  background:
    radial-gradient(ellipse at 88% 7%, #4057b3 0, transparent 53%),
    #172759;
  color: #fffefa;
}

.cover::before {
  position: absolute;
  z-index: -1;
  top: -14rem;
  right: -16rem;
  width: clamp(30rem, 52vw, 55rem);
  aspect-ratio: 1;
  border: 1px solid #9aafff38;
  border-radius: 50%;
  box-shadow: 0 0 0 45px #9aafff12, 0 0 0 92px #9aafff10, 0 0 0 140px #9aafff0b;
  content: "";
  pointer-events: none;
}

.cover .mark {
  background: #e0e6ff;
  color: #233889;
}

.intro {
  max-width: 33rem;
}

.intro h2 {
  margin-block-end: 1.1rem;
  font-family: var(--display);
  font-size: clamp(2.8rem, 5.2vw, 6.05rem);
  font-weight: 400;
  letter-spacing: -.064em;
  line-height: .99;
}

.intro em {
  color: #becaff;
  font-weight: inherit;
}

.intro p {
  max-width: 28rem;
  color: #d9e1fa;
  font-size: clamp(.96rem, 1.4vw, 1.12rem);
}

.providers {
  width: 100%;
  padding-block-start: 1rem;
  border-top: 1px solid #d6e1ff45;
  color: #dce5ff;
  font-size: .84rem;
  letter-spacing: .025em;
}

.providers b {
  margin-inline: .35rem;
  color: #a5b7ff;
}

.paper-art {
  position: relative;
  width: clamp(13rem, 24vw, 23rem);
  max-width: 100%;
  aspect-ratio: 1.77;
  margin-block-end: clamp(1.55rem, 4.5vh, 3rem);
}

.paper {
  position: absolute;
  top: 19%;
  left: 13%;
  width: 72%;
  height: 69%;
  border: 1px solid #45548952;
  border-radius: 6px;
  box-shadow: 1px 10px 23px #0a112a46;
  transform-origin: center;
}

.paper.back {
  background: #8ea5f1;
  transform: translate(10%, -7%) rotate(13deg);
}

.paper.middle {
  background: #c4d0ff;
  transform: translate(-11%, -5%) rotate(-13deg);
}

.paper.front {
  display: flex;
  flex-direction: column;
  gap: 6%;
  overflow: hidden;
  padding: 11% 8% 5%;
  background:
    linear-gradient(146deg, transparent 49.5%, #a7b4dc90 50%, transparent 50.6%) bottom right / 54% 62% no-repeat,
    linear-gradient(214deg, transparent 49.5%, #a7b4dc80 50%, transparent 50.6%) bottom left / 54% 62% no-repeat,
    #fff8e8;
  transform: rotate(-4deg);
}

.paper.front span {
  position: absolute;
  top: 12%;
  right: 8%;
  display: grid;
  width: 17%;
  aspect-ratio: 1;
  place-items: center;
  border: 2px dotted #3853b9;
  background: #dae3ff;
  color: #3049a8;
}

.paper.front span::after {
  width: 45%;
  aspect-ratio: 1;
  border: 1px solid currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #dae3ff, 0 0 0 3px #3049a8;
  content: "";
}

.paper.front i {
  width: 43%;
  height: 2px;
  background: #5d72b1;
}

.paper.front i:nth-of-type(2) {
  width: 30%;
}

.paper.front i:nth-of-type(3) {
  width: 36%;
  opacity: .6;
}

.signin {
  display: grid;
  min-width: 0;
  align-items: center;
  justify-items: center;
  padding: clamp(2rem, 6vw, 6rem) var(--gutter);
  background: var(--surface);
}

.signbody {
  width: min(100%, 25rem);
}

.signbody h1 {
  font-size: clamp(2.65rem, 5vw, 4.55rem);
}

.signbody .sub {
  margin-block: .75rem 1.9rem;
}

.signbody .primary {
  justify-content: space-between;
  min-height: 52px;
  margin-block-start: .15rem;
  padding-inline: 1rem;
}

.signbody .primary span {
  font-size: 1.2rem;
  line-height: 1;
}

.switch {
  margin-block-start: 1.4rem;
  padding-block-start: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}

.switch a {
  font-weight: 700;
}

.top {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.bar,
.workspace {
  max-width: 86rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1rem, 4vw, 3.5rem);
  min-height: 72px;
}

.bar nav {
  display: flex;
  gap: .35rem;
}

.bar nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .65rem .75rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 650;
  text-decoration: none;
}

.bar nav a:hover,
.bar nav [aria-current="page"] {
  background: var(--accent-tint);
  color: var(--accent-deep);
}

.account,
.meta {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.account {
  min-width: 0;
  font-size: .85rem;
}

.account > span:nth-child(2) {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar,
.sendericon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent-deep);
  font-weight: 750;
}

.avatar {
  width: 32px;
  height: 32px;
}

.workspace {
  padding-block: clamp(2rem, 6vw, 4.55rem) 3rem;
}

.workspace.narrow {
  max-width: 62rem;
}

.headline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-block-end: clamp(1.45rem, 4vw, 2.8rem);
}

.headline h1 {
  font-size: clamp(3rem, 6.8vw, 5.5rem);
}

.headline .sub {
  margin-block-start: .45rem;
}

.period {
  color: var(--accent);
}

.inbox-grid,
.settings-grid {
  display: grid;
  grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.25rem, 3.5vw, 3rem);
}

.filters,
.sections {
  min-width: 0;
  padding-block: .2rem;
}

.filters > .label,
.sections > .label {
  margin: 0 .7rem .55rem;
}

.filter,
.sections a {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  padding: .45rem .65rem;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  font-size: .875rem;
  text-decoration: none;
}

.filter b {
  margin-inline-start: auto;
  color: var(--muted);
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.filter:hover,
.sections a:hover {
  background: #ebebe6;
}

.filter.chosen {
  border-color: #ccd4ff;
  background: var(--accent-tint);
  color: var(--accent-deep);
  font-weight: 700;
}

.dot,
.badge {
  --category-ink: #535c69;
  --category-fill: #eeeff2;
}

.all { --category-ink: var(--accent); }
.action { --category-ink: #9f392d; --category-fill: #fae7e1; }
.info { --category-ink: #235b4b; --category-fill: #e2f2e9; }
.newsletter { --category-ink: #494f98; --category-fill: #eaecfb; }
.spam { --category-ink: #595368; --category-fill: #efedf1; }
.pending { --category-ink: #745310; --category-fill: #f8edcc; }

.dot {
  flex: 0 0 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--category-ink);
}

.badge,
.status {
  display: inline-block;
  width: fit-content;
  padding: .2rem .52rem;
  border-radius: 5px;
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.35;
}

.badge {
  background: var(--category-fill);
  color: var(--category-ink);
}

.status {
  background: var(--accent-tint);
  color: var(--accent-deep);
}

.list,
.panel,
.reading {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.listhead,
.panelhead,
.connection,
.rowtop,
.boxfilter,
.pagination {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.listhead,
.panelhead,
.connection,
.rowtop {
  justify-content: space-between;
}

.listhead {
  flex-wrap: wrap;
  min-height: 74px;
  padding: .8rem clamp(1rem, 2.5vw, 1.6rem);
  border-bottom: 1px solid var(--line);
}

.listhead h2,
.panel h2 {
  font-size: clamp(1.15rem, 2vw, 1.37rem);
  letter-spacing: -.027em;
}

.boxfilter {
  min-width: 0;
  max-width: 100%;
}

.boxfilter select {
  max-width: min(18rem, 37vw);
  min-height: 44px;
  font-size: .875rem;
}

.boxfilter .quiet {
  flex: 0 0 auto;
}

.row {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  padding: 1.1rem clamp(1rem, 2.5vw, 1.6rem);
  color: inherit;
  text-decoration: none;
}

.row + .row {
  border-top: 1px solid var(--line);
}

.row:hover {
  background: #f1f3ff;
}

.row:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
}

.row:focus-visible {
  outline-offset: -3px;
}

.sendericon {
  width: 36px;
  height: 36px;
  font-size: .86rem;
}

.preview {
  flex: 1;
  min-width: 0;
}

.rowtop {
  align-items: baseline;
  margin-block-end: .2rem;
  font-size: .84rem;
}

.rowtop time,
.meta {
  color: var(--muted);
  font-size: .75rem;
}

.rowtop time {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.preview h3 {
  font-size: 1rem;
}

.preview p {
  margin-block: .25rem;
  color: var(--muted);
  font-size: .88rem;
}

.meta {
  flex-wrap: wrap;
  margin-block-start: .55rem;
}

.empty {
  display: grid;
  justify-items: center;
  gap: .7rem;
  min-height: clamp(16rem, 31vw, 23rem);
  align-content: center;
  padding: clamp(1.2rem, 4vw, 3rem);
  text-align: center;
}

.large-envelope {
  width: 52px;
  height: 35px;
  margin-block-end: .55rem;
  border-radius: 6px;
  background: var(--accent-tint);
  color: var(--accent);
}

.empty h3 {
  font-family: var(--display);
  font-size: clamp(1.55rem, 2.7vw, 2.15rem);
  font-weight: 400;
  letter-spacing: -.035em;
}

.empty p {
  max-width: 28rem;
  color: var(--muted);
}

.empty .primary {
  margin-block-start: .5rem;
}

.pagination {
  justify-content: center;
  padding: .6rem 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .875rem;
}

.pagination a,
.backlink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 650;
}

.pagination a {
  padding-inline: .4rem;
}

.backlink {
  margin-block-end: .65rem;
}

.reading,
.panel {
  padding: clamp(1rem, 3.5vw, 2rem);
}

.reading h1 {
  margin-block: .75rem;
  font-size: clamp(2.25rem, 5.6vw, 4.25rem);
}

.summary {
  display: grid;
  gap: .4rem;
  margin-block: 1.25rem;
  padding: .85rem 1rem;
  border-inline-start: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-tint);
}

.letter {
  margin-block-start: 1.35rem;
  padding-block-start: 1.35rem;
  border-top: 1px solid var(--line);
  white-space: pre-wrap;
}

.panels {
  display: grid;
  min-width: 0;
  gap: 1rem;
}

.panel {
  scroll-margin-top: 1rem;
}

.panelhead {
  flex-wrap: wrap;
}

.panel .sub {
  max-width: 62ch;
  margin-block: .45rem 1rem;
}

.panel > small {
  display: block;
  margin-block-start: .55rem;
}

.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.connection {
  flex-wrap: wrap;
  min-width: 0;
  margin-block-end: .75rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.connection small {
  display: block;
}

.fail {
  color: #8d2828;
}

.help,
.connection details {
  min-width: 0;
  font-size: .875rem;
}

.help summary,
.connection summary {
  width: fit-content;
  padding-block: .4rem;
  color: var(--accent-deep);
  font-weight: 650;
}

.help p {
  margin-block-start: .45rem;
}

.remove {
  display: grid;
  justify-items: start;
  gap: .65rem;
  padding-block-start: .4rem;
}

.check {
  display: flex;
  align-items: baseline;
  gap: .45rem;
}

.check input {
  flex: 0 0 auto;
  accent-color: var(--accent);
}

@media (max-width: 53rem) {
  .gate {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cover {
    --cover-gutter: clamp(1.3rem, 4vw, 2.25rem);
  }

  .inbox-grid,
  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: .95rem;
  }

  .filters,
  .sections {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
  }

  .filters > .label,
  .sections > .label {
    width: 100%;
    margin: 0 0 .2rem;
  }

  .filter,
  .sections a {
    gap: .4rem;
    border-color: var(--line);
    background: var(--surface);
  }
}

@media (max-width: 37rem) {
  .gate {
    display: block;
  }

  .cover {
    gap: 1rem;
    padding-block: 1rem 1.25rem;
  }

  .cover::before {
    top: -18rem;
    right: -17rem;
  }

  .intro h2 {
    margin-block-end: .5rem;
    font-size: clamp(2.05rem, 7.6vw, 3.2rem);
  }

  .intro p {
    font-size: .875rem;
  }

  .paper-art {
    float: right;
    width: min(31%, 8rem);
    margin: .25rem 0 .2rem .65rem;
  }

  .paper.front span {
    border-width: 1px;
  }

  .paper.front span::after {
    display: none;
  }

  .providers {
    padding-block-start: .5rem;
    font-size: .75rem;
  }

  .signin {
    padding-block: 1.65rem 2.5rem;
  }

  .signbody h1 {
    font-size: clamp(2.3rem, 9vw, 3.25rem);
  }

  .bar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .25rem .6rem;
    padding-block: .55rem;
  }

  .bar nav {
    grid-column: 1;
    grid-row: 2;
  }

  .bar nav a {
    flex: 1;
    padding-inline: .55rem;
    text-align: center;
  }

  .account {
    display: contents;
  }

  .account .avatar {
    display: none;
  }

  .account > span:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    max-width: min(38vw, 11rem);
    color: var(--muted);
    font-size: .85rem;
  }

  .account form {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }

  .account .quiet {
    padding-inline: .45rem;
  }

  .headline {
    flex-direction: column;
    align-items: flex-start;
    gap: .7rem;
  }

  .boxfilter {
    width: 100%;
  }

  .boxfilter select {
    max-width: none;
  }

  .rowtop {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: .1rem .55rem;
  }

  .pair {
    grid-template-columns: minmax(0, 1fr);
  }
}
