
:root {
    --brn-note-list-width: 320px;
    --brn-editor-height: 420px;
    --brn-border: #d9dee7;
    --brn-bg: #ffffff;
    --brn-soft: #f6f8fb;
    --brn-text: #17202a;
    --brn-muted: #657181;
    --brn-primary: #2563eb;
    --brn-danger: #dc2626;
}

.brn-wrap,
.brn-guest-box {
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    color: var(--brn-text);
}

.brn-wrap *,
.brn-guest-box * {
    box-sizing: border-box;
}

.brn-wrap {
    display: grid;
    grid-template-columns: minmax(0, min(100%, var(--brn-note-list-width))) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.brn-sidebar,
.brn-editor,
.brn-guest-card {
    background: var(--brn-bg);
    border: 1px solid var(--brn-border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.06);
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.brn-sidebar {
    padding: 16px;
}

.brn-sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}

.brn-note-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(var(--brn-editor-height) + 58px);
    overflow-y: auto;
    overflow-x: hidden;
}

.brn-note-item {
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--brn-border);
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

.brn-note-item.is-active {
    border-color: var(--brn-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.brn-note-item-title,
.brn-note-item-text,
.brn-title-input,
.brn-content-input,
.brn-search,
.brn-status {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.brn-note-item-title {
    font-weight: 700;
    color: var(--brn-text);
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.brn-note-item-text {
    font-size: 13px;
    color: var(--brn-muted);
    line-height: 1.45;
    white-space: normal;
}

.brn-editor {
    padding: 18px;
    min-width: 0;
    overflow: hidden;
}

.brn-editor-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.brn-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.brn-title-input,
.brn-search,
.brn-content-input {
    width: 100%;
    border: 1px solid var(--brn-border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    display: block;
}

.brn-title-input:focus,
.brn-search:focus,
.brn-content-input:focus {
    border-color: var(--brn-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.brn-title-input {
    font-size: 20px;
    font-weight: 700;
}

.brn-content-input {
    min-height: var(--brn-editor-height);
    max-height: 80vh;
    resize: vertical;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow-x: hidden;
}

.brn-editor-footer {
    margin-top: 10px;
    color: var(--brn-muted);
}

.brn-status {
    font-size: 12px;
    color: var(--brn-muted);
}

.brn-status[data-state="saving"] {
    color: #9a6700;
}

.brn-status[data-state="saved"] {
    color: #0f766e;
}

.brn-status[data-state="error"] {
    color: var(--brn-danger);
}

.brn-btn {
    border: 0;
    border-radius: 12px;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
}

.brn-btn-primary {
    background: var(--brn-primary);
    color: #fff;
}

.brn-btn-danger {
    background: #fee2e2;
    color: #991b1b;
}

.brn-loading,
.brn-empty {
    padding: 18px;
    text-align: center;
    color: var(--brn-muted);
    background: var(--brn-soft);
    border-radius: 12px;
}

.brn-guest-box {
    display: flex;
    justify-content: center;
    padding: 20px 0;
    width: 100%;
    max-width: 100%;
}

.brn-guest-card {
    max-width: 520px;
    width: 100%;
    padding: 28px;
    text-align: center;
}

.brn-guest-card h3 {
    margin: 0 0 10px;
    font-size: 24px;
}

.brn-guest-card p {
    margin: 0 0 18px;
    color: var(--brn-muted);
    line-height: 1.6;
}

@media (max-width: 900px) {
    .brn-wrap {
        grid-template-columns: 1fr;
    }

    .brn-note-list {
        max-height: 260px;
    }

    .brn-editor-top {
        flex-direction: column;
    }

    .brn-actions,
    .brn-btn,
    .brn-sidebar-top .brn-btn {
        width: 100%;
    }

    .brn-sidebar,
    .brn-editor {
        padding: 14px;
    }

    .brn-title-input {
        font-size: 18px;
    }

    .brn-content-input {
        min-height: min(55vh, var(--brn-editor-height));
        max-height: 65vh;
    }
}
