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

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #fafbfc 0%, #fff 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

.header {
  text-align: center;
  color: #2d3748;
  margin-bottom: 30px;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.header p {
  opacity: 0.7;
  font-size: 1.1rem;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.editor-card {
  padding: 20px;
}

.editor-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 14px;
}

.editor-tab {
  background: #f8fafc;
  color: #4a5568;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.editor-tab:hover {
  background: #edf2f7;
}

.editor-tab.active {
  background: #1f2937;
  color: #ffffff;
  border-color: #1f2937;
}

.editor-tab-count {
  background: rgba(255, 255, 255, 0.18);
  color: currentColor;
  border-radius: 999px;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.editor-tab:not(.active) .editor-tab-count {
  background: #e2e8f0;
}

.editor-panel {
  padding: 6px 2px 2px;
}

.panel-header {
  margin-bottom: 12px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: #2d3748;
}

.list-container {
  min-height: 60px;
}

.list-item {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: center;
}

input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  background: hsl(0, 0%, 98%);
  transition: all 0.2s;
  cursor: text;
}

input[type="text"]:hover,
input[type="text"]:focus {
  background: hsl(0, 0%, 95%);
}

input[type="text"]:focus {
  outline: none;
}

button {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #48bb78;
  color: white;
  max-width: 250px;
}

.btn-primary:hover {
  background: #38a169;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.btn-secondary {
  background: #e2e8f0;
  color: #4a5568;
  max-width: 250px;
}

.btn-secondary:hover {
  background: #cbd5e0;
}

.btn-icon {
  background: transparent;
  color: #a0aec0;
  padding: 4px;
  font-size: 1.8rem;
  min-width: auto;
  max-width: none;
  border-radius: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

.btn-icon-danger:hover {
  background: #fed7d7;
  color: #e53e3e;
}

.btn-icon-primary:hover {
  background: #edf2f7;
  color: #4299e1;
}

.info-block {
  background: #edf2f7;
  border-left: 4px solid #4299e1;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

.info-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 12px;
}

.config-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.config-label {
  color: #718096;
  font-weight: 500;
}

.config-value {
  background: #4299e1;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.config-value:hover {
  background: #3182ce;
  transform: translateY(-1px);
}

.config-value svg {
  width: 16px;
  height: 16px;
  opacity: 0.8;
}

.config-value.copied {
  background: #48bb78;
}

.config-value.copied {
  background: #48bb78;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: #999;
  font-style: italic;
}

.section-hint {
  color: #718096;
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.compact-list-item {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.focus-note {
  color: #975a16;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-soft {
  background: #edf2f7;
  color: #4a5568;
}

.badge-focus {
  background: #f6ad55;
  color: #ffffff;
}

.inspiration-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 60px;
}

.inspiration-chip {
  max-width: 100%;
  padding: 10px 18px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  display: inline-flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: left;
  line-height: 1.25;
}

.inspiration-chip-date {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.72;
  letter-spacing: 0.01em;
}

.inspiration-chip-title {
  width: 100%;
}

@media (min-width: 641px) {
  .inspiration-chip {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .inspiration-chip-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 28ch;
  }

  .inspiration-chip-date {
    white-space: nowrap;
  }
}

.inspiration-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: white;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  pointer-events: auto;
  animation: slideIn 0.3s ease-out;
  min-width: 300px;
}

.toast.hiding {
  animation: slideOut 0.3s ease-out forwards;
}

.toast-success {
  border-left: 4px solid #48bb78;
}

.toast-error {
  border-left: 4px solid #f56565;
}

.toast-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  color: #48bb78;
}

.toast-error .toast-icon {
  color: #f56565;
}

.toast-message {
  flex: 1;
  font-weight: 500;
  color: #2d3748;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* Desktop Dashboard Layout */
@media (min-width: 900px) {
  .container.dashboard {
    max-width: 1100px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .dashboard .header {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  .dashboard .info-block {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  .dashboard .card {
    margin-bottom: 0;
  }

  .dashboard .editor-card {
    grid-column: 1 / -1;
  }

  .dashboard .card-inspiration {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .editor-nav {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 20;
    margin: -4px -4px 12px;
    padding: 8px 4px 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    background: #ffffff;
    backdrop-filter: blur(8px);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .editor-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .header h1 {
    font-size: 2rem;
  }

  .card {
    padding: 20px;
  }

  .editor-card {
    padding: 16px;
  }

  .actions {
    flex-direction: column;
  }

  .btn-primary {
    width: 100%;
    max-width: none;
  }

  .btn-secondary {
    font-size: 0.9rem;
    padding: 10px 16px;
  }

  .toast-container {
    right: 20px;
    left: 20px;
  }

  .toast {
    min-width: auto;
    width: 100%;
  }

  .inspiration-chip {
    width: 100%;
    border-radius: 14px;
  }
}

/* Auth Screen Styles */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}

.auth-card {
  background: white;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.auth-card h1 {
  font-size: 2rem;
  margin-bottom: 8px;
  color: #2d3748;
}

.auth-card p {
  color: #718096;
  margin-bottom: 24px;
}

.auth-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 16px;
  transition: all 0.2s;
}

.auth-input:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.auth-input.error {
  border-color: #f56565;
  animation: shake 0.5s ease-in-out;
}

.auth-error {
  color: #e53e3e;
  font-size: 0.9rem;
  margin-bottom: 16px;
  min-height: 24px;
}

.auth-btn {
  width: 100%;
  padding: 14px 20px;
  background: #4299e1;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-btn:hover {
  background: #3182ce;
  transform: translateY(-1px);
}

.auth-btn:disabled {
  background: #a0aec0;
  cursor: not-allowed;
  transform: none;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  50% {
    transform: translateX(8px);
  }
  75% {
    transform: translateX(-8px);
  }
}
[x-cloak] {
  /* biome-ignore lint/complexity/noImportantStyles: Cloaked elements must stay hidden until Alpine initializes. */
  display: none !important;
}
