/* ===== Общие стили ===== */
body {
  font-family: Arial, sans-serif;
  background: #f4f4f4;
  margin: 0;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  margin-bottom: 1rem;
  border-bottom: 1px solid #999;
  padding-bottom: 0.3rem;
  font-size: 1.4rem;
  text-align: center;
}

/* ===== Поиск ===== */
#searchInput {
  padding: 0.5rem;
  font-size: 1rem;
  width: 100%;
  max-width: 300px;
  margin-bottom: 0.5rem;
  text-align: center;
  box-sizing: border-box;
}

/* ===== Блок монеты и резюме ===== */
.asset-block {
  margin-top: 1.5rem;
  width: 100%;
  max-width: 500px;
  background: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  padding: 0.5rem;
  box-sizing: border-box;
}

.asset-title {
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

/* ===== Таблица монет ===== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  table-layout: fixed;
}

th, td {
  border: 1px solid #ccc;
  padding: 0.4rem;
  text-align: center;
  width: 25%;
}

th {
  background: #f0f0f0;
}

/* ===== Инпуты в таблице ===== */
input[type="text"] {
  width: 100%;
  max-width: 80px;
  text-align: center;
  border: 1px solid #ccc;
  padding: 4px;
  font-size: 0.9rem;
  box-sizing: border-box;
}

/* ===== Прибыль/убыток ===== */
.profit {
  font-weight: bold;
}

.positive {
  color: green;
}

.negative {
  color: red;
}

/* ===== Итоговая строка в монете ===== */
.summary-row td {
  border-top: 1px solid #ccc;
  font-weight: bold;
  background: #f9f9f9;
  height: 25px;            /* как высота input и кнопок */
  font-size: 0.90rem;      /* тот же размер шрифта */
  vertical-align: middle;
}



/* ===== Кнопки действий ===== */
td.actions {
  text-align: center;
}

.action-btn {
  display: inline-block;
  margin: 0 2px;
  width: 26px;
  height: 26px;
  font-size: 16px;
  border-radius: 4px;
  border: 1px solid;
  background: transparent;
  line-height: 24px;
  padding: 0;
  box-sizing: border-box;
  cursor: pointer;
}

.action-btn.red {
  color: red;
  border-color: red;
}

.action-btn.green {
  color: green;
  border-color: green;
}

/* ===== Список подсказок ===== */
ul#suggestions {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 150px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ccc;
  width: 100%;
  max-width: 300px;
  position: absolute;
  z-index: 100;
  box-sizing: border-box;
}

ul#suggestions li {
  padding: 0.5rem;
  cursor: pointer;
  text-align: center;
}

ul#suggestions li:hover {
  background-color: #eee;
}

/* ===== PIN панель ===== */
#pinPanel {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: row;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

#pinPanel input {
  width: 150px;
  padding: 5px;
  height: 32px;
  box-sizing: border-box;
}

#pinPanel button {
  height: 34px;
  padding: 0 10px;
  box-sizing: border-box;
}

/* ===== Таблица: Всего вложено / Прибыль ===== */
.summary-wrapper {
  margin-top: 1.5rem;
  width: 100%;
  max-width: 500px;
  background: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  padding: 0.5rem;
  box-sizing: border-box;
}

table.summary-global {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

table.summary-global td {
  border: 1px solid #ccc;
  padding: 0.4rem 0.5rem;
  box-sizing: border-box;
  text-align: left;
  white-space: nowrap;
}

table.summary-global td.label {
  font-weight: bold;
  width: 50%;
}

table.summary-global td.value {
  font-weight: bold;
  width: 50%;
}

table.summary-global .positive {
  color: green;
}

table.summary-global .negative {
  color: red;
}

/* ===== Адаптив ===== */
@media (max-width: 480px) {
  th, td {
    padding: 0.3rem;
    font-size: 0.8rem;
  }

  .asset-title {
    font-size: 0.95rem;
  }

  #pinPanel {
    flex-wrap: nowrap;
    flex-direction: row;
    justify-content: center;
  }

  #pinPanel input {
    width: 140px;
  }

  #pinPanel button {
    max-width: none;
    flex: none;
  }
}


.asset-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.asset-header span[contenteditable] {
  border-bottom: 1px dashed #aaa;
  cursor: text;
}



.full-highlight {
  background: #f0f0f0;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}



input.positive {
  border: 1px solid #ccc; /* стандартная рамка */
  color: green;
  font-weight: bold;
}

input.negative {
  border: 1px solid #ccc;
  color: red;
  font-weight: bold;
}



