:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --sidebar-bg: #ffffff;
  --sidebar-text: #687083;
  --sidebar-active: #101828;
  --accent: #2c7be5;
  --accent-hover: #1d64c4;
  --accent-soft: #eaf2ff;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --success: #039855;
  --success-bg: #ecfdf3;
  --warning: #dc6803;
  --warning-bg: #fff7e8;
  --danger: #d92d20;
  --danger-bg: #fef3f2;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, 0.14);
  --radius: 8px;
  --radius-sm: 6px;
  --content: 1060px;
}

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

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at left top, rgba(44, 123, 229, 0.09), transparent 28rem),
    linear-gradient(180deg, #f8fbff 0%, #f5f7fb 42%, #f3f6fb 100%),
    var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

input, select, textarea, button {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(430px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 34px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.login-brand div {
  display: flex;
  flex-direction: column;
}

.login-brand strong {
  font-size: 16px;
}

.login-brand div span {
  color: var(--muted);
  font-size: 12px;
}

.login-card h1 {
  font-size: 27px;
  margin-bottom: 5px;
}

.login-card p {
  color: var(--muted);
  font-size: 14px;
}

.login-submit {
  width: 100%;
  min-height: 48px;
}

.form-error {
  min-height: 21px;
  color: var(--danger) !important;
  font-size: 13px !important;
  font-weight: 700;
}

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 276px;
  background: var(--sidebar-bg);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 40px rgba(16, 24, 40, 0.04);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
  margin-bottom: 10px;
}

.logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.brand-name {
  color: var(--ink);
  font-weight: 800;
  font-size: 16px;
}

.sidebar-section {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 14px;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 8px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.btn-icon {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-icon:hover {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--ink);
}

.accounts-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.accounts-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 8px;
}

.account-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 9px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}

.account-item:hover,
.account-item.active {
  background: var(--accent-soft);
  color: var(--sidebar-active);
}

.account-item .platform-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef4ff;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account-item .platform-icon svg {
  display: block;
}

.account-item .account-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-item .delete-account {
  opacity: 0;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.account-item:hover .delete-account {
  opacity: 1;
}

.account-item .delete-account:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.account-form-actions {
  display: flex;
  gap: 6px;
}

.account-form-actions .btn {
  flex: 1;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-hidden {
  display: none;
}

.nav-item:hover,
.nav-item.active {
  background: var(--accent-soft);
  color: var(--sidebar-active);
}

.nav-icon {
  width: 22px;
  text-align: center;
  color: var(--accent);
}

.main {
  flex: 1;
  margin-right: 276px;
  padding: 34px clamp(24px, 4vw, 56px) 56px;
  max-width: none;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--content);
  margin: 0 auto 28px;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.current-user {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
  padding-left: 4px;
}

.current-user span {
  font-size: 13px;
  font-weight: 800;
}

.current-user small {
  color: var(--muted);
  font-size: 11px;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

.post-count,
.media-count {
  color: var(--muted);
  font-size: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 9px 17px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(44, 123, 229, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn-secondary:hover:not(:disabled) {
  background: #dceaff;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-soft);
  color: var(--ink);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  background: #027a48;
}

.btn-sm {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 12px;
}

.views {
  position: relative;
  max-width: var(--content);
  margin: 0 auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.queue-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  min-height: 38px;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: all 0.15s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: #fff;
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow);
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  position: relative;
  overflow: hidden;
}

.post-card::before {
  content: "";
  position: absolute;
  inset-block: 18px;
  inset-inline-start: 0;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.18;
}

.post-card:hover {
  border-color: #c7d7f7;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.1);
  transform: translateY(-1px);
}

.post-card.overdue {
  border-color: #fedf89;
}

.post-card-media {
  width: 108px;
  height: 108px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  background: #eef2f6;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.post-card-media img,
.post-card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-media .no-media {
  color: var(--muted);
  font-size: 22px;
}

.media-stack-count {
  position: absolute;
  left: 7px;
  bottom: 7px;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.75);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 7px;
}

.post-card-body {
  flex: 1;
  min-width: 0;
}

.post-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.post-card-platform,
.post-card-type {
  font-size: 11px;
  font-weight: 900;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 8px;
  border-radius: 999px;
}

.post-card-account {
  font-size: 13px;
  color: var(--ink);
  font-weight: 800;
}

.post-card-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-card-content {
  font-size: 14px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.65;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
}

.post-card-time {
  font-size: 12px;
  color: var(--muted);
}

.post-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.badge.scheduled,
.badge.sending {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.draft {
  background: #f2f4f7;
  color: #475467;
}

.badge.sent {
  background: var(--success-bg);
  color: var(--success);
}

.badge.failed {
  background: var(--danger-bg);
  color: var(--danger);
}

.empty-state {
  text-align: center;
  padding: 70px 24px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px dashed #cfd7e6;
  border-radius: var(--radius);
}

.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.empty-state h3 {
  font-size: 17px;
  margin-bottom: 5px;
}

.empty-state p {
  color: var(--muted);
  font-size: 14px;
}

.settings-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 760px;
  box-shadow: var(--shadow);
}

.settings-section + .settings-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.account-settings-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-panel h2,
.media-library-header h2 {
  font-size: 18px;
  font-weight: 800;
}

.settings-panel .lede {
  color: var(--muted);
  font-size: 14px;
  margin: 8px 0 18px;
}

.settings-panel label {
  margin-bottom: 12px;
}

.hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.users-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(480px, 1.3fr);
  gap: 20px;
  align-items: start;
}

.users-layout .settings-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.users-layout h2 {
  font-size: 18px;
}

.users-layout .lede {
  color: var(--muted);
  font-size: 14px;
  margin: 7px 0 20px;
}

.user-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.user-form .hint {
  margin-top: 0;
  font-weight: 500;
  line-height: 1.5;
}

.users-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.users-count {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.users-table-wrap {
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.users-table th,
.users-table td {
  padding: 13px 10px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}

.users-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.users-table tbody tr:last-child td {
  border-bottom: 0;
}

.user-name-cell {
  font-weight: 800;
}

.role-badge {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.role-badge.superadmin {
  background: #fff7e8;
  color: #b54708;
}

.users-empty {
  color: var(--muted);
  text-align: center !important;
  padding: 30px !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.48);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(6px);
}

.modal-content {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  font-size: 17px;
  font-weight: 900;
}

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

.composer {
  padding: 0;
}

.composer-main {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 30px;
  padding: 28px;
}

.media-upload {
  position: relative;
}

.media-placeholder {
  border: 1px dashed #b9c7dc;
  border-radius: var(--radius);
  min-height: 300px;
  aspect-ratio: 4 / 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.18s ease;
  background: var(--surface-soft);
  text-align: center;
  padding: 18px;
}

.media-placeholder:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.upload-icon {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 25px;
  margin-bottom: 10px;
}

.upload-hint {
  font-size: 12px;
  margin-top: 4px;
  color: var(--muted);
}

.media-preview {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #101828;
  min-height: 300px;
  aspect-ratio: 4 / 5;
  display: flex;
  flex-direction: column;
}

.media-grid-preview {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  padding: 2px;
  align-content: start;
  overflow-y: auto;
}

.media-grid-preview .media-grid-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  cursor: grab;
  background: #1a1d23;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.media-grid-preview .media-grid-item:active {
  cursor: grabbing;
}

.media-grid-preview .media-grid-item.dragging {
  opacity: 0.4;
  transform: scale(0.95);
}

.media-grid-preview .media-grid-item.drag-over {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 2px rgba(44, 123, 229, 0.3);
  transform: scale(1.05);
  z-index: 2;
}

.media-grid-preview .media-grid-item img,
.media-grid-preview .media-grid-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.media-grid-preview .media-grid-item .media-item-index {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.media-grid-preview .media-grid-item .media-item-video-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(16, 24, 40, 0.75);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.media-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(16, 24, 40, 0.7);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.media-remove:hover {
  background: var(--danger);
}

.composer-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.field-row {
  display: grid;
  gap: 16px;
}

.field-row.two {
  grid-template-columns: 1fr 1fr;
}

.field-row.meta {
  grid-template-columns: minmax(150px, 0.8fr) minmax(210px, 1fr);
  align-items: start;
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 900;
  color: #344054;
}

input, select, textarea {
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  outline: none;
  width: 100%;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(44, 123, 229, 0.12);
}

textarea {
  resize: vertical;
  line-height: 1.75;
  min-height: 230px;
}

select {
  cursor: pointer;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 20px 28px 28px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  background: #fbfcfe;
}

.composer-actions .btn-ghost {
  margin-right: auto;
}

.toast {
  position: fixed;
  left: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 12px 16px;
  border-radius: var(--radius);
  background: #101828;
  color: white;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 200;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.media-library-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.media-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.media-item:hover {
  box-shadow: var(--shadow);
  border-color: #c7d7f7;
}

.media-item.pickable {
  cursor: pointer;
}

.media-item.pickable.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), var(--shadow);
}

.media-item.pickable.selected .media-item-thumb::after {
  content: "✓";
  position: absolute;
  top: 6px;
  left: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.media-item-thumb {
  position: relative;
  aspect-ratio: 1;
  background: #101828;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-item-thumb img,
.media-item-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-item-badge {
  position: absolute;
  bottom: 7px;
  right: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.72);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.media-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  gap: 8px;
}

.media-item-name {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  direction: ltr;
  text-align: left;
}

.media-delete {
  flex-shrink: 0;
}

.media-delete:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.media-picker-content {
  width: min(660px, 100%);
}

.media-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 12px;
  padding: 20px 24px;
}

.media-picker-footer {
  display: flex;
  gap: 8px;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--line);
}

.media-picker-footer .btn-ghost {
  margin-right: auto;
}

@media (max-width: 860px) {
  .sidebar {
    width: 68px;
    padding: 14px 8px;
  }

  .sidebar-brand .brand-name,
  .nav-item span:last-child,
  .sidebar-section-header span,
  .accounts-empty,
  .account-item .account-name {
    display: none;
  }

  .sidebar-brand {
    justify-content: center;
    padding: 0 0 14px;
  }

  .nav-item,
  .account-item {
    justify-content: center;
    padding: 10px;
  }

  .account-item .delete-account {
    display: none;
  }

  .main {
    margin-right: 68px;
    padding: 18px;
  }

  .composer-main {
    grid-template-columns: 1fr;
  }

  .field-row.meta {
    grid-template-columns: 1fr 1fr;
  }

  .users-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .field-row.two,
  .field-row.meta {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-left {
    flex-wrap: wrap;
  }

  .topbar-right {
    flex-wrap: wrap;
  }

  .current-user {
    flex: 1;
  }

  .post-card {
    flex-direction: column;
    padding: 16px;
  }

  .post-card-media {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .post-card-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .post-card-actions {
    justify-content: flex-start;
  }

  .composer-actions .btn-ghost {
    margin-right: 0;
  }
}
