
:root{
  --bg:#faf8f4;
  --paper:#ffffff;
  --ink:#222;
  --muted:#777;
  --line:#e7e1d9;
  --primary:#3563e9;
  --accent:#f3efe7;
  --shadow:0 6px 20px rgba(0,0,0,.06);

  --radius:18px;
  --maxw: 840px;
  --readw: 680px;
}

*{ box-sizing: border-box; }
html, body{ margin:0; padding:0; }
body{
  background:var(--bg);
  color:var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
               "Apple SD Gothic Neo", "Noto Sans KR", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}


img{ max-width:100%; height:auto; display:block; }
img[alt=""]{ filter:brightness(.98); }


a{ color:inherit; text-decoration:none; }


.tg-header{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  gap:8px;
  padding:10px 14px;
  background:#f0ece4cc;
  backdrop-filter:saturate(120%) blur(10px);
  border-bottom:1px solid var(--line);
}
.tg-header .brand{ margin:0; font-size:16px; font-weight:700; letter-spacing:0.2px; }
.icon-btn{ display:inline-flex; align-items:center; justify-content:center; min-width:28px; height:28px; }


article{ max-width:var(--maxw); margin:0 auto; }


.post-header{
  padding:20px 14px 12px;
  background:linear-gradient(180deg,#efeae1, #f7f4ee 60%, transparent);
  border-bottom:1px solid var(--line);
}
.post-wrap{ max-width:var(--readw); margin:0 auto; }
.post-title{ margin:6px 0 4px; font-size:28px; line-height:1.25; letter-spacing:-0.2px; }
.post-meta{ color:var(--muted); font-size:12px; }


.post-hero{
  margin:14px auto; max-width:420px;
  border-radius:var(--radius); overflow:hidden;
  background:#ddd; box-shadow:var(--shadow);
}
.ar-9x16{ aspect-ratio:9/16; width:100%; object-fit:cover; background:linear-gradient(135deg,#eee,#ddd); }


.post-tags{
  display:flex; gap:8px; flex-wrap:wrap;
  padding:6px 14px 0; max-width:var(--readw); margin:0 auto;
}
.tag{
  font-size:12px; color:#444;
  background:#f5f2ec; border:1px solid var(--line);
  padding:6px 10px; border-radius:999px;
}


.post-body{ padding: 8px 14px 22px; }
.prose{
  max-width:var(--readw); margin:0 auto;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px 16px;
  box-shadow:var(--shadow);
}

.prose h2{
  margin:26px 0 14px;
  padding:12px 14px;
  border-left:5px solid var(--primary);
  border-radius:8px;
  background:#f6f9ff;
  color:#17346f;
  font-size:22px;
  line-height:1.35;
}
.prose p{ margin:12px 0; font-size:16px; line-height:1.75; color:#2b2b2b; }
.prose ul{ margin:10px 0 14px 22px; }
.prose li{ margin:6px 0; }


.callout{
  display:flex; gap:10px; align-items:flex-start;
  background:#f6f9ff; border:1px solid #e4ecff;
  padding:12px; border-radius:12px; margin:14px 0;
}
.callout b{ color:#2d55ff; }


figure{ margin:16px 0; }
.frame{
  border-radius:14px; overflow:hidden;
  border:1px solid var(--line);
  background:#eee; box-shadow:var(--shadow);
}
.frame img{ width:100%; object-fit:cover; }
figcaption{ font-size:12px; color:#666; margin-top:6px; text-align:center; }


.scroll-gallery{
  display:grid; grid-auto-flow:column; grid-auto-columns:80%;
  gap:10px; overflow-x:auto; padding-bottom:8px;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;
}
.scroll-gallery .card{
  scroll-snap-align:center;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:14px; overflow:hidden;
  box-shadow:var(--shadow);
}
.scroll-gallery img{ width:100%; aspect-ratio:9/16; object-fit:cover; }
.scroll-gallery .cap{ padding:8px 10px; font-size:13px; color:#444; }


.ad-wrap{ margin:18px 0; }
.ad-note{ text-align:center; color:#888; font-size:12px; margin-top:6px; }


.related{ padding:10px 12px 32px; max-width:var(--maxw); margin:0 auto; }
.row.scroller{
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:48%;
  gap:12px;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;
}
.card{
  position:relative; display:block;
  background:var(--paper); border:1px solid var(--line);
  border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow);
  scroll-snap-align:center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover{ transform:translateY(-2px); box-shadow:0 10px 28px rgba(0,0,0,.08); }
.card-img{ width:100%; aspect-ratio:4/5; object-fit:cover; background:#eee; display:block; }
.card-body{ padding:8px 10px; }
.card-title{ font-size:14px; line-height:1.35; margin:4px 0 2px; }
.card-excerpt{ font-size:12px; color:#555; margin:0; }
.card-cat{ font-size:12px; color:#888; }


.tabbar{
  position:sticky; bottom:0; z-index:5;
  display:grid; grid-template-columns:repeat(5,1fr);
  border-top:1px solid var(--line);
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(10px);
}
.tab{
  display:flex; flex-direction:column; align-items:center; gap:2px;
  padding:8px 0; font-size:12px; color:#333;
}
.tab.is-active{ color:var(--primary); font-weight:700; }


@media (min-width: 900px){
  .post-hero{ max-width:500px; }
  .scroll-gallery{ grid-auto-columns:48%; }
  .row.scroller{ grid-auto-columns: 32%; }

  .combo{
    display:grid; grid-template-columns: 9fr 11fr;
    gap:18px; align-items:start;
  }
}


#ad, #coupang-ad{ width:100%; }
.ad-wrap iframe[src*="ads-partners.coupang.com"]{
  width:100% !important;
  max-width:100% !important;
  display:block;
  border:0;
}


.page-header{
  position: static;
  background:#ebe7df;
  border-bottom:1px solid var(--line);
  padding:12px 14px;
  z-index: auto;
}
.page-title{ margin:0; font-size:18px; font-weight:800; }

.breadcrumb{
  position: static;
  padding:10px 14px 0;
  color:#666;
  font-size:12px;
  background: transparent;
}
.breadcrumb a{ color:#666; text-decoration:none; }


.toolbar{
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(0,0,0,.06);

  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding:10px 12px;

  max-width:100%;
  overflow: hidden;
}


.toolbar > *{ min-width:0; }


.tool-input{
  flex: 1 1 320px;
  width: 100%;
  min-width: 0;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #ded8cf;
  background:#fff;
  font-size:14px;
}

.tool-select{
  flex: 0 1 160px;
  width: 160px;
  max-width:100%;
  min-width:0;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #ded8cf;
  background:#fff;
  font-size:14px;
}


@media (max-width: 480px){
  .tool-input{ flex: 1 1 100%; }

  .tool-select{
    flex: 1 1 0;
    width: 0;
    min-width: 0;
  }
}


main{ padding-top: 0; }




.grid{
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px;
  padding: 12px;
}


.grid .card{
  width: 100% !important;
  max-width: 100% !important;
  grid-column: auto !important;
}


@media (max-width: 480px){
  .grid .card-img{
    aspect-ratio: 1 / 1;

  }
}




:root{
  --app-maxw: 480px;
}


@media (min-width: 900px){

  .page-header,
  .breadcrumb,
  .toolbar,
  main{
    max-width: var(--app-maxw);
    margin-left: auto;
    margin-right: auto;
  }


  main{
    padding-left: 12px;
    padding-right: 12px;
  }


  .grid{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }


  .page-header{ padding-left: 14px; padding-right: 14px; }
  .breadcrumb{ padding-left: 14px; padding-right: 14px; }


  .toolbar{
    padding-left: 12px;
    padding-right: 12px;
  }


  .tabbar{
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, var(--app-maxw));
    max-width: var(--app-maxw);
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    overflow: hidden;
  }


  body{
    padding-bottom: var(--tabbar-h);
  }
}


@media (min-width: 1400px){
  :root{ --app-maxw: 520px; }
}
