/* Gmail inbox extension. Outbound Email center history keeps its existing layout. */
.gmail-inbox-section,
.gmail-settings-card {
  margin-top: 22px;
}

.gmail-inbox-section .section-heading,
.gmail-settings-card .section-heading {
  align-items: flex-start;
  gap: 18px;
}

.gmail-inbox-section h2,
.gmail-settings-card h2 {
  margin-bottom: 5px;
}

.gmail-empty-launch {
  margin: 0;
  padding: 18px 0 2px;
  color: var(--muted, #727985);
}

.gmail-mailbox {
  margin-top: 18px;
}

.gmail-mailbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.gmail-search-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: min(100%, 380px);
  flex: 1;
  border: 1px solid var(--border, #dfe3e8);
  border-radius: 8px;
  background: #fff;
  padding: 0 11px;
}

.gmail-search-wrap .icon {
  width: 16px;
  height: 16px;
  color: #778292;
}

.gmail-search-wrap input {
  width: 100%;
  min-height: 40px;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
}

.gmail-layout {
  display: grid;
  grid-template-columns: minmax(270px, .85fr) minmax(330px, 1.35fr);
  min-height: 410px;
  overflow: hidden;
  border: 1px solid var(--border, #dfe3e8);
  border-radius: 10px;
  background: #fff;
}

.gmail-thread-list {
  min-width: 0;
  border-right: 1px solid var(--border, #dfe3e8);
  background: #fbfcfd;
}

.gmail-thread-pane {
  min-width: 0;
  background: #fff;
}

.gmail-message-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: start;
  width: 100%;
  gap: 9px;
  padding: 14px 13px;
  border: 0;
  border-bottom: 1px solid #edf0f3;
  background: transparent;
  color: #27303c;
  text-align: left;
  cursor: pointer;
}

.gmail-message-row:hover,
.gmail-message-row.is-selected {
  background: #f0f5fa;
}

.gmail-message-row.is-unread {
  background: #fffaf0;
}

.gmail-message-row.is-unread:hover,
.gmail-message-row.is-unread.is-selected {
  background: #fff5df;
}

.gmail-message-dot {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: transparent;
}

.gmail-message-row.is-unread .gmail-message-dot {
  background: #b28c42;
}

.gmail-message-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.gmail-message-copy strong,
.gmail-message-copy span,
.gmail-message-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gmail-message-copy strong {
  font-size: 12px;
}

.gmail-message-copy span {
  color: #434c5a;
  font-size: 12px;
}

.gmail-message-copy small {
  color: #7b8490;
  font-size: 11px;
}

.gmail-message-row time {
  color: #8b94a0;
  font-size: 10px;
  white-space: nowrap;
}

.gmail-thread {
  min-height: 100%;
}

.gmail-thread-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 13px;
  padding: 18px;
  border-bottom: 1px solid var(--border, #dfe3e8);
}

.gmail-thread-header h3 {
  margin: 0;
  color: #1d2837;
  font-size: 18px;
}

.gmail-thread-header p {
  margin: 5px 0 0;
}

.gmail-thread-messages {
  display: grid;
  gap: 12px;
  padding: 17px;
}

.gmail-message {
  overflow: hidden;
  border: 1px solid #e4e8ec;
  border-radius: 8px;
  background: #fff;
}

.gmail-message-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  background: #f7f8fa;
  border-bottom: 1px solid #e9edf0;
}

.gmail-message-header div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.gmail-message-header strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.gmail-message-header small,
.gmail-message-header time {
  color: #77818e;
  font-size: 10px;
}

.gmail-message-header time {
  white-space: nowrap;
}

.gmail-message-body {
  max-height: 450px;
  overflow: auto;
  padding: 15px 13px;
  color: #313a47;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gmail-thread-placeholder,
.gmail-inline-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  min-height: 270px;
  padding: 25px;
  color: #74808e;
  text-align: center;
}

.gmail-thread-placeholder .icon,
.gmail-inline-state > .icon {
  width: 28px;
  height: 28px;
  color: #b28c42;
}

.gmail-thread-placeholder h3 {
  margin: 0;
  color: #293545;
}

.gmail-thread-placeholder p,
.gmail-inline-state p {
  max-width: 320px;
  margin: 0;
}

.gmail-inline-state {
  min-height: 220px;
}

.gmail-error-state {
  color: #a03b3b;
}

.gmail-error-state .icon {
  color: #a03b3b;
}

.gmail-list-inline-error {
  margin: 10px;
  color: #a03b3b;
  font-size: 11px;
}

.gmail-load-more {
  margin: 12px;
  width: calc(100% - 24px);
}

.gmail-compose {
  display: grid;
  gap: 13px;
  margin-top: 16px;
  padding: 17px;
  border: 1px solid #dac38e;
  border-radius: 10px;
  background: #fffdf8;
}

.gmail-compose-header,
.gmail-compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.gmail-compose-header h3 {
  margin: 0;
  color: #293545;
}

.gmail-compose-header p {
  margin: 4px 0 0;
}

.gmail-compose .field {
  margin: 0;
}

.gmail-compose textarea {
  min-height: 135px;
  resize: vertical;
}

.gmail-compose-footer {
  align-items: flex-end;
}

.gmail-compose-footer .small {
  max-width: 460px;
}

.gmail-notice {
  margin: 12px 0;
}

.gmail-notice > div {
  min-width: 0;
}

.gmail-notice p {
  margin: 4px 0 0;
  line-height: 1.6;
}

.gmail-settings-card {
  display: grid;
  gap: 17px;
}

.gmail-loading {
  margin: 0;
}

.gmail-permission-row,
.gmail-scope-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid #e4e8ec;
  border-radius: 8px;
  background: #fbfcfd;
}

.gmail-permission-row p,
.gmail-scope-help p {
  margin: 5px 0 0;
  line-height: 1.6;
}

.gmail-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 43px;
  height: 24px;
  cursor: pointer;
}

.gmail-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.gmail-switch span {
  width: 43px;
  height: 24px;
  border-radius: 999px;
  background: #bbc3ce;
  transition: background .15s;
}

.gmail-switch span::after {
  display: block;
  width: 18px;
  height: 18px;
  margin: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0003;
  content: '';
  transition: transform .15s;
}

.gmail-switch input:checked + span {
  background: #57856a;
}

.gmail-switch input:checked + span::after {
  transform: translateX(19px);
}

.gmail-switch input:focus-visible + span {
  outline: 2px solid #b28c42;
  outline-offset: 2px;
}

.gmail-switch input:disabled + span {
  cursor: not-allowed;
  opacity: .55;
}

.gmail-scope-help {
  display: grid;
  align-items: stretch;
  justify-content: initial;
}

.gmail-scopes {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.gmail-scopes code {
  padding: 5px 8px;
  border: 1px solid #d8e0e7;
  border-radius: 5px;
  background: #fff;
  color: #415269;
  font-size: 11px;
}

.gmail-settings-actions {
  justify-content: flex-end;
}

@media (max-width: 850px) {
  .gmail-layout {
    grid-template-columns: 1fr;
  }

  .gmail-thread-list {
    max-height: 330px;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border, #dfe3e8);
  }

  .gmail-thread-pane {
    min-height: 320px;
  }
}

@media (max-width: 600px) {
  .gmail-mailbox-toolbar,
  .gmail-compose-header,
  .gmail-compose-footer,
  .gmail-permission-row {
    align-items: stretch;
    flex-direction: column;
  }

  .gmail-search-wrap {
    min-width: 0;
  }

  .gmail-mailbox-toolbar .flex,
  .gmail-compose-footer .btn {
    width: 100%;
  }

  .gmail-mailbox-toolbar .flex .btn {
    flex: 1;
  }

  .gmail-settings-actions {
    justify-content: stretch;
  }

  .gmail-settings-actions .btn {
    flex: 1;
  }
}