:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #172639;
  background: #f6f8fb;
  --ink: #172639;
  --muted: #515f70;
  --line: #d6dee7;
  --slate: #142032;
  --blue: #1855bb;
  --pale: #edf3ff;
  --top: 52px;
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
[hidden] {
  display: none !important;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  background: none;
  border: 0;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #568dff;
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
button svg,
span svg {
  width: 18px;
  height: 18px;
  display: block;
  flex: none;
}
button {
  touch-action: manipulation;
}
h1,
h2,
h3,
p {
  margin: 0;
}
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: calc(var(--top) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0
    max(15px, env(safe-area-inset-left));
  background: var(--slate);
  color: #fff;
  border-bottom: 1px solid #26354b;
}
.identity {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  font-size: 1.24rem;
  font-weight: 740;
  letter-spacing: -0.055em;
}
.identity img {
  object-fit: contain;
  filter: drop-shadow(0 1px 1px #0003);
}
.account {
  margin-left: auto;
  font-size: 0.81rem;
  color: #c7d5e6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-action,
.icon-control,
.back,
.close-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 6px;
}
.top-action {
  color: #dce8f7;
}
.top-action:hover {
  background: #293a51;
}
.workspace {
  display: grid;
  grid-template-columns: clamp(148px, 12vw, 194px) minmax(280px, 30%) minmax(0, 1fr);
  min-height: 0;
  flex: 1;
}
.rail,
.list-pane,
.detail-pane {
  min-height: 0;
  min-width: 0;
}
.rail {
  background: #eef2f7;
  border-right: 1px solid var(--line);
  padding: 15px 8px 0;
  display: flex;
  flex-direction: column;
}
.rail nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  font-weight: 560;
  font-size: 0.9rem;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  min-height: 39px;
  padding: 0 10px;
  color: #38495b;
  border-radius: 5px;
}
.nav-item.active {
  background: #dce8fc;
  color: #10439a;
  font-weight: 660;
}
.nav-item:hover,
.icon-control:hover,
.back:hover,
.close-x:hover,
.action:hover {
  background: #e5ebf4;
}
.nav-item.active:hover {
  background: #d5e3fc;
}
.nav-count {
  margin-left: auto;
  font-size: 0.79rem;
  font-variant-numeric: tabular-nums;
}
.nav-item.side {
  margin-top: 13px;
}
.sync {
  margin-top: auto;
  border-top: 1px solid #d0d9e4;
  padding: 12px 4px max(15px, env(safe-area-inset-bottom));
  font-size: 0.77rem;
  color: #495b70;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.sync strong {
  font-size: 0.81rem;
  display: block;
  color: #2b3c50;
}
.list-pane {
  display: flex;
  flex-direction: column;
  background: white;
  border-right: 1px solid var(--line);
}
.list-tools {
  padding: 15px 13px 11px;
  border-bottom: 1px solid var(--line);
}
.list-heading,
.find-row,
.filters,
.section-head,
.detail-top,
.mail-meta,
.modal-head,
.actions,
.composer-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}
.list-heading {
  margin-bottom: 10px;
  gap: 9px;
}
.list-heading h1 {
  font-size: 1.32rem;
  letter-spacing: -0.045em;
}
.total {
  background: #e9eef5;
  color: #41536a;
  border-radius: 5px;
  font-size: 0.81rem;
  font-weight: 620;
  padding: 2px 7px;
}
.total:empty {
  display: none;
}
.find-row {
  gap: 6px;
}
.search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #cfd8e3;
  background: #f7f9fc;
  padding: 0 8px;
  border-radius: 6px;
  color: #556479;
}
.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  min-height: 34px;
  font-size: 0.88rem;
  outline-offset: 0;
}
.icon-control {
  height: 36px;
  width: 36px;
  border: 1px solid #cfd8e3;
  background: white;
  color: #41536a;
}
.icon-control.active {
  background: #e8f0ff;
  color: #134ca6;
  border-color: #8db0e9;
}
.filters {
  margin-top: 8px;
  font-size: 0.81rem;
  color: var(--muted);
}
.archive-link {
  display: block;
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 600;
  margin-top: 4px;
  min-height: 29px;
  padding: 2px 0;
}
.block + .composer {
  margin-top: 12px;
}
.filters select,
.category-editor select,
.field input,
.field textarea {
  border: 1px solid #bbc8d7;
  background: #fff;
  border-radius: 5px;
}
select {
  max-width: 100%;
  min-height: 34px;
  padding: 0 29px 0 8px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23425870' stroke-width='1.7' d='m1 1 5 5 5-5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
}
.thread-list,
.detail-content {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.thread-list {
  flex: 1;
  position: relative;
}
.thread-row {
  position: relative;
  text-align: left;
  display: block;
  width: 100%;
  padding: 9px 12px 10px 15px;
  border-bottom: 1px solid #e0e6ed;
  background: white;
}
.thread-row:hover {
  background: #f4f7fc;
}
.thread-row.selected {
  background: var(--pale);
  box-shadow: inset 3px 0 var(--blue);
}
.thread-row.unread .row-subject {
  font-weight: 740;
}
.thread-row.unread .sender:before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  background: #1d62cd;
  margin-right: 5px;
  vertical-align: middle;
}
.row-head,
.row-foot {
  display: flex;
  align-items: center;
  gap: 7px;
}
.sender,
.row-time,
.row-preview,
.hint,
.field span,
.meta {
  font-size: 0.8rem;
  color: var(--muted);
}
.category-editor {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 0.87rem;
  color: var(--muted);
  margin-bottom: 13px;
}
.recover {
  color: var(--blue);
  font-size: 0.81rem;
}
.sender,
.row-subject,
.row-preview,
.clip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.sender {
  flex: 1;
  color: #34465b;
  font-weight: 600;
}
.row-time {
  font-variant-numeric: tabular-nums;
  flex: none;
}
.row-subject {
  font-size: 0.94rem;
  font-weight: 570;
  line-height: 1.35;
  margin: 2px 0;
}
.row-preview {
  line-height: 1.4;
  margin: 1px 0;
}
.row-foot {
  margin-top: 5px;
  flex-wrap: wrap;
  row-gap: 3px;
}
.tag {
  display: inline-flex;
  align-items: center;
  background: #edf0f4;
  border-radius: 3px;
  padding: 1px 5px;
  color: #40536a;
  font-size: 0.75rem;
  font-weight: 590;
  line-height: 1.45;
}
.tag.hot {
  background: #ffebe9;
  color: #9b2b20;
}
.tag.blue {
  background: #e4edff;
  color: #19499c;
}
.tag.due {
  background: #f1e9fa;
  color: #654283;
}
.row-count {
  font-size: 0.75rem;
  color: #56677b;
}
.detail-pane {
  display: flex;
  flex-direction: column;
  background: #fff;
}
.detail-head {
  padding: 14px clamp(14px, 2vw, 30px) 0;
  border-bottom: 1px solid var(--line);
}
.detail-top {
  flex-wrap: wrap;
  gap: 5px;
}
.detail-title {
  font-size: clamp(1.18rem, 1.8vw, 1.55rem);
  line-height: 1.17;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
  margin: 7px 0 8px;
}
.detail-sub {
  font-size: 0.85rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.tabs {
  display: flex;
  align-items: center;
  gap: clamp(9px, 1.3vw, 23px);
  margin-top: 8px;
  overflow-x: auto;
}
.tab {
  position: relative;
  border-bottom: 2px solid transparent;
  padding: 10px 0 8px;
  color: #4d6077;
  white-space: nowrap;
  font-size: 0.86rem;
  font-weight: 600;
}
.tab.active {
  color: var(--blue);
  border-color: var(--blue);
}
.tab small {
  margin-left: 3px;
  font-size: 0.74rem;
  font-weight: 530;
}
.detail-content {
  flex: 1;
  padding: 16px clamp(14px, 2vw, 30px) 20px;
  overflow-wrap: anywhere;
}
.block + .block {
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.section-head {
  justify-content: space-between;
  margin-bottom: 8px;
}
.section-head h3,
.modal-head h2 {
  letter-spacing: -0.025em;
  font-size: 1rem;
}
.entry-title {
  font-size: 0.94rem;
  line-height: 1.4;
}
.mail-meta {
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: 0.86rem;
  line-height: 1.5;
}
.meta {
  line-height: 1.5;
}
.attachments {
  margin-top: 6px;
}
.attachment {
  border-top: 1px solid var(--line);
  padding: 4px 0;
}
.attachment-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.attachment-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue);
  overflow-wrap: anywhere;
}
.attachment-image {
  display: block;
  max-width: 100%;
  max-height: 54dvh;
  height: auto;
  margin: 3px 0;
}
.mail-body,
.mail-preview,
.confirm-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  margin: 10px 0 0;
}
.summary {
  line-height: 1.45;
  font-size: 0.96rem;
}
.reason-list {
  padding-left: 1.16rem;
  margin: 8px 0;
  font-size: 0.92rem;
  line-height: 1.5;
}
.evidence-row,
.history-item {
  display: block;
  width: 100%;
  text-align: left;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 5px;
  margin-top: 6px;
  padding: 9px 10px;
}
.evidence-row:hover,
.history-item summary:hover {
  color: var(--blue);
}
.evidence-row strong,
.evidence-row small {
  display: block;
}
.evidence-row small {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 3px;
}
.history-item summary {
  cursor: pointer;
  font-size: 0.9rem;
}
.actions {
  margin-top: auto;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding: 7px clamp(10px, 2vw, 25px) max(7px, env(safe-area-inset-bottom));
  background: #f6f8fb;
  gap: 4px;
}
.action,
.secondary,
.primary {
  border-radius: 5px;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 5px 9px;
  font-size: 0.85rem;
  font-weight: 620;
}
.action {
  color: #3d4f65;
}
.action.active {
  background: #deebff;
  color: #11489d;
}
.secondary {
  border: 1px solid #bdcad9;
  background: white;
}
.secondary:hover {
  background: #f0f4fa;
}
.primary {
  color: white;
  background: var(--blue);
  border: 1px solid var(--blue);
}
.primary:hover {
  background: #124ba9;
}
.action svg {
  height: 16px;
  width: 16px;
}
.back {
  display: none;
}
.composer,
.pair-form,
.dialog-form {
  display: grid;
  gap: 10px;
}
.field {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.field span {
  font-weight: 600;
}
.field input,
.field textarea {
  width: 100%;
  padding: 8px 9px;
  font-size: 1rem;
}
.field textarea {
  resize: vertical;
  line-height: 1.45;
  min-height: 220px;
}
.composer-footer {
  justify-content: flex-end;
  flex-wrap: wrap;
}
.composer-footer .hint {
  margin-right: auto;
}
.empty {
  align-self: center;
  margin: auto;
  text-align: center;
  color: #506075;
  padding: 24px 15px;
  line-height: 1.5;
}
.empty svg {
  width: 29px;
  height: 29px;
  margin: 0 auto 10px;
  color: #748ba6;
  display: block;
}
.empty strong {
  color: #30425a;
  display: block;
  font-weight: 620;
}
.empty-list {
  display: grid;
  place-content: center;
  min-height: 140px;
  text-align: center;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.9rem;
  padding: 15px;
}
.load-more {
  display: block;
  margin: 10px auto;
}
.gate {
  min-height: 0;
  overflow: auto;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 22px 16px max(20px, env(safe-area-inset-bottom));
}
.pair-panel {
  width: min(100%, 390px);
  align-self: center;
  background: white;
  border-top: 3px solid var(--blue);
  padding: 24px;
  border-radius: 5px;
  box-shadow: 0 2px 12px #14203212;
}
.pair-panel h1 {
  margin: 12px 0 7px;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}
.pair-panel p {
  font-size: 0.95rem;
  line-height: 1.48;
  color: var(--muted);
  margin: 7px 0 14px;
}
.pair-panel .primary {
  justify-self: start;
}
.pair-symbol {
  color: var(--blue);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: #e7effe;
  border-radius: 8px;
}
.pair-symbol svg {
  width: 22px;
  height: 22px;
}
.pair-code {
  font:
    650 1.42rem ui-monospace,
    Consolas,
    monospace;
  letter-spacing: 0.065em;
  color: #183c73;
  background: #edf3ff;
  border: 1px solid #d7e5fd;
  border-radius: 4px;
  padding: 9px 10px;
  display: block;
  overflow-wrap: anywhere;
}
.alert {
  background: #fff0ec;
  color: #802b20;
  padding: 9px;
  border-radius: 5px;
  font-size: 0.89rem;
  margin: 8px 0;
  line-height: 1.45;
}
.send-status {
  margin-bottom: 12px;
  padding: 8px 10px;
  background: #edf3ff;
  color: #24497b;
  border-left: 3px solid #4776c7;
  font-size: 0.88rem;
  line-height: 1.4;
}
dialog {
  border: 1px solid #b9c6d5;
  border-radius: 8px;
  padding: 16px;
  width: min(590px, calc(100% - 24px));
  max-height: 85dvh;
  box-shadow: 0 16px 65px #07192b38;
  overflow: auto;
  color: var(--ink);
}
dialog::backdrop {
  background: #0e1c32a6;
}
.modal-head {
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}
.modal-head h2 {
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}
.close-x {
  width: 34px;
  height: 34px;
  background: #eef2f7;
}
.confirm-body {
  max-height: 42dvh;
  overflow: auto;
  background: #f6f8fb;
  border: 1px solid var(--line);
  padding: 9px;
  border-radius: 5px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 13px;
}
#notice {
  position: fixed;
  z-index: 5;
  bottom: max(55px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 14px;
  max-width: calc(100% - 22px);
  background: #172b43;
  color: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 10px #14203233;
  font-size: 0.88rem;
  text-align: center;
}
@media (max-width: 920px) and (min-width: 701px) {
  .workspace {
    grid-template-columns: 132px minmax(240px, 33%) minmax(0, 1fr);
  }
  .rail {
    padding-inline: 5px;
  }
  .nav-item {
    gap: 6px;
    padding-inline: 7px;
  }
  .detail-head,
  .detail-content {
    padding-inline: 12px;
  }
  .actions {
    padding-inline: 4px;
  }
  .action {
    padding-inline: 6px;
  }
}
@media (max-width: 700px) {
  :root {
    --top: 44px;
  }
  .topbar {
    padding-left: max(11px, env(safe-area-inset-left));
    padding-right: max(5px, env(safe-area-inset-right));
    gap: 8px;
  }
  .identity {
    font-size: 1.13rem;
    gap: 5px;
  }
  .identity img {
    width: 35px;
    height: 31px;
  }
  .account {
    font-size: 0.75rem;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .rail {
    padding: 0;
    background: #f3f6fa;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .rail nav {
    flex-direction: row;
    gap: 1px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 max(5px, env(safe-area-inset-right)) 0 max(5px, env(safe-area-inset-left));
  }
  .nav-item {
    flex: none;
    min-height: 41px;
    padding: 0 7px;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    font-size: 0.79rem;
    gap: 3px;
  }
  .nav-item svg {
    width: 15px;
    height: 15px;
  }
  .nav-item.active {
    border-color: var(--blue);
    background: transparent;
  }
  .nav-item.side {
    margin: 0;
  }
  .nav-count {
    font-size: 0.72rem;
  }
  .sync {
    display: none;
  }
  .list-pane {
    flex: 1;
    border: 0;
  }
  .list-tools {
    padding: 7px max(10px, env(safe-area-inset-right)) 7px max(10px, env(safe-area-inset-left));
  }
  .list-heading {
    margin-bottom: 6px;
  }
  .list-heading h1 {
    font-size: 1.12rem;
  }
  .search input {
    font-size: 1rem;
    min-height: 34px;
  }
  .thread-list {
    padding-bottom: env(safe-area-inset-bottom);
    scrollbar-gutter: auto;
  }
  .thread-row {
    padding: 8px 12px;
  }
  .row-subject {
    font-size: 0.97rem;
  }
  .detail-pane {
    display: none;
  }
  .show-detail .detail-pane {
    display: flex;
    flex: 1;
  }
  .show-detail .list-pane,
  .show-detail .rail {
    display: none;
  }
  .detail-head {
    padding: 5px max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  }
  .detail-title {
    font-size: 1.18rem;
    margin: 3px 0 5px;
  }
  .tabs {
    margin-top: 4px;
    gap: 16px;
  }
  .tab {
    font-size: 0.85rem;
    padding: 8px 0;
  }
  .detail-content {
    padding: 12px max(12px, env(safe-area-inset-right)) 16px max(12px, env(safe-area-inset-left));
    scrollbar-gutter: auto;
  }
  .back {
    display: inline-flex;
    height: 33px;
    width: 33px;
    margin-left: -5px;
    color: var(--blue);
  }
  .actions {
    justify-content: space-between;
    padding-inline: max(5px, env(safe-area-inset-left));
    gap: 0;
  }
  .action {
    padding: 6px;
    min-height: 38px;
  }
  .action svg {
    width: 15px;
    height: 15px;
  }
  .field textarea {
    min-height: 185px;
  }
  .pair-panel {
    padding: 18px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .busy svg {
    animation: spin 1.3s linear infinite;
  }
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
}
