/* Facebook Comment Ranker: styles on top of /css/style.css */

.admin-bar { background: #e9f1ec; border-bottom: 1px solid #cfe0d6; font-family: var(--font-head); font-size: 14px; }
.admin-bar .container { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; padding-top: 9px; padding-bottom: 9px; }
.admin-bar span { color: var(--green-dark); font-weight: 600; }
.admin-bar a { text-decoration: none; color: var(--link-color); }
.admin-bar a:hover { text-decoration: underline; }

.tool-wrap { max-width: 980px; margin: 0 auto; padding: 36px 24px 20px; }
.tool-wrap.narrow { max-width: 640px; }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 20px;
}
.panel h2 { font-size: 22px; margin-bottom: 6px; }
.muted { color: var(--muted); font-size: 14px; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-family: var(--font-head); font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.input, select.input, textarea.input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d6cfbd;
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-size: 16px;
    color: var(--txt-color);
}
.input:focus { border-color: var(--link-color); outline: none; box-shadow: 0 0 0 3px rgba(30,88,65,.15); }
textarea.input { min-height: 200px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 15px; }
.alert-ok  { background: #e7f3e8; border: 1px solid #a9d6ae; }
.alert-err { background: #fdecea; border: 1px solid #f2b8b1; }

/* Post list */
.post-list { display: grid; gap: 16px; }
.post-item {
    display: flex; gap: 16px; align-items: center;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px; text-decoration: none; color: inherit;
    transition: transform .2s ease, box-shadow .2s ease;
}
.post-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.post-item .thumb {
    width: 76px; height: 76px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
    background: var(--green-dark); color: var(--gold); display: grid; place-items: center; font-size: 26px;
}
.post-item .title { font-family: var(--font-head); font-weight: 500; line-height: 1.4; }
.post-item .arrow { margin-left: auto; color: var(--link-color); }

/* Post summary on the ranking page */
.post-summary { display: flex; gap: 20px; align-items: flex-start; }
.post-summary img { width: 130px; height: 130px; object-fit: cover; border-radius: 12px; flex-shrink: 0; }
.post-summary h1 { font-size: 24px; margin-bottom: 4px; }
.post-summary .message { white-space: pre-wrap; margin: 12px 0 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; font-size: 14px; color: var(--muted); }
.stat b { display: block; font-family: var(--font-head); font-size: 26px; color: var(--heading-color); line-height: 1.2; }
.stat.gold b { color: #b38a2c; }

/* Repeated-name chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
    background: #fff6dc; border: 1px solid #ecd396; border-radius: 999px;
    padding: 5px 14px; font-size: 14px; text-decoration: none; color: inherit; font-family: var(--font-head);
}
.chip:hover { border-color: var(--gold); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters .input { width: auto; flex: 1; min-width: 160px; padding: 9px 12px; font-size: 15px; }
.filters label { font-size: 15px; display: flex; gap: 6px; align-items: center; }

/* Ranked list */
.ranked { padding: 0; overflow: hidden; }
.item { display: flex; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item.repeat { background: #fffaea; box-shadow: inset 4px 0 0 var(--gold); }
.item.reply { padding-left: 46px; }
.rank { min-width: 38px; font-family: var(--font-head); font-weight: 600; color: var(--muted); }
.item.repeat .rank { color: #b38a2c; }
.item .body { flex: 1; min-width: 0; }
.item .name { font-family: var(--font-head); font-weight: 600; }
.stars { color: var(--gold); margin-left: 6px; letter-spacing: 1px; white-space: nowrap; }
.stars b { color: #a07a22; font-size: 12px; margin-left: 4px; letter-spacing: 0; font-family: var(--font-head); }
.kind { font-family: var(--font-head); font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #e9f1ec; color: var(--link-color); margin-left: 6px; vertical-align: 2px; }
.kind.reply { background: #efece4; color: var(--muted); }
.item .text { white-space: pre-wrap; word-break: break-word; margin-top: 4px; }
.item .meta { margin-top: 4px; font-size: 13px; color: var(--muted); }

.pick { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; background: #fff; }
.pick img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }

@media (max-width: 700px) {
    .tool-wrap { padding: 24px 16px 10px; }
    .stats { grid-template-columns: 1fr 1fr; }
    .post-summary { flex-direction: column; }
    .post-summary img { width: 100%; height: 180px; }
    .item { padding: 14px; gap: 10px; }
    .item.reply { padding-left: 28px; }
    .filters .input, .filters .btn { width: 100%; }
}

/* ---------- Slim tool header (replaces the big title block) ---------- */
.tool-bar { background: var(--bg-color); border-bottom: 1px solid var(--line); padding: 22px 0; }
.tool-bar-inner { display: flex; align-items: center; gap: 16px; }
.tool-bar-icon {
    width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%;
    display: grid; place-items: center; background: var(--green-dark); color: var(--gold); font-size: 19px;
}
.tool-bar h1 { font-size: clamp(20px, 2.6vw, 26px); line-height: 1.25; margin: 0; }
.tool-bar p { font-size: 14px; color: var(--muted); margin: 3px 0 0; line-height: 1.5; }
.tool-bar .gold { color: var(--gold); }

/* Smaller "nothing yet" box */
.tool-wrap .empty-state { padding: 32px 20px; }
.tool-wrap .empty-state i { font-size: 26px; margin-bottom: 8px; }
.tool-wrap .empty-state p { margin-bottom: 0; }
.tool-wrap .empty-state .btn { margin-top: 14px; }

@media (max-width: 600px) {
    .tool-bar { padding: 16px 0; }
    .tool-bar-icon { width: 42px; height: 42px; font-size: 17px; }
}
