:root {
  --bg: #090b12;
  --card: #121725;
  --text: #e7ecff;
  --muted: #a5b0d1;
  --accent: #56f8cc;
  --warn: #ff4a4a;
  --gold: #ffcb52;
}

html[data-theme="light"] {
  --bg: #f8f8fb;
  --card: #ffffff;
  --text: #14141d;
  --muted: #50556a;
  --accent: #1c9675;
  --warn: #d7263d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  min-height: 100vh;
}

.header {
  position: fixed;
  top: 0;
  width: 100%;
  height: 11vh;
  background: rgba(10, 12, 18, 0.95);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2vh 2vh;
  z-index: 20;
  border-bottom: 0.15vh solid #262c44;
}
.logo { color: var(--text); text-decoration: none; display: flex; flex-direction: column; position: relative; padding-left: 6vh; min-height: 5.5vh; justify-content: center; }
.brand-logo {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5vh;
  height: 5vh;
  border-radius: 1vh;
  object-fit: cover;
}
.logo-main { font-size: 2.8vh; font-weight: 700; }
.logo-sub { font-size: 1.7vh; color: var(--muted); }
.header-actions { display: flex; gap: 1vh; }
.icon-btn {
  width: 5.2vh; height: 5.2vh;
  border-radius: 1.2vh; border: 0.1vh solid #3a4160;
  background: var(--card); color: var(--text); cursor: pointer;
}
.icon-btn img {
  width: 3.2vh;
  height: 3.2vh;
  object-fit: contain;
  border-radius: 0.6vh;
}

.network-switch {
  margin-top: 12vh;
  display: flex;
  justify-content: center;
  gap: 2vh;
}
.network-btn {
  width: 17vh; height: 13vh;
  border: 0.2vh solid #34406b;
  background: var(--card);
  color: var(--text);
  border-radius: 1.5vh;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5vh;
}
.network-btn img { width: 6vh; height: 6vh; object-fit: contain; }
.network-btn.active { box-shadow: 0 0 1.6vh #4af7c0; border-color: #4af7c0; }

.app-shell { display: flex; justify-content: center; padding: 2vh 1vh 4vh; }
.feed-container { width: 100%; max-width: 50vh; }
.sender-card, .feed-card {
  background: var(--card);
  border-radius: 1.6vh;
  padding: 2vh;
  margin-bottom: 1.5vh;
  box-shadow: 0 1vh 2vh rgba(0, 0, 0, 0.35);
}
.section-title { margin-top: 0; font-size: 2.3vh; }
label { display: block; font-size: 1.6vh; color: var(--muted); margin-top: 1.2vh; margin-bottom: 0.4vh; }
input, textarea {
  width: 100%;
  border: 0.1vh solid #3c466d;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  padding: 1.2vh;
  border-radius: 1vh;
  font-size: 1.7vh;
}
.warning-box {
  margin-top: 1vh;
  border: 0.2vh solid var(--warn);
  color: #ffd9d9;
  font-size: 1.6vh;
  padding: 1.2vh;
  border-radius: 1vh;
}
.send-btn {
  width: 100%;
  margin-top: 1.8vh;
  height: 6.5vh;
  border-radius: 1.2vh;
  border: 0;
  background: linear-gradient(90deg, #31d6ff, #56f8cc);
  color: #001315;
  font-weight: 700;
  font-size: 2vh;
  cursor: pointer;
}
.send-result { margin-top: 1vh; font-size: 1.6vh; color: var(--muted); word-break: break-word; }
.hidden { display: none; }

.feed-list { margin-top: 1vh; }
.feed-card { display: flex; gap: 1.4vh; transition: transform 0.12s ease; }
.feed-card:hover { transform: translateY(-0.2vh); }
.avatar {
  width: 8vh; height: 8vh; border-radius: 50%;
  background: linear-gradient(120deg, #596eff, #00d8c0);
  display: grid; place-items: center; font-weight: 700; font-size: 2.6vh;
}
.feed-content { flex: 1; min-width: 0; }
.meta-row { display: flex; justify-content: space-between; align-items: center; font-size: 1.5vh; margin-bottom: 0.6vh; gap: 1vh; }
.meta-row a { color: var(--accent); text-decoration: none; }
.meta-author {
  display: inline-flex;
  align-items: center;
  gap: 0.35vh;
  min-width: 0;
  flex: 1;
}
.meta-author-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 22vh;
}
.server-star {
  flex-shrink: 0;
  color: var(--gold);
  font-size: 1.6vh;
  line-height: 1;
  cursor: default;
  user-select: none;
}
.timestamp { color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.meta-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5vh;
  flex-shrink: 0;
}
.tx-inspect-btn {
  border: 0;
  background: transparent;
  padding: 0.2vh 0.35vh;
  font-size: 1.8vh;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}
.tx-inspect-btn:hover { opacity: 1; }
.reply-btn {
  border: 0.1vh solid #4a587f;
  background: transparent;
  color: var(--muted);
  border-radius: 0.7vh;
  font-size: 1.25vh;
  padding: 0.25vh 0.55vh;
  cursor: pointer;
}
.reply-btn:hover { color: var(--text); border-color: var(--accent); }
.payload { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 1.8vh; }
.media { width: 100%; margin-top: 1vh; border-radius: 1vh; max-height: 35vh; object-fit: cover; }
.reply-pill {
  display: inline-block;
  font-size: 1.3vh;
  color: #b4f0ff;
  border: 0.1vh solid #40627d;
  padding: 0.35vh 0.75vh;
  border-radius: 0.8vh;
  margin-bottom: 0.7vh;
}
.link-actions { margin-top: 1vh; display: flex; gap: 0.7vh; flex-wrap: wrap; }
.view-link-btn {
  border: 0.1vh solid #4a587f;
  background: transparent;
  color: var(--text);
  border-radius: 0.8vh;
  font-size: 1.4vh;
  padding: 0.6vh 1vh;
  cursor: pointer;
}
.thread-indent { margin-left: 5vh; border-left: 0.2vh solid #2a3556; padding-left: 1vh; }
.server-signed { border: 0.12vh solid rgba(255, 203, 82, 0.45); }
.reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1vh;
  margin-top: 0.8vh;
  padding: 0.9vh 1vh;
  border-radius: 1vh;
  border: 0.1vh solid #40627d;
  background: rgba(86, 248, 204, 0.06);
  font-size: 1.5vh;
  color: var(--muted);
}
.reply-bar button {
  border: 0.1vh solid #4a587f;
  background: transparent;
  color: var(--text);
  border-radius: 0.7vh;
  padding: 0.4vh 0.8vh;
  cursor: pointer;
  font-size: 1.4vh;
}
.feed-status { text-align: center; color: var(--muted); font-size: 1.5vh; padding: 1vh; }
