/* ==========================================================
   ADMIN PAGE · Midnight Blue Theme
   Uses tokens.css and style.css (top bar, sign-in card),
   then adds the admin layout: a 220 px side menu and a
   fluid 12-column content area.
   ========================================================== */

.admin-body { padding-bottom: 0 !important; background: var(--bg-main); }

.admin-tag {
  font: 500 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--r-pill); border: 1px solid rgba(255, 90, 95, .5); color: var(--spark);
}

/* ---------- Sign-in gate ---------- */

.admin-gate { min-height: calc(100vh - 64px); display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px; }
.admin-gate .auth-card { display: flex; flex-direction: column; gap: 14px; }
.admin-gate form { display: flex; flex-direction: column; gap: 14px; }
.as-link { text-decoration: none; }

/* ---------- Layout: side menu + content ---------- */

.admin-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 64px); }

.admin-nav {
  position: sticky; top: 64px; align-self: start; height: calc(100vh - 64px);
  display: flex; flex-direction: column; gap: 4px; padding: 20px 12px;
  border-right: 1px solid var(--line); background: var(--bg2);
}
.admin-nav-item {
  display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border-radius: 10px;
  font-weight: 600; font-size: 14px; color: var(--body);
}
.admin-nav-item:hover { background: var(--raised); color: var(--text); }
.admin-nav-item.active { background: var(--accent-glow); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.admin-nav-item.active svg { color: var(--accent); }
.admin-nav-mode { margin-top: auto; padding: 10px 12px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.admin-nav-mode.is-live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #5BD69A; margin-right: 8px; vertical-align: middle; }

.admin-main { padding: 32px 32px 120px; max-width: 1280px; width: 100%; }
.admin-view { display: flex; flex-direction: column; gap: 20px; }

.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.view-title { font-size: 32px; font-weight: 800; }
.view-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.view-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */

.btn {
  height: 40px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: 600 14px var(--font-body); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--raised); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--text); color: var(--bg-main); border-color: var(--text); }
.btn-primary:hover:not(:disabled) { background: var(--body); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--story-red); border-color: rgba(255, 90, 95, .45); background: transparent; }
.btn-danger:hover:not(:disabled) { background: rgba(255, 90, 95, .1); }
.btn-danger-text { color: var(--story-red); border-color: transparent; }
.btn-danger-text:hover:not(:disabled) { background: rgba(255, 90, 95, .1); }
.btn-danger-solid { background: var(--story-red); color: var(--on-spark); border-color: var(--story-red); }
.btn-danger-solid:hover:not(:disabled) { background: #FF7478; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.icon-btn { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 12px; }
.icon-btn:disabled { opacity: .3; cursor: default; }
.back-link { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.back-link:hover { color: var(--text); }

/* ---------- Inputs ---------- */

.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-input);
  border: 1px solid var(--field); background: var(--bg-main); color: var(--text); font: 14px var(--font-body);
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input:disabled { opacity: .6; }
textarea.input { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.select { width: auto; min-width: 180px; cursor: pointer; }
.search { max-width: 320px; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: 13px; font-weight: 600; color: var(--body); }
.hint { font-size: 12.5px; color: var(--muted); }
.input-row { display: flex; gap: 8px; }
.range { width: 100%; accent-color: var(--accent); }

/* ---------- Stats, toolbar, bulk bar ---------- */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; gap: 2px; }
.stat-value { font: 800 30px var(--font-head); }
.stat-label { font-size: 13px; color: var(--muted); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.files-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; font-size: 12.5px; color: var(--muted); }

.bulk-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px;
  background: var(--accent-glow); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.bulk-count { font-weight: 700; font-size: 14px; margin-right: 8px; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--bg2);
  font: 500 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: color-mix(in srgb, var(--raised) 60%, transparent); }
.data-table tr.selected td { background: var(--accent-glow); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .check { width: 44px; }
.data-table .check input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.data-table .order { width: 110px; }
.data-table .actions { text-align: right; white-space: nowrap; }
.data-table .actions .btn + .btn { margin-left: 6px; }
.data-table .wrap { overflow-wrap: anywhere; }
.data-table .nowrap { white-space: nowrap; }
.data-table .empty { text-align: center; color: var(--muted); padding: 32px; }
.data-table .empty.error { color: var(--story-red); }
.order-num { display: inline-block; width: 24px; font-variant-numeric: tabular-nums; color: var(--muted); }
.order-btns { display: inline-flex; gap: 4px; }
.row-title { display: block; font-weight: 600; }
.row-title:hover { color: var(--accent); }
.row-sub { display: block; font-size: 12px; color: var(--muted); }
.comment-cell { max-width: 420px; color: var(--body); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.table-foot { font-size: 13px; color: var(--muted); }
.table-note { font-size: 12.5px; color: var(--muted); }

.pill {
  display: inline-block; font: 500 10.5px var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.pill-admin { color: var(--spark); border-color: rgba(255, 90, 95, .5); background: rgba(255, 90, 95, .08); }
.pill-on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.pill-warn { color: #F2B84B; border-color: rgba(242, 184, 75, .5); }
.pill-published { color: #5BD69A; border-color: rgba(91, 214, 154, .5); background: rgba(91, 214, 154, .08); }
.pill-scheduled { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-glow); }
.pill-hidden { border-style: dashed; }

/* ---------- Postings: sub-tabs and notice ---------- */

.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.subtab { height: 42px; padding: 0 16px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; cursor: pointer; margin-bottom: -1px; }
.subtab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.subtab-count { color: var(--muted); font-weight: 500; }
.subview { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }
#postingsList { display: flex; flex-direction: column; gap: 20px; }

.notice { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 14px; border: 1px dashed var(--accent); background: var(--accent-glow); }
.notice-title { font-weight: 700; }
.notice-text { font-size: 13.5px; color: var(--body); }

/* ---------- Chapter editor ---------- */

.editor { display: flex; flex-direction: column; gap: 20px; }
.editor-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
/* Publish on: date · time · time zone */
.when-row { display: grid; grid-template-columns: 1.1fr .8fr 1.6fr; gap: 8px; }
@media (max-width: 600px) { .when-row { grid-template-columns: 1fr 1fr; } .when-row select { grid-column: 1 / -1; } }
.span-2 { grid-column: span 2; }
.status-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--body); min-height: 40px; }

.editor-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.editor-pane { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.md-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.md-btn { height: 32px; padding: 0 10px; border-radius: 8px; border: 0; background: transparent; font-size: 13px; font-weight: 500; cursor: pointer; }
.md-btn:hover { background: var(--raised); }
.md-help { margin-left: auto; color: var(--accent); }
.md-help-box { padding: 12px 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); font-size: 13px; color: var(--body); display: flex; flex-direction: column; gap: 6px; }
.editor-text { min-height: 560px; font: 14px/1.7 var(--font-mono); }
.preview-pane { position: sticky; top: 84px; }
.pane-label { font: 500 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.hint-inline { margin-left: 8px; text-transform: none; letter-spacing: 0; font-family: var(--font-body); }
.editor-preview { max-height: calc(100vh - 140px); overflow-y: auto; padding: 24px 28px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-main); }
.preview-title { font-size: 30px; margin-bottom: 20px; }
.editor-preview .story-content { font-size: 16px; }

/* ---------- Design page ---------- */

.design-layout { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
.design-form { display: flex; flex-direction: column; gap: 14px; }
.panel { margin: 0; padding: 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; gap: 14px; }
.panel legend { padding: 0 6px; font: 700 15px var(--font-head); }
.color-grid { display: flex; flex-direction: column; gap: 12px; }
.color-field { display: flex; gap: 12px; align-items: flex-start; }
.color-field input[type="color"] { width: 44px; height: 44px; padding: 0; border: 1px solid var(--field); border-radius: 10px; background: none; cursor: pointer; flex-shrink: 0; }
.color-text { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.color-text label { font-size: 13px; font-weight: 600; }
.color-text small { font-size: 12px; color: var(--muted); }
.banner-thumb { height: 110px; border-radius: 10px; border: 1px solid var(--line); background: var(--raised) center / cover; }
.banner-thumb.empty { background-image: none; }
.reaction-edit { display: flex; flex-direction: column; gap: 8px; }
.reaction-row { display: grid; grid-template-columns: 64px 1fr; gap: 8px; }
.emoji-input { text-align: center; font-size: 18px; }
.switch-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switch-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.switch-row strong { display: block; font-size: 14px; }
.switch-row small { display: block; font-size: 12.5px; color: var(--muted); }
.design-preview { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 8px; }
.design-preview iframe { width: 100%; height: calc(100vh - 200px); min-height: 520px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-main); }

.save-bar {
  position: sticky; bottom: 16px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px 12px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}
.save-bar.dirty { border-color: var(--spark); }
.save-bar.dirty .save-state::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--spark); margin-right: 8px; box-shadow: 0 0 8px var(--spark-glow); }
.save-state { font-size: 13.5px; color: var(--body); }
.save-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Dialogs ---------- */

.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(4, 6, 12, .7); backdrop-filter: blur(4px); }
.modal-card { width: 100%; max-width: 460px; padding: 24px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.modal-title { font-size: 22px; font-weight: 800; }
.modal-text { font-size: 14px; color: var(--body); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.dm-list { margin: 0; padding: 10px 14px 10px 30px; border-radius: 10px; background: var(--bg2); font-size: 13.5px; color: var(--body); max-height: 160px; overflow-y: auto; }
.dm-list b { color: var(--text); }
.dm-type { font-size: 13px; color: var(--body); }
.dm-type b { font-family: var(--font-mono); color: var(--story-red); }
.dm-error { color: var(--story-red); font-size: 13px; }
.dm-error:empty { display: none; }

/* ---------- Tablet and phones ---------- */

@media (max-width: 1100px) {
  .design-layout { grid-template-columns: 1fr; }
  .design-preview { position: static; }
  .editor-body { grid-template-columns: 1fr; }
  .preview-pane { position: static; }
  .editor-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav {
    position: sticky; top: 58px; z-index: 6; height: auto; flex-direction: row; overflow-x: auto;
    padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .admin-nav-mode { display: none; }
  .admin-tag { display: none; }
  .admin-top .control-pill { white-space: nowrap; padding: 0 10px; }
  .admin-main { padding: 20px 16px 100px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-meta { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .search, .select { max-width: none; flex: 1 1 100%; }

  /* Tables turn into stacked cards on phones */
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { position: relative; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .data-table td { border: 0; padding: 4px 14px 4px 52px; }
  .data-table td[data-label]::before { content: attr(data-label); display: block; font: 500 10px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .data-table td.check { position: absolute; left: 0; top: 12px; width: 44px; padding: 4px 14px; }
  .data-table td.order { padding-left: 52px; }
  .data-table td.num { text-align: left; }
  .data-table td.actions { text-align: left; }
}

/* ---------- Languages ---------- */

/* Chapter editor: one tab per language */
.lang-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.lang-tab {
  height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: transparent; color: var(--body); font: 600 13.5px var(--font-body); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.lang-tab small { font-weight: 400; font-size: 11.5px; color: var(--muted); }
.lang-tab .dot { width: 7px; height: 7px; border-radius: 50%; background: #5BD69A; }
.lang-tab[aria-selected="true"] { background: var(--accent-glow); border-color: var(--accent); color: var(--text); }
.pill-lang { color: var(--body); }

/* Design page: a group of boxes per language */
.lang-group { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.lang-group + .lang-group { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.lang-group-title { font-weight: 700; }
.lang-group-title .mono { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }

/* Members: profile picture next to the username */
.m-user { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.m-avatar { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--raised); border: 1px solid var(--line); font: 700 12px var(--font-head); color: var(--text); }
.m-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-avatar.has-photo { border-color: transparent; }

/* ---------- Email: delivery and newsletter ---------- */

.panel-title { font: 700 18px var(--font-head); color: var(--text); }
.email-status { font-size: 14px; color: var(--body); line-height: 1.6; }
.nl-form { display: flex; flex-direction: column; gap: 16px; }

/* The editor: a toolbar on top of a writing area that looks like the email */
.nl-editor { border: 1px solid var(--field); border-radius: var(--r-input); background: var(--bg-main); overflow: hidden; }
.nl-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.nl-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  padding: 6px; border-bottom: 1px solid var(--line); background: var(--card);
}
.nl-tool {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--body);
  font: 600 15px var(--font-body); cursor: pointer;
}
.nl-tool:hover { background: var(--raised); color: var(--text); }
.nl-tool[aria-pressed="true"] { background: var(--accent-glow); border-color: var(--accent); color: var(--text); }
.nl-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nl-tool b, .nl-tool i, .nl-tool u, .nl-tool s { font-family: Georgia, 'Times New Roman', serif; font-size: 16px; }
.nl-sep { width: 1px; height: 22px; margin: 0 4px; background: var(--line); }

.nl-body {
  min-height: 340px; max-height: 70vh; overflow-y: auto;
  padding: 18px 20px; color: var(--text); font: 16px/1.65 var(--font-body); outline: none;
}
.nl-body:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.nl-body > :first-child { margin-top: 0; }
.nl-body p, .nl-body div { margin: 0 0 14px; }
.nl-body h2 { margin: 24px 0 10px; font: 700 24px/1.25 var(--font-head); }
.nl-body h3 { margin: 20px 0 8px; font: 700 19px/1.3 var(--font-head); }
.nl-body ul, .nl-body ol { margin: 0 0 14px; padding-left: 24px; }
.nl-body ul { list-style: disc; }
.nl-body ol { list-style: decimal; }
.nl-body li { margin: 0 0 6px; }
.nl-body blockquote { margin: 0 0 14px; padding: 2px 0 2px 16px; border-left: 3px solid var(--accent); color: var(--body); }
.nl-body a { color: var(--accent); text-decoration: underline; }
.nl-body hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.nl-body img { display: block; max-width: min(100%, 544px); height: auto; margin: 0 0 14px; border-radius: 8px; cursor: default; }
.nl-body img.is-picked { outline: 3px solid var(--accent); outline-offset: 2px; }
.nl-body img.is-uploading { opacity: .5; }
.nl-foot { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); background: var(--card); }
.nl-file { height: auto; padding: 8px; }

/* Preview: the real email, as readers get it */
.nl-preview-card { max-width: 720px; max-height: calc(100vh - 32px); }
.nl-preview-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.nl-preview-size { display: flex; gap: 6px; }
.nl-preview-size .btn[aria-pressed="true"] { background: var(--raised); border-color: var(--accent); }
.nl-preview-frame { width: 100%; max-width: 640px; height: 62vh; margin: 0 auto; border: 1px solid var(--line); border-radius: 12px; background: #F4F6FA; transition: max-width .2s; }
.nl-preview-frame.is-phone { max-width: 375px; }

@media (max-width: 600px) {
  .nl-body { padding: 14px; min-height: 260px; }
  .nl-tool { width: 34px; height: 34px; }
}

/* Picture size bar: shows while a picture in the newsletter is selected */
.nl-imgbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--raised); }
.nl-imgbar[hidden] { display: none; }
.nl-imgbar-label { font-size: 12.5px; font-weight: 600; color: var(--body); margin-right: 4px; }
.nl-imgbar .btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-glow); }
.nl-imgbar-range { display: inline-flex; width: 140px; }
.nl-imgbar-px { font: 12px var(--font-mono); color: var(--muted); min-width: 52px; }
.nl-imgbar-alt { flex: 1 1 200px; }
.nl-imgbar-alt .input { height: 34px; font-size: 13px; }
.nl-body img[width] { margin-left: auto; margin-right: auto; }

/* Delivery lists */
.email-list { border-top: 1px solid var(--line); padding-top: 12px; }
.email-list summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--text); }
.email-list[open] summary { margin-bottom: 8px; }
.email-list .hint { margin-bottom: 10px; }
.email-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.email-table th { text-align: left; padding: 9px 12px; font: 600 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.email-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--body); vertical-align: top; }
.email-table tr:last-child td { border-bottom: 0; }
.email-table .em { color: var(--text); word-break: break-all; }
.email-table .detail { color: var(--muted); max-width: 360px; }
.mail-pill { display: inline-block; padding: 1px 8px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; border: 1px solid var(--line); white-space: nowrap; }
.mail-pill.ok { color: #5BD69A; border-color: rgba(91, 214, 154, .4); }
.mail-pill.bad { color: var(--story-red); border-color: rgba(255, 90, 95, .45); }
.mail-pill.wait { color: #E8B04B; border-color: rgba(232, 176, 75, .45); }
[data-theme="light"] .mail-pill.ok { color: #1E7A4C; border-color: rgba(30, 122, 76, .4); }
[data-theme="light"] .mail-pill.wait { color: #8A5A00; border-color: rgba(138, 90, 0, .4); }
.nl-body img[width][data-align="left"] { margin-left: 0; margin-right: auto; }
.nl-body img[width][data-align="right"] { margin-left: auto; margin-right: 0; }
.nl-imgbar-group { display: inline-flex; gap: 2px; padding: 0 4px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.nl-imgbar-group .nl-tool { width: 32px; height: 32px; }
.nl-imgbar-group .nl-tool:disabled { opacity: .35; cursor: default; }

/* Text size: A− 16 A+ */
.nl-a { font: 700 13px var(--font-body); }
.nl-a-lg { font-size: 17px; }
.nl-pm { font: 700 11px var(--font-body); margin-left: 1px; transform: translateY(-4px); }
.nl-size { min-width: 26px; text-align: center; font: 600 12px var(--font-mono); color: var(--muted); }
