.kiv-app-tool {
    --app-ink: #1d352d;
    --app-muted: #687d75;
    --app-green: #0f9f65;
    --app-green-dark: #08764a;
    --app-soft: #f3f8f5;
    --app-line: #dce7e1;
    color: var(--app-ink);
}

.kiv-app-tool .app-tabbar {
    align-items: stretch;
    background: #f7faf8;
    border-bottom: 1px solid var(--app-line);
    display: flex;
    gap: 2px;
    margin: 0 0 24px;
    overflow-x: auto;
    padding: 0 10px;
    scrollbar-width: thin;
}

.kiv-app-tool .app-tabbar > li {
    float: none;
    flex: 0 0 auto;
    margin: 0;
}

.kiv-app-tool .app-tabbar > li > a {
    border: 0;
    border-radius: 0;
    color: #4a6259;
    font-size: 14px;
    font-weight: 620;
    margin: 0;
    min-height: 52px;
    padding: 16px 18px 13px;
    position: relative;
    white-space: nowrap;
}

.kiv-app-tool .app-tabbar > li > a:hover,
.kiv-app-tool .app-tabbar > li > a:focus {
    background: #edf5f1;
    color: var(--app-green-dark);
    outline: 0;
}

.kiv-app-tool .app-tabbar > li.active > a,
.kiv-app-tool .app-tabbar > li.active > a:hover,
.kiv-app-tool .app-tabbar > li.active > a:focus {
    background: #fff;
    color: var(--app-green-dark);
}

.kiv-app-tool .app-tabbar > li.active > a::before {
    background: var(--app-green);
    border-radius: 0 0 3px 3px;
    content: "";
    height: 3px;
    left: 12px;
    position: absolute;
    right: 12px;
    top: 0;
}

.kiv-app-tool .app-tabbar .dropdown-menu {
    border: 0;
    border-radius: 4px;
    box-shadow: 0 14px 34px rgba(30, 54, 45, .15);
    min-width: 230px;
    padding: 7px;
}

.kiv-app-tool .app-tabbar .dropdown-menu > li > a {
    border-radius: 3px;
    color: #42594f;
    font-size: 13px;
    padding: 9px 11px;
}

.kiv-app-tool .tool-intro { margin: 0 0 17px; }

.kiv-app-tool .tool-intro h1 {
    color: #21362f;
    font-size: 25px;
    font-weight: 660;
    letter-spacing: -.025em;
    line-height: 1.24;
    margin: 0 0 8px;
}

.kiv-app-tool .tool-intro p {
    color: var(--app-muted);
    font-size: 15px;
    line-height: 1.65;
    margin: 0;
    max-width: 980px;
}

.kiv-app-tool .local-badge {
    background: #e8f7ef;
    border-radius: 999px;
    color: #08764a;
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .09em;
    margin-left: 8px;
    padding: 5px 8px 4px;
    vertical-align: middle;
}

.kiv-app-tool .app-privacy-rail {
    align-items: center;
    background: #edf7f2;
    border-left: 3px solid var(--app-green);
    color: #44685a;
    display: flex;
    font-size: 13px;
    justify-content: space-between;
    margin: 0 0 18px;
    padding: 10px 13px;
}

.kiv-app-tool .app-privacy-rail strong { color: #176b49; }
.kiv-app-tool .app-privacy-rail small { color: #70857c; }

.kiv-app-tool .app-status {
    display: none;
    font-size: 13px;
    margin: 0 0 14px;
    padding: 10px 13px;
}

.kiv-app-tool .app-status.is-visible { display: block; }
.kiv-app-tool .app-status.is-ok { background: #ebf7f1; color: #176b49; }
.kiv-app-tool .app-status.is-warn { background: #fff5e4; color: #875415; }
.kiv-app-tool .app-status.is-error { background: #fff0f1; color: #972f3a; }

.kiv-app-tool .app-workbench {
    background: #f5f8f6;
    display: grid;
    gap: 1px;
    grid-template-columns: minmax(0, .86fr) minmax(420px, 1.14fr);
    overflow: hidden;
}

.kiv-app-tool .app-config,
.kiv-app-tool .app-preview-panel {
    background: #fff;
    min-width: 0;
}

.kiv-app-tool .app-panel-head {
    align-items: center;
    background: #f8faf9;
    border-bottom: 1px solid var(--app-line);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-height: 48px;
    padding: 11px 15px;
}

.kiv-app-tool .app-panel-head > span:first-child {
    color: #29453b;
    font-size: 14px;
    font-weight: 710;
}

.kiv-app-tool .app-panel-head small {
    color: #7b8e86;
    font-size: 12px;
    font-weight: 400;
}

.kiv-app-tool .app-panel-body { padding: 17px; }

.kiv-app-tool .app-form-grid {
    display: grid;
    gap: 13px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kiv-app-tool .app-field {
    display: grid;
    gap: 6px;
    margin: 0;
    min-width: 0;
}

.kiv-app-tool .app-field.is-wide { grid-column: 1 / -1; }

.kiv-app-tool .app-field > span {
    color: #3d594e;
    font-size: 12px;
    font-weight: 680;
}

.kiv-app-tool .app-field > small {
    color: #83938d;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.45;
}

.kiv-app-tool .app-input,
.kiv-app-tool .app-select {
    background: #fbfdfc;
    border: 1px solid #ceddd6;
    border-radius: 3px;
    box-shadow: none;
    color: #263f35;
    font-size: 14px;
    height: 40px;
    padding: 8px 10px;
    width: 100%;
}

.kiv-app-tool .app-input:focus,
.kiv-app-tool .app-select:focus {
    border-color: #5fc492;
    box-shadow: 0 0 0 3px rgba(15, 159, 101, .1);
    outline: 0;
}

.kiv-app-tool .app-platforms {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kiv-app-tool .app-platform {
    align-items: center;
    background: #f6f9f7;
    border: 0;
    border-radius: 3px;
    color: #587067;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    font-size: 11px;
    font-weight: 680;
    gap: 5px;
    justify-content: center;
    min-height: 64px;
    padding: 8px;
}

.kiv-app-tool .app-platform svg {
    fill: none;
    height: 20px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.65;
    width: 20px;
}

.kiv-app-tool .app-platform:hover,
.kiv-app-tool .app-platform:focus { background: #edf5f1; color: var(--app-green-dark); outline: 0; }

.kiv-app-tool .app-platform.is-active {
    background: #e5f4ec;
    box-shadow: inset 0 -2px var(--app-green);
    color: var(--app-green-dark);
}

.kiv-app-tool .app-checkline {
    align-items: center;
    color: #526c62;
    display: flex;
    font-size: 12px;
    gap: 8px;
    min-height: 40px;
    padding-top: 21px;
}

.kiv-app-tool .app-checkline input { accent-color: var(--app-green); margin: 0; }

.kiv-app-tool .app-file-picker {
    align-items: center;
    background: #f6f9f7;
    color: #587067;
    cursor: pointer;
    display: flex;
    font-size: 12px;
    gap: 10px;
    min-height: 58px;
    padding: 10px 12px;
}

.kiv-app-tool .app-file-picker:hover { background: #eef5f1; }
.kiv-app-tool .app-file-picker input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.kiv-app-tool .app-file-mark { color: var(--app-green); font-size: 20px; line-height: 1; }

.kiv-app-tool .app-actions {
    align-items: center;
    border-top: 1px solid var(--app-line);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 17px;
    padding-top: 14px;
}

.kiv-app-tool .app-actions .btn {
    border: 0;
    border-radius: 3px;
    box-shadow: none;
    font-size: 13px;
    font-weight: 650;
    min-height: 38px;
    padding: 9px 14px;
}

.kiv-app-tool .app-actions .btn-primary {
    background: var(--app-green);
    color: #fff;
}

.kiv-app-tool .app-actions .btn-primary:hover,
.kiv-app-tool .app-actions .btn-primary:focus { background: var(--app-green-dark); }
.kiv-app-tool .app-actions .btn-default { background: #edf3f0; color: #435d53; }
.kiv-app-tool .app-actions .btn-default:hover { background: #e1ece6; }

.kiv-app-tool .shortcut-preview-stage,
.kiv-app-tool .mac-preview-stage {
    background-color: #edf3f0;
    background-image: linear-gradient(rgba(45, 89, 70, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(45, 89, 70, .055) 1px, transparent 1px);
    background-size: 22px 22px;
    min-height: 332px;
    padding: 26px;
}

.kiv-app-tool .shortcut-preview-stage {
    align-items: center;
    display: grid;
    justify-items: center;
}

.kiv-app-tool .shortcut-tile {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-width: 170px;
    text-align: center;
}

.kiv-app-tool .shortcut-tile-icon {
    align-items: center;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(29, 56, 45, .13);
    color: var(--app-green);
    display: flex;
    height: 82px;
    justify-content: center;
    position: relative;
    width: 82px;
}

.kiv-app-tool .shortcut-tile-icon::after {
    background: var(--app-green);
    border: 3px solid #fff;
    border-radius: 50%;
    bottom: -4px;
    color: #fff;
    content: "↗";
    display: grid;
    font-size: 15px;
    height: 27px;
    place-items: center;
    position: absolute;
    right: -5px;
    width: 27px;
}

.kiv-app-tool .shortcut-tile-icon svg {
    fill: none;
    height: 38px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.4;
    width: 38px;
}

.kiv-app-tool .shortcut-tile strong { color: #2b433a; font-size: 14px; word-break: break-word; }
.kiv-app-tool .shortcut-tile small { color: #70857c; font-size: 11px; word-break: break-all; }

.kiv-app-tool .app-code-preview {
    background: #172821;
    color: #cbe5d9;
    font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    margin: 0;
    max-height: 230px;
    min-height: 164px;
    overflow: auto;
    padding: 14px 15px;
    white-space: pre-wrap;
    word-break: break-word;
}

.kiv-app-tool .mac-preview-stage { padding: 30px; }

.kiv-app-tool .mac-window {
    background: #fff;
    border-radius: 9px;
    box-shadow: 0 20px 54px rgba(29, 56, 45, .16);
    margin: 0 auto;
    max-width: 640px;
    min-height: 254px;
    overflow: hidden;
}

.kiv-app-tool .mac-titlebar {
    align-items: center;
    background: #f5f6f5;
    border-bottom: 1px solid #e3e8e5;
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) 74px;
    min-height: 42px;
    padding: 0 13px;
}

.kiv-app-tool .mac-lights { display: flex; gap: 7px; }
.kiv-app-tool .mac-lights i { border-radius: 50%; display: block; height: 10px; width: 10px; }
.kiv-app-tool .mac-lights i:nth-child(1) { background: #ff5f57; }
.kiv-app-tool .mac-lights i:nth-child(2) { background: #febc2e; }
.kiv-app-tool .mac-lights i:nth-child(3) { background: #28c840; }
.kiv-app-tool .mac-window-title { color: #4f5f59; font-size: 12px; font-weight: 650; overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; }

.kiv-app-tool .mac-webview {
    align-items: center;
    background: #fcfdfc;
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: center;
    min-height: 212px;
    padding: 28px;
}

.kiv-app-tool .mac-app-icon {
    align-items: center;
    background: linear-gradient(145deg, #17b778, #087c4e);
    border-radius: 20px;
    box-shadow: 0 13px 28px rgba(15, 159, 101, .2);
    color: #fff;
    display: flex;
    font-size: 25px;
    font-weight: 750;
    height: 78px;
    justify-content: center;
    overflow: hidden;
    width: 78px;
}

.kiv-app-tool .mac-app-icon img { height: 100%; object-fit: cover; width: 100%; }
.kiv-app-tool .mac-webview strong { color: #2b4138; font-size: 15px; }
.kiv-app-tool .mac-url-chip { background: #eef4f1; border-radius: 999px; color: #667b73; font: 11px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; max-width: 90%; overflow: hidden; padding: 7px 12px; text-overflow: ellipsis; white-space: nowrap; }

.kiv-app-tool .app-output-strip {
    align-items: center;
    background: #f8faf9;
    border-top: 1px solid var(--app-line);
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 11px 14px;
}

.kiv-app-tool .app-output-strip > span:first-child { color: #52695f; font-size: 11px; font-weight: 700; margin-right: 3px; }
.kiv-app-tool .app-file-chip { background: #eaf3ee; border-radius: 999px; color: #4c6a5e; font: 10px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 5px 8px; }

.kiv-app-tool .app-explain {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 16px;
}

.kiv-app-tool .app-explain article {
    background: #f7faf8;
    min-height: 108px;
    padding: 15px;
}

.kiv-app-tool .app-explain strong { color: #335447; display: block; font-size: 13px; margin-bottom: 7px; }
.kiv-app-tool .app-explain p { color: #6d8179; font-size: 12px; line-height: 1.55; margin: 0; }

html.kiv-shell-dark .kiv-app-tool { --app-ink: #e0eee8; --app-muted: #a8bbb3; --app-line: #344a40; }
html.kiv-shell-dark .kiv-app-tool .app-tabbar,
html.kiv-shell-dark .kiv-app-tool .app-panel-head,
html.kiv-shell-dark .kiv-app-tool .app-output-strip { background: #24362f; }
html.kiv-shell-dark .kiv-app-tool .app-tabbar > li > a { color: #b4c7be; }
html.kiv-shell-dark .kiv-app-tool .app-tabbar > li.active > a,
html.kiv-shell-dark .kiv-app-tool .app-tabbar > li.active > a:hover { background: #1f3029; color: #75d6a8; }
html.kiv-shell-dark .kiv-app-tool .tool-intro h1,
html.kiv-shell-dark .kiv-app-tool .app-panel-head > span:first-child { color: #e7f2ed; }
html.kiv-shell-dark .kiv-app-tool .app-privacy-rail { background: #263e34; color: #b1cbbf; }
html.kiv-shell-dark .kiv-app-tool .app-workbench { background: #344a40; }
html.kiv-shell-dark .kiv-app-tool .app-config,
html.kiv-shell-dark .kiv-app-tool .app-preview-panel { background: #1f3029; }
html.kiv-shell-dark .kiv-app-tool .app-input,
html.kiv-shell-dark .kiv-app-tool .app-select { background: #22362d; border-color: #3b5549; color: #e2eee9; }
html.kiv-shell-dark .kiv-app-tool .app-platform,
html.kiv-shell-dark .kiv-app-tool .app-file-picker,
html.kiv-shell-dark .kiv-app-tool .app-explain article { background: #263a31; color: #b7c9c1; }
html.kiv-shell-dark .kiv-app-tool .app-platform.is-active { background: #294d3d; color: #83ddb1; }
html.kiv-shell-dark .kiv-app-tool .shortcut-preview-stage,
html.kiv-shell-dark .kiv-app-tool .mac-preview-stage { background-color: #263a31; }
html.kiv-shell-dark .kiv-app-tool .mac-window { background: #1d2d26; }
html.kiv-shell-dark .kiv-app-tool .mac-titlebar { background: #2a3933; border-color: #3a4d45; }
html.kiv-shell-dark .kiv-app-tool .mac-webview { background: #21322b; }
html.kiv-shell-dark .kiv-app-tool .mac-webview strong,
html.kiv-shell-dark .kiv-app-tool .shortcut-tile strong { color: #dceae4; }
html.kiv-shell-dark .kiv-app-tool .shortcut-tile-icon { background: #1d2d26; }

@media (max-width: 991px) {
    .kiv-app-tool .app-workbench { grid-template-columns: 1fr; }
    .kiv-app-tool .app-preview-panel { border-top: 1px solid var(--app-line); }
    .kiv-app-tool .shortcut-preview-stage,
    .kiv-app-tool .mac-preview-stage { min-height: 290px; }
}

@media (max-width: 767px) {
    .kiv-app-tool .app-tabbar { margin-left: -15px; margin-right: -15px; padding: 0 6px; }
    .kiv-app-tool .app-tabbar > li > a { font-size: 13px; min-height: 46px; padding: 14px 12px 11px; }
    body.kiv-contextual-nav-page .kiv-contextual-nav-root.kiv-app-tool .tool-intro:not(.alert) h1 { font-size: 21px; }
    .kiv-app-tool .tool-intro p { font-size: 14px; }
    .kiv-app-tool .local-badge { margin-left: 3px; }
    .kiv-app-tool .app-privacy-rail { align-items: flex-start; flex-direction: column; gap: 4px; }
    .kiv-app-tool .app-form-grid { grid-template-columns: 1fr; }
    .kiv-app-tool .app-field.is-wide { grid-column: auto; }
    .kiv-app-tool .app-checkline { padding-top: 0; }
    .kiv-app-tool .app-panel-body { padding: 13px; }
    .kiv-app-tool .shortcut-preview-stage,
    .kiv-app-tool .mac-preview-stage { min-height: 250px; padding: 18px 13px; }
    .kiv-app-tool .app-explain { grid-template-columns: 1fr; }
    .kiv-app-tool .app-actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
    .kiv-app-tool * { scroll-behavior: auto !important; transition: none !important; }
}
