:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  color: #202124;
  background: #f6f8fc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}


/* Login */

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f6f8fc;
}

.login-card {
  width: min(440px, 100%);
  padding: 42px;
  background: white;
  border: 1px solid #e0e3e7;
  border-radius: 20px;
  box-shadow:
    0 10px 35px rgba(32, 33, 36, 0.08);
}

.brand,
.mail-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  margin-bottom: 42px;
}

.brand > div:last-child {
  display: flex;
  gap: 5px;
  font-size: 21px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #111827;
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
}

.brand-mark.small {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 17px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

.muted {
  color: #6b7280;
  margin: 0 0 30px;
}

form {
  display: grid;
  gap: 10px;
}

label {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 650;
}

input {
  width: 100%;
  border: 1px solid #d7dce2;
  border-radius: 10px;
  padding: 13px 14px;
  outline: none;
  background: white;
}

input:focus {
  border-color: #2563eb;
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.1);
}

.primary-button {
  margin-top: 16px;
  border: 0;
  border-radius: 10px;
  padding: 13px;
  background: #2563eb;
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.error {
  color: #b42318;
}


/* Mail */

.mail-app {
  min-height: 100vh;
  background: #f6f8fc;
}

.topbar {
  height: 68px;
  display: grid;
  grid-template-columns: 240px 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 0 20px;
}

.mail-brand strong {
  font-size: 20px;
  font-weight: 650;
}

.search-wrap {
  max-width: 720px;
}

.search-wrap input {
  border: 0;
  background: #eaf1fb;
  border-radius: 24px;
  padding: 14px 20px;
}

.account-area {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}

.text-button,
.icon-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.text-button {
  color: #2563eb;
  font-weight: 650;
}

.mail-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
}

.sidebar {
  padding: 12px;
}

.compose-button {
  width: 150px;
  padding: 16px 20px;
  margin-bottom: 16px;
  border: 0;
  border-radius: 16px;
  background: #c2e7ff;
  font-weight: 650;
  text-align: left;
}

.sidebar nav {
  display: grid;
  gap: 3px;
}

.folder {
  border: 0;
  padding: 10px 18px;
  border-radius: 0 22px 22px 0;
  text-align: left;
  background: transparent;
  display: flex;
  gap: 14px;
}

.folder.active {
  background: #d3e3fd;
  font-weight: 700;
}

.inbox {
  margin: 0 14px 14px 0;
  background: white;
  border-radius: 18px;
  overflow: hidden;
}

.inbox-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid #edf0f3;
}

.inbox-header h1 {
  font-size: 18px;
  margin: 0;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 21px;
}

.icon-button:hover {
  background: #f1f3f4;
}

.state {
  padding: 50px 24px;
  text-align: center;
  color: #6b7280;
}

.message-list {
  width: 100%;
}

.message-row {
  min-height: 48px;
  display: grid;
  grid-template-columns:
    28px
    minmax(140px, 210px)
    minmax(0, 1fr)
    100px;

  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid #edf0f3;
  cursor: default;
}

.message-row:hover {
  box-shadow:
    0 1px 5px rgba(60, 64, 67, 0.18);
  position: relative;
  z-index: 1;
}

.message-row.unread {
  background: #ffffff;
  font-weight: 650;
}

.message-row.read {
  background: #f4f7fb;
}

.star {
  color: #9aa0a6;
  text-align: center;
}

.star.on {
  color: #f9ab00;
}

.sender,
.subject {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subject {
  font-weight: inherit;
}

.date {
  text-align: right;
  font-size: 12px;
  white-space: nowrap;
}


@media (max-width: 800px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .search-wrap {
    display: none;
  }

  .account-area span {
    display: none;
  }

  .mail-body {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .sidebar {
    padding: 8px;
  }

  .compose-button {
    width: 54px;
    height: 54px;
    padding: 0;
    font-size: 0;
    text-align: center;
  }

  .compose-button::first-letter {
    font-size: 22px;
  }

  .folder {
    justify-content: center;
    padding: 12px;
  }

  .folder span + * {
    display: none;
  }

  .inbox {
    margin-right: 8px;
  }

  .message-row {
    grid-template-columns:
      24px
      minmax(90px, 130px)
      minmax(0, 1fr);

    padding: 0 10px;
  }

  .date {
    display: none;
  }
}

/* --------------------------------
   Message reader
-------------------------------- */

.message-row {
  cursor: pointer;
}

.message-view {
  min-height: calc(100vh - 132px);
  background: #ffffff;
}

.message-toolbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 8px 18px;
  border-bottom: 1px solid #edf0f3;
}

.message-content {
  max-width: 900px;
  padding: 28px 36px 60px;
}

.message-content h2 {
  margin: 0 0 24px;
  font-size: 24px;
  font-weight: 500;
}

.message-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 5px;
}

.message-meta span {
  font-size: 13px;
  color: #6b7280;
}

.message-recipient {
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 28px;
}

.message-body-text {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.65;
  color: #202124;
}


/* --------------------------------
   Compose
-------------------------------- */

.compose-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
}

.compose-window {
  pointer-events: auto;
  position: absolute;
  right: 28px;
  bottom: 0;
  width: min(560px, calc(100vw - 28px));
  height: 580px;
  background: #ffffff;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  box-shadow:
    0 8px 30px rgba(0,0,0,0.28);
}

.compose-header {
  height: 42px;
  padding: 0 12px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #40464f;
  color: #ffffff;
  font-size: 13px;
}

.compose-close {
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.compose-window form {
  height: calc(100% - 42px);
  display: grid;
  grid-template-rows:
    auto
    auto
    auto
    1fr
    auto
    auto;
  gap: 0;
}

.compose-window input {
  border: 0;
  border-bottom: 1px solid #e4e7eb;
  border-radius: 0;
  box-shadow: none;
  padding: 13px 16px;
}

.compose-window textarea {
  width: 100%;
  resize: none;
  border: 0;
  outline: none;
  padding: 18px 16px;
  font: inherit;
  line-height: 1.5;
}

.compose-footer {
  padding: 12px 16px;
  border-top: 1px solid #edf0f3;
}

.send-button {
  border: 0;
  border-radius: 18px;
  padding: 9px 24px;
  background: #0b57d0;
  color: #ffffff;
  font-weight: 650;
  cursor: pointer;
}

.send-button:disabled {
  opacity: 0.6;
}

.compose-error {
  padding: 8px 16px;
  color: #b42318;
  font-size: 13px;
  background: #fff4f2;
}


@media (max-width: 650px) {
  .compose-window {
    width: 100vw;
    height: 80vh;
    right: 0;
  }

  .message-content {
    padding: 22px 18px 50px;
  }

  .message-meta {
    flex-direction: column;
    gap: 4px;
  }
}


/* --------------------------------
   HTML email body
-------------------------------- */

.message-body-content {
  margin-top: 28px;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.6;
}

.message-body-content img {
  max-width: 100%;
  height: auto;
}

.message-body-content table {
  max-width: 100%;
}

.message-body-content pre {
  white-space: pre-wrap;
  font-family: inherit;
}

.message-body-content blockquote {
  margin-left: 0;
  padding-left: 16px;
  border-left: 3px solid #dadce0;
  color: #5f6368;
}

.message-body-content a {
  color: #0b57d0;
}


/* --------------------------------
   Reply / forward controls
-------------------------------- */

.message-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 22px 0 8px;
}

.message-action-button {
  border: 1px solid #dadce0;
  border-radius: 18px;
  padding: 8px 16px;
  background: #ffffff;
  color: #3c4043;
  font-weight: 600;
  cursor: pointer;
}

.message-action-button:hover {
  background: #f7f8f9;
}

.compose-window {
  height: 620px;
}



/* Reply editor + quoted original */

.compose-editor-area {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.compose-editor-area textarea {
  flex: 1;
  min-height: 180px;
}

.compose-quoted {
  margin: 0 16px 16px;
  padding: 14px 16px;
  border-left: 3px solid #dadce0;
  background: #f8f9fa;
  color: #5f6368;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.5;
}


/* --------------------------------
   Starred + Bin
-------------------------------- */

.star {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 2px;
  margin: 0;
  cursor: pointer;
  font-size: 18px;
}

.star:hover {
  transform: scale(1.08);
}

.star.on {
  color: #f9ab00;
}

.message-action-button.danger {
  color: #b3261e;
}

.message-action-button.danger:hover {
  background: #fff1f0;
}


/* Drafts */

.compose-footer {
  display: flex;
  align-items: center;
  gap: 14px;
}

.draft-status {
  font-size: 12px;
  color: #6b7280;
}

.message-row[data-folder="drafts"] .star {
  visibility: hidden;
}


.delete-draft-button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #b3261e;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.delete-draft-button:hover {
  text-decoration: underline;
}


/* Search */

#mail-search:not(:placeholder-shown) {
  background: #fff;
}

#mail-search:focus {
  outline: none;
}


/* --------------------------------
   Bulk message selection
-------------------------------- */

.bulk-toolbar {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.bulk-select-all {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}

.bulk-select-all input,
.message-select {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.selected-count {
  font-size: 13px;
  color: #5f6368;
}

.bulk-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.bulk-action-button {
  border: 0;
  border-radius: 18px;
  padding: 7px 14px;
  background: #f1f3f4;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.bulk-action-button:hover {
  background: #e8eaed;
}

.bulk-action-button.danger {
  color: #b3261e;
}

.bulk-action-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.message-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.message-row:has(.message-select:checked) {
  background: #eaf2ff;
}


/* --------------------------------
   Vibrato Contacts
-------------------------------- */

.recipient-field {
  position: relative;
}

.recipient-field > input {
  width: 100%;
  box-sizing: border-box;
}

.contact-suggestions {
  position: absolute;
  top: calc(100% + 2px);
  left: 8px;
  right: 8px;
  z-index: 1000;

  overflow: hidden;

  border: 1px solid #dadce0;
  border-radius: 8px;

  background: #fff;

  box-shadow:
    0 4px 10px rgba(60, 64, 67, 0.18),
    0 2px 6px rgba(60, 64, 67, 0.12);
}

.contact-suggestion {
  width: 100%;

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 9px 12px;

  border: 0;

  background: #fff;

  text-align: left;

  cursor: pointer;
}

.contact-suggestion:hover {
  background: #f1f3f4;
}

.contact-avatar {
  width: 30px;
  height: 30px;

  flex: 0 0 30px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #e8f0fe;
  color: #1967d2;

  font-size: 13px;
  font-weight: 700;
}

.contact-suggestion-text {
  min-width: 0;

  display: flex;
  flex-direction: column;
}

.contact-suggestion-text strong {
  overflow: hidden;

  color: #202124;

  font-size: 13px;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-suggestion-text small {
  overflow: hidden;

  color: #5f6368;

  font-size: 12px;

  text-overflow: ellipsis;
  white-space: nowrap;
}


/* --------------------------------
   Received attachments
-------------------------------- */

.message-attachments {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.attachments-heading {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #202124;
}

.attachments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attachment-card {
  display: flex;
  align-items: center;
  gap: 12px;

  max-width: 620px;

  padding: 10px 12px;

  border: 1px solid #dadce0;
  border-radius: 10px;

  background: #fff;
}

.attachment-icon {
  width: 36px;
  height: 36px;

  flex: 0 0 36px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 8px;

  background: #f1f3f4;

  font-size: 18px;
}

.attachment-details {
  min-width: 0;

  display: flex;
  flex: 1;
  flex-direction: column;
}

.attachment-name {
  overflow: hidden;

  font-size: 13px;
  color: #202124;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-meta {
  margin-top: 2px;

  font-size: 11px;
  color: #6b7280;
}

.attachment-download {
  flex: 0 0 auto;

  padding: 7px 12px;

  border-radius: 18px;

  background: #f1f3f4;

  color: #1a73e8;

  font-size: 12px;
  font-weight: 600;

  text-decoration: none;
}

.attachment-download:hover {
  background: #e8f0fe;
}


/* --------------------------------
   Compose attachments
-------------------------------- */

.compose-attach-button {
  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 50%;

  background: transparent;

  cursor: pointer;

  font-size: 18px;
}

.compose-attach-button:hover {
  background: #f1f3f4;
}


.compose-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;

  padding: 8px 12px;
}


.compose-attachment-chip {
  max-width: 280px;

  display: flex;
  align-items: center;
  gap: 7px;

  padding: 6px 8px;

  border: 1px solid #dadce0;
  border-radius: 8px;

  background: #f8f9fa;
}


.compose-attachment-icon {
  flex: 0 0 auto;
}


.compose-attachment-info {
  min-width: 0;

  display: flex;
  flex-direction: column;
}


.compose-attachment-info strong {
  overflow: hidden;

  max-width: 190px;

  color: #202124;

  font-size: 12px;

  text-overflow: ellipsis;
  white-space: nowrap;
}


.compose-attachment-info small {
  color: #6b7280;
  font-size: 10px;
}


.compose-remove-attachment {
  width: 22px;
  height: 22px;

  flex: 0 0 22px;

  border: 0;
  border-radius: 50%;

  background: transparent;

  color: #5f6368;

  cursor: pointer;

  font-size: 18px;
  line-height: 18px;
}


.compose-remove-attachment:hover {
  background: #e8eaed;
  color: #b3261e;
}


/* --------------------------------
   Contacts page
-------------------------------- */

.contacts-view {
  padding: 24px;
}

.contacts-intro {
  margin-bottom: 20px;
}

.contacts-intro h2 {
  margin: 0 0 5px;
  font-size: 20px;
  color: #202124;
}

.contacts-intro p {
  margin: 0;
  font-size: 13px;
  color: #5f6368;
}

.contacts-empty {
  padding: 40px 0;
  color: #6b7280;
  text-align: center;
}

.contacts-list {
  overflow: hidden;

  border: 1px solid #e5e7eb;
  border-radius: 12px;

  background: #fff;
}

.contact-row {
  min-height: 68px;

  display: flex;
  align-items: center;
  gap: 14px;

  padding: 10px 14px;

  border-bottom:
    1px solid #eef0f2;
}

.contact-row:last-child {
  border-bottom: 0;
}

.contact-row:hover {
  background: #f8fafd;
}

.contact-page-avatar {
  width: 38px;
  height: 38px;

  flex: 0 0 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #e8f0fe;
  color: #1967d2;

  font-size: 15px;
  font-weight: 700;
}

.contact-page-details {
  min-width: 0;
  flex: 1;

  display: flex;
  flex-direction: column;
}

.contact-page-name {
  overflow: hidden;

  color: #202124;

  font-size: 14px;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-page-email {
  overflow: hidden;

  margin-top: 2px;

  color: #5f6368;

  font-size: 12px;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-page-usage {
  min-width: 130px;

  display: flex;
  flex-direction: column;

  color: #5f6368;

  font-size: 12px;
}

.contact-page-usage small {
  margin-top: 2px;
  color: #80868b;
}

.contact-page-actions {
  display: flex;
  gap: 6px;
}

.contact-edit-button,
.contact-delete-button {
  padding: 6px 12px;

  border: 0;
  border-radius: 16px;

  cursor: pointer;

  font-size: 12px;
  font-weight: 600;
}

.contact-edit-button {
  background: #f1f3f4;
  color: #1a73e8;
}

.contact-edit-button:hover {
  background: #e8f0fe;
}

.contact-delete-button {
  background: transparent;
  color: #b3261e;
}

.contact-delete-button:hover {
  background: #fff1f0;
}

@media (max-width: 800px) {
  .contact-page-usage {
    display: none;
  }
}


/* --------------------------------
   Mail organisation
-------------------------------- */

.message-move-select,
.bulk-move-select {
  border: 1px solid #dadce0;
  border-radius: 18px;
  background: #fff;
  color: #3c4043;
  cursor: pointer;
  font-size: 12px;
}

.message-move-select {
  padding: 7px 10px;
}

.bulk-move-select {
  padding: 6px 10px;
}

.message-move-select:hover,
.bulk-move-select:hover {
  background: #f8f9fa;
}

.message-move-select:disabled,
.bulk-move-select:disabled {
  opacity: 0.55;
  cursor: default;
}


/* --------------------------------
   Remote image privacy
-------------------------------- */

.remote-images-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  margin: 14px 0;
  padding: 10px 14px;

  border: 1px solid #d2e3fc;
  border-radius: 9px;

  background: #f8faff;
  color: #3c4043;

  font-size: 13px;
}

.remote-images-notice.hidden {
  display: none;
}

.load-remote-images-button {
  flex: 0 0 auto;

  border: 0;
  border-radius: 18px;

  padding: 7px 13px;

  background: #e8f0fe;
  color: #1967d2;

  cursor: pointer;

  font-size: 12px;
  font-weight: 600;
}

.load-remote-images-button:hover {
  background: #dce8fb;
}

.remote-image-blocked {
  box-sizing: border-box;

  min-width: 100px;
  min-height: 28px;

  border: 1px dashed #dadce0;

  background: #f8f9fa;

  color: #80868b;

  font-size: 11px;
}


.remote-image-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.always-load-remote-images-button {
  flex: 0 0 auto;

  border: 0;
  border-radius: 18px;

  padding: 7px 13px;

  background: transparent;
  color: #1967d2;

  cursor: pointer;

  font-size: 12px;
  font-weight: 600;
}

.always-load-remote-images-button:hover {
  background: #eef3fc;
}

.always-load-remote-images-button:disabled {
  opacity: 0.55;
  cursor: default;
}

