/* ---------- The desk (admin) ---------- */
.admin .frame { padding-top: 0; }

.admin-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  max-width: 882px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background-color: var(--sheet);
  background-image: url("sheet-paper.svg");
  background-size: 600px 600px;
  box-shadow: var(--sheet-shadow);
  font-family: "Cheltenham", Georgia, serif;
  font-size: 14px;
  color: var(--ink-soft);
}
.admin-bar a { text-decoration: none; }
.admin-bar a:hover { color: var(--ink); }
.admin-bar-title { font-family: "Bellefair", serif; letter-spacing: 0.2em; text-transform: uppercase; font-size: 13px; color: var(--accent); }
.admin-bar-actions { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.admin-bar-actions form { margin: 0; }

.status-chip {
  font-family: "Bellefair", serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 3px 9px;
  border: 1px solid currentColor;
}
.status-chip.is-draft { color: #8a6a2e; }
.status-chip.is-live { color: #3f6e45; }

.desk-button {
  font-family: "Bellefair", serif;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sheet);
  background: var(--accent);
  border: 1px solid var(--accent);
  padding: 9px 18px 9px 20px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.desk-button:hover { background: #22304b; }
.link-button {
  font: inherit;
  color: var(--ink-soft);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.link-button:hover { color: var(--ink); text-decoration: underline; }
.link-button.danger { color: #9c3a33; }

.desk-flash {
  font-family: "Cheltenham", Georgia, serif;
  font-style: italic;
  text-align: center;
  color: #3f6e45;
  margin: 0 0 24px;
}
.bar-flash { font-style: italic; color: #3f6e45; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.admin-bar a, .admin-bar button, .admin-bar .status-chip, .admin-bar .bar-flash { white-space: nowrap; }
.desk-new { text-align: center; margin: 0 0 40px; }
.draft-tag {
  font-family: "Bellefair", serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a6a2e;
  border: 1px solid currentColor;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: 2px;
}

/* sign-in */
.login-sheet { max-width: 520px; padding: 64px 72px 72px; }
.login-form { text-align: center; }
.login-line { color: var(--typewriter-ink); margin: 0 0 28px; }
.login-form input {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 8px auto 20px;
  font: inherit;
  text-align: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(90, 78, 60, 0.4);
  padding: 8px 0;
  outline: none;
}
.login-error { color: #9c3a33; font-family: "Cheltenham", Georgia, serif; font-style: italic; margin: -8px 0 18px; }

/* editor: fields sit on the sheet like the typed letter */
.editor { width: 100%; display: flex; flex-direction: column; align-items: center; }
.editor-sheet input,
.editor-sheet .rte { color: var(--typewriter-ink); }
.editor-sheet input {
  font: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed rgba(90, 78, 60, 0.28);
  padding: 2px 0;
  outline: none;
}
.editor-sheet input:focus { border-bottom-color: var(--accent); }
.editor-sheet ::placeholder { color: var(--ink-faint); opacity: 0.75; }
.location-input {
  font-family: "Bellefair", serif !important;
  font-size: 11.5px !important;
  letter-spacing: 0.2em !important;
  text-transform: uppercase;
  text-align: center;
  color: var(--accent) !important;
  width: min(100%, 320px);
}
.editor-to {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin: -16px 0 32px;
  padding: 10px 0;
  border-top: 1px solid rgba(90, 78, 60, 0.12);
  border-bottom: 1px solid rgba(90, 78, 60, 0.12);
}
.editor-to input { flex: 1; min-width: 180px; }
.editor-hint { font-family: "Cheltenham", Georgia, serif; font-style: italic; font-weight: 300; font-size: 12px; color: var(--ink-faint); }
.date-input { text-align: right; }
.line-input { width: 100%; max-width: 360px; }

.rte { outline: none; min-height: 1.5em; }
.rte.body { min-height: 16em; }
.rte:empty::before,
.rte.is-empty::before { content: attr(data-placeholder); color: var(--ink-faint); opacity: 0.75; pointer-events: none; }
.rte:focus { box-shadow: inset 2px 0 0 rgba(44, 59, 90, 0.25); }
.rte p { text-indent: 0; }
.rte.body p { margin: 0 0 1.05em; }
.rte a { color: var(--accent); }
.rte.postscript { margin-top: 40px; }

.rte-toolbar {
  position: sticky;
  top: 64px;
  z-index: 10;
  display: inline-flex;
  gap: 2px;
  margin: 0 0 14px;
  padding: 4px;
  background: rgba(248, 244, 234, 0.92);
  box-shadow: 0 1px 2px rgba(30, 18, 14, 0.15), 0 4px 12px rgba(30, 18, 14, 0.1);
}
.rte-toolbar button {
  font-family: "Cheltenham", Georgia, serif;
  font-size: 13px;
  min-width: 34px;
  padding: 5px 9px;
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  cursor: pointer;
}
.rte-toolbar button:hover { background: rgba(44, 59, 90, 0.08); color: var(--ink); }

.delete-form { max-width: 882px; width: 100%; margin: 20px auto 0; text-align: right; font-family: "Cheltenham", Georgia, serif; font-size: 13px; }
.admin .frame { flex-direction: column; }

/* desk tabs */
.desk-tabs { display: flex; gap: 18px; margin-left: 12px; }
.desk-tab { color: var(--ink-soft); padding: 2px 0; border-bottom: 1px solid transparent; }
.desk-tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.desk-count { font-size: 11px; font-family: "Bellefair", serif; color: var(--sheet); background: #9c3a33; border-radius: 9px; padding: 1px 6px; margin-left: 2px; vertical-align: 1px; }
.desk-count.is-quiet { background: none; color: var(--ink-faint); padding: 0; }
.desk-muted { color: var(--ink-faint); font-style: italic; font-family: "Cheltenham", Georgia, serif; font-weight: 300; }
.desk-empty { text-align: center; }

/* postcards inbox */
.desk-postcard {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1px 220px;
  gap: 24px;
  margin: 0 0 28px;
  padding: 22px 26px;
  background: linear-gradient(rgba(255, 252, 246, 0.5), rgba(255, 252, 246, 0.5));
  box-shadow: 0 1px 2px rgba(30, 18, 14, 0.16), 0 6px 18px rgba(30, 18, 14, 0.12);
}
.desk-postcard::before { content: ""; grid-column: 2; grid-row: 1; background: rgba(90, 78, 60, 0.3); }
.desk-postcard-msg { grid-column: 1; grid-row: 1; color: var(--typewriter-ink); }
.desk-postcard-from { grid-column: 3; grid-row: 1; font-family: "Cheltenham", Georgia, serif; font-size: 14px; }
.desk-postcard-from p { margin: 0 0 8px; }
.desk-postcard-from .contact-label { display: block; margin: 0 0 2px; }
.desk-postcard-dear { margin: 0 0 10px; }
.desk-postcard-text { margin: 0; white-space: normal; }
.is-new-tag { position: absolute; top: 10px; right: 12px; color: #9c3a33; }

/* subscribers */
.desk-sub-actions { display: flex; gap: 20px; align-items: baseline; justify-content: center; margin: -16px 0 28px; font-family: "Cheltenham", Georgia, serif; font-size: 14px; }
.desk-subs li form { margin: 0 0 0 12px; font-family: "Cheltenham", Georgia, serif; font-size: 13px; }

@media (max-width: 560px) {
  .desk-tabs { order: 3; width: 100%; margin-left: 0; }
  .desk-postcard { grid-template-columns: 1fr; }
  .desk-postcard::before { display: none; }
  .desk-postcard-from { grid-column: 1; grid-row: 2; }

  .admin-bar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .admin-bar-actions { gap: 12px; }
  .login-sheet { padding: 40px 28px; }
  .rte-toolbar { top: 92px; }
}
