/*
 * 2000년대 후반 대한민국 공공기관 증권 전산망을 모티프로 한 화면 주제.
 * 거래 로직과 DOM 식별자는 그대로 두고 외형과 정보 밀도만 조정한다.
 */

:root {
  color-scheme: light;
  --bg: #fff;
  --surface: #fff;
  --surface-soft: #f5f5f5;
  --surface-blue: #edf5f8;
  --text: #333;
  --text-2: #555;
  --muted: #777;
  --line: #d1d1d1;
  --accent: #0b6f9f;
  --accent-strong: #07577f;
  --accent-soft: #e9f2f6;
  --up: #d71920;
  --up-soft: #fff0f0;
  --down: #125aa7;
  --down-soft: #eef5ff;
  --good: #25835f;
  --warning: #b17413;
  --danger: #c3272f;
  --shadow: none;
  --radius: 2px;
  --radius-sm: 2px;
  --font: "돋움", Dotum, "굴림", Gulim, Arial, sans-serif;
  --chart-grid: #dce3e7;
  --chart-label: #777;
  --chart-up: #d71920;
  --chart-down: #125aa7;
  --chart-flat: #777;
  --chart-point-ring: #fff;
}

html {
  scroll-behavior: auto;
  background: #e9e9e9;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .3) 0 1px, transparent 1px 4px),
    #e9e9e9;
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.5;
  -webkit-font-smoothing: auto;
  text-rendering: auto;
}

body::before,
body::after {
  display: none;
}

button,
input,
select {
  color-scheme: light;
  font-family: var(--font);
}

input::placeholder {
  color: #999;
}

* {
  scrollbar-color: #a8b5bb #f1f1f1;
  scrollbar-width: thin;
}

::selection {
  background: #cce6f2;
  color: #222;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #e89a2f;
  outline-offset: 1px;
}

.skip-link {
  left: 50%;
  top: -40px;
  border-radius: 0;
  padding: 5px 10px;
  background: #333;
  font-size: 11px;
  transform: translateX(-590px);
}

.skip-link:focus {
  top: 0;
}

.app-header,
.page {
  width: min(1200px, 100%);
  max-width: none;
  margin-right: auto;
  margin-left: auto;
  border-right: 1px solid #d0d0d0;
  border-left: 1px solid #d0d0d0;
}

.app-header {
  position: relative;
  top: auto;
  z-index: 100;
  height: auto;
  border-bottom: 0;
  background: #fff;
  box-shadow: none;
  backdrop-filter: none;
}

.legacy-system-banner {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 20px;
  border-top: 1px solid #d8cf9a;
  border-bottom: 1px solid #d8cf9a;
  background: #fffce6;
  color: #6f6234;
  font-size: 11px;
}

.legacy-system-banner span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legacy-system-banner i {
  width: 5px;
  height: 5px;
  display: inline-block;
  background: #e7902c;
  transform: rotate(45deg);
}

.legacy-utility {
  min-height: 27px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  padding: 0 20px;
  background: #fff;
  color: #777;
  font-size: 11px;
}

.legacy-utility span,
.legacy-utility a {
  position: relative;
  padding: 0 9px;
  color: #777;
  text-decoration: none;
}

.legacy-utility span + span::before,
.legacy-utility a::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 0;
  width: 1px;
  height: 9px;
  background: #ccc;
}

.header-inner {
  width: calc(100% - 40px);
  max-width: none;
  height: 70px;
  margin: 0 auto;
  padding: 0;
  gap: 18px;
}

.brand {
  gap: 10px;
  min-width: max-content;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.brand-mark img {
  width: 46px;
  height: 46px;
}

.brand-copy {
  line-height: 1.12;
}

.brand-copy strong {
  color: #155f82;
  font-family: "굴림", Gulim, "돋움", Dotum, sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -1.2px;
}

.brand-copy span {
  margin-top: 5px;
  color: #777;
  font-family: Arial, sans-serif;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .08em;
}

.global-search {
  width: 280px;
  margin-left: auto;
}

.global-search input {
  height: 26px;
  border: 2px solid #1b789e;
  border-radius: 0;
  background: #fff;
  padding: 0 48px 0 7px;
  color: #333;
  font-size: 11px;
  transition: none;
}

.global-search input:focus {
  border-color: #0a5b82;
  background: #fff;
  box-shadow: none;
}

.search-icon {
  display: none;
}

.shortcut {
  top: 2px;
  right: 2px;
  border: 0;
  border-radius: 0;
  padding: 3px 9px;
  background: linear-gradient(#1684b7, #076892);
  color: #fff;
  font-size: 10px;
}

.auth-area {
  min-width: max-content;
}

.login-btn,
.primary-btn,
.ghost-btn,
.danger-btn {
  border-radius: 0;
  font-weight: 700;
  transition: none;
}

.login-btn {
  height: 27px;
  border: 1px solid #07567f;
  padding: 0 12px;
  background: linear-gradient(#1684b7, #076892);
  color: #fff;
  font-size: 11px;
}

.login-btn:hover,
.primary-btn:hover {
  transform: none;
  filter: none;
  background: linear-gradient(#0874a3, #055a82);
}

.top-nav {
  width: 100%;
  height: 37px;
  display: grid;
  grid-template-columns: repeat(3, 170px) 190px 1fr;
  align-items: stretch;
  gap: 0;
  border-top: 1px solid #0c608c;
  border-bottom: 1px solid #075478;
  padding-left: 20px;
  background: linear-gradient(#1381b2 0%, #0873a4 52%, #086792 53%, #075f88 100%);
}

.nav-btn,
.nav-link {
  min-height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, .17);
  border-left: 1px solid rgba(0, 48, 78, .2);
  border-radius: 0;
  background: transparent;
  padding: 0 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  text-shadow: 0 1px rgba(0, 42, 68, .45);
  cursor: pointer;
}

.nav-btn:first-child {
  border-left: 0;
}

.nav-btn:hover,
.nav-btn.active,
.nav-link:hover {
  background: linear-gradient(#08638f, #064f76);
  color: #fff;
  text-decoration: none;
}

.page {
  min-height: 620px;
  padding: 10px 20px 35px;
  background: #fff;
}

.legacy-page-heading {
  min-height: 57px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 2px solid #4a849f;
  padding: 0 2px 8px;
}

.legacy-page-heading span {
  display: block;
  margin-bottom: 4px;
  color: #888;
  font-size: 10px;
}

.legacy-page-heading h1 {
  margin: 0;
  color: #333;
  font-family: "굴림", Gulim, sans-serif;
  font-size: 18px;
  letter-spacing: -1px;
}

.legacy-page-heading p {
  margin: 0;
  color: #777;
  font-size: 11px;
}

.legacy-page-heading p strong {
  color: #17688f;
}

.paper-notice {
  margin: 8px 0;
  border: 1px solid #d9d0a3;
  border-radius: 0;
  padding: 7px 10px;
  background: #fffdeb;
  color: #6c633d;
  font-size: 11px;
  line-height: 1.45;
}

.paper-notice strong {
  color: #4d472d;
}

.paper-notice button {
  border-left: 1px solid #d9d0a3;
  padding-left: 10px;
  color: #756929;
  font-size: 11px;
}

.market-layout {
  grid-template-columns: 238px minmax(460px, 1fr) 286px;
  gap: 8px;
}

.panel {
  border: 1px solid #c9c9c9;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.market-list-panel,
.order-panel {
  top: 8px;
  max-height: calc(100vh - 16px);
}

.panel-head {
  padding: 0 8px 8px;
}

.panel-title-row {
  height: 32px;
  margin: 0 -8px 8px;
  border-bottom: 1px solid #0b5d84;
  padding: 0 9px;
  background: linear-gradient(#1684b7, #076892);
}

.panel-title {
  color: #fff;
  font-size: 12px;
  letter-spacing: 0;
  text-shadow: 0 1px #064263;
}

.market-state {
  color: #e8f7ff;
  font-size: 10px;
  font-weight: 400;
}

.market-state.open {
  color: #fff;
}

.state-dot,
.market-state.open .state-dot {
  width: 6px;
  height: 6px;
  border-radius: 0;
  background: #f2b33f;
  box-shadow: none;
  transform: rotate(45deg);
}

.market-state.open .state-dot {
  background: #8cdb9d;
}

.list-search {
  margin-top: 0;
}

.list-search span {
  display: none;
}

.list-search input {
  height: 25px;
  border: 1px solid #bbb;
  border-radius: 0;
  background: #fafafa;
  padding: 0 6px;
  color: #444;
  font-size: 11px;
}

.list-search input:focus {
  border-color: #4182a4;
  background: #fff;
  box-shadow: none;
}

.index-card {
  margin: 0 8px 7px;
  border: 1px solid #155a7c;
  border-radius: 0;
  padding: 9px 10px;
  background: linear-gradient(135deg, #266f91, #164e6b);
  box-shadow: inset 0 1px rgba(255, 255, 255, .16);
}

.index-card:hover,
.index-card.active {
  outline: 0;
  background: linear-gradient(135deg, #1d617f, #103f59);
  box-shadow: inset 0 1px rgba(255, 255, 255, .16);
}

.index-card small {
  color: #dceef5;
  font-size: 10px;
  font-weight: 400;
}

.index-main {
  margin-top: 5px;
}

.index-main strong {
  font-size: 17px;
}

.instrument-list {
  padding: 0 8px 8px;
}

.instrument {
  min-height: 48px;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  gap: 7px;
  border-top: 1px dotted #ccc;
  border-radius: 0;
  padding: 6px 2px;
}

.instrument:first-child {
  border-top: 0;
}

.instrument:hover {
  background: #f5f8f9;
}

.instrument.active {
  background: #e8f2f6;
}

.instrument-logo,
.instrument.active .instrument-logo {
  width: 29px;
  height: 29px;
  border: 1px solid #cad6dc;
  border-radius: 2px;
  background: linear-gradient(#fff, #e8eef1);
  color: #37677b;
  font-size: 9px;
}

.instrument-copy strong {
  font-size: 12px;
}

.instrument-copy span,
.instrument-price span {
  margin-top: 2px;
  font-size: 10px;
}

.instrument-price strong {
  font-size: 11px;
}

.up {
  color: var(--up) !important;
}

.down {
  color: var(--down) !important;
}

.flat {
  color: #777 !important;
}

.quote-panel {
  min-height: 650px;
}

.quote-head {
  padding: 0 12px 9px;
}

.quote-head::before {
  content: "종목 시세정보";
  height: 32px;
  display: flex;
  align-items: center;
  margin: 0 -12px 10px;
  border-bottom: 1px solid #c5d4db;
  padding: 0 10px;
  background: linear-gradient(#f9fbfc, #e7eef2);
  color: #285d76;
  font-size: 12px;
  font-weight: 700;
}

.quote-identity {
  gap: 9px;
}

.quote-logo {
  width: 38px;
  height: 38px;
  border: 1px solid #c5d1d6;
  border-radius: 2px;
  background: linear-gradient(#fff, #e9eef1);
  color: #477083;
  font-size: 11px;
}

.quote-name h1 {
  color: #333;
  font-size: 16px;
  letter-spacing: -.6px;
}

.quote-name p {
  margin-top: 3px;
  color: #777;
  font-size: 10px;
}

.quote-price {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dotted #ccc;
}

.quote-price strong {
  font-family: Tahoma, Arial, sans-serif;
  font-size: 27px;
  letter-spacing: -1px;
}

.quote-change {
  margin-top: 4px;
  font-size: 11px;
}

.status-chip {
  border: 1px solid #c9d5da;
  border-radius: 0;
  padding: 2px 5px;
  background: #f2f6f7;
  color: #555;
  font-size: 9px;
  font-weight: 400;
}

.status-chip.paused {
  border-color: #dbc98e;
  background: #fff9df;
  color: #7b641b;
}

.chart-controls {
  min-height: 34px;
  border-top: 1px solid #d4d4d4;
  border-bottom: 1px solid #d4d4d4;
  padding: 4px 10px;
  background: #f6f6f6;
}

.range-tabs {
  gap: 2px;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.range-btn {
  min-width: 42px;
  border: 1px solid #c6c6c6;
  border-radius: 0;
  padding: 4px 7px;
  background: #fff;
  color: #666;
  font-size: 10px;
}

.range-btn:hover,
.range-btn.active {
  border-color: #24769b;
  background: linear-gradient(#3d92b7, #14709a);
  color: #fff;
  box-shadow: none;
}

.chart-updated {
  color: #888;
  font-size: 10px;
}

.chart-wrap {
  height: 300px;
  margin: 5px 7px 0;
  background: #fff;
}

.chart-tooltip {
  min-width: 110px;
  border: 1px solid #777;
  border-radius: 0;
  padding: 6px 8px;
  background: #fffff4;
  color: #333;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .12);
  font-size: 10px;
}

.quote-stats {
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 5px 10px 12px;
}

.quote-stat {
  min-width: 0;
  border: 1px solid #d4d4d4;
  border-left: 0;
  border-radius: 0;
  padding: 7px 8px;
  background: #fafafa;
}

.quote-stat:first-child {
  border-left: 1px solid #d4d4d4;
}

.quote-stat span {
  color: #777;
  font-size: 10px;
}

.quote-stat strong {
  margin-top: 4px;
  font-size: 11px;
}

.recent-section {
  border-top: 2px solid #4a849f;
  padding: 10px 12px 14px;
}

.section-head {
  margin-bottom: 6px;
}

.section-head h2 {
  color: #333;
  font-size: 13px;
}

.text-btn {
  color: #17688f;
  font-size: 10px;
  font-weight: 400;
  text-decoration: underline;
}

.trade-row {
  grid-template-columns: 50px 1fr 1fr 1.25fr;
  gap: 7px;
  border-bottom: 1px dotted #ccc;
  padding: 7px 2px;
  font-size: 11px;
}

.trade-time {
  color: #888;
  font-size: 10px;
}

.order-panel {
  padding-bottom: 10px;
}

.order-top {
  padding: 0;
}

.order-tabs {
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: 0;
  padding: 0;
  background: #e7ecef;
}

.order-tab {
  height: 34px;
  border: 0;
  border-bottom: 1px solid #bbb;
  border-radius: 0;
  background: linear-gradient(#fafafa, #e3e3e3);
  color: #666;
  font-size: 12px;
}

.order-tab + .order-tab {
  border-left: 1px solid #bbb;
}

.order-tab.buy.active,
.order-tab.sell.active {
  border-bottom-color: #8c2027;
  background: linear-gradient(#e9545b, #c92a32);
  color: #fff;
  box-shadow: none;
}

.order-tab.sell.active {
  border-bottom-color: #184d87;
  background: linear-gradient(#3e82c8, #1e5d9d);
}

.order-body {
  padding: 10px 10px 0;
}

.order-type {
  border-bottom: 1px dotted #c9c9c9;
  padding: 7px 2px;
}

.order-type span,
.order-type strong,
.field-label {
  font-size: 11px;
}

.order-field {
  margin-top: 12px;
}

.field-label {
  margin-bottom: 5px;
}

.quantity-box {
  grid-template-columns: 34px 1fr 34px;
  height: 33px;
  border: 1px solid #aaa;
  border-radius: 0;
  background: #fff;
}

.quantity-box button,
.quantity-box button:hover {
  border-radius: 0;
  background: linear-gradient(#fff, #e5e5e5);
  color: #333;
  font-size: 16px;
}

.quantity-box input {
  border-right: 1px solid #ccc;
  border-left: 1px solid #ccc;
  background: #fff;
  color: #333;
  font-size: 12px;
}

.quick-grid {
  gap: 3px;
  margin-top: 5px;
}

.quick-btn {
  height: 26px;
  border: 1px solid #bbb;
  border-radius: 0;
  background: linear-gradient(#fff, #ededed);
  color: #555;
  font-size: 10px;
}

.quick-btn:hover {
  border-color: #6e9cb0;
  background: #eef6f9;
}

.estimate {
  margin-top: 11px;
  border: 1px solid #d1d1d1;
  border-radius: 0;
  padding: 9px;
  background: #f8f8f8;
}

.estimate-row {
  margin-bottom: 7px;
  font-size: 10px;
}

.estimate-row:last-child {
  border-top: 1px solid #cfcfcf;
  padding-top: 7px;
}

.estimate-row strong {
  font-size: 11px;
}

.order-submit {
  height: 38px;
  margin-top: 10px;
  border: 1px solid #a51d25;
  border-radius: 0;
  background: linear-gradient(#e95159, #c72831);
  font-size: 12px;
}

.order-submit.sell {
  border-color: #154c85;
  background: linear-gradient(#4387cb, #1e5e9f);
}

.order-submit:disabled {
  border-color: #aaa;
  background: linear-gradient(#ddd, #bbb);
  color: #777;
}

.order-caption {
  margin-top: 8px;
  color: #888;
  font-size: 9px;
}

.login-card,
.link-card {
  margin: 10px 10px 0;
  border: 1px solid #b9ccd5;
  border-radius: 0;
  padding: 12px;
  background: #eef5f8;
}

.login-card strong,
.link-card strong {
  color: #285d76;
  font-size: 12px;
}

.login-card p,
.link-card p {
  color: #666;
  font-size: 10px;
}

.link-card a {
  height: 29px;
  border: 1px solid #07567f;
  border-radius: 0;
  background: linear-gradient(#1684b7, #076892);
  font-size: 11px;
}

.account-hero {
  gap: 8px;
}

.asset-card,
.profile-card,
.holdings-panel,
.history-panel,
.login-methods-card {
  padding: 14px;
}

.eyebrow {
  color: #17688f;
  font-size: 10px;
}

.total-assets {
  margin: 8px 0 4px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 28px;
}

.asset-change {
  font-size: 11px;
}

.asset-breakdown {
  gap: 0;
  margin-top: 14px;
}

.asset-box {
  border: 1px solid #d3d3d3;
  border-left: 0;
  border-radius: 0;
  padding: 9px;
  background: #fafafa;
}

.asset-box:first-child {
  border-left: 1px solid #d3d3d3;
}

.asset-box span,
.asset-box strong {
  font-size: 10px;
}

.profile-line .avatar,
.avatar {
  border: 1px solid #aaa;
  border-radius: 2px;
  background: #58719a;
}

.roblox-link {
  margin-top: 12px;
  border: 1px solid #d3d3d3;
  border-radius: 0;
  padding: 9px;
  background: #f7f7f7;
  font-size: 10px;
}

.holdings-panel,
.history-panel {
  margin-top: 8px;
}

.holdings-table th,
.history-table th {
  border-top: 2px solid #4a849f;
  border-bottom: 1px solid #aaa;
  padding: 7px 6px;
  background: #eef3f5;
  color: #555;
  font-size: 10px;
}

.holdings-table td,
.history-table td {
  border-bottom: 1px solid #ddd;
  padding: 8px 6px;
  color: #444;
  font-size: 11px;
}

.holding-name .instrument-logo {
  width: 28px;
  height: 28px;
  border-radius: 2px;
}

.history-toolbar h1,
.login-methods-head h1 {
  color: #333;
  font-size: 16px;
}

.filter-group {
  gap: 0;
  border: 1px solid #bbb;
  border-radius: 0;
  padding: 0;
  background: #fff;
}

.filter-btn {
  border-left: 1px solid #ccc;
  border-radius: 0;
  padding: 5px 10px;
  background: linear-gradient(#fff, #ededed);
  color: #666;
  font-size: 10px;
}

.filter-btn:first-child {
  border-left: 0;
}

.filter-btn.active {
  background: #287ca2;
  color: #fff;
  box-shadow: none;
}

.empty-state {
  padding: 30px 12px;
  color: #777;
  font-size: 11px;
}

.empty-state strong {
  color: #555;
  font-size: 12px;
}

.site-footer {
  margin-top: 18px;
  border-top: 1px solid #bbb;
  padding: 15px 2px 0;
  color: #777;
  font-size: 10px;
}

.site-footer a {
  color: #666;
  font-weight: 400;
}

.user-menu {
  border: 1px solid #bbb;
  border-radius: 0;
  padding: 2px 7px 2px 3px;
  background: linear-gradient(#fff, #ededed);
  color: #444;
  box-shadow: none;
}

.user-menu:hover,
.user-menu[aria-expanded="true"] {
  border-color: #5f8ca0;
  background: #eef6f9;
}

.user-menu .avatar {
  width: 25px;
  height: 25px;
}

.user-name {
  font-size: 10px;
}

.user-menu-chevron {
  color: #777;
}

.user-dropdown {
  top: calc(100% + 3px);
  width: 190px;
  border: 1px solid #777;
  border-radius: 0;
  padding: 4px;
  background: #fff;
  color: #333;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .14);
}

.user-dropdown-head {
  border-bottom-color: #ccc;
}

.user-dropdown-head strong {
  color: #333;
}

.user-dropdown button {
  height: 30px;
  border-radius: 0;
  color: #444;
  font-size: 10px;
}

.user-dropdown button:hover {
  background: #eaf2f5;
  color: #222;
}

.user-dropdown button.danger {
  color: #b21f28;
}

.user-dropdown button.danger:hover {
  background: #fff0f0;
  color: #a11820;
}

.login-methods-head {
  margin-bottom: 10px;
}

.login-methods-head p {
  color: #777;
  font-size: 10px;
}

.method-status {
  border: 1px solid #8fb2c1;
  border-radius: 0;
  padding: 3px 6px;
  background: #edf5f8;
  color: #285d76;
  font-size: 9px;
}

.method-status::before {
  width: 5px;
  height: 5px;
  border-radius: 0;
  background: #37916c;
  box-shadow: none;
  transform: rotate(45deg);
}

.login-method-list {
  gap: 5px;
}

.login-method-row {
  border: 1px solid #d1d1d1;
  border-radius: 0;
  padding: 9px 10px;
  background: #fafafa;
}

.login-method-icon,
.login-method-icon.email {
  width: 31px;
  height: 31px;
  flex-basis: 31px;
  border: 1px solid #9fb4bd;
  border-radius: 2px;
  background: #eaf2f5;
  color: #2d647b;
  font-size: 11px;
}

.method-action {
  height: 28px;
  border: 1px solid #aaa;
  border-radius: 0;
  background: linear-gradient(#fff, #e8e8e8);
  color: #444;
  font-size: 10px;
}

.method-action:hover {
  background: #eef6f9;
  color: #222;
}

.email-register-panel {
  border: 1px solid #9ebac7;
  border-radius: 0;
  padding: 12px;
  background: #f1f7f9;
}

.auth-field label {
  color: #555;
  font-size: 10px;
}

.auth-field input {
  height: 32px;
  border: 1px solid #aaa;
  border-radius: 0;
  background: #fff;
  color: #333;
}

.auth-field input:focus {
  border-color: #24769b;
  box-shadow: none;
}

.auth-field input[aria-invalid="true"] {
  border-color: #c3272f;
  box-shadow: none;
}

.auth-form-actions .primary-btn,
.auth-form-actions .ghost-btn,
.primary-btn,
.ghost-btn {
  height: 30px;
  border: 1px solid #07567f;
  border-radius: 0;
  background: linear-gradient(#1684b7, #076892);
  color: #fff;
  font-size: 10px;
}

.ghost-btn {
  border-color: #aaa;
  background: linear-gradient(#fff, #e6e6e6);
  color: #444;
}

.auth-resend {
  color: #17688f;
  font-size: 10px;
}

.modal-backdrop {
  background: rgba(0, 0, 0, .52);
  backdrop-filter: none;
}

.modal {
  border: 2px solid #3e7187;
  border-radius: 0;
  padding: 18px;
  background: #fff;
  color: #333;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .18);
}

.modal h2,
.auth-modal-head h2 {
  color: #285d76;
  font-size: 16px;
}

.modal p {
  color: #666;
  font-size: 11px;
}

.confirm-summary {
  border: 1px solid #ccc;
  border-radius: 0;
  padding: 11px;
  background: #f7f7f7;
}

.modal-close,
.auth-back {
  border: 1px solid #aaa;
  border-radius: 0;
  background: linear-gradient(#fff, #e4e4e4);
  color: #444;
}

.modal-close:hover {
  background: #eee;
  color: #222;
}

.auth-choice {
  border: 1px solid #bbb;
  border-radius: 0;
  padding: 10px;
  background: #fafafa;
}

.auth-choice:hover {
  border-color: #5f8ca0;
  background: #eef6f9;
  transform: none;
}

.auth-choice-mark,
.auth-choice-mark.email {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 2px;
  background: #346f9e;
  font-size: 11px;
}

.auth-choice-mark.email {
  background: #34765d;
}

.auth-choice-copy strong {
  color: #333;
  font-size: 11px;
}

.auth-choice-copy span,
.auth-modal-footer,
.form-message,
.otp-sent-copy {
  color: #777;
  font-size: 10px !important;
}

.toast {
  border: 2px solid #555;
  border-radius: 0;
  padding: 10px 12px;
  background: #333;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .18);
  font-size: 11px;
}

.toast.success {
  border-color: #276e54;
  background: #34765d;
}

.toast.error {
  border-color: #8e1c23;
  background: #ad2830;
}

.mobile-nav {
  height: 48px;
  border-top: 2px solid #075478;
  background: #fff;
  backdrop-filter: none;
}

.mobile-nav button {
  border-left: 1px solid #ccc;
  color: #666;
  font-size: 10px;
}

.mobile-nav button:first-child {
  border-left: 0;
}

.mobile-nav button span {
  display: none;
}

.mobile-nav button.active {
  background: linear-gradient(#1684b7, #076892);
  color: #fff;
}

@media (max-width: 1180px) {
  .market-layout {
    grid-template-columns: 220px minmax(430px, 1fr) 270px;
  }

  .global-search {
    display: block;
  }
}

@media (max-width: 1020px) {
  .legacy-system-banner,
  .legacy-utility,
  .header-inner,
  .page {
    padding-right: 12px;
    padding-left: 12px;
  }

  .header-inner {
    width: 100%;
  }

  .top-nav {
    padding-left: 0;
    grid-template-columns: repeat(4, 1fr);
  }

  .market-layout {
    grid-template-columns: 218px minmax(0, 1fr);
  }

  .order-panel {
    position: relative;
    top: auto;
    grid-column: 1 / -1;
    max-height: none;
  }

  .top-nav {
    display: grid;
  }

  .mobile-nav {
    display: none;
  }
}

@media (max-width: 760px) {
  .legacy-system-banner {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .legacy-system-banner span:last-child,
  .legacy-utility {
    display: none;
  }

  .header-inner {
    height: 60px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-mark img {
    width: 37px;
    height: 37px;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .brand-copy span {
    font-size: 8px;
  }

  .global-search {
    display: none;
  }

  .top-nav {
    height: 35px;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    overflow-x: auto;
  }

  .nav-btn,
  .nav-link {
    min-height: 33px;
    font-size: 11px;
  }

  .page {
    padding: 8px 8px 62px;
  }

  .legacy-page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    min-height: 0;
    padding: 5px 1px 7px;
  }

  .legacy-page-heading p {
    display: none;
  }

  .market-layout {
    display: block;
  }

  .market-list-panel,
  .order-panel {
    position: relative;
    top: auto;
    max-height: none;
    margin-bottom: 7px;
  }

  .instrument-list {
    display: flex;
    gap: 4px;
    padding: 0 7px 7px;
    overflow-x: auto;
  }

  .instrument {
    min-width: 165px;
    grid-template-columns: 30px 1fr;
    border: 1px solid #d1d1d1;
    padding: 6px;
  }

  .instrument-price {
    grid-column: 2;
    display: flex;
    gap: 7px;
    text-align: left;
  }

  .quote-panel {
    min-height: 0;
    margin-bottom: 7px;
  }

  .chart-wrap {
    height: 270px;
  }

  .quote-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .quote-stat:nth-child(3) {
    border-left: 1px solid #d4d4d4;
  }

  .account-hero {
    grid-template-columns: 1fr;
  }

  .asset-card,
  .profile-card,
  .holdings-panel,
  .history-panel,
  .login-methods-card {
    padding: 10px;
  }

  .mobile-nav {
    display: flex;
  }

  .toast-region {
    right: 10px;
    bottom: 58px;
  }
}

@media (max-width: 480px) {
  .brand-copy span {
    display: none;
  }

  .brand-copy strong {
    font-size: 13px;
  }

  .auth-area .login-btn {
    padding: 0 8px;
  }

  .paper-notice {
    align-items: flex-start;
  }

  .quote-head {
    padding-right: 9px;
    padding-left: 9px;
  }

  .chart-controls {
    overflow-x: auto;
  }

  .range-tabs {
    min-width: max-content;
  }
}

/* Keep typography aligned with the compact portal reference. */
* {
  letter-spacing: 0 !important;
}
