*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
:root {
    --bg: #f9f7f4;
    --ink: #1a1814;
    --muted: #7a7570;
    --rule: #e2ddd8;
    --accent: #2a5caa;
    --danger: #c0392b;
    --ff: "Georgia", serif;
    --fm: "SFMono-Regular", "Consolas", monospace;
}
body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--ff);
    font-size: 1rem;
    line-height: 1.75;
}
a {
    color: var(--accent);
}
.wrap {
    max-width: 680px;
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
}

/* Nav */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--rule);
    font-family: var(--fm);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}
nav .brand {
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
}
nav .links {
    display: flex;
    gap: 1.25rem;
}
nav .links a {
    color: var(--muted);
    text-decoration: none;
}
nav .links a:hover {
    color: var(--ink);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}
label {
    display: block;
    font-family: var(--fm);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 0.35rem;
}
input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: #fff;
    font-family: var(--ff);
    font-size: 0.95rem;
    color: var(--ink);
    transition: border-color 0.15s;
}
input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}
textarea {
    resize: none;
    overflow: hidden;
}
.help {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.25rem;
}
.errorlist {
    list-style: none;
    color: var(--danger);
    font-size: 0.82rem;
    margin-top: 0.25rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    border-radius: 4px;
    font-family: var(--fm);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover {
    background: #1e4a8a;
}
.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: var(--rule);
}
.btn-ghost:hover {
    border-color: var(--muted);
    color: var(--ink);
}
.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: #e8b4b0;
}
.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

/* Messages */
.messages {
    list-style: none;
    margin-bottom: 1.5rem;
}
.messages li {
    padding: 0.6rem 0.9rem;
    border-radius: 4px;
    font-size: 0.88rem;
    background: #e8f0fb;
    color: var(--accent);
    border: 1px solid #c5d8f5;
}

/* Misc */
hr {
    border: none;
    border-top: 1px solid var(--rule);
    margin: 2rem 0;
}
h1 {
    font-size: 1.9rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}
h2 {
    font-family: var(--fm);
    color: var(--accent);

    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.mono {
    font-family: var(--fm);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--muted);
}
header {
    margin-bottom:2.5rem
}

/* Footer */
.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}
.site-footer .version {
    cursor: default;
}
.site-footer .footer-meta {
    flex-basis: 100%;
    opacity: 0.45;
    font-size: 0.55rem;
}
.footer-engineroom {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.badge-new {
    display: inline-block;
    padding: 0.05rem 0.4rem;
    border-radius: 3px;
    background: #e8f0fb;
    color: var(--accent);
    font-family: var(--fm);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Markdown content */
.content h2 {
    margin-top: 1.75rem;
}
.content h3 {
    font-family: var(--fm);
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 1.25rem;
    margin-bottom: 0.35rem;
}
.content p {
    margin-bottom: 0.9rem;
}
.content ul,
.content ol {
    margin: 0 0 0.9rem 1.25rem;
}
.content li {
    margin-bottom: 0.3rem;
}
.content code {
    font-family: var(--fm);
    font-size: 0.85em;
    background: #f0ede8;
    padding: 0.1em 0.35em;
    border-radius: 3px;
}
.content pre {
    background: #f0ede8;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 0.9rem;
}
.content pre code {
    background: none;
    padding: 0;
}

/* Layout helpers */
.muted {
    color: var(--muted);
}
.panel {
    max-width: 400px;
}
.back-link {
    color: var(--muted);
    text-decoration: none;
    margin-bottom: 0.5rem;
}
.actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.notice {
    background: #fef9e7;
    border: 1px solid #f0d080;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
.empty {
    text-align: center;
    padding: 3rem 0;
    color: var(--muted);
}
.empty p {
    margin-bottom: 1rem;
}
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}
.list-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--rule);
}
.subheading {
    font-size: 1rem;
    margin-bottom: 0.4rem;
}
.subheading.danger {
    color: var(--danger);
}
.subtext {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 0.85rem;
}
.page-heading {
    margin-bottom: 1.75rem;
}
.entry-link {
    font-weight: 600;
    text-decoration: none;
    color: var(--ink);
}

/* Section table (dashboard) */
.section-table {
    width: 100%;
    border-collapse: collapse;
}
.section-table tr {
    border-bottom: 1px solid var(--rule);
}
.section-table th {
    text-align: left;
    padding: 0.4rem 0;
    font-family: var(--fm);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 400;
}
.section-table td {
    padding: 0.65rem 0;
}
.section-table th.center,
.section-table td.center {
    text-align: center;
}
.section-table .drag-handle {
    width: 1.5rem;
    cursor: grab;
    color: var(--muted);
}
.section-table .title-link {
    color: inherit;
    text-decoration: none;
}
.section-table .toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem 0.5rem;
    color: inherit;
}
.section-table .actions-cell {
    text-align: right;
    padding: 0.65rem 0;
    white-space: nowrap;
}
.section-table .btn-sm {
    font-size: 0.7rem;
    padding: 0.3rem 0.7rem;
}
