:root {
    --teal: #2dd4bf;
    --slate: #334155;
    --text: #1e293b;
}

body {
    font: 16px/1.5 Inter, system-ui, sans-serif;
    color: var(--text);
    margin: 0 auto;
    padding: 2rem;
    max-width: 1200px;
}

h1 {
    font-weight: 700;
}

input,
button,
textarea,
select {
    font: inherit;
    padding: .5rem .6rem;
}

select {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
}

select:disabled {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

button {
    background: var(--teal);
    border: 0;
    color: #04201c;
    border-radius: 6px;
    cursor: pointer;
}

button.ghost {
    background: transparent;
    color: var(--slate);
    border: 1px solid #cbd5e1;
}

.row {
    display: flex;
    gap: .5rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* Labelled field: stacked label above the control */
.field {
    margin-bottom: 1rem;
}

.field > label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--slate);
    margin-bottom: .25rem;
}

.field > input,
.field > textarea,
.field > select {
    width: 100%;
    box-sizing: border-box;
}

/* Two equal columns, collapsing to one below the md breakpoint */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.err {
    color: #e11d48;
}

ul {
    list-style: none;
    padding: 0;
}

li {
    padding: .6rem .8rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: .4rem;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
}

.draft {
    color: #94a3b8;
    font-size: .85em;
}

.hidden {
    display: none;
}

textarea {
    width: 100%;
}

.tag-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 6px;
    box-sizing: border-box;
}

.tag-wrap input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 120px;
    background: transparent;
    color: inherit;
    padding: 2px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2dd4bf;
    color: #0f172a;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
}

.chip button {
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.md-split {
    align-items: stretch;
}

.md-split > #f_content,
.md-split > .md-preview {
    flex: 1;
    min-width: 0;
    width: auto;
}

.md-preview {
    overflow-y: auto;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: .5rem .6rem;
}

button.danger {
    background: transparent;
    color: #e11d48;
    border: 1px solid #e11d48;
}

.row-actions {
    display: flex;
    gap: .4rem;
    align-items: center;
}

.row-act {
    padding: .2rem .5rem;
    font-size: .85em;
}

.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.confirm-box {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 400px;
    width: calc(100% - 2rem);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .2);
}

.confirm-msg {
    margin: 0 0 1.25rem;
    color: var(--text);
}

.confirm-actions {
    margin-bottom: 0;
    justify-content: flex-end;
}
