*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg:      #f0eeea;
  --surface: #ffffff;
  --border:  #e3e0d9;
  --border2: #ccc9c0;
  --text:    #141311;
  --text2:   #6b6760;
  --text3:   #aaa89f;
  --radius:  10px;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar { display: none; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
body::-webkit-scrollbar { display: none; }

button {
  outline: none;
  -webkit-appearance: none;
  user-select: none;
  -webkit-user-select: none;
}
button:focus { outline: none; }

.header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(240, 238, 234, .94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 32px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { display: flex; align-items: center; gap: 10px; }

.logo-mark { width: 30px; height: 30px; flex-shrink: 0; }

.logo-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.1px;
}

.logo-sub {
  font-size: 10.5px;
  color: var(--text3);
  margin-top: 1px;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text3);
}

.stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 5px rgba(34, 197, 94, .5);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.toolbar {
  position: sticky;
  top: 54px;
  z-index: 100;
  background: rgba(240, 238, 234, .94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.toolbar-inner {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 32px;
}

.filter-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 13px 0;
  margin-right: 22px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text3);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: 0;
}
.tab:hover { color: var(--text2); }
.tab.active {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 600;
}

.grid {
  max-width: 1340px;
  margin: 0 auto;
  padding: 28px 32px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .18s, border-color .18s;
  position: relative;
  --cat: #888;
}

.card:hover {
  border-color: var(--border2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .07);
}

.card-head {
  padding: 15px 18px 13px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--cat);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .4px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-family: 'SF Mono', ui-monospace, monospace;
  line-height: 1;
}

.card-info { flex: 1; min-width: 0; }

.card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  letter-spacing: -.1px;
}

.card-desc {
  font-size: 11.5px;
  color: var(--text3);
  margin-top: 2px;
}

.card-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--cat);
  text-transform: uppercase;
  letter-spacing: .6px;
  flex-shrink: 0;
}

.site-section { padding: 11px 18px 11px 20px; }
.site-section + .site-section { border-top: 1px solid var(--border); }

.section-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text3);
}

.section-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cat);
}

.section-btns { display: flex; gap: 5px; }

.btn-go {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: var(--text);
  color: #fff;
  transition: opacity .15s;
  letter-spacing: .1px;
  line-height: 1;
}
.btn-go:hover { opacity: .75; }
.btn-go svg { width: 10px; height: 10px; }

.cred-list { display: flex; flex-direction: column; gap: 4px; }

.cred-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
}

.cred-key {
  font-size: 10.5px;
  color: var(--text3);
  width: 28px;
  flex-shrink: 0;
}

.cred-val {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  font-family: 'SF Mono', ui-monospace, 'Cascadia Code', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-copy {
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text3);
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  flex-shrink: 0;
  white-space: nowrap;
}
.btn-copy:hover {
  background: var(--bg);
  color: var(--text2);
  border-color: var(--text3);
}

.no-cred {
  font-size: 11.5px;
  color: var(--text3);
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}
.viewer.open {
  opacity: 1;
  pointer-events: all;
}

.viewer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.viewer-back {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text2);
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .14s;
  flex-shrink: 0;
  white-space: nowrap;
}
.viewer-back svg { width: 12px; height: 12px; }
.viewer-back:hover { background: var(--bg); }

.viewer-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.creds-wrap {
  position: relative;
  flex-shrink: 0;
}

.btn-creds {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border2);
  background: var(--bg);
  color: var(--text2);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .14s, border-color .14s, color .14s;
  white-space: nowrap;
}
.btn-creds svg { width: 13px; height: 13px; flex-shrink: 0; }
.btn-creds .caret { width: 9px; height: 9px; transition: transform .2s; }
.btn-creds.open .caret { transform: rotate(180deg); }

.btn-creds:hover,
.btn-creds.open {
  background: var(--surface);
  border-color: var(--text3);
  color: var(--text);
}

.creds-panel {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  min-width: 250px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .13);
  padding: 6px;
  z-index: 100;
  display: none;
}
.creds-panel.open { display: block; }

.cp-title {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text3);
  padding: 4px 8px 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.cp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background .1s;
}
.cp-row:hover { background: var(--bg); }

.cp-key {
  font-size: 11px;
  color: var(--text3);
  width: 28px;
  flex-shrink: 0;
}

.cp-val {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  font-family: 'SF Mono', ui-monospace, monospace;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: .2px;
}

.cp-copy {
  padding: 3px 9px;
  border-radius: 5px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text3);
  font-size: 10.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s, transform .1s;
  flex-shrink: 0;
}
.cp-copy:hover {
  background: var(--bg);
  border-color: var(--text3);
  color: var(--text2);
}
.cp-copy:active { transform: scale(.93); }
.cp-copy.copied {
  border-color: #16a34a;
  color: #16a34a;
  background: rgba(22, 163, 74, .07);
}

.viewer-body { flex: 1; overflow: hidden; }
.viewer-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #fff;
}

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--text);
  color: #fff;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 9999;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .22);
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.footer {
  text-align: center;
  padding: 20px;
  font-size: 11.5px;
  color: var(--text3);
  border-top: 1px solid var(--border);
}

.empty {
  grid-column: 1 / -1;
  padding: 80px 20px;
  text-align: center;
  color: var(--text3);
  font-size: 14px;
}

@media (max-width: 768px) {
  .header-inner { padding: 0 16px; }
  .toolbar-inner { padding: 0 16px; }
  .grid { padding: 16px 16px 60px; grid-template-columns: 1fr; gap: 12px; }
  .logo-sub { display: none; }
  .viewer-title { text-align: left; font-size: 12px; }
  .viewer-back span { display: none; }
  .viewer-back { padding: 5px 8px; }
  .btn-creds span { display: none; }
  .btn-creds { padding: 5px 9px; }

  .creds-panel {
    position: fixed;
    left: 0;
    right: 0;
    top: 48px;
    width: 100%;
    min-width: unset;
    border-radius: 0 0 12px 12px;
    border-left: none;
    border-right: none;
    border-top: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    scrollbar-width: none;
  }
  .creds-panel::-webkit-scrollbar { display: none; }
  .cp-row { padding: 10px 12px; }
  .cp-val { font-size: 14px; }
  .cp-copy { padding: 6px 14px; font-size: 12px; min-width: 56px; text-align: center; }
}
