/* ============================================================
   Docs Portal — Klarrro
   docs.klarrro.app
   ============================================================ */

/* ── Page scroll fix (override base.css height:100%) ────────── */
html.docs-root,
html.docs-root body {
  height: auto !important;
  min-height: 100vh;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
}

/* ── Page wrapper ────────────────────────────────────────────── */
.docs-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: #09090E;
  color: #EDE9F6;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  position: relative;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.docs-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('/assets/img/grain.png') repeat;
  opacity: 0.028;
  pointer-events: none;
  z-index: 0;
}

/* ── Header ──────────────────────────────────────────────────── */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  gap: 16px;
  background: rgba(9, 9, 14, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.docs-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.docs-header__logo {
  height: 32px;
  flex-shrink: 0;
}

.docs-header__title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: #ABA3C2;
}

.docs-header__center {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  justify-content: center;
}

.docs-header__right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.docs-header__user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #ABA3C2;
  flex-shrink: 0;
}

.docs-user-badge {
  font-weight: 600;
  color: #EDE9F6;
  font-size: 13px;
}

.docs-user-role {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(224, 82, 122, 0.12);
  color: #E0527A;
}

/* ── Role dropdown ───────────────────────────────── */
.docs-role-switch {
  position: relative;
  cursor: pointer;
  user-select: none;
}
.docs-role-switch__trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(224, 82, 122, 0.10);
  border: 1px solid rgba(224, 82, 122, 0.15);
  transition: background 0.15s, border-color 0.15s;
  font-size: 12px;
  font-weight: 700;
  color: #E0527A;
  white-space: nowrap;
}
.docs-role-switch__trigger:hover {
  background: rgba(224, 82, 122, 0.18);
  border-color: rgba(224, 82, 122, 0.3);
}
.docs-role-switch__icon { font-size: 14px; }
.docs-role-switch__chevron {
  font-size: 10px;
  opacity: 0.6;
  transition: transform 0.15s;
}
.docs-role-switch.open .docs-role-switch__chevron {
  transform: rotate(180deg);
}
.docs-role-switch__menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: #16162C;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 6px;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.docs-role-switch.open .docs-role-switch__menu {
  display: block;
}
.docs-role-switch__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #ABA3C2;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.docs-role-switch__item:hover {
  background: rgba(255,255,255,0.05);
  color: #EDE9F6;
}
.docs-role-switch__item.active {
  background: rgba(224, 82, 122, 0.12);
  color: #E0527A;
  font-weight: 700;
}
.docs-role-switch__item-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
}

.docs-logout-btn {
  border: none;
  outline: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  color: #8A839E;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.docs-logout-btn:hover {
  background: rgba(248, 113, 113, 0.15);
  color: #F87171;
}

/* ── Language switcher ──────────────────────────────────────── */
.docs-lang {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 2px;
}

.docs-lang__btn {
  border: none;
  outline: none;
  cursor: pointer;
  background: transparent;
  color: #8A839E;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.docs-lang__btn:hover { color: #EDE9F6; }
.docs-lang__btn.active { background: rgba(224, 82, 122, 0.2); color: #E0527A; }

/* ── Search ─────────────────────────────────────────────────── */
.docs-search {
  flex: 0 1 320px;
}

.docs-search__input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 13px;
  color: #EDE9F6;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.docs-search__input::placeholder { color: #8A839E; }
.docs-search__input:focus {
  border-color: rgba(224, 82, 122, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

/* ── Main content ────────────────────────────────────────────── */
.docs-main {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 28px 80px;
}

/* ── Loading ─────────────────────────────────────────────────── */
.docs-loading {
  text-align: center;
  padding: 64px 24px;
  color: #8A839E;
  font-size: 15px;
}

/* ── Category filter pills ──────────────────────────────────── */
.docs-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.docs-filter-pill {
  border: none;
  outline: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  color: #ABA3C2;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 13px;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.docs-filter-pill:hover {
  color: #EDE9F6;
  background: rgba(255, 255, 255, 0.1);
}

.docs-filter-pill.active {
  background: #E0527A;
  color: #fff;
}

/* ── Sections ────────────────────────────────────────────────── */
.docs-section {
  margin-bottom: 40px;
}

.docs-section__title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: #EDE9F6;
  margin: 0 0 20px 0;
}

/* ── Recommended carousel ────────────────────────────────────── */
.docs-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 8px;
}

.docs-carousel::-webkit-scrollbar { display: none; }

.docs-carousel .docs-card {
  min-width: 260px;
  max-width: 300px;
  flex-shrink: 0;
}

/* ── Grid ────────────────────────────────────────────────────── */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ── Card ────────────────────────────────────────────────────── */
.docs-card {
  position: relative;
  background: #16162C;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s, opacity 0.1s;
  overflow: hidden;
  animation: docsFadeIn 0.4s ease both;
}

.docs-card:focus-visible { outline: 2px solid #E0527A; outline-offset: 2px; }

.docs-card:hover {
  transform: translateY(-2px);
  border-color: rgba(224, 82, 122, 0.3);
  box-shadow: 0 4px 24px rgba(224, 82, 122, 0.12);
}

.docs-card__icon { font-size: 24px; margin-bottom: 8px; line-height: 1; }

.docs-card__title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  color: #EDE9F6;
  margin-bottom: 6px;
}

.docs-card__desc {
  font-size: 13px;
  color: #ABA3C2;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.docs-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.docs-card__link-badge {
  font-size: 11px;
  font-weight: 700;
  color: #F8BF45;
  margin-top: 8px;
  letter-spacing: 0.02em;
}

/* ── Tags ────────────────────────────────────────────────────── */
.docs-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #ABA3C2;
}

.docs-tag--category { color: #C4B5FD; background: rgba(196, 181, 253, 0.12); }
.docs-tag--draft { color: #F8BF45; background: rgba(248, 191, 69, 0.12); }
.docs-tag--small { font-size: 10px; padding: 2px 8px; color: #8A839E; }

/* ── Breadcrumb ──────────────────────────────────────────────── */
.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #8A839E;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.docs-breadcrumb__link {
  color: #E0527A;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.docs-breadcrumb__link:hover { color: #EE7A97; }
.docs-breadcrumb__sep { color: #8A839E; }
.docs-breadcrumb__item { color: #ABA3C2; }
.docs-breadcrumb__current { color: #EDE9F6; font-weight: 600; }

/* ── Back button ─────────────────────────────────────────────── */
.docs-back-btn {
  border: none;
  outline: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  color: #ABA3C2;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  transition: background 0.2s, color 0.2s;
}

.docs-back-btn:hover { background: rgba(255, 255, 255, 0.1); color: #EDE9F6; }

/* ── Article detail ──────────────────────────────────────────── */
.docs-article {
  max-width: 760px;
  margin: 0 auto;
}

.docs-article__header {
  margin-bottom: 32px;
}

.docs-article__icon {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
}

.docs-article__title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 800;
  color: #EDE9F6;
  margin: 0 0 12px 0;
  line-height: 1.25;
}

.docs-article__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #8A839E;
  flex-wrap: wrap;
}

.docs-article__body {
  font-size: 15px;
  line-height: 1.75;
  color: #ABA3C2;
  margin-bottom: 32px;
}

.docs-article__body h1,
.docs-article__body h2,
.docs-article__body h3,
.docs-article__body h4 {
  font-family: 'Playfair Display', serif;
  color: #EDE9F6;
  margin-top: 2em;
  margin-bottom: 0.5em;
}

.docs-article__body h2 { font-size: 22px; font-weight: 700; }
.docs-article__body h3 { font-size: 18px; font-weight: 700; }

.docs-article__body p { margin: 0 0 1em 0; }

.docs-article__body a { color: #E0527A; text-decoration: underline; }
.docs-article__body a:hover { color: #EE7A97; }

.docs-article__body ul, .docs-article__body ol {
  margin: 0 0 1em 1.5em;
}

.docs-article__body li { margin-bottom: 0.3em; }

.docs-article__body code {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
}

.docs-article__body pre {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 0 0 1em 0;
}

.docs-article__body pre code {
  background: none;
  padding: 0;
}

.docs-article__body img {
  max-width: 100%;
  border-radius: 8px;
}

.docs-article__body blockquote {
  border-left: 3px solid #E0527A;
  padding-left: 16px;
  margin: 1em 0;
  color: #ABA3C2;
  font-style: italic;
}

.docs-article__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Edit button ─────────────────────────────────────────────── */
.docs-edit-btn {
  border: none;
  outline: none;
  cursor: pointer;
  background: rgba(224, 82, 122, 0.12);
  color: #E0527A;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  margin-top: 12px;
  transition: background 0.2s;
}

.docs-edit-btn:hover { background: rgba(224, 82, 122, 0.2); }

/* ── FAB (floating action button) ────────────────────────────── */
.docs-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  border: none;
  outline: none;
  cursor: pointer;
  background: #E0527A;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(224, 82, 122, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 200;
}

.docs-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 32px rgba(224, 82, 122, 0.55);
}

/* ── Editor ──────────────────────────────────────────────────── */
.docs-editor {
  max-width: 760px;
  margin: 0 auto;
}

.docs-editor__title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 800;
  color: #EDE9F6;
  margin: 0 0 24px 0;
}

.docs-editor__tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 20px;
  width: fit-content;
}

.docs-editor__tab {
  border: none;
  outline: none;
  cursor: pointer;
  background: transparent;
  color: #8A839E;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 13px;
  font-weight: 700;
  padding: 7px 18px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.docs-editor__tab:hover { color: #EDE9F6; }
.docs-editor__tab.active { background: rgba(224, 82, 122, 0.2); color: #E0527A; }

.docs-editor__field {
  margin-bottom: 18px;
}

.docs-editor__field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #ABA3C2;
  margin-bottom: 6px;
}

.docs-editor__field input[type="text"],
.docs-editor__field textarea,
.docs-editor__field select {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 14px;
  color: #EDE9F6;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.docs-editor__field textarea {
  resize: vertical;
  min-height: 120px;
  font-family: 'JetBrains Mono', 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 13px;
  line-height: 1.6;
}

.docs-editor__field input:focus,
.docs-editor__field textarea:focus,
.docs-editor__field select:focus {
  border-color: rgba(224, 82, 122, 0.4);
}

.docs-editor__field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238A839E' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px;
}

.docs-editor__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.docs-editor__check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #ABA3C2;
  cursor: pointer;
}

.docs-editor__check input[type="checkbox"] {
  accent-color: #E0527A;
  width: 16px;
  height: 16px;
}

.docs-editor__actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Retry button ───────────────────────────────────────────── */
.docs-retry {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 20px;
  background: rgba(224, 82, 122, 0.15);
  color: #E0527A;
  border: 1px solid rgba(224, 82, 122, 0.3);
  border-radius: 8px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s;
}

.docs-retry:hover { background: rgba(224, 82, 122, 0.25); }

/* ── Empty state ─────────────────────────────────────────────── */
.docs-empty {
  text-align: center;
  padding: 64px 24px;
  color: #8A839E;
  font-size: 15px;
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes docsFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   DRIVE — Dashboard sections
   ============================================================ */

/* ── Welcome banner ─────────────────────────────────────────── */
.drive-welcome {
  margin-bottom: 36px;
  padding: 28px 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.drive-welcome__title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 800;
  color: #EDE9F6;
  margin: 0 0 6px 0;
}

.drive-welcome__role {
  font-size: 14px;
  color: #ABA3C2;
  margin: 0;
}

/* ── Section wrapper ────────────────────────────────────────── */
.drive-section {
  margin-bottom: 40px;
}

.drive-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.drive-section__title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: #EDE9F6;
  margin: 0 0 20px 0;
}

.drive-section__header .drive-section__title {
  margin-bottom: 0;
}

.drive-section__viewall {
  font-size: 13px;
  font-weight: 600;
  color: #E0527A;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.drive-section__viewall:hover {
  color: #EE7A97;
}

.drive-subsection__title {
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 16px;
  font-weight: 700;
  color: #ABA3C2;
  margin: 24px 0 14px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Quick links grid ───────────────────────────────────────── */
.drive-quicklinks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.drive-quicklink {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: #16162C;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  text-decoration: none;
  color: #EDE9F6;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  animation: docsFadeIn 0.4s ease both;
}

.drive-quicklink:hover {
  transform: translateY(-2px);
  border-color: rgba(224, 82, 122, 0.3);
  box-shadow: 0 4px 20px rgba(224, 82, 122, 0.1);
}

.drive-quicklink__icon {
  font-size: 28px;
  line-height: 1;
}

.drive-quicklink__label {
  font-size: 12px;
  font-weight: 600;
  color: #ABA3C2;
  text-align: center;
  line-height: 1.3;
}

.drive-quicklink__lock {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  opacity: 0.5;
}

.drive-quicklink--protected {
  position: relative;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  border: 1px solid rgba(248, 191, 69, 0.15);
}

.drive-quicklink--protected:hover {
  border-color: rgba(248, 191, 69, 0.4);
  box-shadow: 0 4px 20px rgba(248, 191, 69, 0.1);
}

/* ── Guide steps ────────────────────────────────────────────── */
.drive-guides {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drive-guide-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: #16162C;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  animation: docsFadeIn 0.4s ease both;
  transition: border-color 0.2s;
}

.drive-guide-step:hover {
  border-color: rgba(224, 82, 122, 0.2);
}

.drive-guide-step__num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(224, 82, 122, 0.12);
  color: #E0527A;
  font-weight: 800;
  font-size: 15px;
  border-radius: 8px;
}

.drive-guide-step__content {
  flex: 1;
  min-width: 0;
}

.drive-guide-step__title {
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 14px;
  font-weight: 600;
  color: #EDE9F6;
  margin-bottom: 4px;
}

.drive-guide-step__body {
  font-size: 13px;
  line-height: 1.6;
  color: #ABA3C2;
  margin-top: 8px;
}

.drive-guide-step__body a {
  color: #E0527A;
}

.drive-guide-step--expanded {
  padding: 18px 22px;
}

/* ── Feature cards ──────────────────────────────────────────── */
.drive-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.drive-feature {
  background: #16162C;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 18px;
  animation: docsFadeIn 0.4s ease both;
  transition: border-color 0.2s, transform 0.2s;
}

.drive-feature:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.drive-feature__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.drive-feature__icon {
  font-size: 22px;
  line-height: 1;
}

.drive-feature__status {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 8px;
}

.drive-feature__title {
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 14px;
  font-weight: 700;
  color: #EDE9F6;
  margin-bottom: 4px;
}

.drive-feature__desc {
  font-size: 12px;
  color: #ABA3C2;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.drive-feature__meta {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ── Contract cards ─────────────────────────────────────────── */
.drive-contracts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.drive-contract {
  background: #16162C;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 18px;
  animation: docsFadeIn 0.4s ease both;
  transition: border-color 0.2s;
}

.drive-contract:hover {
  border-color: rgba(248, 191, 69, 0.25);
}

.drive-contract__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.drive-contract__title {
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 14px;
  font-weight: 700;
  color: #EDE9F6;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drive-contract__value {
  font-size: 13px;
  font-weight: 600;
  color: #F8BF45;
  margin-bottom: 4px;
}

.drive-contract__dates {
  font-size: 12px;
  color: #8A839E;
  margin-bottom: 6px;
}

.drive-contract__meta {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.drive-contract__dl {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #E0527A;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid rgba(224, 82, 122, 0.2);
  border-radius: 4px;
  transition: background 0.15s, border-color 0.15s;
}

.drive-contract__dl:hover {
  background: rgba(224, 82, 122, 0.1);
  border-color: rgba(224, 82, 122, 0.4);
}

/* ── Role picker cards (login page) ──────────────────────────── */
.role-card:hover {
  background: var(--surface2, #1a1a30) !important;
  border-color: var(--accent, #E0527A) !important;
}

/* ============================================================
   RESPONSIVE — all media queries AFTER base declarations
   ============================================================ */

/* ── Tablet (1024px) ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .docs-grid { grid-template-columns: repeat(2, 1fr); }
  .drive-features-grid { grid-template-columns: repeat(2, 1fr); }
  .drive-quicklinks { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ── Small tablet (768px) ────────────────────────────────────── */
@media (max-width: 768px) {
  .docs-header { padding: 12px 16px; gap: 10px; }
  .docs-header__user { display: none; }
  .docs-role-switch__menu { min-width: 170px; }
  .docs-header__center { gap: 10px; }
  .docs-search { flex: 0 1 200px; }
  .docs-search__input { padding: 7px 12px; font-size: 12px; }
  .docs-main { padding: 24px 16px 60px; }
  .docs-article__title { font-size: 24px; }
}

/* ── Mobile (640px) ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .docs-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .drive-welcome__title { font-size: 22px; }
  .drive-section__title { font-size: 18px; }
  .drive-quicklinks { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .drive-quicklink { padding: 14px 8px; border-radius: 8px; }
  .drive-quicklink__icon { font-size: 22px; }
  .drive-quicklink__label { font-size: 11px; }
  .drive-features-grid { grid-template-columns: 1fr; gap: 10px; }
  .drive-feature { padding: 14px; }
  .drive-feature:hover { transform: none; }
  .drive-contracts { grid-template-columns: 1fr; }
  .drive-contract { padding: 14px; }
  .drive-guide-step { padding: 12px 14px; }
  .drive-guide-step__num { width: 32px; height: 32px; font-size: 13px; }

  .docs-header {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .docs-header__logo { height: 24px; }
  .docs-header__title { font-size: 15px; }
  .docs-header__center { order: 3; width: 100%; }
  .docs-search { flex: 1; }

  .docs-main { padding: 16px 14px 60px; }

  .docs-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 12px;
    gap: 6px;
  }
  .docs-filters::-webkit-scrollbar { display: none; }
  .docs-filter-pill { font-size: 12px; padding: 6px 14px; }

  .docs-carousel .docs-card { min-width: 220px; }

  .docs-card { padding: 16px; border-radius: 8px; }
  .docs-card:hover { transform: none !important; box-shadow: none !important; }
  .docs-card:active { opacity: 0.8; }
  .docs-card__icon { font-size: 20px; margin-bottom: 6px; }
  .docs-card__title { font-size: 15px; margin-bottom: 4px; }
  .docs-card__desc { font-size: 12px; }
  .docs-card__meta { margin-top: 10px; }
  .docs-tag { font-size: 10px; padding: 2px 8px; }

  .docs-section__title { font-size: 18px; margin-bottom: 14px; }

  .docs-article__icon { font-size: 32px; }
  .docs-article__title { font-size: 22px; }
  .docs-article__body { font-size: 14px; }

  .docs-editor__title { font-size: 20px; }

  .docs-fab {
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  .docs-lang__btn { font-size: 10px; padding: 3px 6px; }
  .docs-logout-btn { font-size: 11px; padding: 5px 10px; }
}

/* ── Small phones (380px: SE, mini) ──────────────────────────── */
@media (max-width: 380px) {
  .docs-header { padding: 8px 10px; }
  .docs-header__logo { height: 20px; }
  .docs-main { padding: 12px 10px 48px; }
  .docs-card { padding: 14px; border-radius: 8px; }
  .docs-card__title { font-size: 14px; }
  .docs-article__title { font-size: 19px; }
  .docs-editor__title { font-size: 17px; }
  .drive-welcome__title { font-size: 19px; }
  .drive-quicklinks { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .docs-card { animation-duration: 0.01ms !important; }
}
