/* ===== base.css — 変数・リセット・レイアウト ===== */

:root {
  --bg: #fff;
  --paper: #fff;
  --text: #000;
  --muted: #444;
  --line: #000;
  --max: 460px;
  --shadow: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", "MS Gothic", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

body { min-height: 100vh; visibility: hidden; padding-top: 40px; }
body.is-ready { visibility: visible; }

img {
  max-width: 100%;
  display: block;
  height: auto;
}

button, a {
  font: inherit;
}

.wrap {
  width: min(calc(100% - 28px), var(--max));
  margin: 0 auto;
  padding: 14px 0 60px;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: #e8e8e8;
  border-bottom: 2px solid #000;
}

.topbar-inner {
  width: min(calc(100% - 28px), var(--max));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
}

.title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1;
}

.topbar-login-btn {
  opacity: 0.68;
  color: #7f7f7f;
  margin-right: 2px;
}

.topbar-login-btn:hover {
  opacity: 1;
  color: #555;
}

.title h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.title p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.transfer-modal {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 25;
  background: #fff;
  border: 1px solid #ccc;
  padding: 10px 14px;
  box-shadow: 2px 2px 0 #ccc;
}

.transfer-modal[hidden] {
  display: none !important;
}

.transfer-modal-title {
  margin: 0 0 6px;
  font-family: "Courier New", monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: #333;
}

.transfer-modal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: "Courier New", monospace;
  font-size: 0.68rem;
  color: #444;
  line-height: 1.9;
  white-space: nowrap;
}

.transfer-modal-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.transfer-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.transfer-label-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: #666;
  flex: 0 0 auto;
}

.transfer-label-icon svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.transfer-value {
  text-align: right;
}

.transfer-kb {
  cursor: pointer;
}

.topbar-clock {
  display: none;
}

.topbar-reset-seen-btn {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.64rem;
  color: #aaa;
  opacity: 0.45;
  padding: 2px 6px;
  white-space: nowrap;
  letter-spacing: 0.04em;
  z-index: 1;
}

.topbar-reset-seen-btn:hover {
  opacity: 0.85;
  color: #555;
}

.intro-card {
  padding: 2px 0 10px;
  margin-bottom: 0;
}

.intro-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.load-older-wrap,
.load-newer-wrap {
  display: flex;
  justify-content: center;
}

.load-older-wrap { margin: 8px 0 18px; }
.load-newer-wrap { margin: 18px 0 8px; }

.return-latest-wrap {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 28px), var(--max));
  z-index: 25;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

#returnLatest {
  pointer-events: auto;
}

#loadOlder, #loadNewer {
  font-size: 0.82rem;
}

#returnLatest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  flex-shrink: 0;
  border: 1px solid #888;
  background: #ddd;
  cursor: pointer;
  color: #000;
}

#returnLatest:hover {
  background: #bbb;
  border-color: #000;
}

#returnLatest svg {
  width: 16px;
  height: 16px;
}

.load-older-wrap[hidden],
.load-newer-wrap[hidden],
.return-latest-wrap[hidden] {
  display: none;
}

.empty {
  background: var(--paper);
  border: 2px solid #000;
  padding: 18px;
  color: var(--muted);
}

.footer-note {
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #888;
  background: #ddd;
  cursor: pointer;
  color: #000;
}

.icon-btn:hover {
  background: #bbb;
  border-color: #000;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

@media (min-width: 1024px) {
  :root { --max: 500px; }
  .entry-media { width: 40%; }
}

@media (max-width: 720px) {
  html { font-size: 87.5%; }
  .title p { display: none; }
}
