:root {
  color-scheme: light;
  --primary: #1c1c1e;
  --secondary: #3c3c43;
  --tertiary: #6d6d72;
  --disabled: #aeaeb2;
  --light-fill: #f5f5f5;
  --background: #ffffff;
  --page-inset: 16px;
  --header-height: 44px;
  --glyph-control: 44px;
  --radius: 12px;
  --border: 1px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  min-height: 100%;
  margin: 0;
  background: var(--background);
  color: var(--secondary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Noto Sans JP", "Noto Sans", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 400;
  -webkit-text-size-adjust: 100%;
}

body { min-height: 100svh; }
button, select, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app {
  position: relative;
  width: min(100%, 430px);
  min-height: 100svh;
  margin: 0 auto;
  background: var(--background);
  overflow: hidden;
}

.header {
  height: calc(var(--header-height) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--page-inset) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--background);
}

.wordmark {
  color: var(--tertiary);
  font-size: 17px;
  line-height: var(--glyph-control);
}

.language-controls { display: flex; gap: 8px; }

.glyph-button {
  width: var(--glyph-control);
  height: var(--glyph-control);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tertiary);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}

.status {
  min-height: calc(100svh - var(--header-height) - env(safe-area-inset-top));
  padding: var(--page-inset);
  display: grid;
  place-items: center;
  color: var(--secondary);
  text-align: center;
  line-height: 1.4;
}

.status:empty { display: none; }

.thread {
  height: calc(100svh - var(--header-height) - env(safe-area-inset-top));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--page-inset) var(--page-inset) calc(84px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}

.thread::-webkit-scrollbar { display: none; }
.post, .reply { display: block; }
.post { padding-bottom: 8px; border-bottom: var(--border) solid var(--disabled); }
.replies { padding-top: 24px; }

.media {
  display: block;
  width: 100%;
  max-height: min(70svh, 720px);
  margin: 0 auto 16px;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--light-fill);
}

.author, .time {
  margin: 0;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 400;
}

.author {
  color: var(--tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time {
  min-height: var(--glyph-control);
  display: flex;
  align-items: center;
  color: var(--disabled);
}

.content-row {
  margin: 16px 0 0;
  color: var(--secondary);
  font-size: 17px;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.reply { padding-bottom: 16px; }

.reply.nested {
  position: relative;
  padding-left: 16px;
}

.reply.nested::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 16px;
  width: 1px;
  background: var(--disabled);
}

.mention {
  margin-right: 4px;
  color: var(--tertiary);
  font-size: 13px;
}

.pager {
  position: fixed;
  z-index: 10;
  right: max(var(--page-inset), calc((100vw - 430px) / 2 + var(--page-inset)));
  bottom: calc(var(--page-inset) + env(safe-area-inset-bottom));
  width: 97px;
  height: var(--glyph-control);
  display: grid;
  grid-template-columns: 44px 1px 44px;
  gap: 4px;
  align-items: center;
  border: var(--border) solid var(--tertiary);
  border-radius: var(--radius);
  background: var(--background);
}

.pager-button {
  width: var(--glyph-control);
  height: var(--glyph-control);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--secondary);
  font-size: 28px;
  line-height: 1;
  font-weight: 300;
  cursor: pointer;
}

.pager-button:disabled { color: var(--disabled); cursor: default; }
.pager-divider { width: 1px; height: 24px; background: var(--tertiary); }

noscript {
  display: block;
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 16px;
  font-size: 17px;
}

@media (min-width: 431px) {
  body { background: #f5f5f5; }
  .app { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
