/* Shared ACC-MARKET-style controls for /tools pages. */

.page .fa-icon {
    fill: currentColor;
    stroke: none;
}

.page .spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 999px;
    animation: tools-spin 760ms linear infinite;
}

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

.page .status-text {
    color: var(--muted-foreground);
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
}

.page .status-text.error {
    color: var(--destructive);
}

.page .progress-percent {
    color: var(--foreground);
    font-size: 13px;
    font-weight: 700;
    line-height: 20px;
}

.page .progress-track {
    height: 8px;
    overflow: hidden;
    background: #e5e7eb;
    border-radius: 999px;
}

.page .progress-bar {
    width: 0%;
    height: 100%;
    background: var(--primary);
    border-radius: inherit;
    transition: width 700ms ease-out;
}

.page .copy-input,
.page .panel-action,
.page .tool-button,
.page .copy-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    border: 1px solid var(--input);
    background: var(--background);
    color: var(--muted-foreground);
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.page .copy-input:hover,
.page .panel-action:hover,
.page .panel-action[aria-expanded="true"],
.page .tool-button:hover,
.page .copy-small:hover {
    background: var(--muted);
    color: var(--foreground);
}

.page .copy-input:disabled,
.page .panel-action:disabled,
.page .tool-button:disabled,
.page .copy-small:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.page .copy-input,
.page .panel-action {
    font-size: 0.75rem;
    line-height: 1rem;
}

.page .copy-input {
    height: 1.75rem;
    min-height: 1.75rem;
    gap: 0.375rem;
    padding: 0 0.625rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

.page .panel-action {
    min-height: 26px;
    gap: 4px;
    padding: 4px 8px;
    color: var(--muted-foreground);
    background: #f3f4f6;
    border-color: var(--border);
    border-radius: 4px;
    font-weight: 400;
}

.page .panel-action:hover,
.page .panel-action[aria-expanded="true"] {
    color: #374151;
    background: #e5e7eb;
}

.page .segment {
    display: inline-flex;
    min-width: 0;
    height: 2rem;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0 0.625rem;
    border-radius: 0.375rem;
    color: var(--muted-foreground);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1rem;
    transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.page .segment:hover {
    color: var(--foreground);
}

.page .segment.is-active {
    background: #ffffff;
    color: var(--foreground);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.page .actions {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.page .actions [aria-label="Output options"] {
    min-width: 0;
}

.page .empty-result,
.page .tool-empty {
    display: grid;
    min-height: 84px;
    place-items: center;
    color: #94a3b8;
    font-size: 13px;
    line-height: 20px;
}

.page .bm-list,
.page .uid-list,
.page .tool-result-list {
    display: grid;
    gap: 8px;
}

.page .bm-list.is-compact,
.page .uid-list.is-compact {
    display: block;
    padding: 8px;
    color: #111827;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
    line-height: 16px;
    word-break: break-all;
    white-space: pre-line;
}

.page .bm-item,
.page .uid-item,
.page .tool-result-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px;
    color: #111827;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 4px;
    line-height: 24px;
}

.page .bm-value,
.page .uid-value {
    min-width: 0;
    flex: 1 1 auto;
    padding: 0;
    color: #111827;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 12px;
    line-height: 16px;
    text-align: left;
    word-break: break-all;
}

.page .bm-value:hover,
.page .uid-value:hover {
    font-weight: 650;
}

.page .bm-meta,
.page .uid-meta {
    display: block;
    margin-top: 2px;
    color: #6b7280;
    font-size: 11px;
    line-height: 14px;
}

.page .copy-hint {
    position: absolute;
    inset: -1px;
    z-index: 5;
    display: flex;
    align-items: center;
    padding-left: 10px;
    color: var(--primary);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: inherit;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
}

.page .copy-hint.show {
    opacity: 1;
}

.page .toast-stack,
.toast-stack,
.tool-toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 80;
    display: grid;
    width: min(360px, calc(100vw - 36px));
    gap: 10px;
    pointer-events: none;
}

.page .toast,
.toast-stack .toast,
.toast-stack .tool-toast,
.tool-toast-stack .toast,
.tool-toast-stack .tool-toast {
    padding: 12px 14px;
    color: var(--foreground);
    background: #ffffff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius, 8px);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
    pointer-events: auto;
}

.page .toast.error,
.toast-stack .toast.error,
.toast-stack .tool-toast.error,
.tool-toast-stack .toast.error,
.tool-toast-stack .tool-toast.error {
    border-left-color: var(--destructive);
}

.page .toast.success,
.toast-stack .toast.success,
.toast-stack .tool-toast.success,
.tool-toast-stack .toast.success,
.tool-toast-stack .tool-toast.success {
    border-left-color: var(--primary);
}

.page .tab-panel {
    display: none;
    padding: 20px;
}

.page .tab-panel.is-active {
    display: block;
}

.page .faq-answer {
    display: none;
    padding: 0 14px 14px;
}

.page .faq-answer.is-open {
    display: block;
}

.page .menu-list {
    display: none;
}

.page .menu.is-open .menu-list {
    display: block;
}

.page .tool-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.page .range-input {
    accent-color: var(--primary);
}

@media (max-width: 860px) {
    .page .actions {
        align-items: stretch;
    }

    .page .toolbar {
        margin-left: 0;
        flex-wrap: wrap;
    }
}

@media (max-width: 560px) {
    .page .tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .page button[class~="bg-primary"]:not(#back-to-top),
    .page button[id*="reset"],
    .page button[id*="Reset"],
    .page button[id*="clear"],
    .page button[id*="Clear"] {
        display: inline-flex !important;
        width: 100%;
        height: 2.75rem !important;
        min-height: 2.75rem !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        line-height: 1.25rem !important;
        white-space: nowrap;
    }

    .page button[class~="bg-primary"]:not(#back-to-top) > svg,
    .page button[class~="bg-primary"]:not(#back-to-top) > i,
    .page button[id*="reset"] > svg,
    .page button[id*="Reset"] > svg,
    .page button[id*="clear"] > svg,
    .page button[id*="Clear"] > svg,
    .page button[id*="reset"] > i,
    .page button[id*="Reset"] > i,
    .page button[id*="clear"] > i,
    .page button[id*="Clear"] > i {
        width: 1rem !important;
        height: 1rem !important;
        flex: 0 0 1rem !important;
    }

    .page button[class~="bg-primary"]:not(#back-to-top) > span,
    .page button[id*="reset"] > span,
    .page button[id*="Reset"] > span,
    .page button[id*="clear"] > span,
    .page button[id*="Clear"] > span {
        display: inline-flex;
        min-height: 1.25rem;
        align-items: center;
        justify-content: center;
    }
}
