
  :root {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a3e;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
  }
  
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  body {
    font-family:
      "Inter",
      -apple-system,
      BlinkMacSystemFont,
      sans-serif;
    background: linear-gradient(
      135deg,
      var(--bg-primary) 0%,
      var(--bg-secondary) 100%
    );
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  
  /* Header */
  header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
  }
  
  .credit-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--success);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 1rem;
    color: var(--success);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
  }
  
  .credit-badge span {
    font-weight: bold;
    font-size: 1.2rem;
  }
  
  /* Main Layout */
  .main-container {
    display: flex;
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
    gap: 20px;
  }
  
  /* Left Column - Chat */
  .left-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  
  /* Right Column - Credit History (Desktop only) */
  .right-column {
    width: 360px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  
  .history-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
    max-height: 600px;
  }
  
  .history-panel h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  
  .history-list {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  /* History Item Styles */
  .history-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 12px;
    border-left: 3px solid var(--accent);
    transition: all 0.2s;
  }
  
  .history-item:hover {
    background: rgba(255, 255, 255, 0.06);
  }
  
  .history-item.grant {
    border-left-color: var(--success);
  }
  .history-item.spend,
  .history-item.consume {
    border-left-color: var(--danger);
  }
  .history-item.expire {
    border-left-color: var(--warning);
  }
  .history-item.adjust {
    border-left-color: #a855f7;
  }
  .history-item.reserve {
    border-left-color: #3b82f6;
  }
  .history-item.commit {
    border-left-color: #06b6d4;
  }
  .history-item.rollback {
    border-left-color: #6b7280;
  }
  
  .history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
  }
  
  .history-type {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
  }
  
  .history-item.grant .history-type {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
  }
  .history-item.spend .history-type,
  .history-item.consume .history-type {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
  }
  .history-item.expire .history-type {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
  }
  
  .history-amount {
    font-weight: bold;
    font-size: 1rem;
  }
  
  .history-item.grant .history-amount {
    color: var(--success);
  }
  .history-item.spend .history-amount,
  .history-item.consume .history-amount {
    color: var(--danger);
  }
  .history-item.expire .history-amount {
    color: var(--warning);
  }
  
  .history-reason {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
  }
  
  .history-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-top: 6px;
  }
  
  .history-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
  }
  
  /* Buttons */
  .btn {
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
  }
  
  .btn-primary {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: white;
  }
  
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
  }
  
  .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
  }
  
  /* Mobile Hamburger Menu */
  .hamburger-btn {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s;
  }
  
  .hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.15);
  }
  
  .hamburger-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
  }
  
  .hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .hamburger-btn.active span:nth-child(2) {
    opacity: 0;
  }
  
  .hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }
  
  /* Mobile Menu */
  .mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: var(--bg-secondary);
    z-index: 999;
    padding: 80px 20px 20px;
    overflow-y: auto;
    transition: right 0.3s ease;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    visibility: hidden;
  }
  
  .mobile-menu.active {
    right: 0;
    pointer-events: auto;
    visibility: visible;
  }
  
  .mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    visibility: hidden;
  }
  
  .mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }
  
  .mobile-history-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .mobile-history-panel h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .mobile-history-list {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  /* Auth Section */
  #auth-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 20px;
    max-width: 400px;
    margin: 0 auto;
  }
  
  #auth-section h2 {
    font-size: 1.3rem;
    color: var(--text-secondary);
  }
  
  .auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }
  
  .auth-form input {
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
  }
  
  .auth-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
  }
  
  /* Chat Section */
  #chat-section {
    display: none;
    flex-direction: column;
    flex: 1;
    gap: 20px;
  }
  
  .messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    min-height: 300px;
    max-height: 600px;
  }
  
  .message {
    margin-bottom: 16px;
    padding: 14px 18px;
    border-radius: 16px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
  }
  
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .message.user {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    margin-left: auto;
    border-bottom-right-radius: 4px;
  }
  
  .message.assistant {
    background: rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
  }
  
  .message .tokens {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 8px;
    opacity: 0.7;
  }
  
  .chat-input {
    display: flex;
    gap: 12px;
  }
  
  .chat-input textarea {
    flex: 1;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 1rem;
    resize: none;
    height: 56px;
    outline: none;
    transition: all 0.3s;
  }
  
  .chat-input textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
  }
  
  .powered-by {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
  }
  
  .powered-by a {
    color: var(--accent);
    text-decoration: none;
  }
  
  /* Tablet Responsive */
  @media (max-width: 900px) {
    .main-container {
      flex-direction: column;
    }
  
    .right-column {
      width: 100%;
    }
  
    .history-panel {
      max-height: 400px;
    }
  }
  
  /* Mobile Responsive (768px and below) */
  @media (max-width: 768px) {
    .hamburger-btn {
      display: flex;
    }
  
    .mobile-menu,
    .mobile-overlay {
      display: block;
    }
  
    /* Hide right column completely on mobile */
    .right-column {
      display: none !important;
    }
  
    h1 {
      font-size: 1.5rem;
    }
  
    .main-container {
      padding: 10px;
    }
  
    .messages {
      padding: 15px;
      min-height: 250px;
    }
  }
