/* City life: faces, citizen dossier card, town notes, life toast. Calm Nous styling, phone first. */
.cl-icon, .cl-face { flex: none; display: block; }

/* dossier card: paper-ish, light, compact */
.cl-card { position: relative; box-sizing: border-box; width: 100%; max-width: 420px; padding: 12px; border-radius: 14px;
    background: #fffdf8; border: 1px solid #ece4d3; box-shadow: 0 6px 22px rgba(54, 63, 81, .10); color: #363f51; font-weight: 300; animation: clIn .2s ease-out; }
.cl-x { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #9aa3b5; cursor: pointer; }
.cl-x:hover { background: #f3eee3; color: #363f51; }
.cl-card__top { display: flex; gap: 12px; align-items: flex-start; }
.cl-portrait { flex: none; width: 72px; height: 80px; box-sizing: border-box; display: grid; place-items: end center; overflow: hidden;
    border: 2px solid #d9cfbb; border-radius: 6px; background: linear-gradient(#e9f0f6, #e9f0f6 70%, #dfe7ee 70%); }
.cl-portrait .cl-face { margin-bottom: -4px; }
.cl-card__id { flex: 1; min-width: 0; padding-right: 24px; }
.cl-name { display: flex; align-items: center; gap: 4px; font-size: 17px; line-height: 1.2; }
.cl-name b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-edit { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #9aa3b5; cursor: pointer; }
.cl-edit:hover { background: #f3eee3; color: #363f51; }
.cl-bio { margin-top: 2px; font-size: 12px; font-style: italic; color: #7a8399; line-height: 1.35; }
.cl-rename input { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; font-weight: 500; color: #363f51; padding: 3px 8px; border: 1px solid #d9cfbb; border-radius: 6px; outline: none; background: #fff; }
.cl-rename input:focus { border-color: #4cbf86; box-shadow: 0 0 0 3px rgba(76, 191, 134, .15); }
.cl-traits { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.cl-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 5px; border-radius: 999px; font-size: 11px; color: #4a5568; background: #f3eee3; }

.cl-job { display: block; width: 100%; margin-top: 10px; padding: 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.cl-job:disabled { cursor: default; }
.cl-job__line { display: block; font-size: 13px; color: #4a5568; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-job__line b { font-weight: 500; color: #363f51; }
.cl-xp { display: block; height: 3px; margin-top: 5px; border-radius: 2px; background: #ece4d3; overflow: hidden; }
.cl-xp span { display: block; height: 100%; background: #f2b33d; transform-origin: left; transition: transform .8s ease; }

.cl-bars { display: grid; gap: 4px; margin-top: 10px; }
.cl-barrow { display: grid; grid-template-columns: 52px 1fr 40px; align-items: center; gap: 8px; font-size: 11px; color: #7a8399; }
.cl-barrow__bar { height: 7px; border-radius: 2px; background: #efe9dc; overflow: hidden; }
.cl-barrow__bar span { display: block; height: 100%; border-radius: 2px; transition: width .6s ease; }
.cl-barrow__v { text-align: right; color: #4a5568; }

.cl-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed #e6dcc7; }
.cl-friend { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 3px; border: 0; border-radius: 999px; background: #eef4fb; font: inherit; font-size: 12px; color: #363f51; cursor: pointer; }
.cl-friend:disabled { cursor: default; }
.cl-friend small { display: block; font-size: 9px; color: #7a8399; line-height: 1; }
.cl-friend > span { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.cl-moodlet { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 5px; border-radius: 999px; font-size: 12px; }
.cl-moodlet.is-up { background: #eaf7ef; color: #23704a; }
.cl-moodlet.is-down { background: #fdeeee; color: #a54848; }
.cl-extra { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 7px; }
.cl-mini { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #7a8399; }
.cl-mini.is-done { color: #23704a; }

/* town notes */
.cl-notes { box-sizing: border-box; width: 100%; max-width: 420px; padding: 10px 12px; border-radius: 14px; background: #fffdf8; border: 1px solid #ece4d3; color: #363f51; font-weight: 300; }
.cl-notes__head { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: #6b5a33; margin-bottom: 4px; }
.cl-notes__day { margin-left: auto; font-size: 11px; font-weight: 300; color: #a8925f; }
.cl-notes ul { list-style: none; margin: 0; padding: 0; }
.cl-note { display: flex; align-items: center; gap: 7px; padding: 6px 0; font-size: 13px; line-height: 1.3; border-bottom: 1px dashed #efe4c8; }
.cl-note:last-child { border-bottom: 0; }
.cl-note__faces { flex: none; display: inline-flex; }
.cl-note__faces .cl-face + .cl-face { margin-left: -6px; }
.cl-note__text { min-width: 0; }

/* toast */
.cl-toast { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 60; box-sizing: border-box; width: calc(100% - 24px); max-width: 396px;
    display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 14px; background: rgba(255, 253, 248, .98); border: 1px solid #ece4d3;
    box-shadow: 0 8px 26px rgba(54, 63, 81, .16); color: #363f51; font-weight: 300; cursor: pointer;
    transform: translate(-50%, -140%); opacity: 0; transition: transform .32s cubic-bezier(.2, .9, .3, 1.2), opacity .25s; }
.cl-toast.is-in { transform: translate(-50%, 0); opacity: 1; }
.cl-toast__icon { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #f6f1e6; }
.cl-toast__body { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; }
.cl-toast__body b { font-weight: 500; font-size: 11px; letter-spacing: .04em; color: #8a7a55; }
.cl-toast__coins { flex: none; padding: 2px 9px; border-radius: 999px; font-size: 12px; color: #92400e; background: #fef3c7; }

@keyframes clIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .cl-card { animation: none; }
    .cl-toast { transition: opacity .2s; }
}

/* polish: calmer edges and night mode */
.cl-card { padding: 14px; border-radius: 16px; }
.cl-notes { padding: 12px 14px; border-radius: 16px; }
.cl-x { width: 36px; height: 36px; top: 4px; right: 4px; }
.cl-toast { border-radius: 16px; }
body.night-mode .cl-card, body.night-mode .cl-notes, body.night-mode .cl-toast { background: #1f2937; border-color: #374151; color: #e5e7eb; box-shadow: 0 6px 22px rgba(0, 0, 0, .35); }
body.night-mode .cl-portrait { border-color: #475569; background: linear-gradient(#334155, #334155 70%, #273244 70%); }
body.night-mode .cl-bio, body.night-mode .cl-barrow, body.night-mode .cl-mini, body.night-mode .cl-friend small, body.night-mode .cl-notes__day { color: #94a3b8; }
body.night-mode .cl-job__line, body.night-mode .cl-barrow__v, body.night-mode .cl-chip { color: #cbd5e1; }
body.night-mode .cl-job__line b, body.night-mode .cl-name, body.night-mode .cl-toast__body b { color: #e5e7eb; }
body.night-mode .cl-chip, body.night-mode .cl-toast__icon { background: #273244; }
body.night-mode .cl-xp, body.night-mode .cl-barrow__bar { background: #374151; }
body.night-mode .cl-foot { border-top-color: #374151; }
body.night-mode .cl-note { border-bottom-color: #374151; }
body.night-mode .cl-notes__head { color: #fcd34d; }
body.night-mode .cl-friend { background: #273244; color: #e5e7eb; }
body.night-mode .cl-moodlet.is-up { background: rgba(16, 185, 129, .15); color: #6ee7b7; }
body.night-mode .cl-moodlet.is-down { background: rgba(239, 68, 68, .15); color: #fca5a5; }
body.night-mode .cl-x:hover, body.night-mode .cl-edit:hover { background: #273244; color: #e5e7eb; }
body.night-mode .cl-rename input { background: #111827; border-color: #475569; color: #e5e7eb; }
body.night-mode .cl-toast__coins { background: #422006; color: #fde68a; }

/* the citizen profile (2026-10-23 r2): text 14px and up, 44px targets, a calm simple card when the mood layer is off */
.cl-card { max-width: 460px; }
.cl-x { width: 44px; height: 44px; top: 2px; right: 2px; color: #64748b; }
.cl-card__id { padding-right: 40px; }
.cl-name { font-size: 18px; gap: 2px; }
.cl-edit { width: 44px; height: 44px; margin: -10px 0; color: #64748b; }
.cl-bio { font-size: 14px; }
.cl-chip { font-size: 14px; padding: 4px 10px 4px 6px; }
.cl-job__line { font-size: 15px; white-space: normal; }
.cl-barrow, .cl-friend, .cl-moodlet, .cl-mini { font-size: 14px; }
.cl-friend small { font-size: 12px; }
.cl-rename input { min-height: 44px; font-size: 17px; }
.cl-card--simple .cl-portrait { border-color: #e2d8c4; }
.cl-card--simple .cl-job { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #f6f1e6; }
.cl-card--simple .cl-extra { margin-top: 10px; }
body.night-mode .cl-card--simple .cl-job { background: #273244; }

/* today's thought (city-wisdom.js): a quiet quote under the job, new every day */
.cl-thought { margin: 12px 0 2px; padding: 2px 4px 2px 14px; border-left: 3px solid #bfe0c9; }
.cl-thought__k { display: flex; align-items: center; gap: 5px; font-size: 14px; color: #6b8a74; letter-spacing: .02em; margin-bottom: 4px; }
.cl-thought__t { margin: 0; font-size: 15px; line-height: 1.45; color: #363f51; font-weight: 400; }
.cl-thought__by { margin-top: 4px; font-size: 14px; color: #8a93a6; font-weight: 300; }
.cl-thought__by::before { content: '\2014\00a0'; }
body.night-mode .cl-thought { border-left-color: #3f7a57; }
body.night-mode .cl-thought__k { color: #86c29b; }
body.night-mode .cl-thought__t { color: #e5e7eb; }
body.night-mode .cl-thought__by { color: #94a3b8; }
