/* 공유판 화면. 디자인은 GPT 1 「정밀정렬」 시안(흰 바탕, 파란 강조, 가는 선)을 반응형으로 옮긴 것. 760px 아래는 휴대폰 배치. */
:root {
  --ink: #202C3A; --muted: #586574; --line: #DFE4EB; --soft: #F6F8FB; --accent: #2454AF; --tint: #EDF3FD;
  --warn: #88501B; --no: #B78049; --pending: #CCD3DD; --radius: 8px; --wrap: 1216px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #FFF; color: var(--ink); font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; font-size: 14px; line-height: 1.5; font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, .number, .brand { font-family: 'Paperlogy', 'Pretendard Variable', sans-serif; font-weight: 700; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 700; }
.t-accent { color: var(--accent); } .t-warn { color: var(--warn); } .t-muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.narrow { max-width: 520px; padding-top: 72px; padding-bottom: 72px; }
.narrow-wide { max-width: 860px; }
.mobile-only { display: none; }

/* 위쪽 */
.topbar-in { height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand-wrap { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 18px; letter-spacing: -.6px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; background: var(--accent); color: #FFF; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.grade { font-size: 12px; color: var(--muted); border-left: 1px solid var(--line); padding-left: 16px; white-space: nowrap; }
.admin-tag { font-family: 'Pretendard Variable', sans-serif; font-size: 11px; font-weight: 700; color: #FFF; background: var(--ink); border-radius: 4px; padding: 2px 6px; margin-left: 2px; letter-spacing: 0; }
.top-actions { display: flex; gap: 8px; }

.tabs { border-bottom: 1px solid var(--line); }
.tabs-in { min-height: 44px; display: flex; align-items: stretch; gap: 22px; }
.tabs-in > a, .more > summary { font-size: 13px; display: flex; align-items: center; gap: 5px; white-space: nowrap; min-height: 32px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs-in > a:hover { color: var(--ink); text-decoration: none; }
.tabs-in > .active { color: var(--accent); font-weight: 700; border-bottom-color: var(--accent); }
.tabs-in > .all { margin-left: auto; color: var(--ink); font-weight: 600; }
.tabs .count { font-size: 11px; color: var(--muted); font-weight: 500; background: var(--soft); border-radius: 9px; padding: 1px 6px; }
.tabs .active .count { background: var(--tint); color: var(--accent); }
.more { position: relative; display: flex; }
.more > summary { list-style: none; cursor: pointer; }
.more > summary::-webkit-details-marker { display: none; }
.more-list { position: absolute; top: 100%; left: 0; z-index: 5; min-width: 220px; background: #FFF; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(32,44,58,.10); padding: 6px; }
.more-list a { display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border-radius: 6px; font-size: 13px; }
.more-list a:hover { background: var(--soft); text-decoration: none; }

/* 단추, 알약 */
.btn { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #FFF; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; font-weight: 600; font-size: 12px; cursor: pointer; }
.btn:hover { background: var(--soft); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #FFF; }
.btn.primary:hover { background: #1D468F; }
.btn.danger { color: #9B2C2C; border-color: #E8C7C7; }
.btn.wide { width: 100%; min-height: 38px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.textlink { border: 0; background: transparent; padding: 0; min-height: 32px; font-size: 12px; font-weight: 600; color: var(--accent); cursor: pointer; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 5px; background: var(--tint); color: var(--accent); padding: 3px 7px; white-space: nowrap; font-size: 11px; font-weight: 600; font-family: 'Pretendard Variable', sans-serif; letter-spacing: 0; }
.pill.small { font-size: 10px; padding: 1px 5px; }
.pill.protection { min-height: 32px; padding: 0 10px; }
.pill.t-warn { background: #FCF2E8; color: var(--warn); }
.pill.t-muted, .muted-pill { background: #F1F3F6; color: #46525F; }
.st { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 8px; border-radius: 5px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.st.share { background: var(--tint); color: var(--accent); }
.st.mine { background: #F1F3F6; color: #46525F; }
.st.rec { background: #FCF2E8; color: var(--warn); }
.st.draft { border: 1px dashed #AEB7C2; color: #46525F; }

/* 본문 */
.main { padding-top: 22px; padding-bottom: 56px; }
.heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
h1 { font-size: 26px; line-height: 1.35; letter-spacing: -.8px; }
.subtitle { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.heading-actions { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.focus-note { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--tint); color: #1D3F7E; font-size: 13px; }
.focus-note a { font-weight: 700; color: var(--accent); white-space: nowrap; }
.focus-note.muted-note { background: #F1F3F6; color: #46525F; }
.focus-note.warn-note { background: #FCF2E8; color: var(--warn); }
.flash { margin-top: 14px; padding: 10px 14px; border-radius: var(--radius); background: #EAF6EF; color: #1E5B3A; font-size: 13px; }
.form-error { margin-top: 14px; padding: 10px 14px; border-radius: var(--radius); background: #FCECEC; color: #8A2323; font-size: 13px; }
.block { margin-top: 16px; }
.block h2 { font-size: 15px; }
.block h3 { font-family: 'Pretendard Variable', sans-serif; font-weight: 600; font-size: 12px; margin-bottom: 8px; }
.mine-mark { display: inline-block; margin-left: 6px; font-family: 'Pretendard Variable', sans-serif; font-size: 10px; font-weight: 700; color: var(--warn); background: #FCF2E8; border-radius: 4px; padding: 1px 5px; vertical-align: middle; letter-spacing: 0; }
.is-mine { outline: 1px dashed #E4D2BC; outline-offset: 6px; border-radius: 4px; }

/* 요약 숫자 */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; background: var(--line); min-height: 62px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 12px; padding: 10px 18px; background: #FFF; }
.stat.emphasis { background: var(--tint); }
.stat.emphasis .number { color: var(--accent); }
.stat-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.stat .number { font-size: 23px; letter-spacing: -.5px; white-space: nowrap; }
.stat .unit { font-family: 'Pretendard Variable', sans-serif; font-size: 12px; margin-left: 3px; font-weight: 500; }
.stat small { color: var(--muted); white-space: nowrap; font-size: 12px; }

/* 표 */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; margin-bottom: 6px; flex-wrap: wrap; }
.toolbar .hint { font-size: 12px; }
.legend { display: flex; gap: 12px; font-size: 11px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.data-table { container-type: inline-size; }
.grid { display: grid; grid-template-columns: var(--cols); column-gap: 16px; align-items: center; padding: 0 14px; }
.thead { min-height: 30px; background: var(--soft); color: var(--muted); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 11px; border-radius: 5px 5px 0 0; }
.c { min-width: 0; display: flex; align-items: center; gap: 6px; }
.c.a-right { justify-content: flex-end; text-align: right; }
.ell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow > .grid, .trow > summary { min-height: 40px; border-bottom: 1px solid var(--line); font-size: 13px; }
.trow > summary { list-style: none; cursor: pointer; }
.trow > summary::-webkit-details-marker { display: none; }
.trow > summary:hover { background: var(--soft); }
.trow[open] > summary { background: var(--tint); font-weight: 600; }
.chevron { color: var(--muted); transition: transform .15s; }
.trow[open] > summary .chevron { transform: rotate(180deg); color: var(--accent); }
.numcell { font-family: 'Paperlogy', 'Pretendard Variable', sans-serif; font-weight: 600; justify-content: flex-end; }
.bar { display: flex; height: 6px; gap: 2px; overflow: hidden; border-radius: 3px; width: 100%; }
.bar span { height: 100%; }
.b0 { background: var(--accent); } .b1 { background: var(--no); } .b2 { background: var(--pending); } .b3 { background: #7A8AA0; }
.detail { padding: 12px 16px 14px; background: var(--soft); border-bottom: 1px solid var(--line); }
.detail-blocks { display: flex; flex-wrap: wrap; gap: 14px 36px; }
.detail-blocks > .block { margin-top: 0; min-width: 0; }
.mfacts { display: none; }
.facts-only > summary { pointer-events: none; }
.facts-only > summary .chevron { visibility: hidden; }
.facts-only > .detail { display: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 5px; background: #FFF; padding: 6px 9px; font-size: 12px; }
.chip .sid, .chip small { color: var(--muted); }
.chip b { font-weight: 600; }
.chip.t-warn { border-color: #EBD3BD; }
.pairs { margin: 0; display: grid; gap: 2px; font-size: 12px; line-height: 1.7; }
.pairs div { display: flex; gap: 10px; }
.pairs dt { font-weight: 600; min-width: 64px; }
.pairs dd { margin: 0; color: var(--muted); }
.textblock p { margin-top: 6px; font-size: 13px; line-height: 1.7; }
.link-row { display: flex; gap: 8px; flex-wrap: wrap; }
.footnote { font-size: 11px; color: var(--muted); }
.page-foot { margin-top: 18px; font-size: 11px; color: var(--muted); }
.empty { padding: 28px 14px; color: var(--muted); font-size: 13px; }
.group { min-height: 30px; display: flex; align-items: center; padding: 0 14px; font-size: 11px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); }
.list-row { min-height: 40px; border-bottom: 1px solid var(--line); font-size: 13px; }
.list-row:hover { background: var(--soft); text-decoration: none; }

/* 코드 입력 */
.lock-card { border: 1px solid var(--line); border-radius: 12px; padding: 28px; text-align: left; }
.lock-card h1 { font-size: 22px; margin-top: 10px; }
.lock-card p { margin-top: 8px; font-size: 13px; line-height: 1.7; }
.lock-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--tint); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.code-form { margin-top: 18px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.code-form label { grid-column: 1 / -1; font-size: 12px; font-weight: 600; }
.code-form input { min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 12px; font-size: 18px; letter-spacing: 4px; }
.code-form .btn { min-height: 44px; padding: 0 20px; font-size: 14px; }

/* 휴대폰 게시물 고르기 */
.post-menu { margin-top: 2px; position: relative; }
.post-menu > summary { list-style: none; width: 100%; justify-content: space-between; min-height: 44px; background: var(--soft); font-size: 13px; }
.post-menu > summary::-webkit-details-marker { display: none; }
.post-menu > summary span { display: flex; gap: 9px; align-items: center; }
.post-menu > summary small { font-weight: 400; color: var(--muted); }
.post-menu-list { margin-top: 6px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.post-menu-list a { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.post-menu-list a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-menu-list a small { color: var(--muted); font-size: 11px; }
.post-menu-list a[aria-current] { background: var(--tint); color: var(--accent); font-weight: 700; }
.post-menu-list .all { justify-content: center; color: var(--accent); font-weight: 600; border-bottom: 0; }

/* 관리자 */
.crumb { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
.crumb-in { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.crumb-in b { color: var(--ink); font-weight: 600; }
.crumb-actions { display: flex; gap: 8px; }
.split { display: flex; gap: 0; align-items: flex-start; }
.split .left { flex: 1; min-width: 0; padding: 20px 28px 56px 0; }
.panel { width: 356px; flex: none; border-left: 1px solid var(--line); padding: 18px 0 40px 22px; display: flex; flex-direction: column; gap: 16px; }
.panel-form { display: flex; flex-direction: column; gap: 16px; }
.panel-sec { border: 0; margin: 0; padding: 0; }
.panel-sec + .panel-sec { padding-top: 14px; border-top: 1px solid var(--line); }
.panel-sec.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.p-title { font-size: 12px; font-weight: 700; margin-bottom: 8px; display: block; padding: 0; }
.opt { display: flex; align-items: center; gap: 9px; min-height: 32px; font-size: 12px; }
.opt input[type=checkbox], .opt input[type=radio] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.opt small { color: var(--muted); margin-left: auto; }
.opt.is-disabled { color: var(--muted); }
.opt.sub-input { padding-left: 25px; }
.switch-opt span small { margin-left: 6px; }
.panel input[type=password], .panel input[type=date], .edit-form input, .edit-form select, .edit-form textarea { width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 13px; background: #FFF; }
.linkbox { display: flex; gap: 6px; }
.linkbox .field { flex: 1; min-width: 0; min-height: 34px; border: 1px solid var(--line); border-radius: 6px; background: #FFF; display: flex; align-items: center; padding: 0 10px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log { display: flex; gap: 10px; font-size: 11px; line-height: 1.8; }
.log span:first-child { color: var(--muted); width: 82px; flex: none; }
.mine-box { margin-top: 14px; border: 1px solid #E4D2BC; background: #FFFBF5; border-radius: var(--radius); padding: 12px 14px; }
.mine-box h2 { font-family: 'Pretendard Variable', sans-serif; font-size: 12px; font-weight: 700; color: var(--warn); display: flex; align-items: center; gap: 6px; letter-spacing: 0; }
.mine-box p { margin-top: 4px; font-size: 13px; line-height: 1.7; }
.edit-form { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.edit-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; }
.edit-form label.opt { flex-direction: row; font-weight: 500; }
.edit-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mono { font-family: Consolas, 'D2Coding', monospace; font-size: 12px !important; line-height: 1.5; }
.form-actions { display: flex; gap: 8px; }
.danger-zone { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }

@media (max-width: 760px) {
  .wrap { padding: 0 18px; }
  .mobile-only { display: block; padding-top: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .tabs { display: none; }
  .is-admin .tabs { display: block; overflow-x: auto; }
  .is-admin .tabs-in { gap: 16px; }
  .is-admin .tabs-in > .all { display: none; }
  .grade { display: none; }
  .hide-s { display: none; }
  .topbar-in { height: 60px; }
  .brand { font-size: 17px; }
  .main { padding-top: 18px; }
  h1 { font-size: 21px; letter-spacing: -.7px; line-height: 1.45; }
  .heading { flex-direction: column; gap: 10px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { flex-direction: column; align-items: flex-start; gap: 3px; padding: 9px 12px; }
  .stat .number { font-size: 19px; }
  .stat small { display: none; }
  .trow > summary, .trow > .grid { min-height: 46px; }
  .chip { font-size: 12px; padding: 7px 10px; }
  .btn { min-height: 44px; }
  .split { flex-direction: column; }
  .split .left { padding: 18px 0 20px; }
  .panel { width: 100%; border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 40px; }
  .edit-form .two, .panel-sec.two { grid-template-columns: 1fr; }
  .narrow { padding-top: 36px; }
}

/* 표가 좁은 자리에 놓이면(휴대폰, 관리자 화면의 왼쪽 칸 등) 주요 칸만 남기고 나머지는 펼침 안으로 */
@container (max-width: 680px) {
  .grid { grid-template-columns: var(--mcols); column-gap: 12px; padding: 0 12px; }
  .m-hide { display: none !important; }
  .mfacts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin: 0 0 10px; font-size: 12px; }
  .mfacts div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--line); padding-bottom: 4px; }
  .mfacts dt { color: var(--muted); }
  .mfacts dd { margin: 0; font-weight: 600; text-align: right; }
  .facts-only > summary { pointer-events: auto; }
  .facts-only > summary .chevron { visibility: visible; }
  .facts-only > .detail { display: block; }
  .detail-blocks { flex-direction: column; gap: 12px; }
}
