/*
 * Trader-tool mesh (best lists, head-to-head, by-platform).
 *
 * Namespaced .tm-* so it cannot collide with the prop-firm styles. Loaded alongside
 * tools.css rather than replacing it - the tools vertical is an expansion and must not
 * put the working prop-firm pages at risk.
 */

.tm-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 20px 72px;
}

/* ---------------------------------------------------------------- breadcrumbs */
.tm-crumbs {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 18px;
}
.tm-crumbs a { color: #4f46e5; text-decoration: none; }
.tm-crumbs a:hover { text-decoration: underline; }

/* ----------------------------------------------------------------------- hero */
.tm-hero {
    background: #fff;
    border: 1px solid #e8eaf3;
    border-radius: 18px;
    padding: 34px 32px;
    margin-bottom: 26px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.tm-hero__eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #4f46e5;
    background: #eef2ff;
    border-radius: 999px;
    padding: 5px 12px;
    margin-bottom: 12px;
}
.tm-hero h1 {
    font-size: clamp(26px, 3.4vw, 38px);
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: -.02em;
    color: #0f172a;
    margin: 0 0 10px;
}
.tm-hero p { color: #475569; font-size: 16px; line-height: 1.6; margin: 0; max-width: 74ch; }
.tm-hero--vs h1 em { color: #94a3b8; font-style: normal; margin: 0 10px; font-weight: 600; }

/* ---------------------------------------------------------------------- grids */
.tm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.tm-grid--two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.tm-grid--lists { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* ---------------------------------------------------------------- tool cards */
.tm-card {
    background: #fff;
    border: 1px solid #e8eaf3;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tm-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 8px 24px rgba(79, 70, 229, .10);
    transform: translateY(-2px);
}
.tm-card__main { display: flex; gap: 13px; text-decoration: none; color: inherit; align-items: flex-start; }
.tm-card__logo {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-weight: 800;
    font-size: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.tm-card__logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.tm-card__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tm-card__name { font-weight: 700; color: #0f172a; font-size: 16px; }
.tm-card__cat { font-size: 12px; font-weight: 600; color: #6366f1; text-transform: uppercase; letter-spacing: .04em; }
.tm-card__desc { font-size: 13.5px; color: #64748b; line-height: 1.5; margin-top: 3px; }
.tm-card__meta { display: flex; flex-wrap: wrap; gap: 6px; }

/* --------------------------------------------------------------------- badges */
.tm-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px 9px;
}
.tm-badge--free { background: #ecfdf5; color: #047857; }
.tm-badge--star { background: #fffbeb; color: #b45309; }
.tm-badge--own  { background: #eef2ff; color: #4338ca; margin-left: 7px; font-size: 11px; }

/* ----------------------------------------------------------------- list cards */
.tm-listcard {
    background: #fff;
    border: 1px solid #e8eaf3;
    border-radius: 14px;
    padding: 20px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tm-listcard:hover { border-color: #c7d2fe; box-shadow: 0 8px 24px rgba(79, 70, 229, .10); transform: translateY(-2px); }
.tm-listcard h2 { font-size: 17px; font-weight: 700; color: #0f172a; margin: 0; }
.tm-listcard p { font-size: 13.5px; color: #64748b; margin: 0; line-height: 1.5; }
.tm-listcard__go { margin-top: 6px; font-size: 13px; font-weight: 700; color: #4f46e5; }

/* ------------------------------------------------------------------- sections */
.tm-section { margin-top: 38px; }
.tm-section > h2 {
    font-size: 21px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 15px;
    letter-spacing: -.01em;
}

/* --------------------------------------------------------------------- tables */
/* Wide comparison grids must scroll inside their own box, never the page body. */
.tm-tablewrap {
    overflow-x: auto;
    background: #fff;
    border: 1px solid #e8eaf3;
    border-radius: 14px;
}
.tm-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
.tm-table th, .tm-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.tm-table thead th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .045em;
    color: #64748b;
    background: #f8fafc;
    font-weight: 700;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}
.tm-table tbody th[scope="row"] { font-weight: 700; color: #0f172a; white-space: nowrap; }
.tm-table tbody th[scope="row"] a { color: #4f46e5; text-decoration: none; }
.tm-table tbody th[scope="row"] a:hover { text-decoration: underline; }
.tm-table tbody tr:last-child th, .tm-table tbody tr:last-child td { border-bottom: 0; }
.tm-table tbody tr:hover { background: #fafbff; }
.tm-table--vs td { width: 38%; }
.tm-unit { font-weight: 500; color: #94a3b8; text-transform: none; letter-spacing: 0; }

/* ------------------------------------------------------------------ spec cells
   Yes / No / Not verified are deliberately three different colours. Rendering an
   unverified dimension the same as a confirmed "No" would misrepresent the vendor. */
.tm-cell { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.tm-cell--yes { color: #059669; }
.tm-cell--no { color: #b91c1c; }
.tm-cell--unknown {
    color: #94a3b8;
    font-weight: 500;
    font-style: italic;
    border-bottom: 1px dotted #cbd5e1;
    cursor: help;
}
.tm-cell--missing { color: #cbd5e1; }
.tm-cell--val { color: #0f172a; }

.tm-chips { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.tm-chip {
    font-size: 11.5px;
    font-weight: 600;
    color: #4338ca;
    background: #eef2ff;
    border-radius: 6px;
    padding: 3px 7px;
    white-space: nowrap;
}
.tm-chip--more { background: #f1f5f9; color: #64748b; }

.tm-src {
    display: inline-block;
    margin-left: 7px;
    font-size: 11px;
    font-weight: 600;
    color: #a5b4fc;
    text-decoration: none;
    vertical-align: middle;
}
.tm-src:hover { color: #4f46e5; text-decoration: underline; }

/* ------------------------------------------------------------------ vs listing */
.tm-vslist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 9px; }
.tm-vslist a {
    display: block;
    background: #fff;
    border: 1px solid #e8eaf3;
    border-radius: 11px;
    padding: 13px 15px;
    text-decoration: none;
    color: #0f172a;
    font-weight: 600;
    font-size: 14.5px;
    transition: border-color .15s ease, background .15s ease;
}
.tm-vslist a:hover { border-color: #c7d2fe; background: #fafbff; }
.tm-vslist em { color: #94a3b8; font-style: normal; font-weight: 500; margin: 0 5px; }

/* --------------------------------------------------------------- notes / empty */
.tm-note { font-size: 12.5px; color: #94a3b8; margin-top: 11px; line-height: 1.55; }
.tm-empty {
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 34px;
    text-align: center;
    color: #64748b;
}

@media (max-width: 640px) {
    .tm-hero { padding: 24px 20px; }
    .tm-wrap { padding: 18px 14px 56px; }
}

/* -------------------------------------------------------------- mesh nav band
   Sits on /tools and routes people into the derived surfaces. Hidden entirely when
   the mesh is empty, so a fresh install never links into nothing. */
.tm-meshnav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin: 0 0 22px;
}
.tm-meshnav__item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: #fff;
    border: 1px solid #e8eaf3;
    border-left: 3px solid #6366f1;
    border-radius: 12px;
    padding: 15px 17px;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tm-meshnav__item:hover {
    border-color: #c7d2fe;
    border-left-color: #4f46e5;
    box-shadow: 0 8px 22px rgba(79, 70, 229, .10);
    transform: translateY(-2px);
}
.tm-meshnav__k { font-size: 15px; font-weight: 700; color: #0f172a; }
.tm-meshnav__v { font-size: 12px; font-weight: 700; color: #4f46e5; text-transform: uppercase; letter-spacing: .04em; }
.tm-meshnav__d { font-size: 13px; color: #64748b; line-height: 1.5; margin-top: 2px; }

/* ------------------------------------------------------------------- rankings */
.tm-rankhead { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.tm-rankhead h2 { margin: 0; font-size: 21px; font-weight: 800; color: #0f172a; }
.tm-rankhead__all { font-size: 13.5px; font-weight: 700; color: #4f46e5; text-decoration: none; white-space: nowrap; }
.tm-rankhead__all:hover { text-decoration: underline; }

.tm-podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tm-podium__item {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
    background: #fff; border: 1px solid #e8eaf3; border-radius: 14px; padding: 22px 16px 18px;
    text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tm-podium__item:hover { border-color: #c7d2fe; box-shadow: 0 8px 24px rgba(79,70,229,.10); transform: translateY(-2px); }
.tm-podium__item--1 { border-color: #fcd34d; background: linear-gradient(180deg, #fffbeb 0%, #fff 60%); }
.tm-podium__rank {
    position: absolute; top: 10px; left: 12px; font-size: 12px; font-weight: 800;
    color: #94a3b8; background: #f1f5f9; border-radius: 999px; width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
}
.tm-podium__item--1 .tm-podium__rank { background: #fcd34d; color: #78350f; }
.tm-podium__logo {
    width: 52px; height: 52px; border-radius: 13px; overflow: hidden;
    background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
    font-weight: 800; font-size: 22px; display: flex; align-items: center; justify-content: center;
}
.tm-podium__logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.tm-podium__name { font-weight: 700; color: #0f172a; text-align: center; font-size: 15px; }
.tm-podium__score { font-size: 12px; font-weight: 800; color: #4f46e5; background: #eef2ff; border-radius: 999px; padding: 3px 10px; }

.tm-statrow { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 16px; font-size: 14px; color: #475569; }
.tm-statrow strong { color: #0f172a; font-size: 17px; }

.tm-table--rank tbody td { vertical-align: middle; }
.tm-rank { font-weight: 800; color: #94a3b8; font-size: 15px; }
.tm-rank__tool { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.tm-rank__desc { display: block; font-size: 12.5px; color: #64748b; margin-top: 2px; font-weight: 400; }
.tm-card__logo--sm { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 9px; font-size: 15px; }
.tm-scorepill { display: inline-block; font-weight: 800; font-size: 13px; color: #4338ca; background: #eef2ff; border-radius: 999px; padding: 4px 11px; }
.tm-visit {
    display: inline-block; font-size: 13px; font-weight: 700; color: #fff;
    background: #4f46e5; border-radius: 9px; padding: 7px 14px; text-decoration: none; white-space: nowrap;
}
.tm-visit:hover { background: #4338ca; color: #fff; }
