/* 仮の見た目（あとで差し替え前提） */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }  /* スマホの横向きで文字が勝手に拡大されない */
[hidden] { display: none !important; }
body { margin: 0; font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif; line-height: 1.8; color: #222; background: #fff; }
header { border-bottom: 1px solid #eee; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
header .site { font-weight: bold; text-decoration: none; color: inherit; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
header .logo { width: 32px; height: 32px; border-radius: 6px; image-rendering: pixelated; }
.tagbar { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; margin: -8px 0 8px; }

/* 更新予報（右上） */
.forecast { display: flex; align-items: center; gap: 8px; font-size: .72em; color: #888; margin-left: auto; }
.fc-chart { display: block; }
.fc-line { fill: none; stroke: #222; stroke-width: 1.2; }
.fc-dot { fill: #222; }
.fc-pred { stroke: #222; stroke-width: 1; stroke-dasharray: 2 2; }
.fc-band { fill: #2563eb; opacity: .15; }
.fc-today { stroke: #ddd; stroke-width: 1; }
.fc-label { line-height: 1.4; }
.fc-range { color: #aaa; }
.fc-writing { display: block; color: #2563eb; }
.tag { font: inherit; font-size: .78em; padding: 1px 8px; border: 1px solid #ddd; border-radius: 999px; background: #fff; color: #555; cursor: pointer; text-decoration: none; }
.tag:hover { border-color: #999; }
.tag.on { background: #222; color: #fff; border-color: #222; }
.tag-s { font-size: .78em; color: #888; margin-left: 6px; }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.meta .date { color: #888; font-size: .85em; text-decoration: none; }
main { max-width: 720px; margin: 0 auto; padding: 24px 20px 80px; }
a { color: #2563eb; }
.muted { color: #888; }
time { color: #888; font-size: .9em; }

.post-list { list-style: none; padding: 0; }
.post-list li { padding: 16px 0; border-bottom: 1px solid #eee; }
.post-list .excerpt { margin: 0 0 6px; white-space: pre-line; overflow-wrap: anywhere; }
.post-list .more { white-space: nowrap; font-size: .9em; }

article .meta { margin-bottom: 8px; }
.body img { max-width: 100%; height: auto; border-radius: 6px; display: block; }
.body figure { margin: 1.2em 0; }
.body figcaption { color: #888; font-size: .85em; margin-top: 4px; }
.body h2, .body h3 { line-height: 1.4; margin-bottom: .5em; }
.body h2 { font-size: 1.5em; margin-top: 1.6em; }
.body h3 { font-size: 1.2em; margin-top: 1.4em; }
.body h2 + h3, .body h2 + h2, .body h3 + h3 { margin-top: .3em; }  /* 見出しが続くときは詰める */
.body > :first-child { margin-top: 0; }
.body .big { font-size: 1.35em; }
.body mark { background: #fff3a3; }
.body blockquote { margin: 1em 0; padding: 4px 16px; border-left: 4px solid #ddd; color: #555; }
.body :not(pre) > code { background: #f2f2f2; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.body hr { border: 0; border-top: 1px solid #ddd; margin: 2em 0; }

.code { margin: 1.2em 0; border-radius: 8px; overflow: hidden; background: #1e1e1e; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 4px 12px; background: #2d2d2d; color: #aaa; font-size: .8em; }
.code pre { margin: 0; padding: 12px 14px; overflow-x: auto; color: #eee; font-size: .9em; line-height: 1.6; }
.code .copy { background: #444; color: #fff; border: 0; border-radius: 4px; padding: 2px 10px; cursor: pointer; font-size: 1em; }
.code .copy:hover { background: #555; }

/* 管理画面 */
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
/* 入力欄は16px以上にしておくと、iPhoneでタップしたときに勝手にズームしない */
input[type=text], input[type=password], textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 6px; font: inherit; font-size: 16px; }
textarea { font-family: ui-monospace, Consolas, monospace; line-height: 1.6; }
.tag-suggest { display: flex; flex-wrap: wrap; gap: 4px; margin-top: -4px; }
button, .button { padding: 6px 14px; border: 1px solid #ccc; border-radius: 6px; background: #fff; cursor: pointer; font: inherit; text-decoration: none; color: inherit; display: inline-block; }
.primary { background: #222; color: #fff; border-color: #222; }
.danger { color: #c00; border-color: #e5a0a0; margin-top: 24px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; position: sticky; top: 0; background: #fff; padding: 6px 0; z-index: 1; }
.toolbar button { padding: 3px 9px; font-size: .85em; }
.toolbar .spacer { flex: 1; }
.preview { border: 1px dashed #ccc; border-radius: 6px; padding: 8px 16px; min-height: 300px; }
.check { display: flex; gap: 6px; align-items: center; }
.error { color: #c00; } .ok { color: #080; }
.badge { display: inline-block; background: #fff3a3; padding: 2px 8px; border-radius: 4px; font-size: .85em; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 8px; border-bottom: 1px solid #eee; text-align: left; }
.admin-table .num { text-align: right; }
