@charset "UTF-8";

/*
Theme Name: 子猫AIケア手帳
Theme URI: https://sakusite.com/
Author: SakuSite Works たか369
Author URI: https://sakusite.com/
Description: A WordPress theme designed for the 'Kitten AI Care Log' application, featuring a custom front page with hero section and tools, and a standard 2-column layout for inner pages.
Version: 1.0.5
Text Domain: kitten-ai-care-handbook
Tags: custom-background, two-columns, full-width-template, theme-options
*/

/* * KACH (Kitten AI Care Handbook) UI Styles
 * WordPressの他テーマと干渉しないよう、.kach-ui スコープ内で定義
 */

:root {
    /* Color Palette */
    --kach-primary: #EDB9C8;
    /* New Pink */
    --kach-primary-dark: #D49AA9;
    /* Slightly darker for float/active */
    --kach-secondary: #A8D8F0;
    /* Pale Blue */
    --kach-secondary-dark: #8AC0DD;
    --kach-accent: #FFF5CC;
    /* Pale Yellow */
    --kach-text-main: #5D5D5D;
    /* Dark Gray */
    --kach-text-light: #888888;
    --kach-bg: #FFF7FA;
    /* Very pale pink bg */
    --kach-white: #FFFFFF;
    --kach-danger: #FF8E8E;
    --kach-success: #8CDDCD;

    /* UI Dimensions */
    --kach-radius-lg: 24px;
    --kach-radius-md: 16px;
    --kach-radius-sm: 8px;
    --kach-shadow: 0 8px 24px rgba(247, 182, 200, 0.15);
    --kach-shadow-hover: 0 12px 32px rgba(247, 182, 200, 0.25);

    /* Typography */
    --kach-font: "M PLUS Rounded 1c", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", "Segoe UI", sans-serif;
    --kach-font-sans: "Zen Kaku Gothic New", sans-serif;
    --kach-font-serif: "Shippori Mincho", serif;
    --kach-border: #EADCE1;
}

/* リセットと基本設定 */
body {
    font-family: var(--kach-font);
    color: var(--kach-text-main);
    background-color: var(--kach-bg);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.kach-ui {
    /* Force unified pastel palette even when plugin injects its own CSS vars. */
    --kach-primary: #EDB9C8;
    --kach-primary-dark: #D49AA9;
    font-family: var(--kach-font);
    color: var(--kach-text-main);
    background-color: var(--kach-bg);
    line-height: 1.6;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    position: relative;
}

/* Site shell: prevent plugin ".kach-ui" layout rules from shrinking the global header/body wrapper. */
.kach-ui.kach-site-shell {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: var(--kach-bg);
}

.kach-ui *,
.kach-ui *::before,
.kach-ui *::after {
    box-sizing: border-box;
}

/* リンクのリセット */
.kach-ui a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.kach-ui a:hover {
    opacity: 0.8;
}

/* レイアウトコンテナ */
.kach-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Front Page Specific Container - narrowed for app-like feel */
.home .kach-container,
.front-page .kach-container {
    max-width: 600px;
}

.home .kach-container.kach-front-with-sidebar,
.front-page .kach-container.kach-front-with-sidebar {
    max-width: 1200px;
}

/* --- ヘッダー --- */
.kach-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--kach-white);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

/* --- Search Form in Widgets/Sidebar --- */
.widget .search-form {
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative;
    width: 100%;
}

.widget .search-form label {
    flex: 1;
    margin: 0;
    width: 100%;
}

.widget .search-field {
    width: 100%;
    margin: 0;
    border-radius: 999px;
    padding-right: 16px;
    border-color: var(--kach-border);
    min-height: 48px;
}

.widget .search-form:not(.kach-search-form) .search-submit {
    position: static;
    transform: none;
    width: auto;
    min-width: 88px;
    height: 48px;
    padding: 0 16px;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 0.9rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--kach-primary);
    color: #fff;
    border: none;
    box-shadow: none;
    transition: background 0.2s ease;
}

.widget .search-form:not(.kach-search-form) .search-submit:hover {
    background: var(--kach-primary-dark);
    transform: none;
}

.widget .search-field:focus,
.kach-sidebar .wp-block-search__input:focus {
    border-color: var(--kach-primary);
    box-shadow: 0 0 0 4px rgba(237, 185, 200, 0.26);
}

.widget .search-form:not(.kach-search-form) .search-submit svg {
    display: none;
}

/* WordPress block search widget compatibility */
.kach-sidebar .wp-block-search__inside-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kach-sidebar .wp-block-search__input {
    min-height: 48px;
    border-radius: 999px;
}

.kach-sidebar .wp-block-search__button {
    min-width: 88px;
    min-height: 48px;
    margin: 0;
    padding: 0 16px;
    border-radius: 999px;
    white-space: nowrap;
    background: var(--kach-primary) !important;
    border: 1px solid var(--kach-primary) !important;
    color: #fff !important;
}

.kach-sidebar .wp-block-search__button:hover {
    background: var(--kach-primary-dark) !important;
}

.kach-sidebar .wp-block-search__button svg,
.kach-sidebar .wp-block-search__button svg * {
    stroke: #fff !important;
    fill: none !important;
}

.kach-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--kach-text-main);
    min-width: 0;
}

.kach-logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kach-logo svg {
    width: 28px;
    height: 28px;
    fill: var(--kach-primary);
}

/* Header Navigation (Desktop) */
.kach-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}

.kach-nav-menu>li {
    position: relative;
    font-size: 0.95rem;
    font-weight: 700;
}

/* Sub-menu (Dropdown) */
.kach-nav-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--kach-white);
    box-shadow: var(--kach-shadow);
    border-radius: var(--kach-radius-sm);
    min-width: 200px;
    padding: 10px 0;
    margin: 0;
    list-style: none;
    flex-direction: column;
    gap: 0;
    z-index: 200;
    border: 1px solid var(--kach-bg);
}

.kach-nav-menu li:hover>.sub-menu {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.kach-nav-menu .sub-menu li a {
    display: block;
    padding: 10px 16px;
    white-space: nowrap;
    color: var(--kach-text-main);
    font-size: 0.9rem;
    font-weight: 500;
}

.kach-nav-menu .sub-menu li a:hover {
    background: var(--kach-bg);
    color: var(--kach-primary);
}

/* Keep mobile drawer hidden by default in all environments.
   This prevents "raw list" rendering if a media query is not applied yet. */
.kach-menu-toggle,
.kach-mobile-drawer,
.kach-mobile-overlay {
    display: none;
}

.kach-mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kach-mobile-menu-list li {
    list-style: none;
}

/* Defensive reset against plugin/host-side CSS that targets generic .menu/.sub-menu. */
.kach-header-nav .kach-nav-menu,
.kach-mobile-nav .kach-mobile-menu-list,
.kach-mobile-nav .kach-mobile-menu-list li {
    list-style: none !important;
    margin: 0;
    padding: 0;
}

@media (max-width: 768px) {
    .kach-header-nav {
        display: none;
        /* Mobile menu implementation needed if requested */
    }
}

.kach-header-btn {
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 20px;
    background: #fff;
    color: var(--kach-primary);
    border: 1px solid var(--kach-primary);
    box-shadow: 0 3px 10px rgba(237, 185, 200, 0.22);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.kach-header-btn:hover {
    background: #fff;
    color: var(--kach-primary-dark);
    border-color: var(--kach-primary-dark);
    transform: translateY(-1px);
}

.kach-header-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(237, 185, 200, 0.28);
}

/* --- タイポグラフィ --- */
.kach-h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.3;
    color: var(--kach-text-main);
}

.kach-h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kach-h2::before {
    content: '';
    display: block;
    width: 6px;
    height: 24px;
    background: var(--kach-primary);
    border-radius: 4px;
}

.kach-p {
    margin: 0 0 16px;
    font-size: 0.95rem;
}

.kach-text-sm {
    font-size: 0.85rem;
    color: var(--kach-text-light);
}

/* タグライン（キャッチフレーズ用） */
.kach-tagline {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--kach-primary-dark);
    background: rgba(255, 255, 255, 0.7);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(247, 182, 200, 0.1);
}

/* --- ファーストビュー (Hero) --- */
.kach-hero {
    padding: 40px 20px 60px;
    /* 下部はツールエリアと被るため広めに */
    text-align: center;
    background: radial-gradient(circle at top right, #FFF0F5 0%, #FFF7FA 60%);
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.kach-hero-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.kach-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    z-index: 0;
}

/* 背景の肉球パターン（CSS装飾） */
.kach-bg-pattern {
    position: absolute;
    top: 20px;
    right: -20px;
    opacity: 0.4;
    pointer-events: none;
    z-index: 1;
}

.kach-hero-content {
    position: relative;
    z-index: 2;
}

.kach-hero-feature {
    margin-top: 18px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    padding: 14px;
    border-radius: var(--kach-radius-md);
    border: 1px solid rgba(212, 154, 169, 0.28);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 245, 247, 0.92));
    box-shadow: 0 6px 18px rgba(237, 185, 200, 0.18);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.kach-hero-feature::after {
    content: '';
    position: absolute;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 216, 240, 0.22), rgba(168, 216, 240, 0));
    right: -45px;
    top: -45px;
    pointer-events: none;
}

.kach-hero-feature-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #FFF;
    color: var(--kach-primary-dark);
    border: 1px solid rgba(212, 154, 169, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(237, 185, 200, 0.2);
}

.kach-hero-feature-content {
    position: relative;
    z-index: 1;
}

.kach-hero-feature-label {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    margin: 0 0 8px;
    border-radius: 999px;
    background: rgba(168, 216, 240, 0.25);
    color: #5E8EA8;
    font-size: 0.76rem;
    font-weight: 700;
}

.kach-hero-feature-title {
    margin: 0;
    color: var(--kach-text-main);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.45;
}

.kach-hero-feature-text {
    margin: 6px 0 0;
    color: var(--kach-text-main);
    font-size: 0.86rem;
    line-height: 1.6;
}

.kach-hero-feature-link {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(168, 216, 240, 0.7);
    background: #fff;
    color: #5E8EA8;
    font-size: 0.84rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.kach-hero-feature-link:hover {
    color: #4B7A93;
    border-color: rgba(138, 192, 221, 0.85);
    background: rgba(168, 216, 240, 0.12);
    transform: translateY(-1px);
}

.kach-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.kach-hero-sub-action {
    margin-top: 14px;
}

/* 猫イラストプレースホルダー（SVG） */
.kach-hero-cat {
    display: none;
    /* スマホでは非表示気味、または小さく */
}

/* ふわふわ浮くアニメーション */
@keyframes kachFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@media (min-width: 768px) {
    .kach-hero {
        text-align: left;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 40px;
        padding: 60px 20px 80px;
    }

    .kach-hero-content {
        flex: 1;
        max-width: 500px;
    }

    .kach-hero-feature {
        margin-left: 0;
        margin-right: 0;
    }

    .kach-hero-actions {
        margin-left: 0;
        flex-direction: row;
    }

    .kach-hero-sub-action {
        margin-top: 18px;
    }

    .kach-hero-cat {
        display: block;
        flex: 1;
        max-width: 350px;
        /* 少し大きく */
        height: auto;
        animation: kachFloat 6s ease-in-out infinite;
        /* 浮遊アニメーション追加 */
        position: relative;
        z-index: 2;
    }

    .home .kach-container,
    .front-page .kach-container {
        max-width: 600px;
    }
}

/* --- ボタンコンポーネント --- */
.kach-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    border-radius: 50px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.kach-btn:active {
    transform: scale(0.98);
}

.kach-btn--primary {
    background: var(--kach-primary);
    color: #FFFFFF !important;
    /* Force White */
    box-shadow: 0 4px 12px rgba(247, 182, 200, 0.4);
}

.kach-btn--primary:hover {
    background: var(--kach-primary-dark);
    color: #FFFFFF !important;
    transform: translateY(-2px);
}

.kach-btn--primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(237, 185, 200, 0.26);
}

.kach-btn--secondary {
    background: var(--kach-secondary);
    color: #FFFFFF !important;
    /* Force White */
    box-shadow: 0 4px 12px rgba(168, 216, 240, 0.4);
}

.kach-btn--secondary:hover {
    background: var(--kach-secondary-dark);
    color: #FFFFFF !important;
    transform: translateY(-2px);
}

.kach-btn--secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(168, 216, 240, 0.3);
}

.kach-btn svg {
    stroke: currentColor;
    /* Ensure SVG follows text color */
    fill: none;
    /* Ensure fill doesn't interfere */
}

.kach-btn--ghost {
    background: transparent;
    color: var(--kach-text-main);
    border: 2px solid var(--kach-primary);
}

.kach-btn--ghost:hover {
    background: rgba(247, 182, 200, 0.1);
}

.kach-btn--tertiary {
    background: #fff;
    color: var(--kach-secondary-dark);
    border: 2px solid var(--kach-secondary);
    box-shadow: 0 3px 10px rgba(168, 216, 240, 0.2);
}

.kach-btn--tertiary:hover {
    background: rgba(168, 216, 240, 0.12);
    color: var(--kach-secondary-dark);
    transform: translateY(-2px);
}

.kach-btn--tertiary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(168, 216, 240, 0.25);
}

/* Keep front-page CTA variants stable even when plugin CSS defines generic .kach-btn styles. */
.kach-ui.kach-site-shell .kach-btn--primary {
    background: var(--kach-primary);
    color: #fff !important;
    border: none;
}

.kach-ui.kach-site-shell .kach-btn--primary:hover {
    background: var(--kach-primary-dark);
}

.kach-ui.kach-site-shell .kach-btn--secondary {
    background: var(--kach-secondary);
    color: #fff !important;
    border: none;
}

.kach-ui.kach-site-shell .kach-btn--secondary:hover {
    background: var(--kach-secondary-dark);
}

/* Front-page hero: keep "いま心配を相談" in pastel blue like the prototype. */
.kach-ui.kach-site-shell .kach-hero-actions .kach-btn--secondary {
    background: #A8D8F0 !important;
    border-color: #A8D8F0 !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(168, 216, 240, 0.4) !important;
}

.kach-ui.kach-site-shell .kach-hero-actions .kach-btn--secondary:hover {
    background: #8AC0DD !important;
    border-color: #8AC0DD !important;
    color: #fff !important;
}

.kach-ui.kach-site-shell .kach-btn--tertiary {
    background: #fff;
    color: var(--kach-secondary-dark) !important;
    border: 2px solid var(--kach-secondary);
}

.kach-ui.kach-site-shell .kach-btn--tertiary:hover {
    background: rgba(168, 216, 240, 0.12);
    color: var(--kach-secondary-dark) !important;
    border-color: var(--kach-secondary-dark);
}

/* --- ツールカードエリア（最重要） --- */
.kach-tool-area {
    margin-top: -40px;
    /* ヒーローに食い込ませる */
    position: relative;
    z-index: 10;
    margin-bottom: 40px;
}

.kach-card {
    background: var(--kach-white);
    border-radius: var(--kach-radius-lg);
    box-shadow: var(--kach-shadow);
    overflow: hidden;
    padding: 0;
    /* タブがあるのでpaddingは内部で調整 */
}

/* タブナビゲーション */
.kach-tabs {
    display: flex;
    background: #FFF0F5;
    padding: 6px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.kach-tab-btn {
    flex: 1;
    padding: 12px 4px;
    border: none;
    background: transparent;
    color: var(--kach-text-light);
    font-weight: 700;
    border-radius: var(--kach-radius-md);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.kach-tab-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    opacity: 0.7;
}

.kach-tab-btn.is-active {
    background: var(--kach-white);
    color: var(--kach-primary-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.kach-tab-btn.is-active svg {
    fill: var(--kach-primary);
    opacity: 1;
}

/* ツールコンテンツスロット */
.kach-tab-content {
    display: none;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.kach-tab-content.is-active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Global Form Elements (Consistency) --- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 2px solid #F0F0F0;
    border-radius: var(--kach-radius-md);
    background: #FAFAFA;
    font-size: 1rem;
    color: var(--kach-text-main);
    font-family: inherit;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--kach-primary);
    background: #FFF;
    box-shadow: 0 0 0 4px rgba(247, 182, 200, 0.2);
}

/* Select Custom Arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* Checkbox & Radio (Custom Cute Style) */
input[type="checkbox"],
input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid #DDD;
    border-radius: 6px;
    margin: 0 8px 0 0;
    vertical-align: middle;
    position: relative;
    cursor: pointer;
    background: #FFF;
    transition: all 0.2s;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background: var(--kach-primary);
    border-color: var(--kach-primary);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* Labels */
label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--kach-text-main);
    font-size: 0.95rem;
}

/* Placeholder */
::placeholder {
    color: #CCC;
    opacity: 1;
}

/* Button & Submit consistency */
.kach-ui input[type="submit"],
.kach-ui button[type="submit"] {
    background: var(--kach-primary);
    color: #FFF;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(237, 185, 200, 0.4);
}

.kach-ui input[type="submit"]:hover,
.kach-ui button[type="submit"]:hover {
    background: var(--kach-primary-dark);
    transform: translateY(-2px);
}

.kach-ui input[type="submit"]:focus-visible,
.kach-ui button[type="submit"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(237, 185, 200, 0.24);
}

/* Keep all destructive actions in danger color regardless of global button styles. */
.kach-ui :is(button, input[type="submit"], .kach-btn, [role="button"]):is(
    [class*="danger" i],
    [class*="destructive" i],
    [class*="delete" i],
    [class*="remove" i],
    [class*="warning" i],
    [class*="error" i],
    [name*="delete" i],
    [name*="remove" i],
    [name*="destroy" i],
    [name*="reset" i],
    [name*="clear" i],
    [name*="withdraw" i],
    [name*="unsubscribe" i],
    [name*="logout" i],
    [name*="削除"],
    [name*="退会"],
    [name*="破棄"],
    [name*="消去"],
    [name*="初期化"],
    [aria-label*="delete" i],
    [aria-label*="remove" i],
    [aria-label*="destroy" i],
    [aria-label*="reset" i],
    [aria-label*="clear" i],
    [aria-label*="withdraw" i],
    [aria-label*="unsubscribe" i],
    [aria-label*="logout" i],
    [aria-label*="削除"],
    [aria-label*="退会"],
    [aria-label*="破棄"],
    [aria-label*="消去"],
    [aria-label*="初期化"],
    [title*="delete" i],
    [title*="remove" i],
    [title*="destroy" i],
    [title*="reset" i],
    [title*="clear" i],
    [title*="withdraw" i],
    [title*="unsubscribe" i],
    [title*="logout" i],
    [title*="削除"],
    [title*="退会"],
    [title*="破棄"],
    [title*="消去"],
    [title*="初期化"]
) {
    background: var(--kach-danger) !important;
    border-color: var(--kach-danger) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(255, 142, 142, 0.35) !important;
}

/* Keep search actions consistently secondary after generic submit rules. */
.kach-ui .kach-sidebar .wp-block-search__button {
    background: var(--kach-primary) !important;
    border-color: transparent;
    color: #fff !important;
}

.kach-ui .kach-sidebar .wp-block-search__button:hover {
    background: var(--kach-primary-dark) !important;
}

/* Special KACH Form overrides if needed */
.kach-form-dummy {
    /* Legacy dummy class kept just safely, but empty now as global styles take over */
}

/* --- 広告スロット --- */
.kach-ad {
    margin: 24px 0;
    min-height: 10px;
}

.kach-ad-label {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--kach-accent);
    color: var(--kach-text-main);
    font-size: 10px;
    padding: 2px 6px;
    border-bottom-right-radius: 8px;
    border-top-left-radius: 16px;
    /* Matches Image radius if corner */
    pointer-events: none;
    z-index: 2;
    font-weight: 700;
}

.kach-ad-placeholder {
    background: #F9F9F9;
    border: 1px dashed #DDD;
    border-radius: var(--kach-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

/* .kach-ad::before removed to prevent overlap */

/* --- 最近の記録 --- */
.kach-record-list {
    display: grid;
    gap: 12px;
}

.kach-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.kach-record-item {
    background: var(--kach-white);
    padding: 16px;
    border-radius: var(--kach-radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    border-left: 4px solid var(--kach-secondary);
}

.kach-record-meta {
    display: flex;
    flex-direction: column;
}

.kach-record-date {
    font-size: 0.75rem;
    color: var(--kach-text-light);
}

.kach-record-title {
    font-weight: 700;
}

/* --- 安心設計（信頼ブロック） --- */
.kach-trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 40px;
    text-align: center;
}

.kach-trust-item {
    background: var(--kach-white);
    padding: 16px 8px;
    border-radius: var(--kach-radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.kach-trust-icon {
    width: 40px;
    height: 40px;
    background: var(--kach-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #DDAA00;
}

.kach-trust-grid .kach-trust-icon {
    background: var(--kach-accent) !important;
    color: #DDAA00 !important;
}

.kach-trust-grid .kach-trust-icon svg,
.kach-trust-grid .kach-trust-icon svg * {
    stroke: currentColor !important;
    fill: none !important;
}

.kach-trust-text {
    font-size: 0.75rem;
    line-height: 1.3;
    font-weight: 700;
}

/* --- 使い方ステップ --- */
.kach-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.kach-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
}

.kach-step-circle {
    width: 32px;
    height: 32px;
    background: var(--kach-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: 700;
}

/* 線をつなぐ */
.kach-steps::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #EEE;
    z-index: 1;
}

/* --- FAQ (Accordion) --- */
.kach-faq-item {
    background: var(--kach-white);
    border-radius: var(--kach-radius-md);
    margin-bottom: 8px;
    overflow: hidden;
}

.kach-faq-summary {
    padding: 16px;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    /* デフォルトの三角を消す */
}

.kach-faq-summary::-webkit-details-marker {
    display: none;
}

.kach-faq-summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--kach-primary);
    transition: transform 0.3s;
}

.kach-faq-item[open] .kach-faq-summary::after {
    transform: rotate(45deg);
}

.kach-faq-content {
    padding: 0 16px 16px;
    font-size: 0.9rem;
    color: var(--kach-text-main);
    border-top: 1px solid #F0F0F0;
    padding-top: 12px;
}

/* --- フッター --- */
.kach-footer {
    margin-top: 72px;
    padding: 56px 20px 32px;
    text-align: center;
    border-top: 1px solid #F1E2E8;
    font-size: 0.85rem;
    color: var(--kach-text-light);
    background: linear-gradient(180deg, #FFF7FA 0%, #FFF 44%, #FFF 100%);
}

.kach-footer-links {
    display: flex;
    justify-content: center;
    margin: 0 auto 24px;
}

/* Footer Links Widget Styling */
.kach-footer-links .footer-links-widget {
    width: 100%;
}

.kach-footer-links .footer-links-widget.widget_nav_menu .menu,
.kach-footer-links .footer-links-widget.widget_nav_menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kach-footer-links .footer-links-widget.widget_nav_menu .menu {
    display: grid;
    gap: 12px;
}

.kach-footer-links .footer-links-widget.widget_nav_menu .menu>li>a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 12px 18px;
    border-radius: 16px;
    border: 1px solid #EFD7E0;
    background: #FFF;
    color: var(--kach-text-main);
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.4;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.kach-footer-links .footer-links-widget.widget_nav_menu .menu>li>.sub-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.kach-footer-links .footer-links-widget.widget_nav_menu .menu>li>.sub-menu li {
    margin: 0;
}

.kach-footer-links .footer-links-widget.widget_nav_menu .menu>li>.sub-menu li+li {
    margin-top: 0;
}

.kach-footer-links .footer-links-widget.widget_nav_menu .menu>li>.sub-menu li>a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid #EFD7E0;
    background: #FFF;
    color: var(--kach-text-main);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.45;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.kach-footer-links .footer-links-widget.widget_nav_menu a:hover {
    color: var(--kach-primary-dark);
    border-color: var(--kach-primary);
    transform: translateY(-1px);
}

.kach-footer .widget ul,
.kach-footer .widget ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kach-footer .widget li+li {
    margin-top: 10px;
}

.kach-footer .widget a {
    color: var(--kach-text-main);
}

.kach-footer .widget_nav_menu .menu,
.kach-footer .widget_nav_menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kach-footer .widget_nav_menu .menu {
    display: grid;
    gap: 8px;
}

.kach-footer .widget_nav_menu .menu>li>a {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #F2E4EA;
    background: #FFF;
    font-weight: 700;
}

.kach-footer .widget_nav_menu .menu .sub-menu {
    margin-top: 8px;
    padding-left: 10px;
}

.kach-footer .widget_nav_menu .menu .sub-menu a {
    display: block;
    padding: 6px 0;
    font-size: 0.9rem;
}

.kach-copyright {
    margin: 0;
    line-height: 1.7;
}

/* --- ローディング・トースト --- */
.kach-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--kach-text-main);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    width: max-content;
}

.kach-toast.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.kach-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #FFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.kach-btn.is-loading .kach-spinner {
    display: inline-block;
}

.kach-btn.is-loading span {
    opacity: 0.7;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Single/Page Layout Extras to mix smoothly */
.kach-content-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.kach-main-content {
    flex: 2;
    min-width: 0;
}

.kach-sidebar {
    flex: 1;
    min-width: 300px;
}

.kach-content-wrapper.kach-no-sidebar {
    display: block;
}

.kach-content-wrapper.kach-no-sidebar .kach-main-content {
    width: 100%;
    max-width: 100%;
}

/* Plugin app page single-column fallback (used when sidebar is disabled). */
.kach-plugin-page-container .kach-content-wrapper {
    display: block;
    margin-top: 24px;
    margin-bottom: 24px;
}

.kach-plugin-page-container .kach-main-content {
    width: 100%;
    max-width: 100%;
}

.kach-plugin-page-container .entry-content {
    width: 100%;
    overflow-wrap: anywhere;
}

.kach-plugin-page-container .kach-sidebar {
    display: none !important;
}

/* --- Article TOC + Heading Design --- */
.kach-main-content .entry-content {
    font-size: 1rem;
    line-height: 1.9;
}

.kach-main-content .entry-content>*:first-child {
    margin-top: 0;
}

.kach-toc {
    position: relative;
    margin: 0 0 30px;
    padding: 18px 18px 16px;
    border-radius: 22px;
    border: 1px solid #F2D9E3;
    background: linear-gradient(160deg, #FFF 0%, #FFF8FB 58%, #FDF6FF 100%);
    box-shadow: 0 10px 22px rgba(237, 185, 200, 0.16);
    overflow: hidden;
}

.kach-toc::before,
.kach-toc::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.kach-toc::before {
    width: 120px;
    height: 120px;
    right: -40px;
    top: -46px;
    background: rgba(237, 185, 200, 0.22);
}

.kach-toc::after {
    width: 84px;
    height: 84px;
    left: -24px;
    bottom: -24px;
    background: rgba(168, 216, 240, 0.2);
}

.kach-toc__header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.kach-toc__eyebrow {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--kach-primary-dark);
    font-weight: 700;
}

.kach-toc__title {
    margin: 4px 0 0;
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--kach-text-main);
}

.kach-toc__cat {
    width: 76px;
    height: 76px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid #F1D6E0;
    padding: 4px;
    box-shadow: 0 6px 14px rgba(237, 185, 200, 0.2);
    animation: kachFloat 6s ease-in-out infinite;
}

.kach-toc__cat svg {
    display: block;
    width: 100%;
    height: 100%;
}

.kach-toc__list {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.kach-toc__item a {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 12px;
    color: var(--kach-text-main);
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.5;
    transition: background 0.2s ease, transform 0.2s ease;
}

.kach-toc__item a:hover {
    background: rgba(237, 185, 200, 0.14);
    transform: translateX(2px);
}

.kach-toc__paw {
    width: 10px;
    height: 10px;
    margin-top: 0.47em;
    border-radius: 50%;
    background: var(--kach-primary);
    box-shadow:
        -7px 1px 0 -3px rgba(237, 185, 200, 0.9),
        -3px -4px 0 -3px rgba(237, 185, 200, 0.9),
        3px -4px 0 -3px rgba(237, 185, 200, 0.9),
        7px 1px 0 -3px rgba(237, 185, 200, 0.9);
    flex-shrink: 0;
}

.kach-toc__item--h3 a {
    padding-left: 24px;
    font-size: 0.92rem;
}

.kach-toc__item--h4 a {
    padding-left: 38px;
    font-size: 0.88rem;
    color: #717171;
}

.kach-main-content .entry-content>h2,
.kach-main-content .entry-content>h3,
.kach-main-content .entry-content>h4 {
    scroll-margin-top: 110px;
    color: var(--kach-text-main);
}

.kach-main-content .entry-content>h2 {
    position: relative;
    margin: 48px 0 20px;
    padding: 18px 16px 18px 66px;
    border: 1px solid #F0D4DE;
    border-radius: 18px;
    background: linear-gradient(90deg, #FFF3F8 0%, #FFF 65%);
    box-shadow: 0 6px 15px rgba(237, 185, 200, 0.14);
    font-size: 1.48rem;
    font-weight: 800;
    line-height: 1.45;
}

.kach-main-content .entry-content>h2::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #FFF;
    border: 1px solid #F2D7E1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23EDB9C8' d='M6.3 9.2 3.7 4.8l4.5 2L10.9 3l2.8 3.8 4.5-2-2.6 4.4a6.3 6.3 0 1 1-9.3 0z'/%3E%3Ccircle cx='9.2' cy='12.3' r='1' fill='%235D5D5D'/%3E%3Ccircle cx='14.8' cy='12.3' r='1' fill='%235D5D5D'/%3E%3Cpath d='M10.4 15.2c.6.6 2.6.6 3.2 0' stroke='%23D49AA9' stroke-width='1.2' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
    background-size: 22px 22px;
    background-repeat: no-repeat;
    background-position: center;
}

.kach-main-content .entry-content>h3 {
    position: relative;
    margin: 36px 0 16px;
    padding: 10px 12px 10px 20px;
    border-left: 6px solid var(--kach-secondary);
    border-bottom: 1px dashed #D8EAF4;
    font-size: 1.24rem;
    font-weight: 800;
    line-height: 1.5;
}

.kach-main-content .entry-content>h3::before {
    content: '';
    position: absolute;
    left: -11px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--kach-secondary);
    border: 2px solid #fff;
    box-shadow: 0 1px 6px rgba(138, 192, 221, 0.35);
}

.kach-main-content .entry-content>h4 {
    margin: 26px 0 14px;
    padding-left: 12px;
    border-left: 3px solid #FFDDAA;
    font-size: 1.06rem;
    font-weight: 800;
    line-height: 1.55;
}

@media (max-width: 768px) {
    .kach-toc {
        border-radius: 18px;
        padding: 16px 14px 12px;
    }

    .kach-toc__cat {
        width: 62px;
        height: 62px;
    }

    .kach-toc__item a {
        font-size: 0.92rem;
        padding: 7px 8px;
    }

    .kach-toc__item--h3 a {
        padding-left: 18px;
    }

    .kach-toc__item--h4 a {
        padding-left: 28px;
    }

    .kach-main-content .entry-content>h2 {
        font-size: 1.3rem;
        padding: 14px 12px 14px 54px;
        margin-top: 36px;
    }

    .kach-main-content .entry-content>h2::before {
        left: 12px;
        width: 30px;
        height: 30px;
        background-size: 18px 18px;
    }

    .kach-main-content .entry-content>h3 {
        font-size: 1.12rem;
    }

    .kach-main-content .entry-content>h4 {
        font-size: 1rem;
    }
}

.kach-sidebar .widget-title {
    word-break: keep-all;
    line-height: 1.4;
}

.kach-sidebar .widget ul,
.kach-sidebar .widget ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kach-sidebar .widget li+li {
    margin-top: 10px;
}

.widget {
    background: var(--kach-white);
    border-radius: var(--kach-radius-md);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--kach-bg);
    color: var(--kach-primary-dark);
}

.kach-footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.kach-footer-widgets .widget {
    margin-bottom: 0;
    border: 1px solid #F2E4EA;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

@media (max-width: 992px) {
    .kach-content-wrapper {
        flex-direction: column;
        gap: 24px;
    }

    .kach-main-content,
    .kach-sidebar {
        flex: none;
        width: 100%;
        min-width: 0;
    }

    .kach-sidebar {
        margin-top: 4px;
    }

    .kach-footer {
        padding: 44px 16px 24px;
    }

    .kach-footer-widgets {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 20px;
    }

    .kach-footer-links .footer-links-widget.widget_nav_menu .menu>li>.sub-menu {
        justify-content: center;
        gap: 8px;
    }

    .kach-footer-links .footer-links-widget.widget_nav_menu .menu>li>a {
        min-height: 50px;
        font-size: 1.02rem;
        padding: 10px 14px;
    }

    .kach-footer-links .footer-links-widget.widget_nav_menu .menu>li>.sub-menu li>a {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 0.94rem;
    }
}

/* --- Plugin Integration Overrides --- */
/* Reset plugin card styles when plugin widgets are rendered inside top-page tabs. */
.kach-tab-content .kach-plugin-ui .kach-card {
    box-shadow: none;
    padding: 0;
    border: none;
    border-radius: 0;
    margin-bottom: 0;
}

/* Adjust Plugin headings inside tabs */
.kach-tab-content .kach-plugin-ui .kach-h {
    display: none;
    /* Hide plugin's own headers as tabs have h2 */
}

/* Ensure full width for plugin forms inside tabs */
.kach-tab-content .kach-plugin-ui {
    max-width: 100%;
}

/* --- Search Widget (Cute Style) --- */
.kach-search-form {
    display: flex;
    align-items: center;
    background: #FFF;
    border: 2px solid #F0F0F0;
    border-radius: 50px;
    padding: 4px 4px 4px 16px;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.kach-search-form:focus-within {
    border-color: var(--kach-secondary);
    box-shadow: 0 0 0 4px rgba(168, 216, 240, 0.2);
}

.kach-search-form .search-field {
    border: none;
    background: transparent;
    outline: none;
    flex-grow: 1;
    font-size: 0.95rem;
    color: var(--kach-text-main);
    padding: 8px 0;
    width: 100%;
}

.kach-ui .kach-search-form .search-submit {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 8px;
    background: var(--kach-primary) !important;
    color: #fff !important;
    border: 1px solid var(--kach-primary) !important;
    cursor: pointer;
    transition: background 0.2s;
}

.kach-ui .kach-search-form .search-submit:hover {
    background: var(--kach-primary-dark) !important;
    border-color: var(--kach-primary-dark) !important;
}

.kach-ui .kach-search-form .search-submit svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    fill: none;
}

.kach-ui .kach-search-form .search-submit svg * {
    stroke: #fff;
    fill: none;
}

.kach-ui .kach-search-form .search-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(237, 185, 200, 0.3);
}

/* Sidebar search: always pastel pink background with white icon/text. */
.kach-ui .kach-sidebar .kach-search-form .search-submit,
.kach-ui .widget .kach-search-form .search-submit {
    background: var(--kach-primary) !important;
    border: 1px solid var(--kach-primary) !important;
    color: #fff !important;
}

.kach-ui .kach-sidebar .kach-search-form .search-submit:hover,
.kach-ui .widget .kach-search-form .search-submit:hover {
    background: var(--kach-primary-dark) !important;
    border-color: var(--kach-primary-dark) !important;
}

.kach-ui .kach-sidebar .kach-search-form .search-submit svg,
.kach-ui .kach-sidebar .kach-search-form .search-submit svg *,
.kach-ui .widget .kach-search-form .search-submit svg,
.kach-ui .widget .kach-search-form .search-submit svg * {
    stroke: #fff !important;
    fill: none !important;
}

/* --- Breadcrumbs --- */
.kach-breadcrumb {
    font-size: 0.85rem;
    color: var(--kach-text-light);
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.kach-breadcrumb a {
    color: var(--kach-primary-dark);
    text-decoration: none;
    font-weight: 700;
}

.kach-breadcrumb a:hover {
    text-decoration: underline;
}

.kach-breadcrumb span[aria-current="page"] {
    color: var(--kach-text-main);
    font-weight: normal;
}

/* --- Widget: Popular Posts --- */
.kach-popular-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    --kach-popular-accent: var(--kach-primary);
}

.kach-popular-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 1px solid #F0E5EA;
    border-radius: 14px;
    background: #FFF;
    position: relative;
    transition: all 0.2s ease;
}

.kach-popular-item:hover {
    border-color: var(--kach-popular-accent);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
}

.kach-popular-item:last-child {
    margin-bottom: 0;
}

/* Rank Badge */
.kach-popular-rank {
    position: absolute;
    top: -8px;
    left: -8px;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: var(--kach-popular-accent);
    color: white;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.kach-popular-rank.rank-1 {
    background: #FFD700;
}

/* Gold */
.kach-popular-rank.rank-2 {
    background: #C0C0C0;
}

/* Silver */
.kach-popular-rank.rank-3 {
    background: #CD7F32;
}

/* Bronze */

.kach-popular-thumb {
    flex-shrink: 0;
    width: 74px;
    height: 74px;
    border-radius: var(--kach-radius-sm);
    overflow: hidden;
    position: relative;
    border: 2px solid #FFF;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.kach-popular-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.kach-popular-item:hover .kach-popular-thumb img {
    transform: scale(1.1);
}

.kach-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FAFAFA;
    color: #8F8F8F;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.kach-popular-content {
    flex-grow: 1;
    min-width: 0;
}

.kach-popular-title {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--kach-text-main);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kach-popular-title:hover {
    color: var(--kach-popular-accent);
}

.kach-popular-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--kach-text-light);
}

.kach-popular-views {
    display: flex;
    align-items: center;
    gap: 4px;
}

.kach-popular-excerpt {
    margin: 7px 0 8px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #7B7B7B;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kach-popular-list--compact .kach-popular-item {
    padding: 0 0 12px;
    border: none;
    border-bottom: 1px dashed #EEE;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.kach-popular-list--compact .kach-popular-item:hover {
    border-color: transparent;
    box-shadow: none;
}

.kach-popular-list--compact .kach-popular-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.kach-popular-list--minimal .kach-popular-item {
    padding: 8px 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.kach-popular-list--minimal .kach-popular-thumb {
    width: 58px;
    height: 58px;
}

.kach-popular-list--minimal .kach-popular-rank {
    top: -5px;
    left: -5px;
    min-width: 20px;
    height: 20px;
    font-size: 0.66rem;
}

.kach-popular-list--soft .kach-popular-item {
    border-color: #F1DFE6;
    background: linear-gradient(180deg, #FFF 0%, #FFF8FB 100%);
}

.kach-popular-list--bordered .kach-popular-item {
    border-width: 2px;
    border-color: #E9D4DC;
}

.kach-popular-list--plain .kach-popular-item {
    background: #FFF;
    border-color: #F2F2F2;
    box-shadow: none;
}

/* --- Site Sale Floating Widget --- */
.kach-sale-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    border: 2px solid var(--kach-primary);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    overflow: hidden;
    animation: slideInUp 0.5s ease;
    max-width: 300px;
    display: flex;
}

.kach-sale-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--kach-text-main);
    transition: background 0.2s;
}

.kach-sale-link:hover {
    background: #FFF0F5;
}

.kach-sale-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--kach-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.kach-sale-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kach-sale-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--kach-text-light);
    font-weight: 700;
}

.kach-pr-tag {
    background: var(--kach-accent);
    color: var(--kach-text-main);
    font-size: 0.65rem;
    padding: 1px 4px;
    border-radius: 4px;
}

.kach-sale-title {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
}

.kach-sale-sub {
    font-size: 0.8rem;
    color: var(--kach-primary-dark);
    font-weight: 700;
    margin-top: 2px;
}

.kach-sale-meta {
    font-size: 0.65rem;
    color: #999;
    font-weight: 400;
    margin-top: 4px;
    letter-spacing: 0.02em;
}

.kach-sale-close {
    position: absolute;
    top: 4px;
    right: 4px;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    color: #aaa;
    cursor: pointer;
    padding: 0 4px;
}

.kach-sale-close:hover {
    color: var(--kach-text-main);
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .kach-container {
        padding: 0 14px;
    }

    .kach-sale-widget {
        left: 20px;
        /* Full width minus margin */
        right: 20px;
        max-width: none;
        bottom: 80px;
        /* Avoid potential bottom navigation */
    }

    /* --- Mobile Header Adjustments --- */
    .kach-header {
        padding: 10px 16px;
    }

    .kach-header-nav {
        display: none;
        /* Hide Desktop Menu */
    }

    .kach-logo svg {
        width: 32px;
        height: 32px;
    }

    .kach-logo {
        font-size: 0.95rem;
    }

    .kach-logo-link {
        max-width: calc(100vw - 190px);
    }

    /* Header Layout for Mobile */
    .kach-header {
        justify-content: space-between;
    }

    /* Adjust My Page Button on Mobile */
    .kach-header-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .kach-content-wrapper {
        margin-top: 24px;
        margin-bottom: 24px;
    }

    .kach-tab-content {
        padding: 18px 14px;
    }

    .kach-record-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .widget .search-form {
        flex-wrap: wrap;
        gap: 8px;
    }

    .widget .search-form:not(.kach-search-form) .search-submit,
    .kach-sidebar .wp-block-search__button {
        min-width: 72px;
        min-height: 44px;
        padding: 0 12px;
    }

    .widget {
        padding: 16px;
    }

    /* Hamburger Menu Button */
    .kach-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        margin-left: 12px;
        /* Space from My Page button */
        z-index: 1001;
        /* Above drawer */
    }

    .kach-menu-toggle span {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--kach-text-main);
        border-radius: 2px;
        transition: all 0.3s;
    }

    /* Mobile Drawer */
    .kach-mobile-drawer {
        display: block;
        position: fixed;
        top: 0;
        right: -280px;
        /* Hidden by default */
        width: 280px;
        height: 100%;
        background: #FFF;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
        z-index: 2000;
        transition: right 0.3s ease;
        padding: 60px 20px 20px;
        box-sizing: border-box;
    }

    .kach-mobile-drawer.is-open {
        right: 0;
    }

    /* Drawer Close Button */
    .kach-drawer-close {
        position: absolute;
        top: 10px;
        right: 16px;
        font-size: 2rem;
        background: transparent;
        border: none;
        color: var(--kach-text-light);
        cursor: pointer;
    }

    /* Mobile Menu List */
    .kach-mobile-menu-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .kach-mobile-menu-list li {
        border-bottom: 1px solid #f0f0f0;
    }

    .kach-mobile-menu-list li a {
        display: block;
        padding: 16px 0;
        color: var(--kach-text-main);
        text-decoration: none;
        font-weight: 500;
    }

    /* Overlay */
    .kach-mobile-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s;
    }

    .kach-mobile-overlay.is-open {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 480px) {
    .kach-trust-grid {
        grid-template-columns: 1fr;
    }

    .kach-section-head a {
        width: 100%;
    }
}

/* Hide Hamburger on Desktop */
@media (min-width: 769px) {

    .kach-menu-toggle,
    .kach-mobile-drawer,
    .kach-mobile-overlay {
        display: none !important;
    }
}
