/* Semantic tokens: static/css/skydns-tokens.css (loaded before this file in base.html) */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

a {
  color: var(--astro-blue);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

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

/* ——— Sidebar ——— */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--header-height);
  padding: 14px 16px;
  background: var(--astro-blue);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.sidebar-logo-link:hover {
  opacity: 0.92;
}

.sidebar-logo-img {
  display: block;
  width: auto;
  max-width: 168px;
  height: 28px;
  object-fit: contain;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
  min-height: 40px;
  font-size: 0.9rem;
  font-weight: 500;
  box-sizing: border-box;
  width: 100%;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.nav-item:hover svg {
  opacity: 1;
}

.nav-item.active {
  background: var(--white-blue);
  color: var(--astro-blue);
}

.nav-item.active svg {
  opacity: 1;
  color: var(--astro-blue);
}

.nav-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.nav-item .badge-soon {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-subtle);
  color: var(--text-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

.sidebar-footer a {
  color: var(--text-tertiary);
  font-weight: 500;
}

.sidebar-footer a:hover {
  color: var(--astro-blue);
}

/* ——— Main layout ——— */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.main-content--guest {
  margin-left: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

.main-content--guest .page-content {
  max-width: none;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
}

.top-header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

.top-header-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.header-search {
  position: relative;
  flex: 1 1 auto;
  max-width: 420px;
}

.header-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.header-search-input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.header-search-input:focus {
  outline: none;
  border-color: var(--astro-blue);
  background: var(--bg-surface);
}

.header-search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

.header-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 420px;
  overflow-y: auto;
  z-index: 60;
  padding: 8px 0;
}

.header-search-results[hidden] {
  display: none;
}

.header-search-group-title {
  padding: 8px 14px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.header-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  color: var(--text-primary);
}

.header-search-item:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.header-search-item-title {
  font-weight: 500;
  font-size: 0.875rem;
}

.header-search-item-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: 4px;
}

.header-search-item-post {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-search-empty,
.header-search-loading {
  padding: 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

.user-menu {
  position: relative;
  margin-left: auto;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.user-menu-trigger:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--bg-surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  padding: 6px;
  margin-top: 0;
}

.user-menu.open .user-dropdown {
  display: block;
}

.user-dropdown a,
.user-dropdown span,
.user-dropdown .logout-btn {
  display: block;
  width: 100%;
  padding: 9px 12px;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

.user-dropdown a:hover,
.user-dropdown .logout-btn:hover {
  background: var(--bg-subtle);
}

.logout-form {
  margin: 0;
}

.user-dropdown .disabled-item {
  opacity: 0.4;
  cursor: not-allowed;
}

.roles-fieldset {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.roles-fieldset-title {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.roles-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.roles-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
}

.page-content {
  padding: 28px 32px 48px;
  flex: 1;
  max-width: 1400px;
  width: 100%;
}

.page-title {
  margin: 0 0 24px;
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 16px;
}

.card-white-blue {
  background: var(--white-blue);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 40px;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--astro-blue);
  color: #fff;
  box-shadow: 0 1px 2px rgba(30, 79, 208, 0.2);
}

.btn-primary:hover {
  background: var(--astro-blue-hover);
  color: #fff;
  box-shadow: 0 2px 8px rgba(30, 79, 208, 0.25);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  margin-bottom: 12px;
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--astro-blue);
  box-shadow: 0 0 0 3px rgba(30, 79, 208, 0.12);
}

/* Скрытый native file input + корпоративная кнопка выбора */
.file-input-native,
.avatar-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.avatar-upload {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  margin-bottom: 12px;
}

.avatar-upload-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.avatar-upload-preview--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--astro-blue);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
}

.avatar-upload-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.avatar-upload-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

label.avatar-upload-btn.btn {
  cursor: pointer;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  user-select: none;
}

.btn-ghost-danger {
  background: transparent;
  border: 1px solid #f1c4c4;
  color: #c0392b;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.btn-ghost-danger:hover {
  background: #fdf2f2;
  border-color: #e8a0a0;
}

.avatar-upload-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.avatar-upload .form-help {
  margin: 0;
}

.avatar-crop-modal {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: min(560px, 94vw);
  width: 100%;
  background: transparent;
}

.avatar-crop-modal::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.avatar-crop-dialog {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 20px;
}

.avatar-crop-title {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.avatar-crop-hint {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.avatar-crop-stage {
  width: 100%;
  max-height: 420px;
  background: #0f172a;
  border-radius: var(--radius);
  overflow: hidden;
}

.avatar-crop-image {
  display: block;
  max-width: 100%;
}

.avatar-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 0;
}

.form-group--checkbox {
  margin-top: 4px;
}

.form-group--checkbox .form-check-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
}

.form-group--checkbox .form-check-input {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--astro-blue);
}

.form-help {
  margin: 6px 0 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.form-hint {
  display: block;
  color: #6b7c93;
  font-size: 0.85rem;
  margin-top: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
  margin-bottom: 8px;
}

.form-group--full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid #e8edf5;
}

.card--form {
  padding-bottom: 28px;
}

.profile-header-meta {
  margin: 0 0 4px;
  opacity: 0.95;
  font-size: 1.05rem;
}

.profile-header-dept {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.probation-banner {
  background: #f8e3e3;
  color: #a12227;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-weight: 500;
}

.home-birthday-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.home-birthday-list a {
  display: block;
  padding: 6px 0;
  color: var(--dark-blue);
  font-weight: 500;
}

.home-birthday-date {
  display: inline-block;
  min-width: 42px;
  color: #6b7c93;
  font-weight: 400;
}

.profile-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  margin: 0 0 20px;
  padding: 16px;
  background: var(--white-blue);
  border-radius: 8px;
}

.profile-facts dt {
  font-weight: 500;
  color: #6b7c93;
  margin: 0;
}

.profile-facts dd {
  margin: 0;
  font-weight: 500;
}

.text-muted {
  color: #6b7c93;
  font-weight: 400;
}

.feed-card-title {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.feed-card-title a {
  color: var(--dark-blue);
}

.feed-card-title a:hover {
  color: var(--astro-blue);
}

.feed-card-preview {
  margin: 0 0 8px;
  color: #4a5568;
  white-space: pre-line;
}

.feed-read-more {
  display: inline-block;
  margin-bottom: 12px;
  font-weight: 500;
}

.feed-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  margin: 0 6px 6px 0;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.feed-tag:hover {
  background: var(--white-blue);
  color: var(--astro-blue);
}

.feed-tags {
  margin-bottom: 8px;
}

.tags-input-wrap {
  border: 1px solid #d0d9e8;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.tags-input-wrap:focus-within {
  border-color: var(--cloud-blue);
  box-shadow: 0 0 0 2px rgba(70, 157, 241, 0.15);
}

.tags-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.tags-chips:empty {
  margin-bottom: 0;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--white-blue);
  color: var(--astro-blue);
  border-radius: 999px;
  padding: 4px 8px 4px 12px;
  font-size: 0.85rem;
  font-weight: 500;
}

.tag-chip-remove {
  border: none;
  background: transparent;
  color: #6b7c93;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}

.tag-chip-remove:hover {
  color: var(--tango-red);
}

#id_tags_input {
  border: none !important;
  padding: 4px 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  width: 100%;
  min-width: 120px;
}

#id_tags_input:focus {
  outline: none;
}

.feed-card-meta,
.feed-article-meta {
  color: #6b7c93;
}

/* ——— Feed ——— */
.page-content:has(.feed-shell) {
  /* справа и между колонками — 12px; слева 18px (×1.5) за счёт сайдбара */
  padding: 28px 12px 48px 18px;
  max-width: none;
  width: 100%;
  background: var(--bg-app);
}

.feed-shell {
  width: 100%;
}

.feed-top {
  margin-bottom: 16px;
}

.feed-page {
  width: 100%;
  min-width: 0;
}

.feed-layout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.feed-layout .feed-page--with-sidebar {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  margin: 0;
}

.feed-sidebar {
  width: 354px;
  flex: 0 0 354px;
  min-width: 354px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-mobile-switch {
  display: none;
}

.feed-mobile-switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}

.feed-mobile-switch-tab {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.feed-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.feed-page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.feed-page-lead {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.feed-back {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--astro-blue);
}

.feed-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0;
}

.feed-filter {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.feed-filter:hover {
  border-color: var(--astro-blue);
  color: var(--astro-blue);
}

.feed-filter.is-active {
  background: var(--astro-blue);
  border-color: var(--astro-blue);
  color: #fff;
}

.feed-active-filter {
  margin: -8px 0 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.feed-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-sentinel {
  height: 1px;
}

.feed-load-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 0 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.feed-load-status[hidden] {
  display: none !important;
}

.feed-end {
  margin: 8px 0 0;
  padding: 12px 0 4px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-tertiary);
}

.feed-end[hidden] {
  display: none !important;
}

.feed-scroll-top {
  position: fixed;
  right: 4px;
  bottom: 28px;
  z-index: 40;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.feed-scroll-top:hover {
  background: var(--astro-blue);
  border-color: var(--astro-blue);
  color: #fff;
}

.feed-scroll-top[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .feed-scroll-top {
    right: 6px;
    bottom: 20px;
  }
}

.feed-load-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #d0d3d8;
  border-top-color: var(--astro-blue);
  border-radius: 50%;
  animation: feed-spin 0.7s linear infinite;
}

@keyframes feed-spin {
  to { transform: rotate(360deg); }
}

.feed-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.feed-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.feed-card--empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-secondary);
}

.feed-card--article {
  margin-bottom: 20px;
}

.feed-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 0;
}

.feed-card-header .feed-card-category {
  margin: 0;
}

.feed-author {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* Align author row with feed-card-body / feed-article horizontal inset */
.feed-card > .feed-author {
  padding: 10px 20px 0;
  box-sizing: border-box;
}

.feed-card--article > .feed-author {
  padding: 8px 16px 0;
}

.feed-author-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.feed-author-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.3;
  text-decoration: none;
}

a.feed-author-name:hover {
  color: var(--astro-blue);
  text-decoration: none;
}

.feed-author-meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 360px;
}

.feed-card-header-side {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.feed-card-time {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.feed-card-edit {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-size: 0.875rem;
  text-decoration: none;
}

.feed-card-edit:hover {
  background: var(--bg-subtle);
  color: var(--astro-blue);
}

.feed-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.feed-card-link:hover .feed-card-title {
  color: var(--astro-blue);
}

.feed-card-body {
  padding: 10px 20px 16px;
}

.feed-card-category {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--astro-blue);
  margin-bottom: 6px;
}

.feed-card-title {
  margin: 0 0 8px;
  font-size: 1.0625rem;
  font-weight: 600;
  font-family: var(--font-display);
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.feed-card-title a {
  color: inherit;
  text-decoration: none;
}

.feed-card-title a:hover {
  color: var(--astro-blue);
}

.feed-card-text,
.feed-card-preview {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.feed-card-tags {
  margin-top: 10px;
}

.feed-card-tags .feed-tag {
  font-size: 0.75rem;
  padding: 3px 10px;
  margin: 0 6px 0 0;
}

.feed-card-media {
  margin: 0 20px 16px;
  border-radius: var(--radius);
  background: var(--bg-subtle);
  max-height: 320px;
  overflow: hidden;
}

.feed-card-media img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
}

.feed-card-footer {
  padding: 0 20px 14px;
}

.feed-card-more {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--astro-blue);
}

.feed-card-more:hover {
  color: var(--astro-blue-hover);
}

.feed-card-social-wrap {
  padding: 10px 20px 16px;
  border-top: 1px solid var(--border);
}

.feed-social {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feed-like-btn,
.feed-comment-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.feed-like-btn:hover,
.feed-comment-link:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.feed-like-btn.is-liked {
  color: var(--tango-red);
  background: #FEF2F2;
}

.feed-like-btn.is-liked:hover {
  background: #FEE2E2;
}

.feed-read-more {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.84rem;
  font-weight: 600;
}

.home-birthday-soon {
  margin-left: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--astro-blue);
}

@media (max-width: 860px) {
  .page-content:has(.feed-shell) {
    padding-left: 12px;
    padding-right: 12px;
  }

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

@media (max-width: 1100px) {
  .feed-mobile-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
  }

  .feed-mobile-switch:has(#feed-view-list:checked) .feed-mobile-switch-tab[for="feed-view-list"],
  .feed-mobile-switch:has(#feed-view-events:checked) .feed-mobile-switch-tab[for="feed-view-events"] {
    background: var(--astro-blue);
    border-color: var(--astro-blue);
    color: #fff;
  }

  .feed-toolbar-text {
    display: none;
  }

  .feed-toolbar:not(:has(.feed-toolbar-actions)) {
    display: none;
  }

  .feed-layout {
    flex-direction: column;
  }

  .feed-sidebar {
    display: none;
    width: 100%;
    flex: none;
    min-width: 0;
  }

  .feed-shell:has(#feed-view-events:checked) .feed-page--with-sidebar,
  .feed-shell:has(#feed-view-events:checked) .feed-filters,
  .feed-shell:has(#feed-view-events:checked) .feed-toolbar {
    display: none;
  }

  .feed-shell:has(#feed-view-events:checked) .feed-sidebar {
    display: flex;
  }
}

.feed-like-icon svg,
.feed-comment-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.feed-comments {
  margin-top: 12px;
  padding: 16px 20px;
}

.feed-comments-title {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-family: "Roboto", sans-serif;
}

.feed-comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.feed-comment-composer {
  position: relative;
  border: 1px solid #d0d9e8;
  border-radius: 8px;
  background: #fff;
  overflow: visible;
}

.feed-comment-editor {
  min-height: 72px;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.94rem;
  line-height: 1.5;
  outline: none;
  word-break: break-word;
}

.feed-comment-editor:empty::before {
  content: attr(data-placeholder);
  color: #8a8d91;
  pointer-events: none;
}

.feed-comment-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-top: 1px solid #e4e6eb;
  background: #f7f8fa;
  border-radius: 0 0 8px 8px;
}

.feed-comment-tool {
  width: 36px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: #65676b;
  font-family: inherit;
}

.feed-comment-tool--label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--astro-blue);
  width: auto;
  min-width: 36px;
  padding: 0 6px;
}

.feed-comment-tool:hover {
  background: #e4e6eb;
}

.feed-comment-hint {
  margin-left: auto;
  font-size: 0.72rem;
  color: #8a8d91;
}

.sticker-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 10px;
  max-height: 220px;
  overflow-y: auto;
}

.sticker-picker-item {
  border: none;
  background: transparent;
  font-size: 1.35rem; /* как emoji-picker-item — крупными стикеры только после публикации */
  line-height: 1;
  padding: 6px;
  cursor: pointer;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.feed-comment-editor .feed-sticker {
  font-size: 1.35rem;
  line-height: 1;
  margin: 0;
  vertical-align: baseline;
}

.sticker-picker-item:hover {
  background: var(--bg-subtle);
  border-color: var(--astro-blue);
}

.feed-comment-content {
  font-size: 0.94rem;
  line-height: 1.5;
}

.feed-comment-content p {
  margin: 0 0 0.4em;
}

.feed-comment-content .feed-sticker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  line-height: 1;
  vertical-align: middle;
  margin: 4px 6px 4px 0;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle);
}

.feed-comment-content .feed-comment-img,
.feed-comment-content .feed-comment-gif {
  display: block;
  max-width: 100%;
  max-height: 240px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 8px 0;
  border-radius: 8px;
  background: #f0f2f5;
  cursor: zoom-in;
}

.feed-comment-content .feed-comment-gif {
  max-height: 200px;
}

.feed-comment-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d9e8;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.94rem;
  resize: vertical;
  min-height: 56px;
}

.feed-comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feed-comment {
  margin: 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--border);
}

.feed-comment-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.feed-comment-author-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.feed-comment-author {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.feed-comment-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

a.feed-comment-name:hover {
  color: var(--astro-blue);
}

.feed-comment-role {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.feed-comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: var(--text-tertiary);
  font-size: 0.78rem;
}

.feed-comment-edited {
  color: var(--text-tertiary);
}

.feed-comment-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.feed-comment-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: var(--text-tertiary);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0;
  font-family: inherit;
}

.feed-comment-action:hover {
  background: var(--bg-subtle);
  color: var(--astro-blue);
}

.feed-comment-content {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-primary);
  width: 100%;
}

.feed-comment-content p {
  margin: 0 0 0.5em;
}

.feed-comment-content .feed-comment-img {
  max-width: 100%;
  max-height: 280px;
  border-radius: 8px;
  display: block;
  margin: 6px 0;
}

.feed-comment-time {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.feed-comment-empty {
  padding: 12px 0;
  color: var(--text-secondary);
  list-style: none;
}

.feed-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.feed-publish-box {
  margin: 20px 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  overflow: hidden;
}

.feed-publish-box legend {
  padding: 0 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.feed-publish-box-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.form-hint--tight {
  margin-top: 4px;
}

.form-group--article-body {
  margin-top: 28px;
}

.corp-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
}

.corp-choice input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.corp-choice-ui {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 2px solid var(--border-strong, var(--border));
  background: var(--bg-surface);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.corp-choice-ui--radio {
  border-radius: 50%;
}

.corp-choice-ui--check {
  border-radius: 5px;
}

.corp-choice input:checked ~ .corp-choice-ui {
  border-color: var(--astro-blue);
  background: var(--astro-blue);
}

.corp-choice-ui--radio::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s ease;
}

.corp-choice input:checked ~ .corp-choice-ui--radio::after {
  transform: translate(-50%, -50%) scale(1);
}

.corp-choice-ui--check::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
}

.corp-choice input:checked ~ .corp-choice-ui--check::after {
  transform: rotate(45deg) scale(1);
}

.corp-choice input:focus-visible ~ .corp-choice-ui {
  box-shadow: 0 0 0 3px rgba(30, 79, 208, 0.15);
}

.corp-choice-label {
  color: var(--text-primary);
}

.feed-publish-modes {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.feed-publish-mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  cursor: pointer;
}

.feed-schedule-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.feed-schedule-fields {
  margin-top: 12px;
  max-width: 320px;
}

.feed-drafts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-draft-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.feed-draft-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.feed-draft-badge {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.feed-draft-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.feed-draft-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.feed-draft-title a:hover {
  color: var(--astro-blue);
}

.feed-draft-actions {
  display: flex;
  gap: 8px;
}

.feed-card-text {
  white-space: normal;
}

.ql-portal-tool {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  padding: 0;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

.ql-portal-tool:hover {
  color: var(--astro-blue);
  background: var(--bg-subtle);
}

.ql-portal-tool svg {
  display: block;
}



.home-quick-links-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.home-quick-links-list a {
  font-weight: 600;
  font-size: 0.9rem;
}

.feed-card--empty {
  padding: 40px 20px;
  text-align: center;
  color: #65676b;
}

.feed-back {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #65676b;
}

.feed-back:hover {
  color: var(--astro-blue);
}

.feed-article {
  padding: 4px 16px 20px;
}

.feed-article-title {
  margin: 2px 0 10px;
  font-size: 1.35rem;
  font-weight: 700;
  font-family: "Roboto", sans-serif;
  line-height: 1.3;
  color: #1c1e21;
}

.feed-article-content {
  padding-top: 8px;
}

.feed-plain-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.feed-plain-link:hover {
  color: inherit;
  text-decoration: none;
}

.thanks-post-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.thanks-post-title {
  margin: 0;
}

.thanks-post-message {
  margin-top: 16px;
  -webkit-line-clamp: unset;
}

.feed-card-body--thanks .thanks-post-message {
  margin-top: 10px;
  cursor: pointer;
}

.avatar-md {
  width: 48px;
  height: 48px;
  font-size: 1rem;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.875rem;
  min-height: 36px;
}

.feed-reading-layout {
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  font-weight: 500;
}

/* Rich article typography — editor + published (Brand: Roboto ~130% line-height) */
.post-content,
.rich-content.post-content,
.ql-editor.post-content {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: var(--line-height-body);
  color: var(--color-text-primary);
  word-wrap: break-word;
  max-width: 100%;
}

.rich-content {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: var(--line-height-body);
  color: var(--color-text-primary);
  word-wrap: break-word;
  max-width: 100%;
}

.post-content p,
.rich-content.post-content p,
.rich-content p {
  margin: 0 0 0.65em;
}

.post-content p:last-child,
.rich-content p:last-child {
  margin-bottom: 0;
}

.rich-content p:has(img) {
  display: flow-root;
}

.rich-content h1,
.rich-content h2,
.rich-content h3 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.35;
  margin: 1.6em 0 0.6em;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.rich-content h1:first-child,
.rich-content h2:first-child,
.rich-content h3:first-child {
  margin-top: 0;
}

.rich-content h1 { font-size: 1.5rem; }
.rich-content h2 { font-size: 1.3rem; }
.rich-content h3 { font-size: 1.15rem; }

.rich-content ul,
.rich-content ol {
  margin: 0 0 1.1em;
  padding-left: 1.4em;
}

.rich-content a {
  color: var(--astro-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.rich-content a:hover {
  color: var(--astro-blue-hover);
}

.ql-editor a {
  color: var(--astro-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.rich-content img,
.feed-article-content img,
.feed-article-body img {
  display: block;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  max-height: 420px;
  object-fit: contain;
  margin: 16px auto;
  border-radius: 8px;
  border: none;
  background: #f0f2f5;
  box-shadow: none;
  cursor: zoom-in;
}

.feed-article-content.rich-content img {
  width: calc(100% + 32px) !important;
  max-width: calc(100% + 32px) !important;
  margin: 16px -16px;
  border-radius: 0;
  max-height: 440px;
  object-fit: cover;
}

.rich-content img:hover,
.feed-article-content img:hover,
.feed-article-body img:hover {
  opacity: 0.96;
}

.rich-image-zoomable {
  cursor: zoom-in;
}

/* Image lightbox */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.image-lightbox[hidden] {
  display: none !important;
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 40, 66, 0.88);
  border: none;
  cursor: zoom-out;
}

.image-lightbox-img {
  position: relative;
  z-index: 1;
  /* Не увеличиваем маленькие; большие вписываем в экран целиком */
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  cursor: zoom-out;
  image-rendering: auto;
  image-rendering: high-quality;
  -ms-interpolation-mode: bicubic;
}

.image-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.image-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.image-lightbox-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
}

.rich-editor-mount {
  min-height: 280px;
  background: #fff;
}

.ql-container {
  font-family: "Roboto", sans-serif;
  font-size: 1rem;
}

.editor-with-emoji {
  position: relative;
}

.portal-editor-extras {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.ql-portal-emoji-legacy {
  width: 36px !important;
  height: 28px;
  padding: 2px 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  border-radius: 4px;
  line-height: 1;
}

.ql-portal-gif {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--astro-blue);
  width: auto !important;
  min-width: 36px;
}

.ql-portal-emoji:hover,
.ql-portal-gif:hover {
  background: var(--white-blue);
}

.emoji-picker {
  position: absolute;
  z-index: 200;
  left: 0;
  right: auto;
  top: 100%;
  margin-top: 8px;
  width: min(360px, 92vw);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(22, 40, 66, 0.18);
  border: 1px solid #e8edf5;
  overflow: hidden;
}

.portal-tool-wrap {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
}

.portal-emoji-field-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal-emoji-field-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.emoji-picker-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px 8px 0;
  border-bottom: 1px solid #e8edf5;
  background: var(--white-blue);
}

.emoji-picker-tab {
  border: none;
  background: transparent;
  padding: 6px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  color: #6b7c93;
  font-family: inherit;
}

.emoji-picker-tab.active {
  background: #fff;
  color: var(--astro-blue);
  font-weight: 500;
}

.emoji-picker-grid-wrap {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 10px;
  max-height: 220px;
  overflow-y: auto;
}

.emoji-picker-item {
  border: none;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
  border-radius: 6px;
}

.emoji-picker-item:hover {
  background: var(--white-blue);
}

.kbase-list {
  list-style: none;
  padding: 0;
}

.kbase-list li {
  padding: 8px 0;
  border-bottom: 1px solid #e8edf5;
}

.kbase-space-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.kb-page {
  max-width: 880px;
}

.kb-page--resources {
  max-width: none;
  width: 100%;
}

.kb-page--article-form {
  max-width: 960px;
}

.kb-rich-editor {
  min-height: 520px;
}

.kb-article-form .ql-editor,
.kb-page--article-form .ql-editor {
  min-height: 480px;
}

.kb-editors-field .kb-editors-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
}

.kb-editors-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}

.kb-editors-empty {
  color: var(--text-muted, #6b7c93);
  font-size: 0.9rem;
  padding: 6px 0;
}

.kb-editor-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  background: var(--bg-subtle, #f0f1f4);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.875rem;
  line-height: 1.3;
}

.kb-editor-chip-remove {
  border: none;
  background: transparent;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 4px;
  border-radius: 50%;
}

.kb-editor-chip-remove:hover {
  color: var(--tango-red);
  background: rgba(239, 68, 68, 0.08);
}

.kb-editors-add-wrap {
  position: relative;
}

.kb-editor-picker {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  width: 280px;
  max-width: min(280px, 90vw);
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
}

.kb-editor-picker .form-control {
  width: 100%;
  margin-bottom: 6px;
}

.kb-editor-picker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
}

.kb-editor-picker-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.kb-editor-picker-item:hover {
  background: var(--bg-subtle, #f0f1f4);
}

.kb-editor-picker-empty {
  padding: 10px;
  font-size: 0.85rem;
  color: var(--text-muted, #6b7c93);
}

.kb-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.kb-lead {
  margin: -8px 0 0;
  color: var(--text-muted, #6b7c93);
  max-width: 42rem;
}

.kb-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.kb-tree {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.kb-space {
  padding-left: calc(var(--kb-level, 0) * 1.25rem);
  border-left: 2px solid #e8edf5;
  margin-left: calc(var(--kb-level, 0) * 0.25rem);
  padding-bottom: 4px;
}

.kb-space-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.kb-space-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text, #1a2332);
  text-decoration: none;
}

.kb-space-title:hover {
  color: var(--astro-blue);
}

.kb-article-list,
.kb-list,
.kb-resource-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}

.kb-article-list {
  padding-left: 0.5rem;
}

.kb-article-list li,
.kb-list li,
.kb-resource-list li {
  padding: 8px 0;
  border-bottom: 1px solid #e8edf5;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: baseline;
}

.kb-article-list a,
.kb-list a,
.kb-resource-list a {
  color: var(--text, #1a2332);
  text-decoration: none;
}

.kb-article-list a:hover,
.kb-list a:hover,
.kb-resource-list a:hover {
  color: var(--astro-blue);
}

.kb-meta {
  color: var(--text-muted, #6b7c93);
  font-size: 0.85rem;
}

.kb-section {
  margin-bottom: 28px;
}

.kb-section-title {
  font-size: 1rem;
  margin: 0 0 8px;
  color: var(--text-muted, #6b7c93);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kb-article-body {
  margin-top: 8px;
  line-height: 1.65;
}

.kb-empty {
  padding: 24px;
  background: #f7f9fc;
  border-radius: 8px;
}

.kb-confirm-warning {
  color: var(--tango-red, #c0392b);
}

.btn-danger {
  background: var(--tango-red, #c0392b);
  color: #fff;
  border: none;
}

.btn-danger:hover {
  filter: brightness(0.92);
  color: #fff;
}

.feed-delete-form {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.btn-sm {
  padding: 6px 12px;
  min-height: 36px;
  font-size: 0.85rem;
}

.breadcrumbs {
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.rbac-matrix-wrap {
  overflow-x: auto;
}

.rbac-matrix {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.rbac-matrix th,
.rbac-matrix td {
  border: 1px solid #e8edf5;
  padding: 10px 12px;
  text-align: center;
}

.rbac-matrix th:first-child,
.rbac-matrix td:first-child {
  text-align: left;
  min-width: 220px;
}

.rbac-cell input {
  width: 18px;
  height: 18px;
}

.editor-grants {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.grant-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.form-errors {
  color: var(--tango-red);
  margin-bottom: 12px;
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.messages li {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.messages .success {
  background: var(--white-green);
  color: #1a6b3a;
}

.messages .error {
  background: #fde8e8;
  color: #a12227;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--astro-blue), var(--cloud-blue));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.avatar-lg {
  width: 80px;
  height: 80px;
  font-size: 1.5rem;
}

.avatar-org {
  width: 48px;
  height: 48px;
  font-size: 0.85rem;
}

.company-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--white-blue);
  color: var(--astro-blue);
  font-weight: 500;
}

.company-badge.skydns { border-left: 3px solid var(--astro-blue); }
.company-badge.safedns { border-left: 3px solid #F28740; }

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  padding: 4px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border-bottom: none;
  width: fit-content;
  max-width: 100%;
}

.tab {
  padding: 8px 16px;
  color: var(--text-secondary);
  border-bottom: none;
  border-radius: 6px;
  margin-bottom: 0;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.tab.active {
  color: var(--astro-blue);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.tab.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  padding: 4px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  width: fit-content;
  max-width: 100%;
}

.admin-tab {
  padding: 8px 16px;
  color: var(--text-secondary);
  border-radius: 6px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.admin-tab:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.admin-tab.active {
  color: var(--astro-blue);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.feed-category {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.profile-header {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 32px;
  margin-bottom: 24px;
  display: flex;
  gap: 24px;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.profile-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--astro-blue);
}

.profile-header--safedns::before {
  background: #F28740;
}

.profile-header--both::before {
  height: 8px;
  background: linear-gradient(180deg, var(--astro-blue) 0%, var(--astro-blue) 50%, #F28740 50%, #F28740 100%);
}

.profile-header h1,
.profile-header p {
  color: var(--text-primary);
}

.profile-header .avatar-lg {
  border: 3px solid var(--bg-surface);
  box-shadow: var(--shadow);
}

.avatar-zoomable {
  cursor: zoom-in;
}

.colleague-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  transition: background 0.2s;
}

.colleague-card:hover {
  background: var(--bg-subtle);
}

.colleague-card-phone {
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.colleague-card-focus {
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.colleague-card-meta {
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.profile-section-title {
  margin: 16px 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

.profile-what-i-do {
  margin: 0;
  white-space: pre-wrap;
}

.award-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.award-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 96px;
  text-align: center;
  position: relative;
}

.award-badge {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.award-item:hover .award-badge {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.award-badge--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--astro-blue);
}

.award-item-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.75rem;
  line-height: 1.25;
}

.award-item-meta strong {
  font-size: 0.8rem;
  font-weight: 600;
}

.award-assign-form {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}


.org-accordion {
  margin-bottom: 12px;
}

.org-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  min-height: 44px;
  width: 100%;
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.org-accordion-header:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.org-accordion-body {
  padding: 16px;
  display: none;
}

.org-accordion.open .org-accordion-body {
  display: block;
}

.org-tree {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.org-tree ul {
  list-style: none;
  padding-left: 24px;
  margin: 4px 0;
  border-left: 2px solid #e0ecff;
}

.org-node-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.org-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.stat-card {
  padding: 20px;
}

.stat-card--wide {
  grid-column: 1 / -1;
}

.stat-card-title {
  margin: 0 0 12px;
  font-size: 1rem;
}

.stat-card-sub {
  margin: -4px 0 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stat-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-bar-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.stat-bar-row--tenure {
  grid-template-columns: 88px minmax(0, 1fr) 36px;
}

.stat-bar-row--city {
  grid-template-columns: 140px minmax(0, 1fr) 36px;
}

.stat-bar-label {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.25;
}

.stat-bar-track {
  height: 12px;
  border-radius: 999px;
  background: #e8edf5;
  overflow: hidden;
}

.stat-bar-fill {
  display: block;
  height: 100%;
  min-width: 0;
  max-width: 100%;
  border-radius: 999px;
  background: var(--astro-blue);
}

.stat-bar-value {
  text-align: right;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-gender-bar {
  display: flex;
  height: 22px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8edf5;
  margin-bottom: 14px;
}

.stat-gender-bar-male {
  background: var(--astro-blue);
  min-width: 0;
}

.stat-gender-bar-female {
  background: #F472B6;
  min-width: 0;
}

.stat-gender-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stat-legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}

.stat-legend-dot--male {
  background: var(--astro-blue);
}

.stat-legend-dot--female {
  background: #F472B6;
}

.stat-headcount-chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  min-height: 360px;
  overflow-x: auto;
  padding: 8px 0 4px;
}

.stat-headcount-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 28px;
  flex: 1 0 auto;
}

.stat-headcount-value {
  margin-bottom: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text-secondary);
  white-space: nowrap;
}

.stat-headcount-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: var(--astro-blue);
}

.stat-headcount-label {
  margin-top: 6px;
  font-size: 0.68rem;
  line-height: 1;
  color: var(--text-tertiary);
  white-space: nowrap;
  writing-mode: horizontal-tb;
  transform: none;
}

@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-bar input,
.filter-bar select {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 40px;
  font-family: inherit;
  font-size: 0.875rem;
  background: var(--bg-surface);
  color: var(--text-primary);
}

.widget-stub {
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  padding: 20px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

/* ——— Home page ——— */
.home-hero {
  margin-bottom: 28px;
}

.home-hero-title {
  margin: 0 0 6px;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.home-hero-sub {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.home-section-title {
  margin: 0 0 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

.home-quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-quick-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.home-quick-link:hover {
  border-color: var(--astro-blue);
  box-shadow: var(--shadow-sm);
  color: var(--astro-blue);
}

.home-quick-link-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--white-blue);
  color: var(--astro-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.home-news-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.home-news-item:first-child {
  padding-top: 0;
}

.home-news-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.home-widget {
  border: 1px solid var(--border);
}

.home-birthday-list a {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.home-birthday-list li:last-child a {
  border-bottom: none;
}

.home-birthday-date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 44px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8125rem;
}

.home-birthday-date.is-current {
  background: var(--white-blue);
  color: var(--astro-blue);
}

.home-birthday-name {
  min-width: 0;
  flex: 1;
  line-height: 1.35;
}

.changelog-content h2 {
  margin-top: 32px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--astro-blue);
}

.changelog-content h2:first-child {
  margin-top: 0;
}

.changelog-content ul {
  padding-left: 20px;
}

.login-page {
  flex: 1;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-app);
  box-sizing: border-box;
}

.login-card {
  background: var(--bg-surface);
  padding: 40px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-card h1 {
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 24px;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.burger-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  color: var(--dark-blue);
}

@media (max-width: 900px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .burger-btn {
    display: block;
    margin-right: auto;
  }

  .org-grid,
  .home-grid {
    grid-template-columns: 1fr;
  }
}

.work-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-at-work { background: #e8f5ec; color: #1b6b3a; }
.status-remote { background: #e8f0fe; color: #1a4f9c; }
.status-vacation { background: #fff4e5; color: #9a5b00; }
.status-sick { background: #fdecea; color: #a12227; }
.status-away { background: #f1f3f5; color: #5c6b7a; }

.colleague-card .work-status-badge {
  margin-right: 8px;
}

.work-status-badge--profile-header {
  margin-top: 10px;
}

.filter-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.thanks-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.thanks-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border, #e8ecf1);
}

.thanks-item:last-child {
  border-bottom: none;
}

.thanks-item-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.thanks-item-head-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.thanks-item-edit {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 1rem;
  line-height: 1;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.thanks-item-edit:hover {
  color: var(--astro-blue);
  background: var(--white-blue);
}

.thank-delete-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.thanks-item-sender {
  font-size: 1.05rem;
}

.thanks-message {
  margin: 0;
  color: #3d4f61;
}

.thanks-item-social {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
}

.thanks-item-social .feed-social {
  margin: 0;
  padding: 0;
  border: 0;
  gap: 16px;
}

.thanks-item-social-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

a.thanks-item-social-item:hover {
  color: var(--astro-blue);
}

.thanks-list--compact .thanks-item {
  padding: 10px 0;
}

.thank-modal {
  border: none;
  border-radius: var(--radius, 12px);
  padding: 24px;
  max-width: 480px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
}

.thank-modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.home-thanks-form textarea {
  width: 100%;
  margin-top: 10px;
}

.audit-log-wrap {
  overflow-x: auto;
}

.audit-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.audit-log-table th,
.audit-log-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #e8ecf1);
  vertical-align: top;
}

.audit-log-date {
  white-space: nowrap;
  color: #6b7c93;
}

.pagination-nav {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
}

.adaptation-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.adaptation-progress-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 600;
}

.adaptation-progress-bar {
  height: 10px;
  background: #ecfef1;
  border-radius: 999px;
  overflow: hidden;
}

.adaptation-progress-fill {
  height: 100%;
  background: #76f1a3;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.adaptation-progress-stats {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 0.92rem;
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.community-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.community-card__icon {
  font-size: 1.75rem;
  line-height: 1;
}

.community-card__title {
  margin: 0;
  font-size: 1.1rem;
}

.community-card__desc {
  margin: 0 0 12px;
  color: var(--text-muted, #5a6b85);
}

.community-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.community-member-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.community-member-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle, rgba(32, 74, 178, 0.12));
}

.community-back {
  margin: 0 0 12px;
}

.community-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  margin-top: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .community-layout {
    grid-template-columns: 1fr;
  }
}

.community-page-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.community-page-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.community-composer textarea {
  width: 100%;
  min-height: 72px;
}

.community-post {
  margin-bottom: 14px;
}

.community-post__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.community-post__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.community-react-form {
  margin: 0;
}

.community-react-btn {
  border: 1px solid var(--border-subtle, rgba(32, 74, 178, 0.2));
  background: transparent;
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  font: inherit;
}

.community-react-btn.is-active {
  background: rgba(118, 241, 163, 0.25);
  border-color: #76f1a3;
}

.community-post-comments {
  margin-top: 12px;
}

.community-comment-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.community-comment-list li {
  padding: 8px 0;
  border-top: 1px solid var(--border-subtle, rgba(32, 74, 178, 0.1));
}

.community-post-deleted {
  font-style: italic;
  margin: 0;
}

.community-hero {
  position: relative;
  border-radius: var(--radius, 12px);
  padding: 20px 22px;
  margin-bottom: 12px;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    var(--community-hero-from, rgba(32, 74, 178, 0.12)),
    var(--community-hero-to, rgba(118, 241, 163, 0.08))
  );
  border: 1px solid var(--border-subtle, rgba(32, 74, 178, 0.14));
}

.community-hero__glow {
  position: absolute;
  inset: -40% 40% auto -20%;
  height: 140%;
  background: radial-gradient(circle, var(--community-glow, rgba(118, 241, 163, 0.25)), transparent 65%);
  pointer-events: none;
  opacity: 0.7;
}

.community-hero__inner {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.community-hero__icon {
  font-size: 2rem;
  line-height: 1;
  margin: 0 0 6px;
}

.community-hero__title {
  margin: 0 0 8px;
  font-size: 1.45rem;
  text-transform: none;
  letter-spacing: normal;
}

.community-hero__desc {
  margin: 0 0 12px;
  color: var(--text-muted, #5a6b85);
  max-width: 52ch;
}

.community-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
}

.community-hero__avatars {
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0;
}

.community-hero__avatars li {
  margin-left: -6px;
}

.community-hero__avatars li:first-child {
  margin-left: 0;
}

.community-hero__avatars-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: var(--surface-elevated, #fff);
  border: 1px solid var(--border-subtle, rgba(32, 74, 178, 0.18));
}

.community-hero__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.community-hero--movies {
  --community-hero-from: rgba(88, 52, 170, 0.14);
  --community-hero-to: rgba(32, 74, 178, 0.08);
  --community-glow: rgba(136, 96, 255, 0.22);
}

.community-hero--games {
  --community-hero-from: rgba(32, 74, 178, 0.16);
  --community-hero-to: rgba(118, 241, 163, 0.1);
  --community-glow: rgba(118, 241, 163, 0.28);
}

.community-hero--fishing {
  --community-hero-from: rgba(24, 120, 160, 0.14);
  --community-hero-to: rgba(118, 241, 163, 0.08);
  --community-glow: rgba(64, 180, 220, 0.22);
}

.community-hero--books {
  --community-hero-from: rgba(160, 88, 40, 0.12);
  --community-hero-to: rgba(32, 74, 178, 0.06);
  --community-glow: rgba(220, 160, 96, 0.2);
}

.community-hero--cooking {
  --community-hero-from: rgba(200, 88, 120, 0.12);
  --community-hero-to: rgba(255, 200, 160, 0.1);
  --community-glow: rgba(255, 160, 200, 0.22);
}

.community-hero--sport {
  --community-hero-from: rgba(32, 140, 100, 0.14);
  --community-hero-to: rgba(118, 241, 163, 0.1);
  --community-glow: rgba(76, 200, 140, 0.24);
}

.community-hero--pets {
  --community-hero-from: rgba(180, 120, 60, 0.12);
  --community-hero-to: rgba(32, 74, 178, 0.06);
  --community-glow: rgba(240, 180, 100, 0.2);
}

.community-hero--it {
  --community-hero-from: rgba(32, 74, 178, 0.18);
  --community-hero-to: rgba(64, 200, 255, 0.08);
  --community-glow: rgba(96, 180, 255, 0.22);
}

.community-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0 0 16px;
  font-size: 0.92rem;
}

.community-subnav a {
  color: var(--link, #204ab2);
  text-decoration: none;
}

.community-subnav a:hover {
  text-decoration: underline;
}

.community-about {
  margin-bottom: 16px;
}

.community-about__desc {
  margin: 0 0 12px;
  color: var(--text-muted, #5a6b85);
}

.community-about__subtitle {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

.community-about__list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted, #5a6b85);
}

.community-about__list li {
  margin: 4px 0;
}

.community-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.community-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.community-side-block {
  padding: 14px 16px;
}

.community-activity-line {
  margin: 0;
  font-size: 0.92rem;
}

.community-popular-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.community-popular-list li {
  padding: 10px 0;
  border-top: 1px solid var(--border-subtle, rgba(32, 74, 178, 0.1));
  font-size: 0.9rem;
}

.community-popular-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.community-popular-list a {
  display: block;
  margin-bottom: 4px;
}

.community-join-hint {
  padding: 14px 16px;
  margin-bottom: 14px;
  color: var(--text-muted, #5a6b85);
}

.community-empty {
  text-align: center;
  padding: 24px 20px;
  margin-bottom: 16px;
}

.community-empty__icon {
  font-size: 2.25rem;
  margin: 0 0 8px;
}

.community-empty__title {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.community-empty__lead {
  margin: 0 0 14px;
  color: var(--text-muted, #5a6b85);
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}

.community-empty__ideas-label {
  margin: 16px 0 6px;
  font-size: 0.88rem;
  color: var(--text-muted, #5a6b85);
}

.community-empty__ideas {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 28ch;
  text-align: left;
  font-size: 0.9rem;
  color: var(--text-muted, #5a6b85);
}

.community-empty__ideas li::before {
  content: "• ";
}

.community-feed__posts-title {
  margin: 8px 0 12px;
  font-size: 1rem;
  font-weight: 600;
}

.community-composer {
  padding: 14px 16px;
  margin-bottom: 14px;
}

.community-composer__details summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
}

.community-composer__details summary::-webkit-details-marker {
  display: none;
}

.community-composer__form {
  margin-top: 12px;
}

.community-composer__actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.community-post__author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.community-post__author {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.community-post__role {
  font-size: 0.85rem;
}

.community-post__time {
  font-size: 0.85rem;
  white-space: nowrap;
}

.community-post--system {
  border-color: rgba(32, 74, 178, 0.12);
  background: rgba(32, 74, 178, 0.03);
}

.community-comment__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.community-comment-form__submit {
  margin-top: 8px;
}

.community-member-list--rich li {
  border-bottom: none;
  padding: 6px 0;
}

.community-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.community-member-row:hover .community-member-row__name {
  color: var(--link, #204ab2);
}

.community-members-all {
  margin-top: 10px;
}

.community-members-all__link {
  cursor: pointer;
  color: var(--link, #204ab2);
  font-size: 0.92rem;
}

.community-members-all__link::-webkit-details-marker {
  display: none;
}

.adaptation-risk-banner {
  background: #fff4e5;
  color: #9a5b00;
  border-radius: var(--radius, 12px);
  padding: 12px 16px;
  margin: 16px 0;
  font-weight: 500;
}

.adaptation-risk-label {
  color: #a12227;
  font-weight: 600;
}

.adaptation-stage {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e8ecf1);
}

.adaptation-stage:first-child {
  border-top: none;
  padding-top: 0;
}

.adaptation-task-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.adaptation-task-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border, #e8ecf1);
}

.adaptation-task-overdue {
  background: #fff8f8;
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
}

.adaptation-task-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}

.adaptation-task-status {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 8px;
}

.adaptation-task-status--done { background: #ecfef1; color: #1b6b3a; }
.adaptation-task-status--in_progress { background: #e8f0fe; color: #1a4f9c; }
.adaptation-task-status--pending { background: #f1f3f5; color: #5c6b7a; }

.criterion-list, .meeting-list, .feedback-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.criterion-item, .meeting-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border, #e8ecf1);
}

.criterion-status {
  margin-left: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.criterion-status--met { color: #1b6b3a; }
.criterion-status--at_risk { color: #9a5b00; }
.criterion-status--not_met { color: #a12227; }

.adaptation-dashboard-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.adaptation-stat {
  text-align: center;
  padding: 20px;
}

.adaptation-stat strong {
  display: block;
  font-size: 2rem;
  line-height: 1.1;
}

.adaptation-stat--risk strong {
  color: #a12227;
}

.nav-progress-badge {
  margin-left: auto;
  font-size: 0.7rem;
  background: #ecfef1;
  color: #1b6b3a;
  padding: 2px 6px;
  border-radius: 999px;
}

.adaptation-private {
  border-left: 4px solid #f8e3e3;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .adaptation-dashboard-stats {
    grid-template-columns: 1fr;
  }
}


/* ——— Gamification 2.0 ——— */
.gm-hero {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 20px;
  padding: 28px;
  margin-bottom: 16px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 85% 20%, rgba(118,241,163,0.25), transparent 40%),
    linear-gradient(135deg, #1E4FD0 0%, #163FA8 55%, #0F172A 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.gm-eyebrow { margin: 0 0 8px; opacity: 0.85; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; }
.gm-hero-title { margin: 0 0 8px; font-size: 2rem; color: #fff; }
.gm-hero-sub { margin: 0 0 12px; color: #76F1A3; font-weight: 600; }
.gm-hero-lead { margin: 0 0 18px; max-width: 46ch; color: rgba(255,255,255,0.88); }
.gm-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gm-hero .btn-secondary { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.25); }
.gm-hero .btn-secondary:hover { background: rgba(255,255,255,0.2); color: #fff; }
.gm-hero-side { position: relative; display: flex; align-items: center; justify-content: center; }
.gm-balance-card {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 20px 22px;
  min-width: 200px;
}
.gm-balance-label { font-size: 0.85rem; opacity: 0.8; }
.gm-balance-value { font-size: 2.4rem; font-weight: 700; line-height: 1.1; margin: 6px 0; }
.gm-balance-value small { font-size: 1rem; opacity: 0.8; }
.gm-balance-note { margin: 0; font-size: 0.75rem; opacity: 0.75; max-width: 22ch; }
.gm-coin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.9em;
  height: 0.9em;
  margin-right: 8px;
  vertical-align: -0.12em;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.28));
}
.gm-coin svg {
  display: block;
  width: 100%;
  height: 100%;
}
.gm-pixel { position: absolute; width: 14px; height: 14px; border-radius: 3px; opacity: 0.7; }
.gm-pixel-a { background: #76F1A3; top: 18%; right: 8%; }
.gm-pixel-b { background: #469DF1; bottom: 22%; left: 6%; width: 10px; height: 10px; }

.gm-howto {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}
.gm-howto li {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--white-blue);
  color: var(--text-primary);
  font-size: 0.95rem;
}
.gm-howto strong { color: var(--astro-blue); margin-right: 4px; }

.gm-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}
.gm-status--draft { background: #F1F5F9; color: #475569; }
.gm-status--pending_manager { background: #FEF3C7; color: #92400E; }
.gm-status--rejected_manager,
.gm-status--rejected_operator { background: #FEE2E2; color: #991B1B; }
.gm-status--pending_operator { background: #DBEAFE; color: #1E40AF; }
.gm-status--awarded { background: #DCFCE7; color: #166534; }
.gm-status--closed { background: #E2E8F0; color: #334155; }

.gm-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}
.gm-progress-step {
  position: relative;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}
.gm-progress-step.is-done { background: #DCFCE7; color: #166534; }
.gm-progress-step.is-current { background: var(--white-blue); color: var(--astro-blue); box-shadow: inset 0 0 0 1px var(--cloud-blue); }
.gm-progress-step.is-failed { background: #FEE2E2; color: #991B1B; }

.gm-shop-afford { margin: 8px 0 0; font-size: 0.82rem; font-weight: 600; }
.gm-shop-afford--ok { color: #15803D; }
.gm-shop-afford--need { color: #B45309; }
.gm-shop-card--need { opacity: 0.92; }

.gm-live-sum {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: baseline;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 0.95rem;
}
.gm-live-sum-note { color: var(--text-secondary); font-size: 0.85rem; }
.gm-live-sum-note--warn { color: #B45309; font-weight: 600; }

.gm-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 12px; padding: 6px; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: 14px;
}
.gm-tab {
  padding: 8px 14px; border-radius: 10px; color: var(--text-secondary); font-weight: 500;
}
.gm-tab:hover { background: var(--bg-subtle); color: var(--text-primary); }
.gm-tab.active { background: var(--white-blue); color: var(--astro-blue); }

.gm-help-bar {
  display: flex; flex-wrap: wrap; gap: 12px 18px;
  margin-bottom: 16px; font-size: 0.9rem;
}

.gm-queues { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.gm-queue-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.gm-queue-card h3 { margin: 0 0 8px; font-size: 0.95rem; }
.gm-queue-card a { display: block; padding: 6px 0; border-bottom: 1px solid var(--border); }
.gm-queue-card a:last-child { border-bottom: 0; }

.gm-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px 24px;
  box-shadow: var(--shadow-sm);
}
.gm-panel-head { margin-bottom: 18px; }
.gm-panel-head h2 { margin: 0 0 6px; }
.gm-panel-head p { margin: 0; color: var(--text-secondary); }

.gm-season-banner {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 18px; align-items: center;
  padding: 18px; border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #EEF2FF, #ECFDF3);
  margin-bottom: 16px;
}
.gm-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: #22C55E; color: #fff; font-size: 0.75rem; font-weight: 600;
}
.gm-season-banner h2 { margin: 8px 0; }
.gm-season-points { margin: 10px 0 0; padding-left: 18px; color: var(--text-secondary); }
.gm-poster {
  width: 100%;
  max-width: 260px;
  height: auto;
  border-radius: 14px;
  box-shadow: var(--shadow);
  object-fit: contain;
  justify-self: end;
}
.gm-home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gm-home-tile {
  display: block; padding: 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: #fff; color: inherit;
  transition: border-color .15s, transform .15s;
}
.gm-home-tile:hover { border-color: var(--cloud-blue); transform: translateY(-1px); color: inherit; }
.gm-home-tile strong { display: block; margin-bottom: 6px; }
.gm-home-tile span { color: var(--text-secondary); font-size: 0.9rem; }

.gm-group { margin-bottom: 22px; }
.gm-group h3 { margin: 0 0 12px; }
.gm-group--season {
  padding: 16px; border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(70,157,241,0.08), rgba(34,197,94,0.08));
  border: 1px solid rgba(70,157,241,0.2);
}
.gm-act-grid, .gm-shop-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px;
}
.gm-act-card, .gm-shop-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 14px 16px; position: relative;
}
.gm-act-card h4, .gm-shop-card h3 { margin: 0 0 6px; font-size: 0.98rem; }
.gm-act-card p { margin: 0; color: var(--text-secondary); font-size: 0.85rem; }
.gm-act-points, .gm-shop-price {
  display: inline-flex; align-items: baseline; gap: 4px;
  margin-bottom: 8px; padding: 4px 10px; border-radius: 999px;
  background: var(--white-green); color: #15803D; font-weight: 700; font-size: 0.9rem;
}
.gm-act-points span, .gm-shop-price span { font-weight: 500; font-size: 0.75rem; }

.gm-shop-hero {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
  padding: 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
}
.gm-shop-hero img {
  width: auto;
  max-width: min(100%, 360px);
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
}
.gm-shop-note { margin-top: 14px; color: var(--text-secondary); font-size: 0.9rem; }
.gm-help-balance { color: var(--text-secondary); font-size: 0.9rem; }
.gm-help-balance a { font-weight: 600; }

.gm-request-cols { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 16px; margin-bottom: 14px; }
.gm-request-form fieldset {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 0;
}
.gm-request-form legend { padding: 0 6px; font-weight: 600; }
.gm-check-grid { display: grid; gap: 8px; max-height: 420px; overflow: auto; }
.gm-check-card {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; cursor: pointer;
}
.gm-check-card:has(input:checked) {
  border-color: var(--astro-blue); background: var(--white-blue);
}
.gm-check-card input { margin-top: 3px; }
.gm-subhead { margin: 24px 0 10px; font-size: 1.05rem; }
.gm-list { list-style: none; padding: 0; margin: 0; }
.gm-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}

.gm-tx-list { list-style: none; padding: 0; margin: 0; }
.gm-tx { padding: 12px 0; border-bottom: 1px solid var(--border); }
.gm-tx-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.gm-receipt { list-style: none; padding: 8px 0 0; margin: 0; }
.gm-receipt li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; color: var(--text-secondary); font-size: 0.9rem; }

.gm-faq details {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; background: #fff;
}
.gm-faq summary { cursor: pointer; font-weight: 600; }
.gm-faq details p { margin: 8px 0 0; color: var(--text-secondary); }

@media (max-width: 900px) {
  .gm-hero, .gm-season-banner, .gm-home-grid, .gm-request-cols, .gm-howto, .gm-progress { grid-template-columns: 1fr; }
  .gm-poster { max-width: 220px; justify-self: start; }
}


/* ——— Gamification check (last 5, like Iris) ——— */
.gm-check {
  margin: 20px 0 24px;
  padding: 18px 20px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #fafafa 0%, #fff 40%);
  max-width: 520px;
}
.gm-check--full { max-width: 560px; }
.gm-check-head h2 { margin: 0 0 4px; font-size: 1.15rem; }
.gm-check-head p { margin: 0 0 14px; color: var(--text-secondary); font-size: 0.9rem; }
.gm-check-balance {
  padding: 8px 0 12px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.gm-check-lines {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
}
.gm-check-lines > li {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px dotted rgba(0,0,0,.08);
}
.gm-check-sub {
  opacity: 0.75;
  font-size: 0.82rem;
  padding-left: 0.5rem;
}
.gm-check-amt { font-weight: 700; }
.gm-check-title { color: var(--text); }
.gm-check-date { color: var(--text-secondary); font-size: 0.8rem; white-space: nowrap; }
.gm-check-footnote {
  margin: 14px 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
}
.gm-check-more {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.9rem;
}
.gm-check-empty { margin: 0; }
.tx-plus { color: #15803d; }
.tx-minus { color: #b45309; }


/* ——— Admin: portal activity ——— */
.activity-period-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 6px;
}
.activity-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 0.9rem;
  text-decoration: none;
}
.activity-chip:hover { border-color: var(--text-secondary); }
.activity-chip.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.activity-period-range {
  margin: 0 0 18px;
  font-size: 0.85rem;
}
.activity-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.activity-kpi {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.activity-kpi-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.activity-kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
}
.activity-kpi-value small {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.activity-kpi-hint {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.activity-section-title {
  margin: 0;
  font-size: 1.05rem;
}
.activity-chart-card { margin-bottom: 18px; }
.activity-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 160px;
  padding: 8px 4px 0;
  overflow-x: auto;
}
.activity-chart-col {
  flex: 1 1 28px;
  min-width: 28px;
  max-width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.activity-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  width: 100%;
  justify-content: center;
}
.activity-chart-bar {
  width: 10px;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: #94a3b8;
}
.activity-chart-bar--logins { background: #2563eb; }
.activity-chart-bar--actions { background: #0f766e; }
.activity-chart-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}
.activity-chart-legend {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.activity-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.activity-dot--logins { background: #2563eb; }
.activity-dot--actions { background: #0f766e; }
.activity-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.activity-list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.activity-table td:nth-child(3),
.activity-table td:nth-child(4),
.activity-table th:nth-child(3),
.activity-table th:nth-child(4) {
  text-align: right;
  width: 72px;
}
.activity-absent-filter { margin-bottom: 10px; }
.activity-absent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 480px;
  overflow: auto;
}
.activity-absent-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.activity-absent-list li:last-child { border-bottom: 0; }
@media (max-width: 900px) {
  .activity-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-two-col { grid-template-columns: 1fr; }
}

.activity-filters {
  margin: 8px 0 12px;
  align-items: center;
}
.activity-filter-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.activity-compare {
  margin: -6px 0 16px;
  font-size: 0.9rem;
}
.activity-list-actions {
  font-size: 0.85rem;
  white-space: nowrap;
}
.tx-plus { color: #15803d; }
.tx-minus { color: #b45309; }
