:root {
  --bg: #0a0a0a;
  --panel: #171717;
  --text: #f4f4f4;
  --muted: #b8b8b8;
  --gold: #d4af37;
  --gold-2: #f4d03f;
  --bubble-user: linear-gradient(135deg, #b68a15, #d4af37);
  --bubble-bot: #1f1f1f;
  --border: rgba(212, 175, 55, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #1b1b1b, var(--bg) 55%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

.app-shell {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 12px 12px 90px;
}

.glass-panel {
  background: linear-gradient(180deg, rgba(33, 33, 33, 0.82), rgba(16, 16, 16, 0.9));
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark,
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #111;
  background: linear-gradient(130deg, var(--gold-2), var(--gold));
}

h1 {
  font-size: 0.86rem;
  margin: 0;
  letter-spacing: 0.03em;
}

.subtitle,
.country {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.menu-btn {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.4rem;
}

.links-section,
.chat-panel,
.profile-panel,
.settings-panel {
  margin-top: 12px;
  padding: 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

h2,
h3 {
  margin: 0 0 10px;
}

#last-refresh {
  font-size: 0.72rem;
  color: var(--muted);
}

.dynamic-links {
  margin: 0;
  padding-left: 20px;
}

.dynamic-links li {
  margin-bottom: 8px;
}

.dynamic-links a {
  color: #f7da6f;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.social-links a {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  text-decoration: none;
  display: grid;
  place-items: center;
  color: #1a1a1a;
  font-weight: 700;
  background: linear-gradient(140deg, #f7df82, var(--gold));
}

.chat-window {
  max-height: 42vh;
  overflow-y: auto;
  padding-right: 4px;
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.message.user {
  justify-content: flex-end;
}

.message.user .avatar {
  display: none;
}

.bubble-wrap {
  max-width: 80%;
}

.bubble {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--bubble-bot);
  line-height: 1.35;
}

.message.user .bubble {
  background: var(--bubble-user);
  color: #161616;
}

time {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.67rem;
  color: var(--muted);
}

.options-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.options-list button {
  border: 1px solid #77652a;
  background: #242424;
  color: #f2da80;
  border-radius: 999px;
  padding: 6px 10px;
}

.chat-input {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 40px 1fr 42px;
  gap: 8px;
}

.chat-input input,
.profile-panel input,
.profile-panel textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #494949;
  background: #111;
  color: var(--text);
  padding: 10px;
}

.attach-btn,
.send-btn {
  border: none;
  border-radius: 12px;
  background: #262626;
  color: #f7da6f;
}

.send-btn {
  background: linear-gradient(140deg, #f0d77a, var(--gold));
  color: #171717;
}

.profile-panel,
.settings-panel {
  display: grid;
  gap: 10px;
}

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bottom-nav {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: min(500px, calc(100% - 20px));
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tab-btn {
  border: none;
  border-radius: 12px;
  background: #202020;
  color: var(--muted);
  padding: 10px 0;
}

.tab-btn.active {
  background: linear-gradient(140deg, #f7dd85, var(--gold));
  color: #111;
  font-weight: 700;
}

.hidden {
  display: none;
}

.app-footer {
  text-align: center;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.app-footer a {
  color: #f5d970;
}

@media (min-width: 521px) {
  .app-shell {
    padding-bottom: 100px;
  }
}

body.theme-alt {
  --bg: #101621;
  --panel: #1a2231;
  --gold: #6ec1ff;
  --gold-2: #a5dbff;
}
