:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #0b1220;
  --border: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent: #10b981;
  --danger: #ef4444;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

.Container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

.TopBar {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.TopBarInner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
  gap: 12px;
}

.Brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.BrandBadge {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.Brand h1 {
  font-size: 1.15rem;
  font-weight: 700;
}

.Brand p {
  font-size: 0.8rem;
  color: var(--muted);
}

.TopActions {
  display: flex;
  gap: 8px;
}

.MainGrid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  padding-top: 20px;
  padding-bottom: 48px;
  align-items: start;
}

@media (max-width: 820px) {
  .MainGrid {
    grid-template-columns: 1fr;
  }
}

.Card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.SectionHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.SectionHeader h2 {
  font-size: 1rem;
}

.StatusPill {
  font-size: 0.75rem;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  font-weight: 600;
}

.CredentialBox {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.CredRow {
  margin-bottom: 10px;
}

.CredLabel {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 3px;
}

.PasswordRow {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.PasswordRow code {
  background: #172033;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  word-break: break-all;
  color: #93c5fd;
  flex: 1;
  min-width: 140px;
}

.HintText {
  font-size: 0.76rem;
  color: var(--muted);
}

.Accordion {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 10px;
}

.Accordion summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: #cbd5e1;
  user-select: none;
}

.StackForm {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.StackForm label span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 4px;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
  font-size: 0.92rem;
}

input:focus,
textarea:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

textarea {
  resize: vertical;
}

.RowActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.Btn {
  border: none;
  border-radius: 9px;
  padding: 9px 15px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.Btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.Btn.Primary {
  background: var(--primary);
  color: #fff;
}
.Btn.Primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.Btn.Secondary {
  background: #334155;
  color: var(--text);
}
.Btn.Secondary:hover:not(:disabled) {
  background: #475569;
}

.Btn.Ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}
.Btn.Ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: #64748b;
}

.Btn.Small {
  padding: 6px 11px;
  font-size: 0.82rem;
}

.Btn.Tiny {
  padding: 4px 8px;
  font-size: 0.75rem;
}

.ComposerCard {
  margin-bottom: 16px;
}

.ComposerFooter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.CharCounter {
  font-size: 0.8rem;
  color: var(--muted);
}

.FeedList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.PostCard {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.PostHeader {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.PostAuthor {
  font-weight: 700;
  color: #60a5fa;
}

.PostAuthor.IsMe::after {
  content: " (Sen)";
  font-weight: 500;
  font-size: 0.78rem;
  color: #34d399;
}

.PostTime {
  font-size: 0.78rem;
  color: var(--muted);
}

.PostBody {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.96rem;
}

.PostActions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid rgba(51, 65, 85, 0.55);
}

.LikeBtn.Liked {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.CommentsBox {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.CommentItem {
  font-size: 0.86rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
  padding-bottom: 6px;
}

.CommentItem:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.CommentAuthor {
  font-weight: 600;
  color: #93c5fd;
  margin-right: 6px;
}

.CommentForm {
  display: flex;
  gap: 6px;
}

.CommentForm input {
  padding: 6px 10px;
  font-size: 0.85rem;
}

.Toast {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #1e3a8a;
  border: 1px solid #3b82f6;
  font-size: 0.88rem;
}

.Toast.Error {
  background: #7f1d1d;
  border-color: #ef4444;
}

.Hidden { display: none !important; }
.EmptyState { text-align: center; color: var(--muted); padding: 28px; }
.SrOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
