:root {
  --page-width: 480px;
  --ink: #15252b;
  --muted: #6b777b;
  --line: #dce3e5;
  --header: #00505b;
  --positive: #087f5b;
  --negative: #c92a2a;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  min-width: 320px;
  margin: 0;
  overflow: hidden;
  background: #fff;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.page-shell {
  width: 100%;
  max-width: var(--page-width);
  height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: 0 0 30px rgb(24 52 59 / 10%);
}

.div-ricerca {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 0 0 9%;
  width: 100%;
  height: 9%;
  min-height: 0;
  padding: 10px 8px 5px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.div-ricerca input {
  width: 100%;
  height: 28px;
  flex: 0 0 28px;
  min-height: 0;
  padding: 0 10px;
  border: 1px solid #b8c6c9;
  border-radius: 5px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 17px;
  margin-top: 3px;
  margin-bottom: 2px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 17px;
  white-space: nowrap;
}

.div-ricerca input:focus {
  border-color: var(--header);
  box-shadow: 0 0 0 3px rgb(0 80 91 / 13%);
}

.div-tabella {
  flex: 0 0 91%;
  width: 100%;
  height: 91%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  background: #fff;
}

.div-tabella::-webkit-scrollbar { width: 7px; }
.div-tabella::-webkit-scrollbar-track { background: #eef2f3; }
.div-tabella::-webkit-scrollbar-thumb { background: #899a9e; border-radius: 7px; }

.error-message {
  margin: 12px;
  padding: 10px;
  border: 1px solid #ffc9c9;
  border-radius: 8px;
  background: #fff5f5;
  color: var(--negative);
  font-size: 12px;
}

table {
  width: 100%;
  table-layout: fixed;
  border-spacing: 0;
  border-collapse: separate;
  background: #fff;
  font-variant-numeric: tabular-nums;
}

.col-name { width: 55%; }
.col-price { width: 23%; }
.col-change { width: 22%; }
.hidden-column { display: none; }

th {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 6px;
  border-right: 1px solid rgb(255 255 255 / 18%);
  background: var(--header);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  text-transform: uppercase;
}

th:first-child {
  padding-left: 12px;
  text-align: left;
}

th:nth-child(2) {
  padding-left: 12px;
  text-align: left;
}

td {
  height: 30px;
  padding: 2px 6px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  color: #2c3d42;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  text-overflow: clip;
  white-space: nowrap;
}

td:first-child {
  padding-left: 12px;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

td:nth-child(2) {
  padding-left: 12px;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

tbody tr:nth-child(even) td { background: #f8fafa; }
.spacer-row td { background: #fff !important; color: transparent; }
.company-link { display: block; overflow: hidden; color: inherit; text-decoration: none; text-overflow: clip; white-space: nowrap; }
.company-link:focus-visible { outline: 2px solid var(--header); outline-offset: 1px; }
.positive { color: var(--positive); font-weight: 600; }
.negative { color: var(--negative); font-weight: 600; }

@media (max-width: 480px) {
  html { -webkit-text-size-adjust: 100%; }
  .page-shell { box-shadow: none; }
  .div-ricerca { padding-inline: 6px; }
  .div-ricerca input { font-size: 16px; touch-action: manipulation; }
  td:first-child, td:nth-child(2) { padding-left: 9px; }
}
