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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #fff;
  color: #3d3929;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}

#app {
  width: 100%;
  max-width: 520px;
  padding: 20px;
}

h1 {
  font-size: 28px;
  color: #1a1710;
  margin-bottom: 8px;
}

h1 span {
  color: #d97706;
}

.subtitle {
  color: #6b6553;
  margin-bottom: 24px;
  line-height: 1.6;
}

/* Features */

.features {
  margin-bottom: 20px;
}

.feature {
  padding: 12px 0;
  border-bottom: 1px solid #f0ede6;
}

.feature:last-child {
  border-bottom: none;
}

.feature-title {
  font-weight: 600;
  color: #1a1710;
  margin-bottom: 4px;
  font-size: 14px;
}

.feature-desc {
  color: #8a8272;
  font-size: 13px;
  line-height: 1.5;
}

/* Story */

.story {
  margin-top: 40px;
  margin-bottom: 0;
  padding: 16px;
  background: #fafaf8;
  border-radius: 12px;
}

.story-heading {
  font-size: 12px;
  color: #9b9484;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.story-section {
  padding: 12px 0;
}

.story-section:first-child {
  padding-top: 0;
}

.story-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.story-good {
  background: #ecfdf5;
  color: #047857;
}

.story-bad {
  background: #fef2f2;
  color: #b91c1c;
}

.story-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.story-list li {
  font-size: 13px;
  color: #4b4538;
  line-height: 1.6;
  padding-left: 16px;
  position: relative;
}

.story-list li::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: #9b9484;
}

.story-list li strong {
  color: #1a1710;
}

.story-arrow {
  text-align: center;
  font-size: 14px;
  color: #9b9484;
  padding: 2px 0;
}

.story-solution {
  background: #fffbeb;
  border-radius: 8px;
  padding: 12px 14px;
  border: 1px solid #f5e6b8;
}

.story-text {
  font-size: 13px;
  color: #4b4538;
  line-height: 1.6;
}

.story-text strong {
  color: #b45309;
}

/* Note */

.note {
  margin-bottom: 24px;
  padding: 12px 16px;
  background: #fef9ee;
  border-radius: 8px;
  font-size: 13px;
  color: #8a6d2b;
  line-height: 1.5;
}

.note code {
  background: #fff;
  border: 1px solid #e8e5dc;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #b45309;
}

/* Auth */

#login-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #d97706;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
}

#login-btn:hover {
  background: #b45309;
}

#login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Repo setup section */

#repo-setup-section h2 {
  font-size: 20px;
  color: #1a1710;
  margin-bottom: 8px;
}

.setup-desc {
  color: #6b6553;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Setup steps */

.setup-steps {
  margin-bottom: 16px;
}

.setup-step {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0ede6;
}

.setup-step:last-child {
  border-bottom: none;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #d97706;
  color: #fff;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content p {
  color: #3d3929;
  font-size: 14px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.create-repo-btn {
  display: inline-block;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid #d4d0c5;
  border-radius: 6px;
  color: #3d3929;
  font-size: 13px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.create-repo-btn:hover {
  border-color: #d97706;
  background: #fffbeb;
}

.repo-input-row {
  margin-bottom: 12px;
}

#repo-name-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d4d0c5;
  border-radius: 8px;
  font-size: 16px;
  font-family: monospace;
  color: #3d3929;
  outline: none;
  transition: border-color 0.15s;
}

#repo-name-input:focus {
  border-color: #d97706;
}

#repo-setup-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #d97706;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s;
}

#repo-setup-btn:hover {
  background: #b45309;
}

#repo-setup-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.repo-status {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid #e8e5dc;
  color: #3d3929;
}

.repo-status.error {
  border-color: #dc2626;
  color: #dc2626;
}

/* Upload section */

.repo-badge {
  background: #fef9ee;
  border: 1px solid #e8e5dc;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 13px;
  color: #b45309;
}

#change-repo-btn {
  background: none;
  border: none;
  color: #d97706;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}

#change-repo-btn:hover {
  text-decoration: underline;
}

#setup-logout-btn {
  background: none;
  border: none;
  color: #d97706;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}

#setup-logout-btn:hover {
  text-decoration: underline;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: #6b6553;
  font-size: 14px;
}

.user-bar strong {
  color: #1a1710;
}

#logout-btn {
  background: none;
  border: none;
  color: #d97706;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}

#logout-btn:hover {
  text-decoration: underline;
}

/* Drop zone */

#drop-zone {
  border: 2px dashed #d4d0c5;
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  background: #fff;
}

#drop-zone:hover,
#drop-zone.dragover {
  border-color: #d97706;
  background: #fffbeb;
}

#drop-zone.uploading {
  opacity: 0.5;
  pointer-events: none;
}

.drop-icon {
  font-size: 48px;
  color: #d97706;
  margin-bottom: 16px;
}

#drop-zone p {
  color: #6b6553;
  margin-bottom: 8px;
}

#file-picker-btn {
  background: #fff;
  border: 1px solid #d4d0c5;
  color: #3d3929;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.15s;
}

#file-picker-btn:hover {
  border-color: #d97706;
}

.file-limit {
  font-size: 12px;
  color: #9b9484;
  margin-top: 12px;
}

/* Status */

#status {
  margin-top: 20px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e8e5dc;
  border-radius: 8px;
  font-size: 14px;
  color: #3d3929;
}

#status.error {
  border-color: #dc2626;
  color: #dc2626;
}

/* Result */

#result {
  margin-top: 16px;
  padding: 16px;
  background: #fffbeb;
  border: 1px solid #d97706;
  border-radius: 8px;
}

#result label {
  display: block;
  font-size: 12px;
  color: #6b6553;
  margin-bottom: 8px;
}

.result-row {
  display: flex;
  gap: 8px;
}

#result-url {
  flex: 1;
  background: #fff;
  border: 1px solid #d4d0c5;
  color: #b45309;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 13px;
  outline: none;
}

#result-url:focus {
  border-color: #d97706;
}

#copy-btn {
  padding: 8px 16px;
  background: #d97706;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.15s;
}

#copy-btn:hover {
  background: #b45309;
}

/* History */

#history-section {
  margin-top: 24px;
}

#history-section h3 {
  font-size: 14px;
  color: #6b6553;
  font-weight: 600;
  margin-bottom: 8px;
}

.history-list {
  display: flex;
  flex-direction: column;
}

.history-loading,
.history-empty {
  font-size: 13px;
  color: #9b9484;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #f0ede6;
  text-decoration: none;
  color: #3d3929;
  transition: background 0.15s;
}

.history-item:first-child {
  border-top: 1px solid #f0ede6;
}

.history-item:hover {
  background: #fffbeb;
}

.history-name {
  font-size: 14px;
  color: #1a1710;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 12px;
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.history-date {
  font-size: 12px;
  color: #9b9484;
}

.history-remaining {
  font-size: 12px;
  color: #6b6553;
  background: #f5f3ee;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.history-remaining.expiring {
  color: #dc2626;
  background: #fef2f2;
}

.history-copy-btn {
  padding: 2px 10px;
  background: #fff;
  border: 1px solid #d4d0c5;
  border-radius: 4px;
  font-size: 12px;
  color: #6b6553;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
  min-width: 48px;
}

.history-copy-btn:hover {
  border-color: #d97706;
  background: #fffbeb;
  color: #b45309;
}

/* User bar */

.user-bar-sep {
  color: #d4d0c5;
}

/* Repo badge link */

.repo-badge {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.repo-badge:hover {
  border-color: #d97706;
}

/* Buy me a coffee (fixed position) */

.bmc-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #FFDD00;
  color: #0D0C22;
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: background 0.15s, box-shadow 0.15s;
  z-index: 100;
}

.bmc-btn:hover {
  background: #ffca00;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

/* Responsive */

@media (max-width: 480px) {
  #app {
    padding: 16px;
  }

  h1 {
    font-size: 24px;
  }

  #drop-zone {
    padding: 32px 16px;
  }

  .bmc-btn {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    bottom: 16px;
  }
}
