/* Mail composer and legal information windows. */
.mail-window {
  width: 500px;
  height: 430px;
}

.mail-titlebar {
  min-height: 44px;
  height: 44px;
  gap: 7px;
  padding: 0 10px;
  background: var(--sonoma-titlebar-surface, rgba(73,71,76,.78));
}

.mail-toolbar-left,
.mail-toolbar-right {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2px;
}

.mail-window-title {
  margin-left: 5px;
  color: rgba(255,255,255,.94);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.1px;
  line-height: 1;
  white-space: nowrap;
}

.mail-toolbar-button {
  min-width: 24px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 0;
  border-radius: 5px;
  color: rgba(255,255,255,.58);
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.mail-toolbar-button:hover { color: rgba(255,255,255,.86); background: rgba(255,255,255,.09); }
.mail-toolbar-button.active { color: rgba(255,255,255,.92); background: rgba(255,255,255,.15); }
.mail-toolbar-button:focus { outline: none; }
.mail-toolbar-button:focus-visible { box-shadow: inset 0 0 0 1px rgba(255,255,255,.26); }
.mail-send { width: 38px; flex-direction: column; gap: 3px; padding-top:3px; }
.mail-send-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}
.mail-send img { width: 14px; height: 14px; opacity: .66; }
.mail-send:hover img { opacity: .92; }
.mail-send:disabled { cursor: wait; opacity: .48; }
.mail-send .mail-send-label {
  color: var(--text-soft);
  font-size: 7px;
  line-height: 1;
  font-weight: 500;
  white-space: nowrap;
}

.mail-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 15px 12px;
  background: var(--sonoma-content-surface, rgba(30, 28, 36, 0.60));
}

.mail-row {
  height: 34px;
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
}

.mail-row input,
.mail-body {
  width: 100%;
  border: 0;
  outline: 0;
  color: rgba(255, 255, 255, 0.94);
  background: transparent;
  font: inherit;
}

.mail-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 11px 0;
  font-size: 12px;
  line-height: 1.45;
  -webkit-user-select: text;
  user-select: text;
}

.mail-row input::placeholder,
.mail-body:empty::before,
.mail-body[data-empty="true"]::before {
  content: attr(data-placeholder);
  display: block;
  color: rgba(255, 255, 255, 0.30);
  pointer-events: none;
}

.mail-feedback {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 10, 12, 0.36);
  -webkit-backdrop-filter: blur(5px) saturate(90%);
  backdrop-filter: blur(5px) saturate(90%);
}

.mail-feedback.hidden {
  display: none !important;
}

.mail-feedback-sheet {
  width: min(360px, calc(100% - 20px));
  min-height: 136px;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 16px;
  padding: 22px 22px 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 13px;
  color: rgba(255, 255, 255, 0.96);
  background: rgba(77, 75, 79, 0.94);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.48),
    0 1px 0 rgba(255, 255, 255, 0.18) inset;
  -webkit-backdrop-filter: blur(32px) saturate(140%);
  backdrop-filter: blur(32px) saturate(140%);
}

.mail-feedback-icon {
  position: relative;
  width: 58px;
  height: 58px;
}

.mail-feedback-icon img {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.mail-feedback-badge {
  position: absolute;
  right: -1px;
  bottom: -1px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(77, 75, 79, 0.96);
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.30);
}

.mail-feedback-badge::before {
  content: '✓';
  color: #fff;
  font-size: 17px;
  line-height: 1;
  font-weight: 800;
  transform: translateY(-0.5px);
}

.mail-feedback.is-error .mail-feedback-badge {
  background: #ff453a;
}

.mail-feedback.is-error .mail-feedback-badge::before {
  content: '!';
  inset: 0;
  width: auto;
  height: auto;
  border: 0;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
  text-align: center;
  transform: none;
}

.mail-feedback-copy {
  min-width: 0;
}

.mail-feedback-copy h2 {
  margin: 2px 0 7px;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: -0.1px;
}

.mail-feedback-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.38;
}

.mail-feedback-copy button {
  float: right;
  min-width: 72px;
  height: 24px;
  margin-top: 17px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  color: #fff;
  background: linear-gradient(#67a7ff, var(--accent));
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.30);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.mail-feedback-copy button:focus-visible {
  outline: 3px solid rgba(59, 130, 247, 0.34);
  outline-offset: 2px;
}

.legal-window {
  width: 560px;
  height: 540px;
}

.legal-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 28px 34px 38px;
  color: rgba(255, 255, 255, 0.78);
  background: var(--sonoma-content-surface, rgba(30, 28, 36, 0.60));
  -webkit-user-select: text;
  user-select: text;
}

.legal-content h1 {
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.96);
  font-size: 26px;
  letter-spacing: -0.7px;
}

.legal-content h2 {
  margin: 22px 0 7px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
}

.legal-content p {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
}

.legal-content a { color: var(--accent); }

.legal-notice {
  padding: 10px 12px;
  border: 1px solid rgba(59, 130, 247, 0.38);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(59, 130, 247, 0.10);
}
