/* NightCrew readable type scale — loaded last so every module is consistent. */
:root {
  --type-caption: 11px;
  --type-small: 12px;
  --type-body: 14px;
  --type-label: 13px;
  --type-control: 14px;
}

html { font-size: 16px; }
body { font-size: var(--type-body); line-height: 1.5; }

/* Keep navigation available while long module workspaces scroll independently. */
@media (min-width: 621px) {
  html, body { height: 100%; }
  .app { height: 100dvh; min-height: 100vh; overflow: hidden; align-items: stretch; }
  .rail {
    position: relative;
    top: auto;
    height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
  .content {
    height: 100dvh;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* Navigation */
.app { grid-template-columns: 278px 1fr; }
.rail { padding-inline: 16px; }
.navlink { min-height: 42px; padding: 10px 12px; font-size: 13px; gap: 11px; }
.navlink svg { width: 17px; height: 17px; }
.rail-section-label { padding: 20px 10px 8px; font-size: 10px; line-height: 1.3; }
.guild-switch { min-height: 58px; }
.guild-name { font-size: 14px; }
.guild-sub { font-size: 12px; }
.rail-profile .name { font-size: 13px; }
.rail-profile .role { font-size: 11px; }
.navlink .count { min-width: 20px; min-height: 20px; font-size: 10px; }
.rail-group { margin-top: 5px; }
.rail-group>summary { display:flex;align-items:center;justify-content:space-between;min-height:34px;padding:8px 10px;color:rgba(255,255,255,.42);font:600 10px/1.3 'Plex Mono',monospace;letter-spacing:.12em;text-transform:uppercase;cursor:pointer;list-style:none;border-radius:7px; }
.rail-group>summary::-webkit-details-marker { display:none; }
.rail-group>summary:hover { color:#fff;background:rgba(255,255,255,.035); }
.rail-group>summary i { font-style:normal;font-size:12px;transition:transform .16s; }
.rail-group[open]>summary i { transform:rotate(180deg); }
.rail-group__links { display:grid;gap:2px;padding:2px 0 5px; }

/* Shared text and form controls */
.content p:not(.eyebrow),
.content li,
.content dd { font-size: var(--type-body); line-height: 1.55; }
.content .eyebrow { font-size: 11px; line-height: 1.4; }
.content small,
.content time { font-size: var(--type-caption); line-height: 1.4; }
.content .empty-note,
.content .meta { font-size: 13px; line-height: 1.55; }
.content .field label,
.content label { font-size: var(--type-label); line-height: 1.4; }
.content input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.content textarea,
.content select { min-height: 43px; padding: 10px 12px; font-size: var(--type-control) !important; line-height: 1.4; }
.content textarea { min-height: 105px; }
.content button,
.content .btn-primary,
.content .btn-secondary,
.content .btn-danger { min-height: 40px; padding: 10px 14px; font-size: 13px; line-height: 1.2; }
.content code,
.content .mono { font-size: 12px; }
.content table th { font-size: 11px !important; }
.content table td { font-size: 13px !important; }
.content .pill,
.content .filter-pill { font-size: 12px; }

/* Headings and supporting copy */
.community-page-head>div>p:last-child,
.embed-page-head p:last-child,
.welcome-center-head>div>p:last-child,
.panel-page-head p,
.app-editor-head p { font-size: 14px; }
.community-panel>header h2,
.embed-section-title h2,
.welcome-section-head h2 { font-size: 17px; }
.community-panel>header p,
.embed-section-title p,
.welcome-section-head p:last-child,
.giveaway-create-section>header p:last-child { font-size: 12px; }

/* Metrics, tabs, badges and status text */
.community-stat-grid>article>div:nth-child(2)>span { font-size: 12px; }
.community-stat-grid>article>div:nth-child(2)>small { font-size: 11px; }
.community-tabs a { padding: 9px 14px; font-size: 12px; }
.community-tabs b { font-size: 10px; }
.community-period-label,
.community-head-badge,
.module-state,
.queue-count,
.metric-help { font-size: 11px; }
.suggestion-status { padding: 5px 8px; font-size: 10px; }
.suggestion-copy>p { font-size: 14px; }
.suggestion-copy footer,
.suggestion-vote strong { font-size: 11px; }
.suggestion-copy time { font-size: 10px; }
.suggestion-actions button { font-size: 12px; }
.community-empty-state h3 { font-size: 17px; }
.community-empty-state p { font-size: 13px; }
.community-empty-state>span,
.community-empty-state>code,
.community-empty-state>a { font-size: 11px; }

/* New engagement pages */
.settings-section-title strong,
.leveling-settings footer strong,
.giveaway-editor footer strong { font-size: 13px; }
.settings-section-title small,
.settings-master-toggle span,
.leveling-settings footer span,
.giveaway-editor footer span,
.giveaway-preview-help p { font-size: 11px; }
.settings-master-toggle strong { font-size: 14px; }
.level-member-copy strong,
.giveaway-item-copy>strong { font-size: 14px; }
.level-member-copy span,
.level-progress span,
.giveaway-item-copy>p,
.giveaway-list dt,
.giveaway-list dd small { font-size: 11px; }
.giveaway-list dd { font-size: 13px; }

/* Builders, staff, roles, welcome and moderation */
.embed-editor-actions strong,
.welcome-editor-form label,
.staff-permission-option strong,
.moderation-action-toggle strong,
.role-option-row strong { font-size: 13px; }
.embed-editor-actions small,
.welcome-editor-form small,
.welcome-enable small,
.staff-permission-option small,
.staff-create-footer p,
.moderation-action-toggle small,
.moderation-savebar small,
.role-option-row small,
.role-form-title p { font-size: 11px; }
.welcome-enable strong,
.welcome-placeholder-box>strong,
.welcome-advanced>summary { font-size: 12px; }
.welcome-placeholder-box button { font-size: 11px; }
.staff-permission-group h3,
.staff-permission-fieldset>p { font-size: 11px; }
.staff-permission-fieldset>legend { font-size: 14px; }

/* Existing cards, dialogs and Discord previews */
.ticket-creator strong,
.ticket-category strong,
.ticket-assigned strong,
.ticket-opened strong,
.ticket-message header strong { font-size: 14px; }
.ticket-creator small,
.ticket-assigned small,
.ticket-opened small,
.ticket-message header small,
.ticket-detail-meta dt { font-size: 11px; }
.ticket-message p,
.ticket-detail-meta dd { font-size: 14px; }
.discord-author strong { font-size: 14px; }
.discord-author small { font-size: 11px; }
.discord-author>span { font-size: 9px; }
.discord-embed-title { font-size: 15px; }
.discord-embed p { font-size: 13px; }
.discord-embed footer { font-size: 11px; }
.discord-preview-buttons button { font-size: 12px; }
.preview-label,
.embed-preview-heading strong,
.welcome-inline-preview>span { font-size: 10px; }

/* Module-owned settings remain readable at desktop dashboard density. */
.settings-overview strong { font-size: 15px; }
.settings-overview p { font-size: 13px; }
.settings-module-grid small { font-size: 11px; }
.settings-module-grid h2 { font-size: 18px; }
.settings-module-grid p { font-size: 13px; line-height: 1.45; }
.module-settings-card>summary strong { font-size: 15px; }
.module-settings-card>summary small { font-size: 12px; }
.module-settings-card footer>span,
.module-role-setting>p { font-size: 12px; }
.module-role-setting>strong { font-size: 14px; }
.settings-role-grid label,
.module-settings-notice { font-size: 13px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 78px 1fr; }
  .navlink { font-size: 0; }
  .rail-section-label { font-size: 0; }
  .rail-group>summary { justify-content:center;padding-inline:4px; }
  .rail-group>summary span { width:24px;height:24px;overflow:hidden;font-size:0;display:grid;place-items:center;border:1px solid var(--border);border-radius:6px; }
  .rail-group>summary span:before { content:'•••';font-size:8px;letter-spacing:0;color:var(--text-faint); }
  .rail-group>summary i { display:none; }
}

@media (max-width: 620px) {
  html, body { height: auto; }
  .app { display: block; }
  .rail-brand span { font-size: 15px; }
  .content { padding-inline: 16px; }
}
