@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --font-display: 'Fraunces', Georgia, serif;
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

    --bg-page: #f6f5ef;
    --bg-surface: #ffffff;
    --bg-subtle: #eff2eb;
    --bg-warm: #f2ede3;

    --text-primary: #1c241e;
    --text-secondary: #434d46;
    --text-muted: #525d55;

    --primary: #14532d;
    --primary-hover: #0f4224;
    --primary-soft: #e6f2ea;
    --primary-border: #c3dccb;

    --accent: #a64e2e;
    --accent-hover: #8d4024;
    --accent-soft: #f9ebe5;
    --accent-border: #e9c9bc;

    --border: #e1e6dc;
    --border-strong: #cdd6c7;

    --danger: #9f2323;
    --danger-bg: #fdf0f0;
    --danger-border: #f0bcbc;

    --ring: #2d7a49;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-pill: 999px;

    --shadow-sm: 0 2px 8px rgba(20, 45, 29, 0.04);
    --shadow-md: 0 12px 30px rgba(20, 45, 29, 0.07);
    --shadow-lg: 0 20px 44px rgba(20, 45, 29, 0.10);

    --transition: 180ms cubic-bezier(0.22, 1, 0.36, 1);

    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-page);
    font-synthesis: none;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(960px 420px at 90% -80px, rgba(20, 83, 45, 0.06), transparent 65%),
        radial-gradient(760px 380px at 0% 120px, rgba(166, 78, 46, 0.05), transparent 60%),
        var(--bg-page);
    color: var(--text-primary);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

main {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 24px 72px;
}

/* Typography */
h1, h2, h3 {
    color: var(--text-primary);
    margin-top: 0;
}

h1 {
    font-family: var(--font-display);
    font-size: clamp(36px, 5.5vw, 62px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.06;
    margin-bottom: 18px;
}

h2 {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 0 12px;
}

.intro {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.68;
    max-width: 62ch;
    margin: 0 0 20px;
}

.meta {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.icon-sm {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* Focus accessibility */
.button:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 2px;
}

/* Header & Navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1180px;
    margin: 0 auto;
    min-height: 74px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.04em;
    min-height: 44px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(20, 83, 45, 0.22);
}

.brand span.dot {
    color: var(--accent);
}

nav.main-nav {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user {
    margin-left: 20px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background var(--transition), color var(--transition);
}

.nav-link:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 4px 14px 4px 6px;
    border-radius: var(--radius-pill);
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: background var(--transition), border-color var(--transition);
}

.user-pill:hover {
    background: #d9ecdf;
    border-color: #a8cfb6;
}

.avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-sm.warm {
    background: var(--accent);
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #ffffff;
    text-decoration: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.button:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(20, 83, 45, 0.18);
}

.button.small {
    min-height: 44px;
    padding: 0 16px;
    font-size: 13px;
}

.button.secondary {
    background: var(--bg-surface);
    color: var(--primary);
    border-color: var(--primary-border);
}

.button.secondary:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    box-shadow: none;
}

.button.accent {
    background: var(--accent);
    color: #ffffff;
}

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

.text-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 6px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.text-button:hover {
    background: var(--primary-soft);
    text-decoration: underline;
}

.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--danger-border);
    border-radius: var(--radius-sm);
    background: var(--danger-bg);
    color: var(--danger);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}

.danger-button:hover {
    background: #fbe2e2;
    border-color: var(--danger);
}

.danger-text {
    color: var(--danger);
}

.danger-text:hover {
    background: var(--danger-bg);
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

/* Forms */
label {
    display: grid;
    align-content: start;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
}

input, textarea, select {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23434d46' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
    cursor: pointer;
}

textarea {
    min-height: 92px;
    resize: vertical;
    line-height: 1.5;
}

input::placeholder, textarea::placeholder {
    color: #77817a;
}

input:hover, textarea:hover, select:hover {
    border-color: #9eb0a2;
}

input[type="file"] {
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-secondary);
}

input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 7px 12px;
    border: 1px solid var(--primary-border);
    border-radius: 6px;
    background: var(--primary-soft);
    color: var(--primary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}

input[type="file"]::file-selector-button:hover {
    background: #d5ebdc;
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: start;
    gap: 16px;
}

.form-hint {
    margin: 2px 0 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

/* Hero & Marketplace Search */
.hero {
    padding: 20px 0 38px;
}

.hero-top {
    display: grid;
    grid-template-columns: 1.35fr 0.65fr;
    gap: 28px;
    align-items: end;
}

.trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: var(--radius-pill);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.trust-pill svg {
    color: var(--primary);
}

.hero-callout {
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: grid;
    gap: 10px;
}

.hero-callout strong {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--text-primary);
}

.hero-callout p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.search-panel {
    margin-top: 30px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
}

.search {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.quick-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.quick-filters-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 4px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.chip:hover {
    background: var(--primary-soft);
    border-color: var(--primary-border);
    color: var(--primary);
}

.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.save-search-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.save-search {
    margin: 0;
}

/* Listing Grid & Cards */
.listing-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 12px 0 22px;
}

.listing-head h2 {
    margin: 0;
}

.result-count {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-border);
}

.card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.card-link:hover h3 {
    color: var(--primary);
}

.card-art {
    position: relative;
    height: 188px;
    overflow: hidden;
    background:
        radial-gradient(circle at 85% 20%, rgba(166, 78, 46, 0.14), transparent 52%),
        linear-gradient(135deg, #e1efe4 0%, #eaf2e5 55%, #f4ede2 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.card-art.has-photo {
    background: var(--bg-subtle);
}

.card-art.has-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(16, 26, 20, 0.34) 0%, rgba(16, 26, 20, 0.04) 48%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.card-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover .card-photo {
    transform: scale(1.04);
}

.card-art-top {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.state-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.state-badge[data-state="NEUF"] {
    background: #dff4e6;
    border-color: #a9dbba;
    color: #0f4f28;
}

.state-badge[data-state="TRES_BON"] {
    background: #e7f3ec;
    border-color: #bddcc8;
    color: #14532d;
}

.state-badge[data-state="BON"] {
    background: #ffffff;
    border-color: #d6dfd2;
    color: #36453a;
}

.state-badge[data-state="A_REPARER"] {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: #8c3b1e;
}

.delivery-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
}

.card-art-glyph {
    align-self: flex-end;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(20, 83, 45, 0.12);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

.card-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 8px;
}

.card h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.25;
    margin: 0 0 8px;
    transition: color var(--transition);
}

.card-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tags {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin: 16px 0 0;
}

.tags span {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid var(--primary-border);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
}

.owner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin: 18px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.owner-info {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.card-cta {
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

/* Empty state */
.empty-state {
    background: var(--bg-surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 44px 24px;
    text-align: center;
    max-width: 560px;
    margin: 24px auto;
}

.empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.empty-state h3 {
    font-family: var(--font-display);
    font-size: 22px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 20px;
}

.empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 36px;
}

.page-info {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 8px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
}

.space-pagination {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    gap: 10px;
    flex-wrap: wrap;
}

.space-pagination .page-info {
    background: var(--bg-page);
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin: 18px 0;
    font-size: 14px;
    font-weight: 600;
}

.alert.success {
    background: #e7f4ea;
    color: var(--primary);
    border: 1px solid #b5d9be;
}

.alert.error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

/* Detail page */
.breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 14px;
}

.breadcrumb:hover {
    text-decoration: underline;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 28px;
    align-items: start;
}

.detail-main-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.detail-photo-wrap {
    margin: -28px -28px 24px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    max-height: 400px;
}

.detail-photo {
    width: 100%;
    height: 100%;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

.detail-main-card h1 {
    font-size: clamp(30px, 4vw, 44px);
    margin-bottom: 12px;
}

.detail-section-title {
    font-size: 16px;
    font-family: var(--font-sans);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 26px 0 10px;
}

.detail-sidebar {
    position: sticky;
    top: 94px;
    display: grid;
    gap: 18px;
}

.detail-box {
    background: var(--bg-surface);
    padding: 8px 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.detail-box p {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    margin: 0;
    font-size: 14px;
}

.detail-box p:last-child {
    border: 0;
}

.detail-box b {
    color: var(--text-secondary);
    font-weight: 600;
}

.actions {
    display: grid;
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
}

.actions form {
    display: grid;
    gap: 12px;
}

.actions .button {
    width: 100%;
}

.owner-tools {
    margin-top: 22px;
    padding: 20px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
}

.owner-tools summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
    color: var(--primary);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.owner-tools summary::-webkit-details-marker {
    display: none;
}

.owner-tools form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.danger-zone {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

/* Auth & Form Pages */
.detail {
    max-width: 780px;
}

.form-shell {
    max-width: 680px;
    margin: 0 auto;
}

.auth-shell {
    max-width: 520px;
    margin: 0 auto;
}

.form-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
}

.form-card > :first-child {
    margin-top: 0;
}

.editor {
    display: grid;
    gap: 18px;
    margin: 12px 0 0;
}

.editor .button {
    justify-self: start;
}

.auth-shell .editor .button {
    width: 100%;
    justify-self: stretch;
}

.demo-box {
    margin-top: 20px;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
}

.demo-box h2 {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin: 0 0 10px;
}

.demo-box p {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0;
    font-size: 13px;
}

.demo-box code {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

.auth-footer-link {
    margin: 20px 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Personal Space (Bento Dashboard) */
.space-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.space-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.space-header h1 {
    margin-bottom: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin: 0 0 26px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
}

.space-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.space-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.space-card h2 {
    font-size: 20px;
    margin: 0;
}

.space-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.space-title-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.card-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon.warm {
    background: var(--accent-soft);
    color: var(--accent);
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border-radius: var(--radius-pill);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}

.space-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.space-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-page);
    border: 1px solid var(--border);
}

.space-item-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.space-thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
}

.space-list a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.space-list a:hover {
    text-decoration: underline;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 4px;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
}

.status-badge.active {
    background: var(--primary-soft);
    color: var(--primary);
}

.status-badge.inactive {
    background: var(--bg-subtle);
    color: var(--text-muted);
}

.lot-box {
    margin-top: 16px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--bg-page);
    border: 1px solid var(--border);
}

.lot-box .space-head {
    margin-bottom: 10px;
}

.lot-box .space-list li {
    background: var(--bg-surface);
}

.compact-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin: 12px 0;
}

.compact-form label,
.compact-form select {
    flex: 1;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.message-section {
    margin-top: 20px;
}

.message-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.3fr;
    gap: 24px;
    align-items: start;
}

.message-item {
    display: block !important;
}

.message-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.message-body {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.55;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 13px;
}

.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-weight: 600;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.footer-links a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .hero-top {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .search {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .search .button {
        grid-column: span 1;
    }

    .cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-grid,
    .message-grid {
        grid-template-columns: 1fr;
    }

    .detail-sidebar {
        position: static;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    main {
        padding: 28px 18px 56px;
    }

    .header-inner {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        row-gap: 10px;
        column-gap: 12px;
        align-items: center;
        padding: 10px 18px;
        min-height: auto;
    }

    nav.main-nav {
        display: contents;
    }

    .brand {
        grid-column: 1;
        grid-row: 1;
        min-height: auto;
    }

    .nav-user {
        grid-column: 2;
        grid-row: 1;
        margin-left: 0;
        justify-self: end;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .nav-primary {
        grid-column: 1 / -1;
        grid-row: 2;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        padding-top: 6px;
        border-top: 1px solid var(--border);
    }

    .nav-primary .nav-link {
        min-height: 38px;
        padding: 0 8px;
        font-size: 13px;
    }

    .nav-primary .button.small {
        min-height: 38px;
        padding: 0 14px;
        font-size: 13px;
    }

    .user-pill {
        margin-left: 0;
        min-height: 38px;
        padding: 3px 12px 3px 6px;
        font-size: 12px;
        max-width: 210px;
    }

    .user-pill span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .search {
        grid-template-columns: 1fr 1fr;
    }

    .search .button {
        grid-column: 1 / -1;
    }

    .space-grid,
    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .listing-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .header-inner {
        padding: 8px 14px;
        row-gap: 8px;
    }

    .brand {
        font-size: 22px;
        gap: 8px;
    }

    .brand-mark {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .user-pill {
        max-width: 175px;
        font-size: 11px;
        padding: 2px 10px 2px 4px;
        gap: 6px;
    }

    .avatar-sm {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .nav-primary .nav-link {
        padding: 0 4px;
        font-size: 12px;
    }

    .nav-primary .button.small {
        padding: 0 12px;
        font-size: 12px;
    }

    .cards,
    .search,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .search .button {
        grid-column: auto;
    }

    .compact-form {
        flex-direction: column;
        align-items: stretch;
    }

    .card-art {
        height: 164px;
    }

    .form-card,
    .detail-main-card,
    .space-card {
        padding: 20px;
    }

    .detail-photo-wrap {
        margin: -20px -20px 18px;
    }

    .space-list li {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}
