/* ============================================
   SANDWICHEDIN - Corporate Blue Edition
   The opposite of everything else on this site.
   Every rounded corner here was a compromise.
   ============================================ */

:root {
  color-scheme: light;
  --blue: #0a66c2;
  --blue-dark: #004182;
  --blue-wash: #edf3f8;
  --page: #f4f2ee;
  --card: #ffffff;
  --ink: #1f1f1f;
  --muted: #666666;
  --line: #e0dfdc;
  --gold: #e7a33e;
  --red: #cc1016;
}

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

body {
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

ul {
  list-style: none;
}

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 12px 0;
}

h2 {
  font-size: 16px;
  font-weight: 600;
}

a {
  color: var(--blue);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 10px;
}

/* === TOP BAR === */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.5px;
  color: var(--blue);
}

.logo-tile {
  background: var(--blue);
  color: #ffffff;
  border-radius: 3px;
  padding: 0 4px;
  font-size: 18px;
}

.search {
  background: var(--blue-wash);
  border-radius: 4px;
  padding: 7px 10px;
  width: 240px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}

/* === LAYOUT === */
.layout {
  max-width: 940px;
  margin: 0 auto;
  padding: 20px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

/* === COMPOSER === */
.composer {
  padding: 12px 16px;
}

.composer-top {
  display: flex;
  gap: 10px;
}

.composer-field {
  flex: 1;
  min-width: 0;
}

.composer-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.composer textarea {
  width: 100%;
  height: 64px;
  border: 1px solid #8c8c89;
  border-radius: 12px;
  padding: 9px 12px;
  font: inherit;
  resize: none;
}

.composer-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.composer-options label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.composer select {
  display: block;
  width: 100%;
  margin-top: 3px;
  border: 1px solid #8c8c89;
  border-radius: 4px;
  padding: 6px;
  font: inherit;
  color: var(--ink);
  background: #ffffff;
}

.composer textarea:focus,
.composer select:focus {
  outline: 2px solid var(--blue);
  outline-offset: 0;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.status {
  margin-right: auto;
  color: var(--muted);
  font-size: 13px;
}

.status-error {
  color: var(--red);
  font-weight: 600;
}

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 20px;
  padding: 6px 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--blue);
  border: 1px solid var(--blue);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--blue);
  color: var(--blue);
}

.btn-ghost:hover {
  background: var(--blue-wash);
}

.btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.sort {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}

.sort span {
  flex: 1;
  border-top: 1px solid #c9c7c2;
  margin-right: 6px;
}

.sort b {
  color: var(--ink);
}

/* === OUT OF BUDGET === */
.broke {
  padding: 12px 16px 14px;
  border-top: 4px solid var(--gold);
}

.broke h2 {
  margin: 4px 0 8px;
}

.broke p {
  margin-bottom: 10px;
}

.broke a.btn {
  display: inline-block;
  margin-bottom: 10px;
  text-decoration: none;
}

/* === POSTS === */
.avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: var(--blue-wash);
  border-radius: 50%;
  text-align: center;
  font-size: 26px;
  line-height: 48px;
}

.avatar-small {
  width: 40px;
  height: 40px;
  font-size: 20px;
  line-height: 40px;
}

.post-head {
  display: flex;
  gap: 10px;
  padding: 12px 16px 8px;
}

.post-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.post-body {
  padding: 0 16px 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.see-more {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  margin-left: 4px;
}

.see-more:hover {
  color: var(--blue);
  text-decoration: underline;
}

.counts {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.post-actions {
  display: flex;
  padding: 4px 8px;
}

.action {
  flex: 1;
  background: none;
  border: none;
  border-radius: 4px;
  padding: 10px 4px;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.action:hover {
  background: #f3f2f0;
}

.action-on {
  color: var(--blue);
}

.comment {
  margin: 0 16px 12px;
  padding: 8px 10px;
  background: #f2f2f2;
  border-radius: 0 8px 8px 8px;
}

.comment-caught {
  border-left: 4px solid var(--gold);
}

/* === ACTIVITY === */
.activity {
  padding: 12px 16px;
}

.activity #history-empty {
  margin-top: 8px;
}

.activity li {
  border-top: 1px solid var(--line);
  padding: 10px 0;
  margin-top: 8px;
}

.history-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.history-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-wrap: anywhere;
}

.history-buttons {
  flex-shrink: 0;
}

.link-button {
  background: none;
  border: none;
  color: var(--blue);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 4px;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.history-post {
  margin-top: 8px;
  padding: 10px;
  background: #f8f8f6;
  border-radius: 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* === RIGHT RAIL === */
.news,
.people {
  padding: 12px 16px;
}

.news li {
  padding: 8px 0 0;
}

.news li b {
  display: block;
  font-size: 13px;
}

.news li span,
.people li span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.people li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
}

.legal {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 12px;
}

/* === SMALLER SCREENS === */
@media screen and (max-width: 820px) {
  .layout {
    display: block;
    padding: 10px 0;
  }
  .col-main,
  .col-right {
    padding: 0 8px;
  }
}

@media screen and (max-width: 720px) {
  .search {
    display: none;
  }
  .logo {
    font-size: 17px;
  }
}

@media screen and (max-width: 440px) {
  .composer-options {
    grid-template-columns: 1fr;
  }
  .action {
    font-size: 12px;
  }
}
