:root {
  /* Colors - Light Theme Default */
  --ak-text: #1A1D23;
  --ak-text-secondary: #64748B;
  --ak-bg-root: #FFFFFF;
  --ak-bg-default: #F7F9FA;
  --ak-bg-secondary: #EDF1F3;
  --ak-bg-elevated: #F7F9FA;
  --ak-primary: #4A90A4;
  --ak-primary-light: #6BA8BB;
  --ak-primary-dark: #357A8C;
  --ak-success: #52A287;
  --ak-warning: #F5A962;
  --ak-error: #E85D5D;
  --ak-border: #E5E7EB;
  
  /* Telegram Theme Variable Mapping (will be overridden by JS if available) */
  --tg-theme-bg-color: var(--ak-bg-root);
  --tg-theme-text-color: var(--ak-text);
  --tg-theme-hint-color: var(--ak-text-secondary);
  --tg-theme-link-color: var(--ak-primary);
  --tg-theme-button-color: var(--ak-primary);
  --tg-theme-button-text-color: #FFFFFF;
  --tg-theme-secondary-bg-color: var(--ak-bg-default);
  
  /* Spacing */
  --ak-space-xs: 4px;
  --ak-space-sm: 8px;
  --ak-space-md: 16px;
  --ak-space-lg: 24px;
  --ak-space-xl: 32px;
  
  /* Typography */
  --ak-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  background-color: var(--tg-theme-bg-color);
  color: var(--tg-theme-text-color);
  font-family: var(--ak-font-sans);
  font-size: 16px;
  line-height: 1.5;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 80px; /* Space for bottom nav */
  height: 100vh;
  overflow: hidden; /* Prevent body scroll, use container scroll */
}

/* App Container */
.ak-app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Screen Containers */
.ak-screen-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
  padding-bottom: 120px; /* Nav bar offset + safe area */
}

.ak-screen-container--padded {
  padding: var(--ak-space-xl) var(--ak-space-lg);
}

/* Views */
.ak-view {
  display: none;
  height: 100%;
  width: 100%;
}

.ak-view--active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 
 * =========================================
 * MindUnload Screen (Home)
 * =========================================
 */
.ak-input-section {
  flex: 1;
  min-height: 300px;
  padding: var(--ak-space-md);
  display: flex;
  flex-direction: column;
}

.ak-text-input {
  flex: 1;
  width: 100%;
  background-color: var(--tg-theme-secondary-bg-color);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: var(--ak-space-md);
  font-family: inherit;
  font-size: 16px;
  color: var(--tg-theme-text-color);
  resize: none;
  outline: none;
  transition: all 0.2s;
}

.ak-text-input:focus {
  background-color: var(--tg-theme-bg-color);
  border-color: var(--ak-border);
}

.ak-transcribing-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--ak-space-sm);
  padding-top: var(--ak-space-md);
}

.ak-transcribing-text {
  font-size: 14px;
  color: var(--tg-theme-hint-color);
}

.ak-action-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ak-space-lg);
  padding: var(--ak-space-xl) var(--ak-space-lg);
  background-color: var(--tg-theme-bg-color); /* Ensure visibility over content */
}

/* Floating Voice Button */
.ak-voice-button {
  width: 64px;
  height: 64px;
  border-radius: 32px;
  background-color: var(--ak-primary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 24px;
  box-shadow: 0 8px 16px rgba(74, 144, 164, 0.3);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 10;
}

.ak-voice-button:active {
  transform: scale(0.9);
}

.ak-voice-button--recording {
  background-color: var(--ak-error);
  box-shadow: 0 8px 16px rgba(232, 93, 93, 0.3);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Process Button */
.ak-process-button {
  width: 100%;
  height: 48px;
  background-color: var(--ak-primary);
  border-radius: 8px; /* BorderRadius.sm */
  border: none;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.ak-process-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ak-process-button:active:not(:disabled) {
  transform: scale(0.98);
}

/* 
 * =========================================
 * Focus Screen (Heute)
 * =========================================
 */
.ak-streak-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--ak-space-xs);
  margin-bottom: var(--ak-space-md);
  color: var(--ak-warning);
  font-weight: 500;
  font-size: 14px;
}

.ak-center-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Focus Card */
.ak-focus-card {
  width: 100%;
  background-color: var(--tg-theme-secondary-bg-color);
  border-radius: 16px; /* BorderRadius.lg */
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
  border: 1px solid var(--ak-border);
  animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.ak-task-accent {
  height: 4px;
  background-color: var(--ak-primary-light);
  width: 100%;
}

.ak-focus-content {
  padding: var(--ak-space-lg);
  text-align: center;
}

.ak-focus-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: var(--ak-space-sm);
  color: var(--tg-theme-text-color);
}

.ak-focus-content p {
  font-size: 16px;
  color: var(--tg-theme-hint-color);
  margin-bottom: var(--ak-space-md);
  line-height: 1.5;
}

.ak-skipped-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--ak-space-xs);
  padding: 4px 8px;
  background-color: rgba(0,0,0,0.05);
  border-radius: 4px;
  font-size: 12px;
  color: var(--tg-theme-hint-color);
}

/* Empty State */
.ak-empty-state {
  text-align: center;
  padding: var(--ak-space-lg);
}

.ak-empty-icon-container {
  width: 96px;
  height: 96px;
  border-radius: 48px;
  background-color: rgba(82, 162, 135, 0.1); /* success + 20 */
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--ak-space-lg);
}

.ak-empty-icon-container i {
  font-size: 48px;
  color: var(--ak-success);
}

.ak-empty-state h2 {
  font-size: 20px;
  margin-bottom: var(--ak-space-sm);
  font-weight: 700;
}

.ak-empty-state p {
  color: var(--tg-theme-hint-color);
  line-height: 1.5;
}

/* Focus Actions */
.ak-focus-actions {
  display: flex;
  gap: var(--ak-space-md);
  padding-bottom: var(--ak-space-md);
  width: 100%;
}

.ak-action-button {
  flex: 1;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--ak-space-sm);
  font-weight: 600;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: transform 0.1s;
}

.ak-action-button:active {
  transform: scale(0.98);
}

.ak-action-button--done {
  background-color: var(--ak-primary);
  color: #FFFFFF;
}

.ak-action-button--skip {
  background-color: transparent;
  border: 2px solid var(--ak-primary);
  color: var(--ak-primary);
}

/* 
 * =========================================
 * List Screen (Liste) - New Styles
 * =========================================
 */
.ak-list-header {
  padding: var(--ak-space-lg) var(--ak-space-md);
  background-color: var(--tg-theme-bg-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.ak-tabs-header {
  display: flex;
  background-color: var(--tg-theme-secondary-bg-color);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.ak-tab-pill {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--tg-theme-hint-color);
  cursor: pointer;
  transition: all 0.2s;
}

.ak-tab-pill--active {
  background-color: var(--ak-primary);
  color: #FFFFFF;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  font-weight: 600;
}

.ak-filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.ak-filter-chip {
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid var(--ak-border);
  background-color: transparent;
  color: var(--tg-theme-hint-color);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.ak-filter-chip--active {
  background-color: var(--ak-primary);
  color: #FFFFFF;
  border-color: var(--ak-primary);
}

.ak-task-list {
  padding: 0 var(--ak-space-md);
}

/* List Items */
.ak-list-item {
  background-color: var(--tg-theme-secondary-bg-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.ak-list-item--task { border-left: 4px solid var(--ak-primary-light); }
.ak-list-item--worry { border-left: 4px solid var(--ak-warning); }
.ak-list-item--note { border-left: 4px solid #8B7AA3; }
.ak-list-item--done { opacity: 0.6; text-decoration: line-through; border-left-color: var(--ak-success); }

.ak-item-content {
  flex: 1;
}

.ak-item-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
  color: var(--tg-theme-text-color);
}

.ak-item-meta {
  font-size: 12px;
  color: var(--tg-theme-hint-color);
  display: flex;
  gap: 8px;
  align-items: center;
}

.ak-item-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ak-reorder-btn {
  padding: 4px;
  background: none;
  border: none;
  color: var(--tg-theme-hint-color);
  cursor: pointer;
}

.ak-icon-action {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tg-theme-hint-color);
    padding: 4px;
}
.ak-icon-action:hover { color: var(--ak-primary); }
.ak-icon-action--delete:hover { color: var(--ak-error); }

/* 
 * =========================================
 * Account Screen (Konto)
 * =========================================
 */
.ak-profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.ak-avatar {
    width: 64px;
    height: 64px;
    border-radius: 32px;
    background-color: var(--ak-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ak-profile-info h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.ak-badge {
    background-color: var(--tg-theme-secondary-bg-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

.ak-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 32px;
}

.ak-stat-card {
    background-color: var(--tg-theme-secondary-bg-color);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

.ak-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--ak-primary);
    margin-bottom: 4px;
}

.ak-stat-label {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

.ak-settings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 32px;
}

.ak-settings-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background-color: var(--tg-theme-secondary-bg-color);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    color: var(--tg-theme-text-color);
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.ak-text-danger {
    color: var(--ak-error);
}

.ak-version-info {
    text-align: center;
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    margin-top: auto;
}

/* 
 * =========================================
 * Tab Bar (Bottom Nav)
 * =========================================
 */
.ak-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.9); /* Blur effect base */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-around;
  padding: 8px 16px; /* Reset padding */
  padding-bottom: env(safe-area-inset-bottom, 24px); /* Safe area padding */
  z-index: 1000;
}

/* Dark mode override for tab bar */
@media (prefers-color-scheme: dark) {
  .ak-tab-bar {
    background-color: rgba(26, 29, 35, 0.9);
    border-top: 1px solid rgba(255,255,255,0.05);
  }
}

.ak-nav__item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--tg-theme-hint-color);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px;
  min-width: 60px;
}

.ak-nav__item svg {
  margin-bottom: 2px;
}

.ak-nav__item--active {
  color: var(--ak-primary);
}

.ak-spinner-icon {
    animation: spin 1s linear infinite;
}

/* 
 * =========================================
 * Utilities
 * =========================================
 */
.ak-hidden { display: none !important; }

.ak-spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid var(--ak-primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.ak-modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
}

.ak-modal__content {
  background-color: var(--tg-theme-bg-color);
  width: 100%;
  border-radius: 20px 20px 0 0;
  padding: 24px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.ak-modal__header h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.ak-modal__actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.ak-button {
  flex: 1;
  height: 44px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.ak-button--primary { background-color: var(--ak-primary); color: #FFFFFF; }
.ak-button--secondary { background-color: transparent; border: 1px solid var(--ak-primary); color: var(--ak-primary); }

.ak-card {
    background-color: var(--tg-theme-secondary-bg-color);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
}
.ak-card--mini { padding: 12px; font-size: 14px; }
.ak-card--task { border-left: 3px solid var(--ak-primary-light); }
.ak-card--worry { border-left: 3px solid var(--ak-warning); }
.ak-card--note { border-left: 3px solid #8B7AA3; }
.ak-card__header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.ak-section-title { font-weight: 600; margin-top: 16px; margin-bottom: 8px; color: var(--tg-theme-text-color); }
