/* 📁НАЧАЛО ФАЙЛА css/style.css v1.9 (ПОЛНАЯ ВЕРСИЯ) */

@layer reset, global, layout, components, utilities;

@layer reset {
  :where(*, *::before, *::after) {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  :where(html) {
    scroll-behavior: smooth;
  }
  :where(body) {
    min-height: 100vh;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  :where(img, picture, video, canvas, svg) {
    display: block;
    max-width: 100%;
  }
  :where(input, button, textarea, select) {
    font: inherit;
  }
  :where(details) > :not(summary) {
    display: block;
  }
  @media (prefers-reduced-motion: reduce) {
    :where(html:focus-within) {
      scroll-behavior: auto;
    }
    :where(*, *::before, *::after) {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

@layer global {
  :root {
    --font-primary: system-ui, sans-serif;
    --surface-1: oklch(0.98 0.01 240);
    --surface-2: oklch(0.92 0.02 240);
    --surface-3: oklch(1 0 0);
    --text-1: oklch(0.2 0.01 240);
    --text-2: oklch(0.4 0.01 240);
    --brand: oklch(0.6 0.2 260);
    --border-color: oklch(0.85 0.02 240);
    --shadow-color: oklch(0.1 0.05 250 / 0.2);
    --grid-dot-color: oklch(0.9 0.01 240);
    --radius-1: 0.25rem;
    --radius-2: 0.5rem;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --surface-1: oklch(0.15 0.02 240);
      --surface-2: oklch(0.2 0.02 240);
      --surface-3: oklch(0.1 0 0);
      --text-1: oklch(0.95 0.01 240);
      --text-2: oklch(0.7 0.01 240);
      --brand: oklch(0.7 0.2 280);
      --border-color: oklch(0.3 0.02 240);
      --shadow-color: oklch(0 0 0 / 0.5);
      --grid-dot-color: oklch(0.25 0.01 240);
    }
  }
  body {
    display: grid;
    grid-template-rows: auto 1fr auto;
    background-color: var(--surface-1);
    color: var(--text-1);
    font-family: var(--font-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
  }
  .main-header,
  .main-footer {
    padding: 1rem 2rem;
    background-color: var(--surface-3);
    box-shadow: 0 2px 5px var(--shadow-color);
    z-index: 10;
  }
  .main-footer {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-2);
    box-shadow: 0 -2px 5px var(--shadow-color);
  }
}

@layer layout {
  .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .main-header h1 {
    font-size: 1.5rem;
    color: var(--brand);
  }
  .main-nav {
    display: flex;
    gap: 0.5rem;
  }
  .main-nav a {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-2);
    text-decoration: none;
    font-weight: 500;
    color: var(--text-2);
    transition: background-color 0.2s, color 0.2s;
  }
  .main-nav a:hover {
    background-color: var(--surface-2);
    color: var(--text-1);
  }
  .main-nav a[aria-current="page"] {
    background-color: oklch(from var(--brand) l c h / 0.1);
    color: var(--brand);
    font-weight: 600;
  }
  
  #prompt-library-container {
    padding: 2rem;
    width: 100%;
    max-width: 1400px;
    margin-inline: auto;
  }
  
  .toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
  }
  .search-bar {
    flex-grow: 1;
  }
  .search-bar input[type="search"] {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-2);
    border: 1px solid var(--border-color);
    background-color: var(--surface-2);
    color: var(--text-1);
    font-size: 1rem;
    transition: box-shadow 0.2s, border-color 0.2s;
  }
  .search-bar input[type="search"]:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px oklch(from var(--brand) l c h / 0.3);
  }
  
  .button {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-2);
    border: 1px solid var(--border-color);
    background-color: var(--surface-3);
    color: var(--text-1);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
  }
  .button:hover {
    border-color: var(--brand);
    background-color: var(--surface-2);
  }
  .button[aria-pressed="true"] {
    background-color: var(--brand);
    color: var(--surface-1);
    border-color: var(--brand);
  }

  .prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
  }
  .prompt-card {
    display: flex;
    flex-direction: column;
    background-color: var(--surface-3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2);
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .prompt-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px var(--shadow-color);
  }
  .card-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
  }
  .prompt-title {
    font-size: 1.1rem;
    color: var(--text-1);
  }
  .card-tags {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .tag {
    display: inline-flex;
    align-items: center;
    background-color: oklch(from var(--brand) l c h / 0.1);
    color: oklch(from var(--brand) l c h);
    padding: 2px 6px;
    border-radius: var(--radius-1);
    font-size: 0.8rem;
    font-weight: 500;
  }
  .card-content {
    padding: 1rem;
    flex-grow: 1;
    overflow-y: auto;
    max-height: 250px;
  }
  .content-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 0.25rem;
    display: block;
    text-transform: uppercase;
  }
  .prompt-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.95rem;
    color: var(--text-2);
  }
  .card-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--surface-2);
    border-radius: 0 0 var(--radius-2) var(--radius-2);
  }
  .card-actions .button {
    flex-grow: 1;
    text-align: center;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-2);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
  }
  .card-actions .button:hover {
    border-color: var(--brand);
    background-color: oklch(from var(--brand) l c h / 0.1);
    color: var(--brand);
  }
  .card-actions .delete-button:hover {
    --brand: oklch(0.6 0.2 30);
  }

  .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--surface-2);
    border-radius: var(--radius-2);
    border: 1px dashed var(--border-color);
  }
  .empty-state h3 { font-size: 1.5rem; color: var(--text-1); margin-bottom: 0.5rem; }
  .empty-state p { color: var(--text-2); }
  .empty-state a { color: var(--brand); text-decoration: none; font-weight: 500; }
  .empty-state a:hover { text-decoration: underline; }

  .tag-cloud-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background-color: var(--surface-2);
    border-radius: var(--radius-2);
    min-height: 400px;
    perspective: 1000px;
  }
  .tag-cloud-container.is-animated .tag-cloud-rotator {
    animation: slow-spin 35s linear infinite;
  }
  .tag-cloud-rotator {
    position: relative;
    width: 1px;
    height: 1px;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(.25,1,.5,1);
    transform: rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg));
  }
  .tag-cloud-item {
    position: absolute;
    top: 50%;
    left: 50%;
    --min-font-size: 1rem;
    --max-font-size: 2.2rem;
    font-size: clamp(var(--min-font-size), calc(var(--min-font-size) + (var(--tag-frequency, 1) - 1) * 0.15rem), var(--max-font-size));
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    border: none;
    background: none;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s, text-shadow 0.2s;
  }
  .tag-cloud-item:hover {
    color: var(--brand);
    text-shadow: 0 0 10px oklch(from var(--brand) l c h / 0.5);
  }

  @keyframes slow-spin {
    from { transform: rotateX(0deg) rotateY(0deg); }
    to   { transform: rotateX(0deg) rotateY(360deg); }
  }
}

@layer components {
  .editor-canvas {
    position: relative;
    overflow: hidden;
    cursor: grab;
    background-color: var(--surface-1);
    --dot-size: 1px;
    --dot-space: 20px;
    background-image: radial-gradient(circle at center, var(--grid-dot-color) var(--dot-size), transparent 0);
    background-size: var(--dot-space) var(--dot-space);
    touch-action: none;
  }
  .editor-canvas:active {
    cursor: grabbing;
  }
  #scene-layer {
    position: absolute;
    inset: 0;
    transform-origin: 0 0;
    will-change: transform;
  }
  .connector-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    width: 100%;
    height: 100%;
    overflow: visible;
    z-index: 1;
  }
  .connector-line {
    fill: none;
    stroke: var(--text-2);
    stroke-width: 2.5px;
    stroke-linecap: round;
  }
  .connector-line.is-draft {
    stroke: var(--brand);
    stroke-dasharray: 5 5;
  }
}

/* 📁КОНЕЦ ФАЙЛА css/style.css v1.9 (ПОЛНАЯ ВЕРСИЯ) */