/* essay.chocolab.co.kr — 논술 자료 (공용 스타일은 /_shared/ui.css) */
:root { --site: var(--c-lavender); --site-ink: var(--c-lavender-ink); }

main { padding-top: 26px; padding-bottom: 40px; }
h1 { font-family: var(--f-title); font-weight: 400; font-size: clamp(28px, 4vw, 38px); line-height: 1.15; margin: 0; }
.sub { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }

/* ---------- 들어오기 전 화면 ---------- */
.gate-card { max-width: 520px; margin: 40px auto; padding: 34px 30px 30px; text-align: center; }
.gate-card .pic { width: 120px; height: 120px; margin: 0 auto 14px; border-radius: 50%; background: radial-gradient(circle at 50% 42%, #fff 0 55%, var(--cream-2) 56%); display: grid; place-items: center; box-shadow: 0 0 0 2px dashed var(--line); }
.gate-card .pic img { width: 86%; height: 86%; object-fit: contain; }
.gate-card h1 { font-size: 30px; margin-bottom: 8px; }
.gate-card p { color: var(--ink-2); margin: 0 0 20px; }
.gate-card .actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.gate-card form { text-align: left; margin-top: 6px; }
.gate-card .state { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; padding: 5px 12px; border-radius: 999px; margin-bottom: 12px; }
.state.wait { background: var(--warn-bg); color: var(--warn); }
.state.stop { background: var(--err-bg); color: var(--err); }

/* ---------- 머리줄 ---------- */
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.views { display: flex; gap: 6px; flex-wrap: wrap; }
.views .count:empty { display: none; }
.views .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--c-orange-ink); color: #fff; font-size: 11px; }

/* ---------- 찾기 + 담기 ---------- */
.browse { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.filters { padding: 16px; display: grid; gap: 10px; position: sticky; top: 76px; z-index: 5; }
.search { font-size: 15px; }
.frow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flabel { font-size: 12px; font-weight: 700; color: var(--ink-3); width: 30px; flex: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.year { width: auto; padding: 6px 12px; font-size: 13px; border-radius: 999px; }

.list { margin-top: 14px; display: grid; gap: 12px; }
.uni { overflow: hidden; }
.uni > button {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  background: none; border: 0; cursor: pointer; text-align: left;
}
.uni .mark { width: 40px; height: 40px; border-radius: 12px; background: var(--site); color: var(--site-ink); display: grid; place-items: center; font-family: var(--f-title); font-size: 18px; flex: none; }
.uni .uname { font-family: var(--f-title); font-size: 19px; line-height: 1.2; }
.uni .meta { font-size: 12px; color: var(--ink-3); }
.uni .grow { flex: 1; min-width: 0; }
.uni .chev { color: var(--ink-3); transition: transform .2s; font-size: 18px; }
.uni[open] .chev { transform: rotate(90deg); }
.uni .rows { border-top: 1px dashed var(--line); padding: 4px 8px 8px; }
.uni:not([open]) .rows { display: none; }
.year-head { font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 10px 10px 4px; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; }
.row:hover { background: var(--cream); }
.row .what { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.row .what b { font-weight: 700; }
.tag.cat-자연 { background: var(--c-mint); color: var(--c-mint-ink); }
.tag.cat-인문·사회 { background: var(--c-lavender); color: var(--c-lavender-ink); }
.tag.mock { background: var(--c-yellow); color: var(--c-yellow-ink); }
.add { border: 1.5px solid var(--site-ink); background: #fff; color: var(--site-ink); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.add:hover { background: var(--site); }
.add[aria-pressed="true"] { background: var(--site-ink); color: #fff; }
.uni .addall { margin-left: auto; }
.none { text-align: center; color: var(--ink-3); padding: 40px 10px; }
.skel { height: 72px; border-radius: var(--radius); background: linear-gradient(90deg, #f3eee7 25%, #faf7f2 50%, #f3eee7 75%); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }

/* ---------- 담은 시험 ---------- */
.cart { padding: 18px; position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }
.cart-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cart-head h2 { margin: 0; font-family: var(--f-title); font-weight: 400; font-size: 22px; flex: 1; }
.cart-head .n { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--site-ink); color: #fff; font-family: var(--f-body); font-size: 13px; font-weight: 700; vertical-align: 3px; }
.linkish { background: none; border: 0; color: var(--ink-3); font-size: 13px; cursor: pointer; text-decoration: underline; }
.cart .x { position: static; display: none; }
.cart-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: c; }
.cart-list li { counter-increment: c; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--cream); font-size: 13px; }
.cart-list li::before { content: counter(c); width: 20px; height: 20px; flex: none; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.cart-list .t { flex: 1; min-width: 0; line-height: 1.35; }
.cart-list .t small { color: var(--ink-3); }
.cart-list button { background: none; border: 0; cursor: pointer; color: var(--ink-3); font-size: 16px; padding: 0 2px; line-height: 1; }
.cart-list button:hover { color: var(--err); }
.empty { color: var(--ink-3); font-size: 13px; text-align: center; padding: 14px 6px; margin: 0; border: 1.5px dashed var(--line); border-radius: 14px; }

.opts { margin: 16px 0 14px; padding-top: 14px; border-top: 1px dashed var(--line); display: grid; gap: 12px; }
.olabel { display: block; font-size: 12px; font-weight: 700; color: var(--ink-3); margin-bottom: 5px; }
.olabel i { font-style: normal; font-weight: 400; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--cream); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 7px 4px; font-size: 13px; font-weight: 700; color: var(--ink-3); cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(36, 31, 26, .14); }
.opt.two { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.opt .input { padding: 8px 10px; font-size: 14px; border-radius: 12px; }
.make { width: 100%; padding: 14px; font-size: 16px; }
.status { margin-top: 10px; display: grid; gap: 8px; font-size: 13px; }
.status .working { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--site); border-top-color: var(--site-ink); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 관리 ---------- */
.admin .card { padding: 6px 0; overflow-x: auto; }
.admin table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.admin th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin td { padding: 10px 14px; border-bottom: 1px dashed var(--line); vertical-align: top; }
.admin tr:last-child td { border-bottom: 0; }
.admin td small { color: var(--ink-3); }
.admin .acts { display: flex; gap: 6px; white-space: nowrap; }
.st { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.st-pending { background: var(--warn-bg); color: var(--warn); }
.st-approved { background: var(--ok-bg); color: var(--ok); }
.st-blocked { background: var(--err-bg); color: var(--err); }
.admin h2 { font-family: var(--f-title); font-weight: 400; font-size: 22px; margin: 4px 0 10px; }

/* ---------- 바닥 ---------- */
.foot { display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: space-between; border-top: 1px dashed var(--line); padding-top: 18px; padding-bottom: 90px; font-size: 12px; color: var(--ink-3); }

/* ---------- 휴대폰 ---------- */
.cartbar { display: none; }
@media (max-width: 960px) {
  .browse { grid-template-columns: 1fr; }
  .filters { position: static; }
  .cart {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40;
    max-height: 86vh; border-radius: 24px 24px 0 0; border-bottom: 0;
    transform: translateY(105%); transition: transform .25s ease; box-shadow: 0 -20px 50px -20px rgba(36,31,26,.4);
  }
  .cart.open { transform: none; box-shadow: 0 0 0 100vmax rgba(36, 31, 26, .38); }
  .cart .x { display: inline-block; width: 34px; height: 34px; }
  .cartbar:not([hidden]) {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 35;
    background: var(--ink); color: #fff; border-radius: 999px; padding: 8px 8px 8px 20px;
    box-shadow: var(--shadow-up);
  }
  .cartbar b { font-size: 17px; }
}
@media (max-width: 640px) {
  main { padding-top: 18px; }
  .brand .badge { display: none; }
  .uni > button { padding: 12px 14px; }
  .row { padding: 8px 6px; }
  .opt.two { grid-template-columns: 1fr; }
  .gate-card { margin: 20px auto; padding: 28px 20px 24px; }
}

/* 초코 그림을 못 불러왔을 때 */
.noimg { display: grid; place-items: center; background: var(--cream-2); color: var(--c-choco-ink); font-size: 20px; }
.gate-card .pic .noimg { width: 86%; height: 86%; border-radius: 50%; font-size: 44px; }
