:root {
    --bg: #ffffff;
    --surface: #f5f2ff;
    --text: #191622;
    --muted: #5f5a72;
    --primary: #6d28d9;
    --primary-hover: #5b21b6;
    --primary-soft: #ede9fe;
    --secondary: #15803d;
    --secondary-soft: #dcfce7;
    --danger: #dc2626;
    --border: #ddd6fe;
    --shadow: 0 10px 22px rgba(47, 13, 119, 0.11);
}

body.dark {
    --bg: #000000;
    --surface: #121016;
    --text: #f5f3ff;
    --muted: #c4bdd9;
    --primary: #a78bfa;
    --primary-hover: #c4b5fd;
    --primary-soft: #2b2146;
    --secondary: #4ade80;
    --secondary-soft: #11341f;
    --danger: #fb7185;
    --border: #3a2f57;
    --shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", sans-serif;
    background: var(--bg);
    color: var(--text);
}

.app {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.4rem 3rem;
}

h1,
h2,
h3,
p {
    margin: 0 auto;
    color: var(--text)
}


.app__header,
.composer__row,
.entry-head,
.dialog-actions,
.entry-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.app__header {
    margin-bottom: 1.5rem;
}

.app__header h1 {
    color: var(--primary);
}

.app__header p {
    color: var(--muted);
    margin-top: 0.35rem;
}

.icon-btn,
.btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.icon-btn {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
}

.btn {
    min-height: 48px;
    padding: 0.75rem 1.1rem;
    font-weight: 600;
}

.icon-btn--primary,
.btn--primary {
    background: var(--primary);
    color: #fff;
    border-color: transparent;
}

.icon-btn:hover,
.btn:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
}

.icon-btn--primary:hover,
.btn--primary:hover {
    background: var(--primary-hover);
}

.icon-btn:focus-visible,
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--secondary) 42%, transparent);
    outline-offset: 2px;
}

.composer,
.stats,
.entry-item,
.entry-dialog form {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.composer,
.stats {
    padding: 1rem;
    margin-bottom: 3rem;
    margin-top: 3rem;
}

.stats {
    background: color-mix(in srgb, var(--surface) 70%, var(--secondary-soft));
}

.composer label,
.entry-dialog label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text)
}

.composer label {
    font-size: 1.5rem;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.75rem;
    font: inherit;
    color: var(--text);
    background: var(--bg);
}

.stats p {
    margin-top: 0.5rem;
    color: var(--muted);
    line-height: 1.5;
    white-space: pre-line;
}

.empty-state {
    margin-top: 0.8rem;
    color: var(--muted);
}

.entry-list {
    list-style: none;
    padding: 0;
    margin: 0.8rem 0 0;
    display: grid;
    gap: 0.8rem;
}

.entry-item {
    padding: 1rem;
}

.entry-line {
    margin-bottom: 0.5rem;
}

.entry-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.entry-score {
    color: var(--secondary);
    font-weight: 700;
}

.entry-item p {
    color: var(--muted);
    line-height: 1.5;
    margin-top: 0.4rem;
}

.entry-item .optional-note {
    margin-top: 0.75rem;
    border-top: 1px dashed var(--border);
    padding-top: 0.6rem;
}

.delete-btn {
    color: var(--muted);
}

.delete-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.entry-dialog {
    border: none;
    border-radius: 1rem;
    padding: 0;
    width: min(700px, 96vw);
    background: transparent;
}

.entry-dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.entry-dialog form {
    padding: 1rem;
}

.helper {
    margin-top: 0.5rem;
    margin-bottom: 36px;
    color: var(--muted);
}

.question-list {
    margin: 1rem 0;
    display: grid;
    gap: 0.6rem;
    max-height: 45vh;
    overflow: auto;
    padding-right: 0.2rem;
}


.note-field {
    display: grid;
    gap: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px dashed var(--border);
}

.question-item {
    display: grid;
    grid-template-columns: 1fr 80px;
    align-items: center;
    gap: 0.7rem;
}

.question-item label {
    color: var(--text);
}

.dialog-actions {
    margin-top: 0.8rem;
    padding: 0;
}
.entry-timestamp {
    font-size: 0.8rem;
    color: #555;
}