* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #fff;
  font-family: "Inter var", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "calt" 1, "cv06" 1, "cv10" 1, "cv11" 1, "cv12" 1, "cv13" 1, "liga" 1, "ss01" 1, "ss08" 1, "zero" 1;
  font-size: 14px;
  font-weight: 450;
  font-variant-ligatures: common-ligatures contextual;
  letter-spacing: normal;
  line-height: 20px;
  color: rgb(17, 17, 17);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
  min-height: 100vh;
  margin: 0;
}

.email-wrapper {
  max-width: 860px;
  margin: 8% auto 60px;
  padding: 0 24px;
}

@media (max-width: 600px) {
  .email-wrapper {
    margin-top: 7%;
    padding: 0 16px;
  }
  .time {
    margin-left: 0;
    width: 100%;
    order: 10;
  }
  .action-icons {
    margin-left: 0;
  }
  .email-body {
    padding-left: 0;
  }
}

/* ── Subject row ── */
.email-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.subject-row {
  display: flex;
  align-items: center;
  min-height: 32px;
  gap: 12px;
  flex-wrap: wrap;
}

.subject {
  font-size: 22px;
  font-weight: 400;
  color: #202124;
}

.label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  gap: 4px;
  background: #e8eaed;
  color: #444;
  font-size: 13px;
  padding: 2px 8px 2px 10px;
  border-radius: 8px;
}

.label-x {
  font-size: 15px;
  cursor: pointer;
  color: #929292;
}

.header-icons {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ── Sender row ── */
.sender-row {
  display: flex;
  gap: 14px;
  margin-bottom: 28px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e8eaed;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.15s;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar:hover {
  opacity: 0.85;
}

.sender-info {
  flex: 1;
}

.sender-top {
  display: flex;
  align-items: center;
  min-height: 32px;
  gap: 6px;
  flex-wrap: wrap;
}

.sender-name {
  font-weight: 600;
  font-size: 14px;
  color: #202124;
}

.sender-email {
  font-size: 13px;
  color: #5f6368;
}

/* .time is defined in the tooltip section above */

.action-icons {
  display: flex;
  gap: 2px;
  margin-left: 8px;
}

.sender-to {
  display: flex;
  align-items: center;
  min-height: 32px;
  font-size: 13px;
  color: #5f6368;
  margin-top: 2px;
  gap: 2px;
  cursor: pointer;
  width: fit-content;
  border-radius: 4px;
  padding: 1px 4px 1px 0px;
  transition: background 0.15s;
}


.chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}

.sender-to.expanded .chevron {
  transform: rotate(180deg);
}

/* ── Icon buttons ── */
.icon-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: #5f6368;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  min-height: 32px;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: #f1f3f4;
  color: #202124;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ── Tooltip ── */
.tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 200;
  box-shadow: 0px 2px 4px -0.75px rgba(0, 0, 0, 0.05), 0px 1px 2px -0.25px rgba(0, 0, 0, 0.05);
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #111;
}

.tooltip.visible {
  opacity: 1;
}

/* ── No-signal tooltip (for static blocks) ── */
.no-signal-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 300;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.no-signal-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #111;
}

.static-block:hover .no-signal-tip {
  opacity: 1;
}

/* ── Time element ── */
.time {
  font-size: 13px;
  color: #5f6368;
  margin-left: auto;
  cursor: default;
}

/* ── Sender details dropdown ── */
.sender-details {
  display: none;
  margin-top: 8px;
  padding: 10px 12px;
  background: #f8f9fa;
  border: 1px solid #e8eaed;
  border-radius: 6px;
  font-size: 12px;
  color: #5f6368;
  line-height: 1.8;
}

.sender-details.visible {
  display: block;
}

.sender-details strong {
  color: #202124;
  font-weight: 600;
  min-width: 50px;
  display: inline-block;
}

/* ── Reply box ── */
.reply-box {
  display: none;
  margin-top: 24px;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.reply-box.visible {
  display: block;
}

.reply-to-label {
  font-size: 12px;
  color: #5f6368;
  margin-bottom: 8px;
}

.reply-to-label span {
  color: #202124;
  font-weight: 500;
}

.reply-textarea {
  width: 100%;
  min-height: 80px;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 450;
  line-height: 1.6;
  color: #202124;
  background: transparent;
}

.reply-textarea::placeholder {
  color: #9aa0a6;
}

.reply-actions {
  display: flex;
  align-items: center;
  min-height: 32px;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e8eaed;
}

.reply-send-btn {
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.reply-send-btn:hover {
  background: #1557b0;
}

.reply-discard-btn {
  background: none;
  border: none;
  color: #5f6368;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
}

.reply-discard-btn:hover {
  background: #f1f3f4;
  color: #202124;
}

/* ── Print overlay ── */
@media print {
  .header-icons, .action-icons { display: none; }
  .reply-box { display: none; }
  .email-wrapper { margin: 20px; }
}

/* ── Email body ── */
.email-body {
  font-size: 14px;
  line-height: 1.7;
  color: #202124;
  padding-left: 54px;
}

.email-body p {
  margin-bottom: 16px;
}

.email-body p:last-child {
  margin-bottom: 0;
}
/* ── SVG icon img coloring ── */
/* Default icon color: #5f6368 (gray) */
.icon {
  filter: invert(41%) sepia(6%) saturate(526%) hue-rotate(167deg) brightness(95%) contrast(87%);
  transition: filter 0.15s;
}

.icon-btn:hover .icon {
  filter: invert(11%) sepia(5%) saturate(456%) hue-rotate(167deg) brightness(90%) contrast(95%);
}

/* Gray icon for avatar (#9aa0a6) */
.icon-gray {
  filter: invert(67%) sepia(7%) saturate(271%) hue-rotate(167deg) brightness(96%) contrast(89%);
}

/* Chevron inherits icon style */
.sender-to .icon {
  transition: filter 0.15s, transform 0.2s;
}

.sender-to.expanded .icon {
  transform: rotate(180deg);
}

/* ── Star animation ── */
@keyframes starPop {
  0%   { transform: scale(1);    }
  50%  { transform: scale(1.10); }
  100% { transform: scale(1);    }
}

.icon-btn.star-animating .icon {
  animation: starPop 0.3s ease-in-out forwards;
}

/* ── Checkmark animation ── */
@keyframes checkIn {
  0%   { transform: scale(0.5) rotate(-15deg); opacity: 0; }
  60%  { transform: scale(1.2) rotate(5deg);   opacity: 1; }
  100% { transform: scale(1)   rotate(0deg);   opacity: 1; }
}

@keyframes checkOut {
  0%   { transform: scale(1);   opacity: 1; }
  100% { transform: scale(0.6); opacity: 0; }
}

.icon.check-animate-in {
  animation: checkIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.icon.check-animate-out {
  animation: checkOut 0.25s ease-in forwards;
}

/* Blue filter for active double-check */
.icon-btn.read-active .icon {
  filter: invert(35%) sepia(98%) saturate(1400%) hue-rotate(200deg) brightness(97%) contrast(95%);
}

/* ── Star: yellow/gold when active (override blue) ── */
.icon-btn.star-active .icon {
  filter: invert(85%) sepia(60%) saturate(900%) hue-rotate(5deg) brightness(102%) contrast(100%);
}

/* ── TV Static glitch effect ── */
.static-block {
  display: inline-block;
  position: relative;
  vertical-align: middle;
  border-radius: 3px;
  overflow: hidden;
  /* size set by JS based on text width */
}

.static-block canvas {
  display: block;
}

/* star color is baked into star-filled.svg (#FFD230) */

/* ── Static block ── */
.static-block {
  display: inline-block;
  position: relative;
  vertical-align: middle;
  border-radius: 2px;
  overflow: hidden;
}
.static-block canvas { display: block; }

/* ── Reply email input ── */
.reply-email-input {
  display: block;
  width: 100%;
  border: none;
  border-bottom: 1px solid #e8eaed;
  outline: none;
  padding: 6px 0;
  margin-bottom: 16px;
  margin-top: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 450;
  color: #202124;
  background: transparent;
  transition: border-color 0.15s;
}
.reply-email-input::placeholder { color: #9aa0a6; }
.reply-email-input:focus { border-bottom-color: #1a73e8; }
/* ── Email divider + social links ── */
.email-divider {
  border: none;
  border-top: 1.5px dashed #d0d0d0;
  margin: 20px 0 16px;
}

.social-links {
  font-size: 13px;
  color: #9aa0a6;
}

.social-links a {
  color: #9aa0a6;
  text-decoration: none;
  transition: color 0.15s;
}

.social-links a:hover {
  color: #5f6368;
}