:root {
    --bg: #fafaf7;
    --fg: #2a2a2a;
    --muted: #777;
    --accent: #d97706;
    --accent-hover: #b45309;
    --card: #fff;
    --border: #e5e5e0;
    --demo: #f0ad4e;
    --fork: #4a90d9;
    --cooked: #4caf50;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--fg);
    margin: 0;
    line-height: 1.55;
    font-size: 16px;
}

.wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Шапка */
header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    margin-bottom: 28px;
    position: sticky;
    top: 0;
    z-index: 10;
}

header .wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

header .logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--fg);
    text-decoration: none;
    letter-spacing: -0.5px;
}

header .logo span { color: var(--accent); }

header nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
}

header nav a {
    color: var(--fg);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.15s;
}

header nav a:hover { background: #f3f3ee; }
header nav a.primary {
    background: var(--accent);
    color: #fff;
}
header nav a.primary:hover { background: var(--accent-hover); }

/* Заголовки */
h1 {
    font-size: 26px;
    margin: 32px 0 16px;
    letter-spacing: -0.4px;
}
h1:first-child { margin-top: 0; }

h2 {
    font-size: 19px;
    margin: 28px 0 12px;
    letter-spacing: -0.2px;
}

h3 { font-size: 16px; margin: 20px 0 8px; }

/* Карточки */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 10px 0;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
    border-color: #d0d0c8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.card a {
    color: var(--fg);
    text-decoration: none;
    font-weight: 600;
}

.card a:hover { color: var(--accent); }

.card .meta {
    display: block;
    margin-top: 4px;
}

/* Мета */
.meta {
    color: var(--muted);
    font-size: 13.5px;
}

/* Бейджи */
.demo-badge, .fork-badge, .cooked-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    vertical-align: middle;
}

.demo-badge { background: #fef3c7; color: #92400e; }
.fork-badge { background: #dbeafe; color: #1e40af; }
.cooked-badge { background: #dcfce7; color: #166534; }

.card.demo { opacity: 0.6; }
.card.demo:hover { opacity: 1; }

/* Пустые состояния */
.empty {
    color: var(--muted);
    font-style: italic;
    padding: 20px 0;
}

/* Формы */
form { margin: 16px 0; }

label {
    display: block;
    margin: 14px 0 6px;
    font-size: 14px;
    font-weight: 500;
}

input[type=text], input[type=email], input[type=password], textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    background: var(--card);
    color: var(--fg);
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12);
}

textarea {
    min-height: 130px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 13.5px;
    line-height: 1.5;
    resize: vertical;
}

button, input[type=submit] {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 8px;
}

button:hover, input[type=submit]:hover {
    background: var(--accent-hover);
}

/* Чекбоксы */
label.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    margin: 14px 0;
}

label.checkbox input { width: auto; margin: 0; }

/* Список версий */
.version-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.version-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14.5px;
}

.version-list li:last-child { border-bottom: none; }

.version-list a {
    font-weight: 600;
    color: var(--fg);
    text-decoration: none;
}

.version-list a:hover { color: var(--accent); }

.version-list .meta { display: inline; margin-left: 8px; }

/* Ингредиенты и шаги */
.ingredients {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 20px;
    margin: 12px 0;
}

.ingredients li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0ea;
}
.ingredients li:last-child { border-bottom: none; }

.steps li {
    padding: 8px 0;
    line-height: 1.6;
}

.ing-name-display {
    font-weight: 600;
    flex: 1;
}
.ing-amount-display {
    /*color: var(--muted);*/
	
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Видео */
.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    margin: 12px 0;
}

.video-embed iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}

/* Сообщения */
.notice {
    background: #fef3c7;
    border-left: 3px solid var(--demo);
    padding: 12px 16px;
    border-radius: 6px;
    margin: 16px 0;
    font-size: 14.5px;
}

.warnings-list {
    margin: 8px 0 8px 20px;
    padding: 0;
}
.warnings-list li {
    margin: 4px 0;
}

.ing-exact {
    color: #999;
    font-size: 0.85em;
    margin-left: 4px;
    font-variant-numeric: tabular-nums;
}