:root {
    --bg: #0f1110;
    --panel: rgba(18, 20, 19, 0.95);
    --card: #171a19;
    --card-soft: #1d2120;
    --text: #eef4ef;
    --muted: #a8b5ab;
    --primary: #38f07a;
    --primary-soft: #1ddf67;
    --danger: #ff7f8b;
    --border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at 12% 8%, #1b221e 0%, transparent 34%),
        radial-gradient(circle at 88% 0%, #18231d 0%, transparent 36%),
        var(--bg);
    color: var(--text);
    font-family: "Inter", "Segoe UI", sans-serif;
    min-height: 100vh;
}

.page {
    max-width: 1040px;
    margin: 0 auto;
    padding: 24px 14px 40px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

h1, h2, h3 {
    margin: 0;
}

h1 {
    font-size: 1.35rem;
}

.muted {
    color: var(--muted);
    font-size: 0.9rem;
}

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-link {
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #161a18;
    color: var(--text);
    padding: 7px 11px;
    font-size: 0.88rem;
}

.tab-link.active {
    border-color: var(--primary);
    color: var(--primary);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}

.home-card {
    text-decoration: none;
    color: inherit;
    display: block;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.home-card:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 240, 122, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 30px rgba(0, 0, 0, 0.32);
}

.home-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.home-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0d2314;
    background: linear-gradient(140deg, var(--primary), var(--primary-soft));
    box-shadow: 0 0 0 1px rgba(56, 240, 122, 0.25), 0 4px 14px rgba(56, 240, 122, 0.28);
}

.home-icon-wrap svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.home-chevron {
    color: var(--muted);
}

.home-chevron svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pill {
    display: inline-block;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.75rem;
    color: var(--muted);
}

.pill.on {
    border-color: rgba(56, 240, 122, 0.4);
    color: var(--primary);
}

.actions {
    margin-top: 10px;
}

.btn {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    color: var(--text);
    background: #171c1a;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn:hover {
    border-color: var(--primary);
}

.btn.active {
    border-color: var(--primary);
    color: var(--primary);
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-soft));
    color: #0b2412;
    border: none;
    font-weight: 600;
}

.btn.danger {
    color: var(--danger);
    border-color: rgba(255, 127, 139, 0.35);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 10px;
}

.input, .textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #121514;
    color: var(--text);
    padding: 10px;
}

.textarea {
    min-height: 120px;
    resize: vertical;
    margin-top: 10px;
}

.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.search {
    flex: 1;
    min-width: 240px;
}

.list {
    display: grid;
    gap: 10px;
}

.answer-row {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-soft);
    padding: 12px;
    animation: fadeIn 0.2s ease;
}

.answer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.answer-top strong {
    color: var(--primary);
}

.answer-text {
    white-space: pre-wrap;
    color: #dde5de;
    margin-bottom: 8px;
}

.row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.empty {
    color: var(--muted);
    padding: 16px 4px;
}

.load-wrap {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

.loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.hidden {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

@media (max-width: 760px) {
    .grid-2,
    .form-grid {
        grid-template-columns: 1fr;
    }
}
