.win7-app-window.contact-window {
  left: clamp(118px, 17vw, 340px);
  top: clamp(82px, 12vh, 145px);
  width: min(820px, 72vw);
  height: min(610px, calc(100vh - var(--taskbar-h) - 68px));
  min-width: 640px;
  min-height: 470px;
  z-index: 9;
}

.win7-app-window.contact-window.is-active {
  z-index: 12;
}

.contact-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  height: 100%;
  color: #1d2833;
  background:
    linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,.12) 34%, rgba(40,95,140,.16)),
    #d7e8f4;
  border-top: 1px solid rgba(255,255,255,.58);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.contact-commandbar {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 34px;
  padding: 5px 7px;
  border-bottom: 1px solid #a4bccd;
  background:
    linear-gradient(180deg, #fbfdff, #e8f1f8 52%, #d4e4ef);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.86);
}

.contact-command,
.contact-commandbar button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 8px;
  color: #15324d;
  font-size: 12px;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
}

.contact-command:hover,
.contact-command:focus-visible,
.contact-commandbar button:hover,
.contact-commandbar button:focus-visible {
  border-color: #7da8ca;
  background: linear-gradient(#fefefe, #d7e9f6);
  outline: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.76);
}

.contact-command img,
.contact-links img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.contact-workspace {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 0;
  padding: 8px;
  gap: 8px;
}

.contact-sidebar,
.contact-panel {
  min-height: 0;
  border: 1px solid #8faec6;
  background: rgba(255,255,255,.74);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.72),
    0 1px 3px rgba(33,70,96,.22);
}

.contact-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.9), rgba(232,243,251,.84)),
    #edf6fb;
}

.contact-user-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 11px 10px;
  border-bottom: 1px solid #b7cddd;
  background: linear-gradient(180deg, #ffffff, #e4f0f8);
}

.contact-user-card img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.contact-user-card strong,
.contact-user-card span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-user-card strong {
  color: #0c3559;
  font-size: 13px;
  font-weight: 600;
}

.contact-user-card span {
  color: #526575;
  font-size: 11px;
}

.contact-links {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 8px 7px;
}

.contact-links a,
.contact-links button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 28px;
  padding: 4px 7px;
  color: #15324d;
  text-align: left;
  font-size: 12px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
}

.contact-links a:hover,
.contact-links a:focus-visible,
.contact-links button:hover,
.contact-links button:focus-visible {
  border-color: #7da8ca;
  background: linear-gradient(90deg, #e4f3ff, #f8fcff);
  outline: 0;
}

.contact-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: #f7fbff;
}

.contact-panel-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px 14px 11px;
  border-bottom: 1px solid #c3d4e0;
  background:
    linear-gradient(180deg, #ffffff, #eef6fb);
}

.contact-panel-header img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.22));
}

.contact-panel-header h2 {
  margin: 0 0 3px;
  color: #11385b;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: 0;
}

.contact-panel-header p {
  max-width: 62ch;
  margin: 0;
  color: #485d6e;
  font-size: 12px;
  line-height: 1.35;
}

.contact-form {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 9px;
  min-height: 0;
  padding: 12px 14px 14px;
  overflow: auto;
  scrollbar-color: #8baeca #edf6fb;
}

.contact-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.contact-presets legend {
  width: 100%;
  margin-bottom: 1px;
  color: #354c5f;
  font-size: 12px;
  font-weight: 600;
}

.contact-presets label {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.contact-presets input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.contact-presets span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px;
  color: #16324c;
  font-size: 12px;
  line-height: 1.2;
  border: 1px solid #8baeca;
  border-radius: 3px;
  background: linear-gradient(#ffffff, #dbeaf5 52%, #c1d9ea);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.76);
  cursor: pointer;
}

.contact-presets input:checked + span {
  border-color: #4e87b4;
  color: #062a49;
  background: linear-gradient(#d8efff, #a9d5f4 50%, #82b9df);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.72),
    0 0 0 1px rgba(54,121,172,.22);
}

.contact-presets input:focus-visible + span {
  outline: 1px dotted #1f4f78;
  outline-offset: 2px;
}

.contact-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.contact-field span {
  color: #354c5f;
  font-size: 12px;
  font-weight: 600;
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  min-width: 0;
  color: #142634;
  font: 13px/1.35 "Segoe UI", Tahoma, Arial, sans-serif;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  background: #ffffff;
  box-shadow:
    inset 1px 1px 2px rgba(40,70,90,.18),
    0 1px 0 rgba(255,255,255,.8);
}

.contact-field input {
  height: 28px;
  padding: 4px 7px;
}

.contact-field textarea {
  min-height: 132px;
  height: 100%;
  resize: vertical;
  padding: 7px;
}

.contact-field input:focus,
.contact-field textarea:focus {
  border-color: #3c7fb1;
  outline: 0;
  box-shadow:
    inset 1px 1px 2px rgba(40,70,90,.14),
    0 0 0 1px #8fc7ee;
}

.contact-message-field {
  min-height: 150px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
  padding-top: 1px;
}

.contact-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 28px;
  min-width: 92px;
  padding: 4px 12px;
  color: #102334;
  font-size: 12px;
  line-height: 1.2;
  border: 1px solid #6f8faa;
  border-radius: 2px;
  background: linear-gradient(#ffffff, #e1eef7 48%, #bfd7ea);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.76);
}

.contact-actions button:hover,
.contact-actions button:focus-visible {
  border-color: #3c7fb1;
  background: linear-gradient(#ffffff, #d8efff 48%, #9fd1f2);
  outline: 0;
}

.contact-actions button:active {
  background: linear-gradient(#b6d7ef, #e9f6ff);
}

.contact-actions .contact-primary {
  border-color: #2d729f;
  color: #062741;
  background: linear-gradient(#ffffff, #c9e9fb 46%, #83c1e7);
}

.contact-status {
  min-height: 24px;
  margin: 0;
  padding: 5px 10px;
  color: #304657;
  font-size: 12px;
  line-height: 1.2;
  border-top: 1px solid #a4bccd;
  background:
    linear-gradient(180deg, #edf5fa, #d9e8f2);
}

.contact-command-icon,
.contact-nav-icon,
.contact-button-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.contact-mail-icon {
  border: 1px solid #5b88a6;
  border-radius: 2px;
  background:
    linear-gradient(135deg, transparent 46%, #5b88a6 47% 52%, transparent 53%),
    linear-gradient(45deg, transparent 46%, #5b88a6 47% 52%, transparent 53%),
    linear-gradient(#ffffff, #cfe4f2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72);
}

.contact-copy-icon::before,
.contact-copy-icon::after {
  content: "";
  position: absolute;
  border: 1px solid #557d99;
  border-radius: 2px;
  background: linear-gradient(#ffffff, #dceaf3);
}

.contact-copy-icon::before {
  left: 5px;
  top: 3px;
  width: 8px;
  height: 10px;
}

.contact-copy-icon::after {
  left: 2px;
  top: 6px;
  width: 8px;
  height: 9px;
}

.contact-link-icon {
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #ffffff 0 18%, transparent 19%),
    linear-gradient(90deg, transparent 43%, #557d99 44% 56%, transparent 57%),
    linear-gradient(#dff1fc, #8dbfe2);
  border: 1px solid #557d99;
}

.contact-clear-icon::before,
.contact-clear-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 7px;
  width: 11px;
  height: 2px;
  border-radius: 2px;
  background: #8a2f2f;
}

.contact-clear-icon::before {
  transform: rotate(45deg);
}

.contact-clear-icon::after {
  transform: rotate(-45deg);
}

@media (max-width: 1200px) {
  .win7-app-window.contact-window {
    width: min(780px, 82vw);
    height: min(600px, calc(100vh - var(--taskbar-h) - 42px));
  }
}

@media (max-width: 899px), (max-height: 690px) {
  .win7-app-window.contact-window {
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: calc(100vw - 16px);
    height: auto;
    min-width: 0;
    min-height: 0;
    margin: 8px;
  }

  .contact-workspace {
    grid-template-columns: 1fr;
  }

  .contact-sidebar {
    display: none;
  }

  .contact-form {
    overflow: visible;
  }
}
