:root {
    --accent: #9a6b3f;
    --accent-soft: #f3e9da;
    --accent-border: #d9c4a3;
    --border: #e3d9cb;
    --muted: #8a7a66;
    --bg: #faf6ef;
    --surface: #fffdf9;
    --danger: #b3564a;
}

* { box-sizing: border-box; }

/* Warm-tint the Fluent neutral surfaces */
body, :root {
    --colorNeutralBackground1: #fffdf9;
    --colorNeutralBackground2: #f7f1e6;
    --colorNeutralCardBackground: #fffdf9;
    --colorNeutralStrokeAccessible: #d9c4a3;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #43382b;
    background: var(--bg);
    /* FluentUI's default-fuib.css locks the body to the viewport (overflow: hidden); undo it so long lists scroll */
    height: auto;
    overflow: auto;
}

.page { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--accent-border);
}

.brand { font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--accent); }
.auth-area { display: flex; align-items: center; gap: 0.75rem; }
.user { color: var(--muted); }

.content { flex: 1; width: 100%; max-width: 60rem; margin: 0 auto; padding: 1.5rem; }

h1 { margin-top: 0; }

.btn {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: var(--surface);
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-link { border: none; background: none; color: var(--accent); padding: 0.2rem 0.4rem; }
.inline-form { display: inline; }

.toolbar { margin-bottom: 1rem; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.filter-bar .search-box { flex: 1 1 16rem; max-width: 28rem; }
.filter-bar fluent-search::part(control) { width: 100%; }

.filter-bar input[type="search"] {
    flex: 1 1 14rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
}

.tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 1.2rem;
    align-items: center;
    margin-bottom: 1rem;
    width: 100%;
}

/* FluentCheckbox wraps each item in a fluent-field with vertical margins; keep the filter compact */
.tag-filter fluent-field {
    margin: 0;
    font-size: 0.875rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #f8f9fa;
    font-size: 0.875rem;
    cursor: pointer;
    user-select: none;
}

.chip input { margin: 0; }
.chip-selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-static { cursor: default; background: var(--accent-soft); border-color: var(--accent-border); color: #6b4f2e; }

.quotation-list { display: flex; flex-direction: column; gap: 0.75rem; }

.quotation {
    padding: 0.75rem 1rem;
}

.quotation .text { margin: 0 0 0.5rem; white-space: pre-line; }
.quotation-footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.muted { color: var(--muted); }

.form-field { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.form-field input[type="text"],
.form-field input[type="password"],
.form-field textarea {
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font: inherit;
    width: 100%;
    max-width: 40rem;
}

.field-label { font-weight: 600; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.new-tag-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.new-tag-row input { max-width: 16rem; }

.form-actions { display: flex; gap: 0.5rem; align-items: center; }

.login-form { max-width: 22rem; }

.danger-zone {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.error, .validation-errors { color: var(--danger); }
