*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --ink: #0f172a; --muted: #475569; --soft: #64748b; --label: #1e293b;
    --line: rgba(15,23,42,0.08); --blue: #2563eb; --violet: #7c3aed; --danger: #dc2626;
    --star: #f59e0b; --card: rgba(255,255,255,0.9);
    --grad: linear-gradient(135deg, #2563eb, #7c3aed);
    --grad-dark: linear-gradient(135deg, #111827 0%, #1e3a8a 55%, #4c1d95 100%);
    --topbar-h: 60px;
}
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Plus Jakarta Sans', sans-serif; color: var(--ink);
    min-height: 100vh; display: flex; overflow-x: hidden;
    background:
        radial-gradient(40% 35% at 15% 10%, rgba(37,99,235,0.12) 0%, transparent 70%),
        radial-gradient(40% 40% at 90% 90%, rgba(124,58,237,0.12) 0%, transparent 70%),
        #eef2f7;
    background-attachment: fixed;
}
.ico { width: 16px; height: 16px; flex-shrink: 0; }
@keyframes fbUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.main-content { flex: 1; min-width: 0; padding: 36px 40px 48px; }
.fb-wrap { max-width: 1120px; margin: 0 auto; }

.page-header { margin-bottom: 22px; animation: fbUp .5s ease both; }
.page-title { font-size: 30px; font-weight: 800; letter-spacing: -0.8px; }
.page-title span { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.page-sub { font-size: 14.5px; color: var(--muted); margin-top: 4px; }

.fb-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 22px; align-items: start; }
.fb-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 24px; }

.card {
    background: var(--card); border: 1px solid rgba(255,255,255,0.7); border-radius: 22px;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 16px 36px rgba(15,23,42,0.07);
    animation: fbUp .5s ease both;
}
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-ico {
    width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
    color: #fff; background: var(--grad); box-shadow: 0 8px 18px rgba(37,99,235,.28);
}
.card-ico .ico { width: 18px; height: 18px; }
.card-title { font-size: 17px; font-weight: 800; letter-spacing: -0.2px; }
.card-sub { font-size: 13px; color: var(--soft); margin-top: 1px; }

.fb-summary { padding: 22px; }
.fb-score { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.fb-avg { font-size: 46px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; }
.fb-count { font-size: 13px; color: var(--muted); margin-top: 6px; font-weight: 600; }
.stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.stars svg { width: 17px; height: 17px; fill: #e2e8f0; }
.stars svg.on { fill: var(--star); }
.stars.lg svg { width: 21px; height: 21px; }
.fb-bars { display: flex; flex-direction: column; gap: 7px; }
.fb-bar { display: grid; grid-template-columns: 28px 1fr 26px; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--label); }
.fb-bar-track { height: 8px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.fb-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.fb-bar-n { text-align: right; color: var(--soft); font-weight: 600; }

.fb-form { padding: 22px; animation-delay: .05s; }
.field-label { display: block; font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--label); margin-bottom: 8px; }

.star-pick { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-pick input { position: absolute; opacity: 0; pointer-events: none; }
.star-pick label { cursor: pointer; padding: 2px; border-radius: 8px; transition: transform .15s; }
.star-pick label svg { width: 34px; height: 34px; fill: #e2e8f0; transition: fill .15s; display: block; }
.star-pick label:hover { transform: scale(1.12); }
.star-pick input:checked ~ label svg,
.star-pick label:hover svg,
.star-pick label:hover ~ label svg { fill: var(--star); }
.star-pick input:focus-visible + label { outline: 2px solid var(--blue); outline-offset: 2px; }
.star-text { font-size: 13.5px; font-weight: 700; color: #b45309; margin: 4px 0 16px; min-height: 18px; }

textarea {
    width: 100%; padding: 12px 14px; border: 1.5px solid rgba(15,23,42,0.10); border-radius: 13px;
    background: #fff; font-family: inherit; font-size: 14.5px; color: var(--ink); line-height: 1.55;
    resize: vertical; min-height: 120px; box-shadow: 0 1px 2px rgba(15,23,42,0.04);
    transition: border-color .2s, box-shadow .2s;
}
textarea::placeholder { color: var(--soft); }
textarea:hover { border-color: rgba(37,99,235,0.35); }
textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37,99,235,0.14); }
.fb-hint { display: flex; justify-content: flex-end; font-size: 12px; color: var(--soft); margin-top: 6px; }

.btn-submit {
    width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 14px; padding: 13px 18px; border: none; border-radius: 13px; cursor: pointer;
    color: #fff; font-family: inherit; font-size: 14.5px; font-weight: 700; text-decoration: none;
    background: var(--grad-dark); box-shadow: 0 10px 24px rgba(30,58,138,0.28);
    transition: transform .2s, background .2s, box-shadow .2s;
}
.btn-submit:hover { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #7c3aed 100%); transform: translateY(-1px); }
.btn-submit .ico { width: 17px; height: 17px; }

.fb-note { padding: 22px; text-align: center; animation-delay: .05s; }
.fb-note .card-ico { margin: 0 auto 12px; width: 52px; height: 52px; border-radius: 16px; }
.fb-note .card-ico .ico { width: 24px; height: 24px; }
.fb-note p { font-size: 13.5px; color: var(--muted); line-height: 1.55; margin-top: 6px; }

.fb-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 2px 4px 14px; }
.fb-list-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; }
.fb-list-head span { font-size: 13px; color: var(--soft); font-weight: 600; }
.fb-list { display: flex; flex-direction: column; gap: 14px; }

.review { padding: 20px 22px; transition: transform .2s, box-shadow .2s; }
.review:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(15,23,42,0.05), 0 20px 40px rgba(15,23,42,0.10); }
.review.is-hidden { opacity: .6; border-style: dashed; border-color: #cbd5e1; }
.review.mine { box-shadow: 0 0 0 2px rgba(37,99,235,0.18), 0 16px 36px rgba(15,23,42,0.07); }

.rv-top { display: flex; align-items: center; gap: 12px; }
.rv-avatar {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
    display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px;
    background: var(--grad); box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(37,99,235,0.18);
}
.rv-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-who { flex: 1; min-width: 0; }
.rv-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.rv-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 12.5px; color: var(--soft); font-weight: 600; }
.tag { font-size: 10.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.tag-you { color: #1d4ed8; background: rgba(37,99,235,0.1); }
.hidden-badge { color: #fff; background: #334155; }

.feedback-message { margin: 12px 0 0; font-size: 14.5px; line-height: 1.65; color: var(--label); overflow-wrap: anywhere; }

.admin-reply-box {
    display: flex; gap: 12px; margin-top: 14px; padding: 14px 16px; border-radius: 16px;
    background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(124,58,237,0.06));
    border: 1px solid rgba(37,99,235,0.14);
}
.reply-logo {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: flex-end; justify-content: center;
    gap: 2px; padding-bottom: 8px; background: var(--grad);
}
.reply-logo i { width: 3px; border-radius: 2px; background: #fff; }
.reply-logo i:nth-child(1) { height: 8px; } .reply-logo i:nth-child(2) { height: 15px; }
.reply-logo i:nth-child(3) { height: 11px; } .reply-logo i:nth-child(4) { height: 17px; }
.reply-body { min-width: 0; font-size: 14px; line-height: 1.6; color: var(--label); overflow-wrap: anywhere; }
.reply-label { display: block; font-size: 12.5px; font-weight: 800; color: #1d4ed8; margin-bottom: 2px; }

.empty-state { padding: 46px 20px; text-align: center; }
.empty-state .card-ico { margin: 0 auto 12px; width: 56px; height: 56px; border-radius: 16px; }
.empty-state .card-ico .ico { width: 26px; height: 26px; }
.empty-state b { display: block; font-size: 16px; }
.empty-state p { font-size: 13.5px; color: var(--muted); margin-top: 4px; }

.admin-actions { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-actions form { display: inline-flex; }
.action-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 10px; cursor: pointer;
    font-family: inherit; font-size: 13px; font-weight: 700; border: 1px solid; transition: all .2s;
    color: #1d4ed8; border-color: rgba(37,99,235,0.2); background: rgba(37,99,235,0.06);
}
.action-btn:hover { color: #fff; background: var(--blue); border-color: var(--blue); }
.action-btn-hide { color: #b45309; border-color: rgba(180,83,9,0.25); background: rgba(245,158,11,0.08); }
.action-btn-hide:hover { color: #fff; background: #d97706; border-color: #d97706; }
.action-btn-delete { color: var(--danger); border-color: rgba(220,38,38,0.22); background: rgba(220,38,38,0.05); }
.action-btn-delete:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.reply-form { display: none; width: 100%; flex-basis: 100%; margin-top: 4px; }
.reply-form textarea { min-height: 90px; }
.reply-form .btn-submit { width: auto; margin-top: 8px; padding: 10px 18px; }

.toast {
    position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 9999;
    display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 14px;
    background: #065f46; color: #fff; font-size: 14px; font-weight: 700;
    box-shadow: 0 14px 32px rgba(0,0,0,0.18); animation: tIn .35s ease, tOut .4s ease 3.5s forwards;
}
@keyframes tIn { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes tOut { to { opacity: 0; transform: translate(-50%, -10px); visibility: hidden; } }

@media (max-width: 1100px) {
    .fb-grid { grid-template-columns: 1fr; }
    .fb-side { position: static; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 1024px) {
    .main-content { padding: calc(var(--topbar-h) + 20px) 24px 32px; }
    .toast { top: calc(var(--topbar-h) + 12px); }
}
@media (max-width: 720px) {
    .fb-side { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .main-content { padding: calc(var(--topbar-h) + 16px) 14px 28px; }
    .page-title { font-size: 25px; }
    .review { padding: 18px 16px; }
    textarea { font-size: 16px; }
    .admin-actions > .action-btn, .admin-actions > form { flex: 1 1 calc(33.333% - 6px); }
    .admin-actions > form .action-btn, .admin-actions > .action-btn { width: 100%; justify-content: center; padding: 10px; }
    .reply-form .btn-submit { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body.is-guest { flex-direction: column; }
body.is-guest > nav, body.is-guest > header { flex-shrink: 0; }
body.is-guest .main-content { width: 100%; padding: 36px 40px 48px; }
body.is-guest .fb-side { top: 90px; }
body.is-guest .toast { top: 22px; }
@media (max-width: 1024px) {
    body.is-guest .main-content { padding: 28px 24px 32px; }
}
@media (max-width: 600px) {
    body.is-guest .main-content { padding: 22px 14px 28px; }
}