:root {
    color-scheme: dark;
    --bg: #080b0a;
    --panel: #171d1a;
    --panel-soft: #1f2823;
    --field: #111714;
    --text: #edf4ef;
    --muted: #9eaaa3;
    --line: #2d3933;
    --line-strong: #415249;
    --accent: #71d19d;
    --accent-strong: #a8e7bf;
    --accent-text: #07130e;
    --warning: #f0bf65;
    --error: #ff9a9a;
    --success: #91dca8;
    --danger-bg: #2b1718;
    --danger-line: #744043;
    --success-bg: #132a1d;
    --success-line: #315d40;
    --shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
    --texture-soft: rgba(113, 209, 157, 0.006);
    --topbar-bg: rgba(15, 19, 17, 0.94);
    --quick-jot-bg: linear-gradient(135deg, rgba(23, 29, 26, 0.98), rgba(31, 40, 35, 0.94));
    --danger-hover-bg: #3a1e20;
    --comment-bubble-hover-bg: #26352e;
    --entry-panel-alt: #1c241f;
    --entry-panel-soft-alt: #263129;
    --entry-footer-bg-base: rgba(31, 40, 35, 0.46);
    --entry-footer-bg-alt: rgba(38, 49, 41, 0.52);
    --home-event-alt: #222b25;
    --mobile-nav-bg: rgba(15, 19, 17, 0.98);
    --mobile-nav-shadow: 0 -12px 26px rgba(0, 0, 0, 0.32);
    --notice-close-hover-bg: rgba(255, 255, 255, 0.08);
    --reminder-dot: #ff4f4f;
    --reminder-dot-ring: #171d1a;
}

[data-theme="light"] {
    color-scheme: light;
    --bg: #f6f7f4;
    --panel: #ffffff;
    --panel-soft: #eef5f1;
    --field: #ffffff;
    --text: #202624;
    --muted: #66716d;
    --line: #d8dfd8;
    --line-strong: #c7d1ca;
    --accent: #286b57;
    --accent-strong: #1f5445;
    --accent-text: #ffffff;
    --warning: #8b5e12;
    --error: #9f2e2e;
    --success: #246b3d;
    --danger-bg: #fff2f2;
    --danger-line: #efc3c3;
    --success-bg: #eaf5ed;
    --success-line: #b7d8c2;
    --shadow: 0 14px 32px rgba(32, 38, 36, 0.08);
    --texture-soft: rgba(40, 107, 87, 0.014);
    --topbar-bg: rgba(255, 255, 255, 0.94);
    --quick-jot-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(238, 245, 241, 0.92));
    --danger-hover-bg: #ffe8e8;
    --comment-bubble-hover-bg: #dfeee6;
    --entry-panel-alt: #f1f5f0;
    --entry-panel-soft-alt: #e5eee7;
    --entry-footer-bg-base: rgba(238, 245, 241, 0.52);
    --entry-footer-bg-alt: rgba(229, 238, 231, 0.62);
    --home-event-alt: #f6faf7;
    --mobile-nav-bg: rgba(255, 255, 255, 0.98);
    --mobile-nav-shadow: 0 -12px 26px rgba(32, 38, 36, 0.08);
    --notice-close-hover-bg: rgba(32, 38, 36, 0.08);
    --reminder-dot: #d92d20;
    --reminder-dot-ring: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--bg);
    background-image: repeating-linear-gradient(135deg, transparent 0 12px, var(--texture-soft) 12px 13px);
    background-size: 18px 18px;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

a {
    color: var(--accent);
    font-weight: 650;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    align-items: center;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 24px;
    justify-content: flex-start;
    min-height: 86px;
    padding: 8px 32px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.brand {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    min-width: 170px;
}

.brand-logo {
    display: block;
    height: auto;
    max-width: min(310px, 42vw);
    width: clamp(220px, 24vw, 310px);
}

.nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-left: auto;
}

.nav-label {
    display: none;
}

.nav-home {
    display: none;
}

.nav-icon {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: var(--accent);
    cursor: pointer;
    display: inline-flex;
    height: 40px;
    justify-content: center;
    padding: 0;
    position: relative;
    width: 40px;
}

.nav-icon svg {
    fill: none;
    height: 22px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 22px;
}

.nav-icon:hover {
    background: var(--panel-soft);
    text-decoration: none;
}

.nav-icon.is-active {
    background: var(--panel-soft);
    color: var(--accent-strong);
}

.nav-profile-icon img {
    border: 2px solid var(--accent);
    border-radius: 999px;
    display: block;
    height: 32px;
    object-fit: cover;
    width: 32px;
}

.nav-icon-has-dot::after {
    background: var(--reminder-dot);
    border: 2px solid var(--reminder-dot-ring);
    border-radius: 999px;
    content: "";
    height: 8px;
    position: absolute;
    right: 7px;
    top: 7px;
    width: 8px;
}

.inline-icon {
    align-items: center;
    border-radius: 999px;
    color: var(--accent);
    display: inline-flex;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.inline-icon svg {
    fill: none;
    height: 20px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 20px;
}

.inline-icon:hover {
    background: var(--panel-soft);
    color: var(--accent-strong);
    text-decoration: none;
}

.nav-icon-action {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: var(--accent-text);
    margin-left: 10px;
}

.nav-icon-action:hover {
    background: var(--accent-strong);
    text-decoration: none;
}

.sr-only {
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.shell {
    margin: 0 auto;
    max-width: 1120px;
    padding: 32px;
}

.public-view .shell {
    max-width: 860px;
    padding-top: 28px;
}

.public-entry-list {
    gap: 24px;
}

.public-entry-thread .entry {
    overflow: hidden;
}

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

h1,
h2 {
    line-height: 1.15;
    margin: 0;
}

h1 {
    font-size: 32px;
}

h2 {
    font-size: 18px;
}

p {
    color: var(--muted);
    margin: 6px 0 0;
}

.auth-panel,
.empty-state,
.entry,
.profile-form,
.entry-form,
.table-wrap {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.auth-panel {
    margin: 64px auto;
    max-width: 420px;
    padding: 28px;
}

.stack {
    display: grid;
    gap: 18px;
}

label,
fieldset {
    display: grid;
    gap: 7px;
}

label span,
legend {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

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

input,
select,
textarea {
    background: var(--field);
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    color: var(--text);
    min-height: 42px;
    padding: 10px 12px;
    width: 100%;
}

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

fieldset {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 0;
    padding: 16px;
}

button,
.primary-action,
.secondary-action,
.cancel-action {
    align-items: center;
    border-radius: 7px;
    cursor: pointer;
    display: inline-flex;
    font-weight: 750;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    position: relative;
    text-decoration: none;
    --loading-spinner-color: var(--text);
    --loading-spinner-track: var(--line-strong);
}

button {
    background: var(--field);
    border: 1px solid var(--line-strong);
    color: var(--text);
}

.primary-action {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: var(--accent-text);
    --loading-spinner-color: var(--accent-text);
    --loading-spinner-track: rgba(255, 255, 255, 0.42);
}

.primary-action:hover {
    background: var(--accent-strong);
    text-decoration: none;
}

.secondary-action {
    background: var(--panel-soft);
    border: 1px solid var(--line-strong);
    color: var(--accent-strong);
    --loading-spinner-color: var(--accent-strong);
}

.secondary-action:hover {
    text-decoration: none;
}

.cancel-action {
    background: var(--danger-bg);
    border: 1px solid var(--danger-line);
    color: var(--error);
    --loading-spinner-color: var(--error);
    --loading-spinner-track: var(--danger-line);
}

.cancel-action:hover {
    background: var(--danger-hover-bg);
    text-decoration: none;
}

button.is-loading {
    color: transparent;
    cursor: wait;
    pointer-events: none;
}

button.is-loading > * {
    opacity: 0;
}

button.is-loading::after {
    animation: spin 0.8s linear infinite;
    border: 2px solid var(--loading-spinner-track);
    border-radius: 999px;
    border-top-color: var(--loading-spinner-color);
    content: "";
    height: 18px;
    left: calc(50% - 9px);
    position: absolute;
    top: calc(50% - 9px);
    width: 18px;
}

.quick-jot {
    align-items: end;
    background: var(--quick-jot-bg);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) max-content;
    margin-bottom: 16px;
    padding: 16px;
}

.hxp-public-logo {
    align-items: center;
    background: linear-gradient(180deg, #74c7ee 0 33%, #ffffff 33% 66%, #74c7ee 66% 100%);
    border: 1px solid rgba(70, 150, 190, 0.42);
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: #123f67;
    display: inline-flex;
    font-size: 13px;
    gap: 9px;
    letter-spacing: 0;
    line-height: 1;
    margin-bottom: 14px;
    min-height: 38px;
    padding: 7px 14px;
}

.hxp-public-logo strong {
    color: #0b3762;
    font-size: 21px;
    font-weight: 900;
}

.hxp-public-logo-mark {
    background: #f7b733;
    border-radius: 999px;
    box-shadow: 0 0 0 3px rgba(247, 183, 51, 0.2);
    height: 12px;
    width: 12px;
}

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

.quick-jot textarea {
    min-height: 74px;
    resize: vertical;
}

.media-action {
    align-items: center;
    background: var(--field);
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    color: var(--accent);
    cursor: pointer;
    display: inline-flex;
    height: 40px;
    justify-content: center;
    min-height: 40px;
    padding: 0;
    position: relative;
    width: 40px;
}

.media-action svg {
    fill: none;
    height: 21px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 21px;
}

.media-action:hover {
    background: var(--panel-soft);
    color: var(--accent-strong);
}

.mobile-camera-action {
    display: none;
}

.media-action.is-loading,
.media-action:disabled {
    cursor: wait;
    opacity: 0.92;
}

.media-action.is-loading svg {
    opacity: 0;
}

.media-action.is-loading::after {
    animation: spin 0.8s linear infinite;
    border: 2px solid var(--line-strong);
    border-top-color: var(--accent);
    border-radius: 999px;
    content: "";
    height: 18px;
    position: absolute;
    width: 18px;
}

.quick-jot-media-input,
.quick-jot-selfie-input {
    display: none;
}

.quick-jot .primary-action {
    min-width: 112px;
    white-space: nowrap;
}

.emoji-picker-wrap {
    display: inline-flex;
    position: relative;
}

.emoji-picker-toggle span {
    font-size: 18px;
    line-height: 1;
}

.emoji-picker {
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(6, 34px);
    max-width: calc(100vw - 16px);
    padding: 7px;
    position: fixed;
    z-index: 70;
}

.emoji-picker[hidden] {
    display: none;
}

.emoji-choice {
    align-items: center;
    background: var(--panel-soft);
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font-size: 18px;
    height: 34px;
    justify-content: center;
    padding: 0;
    width: 34px;
}

.emoji-choice:hover,
.emoji-choice:focus-visible {
    background: var(--field);
    border-color: var(--line-strong);
}

.entry-editor-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: -6px;
}

.home-events {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin: -4px 0 16px;
    overflow: hidden;
    position: relative;
}

.hxp-log-divider {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 12px;
    font-weight: 850;
    gap: 10px;
    letter-spacing: 0;
    margin: 3px 0 10px;
    text-align: center;
    text-transform: uppercase;
}

.hxp-log-divider::before,
.hxp-log-divider::after {
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
    content: "";
    flex: 1 1 auto;
    height: 1px;
}

.hxp-log-divider span {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 9px;
}

.home-events-title {
    align-items: center;
    color: var(--text);
    display: inline-flex;
    gap: 8px;
    min-width: 0;
}

.home-events-title svg {
    fill: none;
    flex: 0 0 auto;
    height: 18px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 18px;
}

.home-events-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-events-toggle {
    align-items: center;
    background: var(--panel-soft);
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    color: var(--accent-strong);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font: inherit;
    height: 31px;
    justify-content: center;
    min-height: 31px;
    padding: 0;
    position: absolute;
    right: 20px;
    top: 16px;
    width: 31px;
    z-index: 2;
}

.home-events-toggle:hover {
    background: var(--field);
}

.home-events-toggle svg {
    fill: none;
    height: 17px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 17px;
}

.home-events.is-collapsed {
    min-height: 46px;
}

.home-events.is-collapsed .home-events-toggle {
    right: 8px;
    top: 7px;
}

.home-events-body {
    padding: 6px 12px 12px;
}

.home-events-body[hidden] {
    display: none;
}

.home-events-layout {
    align-items: start;
    display: grid;
    gap: 12px;
    grid-template-columns: 76px minmax(0, 1fr);
}

.home-events-date-card {
    align-items: center;
    background: var(--panel-soft);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--text);
    display: grid;
    gap: 7px;
    min-height: 86px;
    padding: 10px 8px;
    text-align: center;
}

.home-events-date-card:hover {
    background: var(--field);
    text-decoration: none;
}

.home-events-date-card svg {
    fill: none;
    height: 19px;
    justify-self: center;
    stroke: var(--accent-strong);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 19px;
}

.home-events-date-card time {
    display: grid;
    gap: 2px;
    line-height: 1;
}

.home-events-date-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.home-events-date-card strong {
    color: var(--text);
    font-size: 28px;
    font-weight: 950;
    letter-spacing: 0;
}

.home-event-list {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
}

.home-event-pill {
    background: var(--panel-soft);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--text);
    display: grid;
    gap: 4px;
    min-height: 54px;
    padding: 9px 12px;
}

.home-event-pill:nth-child(even) {
    background: var(--home-event-alt);
}

.home-event-pill:hover {
    background: var(--field);
    text-decoration: none;
}

.home-event-pill:first-child .home-event-head {
    padding-right: 42px;
}

.home-event-head {
    align-items: center;
    display: flex;
    gap: 9px;
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
}

.home-event-time {
    color: var(--accent-strong);
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.2;
    margin-left: auto;
    text-align: right;
    text-transform: none;
    white-space: nowrap;
}

.home-event-name {
    flex: 1 1 auto;
    font-weight: 850;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-event-details {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    overflow: hidden;
    padding-top: 6px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-event-date-line {
    color: var(--muted);
    display: none;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.home-event-pill em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.toolbar {
    align-items: end;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 22px;
    padding: 16px;
}

.filters-panel[hidden] {
    display: none;
}

.entry-list {
    display: grid;
    gap: 30px;
}

.event-reminders {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.event-reminder {
    background: var(--success-bg);
    border: 1px solid var(--success-line);
    border-radius: 8px;
    color: var(--success);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px 14px;
}

.event-reminder:hover {
    text-decoration: none;
}

.event-list {
    display: grid;
    gap: 16px;
}

.event-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 16px;
    grid-template-columns: 72px minmax(0, 1fr);
    padding: 16px;
}

.event-date {
    align-self: start;
    background: var(--panel-soft);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--text);
    display: grid;
    line-height: 1;
    min-height: 72px;
    place-items: center;
    text-align: center;
}

.event-date span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.event-date strong {
    font-size: 28px;
}

.event-main {
    min-width: 0;
}

.event-header {
    align-items: start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.event-meta {
    color: var(--accent-strong);
    font-size: 14px;
    font-weight: 750;
    margin-top: 10px;
}

.event-details {
    margin-top: 10px;
    overflow-wrap: anywhere;
}

.event-details p {
    color: inherit;
}

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

.event-time-selects {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
}

.entry-thread {
    --entry-panel: var(--panel);
    --entry-panel-soft: var(--panel-soft);
    --entry-footer-bg: var(--entry-footer-bg-base);
    display: grid;
    gap: 10px;
    transition: opacity 160ms ease, transform 160ms ease;
}

.entry-thread:nth-child(even) {
    --entry-panel: var(--entry-panel-alt);
    --entry-panel-soft: var(--entry-panel-soft-alt);
    --entry-footer-bg: var(--entry-footer-bg-alt);
}

.entry-thread.is-read {
    opacity: 0.82;
}

.entry-thread.is-removing {
    opacity: 0;
    transform: translateY(-6px);
}

.entry-live-error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-line);
    border-radius: 8px;
    color: var(--error);
    font-size: 13px;
    font-weight: 800;
    padding: 8px 10px;
}

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

.entry {
    background: var(--entry-panel);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

.entry::before {
    background: linear-gradient(90deg, var(--accent), transparent);
    content: "";
    height: 3px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.comment {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 14px;
    grid-template-columns: 54px 1fr;
    padding: 16px;
}

.comment-count {
    align-items: center;
    background: var(--panel-soft);
    border-radius: 7px;
    color: var(--accent-strong);
    display: flex;
    font-weight: 800;
    height: 42px;
    justify-content: center;
}

.comment-bubble {
    align-items: center;
    background: var(--panel-soft);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--accent-strong);
    display: inline-flex;
    gap: 7px;
    min-height: 36px;
    min-width: 58px;
    padding: 6px 12px;
}

.comment-bubble svg {
    fill: none;
    height: 18px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 18px;
}

.comment-bubble span {
    font-weight: 850;
    line-height: 1;
}

.comment-bubble:hover {
    background: var(--comment-bubble-hover-bg);
}

.interaction-wrap {
    display: inline-flex;
    position: relative;
}

.interaction-button {
    align-items: center;
    background: var(--panel-soft);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--accent-strong);
    display: inline-flex;
    gap: 7px;
    min-height: 36px;
    min-width: 58px;
    padding: 6px 12px;
}

.interaction-button:hover,
.interaction-button:focus-visible {
    background: var(--comment-bubble-hover-bg);
}

.interaction-button svg {
    fill: none;
    height: 18px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 18px;
}

.interaction-button span {
    font-weight: 850;
    line-height: 1;
}

.interaction-popover {
    min-width: 142px;
}

.comments-panel {
    background: var(--entry-panel);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 10px 12px 12px;
}

.comments-panel[hidden] {
    display: none;
}

.inline-comment-form {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) max-content;
}

.inline-comment-form input {
    min-height: 38px;
    padding: 8px 11px;
}

.inline-comment-form .primary-action {
    min-height: 38px;
    padding: 8px 12px;
}

.inline-comment-list {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
}

.inline-comment {
    align-items: flex-start;
    background: transparent;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 9px;
    padding: 0 0 8px;
}

.inline-comment:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.inline-comment-meta {
    align-items: center;
    display: flex;
    gap: 8px;
    line-height: 1.25;
    margin-bottom: 3px;
}

.inline-comment-avatar {
    background: var(--field);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--accent-strong);
    display: inline-grid;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 900;
    height: 30px;
    line-height: 1;
    object-fit: cover;
    place-items: center;
    width: 30px;
}

.inline-comment-content {
    flex: 1 1 auto;
    min-width: 0;
}

.inline-comment-meta strong {
    color: var(--text);
    font-size: 13px;
}

.inline-comment-meta time {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.inline-comment-text {
    color: var(--text);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.inline-comment-text p {
    color: inherit;
    margin: 0;
}

.comment-empty {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    margin-top: 10px;
    padding-top: 10px;
}

.comment-body {
    overflow-wrap: anywhere;
}

.comment-body footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    margin-top: 12px;
    padding-top: 10px;
}

.entry-header,
.entry-footer {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 16px 18px;
}

.entry-header {
    border-bottom: 1px solid var(--line);
    background: var(--entry-panel-soft);
}

.entry-identity {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.entry-avatar {
    background: var(--field);
    border: 2px solid var(--line-strong);
    border-radius: 999px;
    color: var(--accent-strong);
    display: inline-grid;
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 900;
    height: 44px;
    object-fit: cover;
    place-items: center;
    width: 44px;
}

.entry-avatar-fallback {
    line-height: 1;
}

.entry-header time,
.entry-footer {
    color: var(--muted);
    font-size: 13px;
}

.entry-body {
    overflow-wrap: anywhere;
    padding: 18px;
}

.entry-body img,
.entry-body video {
    height: auto;
    max-width: 100%;
}

@media (min-width: 761px) {
    .entry-body img,
    .entry-body video {
        display: block;
        max-height: 500px;
        max-width: min(500px, 100%);
        object-fit: contain;
        width: auto;
    }
}

.entry-body figure {
    margin: 18px 0;
}

.entry-body video {
    background: #000;
    border-radius: 8px;
    display: block;
}

.entry-body figcaption {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
}

.entry-form input[type="file"] {
    padding: 8px 10px;
}

.entry-footer {
    border-top: 1px solid var(--line);
    background: var(--entry-footer-bg);
    flex-wrap: wrap;
    justify-content: space-between;
}

.entry-footer-actions {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    gap: 8px;
    margin-left: auto;
}

.reaction-row {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
}

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

.reaction-pill {
    align-items: stretch;
    background: var(--panel-soft);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    display: inline-flex;
    position: relative;
}

.reaction-pill:hover {
    background: var(--field);
}

.reaction-pill.is-active {
    background: var(--success-bg);
    border-color: var(--success-line);
    color: var(--accent-strong);
}

.reaction-pill.is-active .reaction-button,
.reaction-pill.is-active .reaction-count-button {
    color: var(--accent-strong);
}

.reaction-button,
.reaction-count-button {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--text);
    display: inline-flex;
    gap: 5px;
    justify-content: center;
    min-height: 30px;
    padding: 4px 8px;
}

.reaction-button {
    border-radius: 999px 0 0 999px;
    min-width: 32px;
    padding-left: 9px;
}

.reaction-count-button {
    border-left: 1px solid var(--line);
    border-radius: 0 999px 999px 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    min-width: 28px;
    padding-left: 7px;
    padding-right: 9px;
}

.reaction-button:hover,
.reaction-count-button:hover,
.reaction-count-button:focus-visible {
    background: var(--field);
    color: var(--accent-strong);
}

.reaction-count-button.is-static {
    cursor: default;
}

.reaction-count-button.is-static:hover {
    background: transparent;
    color: var(--muted);
}

.reaction-picker-wrap {
    display: inline-flex;
    position: relative;
}

.reaction-add-button,
.reaction-choice {
    align-items: center;
    background: var(--panel-soft);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--accent-strong);
    display: inline-flex;
    justify-content: center;
    min-height: 32px;
    min-width: 32px;
    padding: 4px;
}

.reaction-add-button:hover,
.reaction-choice:hover {
    background: var(--field);
}

.reaction-add-button svg {
    fill: none;
    height: 17px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.3;
    width: 17px;
}

.reaction-picker {
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    box-shadow: var(--shadow);
    display: inline-flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: calc(100vw - 16px);
    padding: 5px;
    position: fixed;
    z-index: 30;
}

.reaction-picker[hidden] {
    display: none;
}

.public-reaction-picker {
    align-items: center;
    border-radius: 12px;
    margin: 0;
}

.public-reaction-name input {
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    min-height: 32px;
    padding: 5px 10px;
    width: 128px;
}

.public-reaction-choices {
    align-items: center;
    display: inline-flex;
    gap: 5px;
}

.reaction-info-popover {
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: var(--text);
    display: grid;
    font-size: 13px;
    font-weight: 750;
    gap: 4px;
    line-height: 1.35;
    max-width: calc(100vw - 16px);
    min-width: 124px;
    padding: 9px 11px;
    position: fixed;
    text-align: left;
    z-index: 80;
}

.reaction-info-popover[hidden] {
    display: none;
}

.reaction-choice {
    border-color: transparent;
    font-size: 17px;
}

.reaction-symbol {
    font-size: 17px;
    line-height: 1;
}

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

.updated-status {
    align-items: center;
    background: var(--danger-bg);
    border: 1px solid var(--danger-line);
    border-radius: 999px;
    color: var(--error);
    display: inline-flex;
    font-size: 12px;
    font-weight: 850;
    gap: 6px;
    min-height: 36px;
    padding: 6px 10px;
    text-transform: uppercase;
}

.updated-status svg {
    fill: none;
    height: 17px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
    width: 17px;
}

.mark-read-button,
.read-status {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    min-height: 36px;
    padding: 0;
    width: 36px;
}

.mark-read-button {
    background: var(--panel-soft);
    border: 1px solid var(--line-strong);
    color: var(--accent-strong);
}

.mark-read-button:hover {
    background: var(--field);
}

.read-status {
    background: var(--success-bg);
    border: 1px solid var(--success-line);
    color: var(--success);
}

.mark-read-button svg,
.read-status svg {
    fill: none;
    height: 19px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.4;
    width: 19px;
}

.table-wrap {
    overflow: auto;
}

table {
    border-collapse: collapse;
    min-width: 720px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 13px 14px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
}

.profile-form,
.entry-form {
    padding: 20px;
}

.profile-photo-field {
    padding: 18px;
}

.profile-photo-editor {
    align-items: center;
    display: grid;
    gap: 18px;
    grid-template-columns: 132px minmax(0, 1fr);
}

.profile-photo-preview {
    background: var(--field);
    border: 2px solid var(--line-strong);
    border-radius: 999px;
    color: var(--accent-strong);
    display: grid;
    font-size: 34px;
    font-weight: 900;
    height: 132px;
    overflow: hidden;
    place-items: center;
    position: relative;
    width: 132px;
}

.profile-photo-preview img {
    height: 100%;
    object-fit: cover;
    position: absolute;
    transform-origin: center;
    width: 100%;
}

.profile-photo-preview span {
    position: relative;
    z-index: 1;
}

.profile-photo-controls {
    display: grid;
    gap: 12px;
}

.profile-crop-controls {
    display: grid;
    gap: 12px;
}

.profile-crop-controls[hidden] {
    display: none;
}

.profile-photo-adjustments {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.date-field {
    max-width: 260px;
}

.entry-date-actions {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 260px) max-content;
    justify-content: start;
}

.entry-date-actions .primary-action {
    white-space: nowrap;
}

.form-actions {
    align-items: center;
    display: flex;
    gap: 16px;
}

.event-delete-form {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.profile-actions,
.profile-logout {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.profile-logout {
    justify-content: flex-end;
    margin-top: 16px;
}

.admin-panel {
    margin-bottom: 24px;
}

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

.admin-user-card {
    box-shadow: var(--shadow);
}

.admin-user-header {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.admin-user-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-badge {
    background: var(--panel-soft);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 850;
    padding: 4px 10px;
}

.checkbox-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.theme-choice {
    background: var(--field);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    display: inline-grid;
    gap: 4px;
    grid-template-columns: repeat(2, minmax(88px, 1fr));
    padding: 4px;
}

.theme-choice label {
    cursor: pointer;
    display: block;
}

.theme-choice input {
    position: absolute;
    opacity: 0;
    width: 1px;
}

.theme-choice span {
    border-radius: 6px;
    color: var(--muted);
    display: block;
    font-weight: 800;
    padding: 8px 12px;
    text-align: center;
}

.theme-choice input:checked + span {
    background: var(--accent);
    color: var(--accent-text);
}

.check-row {
    align-items: center;
    display: flex;
    gap: 9px;
}

.check-row input {
    min-height: auto;
    width: auto;
}

.notice {
    border-radius: 8px;
    display: block;
    margin-bottom: 16px;
    min-height: 48px;
    padding: 14px 44px 14px 14px;
    position: relative;
}

.notice-success {
    background: var(--success-bg);
    border: 1px solid var(--success-line);
    color: var(--success);
}

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

.notice > .notice-close {
    align-items: center;
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    font-size: 22px;
    font-weight: 500;
    height: 28px;
    justify-content: center;
    line-height: 1;
    min-height: 28px;
    opacity: 0.72;
    padding: 0;
    position: absolute;
    right: 8px;
    top: 8px;
    width: 28px;
    z-index: 1;
}

.notice > .notice-close:hover {
    background: var(--notice-close-hover-bg);
    opacity: 1;
}

.notice > .notice-close svg {
    fill: none;
    height: 17px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.4;
    width: 17px;
}

.empty-state {
    padding: 28px;
    text-align: center;
}

.empty-state-heading {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.empty-read-count {
    align-items: center;
    background: var(--panel-soft);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--accent-strong);
    display: inline-flex;
    gap: 7px;
    min-height: 36px;
    padding: 6px 11px;
}

.empty-read-count:hover {
    background: var(--field);
    text-decoration: none;
}

.empty-read-count svg {
    fill: none;
    height: 18px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 18px;
}

.empty-read-count span {
    font-size: 13px;
    font-weight: 850;
    line-height: 1;
}

.empty-state-actions {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.empty-older-link {
    gap: 8px;
}

.empty-older-link svg {
    fill: none;
    height: 18px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
    width: 18px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 760px) {
    body {
        background-color: var(--bg);
    }

    .topbar {
        align-items: center;
        flex-direction: row;
        justify-content: center;
        min-height: 58px;
        padding: 8px 14px;
    }

    .brand {
        justify-content: center;
        min-width: 0;
        width: 100%;
    }

    .brand-logo {
        max-width: min(230px, 70vw);
        width: min(230px, 70vw);
    }

    .nav {
        background: var(--mobile-nav-bg);
        border-top: 1px solid var(--line);
        bottom: 0;
        box-shadow: var(--mobile-nav-shadow);
        display: grid;
        gap: 0;
        grid-auto-columns: 1fr;
        grid-auto-flow: column;
        left: 0;
        margin-left: 0;
        padding:
            6px max(10px, env(safe-area-inset-left))
            calc(6px + env(safe-area-inset-bottom))
            max(10px, env(safe-area-inset-right));
        position: fixed;
        right: 0;
        z-index: 20;
    }

    .nav-icon {
        border: 0;
        border-radius: 8px;
        display: inline-flex;
        flex-direction: column;
        gap: 3px;
        height: 52px;
        margin-left: 0;
        width: 100%;
    }

    .nav-icon:hover {
        background: var(--panel-soft);
        color: var(--accent-strong);
    }

    .nav-icon svg {
        height: 21px;
        width: 21px;
    }

    .nav-label {
        color: var(--muted);
        display: block;
        font-size: 11px;
        font-weight: 750;
        line-height: 1;
    }

    .add-entry-shortcut {
        border-radius: 999px;
        height: 40px;
        margin-left: 0;
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
    }

.add-entry-shortcut:hover {
        background: var(--accent-strong);
        color: var(--accent-text);
    }

    .shell {
        max-width: none;
        padding: 16px 12px calc(86px + env(safe-area-inset-bottom));
    }

    .public-view .shell {
        padding: 12px;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 14px;
    }

    .page-heading h1 {
        font-size: 22px;
    }

    .page-heading p {
        font-size: 13px;
        margin-top: 4px;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }

    .toolbar {
        box-shadow: none;
        gap: 10px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-bottom: 14px;
        padding: 12px;
    }

    .toolbar label:nth-of-type(n + 3),
    .toolbar button {
        grid-column: 1 / -1;
    }

    .quick-jot {
        align-items: stretch;
        box-shadow: none;
        gap: 10px;
        grid-template-columns: 1fr;
        margin-bottom: 12px;
        padding: 12px;
    }

    .quick-jot textarea {
        min-height: 96px;
    }

    .quick-jot-actions {
        justify-content: flex-end;
    }

    .mobile-camera-action {
        display: inline-flex;
    }

    .home-events {
        box-shadow: none;
        margin: -2px 0 12px;
    }

    .home-events-body {
        padding: 9px 10px 10px;
    }

    .home-events-toggle {
        right: 18px;
        top: 18px;
    }

    .home-events-layout {
        gap: 9px;
        grid-template-columns: 62px minmax(0, 1fr);
    }

    .home-events-date-card {
        min-height: 74px;
        padding: 8px 6px;
    }

    .home-events-date-card svg {
        height: 17px;
        width: 17px;
    }

    .home-events-date-card strong {
        font-size: 23px;
    }

    .home-event-list {
        grid-template-columns: 1fr;
    }

    .home-event-pill {
        min-height: 54px;
        padding: 9px 10px;
    }

    .home-event-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .home-event-time {
        margin-left: 0;
        text-align: left;
    }

    .home-event-date-line {
        display: block;
        margin-top: -1px;
    }

    .entry-list {
        gap: 20px;
    }

    .event-reminder {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .event-card {
        box-shadow: none;
        gap: 12px;
        grid-template-columns: 58px minmax(0, 1fr);
        padding: 12px;
    }

    .event-date {
        min-height: 58px;
    }

    .event-date strong {
        font-size: 22px;
    }

    .event-header h2 {
        font-size: 16px;
    }

    .event-form-grid {
        grid-template-columns: 1fr;
    }

    .entry-thread {
        gap: 7px;
    }

    .entry {
        border-radius: 8px;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
    }

    .entry-header,
    .entry-footer {
        gap: 12px;
        padding: 12px;
    }

    .entry-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .reaction-row {
        width: 100%;
    }

    .entry-footer-actions {
        justify-content: flex-end;
        margin-left: 0;
        width: 100%;
    }

    .entry-avatar {
        height: 38px;
        width: 38px;
    }

    .entry-header h2 {
        font-size: 16px;
    }

    .entry-body {
        font-size: 15px;
        padding: 14px 12px;
    }

    .inline-icon {
        height: 40px;
        width: 40px;
    }

    .comment-bubble,
    .interaction-button {
        min-height: 40px;
        min-width: 62px;
    }

    .comments-panel {
        box-shadow: none;
        padding: 10px;
    }

    .inline-comment-form {
        grid-template-columns: minmax(0, 1fr) max-content;
    }

    .profile-form,
    .entry-form,
    .table-wrap,
    .empty-state {
        box-shadow: none;
    }

    .profile-form,
    .entry-form {
        padding: 14px;
    }

    .profile-photo-editor,
    .profile-photo-adjustments {
        grid-template-columns: 1fr;
    }

    .admin-user-grid {
        grid-template-columns: 1fr;
    }

    .admin-user-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .entry-form textarea {
        min-height: 44vh;
    }

    .entry-date-actions {
        grid-template-columns: 1fr;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

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

    .date-field {
        max-width: none;
    }

    .comment {
        box-shadow: none;
        grid-template-columns: 46px 1fr;
        padding: 12px;
    }

    .notice {
        margin-bottom: 12px;
    }

    table {
        min-width: 0;
    }

    thead {
        display: none;
    }

    tr,
    td {
        display: block;
    }

    tbody tr {
        border-bottom: 1px solid var(--line);
        padding: 10px 0;
    }

    td {
        border-bottom: 0;
        padding: 5px 12px;
    }

    td:last-child {
        padding-top: 8px;
    }
}
