/* Ofiki (ofiki.ru). © 2025–2026 DNR.GURU (https://dnr.guru). Все права защищены. Исходный код является интеллектуальной собственностью DNR.GURU; копирование, распространение, изменение и использование без письменного разрешения правообладателя запрещены. */
/* Бесплатные инструменты (0.18.70): генератор QR-кода и калькулятор себестоимости. */

.tool .eyebrow a {
    text-decoration: none;
}

.tool-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    margin: 8px 0 36px;
}

.tool-form,
.tool-result {
    padding: 26px 28px;
}

.tool-form .field:last-of-type {
    margin-bottom: 18px;
}

.tool-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.tool-row .field {
    margin-bottom: 18px;
}

.tool-form input[type="color"] {
    padding: 4px;
    cursor: pointer;
}

.tool-form .notice {
    margin: 16px 0 0;
}

.tool-result {
    text-align: center;
}

.tool-qr-image {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    margin: 0 auto 12px;
}

.tool-qr-url {
    font-size: .8rem;
    color: var(--muted);
    overflow-wrap: anywhere;
    margin-bottom: 14px;
}

.tool-actions {
    justify-content: center;
}

.tool-result .hint {
    text-align: left;
}

.tool-placeholder {
    display: grid;
    place-items: center;
    min-height: 280px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    padding: 24px;
}

.tool-placeholder p {
    margin: 0;
}

/* Калькулятор: таблица продуктов прокручивается внутри себя на узком экране. */
.cost-tool {
    margin: 8px 0 20px;
}

.cost-table-wrap {
    /* Точка отсчёта для скрытой подписи столбца: иначе она выталкивает страницу вбок. */
    position: relative;
    overflow-x: auto;
    margin: 0 -8px 8px;
    padding: 0 8px;
}

.cost-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: .875rem;
}

.cost-table th {
    text-align: left;
    font-weight: 600;
    color: var(--muted);
    padding: 0 6px 8px;
    white-space: nowrap;
}

.cost-table td {
    padding: 4px 6px;
    vertical-align: middle;
}

.cost-table input,
.cost-table select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid #b5bcae;
    border-radius: 8px;
    background: var(--paper);
    padding: 8px 10px;
    font-size: .95rem;
    color: var(--ink);
}

.cost-table td:nth-child(1) { width: 30%; }
.cost-table td:nth-child(2),
.cost-table td:nth-child(4) { width: 11%; }
.cost-table td:nth-child(3) { width: 9%; }
.cost-table td:nth-child(5) { width: 17%; }

.cost-table td:nth-child(5) {
    white-space: nowrap;
}

.cost-table td:nth-child(5) input {
    width: calc(100% - 42px);
    display: inline-block;
}

.cost-price-unit {
    display: inline-block;
    width: 38px;
    margin-left: 4px;
    font-size: .75rem;
    color: var(--muted);
}

.cost-brutto,
.cost-sum {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.cost-sum {
    font-weight: 600;
}

.cost-remove {
    min-width: 36px;
    font-size: 1.2rem;
    text-decoration: none;
}

.cost-result {
    margin-bottom: 36px;
    text-align: left;
}

.cost-figures {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
}

.cost-figures div {
    padding-left: 14px;
    border-left: 2px solid var(--line);
}

.cost-figures dt {
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.cost-figures dd {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.cost-result .hint {
    margin-bottom: 0;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 900px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }

    .cost-figures {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* На телефоне строка продукта — карточка: название сверху, поля по два в ряд, итог строки внизу. */
@media (max-width: 640px) {
    .cost-table-wrap {
        overflow: visible;
        margin: 0 0 8px;
        padding: 0;
    }

    .cost-table,
    .cost-table tbody {
        display: block;
        min-width: 0;
    }

    .cost-table thead {
        display: none;
    }

    .cost-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px 10px;
        padding: 14px 0;
        border-bottom: 1px solid var(--line);
        position: relative;
    }

    .cost-table td {
        display: block;
        width: auto !important;
        padding: 0;
    }

    .cost-table td::before {
        content: attr(data-label);
        display: block;
        font-size: .75rem;
        color: var(--muted);
        margin-bottom: 4px;
    }

    .cost-table td:nth-child(1) {
        grid-column: 1 / -1;
        padding-right: 44px;
    }

    .cost-brutto,
    .cost-sum {
        padding-top: 4px !important;
    }

    .cost-remove-cell {
        position: absolute;
        top: 30px;
        right: 0;
    }

    .cost-remove-cell::before {
        content: none !important;
    }
}

@media (max-width: 560px) {
    .tool-form,
    .tool-result {
        padding: 20px 18px;
    }

    .tool-row {
        grid-template-columns: 1fr 1fr;
    }

    .tool-row .field:last-child {
        grid-column: 1 / -1;
    }
}

/* Бланк технологической карты (0.18.72): на экране — форма, на печати — документ на листе A4. */
.techcard {
    padding: 32px 36px;
    margin: 8px 0 36px;
}

.techcard input,
.techcard textarea {
    width: 100%;
    min-width: 0;
    border: 0;
    border-bottom: 1px solid #b5bcae;
    border-radius: 0;
    background: transparent;
    padding: 6px 2px;
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    min-height: 0;
}

.techcard textarea {
    display: block;
    resize: vertical;
    line-height: 1.5;
    border: 1px solid #b5bcae;
    border-radius: 6px;
    padding: 8px 10px;
}

.techcard input:focus,
.techcard textarea:focus {
    outline: none;
    border-color: var(--ink);
}

.techcard label span {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 2px;
}

.techcard-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 2px solid var(--ink);
}

.techcard-head h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.techcard-inline.techcard-number {
    width: 90px;
    font-size: 1.3rem;
    font-weight: 600;
}

.techcard-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 24px;
    margin-bottom: 16px;
}

.techcard-head .techcard-meta {
    margin: 0;
    min-width: min(100%, 420px);
}

.techcard-title {
    display: block;
    margin-bottom: 16px;
}

.techcard-title input {
    font-size: 1.25rem;
    font-weight: 600;
}

.techcard-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0 22px;
    font-size: .95rem;
}

.techcard-table th {
    text-align: left;
    font-size: .75rem;
    color: var(--muted);
    padding: 6px 6px;
    border-bottom: 1px solid var(--ink);
}

.techcard-table td {
    padding: 2px 6px;
    border-bottom: 1px solid var(--line);
}

.techcard-table td input {
    border-bottom: 0;
}

.techcard-table th:nth-child(1),
.techcard-n {
    width: 36px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.techcard-table th:nth-child(3),
.techcard-table th:nth-child(4),
.techcard-table td:nth-child(3),
.techcard-table td:nth-child(4) {
    width: 16%;
}

.techcard-table tfoot td {
    border-bottom: 0;
    padding-top: 8px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.techcard-sum-label {
    text-align: right;
    color: var(--muted);
    font-weight: 400 !important;
}

.techcard-remove-cell {
    width: 40px;
}

.techcard-remove {
    min-width: 36px;
    font-size: 1.2rem;
    text-decoration: none;
}

.techcard-field {
    display: block;
    margin-bottom: 16px;
}

.techcard-sign {
    margin-top: 26px;
}

@media (max-width: 560px) {
    .techcard {
        padding: 22px 16px;
    }

    .techcard-meta {
        grid-template-columns: 1fr;
    }

    .techcard-table th:nth-child(3),
    .techcard-table th:nth-child(4),
    .techcard-table td:nth-child(3),
    .techcard-table td:nth-child(4) {
        width: 17%;
    }

    .techcard-table th,
    .techcard-table td {
        padding-left: 3px;
        padding-right: 3px;
    }

    .techcard-table th:nth-child(1),
    .techcard-n {
        width: 22px;
    }

    .techcard-remove-cell {
        width: 30px;
    }

    .techcard-remove {
        min-width: 28px;
        padding: 6px 0;
    }
}

/* Печать: только карта, чёрным по белому, без полей ввода. */
@media print {
    @page {
        size: A4;
        margin: 12mm 14mm;
    }

    body {
        background: #fff !important;
    }

    .topbar,
    .ofiki-footer,
    .breadcrumbs,
    nav[aria-label="Хлебные крошки"],
    .no-print,
    [class*="cookie"],
    .skip {
        display: none !important;
    }

    .workspace {
        padding: 0 !important;
        max-width: none !important;
        min-height: 0 !important;
    }

    .techcard {
        border: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
        color: #000;
        font-size: 11pt;
    }

    .techcard input,
    .techcard textarea {
        color: #000;
        border-color: #999;
    }

    .techcard textarea {
        border: 0;
        border-bottom: 1px solid #999;
        border-radius: 0;
        resize: none;
        overflow: visible;
        min-height: 3em;
    }

    .techcard input::placeholder,
    .techcard textarea::placeholder {
        color: transparent;
    }

    .techcard-table tr {
        break-inside: avoid;
    }

    /* Пустой бланк с восемью строками помещается на один лист. */
    .techcard input { padding: 3px 2px; font-size: 10.5pt; }
    .techcard-table td input { padding: 2px; }
    .techcard-head { padding-bottom: 8px; margin-bottom: 10px; }
    .techcard-meta, .techcard-title, .techcard-field { margin-bottom: 9px; }
    .techcard-table { margin: 4px 0 12px; }
    .techcard textarea { min-height: 2.6em; padding: 3px 2px; font-size: 10.5pt; }
    .techcard-sign { margin-top: 8px; }
    .techcard label span { margin-bottom: 0; }
    .techcard-table th { padding: 3px 6px; }
}

/* Инструменты 0.18.73: наценка, безубыточность, таблички, график смен, Wi-Fi. */
.tool-subtitle {
    font-size: 1.1rem;
    margin: 4px 0 14px;
}

.tool-subtitle:not(:first-child) {
    margin-top: 8px;
}

.tool-output {
    display: flex;
    align-items: center;
    min-height: 50px;
    font-size: 1.05rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.cost-figures-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

[data-markup-reverse] {
    margin-bottom: 36px;
}

.tool-month {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin: 8px 0 4px;
}

.tool-month .field {
    margin: 0;
    min-width: 200px;
}

/* Табличка на стол: на экране — одна карточка для примера, на печати — листы A4. */
.table-card-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.table-card-print {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3mm;
    background: #fff;
    color: #17352d;
    border: 1px dashed #9aa092;
    text-align: center;
    overflow: hidden;
    font-family: var(--font);
}

.table-card-a6 {
    width: 99mm;
    height: 142mm;
    padding: 8mm 7mm;
}

.table-card-sticker {
    width: 80mm;
    height: 80mm;
    padding: 4mm;
    gap: 1.5mm;
}

.table-card-print p {
    margin: 0;
}

.table-card-name {
    font-size: 17pt;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.table-card-sticker .table-card-name {
    font-size: 10pt;
}

.table-card-qr {
    width: 70mm;
    height: 70mm;
}

.table-card-sticker .table-card-qr {
    width: 52mm;
    height: 52mm;
}

.table-card-caption {
    font-size: 12pt;
    line-height: 1.3;
}

.table-card-sticker .table-card-caption {
    font-size: 8pt;
}

.table-card-number {
    font-size: 15pt;
    font-weight: 700;
}

.table-card-sticker .table-card-number {
    font-size: 9pt;
}

.table-card-preview .table-card-a6 {
    max-width: 100%;
}

.table-card-sheets {
    display: none;
}

/* График смен: таблица месяца прокручивается внутри себя, на печати — альбомный A4. */
.shift-sheet {
    padding: 24px 24px 18px;
    margin: 12px 0 36px;
}

.shift-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.shift-head h2 {
    margin: 0;
    font-size: 1.35rem;
}

.shift-head label {
    min-width: min(100%, 320px);
}

.shift-head label span {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: var(--muted);
}

.shift-sheet input {
    width: 100%;
    min-width: 0;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 4px 2px;
    font: inherit;
    font-size: .85rem;
    color: var(--ink);
}

.shift-head input {
    border-bottom: 1px solid #b5bcae;
    font-size: 1rem;
}

.shift-table-wrap {
    position: relative;
    overflow-x: auto;
}

.shift-table {
    border-collapse: collapse;
    min-width: 1100px;
    width: 100%;
    font-size: .8rem;
}

.shift-table th,
.shift-table td {
    border: 1px solid var(--line);
    padding: 0;
    text-align: center;
}

.shift-table th {
    font-weight: 600;
    padding: 4px 1px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.shift-table th small {
    display: block;
    font-weight: 400;
    font-size: .65rem;
}

.shift-table td input {
    text-align: center;
    text-transform: uppercase;
}

.shift-table .shift-name {
    min-width: 150px;
    text-align: left;
}

.shift-table .shift-role {
    min-width: 90px;
    text-align: left;
}

.shift-table .shift-name input,
.shift-table .shift-role input {
    text-align: left;
    text-transform: none;
    padding-left: 6px;
}

.shift-weekend {
    background: #ece7da;
}

.shift-count,
.shift-hours {
    min-width: 42px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.shift-remove {
    min-width: 30px;
    min-height: 30px;
    padding: 0;
    text-decoration: none;
}

.shift-legend {
    font-size: .8rem;
    color: var(--muted);
    margin: 12px 0 0;
}

.shift-legend-hours input {
    display: inline-block;
    width: 36px;
    border-bottom: 1px solid #b5bcae;
    text-align: center;
}

/* Wi-Fi: карточка для печати. */
.wifi-card {
    max-width: 320px;
    margin: 0 auto 14px;
    padding: 20px;
    background: #fff;
    border: 1px dashed #9aa092;
    border-radius: 12px;
    color: #17352d;
}

.wifi-card p {
    margin: 0;
}

.wifi-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px !important;
}

.wifi-card-qr svg {
    display: block;
    width: 100%;
    max-width: 240px;
    height: auto;
    margin: 0 auto 10px;
}

.wifi-card-qr .muted {
    padding: 60px 0;
}

.wifi-card-line {
    font-size: 1rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.wifi-card-hint {
    font-size: .8rem;
    color: #666d62;
    margin-top: 8px !important;
}

@media (max-width: 900px) {
    .cost-figures-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@page shifts {
    size: A4 landscape;
    margin: 8mm;
}

@page cards {
    size: A4;
    margin: 6mm;
}

@media print {
    .tool-result:not(.wifi-result),
    .tool-form,
    .article-related {
        display: none !important;
    }

    .table-card-sheets {
        display: block;
    }

    .table-card-sheet {
        page: cards;
        display: grid;
        justify-content: center;
        align-content: start;
        break-after: page;
    }

    .table-card-sheet:last-child {
        break-after: auto;
    }

    .table-card-sheet-a6 {
        grid-template-columns: repeat(2, 99mm);
    }

    .table-card-sheet-sticker {
        grid-template-columns: repeat(2, 80mm);
        gap: 4mm;
    }

    .table-card-print {
        break-inside: avoid;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .shift-sheet {
        page: shifts;
        border: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
    }

    .shift-table {
        min-width: 0;
        font-size: 7.5pt;
    }

    .shift-table .shift-name { min-width: 32mm; }
    .shift-table .shift-role { min-width: 18mm; }
    .shift-sheet input { font-size: 8pt; padding: 1.5mm 0.5mm; }
    .shift-table-wrap { overflow: visible; }
    .shift-sheet input:focus, .techcard input:focus, .techcard textarea:focus { outline: none; box-shadow: none; }

    .shift-weekend {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .wifi-result {
        border: 0 !important;
        background: #fff !important;
        padding: 0 !important;
    }

    .wifi-card {
        max-width: 90mm;
        margin: 10mm auto;
    }

    .wifi-grid {
        display: block;
    }
}

@media (max-width: 560px) {
    /* Пример таблички на экране телефона — уменьшенная копия; на печать идёт полный размер. */
    .table-card-preview {
        zoom: .78;
    }
}
