:root {
  color-scheme: dark;
  --bg-main: #0d1020;
  --glass-bg: rgba(255, 255, 255, 0.055);
  --glass-border: rgba(188, 171, 255, 0.2);
  --text-primary: #f4f4fb;
  --text-muted: #a3a7bb;
  --accent: #c28bff;
  --accent-blue: #67e8f9;
  --accent-pink: #ff78c8;
  --accent-lime: #c3f77a;
  --btn-bg: rgba(185, 113, 255, 0.2);
  --btn-border: rgba(203, 147, 255, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg-main);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  padding: 118px 4vw 36px;
  color: var(--text-primary);
  background:
    radial-gradient(ellipse at 9% 8%, rgba(191, 74, 190, 0.2), transparent 38rem),
    radial-gradient(ellipse at 91% 14%, rgba(37, 197, 216, 0.17), transparent 35rem),
    radial-gradient(ellipse at 72% 95%, rgba(161, 197, 67, 0.11), transparent 34rem),
    linear-gradient(135deg, #111126, #15152d 52%, #101a2d);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.ambient-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 0.7px, transparent 0.7px);
  background-size: 24px 24px;
  opacity: 0.17;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.glass {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background:
    linear-gradient(128deg, rgba(174, 106, 255, 0.055), transparent 43%),
    var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow:
    inset 0 1px 1px rgba(103, 232, 249, 0.075),
    inset 0 -1px 1px rgba(0, 0, 0, 0.12),
    0 14px 42px rgba(0, 0, 0, 0.2);
}

.glass::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(194, 139, 255, 0.12), transparent 48%),
    radial-gradient(ellipse at 100% 100%, rgba(103, 232, 249, 0.045), transparent 40%);
  content: "";
  pointer-events: none;
}

.glass > * {
  position: relative;
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 22px;
  left: 50%;
  display: flex;
  width: min(1100px, 92vw);
  height: 70px;
  align-items: center;
  gap: 30px;
  padding: 0 18px;
  border-radius: 22px;
  transform: translateX(-50%);
}

.brand {
  display: inline-flex;
  flex: 0 0 195px;
  align-items: center;
  gap: 11px;
  font-family: "Bitcount Grid Single", system-ui, sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
}

.brand-icon {
  width: 33px;
  height: 33px;
  border: 1px solid var(--glass-border);
  border-radius: 11px;
  object-fit: cover;
}

.brand-dot,
.loader-mark span {
  color: var(--accent-blue);
}

.topbar-search {
  position: relative;
  display: flex;
  width: min(390px, 100%);
  height: 40px;
  align-items: center;
  margin: 0 auto;
}

.topbar-search input {
  width: 100%;
  height: 100%;
  padding: 0 42px 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  outline: none;
  color: var(--text-primary);
  background: rgba(7, 9, 21, 0.25);
  font-size: 0.85rem;
  transition: border-color 180ms ease, background 180ms ease;
}

.topbar-search input::placeholder {
  color: #a3a7bb;
}

.topbar-search input:focus {
  border-color: rgba(154, 145, 255, 0.6);
  background: rgba(7, 9, 21, 0.43);
}

.search-icon {
  position: absolute;
  right: 14px;
  color: var(--text-muted);
  font-size: 1.4rem;
  pointer-events: none;
}

.topbar-actions {
  display: flex;
  flex: 0 0 195px;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.account-avatar {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: var(--accent-blue);
  background: linear-gradient(145deg, rgba(154, 145, 255, 0.19), rgba(123, 217, 254, 0.08));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.account-avatar span {
  font-size: 1.5rem;
  line-height: 1;
}

.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.database-topbar-label {
  margin: 0 auto;
  color: var(--text-muted);
  font-family: "Bitcount Grid Single", system-ui, sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
}

.header-button {
  display: inline-flex;
  min-width: 62px;
  height: 39px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease;
}

.header-button:hover {
  transform: translateY(-2px);
  background: rgba(154, 145, 255, 0.22);
}

.header-button > span:first-child {
  color: var(--accent-blue);
  font-size: 1.15rem;
}

#countDisplay {
  font-size: 0.8rem;
}

.button-label {
  font-size: 0.76rem;
}

.dashboard {
  display: grid;
  width: min(1440px, 100%);
  min-height: min(720px, calc(100vh - 160px));
  grid-template-columns: minmax(230px, 1fr) minmax(0, 3fr);
  gap: 22px;
  margin: 0 auto;
}

.dashboard[hidden],
.screen-overlay[hidden] {
  display: none;
}

.profile-panel {
  display: flex;
  min-height: 660px;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px clamp(22px, 2.4vw, 38px);
  border-radius: 28px;
}

.profile-topline,
.eyebrow,
.page-footer,
.project-index,
.social-heading-note {
  font-family: "Bitcount Grid Single", system-ui, sans-serif;
  font-size: 0.67rem;
  letter-spacing: 0.1em;
}

.profile-topline {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #c0c4d3;
  font-size: 0.61rem;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #74e6b1;
  box-shadow: 0 0 12px rgba(116, 230, 177, 0.8);
}

.profile-avatar-wrap {
  position: relative;
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  align-self: center;
  margin: 48px 0 30px;
}

.profile-avatar {
  z-index: 1;
  width: 132px;
  height: 132px;
  border: 1px solid rgba(255, 255, 255, 0.27);
  border-radius: 42px;
  object-fit: cover;
  box-shadow: 0 15px 45px rgba(61, 125, 177, 0.24);
  transform: rotate(-5deg);
}

.avatar-glow {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(130, 117, 255, 0.25);
  filter: blur(30px);
}

.eyebrow {
  color: var(--accent-blue);
  font-size: 0.61rem;
}

.animated-gradient {
  margin: 2px 0 0 -4px;
  background: linear-gradient(110deg, #f8f7ff 12%, #9a91ff 62%, #7bd9fe);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-family: "Bitcount Grid Single", system-ui, sans-serif;
  font-size: clamp(3.1rem, 5vw, 4.8rem);
  font-weight: 500;
  line-height: 1.15;
  text-shadow: 0 4px 25px rgba(123, 217, 254, 0.12);
}

.profile-role {
  margin-top: 7px;
  color: #d3d5e2;
  font-size: 0.9rem;
}

.profile-divider {
  width: 100%;
  height: 1px;
  margin: 25px 0 20px;
  background: linear-gradient(90deg, rgba(154, 145, 255, 0.55), transparent);
}

.profile-copy {
  max-width: 290px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.profile-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 34px;
}

.stat-number {
  color: var(--accent-blue);
  font-family: "Bitcount Grid Single", system-ui, sans-serif;
  font-size: 2.6rem;
}

.stat-caption {
  color: var(--text-muted);
  font-size: 0.63rem;
  letter-spacing: 0.09em;
  line-height: 1.6;
}

.profile-location {
  margin-top: 19px;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.profile-location span {
  padding-right: 5px;
  color: var(--accent);
}

.workspace {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 22px;
}

.panel {
  min-width: 0;
  padding: 23px;
  border-radius: 26px;
}

.panel-heading,
.social-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.panel-heading h2,
.social-heading h2 {
  margin-top: 6px;
  font-family: "Bitcount Grid Single", system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 400;
}

.heading-icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.045);
  font-size: 1rem;
}

.field-label {
  margin-bottom: 8px;
  color: #d7d9e4;
  font-size: 0.73rem;
}

.text-field {
  width: 100%;
  min-height: 45px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  outline: none;
  color: var(--text-primary);
  background: rgba(5, 8, 19, 0.27);
  font-size: 0.83rem;
}

.text-field::placeholder {
  color: #8f94a9;
}

.text-field:focus {
  border-color: rgba(154, 145, 255, 0.65);
}

.file-drop {
  position: relative;
  display: flex;
  min-height: 115px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 15px;
  border: 1px dashed rgba(154, 145, 255, 0.45);
  border-radius: 15px;
  background: rgba(154, 145, 255, 0.045);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.file-drop:hover,
.file-drop:focus-within,
.file-drop.is-dragging {
  border-color: var(--accent-blue);
  background: rgba(154, 145, 255, 0.1);
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.file-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(154, 145, 255, 0.4);
  border-radius: 10px;
  color: var(--accent-blue);
  font-size: 1.1rem;
}

.file-prompt {
  max-width: 90%;
  overflow: hidden;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-hint {
  color: var(--text-muted);
  font-size: 0.64rem;
}

.form-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: #a9ecd0;
  font-size: 0.68rem;
}

.error-message {
  color: #ff9baf;
}

.primary-button {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--btn-border);
  border-radius: 13px;
  color: white;
  background: linear-gradient(110deg, rgba(116, 104, 224, 0.65), rgba(60, 128, 167, 0.57));
  cursor: pointer;
  font-size: 0.78rem;
  transition: filter 180ms ease, transform 180ms ease;
}

.primary-button:hover {
  filter: brightness(1.18);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  filter: grayscale(0.35);
  opacity: 0.7;
}

.primary-button span {
  color: var(--accent-blue);
}

.secondary-button {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 13px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.73rem;
  transition: border-color 180ms ease, background 180ms ease;
}

.secondary-button:hover {
  border-color: rgba(123, 217, 254, 0.5);
  background: rgba(123, 217, 254, 0.09);
}

.secondary-button span {
  color: var(--accent-blue);
}

.database-main {
  width: min(1440px, 100%);
  margin: 0 auto;
}

.database-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.database-intro h1 {
  margin-top: 5px;
  font-family: "Bitcount Grid Single", system-ui, sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
}

.database-intro p:not(.eyebrow) {
  max-width: 560px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.database-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.4fr);
  align-items: start;
  gap: 18px;
}

.workspace-tabs {
  display: flex;
  gap: 9px;
  margin: 0 0 18px;
  padding: 6px;
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.035);
}

.workspace-tab {
  position: relative;
  overflow: hidden;
  min-width: 112px;
  min-height: 39px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.workspace-tab:hover,
.workspace-tab:focus-visible {
  color: var(--text-primary);
  outline: none;
}

.workspace-tab.is-active {
  border-color: rgba(203, 147, 255, 0.6);
  color: var(--text-primary);
  background: linear-gradient(110deg, rgba(194, 139, 255, 0.28), rgba(103, 232, 249, 0.14), rgba(255, 120, 200, 0.16));
  box-shadow: inset 0 0 18px rgba(194, 139, 255, 0.1), 0 5px 18px rgba(118, 79, 205, 0.12);
}

.workspace-tab-panel[hidden] {
  display: none;
}

.workspace-tab-panel.slide-from-left {
  animation: workspace-slide-from-left 260ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.workspace-tab-panel.slide-from-right {
  animation: workspace-slide-from-right 260ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.codebase-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.database-panel {
  position: relative;
  overflow: hidden;
  padding: 23px;
  border: 1px solid rgba(194, 139, 255, 0.28);
  border-radius: 25px;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(194, 139, 255, 0.13), transparent 58%),
    radial-gradient(ellipse at 100% 100%, rgba(103, 232, 249, 0.085), transparent 56%),
    linear-gradient(145deg, rgba(32, 24, 62, 0.66), rgba(13, 30, 48, 0.72));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 16px 40px rgba(5, 6, 20, 0.2);
}

.database-panel > * {
  position: relative;
}

.code-editor-panel {
  border-color: rgba(103, 232, 249, 0.28);
  background:
    radial-gradient(ellipse at 0% 0%, rgba(194, 139, 255, 0.17), transparent 54%),
    radial-gradient(ellipse at 100% 12%, rgba(255, 120, 200, 0.11), transparent 48%),
    linear-gradient(140deg, rgba(33, 23, 67, 0.78), rgba(11, 34, 50, 0.82));
}

.code-editor-panel .panel-heading h2 {
  background: linear-gradient(100deg, #f7e9ff, #d2a7ff 55%, #81edfa);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.code-editor-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.code-editor-heading-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.new-code-tab-button {
  min-height: 36px;
  padding: 0 12px;
  cursor: pointer;
  white-space: nowrap;
}

.code-editor-hint {
  margin: -4px 0 8px;
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.5;
}

.code-editor-input {
  width: 100%;
  min-height: min(62vh, 720px);
  padding: 16px;
  border: 1px solid rgba(155, 124, 245, 0.38);
  border-radius: 14px;
  outline: none;
  color: #e7e8f4;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(124, 70, 190, 0.16), transparent 54%),
    linear-gradient(145deg, rgba(18, 15, 43, 0.97), rgba(7, 27, 43, 0.97));
  box-shadow: inset 0 0 42px rgba(111, 73, 193, 0.13);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.79rem;
  line-height: 1.65;
  tab-size: 2;
  resize: vertical;
}

.code-editor-input:focus {
  border-color: rgba(103, 232, 249, 0.7);
  box-shadow:
    inset 0 0 42px rgba(111, 73, 193, 0.16),
    0 0 0 3px rgba(103, 232, 249, 0.09);
}

.code-editor-input::placeholder {
  color: #737990;
}

.code-editor-actions {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.code-editor-actions .secondary-button {
  cursor: pointer;
}

.code-editor-actions [hidden] {
  display: none;
}

.save-code-button {
  display: inline-flex;
  width: 43px;
  min-height: 43px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  margin-left: auto;
  padding: 0 12px;
  overflow: hidden;
  border: 1px solid rgba(103, 232, 249, 0.42);
  border-radius: 13px;
  color: #f7f5ff;
  background: linear-gradient(110deg, rgba(194, 139, 255, 0.78), rgba(71, 194, 216, 0.72));
  box-shadow: 0 7px 20px rgba(103, 90, 202, 0.2);
  cursor: pointer;
  transition: width 200ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.save-code-button:hover,
.save-code-button:focus-visible {
  width: 132px;
  outline: none;
  filter: brightness(1.12);
  box-shadow: 0 9px 24px rgba(103, 90, 202, 0.32);
}

.save-code-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.save-code-icon {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
}

.save-code-label {
  overflow: hidden;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 120ms ease 40ms;
}

.save-code-button:hover .save-code-label,
.save-code-button:focus-visible .save-code-label {
  opacity: 1;
}

.code-editor-input[readonly] {
  cursor: text;
  border-color: rgba(103, 232, 249, 0.25);
}

.code-files-list {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.code-file-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.code-file-group h3 {
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--accent-pink);
  font-family: "Bitcount Grid Single", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
}

.code-file-button {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  text-align: left;
  transition: border-color 180ms ease, background 180ms ease;
}

.code-file-button:hover,
.code-file-button:focus-visible {
  border-color: rgba(103, 232, 249, 0.45);
  outline: none;
  background: linear-gradient(110deg, rgba(194, 139, 255, 0.1), rgba(103, 232, 249, 0.08));
}

.code-file-button strong {
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.74rem;
  font-weight: 500;
}

.code-file-button small {
  color: var(--text-muted);
  font-size: 0.63rem;
}

.database-panel .panel-heading {
  margin-bottom: 20px;
}

.database-upload-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.database-upload-form .file-drop {
  margin-top: 2px;
}

.folder-select {
  appearance: none;
  cursor: pointer;
}

.folder-select option {
  color: var(--text-primary);
  background: #17172b;
}

.database-upload-form .primary-button {
  width: 100%;
}

.database-files {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.database-folder {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(194, 139, 255, 0.27);
  border-radius: 17px;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(194, 139, 255, 0.105), transparent 62%),
    linear-gradient(125deg, rgba(26, 22, 53, 0.7), rgba(12, 31, 47, 0.55));
  transition: border-color 180ms ease, background 180ms ease;
}

.database-folder:hover {
  border-color: rgba(103, 232, 249, 0.42);
  background:
    radial-gradient(ellipse at 0% 0%, rgba(194, 139, 255, 0.14), transparent 62%),
    linear-gradient(125deg, rgba(34, 25, 65, 0.76), rgba(10, 39, 54, 0.68));
}

.database-folder-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
  color: var(--accent-lime);
  font-family: "Bitcount Grid Single", system-ui, sans-serif;
  font-size: 0.86rem;
  font-weight: 400;
}

.database-folder-icon {
  display: grid;
  width: 28px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(195, 247, 122, 0.28);
  border-radius: 8px;
  color: var(--accent-lime);
  background: rgba(195, 247, 122, 0.08);
  font-family: Inter, sans-serif;
  font-size: 1rem;
}

.database-folder-heading small {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  margin-left: auto;
  border-radius: 20px;
  color: var(--accent-blue);
  background: rgba(103, 232, 249, 0.1);
  font-family: Inter, sans-serif;
  font-size: 0.65rem;
}

.database-folder-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.database-folder-empty {
  padding: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.database-file {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.database-file:hover,
.database-file:focus-visible {
  border-color: rgba(103, 232, 249, 0.4);
  background: linear-gradient(110deg, rgba(194, 139, 255, 0.09), rgba(103, 232, 249, 0.075));
  outline: none;
}

.database-file-open {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.database-file-open:focus-visible {
  border-radius: 8px;
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

.database-file-unavailable {
  cursor: default;
}

.database-file-unavailable .database-file-open {
  cursor: default;
  pointer-events: none;
}

.database-file-unavailable:hover {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
}

.database-file-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid rgba(154, 145, 255, 0.25);
  border-radius: 12px;
  color: var(--accent-blue);
  background: rgba(154, 145, 255, 0.08);
}

.database-file-details {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 5px;
}

.database-file-details strong {
  overflow-wrap: anywhere;
  font-size: 0.78rem;
  font-weight: 500;
}

.database-file-details small {
  color: var(--text-muted);
  font-size: 0.65rem;
}

.database-file-action {
  display: inline-flex;
  min-height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid rgba(123, 217, 254, 0.24);
  border-radius: 10px;
  color: var(--accent-blue);
  background: rgba(123, 217, 254, 0.06);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.68rem;
  transition: background 180ms ease, border-color 180ms ease;
}

.database-file-action:hover:not(:disabled) {
  border-color: rgba(123, 217, 254, 0.55);
  background: rgba(123, 217, 254, 0.14);
}

.database-download-action {
  border-color: rgba(154, 145, 255, 0.27);
  color: #c5beff;
  background: rgba(154, 145, 255, 0.06);
}

.database-download-action:hover:not(:disabled) {
  border-color: rgba(154, 145, 255, 0.58);
  background: rgba(154, 145, 255, 0.14);
}

.database-file-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.database-open-indicator {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.database-empty {
  padding: 28px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  color: var(--text-muted);
  font-size: 0.79rem;
  line-height: 1.6;
  text-align: center;
}

.database-status {
  min-height: 20px;
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.database-status.error-message {
  color: #ff9baf;
}

.refresh-button {
  min-height: 35px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  font-size: 0.7rem;
}

.refresh-button:hover {
  background: rgba(154, 145, 255, 0.16);
}

.database-warning {
  margin-top: 15px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 120, 200, 0.22);
  border-radius: 14px;
  color: #f0c3e1;
  background: linear-gradient(110deg, rgba(255, 120, 200, 0.075), rgba(255, 190, 100, 0.045));
  font-size: 0.68rem;
  line-height: 1.55;
}

.projects-panel {
  display: flex;
  flex-direction: column;
}

.project-count {
  margin-left: 6px;
  color: var(--accent-blue);
  font-family: Inter, sans-serif;
  font-size: 0.67rem;
  vertical-align: middle;
}

.project-grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.projects-status:empty {
  display: none;
}

.projects-status {
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.project-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.018));
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.project-card:hover {
  border-color: rgba(123, 217, 254, 0.45);
  background: linear-gradient(135deg, rgba(123, 217, 254, 0.11), rgba(154, 145, 255, 0.09));
  transform: translateY(-2px);
}

.project-card[hidden] {
  display: none;
}

.project-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.04);
}

.project-details {
  display: flex;
  min-height: 126px;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  padding: 16px 38px 16px 16px;
}

.project-index {
  color: var(--text-muted);
  font-size: 0.55rem;
}

.project-card strong {
  padding-right: 24px;
  font-size: 1rem;
  font-weight: 500;
}

.project-description {
  max-width: 95%;
  color: var(--text-muted);
  font-size: 0.73rem;
  line-height: 1.5;
}

.project-arrow {
  position: absolute;
  right: 16px;
  bottom: 17px;
  color: var(--accent-blue);
  font-size: 0.9rem;
}

.social-section {
  padding: 2px 0 0;
}

.social-heading {
  align-items: flex-end;
  margin: 0 3px 14px;
}

.social-heading h2 {
  font-size: 1.55rem;
}

.social-heading-note {
  padding-bottom: 4px;
  color: var(--text-muted);
  font-size: 0.56rem;
}

.social-heading-note span {
  padding-left: 5px;
  color: var(--accent-blue);
}

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

.social-card {
  display: flex;
  min-width: 0;
  min-height: 82px;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border-radius: 18px;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.social-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.09);
}

.social-symbol {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 37px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.05);
  font-size: 1rem;
  font-weight: 650;
}

.social-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.social-copy strong {
  font-size: 0.76rem;
  font-weight: 550;
}

.social-copy small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.6rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-arrow {
  align-self: flex-start;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.youtube:hover {
  border-color: rgba(255, 0, 0, 0.5);
}

.youtube .social-symbol {
  color: #ff777e;
}

.github:hover {
  border-color: rgba(255, 255, 255, 0.38);
}

.linkedin:hover {
  border-color: rgba(65, 155, 255, 0.6);
}

.instagram:hover {
  border-color: rgba(255, 120, 178, 0.6);
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding: 12px 3px 0;
  color: rgba(163, 167, 187, 0.7);
  font-size: 0.53rem;
}

.like-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  color: rgba(255, 255, 255, 0.75);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  transition: color 180ms ease, transform 180ms ease;
}

.like-inline span:first-child {
  color: #ff4f70;
  font-size: 1rem;
  text-shadow: 0 0 10px rgba(255, 79, 112, 0.32);
}

.like-inline:hover:not(:disabled) {
  color: white;
  transform: scale(1.08);
}

.like-inline[aria-pressed="true"] span:first-child {
  color: #ff174b;
  text-shadow: 0 0 13px rgba(255, 23, 75, 0.65);
}

.like-inline:disabled {
  cursor: default;
}

.like-inline:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 4px;
  border-radius: 4px;
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.screen-overlay {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(7, 9, 20, 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  opacity: 1;
  transition: opacity 300ms ease, visibility 300ms ease;
}

.screen-overlay.is-leaving {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loader-card {
  width: min(390px, 100%);
  padding: 34px;
  border-radius: 25px;
  text-align: center;
}

.loader-mark {
  display: block;
  margin-bottom: 22px;
  font-family: "Bitcount Grid Single", system-ui, sans-serif;
  font-size: 3.2rem;
}

.loader-track {
  height: 3px;
  margin-top: 22px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
}

.loader-track span {
  display: block;
  width: 35%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-blue));
  animation: loading 1.1s ease-in-out infinite;
}

.loader-caption {
  margin-top: 13px;
  color: var(--text-muted);
  font-size: 0.74rem;
}

.auth-page {
  padding-top: 120px;
}

.auth-main {
  display: flex;
  width: min(460px, 100%);
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  margin: 0 auto;
}

.auth-card {
  padding: clamp(24px, 6vw, 38px);
  border-radius: 26px;
}

.auth-avatar {
  display: grid;
  width: 53px;
  height: 53px;
  place-items: center;
  margin-bottom: 24px;
  border: 1px solid var(--glass-border);
  border-radius: 17px;
  color: var(--accent-blue);
  object-fit: cover;
}

.account-avatar-large {
  overflow: hidden;
  border-radius: 50%;
  font-size: 1.35rem;
}

.profile-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.profile-heading .auth-avatar {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
}

.profile-heading .auth-avatar:disabled {
  cursor: wait;
  opacity: 0.65;
}

.profile-heading .auth-avatar img {
  display: block;
}

#auth-user-avatar[hidden],
#auth-user-avatar-placeholder[hidden] {
  display: none;
}

.profile-heading-text {
  min-width: 0;
}

.profile-heading-text .eyebrow {
  margin-bottom: 5px;
}

.profile-heading-text h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: "Bitcount Grid Single", system-ui, sans-serif;
  font-size: clamp(1.35rem, 5vw, 1.8rem);
  font-weight: 400;
}

.account-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-card h1 {
  margin-top: 8px;
  font-family: "Bitcount Grid Single", system-ui, sans-serif;
  font-size: clamp(1.65rem, 6vw, 2.15rem);
  font-weight: 400;
}

.auth-description {
  margin: 10px 0 20px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.google-button {
  display: flex;
  width: 100%;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.055);
  font-size: 0.8rem;
  cursor: pointer;
}

.google-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.google-mark {
  color: #a9c6ff;
  font-size: 1rem;
  font-weight: 700;
}

.auth-provider-note {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.65rem;
  line-height: 1.5;
  text-align: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 0;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  content: "";
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: rgba(5, 8, 19, 0.23);
  margin-top: 20px;
}

.auth-mode {
  min-height: 35px;
  border: 0;
  border-radius: 9px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.72rem;
}

.auth-mode.is-active {
  color: var(--text-primary);
  background: rgba(154, 145, 255, 0.19);
}

.auth-form {
  display: flex;
  flex-direction: column;
  margin-top: 17px;
}

.auth-form .field-label:not(:first-child) {
  margin-top: 14px;
}

.auth-form .primary-button {
  width: 100%;
}

.auth-form .primary-button:disabled,
.auth-sign-out:disabled,
.profile-form button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.auth-card h2 {
  margin-top: 8px;
  font-family: "Bitcount Grid Single", system-ui, sans-serif;
  font-size: clamp(1.45rem, 5vw, 1.9rem);
  font-weight: 400;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 18px;
}

.profile-form .secondary-button {
  width: 100%;
  cursor: pointer;
}

.auth-status {
  min-height: 20px;
  line-height: 1.5;
}

.auth-security-note {
  color: var(--text-muted);
  font-size: 0.66rem;
  line-height: 1.6;
  text-align: center;
}

.auth-continue {
  width: 100%;
}

.auth-sign-out {
  width: 100%;
  margin-top: 10px;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@keyframes loading {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(320%);
  }
}

@media (max-width: 1050px) {
  body {
    padding-right: 3vw;
    padding-left: 3vw;
  }

  .dashboard {
    grid-template-columns: minmax(220px, 0.85fr) minmax(0, 2.6fr);
    gap: 16px;
  }

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

  .panel {
    padding: 19px;
  }

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

@media (max-width: 760px) {
  body {
    padding: 108px 18px 26px;
  }

  .database-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

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

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

  .topbar {
    top: 14px;
    width: calc(100% - 28px);
    height: 66px;
    gap: 8px;
    padding: 0 11px;
    border-radius: 19px;
  }

  .brand {
    flex: 1 1 auto;
    gap: 8px;
    font-size: 0.95rem;
  }

  .brand-icon {
    width: 30px;
    height: 30px;
  }

  .topbar-search {
    display: none;
  }

  .database-topbar-label {
    display: none;
  }

  .topbar-actions {
    flex: 0 0 auto;
  }

  .header-button {
    min-width: 48px;
    height: 37px;
    padding: 0 10px;
  }

  .button-label {
    display: none;
  }

  .workspace-tabs {
    margin-bottom: 14px;
  }

  .workspace-tab {
    flex: 1;
    min-width: 0;
  }

  .dashboard {
    min-height: auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
  }

  .profile-panel {
    min-height: 0;
    padding: 24px;
  }

  .profile-avatar-wrap {
    width: 112px;
    height: 112px;
    margin: 24px 0 20px;
  }

  .profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 33px;
  }

  .profile-stat {
    margin-top: 23px;
    padding-top: 0;
  }

  .profile-location {
    margin-top: 12px;
  }

  .social-grid {
    gap: 9px;
  }

  .social-card {
    gap: 8px;
    padding: 11px 9px;
  }
}

@media (max-width: 420px) {
  body {
    padding-right: 13px;
    padding-left: 13px;
  }

  .project-grid {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr);
  }

  .project-card {
    border-radius: 15px;
  }

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

  .social-card {
    min-height: 68px;
    padding: 10px 13px;
  }

  .social-heading-note {
    display: none;
  }

  .code-editor-input {
    min-height: 340px;
    padding: 12px;
    font-size: 0.72rem;
  }

  .code-editor-heading-actions {
    gap: 6px;
  }

  .new-code-tab-button {
    min-height: 34px;
    padding: 0 9px;
    font-size: 0.65rem;
  }

}

@media (max-width: 520px) {
  .database-file {
    gap: 8px;
    padding: 9px;
  }

  .database-file-open {
    gap: 8px;
  }

  .database-file-action {
    min-height: 32px;
    padding: 0 8px;
  }

  .database-download-action > span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes workspace-slide-from-left {
  from {
    opacity: 0.35;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes workspace-slide-from-right {
  from {
    opacity: 0.35;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
