/* ==========================================================================
   Universal Terms & Conditions Stylesheet
   JNU Infosoft Android Portfolio
   ========================================================================== */

/* Theme Variables (Default: Light) */
:root {
  --bg-body: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.82);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --border-color: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(79, 70, 229, 0.28);
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.12);
  --accent: #0891b2;
  --accent-glow: rgba(8, 145, 178, 0.12);
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --nav-bg: rgba(248, 250, 252, 0.85);
  --glass-bg: rgba(255, 255, 255, 0.6);
  --chip-bg: rgba(15, 23, 42, 0.04);
  --chip-active-bg: #4f46e5;
  --chip-active-text: #ffffff;
  --chip-border: rgba(15, 23, 42, 0.08);
  --callout-info-bg: rgba(8, 145, 178, 0.06);
  --callout-info-border: rgba(8, 145, 178, 0.25);
  --callout-warning-bg: rgba(245, 158, 11, 0.08);
  --callout-warning-border: #f59e0b;
  --legal-box-bg: rgba(15, 23, 42, 0.03);
  --legal-box-border: rgba(15, 23, 42, 0.12);
  --code-bg: rgba(79, 70, 229, 0.06);
  --code-text: #4338ca;
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --bg-body: #070a13;
  --bg-card: rgba(15, 23, 42, 0.65);
  --bg-card-hover: rgba(15, 23, 42, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.45);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);
  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.25);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --nav-bg: rgba(7, 10, 19, 0.88);
  --glass-bg: rgba(15, 23, 42, 0.45);
  --chip-bg: rgba(255, 255, 255, 0.05);
  --chip-active-bg: #6366f1;
  --chip-active-text: #ffffff;
  --chip-border: rgba(255, 255, 255, 0.1);
  --callout-info-bg: rgba(6, 182, 212, 0.1);
  --callout-info-border: rgba(6, 182, 212, 0.35);
  --callout-warning-bg: rgba(245, 158, 11, 0.12);
  --callout-warning-border: #f59e0b;
  --legal-box-bg: rgba(255, 255, 255, 0.03);
  --legal-box-border: rgba(255, 255, 255, 0.12);
  --code-bg: rgba(99, 102, 241, 0.15);
  --code-text: #a5b4fc;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-body);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.65;
  transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] body {
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 45%);
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* Header */
header {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  transition: background-color 0.3s ease;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 20px;
  background: linear-gradient(135deg, var(--text-main) 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border-color);
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.05);
}

.theme-toggle-btn .sun-icon {
  display: none;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.theme-toggle-btn .moon-icon {
  display: block;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

[data-theme="dark"] .theme-toggle-btn .sun-icon {
  display: block;
}

[data-theme="dark"] .theme-toggle-btn .moon-icon {
  display: none;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.terms-hero {
  padding: 44px 0 32px 0;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.03) 0%, transparent 100%);
}

.hero-top-badges {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-legal {
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.badge-category {
  background: rgba(8, 145, 178, 0.1);
  color: var(--accent);
  border: 1px solid rgba(8, 145, 178, 0.2);
}

.terms-title {
  font-family: 'Outfit', sans-serif;
  font-size: 40px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 8px;
  color: var(--text-main);
}

.terms-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.terms-subtitle strong {
  color: var(--text-main);
}

/* Meta Grid */
.app-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.meta-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.meta-card:hover {
  border-color: var(--border-hover);
}

.meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-subtle);
  font-weight: 600;
}

.meta-val {
  font-size: 14px;
  color: var(--text-main);
  word-break: break-all;
}

.meta-val a {
  color: var(--accent);
  text-decoration: none;
}

.meta-val a:hover {
  text-decoration: underline;
}

.meta-val code {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Hero Actions */
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.action-btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.action-btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.action-btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}

.action-btn-secondary:hover {
  border-color: var(--border-hover);
  color: var(--primary);
  background: var(--bg-card-hover);
}

.action-btn-print {
  background: var(--bg-card);
  color: var(--text-muted);
  border-color: var(--border-color);
}

.action-btn-print:hover {
  color: var(--text-main);
  border-color: var(--text-subtle);
}

/* ==========================================================================
   App Switcher Bar
   ========================================================================== */
.app-switcher-wrapper {
  background: var(--glass-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.app-switcher-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.switcher-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-subtle);
  white-space: nowrap;
}

.app-chips-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.app-chips-container::-webkit-scrollbar {
  height: 4px;
}

.app-chips-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.app-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.app-chip:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

.app-chip.active {
  background: var(--chip-active-bg);
  color: var(--chip-active-text);
  border-color: var(--chip-active-bg);
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* ==========================================================================
   Main Layout: Sidebar TOC + Legal Content
   ========================================================================== */
.terms-main-wrapper {
  padding: 40px 0 80px 0;
  flex: 1;
}

.terms-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  align-items: start;
}

/* Sidebar TOC */
.terms-sidebar {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.terms-sidebar::-webkit-scrollbar {
  width: 5px;
}

.terms-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.toc-sticky-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.toc-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.toc-count {
  font-size: 11px;
  font-weight: 600;
  background: var(--chip-bg);
  padding: 3px 8px;
  border-radius: 12px;
  color: var(--text-subtle);
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-link {
  display: flex;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.toc-num {
  font-weight: 600;
  color: var(--accent);
  min-width: 22px;
}

.toc-title {
  flex: 1;
}

.toc-link:hover {
  color: var(--text-main);
  background: rgba(79, 70, 229, 0.05);
}

.toc-link.active {
  color: var(--primary);
  font-weight: 600;
  background: rgba(79, 70, 229, 0.1);
  border-left: 3px solid var(--primary);
}

/* ==========================================================================
   Main Legal Content Sections
   ========================================================================== */
.terms-content {
  min-width: 0;
}

.terms-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 28px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.terms-section:hover {
  border-color: var(--border-hover);
}

.section-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: 8px;
}

.terms-section h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text-main);
  line-height: 1.3;
}

.terms-section p {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 16px;
  line-height: 1.7;
}

.terms-section p:last-child {
  margin-bottom: 0;
}

.terms-section ul, 
.terms-section ol {
  margin-left: 20px;
  margin-bottom: 18px;
  color: var(--text-muted);
  font-size: 15px;
}

.terms-section li {
  margin-bottom: 10px;
  line-height: 1.6;
}

.terms-section strong {
  color: var(--text-main);
}

.inline-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.inline-link:hover {
  text-decoration: underline;
}

/* Callout Boxes */
.callout-box {
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 28px;
  font-size: 15px;
  line-height: 1.7;
}

.info-callout {
  background: var(--callout-info-bg);
  border: 1px solid var(--callout-info-border);
}

.warning-callout {
  background: var(--callout-warning-bg);
  border: 1px solid var(--callout-warning-border);
  border-left-width: 5px;
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
}

.callout-list {
  margin-left: 20px;
  margin-bottom: 0;
}

.callout-list li {
  margin-bottom: 8px;
  color: var(--text-main);
  font-size: 14.5px;
}

/* Legal Emphasis Box (All-Caps Warranty / Liability) */
.legal-emphasis-box {
  background: var(--legal-box-bg);
  border: 1px solid var(--legal-box-border);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  padding: 22px;
  margin: 18px 0;
}

.legal-emphasis-box p {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-main);
  margin-bottom: 14px;
}

.legal-emphasis-box p:last-child {
  margin-bottom: 0;
}

/* Code Step Box */
.code-step-box {
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 14px 0 18px 0;
  overflow-x: auto;
}

.code-step-box code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  color: var(--code-text);
  white-space: nowrap;
}

/* Trader Card */
.trader-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  margin: 20px 0;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.trader-header {
  background: rgba(79, 70, 229, 0.08);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
}

.trader-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.trader-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trader-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-color);
}

.trader-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.trader-label {
  color: var(--text-subtle);
  font-weight: 500;
  min-width: 220px;
}

.trader-val {
  color: var(--text-main);
  text-align: right;
  flex: 1;
}

.trader-val a {
  color: var(--accent);
  text-decoration: none;
}

.trader-val a:hover {
  text-decoration: underline;
}

/* Permissions Schedule */
.permissions-schedule-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 28px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.permissions-schedule-wrapper h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.permissions-schedule-wrapper p {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 20px;
}

.permissions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.permission-card {
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 20px;
}

[data-theme="dark"] .permission-card {
  background: rgba(255, 255, 255, 0.02);
}

.permission-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.permission-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.permission-tag.mandatory {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.permission-tag.optional {
  background: rgba(8, 145, 178, 0.12);
  color: var(--accent);
  border: 1px solid rgba(8, 145, 178, 0.25);
}

.permission-name code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 13.5px;
  color: var(--text-main);
}

.permission-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.permission-settings {
  font-size: 12.5px;
  color: var(--text-subtle);
}

/* Back to Top */
.back-to-top-container {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.back-to-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.back-to-top-btn:hover {
  color: var(--primary);
  border-color: var(--border-hover);
}

/* ==========================================================================
   404 State Styles
   ========================================================================== */
.terms-404-wrapper {
  padding: 80px 0;
  display: flex;
  justify-content: center;
}

.error-box-404 {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 48px;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 40px var(--primary-glow);
}

.error-code-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.error-box-404 h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text-main);
}

.error-message {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.error-message code {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 2px 6px;
  border-radius: 4px;
}

.error-actions-404 {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.available-apps-404 {
  text-align: left;
  border-top: 1px solid var(--border-color);
  padding-top: 32px;
}

.available-apps-404 h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-main);
}

.apps-grid-404 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.app-card-404 {
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

[data-theme="dark"] .app-card-404 {
  background: rgba(255, 255, 255, 0.02);
}

.app-card-404 h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.app-pkg-404 code {
  font-size: 11px;
  color: var(--text-subtle);
}

.app-summary-404 {
  font-size: 12.5px;
  color: var(--text-muted);
  flex: 1;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding: 36px 0;
  background: var(--nav-bg);
  font-size: 14px;
  color: var(--text-muted);
  transition: background-color 0.3s ease;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text-main);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 980px) {
  .terms-layout {
    grid-template-columns: 1fr;
  }

  .terms-sidebar {
    position: static;
    max-height: none;
    margin-bottom: 24px;
  }

  .toc-sticky-box {
    padding: 16px;
  }

  .toc-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 4px;
  }
}

@media (max-width: 640px) {
  .terms-title {
    font-size: 30px;
  }

  .terms-subtitle {
    font-size: 15px;
  }

  .terms-section {
    padding: 22px 18px;
  }

  .terms-section h2 {
    font-size: 20px;
  }

  .trader-row {
    flex-direction: column;
    gap: 4px;
  }

  .trader-label {
    min-width: 0;
  }

  .trader-val {
    text-align: left;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .hero-actions {
    flex-direction: column;
  }

  .action-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   Print Stylesheet (@media print)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
    line-height: 1.5;
  }

  header,
  footer,
  .terms-sidebar,
  .app-switcher-wrapper,
  .hero-actions,
  .back-to-top-container,
  .theme-toggle-btn {
    display: none !important;
  }

  .terms-hero {
    padding: 0 0 20pt 0 !important;
    border-bottom: 2pt solid #000000 !important;
    background: none !important;
  }

  .terms-title {
    font-size: 24pt !important;
    color: #000000 !important;
  }

  .terms-layout {
    display: block !important;
  }

  .terms-section {
    background: none !important;
    border: none !important;
    padding: 12pt 0 !important;
    margin-bottom: 16pt !important;
    page-break-inside: avoid;
    break-inside: avoid;
    box-shadow: none !important;
  }

  .terms-section h2 {
    font-size: 16pt !important;
    color: #000000 !important;
    border-bottom: 1pt solid #cccccc;
    padding-bottom: 4pt;
  }

  .legal-emphasis-box,
  .callout-box,
  .trader-card,
  .permission-card {
    border: 1pt solid #666666 !important;
    background: none !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  a {
    color: #000000 !important;
    text-decoration: underline !important;
  }

  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 9pt;
  }
}

