/*
 * Ember-specific styles. Loaded after main.css.
 *
 * Goal: take the MM design tokens from main.css and assemble a tighter,
 * tool-shaped app shell — closer to Mask's compact desktop UI than the
 * marketing-website spacing of the homepage. We share the tokens, not the
 * spacing.
 */

:root {
    --ember-accent: #e8743b;        /* the .a-ember hue from main.css */
    --mask-accent:   #444444;        /* matches Mask's brand mark color */
    --danger:        #b3261e;
    --success:       #1f7a55;

    --font-body:    "BeVietnamPro-Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif;
    --font-display: "ClashDisplay-Variable", "ClashDisplay-Bold", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root { --mask-accent: #f4f4f6; }
}

/* Override main.css's max-width-1800, overflow:hidden container — that's
   tuned for marketing pages, not a scrolling app. */
body.ember {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
}

.ember-shell {
    max-width: 1280px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.ember-content {
    flex: 1;
    padding: 24px 32px 32px;
}

.ember-content--narrow {
    max-width: 760px;
    margin: 0 auto;
    width: 100%;
}

/* ----------------------------------------------------------------------
   Topbar — Mask-style: brand-row on the left, pill nav, account chip
   ---------------------------------------------------------------------- */

.ember-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--bg);
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.brand-mark {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 9px;
    object-fit: cover;
    display: block;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--heading);
    letter-spacing: -0.01em;
}

.brand-sub {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    margin-top: 1px;
}

.ember-nav {
    display: flex;
    gap: 4px;
    background: var(--bg-softer);
    padding: 4px;
    border-radius: 999px;
    list-style: none;
}

.ember-nav a,
.ember-nav button {
    display: inline-block;
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s;
}

.ember-nav a:hover,
.ember-nav button:hover {
    color: var(--heading);
}

.ember-nav a.is-active {
    background: var(--bg);
    color: var(--heading);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
    .ember-nav a.is-active { background: var(--bg-card); }
}

/* Account chip ---------------------------------------------------------- */

.account {
    position: relative;
}

.account-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-softer);
    border: 1px solid var(--border-soft);
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    color: var(--heading);
    text-decoration: none;
    transition: border-color 0.15s, background-color 0.15s;
}

.account-chip:hover { border-color: var(--border); }

.account-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.account-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    text-align: left;
}

.account-email {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--heading);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-plan {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    margin-top: 1px;
}

.account-plan.is-active { color: var(--success); }
.account-plan.is-trial  { color: var(--primary); }
.account-plan.is-error  { color: var(--danger); }

/* Account dropdown (CSS-only via <details>/<summary>) */
.account details > summary {
    list-style: none;
    cursor: pointer;
}
.account details > summary::-webkit-details-marker { display: none; }

.account-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    padding: 8px;
    z-index: 50;
}

.account-menu-row {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 4px;
    color: var(--text);
    font-size: 0.78rem;
    line-height: 1.45;
}

.account-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 9px 14px;
    font: inherit;
    font-size: 0.85rem;
    color: var(--heading);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.12s;
}

.account-menu-item:hover { background: var(--bg-softer); }

.account-menu-item--danger { color: var(--danger); }

/* ----------------------------------------------------------------------
   Button system — matches Mask. Replaces the marketing-page .btn-cta from
   main.css when used with the new .btn base class.
   ---------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 18px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.18s, color 0.18s, border-color 0.18s, opacity 0.18s;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn.btn-cta {
    background-color: var(--primary);
    color: #ffffff;
}
.btn.btn-cta:hover:not(:disabled) { background-color: var(--primary-light); }

.btn.btn-secondary {
    background-color: var(--mask-accent);
    color: #ffffff;
}
.btn.btn-secondary:hover:not(:disabled) { background-color: #5a5a5a; }

@media (prefers-color-scheme: dark) {
    .btn.btn-secondary { background-color: #2a2a30; color: var(--heading); }
    .btn.btn-secondary:hover:not(:disabled) { background-color: #3a3a42; }
}

.btn.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 9px 16px;
}
.btn.btn-ghost:hover:not(:disabled) {
    color: var(--heading);
    border-color: var(--heading);
}

.btn.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
}
.btn.btn-danger:hover:not(:disabled) { background-color: #8a1d17; }

.btn.btn-sm {
    padding: 7px 12px;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

.btn.btn-block {
    width: 100%;
    padding: 14px 18px;
}

/* ----------------------------------------------------------------------
   Flash banners + form errors
   ---------------------------------------------------------------------- */

.flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 0.9rem;
    line-height: 1.45;
    border: 1px solid transparent;
}

.flash a { color: inherit; text-decoration: underline; }

.flash--success { background: rgba(31, 122, 85, 0.08);  color: var(--success); border-color: rgba(31, 122, 85, 0.18); }
.flash--error   { background: rgba(179, 38, 30, 0.06);  color: var(--danger);  border-color: rgba(179, 38, 30, 0.18); }
.flash--info    { background: rgba(232, 116, 59, 0.08); color: #c25817;        border-color: rgba(232, 116, 59, 0.20); }

@media (prefers-color-scheme: dark) {
    .flash--success { background: rgba(43, 157, 110, 0.16); color: #7fd3ad; }
    .flash--error   { background: rgba(179, 38, 30, 0.18);  color: #f0938b; }
    .flash--info    { background: rgba(232, 116, 59, 0.18); color: #f4a26b; }
}

.field-error {
    color: var(--danger);
    font-size: 0.78rem;
    margin-top: 6px;
}

.ember-form .field input.is-error,
.ember-form .field textarea.is-error,
.ember-form .field select.is-error { border-color: var(--danger); }

.page-actions-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

/* ----------------------------------------------------------------------
   Page sections
   ---------------------------------------------------------------------- */

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.page-head h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.75rem;
    line-height: 1.1;
    color: var(--heading);
    margin-bottom: 4px;
}

.page-head p {
    color: var(--text);
    font-size: 0.92rem;
}

/* Pane — card with header + body, mirrors Mask's .pane */
.pane {
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-soft);
    gap: 12px;
    flex-wrap: wrap;
}

.pane-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    font-weight: 600;
}

.pane-meta {
    font-size: 0.78rem;
    color: var(--text);
}

.pane-body {
    padding: 18px;
}

.pane-body--bare {
    padding: 0;
}

.pane--danger {
    background: rgba(179, 38, 30, 0.04);
    border-color: rgba(179, 38, 30, 0.18);
}
.pane--danger .pane-head { border-bottom-color: rgba(179, 38, 30, 0.18); }
.pane--danger .pane-title { color: var(--danger); }

@media (prefers-color-scheme: dark) {
    .pane--danger { background: rgba(179, 38, 30, 0.10); }
}

/* Row list — replaces main.css's .device-list for tighter app rows */
.row-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-soft);
}

.row:last-child { border-bottom: none; }

.row-main { min-width: 0; flex: 1; }

.row-title {
    color: var(--heading);
    font-weight: 600;
    margin-bottom: 4px;
    text-decoration: none;
    display: inline-block;
}

.row-title:hover { color: var(--primary); }

.row-sub {
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1.4;
}

.row-empty {
    padding: 24px 18px;
    color: var(--text);
    font-size: 0.9rem;
    text-align: center;
}

/* Small × button on dashboard rows for cleaning up dead transfers. */
.row-delete {
    background: transparent;
    border: 1px solid var(--border-soft);
    color: var(--text);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.row-delete:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(179, 38, 30, 0.06);
}

/* Status pills */
.pill {
    display: inline-block;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
}

.pill.is-active       { background: rgba(31, 122, 85, 0.12);  color: var(--success); }
.pill.is-expired      { background: rgba(0, 0, 0, 0.05);      color: var(--text); }
.pill.is-revoked      { background: rgba(232, 116, 59, 0.14); color: #c25817; }
.pill.is-pending      { background: rgba(232, 116, 59, 0.12); color: #c25817; }
.pill.is-unsubscribed { background: rgba(0, 0, 0, 0.05);      color: var(--text); }
.pill.is-bounced      { background: rgba(179, 38, 30, 0.10);  color: var(--danger); }
.pill.is-draft        { background: rgba(0, 0, 0, 0.05);      color: var(--text); }
.pill.is-scheduled    { background: rgba(232, 116, 59, 0.12); color: #c25817; }
.pill.is-sending      { background: rgba(31, 122, 85, 0.12);  color: var(--success); }
.pill.is-sent         { background: rgba(31, 122, 85, 0.12);  color: var(--success); }
.pill.is-shared       { background: rgba(79, 70, 229, 0.10);  color: #4f46e5; }

@media (prefers-color-scheme: dark) {
    .pill.is-active       { background: rgba(43, 157, 110, 0.2); color: #7fd3ad; }
    .pill.is-expired      { background: rgba(255, 255, 255, 0.06); }
    .pill.is-revoked      { background: rgba(232, 116, 59, 0.2);  color: #f4a26b; }
    .pill.is-pending      { background: rgba(232, 116, 59, 0.2);  color: #f4a26b; }
    .pill.is-unsubscribed { background: rgba(255, 255, 255, 0.06); }
    .pill.is-bounced      { background: rgba(179, 38, 30, 0.2);   color: #f0938b; }
    .pill.is-draft        { background: rgba(255, 255, 255, 0.06); }
    .pill.is-scheduled    { background: rgba(232, 116, 59, 0.2);  color: #f4a26b; }
    .pill.is-sending      { background: rgba(43, 157, 110, 0.2);  color: #7fd3ad; }
    .pill.is-sent         { background: rgba(43, 157, 110, 0.2);  color: #7fd3ad; }
    .pill.is-shared       { background: rgba(79, 70, 229, 0.2);   color: #a5a0ff; }
}

/* Checkbox + label row (settings toggles). */
.check-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 4px 0;
}

.check-row input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--primary);
}

.check-row strong {
    display: block;
    color: var(--heading);
    font-weight: 600;
    font-size: 0.92rem;
}

.check-sub {
    display: block;
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1.5;
    margin-top: 4px;
}

/* Plan indicator chip (dashboard + newsletter_show). */
.plan-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    border: 1px solid var(--border-soft);
    color: var(--text);
    background: var(--bg-softer);
}
.plan-chip--ultra {
    background: rgba(232, 116, 59, 0.12);
    border-color: rgba(232, 116, 59, 0.3);
    color: #c25817;
}
@media (prefers-color-scheme: dark) {
    .plan-chip--ultra { background: rgba(232, 116, 59, 0.2); color: #f4a26b; }
}

/* ----------------------------------------------------------------------
   Issue compose (Editor.js host + autosave indicator + schedule pop)
   ---------------------------------------------------------------------- */

.editor-holder {
    min-height: 360px;
    padding: 4px 8px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--bg);
}

.editor-holder .codex-editor,
.editor-holder .codex-editor__redactor {
    color: var(--heading);
}

.autosave-state {
    font-size: 0.78rem;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    min-width: 90px;
    text-align: right;
}
.autosave-state.is-error { color: var(--danger); }

/* The "Schedule…" button is a <details><summary>; expand to show the form. */
.schedule-pop { position: relative; }
.schedule-pop > summary {
    list-style: none;
    display: inline-flex;
    cursor: pointer;
}
.schedule-pop > summary::-webkit-details-marker { display: none; }

.schedule-form {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    z-index: 20;
    margin: 0;
    white-space: nowrap;
}

.schedule-form label {
    display: flex;
    flex-direction: column;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text);
    gap: 4px;
    font-weight: 600;
}

.schedule-form input[type="datetime-local"] {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    font: inherit;
    color: var(--heading);
}

/* ----------------------------------------------------------------------
   Issue stats (sent / opens / open-rate)
   ---------------------------------------------------------------------- */

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.stat {
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 16px 18px;
}

.stat-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--heading);
}

.stat-label {
    margin-top: 6px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text);
    font-weight: 600;
}

/* ----------------------------------------------------------------------
   Rendered issue body (BlockRenderer 'web' mode). Also used by the
   public archive in Phase 6.
   ---------------------------------------------------------------------- */

.issue-preview { max-width: 640px; }
.issue-preview .issue-h2,
.issue-preview .issue-h3,
.issue-preview .issue-h4 {
    font-family: var(--font-display);
    color: var(--heading);
    line-height: 1.2;
    margin: 24px 0 12px;
}
.issue-preview .issue-h2 { font-size: 1.6rem; font-weight: 700; }
.issue-preview .issue-h3 { font-size: 1.25rem; font-weight: 700; }
.issue-preview .issue-h4 { font-size: 1.05rem; font-weight: 600; }

.issue-preview .issue-p,
.issue-preview .issue-list {
    color: var(--text);
    line-height: 1.65;
    font-size: 1rem;
    margin: 0 0 14px;
}
.issue-preview .issue-list { padding-left: 22px; }

.issue-preview .issue-figure {
    margin: 18px 0;
}
.issue-preview .issue-figure img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}
.issue-preview .issue-caption {
    font-size: 0.85rem;
    color: var(--text);
    margin-top: 8px;
    text-align: center;
}

.issue-preview .issue-quote {
    border-left: 3px solid var(--primary);
    padding: 4px 0 4px 16px;
    margin: 18px 0;
    font-style: italic;
    color: var(--heading);
}
.issue-preview .issue-quote cite {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text);
    font-style: normal;
}

.issue-preview .issue-delimiter {
    border: none;
    text-align: center;
    margin: 32px 0;
}
.issue-preview .issue-delimiter::before {
    content: "* * *";
    letter-spacing: 0.5em;
    color: var(--border);
}

.issue-preview .issue-link-card {
    display: block;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    margin: 14px 0;
}
.issue-preview .issue-link-card strong { display: block; color: var(--heading); }
.issue-preview .issue-link-card span   { display: block; color: var(--text); font-size: 0.85rem; margin-top: 4px; }
.issue-preview .issue-link-card small  { display: block; color: var(--text); opacity: 0.7; font-size: 0.75rem; margin-top: 6px; }

.issue-preheader {
    color: var(--text);
    font-size: 0.95rem;
    margin: -4px 0 24px;
    opacity: 0.85;
}

/* ----------------------------------------------------------------------
   Filter tabs (e.g. subscriber list)
   ---------------------------------------------------------------------- */

.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-softer);
    padding: 4px;
    border-radius: 999px;
    width: fit-content;
    flex-wrap: wrap;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text);
    transition: color 0.15s, background-color 0.15s;
}

.tab:hover { color: var(--heading); }

.tab.is-active {
    background: var(--bg);
    color: var(--heading);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
    .tab.is-active { background: var(--bg-card); }
}

.tab-count {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text);
    background: rgba(0, 0, 0, 0.05);
    border-radius: 999px;
    padding: 1px 8px;
}

.tab.is-active .tab-count {
    background: rgba(232, 116, 59, 0.14);
    color: #c25817;
}

@media (prefers-color-scheme: dark) {
    .tab-count               { background: rgba(255, 255, 255, 0.08); }
    .tab.is-active .tab-count { background: rgba(232, 116, 59, 0.2); color: #f4a26b; }
}

/* ----------------------------------------------------------------------
   Public-facing pages (subscribe, confirm, unsubscribe).
   These render with hide_chrome=true so they feel standalone, not part
   of the author dashboard.
   ---------------------------------------------------------------------- */

.public-page {
    max-width: 560px;
    margin: 0 auto;
    padding: 60px 24px 32px;
}

.public-page--center {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}

.public-card {
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    padding: 40px 36px;
    text-align: center;
}

.public-card--narrow { padding: 48px 36px; }

.public-brand {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    margin-bottom: 12px;
    font-weight: 600;
}

.public-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2.2rem;
    color: var(--heading);
    line-height: 1.1;
    margin: 0 0 16px;
}

.public-sub {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.55;
    margin: 0 0 24px;
}

.public-meta {
    font-size: 0.82rem;
    color: var(--text);
    opacity: 0.85;
    margin: 12px 0 0;
}

.public-icon-mail,
.public-icon-check {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

.public-icon-mail  { background: rgba(232, 116, 59, 0.12); color: #c25817; }
.public-icon-check { background: rgba(31, 122, 85, 0.12);  color: var(--success); }

@media (prefers-color-scheme: dark) {
    .public-icon-mail  { background: rgba(232, 116, 59, 0.2); color: #f4a26b; }
    .public-icon-check { background: rgba(43, 157, 110, 0.2); color: #7fd3ad; }
}

.public-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    margin-bottom: 10px;
    text-align: left;
    font-weight: 600;
}

.public-subscribe { text-align: left; margin-top: 28px; }

.public-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.public-row input[type="email"] {
    flex: 1;
    min-width: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    padding: 12px 14px;
    font: inherit;
    color: var(--heading);
}

.public-row input[type="email"]:focus { border-color: var(--primary); }

.public-archive {
    margin-top: 40px;
    padding: 0 8px;
}

.public-archive-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--heading);
    margin: 0 0 12px;
}

.public-archive-empty {
    color: var(--text);
    font-size: 0.9rem;
}

.public-archive-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.archive-item {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px 16px;
    padding: 14px 12px;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    transition: background-color 0.12s;
}

.archive-item:hover {
    background: var(--bg-soft);
}

.archive-date {
    font-size: 0.78rem;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    padding-top: 2px;
}

.archive-title {
    color: var(--heading);
    font-weight: 600;
    line-height: 1.35;
}

.archive-preheader {
    grid-column: 2;
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.45;
}

/* ----------------------------------------------------------------------
   Public single-issue (reading view) — narrower column, generous spacing.
   ---------------------------------------------------------------------- */

.public-page--reading {
    max-width: 680px;
    padding: 48px 24px 32px;
}

.public-issue-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.public-brand-link {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--heading);
    text-decoration: none;
}

.public-brand-link:hover { color: var(--primary); }

.public-issue-meta {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text);
    font-weight: 600;
}

.public-issue-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2.2rem;
    color: var(--heading);
    line-height: 1.15;
    margin: 0 0 12px;
}

.public-issue-preheader {
    color: var(--text);
    font-size: 1.05rem;
    line-height: 1.5;
    margin: 0 0 28px;
    opacity: 0.85;
}

.public-issue-body {
    color: var(--heading);
}

.public-issue-sep {
    border: none;
    border-top: 1px solid var(--border-soft);
    margin: 40px 0;
}

.public-issue-subscribe {
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 28px 28px;
    margin-bottom: 32px;
}

.public-issue-subscribe h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--heading);
    margin: 0 0 8px;
    line-height: 1.25;
}

.public-issue-other {
    margin-bottom: 24px;
}

.public-issue-other h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--heading);
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.78rem;
}

.public-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text);
    opacity: 0.7;
}

.public-footer a { color: inherit; }

/* Share link card */
.share-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
}

.share-url {
    display: block;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 12px 14px;
    border-radius: 8px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.82rem;
    word-break: break-all;
    user-select: all;
    color: var(--heading);
}

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

/* ----------------------------------------------------------------------
   Auth gate — centered card used for sign-in, errors, 404, expired links.
   ---------------------------------------------------------------------- */

.auth-gate-page {
    min-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 60px 24px;
}

.auth-gate-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    padding: 48px 40px;
    text-align: center;
}

.auth-gate-mark {
    width: 84px;
    height: 84px;
    margin: 0 auto 28px;
    border-radius: 20px;
    object-fit: cover;
    display: block;
    box-shadow: 0 12px 32px rgba(232, 116, 59, 0.28);
}

.auth-gate-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--heading);
    margin-bottom: 14px;
    line-height: 1.1;
}

.auth-gate-sub {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 28px;
}

.auth-gate-meta {
    font-size: 0.78rem;
    color: var(--text);
    opacity: 0.85;
    margin-top: 18px;
}

.auth-gate-error {
    margin-top: 16px;
    background: rgba(179, 38, 30, 0.08);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
}

.auth-gate-link {
    display: block;
    width: 100%;
    margin-top: 24px;
    background: transparent;
    border: none;
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 4px;
}
.auth-gate-link:hover { color: var(--heading); }

/* ----------------------------------------------------------------------
   Promo card — soft pitch for Ember / MM, shown on the "link unavailable"
   page so recipients with broken links still see who we are.
   ---------------------------------------------------------------------- */

.promo-card {
    width: 100%;
    max-width: 520px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    padding: 28px 32px;
}

.promo-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.promo-icon {
    border-radius: 11px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(232, 116, 59, 0.18);
}

.promo-head h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--heading);
    line-height: 1.2;
    margin-bottom: 4px;
}

.promo-head p {
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.4;
}

.promo-features {
    list-style: none;
    padding: 0;
    margin: 0 0 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.5;
}

.promo-features li {
    padding-left: 22px;
    position: relative;
}

.promo-features li::before {
    content: "→";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary);
    font-weight: 700;
}

.promo-features strong {
    color: var(--heading);
    font-weight: 600;
}

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

/* ----------------------------------------------------------------------
   Upload dropzone
   ---------------------------------------------------------------------- */

.dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 220px;
    border: 2px dashed var(--border);
    border-radius: 14px;
    background: var(--bg);
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.dropzone:hover,
.dropzone.is-hover {
    border-color: var(--primary);
    background: rgba(232, 116, 59, 0.04);
}

.dropzone-inner {
    text-align: center;
    color: var(--text);
}

.dropzone-inner strong {
    display: block;
    color: var(--heading);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 6px;
}

@media (prefers-color-scheme: dark) {
    .dropzone:hover, .dropzone.is-hover { background: rgba(232, 116, 59, 0.08); }
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text);
    font-size: 0.9rem;
}

.file-list li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.file-list li:last-child { border-bottom: none; }

.file-list-total {
    margin-top: 6px;
    color: var(--heading);
    font-weight: 600;
}

/* ----------------------------------------------------------------------
   Form fields (tighter than main.css's contact form)
   ---------------------------------------------------------------------- */

.ember-form .field {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.ember-form .field label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    margin-bottom: 6px;
    font-weight: 600;
}

.ember-form .field input,
.ember-form .field textarea,
.ember-form .field select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    padding: 10px 12px;
    font: inherit;
    color: var(--heading);
    transition: border-color 0.15s;
}

.ember-form .field textarea { resize: vertical; min-height: 80px; font-family: inherit; }

.ember-form .field input:focus,
.ember-form .field textarea:focus,
.ember-form .field select:focus { border-color: var(--primary); }

.ember-form .field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ember-form .field-row .field { margin-bottom: 0; }

.ember-form .actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.ember-form .actions p {
    color: var(--text);
    font-size: 0.78rem;
    margin: 0;
}

/* ----------------------------------------------------------------------
   Footer
   ---------------------------------------------------------------------- */

.ember-footer {
    margin-top: 40px;
    padding: 20px 32px;
    border-top: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    color: var(--text);
    font-size: 0.78rem;
    flex-wrap: wrap;
}

.ember-footer a {
    color: var(--text);
    text-decoration: none;
    margin-left: 16px;
}

.ember-footer a:hover { color: var(--heading); }

/* ----------------------------------------------------------------------
   Recipient download page — slightly tighter than the marketing
   .download-page in main.css but recognizably the same.
   ---------------------------------------------------------------------- */

.recipient-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    text-align: center;
}

.recipient-mark {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: var(--ember-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2rem;
    margin: 0 auto 22px;
    box-shadow: 0 8px 24px rgba(232, 116, 59, 0.25);
}

.recipient-page h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2rem;
    color: var(--heading);
    margin-bottom: 10px;
    line-height: 1.1;
}

.recipient-page .tagline {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 32px;
}

.recipient-files {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.recipient-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: var(--primary);
    color: #fff;
    border-radius: 12px;
    text-decoration: none;
    transition: background-color 0.15s, transform 0.15s;
    text-align: left;
}

.recipient-file:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.recipient-file-name {
    font-weight: 600;
    flex: 1;
    word-break: break-word;
}

.recipient-file-size {
    font-size: 0.82rem;
    opacity: 0.85;
}

.recipient-foot {
    color: var(--text);
    font-size: 0.82rem;
}

.recipient-foot a { color: var(--primary); text-decoration: none; }

/* ----------------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------------- */

@media (max-width: 720px) {
    .ember-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 14px 20px;
    }
    .ember-nav { justify-content: center; flex-wrap: wrap; }
    .account-chip { align-self: center; }
    .ember-content { padding: 18px 20px 24px; }
    .ember-footer { padding: 16px 20px; }
    .ember-form .field-row { grid-template-columns: 1fr; }
}
