.ks-feed,
.ks-submit-card,
.ks-dashboard-card {
  border: 1px solid var(--ks-border, #cbd5e1);
  border-radius: var(--ks-radius, 10px);
  background: var(--ks-surface, #fff);
}

.ks-feed {
  overflow: hidden;
}

.ks-post-list {
  display: grid;
}

.ks-post-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border-top: 1px solid rgba(203, 213, 225, 0.78);
  transition: background-color 160ms ease;
}

.ks-post-row:first-child {
  border-top: 0;
}

.ks-post-row:hover {
  background: rgba(255, 48, 69, 0.04);
}

.ks-post-row__avatar {
  overflow: hidden;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 48, 69, 0.12);
}

.ks-post-row__avatar-img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: cover;
}

.ks-post-row__avatar--text {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ks-green, #ff3045);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0;
}

.ks-post-row__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--ks-muted, #64748b);
  font-size: 13px;
  line-height: 1.35;
}

.ks-post-row__head > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  align-items: center;
}

.ks-post-row__head strong {
  color: var(--ks-ink, #111827);
  font-size: 15px;
  font-weight: 850;
}

.ks-post-row__category {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--ks-deep-green, #e11d2e);
  background: rgba(255, 48, 69, 0.12);
  font-size: 12px;
  font-weight: 800;
}

.ks-post-row__more {
  flex: 0 0 auto;
  color: var(--ks-muted, #64748b);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.ks-post-row__more:hover {
  color: var(--ks-green, #ff3045);
}

.ks-post-row__media {
  overflow: hidden;
  display: block;
  width: 100%;
  max-width: 560px;
  height: 238px;
  margin-top: 12px;
  border-radius: 8px;
  background: #e2e8f0;
  text-decoration: none;
}

.ks-post-row__media img,
.ks-post-row__media span {
  display: block;
  width: 100%;
  height: 100%;
}

.ks-post-row__media img {
  object-fit: cover;
}

.ks-post-row__media--demo {
  background: #eef5f1;
}

.ks-demo-media-card {
  position: relative;
  display: grid !important;
  align-content: end;
  gap: 4px;
  overflow: hidden;
  width: 100%;
  height: 100%;
  padding: 20px;
  color: #fff;
  background: #ff3045;
}

.ks-demo-media-card::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 46%),
    linear-gradient(0deg, rgba(17, 24, 39, 0.56), transparent 58%);
  content: "";
}

.ks-demo-media-card strong,
.ks-demo-media-card span {
  position: relative;
  z-index: 1;
}

.ks-demo-media-card strong {
  font-size: 22px;
  line-height: 1.1;
}

.ks-demo-media-card span {
  font-size: 14px;
  font-weight: 750;
  opacity: 0.92;
}

.ks-demo-media-card--housing {
  background: #ff3045;
}

.ks-demo-media-card--business {
  background: #b7791f;
}

.ks-demo-media-card--jobs {
  background: #315a9f;
}

.ks-demo-media-card--qa {
  background: #6b7280;
}

.ks-demo-media-card--secondhand {
  background: #8f4f2a;
}

.ks-media-placeholder,
.ks-video-placeholder {
  background:
    linear-gradient(135deg, rgba(255, 48, 69, 0.16), rgba(198, 161, 91, 0.14)),
    #e2e8f0;
}

.ks-video-placeholder {
  display: grid !important;
  place-items: center;
  color: var(--ks-deep-green, #e11d2e);
  font-size: 15px;
  font-weight: 800;
}

.ks-post-row__body h3 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.3;
}

.ks-post-row__body h3 a {
  color: var(--ks-ink, #111827);
  text-decoration: none;
}

.ks-post-row__body p {
  margin: 0 0 10px;
  color: var(--ks-muted, #64748b);
}

.ks-post-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 12px;
  color: var(--ks-muted, #64748b);
  font-size: 13px;
}

.ks-post-row__actions a,
.ks-post-row__actions span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  color: inherit;
  text-decoration: none;
}

.ks-post-row__actions a:hover {
  color: var(--ks-green, #ff3045);
}

.ks-post-row__actions .dashicons {
  width: 17px;
  height: 17px;
  font-size: 17px;
  line-height: 1;
}

.ks-post-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--ks-muted, #64748b);
  font-size: 13px;
}

.ks-mobile-empty-feed {
  background: var(--ks-surface, #fff);
}

.ks-mobile-empty-actions {
  display: flex;
  gap: 10px;
  margin: 14px 0 2px;
}

.ks-mobile-empty-actions .ks-button {
  min-height: 40px;
  padding: 8px 14px;
}

.ks-empty-state {
  padding: 30px;
}

.ks-empty-state h3 {
  margin-top: 0;
}

.ks-submit-card,
.ks-dashboard-card {
  padding: 22px;
  margin-bottom: 18px;
}

.ks-muted {
  color: var(--ks-muted, #64748b);
}

.ks-submit-form {
  display: grid;
  gap: 16px;
}

.ks-submit-form label {
  display: grid;
  gap: 7px;
  color: var(--ks-ink, #111827);
  font-weight: 700;
}

.ks-submit-form input,
.ks-submit-form select,
.ks-submit-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--ks-border, #cbd5e1);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ks-ink, #111827);
  background: var(--ks-surface, #fff);
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.ks-submit-form input:focus,
.ks-submit-form select:focus,
.ks-submit-form textarea:focus {
  outline: none;
  border-color: var(--ks-green, #ff3045);
  box-shadow: 0 0 0 3px rgba(255, 48, 69, 0.16);
}

.ks-submit-form textarea {
  resize: vertical;
}

.ks-submit-form small {
  color: var(--ks-muted, #64748b);
  font-weight: 500;
}

.ks-file-feedback {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--ks-deep-green, #e11d2e);
  background: rgba(255, 48, 69, 0.1);
  font-size: 13px;
  font-weight: 700;
}

.ks-file-feedback.is-error {
  color: #8b1a1a;
  background: rgba(220, 38, 38, 0.1);
}

.ks-submit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ks-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ks-green, #ff3045);
  border-radius: 10px;
  padding: 10px 18px;
  color: #fff;
  background: var(--ks-green, #ff3045);
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 -1px 0 rgba(17, 24, 39, 0.12);
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.ks-button:hover {
  border-color: var(--ks-deep-green, #e11d2e);
  background: var(--ks-deep-green, #e11d2e);
}

.ks-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 48, 69, 0.2), inset 0 -1px 0 rgba(17, 24, 39, 0.12);
}

.ks-button:active {
  transform: translateY(1px);
}

.ks-button--ghost {
  color: var(--ks-ink, #111827);
  border-color: var(--ks-border, #cbd5e1);
  background: #fff;
  box-shadow: none;
}

.ks-button--ghost:hover {
  border-color: var(--ks-green, #ff3045);
  color: var(--ks-deep-green, #e11d2e);
  background: rgba(255, 48, 69, 0.08);
}

.ks-submit-form.is-submitting .ks-button {
  cursor: progress;
  pointer-events: none;
}

.ks-login-prompt {
  max-width: 640px;
}

.ks-login-prompt h2 {
  margin: 0 0 8px;
}

.ks-login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 12px;
}

.ks-login-note {
  margin: 0;
  color: var(--ks-muted, #64748b);
  font-size: 14px;
}

.ks-dashboard {
  display: grid;
  gap: 18px;
}

.ks-messages {
  display: grid;
  gap: 18px;
}

.ks-messages-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ks-messages-head h2 {
  margin: 0;
}

.ks-messages-head a {
  color: var(--ks-green, #ff3045);
  font-weight: 800;
  text-decoration: none;
}

.ks-message-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ks-message-tabs a {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--ks-ink, #111827);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.ks-message-tabs .dashicons {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #fff;
  background: var(--ks-green, #ff3045);
  font-size: 21px;
}

.ks-message-list {
  display: grid;
  gap: 4px;
}

.ks-message-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 70px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
  color: inherit;
  text-decoration: none;
}

.ks-message-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  background: var(--ks-green, #ff3045);
  font-size: 13px;
  font-weight: 900;
}

.ks-message-row strong,
.ks-message-row em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ks-message-row strong {
  color: var(--ks-ink, #111827);
  font-size: 15px;
}

.ks-message-row em,
.ks-message-row small {
  color: var(--ks-muted, #64748b);
  font-style: normal;
  font-size: 12px;
}

.ks-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ks-dashboard-grid span {
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--ks-border, #cbd5e1);
  border-radius: 8px;
  color: var(--ks-muted, #64748b);
  background: var(--ks-canvas, #f8fafc);
}

.ks-dashboard-grid strong {
  color: var(--ks-ink, #111827);
}

.ks-media-gallery {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.ks-media-gallery img,
.ks-media-gallery video {
  width: 100%;
  border-radius: 10px;
}

.ks-notice {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 700;
}

.ks-notice--success {
  color: #e11d2e;
  background: rgba(255, 48, 69, 0.14);
}

.ks-notice--warning {
  color: #7c3f00;
  background: rgba(217, 119, 6, 0.16);
}

.ks-notice--error {
  color: #8b1a1a;
  background: rgba(220, 38, 38, 0.12);
}

@media (max-width: 720px) {
  .ks-feed {
    border-radius: 0;
  }

  .ks-feed--mobile {
    border: 0;
    background: #fff;
  }

  .ks-feed--mobile .ks-post-list {
    padding-bottom: 18px;
  }

  .ks-post-row {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    padding: 16px 18px 18px;
    border-top-color: rgba(229, 231, 235, 0.95);
  }

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

  .ks-post-row__media {
    order: 4;
    height: auto;
    aspect-ratio: 16 / 9;
    max-width: none;
    margin-top: 10px;
    border-radius: 10px;
  }

  .ks-post-row__head {
    margin-bottom: 7px;
  }

  .ks-post-row__head strong {
    font-size: 16px;
  }

  .ks-post-row__head span:not(.ks-post-row__category) {
    font-size: 13px;
  }

  .ks-post-row__more {
    font-size: 0;
  }

  .ks-post-row__more::before {
    content: "...";
    color: var(--ks-muted, #64748b);
    font-size: 24px;
    line-height: 1;
  }

  .ks-post-row__body h3 {
    order: 1;
    font-size: 20px;
    line-height: 1.32;
  }

  .ks-post-row__body p {
    order: 2;
    color: var(--ks-ink, #111827);
    font-size: 16px;
    line-height: 1.58;
  }

  .ks-post-row__actions {
    order: 3;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
    padding: 4px 4px 0 0;
    font-size: 14px;
  }

  .ks-post-row__actions a,
  .ks-post-row__actions span {
    min-height: 36px;
    min-width: 50px;
    justify-content: center;
    border-radius: 999px;
  }

  .ks-post-row__actions a:active {
    color: var(--ks-green, #ff3045);
    background: rgba(255, 48, 69, 0.08);
  }

  .ks-post-row__meta {
    order: 5;
  }

  .ks-mobile-empty-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .ks-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ks-submit-actions {
    display: grid;
  }
}

@media (max-width: 720px) {
  .ks-feed--cards {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .ks-feed--cards .ks-post-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 16px 18px;
  }

  .ks-feed--cards .ks-post-row {
    display: block;
    overflow: hidden;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
  }

  .ks-feed--cards .ks-post-row__avatar,
  .ks-feed--cards .ks-post-row__more,
  .ks-feed--cards .ks-post-row__body p {
    display: none;
  }

  .ks-feed--cards .ks-post-row__body {
    display: flex;
    min-width: 0;
    flex-direction: column;
  }

  .ks-feed--cards .ks-post-row__media {
    order: 1;
    width: 100%;
    margin: 0;
    border-radius: 0;
    aspect-ratio: 1.14 / 1;
  }

  .ks-feed--cards .ks-post-row__body h3 {
    order: 2;
    min-height: 42px;
    margin: 8px 9px 4px;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 850;
  }

  .ks-feed--cards .ks-post-row__head {
    order: 3;
    margin: 0 9px 8px;
    font-size: 11px;
  }

  .ks-feed--cards .ks-post-row__head > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .ks-feed--cards .ks-post-row__head strong {
    overflow: hidden;
    color: #5d6472;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ks-feed--cards .ks-post-row__category,
  .ks-feed--cards .ks-post-row__head span:not(.ks-post-row__category) {
    display: none;
  }

  .ks-feed--cards .ks-post-row__actions {
    order: 4;
    justify-content: flex-end;
    margin: 0;
    padding: 0 9px 9px;
    font-size: 11px;
  }

  .ks-feed--cards .ks-post-row__actions a:first-child {
    margin-right: auto;
  }

  .ks-feed--cards .ks-post-row__actions a,
  .ks-feed--cards .ks-post-row__actions span {
    min-height: 24px;
    min-width: 0;
    color: #7b8190;
  }

  .ks-submit-card,
  .ks-dashboard-card,
  .ks-login-prompt,
  .ks-messages {
    margin: 0 0 14px;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }

  .ks-submit-card {
    min-height: calc(100dvh - 86px);
    padding: 18px 16px 96px;
  }

  .ks-submit-card h2 {
    margin: 0 0 8px;
    text-align: center;
    font-size: 17px;
  }

  .ks-submit-card .ks-muted {
    text-align: center;
    font-size: 12px;
  }

  .ks-submit-form {
    gap: 0;
    margin-top: 16px;
  }

  .ks-submit-form label {
    gap: 8px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
    font-size: 14px;
  }

  .ks-submit-form textarea {
    min-height: 132px;
  }

  .ks-submit-form input,
  .ks-submit-form select,
  .ks-submit-form textarea {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .ks-submit-actions {
    position: sticky;
    bottom: 86px;
    margin-top: 18px;
  }

  .ks-submit-actions .ks-button {
    border-radius: 10px;
    background: var(--ks-green, #ff3045);
  }

  .ks-dashboard {
    gap: 0;
    padding-bottom: 92px;
    background: #f7f7f9;
  }

  .ks-dashboard-card:first-child {
    overflow: hidden;
    padding: 22px 16px 18px;
    color: #fff;
    background: linear-gradient(135deg, #ff3045, #ff5a62);
  }

  .ks-dashboard-card:first-child .ks-muted,
  .ks-dashboard-card:first-child h2 {
    color: #fff;
  }

  .ks-dashboard-grid span {
    border: 0;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.13);
  }

  .ks-dashboard-grid strong {
    color: #fff;
  }

  .ks-dashboard-card#my-posts {
    margin: -4px 12px 16px;
    border-radius: 12px;
    padding: 16px 12px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.08);
  }

  .ks-messages {
    min-height: calc(100dvh - 86px);
    padding: 18px 16px 96px;
  }

  .ks-messages-head h2 {
    font-size: 17px;
  }

  .ks-message-tabs {
    padding: 10px 0 4px;
  }
}
