/* PDFKOR 피드백 게시판(/feedback). styles/tokens.css 필요. 카드 격자 + 오른쪽 패널. */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --danger: #b3402f;
  --danger-tint: #f6dfda;
}
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
html { scrollbar-gutter: stable; }
body.fb-panel-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
button:disabled { cursor: default; opacity: 0.5; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- 상단 ---------- */
.fb-nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); }
.fb-nav-inner { width: min(var(--container), calc(100% - 32px)); margin: 0 auto; height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.fb-logo { display: flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: 0.02em; font-size: 17px; }
.fb-logo img { width: 32px; height: 32px; margin-left: -3px; }
.fb-nav-links { display: flex; align-items: center; gap: 22px; font-size: 14px; min-width: 0; }
.fb-nav-links a { color: var(--ink-soft); }
.fb-nav-links a:hover, .fb-nav-links a[aria-current="page"] { color: var(--ink); }
.fb-account { color: var(--ink-faint); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 본문 ---------- */
.fb-wrap { width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 80px; }
.fb-hero { text-align: center; margin-bottom: 32px; }
.fb-hero h1 { font-size: 32px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.35; }
.fb-hero p { margin-top: 8px; color: var(--ink-soft); font-size: 15.5px; }

.fb-tools { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.fb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-pill { height: 32px; padding: 0 14px; border-radius: 999px; background: var(--pill); color: var(--ink-soft); font-size: 13.5px; transition: background 0.15s, color 0.15s; }
.fb-pill:hover { color: var(--ink); }
.fb-pill[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.fb-search { height: 36px; min-width: 200px; flex: 0 1 240px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 16px; background: var(--surface); font-size: 14px; outline: none; }
.fb-search::placeholder { color: var(--ink-faint); }
.fb-search:focus { border-color: var(--ink-faint); }

.fb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 999px; font-size: 14px; border: 1px solid transparent; transition: background 0.15s; }
.fb-btn.dark { background: var(--ink); color: var(--bg); }
.fb-btn.dark:hover:not(:disabled) { background: color-mix(in srgb, var(--ink), #fff 12%); }
.fb-btn.line { border-color: var(--line-strong); }
.fb-btn.line:hover:not(:disabled) { background: var(--pill); }
.fb-btn.danger { background: var(--danger); color: #fff; }
.fb-btn.fb-icon-only { width: 36px; padding: 0; }
.fb-icon { width: 15px; height: 15px; flex: none; }

.fb-admin-row { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; font-size: 13px; }
.fb-faint { color: var(--ink-faint); font-size: 12.5px; }
.fb-count { min-height: 22px; margin-bottom: 8px; text-align: right; font-size: 12.5px; color: var(--ink-faint); }

.fb-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; line-height: 1.6; background: var(--pill); color: var(--ink-soft); white-space: nowrap; }
.fb-chip.accent { background: var(--accent-tint); color: var(--accent-ink); }
.fb-chip.danger { background: var(--danger-tint); color: var(--danger); }
.fb-mine { font-size: 12px; color: var(--ink-faint); }

/* ---------- 카드 격자 ---------- */
.fb-grid { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fb-card { width: 100%; height: 100%; min-height: 176px; text-align: left; display: flex; flex-direction: column; gap: 8px; padding: 18px 18px 16px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.15s, transform 0.15s; }
.fb-card:hover { box-shadow: inset 0 0 0 1px var(--line-strong), 0 6px 18px color-mix(in srgb, var(--ink) 8%, transparent); }
.fb-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fb-card-title { font-size: 15.5px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fb-card-body { font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fb-card-meta { margin-top: auto; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-faint); min-width: 0; }
.fb-author { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
.fb-attach { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; }
.fb-more { display: flex; justify-content: center; margin-top: 22px; }

/* ---------- 상태 카드·로딩 ---------- */
.fb-state { display: block; }
.fb-state-card { margin: 24px auto 0; max-width: 520px; padding: 40px 28px; text-align: center; border-radius: 14px; border: 1px dashed var(--line-strong); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fb-state-card h2 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.fb-state-card p { color: var(--ink-soft); font-size: 14.5px; }
.fb-state-card .fb-btn { margin-top: 14px; display: inline-flex; line-height: 34px; }
.fb-skeleton { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fb-skel-card { height: 176px; border-radius: 14px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
@media (prefers-reduced-motion: no-preference) {
  .fb-skel-card { animation: fb-pulse 1.4s ease-in-out infinite; }
}
@keyframes fb-pulse { 50% { opacity: 0.55; } }

/* ---------- 가운데 창: 카드가 그 자리에서 커지며 열린다(js/feedback/main.js의 FLIP) ---------- */
.fb-scrim { position: fixed; inset: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.35s ease; }
.fb-scrim.on { opacity: 1; }
.fb-card.is-away { opacity: 0; pointer-events: none; }
.fb-panel { position: fixed; inset: 0; margin: auto; z-index: 40; width: min(720px, calc(100% - 32px)); height: fit-content; max-height: calc(100dvh - 48px); display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 30px 80px color-mix(in srgb, var(--ink) 18%, transparent); transform-origin: top left; }
.fb-panel > * { opacity: 0; transition: opacity 0.2s ease; }
.fb-panel.ready > * { opacity: 1; transition-delay: 0.12s; }
@media (prefers-reduced-motion: reduce) {
  .fb-scrim, .fb-panel > * { transition: none; }
}
.fb-panel-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.fb-panel-kicker { font-size: 13px; color: var(--ink-faint); letter-spacing: 0.04em; }
.fb-icon-btn { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-soft); }
.fb-icon-btn:hover { background: var(--pill); color: var(--ink); }
.fb-panel-body { flex: 0 1 auto; min-height: 0; overflow-y: auto; padding: 24px 28px 30px; }

.fb-detail-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fb-detail-title { margin: 12px 0; font-size: 22px; font-weight: 500; line-height: 1.45; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.fb-detail-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-soft); }
.fb-detail-actions { display: flex; gap: 2px; flex-wrap: wrap; }
.fb-link-btn { height: 28px; padding: 0 10px; border-radius: 8px; font-size: 13px; color: var(--ink-soft); }
.fb-link-btn:hover:not(:disabled) { background: var(--pill); color: var(--ink); }
.fb-link-btn.danger { color: var(--danger); }
.fb-link-btn.accent { color: var(--accent-ink); }
.fb-detail-text { margin: 20px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.85; color: var(--ink-soft); }
.fb-hidden-note { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--danger-tint); font-size: 13px; line-height: 1.7; }
.fb-hidden-note .danger { color: var(--danger); }
.fb-muted { color: var(--ink-soft); font-size: 13.5px; margin-top: 12px; }
.fb-error { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: var(--danger-tint); color: var(--danger); font-size: 13.5px; }

.fb-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.fb-thumb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px 10px 12px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; color: var(--ink-soft); min-width: 0; }
.fb-thumb .fb-icon { width: 24px; height: 24px; }
.fb-thumb small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--ink-faint); }

.fb-reply { margin-top: 28px; padding: 18px 20px; border-radius: 12px; background: var(--card); }
.fb-reply-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.fb-reply h3 { font-size: 14px; font-weight: 600; }
.fb-reply .fb-detail-text { margin: 10px 0; font-size: 14.5px; }

/* ---------- 입력 ---------- */
.fb-form { display: flex; flex-direction: column; gap: 22px; }
.fb-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fb-label { font-size: 12.5px; color: var(--ink-soft); }
.fb-form input[type="text"], .fb-form input:not([type]), .fb-form input#fbTitle, .fb-form input#fbAuthor, textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); padding: 0 14px; font-size: 14.5px; outline: none;
}
.fb-form input#fbTitle, .fb-form input#fbAuthor { height: 40px; }
textarea { padding: 10px 14px; line-height: 1.7; resize: vertical; min-height: 160px; }
.fb-reply textarea { min-height: 130px; margin-top: 10px; }
.fb-form input:focus, textarea:focus { border-color: var(--ink-faint); }
textarea::placeholder, .fb-form input::placeholder { color: var(--ink-faint); }
.fb-field-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; font-size: 12px; color: var(--ink-faint); }
.fb-field-foot.right { justify-content: flex-end; margin-top: 0; }
.fb-segment { display: inline-flex; align-self: flex-start; padding: 3px; border-radius: 999px; background: var(--pill); }
.fb-segment button { height: 28px; padding: 0 14px; border-radius: 999px; font-size: 13px; color: var(--ink-soft); }
.fb-segment button[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 12%, transparent); }
.fb-attach-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.fb-attach-list { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.fb-attach-item { position: relative; width: 112px; }
.fb-attach-preview { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; color: var(--ink-soft); }
.fb-attach-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.fb-attach-preview span { display: flex; height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.fb-attach-remove { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); box-shadow: 0 0 0 1px var(--line-strong); line-height: 1; font-size: 14px; }
.fb-attach-item p { margin-top: 4px; font-size: 11.5px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-write-foot { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.fb-author-field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 200px; max-width: 260px; }
.fb-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.fb-write-foot .fb-form-actions { margin-top: 0; }

/* ---------- 대화 상자 ---------- */
dialog.fb-dialog { margin: auto; border: 0; border-radius: 16px; padding: 24px; width: min(420px, calc(100% - 32px)); background: var(--bg); color: var(--ink); box-shadow: 0 18px 50px color-mix(in srgb, var(--ink) 25%, transparent); }
dialog.fb-dialog::backdrop, dialog.fb-lightbox::backdrop { background: rgba(20, 18, 12, 0.34); }
.fb-dialog h2 { font-size: 16px; font-weight: 500; }
.fb-dialog p { margin-top: 6px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.7; }
.fb-dialog textarea { margin-top: 6px; min-height: 110px; }
.fb-dialog .fb-label { display: block; margin-top: 16px; }
dialog.fb-lightbox { margin: auto; border: 0; border-radius: 16px; padding: 0; width: min(960px, calc(100% - 24px)); height: min(760px, calc(100dvh - 24px)); background: var(--bg); color: var(--ink); overflow: hidden; }
dialog.fb-lightbox[open] { display: flex; flex-direction: column; }
.fb-lightbox-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--line); }
.fb-lightbox-head p { font-size: 13.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-lightbox-stage { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; }
.fb-lightbox-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }

.fb-toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 13.5px; box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 25%, transparent); }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 860px) {
  .fb-grid, .fb-skeleton { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .fb-wrap { padding-top: 32px; }
  .fb-hero h1 { font-size: 25px; }
  .fb-grid, .fb-skeleton { grid-template-columns: 1fr; }
  .fb-card, .fb-skel-card { min-height: 0; }
  .fb-search { flex-basis: 100%; order: 3; }
  .fb-panel { width: calc(100% - 16px); max-height: calc(100dvh - 24px); }
  .fb-panel-body { padding: 20px 18px 24px; }
  .fb-nav-links { gap: 14px; }
  .fb-account { display: none; }
  .fb-write-foot { align-items: stretch; flex-direction: column; }
  .fb-author-field { max-width: none; }
}
