:root {
  --bg: #fafaf7;
  --card: #ffffff;
  --ink: #1c1c1a;
  --muted: #6b6b66;
  --line: #e6e4dd;
  --accent: #0d4f9c;
  --danger: #b00020;
  --good: #1f6f3f;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { display: flex; align-items: center; gap: 1.5rem; padding: 0.8rem 1.5rem; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--ink); }
.topbar nav { display: flex; gap: 1.25rem; }
.topbar nav a { color: var(--ink); }
.logout-form { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }
.logout-form .user { color: var(--muted); font-size: 0.9rem; }
button.link, a.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-size: 1rem; }
main { max-width: 1024px; margin: 0 auto; padding: 1.5rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; font-size: 1.6rem; }
.count { color: var(--muted); font-weight: 400; font-size: 1rem; margin-left: 0.4rem; }
.subline { color: var(--muted); margin: 0.2rem 0 0; }
.subtitle { color: var(--muted); font-style: italic; margin: 0.2rem 0 0; }
section { margin-bottom: 2rem; }
section h2 { font-size: 1.15rem; }
button, .btn, .btn-small { background: var(--ink); color: #fff; border: 0; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.95rem; }
.btn-small { padding: 0.25rem 0.7rem; font-size: 0.85rem; }
button:hover, .btn:hover, .btn-small:hover { opacity: 0.9; text-decoration: none; color: #fff; }
.btn.danger { background: var(--danger); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem; margin: 1rem 0; }
.card.narrow { max-width: 32rem; }
.card h1 { margin-top: 0; }
form label { display: block; margin: 0.7rem 0; font-size: 0.92rem; color: var(--muted); }
form label small { color: var(--muted); font-weight: 400; }
form input, form textarea { display: block; width: 100%; padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; color: var(--ink); margin-top: 0.25rem; background: #fff; }
form textarea { resize: vertical; font-family: inherit; }
form .row { display: flex; gap: 1rem; }
form .row label { flex: 1; }
.error { background: #fdecea; color: var(--danger); padding: 0.6rem 0.8rem; border-radius: 6px; }
.success { background: #e8f3ec; color: var(--good); padding: 0.6rem 0.8rem; border-radius: 6px; }
.hint { color: var(--muted); font-size: 0.92rem; }
table.roles { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
table.roles th, table.roles td { padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.roles th { background: #f4f2eb; font-weight: 600; font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
table.roles tr:last-child td { border-bottom: 0; }
.row-actions a { margin-right: 0.6rem; }
.empty { color: var(--muted); padding: 2rem 0; text-align: center; }

/* bullet rows */
.bullet-row { display: flex; gap: 0.5rem; align-items: stretch; margin-bottom: 0.5rem; }
.bullet-edit { flex: 1; display: flex; gap: 0.5rem; align-items: stretch; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.7rem; }
.bullet-edit textarea { flex: 1; border: 0; padding: 0.25rem 0; margin: 0; background: transparent; }
.bullet-edit textarea:focus { outline: 1px solid var(--accent); border-radius: 4px; }
.bullet-actions { display: flex; align-items: center; }
.bullet-actions button { font-size: 0.85rem; padding: 0.35rem 0.7rem; }
.bullet-delete { display: flex; align-items: center; }
.bullet-delete button { font-size: 0.85rem; padding: 0.35rem 0.7rem; }

/* application edit */
.role-block { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.1rem 1.3rem; margin-bottom: 1rem; }
.role-block-head { border-bottom: 1px solid var(--line); padding-bottom: 0.6rem; margin-bottom: 0.8rem; position: relative; }
.role-block-head h3 { margin: 0; font-size: 1.05rem; }
.role-block-head .count-inline { position: absolute; right: 0; top: 0; color: var(--muted); font-size: 0.85rem; margin: 0; }
.bullet-pick { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0.5rem 0; cursor: pointer; padding: 0.3rem; border-radius: 6px; }
.bullet-pick:hover { background: #f4f2eb; }
.bullet-pick input { margin-top: 0.3rem; flex-shrink: 0; }
.bullet-pick input:checked + span { color: var(--ink); }
.bullet-pick input:not(:checked) + span { color: #a09e96; text-decoration: line-through; text-decoration-color: #d8d4c5; }
.add-bullet { margin-top: 0.8rem; }
.add-bullet summary { cursor: pointer; color: var(--accent); font-size: 0.9rem; padding: 0.3rem 0; }
.add-bullet summary small { color: var(--muted); font-weight: 400; }
.add-bullet-form { display: flex; gap: 0.5rem; align-items: stretch; margin-top: 0.5rem; }
.add-bullet-form textarea { flex: 1; margin: 0; }
.sticky-save { position: sticky; bottom: 0.5rem; display: flex; justify-content: flex-end; padding: 0.6rem; background: rgba(250, 250, 247, 0.95); backdrop-filter: blur(4px); border-radius: 8px; }

/* resume preview */
.resume-preview { background: #fff; border: 1px solid var(--line); padding: 2.5rem 3rem; margin-top: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.resume-header { text-align: center; border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 1.25rem; }
.resume-header h1 { margin: 0 0 0.25rem; font-size: 1.6rem; color: #1f2a44; }
.resume-header p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.resume-section { margin-bottom: 1.5rem; }
.resume-section h2 { font-size: 1.05rem; color: #1f2a44; border-bottom: 1px solid #d8d4c5; padding-bottom: 0.2rem; margin: 1.2rem 0 0.6rem; }
.resume-role { margin-bottom: 0.9rem; }
.resume-role h3 { font-size: 1rem; margin: 0; }
.resume-meta { color: var(--muted); font-style: italic; font-size: 0.9rem; margin: 0.1rem 0; }
.resume-subtitle { color: var(--muted); font-style: italic; font-size: 0.88rem; margin: 0.1rem 0; }
.resume-role ul { margin: 0.4rem 0 0 1.2rem; padding: 0; }
.resume-role li { margin-bottom: 0.25rem; font-size: 0.95rem; }
.resume-summary { font-size: 0.95rem; margin: 0.4rem 0 0; line-height: 1.45; }
.export-actions { display: flex; gap: 0.6rem; align-items: center; }
.sync-banner { display: flex; gap: 0.8rem; align-items: center; background: #fff7e0; border: 1px solid #f0d896; padding: 0.6rem 0.9rem; border-radius: 8px; margin: 0.5rem 0 1rem; }
.sync-banner button { background: #b8780b; }
