/* Wolf Ridge Stocks — phone-first, clean, one idea per screen. */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1c2733;
  background: #f6f8fa;
  line-height: 1.5;
}
header.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  padding: 0.7rem 1rem; background: #123524; color: #fff;
}
header.top .brand { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
header.top nav { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; }
header.top nav a { color: #cfe3d6; text-decoration: none; font-size: 0.95rem; }
header.top nav a:hover { color: #fff; text-decoration: underline; }
main { max-width: 760px; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.55rem; line-height: 1.25; margin: 0.4rem 0 0.8rem; }
h1 .ticker { font-size: 1rem; color: #5a6b7a; font-weight: 400; }
h2 { font-size: 1.15rem; margin: 0.2rem 0 0.6rem; }
h3 { font-size: 1rem; margin: 0.9rem 0 0.4rem; }
p { margin: 0.5rem 0; }
.lede { font-size: 1.05rem; }
.small { font-size: 0.85rem; color: #5a6b7a; }
a { color: #14532d; }
.card {
  background: #fff; border: 1px solid #dde5ec; border-radius: 10px;
  padding: 1rem; margin: 0.9rem 0;
}
.means {
  background: #eef6f0; border-left: 4px solid #2e7d46; border-radius: 0 8px 8px 0;
  padding: 0.6rem 0.8rem; margin: 0.7rem 0; font-size: 0.95rem;
}
.chip {
  display: inline-block; padding: 0.12rem 0.55rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap;
}
.chip.pass { background: #d9f2e0; color: #14532d; border: 1px solid #2e7d46; }
.chip.fail { background: #fde3e0; color: #8c1d12; border: 1px solid #c0392b; }
.chip.neh { background: #e8edf2; color: #44566a; border: 1px solid #8fa3b8; }
.resultline { font-size: 1.05rem; }
.bigfig { font-size: 1.05rem; }
.tabs { display: flex; gap: 0.5rem; margin: 1rem 0 0.4rem; }
.tab {
  padding: 0.45rem 1.1rem; border: 1px solid #b9c8d4; border-radius: 999px;
  text-decoration: none; color: #1c2733; background: #fff; font-weight: 600;
}
.tab.active { background: #123524; color: #fff; border-color: #123524; }
table { border-collapse: collapse; width: 100%; margin: 0.6rem 0; font-size: 0.92rem; }
th, td { padding: 0.45rem 0.5rem; border-bottom: 1px solid #e3eaf0; text-align: left; vertical-align: top; }
thead th { border-bottom: 2px solid #b9c8d4; }
td.num, th.num { text-align: right; }
table.list td { vertical-align: middle; }
table.bigfive tr.explain td { border-bottom: 2px solid #d5dee7; color: #44566a; font-size: 0.85rem; padding-top: 0; }
table.calc th { background: #f0f4f8; }
.scroll { overflow-x: auto; }
table.series { font-size: 0.8rem; white-space: nowrap; }
ul.why { list-style: none; padding: 0; margin: 0; }
ul.why li { padding: 0.55rem 0.7rem; border-radius: 8px; margin: 0.45rem 0; }
li.why.pass { background: #eef8f1; }
li.why.fail { background: #fdf0ee; }
li.why.neh { background: #eef2f6; }
.converter label { display: block; margin: 0.5rem 0; font-size: 0.92rem; }
.converter input, .converter select {
  width: 100%; padding: 0.55rem; font-size: 1rem; border: 1px solid #b9c8d4; border-radius: 8px; margin-top: 0.2rem;
}
.cvout { font-size: 1.15rem; font-weight: 700; margin-top: 0.8rem; }
.gloss h2 { margin-bottom: 0.2rem; }
/* Accounts, pricing, favourites */
header.top nav .acct { color: #fff; font-size: 0.9rem; align-self: center; }
header.top nav form.signout { display: inline; align-self: center; }
header.top nav form.signout button {
  background: none; border: 1px solid #cfe3d6; color: #cfe3d6; border-radius: 999px;
  padding: 0.15rem 0.7rem; font-size: 0.85rem; cursor: pointer;
}
header.top nav form.signout button:hover { color: #fff; border-color: #fff; }
.btn {
  display: inline-block; background: #123524; color: #fff; border: 1px solid #123524;
  padding: 0.55rem 1.1rem; border-radius: 8px; font-size: 1rem; font-weight: 600;
  text-decoration: none; cursor: pointer; margin: 0.3rem 0.3rem 0.3rem 0;
}
.btn:hover { background: #1a4a32; }
.btn.secondary { background: #fff; color: #123524; }
.btn.secondary:hover { background: #eef6f0; }
.notice {
  background: #fdf6e3; border: 1px solid #d9b23a; border-radius: 8px;
  padding: 0.6rem 0.8rem; margin: 0.7rem 0; font-size: 0.95rem;
}
.notice.ok { background: #eef8f1; border-color: #2e7d46; }
.notice.error { background: #fdf0ee; border-color: #c0392b; }
.authform label { display: block; margin: 0.6rem 0; font-size: 0.95rem; }
.authform input {
  width: 100%; padding: 0.6rem; font-size: 1rem; border: 1px solid #b9c8d4;
  border-radius: 8px; margin-top: 0.25rem;
}
.pricefig { font-size: 1.5rem; font-weight: 700; margin: 0.3rem 0; }
.pricefig .per { font-size: 0.95rem; font-weight: 400; color: #5a6b7a; }
.card.price ul { margin: 0.4rem 0; padding-left: 1.2rem; }
.card.price li { margin: 0.3rem 0; }
.favform { display: inline; }
.star {
  background: none; border: none; padding: 0 0.1rem; margin: 0;
  font-size: 1.05rem; line-height: 1; cursor: pointer; color: #b8860b;
  text-decoration: none; vertical-align: baseline;
}
.star.on { color: #d97706; }
.star.off { color: #8fa3b8; }
.favline { display: flex; align-items: center; gap: 0.4rem; }
.favline .star { font-size: 1.4rem; }
hr { border: none; border-top: 1px solid #dde5ec; margin: 1.2rem 0; }
footer {
  max-width: 760px; margin: 0 auto; padding: 1rem; font-size: 0.85rem; color: #5a6b7a;
  border-top: 1px solid #dde5ec;
}
@media (max-width: 560px) {
  /* List rows become cards on a fixed grid: the details stack on the left
     and every result chip sits in the same fixed-width column on the right,
     stretched to the full column width, so the chips line up in a neat
     column from row to row instead of wrapping wherever they fit. */
  table.list, table.list tbody { display: block; }
  table.list thead { display: none; }
  table.list tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 9.5rem;
    grid-template-areas:
      "ticker result"
      "company result"
      "market result"
      "price result"
      "dividend result";
    align-items: center;
    column-gap: 0.7rem;
    background: #fff; border: 1px solid #dde5ec; border-radius: 10px;
    margin: 0.7rem 0; padding: 0.6rem 0.8rem;
  }
  table.list td { display: block; border: none; padding: 0.12rem 0; min-width: 0; }
  table.list td.c-market { grid-area: market; }
  table.list td.c-ticker { grid-area: ticker; }
  table.list td.c-company { grid-area: company; }
  table.list td.c-price { grid-area: price; text-align: left; }
  table.list td.c-dividend { grid-area: dividend; }
  table.list td.c-result { grid-area: result; align-self: center; }
  table.list td.c-result .chip { display: block; text-align: center; padding: 0.32rem 0.2rem; font-size: 0.72rem; letter-spacing: 0; }
  table.bigfive { font-size: 0.82rem; }
  th, td { padding: 0.35rem 0.3rem; }
}

/* v7: list controls (pass mark, dividend filter, sort), the language
   switcher, the custom-mark verdict line, and right-to-left support. */
.controls {
  display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: end;
  background: #fff; border: 1px solid #dde5ec; border-radius: 10px;
  padding: 0.7rem 0.8rem; margin: 0.8rem 0 0.4rem;
}
.controls label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: #44566a; }
.controls label.check { flex-direction: row; align-items: center; gap: 0.4rem; padding-bottom: 0.45rem; }
.controls input[type="number"] { width: 5.2rem; }
.controls input, .controls select { font: inherit; padding: 0.3rem 0.4rem; border: 1px solid #b9c7d4; border-radius: 6px; background: #fff; }
.controls button { font: inherit; padding: 0.38rem 0.9rem; border: 1px solid #2e7d46; border-radius: 6px; background: #2e7d46; color: #fff; cursor: pointer; }
.controls .nowrap { white-space: nowrap; }
.langswitch { max-width: 760px; margin: 0.2rem auto 0; padding: 0 1rem; font-size: 0.85rem; color: #5a6b7a; }
.langswitch a { color: #44566a; }
.customverdict { background: #fff8e6; border: 1px solid #d9a441; border-radius: 10px; padding: 0.6rem 0.8rem; }
table.list th a { color: inherit; text-decoration: none; border-bottom: 1px dotted #8fa3b8; }
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .num { text-align: left; }
html[dir="rtl"] table.list td.c-result .chip { text-align: center; }
