:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #dce1de;
  background: #0a0c0b;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 85% 0%, rgba(38, 70, 52, 0.16), transparent 34%),
    #0a0c0b;
}

button,
input {
  font: inherit;
}

button,
label {
  cursor: pointer;
}

.settings-shell {
  width: min(820px, calc(100% - 32px));
  margin: 0 auto;
  padding: 52px 0 36px;
}

.page-header,
.section-title,
.stock-row,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-header {
  margin-bottom: 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 17px;
}

.kicker {
  color: #667169;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.subtitle,
.section-title p,
.data-note {
  color: #6f7872;
  font-size: 11px;
}

.subtitle {
  margin-top: 7px;
}

.save-state {
  border: 1px solid #263029;
  border-radius: 999px;
  padding: 6px 10px;
  color: #6e8575;
  font-size: 10px;
}

.save-state.saving {
  color: #ad9860;
}

.settings-card {
  margin-bottom: 14px;
  padding: 22px;
  border: 1px solid #202522;
  border-radius: 15px;
  background: #101311;
}

.section-title p {
  margin-top: 5px;
}

.badge-preview {
  min-width: 37px;
  border-radius: 5px;
  padding: 3px 6px;
  color: #ffffff;
  background: #b83b36;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
}

.badge-preview.off {
  color: #69716c;
  background: #202522;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 17px;
}

.mode-option {
  display: flex;
  min-height: 62px;
  padding: 12px;
  border: 1px solid #282e2a;
  border-radius: 10px;
  align-items: center;
  gap: 10px;
  background: #141816;
}

.mode-option:has(input:checked) {
  border-color: #52645a;
  background: #19201c;
}

.mode-option input {
  accent-color: #778d7e;
}

.mode-option strong,
.mode-option small {
  display: block;
}

.privacy-option {
  display: flex;
  min-height: 54px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid #282e2a;
  border-radius: 10px;
  align-items: center;
  justify-content: space-between;
  background: #141816;
}

.privacy-option > span {
  margin: 0;
}

.privacy-option strong,
.privacy-option small {
  display: block;
}

.privacy-option strong {
  color: #dce1de;
  font-size: 12px;
}

.privacy-option small {
  margin-top: 3px;
  color: #6e7771;
  font-size: 9px;
}

.privacy-option input {
  width: 16px;
  height: 16px;
  accent-color: #778d7e;
}

.mode-option strong {
  font-size: 12px;
}

.mode-option small {
  margin-top: 3px;
  color: #6e7771;
  font-size: 9px;
}

.portfolio-title {
  margin-bottom: 18px;
}

.stock-form {
  display: grid;
  grid-template-columns: 1fr 1.25fr 0.8fr 0.8fr;
  gap: 11px;
  padding: 15px;
  border: 1px solid #242a26;
  border-radius: 11px;
  background: #0c0f0d;
}

label > span {
  display: block;
  margin-bottom: 6px;
  color: #7a837d;
  font-size: 10px;
  font-weight: 650;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  height: 37px;
  border: 1px solid #29302b;
  border-radius: 8px;
  outline: none;
  padding: 0 10px;
  color: #e0e4e1;
  background: #141816;
}

input:focus {
  border-color: #586b5f;
  box-shadow: 0 0 0 3px rgba(88, 107, 95, 0.12);
}

input:read-only {
  color: #7a837d;
  cursor: default;
}

.form-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 8px;
}

.data-consent {
  display: flex;
  grid-column: 1 / -1;
  align-items: flex-start;
  gap: 8px;
  color: #879089;
  font-size: 10px;
  line-height: 1.6;
}

.data-consent input {
  flex: 0 0 auto;
  margin-top: 2px;
}

.data-consent span {
  margin: 0;
  color: inherit;
  font: inherit;
}

.data-consent a {
  color: #9bb8a4;
}

.primary-button,
.secondary-button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 13px;
  font-size: 10px;
  font-weight: 750;
}

.primary-button {
  color: #0d120f;
  background: #aebcaf;
}

.secondary-button {
  color: #879089;
  border-color: #2d342f;
  background: transparent;
}

.form-error {
  grid-column: 1 / -1;
  min-height: 14px;
  color: #d65a54;
  font-size: 10px;
  text-align: right;
}

.stock-list {
  margin-top: 14px;
  border-top: 1px solid #222724;
}

.stock-row {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr 0.8fr 1fr auto;
  gap: 16px;
  min-height: 65px;
  border-bottom: 1px solid #1d221f;
}

.row-identity strong,
.row-identity span,
.row-value strong,
.row-value span {
  display: block;
}

.row-identity strong,
.row-value strong {
  font-size: 11px;
}

.row-identity span,
.row-value span {
  margin-bottom: 4px;
  color: #68716b;
  font-size: 9px;
}

.row-code {
  margin-top: 4px;
  text-transform: uppercase;
}

.row-actions {
  text-align: right;
}

.text-button {
  border: 0;
  padding: 5px;
  color: #79837c;
  background: transparent;
  font-size: 9px;
}

.danger-button {
  color: #9c5551;
}

.empty-state {
  margin-top: 14px;
  padding: 24px;
  border: 1px dashed #29302b;
  border-radius: 10px;
  color: #69716c;
  text-align: center;
  font-size: 10px;
}

.empty-state[hidden] {
  display: none;
}

.data-note {
  padding: 5px 3px;
}

@media (max-width: 680px) {
  .settings-shell {
    padding-top: 24px;
  }

  .mode-grid,
  .stock-form {
    grid-template-columns: 1fr;
  }

  .form-actions,
  .form-error {
    grid-column: 1;
  }

  .stock-row {
    grid-template-columns: 1fr 1fr;
    padding: 12px 0;
  }

  .row-actions {
    grid-column: 1 / -1;
    text-align: left;
  }
}
