/* =====================================================================
   Design tokens
   ===================================================================== */
:root {
    --color-bg: #f5f5f7;
    --color-surface: #ffffff;
    --color-surface-2: #fafafa;
    --color-text: #1d1d1f;
    --color-text-muted: #6e6e73;
    --color-text-subtle: #86868b;
    --color-text-body: #515154;
    --color-border: #d2d2d7;
    --color-border-light: #e5e5e7;
    --color-border-faint: #f0f0f2;
    --color-primary: #0071e3;
    --color-primary-hover: #0077ed;
    --color-success-bg: #e8f4ea;
    --color-success: #1c6e2f;
    --color-warning-bg: #fff7d6;
    --color-warning: #6b5510;
    --color-danger: #d70015;
    --color-danger-bg: #ffe5ea;
    --color-danger-border: #ffb3c0;

    --shadow-sm: 0 1px 6px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 16px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.06);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 999px;
}

/* =====================================================================
   Reset + base
   ===================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

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

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* =====================================================================
   App navigation (for layouts/app.blade.php)
   ===================================================================== */
.nav {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: saturate(180%) blur(20px);
    background: rgba(255, 255, 255, 0.92);
}

.nav .brand {
    font-weight: 700;
    font-size: 17px;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -0.3px;
}

.nav .brand:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.nav>div {
    display: flex;
    align-items: center;
    gap: 22px;
}

.nav a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s;
}

.nav a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.nav form {
    display: inline;
    margin: 0;
}

.nav button {
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    font: inherit;
    padding: 0;
    font-weight: 500;
    transition: color 0.15s;
}

.nav button:hover {
    color: var(--color-primary);
}

/* =====================================================================
   Auth layout brand
   ===================================================================== */
.auth-brand {
    text-align: center;
    padding: 32px 20px 8px;
}

.auth-brand a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.auth-brand a:hover {
    color: var(--color-primary);
}

/* Auth layout main */
body.auth-body main {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
}

/* =====================================================================
   Containers
   =====================================================================
   NOTE: Previously this re-styled the global `.container` selector as a
   white card. That conflicted with Bootstrap's `.container` (which is
   meant to be a transparent centered wrapper), causing every Bootstrap
   container on the site to render as a floating white card on the black
   theme background. Removed so Bootstrap's grid works as intended.
   Panel-style cards now use `.soft-card` / `.editorial-panel` /
   `.compact-panel` from theme.css instead. */

/* =====================================================================
   Headings
   ===================================================================== */
h1 {
    font-size: 26px;
    margin: 0 0 12px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

h2 {
    font-size: 20px;
    margin: 0 0 10px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

h3 {
    font-size: 16px;
    margin: 0 0 8px;
    font-weight: 600;
}

/* =====================================================================
   Forms � base inputs
   ===================================================================== */
label {
    display: block;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

input[type=text],
input[type=email],
input[type=password],
input[type=date],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    margin-top: 6px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

input[disabled],
textarea[disabled] {
    background: var(--color-surface-2);
    color: var(--color-text-muted);
    cursor: not-allowed;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

input[type=file] {
    padding: 8px 0;
    border: none;
    font-size: 14px;
}

.help {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.error {
    color: var(--color-danger);
    font-size: 13px;
    margin-top: 4px;
}

.check {
    margin-top: 14px;
    font-size: 14px;
}

.check input {
    margin-right: 6px;
}

/* =====================================================================
   Buttons
   ===================================================================== */
button.primary {
    margin-top: 20px;
    width: 100%;
    padding: 11px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, transform 0.05s;
}

button.primary:hover {
    background: var(--color-primary-hover);
}

button.primary:active {
    transform: translateY(1px);
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.15s, transform 0.05s;
    font-family: inherit;
}

.btn.primary {
    background: var(--color-primary);
    color: #fff;
}

.btn.primary:hover {
    background: var(--color-primary-hover);
    text-decoration: none;
}

.btn.secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn.secondary:hover {
    background: var(--color-bg);
    text-decoration: none;
}

.btn.draft {
    background: var(--color-text-muted);
    color: #fff;
}

.btn.draft:hover {
    background: #515154;
}

/* =====================================================================
   Flash messages
   ===================================================================== */
.status {
    margin-top: 14px;
    margin-bottom: 16px;
    padding: 11px 14px;
    background: var(--color-success-bg);
    color: var(--color-success);
    border-radius: var(--radius-md);
    font-size: 14px;
}

/* =====================================================================
   Auth pages � Google button + divider + meta
   ===================================================================== */
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px;
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    margin-top: 14px;
    transition: background 0.15s, border-color 0.15s;
}

.google-btn:hover {
    background: var(--color-bg);
    border-color: var(--color-text-subtle);
    text-decoration: none;
}

.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    color: var(--color-text-subtle);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.meta {
    margin-top: 20px;
    font-size: 14px;
    text-align: center;
    color: var(--color-text-muted);
}

.meta a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.meta a:hover {
    text-decoration: underline;
}

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
}

.row-between .check {
    margin-top: 0;
}

.row-between a {
    font-size: 14px;
    color: var(--color-primary);
    text-decoration: none;
}

/* =====================================================================
   Register � generate password row
   ===================================================================== */
.password-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-top: 6px;
}

.password-row input {
    flex: 1;
    margin-top: 0;
}

.password-row .gen-btn {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0 14px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    color: var(--color-text);
    white-space: nowrap;
    transition: background 0.15s;
}

.password-row .gen-btn:hover {
    background: var(--color-border-light);
}

.gen-hint {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 6px;
    word-break: break-all;
    font-family: monospace;
}

/* =====================================================================
   Dashboard
   ===================================================================== */
.dash-wrap {
    max-width: 760px;
    margin: 30px auto;
    padding: 0 20px;
}

.greet {
    background: var(--color-surface);
    padding: 28px 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 22px;
}

.greet h1 {
    margin: 0;
    font-size: 26px;
}

.cta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cta {
    display: inline-block;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, transform 0.05s;
}

.cta.primary {
    background: var(--color-primary);
    color: #fff;
}

.cta.primary:hover {
    background: var(--color-primary-hover);
    text-decoration: none;
}

.cta.secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.cta.secondary:hover {
    background: var(--color-bg);
    text-decoration: none;
}

/* =====================================================================
   Profile show + edit
   ===================================================================== */
.profile-wrap {
    max-width: 560px;
    margin: 40px auto;
    padding: 32px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.field-row {
    display: flex;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border-faint);
}

.field-row:last-of-type {
    border-bottom: none;
}

.field-label {
    width: 150px;
    color: var(--color-text-muted);
    font-size: 14px;
}

.field-value {
    flex: 1;
    color: var(--color-text);
    font-size: 14px;
}

.field-value.muted {
    color: var(--color-text-subtle);
    font-style: italic;
}

.actions {
    margin-top: 24px;
}

.actions a {
    display: inline-block;
    padding: 10px 18px;
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.actions a:hover {
    background: var(--color-primary-hover);
    text-decoration: none;
}

.button-row {
    margin-top: 22px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.button-row .secondary {
    padding: 11px 18px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--color-text);
    font-size: 14px;
}

.button-row .secondary:hover {
    background: var(--color-border-light);
    text-decoration: none;
}

.button-row button {
    flex: 1;
    margin-top: 0;
}

/* =====================================================================
   Blog feed (index, categories, tags)
   ===================================================================== */
.feed-wrap {
    max-width: 760px;
    margin: 30px auto;
    padding: 0 20px;
}

.feed-wrap.with-sidebar {
    max-width: 960px;
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 30px;
}

.feed-title {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.feed-sub {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.blog-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: 200px 1fr;
    transition: box-shadow 0.2s, transform 0.1s;
}

.blog-card:hover {
    box-shadow: var(--shadow-lg);
}

.blog-card.no-cover {
    grid-template-columns: 1fr;
}

.blog-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 140px;
}

.blog-card .body {
    padding: 18px 22px;
}

.blog-card h2 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
}

.blog-card h2 a {
    color: var(--color-text);
    text-decoration: none;
}

.blog-card h2 a:hover {
    color: var(--color-primary);
}

.blog-card .meta {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.blog-card .meta a {
    color: var(--color-primary);
    text-decoration: none;
}

.blog-card .excerpt {
    font-size: 14px;
    color: var(--color-text-body);
    line-height: 1.6;
}

.sidebar h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-subtle);
    margin: 0 0 12px;
    font-weight: 600;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0 0 26px;
}

.sidebar li {
    padding: 7px 0;
}

.sidebar a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s;
}

.sidebar a:hover {
    color: var(--color-primary);
}

.empty {
    padding: 50px 24px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--color-text-muted);
    box-shadow: var(--shadow-sm);
}

.empty a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.pagination {
    margin-top: 22px;
}

/* =====================================================================
   Single blog (show page)
   ===================================================================== */
.article-wrap {
    max-width: 760px;
    margin: 30px auto;
    padding: 0 20px;
}

.draft-banner {
    padding: 11px 14px;
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
}

.article-cover {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.article-title {
    margin: 0 0 12px;
    font-size: 36px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.6px;
}

.article-meta {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-bottom: 26px;
}

.article-meta a {
    color: var(--color-primary);
    text-decoration: none;
}

.article-body {
    font-size: 17px;
    line-height: 1.75;
    color: var(--color-text);
}

.article-body p {
    margin: 0 0 16px;
}

.article-body h1,
.article-body h2,
.article-body h3 {
    margin: 26px 0 12px;
    font-weight: 700;
}

.article-body img {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin: 14px 0;
}

.article-body blockquote {
    border-left: 3px solid var(--color-primary);
    padding: 6px 16px;
    color: var(--color-text-body);
    margin: 16px 0;
    background: var(--color-bg);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.article-body pre,
.article-body code {
    background: var(--color-bg);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 14px;
}

.article-body pre {
    padding: 14px;
    overflow-x: auto;
    line-height: 1.5;
}

.article-body a {
    color: var(--color-primary);
}

.tag-row {
    margin: 28px 0 20px;
}

.tag-row a {
    display: inline-block;
    padding: 5px 12px;
    margin: 0 4px 4px 0;
    background: var(--color-bg);
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-pill);
    font-size: 13px;
    transition: background 0.15s;
}

.tag-row a:hover {
    background: var(--color-border-light);
}

.like-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 0;
    border-top: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border-light);
    margin: 24px 0;
}

.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    color: var(--color-text);
    transition: background 0.15s, border-color 0.15s;
}

.like-btn:hover {
    background: var(--color-bg);
}

.like-btn.liked {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border-color: var(--color-danger-border);
}

.like-btn:disabled {
    color: var(--color-text-subtle);
    cursor: not-allowed;
    background: var(--color-surface);
}

.like-count {
    color: var(--color-text-muted);
    font-size: 14px;
}

.comments-wrap {
    margin-top: 32px;
}

.comments-wrap h3 {
    font-size: 18px;
    margin-bottom: 16px;
    font-weight: 600;
}

.comment-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.comment-form button {
    margin-top: 10px;
    padding: 9px 20px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
}

.comment-form button:hover {
    background: var(--color-primary-hover);
}

.comment {
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border-faint);
}

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

.comment .meta {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment .meta form {
    display: inline;
    margin: 0;
}

.comment .meta button {
    background: none;
    border: none;
    color: var(--color-danger);
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    font-family: inherit;
}

.comment .body {
    font-size: 14px;
    color: var(--color-text);
    white-space: pre-wrap;
    line-height: 1.6;
}

.login-prompt {
    padding: 16px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    font-size: 14px;
    text-align: center;
    color: var(--color-text-muted);
}

.login-prompt a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

/* =====================================================================
   My blogs (author dashboard)
   ===================================================================== */
.my-blogs-wrap {
    max-width: 920px;
    margin: 30px auto;
    padding: 0 20px;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.header-row h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-row a.cta {
    padding: 10px 18px;
    background: var(--color-primary);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s;
}

.header-row a.cta:hover {
    background: var(--color-primary-hover);
    text-decoration: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

th,
td {
    padding: 13px 16px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid var(--color-border-faint);
}

th {
    background: var(--color-surface-2);
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.badge.draft {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.badge.published {
    background: var(--color-success-bg);
    color: var(--color-success);
}

td.actions a,
td.actions button {
    font-size: 13px;
    margin-right: 10px;
    text-decoration: none;
    color: var(--color-primary);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
}

td.actions a:hover {
    text-decoration: underline;
}

td.actions button.delete {
    color: var(--color-danger);
}

/* =====================================================================
   Blog editor form
   ===================================================================== */
.form-wrap {
    max-width: 760px;
    margin: 30px auto;
    padding: 0 20px;
}

.card {
    background: var(--color-surface);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card h1 {
    margin: 0 0 22px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
    margin-top: 0;
}

.field input[type=text],
.field select,
.field textarea {
    margin-top: 0;
}

.field .help {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 6px;
}

#editor {
    background: var(--color-surface);
    min-height: 280px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.ql-toolbar {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-color: var(--color-border) !important;
}

.ql-container {
    border-color: var(--color-border) !important;
}

.cover-preview {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.cover-preview img {
    width: 130px;
    height: 88px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.actions-row {
    margin-top: 26px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 768px) {
    .feed-wrap.with-sidebar {
        grid-template-columns: 1fr;
    }

    .blog-card {
        grid-template-columns: 1fr;
    }

    .blog-card img {
        height: 200px;
        min-height: 0;
    }

    .article-title {
        font-size: 28px;
    }

    .article-body {
        font-size: 16px;
    }

    .nav {
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav>div {
        gap: 14px;
        flex-wrap: wrap;
    }

    .header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .field-row {
        flex-direction: column;
        gap: 4px;
    }

    .field-label {
        width: auto;
    }
}

/* =====================================================================
   Platform modules: memberships, chat, admin
   ===================================================================== */
.dash-wrap.wide {
    max-width: 1040px;
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
}

.dashboard-hero p {
    margin: 6px 0 0;
    color: var(--color-text-muted);
    max-width: 620px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--color-primary);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.plan-chip {
    min-width: 170px;
    padding: 12px 14px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    background: var(--color-surface-2);
    font-weight: 700;
}

.plan-chip span {
    display: block;
    margin-top: 3px;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 500;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 18px 0 22px;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.stat-card strong {
    display: block;
    font-size: 26px;
    line-height: 1.1;
}

.stat-card span {
    color: var(--color-text-muted);
    font-size: 13px;
}

.panel {
    margin-top: 24px;
    padding: 22px;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.activity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid var(--color-border-faint);
}

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

.activity-row strong {
    display: block;
    color: var(--color-text);
}

.activity-row span {
    color: var(--color-text-muted);
    font-size: 13px;
}

.empty.compact {
    padding: 26px 18px;
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 22px;
}

.plan-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

.plan-card strong {
    display: block;
    margin: 14px 0 6px;
    font-size: 24px;
}

.plan-card p {
    min-height: 44px;
    color: var(--color-text-muted);
}

.plan-card form {
    margin-top: 16px;
}

.profile-wide {
    max-width: 820px;
}

.profile-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.profile-head p {
    color: var(--color-text-muted);
    margin: 4px 0 0;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.author-actions {
    display: flex;
    gap: 10px;
    margin: -8px 0 22px;
}

.author-actions form {
    margin: 0;
}

.chat-wrap {
    max-width: 820px;
    margin: 30px auto;
    padding: 0 20px;
}

.chat-link {
    color: var(--color-text);
    text-decoration: none;
    background: var(--color-surface);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
}

.messages-panel {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.message {
    max-width: 72%;
    margin-bottom: 14px;
    padding: 12px 14px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
}

.message.mine {
    margin-left: auto;
    background: #e8f2ff;
}

.message p {
    margin: 5px 0;
    white-space: pre-wrap;
}

.message span {
    color: var(--color-text-muted);
    font-size: 12px;
}

.message-form {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.message-form textarea {
    min-height: 90px;
}

.admin-plan-row {
    display: grid;
    grid-template-columns: 160px 1fr 1fr 110px auto;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border-faint);
}

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

.admin-plan-row label {
    margin: 0;
}

@media (max-width: 768px) {

    .dashboard-hero,
    .profile-head {
        flex-direction: column;
    }

    .stat-grid,
    .plan-grid,
    .two-col,
    .admin-plan-row {
        grid-template-columns: 1fr;
    }

    .message {
        max-width: 100%;
    }
}