/* Abhi Arya — Market Scanners. Light cream dashboard: white cards, navy text, orange accent. Layout adapts to the content width. */
.ams {
	--bg: #faf6ee; --card: #fff; --ink: #17233b; --mute: #667085; --line: #e9e2d4; --acc: #f47732; --acc-d: #d9631f; --acc-soft: #fff1e7;
	--up: #12924f; --down: #d6382c;
	--serif: "Fraunces", Georgia, "Times New Roman", serif; --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-family: var(--sans); color: var(--ink); font-size: 15px; line-height: 1.45;
	width: min(1320px, calc(100vw - 2rem)) !important; max-width: none !important; margin: 0; position: relative; left: 50%; transform: translateX(-50%);
	box-sizing: border-box; container-type: inline-size; container-name: ams;
}
.ams *, .ams *::before, .ams *::after { box-sizing: inherit; }
.ams [hidden] { display: none !important; }
.ams button, .ams select, .ams input { font: inherit; color: inherit; }
.ams .ams-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ams .ams-ic { width: 1.35em; height: 1.35em; flex: none; display: block; }

/* header */
.ams .ams-bc { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; font-size: .86rem; color: var(--mute); margin: 0 0 .5rem; }
.ams .ams-bc a { color: inherit; text-decoration: none; }
.ams .ams-bc a:hover { color: var(--acc-d); }
.ams .ams-bc [aria-current] { color: var(--ink); }
.ams .ams-h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(2rem, 4.6vw, 2.9rem); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 .4rem; color: var(--ink); }
.ams .ams-lead { margin: 0 0 1.1rem; color: var(--mute); max-width: 70ch; }

/* controls */
.ams .ams-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 0 0 .7rem; }
.ams .ams-f { display: flex; align-items: center; gap: .5rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0 .75rem; height: 2.6rem; position: relative; }
.ams .ams-f .ams-ic { width: 1.25rem; height: 1.25rem; }
.ams .ams-f select, .ams .ams-f input { border: 0; background: transparent; outline: 0; height: 100%; font-weight: 600; min-width: 0; }
.ams .ams-f select { padding-right: .3rem; cursor: pointer; }
.ams .ams-f:focus-within { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(244, 119, 50, .18); }
.ams .ams-fq { flex: 1 1 14rem; max-width: 24rem; }
.ams .ams-fq input { width: 100%; font-weight: 400; }
.ams .ams-upd { display: flex; align-items: center; gap: .5rem; margin-left: auto; color: var(--mute); font-size: .88rem; }
.ams .ams-upd .ams-ic { width: 1.2rem; height: 1.2rem; }
.ams .ams-upd b { color: var(--ink); font-weight: 600; }
.ams .ams-rf { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); cursor: pointer; padding: 0; }
.ams .ams-rf .ams-ic { width: 1.1rem; height: 1.1rem; }
.ams .ams-rf:hover { border-color: var(--acc); }
.ams .ams-rf.is-spin .ams-ic { animation: ams-spin .8s linear infinite; }
.ams .ams-bar2 { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; margin: 0 0 1rem; }
.ams .ams-utabs { display: flex; gap: .35rem; flex-wrap: wrap; background: #f3ecdf; border-radius: 12px; padding: .25rem; }
.ams .ams-ut { border: 0; background: transparent; border-radius: 9px; padding: .45rem 1rem; font-weight: 600; cursor: pointer; color: var(--mute); }
.ams .ams-ut:hover { color: var(--ink); }
.ams .ams-ut.is-on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(23, 35, 59, .12); }
.ams .ams-right { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.ams .ams-auto { display: flex; align-items: center; gap: .5rem; color: var(--mute); font-size: .9rem; }
.ams .ams-auto select { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.ams .ams-setw { position: relative; }
.ams .ams-set { display: inline-flex; align-items: center; gap: .5rem; background: var(--acc); color: #fff; border: 0; border-radius: 10px; height: 2.6rem; padding: 0 1.1rem; font-weight: 600; cursor: pointer; }
.ams .ams-set .ams-ic { width: 1.15rem; height: 1.15rem; filter: brightness(0) invert(1); }
.ams .ams-set:hover { background: var(--acc-d); }
.ams .ams-pop { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 20; min-width: 16rem; max-height: 22rem; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(23, 35, 59, .16); padding: .8rem .9rem; display: grid; gap: .45rem; }
.ams .ams-pop label { display: flex; gap: .5rem; align-items: center; font-size: .92rem; }
.ams .ams-reset { justify-self: start; background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: .3rem .7rem; cursor: pointer; margin-top: .2rem; }
.ams button:focus-visible, .ams select:focus-visible, .ams a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ams .ams-note { margin: 0 0 1rem; background: var(--acc-soft); border: 1px solid #f9d6bd; border-radius: 10px; padding: .6rem .9rem; font-size: .9rem; color: #7a3a10; }

/* grid and cards */
.ams .ams-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; align-items: start; }
.ams .ams-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(23, 35, 59, .04), 0 8px 24px rgba(23, 35, 59, .05); padding: 1rem 1rem .85rem; position: relative; min-width: 0; container-type: inline-size; container-name: amsc; }
.ams .ams-card.is-off { display: none; }
.ams .ams-ch { display: flex; gap: .7rem; align-items: flex-start; margin: 0 0 .7rem; }
.ams .ams-ci { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; border-radius: 12px; background: var(--acc-soft); flex: none; }
.ams .ams-ci .ams-ic { width: 1.7rem; height: 1.7rem; }
.ams .ams-ct { flex: 1; min-width: 0; }
.ams .ams-ct h2 { font-family: var(--serif); font-size: 1.08rem; font-weight: 700; line-height: 1.2; margin: 0; color: var(--ink); letter-spacing: -.005em; }
.ams .ams-ct p { margin: .1rem 0 0; font-size: .8rem; color: var(--mute); }
.ams .ams-cm { display: flex; align-items: center; gap: .35rem; flex: none; }
.ams .ams-tot { font-size: .8rem; color: var(--mute); white-space: nowrap; }
.ams .ams-tot b { color: var(--ink); font-weight: 700; }
.ams .ams-infow { position: relative; }
.ams .ams-info { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border: 0; background: transparent; border-radius: 999px; cursor: pointer; padding: 0; }
.ams .ams-info .ams-ic { width: 1.1rem; height: 1.1rem; }
.ams .ams-info:hover { background: var(--acc-soft); }
.ams .ams-tip { position: absolute; right: 0; top: calc(100% + .3rem); z-index: 15; width: 15rem; background: var(--ink); color: #fff; font-size: .8rem; line-height: 1.4; border-radius: 10px; padding: .6rem .7rem; box-shadow: 0 8px 22px rgba(23, 35, 59, .25); }
.ams .ams-ctabs { display: flex; gap: .35rem; margin: 0 0 .6rem; }
.ams .ams-ctab { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: .3rem .8rem; font-size: .84rem; font-weight: 600; cursor: pointer; color: var(--mute); }
.ams .ams-ctab span { color: var(--ink); margin-left: .2rem; }
.ams .ams-ctab.is-on { background: var(--acc); border-color: var(--acc); color: #fff; }
.ams .ams-ctab.is-on span { color: #fff; }

/* panels + tables */
.ams .ams-pn { position: relative; min-width: 0; transition: opacity .15s; }
.ams .ams-pn.is-off { display: none; }
.ams .ams-pn.is-loading { opacity: .45; pointer-events: none; }
.ams .ams-pn.is-loading::after { content: ""; position: absolute; left: 50%; top: 40%; width: 1.4rem; height: 1.4rem; margin: -.7rem 0 0 -.7rem; border: 2px solid var(--line); border-top-color: var(--acc); border-radius: 50%; animation: ams-spin .7s linear infinite; }
.ams .ams-body.is-dual { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.ams .ams-sub { font-size: .86rem; font-weight: 700; margin: 0 0 .4rem; }
.ams .ams-sub span { color: var(--mute); font-weight: 500; }
.ams .ams-sub.is-up { color: var(--up); }
.ams .ams-sub.is-dn { color: var(--down); }
.ams .ams-tw { overflow-x: auto; }
.ams .ams-t { width: 100%; border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; }
.ams .ams-t th { text-align: left; font-size: .72rem; font-weight: 600; color: var(--mute); padding: .35rem .3rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ams .ams-t td { padding: .42rem .3rem; border-bottom: 1px solid #f1ebdf; white-space: nowrap; }
.ams .ams-t tr:last-child td { border-bottom: 0; }
.ams .ams-t .n { text-align: right; }
.ams .ams-t th.n { text-align: right; }
.ams .ams-t .i { width: 1.6rem; color: var(--mute); }
.ams .ams-t .s { font-weight: 700; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }
.ams .ams-t .s span { overflow: hidden; text-overflow: ellipsis; }
.ams .ams-t .g { color: var(--up); font-weight: 600; }
.ams .ams-t .r { color: var(--down); font-weight: 600; }
.ams .chip { font-style: normal; font-size: .62rem; font-weight: 700; margin-left: .3rem; padding: .05rem .3rem; border-radius: 4px; background: #f3ecdf; color: var(--mute); vertical-align: middle; }
.ams .bw { display: inline-flex; align-items: center; gap: .4rem; justify-content: flex-end; }
.ams .bar { display: inline-block; width: 2.2rem; height: .32rem; border-radius: 99px; background: #efe8da; overflow: hidden; }
.ams .bar u { display: block; height: 100%; border-radius: 99px; background: var(--up); }
.ams .bar.r u { background: var(--down); }
.ams .bar.o u { background: var(--acc); }
.ams .ams-empty { text-align: center; padding: 1.6rem .8rem; color: var(--mute); }
.ams .ams-empty strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 1.05rem; }
.ams .ams-empty p { margin: .2rem 0 0; font-size: .86rem; }

/* pagination */
.ams .ams-pg { display: flex; justify-content: center; align-items: center; gap: .25rem; margin: .7rem 0 0; flex-wrap: wrap; }
.ams .ams-pb { min-width: 1.9rem; height: 1.9rem; padding: 0 .4rem; border: 1px solid transparent; background: transparent; border-radius: 8px; font-size: .84rem; font-weight: 600; cursor: pointer; display: inline-grid; place-items: center; color: var(--ink); }
.ams .ams-pb:hover:not(:disabled):not(.is-on) { background: var(--acc-soft); border-color: #f9d6bd; }
.ams .ams-pb.is-on { background: var(--acc); color: #fff; border-color: var(--acc); cursor: default; }
.ams .ams-pb:disabled { opacity: .35; cursor: not-allowed; }
.ams .ams-pi { width: .8rem; height: 1rem; }
.ams .ams-dots { color: var(--mute); padding: 0 .1rem; }
.ams .ams-err { margin: .6rem 0 0; background: #fdecea; border: 1px solid #f5c2bd; color: #8a1f17; border-radius: 10px; padding: .5rem .7rem; font-size: .84rem; display: flex; gap: .6rem; align-items: center; justify-content: space-between; }
.ams .ams-retry { border: 1px solid #e59a93; background: #fff; border-radius: 8px; padding: .2rem .6rem; cursor: pointer; font-weight: 600; }
.ams .ams-foot { margin: 1.2rem 0 0; font-size: .8rem; color: var(--mute); }

/* circuit: two tables side by side when the card is wide enough */
@container amsc (min-width: 340px) {
	.ams .ams-body.is-dual { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
	.ams .is-dual .ams-t { font-size: .74rem; }
	.ams .is-dual .ams-t th { font-size: .66rem; padding: .3rem .15rem; }
	.ams .is-dual .ams-t td { padding: .4rem .15rem; }
	.ams .is-dual .ams-t .i { display: none; }
	.ams .is-dual .ams-t .s { max-width: none; overflow: visible; }
	.ams .is-dual .ams-t .chip { margin-left: .15rem; font-size: .56rem; }
	.ams .is-dual .ams-tw { overflow: visible; }
	.ams .is-dual .ams-pg { gap: .05rem; flex-wrap: nowrap; }
	.ams .is-dual .ams-pb { min-width: 1.5rem; height: 1.65rem; padding: 0 .2rem; font-size: .78rem; }
}

/* responsive: 3 columns desktop, 2 tablet, 1 mobile */
@container ams (max-width: 1060px) { .ams .ams-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container ams (max-width: 700px) {
	.ams .ams-grid { grid-template-columns: minmax(0, 1fr); }
	.ams .ams-upd { margin-left: 0; width: 100%; }
	.ams .ams-fq { max-width: none; flex-basis: 100%; }
	.ams .ams-right { width: 100%; justify-content: space-between; }
	.ams .ams-utabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
	.ams .ams-ut { white-space: nowrap; }
}
@media (max-width: 700px) {
	.ams .ams-grid { grid-template-columns: minmax(0, 1fr); }
	.ams .ams-pop { right: auto; left: 0; }
}
@keyframes ams-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ams *, .ams *::before, .ams *::after { animation: none !important; transition: none !important; } }

/* narrow cards (phones): drop the # column and the mini bars so every column fits */
@container amsc (max-width: 430px) {
	.ams .ams-body:not(.is-dual) .ams-t .i { display: none; }
	.ams .ams-body:not(.is-dual) .bar { display: none; }
	.ams .ams-body:not(.is-dual) .ams-t { font-size: .8rem; }
	.ams .ams-body:not(.is-dual) .ams-t th { font-size: .68rem; }
	.ams .ams-body:not(.is-dual) .ams-t th, .ams .ams-body:not(.is-dual) .ams-t td { padding-left: .2rem; padding-right: .2rem; }
}
