/* MobileProTool (MPT)
   Developed by alephgsm.com
   Copyright (c) 2026 MobileProTool. All rights reserved.

   Foundation: fonts, tokens, reset, typography, and shared primitives.
   Loaded before panel.css or public.css. Nothing else defines design tokens. */

@font-face {
    font-family: "Manrope";
    src: url("../fonts/manrope-variable.ttf") format("truetype");
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
}

@font-face {
    font-family: "Geist Mono";
    src: url("../fonts/geist-mono-variable.ttf") format("truetype");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --font-sans: "Manrope", "Segoe UI", sans-serif;
    --font-mono: "Geist Mono", "Cascadia Code", Consolas, monospace;

    --bg: #f6f7f7;
    --surface: #ffffff;
    --surface-subtle: #f9fbfa;
    --surface-muted: #f1f4f2;
    --text: #101a16;
    --text-soft: #56635c;
    --text-muted: #7e8883;
    --border: #e3e7e5;
    --border-strong: #d3dad6;

    --primary: #0f7a4d;
    --primary-hover: #0b6440;
    --primary-soft: #e9f4ee;
    --primary-line: #cfe6da;
    --primary-contrast: #ffffff;
    --info: #2564c6;
    --info-soft: #eaf1fd;
    --warning: #96610a;
    --warning-soft: #fdf3dd;
    --warning-line: #f0dcae;
    --danger: #c1394a;
    --danger-soft: #fdecef;
    --danger-line: #f2ccd3;
    --success: #0f7a4d;
    --success-soft: #e9f4ee;

    --shadow-xs: 0 1px 2px rgb(16 26 22 / .04);
    --shadow-sm: 0 6px 18px rgb(16 26 22 / .06);
    --shadow-md: 0 16px 40px rgb(16 26 22 / .1);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --control-h: 34px;
    --control-h-sm: 30px;
    --content: 1240px;
    --ease: cubic-bezier(.2, .8, .2, 1);

    color-scheme: light;
}

html[data-theme="dark"] {
    --bg: #0d1210;
    --surface: #131a17;
    --surface-subtle: #101613;
    --surface-muted: #1b2420;
    --text: #edf4f0;
    --text-soft: #a9b7b0;
    --text-muted: #74827b;
    --border: #27332e;
    --border-strong: #384740;

    --primary: #64d99a;
    --primary-hover: #83e8af;
    --primary-soft: #173426;
    --primary-line: #22503a;
    --primary-contrast: #092015;
    --info: #79aef5;
    --info-soft: #192d48;
    --warning: #efc068;
    --warning-soft: #3a2d16;
    --warning-line: #4d3d1d;
    --danger: #ff8b95;
    --danger-soft: #3f2024;
    --danger-line: #55292e;
    --success: #64d99a;
    --success-soft: #173426;

    --shadow-xs: 0 1px 2px rgb(0 0 0 / .18);
    --shadow-sm: 0 8px 22px rgb(0 0 0 / .2);
    --shadow-md: 0 22px 54px rgb(0 0 0 / .28);

    color-scheme: dark;
}

/* -------------------------------------------------- reset */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    font-optical-sizing: auto;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: var(--font-sans);
    font-size: inherit;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text);
    letter-spacing: -.025em;
    text-wrap: balance;
}

p {
    color: var(--text-soft);
}

code,
pre,
.mono {
    color: var(--text-soft);
    font-family: var(--font-mono);
}

[x-cloak] {
    display: none !important;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

::selection {
    color: var(--primary-contrast);
    background: var(--primary);
}

.sr-only,
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* -------------------------------------------------- brand */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.03em;
}

.brand > span:last-child > span {
    color: var(--primary);
}

.brand-mark {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: var(--primary-soft);
    padding: 4px;
}

.brand-mark span {
    display: block;
    border-radius: 1px;
    background: var(--primary);
}

.brand-mark span:first-child,
.brand-mark span:last-child {
    opacity: .45;
}

/* -------------------------------------------------- icons */

.ui-icon {
    width: 1.15em;
    height: 1.15em;
    flex: 0 0 auto;
    display: inline-block;
    overflow: visible;
    stroke-width: 1.7;
}

/* -------------------------------------------------- buttons */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: var(--control-h);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    background: var(--primary);
    padding: 0 15px;
    color: var(--primary-contrast);
    font: 700 12px/1 var(--font-sans);
    letter-spacing: -.005em;
    white-space: nowrap;
    transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}

.button:hover {
    border-color: var(--primary-hover);
    background: var(--primary-hover);
    color: var(--primary-contrast);
}

.button .ui-icon {
    width: 15px;
    height: 15px;
}

.button-small {
    min-height: var(--control-h-sm);
    padding: 0 11px;
    font-size: 11px;
}

.button-full {
    width: 100%;
}

.button-ghost {
    border-color: var(--border-strong);
    background: var(--surface);
    color: var(--text);
}

.button-ghost:hover {
    border-color: var(--primary-line);
    background: var(--primary-soft);
    color: var(--primary);
}

.button-danger {
    border-color: var(--danger);
    background: var(--danger);
    color: #ffffff;
}

.button-danger:hover {
    border-color: var(--danger);
    background: color-mix(in srgb, var(--danger) 85%, #000);
    color: #ffffff;
}

.button:disabled {
    opacity: .5;
    pointer-events: none;
}

.text-link {
    display: inline-flex;
    align-items: center;
    min-height: var(--control-h);
    border-radius: var(--radius-sm);
    padding: 0 10px;
    color: var(--text-soft);
    font: 700 12px var(--font-sans);
}

.text-link:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

/* -------------------------------------------------- form controls */

input,
select,
textarea {
    width: 100%;
    min-height: var(--control-h);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 7px 10px;
    color: var(--text);
    font-size: 13px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

textarea {
    min-height: 96px;
    line-height: 1.55;
    resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    min-height: 0;
    accent-color: var(--primary);
}

input[type="file"] {
    padding: 6px 10px;
    color: var(--text-soft);
    font-size: 12px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

label {
    color: var(--text-soft);
    font: 700 11px var(--font-sans);
}

label small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-weight: 600;
}

/* -------------------------------------------------- status, badges, messages */

.eyebrow {
    color: var(--primary);
    font: 700 11px/1.4 var(--font-sans);
    letter-spacing: .01em;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    border: 1px solid var(--primary-line);
    border-radius: var(--radius-sm);
    background: var(--success-soft);
    padding: 3px 8px;
    color: var(--success);
    font: 700 10px/1.4 var(--font-sans);
}

.status-badge.warning,
.status-badge.pending {
    border-color: var(--warning-line);
    background: var(--warning-soft);
    color: var(--warning);
}

.status-badge.danger,
.status-badge.failed {
    border-color: var(--danger-line);
    background: var(--danger-soft);
    color: var(--danger);
}

.status-badge.neutral {
    border-color: var(--border-strong);
    background: var(--surface-muted);
    color: var(--text-soft);
}

.flash-message,
.form-success,
.form-errors {
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-size: 13px;
}

.flash-message,
.form-success {
    border: 1px solid var(--primary-line);
    background: var(--success-soft);
    color: var(--success);
}

.form-errors {
    border: 1px solid var(--danger-line);
    background: var(--danger-soft);
    color: var(--danger);
}

.form-errors ul {
    margin: 0;
    padding-left: 18px;
}

.empty-state {
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface-subtle);
    padding: 52px 24px;
    color: var(--text-soft);
    text-align: center;
}

.empty-state > span {
    color: var(--primary);
    font: 700 11px var(--font-sans);
}

.empty-state h2 {
    margin: 9px 0 5px;
    font-size: 19px;
}

.empty-state p {
    margin: 0 auto;
    max-width: 460px;
    font-size: 13px;
}

.empty-state .button {
    margin-top: 16px;
}

/* -------------------------------------------------- pagination */

.pagination-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin: 22px 0 4px;
}

.pagination-wrap nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pagination-wrap a,
.pagination-wrap span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
}

.pagination-wrap a:hover {
    border-color: var(--primary-line);
    background: var(--primary-soft);
    color: var(--primary);
}

.pagination-wrap a.active {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--primary-contrast);
}

.pagination-wrap .pagination-ellipsis {
    min-width: 20px;
    border-color: transparent;
    background: transparent;
}

.pagination-wrap .disabled {
    background: var(--surface-subtle);
    color: var(--text-muted);
    opacity: .6;
}

/* -------------------------------------------------- theme toggle */

.theme-toggle {
    display: grid;
    place-items: center;
    width: var(--control-h);
    height: var(--control-h);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-soft);
    transition: color .16s ease, border-color .16s ease, background .16s ease;
}

.theme-toggle:hover {
    border-color: var(--primary-line);
    background: var(--primary-soft);
    color: var(--primary);
}

.theme-toggle > span {
    display: grid;
    grid-area: 1 / 1;
    place-items: center;
}

.theme-toggle .ui-icon {
    width: 16px;
    height: 16px;
}

html[data-theme="light"] .theme-icon-light,
html[data-theme="dark"] .theme-icon-dark {
    display: none;
}

/* -------------------------------------------------- rich text output */

.rich-text {
    color: var(--text-soft);
    font-size: 13.5px;
    line-height: 1.7;
}

.rich-text > :first-child {
    margin-top: 0;
}

.rich-text > :last-child {
    margin-bottom: 0;
}

.rich-text p,
.rich-text ul,
.rich-text ol,
.rich-text blockquote {
    margin: 0 0 10px;
}

.rich-text h2,
.rich-text h3 {
    margin: 16px 0 8px;
    color: var(--text);
}

.rich-text h2 {
    font-size: 17px;
}

.rich-text h3 {
    font-size: 15px;
}

.rich-text ul,
.rich-text ol {
    padding-left: 1.2em;
}

.rich-text a {
    color: var(--primary);
    text-decoration: underline;
}

.rich-text blockquote {
    border-left: 3px solid var(--primary-line);
    padding-left: 12px;
}

.cf-turnstile {
    min-height: 65px;
    margin: 14px 0;
}

.maker-credit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 650;
}

.maker-credit:hover {
    color: var(--primary);
}

.maker-heart {
    color: var(--danger);
    font-size: 13px;
    line-height: 1;
    transform: translateY(1px);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
