:root {
  --blue: #3b5ffc;
  --blue-dark: #2746d1;
  --bg: #f4efe8;
  --panel: #ffffff;
  --line: #e8e3dc;
  --charcoal: #1a1a1a;
  --gray: #606060;
  --font-heading: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--bg);
}

a {
  color: inherit;
}

.secure-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* --- Header --- */

.secure-header {
  flex-shrink: 0;
  padding: 1rem 1.5rem 0;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c9d4ff;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--blue);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.6);
}

.back-link:hover {
  background: #eef2ff;
}

.secure-header h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.6rem;
}

/* --- Tab bar --- */

.tab-bar {
  flex-shrink: 0;
  display: flex;
  gap: 0;
  padding: 0 1.5rem;
  border-bottom: 2px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  flex-shrink: 0;
  border: none;
  background: none;
  color: var(--gray);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
  color: var(--charcoal);
}

.tab-btn.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.tab-type {
  display: none;
}

/* --- Content frame --- */

.content-frame {
  flex: 1;
  position: relative;
  min-height: 0;
}

.content-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.empty-state {
  text-align: center;
  color: var(--gray);
  padding: 3rem 1rem;
  font-size: 0.95rem;
}

.external-notice {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--gray);
}

.external-notice strong {
  color: var(--charcoal);
}

.external-hint {
  font-size: 0.78rem;
  margin-top: 0.3rem;
  opacity: 0.7;
}

.external-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  border: 1px solid var(--blue);
  padding: 0.4rem 1rem;
  border-radius: 6px;
}

.external-link:hover {
  background: var(--blue);
  color: #fff;
}

/* --- Responsive --- */

@media (max-width: 640px) {
  .secure-header {
    padding: 0.8rem 1rem 0;
  }

  .tab-bar {
    padding: 0 1rem;
  }

  .tab-btn {
    font-size: 0.75rem;
    padding: 0.55rem 0.7rem;
  }
}
