@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }

:root {
  --white:    #ffffff;
  --off:      #f7f7f5;
  --grey-1:   #eeede9;
  --grey-2:   #d4d2cc;
  --grey-3:   #9b9890;
  --grey-4:   #6b6860;
  --grey-5:   #3a3835;
  --black:    #111110;
  --accent:   #1a1a1a;
  --green:    #128c7e;
  --green-lt: #e8f5f3;
  --red:      #c0392b;
  --radius:   2px;
  --gap:      24px;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

body {
  background: var(--off);
  color: var(--black);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px 64px;
  -webkit-font-smoothing: antialiased;
}

.page-wrap {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.site-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-bottom: 2px solid var(--black);
  padding-bottom: 12px;
}
.site-logo { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; color: var(--black); }
.site-logo em { font-style: normal; color: var(--green); }
.site-tagline { font-size: 11px; font-weight: 400; color: var(--grey-3); letter-spacing: 0.08em; text-transform: uppercase; }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1.5px solid var(--grey-2);
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
}
.tab-btn {
  background: transparent;
  border: none;
  padding: 11px 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-3);
  cursor: pointer;
  transition: color .15s, background .15s;
  border-right: 1.5px solid var(--grey-2);
  position: relative;
}
.tab-btn:last-child { border-right: none; }
.tab-btn.active { color: var(--white); background: var(--black); }
.tab-btn:hover:not(.active) { color: var(--black); background: var(--grey-1); }

.card {
  background: var(--white);
  border: 1.5px solid var(--grey-2);
  border-radius: var(--radius);
}
.card.card-form { overflow: hidden; }

.form-panel { padding: 20px; }

.field-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey-3);
  margin-bottom: 8px;
}

.input-row { display: flex; gap: 8px; }

input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1.5px solid var(--grey-2);
  border-radius: var(--radius);
  background: var(--off);
  color: var(--black);
  font-size: 13px;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type="text"]::placeholder { color: var(--grey-3); font-family: var(--font-sans); }
input[type="text"]:focus { border-color: var(--black); background: var(--white); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 18px;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
  background: none;
}
.btn-primary { background: var(--black); color: var(--white); border-color: var(--black); }
.btn-primary:hover { background: var(--grey-5); border-color: var(--grey-5); }
.btn-primary:active { background: var(--black); }
.btn-outline { background: var(--white); color: var(--black); border-color: var(--grey-2); }
.btn-outline:hover { border-color: var(--black); background: var(--off); }
.btn-green { background: var(--green); color: var(--white); border-color: var(--green); }
.btn-green:hover { background: #0e7268; border-color: #0e7268; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 11px; }

.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-top: 1px solid var(--grey-1);
  font-size: 11px;
  color: var(--grey-3);
  letter-spacing: 0.04em;
}
.status-bar.hidden { display: none; }

.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--grey-2);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-box {
  display: none;
  margin: 0 20px 16px;
  padding: 10px 14px;
  background: #fdf2f2;
  border-left: 3px solid var(--red);
  color: var(--red);
  font-size: 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.error-box.visible { display: block; }

.result-card { display: none; }
.result-card.visible { display: block; }

.cover-banner {
  width: 100%;
  height: 130px;
  background: var(--grey-1);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}
.cover-banner-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cover-banner-placeholder svg { opacity: .15; }
.cover-banner img { width: 100%; height: 100%; object-fit: cover; display: none; }
.cover-banner img.visible { display: block; }

.profile-body { padding: 0 0 20px; }
.profile-info { padding: 0 20px 20px; }

.avatar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: -36px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  padding: 0 20px;
}
.avatar-frame {
  width: 72px; height: 72px;
  border: 3px solid var(--white);
  border-radius: 50%;
  overflow: hidden;
  background: var(--grey-1);
  flex-shrink: 0;
  box-shadow: 0 1px 6px rgba(0,0,0,.14);
}
.avatar-frame img { width: 100%; height: 100%; object-fit: cover; }
.avatar-actions { display: flex; gap: 8px; padding-bottom: 4px; }

.profile-name { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; color: var(--black); line-height: 1.2; }
.profile-handle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--grey-4);
  background: var(--grey-1);
  padding: 2px 8px;
  border-radius: var(--radius);
}
.profile-handle .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }

.profile-about {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--off);
  border-left: 2px solid var(--grey-2);
  font-size: 13px;
  color: var(--grey-5);
  line-height: 1.55;
  display: none;
}
.profile-about.visible { display: block; }

.meta-table { margin-top: 14px; border: 1px solid var(--grey-1); border-radius: var(--radius); overflow: hidden; }
.meta-row { display: none; align-items: flex-start; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--grey-1); font-size: 13px; }
.meta-row:last-child { border-bottom: none; }
.meta-row.visible { display: flex; }
.meta-icon { flex-shrink: 0; width: 16px; color: var(--grey-3); margin-top: 1px; font-style: normal; }
.meta-value { color: var(--grey-5); word-break: break-all; }
.meta-value a { color: var(--green); }
.meta-value a:hover { text-decoration: underline; }
.meta-empty { padding: 10px 14px; font-size: 12px; color: var(--grey-3); display: none; }
.meta-empty.visible { display: block; }

.divider { border: none; border-top: 1px solid var(--grey-1); margin: 16px 0; }

.channel-result { display: none; }
.channel-result.visible { display: block; }

.channel-image-block {
  width: 100%;
  height: 180px;
  background: var(--grey-1);
  overflow: hidden;
  position: relative;
  border-radius: var(--radius) var(--radius) 0 0;
}
.channel-image-block img { width: 100%; height: 100%; object-fit: cover; display: none; }
.channel-image-block img.visible { display: block; }
.channel-image-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.channel-image-placeholder svg { opacity: .15; }

.channel-body { padding: 18px 20px 20px; }
.channel-name { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; color: var(--black); margin-bottom: 6px; }
.channel-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey-4);
  background: var(--grey-1);
  padding: 3px 9px;
  border-radius: var(--radius);
}
.channel-stat strong { color: var(--black); font-weight: 700; }

.channel-desc {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--off);
  border-left: 2px solid var(--grey-2);
  font-size: 13px;
  color: var(--grey-5);
  line-height: 1.6;
  display: none;
}
.channel-desc.visible { display: block; }

.channel-actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }

.btn-copy { position: relative; }
.btn-copy.copied { background: var(--green); border-color: var(--green); color: var(--white); }
.btn-copy.copied:hover { background: var(--green); border-color: var(--green); }

.site-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 1px solid var(--grey-2);
  padding-top: 20px;
}

.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; border: 1.5px solid var(--grey-2); flex-shrink: 0; }
.footer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.footer-dev-name { font-size: 12px; font-weight: 600; color: var(--black); line-height: 1.2; }
.footer-dev-role { font-size: 10px; color: var(--grey-3); letter-spacing: 0.06em; text-transform: uppercase; }

.footer-links { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-links .btn { height: 32px; padding: 0 12px; font-size: 10px; letter-spacing: 0.06em; }

.footer-credit { font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey-3); text-align: center; }

.faq-section { display: flex; flex-direction: column; gap: 0; }
.faq-heading { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey-4); margin-bottom: 10px; }
.faq-item { border-top: 1px solid var(--grey-1); }
.faq-item:last-child { border-bottom: 1px solid var(--grey-1); }
.faq-q {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 12px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}
.faq-q:hover { color: var(--green); }
.faq-chevron { flex-shrink: 0; width: 14px; height: 14px; transition: transform .2s; color: var(--grey-3); }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-a { font-size: 13px; color: var(--grey-5); line-height: 1.65; padding-bottom: 14px; display: none; }
.faq-item.open .faq-a { display: block; }
.faq-a a { color: var(--green); text-decoration: underline; }

.hidden  { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

@media (max-width: 400px) {
  .input-row { flex-direction: column; }
  .avatar-actions { flex-direction: column; }
  .btn { width: 100%; }
  .channel-actions { flex-direction: column; }
}

.input-hint {
  font-size: 11px;
  margin-top: 6px;
  min-height: 16px;
  letter-spacing: 0.02em;
  display: none;
}
.input-hint.visible { display: block; }
.input-hint.ok   { color: var(--green); }
.input-hint.warn { color: #b45309; }
.input-hint.bad  { color: var(--red); }

.update-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  color: #92400e;
}
.update-banner.visible { display: flex; }
.update-banner .btn-update {
  height: 30px;
  padding: 0 12px;
  font-size: 11px;
  background: #f59e0b;
  color: #fff;
  border-color: #f59e0b;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.update-banner .btn-update:hover { background: #d97706; border-color: #d97706; }
