:root {
  --color-background: #CADCAE;
  --color-card: #E1E9C9;
  --color-button: #EDA35A;
  --color-button-h: #FEE8D9;
  --color-text: black;
  --color-items: var(--color-background);
  --color-border: #2222;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--color-background); color: var(--color-text);
  height: 100vh; display: flex; justify-content: center; align-items: flex-start; padding: 3px;
}
.container {
  width: 100%; max-width: 900px; display: flex; gap: 5px; height: 100%; background: var(--color-background);
}
#feed-area {
  flex: 1; background: var(--color-card); border: 1px solid var(--color-border);
  display: flex; flex-direction: column; overflow: hidden; height: 100%;
}
#feed-header {
  padding: 1rem; font-weight: bold; font-size: 1.2rem;
  border-bottom: 1px solid var(--color-border); position: sticky; top: 0;
  background: var(--color-card); z-index: 10;
}
#feed-content { flex: 1; overflow-y: auto; padding: 3px; }
#post-composer {
  padding: 1rem; border-bottom: 1px solid var(--color-border);
  display: flex; gap: 0.75rem;
}
.composer-avatar {
  width: 48px; height: 48px; background: var(--color-button); border: 1px solid var(--color-border);
  flex-shrink: 0; overflow: hidden; cursor: pointer;
}
.composer-avatar img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.composer-body { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
#post-text {
  width: 100%; padding: 0.75rem; font-size: 1rem; border: 1px solid var(--color-border);
  background: var(--color-background); color: var(--color-text); resize: none; min-height: 80px; font-family: inherit;
}
#post-image-url {
  width: 100%; padding: 0.5rem; font-size: 0.95rem; border: 1px solid var(--color-border);
  background: var(--color-background); color: var(--color-text); font-family: inherit;
}
.composer-actions { display: flex; justify-content: space-between; align-items: center; }
.composer-tools { display: flex; gap: 0.5rem; align-items: center; }
#post-button {
  padding: 0.5rem 1.25rem; font-size: 1rem; border: 1px solid var(--color-border);
  background: var(--color-button); cursor: pointer; font-weight: 600;
}
#post-button:hover { background: var(--color-button-h); }
.post {
  background: var(--color-background); border: 1px solid var(--color-border);
  margin-bottom: 3px; padding: 1rem; display: flex; gap: 0.75rem;
}
.post:hover { background: var(--color-button-h); }
.post-avatar {
  width: 48px; height: 48px; background: var(--color-button); border: 1px solid var(--color-border);
  flex-shrink: 0; overflow: hidden; cursor: pointer;
}
.post-avatar img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.post-content { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.post-header { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.post-author { font-weight: 600; color: var(--color-text); cursor: pointer; }
.post-author:hover { text-decoration: underline; }
.post-handle { font-size: 0.9rem; color: #666; }
.post-time { font-size: 0.9rem; color: #666; }
.post-text { font-size: 0.95rem; color: var(--color-text); line-height: 1.4; margin-bottom: 0.5rem; }
.post-image {
  width: 100%; max-height: 400px; object-fit: cover; border: 1px solid var(--color-border);
  margin-bottom: 0.5rem; display: block;
}
.post-actions { display: flex; gap: 2rem; margin-top: 0.25rem; }
.action-button {
  display: flex; align-items: center; gap: 0.3rem; padding: 0.4rem 0.6rem; font-size: 0.9rem;
  border: 1px solid var(--color-border); background: var(--color-button); cursor: pointer;
}
.action-button:hover { background: var(--color-button-h); }
.action-button.liked { background: #ff9999; pointer-events: none; }
#settings-button {
  position: fixed; bottom: 1.5rem; right: 1.5rem; width: 48px; height: 48px;
  border: 1px solid var(--color-border); background: var(--color-button); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem; z-index: 100;
}
#settings-button:hover { background: var(--color-button-h); }
.modal {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); justify-content: center; align-items: center; z-index: 200;
}
.modal.active { display: flex; }
.modal-content {
  background: var(--color-card); border: 1px solid var(--color-border); padding: 2rem;
  width: 90%; max-width: 500px; position: relative; max-height: 90vh; overflow-y: auto;
}
.modal-content.wide { max-width: 700px; }
.close-modal {
  position: absolute; top: 0.5rem; right: 1rem; font-size: 1.5rem; cursor: pointer;
  background: none; border: none; color: var(--color-text);
}
#friend-list { list-style: none; margin: 1rem 0; }
#friend-list li {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.5rem; padding: 0.25rem; border: 1px solid var(--color-border);
}
.online-dot { width: 10px; height: 10px; background: #4CAF50; display: inline-block; margin-left: 0.5rem; border: 1px solid var(--color-border); }
.offline-dot { background: #ccc; }
.profile-form { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.add-friend-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.add-friend-row input { flex: 1; padding: 0.5rem; }
.profile-avatar-large {
  width: 80px; height: 80px; background: var(--color-button); border: 1px solid var(--color-border);
  margin-bottom: 0.5rem; overflow: hidden;
}
.profile-avatar-large img { width: 100%; height: 100%; object-fit: cover; display: block; }
input, textarea, button {
  border: 1px solid var(--color-border); background: var(--color-background); color: var(--color-text); font-family: inherit; font-size: 1rem;
}
button { cursor: pointer; background: var(--color-button); }
button:hover { background: var(--color-button-h); }
#save-profile, #add-friend-btn, #copy-id { padding: 0.4rem 0.8rem; }
#profile-view-posts { margin-top: 1rem; }
#profile-view-posts .post { background: var(--color-background); cursor: default; }
@media (max-width: 700px) {
  .container { padding: 0; }
  #feed-area { width: 100%; height: 100dvh; margin: 0; }
  body { padding: 0; }
  .post { padding: 0.75rem; }
  #settings-button { bottom: 1rem; right: 1rem; }
}