/* Basic reset */
*{box-sizing:border-box;margin:0;padding:0}
body{font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans JP","Hiragino Kaku Gothic ProN",Meiryo,sans-serif;background:#f2f5f7;color:#0f1419}
a{color:inherit;text-decoration:none}
.container{max-width:980px;margin:0 auto;padding:0 16px 16px 16px}
.header {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
}
.header .logo{font-weight:800;font-size:22px}
#timeline {border: 1px solid #e1e2e2;padding: 0 10px;}
.post{
  display:flex;
  align-items:flex-start;
  gap:12px;
  /* Make the post content align with #timeline's 10px padding,
     but let the bottom border stretch edge-to-edge inside #timeline */
  padding:16px 10px;
  margin:0 -10px;
  border-bottom:1px solid #e1e2e2;
}
.avatar{width:48px;height:48px;border-radius:50%;flex:0 0 auto;object-fit:cover}
.favicon{width:48px;height:48px;flex:0 0 auto;object-fit:cover;margin-left: 20px;}
.meta{display:flex;gap:8px;color:#536471;font-size:14px}
.name{font-weight:700}
.text{font-size:16px;line-height:1.6;margin-top:4px;white-space:pre-wrap;word-wrap:break-word}
.gallery{margin-top:10px;display:grid;grid-template-columns:1fr 1fr;gap:6px}
.gallery img{width:100%;height:220px;object-fit:cover;border-radius:12px;border: 1px #9c9c9c solid;}
.actions{display:flex;align-items:center;gap:16px;margin-top:10px;color:#536471}
.action{display:inline-flex;align-items:center;gap:6px;cursor:pointer;padding:6px 10px;border-radius:9999px}
.action:hover{background:#f1f5f9}
.badge{
  background:#e5e7eb;
  border-radius:9999px;
  padding:2px 8px;
  font-size:12px;
  color:#475569;
  display: inline-flex;
  align-items: center;
}
.tags{display:flex;gap:8px;margin-top:8px;flex-wrap:wrap}
.tag{font-size:12px;border:1px solid #e5e7eb;padding:2px 8px;border-radius:9999px;color:#475569;cursor:pointer}
.footer-space{height:60px}
.compose{position:fixed;bottom:16px;right:16px;background:#1d9bf0;color:#fff;border:none;border-radius:9999px;padding:12px 18px;font-weight:700;box-shadow:0 4px 12px rgba(0,0,0,.12);cursor:pointer}
.searchbar{display:flex;gap:8px;}
.searchbar input{
  height:36px;              /* match tab height */
  padding:0 12px;           /* vertical center */
  border:1px solid #e5e7eb;
  border-radius:12px;
}
.bookmark-on{color:#eab308}
.single{padding:12px;border:1px solid #e2e8f0;border-radius:12px;background:#fff}
.notice{font-size:12px;color:#64748b;margin:8px 0 0}
.tabs {
  font-size: 14px;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  width: 100%;
}
.tab{
  display:inline-flex;
  align-items:center;
  height:36px;              /* unify nav item height */
  padding:0 8px;            /* horizontal padding only */
  color:#334155;
  text-decoration:none;
  position:relative;
}
.tab:hover{color:#0f172a}
.tab.active{font-weight:800;color:#1d9bf0}
.tab.active::after{content:"";position:absolute;left:0;right:0;bottom:-6px;height:6px;background:#1d9bf0;border-radius:9999px}


.searchbar .search-wrap{
  position:relative;
  display:flex;            /* input & button in one row */
  align-items:center;
  max-width:100%;
}
.searchbar #search{
  font-size: 16px;
  flex:0 0 auto;
  width:12rem;
  height:36px;             /* align with tabs */
  padding:0 36px 0 12px;   /* room for the X button */
}
.text a {
    display: block;
    text-decoration: underline;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 16rem;
}
@media (max-width:640px){
  .container{padding:0 6px 12px 6px}
  .gallery img{height:160px}
  body {margin: 0;}
  .searchbar #search{width: 6rem;}
}
.clear-button{
  position:absolute;
  right:10px; top:50%;
  transform:translateY(-50%);
  width:28px; height:28px; line-height:28px;
  text-align:center; border:0; border-radius:9999px;
  color: #fff;
  background:#1d9bf0; cursor:pointer; font-size:18px;
  z-index:1;
}
.clear-button[hidden]{display:none}
.clear-button:hover{background:rgba(15,23,42,.12)}
.clear-button:focus{outline:2px solid #1d9bf0; outline-offset:2px}


/* --- Truncate ID badge text (show head only, add ellipsis) --- */
.meta .badge{ min-width: 0; }
.meta .badge a{
  display:inline-block;
  max-width:12ch;              /* e.g. "ID: 17549…" */
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  vertical-align:bottom;
}

/* --- Sidebar Layout (timeline + sidebar) --- */
/* Mobile: <=720px → 1カラム（サイドバー非表示） */
.sidebar{display:none}
#timeline{margin-right:0}

/* Desktop: >=721px → 右サイドバーをfloatで配置 */
@media (min-width: 721px){
  .sidebar{display:block;float:right;clear:none;width:280px;margin-left:16px}
  #timeline{margin-right:296px}
}
/* Clear floats */
.container::after{content:"";display:table;clear:both}

/* Sidebar visuals */
.sidebar section{background:#fff;border:1px solid #e1e2e2;border-radius:12px;padding:12px;margin-bottom:16px}
.sidebar h3{font-size:14px;color:#334155;margin-bottom:8px}
.tagcloud-body a{display:inline-block;margin:4px 6px;color:#1d4ed8}