/* Мой кабинет — тикеры и графики. Everything is prefixed with .grn- to stay out of the theme's way. */

:root {
  --grn-accent: #f2a93b;
  --grn-accent-ink: #0d1117;
  --grn-up: #1f9d55;
  --grn-down: #d9480f;
  --grn-line: rgba(127, 127, 127, 0.28);
  --grn-soft: rgba(127, 127, 127, 0.09);
}

/* ---------------------------------------------------------- ticker in text */
.grn-tk {
  display: inline;
  cursor: pointer;
  border-bottom: 1.5px dashed var(--grn-accent);
  border-radius: 2px;
  padding: 0 1px;
  transition: background-color .15s;
  white-space: normal;
}
.grn-tk:hover, .grn-tk:focus-visible { background: rgba(242, 169, 59, 0.16); outline: none; }
.grn-tk__badge {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--grn-soft);
  font-size: .78em;
  font-weight: 600;
  line-height: 1.6;
  vertical-align: .08em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.grn-tk__sym:empty, .grn-tk__chg:empty { display: none; }
.grn-tk__badge:has(.grn-tk__sym:empty):has(.grn-tk__chg:empty) { display: none; }
.grn-tk[data-tone="up"] .grn-tk__chg, [data-tone="up"] > .grn-row__chg, .grn-modal__chg[data-tone="up"] { color: var(--grn-up); }
.grn-tk[data-tone="down"] .grn-tk__chg, [data-tone="down"] > .grn-row__chg, .grn-modal__chg[data-tone="down"] { color: var(--grn-down); }

/* ------------------------------------------------- block "в статье" */
.grn-box {
  margin: 1.8em 0;
  padding: 16px 18px;
  border: 1px solid var(--grn-line);
  border-left: 4px solid var(--grn-accent);
  border-radius: 10px;
  background: var(--grn-soft);
  font-size: 15px;
  line-height: 1.4;
}
.grn-box__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.grn-box__title { font-weight: 700; font-size: 16px; }
.grn-box__cab { font-size: 13px; font-weight: 600; color: inherit; opacity: .75; text-decoration: none; }
.grn-box__cab:hover { opacity: 1; text-decoration: underline; }
.grn-box__list { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.grn-row { display: flex; align-items: center; gap: 10px; margin: 0 !important; padding: 0 !important; list-style: none !important; }
.grn-row + .grn-row { border-top: 1px solid var(--grn-line); }
.grn-row::before, .grn-row::marker { content: none !important; }
.grn-row__main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; margin: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.grn-row__main:hover .grn-row__chart { text-decoration: underline; }
.grn-row__id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.grn-row__sym { font-weight: 700; }
.grn-row__name { font-size: 12px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grn-row__px { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; min-width: 84px; }
.grn-row__price { font-weight: 600; }
.grn-row__chg { font-size: 12px; font-weight: 600; }
.grn-row__chart { font-size: 13px; font-weight: 600; color: var(--grn-accent); white-space: nowrap; }

/* ------------------------------------------------------- buttons */
.grn-fav, .grn-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 14px; margin: 0;
  border-radius: 8px; border: 1px solid var(--grn-accent);
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap;
  text-decoration: none !important; cursor: pointer;
}
.grn-fav { background: var(--grn-accent); color: var(--grn-accent-ink); }
.grn-fav:hover { filter: brightness(1.06); }
.grn-fav.is-on { background: transparent; color: var(--grn-accent); }
.grn-fav--sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.grn-fav__star { font-size: 1.05em; }
.grn-btn--ghost { background: transparent; color: inherit; border-color: var(--grn-line); }
.grn-btn--ghost:hover { border-color: var(--grn-accent); }
.grn-btn--link { background: transparent; border-color: transparent; color: inherit; opacity: .8; }
.grn-btn--link:hover { opacity: 1; text-decoration: underline !important; }

/* "Мой кабинет" */
.grn-cab-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 8px;
  background: var(--grn-accent); color: var(--grn-accent-ink) !important;
  font-weight: 700; font-size: 14px; line-height: 1.2; text-decoration: none !important; white-space: nowrap;
}
.grn-cab-btn:hover { filter: brightness(1.06); color: var(--grn-accent-ink) !important; }
.grn-cab-btn__icon { font-size: 1.05em; }
.grn-cab-menu-item { display: flex; align-items: center; }
.grn-cab-btn--menu { margin: 0 0 0 8px; }
.grn-cab-btn--float {
  position: fixed; right: 18px; bottom: 18px; z-index: 99990;
  padding: 11px 16px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}
@media (max-width: 640px) {
  .grn-cab-btn--float { right: 12px; bottom: 12px; padding: 10px 14px; font-size: 13px; }
  .grn-row__chart { display: none; }
  .grn-box { padding: 12px 14px; }
}

/* ---------------------------------------------------------- modal */
html.grn-lock, html.grn-lock body { overflow: hidden !important; }
.grn-modal[hidden] { display: none !important; }
.grn-modal {
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(5, 8, 12, .62);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 15px; line-height: 1.4;
}
.grn-modal__box {
  width: min(1100px, 100%); height: min(760px, 100%);
  display: flex; flex-direction: column;
  border-radius: 14px; overflow: hidden; box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
}
.grn-modal--dark .grn-modal__box { background: #131722; color: #e6edf3; --grn-line: rgba(255, 255, 255, .12); }
.grn-modal--light .grn-modal__box { background: #fff; color: #131722; --grn-line: rgba(0, 0, 0, .1); }
.grn-modal__head { display: flex; align-items: center; gap: 16px; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--grn-line); }
.grn-modal__id { flex: 1; min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.grn-modal__title { font-size: 20px; font-weight: 700; }
.grn-modal__sym { font-weight: 600; opacity: .7; }
.grn-modal__cls { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--grn-soft); }
.grn-modal__px { display: flex; align-items: baseline; gap: 10px; font-variant-numeric: tabular-nums; }
.grn-modal__price { font-size: 20px; font-weight: 700; }
.grn-modal__chg { font-size: 14px; font-weight: 600; }
.grn-modal__close {
  width: 38px; height: 38px; flex: none; margin: 0; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 26px; line-height: 1; cursor: pointer;
}
.grn-modal__close:hover { background: var(--grn-soft); }
.grn-modal__chart { flex: 1; min-height: 0; }
.grn-modal__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--grn-line); }

@media (max-width: 640px) {
  .grn-modal { padding: 0; align-items: stretch; }
  .grn-modal__box { width: 100%; height: 100%; border-radius: 0; }
  .grn-modal__head { flex-wrap: wrap; padding: 10px 10px 10px 14px; gap: 6px 10px; }
  .grn-modal__id { order: 1; flex-basis: calc(100% - 48px); }
  .grn-modal__close { order: 2; }
  .grn-modal__px { order: 3; flex-basis: 100%; }
  .grn-modal__title, .grn-modal__price { font-size: 18px; }
  .grn-modal__foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .grn-modal__foot .grn-fav { flex: 1 1 100%; min-height: 44px; }
  .grn-modal__foot .grn-btn { flex: 1 1 0; }
}
