* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  transition:
    background var(--speed),
    color var(--speed);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: none;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.01em;
}
h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}
h2 .icon {
  width: 16px;
  height: 16px;
  color: var(--text-3);
}

::selection {
  background: var(--accent-ring);
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.mono {
  font-family: "Cascadia Code", Consolas, "SF Mono", ui-monospace, monospace;
  font-size: 0.93em;
}
.muted {
  color: var(--text-2);
}
.small {
  font-size: 12px;
}
.strong {
  font-weight: 600;
}
.pos,
.neg {
  font-variant-numeric: tabular-nums;
}

.only-dark {
  display: none;
}
html[data-theme="dark"] .only-dark {
  display: inline-flex;
}
html[data-theme="dark"] .only-light {
  display: none;
}

.shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
}
.brand-mark-lg {
  width: 46px;
  height: 46px;
  border-radius: 13px;
}
.brand-mark-lg svg {
  width: 26px;
  height: 26px;
}

.brand-name {
  font-weight: 700;
  line-height: 1.2;
}
.brand-name em {
  font-style: normal;
}

.side-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text-2);
  transition:
    background var(--speed),
    color var(--speed);
}
.nav-item .icon {
  color: var(--text-3);
  transition: color var(--speed);
}
.nav-item:hover {
  background: var(--bg-accent);
  color: var(--text);
}
.nav-item:hover .icon {
  color: var(--text-2);
}
.nav-item.is-active .icon {
  color: var(--accent);
}

.sidebar-foot {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border);
}

.user-chip {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  border-radius: var(--radius-sm);
}
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  font-weight: 700;
}
.user-meta {
  min-width: 0;
  line-height: 1.25;
}
.user-meta strong {
  display: block;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-meta small {
  display: block;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main {
  margin-left: var(--sidebar-w);
}
.main-plain {
  margin-left: 0;
}

.page-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}
.page-sub {
  margin: 4px 0 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--speed);
}
.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.chip.is-active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
html[data-theme="dark"] .chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.dot-ok {
  color: var(--ok);
  background: var(--ok);
}
.dot-warn {
  color: var(--warn);
  background: var(--warn);
}
.dot-err {
  color: var(--err);
  background: var(--err);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  min-width: 190px;
  transition:
    border-color var(--speed),
    box-shadow var(--speed);
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.search input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}
.search input::placeholder {
  color: var(--text-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  background: var(--bg-accent);
  border-color: var(--border-strong);
}

.btn-danger {
  color: var(--err);
  border-color: var(--err-bg);
  background: var(--surface);
}
.btn-danger:hover {
  background: var(--err-bg);
  border-color: var(--err);
}

.btn-sm {
  font-size: 12.5px;
  border-radius: 8px;
}
.btn-sm .icon {
  width: 14px;
  height: 14px;
}
.btn-block {
  width: 100%;
  justify-content: center;
}

button[data-loading].is-loading {
  pointer-events: none;
  opacity: 0.7;
}
button[data-loading].is-loading .icon {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--speed);
}
.icon-btn:hover {
  background: var(--bg-accent);
  color: var(--text);
}
.icon-btn-sm .icon {
  width: 15px;
  height: 15px;
}
.icon-save {
  color: var(--ok);
}
.icon-save:hover {
  background: var(--ok-bg);
  color: var(--ok);
}
.icon-danger:hover:not(:disabled) {
  background: var(--err-bg);
  color: var(--err);
}
.icon-danger:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.card {
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 12px;
}
.card-foot .icon {
  width: 14px;
  height: 14px;
}

.card-table {
  margin-bottom: 20px;
}

.count-chip {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  padding: 0 7px;
  color: var(--text-2);
}

.table-wrap,
.card-table {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}
.table th {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--border);
}
.table thead {
  position: sticky;
  top: 0;
}
.table th.num,
.table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.table td {
  border-bottom: 1px solid var(--border);
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.table tbody tr {
  transition: background 0.12s;
}

.cell-code {
  font-weight: 650;
}
.cell-company {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cell-days {
  font-weight: 550;
}
.cell-end-hot {
  color: var(--accent);
  font-weight: 650;
}
.cell-msg {
  white-space: normal;
  min-width: 220px;
}
.row-follow .col-star .star {
  color: var(--star);
}
.row-note td {
  background: var(--bg-accent);
}

.col-star {
  width: 40px;
}
.col-actions {
  width: 76px;
  text-align: right;
}
.col-actions .icon-btn {
  transition: opacity var(--speed);
}
tr:hover .col-actions .icon-btn,
tr:hover .col-actions .btn {
  opacity: 1;
}
.add-row .col-actions .btn {
  opacity: 1;
}
.star {
  display: inline-flex;
  padding: 5px;
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--speed);
}
.star .icon {
  width: 17px;
  height: 17px;
}
.star:hover {
  color: var(--star);
  background: var(--warn-bg);
}
.star.is-on {
  color: var(--star);
}
.star.is-on .icon {
  fill: currentColor;
}
.pill {
  display: inline-flex;
  align-items: center;
}
.pill .dot {
  width: 6px;
  height: 6px;
}

.tag {
  display: inline-block;
  font-weight: 600;
}
.tag-muted {
  background: var(--bg-accent);
  color: var(--text-2);
}
.table-edit input:not([type="checkbox"]),
.table-edit select {
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  width: 100%;
  transition: all var(--speed);
}
.table-edit input:focus,
.table-edit select:focus {
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.table-edit select {
  cursor: pointer;
}
.input-code {
  text-transform: uppercase;
  min-width: 76px;
  font-weight: 600;
}

.table-edit input[type="number"]::-webkit-outer-spin-button,
.table-edit input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.table-edit input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.table-edit th {
  padding: 8px 6px;
}
.add-row input,
.add-row select {
  background: var(--surface);
}
.add-row input::placeholder {
  color: var(--text-3);
}
input,
select,
textarea {
  border: 1px solid var(--border);
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition:
    border-color var(--speed),
    box-shadow var(--speed);
}
input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
input::placeholder {
  color: var(--text-3);
}

label {
  display: block;
  color: var(--text-2);
}
label input,
label select {
  display: block;
  width: 100%;
  font-weight: 400;
}
.form-grid {
  display: grid;
}
.form-grid label {
  margin: 0;
}
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}
.form-actions .btn {
  margin-top: 0;
}
.new-record-card .card-head {
  padding-bottom: 4px;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  cursor: pointer;
  margin: 12px 0;
}
.check input {
  accent-color: var(--accent);
  margin: 0;
  flex: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat-card-total {
  border-color: var(--accent);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
}
.stat-label .icon {
  width: 15px;
  height: 15px;
}

.stat-value {
  font-variant-numeric: tabular-nums;
}

.stat-rows {
  display: flex;
  flex-direction: column;
}
.stat-rows > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.stat-rows span:first-child {
  color: var(--text-2);
}
.stat-rows span:last-child {
  font-variant-numeric: tabular-nums;
  font-weight: 550;
}
.stat-empty {
  color: var(--text-2);
  font-size: 12.5px;
  margin-top: 10px;
}

.close-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.close-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
  min-width: 260px;
}
.close-form select {
  min-width: 230px;
}
.close-form .check {
  margin: 0;
  font-size: 12.5px;
}
.close-form .btn {
  margin: 0;
}

.calc-bar {
  display: grid;
}
.calc-cell {
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.calc-cell > span {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}
.calc-cell > strong {
  font-variant-numeric: tabular-nums;
}
.calc-cell-add .calc-add-form {
  display: flex;
  gap: 7px;
  align-items: center;
}
.calc-cell-add select {
  flex: 1;
  min-width: 0;
  max-width: 260px;
}
.calc-cell-add .btn {
  padding: 6px 9px;
}

.calc-totals {
  display: grid;
}

.table-scroll {
  overflow-x: auto;
}
.table-scroll table {
  min-width: 900px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9, 12, 20, 0.45);
  backdrop-filter: blur(3px);
  animation: modal-fade 0.16s;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lift);
}
.modal-card h3 {
  margin-bottom: 8px;
}
.modal-card p {
  margin: 0;
  color: var(--text-2);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}
.modal-overlay.is-out {
  opacity: 0;
  transition: opacity 0.16s;
}

@keyframes modal-fade {
  from {
    opacity: 0;
  }
}
@keyframes modal-pop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(6px);
  }
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-2);
  text-align: center;
}
.empty strong {
  color: var(--text);
  font-size: 14px;
}
.empty span {
  font-size: 12.5px;
}
.empty-icon {
  color: var(--text-3);
  margin-bottom: 6px;
}

.foot-note {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-3);
  margin: 0;
}
.foot-note .icon {
  width: 14px;
  height: 14px;
}

.toasts {
  position: fixed;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.toast {
  display: flex;
  max-width: 420px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow-lift);
  font-size: 13px;
}
.toast .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}
.toast-x {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 5px;
}
.toast-x:hover {
  color: var(--text);
}
.toast-x .icon {
  width: 13px;
  height: 13px;
  margin: 0;
}

.toast-ok {
  border-left-color: var(--ok);
}
.toast-ok > .icon {
  color: var(--ok);
}
.toast-warn {
  border-left-color: var(--warn);
}
.toast-warn > .icon {
  color: var(--warn);
}
.toast-err {
  border-left-color: var(--err);
}
.toast-err > .icon {
  color: var(--err);
}

.toast.is-out {
  animation: toast-out 0.25s forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.login-wrap {
  place-items: center;
}

.login-card {
  width: 100%;
}
.login-brand h1 {
  margin-bottom: 5px;
}
.login-brand p {
  margin: 0;
  color: var(--text-2);
}

.login-error {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--err-bg);
  color: var(--err);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 13px;
  margin-bottom: 16px;
}
.login-error .icon {
  width: 15px;
  height: 15px;
  flex: none;
}
.login-form .btn {
  padding: 10px;
}

.settings-grid {
  display: grid;
  align-items: start;
}
.settings-grid .card {
  margin-bottom: 0;
}
.settings-grid .card .card-head {
  padding: 15px 18px 12px;
}
.settings-grid .card-sub {
  margin-bottom: 6px;
}
.settings-grid .card-table .table {
  padding: 0;
}
.settings-grid .foot-note {
  padding: 0 18px 16px;
}

@media (max-width: 1020px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: sticky;
    top: 0;
    inset: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .brand {
    padding: 0;
  }
  .brand-name {
    display: none;
  }
  .side-nav {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .side-nav::-webkit-scrollbar {
    display: none;
  }
  .nav-item {
    padding: 7px 11px;
    white-space: nowrap;
  }
  .nav-item span {
    font-size: 13px;
  }
  .sidebar-foot {
    border-top: none;
    padding-top: 0;
    margin-left: auto;
  }
  .user-chip {
    display: none;
  }
  .main {
    margin-left: 0;
    padding: 20px 16px 48px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 18px;
  }
  .search input {
    width: 120px;
  }
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 8px;
  border: 2px solid var(--surface);
}
::-webkit-scrollbar-track {
  background: transparent;
}
:root {
  color-scheme: light;
}
html[data-theme="dark"] {
  color-scheme: dark;
}
html {
  scroll-padding-top: 90px;
}
h1 {
  line-height: 1.25;
}
h2 {
  font-size: 14px;
}
h3 {
  font-size: 18px;
  letter-spacing: -0.3px;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  transform: translateY(-160%);
  z-index: 500;
  background: var(--surface);
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 6px;
}
.skip-link:focus {
  transform: none;
}
.sidebar {
  padding: 28px 16px 16px;
  gap: 0;
}
.brand {
  padding: 0 8px 42px;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  box-shadow: none;
}
.brand-mark svg {
  width: 25px;
  height: 25px;
}
.brand-name {
  letter-spacing: -0.4px;
}
.brand-name em {
  display: block;
  font-weight: 400;
  letter-spacing: 0.1px;
}
.nav-caption {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-3);
  padding: 0 12px 12px;
}
.side-nav {
  gap: 5px;
}
.nav-item {
  padding: 11px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}
.nav-item.is-active {
  font-weight: 600;
}
.nav-item.is-active:before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 22px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.sidebar-foot {
  gap: 3px;
  padding-top: 16px;
}
.user-chip {
  gap: 8px;
  padding: 0;
}
.avatar {
  width: 29px;
  height: 29px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
}
.user-meta strong {
  font-size: 12px;
}
.user-meta small {
  font-size: 10px;
}
.mobile-bar {
  display: none;
}
.page-head {
  align-items: center;
  gap: 20px;
}
.page-sub {
  margin-top: 8px;
}
.record-switch {
  display: flex;
  gap: 8px;
}
.toolbar {
  gap: 16px;
  margin-bottom: 18px;
}
.chips {
  gap: 3px;
}
.chip {
  min-height: 36px;
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
}
.chip.is-active,
html[data-theme="dark"] .chip.is-active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--accent);
  box-shadow: 0 1px 2px #00000006;
}
.search {
  border-color: var(--border-strong);
  border-radius: 6px;
  padding: 0 11px;
  flex: 0 1 280px;
}
.search input {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 9px 0;
  box-shadow: none !important;
}
.btn {
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 6px;
  border-color: var(--border-strong);
  font-size: 12px;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.btn:active {
  transform: none;
}
.btn-primary {
  box-shadow: none;
}
.btn-sm {
  min-height: 32px;
  padding: 5px 10px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
}
.icon-btn-sm {
  width: 30px;
  height: 32px;
}
.col-actions .icon-btn {
  opacity: 1;
}
.icon-danger {
  color: var(--text-2);
}
.is-loading {
  pointer-events: none;
  opacity: 0.65;
}
.is-loading .icon {
  animation: spin 1s linear infinite;
}
input,
select,
textarea {
  min-height: 40px;
  max-width: 100%;
  padding: 9px 11px;
  border-color: var(--border-strong);
  border-radius: 6px;
  font-size: 13px;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--text-3);
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m5 6 3 3 3-3' fill='none' stroke='%23737e8e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
select option {
  background: var(--surface);
  color: var(--text);
}
label {
  font-size: 12px;
  font-weight: 500;
}
label input,
label select {
  margin-top: 7px;
}
.check input {
  min-height: 0;
  width: 17px;
  height: 17px;
}
.check {
  font-weight: 400;
}
.form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  padding: 22px;
}
.form-actions {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.form-stack label {
  margin-bottom: 20px;
}
.password-field {
  position: relative;
  display: block;
}
.password-field input {
  padding-right: 66px;
}
.password-toggle {
  position: absolute;
  right: 8px;
  top: 6px;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 11px;
  cursor: pointer;
}
.field-help {
  display: block;
  font-size: 11px;
  color: var(--text-3);
  font-weight: 400;
  margin-top: 7px;
}
.card {
  margin-bottom: 24px;
}
.card-head,
.settings-grid .card .card-head,
.new-record-card .card-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}
.card-sub {
  padding: 0 22px;
}
.count-chip {
  height: 21px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 500;
}
.table {
  font-size: 12px;
}
.table th,
.table td {
  padding: 14px 16px;
}
.table th {
  text-transform: none;
  letter-spacing: 0;
}
.cell-code {
  color: var(--text);
  letter-spacing: 0.2px;
}
.row-dim td {
  opacity: 1;
  color: var(--text-2);
}
.table .col-actions {
  width: 84px;
  text-align: right;
  white-space: nowrap;
}
.star {
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
}
.star:hover {
  transform: none;
}
.pill {
  gap: 6px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.tag {
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
}
.table-edit td {
  padding: 4px 6px;
}
.table-edit input:not([type="checkbox"]),
.table-edit select {
  min-width: 85px;
  min-height: 26px;
  padding: 3px 7px;
  font-size: 12px;
  background-color: transparent;
  border-radius: 6px;
}
.table-edit select {
  padding-right: 26px;
  min-width: 105px;
}
.table-edit input[type="date"] {
  min-width: 118px;
}
.table-edit input:hover,
.table-edit select:hover {
  background-color: var(--surface);
}
.table-edit input:focus,
.table-edit select:focus {
  border-color: var(--accent);
  background-color: var(--surface);
}
.add-row td {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}
.stats-grid {
  gap: 16px;
  margin-bottom: 30px;
}
.stat-card {
  padding: 22px;
}
.stat-card-total {
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  padding-top: 20px;
  background: var(--surface);
}
.stat-label {
  font-size: 12px;
  font-weight: 400;
}
.stat-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1.25;
  margin: 12px 0 20px;
}
.stat-card-total .stat-value {
  color: var(--text);
}
.stat-rows {
  gap: 9px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.close-card {
  padding: 22px;
  gap: 24px;
  border-left: 1px solid var(--border);
}
.close-form {
  gap: 18px;
}
.calc-bar {
  grid-template-columns: 1fr 1fr 1.3fr 2fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
}
.calc-cell {
  gap: 10px;
  padding: 20px;
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
}
.calc-cell:last-child {
  border: 0;
}
.calc-cell > strong {
  font-size: 24px;
  font-weight: 600;
  line-height: 40px;
}
.calc-cell input {
  width: 100%;
  max-width: none;
  padding: 9px 11px;
}
.calc-totals {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
}
.calc-totals .stat-value {
  margin-bottom: 0;
}
.calc-scenarios {
  margin-top: 8px;
}
.calc-scenarios-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 12px;
}
.calc-scenarios-head h2 {
  margin: 0;
  font-size: 17px;
}
.calc-scenarios-head p {
  margin: 4px 0 0;
}
.scenario-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}
.scenario-switch legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.scenario-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.scenario-switch label {
  min-width: 78px;
  padding: 7px 11px;
  border-radius: 5px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.scenario-switch input:checked + label {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.scenario-switch input:disabled + label {
  color: var(--text-3);
  cursor: not-allowed;
  opacity: 0.55;
}
.scenario-switch input:focus-visible + label {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.records-divider {
  height: 1px;
  margin: 26px 12px;
  background: var(--border);
}
.calc-lot {
  width: 110px;
}
.empty {
  gap: 9px;
  white-space: normal;
}
.empty span {
  max-width: 360px;
  color: var(--text-2);
}
.empty .btn {
  margin-top: 10px;
}
.empty-sm {
  padding: 30px 20px;
}
.foot-note {
  font-size: 11px;
}
.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.settings-grid .card {
  min-width: 0;
}
.settings-grid .form-stack {
  padding: 22px;
}
.settings-grid .card-table {
  grid-column: 1/-1;
}
.modal-card {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 28px;
  border-radius: 12px;
  color: var(--text);
  animation: modal-fade 0.16s;
}
.modal-card::backdrop {
  background: #11182766;
}
.modal-card h3 {
  font-size: 18px;
  margin: 16px 0 9px;
}
.modal-card p {
  font-size: 13px;
  line-height: 1.7;
}
.modal-symbol {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 20px;
}
.modal-danger .modal-symbol {
  background: var(--err-bg);
  color: var(--err);
}
.modal-actions {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 24px;
}
.modal-danger .modal-actions .btn-danger {
  background: #b63838;
  border-color: #b63838;
  color: #fff;
}
.modal-danger .modal-actions .btn-danger:hover {
  background: #9c2e2e;
}
.toasts {
  top: auto;
  bottom: 24px;
  right: 24px;
  width: min(390px, calc(100vw - 32px));
  gap: 10px;
}
.toast {
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  animation: modal-fade 0.2s;
}
.toast > span {
  flex: 1;
  overflow-wrap: anywhere;
}
.toast-x {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  flex: none;
}
.toast-x:hover {
  background: var(--surface-2);
}
.login-wrap {
  min-height: 100dvh;
}
.neutral {
  color: var(--text) !important;
}
.pos {
  color: var(--pos) !important;
}
.neg {
  color: var(--neg) !important;
}
.table td.pos,
.table td.neg {
  color: var(--neg) !important;
}
.pill-ok {
  background: var(--ok-bg) !important;
  color: var(--ok) !important;
}
.pill-warn {
  background: var(--warn-bg) !important;
  color: var(--warn) !important;
}
.pill-err {
  background: var(--err-bg) !important;
  color: var(--err) !important;
}
.tag-ok {
  background: var(--ok-bg) !important;
  color: var(--ok) !important;
}
.tag-warn {
  background: var(--warn-bg) !important;
  color: var(--warn) !important;
}
.account-marker {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 8px 1px 0;
  border-radius: 50%;
  background: var(--account-color, var(--accent));
  box-shadow: 0 0 0 2px
    color-mix(in srgb, var(--account-color, var(--accent)) 22%, transparent);
  vertical-align: middle;
}
.account-marker-new {
  background: var(--border-strong);
  box-shadow: none;
}
.settings-grid .table-edit td:first-child {
  min-width: 180px;
}
.settings-grid .table-edit td:first-child input {
  display: inline-block;
  width: calc(100% - 22px);
  vertical-align: middle;
}
.account-color {
  width: 36px !important;
  min-width: 36px !important;
  height: 30px;
  min-height: 30px !important;
  padding: 3px !important;
  border-radius: 5px !important;
  cursor: pointer;
}
.account-select {
  border-left: 3px solid var(--account-color, var(--border-strong));
  color: var(--account-color, var(--text));
  font-weight: 600;
}
.account-select option {
  color: var(--text);
  font-weight: 400;
}
.account-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 180px;
}
.account-cell .account-marker {
  flex: 0 0 8px;
  margin-right: 0;
}
.account-cell .account-select {
  flex: 1 1 auto;
  min-width: 0;
}
.profit-input.pos {
  color: var(--pos) !important;
}
.profit-input.neg {
  color: var(--neg) !important;
}
.telegram-panel {
  padding: 20px 22px 18px;
}
.settings-message {
  margin: 0 0 17px;
  font-size: 13px;
  line-height: 1.7;
}
.settings-message-error {
  color: var(--neg);
}
.telegram-status {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
}
.telegram-status .status-dot {
  width: 9px;
  height: 9px;
  background: #62b889;
  border-radius: 50%;
  box-shadow: 0 0 0 4px #62b88922;
}
.telegram-status strong,
.telegram-status small {
  display: block;
}
.telegram-status strong {
  font-size: 13px;
}
.telegram-status small {
  color: var(--text-2);
  font-size: 11px;
  margin-top: 2px;
}
.telegram-link-box {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.telegram-link-box label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
}
.copy-field {
  display: flex;
  gap: 8px;
}
.copy-field input {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--text-2);
}
.telegram-link-box > small {
  display: block;
  margin-top: 8px;
  color: var(--text-3);
  font-size: 11px;
}
.automation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding: 14px 22px 16px;
}
.automation-row form {
  display: flex;
  align-items: center;
  gap: 12px;
}
.automation-row .check {
  margin: 0;
}
@supports not (color: color-mix(in srgb, red, transparent)) {
  .account-marker {
    box-shadow: none;
  }
}
.login-intro {
  flex-direction: column;
  justify-content: space-between;
  min-height: 100dvh;
  width: 100%;
  padding: 48px 12%;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
}
.login-wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 600;
}
.login-intro h2 {
  font-size: clamp(36px, 4.4vw, 68px);
  line-height: 1.12;
  letter-spacing: -2.5px;
  margin: 24px 0;
  font-weight: 550;
}
.login-intro p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-2);
}
.login-caption {
  font-size: 11px;
  color: var(--text-3);
}
.login-card {
  box-shadow: none;
}
.login-brand {
  text-align: left;
  margin-bottom: 32px;
}
.login-brand p {
  font-size: 12px;
  margin-top: 12px;
}
.login-form label {
  margin-bottom: 22px;
}
.login-form .btn {
  margin-top: 8px;
  min-height: 42px;
}
@media (min-width: 1600px) {
  .main:not(.main-plain) {
    padding-left: 52px;
    padding-right: 52px;
  }
}
@media (min-width: 801px) and (max-width: 1020px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    flex-direction: column;
    align-items: stretch;
    border-right: 1px solid var(--border);
    border-bottom: 0;
  }
  .brand {
    padding: 0 8px 42px;
  }
  .brand-name {
    display: block;
  }
  .side-nav {
    flex-direction: column;
    overflow: visible;
  }
  .sidebar-foot {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-left: 0;
  }
  .user-chip {
    display: flex;
  }
  .main {
    margin-left: var(--sidebar-w);
  }
  .main-plain {
    margin-left: 0;
  }
}
@media (max-width: 1200px) {
  .main {
    padding-top: 28px;
    padding-left: 24px;
    padding-right: 24px;
  }
  .main-plain {
    padding: 0;
  }
  .calc-bar {
    grid-template-columns: 1fr 1fr;
  }
  .calc-cell:nth-child(2) {
    border-right: 0;
  }
  .calc-cell:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }
  .calc-totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 800px) {
  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 35;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }
  .mobile-brand {
    font-weight: 650;
    font-size: 14px;
    color: var(--text);
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    visibility: hidden;
    transform: translateX(-100%);
    transition:
      transform 0.18s,
      visibility 0.18s;
    width: 260px;
    flex-direction: column;
    align-items: stretch;
    z-index: 40;
  }
  .nav-open .sidebar {
    visibility: visible;
    transform: none;
  }
  .brand {
    padding: 0 8px 42px;
  }
  .brand-name {
    display: block;
  }
  .side-nav {
    flex-direction: column;
  }
  .sidebar-foot {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-left: 0;
  }
  .user-chip {
    display: flex;
  }
  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 39;
    background: #11182766;
    border: 0;
    border-radius: 0;
  }
  .main {
    margin: 0;
    padding: 24px 20px 40px;
  }
  .main-plain {
    padding: 0;
  }
  .page-head {
    margin-bottom: 24px;
  }
  .calc-scenarios-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .scenario-switch {
    align-self: stretch;
  }
  .scenario-switch label {
    flex: 1;
  }
  h1 {
    font-size: 25px;
  }
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .login-intro {
    padding: 40px 30px;
  }
  .login-intro h2 {
    font-size: 42px;
  }
  .login-card {
    padding: 28px;
  }
  .table th,
  .table td {
    padding: 12px;
  }
  .table-edit td {
    padding: 6px;
  }
  .card-table:focus-visible {
    outline-offset: -3px;
  }
}
@media (max-width: 540px) {
  .main {
    padding-left: 16px;
    padding-right: 16px;
  }
  .main-plain {
    padding: 0;
  }
  .page-head {
    align-items: flex-start;
    gap: 16px;
  }
  .page-head > .inline {
    width: 100%;
  }
  .page-head > .inline .btn {
    width: 100%;
  }
  .toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .search {
    flex: auto;
    width: 100%;
    min-height: 40px;
  }
  .search input {
    width: 100%;
  }
  .chip {
    padding: 7px 9px;
    min-height: 40px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    padding: 18px;
    gap: 18px 12px;
  }
  .form-grid label {
    min-width: 0;
  }
  .form-grid input,
  .form-grid select {
    min-width: 0;
  }
  .form-actions .btn {
    width: 100%;
  }
  input,
  select,
  textarea,
  .table-edit input:not([type="checkbox"]),
  .table-edit select,
  .search input {
    font-size: 16px;
  }
  .calc-cell {
    padding: 16px;
  }
  .calc-cell-add {
    grid-column: 1/-1;
    border-top: 1px solid var(--border) !important;
  }
  .calc-cell:nth-child(3) {
    grid-column: 1/-1;
    border: 0;
  }
  .calc-totals {
    gap: 10px;
  }
  .calc-totals .stat-card {
    padding: 16px;
  }
  .calc-totals .stat-value {
    font-size: 20px;
    letter-spacing: -0.5px;
  }
  .close-card {
    padding: 18px;
    gap: 18px;
  }
  .close-form {
    min-width: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }
  .close-form select {
    min-width: 0;
    width: 100%;
  }
  .foot-note {
    align-items: flex-start;
  }
  .toasts {
    right: 16px;
    bottom: 16px;
  }
  .modal-card {
    padding: 24px;
  }
  .login-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
  }
  .login-intro {
    min-height: 0;
    padding: 28px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .login-intro > div,
  .login-caption {
    display: none;
  }
  .login-card {
    margin: auto;
    padding: 36px 28px;
  }
  .btn {
    min-height: 40px;
  }
  .icon-btn,
  .star {
    min-width: 36px;
    min-height: 36px;
  }
}
.archive-import {
  margin-bottom: 20px;
}
.archive-import > summary {
  justify-content: flex-start;
}
.archive-import > summary .muted {
  margin-left: auto;
}
.archive-import-body {
  padding: 20px;
}
.archive-import-help {
  max-width: 920px;
  margin: 0 0 16px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.7;
}
.archive-import-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.archive-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.archive-file-label {
  cursor: pointer;
}
.archive-import-text {
  display: block;
  width: 100%;
  min-height: 180px;
  resize: vertical;
  font:
    12px/1.55 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  white-space: pre;
  tab-size: 4;
}
.archive-import-form .form-actions,
.archive-account-map .form-actions {
  justify-content: flex-start;
  margin-top: 14px;
}
.archive-import-error {
  margin: 0 0 16px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--neg) 45%, var(--border));
  border-radius: 6px;
  color: var(--neg);
  font-size: 12px;
}
.archive-import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 22px;
  padding: 13px 15px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.archive-import-summary .warn {
  color: var(--warning, #d6b16f);
}
.archive-import-warnings {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.6;
}
.archive-account-map,
.archive-import-sample {
  margin-top: 22px;
}
.archive-account-map h3,
.archive-import-sample h3 {
  margin: 0 0 7px;
  font-size: 13px;
  font-weight: 600;
}
.archive-account-map p {
  margin: 0 0 12px;
}
.archive-account-map .table,
.archive-import-sample .table {
  min-width: 560px;
}
.archive-account-map select {
  min-width: 240px;
}
.archive-import-sample {
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
@media (max-width: 540px) {
  .archive-import-body {
    padding: 16px;
  }
  .archive-import-tools {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .archive-import > summary .muted {
    display: none;
  }
  .archive-account-map select {
    min-width: 0;
    width: 100%;
  }
}
@media (max-width: 800px) {
  body.nav-open .sidebar {
    visibility: visible !important;
    transform: translateX(0) !important;
  }
  body:not(.nav-open) .sidebar {
    visibility: hidden;
    transform: translateX(-100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.stock-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
  margin-bottom: 24px;
}
.stock-add-card,
.stock-source-card {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 20px;
}
.stock-add-card .card-head,
.stock-source-card .card-head {
  padding: 0 0 16px;
}
.stock-add-card h2,
.stock-source-card h2 {
  margin: 0;
  font-size: 14px;
}
.card-sub {
  margin: 5px 0 0;
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.55;
}
.stock-add-form {
  display: grid;
  grid-template-columns: minmax(100px, 0.55fr) minmax(150px, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.stock-add-form label,
.stock-source-form label {
  display: grid;
  gap: 6px;
  margin: 0;
}
.stock-add-form label > span,
.stock-source-form label > span {
  color: var(--text-2);
  font-size: 11px;
}
.stock-add-form label small {
  color: var(--text-3);
  font-size: 10px;
}
.stock-add-form .btn {
  min-height: 40px;
  white-space: nowrap;
}
.stock-source-card .card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.source-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: var(--text-3);
  font-size: 10px;
  white-space: nowrap;
}
.source-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
}
.source-status.is-connected {
  color: var(--ok);
}
.source-status.is-connected .source-status-dot {
  background: var(--ok);
}
.stock-source-details {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.stock-source-details > summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 11px;
  list-style: none;
}
.stock-source-details > summary::-webkit-details-marker {
  display: none;
}
.stock-source-details > summary:after {
  content: "+";
  float: right;
  color: var(--text-3);
  font-size: 15px;
  line-height: 1;
}
.stock-source-details[open] > summary:after {
  content: "−";
}
.stock-source-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.stock-source-form .form-hint {
  margin: 0;
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.55;
}
.stock-source-connected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  color: var(--text-2);
  font-size: 11px;
}
.stock-table-card {
  border: 1px solid var(--border);
  background: var(--surface);
}
.stock-table-head {
  border-bottom: 1px solid var(--border);
  padding: 17px 20px 14px;
}
.stock-table-head h2 {
  margin: 0;
}
.stock-table {
  min-width: 980px;
}
.stock-symbol-wrap {
  display: grid;
  gap: 3px;
}
.stock-symbol-wrap small {
  max-width: 140px;
  overflow: hidden;
  color: var(--text-3);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stock-table .cell-company {
  max-width: 240px;
  color: var(--text-2);
}
.stock-table .small {
  font-size: 10px;
}
.stock-table .icon-danger {
  color: var(--text-3);
}
.stock-table .icon-danger:hover {
  color: var(--neg);
}
html[data-theme="light"] .stock-add-card,
html[data-theme="light"] .stock-source-card,
html[data-theme="light"] .stock-table-card {
  background: var(--surface);
}

@media (max-width: 980px) {
  .stock-top-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .stock-add-card,
  .stock-source-card {
    padding: 16px;
  }
  .stock-add-form {
    grid-template-columns: 1fr 1fr;
  }
  .stock-add-form .btn {
    grid-column: 1 / -1;
    width: 100%;
  }
  .stock-source-card .card-head {
    display: block;
  }
  .source-status {
    margin-top: 10px;
  }
  .stock-source-connected {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (forced-colors: active) {
  .nav-item.is-active,
  .chip.is-active {
    outline: 1px solid Highlight;
  }
  .brand-mark {
    border: none;
    outline: none;
  }
}
.nav-open {
  overflow: hidden;
}
.settings-grid .table-edit {
  min-width: 560px;
}
.new-record-card {
  scroll-margin-top: 24px;
}
@media print {
  .sidebar,
  .mobile-bar,
  .toasts,
  .page-head > .btn,
  .col-actions {
    display: none;
  }
  .main {
    margin: 0;
    padding: 0;
  }
  .card,
  .stat-card {
    break-inside: avoid;
  }
  body {
    background: white;
  }
}
.sidebar {
  border-right-color: var(--border);
}
.brand-name {
  font-size: 15px;
}
.side-nav {
  overflow: visible;
}
.nav-group summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  border-radius: 6px;
}
.nav-group summary::-webkit-details-marker,
.section-disclosure summary::-webkit-details-marker {
  display: none;
}
.nav-group summary:hover {
  background: var(--surface-2);
}
.nav-group summary > .icon {
  color: var(--text-3);
  width: 16px;
}
.nav-chevron {
  margin-left: auto;
  color: var(--text-3);
  transform: rotate(-90deg);
}
.nav-group[open] .nav-chevron {
  transform: none;
}
.nav-group-items {
  padding-left: 10px;
  border-left: 1px solid var(--border);
}
.nav-group-items .nav-item .icon {
  display: none;
}
.nav-item.is-active:before {
  display: none;
}
.nav-settings {
  margin-top: auto;
  margin-bottom: 18px;
}
.main:not(.main-plain) {
  max-width: 1640px;
}
.page-head {
  margin-bottom: 28px;
}
.portfolio-summary {
  align-items: center;
}
.balance-primary {
  display: flex;
  flex-direction: column;
}
.balance-primary strong {
  font-variant-numeric: tabular-nums;
}
.balance-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}
.balance-metrics dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.section-disclosure {
  border: 1px solid var(--border);
  margin-bottom: 20px;
  overflow: hidden;
}
.section-disclosure > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.section-disclosure > summary:hover {
  background: var(--surface);
}
.section-disclosure > summary:after {
  content: "+";
  margin-left: auto;
  font-size: 18px;
  font-weight: 400;
  color: var(--text-3);
}
.section-disclosure[open] > summary:after {
  content: "−";
}
.section-disclosure[open] > summary {
  border-bottom: 1px solid var(--border);
}
.section-disclosure > summary .muted {
  font-size: 11px;
  font-weight: 400;
}
.account-disclosure {
  margin-bottom: 32px;
}
.record-disclosure .form-grid {
  background: var(--surface);
  margin: 0;
}
.empty {
  padding: 42px 20px;
}
.empty-icon {
  width: 24px;
  height: 24px;
}
.empty strong {
  font-weight: 500;
}
.table-edit input:hover,
.table-edit select:hover {
  border-color: var(--border-strong);
}
input,
select,
textarea {
  background-color: var(--surface);
}
.pill,
.tag {
  background: transparent;
}
.calc-totals {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.calc-totals .stat-value {
  font-size: 21px;
  font-weight: 500;
}
.login-wrap {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--bg);
}
.login-intro {
  display: none;
}
.login-brand .brand-mark {
  display: grid;
  margin: 0 0 28px;
}
.login-brand h1 {
  font-size: 24px;
}
@media (max-width: 1100px) {
  .portfolio-summary {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}
@media (max-width: 800px) {
  .side-nav {
    overflow-y: auto;
  }
  .nav-group-items {
    margin-left: 20px;
  }
}
@media (max-width: 540px) {
  .balance-metrics {
    gap: 12px;
  }
  .balance-metrics dt {
    font-size: 10px;
    min-height: 30px;
    margin-bottom: 4px;
  }
  .balance-metrics dd {
    font-size: 14px;
  }
  .portfolio-summary {
    padding-top: 0;
    gap: 24px;
  }
  .section-disclosure > summary {
    padding: 15px;
  }
  .section-disclosure > summary .muted {
    display: none;
  }
  .record-switch {
    width: 100%;
  }
  .records-divider {
    margin: 20px 4px;
  }
  .record-switch .btn {
    flex: 1;
  }
  .login-wrap {
    display: grid;
  }
}
.stock-add-card,
.stock-source-card,
.stock-table-card {
  background: var(--surface);
}

.stock-analyze-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 16px 18px 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.stock-analyze-row > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.stock-analyze-row strong {
  font-size: 12.5px;
  color: var(--text);
}
.stock-analyze-row span {
  color: var(--text-3);
  font-size: 11.5px;
}
.stock-analyze-form {
  display: flex;
  gap: 7px;
  align-items: center;
  flex: 0 0 210px;
}
.stock-analyze-form input {
  min-width: 0;
  width: 100%;
}
.stock-symbol {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.03em;
}
.stock-symbol:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.analysis-hero {
  align-items: flex-end;
  margin-bottom: 18px;
}
.analysis-title-wrap {
  min-width: 0;
}
.back-link {
  display: inline-flex;
  color: var(--text-2);
  font-size: 12px;
  margin-bottom: 11px;
}
.back-link:hover {
  color: var(--accent);
}
.analysis-title-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.analysis-logo {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  object-fit: contain;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 5px;
}
.analysis-symbol {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}
.analysis-title-line h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.analysis-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.analysis-toolbar .source-status {
  margin-right: 4px;
}
.analysis-warning {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  margin: 0 0 15px;
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}
.analysis-warning .icon {
  width: 16px;
  height: 16px;
  flex: none;
}
.analysis-warning-muted {
  color: var(--text-2);
  background: var(--surface);
  border-color: var(--border);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 18px;
}
.analysis-summary-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.metric-card {
  min-width: 0;
  padding: 14px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.metric-card-primary {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: linear-gradient(145deg, var(--accent-soft), var(--surface) 72%);
}
.metric-label {
  display: block;
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
}
.metric-value {
  display: block;
  margin: 5px 0 3px;
  color: var(--text);
  font-size: 19px;
  font-weight: 650;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metric-card-primary .metric-value {
  font-size: 23px;
}
.metric-value small {
  font-size: 12px;
  font-weight: 500;
}
.metric-caption {
  display: block;
  min-height: 17px;
  color: var(--text-3);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compact-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.analysis-grid-wide {
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.7fr);
}
.analysis-grid > .card,
.analysis-grid > details {
  margin-bottom: 0;
}
.analysis-section {
  overflow: hidden;
}
.analysis-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
}
.analysis-section > summary::-webkit-details-marker {
  display: none;
}
.analysis-section > summary > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.analysis-section > summary h2 {
  color: var(--text);
}
.analysis-section > summary small {
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 400;
}
.analysis-section > summary:hover {
  background: var(--surface-2);
}
.analysis-section[open] > summary {
  border-bottom: 1px solid var(--border);
}
.summary-chevron {
  color: var(--text-3);
  font-size: 18px;
  transition: transform var(--speed);
}
.analysis-section[open] > summary .summary-chevron {
  transform: rotate(180deg);
}
.analysis-section-body {
  padding: 16px 18px 19px;
}
.analysis-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px 0;
}
.analysis-section-head .card-sub {
  padding: 0;
}
.analysis-badge {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}
.analysis-subsection {
  margin-top: 18px;
}
.analysis-subsection > h3,
.analysis-kv-card > h3 {
  margin: 0 0 10px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
}
.analysis-table-wrap,
.analysis-mini-table-wrap {
  overflow-x: auto;
}
.analysis-table {
  font-size: 12.5px;
}
.analysis-table th,
.analysis-table td {
  padding: 8px 10px;
}
.analysis-table th {
  font-size: 10px;
}
.analysis-table .cell-wrap {
  white-space: normal;
  min-width: 160px;
}
.analysis-chart-card {
  min-width: 0;
}
.analysis-chart-wrap {
  height: 205px;
  padding: 15px 18px 0;
}
.analysis-sparkline {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.spark-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.spark-area {
  fill: url(#chart-fill);
  stroke: none;
  opacity: 0.7;
}
.analysis-ohlcv-table {
  min-width: 620px;
}
.returns-card {
  min-width: 0;
}
.return-list {
  padding: 14px 18px 4px;
}
.return-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.return-row:last-child {
  border-bottom: 0;
}
.return-row span {
  color: var(--text-2);
}
.return-row strong {
  font-variant-numeric: tabular-nums;
}
.analysis-inline-note {
  margin: 11px 18px 7px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.analysis-index-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 18px 17px;
}
.analysis-index-list span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-2);
  font-size: 11px;
}
.analysis-index-list b {
  font-weight: 650;
}

.analysis-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 15px;
}
.analysis-kv-card {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.analysis-kv {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}
.analysis-kv > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.analysis-kv > div:last-child {
  border-bottom: 0;
}
.analysis-kv dt {
  color: var(--text-2);
  font-size: 11.5px;
}
.analysis-kv dd {
  max-width: 68%;
  margin: 0;
  color: var(--text);
  font-size: 12px;
  text-align: right;
  overflow-wrap: anywhere;
}
.compact-kv dd {
  font-variant-numeric: tabular-nums;
}
.signal-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 15px;
}
.signal-list {
  min-width: 0;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.signal-list h3 {
  margin: 0 0 7px;
  font-size: 12px;
}
.signal-list ul,
.analysis-list {
  padding-left: 18px;
  margin: 0;
  color: var(--text-2);
  font-size: 11.5px;
}
.signal-list li,
.analysis-list li {
  margin: 4px 0;
  overflow-wrap: anywhere;
}
.signal-list.pos h3 {
  color: var(--pos);
}
.signal-list.neg h3 {
  color: var(--neg);
}
.signal-list.accent h3 {
  color: var(--accent);
}
.analysis-text {
  margin: 15px 0 0;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.6;
}
.analysis-text p {
  margin: 5px 0;
}

.depth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}
.depth-side {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.depth-side h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
}
.depth-buy h3 {
  color: var(--pos);
  background: color-mix(in srgb, var(--pos) 8%, var(--surface));
}
.depth-sell h3 {
  color: var(--neg);
  background: color-mix(in srgb, var(--neg) 8%, var(--surface));
}
.depth-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 18px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-3);
  font-size: 10px;
}
.depth-side .analysis-table {
  margin: 0;
}
.nested-disclosure {
  margin-top: 15px;
  border-top: 1px solid var(--border);
}
.nested-disclosure > summary {
  padding: 11px 0 0;
  color: var(--text-2);
  cursor: pointer;
  font-size: 12px;
}
.analysis-list-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.analysis-list-columns > div > strong {
  color: var(--text-2);
  font-size: 11.5px;
}
.compact-list {
  max-height: 180px;
  overflow-y: auto;
}

.ratio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ratio-card {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.ratio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ratio-head strong {
  color: var(--text-2);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ratio-head span {
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.ratio-sparkline {
  display: block;
  width: 100%;
  height: 58px;
  margin: 8px 0 3px;
}
.ratio-card small {
  color: var(--text-3);
  font-size: 10px;
}
.analysis-news-list {
  padding-top: 4px;
}
.analysis-news {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.analysis-news:last-child {
  border-bottom: 0;
}
.analysis-news strong {
  display: block;
  color: var(--text);
  font-size: 12.5px;
}
.analysis-news p {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.45;
}
.analysis-news time {
  flex: 0 0 auto;
  color: var(--text-3);
  font-size: 10.5px;
  white-space: nowrap;
}
.raw-json {
  max-height: 520px;
  overflow: auto;
  margin: 13px 0 0;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-2);
  font:
    11px/1.55 "Cascadia Code",
    Consolas,
    monospace;
  tab-size: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.analysis-disclaimer {
  margin-top: 16px;
}

@media (max-width: 1200px) {
  .analysis-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .analysis-grid-wide {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .stock-analyze-row {
    align-items: stretch;
    flex-direction: column;
  }
  .stock-analyze-form {
    flex-basis: auto;
  }
  .analysis-hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .analysis-toolbar {
    justify-content: flex-start;
  }
  .analysis-summary-grid,
  .compact-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .analysis-grid,
  .analysis-detail-grid,
  .depth-grid {
    grid-template-columns: 1fr;
  }
  .signal-columns,
  .analysis-list-columns {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 430px) {
  .analysis-summary-grid,
  .compact-metrics,
  .ratio-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .metric-card {
    padding: 11px 10px;
  }
  .metric-value,
  .metric-card-primary .metric-value {
    font-size: 17px;
  }
  .analysis-section-body,
  .analysis-section-head {
    padding-left: 13px;
    padding-right: 13px;
  }
  .analysis-section > summary {
    padding-left: 13px;
    padding-right: 13px;
  }
  .analysis-news {
    flex-direction: column;
    gap: 4px;
  }
}
.day-today {
  color: var(--pos);
  font-weight: 700;
}
.cell-hours.hours-warn {
  color: var(--warn);
}
.hours-flag {
  display: inline-block;
  margin-left: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--warn);
}
body {
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
h1 {
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.7px;
}
.page-sub {
  font-size: 14px;
  color: var(--text-2);
}
.main {
  padding: 36px 36px 64px;
  min-width: 0;
}
.main-plain {
  padding: 0;
}
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding-top: 28px;
}
.brand {
  padding-bottom: 30px;
}
.brand-mark {
  color: var(--accent);
  background: transparent;
  border: none;
  outline: none;
}
.brand-name em {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 5px;
}
.nav-group-items {
  margin: 4px 0 18px;
  padding: 0;
  border: 0;
  display: grid;
  gap: 3px;
}
.nav-group-items .nav-item {
  padding: 10px 12px;
  font-size: 13px;
}
.nav-group summary {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}
.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: none;
}
.card-head {
  background: transparent;
  padding: 20px 22px;
}
.table th {
  font-size: 12px;
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 600;
}
.table td {
  font-size: 13px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.table tbody tr:hover {
  background: var(--surface-2);
}
.btn-primary {
  background: var(--button);
  color: #ffffff;
  border-color: var(--button);
}
.btn-primary:hover {
  background: var(--button-hover);
  color: #ffffff;
  border-color: var(--button-hover);
}
.portfolio-summary {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 0;
  padding: 26px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.balance-primary {
  padding: 0 24px;
  gap: 10px;
}
.balance-primary strong {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -1px;
  color: var(--text);
}
.balance-primary > span,
.balance-primary small {
  font-size: 12px;
  color: var(--text-2);
}
.balance-metrics {
  gap: 0;
}
.balance-metrics > div {
  padding: 6px 24px;
  border-left: 1px solid var(--border);
}
.balance-metrics dt {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 10px;
}
.balance-metrics dd {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
}
.section-disclosure {
  border-radius: var(--radius);
  background: var(--surface);
}
.table-edit input:not([type="checkbox"]),
.table-edit select {
  border-color: var(--border);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
}
.login-wrap {
  padding: 24px;
}
.calc-totals {
  border: 0;
  gap: 12px;
}
.calc-totals .stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
@media (max-width: 1100px) {
  .portfolio-summary {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .balance-metrics > div:first-child {
    border-left: 0;
  }
}
@media (max-width: 800px) {
  .main {
    padding: 24px 20px 48px;
  }
  .main-plain {
    padding: 0;
  }
}
@media (max-width: 540px) {
  h1 {
    font-size: 25px;
  }
  .page-sub {
    font-size: 13px;
  }
  .portfolio-summary {
    padding: 22px 0;
    gap: 22px;
  }
  .balance-primary {
    padding: 0 18px;
  }
  .balance-metrics {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 18px;
  }
  .balance-metrics > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0;
    border: 0;
  }
  .balance-metrics dt {
    min-height: 0;
    margin: 0;
    font-size: 12px;
  }
  .balance-metrics dd {
    font-size: 18px;
  }
  .login-card {
    padding: 26px;
  }
}
.inline {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  gap: 6px;
}

.nav-chevron {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: transform 0.16s ease;
}
.nav-group[open] .nav-chevron {
  transform: rotate(0);
}
.ipo-preferences {
  margin-bottom: 24px;
}
.amount-field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
.amount-field input {
  width: 100%;
}
.amount-field:has(.amount-warning:not([hidden])) input {
  padding-right: 28px;
  border-color: var(--warn);
}
.amount-warning {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--warn);
  font-size: 11px;
  font-weight: 700;
  cursor: help;
}
.price-flash {
  position: relative;
  display: inline-block;
  isolation: isolate;
  border-radius: 5px;
}
.price-flash-value {
  position: relative;
}
.price-flash-wave {
  position: absolute;
  inset: -5px -8px;
  pointer-events: none;
  border-radius: 6px;
  animation: price-wave 0.85s ease-out both;
}
.price-flash-up {
  background: color-mix(in srgb, var(--pos) 22%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--pos) 24%, transparent);
}
.price-flash-down {
  background: color-mix(in srgb, var(--neg) 22%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--neg) 24%, transparent);
}
@keyframes price-wave {
  from {
    opacity: 1;
    transform: scale(0.97);
  }
  to {
    opacity: 0;
    transform: scale(1.08);
  }
}
@media (prefers-reduced-motion: reduce) {
  .price-flash-wave {
    animation: none;
    opacity: 0.4;
  }
  .nav-chevron {
    transition: none;
  }
}
.table-edit .col-actions {
  min-width: 84px;
}
