/* Figma-aligned application chrome and the cloud-only social publishing library. */
.app {
  grid-template-columns: 200px minmax(0, 1fr);
}

.sidebar {
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 44px 12px 12px;
  border-right: 1px solid rgba(0, 0, 0, .12);
  background: #fff;
  font-family: Manrope, Inter, ui-sans-serif, system-ui, sans-serif;
}

.sidebar::before {
  display: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  height: 32px;
  margin-bottom: 20px;
}

.sidebar .brand-logo-image {
  display: block;
  width: 146px;
  height: 32px;
  object-fit: contain;
  object-position: left center;
}

.sidebar .nav-scroll {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  overflow-x: hidden;
}

.sidebar .nav-btn {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  color: #0b0b0b;
  font-size: 12px;
  font-weight: 500;
}

.sidebar .nav-btn:hover,
.sidebar .nav-btn.active {
  background: rgba(0, 0, 0, .045);
  color: #050505;
}

.sidebar .nav-btn > img,
.sidebar .nav-custom-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
}

.sidebar .nav-btn > img {
  object-fit: contain;
}

.sidebar .nav-custom-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.9;
}

.sidebar .history-group {
  display: grid;
  gap: 0;
  margin: 0 0 18px;
  padding: 0 10px 0 18px;
}

.sidebar .history-toggle {
  min-height: 22px;
  padding: 0;
  color: #9a9a9a;
  font-size: 10px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
}

.sidebar .history-toggle svg {
  display: none;
}

.sidebar .history-item {
  min-height: 34px;
  padding: 0;
  color: #999;
  font-size: 11px;
  font-weight: 400;
}

.sidebar .history-item:hover {
  background: transparent;
  color: #555;
}

.sidebar .sidebar-foot {
  gap: 0;
}

.sidebar .user {
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  gap: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.sidebar .avatar {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: #050505;
  font-size: 12px;
}

.sidebar .user b {
  color: #0b0b0b;
  font-size: 12px;
  font-weight: 650;
}

.sidebar .user span {
  color: #8f8f8f;
  font-size: 9px;
}

.sidebar-settings {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #e7e7e7;
  border-radius: 8px;
  background: #fff;
}

.sidebar-settings:hover {
  background: #f6f6f6;
}

.sidebar-settings img {
  width: 18px;
  height: 18px;
}

.social-tabs {
  display: none;
}

#ambient {
  display: none;
}

.main:not(.assistant-mode) .view {
  height: calc(100vh - 58px);
}

.library-mode .topbar {
  display: none;
}

.library-mode .view {
  height: 100vh !important;
}

.assistant-file-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-color: #e6e6e4;
  border-radius: 8px;
  background: #f7f7f5;
  color: #171817;
}

.assistant-file-btn svg {
  width: 16px;
  height: 16px;
}

.assistant-file-btn::after {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 5;
  padding: 6px 8px;
  border-radius: 6px;
  background: #111;
  color: #fff;
  content: attr(data-tooltip);
  font-size: 10px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 3px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

.assistant-file-btn:hover::after,
.assistant-file-btn:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.assistant-context-count {
  display: none;
}

.social-library-shell {
  min-height: 100%;
  padding: 34px 36px 56px;
  background: #fcfcfb;
  color: #262724;
}

.social-library-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto 28px;
}

.social-library-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: #229955;
  font-size: 11px;
  font-weight: 700;
}

.social-library-eyebrow svg {
  width: 14px;
  height: 14px;
}

.social-library-header h1 {
  margin: 0;
  color: #1d1f1c;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -.035em;
}

.social-library-header p {
  margin: 7px 0 0;
  color: #858680;
  font-size: 13px;
}

.social-library-actions {
  display: flex;
  gap: 8px;
}

.social-library-actions button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid #dedfda;
  border-radius: 9px;
  background: #fff;
  color: #343632;
  font-size: 12px;
  font-weight: 650;
}

.social-library-actions button:hover {
  border-color: #9fd6ae;
}

.social-library-actions button.primary {
  border-color: #1c9c52;
  background: #1c9c52;
  color: #fff;
}

.social-library-actions svg {
  width: 15px;
}

.social-library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto 18px;
}

.social-library-toolbar > label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(310px, 34vw);
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid #e2e2de;
  border-radius: 9px;
  background: #fff;
  color: #90918c;
}

.social-library-toolbar > label svg {
  width: 15px;
}

.social-library-toolbar input {
  width: 100%;
  border: 0;
  background: transparent;
  color: #333;
  font-size: 12px;
}

.social-library-filters {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid #e5e5e1;
  border-radius: 10px;
  background: #f5f5f2;
}

.social-library-filters button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  color: #74756f;
  font-size: 11px;
}

.social-library-filters button.active {
  background: #fff;
  color: #238c4e;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .07);
}

.social-library-filters span {
  margin-left: 4px;
  color: #aaa;
  font-size: 9px;
}

.social-library-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
}

.social-asset-card {
  position: relative;
  display: grid;
  grid-template-rows: 140px auto;
  min-width: 0;
  border: 1px solid #e2e3df;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.social-asset-card:hover {
  border-color: #b8d9c1;
  box-shadow: 0 12px 28px rgba(30, 47, 34, .07);
  transform: translateY(-1px);
}

.social-asset-preview {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f2f4f0;
}

.social-asset-preview img,
.social-asset-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-asset-preview.text {
  place-items: start;
  padding: 18px;
  background: linear-gradient(145deg, #f2f8f2, #f7f5ee);
}

.social-asset-preview.text p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #3e453d;
  font-size: 13px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.social-asset-type {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 7px;
  background: rgba(255, 255, 255, .9);
  color: #343632;
  font-size: 9px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.social-asset-type svg {
  width: 11px;
}

.social-asset-body {
  display: grid;
  gap: 10px;
  padding: 13px;
}

.social-asset-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.social-asset-title b {
  overflow: hidden;
  color: #292b28;
  font-size: 12.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-asset-title button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: #777;
}

.social-asset-title button:hover {
  background: #f1f4f0;
  color: #1b914d;
}

.social-asset-title svg {
  width: 14px;
}

.social-asset-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.social-asset-meta span {
  padding: 4px 6px;
  border-radius: 6px;
  background: #f4f4f1;
  color: #777a74;
  font-size: 9px;
}

.social-library-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px dashed #d9dad5;
  border-radius: 14px;
  color: #8a8c86;
  font-size: 12px;
}

.social-library-legacy {
  display: none !important;
}

.social-library-dialog {
  position: fixed;
  z-index: 320;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(32, 34, 31, .34);
  backdrop-filter: blur(5px);
}

.social-library-dialog.open {
  display: grid;
}

.social-library-dialog-card {
  width: min(560px, 100%);
  max-height: min(650px, calc(100vh - 40px));
  padding: 18px;
  border: 1px solid #dedfd9;
  border-radius: 16px;
  overflow: auto;
  background: #fff;
  box-shadow: 0 28px 70px rgba(24, 29, 24, .2);
}

.social-library-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 15px;
}

.social-library-dialog-head h2 {
  margin: 0;
  font-size: 17px;
}

.social-library-dialog-head p {
  margin: 5px 0 0;
  color: #888a84;
  font-size: 11px;
}

.social-library-dialog-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f5f5f2;
}

.social-library-dialog-close svg {
  width: 15px;
}

.social-library-drive-list {
  display: grid;
  gap: 7px;
}

.social-library-drive-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid #e4e4df;
  border-radius: 10px;
  text-align: left;
}

.social-library-drive-item:hover,
.social-library-drive-item.selected {
  border-color: #84cf9b;
  background: #f3faf5;
}

.social-library-drive-item > span:first-child {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #eaf7ee;
  color: #1c9650;
}

.social-library-drive-item svg {
  width: 16px;
}

.social-library-drive-item div {
  min-width: 0;
}

.social-library-drive-item b,
.social-library-drive-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-library-drive-item b {
  font-size: 11.5px;
}

.social-library-drive-item small {
  margin-top: 3px;
  color: #8c8f88;
  font-size: 9.5px;
}

.social-library-drive-item em {
  color: #239654;
  font-size: 10px;
  font-style: normal;
  opacity: 0;
}

.social-library-drive-item.selected em {
  opacity: 1;
}

.social-library-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.social-library-dialog-actions button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #dedfd9;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 650;
}

.social-library-dialog-actions .primary {
  border-color: #1c9c52;
  background: #1c9c52;
  color: #fff;
}

.social-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
}

.social-create-form label {
  display: grid;
  gap: 6px;
  color: #6f716c;
  font-size: 10px;
  font-weight: 650;
}

.social-create-form label:last-child {
  grid-column: 1 / -1;
}

.social-create-form input,
.social-create-form select,
.social-create-form textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #dfdfda;
  border-radius: 9px;
  outline: 0;
  background: #fff;
  color: #2f312e;
  font: inherit;
  font-size: 11px;
}

.social-create-form textarea {
  resize: vertical;
  line-height: 1.55;
}

.social-create-form input:focus,
.social-create-form select:focus,
.social-create-form textarea:focus {
  border-color: #74c58d;
  box-shadow: 0 0 0 3px rgba(41, 170, 86, .08);
}

@media (max-width: 1060px) {
  .social-library-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .social-library-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .social-library-toolbar > label {
    width: 100%;
  }

  .social-library-filters {
    align-self: flex-start;
    overflow-x: auto;
    max-width: 100%;
  }
}

@media (max-width: 780px) {
  .app {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .sidebar {
    padding: 24px 10px 10px;
  }

  .sidebar .brand-logo-image {
    width: 42px;
    object-fit: cover;
    object-position: left;
  }

  .sidebar .nav-btn {
    grid-template-columns: 20px;
    justify-content: center;
    padding: 0;
  }

  .sidebar .nav-btn > span:last-child,
  .sidebar .history-group,
  .sidebar .user > div:nth-child(2),
  .sidebar-settings {
    display: none;
  }

  .sidebar .user {
    grid-template-columns: 32px;
    justify-content: center;
  }

  .social-library-shell {
    padding: 24px 18px 40px;
  }

  .social-library-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

@media (max-width: 560px) {
  .social-library-grid {
    grid-template-columns: 1fr;
  }
}
