 * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #071428 0%, #04121a 100%);
    color: #e6eef8;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.topbar {
    height: 60px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #172840;
    border-bottom: 1px solid #30363d;
    position: relative;
    flex-shrink: 0;
    z-index: 2000;
    box-shadow: 0 2px 8px rgba(2,6,23,0.4);
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon img {
    width: 60px;
    height: 50px;
    object-fit: contain;
}

.brand h1 {
    font-size: 18px;
    font-weight: 600;
    color: #f0f6fc;
    letter-spacing: -0.01em;
}

.topbar-actions {
    display: flex;
    align-items: center;
}

.header-button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 7px;
    background-color: transparent;
    color: #8b949e;
    cursor: pointer;
}
.header-button img {
    width: 18px;
    height: 18px;
    border-radius: 30px;
    object-fit: contain;
}

.header-button:hover {
    background: #21262d;
    color: #f0f6fc;
    border-color: rgba(255,255,255,0.05);
    border-radius: 7px;
}

main {
    display: flex;
    flex: 1;
    height: calc(100vh - 60px);
    min-height: 0;
    overflow: hidden;
}

.toolbar {
    width: 260px;
    min-width: 240px;
    height: 100%;
    padding: 18px 14px;
    background-color: #071726;
    border-right: 1px solid rgba(255,255,255,0.02);
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    scrollbar-width: thin;
    scrollbar-color: #6e7681 transparent;
}

.toolbar::-webkit-scrollbar {
    width: 6px;
}

.toolbar::-webkit-scrollbar-track {
    background: transparent;
}

.toolbar::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 10px;
}

.toolbar::-webkit-scrollbar-thumb:hover {
    background: #6e7681;
}

.toolbar-header {
    margin-bottom: 20px;
    padding: 0 4px;

}

.toolbar-header h2 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #f0f6fc;
}

.search-box{
  margin-bottom: 15px;
}
.search-box input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(13, 17, 23, 0.75);
    color: #f0f6fc;
    border: 1px solid #30363d;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}
.search-box input::placeholder {
    color: #6f7b8c;
}

.search-box input:hover {
    border-color: #484f58;
}

.search-box input:focus {
    border-color: #58a6ff;
    background-color: #0d1117;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.08);
}
.search-hidden {
    display: none !important;
}
.search-empty {
    margin: 12px 0;
    color: #8b949e;
    font-size: 13px;
}

.tool-category {
    margin-bottom: 24px;
}



.tool-category h3 {
    margin-bottom: 8px;
    color: #9aa6b3;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.tool-category button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 40px;
    padding: 10px 12px;
    margin-bottom: 6px;
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: 8px;
    background-color: transparent;
    color: #d3dbe6;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    transition:
        background-color 0.12s ease,
        color 0.12s ease,
        border-color 0.12s ease,
        transform 0.08s ease;
}


.tool-category button:hover {
    background-color: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.04);
    color: #ffffff;
    transform: translateX(2px);
}

.tool-category button.is-active {
    background-color: rgba(88, 166, 255, 0.14);
    border-color: rgba(88, 166, 255, 0.35);
    color: #ffffff;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 2px solid #58a6ff;
    outline-offset: 2px;
}


.workspace {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 32px 24px 48px;
    background: transparent;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    min-height: 0;
    z-index: 1;
    scroll-padding-top: 24px;
    scrollbar-width: thin;
    scrollbar-color: #6e7681 transparent;
}

.workspace::-webkit-scrollbar {
    width: 6px;
}

.workspace::-webkit-scrollbar-track {
    background: transparent;
}

.workspace::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 10px;
}

.workspace::-webkit-scrollbar-thumb:hover {
    background: #6e7681;
}

.workspace > * {
    width: 100%;
    max-width: 1100px;
    background-color: rgba(255,255,255,0.01);
    border-radius: 10px;
    padding: 24px;
    border: 1px solid rgba(255,255,255,0.02);
}


.welcome-screen {
    width: 100%;
    text-align: center;
    max-width: 540px;
    margin: auto;
    background-color: transparent;
    border-radius: 8px;
}

.welcome-screen h2 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #f0f6fc;
}

.welcome-screen p {
    font-size: 18px;
    margin-bottom: 10px;
    color: #8b949e;
}

.welcome-screen span {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    color: #6e7681;
}
body.light-mode {
    background-color: #ffffff;
    color: #24292f;
}

body.light-mode .topbar {
    background-color: #f6f8fa;
    border-bottom-color: #d0d7de;
}

body.light-mode .toolbar {
    background-color: #f6f8fa;
    border-right-color: #d0d7de;
}

body.light-mode .workspace {
    background-color: #ffffff;
}

body.light-mode .brand h1 {
    color: #24292f;
}

body.light-mode .search-box input {
    background-color: #ffffff;
    color: #24292f;
    border-color: #d0d7de;
}

body.light-mode .tool-category button,
body.light-mode .quick-links button {
    color: #57606a;
}

body.light-mode .tool-category button:hover,
body.light-mode .quick-links button:hover {
    background-color: #eaeef2;
    color: #24292f;
}

body.light-mode .tool-category button.is-active {
    background-color: #ddf4ff;
    border-color: #54aeff;
    color: #0969da;
}

body.light-mode .tool-category h3 {
    color: #6e7781;
}

body.light-mode .search-empty {
    color: #57606a;
}

body.light-mode .welcome-screen h2 {
    color: #24292f;
}

body.light-mode .welcome-screen p {
    color: #57606a;
}

body.light-mode .welcome-screen span {
    color: #6e7781;
}

body.light-mode .workspace .tool-header h2,
body.light-mode .workspace #regexResult,
body.light-mode .workspace #diffResult,
body.light-mode .workspace #flexboxCSS,
body.light-mode .workspace .css-output-row code {
    color: #24292f;
}

body.light-mode .workspace .tool-header p,
body.light-mode .workspace label,
body.light-mode .workspace .panel-header,
body.light-mode .workspace .diff-panel-header,
body.light-mode .workspace .diff-result-header,
body.light-mode .workspace .result-header,
body.light-mode .workspace .output-header,
body.light-mode .workspace .json-status,
body.light-mode .workspace .validator-result,
body.light-mode .workspace .regex-result,
body.light-mode .workspace .color-status,
body.light-mode .workspace .gradient-status,
body.light-mode .workspace .shadow-status,
body.light-mode .workspace .flexbox-status {
    color: #57606a;
}

body.light-mode .workspace textarea,
body.light-mode .workspace input[type="text"],
body.light-mode .workspace select {
    color: #24292f;
    background-color: #ffffff;
    border-color: #d0d7de;
}

body.light-mode .workspace .panel-header,
body.light-mode .workspace .diff-panel-header,
body.light-mode .workspace .diff-results,
body.light-mode .workspace .regex-result,
body.light-mode .workspace .validator-result,
body.light-mode .workspace .shadow-output,
body.light-mode .workspace .flexbox-output {
    background-color: #f6f8fa;
    border-color: #d0d7de;
}

.tool-load-error {
    padding: 16px;
    color: #f85149;
    border: 1px solid #f85149;
    border-radius: 8px;
}

@media (max-width: 720px) {
    body { height: auto; min-height: 100vh; overflow: auto; }
    .topbar { position: sticky; top: 0; }
    main { height: auto; min-height: calc(100vh - 60px); flex-direction: column; overflow: visible; flex: none; }
    .toolbar { width: 100%; min-width: 0; height: auto; }
    .workspace { padding: 24px 16px 40px; overflow: visible; }
}

.quick-links-button {
    padding: 10px 16px;
    border: 1px solid #30363d;
    border-radius: 8px;
    background-color: #161b22;
    color: #c9d1d9;
    font-size: 14px;
    cursor: pointer;

}

.quick-links-button:hover {
    background-color: #21262d;
    border-color: rgba(255,255,255,0.05);
    color: #f0f6fc;

}

/* Quick Links workspace styles */
.quick-links-workspace .quick-links-search input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.04);
    background: rgba(13,17,23,0.75);
    color: #e6eef8;
    margin-bottom: 12px;
}
.quick-links-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
@media (max-width: 600px) {
    .quick-links-columns { grid-template-columns: 1fr; }
    .quick-links-column { min-width: 0; }
}
.quick-links-column {
    min-width: 0;
    background: rgba(255,255,255,0.01);
    border: 1px solid rgba(255,255,255,0.02);
    border-radius: 8px;
    padding: 12px;
}
.quick-links-column h3 {
    margin-top: 0;
    margin-bottom: 14px;
    color: #9aa6b3;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    font-size: 16px;
    letter-spacing: 0.02em;
}
.quick-links-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.quick-link-card {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 0 8px;
    margin-bottom: 14px;
    line-height: 1.45;
}
.quick-link-number {
    padding-top: 1px;
    color: #8b949e;
    font-variant-numeric: tabular-nums;
}
.quick-link-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.quick-link-card a {
    color: #58a6ff;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    font-size: 13px;
    text-decoration: none;
}
.quick-link-card a:hover {
    color: #79c0ff;
    text-decoration: underline;
}
