:root {
    --site-font-body: 'Noto Sans JP', sans-serif;
    --site-font-brand: 'Zen Maru Gothic', sans-serif;
    /* 緑系 */
    --primary-green: #1b5e4a;
    --accent-green: #2e7d5e;
    --light-green: #4caf8a;
    --bright-green: #52d9a0;
    /* 青系 */
    --primary-blue: #0d3d6b;
    --accent-blue: #1565c0;
    --light-blue: #29b6f6;
    --bright-blue: #4dd0e1;
    /* ティール（中間色） */
    --teal-dark: #00455a;
    --teal-mid: #00796b;
    --teal-light: #26c6da;
    /* 共通 */
    --bg-base: #e8f5f2;
    --text-dark: #1a2e26;
    --text-light: #5a7a72;
    --border-color: #b2e8de;
    --shadow: 0 2px 8px rgba(0, 60, 60, 0.10);
    --shadow-hover: 0 6px 20px rgba(0, 100, 90, 0.22);
    /* Twitter風 */
    --tw-blue: #1d9bf0;
    --tw-green: #00ba7c;
    --tw-pink: #f91880;
    --tw-border: #eff3f4;
    --tw-bg-hover: #f7f9f9;
    --tw-text-secondary: #536471;
}

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

body {
    font-family: var(--site-font-body);
    background:
        radial-gradient(circle at 8% 4%, rgba(38, 198, 218, 0.18), transparent 30rem),
        radial-gradient(circle at 92% 18%, rgba(99, 102, 241, 0.13), transparent 34rem),
        linear-gradient(180deg, #f7fbff 0%, #f2faf8 55%, #f8fbff 100%);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── ヘッダー ─── */
.header {
    background: linear-gradient(135deg, #0d4a3a 0%, #0d5c7a 50%, #0d3d6b 100%);
    box-shadow: 0 2px 16px rgba(0, 50, 50, 0.28);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.8rem 0;
}
.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-family: var(--site-font-brand);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.25);
    letter-spacing: 0.1em;
}
.logo-link {
    color: inherit;
    text-decoration: none;
}
.logo-link:hover { opacity: 0.9; }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.header-nav { display: flex; gap: 1.5rem; }
.character-language-toggle {
    min-width: 52px;
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(255,255,255,0.72);
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}
.character-language-toggle:hover,
.character-language-toggle:focus-visible {
    background: rgba(255,255,255,0.24);
    outline: 2px solid rgba(255,255,255,0.8);
    outline-offset: 2px;
}
.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* ─── メインコンテンツ ─── */
.main-content { flex: 1; padding: 3rem 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* ─── 検索 ─── */
.search-section { margin-bottom: 2rem; }
.search-box { position: relative; max-width: 600px; margin: 0 auto; }
.search-icon {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--teal-mid); font-size: 1.2rem;
}
.search-input {
    width: 100%; padding: 1rem 3rem; border: 2px solid var(--border-color);
    border-radius: 50px; font-size: 1rem; background: white; transition: all 0.3s ease;
}
.search-input:focus {
    outline: none; border-color: var(--teal-mid);
    box-shadow: 0 0 0 3px rgba(0, 121, 107, 0.15);
}
.clear-btn {
    position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-light); font-size: 1.2rem;
    cursor: pointer; padding: 0.5rem; border-radius: 50%; transition: all 0.3s ease;
}
.clear-btn:hover { background: rgba(0,0,0,0.05); color: var(--text-dark); }

/* ─── タグ ─── */
.tags-section { margin-bottom: 2rem; }
.tags-container { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }
.portal-filters {
    width: fit-content; max-width: 100%; margin: 0 auto 2rem; padding: 0;
    display: grid; gap: 0.45rem; background: transparent;
    border: 0; border-radius: 0;
    box-shadow: none; backdrop-filter: none;
}
.portal-primary-filters { gap: 0.3rem; }
.portal-primary-filters .tag-btn {
    min-width: 190px; min-height: 52px; justify-content: center; padding: 0.75rem 1.6rem;
    font-size: 1.05rem; font-weight: 700; border: 0; border-radius: 0;
}
.portal-secondary-filters {
    padding-top: 0; border-top: 0; gap: 0.35rem;
}
.portal-secondary-filters .tag-btn {
    padding: 0.42rem 0.9rem; border-width: 1px; border-radius: 0; font-size: 0.82rem;
}
.portal-secondary-filters .tag-btn i { display: none; }
.tag-btn {
    padding: 0.6rem 1.2rem; border: 2px solid var(--teal-mid); background: white;
    color: var(--teal-mid); border-radius: 50px; font-size: 0.9rem; font-weight: 500;
    cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; gap: 0.5rem;
}
.tag-btn:hover {
    background: var(--teal-light); color: white; border-color: var(--teal-light);
    transform: translateY(-2px); box-shadow: var(--shadow-hover);
}
.tag-btn.active {
    background: linear-gradient(135deg, var(--teal-mid) 0%, var(--teal-light) 100%);
    color: white; border-color: var(--teal-mid);
}

/* ─── ツールグリッド ─── */
.tools-section { margin-bottom: 3rem; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }

/* ─── ツールカード ─── */
.tool-card {
    background: white; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
    transition: all 0.3s ease; cursor: pointer; border: 2px solid transparent;
    display: flex; flex-direction: column;
}
.tool-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); border-color: var(--teal-mid); }
.tool-cover {
    width: 100%; height: 130px; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; flex-shrink: 0;
}
.tool-cover-icon { font-size: 2.8rem; color: rgba(255,255,255,0.90); filter: drop-shadow(0 2px 6px rgba(0,0,0,0.20)); }
/* 期間限定マーク（カバー左上） */
.tool-limited-badge {
    position: absolute; top: 8px; left: 8px; z-index: 2;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 0.24rem 0.62rem;
    background: linear-gradient(135deg, #ff3b30 0%, #e0245e 100%);
    color: #fff; border-radius: 999px;
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.02em; line-height: 1;
    border: 1.5px solid rgba(255, 255, 255, 0.88);
    box-shadow: 0 3px 10px rgba(224, 36, 94, 0.42);
}
.tool-limited-badge i { font-size: 0.62rem; }
.tool-cover-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tool-body { padding: 1.2rem 1.4rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.tool-title { font-size: 1.15rem; font-weight: 700; color: var(--teal-dark); margin-bottom: 0.45rem; }
.tool-description { color: var(--text-light); font-size: 0.88rem; margin-bottom: 0.9rem; line-height: 1.65; flex: 1; }
.tool-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tool-tag {
    display: inline-block; padding: 0.28rem 0.75rem;
    background: linear-gradient(135deg, var(--teal-mid) 0%, var(--teal-light) 100%);
    color: white; border-radius: 0; font-size: 0.72rem; font-weight: 500;
}
.no-results { text-align: center; padding: 3rem; color: var(--text-light); }
.no-results i { font-size: 3rem; margin-bottom: 1rem; display: block; opacity: 0.5; }

/* ─── 関連ツール（画像内タイトルを主役にした共通カード） ─── */
.related-tools-section { padding: 2.5rem 0 1rem; margin-top: 1.5rem; border-top: 1px solid rgba(15, 23, 42, 0.18); }
.related-tools-container { container-type: inline-size; }
.related-tools-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem;
}
.related-tools-title { font-size: 1.05rem; font-weight: 800; color: var(--teal-dark); letter-spacing: 0.02em; }
.related-tools-more {
    display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.42rem 0.72rem;
    border: 1px solid rgba(0, 69, 90, 0.14); border-radius: 999px;
    background: rgba(255,255,255,0.72); color: var(--teal-dark);
    font-size: 0.74rem; font-weight: 700; text-decoration: none; white-space: nowrap;
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.related-tools-more:hover { transform: translateY(-2px); background: #fff; box-shadow: 0 8px 20px rgba(32,69,88,0.1); }
.related-tools-more i { font-size: 0.68rem; }
.related-tools-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; }
a.related-tool-card {
    position: relative; display: block; min-width: 0; overflow: hidden;
    border: 1px solid rgba(15,49,60,0.1); border-radius: 16px;
    color: inherit; text-decoration: none; box-shadow: 0 10px 28px rgba(32,69,88,0.09);
    animation: relatedCardIn 0.55s cubic-bezier(.2,.75,.2,1) backwards;
}
.related-tool-card:nth-child(2) { animation-delay: 0.06s; }
.related-tool-card:nth-child(3) { animation-delay: 0.12s; }
.related-tool-card:nth-child(4) { animation-delay: 0.18s; }
.related-tool-card:nth-child(5) { animation-delay: 0.24s; }
.related-tool-card:nth-child(6) { animation-delay: 0.30s; }
.related-tool-card .tool-cover { height: auto; aspect-ratio: 16 / 9; }
.related-tool-card .tool-cover-image { transition: transform 0.45s cubic-bezier(.2,.7,.2,1), filter 0.35s ease; }
.related-tool-card:hover { transform: translateY(-4px); border-color: rgba(0,121,107,0.25); box-shadow: 0 18px 38px rgba(32,69,88,0.15); }
.related-tool-card:hover .tool-cover-image { transform: scale(1.04); filter: saturate(1.06); }
.related-tool-open {
    position: absolute; right: 0.65rem; bottom: 0.6rem; z-index: 2;
    display: grid; width: 28px; height: 28px; place-items: center;
    border-radius: 50%; background: rgba(255,255,255,0.94); color: #103f4a;
    box-shadow: 0 5px 14px rgba(12,35,45,0.15); font-size: 0.68rem;
    transition: transform 0.25s ease;
}
.related-tool-card:hover .related-tool-open { transform: translateX(3px); }
.related-tools-section--compact{margin-top:1rem;padding:1rem 0 .25rem;border-top-color:rgba(15,23,42,.1)}
.related-tools-section--compact .related-tools-header{margin-bottom:.55rem}
.related-tools-section--compact .related-tools-title{font-size:.82rem;color:#60747a}
.related-tools-section--compact .related-tools-more{padding:.28rem .52rem;font-size:.62rem;box-shadow:none}
.related-tools-section--compact .related-tools-grid{grid-template-columns:repeat(4,minmax(0,1fr));max-width:860px;gap:.55rem}
.related-tools-section--compact .related-tool-card{border-radius:10px;box-shadow:0 5px 14px rgba(32,69,88,.07)}
.related-tools-section--compact .related-tool-open{width:23px;height:23px;font-size:.55rem}
@media(max-width:768px){.related-tools-section--compact .related-tools-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-width:none}}

.common-color-modal__panel { width:min(390px,calc(100vw - 1.5rem)); }
.common-color-tabs { display:grid; grid-template-columns:1fr 1fr; gap:4px; margin:0 0 .9rem; padding:4px; border:1px solid #d9e6e3; border-radius:999px; background:#f3f7f6; }
.common-color-tabs button { min-height:38px; border:0; border-radius:999px; background:transparent; color:#526b70; font:700 .82rem/1 sans-serif; cursor:pointer; }
.common-color-tabs button.is-active { background:#104c5b; color:#fff; box-shadow:0 3px 9px rgba(15,49,60,.18); }
.common-color-view { display:none; }
.common-color-view.is-active { display:block; }
.common-color-wheel-wrap { position:relative; width:min(280px,75vw); aspect-ratio:1; margin:.25rem auto 1rem; touch-action:none; }
.common-color-wheel { display:block; width:100%; height:100%; border-radius:50%; box-shadow:0 7px 24px rgba(15,49,60,.14); cursor:crosshair; }
.common-color-cursor { position:absolute; width:20px; height:20px; border:3px solid #fff; border-radius:50%; box-shadow:0 0 0 2px #17252b,0 2px 5px rgba(0,0,0,.3); transform:translate(-50%,-50%); pointer-events:none; }
.common-color-value { display:grid; grid-template-columns:46px 1fr; gap:.65rem; align-items:center; margin-bottom:.8rem; }
.common-color-value > span { width:46px; height:42px; border:1px solid rgba(15,49,60,.16); border-radius:9px; }
.common-color-hex { min-width:0; min-height:46px; padding:.65rem .8rem; border:1px solid #cbdeda; border-radius:8px; background:#fff; color:#173f46; font:700 1rem/1 monospace; text-transform:uppercase; }
.common-color-hex:focus { outline:none; border-color:var(--teal-mid); box-shadow:0 0 0 3px rgba(20,115,103,.1); }
.common-color-brightness { display:grid; grid-template-columns:auto 1fr; gap:.75rem; align-items:center; margin-bottom:.8rem; color:#173f46; font-size:.82rem; font-weight:700; }
.common-color-brightness input { width:100%; accent-color:var(--teal-mid); }
.common-color-gradient-toggle{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin:0 0 .8rem;color:#173f46;font-size:.82rem;font-weight:700}.common-color-gradient-toggle input{position:absolute;opacity:0}.common-color-gradient-toggle i{position:relative;width:42px;height:24px;border-radius:999px;background:#b6c7c5;cursor:pointer;transition:.2s}.common-color-gradient-toggle i::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 2px 5px rgba(0,0,0,.18);transition:.2s}.common-color-gradient-toggle input:checked+i{background:#0f766e}.common-color-gradient-toggle input:checked+i::after{transform:translateX(18px)}
.common-color-palette32 { display:grid; grid-template-columns:repeat(8,1fr); gap:8px; margin:.35rem 0 1rem; }
.common-color-palette32 button { aspect-ratio:1; min-width:0; padding:0; border:3px solid #fff; border-radius:50%; background:var(--palette-color); box-shadow:0 0 0 1px rgba(15,49,60,.2); cursor:pointer; transition:transform .15s ease,box-shadow .15s ease; }
.common-color-palette32 button:hover,.common-color-palette32 button:focus-visible { transform:scale(1.12); box-shadow:0 0 0 3px #147367; outline:none; }
.common-color-palette32 button.is-active { transform:scale(1.08); box-shadow:0 0 0 3px #104c5b; }

@keyframes relatedCardIn {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@container (max-width: 768px) {
    .related-tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .related-tools-section {
        margin-top: 1rem;
        padding: 1.25rem 0 0.5rem;
    }
    .related-tools-header {
        margin-bottom: 0.75rem;
    }
    .related-tools-title { font-size: 0.95rem; }
    .related-tools-more { padding: 0.35rem 0.62rem; font-size: 0.7rem; }
    .tools-grid.related-tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }
    .related-tool-card { min-width: 0; border-radius: 11px; border-width: 1px; }
    .related-tool-card .tool-cover { height: auto; aspect-ratio: 16 / 9; }
    .related-tool-open { right: 0.4rem; bottom: 0.38rem; width: 24px; height: 24px; font-size: 0.58rem; }
}

/* ─── ブログページ（Twitter風） ─── */
.blog-main { background: #f7f9f9; padding: 0; }
.blog-container { max-width: 620px; margin: 0 auto; padding: 0; }
.blog-feed {
    background: white; border-left: 1px solid var(--tw-border);
    border-right: 1px solid var(--tw-border); min-height: 80vh;
}

/* タイムライン */
.timeline { display: flex; flex-direction: column; }

/* ツイート風カード */
.post-card {
    padding: 12px 16px; border-bottom: 1px solid var(--tw-border);
    transition: background 0.2s ease; display: flex; gap: 12px;
    background: white; cursor: pointer;
}
.post-card:hover { background: var(--tw-bg-hover); }

/* アバター */
.post-avatar {
    width: 40px; height: 40px; min-width: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-mid) 0%, var(--teal-light) 100%);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.1rem; flex-shrink: 0; overflow: hidden;
}
.post-avatar-lg { width: 48px; height: 48px; min-width: 48px; font-size: 1.3rem; }
.avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ツイート本文エリア */
.post-body { flex: 1; min-width: 0; }
.post-header { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; flex-wrap: wrap; }
.post-author { font-weight: 700; font-size: 0.95rem; color: var(--text-dark); }
.post-handle { color: var(--tw-text-secondary); font-size: 0.9rem; }
.post-dot { color: var(--tw-text-secondary); font-size: 0.9rem; }
.post-time { font-size: 0.9rem; color: var(--tw-text-secondary); }
.post-content { margin-bottom: 12px; line-height: 1.6; color: var(--text-dark); font-size: 0.95rem; word-break: break-word; }
.hashtag { color: var(--teal-mid); font-weight: 500; }
.read-more { color: var(--teal-mid); cursor: pointer; font-size: 0.9rem; }
.post-image { width: 100%; max-height: 400px; object-fit: cover; border-radius: 16px; border: 1px solid var(--tw-border); margin-bottom: 12px; }

/* アクションボタン */
.post-actions { display: flex; justify-content: space-between; max-width: 300px; }
.post-action {
    display: flex; align-items: center; gap: 6px; color: var(--tw-text-secondary);
    cursor: pointer; transition: all 0.2s ease; background: none; border: none;
    font-size: 0.85rem; padding: 6px; border-radius: 50px;
}
.post-action.action-reply:hover { color: var(--tw-blue); }
.post-action.action-retweet:hover { color: var(--tw-green); }
.post-action.action-like:hover { color: var(--tw-pink); }
.post-action.liked { color: var(--tw-pink); }
.post-action.retweeted { color: var(--tw-green); }

.no-posts { text-align: center; padding: 3rem 2rem; color: var(--tw-text-secondary); }

/* ─── ツイート詳細モーダル ─── */
.tweet-modal-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4);
    z-index: 2000; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.25s ease;
}
.tweet-modal-overlay.active { opacity: 1; visibility: visible; }
.tweet-modal {
    background: white; border-radius: 16px; width: 90%; max-width: 600px;
    max-height: 90vh; overflow-y: auto; position: relative;
    transform: scale(0.9); transition: transform 0.25s ease;
}
.tweet-modal-overlay.active .tweet-modal { transform: scale(1); }
.tweet-modal-close {
    position: absolute; top: 8px; left: 8px; width: 36px; height: 36px;
    border-radius: 50%; border: none; background: none; font-size: 1.1rem;
    color: var(--text-dark); cursor: pointer; display: flex; align-items: center;
    justify-content: center; transition: background 0.2s ease; z-index: 1;
}
.tweet-modal-close:hover { background: rgba(0, 0, 0, 0.07); }
.tweet-modal-content { padding: 48px 16px 16px; }
.modal-tweet-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.modal-tweet-header .post-author { font-size: 1rem; }
.modal-tweet-header .post-handle { font-size: 0.9rem; }
.modal-tweet-content { font-size: 1.2rem; line-height: 1.7; color: var(--text-dark); margin-bottom: 16px; }
.modal-tweet-time { color: var(--tw-text-secondary); font-size: 0.9rem; padding-bottom: 12px; border-bottom: 1px solid var(--tw-border); }
.modal-tweet-stats { display: flex; gap: 1.5rem; padding: 12px 0; border-bottom: 1px solid var(--tw-border); font-size: 0.9rem; color: var(--tw-text-secondary); }
.modal-tweet-stats strong { color: var(--text-dark); }
.modal-tweet-actions { display: flex; justify-content: space-around; padding: 8px 0; border-bottom: 1px solid var(--tw-border); }
.modal-tweet-actions .post-action { padding: 10px; font-size: 1.2rem; }

/* ─── フッター ─── */
.footer {
    background: linear-gradient(135deg, #0d4a3a 0%, #0d5c7a 50%, #0d3d6b 100%);
    color: white; padding: 2rem 0; margin-top: auto;
}
.footer-content { max-width: 1200px; margin: 0 auto; padding: 0 2rem; text-align: center; }
.social-links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 1.5rem; }
.social-link {
    width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center; color: white;
    font-size: 1.3rem; text-decoration: none; transition: all 0.3s ease; border: 2px solid transparent;
}
.social-link:hover {
    background: rgba(255,255,255,0.2); border-color: var(--teal-light);
    transform: translateY(-4px); box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.social-tooltip-wrapper {
    position: relative;
    display: inline-flex;
}
.social-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(8px) scale(0.96);
    min-width: 260px;
    max-width: min(86vw, 340px);
    background: rgba(255, 255, 255, 0.96);
    border-radius: 14px;
    border: 1px solid rgba(180, 220, 214, 0.9);
    box-shadow: 0 16px 34px rgba(0, 28, 40, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.68rem 0.78rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1002;
    text-align: center;
}
.social-tooltip::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 9px solid rgba(255, 255, 255, 0.96);
}
.social-tooltip-wrapper:hover .social-tooltip,
.social-tooltip-wrapper:focus-within .social-tooltip,
.social-tooltip-wrapper.active .social-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}
.social-tooltip-title {
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--teal-dark);
    letter-spacing: 0.01em;
}
.social-tooltip-divider {
    width: min(88%, 220px);
    margin: 0.38rem auto 0.42rem;
    border-top: 1px solid transparent;
    border-image: linear-gradient(
        90deg,
        rgba(38, 198, 218, 0.08) 0%,
        rgba(38, 198, 218, 0.45) 22%,
        rgba(13, 92, 122, 0.62) 50%,
        rgba(38, 198, 218, 0.45) 78%,
        rgba(38, 198, 218, 0.08) 100%
    ) 1;
}
.social-tooltip-text {
    color: var(--text-light);
    font-size: 0.78rem;
    line-height: 1.5;
    white-space: pre-line;
}
.copyright { font-size: 0.9rem; opacity: 0.8; }
.footer-policy-link { margin-top: 0.4rem; }
.footer-text-btn {
    background: none; border: none; padding: 0;
    color: rgba(255,255,255,0.55); font: inherit; font-size: 0.8rem;
    cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.footer-text-btn:hover { color: rgba(255,255,255,0.9); }

/* ─── プライバシーポリシー モーダル ─── */
.pp-modal[hidden] { display: none; }
.pp-modal {
    position: fixed; inset: 0; z-index: 9000;
    display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 560px) {
    .pp-modal { align-items: center; }
}
.pp-modal__backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.52);
}
.pp-modal__panel {
    position: relative; z-index: 1;
    width: min(600px, 100%);
    max-height: 85vh;
    display: flex; flex-direction: column;
    background: #fff; border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.18);
    overflow: hidden;
}
@media (min-width: 560px) {
    .pp-modal__panel { border-radius: 18px; max-height: 80vh; }
}
.pp-modal__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.2rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.pp-modal__title { margin: 0; font-size: 1rem; font-weight: 900; color: #1f2937; }
.pp-modal__close {
    width: 32px; height: 32px; border-radius: 50%; border: none;
    background: #f3f4f6; color: #6b7280; cursor: pointer; font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center;
}
.pp-modal__close:hover { background: #e5e7eb; }
.pp-modal__body {
    overflow-y: auto; padding: 1rem 1.2rem 1.5rem;
    color: #374151; font-size: 0.88rem; line-height: 1.75;
    text-align: center;
}
.pp-modal__body h3 {
    margin: 1.1rem 0 0.3rem; font-size: 0.9rem; font-weight: 700; color: #1f2937;
}
.pp-modal__body h3:first-child { margin-top: 0; }
.pp-modal__body p { margin: 0; }

/* ─── Twitter ポップアップ ─── */
.twitter-wrapper { position: relative; }
.twitter-toggle { cursor: pointer; font-family: inherit; padding: 0; }
.twitter-toggle:hover {
    background: rgba(255,255,255,0.2); border-color: var(--teal-light);
    transform: translateY(-4px); box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.twitter-popup {
    position: absolute; bottom: calc(100% + 14px); left: 50%;
    transform: translateX(-50%) translateY(8px) scale(0.96);
    background: rgba(255, 255, 255, 0.96);
    border-radius: 14px;
    border: 1px solid rgba(180, 220, 214, 0.9);
    box-shadow: 0 16px 34px rgba(0, 28, 40, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.6rem;
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1001;
}
.twitter-popup::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 9px solid rgba(255, 255, 255, 0.96);
}
.twitter-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}
.twitter-popup-head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--teal-dark);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    padding: 0.3rem 0.45rem 0.5rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid rgba(178, 232, 222, 0.75);
}
.twitter-popup-head i {
    color: var(--teal-mid);
    font-size: 0.95rem;
}
.twitter-popup-item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    min-height: 64px;
    padding: 0.7rem 0.85rem;
    box-sizing: border-box;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-dark);
    transition: background 0.2s ease, transform 0.2s ease;
}
.twitter-popup-item:hover {
    background: rgba(38, 198, 218, 0.12);
    transform: translateX(2px);
}
.twitter-popup-item > i {
    width: 24px;
    color: var(--teal-mid);
    font-size: 1.2rem;
    text-align: center;
}
.twitter-popup-item__text {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
    text-align: left;
}
.popup-label { display: block; font-weight: 700; font-size: 0.9rem; color: var(--text-dark); }
.popup-sub { display: block; font-size: 0.75rem; color: var(--text-light); }

.floating-index-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1200;
    border: 1px solid rgba(178, 232, 222, 0.95);
    border-radius: 999px;
    padding: 0.56rem 0.86rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--teal-dark);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 18px rgba(0, 45, 60, 0.18);
    cursor: pointer;
    opacity: 1;
    visibility: visible;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease,
        visibility 0s linear;
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    text-decoration: none;
}
.floating-index-btn:hover {
    transform: translateY(-2px);
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(0, 55, 70, 0.27);
}
.floating-index-btn.is-overlapping-action {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px) scale(0.96);
    transition-delay: 0s, 0s, 0s, 0s, 0.2s;
}
.floating-index-btn i { font-size: 0.78rem; }

/* ─── レスポンシブ ─── */
@media (max-width: 768px) {
    .header-content { gap: 0.75rem; padding-inline: 1rem; text-align: left; }
    .logo { min-width: 0; white-space: nowrap; }
    .header-actions { width: auto; margin-left: auto; flex-shrink: 0; }
    .header-nav { gap: 0.5rem; }
    .tools-grid { grid-template-columns: 1fr; }
    .tags-container { justify-content: flex-start; }
    .tag-btn { font-size: 0.85rem; padding: 0.5rem 1rem; }
    .portal-filters { width: 100%; box-sizing: border-box; }
    .portal-primary-filters { flex-wrap: nowrap; }
    .portal-primary-filters .tag-btn {
        min-width: 0; min-height: 48px; flex: 1; padding-inline: 0.6rem; font-size: 0.98rem;
    }
    .portal-secondary-filters { justify-content: center; }
    .container { padding: 0 0.9rem; }
    .blog-container { padding: 0 0.75rem; }
    .social-links { gap: 1rem; }
    .social-link { width: 40px; height: 40px; font-size: 1.1rem; }
    .social-tooltip {
        min-width: 220px;
        max-width: min(90vw, 300px);
    }
    .blog-feed { border-left: none; border-right: none; border-radius: 12px; overflow: hidden; }
    .floating-index-btn {
        right: 12px;
        bottom: 14px;
        padding: 0.54rem 0.78rem;
        font-size: 0.78rem;
    }
}

@media (max-width: 480px) {
    .container { padding: 0 0.7rem; }
    .blog-container { padding: 0 0.6rem; }
    .logo { font-size: 1.3rem; }
    .search-input { font-size: 0.9rem; padding: 0.9rem 2.8rem; }
    .tool-cover { height: 110px; }
    .tool-body { padding: 1rem 1.1rem 1.2rem; }
    .tool-title { font-size: 1.05rem; }
}

/* トップページ：スマホでは一覧性を優先した2列コンパクト表示 */
@media (max-width: 768px) {
    .portal-page .main-content {
        padding: 1rem 0 1.5rem;
    }

    .portal-page .search-section {
        margin-bottom: 0.75rem;
    }

    .portal-page .search-input {
        min-height: 44px;
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
    }

    .portal-page .portal-filters {
        margin-bottom: 0.85rem;
        padding: 0;
        gap: 0.3rem;
    }

    .portal-page .portal-primary-filters .tag-btn {
        min-height: 40px;
        font-size: 0.9rem;
    }

    .portal-page .portal-secondary-filters {
        padding-top: 0;
        gap: 0.25rem;
    }

    .portal-page .portal-secondary-filters .tag-btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
        padding: 0.35rem 0.25rem;
        font-size: 0.74rem;
    }

    .portal-page #toolsGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .portal-page #toolsGrid .tool-card {
        min-width: 0;
        border-radius: 9px;
        border-width: 1px;
    }

    .portal-page #toolsGrid .tool-cover {
        height: 82px;
    }

    .portal-page #toolsGrid .tool-body {
        min-width: 0;
        padding: 0.62rem 0.68rem 0.7rem;
    }

    .portal-page #toolsGrid .tool-title {
        display: -webkit-box;
        min-height: 2.7em;
        margin: 0;
        overflow: hidden;
        color: var(--teal-dark);
        font-size: 0.84rem;
        line-height: 1.35;
        word-break: break-word;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .portal-page #toolsGrid .tool-description {
        display: none;
    }

    .portal-page #toolsGrid .tool-tags {
        margin-top: 0.4rem;
        gap: 0.25rem;
    }

    .portal-page #toolsGrid .tool-tag {
        max-width: 100%;
        padding: 0.18rem 0.4rem;
        overflow: hidden;
        font-size: 0.62rem;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .portal-page #toolsGrid .tool-tag:first-child:not(:only-child) {
        display: none;
    }

    .portal-page #toolsGrid .tool-limited-badge {
        top: 4px;
        left: 4px;
        padding: 0.18rem 0.42rem;
        font-size: 0.58rem;
    }
}

@media (max-width: 360px) {
    .portal-page #toolsGrid {
        gap: 0.5rem;
    }

    .portal-page #toolsGrid .tool-cover {
        height: 72px;
    }

    .portal-page #toolsGrid .tool-body {
        padding: 0.55rem;
    }

    .portal-page #toolsGrid .tool-title {
        font-size: 0.78rem;
    }
}

/* ═══════════ トップポータル 2026 ═══════════ */
.portal-page {
    background:
        radial-gradient(circle at 8% 4%, rgba(38, 198, 218, 0.18), transparent 30rem),
        radial-gradient(circle at 92% 18%, rgba(99, 102, 241, 0.13), transparent 34rem),
        linear-gradient(180deg, #f7fbff 0%, #f2faf8 55%, #f8fbff 100%);
    background-size: 115% 115%;
    animation: portalAurora 18s ease-in-out infinite alternate;
}

.portal-page .main-content { padding: 2rem 0 5rem; }
.portal-page .container { max-width: 1380px; }

.portal-page .search-section { margin-bottom: 1.1rem; }
.portal-page .search-section { animation: none; }
.portal-page .search-box { max-width: 680px; }
.portal-page .search-input {
    min-height: 58px; padding: 0.9rem 3.3rem; border: 1px solid rgba(0, 69, 90, 0.12);
    border-radius: 18px; background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 14px 40px rgba(35, 72, 92, 0.09);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.portal-page .search-input:focus {
    border-color: rgba(0, 121, 107, 0.48);
    box-shadow: 0 16px 44px rgba(35, 72, 92, 0.12), 0 0 0 4px rgba(38, 198, 218, 0.1);
}

.portal-page .portal-filters {
    width: min(100%, 680px); margin-bottom: 2rem; gap: 0.65rem;
    animation: none;
}
.portal-page .portal-secondary-filters[hidden] { display: none !important; }
.portal-page .portal-secondary-filters:not([hidden]) {
    animation: portalFilterGroupIn 0.3s cubic-bezier(.2,.75,.2,1) backwards;
}
.portal-page .portal-primary-filters,
.portal-page .portal-secondary-filters {
    position: relative; width: fit-content; margin-inline: auto; padding: 4px;
    border: 1px solid rgba(0, 69, 90, 0.1); border-radius: 999px;
    background: rgba(255, 255, 255, 0.68); box-shadow: 0 8px 28px rgba(35, 72, 92, 0.07);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.portal-page .portal-primary-filters .tag-btn,
.portal-page .portal-secondary-filters .tag-btn {
    position: relative; z-index: 2;
    min-width: 0; min-height: 0; border: 0; border-radius: 999px; background: transparent;
    box-shadow: none; color: #567078; transform: none; white-space: nowrap;
}
.portal-page .portal-primary-filters .tag-btn { padding: 0.72rem 1.5rem; font-size: 0.9rem; }
.portal-page .portal-secondary-filters .tag-btn { padding: 0.48rem 1rem; font-size: 0.76rem; }
.portal-page .portal-primary-filters .tag-btn.active,
.portal-page .portal-secondary-filters .tag-btn.active {
    background: #d9f0f2; color: #103f4a; box-shadow: 0 5px 14px rgba(16, 63, 74, 0.12);
}
.portal-page .portal-primary-filters .tag-btn:hover,
.portal-page .portal-secondary-filters .tag-btn:hover { background: #e9f7f5; color: #103f4a; }
.portal-page .portal-primary-filters .tag-btn.active:hover,
.portal-page .portal-secondary-filters .tag-btn.active:hover { background: #d9f0f2; color: #103f4a; }
.portal-page .is-indicator-ready > .tag-btn.active,
.portal-page .is-indicator-ready > .tag-btn.active:hover {
    background: transparent; color: #103f4a; box-shadow: none;
}
.portal-filter-indicator {
    --indicator-x: 4px;
    --indicator-width: 0px;
    position: absolute; z-index: 1; top: 4px; bottom: 4px; left: 0;
    width: var(--indicator-width); border-radius: 999px;
    background: #d9f0f2; box-shadow: 0 5px 14px rgba(16, 63, 74, 0.12);
    transform: translate3d(var(--indicator-x), 0, 0);
    pointer-events: none;
}
.is-indicator-ready > .portal-filter-indicator {
    transition: width 0.38s cubic-bezier(.2,.8,.2,1), transform 0.38s cubic-bezier(.2,.8,.2,1);
}

.portal-page #toolsGrid {
    grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.15rem;
}
.portal-page #toolsGrid .tool-card {
    position: relative; display: block; min-width: 0; overflow: hidden;
    border: 1px solid rgba(15, 49, 60, 0.1); border-radius: 20px;
    background: #fff; box-shadow: 0 12px 34px rgba(32, 69, 88, 0.1);
    color: inherit; text-decoration: none; isolation: isolate;
    animation: portalCardIn 0.38s cubic-bezier(.2,.75,.2,1) both;
}
.portal-page #toolsGrid .tool-card::after {
    content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
    background: linear-gradient(115deg, transparent 28%, rgba(255,255,255,0.28) 48%, transparent 68%);
    transform: translateX(-125%); transition: transform 0.75s cubic-bezier(.2,.7,.2,1);
}
.portal-page #toolsGrid .tool-card:hover::after { transform: translateX(125%); }
.portal-page #toolsGrid .tool-card:hover {
    border-color: rgba(0, 121, 107, 0.28); transform: translateY(-5px);
    box-shadow: 0 22px 50px rgba(32, 69, 88, 0.17);
}
.portal-page #toolsGrid .tool-card:focus-visible {
    outline: 3px solid rgba(38, 198, 218, 0.65); outline-offset: 4px;
}
.portal-page #toolsGrid .tool-cover { height: auto; aspect-ratio: 16 / 9; }
.portal-page #toolsGrid .tool-cover-image { transition: transform 0.5s cubic-bezier(.2,.7,.2,1), filter 0.4s ease; }
.portal-page #toolsGrid .tool-card:hover .tool-cover-image { transform: scale(1.035); filter: saturate(1.06); }
.tool-card-chrome {
    position: absolute; inset: auto 0 0; z-index: 2; display: flex; align-items: center;
    justify-content: space-between; padding: 2.4rem 0.85rem 0.75rem;
    background: linear-gradient(180deg, transparent 0%, rgba(5, 25, 33, 0.68) 100%);
}
.tool-card-category {
    padding: 0.3rem 0.62rem; border: 1px solid rgba(255,255,255,0.42); border-radius: 999px;
    background: rgba(255,255,255,0.2); color: #fff; font-size: 0.62rem; font-weight: 700;
    letter-spacing: 0.04em; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.tool-card-category:empty { display: none; }
.tool-card-open {
    display: grid; width: 30px; height: 30px; margin-left: auto; place-items: center; border-radius: 50%;
    background: rgba(255,255,255,0.94); color: #103f4a; font-size: 0.72rem;
    transition: transform 0.25s ease, background 0.25s ease;
}
.portal-page #toolsGrid .tool-card:hover .tool-card-open { transform: translateX(3px); background: #fff; }
.portal-visually-hidden {
    position: absolute !important; width: 1px !important; height: 1px !important;
    padding: 0 !important; margin: -1px !important; overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}

body:not(.portal-page) .main-content > .container {
    animation: pageContentIn 0.55s cubic-bezier(.2,.75,.2,1) backwards;
}

@keyframes portalAurora {
    from { background-position: 0% 0%, 100% 0%, 50% 0%; }
    to { background-position: 7% 4%, 93% 7%, 50% 100%; }
}
@keyframes portalFadeUp {
    from { opacity: 0; transform: translateY(16px); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes portalCardIn {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pageContentIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes portalFilterGroupIn {
    from { opacity: 0; transform: translateY(-5px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1050px) {
    .portal-page #toolsGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .portal-page .main-content { padding: 1.6rem 0 2.5rem; }
    .portal-page .container { padding-inline: 1rem; }
    .portal-page .search-input { min-height: 50px; border-radius: 15px; }
    .portal-page .portal-filters { margin-bottom: 1.25rem; }
    .portal-page .portal-primary-filters .tag-btn { padding: 0.6rem 1.2rem; font-size: 0.78rem; }
    .portal-page .portal-play-label span { display: block; line-height: 1.05; }
    .portal-page .portal-secondary-filters { width: 100%; }
    .portal-page .portal-secondary-filters .tag-btn { padding: 0.44rem 0.5rem; }
    .portal-page #toolsGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
    .portal-page #toolsGrid .tool-card { border-radius: 13px; }
    .portal-page #toolsGrid .tool-cover { height: auto; aspect-ratio: 16 / 9; }
    .tool-card-chrome { padding: 1.8rem 0.5rem 0.45rem; }
    .tool-card-category { padding: 0.22rem 0.45rem; font-size: 0.52rem; }
    .tool-card-open { width: 25px; height: 25px; font-size: 0.62rem; }
}

@media (prefers-reduced-motion: reduce) {
    .portal-page,
    .portal-page .search-section,
    .portal-page .portal-filters,
    .portal-page .portal-secondary-filters:not([hidden]),
    .portal-page #toolsGrid .tool-card,
    .portal-page #toolsGrid .tool-cover-image,
    .related-tool-card,
    .related-tool-card .tool-cover-image,
    .related-tool-open,
    .tool-card-open,
    body:not(.portal-page) .main-content > .container {
        animation: none;
        transition: none;
    }
    .portal-page #toolsGrid .tool-card::after { display: none; }
    .portal-filter-indicator { transition: none !important; }
}

/* ═══════════ 共通モーダル土台（X共有・確認系。旧 tier-page 等から集約） ═══════════ */
.x-share-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.x-share-modal.is-open,
.x-share-modal[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;
}
.x-share-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 26, 25, 0.45);
    backdrop-filter: blur(3px);
}
.x-share-modal__panel {
    position: relative;
    width: min(520px, calc(100vw - 2rem));
    margin: max(6vh, 2rem) auto 0;
    background: linear-gradient(180deg, #ffffff 0%, #f5fbf9 100%);
    border: 1px solid #b8d8d1;
    border-radius: 16px;
    box-shadow: 0 24px 50px rgba(7, 36, 33, 0.24);
    padding: 1rem 1.1rem 1.05rem;
}
.x-share-modal__title {
    margin: 0 0 0.3rem;
    font-size: 1.1rem;
    color: #123c37;
    letter-spacing: 0.01em;
}
.x-share-modal__message {
    margin: 0;
    color: #2f5752;
    font-size: 0.94rem;
    line-height: 1.6;
}
.x-share-modal__actions {
    margin-top: 0.9rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
}
.x-share-modal__btn {
    min-width: 110px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0 1rem;
}
.x-share-modal__btn--sub {
    background: #e6f1ee;
    color: #2f5752;
}
.x-share-modal__btn--sub:hover {
    background: #d9ebe6;
}
.x-share-modal__btn--main {
    background: linear-gradient(135deg, #147367 0%, #1f8a7b 100%);
    color: #fff;
    border-color: #0f6b60;
}
.x-share-modal__btn--main:hover {
    background: linear-gradient(135deg, #0f685d 0%, #197e71 100%);
}
.x-share-modal__btn--danger {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: #fff;
    border-color: #b91c1c;
}
.x-share-modal__btn--danger:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
}
body.has-modal-open {
    overflow: hidden;
}
@media (max-width: 768px) {
    .x-share-modal__panel {
        margin-top: max(4vh, 1.25rem);
        padding: 0.9rem 0.9rem 0.95rem;
    }
    .x-share-modal__actions {
        justify-content: stretch;
    }
    .x-share-modal__btn {
        flex: 1;
        min-width: 0;
    }
}

/* ═══════════ 共通モーダル正規化（旧 layout.js ランタイム注入をソース化） ═══════════ */
/* body.common-share-modal-normalized は layout.js が付与。詳細度(0,2,1)で各ツールの素の
   .x-share-modal__* (0,1,0) に勝つため !important 不要。各ツールの素のモーダルCSSは
   独立した土台として共存（＝上書きではなく通常のカスケード）。 */
body.common-share-modal-normalized .x-share-modal__panel,
body.common-share-modal-normalized .cq-xshare-modal__panel {
    position: relative;
    width: min(440px, calc(100vw - 2rem));
    margin: 0;
    padding: 1rem 1.1rem;
    border: 2px solid #1e293b;
    border-radius: 0;
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
    text-align: left;
}
body.common-share-modal-normalized .x-share-modal,
body.common-share-modal-normalized .cq-xshare-modal {
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
body.common-share-modal-normalized .x-share-modal {
    display: flex;
}
body.common-share-modal-normalized .x-share-modal__backdrop,
body.common-share-modal-normalized .cq-xshare-modal__backdrop {
    background: rgba(12, 26, 25, 0.46);
    backdrop-filter: blur(3px);
}
body.common-share-modal-normalized .x-share-modal__title,
body.common-share-modal-normalized .cq-xshare-modal__title {
    margin: 0 0 0.75rem;
    padding-bottom: 0.65rem;
    border-bottom: 2px solid #1e293b;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0;
}
body.common-share-modal-normalized .x-share-modal__message,
body.common-share-modal-normalized .cq-xshare-modal__message {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.65;
}
body.common-share-modal-normalized .x-share-modal__actions,
body.common-share-modal-normalized .cq-xshare-modal__actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    align-items: center;
}
body.common-share-modal-normalized .x-share-modal__btn,
body.common-share-modal-normalized .cq-xshare-modal__actions .cq-btn-primary,
body.common-share-modal-normalized .cq-xshare-modal__actions .cq-btn-ghost {
    width: auto;
    min-width: 104px;
    height: auto;
    min-height: 0;
    border: 0;
    border-radius: 7px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    justify-content: center;
    gap: 0.45rem;
}
body.common-share-modal-normalized .x-share-modal__btn--sub,
body.common-share-modal-normalized .x-share-modal__btn--save,
body.common-share-modal-normalized .cq-xshare-modal__actions .cq-btn-ghost {
    border: 1px solid #1e293b;
    background: #ffffff;
    color: #64748b;
}
body.common-share-modal-normalized .x-share-modal__btn--main,
body.common-share-modal-normalized .cq-xshare-modal__actions .cq-btn-primary {
    border: 0;
    background: linear-gradient(135deg, #147367 0%, #1f8a7b 100%);
    color: #ffffff;
}
body.common-share-modal-normalized .x-share-modal__cancel,
body.common-share-modal-normalized .cq-xshare-modal__cancel {
    margin: 0;
    width: auto;
    min-width: 104px;
    border: 1px solid #1e293b;
    border-radius: 7px;
    padding: 0.75rem 1rem;
    background: #ffffff;
    color: #64748b;
    font-weight: 700;
    font-size: 0.95rem;
}
@media (max-width: 560px) {
    body.common-share-modal-normalized .x-share-modal__actions,
    body.common-share-modal-normalized .cq-xshare-modal__actions {
        display: grid;
        grid-template-columns: 1fr;
    }
    body.common-share-modal-normalized .x-share-modal__btn,
    body.common-share-modal-normalized .cq-xshare-modal__actions .cq-btn-primary,
    body.common-share-modal-normalized .cq-xshare-modal__actions .cq-btn-ghost,
    body.common-share-modal-normalized .cq-xshare-modal__cancel {
        width: 100%;
    }
}

/* ═══════════ 共通: クリックで編集できるボードタイトル ═══════════ */
.board-title-clickable {
    cursor: pointer;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    align-self: center;
    border: 1px solid rgba(127, 184, 174, 0.72);
    border-radius: 8px;
    padding: 0.35rem 0.8rem;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 1px 4px rgba(0, 40, 40, 0.08);
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
.board-title-clickable:hover {
    border-color: var(--teal-mid);
    background: #fff;
    transform: translateY(-1px);
}

/* ═══════════ 共通: テキスト編集モーダル（タイトル等の編集） ═══════════ */
.text-edit-modal,
body.common-share-modal-normalized .positioning-text-modal {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.text-edit-modal.is-open,
body.common-share-modal-normalized .positioning-text-modal.is-open {
    display: flex;
}
.text-edit-modal__backdrop,
body.common-share-modal-normalized .positioning-text-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 26, 25, 0.46);
    backdrop-filter: blur(3px);
}
.text-edit-modal__panel,
body.common-share-modal-normalized .positioning-text-modal__panel {
    position: relative;
    width: min(440px, calc(100vw - 2rem));
    background: #fff;
    border: 2px solid #1e293b;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
    padding: 1rem 1.1rem;
}
.text-edit-modal__title,
body.common-share-modal-normalized .positioning-text-modal__title {
    margin: 0 0 0.75rem;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 900;
    padding-bottom: 0.65rem;
    border-bottom: 2px solid #1e293b;
}

.custom-focus-modal {
    position: fixed;
    inset: 0;
    width: min(720px, calc(100vw - 2rem));
    height: fit-content;
    max-height: calc(100dvh - 2rem);
    margin: auto;
    box-sizing: border-box;
    overflow: auto;
}

.custom-focus-modal::backdrop {
    background: rgb(12 26 25 / 46%);
}

.custom-focus-modal__preview {
    position: relative;
    display: block;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #eef2f2;
    line-height: 0;
    cursor: grab;
    touch-action: none;
}

.custom-focus-modal__preview:active {
    cursor: grabbing;
}

.custom-focus-modal__preview img {
    display: block;
    max-width: 100%;
    max-height: min(64dvh, max(120px, calc(100dvh - 13rem)));
    user-select: none;
}

.custom-focus-modal__preview span {
    position: absolute;
    left: var(--focus-x);
    top: var(--focus-y);
    width: var(--focus-size, calc(clamp(80px, 24vw, 150px) / var(--focus-zoom, 1)));
    aspect-ratio: var(--focus-ratio, 1);
    border: 2px solid #fff;
    border-radius: 50%;
    box-sizing: border-box;
    box-shadow: 0 0 0 100vmax rgb(32 32 32 / 58%);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.custom-focus-modal__preview.is-rectangular span {
    border-radius: 0;
}

.custom-focus-modal__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.custom-focus-modal__footer .text-edit-modal__actions {
    margin: 0 0 0 auto;
}

.custom-focus-modal__zoom {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    width: min(100%, 10.5rem);
    color: var(--teal-dark, #147367);
    font-size: 0.9rem;
}

.custom-focus-modal__zoom input {
    width: 100%;
    margin: 0;
    accent-color: var(--teal-dark, #147367);
}

@media (hover: none) and (pointer: coarse) {
    .custom-focus-modal__zoom {
        display: none;
    }
}

.custom-card-editor {
    display: grid;
    gap: 0.9rem;
    color: #0f172a;
}

#editModalOverlay:has(.custom-card-editor) {
    display: grid;
    place-items: center;
    padding: 1rem;
}

:is(.edit-modal-panel, .pokemon-picker-panel):has(.custom-card-editor) {
    width: min(480px, 100%);
    max-height: calc(100dvh - 2rem);
    box-sizing: border-box;
    margin: 0;
    padding: clamp(1rem, 4vw, 1.4rem);
}

.custom-card-editor [hidden] {
    display: none !important;
}

.custom-card-editor__title {
    margin: 0;
    padding: 0 2rem 0.7rem 0;
    border-bottom: 2px solid #1e293b;
    font-size: 1.125rem;
}

.custom-card-source-menu {
    position: fixed;
    z-index: 11000;
    display: grid;
    grid-template-columns: repeat(2, 66px);
    gap: 0.25rem;
    padding: 0.3rem;
    border: 1px solid #a7c9c3;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 5px 18px #0f172a30;
}

.custom-card-source-menu::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: var(--custom-source-arrow, 50%);
    width: 8px;
    height: 8px;
    border: solid #a7c9c3;
    border-width: 0 1px 1px 0;
    background: #fff;
    transform: translateX(-50%) rotate(45deg);
    pointer-events: none;
}

.custom-card-source-menu.is-below::after {
    top: -5px;
    bottom: auto;
    border-width: 1px 0 0 1px;
}

.custom-card-source-menu > button {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.3rem;
    min-height: 54px;
    padding: 0.35rem 0.2rem;
    border: 0;
    border-radius: 0.45rem;
    background: transparent;
    color: #17434b;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.custom-card-source-menu > button:is(:hover, :focus-visible) {
    background: #eaf5f3;
}

.custom-card-source-menu > button i {
    font-size: 1.15rem;
}

.custom-card-source-menu > button img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.custom-card-source-menu.is-searching {
    display: block;
    width: min(320px, calc(100vw - 16px));
    box-sizing: border-box;
    padding: 0.65rem;
}

.game-work-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.game-work-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 64px;
    padding: 0.6rem 0.8rem;
    border: 2px solid #d7e3e0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.game-work-option img {
    display: block;
    max-width: min(150px, 100%);
    max-height: 38px;
    object-fit: contain;
}

.game-work-option:is(:hover, .is-active) {
    border-color: var(--teal-mid);
}

.game-work-option.is-active {
    background: #edf8f6;
    box-shadow: 0 0 0 3px rgb(20 115 103 / 10%);
}

@media (max-width: 600px) {
    .game-work-option {
        width: calc(50% - 0.35rem);
        height: 56px;
    }
}

.custom-card-editor__name {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: end;
    gap: 0.5rem;
}

.positioning-x-user-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    min-height: 44px;
    padding: 0 0.7rem 0 0.15rem;
    border: 1px solid #dadce0;
    border-radius: 999px;
    background: #fff;
    color: #202124;
}

.positioning-x-user-row:hover,
.positioning-x-user-row:focus-within {
    box-shadow: 0 1px 6px rgb(32 33 36 / 22%);
}

.positioning-x-user-row:focus-within {
    border-color: #767d86;
}

.positioning-x-user-row .positioning-x-user-input {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 0 0.15rem;
    border: 0;
    outline: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 1rem;
}

.positioning-x-user-search {
    display: grid;
    place-items: center;
    justify-self: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
}

.positioning-x-user-search:is(:hover, :focus-visible) {
    background: #f1f3f4;
    color: #202124;
}

.custom-image-select,
.custom-card-editor__media button,
:is(.custom-card-editor, .custom-card-source-menu.is-searching) .positioning-x-user-candidate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 42px;
    padding: 0.4rem 0.65rem;
    border: 1px solid #cfe1de;
    border-radius: 8px;
    background: #fff;
    color: #17434b;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.custom-image-select:hover:enabled,
.custom-card-editor__media button:hover,
:is(.custom-card-editor, .custom-card-source-menu.is-searching) .positioning-x-user-candidate:hover {
    border-color: #147367;
    background: #eaf5f3;
}

.custom-card-editor__form,
:is(.custom-card-editor, .custom-card-source-menu.is-searching) .positioning-x-user-add {
    display: grid;
    gap: 0.7rem;
}

.custom-card-editor__media {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.custom-card-editor__preview {
    display: block;
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.custom-card-editor__preview.is-avatar {
    border-radius: 50%;
    object-fit: cover;
}

.custom-card-editor__name label {
    display: grid;
    gap: 0.3rem;
    font-size: 0.9rem;
    font-weight: 700;
}

.custom-card-editor__name input[type="text"] {
    width: 100%;
    min-width: 0;
    height: 44px;
    box-sizing: border-box;
    padding: 0.45rem 0.65rem;
    border: 1px solid #cfe1de;
    border-radius: 8px;
    background: #fff;
    color: inherit;
    font: inherit;
}

.custom-card-editor__color {
    height: 44px;
    border: 1px solid #bccdc9;
    border-radius: 8px;
    cursor: pointer;
}

.custom-card-editor .positioning-menu--x-user {
    width: auto;
    min-width: 0;
    padding: 0;
}

:is(.custom-card-editor, .custom-card-source-menu.is-searching) .positioning-x-user-hint,
:is(.custom-card-editor, .custom-card-source-menu.is-searching) .positioning-x-user-note,
.custom-card-editor__error {
    margin: 0;
    font-size: 0.8rem;
}

.custom-card-editor__error {
    color: #9b2c2c;
}

.custom-card-editor .text-edit-modal__actions {
    margin: 0;
}

.custom-card-editor button:disabled {
    opacity: 0.5;
    cursor: default;
}

.text-edit-modal__input,
body.common-share-modal-normalized .positioning-text-modal__input {
    display: block;
    width: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 0;
    padding: 0.58rem 0.68rem;
    font: inherit;
    font-size: 0.95rem;
    color: #0f172a;
    box-sizing: border-box;
}
.text-edit-modal__textarea,
body.common-share-modal-normalized .positioning-text-modal__textarea {
    min-height: 7rem;
    resize: vertical;
    line-height: 1.45;
    white-space: pre-wrap;
}
.text-edit-modal__input:focus,
body.common-share-modal-normalized .positioning-text-modal__input:focus {
    outline: none;
    border-color: #147367;
    box-shadow: 0 0 0 3px rgba(20, 115, 103, 0.15);
}
.text-edit-modal__actions,
body.common-share-modal-normalized .positioning-text-modal__actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
.text-edit-modal__actions .edit-cancel-btn,
.text-edit-modal__actions .edit-save-btn,
body.common-share-modal-normalized .positioning-text-modal__actions .edit-cancel-btn,
body.common-share-modal-normalized .positioning-text-modal__actions .edit-save-btn {
    min-width: 104px;
    border: none;
    border-radius: 7px;
    padding: 0.75rem 1rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}
.text-edit-modal__actions .edit-cancel-btn,
body.common-share-modal-normalized .positioning-text-modal__actions .edit-cancel-btn {
    color: #64748b;
    border: 1px solid #1e293b;
    background: #ffffff;
}
.text-edit-modal__actions .edit-save-btn,
body.common-share-modal-normalized .positioning-text-modal__actions .edit-save-btn {
    color: #fff;
    background: linear-gradient(135deg, #147367 0%, #1f8a7b 100%);
}
.text-edit-modal__actions .edit-save-btn:hover,
body.common-share-modal-normalized .positioning-text-modal__actions .edit-save-btn:hover {
    filter: brightness(0.92);
}

.common-choice-modal__panel {
    width: min(460px, calc(100vw - 2rem));
}

.common-choice-modal__choices {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.common-choice-modal__choice {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.25rem 0.8rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid #d5e3e0;
    border-radius: 12px;
    background: #fff;
    color: #163f3a;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.common-choice-modal__choice:hover,
.common-choice-modal__choice:focus-visible {
    border-color: #1f8a7b;
    background: #eef8f6;
}

.common-choice-modal__choice.is-danger {
    border-color: #e8c8cd;
    color: #8f3d4a;
}

.common-choice-modal__choice.is-danger:hover,
.common-choice-modal__choice.is-danger:focus-visible {
    border-color: #b44c5d;
    background: #fff2f4;
}

.common-choice-modal__choice img {
    grid-row: 1 / span 2;
    width: 92px;
    height: 48px;
    object-fit: contain;
}

.common-choice-modal__label {
    font-weight: 800;
}

.common-choice-modal__choice small {
    color: #64748b;
    line-height: 1.4;
}

.common-choice-modal__note {
    margin: 0.8rem 0 0;
    color: #64748b;
    font-size: 0.82rem;
    text-align: center;
}

/* ツール共通の非公式・権利表記。生成・動的追加は layout.js が担当する。 */
.common-tool-disclaimer {
    box-sizing: border-box;
    width: 100%;
    margin: 1rem 0 0;
    padding: 0.85rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #94a3b8;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.6;
    text-align: center;
}

@media (max-width: 600px) {
    .common-tool-disclaimer {
        padding: 0.75rem 0.8rem;
        font-size: 0.76rem;
    }
}
