:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  background: #080a0b;
  color: #f4f4f5;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.06), transparent 30rem),
    linear-gradient(145deg, #111416, #050606 65%);
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(100% - 2rem, 900px);
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 0 0.25rem;
  color: #8f9499;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.brand-mark {
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.75rem;
  background: rgba(11, 13, 14, 0.82);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.compact {
  max-width: 430px;
  margin: 12vh auto 0;
  padding: 2.25rem;
}

.compose {
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: #8f9499;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.1;
}

.lead {
  margin: 0.85rem 0 1.75rem;
  color: #b6bbc0;
  line-height: 1.55;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

form {
  margin: 0;
}

label {
  display: block;
  margin: 1rem 0 0.45rem;
  color: #d6d8da;
  font-size: 0.84rem;
  font-weight: 700;
}

label span {
  color: #777d82;
  font-weight: 400;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 0.8rem;
  outline: none;
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

input {
  height: 3rem;
  padding: 0 0.9rem;
}

textarea {
  min-height: 15rem;
  padding: 0.9rem;
  line-height: 1.55;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.065);
}

.attachment-input {
  height: auto;
  padding: 0.55rem;
  color: #969ba0;
  cursor: pointer;
}

.attachment-input::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.55rem 0.8rem;
  border: 0;
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.1);
  color: #e3e5e7;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.attachment-list {
  margin-top: 0.5rem;
  color: #777d82;
  font-size: 0.74rem;
}

.attachment-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.38rem 0.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.attachment-list div > span {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
}

.attachment-list strong {
  overflow: hidden;
  color: #bfc3c6;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-remove {
  min-height: auto;
  padding: 0.35rem 0.65rem;
  background: rgba(255, 255, 255, 0.07);
  color: #aeb2b6;
  font-size: 0.7rem;
  font-weight: 600;
  flex: 0 0 auto;
}

.attachment-remove:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.attachment-list p {
  margin: 0.5rem 0 0;
  color: #f0b0b0;
}

.signature-option {
  margin-top: 0.65rem;
}

.signature-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.35rem 0;
  cursor: pointer;
}

.signature-toggle input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: #f4f4f5;
}

.signature-toggle span {
  color: #c8cbce;
  font-size: 0.8rem;
  font-weight: 600;
}

.signature-preview {
  margin-top: 0.35rem;
  padding: 0.85rem 1rem;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
  color: #aeb2b6;
  transition: opacity 0.18s ease;
}

.signature-toggle:has(input:not(:checked)) + .signature-preview {
  opacity: 0.3;
}

.signature-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.signature-content img {
  width: 5.5rem;
  height: auto;
  opacity: 0.86;
}

.signature-preview p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
}

button {
  min-height: 2.75rem;
  padding: 0.7rem 1.15rem;
  border: 0;
  border-radius: 999px;
  background: #f4f4f5;
  color: #111;
  font-weight: 750;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: #fff;
}

button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.button-secondary {
  min-height: 2.25rem;
  padding: 0.45rem 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  color: #d6d8da;
  font-size: 0.78rem;
}

.button-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.13);
}

.sender-line {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  color: #8f9499;
  font-size: 0.82rem;
}

.sender-line strong {
  color: #e8e9ea;
}

.sender-line small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.notice {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.055);
  color: #d8dadd;
  font-size: 0.86rem;
  line-height: 1.45;
}

.notice-success {
  border-color: rgba(109, 205, 145, 0.28);
  color: #a8dfbc;
}

.notice-error {
  border-color: rgba(235, 111, 111, 0.28);
  color: #f0b0b0;
}

.notice-warning {
  border-color: rgba(225, 190, 103, 0.25);
  color: #dfc98f;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.form-actions span {
  color: #777d82;
  font-size: 0.74rem;
}

@media (max-width: 600px) {
  .shell {
    width: min(100% - 1rem, 900px);
    padding-top: 0.75rem;
  }

  .compact {
    margin-top: 8vh;
    padding: 1.5rem;
  }

  .panel-heading,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-heading form,
  .panel-heading button,
  .form-actions button {
    width: 100%;
  }

  .sender-line {
    grid-template-columns: auto 1fr;
  }

  .sender-line small {
    grid-column: 1 / -1;
  }

  .signature-content {
    gap: 0.75rem;
  }

  .signature-content img {
    width: 4.25rem;
  }
}
