.scanline-permalink,
.scanline-tags,
.scanline-mention,
.scanline-join-note {
  color: #000;
}

.scanline-permalink {
  margin-left: 4px;
}

.post-meta time {
  font-weight: bold;
}

.scanline-tags {
  margin: 6px 0;
  font-size: 12px;
}

.scanline-replies {
  margin-left: 28px;
}

.scanline-comment-actions {
  display: flex;
  gap: 6px;
  margin: 4px 0 8px;
}

.scanline-comment-image {
  display: block;
  max-width: 220px;
  margin-top: 6px;
  border: 1px solid #000;
  cursor: zoom-in;
  background: #fff;
}

.scanline-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
}

.scanline-lightbox img {
  max-width: min(920px, 92vw);
  max-height: 90vh;
  background: #fff;
  border: 2px solid #fff;
}

.scanline-bell-panel {
  position: absolute;
  right: 12px;
  top: 40px;
  width: min(320px, 90vw);
  background: #fff;
  border: 2px solid #000;
  box-shadow: 2px 2px #000;
  z-index: 40;
  padding: 8px;
}

.scanline-note-list {
  max-height: 280px;
  overflow: auto;
  margin: 8px 0;
}

.scanline-note {
  display: block;
  color: #000;
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1px solid #000;
}

.scanline-note.unread {
  font-weight: bold;
}

.scanline-settings-form label,
.scanline-comment-file {
  display: block;
  margin: 8px 0;
}

.scanline-target {
  outline: 2px solid #000;
}

/* comment fix 2: force plain links */
.scanline-comment-actions .small-button,
.scanline-comment-actions button {
  background: none !important; border: 0 !important; box-shadow: none !important;
  padding: 0 !important; margin: 0 !important; min-height: 0 !important;
  height: auto !important; width: auto !important; color: #000 !important;
  font: inherit !important; font-size: 13px !important; cursor: pointer;
}
.scanline-comment-actions { display: flex !important; justify-content: flex-start !important; gap: 14px !important; }
.scanline-comment-actions button:hover { text-decoration: underline; }

/* comment fix 3: screenshot layout */
.comment-item { display: block !important; }
.comment-item > .scanline-comment-actions {
  display: flex !important; justify-content: flex-start !important;
  align-items: center !important; gap: 22px !important; margin: 4px 0 10px !important;
}
.scanline-comment-actions button:nth-child(2) { order: -1; color: #666 !important; font-weight: bold !important; }
.scanline-comment-actions button:nth-child(1) { font-size: 14px !important; }
.scanline-add-comment button { color: #666 !important; font-weight: bold !important; }

/* comment fix 4: text sizes */
.comment-item .comment-content > :first-child { font-weight: bold !important; font-size: 13px !important; }
.comment-item .comment-content { font-size: 15px !important; }
.scanline-comment-actions button,
.scanline-comment-actions button:nth-child(1),
.scanline-add-comment button { font-size: 12px !important; }

/* comment fix 5: bold bigger name */
.comment-item .comment-content > strong {
  display: block; font-size: 15px !important; font-weight: bold !important;
  text-shadow: 0.6px 0 0 currentColor, -0.3px 0 0 currentColor; margin-bottom: 2px;
}
.comment-item .comment-content > p { font-size: 14px !important; }

/* comment fix 6: stronger size contrast */
.comment-item .comment-content > strong { font-size: 18px !important; }
.comment-item .comment-content > p { font-size: 17px !important; margin: 2px 0 !important; }
.scanline-comment-actions button,
.scanline-comment-actions button:nth-child(1),
.scanline-comment-actions button:nth-child(2),
.scanline-add-comment button { font-size: 10px !important; }

/* comment fix 7: native comment box via post Comment button */
.scanline-add-comment { display: none !important; }
.scanline-add-comment + form { display: flex !important; }

/* comment fix 8: compact composer */
.scanline-add-comment + form { align-items: center !important; gap: 8px !important; flex-wrap: nowrap !important; }
.scanline-add-comment + form input:not([type=file]),
.scanline-add-comment + form textarea {
  flex: 1 1 auto !important; height: 30px !important; min-height: 0 !important;
  padding: 4px 10px !important; font-size: 14px !important; resize: none !important;
}
.scanline-add-comment + form .scanline-comment-file {
  flex: 0 0 34px !important; width: 34px !important; height: 30px !important;
  margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important;
  font-size: 0 !important; color: transparent !important; cursor: pointer; overflow: hidden;
}
.scanline-add-comment + form .scanline-comment-file::file-selector-button {
  font-size: 20px; border: 0; background: none; cursor: pointer; padding: 0; width: 34px;
  color: transparent; text-shadow: 0 0 0 #000;
}
.scanline-add-comment + form .scanline-comment-file::before { content: "📷"; font-size: 20px; color: #000; }
.scanline-add-comment + form:has(input:placeholder-shown) button,
.scanline-add-comment + form:has(textarea:placeholder-shown) button { display: none !important; }
.scanline-add-comment + form button { height: 30px !important; padding: 0 10px !important; font-size: 12px !important; }

/* comment fix 9: 1-bit pixel camera icon */
.scanline-add-comment + form .scanline-comment-file::before { content: "" !important; }
.scanline-add-comment + form .scanline-comment-file {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath fill='%23000' d='M5 3h5v1H5zM1 4h14v1H1zM1 5h1v8H1zM14 5h1v8h-1zM1 13h14v1H1zM6 6h4v1H6zM5 7h1v4H5zM10 7h1v4h-1zM6 11h4v1H6zM12 6h1v1h-1z'/%3E%3C/svg%3E") center / 20px 20px no-repeat !important;
  image-rendering: pixelated;
}

/* comment fix 10: System 7 square look, 1-bit icons */
#root *, #root *::before, #root *::after, #root *::file-selector-button { border-radius: 0 !important; }
.scanline-add-comment + form .scanline-comment-file {
  text-indent: -9999px !important; border: 1px solid #000 !important; flex-basis: 30px !important; width: 30px !important;
  background-color: #fff !important;
}
.scanline-add-comment + form .scanline-comment-file::file-selector-button { display: none !important; }
.action-button:last-child::before {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath fill='%23000' d='M0 0h11v1H0zM0 1h1v11H0zM11 1h1v11h-1zM1 11h10v1H1zM3 1h6v4H3zM7 2h1v2H7zM2 7h8v4H2z'/%3E%3Cpath fill='%23fff' d='M7 2h1v2H7zM3 8h6v3H3z'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
  image-rendering: pixelated;
}

/* comment fix 11: pixel mail send button */
.scanline-add-comment + form button {
  width: 30px !important; min-width: 30px !important; padding: 0 !important;
  font-size: 0 !important; color: transparent !important; border: 1px solid #000 !important;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 10' shape-rendering='crispEdges'%3E%3Cpath fill='%23000' d='M0 0h14v1H0zM0 9h14v1H0zM0 1h1v8H0zM13 1h1v8h-1zM1 1h1v1H1zM2 2h1v1H2zM3 3h1v1H3zM4 4h1v1H4zM5 5h1v1H5zM6 6h2v1H6zM8 5h1v1H8zM9 4h1v1H9zM10 3h1v1h-1zM11 2h1v1h-1zM12 1h1v1h-1z'/%3E%3C/svg%3E") center / 16px 12px no-repeat !important;
  image-rendering: pixelated; box-shadow: 1px 1px 0 #000 !important;
}

/* comment fix 13: reply popup matches New Post */
.scanline-reply-window { background: #fff !important; border: 2px solid #000 !important; box-shadow: 2px 2px 0 #000 !important; border-radius: 0 !important; }
.scanline-reply-window textarea, .scanline-reply-window input:not([type=file]) {
  background: #fff !important; border: 1px solid #000 !important; box-shadow: none !important;
  border-radius: 0 !important; padding: 8px 12px !important; font-size: 15px !important;
}
.scanline-reply-actions button, .scanline-reply-window button {
  background: #000 !important; color: #fff !important; border: 0 !important; border-radius: 0 !important;
  box-shadow: 2px 2px 0 #888 !important; padding: 8px 14px !important; font-size: 12px !important; cursor: pointer;
}

/* comment fix 14: gray popup + camera in popup */
.scanline-reply-overlay .scanline-reply-window { background: #ddd !important; }
.scanline-reply-overlay input[type=file] {
  width: 30px !important; max-width: 30px !important; height: 30px !important; flex: 0 0 30px !important;
  padding: 0 !important; text-indent: -9999px !important; color: transparent !important; font-size: 0 !important;
  overflow: hidden !important; cursor: pointer; border: 1px solid #000 !important; border-radius: 0 !important;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath fill='%23000' d='M5 3h5v1H5zM1 4h14v1H1zM1 5h1v8H1zM14 5h1v8h-1zM1 13h14v1H1zM6 6h4v1H6zM5 7h1v4H5zM10 7h1v4h-1zM6 11h4v1H6zM12 6h1v1h-1z'/%3E%3C/svg%3E") center / 20px 20px no-repeat !important;
  image-rendering: pixelated;
}
.scanline-reply-overlay input[type=file]::file-selector-button { display: none !important; }
.scanline-reply-overlay input[type=file]::-webkit-file-upload-button { display: none !important; }

/* upload progress bar */
.scanline-upload-bar { height: 8px; border: 1px solid #000; background: #fff; margin: 8px 0 4px; }
.scanline-upload-bar > div { height: 100%; width: 0; background: #000; }

/* attached-photo preview */
.scanline-attach-preview { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-basis: 100%; font-size: 12px; }
.scanline-attach-preview img { width: 40px; height: 40px; object-fit: cover; border: 1px solid #000; background: #fff; }
.scanline-attach-preview button { all: unset; cursor: pointer; border: 1px solid #000; background: #fff; width: 18px; height: 18px; text-align: center; line-height: 18px; font-size: 11px; }
.scanline-add-comment + form { flex-wrap: wrap !important; }
input[type=file].has-file { background-color: #000 !important; filter: invert(1); }

/* attached-photo preview restyle */
input[type=file].has-file { filter: none !important; background-color: #fff !important; border: 2px solid #000 !important; box-shadow: 1px 1px 0 #000 !important; }
.scanline-reply-window form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.scanline-reply-window form > textarea, .scanline-reply-window form > input:not([type=file]),
.scanline-reply-window .scanline-reply-actions, .scanline-reply-window form > p { flex-basis: 100%; }
.scanline-attach-preview { flex-basis: auto !important; margin: 0 !important; gap: 6px !important; }
.scanline-attach-preview img { width: 28px !important; height: 28px !important; }
.scanline-attach-preview span { font-size: 11px; }
.scanline-attach-preview button,
.scanline-reply-window .scanline-attach-preview button {
  all: unset !important; cursor: pointer !important; width: 14px !important; height: 14px !important;
  border: 1px solid #000 !important; background: #fff !important; color: #000 !important;
  font-size: 9px !important; line-height: 14px !important; text-align: center !important; box-shadow: none !important;
}

/* popup alignment fix */
.scanline-reply-window form { justify-content: flex-start !important; text-align: left !important; }
.scanline-reply-window .scanline-reply-actions { display: flex !important; justify-content: flex-end !important; gap: 8px !important; }
.scanline-reply-window input[type=file], .scanline-attach-preview { margin-left: 0 !important; margin-right: 0 !important; }

/* popup: back to original layout, preview replaces camera */
.scanline-reply-window form { display: block !important; text-align: left !important; }
.scanline-reply-window form > * { flex-basis: auto !important; }
.scanline-reply-window input[type=file] { display: block !important; margin: 8px 0 !important; }
.scanline-reply-window input[type=file].has-file { display: none !important; }
.scanline-reply-window .scanline-attach-preview { display: flex !important; justify-content: flex-start !important; margin: 8px 0 !important; }
.scanline-reply-window .scanline-reply-actions { display: flex !important; justify-content: flex-end !important; gap: 8px !important; }

/* live new-posts bar */
.scanline-new-posts { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 9999; background: #fff; color: #000; border: 2px solid #000; box-shadow: 2px 2px 0 #000; border-radius: 0; padding: 6px 14px; font: inherit; font-size: 12px; cursor: pointer; }

/* System 7 loading ball */
.scanline-loading { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; background: #fff; }
.scanline-loading span { width: 32px; height: 32px; border: 2px solid #000; border-radius: 50% !important; background: conic-gradient(#000 0 25%, #fff 0 50%, #000 0 75%, #fff 0); animation: scanline-spin 0.6s steps(8) infinite; image-rendering: pixelated; }
@keyframes scanline-spin { to { transform: rotate(360deg); } }

/* loading ball as overlay, not white screen */
.scanline-loading { background: transparent !important; pointer-events: none; }
.scanline-loading span { box-shadow: 0 0 0 10px #fff, 0 0 0 12px #000, 3px 3px 0 12px #000; }

/* loading ball: small, no shadow */
.scanline-loading span { width: 18px !important; height: 18px !important; border-width: 1px !important; box-shadow: none !important; }

/* loading: rotating square */
.scanline-loading span { border-radius: 0 !important; width: 14px !important; height: 14px !important; background: conic-gradient(#000 0 25%, #fff 0 50%, #000 0 75%, #fff 0) !important; }

/* mobile-safe spinning square */
.scanline-loading span { background: #fff !important; border: 3px solid #000 !important; border-top-color: #fff !important; border-bottom-color: #fff !important; will-change: transform; -webkit-animation: scanline-spin2 0.8s steps(8) infinite !important; animation: scanline-spin2 0.8s steps(8) infinite !important; }
@-webkit-keyframes scanline-spin2 { from { -webkit-transform: rotate(0deg); } to { -webkit-transform: rotate(360deg); } }
@keyframes scanline-spin2 { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* true 4-quadrant checker */
.scanline-loading span { background-color: #fff !important; background-image: linear-gradient(#000, #000), linear-gradient(#000, #000) !important; background-size: 50% 50% !important; background-position: 0 0, 100% 100% !important; background-repeat: no-repeat !important; border: 1px solid #000 !important; }

/* notifications as pixel envelope + count */
.scanline-bell-dark { display: inline-flex !important; align-items: center !important; gap: 4px !important; min-width: 34px !important; padding: 4px 8px !important; font-size: 11px !important; }
.scanline-bell-dark::before { content: ""; width: 16px; height: 12px; display: inline-block; image-rendering: pixelated; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 12' shape-rendering='crispEdges'%3E%3Cpath fill='%23fff' d='M0 0h16v12H0z'/%3E%3Cpath fill='%23000' d='M1 1h14v10H1z'/%3E%3Cpath fill='%23fff' d='M2 2h1v1H2zM3 3h1v1H3zM4 4h1v1H4zM5 5h1v1H5zM6 6h1v1H6zM7 7h2v1H7zM9 6h1v1H9zM10 5h1v1h-1zM11 4h1v1h-1zM12 3h1v1h-1zM13 2h1v1h-1z'/%3E%3C/svg%3E") no-repeat center / 16px 12px; }
.scanline-bell-dark.has-unread { padding-right: 6px !important; }
.scanline-bell-dark:not(.has-unread) { gap: 0 !important; }

/* envelope + number, no box */
.scanline-bell-dark { background: transparent !important; color: #000 !important; border: 0 !important; box-shadow: none !important; padding: 2px 4px !important; font-size: 13px !important; }
.scanline-bell-dark::before { width: 20px !important; height: 15px !important; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 12' shape-rendering='crispEdges'%3E%3Cpath fill='%23000' d='M0 0h16v12H0z'/%3E%3Cpath fill='%23fff' d='M1 1h14v10H1z'/%3E%3Cpath fill='%23000' d='M2 2h1v1H2zM3 3h1v1H3zM4 4h1v1H4zM5 5h1v1H5zM6 6h1v1H6zM7 7h2v1H7zM9 6h1v1H9zM10 5h1v1h-1zM11 4h1v1h-1zM12 3h1v1h-1zM13 2h1v1h-1z'/%3E%3C/svg%3E") no-repeat center / 20px 15px !important; }

/* notifications: envelope + number, no box */
#root .scanline-bell, .scanline-bell.logout-button { display: inline-flex !important; align-items: center !important; gap: 4px !important; background: transparent !important; color: #000 !important; border: 0 !important; box-shadow: none !important; padding: 2px 4px !important; font-size: 13px !important; min-width: 0 !important; }
.scanline-bell::before { content: ""; width: 20px; height: 15px; display: inline-block; image-rendering: pixelated; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 12' shape-rendering='crispEdges'%3E%3Cpath fill='%23000' d='M0 0h16v12H0z'/%3E%3Cpath fill='%23fff' d='M1 1h14v10H1z'/%3E%3Cpath fill='%23000' d='M2 2h1v1H2zM3 3h1v1H3zM4 4h1v1H4zM5 5h1v1H5zM6 6h1v1H6zM7 7h2v1H7zM9 6h1v1H9zM10 5h1v1h-1zM11 4h1v1h-1zM12 3h1v1h-1zM13 2h1v1h-1z'/%3E%3C/svg%3E") no-repeat center / 20px 15px; }

/* push alerts button */
.scanline-push-btn { background: #000 !important; color: #fff !important; border: 1px solid #000 !important; border-radius: 0 !important; font: inherit; font-size: 11px !important; padding: 4px 8px !important; margin-left: 6px; cursor: pointer; }

/* keep cached feed sized like the real feed */
#scanline-feed-cache { max-width: 100%; overflow: hidden; }
#scanline-feed-cache img, #scanline-feed-cache video { max-width: 100% !important; height: auto !important; }
#scanline-feed-cache .post { max-width: 100%; box-sizing: border-box; }
.scanline-loading span { width: 14px !important; height: 14px !important; max-width: 14px !important; max-height: 14px !important; }

/* share icon: pixel paper airplane */
.scanline-share::before { width: 14px !important; height: 12px !important; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 12' shape-rendering='crispEdges'%3E%3Cpath fill='%23000' d='M12 0h2v1h-2zM10 1h2v1h-2zM8 2h2v1H8zM6 3h2v1H6zM4 4h2v1H4zM2 5h2v1H2zM0 6h2v1H0zM2 7h4v1H2zM13 1h1v2h-1zM12 3h1v2h-1zM11 5h1v2h-1zM10 7h1v2h-1zM9 9h1v2H9zM6 8h1v1H6zM7 9h1v1H7zM8 10h1v1H8zM5 8h1v3H5zM9 4h1v1H9zM8 5h1v1H8zM7 6h1v1H7z'/%3E%3C/svg%3E") no-repeat center / 14px 12px !important; }

/* floppy stays on Save when Share is added */
.action-button:nth-last-child(2):not(.scanline-share)::before {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath fill='%23000' d='M0 0h11v1H0zM0 1h1v11H0zM11 1h1v11h-1zM1 11h10v1H1zM3 1h6v4H3zM7 2h1v2H7zM2 7h8v4H2z'/%3E%3Cpath fill='%23fff' d='M7 2h1v2H7zM3 8h6v3H3z'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
  image-rendering: pixelated;
}

.scanline-welcome { background:#fff; border:2px solid #000; padding:12px 16px; margin-bottom:16px; }
.scanline-welcome h2 { margin:0 0 6px; font-size:20px; }
.scanline-welcome p { margin:0; }

/* shared post page */
body.scanline-shared #scanline-public, body.scanline-shared .scanline-welcome { display: none !important; }
#scanline-share-page .scanline-join-row { text-align: center; padding: 16px 0 8px; }
body.scanline-shared.scanline-show-login #root > .auth-page { display: flex !important; position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.35); align-items: center; justify-content: center; }
body.scanline-shared.scanline-show-login #root > .auth-page .auth-card { background: #fff; border: 2px solid #000; padding: 20px; max-width: 420px; }

/* shared page: login hidden until Join, then centered under the post */
body.scanline-shared .auth-page { display: none !important; }
body.scanline-shared.scanline-show-login .auth-page { display: flex !important; position: static !important; background: none !important; justify-content: center; padding: 16px 0 40px; }
body.scanline-shared.scanline-show-login .auth-page .auth-card { background: #fff; border: 2px solid #000; padding: 20px; max-width: 520px; width: 100%; }
body.scanline-shared #root { display: flex; flex-direction: column; }
body.scanline-shared #scanline-share-page { order: 1; }

/* shared page: login hidden until Join, then centered under the post */
body.scanline-shared .auth-page { display: none !important; }
body.scanline-shared.scanline-show-login .auth-page { display: flex !important; position: static !important; background: none !important; justify-content: center; padding: 16px 0 40px; }
body.scanline-shared.scanline-show-login .auth-page .auth-card { background: #fff; border: 2px solid #000; padding: 20px; max-width: 520px; width: 100%; }
body.scanline-shared #root { display: flex; flex-direction: column; }
body.scanline-shared #scanline-share-page { order: 1; }

/* fix: keep login hidden until Join */
body.scanline-shared #root > div.auth-page { display: none !important; }
body.scanline-shared.scanline-show-login #root > div.auth-page { display: flex !important; order: 2; }
