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

:root {
    --bg: #f4f1ea;
    --bg-elevated: rgba(255, 255, 255, 0.78);
    --panel: rgba(255, 255, 255, 0.92);
    --panel-strong: #ffffff;
    --text: #171717;
    --muted: #5f6470;
    --border: rgba(24, 35, 52, 0.1);
    --shadow: 0 24px 60px rgba(20, 26, 40, 0.08);
    --primary: #1f6feb;
    --primary-strong: #174db5;
    --success: #0f8b6d;
    --warning: #d97706;
    --danger: #e11d48;
    --draft: #6b7280;
}

html[data-theme='dark'] {
    --bg: #0c1220;
    --bg-elevated: rgba(18, 27, 45, 0.82);
    --panel: rgba(16, 23, 38, 0.92);
    --panel-strong: #131d31;
    --text: #eef4ff;
    --muted: #a8b4ca;
    --border: rgba(160, 182, 228, 0.12);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
    --primary: #76a7ff;
    --primary-strong: #4d82e5;
    --success: #34d399;
    --warning: #f59e0b;
    --danger: #fb7185;
    --draft: #9ca3af;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(74, 144, 226, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(21, 128, 61, 0.16), transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 18%),
        var(--bg);
}

body.is-lightbox-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
    background: none;
    cursor: pointer;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.56);
    color: var(--text);
    padding: 0.95rem 1rem;
    outline: none;
    transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

html[data-theme='dark'] input,
html[data-theme='dark'] select,
html[data-theme='dark'] textarea {
    background: rgba(6, 10, 18, 0.45);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(31, 111, 235, 0.55);
    transform: translateY(-1px);
}

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

.page-shell {
    width: min(1280px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.page-content {
    display: grid;
    gap: 24px;
}

.topbar,
.panel,
.auth-card {
    border: 1px solid var(--border);
    background: var(--panel);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    border-radius: 28px;
    position: sticky;
    top: 16px;
    z-index: 30;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.brand strong,
.hero-copy h1,
.meeting-title-block h1,
.panel h2,
.panel h3,
.auth-copy h1 {
    font-family: 'Sora', 'Segoe UI', sans-serif;
    letter-spacing: -0.04em;
}

.brand-badge {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    font-family: 'Sora', 'Segoe UI', sans-serif;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #1f6feb, #16a34a);
}

.brand small,
.muted,
.section-kicker,
.stat-label,
.hero-copy p,
.meeting-card-body p,
.featured-body p,
.layout-toolbar p,
.participant-copy span,
.cover-updated,
.page-footer p,
.auth-copy p,
.empty-state,
.credential-box span,
.stack-row span {
    color: var(--muted);
}

.topbar-actions,
.hero-actions,
.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.button,
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.button:hover,
.theme-toggle:hover {
    transform: translateY(-1px);
}

.button-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.button-soft,
.theme-toggle {
    background: rgba(31, 111, 235, 0.12);
    color: var(--primary);
}

.button-ghost {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.36);
}

html[data-theme='dark'] .button-ghost {
    background: rgba(255, 255, 255, 0.02);
}

.button-danger {
    background: rgba(225, 29, 72, 0.1);
    color: var(--danger);
}

.button-mini {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.88rem;
}

.button-full {
    width: 100%;
}

.panel {
    padding: 24px;
    border-radius: 30px;
}

.flash {
    margin-top: 18px;
    padding: 16px 20px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.flash-success {
    background: rgba(15, 139, 109, 0.12);
}

.flash-error {
    background: rgba(225, 29, 72, 0.12);
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.95fr);
    gap: 24px;
}

.hero-copy,
.hero-stats {
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    border-radius: 34px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.hero-copy h1,
.meeting-title-block h1,
.auth-copy h1 {
    font-size: clamp(2.4rem, 4vw, 4.4rem);
    line-height: 0.98;
    margin: 10px 0 16px;
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.74rem;
    font-weight: 700;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-content: start;
}

.stat-card {
    padding: 18px;
    border-radius: 24px;
    background: var(--panel-strong);
    border: 1px solid var(--border);
}

.stat-card strong {
    display: block;
    margin: 10px 0 8px;
    font-size: 2rem;
    font-family: 'Sora', 'Segoe UI', sans-serif;
}

.dashboard-grid,
.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.92fr);
    gap: 24px;
}

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

.section-head-tight {
    margin-bottom: 18px;
}

.section-head h2,
.layout-toolbar h2 {
    margin: 4px 0 0;
    font-size: 1.7rem;
}

.search-box {
    display: grid;
    gap: 8px;
    min-width: 260px;
}

.meeting-list {
    display: grid;
    gap: 18px;
}

.meeting-card {
    display: grid;
    grid-template-columns: 188px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    border-radius: 26px;
    border: 1px solid var(--border);
    background: var(--panel-strong);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.meeting-card:hover {
    transform: translateY(-3px);
    border-color: rgba(31, 111, 235, 0.2);
    box-shadow: 0 24px 44px rgba(31, 41, 55, 0.08);
}

.meeting-cover-thumb,
.featured-cover,
.meeting-cover-large {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background-size: cover;
    background-position: center;
}

.meeting-cover-thumb {
    min-height: 168px;
}

.meeting-cover-title {
    position: absolute;
    left: 18px;
    bottom: 16px;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
}

.meeting-card-body {
    display: grid;
    gap: 12px;
}

.card-topline,
.meta-row,
.hero-progress-head,
.stack-row,
.gallery-card figcaption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.meeting-card-body h3,
.featured-body h3 {
    margin: 0;
    font-size: 1.4rem;
}

.progress-inline {
    display: flex;
    align-items: center;
    gap: 14px;
}

.progress-track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #1f6feb);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.is-success {
    color: var(--success);
    background: rgba(15, 139, 109, 0.12);
}

.is-active {
    color: var(--primary);
    background: rgba(31, 111, 235, 0.12);
}

.is-planned {
    color: var(--warning);
    background: rgba(217, 119, 6, 0.12);
}

.is-draft {
    color: var(--draft);
    background: rgba(107, 114, 128, 0.12);
}

.sidebar-panel {
    display: grid;
    gap: 20px;
    align-content: start;
}

.featured-card,
.admin-note,
.editor-card {
    display: grid;
    gap: 16px;
}

.featured-cover {
    min-height: 220px;
    padding: 18px;
    display: flex;
    align-items: start;
    justify-content: end;
}

.mini-list,
.bullet-list {
    margin: 0;
    padding-left: 18px;
}

.mini-list li,
.bullet-list li {
    margin-bottom: 10px;
}

.credential-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    padding: 16px;
    border-radius: 20px;
    border: 1px dashed var(--border);
}

.credential-box strong {
    font-family: 'Sora', 'Segoe UI', sans-serif;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table-link {
    font-weight: 700;
}

.auth-layout {
    min-height: calc(100vh - 220px);
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(940px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.85fr);
    gap: 28px;
    padding: 30px;
    border-radius: 34px;
}

.auth-form,
.meeting-form {
    display: grid;
    gap: 14px;
}

.meeting-form label,
.auth-form label {
    display: grid;
    gap: 8px;
}

.meeting-form label span,
.auth-form label span {
    font-size: 0.9rem;
    font-weight: 700;
}

.form-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.full-span {
    grid-column: 1 / -1;
}

.meeting-hero {
    display: grid;
    grid-template-columns: minmax(340px, 0.95fr) minmax(0, 1.15fr);
    gap: 22px;
    overflow: hidden;
}

.meeting-cover-large {
    min-height: 380px;
}

.cover-overlay {
    position: absolute;
    inset: auto 18px 18px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(10, 14, 22, 0.54);
    color: #fff;
}

.meeting-hero-body {
    display: grid;
    gap: 22px;
    align-content: start;
}

.meeting-title-block p {
    max-width: 66ch;
}

.hero-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.hero-meta-grid article,
.widget-card,
.editor-card {
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--panel-strong);
}

.hero-meta-grid article {
    padding: 16px;
}

.hero-meta-grid span {
    display: block;
    color: var(--muted);
    margin-bottom: 6px;
}

.layout-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.layout-status {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(31, 111, 235, 0.12);
    color: var(--primary);
    font-weight: 700;
}

.layout-status.is-saving {
    background: rgba(217, 119, 6, 0.12);
    color: var(--warning);
}

.layout-status.is-saved {
    background: rgba(15, 139, 109, 0.12);
    color: var(--success);
}

.widget-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-content: start;
}

.widget-card {
    padding: 22px;
    transition: transform 180ms ease, opacity 180ms ease, border-color 180ms ease;
}

.widget-card.dragging {
    opacity: 0.4;
    transform: scale(0.98);
}

.widget-card.drag-over {
    border-color: rgba(31, 111, 235, 0.38);
}

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

.widget-head h3 {
    margin: 4px 0 0;
    font-size: 1.28rem;
}

.drag-handle {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(107, 114, 128, 0.12);
    color: var(--muted);
}

.progress-widget {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.progress-ring {
    min-height: 180px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 72%, #22c55e));
}

.progress-ring strong {
    display: block;
    font-size: 2.3rem;
    font-family: 'Sora', 'Segoe UI', sans-serif;
}

.stack-list {
    display: grid;
    gap: 12px;
}

.stack-row {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(148, 163, 184, 0.08);
}

.content-block {
    display: grid;
    gap: 16px;
}

.content-block p {
    margin: 0;
    line-height: 1.7;
}

.timeline-list {
    display: grid;
    gap: 14px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(148, 163, 184, 0.08);
}

.timeline-time {
    display: inline-flex;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(31, 111, 235, 0.12);
    color: var(--primary);
    font-weight: 700;
}

.participant-grid,
.gallery-grid {
    display: grid;
    gap: 14px;
}

.participant-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 18px;
    background: rgba(148, 163, 184, 0.08);
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.75);
}

.avatar-fallback {
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #16a34a);
}

.participant-copy {
    display: grid;
    gap: 4px;
}

.checklist {
    display: grid;
    gap: 12px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(148, 163, 184, 0.08);
}

.check-item input {
    width: 18px;
    height: 18px;
}

.check-item.is-done span {
    text-decoration: line-through;
    color: var(--muted);
}

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

.gallery-card {
    overflow: hidden;
    border-radius: 20px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid var(--border);
}

.gallery-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.gallery-card figcaption {
    padding: 14px;
}

.editor-panel {
    display: grid;
    gap: 18px;
    align-content: start;
    position: sticky;
    top: 104px;
    height: max-content;
}

.editor-card {
    padding: 20px;
}

.compact-form textarea {
    min-height: 100px;
}

.centered-panel {
    text-align: center;
    padding: 52px 24px;
}

.empty-state {
    margin: 0;
    padding: 18px;
    border-radius: 18px;
    background: rgba(148, 163, 184, 0.08);
}

.page-footer {
    padding: 24px 8px 0;
    text-align: center;
}

.brand strong {
    display: block;
    font-size: 1.15rem;
}

.brand small {
    display: block;
    font-size: 0.92rem;
    margin-top: 2px;
}

.admin-note {
    padding: 18px;
    border-radius: 24px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px dashed var(--border);
}

.meeting-hero {
    align-items: stretch;
}

.meeting-title-block h1 {
    font-size: clamp(2.8rem, 4vw, 4.6rem);
    line-height: 0.96;
}

.meeting-title-block.is-editable {
    position: relative;
}

.hero-inline-editor,
.widget-editor {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.widget-editor[hidden],
.hero-inline-editor[hidden] {
    display: none !important;
}

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

.meeting-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.meeting-tools-left,
.meeting-tools-right,
.toolbar-inline-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tools-copy,
.toolbar-label,
.widget-heading p {
    margin: 0;
    color: var(--muted);
}

.toolbar-form,
.inline-action {
    margin: 0;
}

.chip-button,
.size-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.chip-button:hover,
.size-chip:hover {
    transform: translateY(-1px);
}

.chip-button.is-danger {
    color: var(--danger);
    background: rgba(225, 29, 72, 0.08);
}

.widget-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
}

.widget-card {
    grid-column: span 6;
    display: grid;
    gap: 18px;
}

.widget-card.is-compact {
    grid-column: span 4;
}

.widget-card.is-wide {
    grid-column: span 6;
}

.widget-card.is-full {
    grid-column: 1 / -1;
}

.widget-heading h2 {
    margin: 0;
    font-size: 1.45rem;
}

.widget-controls,
.size-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.size-chip.is-active {
    background: rgba(31, 111, 235, 0.12);
    color: var(--primary);
    border-color: rgba(31, 111, 235, 0.2);
}

.progress-widget-modern {
    display: grid;
    grid-template-columns: minmax(210px, 0.9fr) minmax(0, 1.1fr);
    gap: 18px;
    align-items: stretch;
}

.progress-badge-card {
    min-height: 220px;
    border-radius: 28px;
    padding: 24px;
    display: grid;
    align-content: space-between;
    background: linear-gradient(145deg, #2563eb, #0891b2);
    color: #fff;
}

.progress-badge-card strong {
    font-family: 'Sora', 'Segoe UI', sans-serif;
    font-size: 3.2rem;
    line-height: 1;
}

.progress-badge-card span {
    font-size: 1.2rem;
    font-weight: 600;
}

.progress-details-grid {
    display: grid;
    gap: 12px;
}

.progress-details-grid article {
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(148, 163, 184, 0.08);
}

.progress-details-grid article span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
}

.progress-inline-bar {
    grid-column: 1 / -1;
}

.gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.gallery-card {
    display: grid;
    gap: 0;
}

.gallery-card img {
    width: 100%;
    object-fit: cover;
}

.gallery-card.is-square img {
    aspect-ratio: 1 / 1;
}

.gallery-card.is-landscape img {
    aspect-ratio: 16 / 10;
}

.gallery-card.is-portrait img {
    aspect-ratio: 3 / 4;
}

.gallery-caption-main {
    display: grid;
    gap: 4px;
}

.gallery-caption-main strong {
    font-size: 1rem;
}

.gallery-caption-main span {
    color: var(--muted);
    font-size: 0.88rem;
}

.gallery-form-card {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(148, 163, 184, 0.08);
}

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

.custom-card-image-fields {
    display: grid;
    gap: 12px;
}

.custom-card-field-copy {
    margin: 0;
    font-size: 0.92rem;
}

.custom-card-image-preview,
.custom-card-media {
    margin: 0;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: rgba(148, 163, 184, 0.08);
}

.custom-card-image-preview img,
.custom-card-media img {
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.48);
}

.hero-edit-form {
    border-top: 1px solid var(--border);
    padding-top: 4px;
}

.standalone-widget-editor {
    margin-top: 0;
    padding-top: 24px;
    border-top: 0;
}

.rich-text-field {
    display: grid;
    gap: 10px;
}

.rich-text-label {
    font-weight: 600;
}

.rich-editor-shell {
    display: grid;
    gap: 12px;
}

.rich-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rich-tool {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.rich-tool:hover {
    transform: translateY(-1px);
    border-color: rgba(31, 111, 235, 0.26);
    background: rgba(31, 111, 235, 0.1);
}

.rich-editor-surface {
    min-height: 180px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.56);
    line-height: 1.72;
    cursor: text;
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

html[data-theme='dark'] .rich-editor-surface {
    background: rgba(6, 10, 18, 0.45);
}

.rich-editor-surface:focus {
    border-color: rgba(31, 111, 235, 0.55);
    box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.08);
}

.rich-editor-surface[data-empty='true']::before {
    content: attr(data-placeholder);
    color: var(--muted);
}

.rich-editor-surface :is(p, ul, ol, blockquote, h3, h4) {
    margin-top: 0;
}

.rich-editor-surface p:last-child,
.rich-editor-surface ul:last-child,
.rich-editor-surface ol:last-child,
.rich-editor-surface blockquote:last-child,
.rich-editor-surface h3:last-child,
.rich-editor-surface h4:last-child {
    margin-bottom: 0;
}

.rich-editor-surface :is(ul, ol) {
    padding-left: 20px;
}

.rich-copy {
    gap: 14px;
}

.rich-copy :is(p, ul, ol, blockquote, h3, h4) {
    margin: 0;
}

.rich-copy :is(ul, ol) {
    display: grid;
    gap: 8px;
    padding-left: 22px;
}

.rich-copy blockquote {
    padding: 14px 16px;
    border-radius: 18px;
    border-left: 4px solid rgba(31, 111, 235, 0.38);
    background: rgba(31, 111, 235, 0.08);
    color: var(--muted);
}

.rich-copy h3,
.rich-copy h4 {
    font-family: 'Sora', 'Segoe UI', sans-serif;
    letter-spacing: -0.03em;
}

.is-custom-card {
    background:
        radial-gradient(circle at top right, rgba(31, 111, 235, 0.08), transparent 28%),
        var(--panel-strong);
}

.gallery-trigger {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
}

.gallery-trigger img {
    transition: transform 220ms ease;
}

.gallery-trigger:hover img {
    transform: scale(1.03);
}

.gallery-zoom-hint {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(11, 18, 32, 0.78);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 24px;
}

.gallery-lightbox[hidden] {
    display: none !important;
}

.gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 16, 0.82);
}

.gallery-lightbox-dialog {
    position: relative;
    z-index: 1;
    width: min(1100px, 100%);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
}

.gallery-lightbox-figure {
    margin: 0;
    padding: 18px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(12, 18, 32, 0.94);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.35);
    display: grid;
    gap: 14px;
}

.gallery-lightbox-figure img {
    width: 100%;
    max-height: min(76vh, 820px);
    border-radius: 20px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.03);
}

.gallery-lightbox-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: #fff;
}

.gallery-lightbox-caption strong {
    font-size: 1.02rem;
}

.gallery-lightbox-caption span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
    white-space: nowrap;
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    backdrop-filter: blur(8px);
    transition: transform 180ms ease, background 180ms ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-nav:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.16);
}

.gallery-lightbox-close {
    position: absolute;
    top: -10px;
    right: 0;
}

@media (max-width: 1080px) {
    .hero-panel,
    .dashboard-grid,
    .detail-layout,
    .meeting-hero,
    .auth-card {
        grid-template-columns: 1fr;
    }

    .editor-panel {
        position: static;
    }

    .widget-card.is-compact,
    .widget-card.is-wide {
        grid-column: span 6;
    }

    .gallery-lightbox-dialog {
        grid-template-columns: 1fr;
    }

    .gallery-lightbox-nav {
        justify-self: center;
    }
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100vw - 20px, 100%);
        padding-top: 14px;
    }

    .topbar,
    .section-head,
    .layout-toolbar,
    .form-hero,
    .cover-overlay,
    .meeting-tools {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-stats,
    .form-grid,
    .gallery-grid,
    .hero-meta-grid {
        grid-template-columns: 1fr;
    }

    .meeting-card,
    .progress-widget,
    .progress-widget-modern,
    .timeline-item,
    .participant-card {
        grid-template-columns: 1fr;
    }

    .widget-card,
    .widget-card.is-compact,
    .widget-card.is-wide,
    .widget-card.is-full {
        grid-column: 1 / -1;
    }

    .rich-toolbar,
    .gallery-lightbox-caption {
        flex-direction: column;
        align-items: stretch;
    }

    .gallery-lightbox {
        padding: 16px;
    }

    .gallery-lightbox-close {
        position: static;
        justify-self: end;
    }

    .meeting-cover-thumb {
        min-height: 200px;
    }

    .auth-card,
    .panel,
    .hero-copy,
    .hero-stats {
        padding: 20px;
    }
}
