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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.6;
    padding: 40px 20px;
}

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

h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.subtitle {
    color: #6e6e73;
    margin-bottom: 32px;
    font-size: 15px;
}

.card {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #1d1d1f;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0,113,227,0.15);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
}

.radio-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 14px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    transition: all 0.2s;
}

.radio-group label:hover {
    border-color: #0071e3;
    background: #f0f7ff;
}

.radio-group input[type="radio"]:checked + span {
    color: #0071e3;
    font-weight: 600;
}

.radio-group input[type="radio"]:checked ~ span {
    color: #0071e3;
}

.radio-group label:has(input:checked) {
    border-color: #0071e3;
    background: #f0f7ff;
}

.radio-group input[type="radio"] { display: none; }

.photo-upload-area {
    border: 2px dashed #d2d2d7;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.photo-upload-area:hover {
    border-color: #0071e3;
    background: #fafafa;
}

.photo-upload-area input { display: none; }

.photo-upload-area .icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.photo-upload-area .hint {
    font-size: 13px;
    color: #6e6e73;
}

.photo-previews {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.photo-previews .preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e8e8ed;
}

.photo-previews .preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-previews .preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    line-height: 22px;
    text-align: center;
}

.price-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.price-hints .hint-chip {
    padding: 6px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.price-hints .hint-chip:hover {
    border-color: #0071e3;
    background: #f0f7ff;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #0071e3;
    color: #fff;
}

.btn-primary:hover {
    background: #0060c9;
}

.btn-secondary {
    background: #e8e8ed;
    color: #1d1d1f;
}

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

.btn-success {
    background: #34c759;
    color: #fff;
}

.btn-success:hover {
    background: #2db84e;
}

.btn-ghost {
    background: transparent;
    color: #0071e3;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-ghost:hover {
    background: #f0f7ff;
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* Результат */
.result-card {
    display: none;
    animation: fadeIn 0.3s ease;
}

.result-card.visible {
    display: block;
}

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

.post-text {
    background: #fafafa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e8e8ed;
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
    min-height: 100px;
}

.result-photos {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.result-photos img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e8e8ed;
}

/* Ошибки */
.error-box {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 10px;
    padding: 14px 18px;
    color: #cf1322;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.error-box.visible { display: block; }

/* Тоаст */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1d1d1f;
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Страница сохранённых */
.posts-grid {
    display: grid;
    gap: 16px;
}

.post-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e8e8ed;
    transition: box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.post-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.post-card .meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: #6e6e73;
}

.post-card .meta .badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-experience { background: #e8f4fd; color: #0071e3; }
.badge-event { background: #fef7e8; color: #b8860b; }

.post-card .preview-text {
    font-size: 14px;
    color: #1d1d1f;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

.post-card .card-photos {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.post-card .card-photos img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
}

/* Страница поста */
.post-page { max-width: 720px; }

.post-page .post-header {
    margin-bottom: 20px;
}

.post-page .post-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: #6e6e73;
    margin-bottom: 8px;
}

.post-page .post-content {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.post-page .post-content .text {
    white-space: pre-wrap;
    font-size: 15px;
    line-height: 1.8;
}

.post-page .post-photos {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.post-page .post-photos img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e8e8ed;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6e6e73;
}

.empty-state .icon { font-size: 56px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; margin-bottom: 8px; }

.nav-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: center;
}

.nav-bar a {
    color: #0071e3;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.nav-bar a:hover { text-decoration: underline; }

.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* scheduler multi-select */
.post-card-wrap { position: relative; }
.post-card { position: relative; }
.select-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 22px;
    height: 22px;
    accent-color: #0071e3;
    cursor: pointer;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.15s;
}
.post-card-wrap:hover .select-checkbox,
.post-card-wrap.show-checkbox .select-checkbox { opacity: 1; }
.post-card-wrap.selected { outline: 2px solid #0071e3; border-radius: 14px; }
.post-card-wrap.selected .select-checkbox { opacity: 1; }

.schedule-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid #d2d2d7;
    padding: 14px 24px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 100;
}
.schedule-action-bar.visible { display: flex; }

/* modal backdrop */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-backdrop.visible { display: flex; }
.modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
}
.modal-box h3 { margin-bottom: 16px; }
.modal-box select, .modal-box input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 12px;
}
