:root {
  --bg: #fff;
  --fg: #000;
  --nav-offset: 39px;
  --post-scroll-offset: 39px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  background: var(--bg);
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.view-toggle {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
}

.view-toggle-left,
.view-toggle-right,
.show-menu {
  pointer-events: auto;
}

.view-toggle-left,
.view-toggle-right {
  display: flex;
  gap: 0;
  align-items: flex-start;
}

.toggle-button,
.show-menu-option,
.post-action,
.filebtn {
  appearance: none;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 13px;
  line-height: normal;
  min-height: var(--nav-offset);
  padding: 10px 14px;
  border-radius: 0;
  cursor: pointer;
  margin-right: -1px;
  text-decoration: none;
}

.toggle-button.on,
.toggle-button.is-active,
.show-menu-option.on,
.post-action.on {
  background: #000;
  color: #fff;
}

@media (hover: hover) and (pointer: fine) {
  .toggle-button:not(.on):not(.is-active):hover,
  .show-menu-option:not(.on):hover,
  .post-action:hover,
  .filebtn:hover {
    background: #d9d9d9;
    color: #000;
  }
}

#auth-state {
  display: inline-flex;
  align-items: center;
  min-height: var(--nav-offset);
  padding: 0 10px;
  border: 1px solid #000;
  border-left: 0;
  border-right: 0;
  background: #fff;
  color: #000;
  font-size: 13px;
}

#auth-state:empty {
  display: none;
}

.show-menu {
  position: relative;
}

.show-menu summary {
  list-style: none;
}

.show-menu summary::-webkit-details-marker {
  display: none;
}

.show-menu-panel {
  position: absolute;
  top: calc(100% - 1px);
  right: 0;
  display: grid;
  min-width: 192px;
}

.show-menu-option {
  display: block;
  border-top: 0;
  text-align: left;
  margin-right: 0;
}

.story-feed {
  width: 100%;
  overflow-x: hidden;
  padding-top: var(--nav-offset);
}

.feed-standby {
  min-height: calc(100svh - var(--nav-offset));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-size: 13px;
  line-height: 1;
  text-transform: lowercase;
}

.post {
  min-height: 100svh;
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  scroll-margin-top: var(--post-scroll-offset);
}

.post-inner {
  min-height: 100svh;
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.post-content {
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: hidden;
}

.panel {
  width: 100%;
  min-height: 100svh;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.panel.text {
  display: block;
  padding: 1.1vw 1.4vw 1.5vw 1.2vw;
  background: #fff;
  color: #000;
}

.panel.text p {
  margin: 0;
  width: 100%;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(70px, 10.7vw, 212px);
  line-height: 0.94;
  letter-spacing: 0.01em;
  font-weight: 400;
  text-wrap: balance;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

.panel.text.panel-text-size-small p {
  font-size: clamp(56px, 8.8vw, 170px);
}

.panel.text.panel-text-size-large p {
  font-size: clamp(88px, 13.4vw, 265px);
}

.panel.inverse {
  background: #000;
  color: #fff;
}

.panel.image {
  position: relative;
  padding: 0;
  background: #000;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

.panel.image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  display: block;
  opacity: 0;
}

.panel.image img.is-loaded {
  opacity: 1;
}

.panel.audio {
  background: #e1e1e1;
  color: #000;
  align-items: center;
  justify-content: center;
  min-height: clamp(360px, 56svh, 720px);
  padding: 0;
  overflow: hidden;
}

.audio-shell {
  width: 100%;
  padding: 26px 5.4vw;
  display: grid;
  gap: 20px;
  overflow: hidden;
}

.audio-label {
  font-size: 20px;
  line-height: 1.02;
  text-transform: lowercase;
  word-break: break-word;
  max-width: min(60vw, 980px);
  width: 100%;
  justify-self: center;
}

.audio-ui {
  width: min(60vw, 980px);
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  padding: 26px 30px;
  border: 1px solid #000;
  background: #fff;
  justify-self: center;
}

.audio-ui audio {
  width: 100%;
}

.post-footer {
  border-bottom: 1px solid #000;
  padding: 16px 1.2vw 22px;
  display: grid;
  gap: 18px;
}

.post-head {
  display: none;
}

.post-meta {
  font-size: clamp(14px, 1.55vw, 22px);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.post-meta a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

.post-actions,
.post-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 4px;
  align-items: center;
}

.post-action,
.post-foot button {
  min-height: auto;
  font-size: 12px;
  padding: 8px 11px;
}

.post-foot .score {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  border: 1px solid #000;
  border-left: 0;
  padding: 0 10px;
  font-size: 12px;
}

.actions {
  display: inline-flex;
  gap: 0;
}

body[data-view="grid"] {
  overflow-y: auto;
}

body[data-view="grid"] .story-feed {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: var(--nav-offset);
}

body[data-view="grid"] .post,
body[data-view="grid"] .post-inner {
  min-height: auto;
}

body[data-view="grid"] .post {
  cursor: pointer;
  overflow: hidden;
}

body[data-view="grid"] .post-inner,
body[data-view="grid"] .post-content {
  height: 33vw;
  min-height: 33vw;
}

body[data-view="grid"] .panel {
  height: 33vw;
  min-height: 33vw;
  overflow: hidden;
}

body[data-view="grid"] .panel.text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

body[data-view="grid"] .panel.text p {
  font-size: clamp(19px, 2vw, 39px);
  line-height: 0.985;
  text-align: center;
}

body[data-view="grid"] .panel.text.panel-text-size-small p {
  font-size: clamp(16px, 1.65vw, 32px);
}

body[data-view="grid"] .panel.text.panel-text-size-large p {
  font-size: clamp(24px, 2.45vw, 48px);
}

body[data-view="grid"] .panel.image img {
  height: 100%;
  min-height: 0;
}

body[data-view="grid"] .panel.audio,
body[data-view="grid"] .audio-shell {
  height: 33vw;
  min-height: 33vw;
}

body[data-view="grid"] .audio-shell {
  padding: 18px;
  gap: 14px;
  align-content: center;
}

body[data-view="grid"] .audio-label {
  max-width: none;
  font-size: 12px;
}

body[data-view="grid"] .audio-ui {
  width: 100%;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px;
}

body[data-view="grid"] .post-footer {
  display: none;
}

.composer,
.modal-card {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 40;
  width: min(520px, 100vw);
  background: rgba(255, 255, 255, 0.96);
  border-left: 1px solid #000;
  backdrop-filter: blur(14px);
  padding: 14px;
  display: grid;
  gap: 14px;
  align-content: start;
}

#modal .modal-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  max-height: 100vh;
  overflow: hidden;
  align-content: stretch;
}

.modal-toolbar {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #000;
}

#modal #modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  -webkit-overflow-scrolling: touch;
}

.composer {
  top: var(--nav-offset);
}

.composer input,
.composer textarea,
.modal-card input,
.modal-card textarea {
  width: 100%;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  color: #000;
  padding: 10px;
  font: inherit;
  font-size: 13px;
}

.composer-row,
.modal-card .tabs,
.modal-card .detail-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.composer-row #p-submit {
  margin-left: auto;
}

.filebtn {
  display: inline-block;
  min-height: auto;
}

.filebtn input {
  display: none;
}

.filebtn.has {
  background: #000;
  color: #fff;
}

.hint,
#composer-status,
.modal-card .err,
.modal-card .score {
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(255, 255, 255, 0.1);
}

.modal-x {
  appearance: none;
  box-sizing: border-box;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  border-radius: 0;
  font: inherit;
  font-size: 17px;
  font-weight: 300;
  line-height: 1;
  min-height: var(--nav-offset);
  padding: 0 12px;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (hover: hover) and (pointer: fine) {
  #modal .modal-x:hover {
    background: #d9d9d9;
    color: #000;
  }
}

.modal-card h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
}

.auth-modal {
  display: grid;
  gap: 18px;
  padding-top: 3px;
}

.auth-modal h3 {
  margin: 0;
  font-size: clamp(34px, 7vw, 62px);
  line-height: 0.9;
  letter-spacing: -0.035em;
  font-weight: 400;
}

.auth-note {
  margin: 0 0 2px 0;
  max-width: 28ch;
  font-size: 13px;
  line-height: 1.15;
  text-transform: lowercase;
}

.auth-modal .tabs {
  margin-top: 2px;
}

.modal-card .auth-modal form {
  gap: 16px;
  padding-top: 2px;
}

.auth-modal .row label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  line-height: 1;
  text-transform: lowercase;
}

.auth-modal .err:not(:empty) {
  padding: 10px;
  border: 1px solid #000;
  background: #000;
  color: #fff;
}

.auth-modal #auth-submit {
  justify-self: start;
  min-width: 112px;
}

.modal-card .row,
.modal-card form {
  display: grid;
  gap: 10px;
}

.modal-card figure {
  margin: 0;
}

.modal-card .detail-meta {
  margin-bottom: 12px;
  padding-right: 0;
  font-size: 13px;
  line-height: 1.1;
  text-transform: lowercase;
}

.modal-card .detail-name {
  margin: 0 0 14px 0;
  font-size: clamp(24px, 5vw, 44px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  font-weight: 400;
}

.detail-body {
  margin: 0 0 18px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(28px, 5.6vw, 68px);
  line-height: 0.96;
  letter-spacing: 0.01em;
  font-weight: 400;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-image {
  margin: 0 0 16px;
  border: 1px solid #000;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: min(64vh, 540px);
  min-height: 100px;
  overflow: hidden;
  box-sizing: border-box;
}

.detail-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-audio {
  margin: 0 0 16px;
  border: 1px solid #000;
  background: #e1e1e1;
  padding: 18px;
}

.detail-audio audio {
  width: 100%;
  display: block;
}

.modal-card .detail-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #000;
  align-items: center;
}

.modal-card .detail-foot button,
.modal-card .detail-actions button,
.modal-card .tabs button,
.modal-card form button {
  appearance: none;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  border-radius: 0;
  font: inherit;
  font-size: 12px;
  padding: 8px 11px;
  cursor: pointer;
  margin-right: -1px;
}

.modal-card .detail-foot button.on,
.modal-card .tabs button.on,
.modal-card .detail-foot button:hover,
.modal-card .detail-actions button:hover,
.modal-card .tabs button:hover,
.modal-card form button:hover {
  background: #000;
  color: #fff;
}

.modal-card .detail-foot .score {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  border: 1px solid #000;
  border-left: 0;
  padding: 0 10px;
}

.modal-card .detail-actions {
  display: inline-flex;
  gap: 0;
  margin-left: auto;
}

@media (max-width: 820px) {
  .view-toggle {
    gap: 0;
  }

  .toggle-button,
  .show-menu-option {
    font-size: 12px;
    padding: 9px 10px;
  }

  body[data-view="grid"] .story-feed {
    grid-template-columns: 1fr 1fr;
  }

  body[data-view="grid"] .panel,
  body[data-view="grid"] .post-inner,
  body[data-view="grid"] .post-content,
  body[data-view="grid"] .panel.image img,
  body[data-view="grid"] .panel.audio,
  body[data-view="grid"] .audio-shell {
    height: 50vw;
    min-height: 50vw;
  }

  .post-footer {
    padding: 16px 10px 22px;
  }

  .post-meta {
    font-size: clamp(12px, 3.4vw, 19px);
  }
}

@media (max-width: 480px) {
  .view-toggle {
    flex-wrap: wrap;
  }

  .view-toggle-left {
    flex-wrap: wrap;
    width: 100%;
    order: 2;
  }

  .view-toggle-right {
    order: 1;
    margin-bottom: 8px;
  }

  .toggle-button,
  .show-menu-option {
    font-size: 11px;
    padding: 8px 10px;
  }

  body[data-view="grid"] .story-feed {
    grid-template-columns: 1fr;
  }

  body[data-view="grid"] .panel,
  body[data-view="grid"] .post-inner,
  body[data-view="grid"] .post-content,
  body[data-view="grid"] .panel.image img,
  body[data-view="grid"] .panel.audio,
  body[data-view="grid"] .audio-shell {
    height: 100vw;
    min-height: 100vw;
  }

  .composer,
  .modal-card {
    width: 100vw;
    max-width: 100vw;
  }

  .audio-ui {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}
