html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
}

/* Shared top-action button theme */
.toolbar button,
.rule-toggle button,
.report-action-btn,
.page-header .back-btn,
.page-header .header-actions .btn {
    min-height: 40px !important;
    padding: 10px 15px !important;
    border: 1px solid #465674 !important;
    border-radius: 9px !important;
    color: #c7d2e5 !important;
    background: #273149 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.toolbar button:hover,
.rule-toggle button:hover,
.report-action-btn:hover,
.page-header .back-btn:hover,
.page-header .header-actions .btn:hover {
    color: #dce6f5 !important;
    background: #303d57 !important;
    border-color: #607394 !important;
}

body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

img,
canvas,
svg,
video,
iframe {
    max-width: 100%;
}

button,
input,
select,
textarea {
    max-width: 100%;
}

table{
			border:2px solid; border-collapse:collapse;
		}
		
th, td{border:1px solid silver;}

a:link {
	color: black;
	background-color: transparent;
	text-decoration: none;
}

a:visited {
	color: pink;
	background-color: transparent;
	text-decoration: none;
}

a:hover {
	color: red;
	background-color: transparent;
	text-decoration: underline;
}

a:active {
	color: yellow;
	background-color: transparent;
	text-decoration: underline;
}

#findLayer {
    position: fixed;
    top: 80px;
    right: 20px;

    background: white;
    border: 1px solid #ccc;
    border-radius: 5px;

    padding: 10px;
    z-index: 9999;

    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.find-hit {
   
}

.find-current {
    background: orange;
}

#loadingLayer {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.loading-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    background: rgba(255,255,255,0.8);
    padding: 20px 40px;
    border-radius: 10px;
    text-align: center;

    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.spinner {
    width: 40px;
    height: 40px;
    margin: auto;
    border: 5px solid #ddd;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

#companyPopup{
    display:none;
    position:fixed;
    left:0;
    top:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.4);
    z-index:9999;
}

.popup-content{
    position:absolute;
    left:50%;
    top:50%;
    transform:translate(-50%,-50%);
    width:min(800px, calc(100vw - 24px));
    max-height:80vh;
    overflow-y:auto;
    background:#fff;
    padding:20px;
    border-radius:10px;
}

.close-btn{
    float:right;
    cursor:pointer;
    font-size:20px;
}

#newsPopup {
    background: rgba(0,0,0,0.7);
}

.popup-content {
    background: #202123;
    color: #ececf1;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.stockTable{
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
}

.stockTable th{
    background:#202020;
    color:#dcdcdc;
}

.stockTable td{
    background:#202020;
    color:#dcdcdc;
}

.summary{
    width:60%;
    line-height:1.8;
    text-align:left;
}

.link-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 5px;
    color: #f8fafc !important;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    text-decoration: none;
    vertical-align: middle;
    box-shadow: none;
}

.link-action-icon.icon-chart {
    background: #2f9e73;
}

.link-action-icon.icon-list {
    background: #3f7dd8;
}

.link-action-icon.icon-group {
    background: #7a5ccf;
}

a:hover .link-action-icon {
    filter: brightness(1.12);
}

@media (max-width: 760px) {
    body {
        min-width: 0 !important;
    }

    .page-header,
    .content,
    .container,
    #container,
    #display,
    .page-footer,
    .table-panel,
    .chart-panel,
    .summary-grid,
    .chart-grid,
    .toolbar,
    .rule-toggle,
    .rule-box {
        width: 100% !important;
        max-width: 100% !important;
    }

    table {
        max-width: 100%;
    }

    th,
    td {
        word-break: keep-all;
    }

    .table-scroll,
    .table-host,
    #display,
    #display_buy,
    #display_sell {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .page-header,
    .toolbar,
    .rule-toggle,
    .page-footer {
        flex-wrap: wrap;
    }

    .popup-content {
        width: calc(100vw - 24px);
        padding: 14px;
    }

    .summary {
        width: 100%;
    }
}
