/* 행머스마 자료실 — 포트폴리오 (2026-09-18) */
.page-portfolio { max-width: 1240px; margin: 0 auto; }
#pf .pf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
#pf .pf-head h1 { font-size: 24px; font-weight: 900; letter-spacing: -.4px; color: #0f172a; margin: 0 0 4px; }
#pf .pf-head .sub { color: #64748b; font-size: 13.5px; }
#pf .pf-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-back { display: inline-flex; align-items: center; border: 0; background: none; color: #2f6bff; font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; padding: 0; margin-bottom: 6px; }
.pf-back:hover { text-decoration: underline; }

/* 목록 */
.pf-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pf-groups { display: flex; flex-wrap: wrap; gap: 6px; }
.gchip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border-strong); background: #fff; color: #334155; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: all .12s; }
.gchip span { color: #94a3b8; font-weight: 600; font-size: 12px; }
.gchip i { font-style: normal; font-size: 11px; }
.gchip:hover { border-color: #2f6bff; color: #2f6bff; background: #eef3ff; }
.gchip.on { background: #2f6bff; border-color: #2f6bff; color: #fff; }
.gchip.on span { color: rgba(255,255,255,.8); }
.gchip.un { border-style: dashed; }
.gchip.add { border-style: dashed; color: #2f6bff; border-color: rgba(47,107,255,.45); background: #fff; }
.pf-tools { display: flex; align-items: center; gap: 8px; }
.pf-sel { height: 34px; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; color: #334155; font: inherit; font-size: 13px; padding: 0 8px; }
.pf-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
@media (max-width: 600px) { .pf-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
.pcard { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: #fff; text-align: left; font: inherit; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; }
.pcard:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(47,107,255,.14); border-color: rgba(47,107,255,.4); }
.pcard .th { position: relative; display: block; aspect-ratio: 4 / 3; background: #eef1f6; }
.pcard .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard .th .nocover { display: flex; align-items: center; justify-content: center; height: 100%; color: #94a3b8; font-size: 12px; }
.pcard .th .cnt { position: absolute; right: 8px; bottom: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(15,23,42,.7); color: #fff; font-size: 11px; font-weight: 800; }
.pcard .th .shared { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 999px; background: #16a34a; color: #fff; font-size: 11px; font-weight: 800; }
.pcard .tx { padding: 10px 12px 12px; min-width: 0; }
.pcard .gtag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #e9efff; color: #1d4ed8; font-size: 11px; font-weight: 800; margin-bottom: 6px; }
.pcard .gtag.un { background: #f1f5f9; color: #64748b; }
.pcard b { display: block; font-size: 14.5px; font-weight: 800; color: #0f172a; letter-spacing: -.2px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pcard small { display: block; color: #94a3b8; font-size: 12px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-empty { grid-column: 1 / -1; padding: 46px 20px; text-align: center; border: 1px dashed var(--border-strong); border-radius: 18px; background: #fff; }
.pf-empty .ic { width: 58px; height: 58px; border-radius: 16px; background: #eef3ff; color: #2f6bff; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.pf-empty .ic svg { width: 28px; height: 28px; }
.pf-empty b { display: block; font-size: 17px; font-weight: 900; color: #0f172a; }
.pf-empty p { color: #64748b; font-size: 13.5px; margin: 6px 0 16px; }

/* 편집기 */
.pf-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
@media (max-width: 960px) { .pf-layout { grid-template-columns: 1fr; } .pf-aside { order: -1; } }
.pf-sec { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.pf-sec .ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pf-sec h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 900; color: #0f172a; }
.pf-sec h3 small { font-size: 12px; color: #94a3b8; font-weight: 600; }
.pf-sec .step { width: 22px; height: 22px; border-radius: 50%; background: #2f6bff; color: #fff; font-size: 12px; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; }
.pf-sec .acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sbtn { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 13px; border-radius: 9px; border: 1px solid var(--border-strong); background: #fff; color: #334155; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; transition: all .12s; }
.sbtn:hover { border-color: #2f6bff; color: #2f6bff; background: #eef3ff; }
.sbtn.ai { background: #f3f0ff; border-color: rgba(109,93,252,.4); color: #5b48e8; }
.sbtn:disabled { opacity: .5; cursor: default; }
.role-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; font-size: 12px; color: #64748b; }
.role-legend .lg { padding: 2px 9px; border-radius: 999px; color: #fff; font-weight: 800; font-size: 11px; }
.lg-cover { background: #e11d48; } .lg-before { background: #16a34a; } .lg-after { background: #d97706; }
.pf-drop { position: relative; min-height: 120px; border: 2px dashed rgba(47,107,255,.35); border-radius: 14px; padding: 10px; background: #f8faff; transition: border-color .15s, background .15s; }
.pf-drop.dragover { border-color: #2f6bff; border-style: solid; background: #e9efff; }
.pf-drop .drop-hint { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; color: #94a3b8; font-size: 13.5px; font-weight: 600; pointer-events: none; }
.pf-drop.empty { cursor: pointer; }
.pf-drop.empty .drop-hint { display: flex; }
.pf-chosen { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
@media (max-width: 600px) { .pf-chosen { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
.pf-chosen .ph { position: relative; border-radius: 12px; overflow: hidden; background: #fff; border: 2px solid #e5e9f2; cursor: grab; }
.pf-chosen .ph.dragging { opacity: .45; }
.pf-chosen .ph.over { outline: 3px solid #2f6bff; outline-offset: 2px; }
.pf-chosen .ph.r-cover { border-color: transparent; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(135deg, #ff2d55, #ff7a45) border-box; }
.pf-chosen .ph.r-before { border-color: transparent; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(135deg, #16a34a, #4ade80) border-box; }
.pf-chosen .ph.r-after { border-color: transparent; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(135deg, #d97706, #fbbf24) border-box; }
.pf-chosen .ph img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.pf-chosen .rtag { position: absolute; left: 6px; top: 6px; padding: 2px 8px; border-radius: 999px; color: #fff; font-size: 11px; font-weight: 800; background: #0f172a; }
.pf-chosen .r-cover .rtag { background: #e11d48; } .pf-chosen .r-before .rtag { background: #16a34a; } .pf-chosen .r-after .rtag { background: #d97706; }
.pf-chosen .idx { position: absolute; right: 30px; top: 6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(15,23,42,.6); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.pf-chosen .rm { position: absolute; right: 6px; top: 6px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(15,23,42,.6); color: #fff; font-size: 11px; cursor: pointer; }
.pf-chosen .rm:hover { background: #e11d48; }
.pf-chosen .roles { display: flex; gap: 3px; padding: 6px; }
.pf-chosen .rl { flex: 1; text-align: center; font-size: 10.5px; font-weight: 800; padding: 4px 0; border-radius: 6px; border: 1px solid #e5e9f2; color: #64748b; cursor: pointer; user-select: none; }
.pf-chosen .rl input { display: none; }
.pf-chosen .rl.on.rl-cover { background: #e11d48; border-color: #e11d48; color: #fff; }
.pf-chosen .rl.on.rl-before { background: #16a34a; border-color: #16a34a; color: #fff; }
.pf-chosen .rl.on.rl-after { background: #d97706; border-color: #d97706; color: #fff; }
.pf-chosen .rl:hover { border-color: #2f6bff; color: #2f6bff; }
.pf-compare { margin-top: 12px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: #fafbff; }
.pf-compare .cmp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.pf-compare .cmp-head span { font-size: 12px; color: #64748b; }
.cmp2 { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.cmp2 figure { margin: 0; text-align: center; }
.cmp2 img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.cmp2 figcaption { font-size: 12px; font-weight: 800; color: #334155; margin-top: 4px; }
.cmp2 .arrow { font-size: 24px; color: #2f6bff; font-weight: 900; }
.gifbox img { width: 100%; max-height: 380px; object-fit: contain; border-radius: 10px; background: #f4f6fb; }

.field-grid { display: grid; gap: 10px 12px; }
.field-grid.two { grid-template-columns: 1fr 1fr; }
.field-grid.three { grid-template-columns: 1.2fr 1fr 1fr; margin-top: 10px; }
@media (max-width: 640px) { .field-grid.two, .field-grid.three { grid-template-columns: 1fr; } }
#pf label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 800; color: #475569; }
#pf label .req { font-style: normal; color: #e11d48; font-size: 10.5px; margin-left: 4px; }
#pf label .ai-mark { font-style: normal; font-size: 10px; color: #5b48e8; background: #ede9fe; padding: 1px 6px; border-radius: 999px; margin-left: 4px; }
#pf label.ai input, #pf label.ai textarea { background: #f7f5ff; }
#pf input[type=text], #pf input[type=date], #pf input:not([type]), #pf textarea, #pf select { width: 100%; box-sizing: border-box; min-height: 40px; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 9px; background: #fff; color: #0f172a; font: inherit; font-size: 14px; font-weight: 500; outline: none; transition: border-color .12s, box-shadow .12s; }
#pf textarea { resize: vertical; line-height: 1.55; }
#pf input:focus, #pf textarea:focus, #pf select:focus { border-color: #2f6bff; box-shadow: 0 0 0 3px rgba(47,107,255,.14); }
#pf .grp-row { display: flex; gap: 6px; }
#pf .grp-row select { flex: 1; }
#pf .mini { width: 40px; min-height: 40px; border-radius: 9px; border: 1px solid var(--border-strong); background: #fff; color: #2f6bff; font: inherit; font-weight: 900; font-size: 16px; cursor: pointer; }
#pf .mini:hover { background: #eef3ff; border-color: #2f6bff; }
#pf details.more { margin-top: 12px; border: 1px dashed var(--border-strong); border-radius: 12px; padding: 0 12px; }
#pf details.more summary { cursor: pointer; padding: 10px 0; font-size: 13px; font-weight: 800; color: #2f6bff; list-style: none; }
#pf details.more summary small { color: #94a3b8; font-weight: 600; margin-left: 6px; }
#pf details.more[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 10px; }
#pf details.more .field-grid { padding-bottom: 12px; }
#pf .pf-sec > label + label { margin-top: 10px; }

.pf-aside { position: sticky; top: 14px; }
.save-panel { background: linear-gradient(160deg, #0f172a, #1e2a4a); color: #fff; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 14px 34px rgba(15,23,42,.25); }
.save-panel .eyebrow { font-size: 10.5px; letter-spacing: 2px; color: #8fb0ff; font-weight: 800; }
.save-panel h3 { margin: 0 0 6px; font-size: 16px; font-weight: 900; line-height: 1.35; letter-spacing: -.2px; }
.save-panel .dbtn.wide { width: 100%; justify-content: center; }
.save-panel .dbtn.ghost { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.25); }
.save-panel .dbtn.ghost:hover { background: rgba(255,255,255,.14); }
.save-panel .dbtn:disabled { opacity: .45; cursor: default; transform: none; }
.save-panel .share-link { display: block; font-size: 12px; color: #8fb0ff; word-break: break-all; text-decoration: none; background: rgba(255,255,255,.06); padding: 8px 10px; border-radius: 8px; }
.save-panel .link-copy { border: 0; background: none; color: #fff; font: inherit; font-size: 12px; font-weight: 800; text-decoration: underline; cursor: pointer; text-align: left; padding: 0; }
.save-panel .save-status { font-size: 12.5px; color: #cbd5e1; min-height: 18px; }
.save-panel .save-status.ok { color: #4ade80; } .save-panel .save-status.err { color: #fb7185; }
.save-panel .pf-del { border: 0; background: none; color: #fb7185; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; text-align: left; padding: 4px 0 0; }
.save-panel small { color: #94a3b8; font-size: 11.5px; line-height: 1.5; }

/* 모달 */
.pf-modal { max-width: 560px; text-align: left; }
.pf-modal.wide { max-width: 960px; width: 96vw; max-height: 90vh; display: flex; flex-direction: column; }
.pf-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.pf-modal-head .modal-title { margin: 0; text-align: left; }
.pf-modal-head .modal-msg { margin: 4px 0 0; text-align: left; }
.pf-modal .x { border: 0; background: none; font-size: 18px; color: #64748b; cursor: pointer; padding: 4px 6px; }
.pf-modal .modal-msg { text-align: left; }
.grp-new { display: flex; gap: 8px; margin-bottom: 12px; }
.grp-new input { flex: 1; min-height: 42px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px; font: inherit; font-size: 14px; outline: none; }
.grp-new input:focus { border-color: #2f6bff; box-shadow: 0 0 0 3px rgba(47,107,255,.14); }
.grp-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.grow { display: grid; grid-template-columns: 40px 1fr auto auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.grow .gcover { width: 40px; height: 40px; border-radius: 8px; background: #eef1f6; overflow: hidden; }
.grow .gcover img { width: 100%; height: 100%; object-fit: cover; }
.grow .gname { min-height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 700; background: transparent; }
.grow .gname:hover, .grow .gname:focus { border-color: var(--border-strong); background: #fff; outline: none; }
.grow .gcnt { font-size: 12px; color: #94a3b8; white-space: nowrap; }
.grow .gacts { display: flex; gap: 4px; }
.grow .mini { width: 30px; height: 30px; border: 1px solid var(--border-strong); background: #fff; border-radius: 7px; cursor: pointer; font: inherit; font-size: 12px; color: #334155; }
.grow .mini:hover { border-color: #2f6bff; color: #2f6bff; }
.grow .mini:disabled { opacity: .3; cursor: default; }
.grow .mini.on { background: #e9fbf1; border-color: #16a34a; }
.grow .mini.danger:hover { border-color: #e11d48; color: #e11d48; }
.grow .gshare { grid-column: 2 / -1; font-size: 11.5px; color: #16a34a; word-break: break-all; text-decoration: none; }
.picker-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 10px; }
.picker-bar .pk-count { font-size: 12.5px; color: #64748b; margin-left: auto; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; overflow: auto; flex: 1; min-height: 200px; max-height: 58vh; padding: 2px; }
.pk { position: relative; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #eef1f6; cursor: pointer; aspect-ratio: 1 / 1; }
.pk img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pk .chk { position: absolute; left: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.9); color: transparent; font-size: 13px; font-weight: 900; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(15,23,42,.25); }
.pk.on { border-color: #2f6bff; }
.pk.on .chk { background: #2f6bff; color: #fff; border-color: #2f6bff; }
.pk.in { opacity: .55; }
.pk .inpf { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(15,23,42,.65); color: #fff; font-size: 10.5px; font-weight: 800; text-align: center; padding: 3px; }
.pf-modal .modal-actions { margin-top: 10px; }
.modal-btn.ok { background: #2f6bff; color: #fff; }
.modal-btn.ok:hover { filter: brightness(1.06); }
/* hidden 속성이 클래스 display 에 밀리지 않도록 */
#pf [hidden], .pf-modal [hidden], .save-panel [hidden] { display: none !important; }
