/* girolamo（2026-11-16）。白い地に、細い線で区切った行で投稿を並べる。手本は Reddit の画面の軽さだ（依頼：ベージュをやめ、軽やかに）
   色は灰色の段だけで組み、色を付けるのは界隈の丸い印と、押したやりとりだけにする */

:root {
  --mainw: 760px; /* 中身の幅。細い1行の余白をこれに合わせる */
  --bg: #ffffff;
  --hover: #f6f7f8;
  --pill: #eaedef;
  --pill-hover: #dfe3e6;
  --line: #e5e8ea;
  --ink: #0f1a1c;
  --mute: #5c6c74;
  --link: #1d5fd6;
  --like: #e0245e;
  --repost: #12a05c;
  --mark: #1d5fd6;
  --kurashi: #2e9e6b;
  --manabi: #3a6ee8;
  --asobi: #f2711c;
  --today: #8a5cf6;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1416; --hover: #131f23; --pill: #1f2c31; --pill-hover: #2a3a40; --line: #223035;
    --ink: #eef1f3; --mute: #8ba2ad; --link: #7aa7ff; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1416; --hover: #131f23; --pill: #1f2c31; --pill-hover: #2a3a40; --line: #223035;
  --ink: #eef1f3; --mute: #8ba2ad; --link: #7aa7ff; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 14px/1.6 "Inter", "IBM Plex Sans JP", system-ui, sans-serif;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
/* hidden の付いたものは、display の規則があっても出さない */
[hidden] { display: none !important; }
body:not([data-signed="1"]) .app { display: none; }

/* ロゴ。丸い点と小文字の名前だけ */
.brand { display: inline-flex; align-items: center; gap: 8px; margin: 0; font: 800 20px/1 "Inter", system-ui, sans-serif; letter-spacing: -.02em; text-decoration: none; }

/* ボタンは灰色の丸だけ。.ink は濃い塗り */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 18px; border-radius: 999px; border: 0;
  background: var(--pill); font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--pill-hover); }
.btn.ink { background: var(--ink); color: var(--bg); }
.btn.quiet { background: none; color: var(--mute); padding: 0; min-height: 32px; font-weight: 400; }
.btn:disabled { opacity: .5; cursor: default; }

/* ログインの前 */
.gate { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 16px; text-align: center; }
.gate .brand { font-size: 40px; gap: 12px; }

.gate .lead { margin: 14px 0 28px; color: var(--mute); }
.gate form { display: flex; flex-direction: column; gap: 10px; width: min(320px, 100%); }
.gate input { font: inherit; height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 999px; background: var(--pill); color: var(--ink); outline: none; }
.gate input:focus { border-color: var(--mute); background: var(--bg); }
.gate .btn { height: 44px; }
.gatemsg { min-height: 1.6em; margin: 10px 0 0; color: var(--like); font-size: 13px; }
.legal { display: flex; gap: 16px; font-size: 12px; margin: 28px 0 0; }
.legal a { color: var(--mute); text-decoration: none; }

/* 上の帯 */
.top {
  position: sticky; top: 0; z-index: 5; height: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 clamp(16px, 3vw, 32px);
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.right { display: flex; align-items: center; gap: 10px; }

/* きょうの語。灰色の丸に日付・語を入れる。押すと Bluets のタイムラインになる */
.today { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 6px; border-radius: 999px; background: var(--pill); text-decoration: none; font-size: 13px; }
.today:hover { background: var(--pill-hover); }
.today .date { display: grid; place-items: center; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--today); color: #fff; font-size: 11px; font-weight: 600; }
.today .label { color: var(--mute); }
.today .word { font-weight: 600; }
.today[aria-current="true"] { box-shadow: inset 0 0 0 1.5px var(--ink); }

.me { position: relative; }
.mebtn { all: unset; cursor: pointer; display: block; border-radius: 50%; }
.mebtn img { width: 32px; height: 32px; border-radius: 50%; background: var(--pill); object-fit: cover; }
.memenu { position: absolute; right: 0; top: 42px; min-width: 220px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.mename { font-weight: 600; }
.mehandle { color: var(--mute); font-size: 13px; margin-bottom: 6px; }

main { max-width: 760px; margin: 0 auto; padding: 0 16px 64px; }

/* 界隈を選ぶ段。棚は字だけのタブ、界隈は印つきの灰色の丸 */
.pick { padding: 14px 0 12px; }
.shelves { display: flex; gap: 4px; margin-bottom: 10px; }
.shelf { all: unset; cursor: pointer; padding: 6px 14px; border-radius: 999px; font-weight: 600; color: var(--mute); }
.shelf:hover { background: var(--hover); color: var(--ink); }
.shelf[aria-selected="true"] { background: var(--pill); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  height: 32px; padding: 0 12px 0 4px; border: 0; border-radius: 999px; background: none; font-size: 13px;
}
.chip:hover { background: var(--hover); }
.chip[aria-current="true"] { background: var(--pill); font-weight: 600; }

/* 界隈の印。淡い棚の色の丸に、Lucide の線のアイコンを濃い棚の色で描く */
.mark { --c: var(--mark); position: relative; display: inline-block; flex: none; width: 24px; height: 24px; border-radius: 50%; background: color-mix(in srgb, var(--c) 14%, transparent); }
.mark::before { content: ""; position: absolute; inset: 22%; background: var(--c); -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.mark.s-kurashi { --c: var(--kurashi); }
.mark.s-manabi { --c: var(--manabi); }
.mark.s-asobi { --c: var(--asobi); }
.mark.s-today { --c: var(--today); }
.mark.big { width: 48px; height: 48px; }
.mark.big::before { inset: 25%; }

/* 選んだ界隈の頭 */
.head { padding: 18px 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.community { display: flex; align-items: center; gap: 12px; }
.head h2 { margin: 0; font: 700 22px/1.25 "Inter", "IBM Plex Sans JP", system-ui, sans-serif; letter-spacing: -.01em; }
.sub { margin: 2px 0 0; color: var(--mute); font-size: 12px; }
.qwords, .words { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.qwords:empty, .words:empty { display: none; }
.qword, .word {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; cursor: pointer;
  border: 0; border-radius: 999px; background: var(--pill); font-size: 12px;
}
.qword:hover, .word:hover { background: var(--pill-hover); }
.qword[aria-pressed="true"], .word[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.word { background: none; box-shadow: inset 0 0 0 1px var(--line); }
.word span { color: var(--mute); font-size: 11px; }
.word[aria-pressed="true"] span { color: inherit; opacity: .7; }

/* 投稿。枠を付けず、細い線で区切った行にする */
.feed { display: flex; flex-direction: column; }
.empty { color: var(--mute); padding: 40px 0; text-align: center; }
.post {
  display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px;
  padding: 14px 12px 8px; margin: 0 -12px; border-bottom: 1px solid var(--line); border-radius: 0;
}
.post:hover { background: var(--hover); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--pill); object-fit: cover; }
.who { display: flex; gap: 6px; align-items: baseline; min-width: 0; font-size: 12px; }
.who .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .handle, .who time { color: var(--mute); white-space: nowrap; }
.who .handle { overflow: hidden; text-overflow: ellipsis; }
.who time::before { content: "・"; margin-right: 2px; }
.text { margin-top: 2px; font-size: 15px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.text a { color: var(--link); text-decoration: none; }
.text a:hover { text-decoration: underline; }
.imgs { display: grid; gap: 4px; margin-top: 10px; grid-template-columns: repeat(2, 1fr); border-radius: 16px; overflow: hidden; }
.imgs.n1 { grid-template-columns: 1fr; }
.imgs img { width: 100%; max-height: 520px; object-fit: cover; background: var(--pill); }
.card, .quote { display: block; margin-top: 10px; border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; text-decoration: none; }
.card:hover, .quote:hover { background: var(--bg); }
.card .t { font-weight: 600; }
.card .d, .card .u, .quote .who { color: var(--mute); font-size: 12px; }

/* やりとりは いいね・リポスト・ブックマーク だけ。灰色の丸に入れる */
.acts { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; font-weight: 600; }
.act { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--pill); cursor: pointer; }
.act:hover { background: var(--pill-hover); }
.act svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.act span:empty { display: none; }
.act.like[aria-pressed="true"] { color: var(--like); }
.act.like[aria-pressed="true"] svg { fill: currentColor; }
.act.repost[aria-pressed="true"] { color: var(--repost); }
.act.bookmark[aria-pressed="true"] { color: var(--link); }
.act.bookmark[aria-pressed="true"] svg { fill: currentColor; }
.act:disabled { opacity: .5; }
.acts .open { margin-left: auto; height: 32px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px; color: var(--mute); text-decoration: none; font-weight: 400; }
.acts .open:hover { background: var(--pill); color: var(--ink); }
.more { color: var(--mute); text-align: center; padding: 28px 0; font-size: 13px; }

@media (max-width: 600px) {
  .today .label { display: none; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .chip { flex: none; }
  .acts .open { padding: 0 4px; }
}

/* 写真は2枚以上なら正方形に切る。1枚は元の縦横比 */
.imgs:not(.n1) img { aspect-ratio: 1; }
.imgs.n3 a:first-child { grid-row: span 2; }
.imgs.n3 a:first-child img { aspect-ratio: auto; height: 100%; }
.imgs.video { position: relative; }
.play { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(0,0,0,.55); }
.play::after { content: ""; position: absolute; left: 22px; top: 17px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff; }

/* リンクのカード。字を左、小さな写真を右に置く */
.card { display: flex; gap: 12px; align-items: center; }
.card .c { flex: 1; min-width: 0; }
.card .u { margin-bottom: 2px; }
.card .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.card .d { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.card img { flex: none; width: 96px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--pill); }

/* 引用 */
.quote .who { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.quote .qav { width: 18px; height: 18px; border-radius: 50%; background: var(--pill); object-fit: cover; }
.quote .name { color: var(--ink); font-weight: 600; }
.qtext { white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }

/* 最初の読み込みのあいだの仮の行 */
.ghost { height: 120px; margin: 14px 0; border-radius: 12px; background: linear-gradient(90deg, var(--hover), var(--pill), var(--hover)); background-size: 200% 100%; animation: ghost 1.2s ease-in-out infinite; }
@keyframes ghost { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .ghost { animation: none; } }

/* スクロールで界隈の頭が見えなくなったら、上の帯の下に細い1行を出す（2026-11-16、依頼：上を重くしない） */
.bar {
  position: fixed; left: 0; right: 0; top: 56px; z-index: 4; height: 44px;
  display: flex; align-items: center; gap: 10px; padding: 0 max(16px, calc((100vw - var(--mainw)) / 2 + 16px));
  background: var(--bg); border-bottom: 1px solid var(--line);
  transform: translateY(-100%); opacity: 0; pointer-events: none; transition: transform .15s ease, opacity .15s ease;
}
body.stuck .bar { transform: none; opacity: 1; pointer-events: auto; }
.barname { all: unset; cursor: pointer; flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 4px; border-radius: 999px; font-weight: 700; }
.barname:hover, .barname[aria-expanded="true"] { background: var(--pill); }
.barname svg { width: 16px; height: 16px; fill: none; stroke: var(--mute); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.barwords { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; mask-image: linear-gradient(90deg, #000 85%, transparent); }
.barwords::-webkit-scrollbar { display: none; }
.barwords .qword, .barwords .word { flex: none; height: 26px; }
.barmenu { position: absolute; top: 48px; left: max(16px, calc((100vw - var(--mainw)) / 2 + 16px)); width: min(420px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 10px; }
.barmenu h3 { margin: 8px 8px 4px; font-size: 12px; color: var(--mute); font-weight: 600; }
.barmenu .chips { margin-bottom: 4px; }
@media (prefers-reduced-motion: reduce) { .bar { transition: none; } }

/* Bluesky で開く は淡い色で小さく出す（2026-11-16、依頼） */
.acts .open { color: var(--mute); opacity: .55; font-size: 11px; }
.acts .open:hover { opacity: 1; }

/* 表示の切り替え（タイル・一覧） */
.community .tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.community .view { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--pill); }
.view button { display: grid; place-items: center; width: 32px; height: 28px; border: 0; border-radius: 999px; background: none; color: var(--mute); cursor: pointer; }
.view button[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.view svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* タイル。幅を広げ、列に積む（2026-11-16、依頼：Tumblr のように） */
body[data-view="tiles"] main { max-width: 1240px; }
body[data-view="tiles"] .stream { max-width: none; }
body[data-view="tiles"] .feed { display: flex; flex-direction: row; align-items: flex-start; gap: 14px; padding-top: 16px; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.tile { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; transition: box-shadow .15s ease, transform .15s ease; }
.tile:hover { box-shadow: 0 6px 20px rgba(0,0,0,.08); transform: translateY(-1px); }
.tmedia { display: block; position: relative; background: var(--pill); }
.tmedia img { width: 100%; height: auto; object-fit: cover; }
.tmedia .count { position: absolute; right: 8px; top: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 600; }
.tb { padding: 12px 14px 8px; }
.ttext { font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 10; -webkit-box-orient: vertical; overflow: hidden; }
.ttext a { color: var(--link); text-decoration: none; }
.tcard { display: block; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; }
.tcard img { width: 100%; aspect-ratio: 1.91; object-fit: cover; background: var(--pill); }
.tcard .u { display: block; padding: 8px 10px 0; color: var(--mute); font-size: 11px; }
.tcard .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding: 0 10px 8px; font-size: 13px; font-weight: 600; line-height: 1.4; }
.tquote { margin-top: 10px; padding-left: 10px; border-left: 2px solid var(--line); color: var(--mute); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tmeta { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; min-width: 0; }
.tav { width: 20px; height: 20px; border-radius: 50%; background: var(--pill); object-fit: cover; }
.tmeta .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmeta time { margin-left: auto; color: var(--mute); white-space: nowrap; }
/* タイルのやりとりは、灰色の丸をやめて印と数だけ */
.tile .acts { gap: 2px; margin-top: 4px; margin-left: -8px; }
.tile .act { background: none; height: 30px; padding: 0 8px; }
.tile .act:hover { background: var(--pill); }
.tile .acts .open { padding: 0 6px; height: 30px; }
body[data-view="tiles"] .ghost { height: 220px; }

/* 絞り込みを外す「すべて」。選ばれているときは濃い塗り */
.qword.all { font-weight: 600; }

/* 検索の語の件数と、0件で押せない語 */
.qword span { color: var(--mute); font-size: 11px; font-weight: 400; }
.qword[aria-pressed="true"] span { color: inherit; opacity: .7; }
.qword:disabled { cursor: default; opacity: .4; background: var(--pill); }
.qword:disabled:hover { background: var(--pill); }

/* 下の帯。Atelier MoJa・MoJa・利用規約・プライバシーポリシーを並べて固定する（2026-11-16、依頼） */
.foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; height: 34px;
  display: flex; align-items: center; justify-content: center; gap: 4px 18px; flex-wrap: wrap;
  padding: 0 16px calc(env(safe-area-inset-bottom) * .6); font-size: 11px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.foot a { color: var(--mute); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }
.foot a:first-child { font-weight: 600; color: var(--ink); }
body { padding-bottom: 34px; }

/* 並べ替え。字の段で、選んだものだけ白く浮かせる（表示の切り替えと同じ形） */
.sort { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--pill); }
.sort button { height: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: none; color: var(--mute); font-size: 12px; cursor: pointer; white-space: nowrap; }
.sort button[aria-pressed="true"] { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
@media (max-width: 600px) {
  .community { flex-wrap: wrap; }
  .community .tools { width: 100%; justify-content: space-between; margin-top: 8px; }
  .sort button { padding: 0 8px; }
}

/* マスコット（2026-11-16、Gemini の下書きを Illustrator で清書）。暗い画面では線を白くする */
.logo-mascot { width: 34px; height: 34px; margin: -6px -2px -6px -6px; }
.gate .logo-mascot { width: 96px; height: 96px; margin: 0 -8px 0 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-mascot { filter: invert(1); } }
:root[data-theme="dark"] .logo-mascot { filter: invert(1); }

/* 読んでいるあいだに跳ねるマスコット。着地で少しつぶれる */
.more .hop { display: block; margin: 0 auto; width: 56px; height: 56px; transform-origin: 50% 100%; animation: hop .7s cubic-bezier(.3,.7,.4,1) infinite; }
@keyframes hop {
  0%   { transform: translateY(0) scale(1.08, .9); }
  15%  { transform: translateY(0) scale(.95, 1.06); }
  50%  { transform: translateY(-26px) scale(1, 1) rotate(-6deg); }
  85%  { transform: translateY(0) scale(.97, 1.03); }
  100% { transform: translateY(0) scale(1.08, .9); }
}
@media (prefers-reduced-motion: reduce) { .more .hop { animation: none; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .more .hop { filter: invert(1); } }
:root[data-theme="dark"] .more .hop { filter: invert(1); }

/* タイルのときは中身が広がるので、細い1行も同じ幅にそろえる（2026-11-16、指摘：Mac で位置がずれる） */
body[data-view="tiles"] { --mainw: 1240px; }
