:root {
  --brand: #5c7080;
  --brand-tint: #e8edf1;
  --on-brand: #ffffff;
  --revit-blue: #0696d7;
  --border: #d3d7db;
  --border-subtle: #c7cdd3;
  --border-light: #e3e5e8;
  --text: #24292b;
  --text-muted: #454c51;
  --text-soft: #5b6268;
  --text-faint: #8a9096;
  --bg-page: #f4f5f6;
  --bg-card: #ffffff;
  --bg-input: #f9fafb;
  --overlay: rgba(20, 24, 28, 0.5);
  --shadow-card: 0 1px 2px rgba(20, 24, 28, 0.04);
  --shadow-card-hover: 0 4px 10px rgba(20, 24, 28, 0.08);
  --shadow-menu: 0 8px 24px rgba(20, 24, 28, 0.12);
  --shadow-modal: 0 20px 60px rgba(20, 24, 28, 0.3);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset */
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  font-family: var(--font);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}

.font_title {
  font-size: 18px;
  font-weight: 700;
  margin: 0px;
}

.font_header {
  font-size: 16px;
  font-weight: 700;
  margin: 0px;
}

.font_description {
  font-size: 16px;
  color: var(--text-muted);
  margin: 0px;
  font-weight: 400;
  line-height: 1.4;
}

.flex-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.flex-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Page shell */
.page {
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  /* flex: 0 0 auto;  */
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
}

.header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* header brand section */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand__mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--brand);
  flex: 0 0 auto;
}

.brand__mark_large {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--brand);
  flex: 0 0 auto;
}

.brand__by {
  font-size: 11px;
  color: var(--text-faint);
  padding-left: 8px;
  border-left: 1px solid var(--border-light);
  margin-left: 2px;
  white-space: nowrap;
}

/* header user section */
.user-button {
  padding: 8px;
  height: 32px;
  width: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--on-brand);
  color: var(--text-soft);
  cursor: pointer;
  font-weight: 700;
}

.user-button:hover {
  color: var(--on-brand);
  background: var(--text-soft);
}

.user-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: var(--shadow-menu);
  min-width: 170px;
  overflow: hidden;
  z-index: 50;
}

.user-menu__identity {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  color: var(--text-faint);
  font-size: 12px;
  padding-top: 6px;
}

.user-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: var(--bg-card);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 14px;
  cursor: pointer;
}

.user-menu__item:hover {
  background: var(--bg-page);
}

.user-menu__item--divider {
  border-top: 1px solid var(--border-light);
}

/* header filter section */
.search-wrap {
  position: relative;
  display: flex;
  flex: 1 1 220px;
  min-width: 140px;
}

.search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 32px 7px 12px;
  font-size: 16px;
  outline: none;
  background: var(--bg-input);
}

.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1;
  padding: 4px;
}

.search-clear:hover {
  color: var(--text);
}

/* buttons */

.btn-outline {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
}

.btn-outline-small {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.btn-primary {
  border: none;
  cursor: pointer;
  background: var(--brand);
  color: var(--on-brand);
}

.btn-muted {
  background: transparent;
  color: var(--text-muted);
}

.btn-primary:hover {
  opacity: 0.9;
}

.filter-btn {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.filter-btn--active {
  border-color: var(--brand);
  background: var(--brand-tint);
  color: var(--brand);
}

/* grid section */

.grid-area {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
}

.fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  pointer-events: none;
  z-index: 1;
}

.fade-top {
  top: 0;
  background: linear-gradient(var(--bg-page), transparent);
}
.fade-bottom {
  bottom: 0;
  background: linear-gradient(transparent, var(--bg-page));
}

.grid-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.state-panel {
  display: flex;
  flex-direction: column;

  max-width: 380px;
  margin: 80px auto;
  text-align: center;

  align-items: center;
  gap: 20px;
  padding: 36px 28px;
  background: var(--bg-card);
}

.empty-panel {
  padding: 60px 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 14px;
}

.cardBorder {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.user-area {
  position: relative;
  flex: 0 0 auto;
}

.card {
  /* position: relative;  */
  background: var(--bg-card);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
}

.card_tag {
  width: fit-content;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--tag-bg);
  color: var(--tag-fg);
}

/* Shared modal styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.modal-box {
  background: var(--bg-card);
  border-radius: 12px;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-modal);
}

.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  gap: 2px;
  border-bottom: 1px solid var(--border-light);
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-faint);
}

.modal-close:hover {
  color: var(--text);
}

.modal__section {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
}

/* Filter Modal */
.filter-modal {
  max-width: 420px;
  max-height: 80vh;
}

.filter-option {
  text-align: left;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  background: transparent;
  width: 100%;
}

.filter-option--active {
  background: var(--tag-bg);
  color: var(--tag-fg);
}

/* Detail Modal */
.detail-modal {
  max-width: 640px;
  max-height: 85vh;
}

#modalHeaderTitle {
  flex: 1;
  min-width: 0;
}

.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.step__num {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--revit-blue);
  color: var(--on-brand);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step__content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.step__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.step__screenshot {
  height: 140px;
  border-radius: 8px;
  background: repeating-linear-gradient(
    45deg,
    #f1f3f4,
    #f1f3f4 10px,
    #e6e9eb 10px,
    #e6e9eb 20px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-size: 12px;
  color: var(--text-faint);
  border: 1px solid var(--border-light);
}

.section-note {
  border-left: 3px solid var(--brand);
  background: var(--brand-tint);
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.4;
}

.section-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}