/* FormatLab - page-specific styles only
   Relies on site-wide variables from styles.css :root
   No resets, no global layout duplication
*/

/* Layout */
.site-main {
    --page-top: 1.25rem;
}

.tool-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 900px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

/* Head area */
.hero {
    background: radial-gradient(600px 300px at 10% -10%, rgba(14, 118, 188, .25), transparent 60%),
        radial-gradient(500px 260px at 90% -20%, rgba(247, 148, 30, .18), transparent 60%);
    border: 1px solid rgba(255, 255, 255, .06);
    background-color: rgba(255, 255, 255, .02);
    border-radius: 18px;
    padding: 1.25rem 1.4rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
}

.hero h1 {
    margin: .1rem 0 .4rem;
    font-size: 1.7rem;
}

.hero p {
    margin: 0;
    color: var(--muted);
}

/* Controls */
.row {
    display: flex;
    gap: .75rem;
    align-items: center;
    margin: .6rem 0;
    flex-wrap: wrap;
}

.row label {
    min-width: 120px;
    color: #d7e2ee;
    font-weight: 600;
}

.row .grow {
    flex: 1 1 240px;
}

/* Inputs */
.input,
.select {
    width: 100%;
    padding: .65rem .7rem;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    background: #0c101a;
    color: #e8ebf1;
    outline: none;
}

.input:focus,
.select:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 4px rgba(14, 118, 188, .15);
}

/* Editor */
.editor {
    display: grid;
    gap: .6rem;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .5rem;
}

.btn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, .16);
    background: #0f1320;
    color: #e8ebf1;
    border-radius: 10px;
    padding: .5rem .65rem;
    font-weight: 700;
    cursor: pointer;
}

.btn:hover {
    filter: brightness(1.06);
}

.btn.primary {
    background: var(--blue);
    color: #fff;
}

.btn.ghost {
    background: transparent;
}

.btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
}

/* Chips */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .6rem;
    border-radius: 999px;
    background: #0c101a;
    border: 1px solid rgba(255, 255, 255, .1);
    color: #e8ebf1;
    font-size: .9rem;
}

/* Textareas / preview */
textarea.input {
    min-height: 160px;
    resize: vertical;
}

.preview {
    background: #0c101a;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px;
    padding: .8rem;
    min-height: 160px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Minor UI */
.hint {
    color: var(--muted);
    font-size: .85rem;
    margin-top: .25rem;
}

.kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .85em;
    background: #0c101a;
    padding: .05rem .35rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, .12);
}

/* Footer actions */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 18px;
    right: 18px;
    z-index: 110;
    background: #0b0f19;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .12);
    padding: .6rem .75rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Ensure math/compat glyphs render in the editor & preview */
textarea.input,
.preview {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans",
        "Noto Sans Symbols 2", "Noto Sans Math", "Segoe UI Symbol",
        "DejaVu Sans", "Arial Unicode MS", sans-serif;
    line-height: 1.5;
}

.preview {
    text-decoration-skip-ink: none;
}

/* Warning chip style */
.chip.warn {
    background: #221112;
    border-color: rgba(255, 80, 80, .35);
    color: #ffb7b7;
    font-weight: 700;
}