:root {
  color-scheme: dark;
  --ink: #f2f2f2;
  --muted: #a2a2a2;
  --panel: #0a0a0a;
  --panel-border: #1a1a1a;
  --accent: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.08);
  --shadow: rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "SFMono-Regular", "Menlo", "Consolas", "Courier New", monospace;
  color: var(--ink);
  background-color: #050505;
  background-image: none;
  padding: 32px;
}

.bg-shape {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(0px);
  opacity: 0;
  pointer-events: none;
}

.bg-shape-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 60%);
  top: -140px;
  right: -140px;
}

.bg-shape-2 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 60%);
  bottom: -110px;
  left: -110px;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.app::before {
  content: none;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--muted);
  margin-bottom: 6px;
}

h1 {
  margin: 0;
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 28px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.byline {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.byline a {
  color: var(--ink);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.byline a:hover {
  opacity: 0.7;
}

.header-actions {
  display: flex;
  gap: 10px;
}

button {
  border: 1px solid var(--panel-border);
  background: #0a0a0a;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.45);
  border-color: #2a2a2a;
}

button.primary {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
  box-shadow: none;
}

.app-main {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(360px, 1fr);
  gap: 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 20px;
  box-shadow: 0 14px 28px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.panel::after {
  content: none;
}

.panel-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  color: var(--muted);
}

.block-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow: auto;
  padding-right: 4px;
}

.block-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: #080808;
  cursor: pointer;
  gap: 8px;
  color: var(--muted);
}

.block-item.active {
  border-color: #2a2a2a;
  background: #0e0e0e;
  font-weight: 600;
  color: var(--ink);
}

.block-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.editor label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.editor input,
.editor select,
.editor textarea {
  font-family: "IBM Plex Mono", "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  background: #070707;
  color: var(--ink);
}

.editor input:focus,
.editor select:focus,
.editor textarea:focus {
  outline: none;
  border-color: #2a2a2a;
  box-shadow: none;
}

.editor textarea {
  resize: vertical;
  min-height: 140px;
}

.editor .row {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
}

.editor-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.raw {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.raw textarea {
  min-height: 160px;
  font-family: "IBM Plex Mono", "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.raw-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

.preview-panel {
  min-height: 620px;
}

.preview-shell {
  background: #070707;
  border-radius: 6px;
  padding: 18px;
  border: 1px solid #1a1a1a;
}

.preview {
  background: #f5f5f5;
  border-radius: 2px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  border: 1px solid #141414;
}

.email-block {
  padding: 20px 28px 22px;
  border-bottom: 2px solid #d7d7d7;
  font-family: "Times New Roman", Times, serif;
  font-size: 17px;
  line-height: 1.38;
  color: #1a1a1a;
}

.email-block:last-child {
  border-bottom: none;
}

.email-header {
  display: grid;
  grid-template-columns: 90px 1fr;
  row-gap: 2px;
  column-gap: 10px;
}

.email-label {
  font-weight: 700;
}

.email-body {
  margin-top: 14px;
  white-space: pre-wrap;
}

.email-footer {
  margin-top: 14px;
}

.redact {
  display: inline-block;
  background: #000;
  color: transparent;
  padding: 0 0.14em;
  border-radius: 0;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

@media (max-width: 980px) {
  body {
    padding: 20px;
  }

  .app-main {
    grid-template-columns: 1fr;
  }

  .header-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .block-actions {
    grid-template-columns: 1fr;
  }

  .raw-actions {
    grid-template-columns: 1fr;
  }

  .editor .row {
    grid-template-columns: 1fr;
  }
}
