:root {
    --ink: #1a1a1a;
    --mute: #6b6b6b;
    --line: #e4e1dc;
    --paper: #faf9f7;
    --warn: #b00020;
    --note: #fdf6e3;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}
header .brand { font-weight: 600; letter-spacing: -0.01em; }
header nav { display: flex; align-items: center; gap: 16px; }
header nav a { color: var(--mute); text-decoration: none; font-size: 14px; }
header nav a:hover { color: var(--ink); }

main { max-width: 1100px; margin: 0 auto; padding: 28px 22px; }
h1 { font-size: 24px; letter-spacing: -0.02em; }

.btn {
    display: inline-block;
    background: var(--ink);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;
    font: inherit;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }

.notice { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.error { color: var(--warn); margin-bottom: 14px; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--mute); font-weight: 500; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--mute); margin-bottom: 4px; }
.field small { font-weight: 400; }
.field input, .field select, .field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

/* --- board ------------------------------------------------------------ */

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }
.search {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

.switch { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.switch button {
    border: 0;
    background: #fff;
    color: var(--mute);
    padding: 9px 12px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
.switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.board { column-count: 4; column-gap: 14px; }
@media (max-width: 1000px) { .board { column-count: 3; } }
@media (max-width: 700px)  { .board { column-count: 2; } }
@media (max-width: 460px)  { .board { column-count: 1; } }

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    break-inside: avoid;
    margin-bottom: 14px;
    display: inline-block;
    width: 100%;
    text-decoration: none;
    color: inherit;
}
.card:hover { border-color: var(--mute); }
.card .pad { padding: 12px 14px; }
.card .ttl { font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.card .src { color: var(--mute); font-size: 12px; }
.card .quote { font-style: italic; line-height: 1.45; }
.card.note { background: var(--note); }
.card .tags { margin-top: 8px; display: flex; gap: 5px; flex-wrap: wrap; }
.card .tags span {
    background: #f1efeb;
    color: var(--mute);
    border-radius: 99px;
    padding: 2px 8px;
    font-size: 11px;
}
.card .noteflag { color: var(--mute); font-size: 12px; margin-top: 8px; }

/* List layout: the same cards, a different flow. */
.board.as-list { column-count: 1; }
.board.as-list .card { display: flex; align-items: center; gap: 12px; margin-bottom: 1px; border-radius: 0; }
.board.as-list .card .pad { padding: 9px 12px; flex: 1; }

/* The trailing pad holds tags and the note marker. Without this it also
   takes flex:1 and they drift into the middle of the row. */
.board.as-list .card .pad + .pad { flex: none; padding-top: 9px; text-align: right; }
.board.as-list .card .tags { margin-top: 0; justify-content: flex-end; }
.board.as-list .card .noteflag { margin-top: 4px; }

.empty { color: var(--mute); padding: 40px 0; }
