:root {
    --bg:#f6f6f6;
    --card:#fff;
    --txt:#111;
    --muted:#555;
    --line:#e6e6e6;
    --err:#b00020;
}
* {
    box-sizing: border-box;
}
body {
    margin:0;
    font-family: Arial, sans-serif;
    color:var(--txt);
    background:var(--bg);
}
.top {
    padding:24px 18px;
    background:#111;
    color:#fff;
}
.top h1 {
    margin:0 0 6px 0;
    font-size:20px;
}
.sub {
    margin:0;
    color:rgba(255,255,255,.8);
    font-size:13px;
    line-height:1.35;
}

.wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 18px;
}
.card {
    background:var(--card);
    border:1px solid var(--line);
    border-radius:10px;
    padding:16px;
    margin:14px 0;
}
.card h2 {
    margin:0 0 12px 0;
    font-size:16px;
}
.card h3 {
    margin:0 0 10px 0;
    font-size:14px;
}

label {
    display:block;
    margin: 10px 0;
    font-size: 13px;
    color: var(--muted);
}
input, select, textarea {
    width:100%;
    padding: 9px 10px;
    margin-top:6px;
    border:1px solid var(--line);
    border-radius:8px;
    background:#fff;
    color:var(--txt);
}
input[type="checkbox"] {
    width: 5%;
}
textarea {
    resize: vertical;
}

.grid2 {
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.grid3 {
    display:grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
@media (max-width: 820px) {
    .grid2, .grid3 {
        grid-template-columns: 1fr;
    }
}

.checks {
    display:grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 8px 14px;
    margin-top:10px;
}
@media (max-width: 820px) {
    .checks {
        grid-template-columns: 1fr;
    }
}

.row {
    display:flex;
    gap:10px;
    align-items:center;
    margin: 6px 0;
    color:var(--txt);
}
.row input {
    width:auto;
    margin:0;
}

hr {
    border:0;
    border-top:1px solid var(--line);
    margin: 14px 0;
}

.hintbox {
    border:1px dashed #bbb;
    border-radius:10px;
    padding:12px;
    margin-top:10px;
    background:#fafafa;
}

.actions {
    display:flex;
    gap:10px;
    align-items:center;
    margin-top: 12px;
    flex-wrap: wrap;
}
button, .btn {
    border:0;
    border-radius:10px;
    padding:12px 16px;
    cursor:pointer;
    background:#111;
    color:#fff;
    font-weight:700;
    text-decoration:none;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}
.btn.ghost {
    background:#fff;
    color:#111;
    border:1px solid var(--line);
}
button:hover {
    opacity:.92;
}
.btn.ghost:hover {
    background:#f2f2f2;
}

.errors {
    border:1px solid #f3c;
    background:#fff3f6;
    color:var(--err);
    padding:10px;
    border-radius:10px;
}
.hidden {
    display:none !important;
}

.foot {
    padding: 16px 18px;
    color:#666;
    text-align:center;
}

.small {
    font-size: 12px;
}
.muted {
    color: #666;
}

/* ===== TOOLTIP (hover + focus) ===== */
.tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: #0a4dbf;
    color: #fff;
    font-size: 12px;
    line-height: 18px;
    cursor: help;
    position: relative;
    user-select: none;
}
.tooltip:focus {
    outline: 2px solid #7fb0ff;
    outline-offset: 2px;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 140%;
    left: 50%;
    transform: translateX(-50%);
    width: min(360px, 80vw);
    background: #111;
    color: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.45;
    z-index: 1000;
    transition: opacity 0.18s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.tooltip:hover .tooltip-text,
.tooltip:focus .tooltip-text {
    visibility: visible;
    opacity: 1;
}
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 7px;
    border-style: solid;
    border-color: #111 transparent transparent transparent;
}

/* ===== SPECIAL DATA ROWS ===== */
.special-row {
    border: 1px dashed #cfcfcf;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    margin: 10px 0;
}
.special-row .rowhead {
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.special-row .rowhead .title {
    font-weight: 700;
    color: #111;
    font-size: 13px;
}
.special-row .mini {
    padding: 8px 10px;
    border-radius: 10px;
}
