:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 72px;

    /* カラーシステム */
    --accent-primary: #51bb9b;
    --accent-light: #89ebcd;
    --accent-dark: #258a60;
    --warning-primary: #cc5759;
    --warning-dark: #9b3638;
    --text-primary: #555;
    --text-secondary: #888;
    --text-light: #aaa;

    /* 背景とサーフェス */
    --bg-primary: #ffffff;
    --bg-secondary: #fafbfc;
    --bg-tertiary: #f5f7f9;
    --surface-elevated: #ffffff;
    --border-color: #b2b2b2;
    --border-light: #f0f2f4;

    /* シャドウ */
    --shadow-sm: 0 1px 3px rgba(81, 187, 155, 0.08);
    --shadow-md: 0 4px 12px rgba(81, 187, 155, 0.12);
    --shadow-lg: 0 8px 24px rgba(81, 187, 155, 0.16);
    --shadow-hover: 0 6px 20px rgba(81, 187, 155, 0.2);

    /* トランジション */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

}

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

body {
    font-family: 'Outfit', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.d-flex {
    display: flex;
}



/* サイドバー */
#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    transition: transform var(--transition-base), width var(--transition-base);
    z-index: 1000;
    overflow-y: scroll;
    overflow-x: hidden;
    box-shadow: var(--shadow-sm);
}


#sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

#sidebar::-webkit-scrollbar {
    width: 6px;
}

#sidebar::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 60px;
}

.sidebar-title {
    font-weight: 600;
    font-size: 1.125rem;
    white-space: nowrap;
    opacity: 1;
    transition: opacity var(--transition-base);
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1;
    flex: 1;
}

#sidebar.collapsed .sidebar-title {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

#toggleSidebar {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}

#toggleSidebar:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: scale(1.05);
}

#toggleSidebar i {
    font-size: 1.25rem;
    line-height: 1;
}

/* サイドバーが開いているときの×ボタン */
#sidebar.show #toggleSidebar {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.nav {
    padding: 1rem 0.75rem;
    list-style: none;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    color: var(--text-primary);
    padding: 0.875rem 1rem 0.875rem 0.7rem;
    border-radius: 10px;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 1rem;
    white-space: nowrap;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-primary);
    transform: scaleY(0);
    transition: transform var(--transition-base);
    border-radius: 0 2px 2px 0;
}

.nav-link:hover {
    background: rgba(81, 187, 155, 0.08);
    color: var(--accent-primary);
    transform: translateX(4px);
}

.nav-link.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-md);
    transform: translateX(0);
}

.nav-link.active::before {
    transform: scaleY(1);
}

.nav-link i {
    font-size: 1.25rem;
    min-width: 1.25rem;
    transition: transform var(--transition-base);
}

.nav-link:hover i {
    transform: scale(1.1);
}

.menu-text {
    transition: opacity var(--transition-base);
    flex: 1;
}

#sidebar.collapsed .menu-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* モバイルメニューボタン */
.mobile-menu-btn {
    display: none;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    z-index: 1001;
    transition: all var(--transition-base);
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    margin-right: 0.75rem;
}

.mobile-menu-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.mobile-menu-btn i {
    font-size: 1.25rem;
    transition: transform var(--transition-base);
}

.mobile-menu-btn.active {
    display: none;
}

/* モバイルオーバーレイ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* メインコンテンツ */
#content {
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-base);
    min-height: 100vh;
    background: var(--bg-secondary);
    width: calc(100% - var(--sidebar-width));
}

#content.expanded {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

/* ヘッダー */
.system_header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.header_option_link_area {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header_link_exit {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header_link_exit:hover {
    color: var(--accent-primary);
}

.header_option_link_area a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header_option_link_area a:hover {
    color: var(--accent-primary);
}

.header_option_link_area span {
    cursor: pointer;
    color: var(--text-secondary);
}

.header_option_link_area span:hover {
    color: var(--accent-primary);
}

.header_option_link_area {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header_link_exit {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header_link_exit:hover {
    color: var(--accent-primary);
}

.header_option_link_area a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header_option_link_area a:hover {
    color: var(--accent-primary);
}

.header_option_link_area span {
    cursor: pointer;
    color: var(--text-secondary);
}

.header_option_link_area span:hover {
    color: var(--accent-primary);
}

/* ヘッダー */
.content-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2.5rem;
    position: sticky;
    top: 0;
    z-index: 999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: padding var(--transition-fast), box-shadow var(--transition-fast);
}

.content-footer{
        display: flex;
    justify-content: center;
    align-items: center;
}

.content-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

/* スクロール時の縮小スタイル */
.content-header.scrolled {
    padding: 0.625rem 2.5rem;
    box-shadow: var(--shadow-md);
}


.content-header.scrolled h1 {
    font-size: 1.125rem;
}

.content-header.scrolled .btn-save {
    font-size: 1rem;
    padding: 0.3rem 0.75rem 0.3rem 0.75rem;
}

/* セクション */
section {
    display: none;
    padding: 2.5rem;
    animation: fadeIn var(--transition-base);
}

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

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

section.active {
    display: block;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.section-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.theme_section {
    display: none;
}

.theme_section.active {
    display: block;
}

.theme_info {
    font-size: 0.875rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

/* カード */
.settings-card {
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.settings-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(81, 187, 155, 0.3);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.02em;
}

.card-title i {
    color: var(--accent-primary);
    font-size: 1.5rem;
}

/* フォーム要素 */
.form-group {
    margin-bottom: 1.75rem;
}

.form-label {
    font-weight: 900;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
    display: block;
    font-size: 0.9375rem;
}

.form-control,
.form-select {
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
    background: var(--bg-primary);
    color: var(--text-primary);
    width: 100%;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(81, 187, 155, 0.1);
    background: var(--bg-primary);
}

.form-control:hover,
.form-select:hover {
    border-color: var(--accent-light);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
    font-size: 1rem;
}

.form-check {
    padding-left: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-primary);
    position: relative;
}

.form-check-input:checked {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(81, 187, 155, 0.1);
}

.form-check-input:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
    margin: 0;
    font-size: 0.9375rem;
}

input[type="color"] {
    width: 64px;
    height: 40px;
    padding: 4px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

input[type="color"]:hover {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

/* ボタン */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;

}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--accent-dark);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    border-color: var(--text-secondary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-save {
    min-width: 140px;
    justify-content: center;
}

/* ファイルアップロード */
.file-upload-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-upload-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

.file-upload-label {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.file-upload-label:hover {
    background: var(--border-color);
    border-color: var(--accent-primary);
}

.file_status {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.file_button,
.file_clear_button {
    margin-left: 0.5rem;
}

/* ヘルプテキスト */
.form-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    display: block;
    line-height: 1.5;
}

/* セクションナビゲータ */
.section-navigator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.section-navigator .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.section-navigator .nav-link:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateX(-2px);
}

.section-navigator .nav-link.next:hover {
    transform: translateX(2px);
}

.section-navigator .nav-spacer {
    flex: 1;
}

.section-navigator .nav-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ユーティリティ */
.hide {
    display: none !important;
}

.row {
    display: flex;
    gap: 1.5rem;
    margin: 0 -0.75rem;
}

.col-md-6 {
    flex: 1;
    padding: 0 0.75rem;
}

/* レスポンシブ */
@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    #sidebar.show {
        transform: translateX(0);
    }

    #sidebar.collapsed {
        width: var(--sidebar-width);
    }

    #content {
        margin-left: 0;
        width: 100%;
    }

    #content.expanded {
        margin-left: 0;
        width: 100%;
    }

    .content-header {
        padding: 1rem 1.5rem 1rem 1.5rem;
    }

    .content-header h1 {
        font-size: 1.25rem;
    }

    .btn-save {
        padding: 0.5rem 1rem;
        min-width: auto;
    }

    .btn-save span {
        display: none;
    }

    section {
        padding: 1.5rem;
    }

    .row {
        flex-direction: column;
        gap: 0;
    }

    .col-md-6 {
        padding: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .sidebar-overlay {
        display: block;
    }

    #toggleSidebar {
        display: flex;
    }

    .sidebar-header {
        padding: 1rem;
    }
}

/* カスタムスクロールバー */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* セレクト矢印のカスタマイズ */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2351bb9b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
    padding-right: 3rem;
}

/* リンクスタイル */
a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-dark);
}

/* システムヘッダー */
.system_header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.header_option_link_area {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header_link_exit {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header_link_exit:hover {
    color: var(--accent-primary);
}

.header_option_link_area a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header_option_link_area a:hover {
    color: var(--accent-primary);
}

.header_option_link_area span {
    cursor: pointer;
    color: var(--text-secondary);
}

.header_option_link_area span:hover {
    color: var(--accent-primary);
}

.flex-column {
    flex-direction: column;
}

.mt-3 {
    margin-top: 1rem;
}

.dlg_message {
    color: var(--text-primary);
}

.dlg_btn_close,
.dlg_btn_ok {
    background: var(--accent-primary);
    color: white;
}

.dlg_btn_close:hover,
.dlg_btn_ok:hover {
    background: var(--accent-dark);
}

.dlg_btn_cancel {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.dlg_btn_cancel:hover {
    background: var(--border-color);
}

/* 保存ボタンのローディング状態 */
.btn-save.saving {
    pointer-events: none;
    opacity: 0.7;
}

.btn-save.saving i {
    animation: spin 1s linear infinite;
}

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

    to {
        transform: rotate(360deg);
    }
}

/* Syntax Highlighter Styles */
.syntax-editor-container {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
}

.syntax-wrap-toggle {
    position: absolute;
    bottom: -32px;
    right: 0px;
    z-index: 3;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary, #f0f0f0);
    border: 1px solid var(--border-color, #ccc);
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s;
    font-size: 14px;
    color: var(--text-muted, #888);
    line-height: 1;
    padding: 0;
}

.syntax-wrap-toggle:hover {
    opacity: 1;
}

.syntax-wrap-toggle.wrap-on {
    opacity: 0.85;
    color: var(--accent-primary, #0d6efd);
    border-color: var(--accent-primary, #0d6efd);
}

.syntax-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    background-color: var(--bg-primary);
    /* Match theme bg */
    border: 1px solid #ffffff00;
    /* Match theme border */
    border-radius: 0.25rem;
    /* Match Bootstrap .form-control */
    box-sizing: border-box;
    padding: 0.375rem 0.75rem;
    /* Match Bootstrap .form-control padding */
    text-align: left;
}

.syntax-highlights {
    margin: 0;
    padding: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: var(--bs-body-font-family);
    /* Match Bootstrap font */
    font-size: 1rem;
    /* Match Bootstrap font size */
    line-height: 1.5;
    /* Match Bootstrap line-height */
    color: transparent;
    /* Hide non-highlighted text in backdrop, let textarea show it? No, we want backdrop to show everything. */
    color: var(--text-primary);
}

/* Override for the textarea to be transparent but allow caret */
textarea[data-syntax-editor] {
    position: relative;
    z-index: 2;
    background-color: transparent !important;
    color: transparent !important;
    caret-color: var(--text-primary);
    /* Ensure caret is visible */
    display: block;
}

/* Highlight colors */
.syntax-tag {
    color: #d63384;
    /* Pinkish for tags <> */
}

.syntax-var {
    color: #0d6efd;
    /* Blue for vars {} */
}

/* CSS Syntax Highlight colors */
.syntax-comment {
    color: #218332;
    font-style: italic;
    /* Gray for comments */
}

.syntax-comment .syntax-selector {
    color: #218332;
}

.syntax-selector {
    color: #d63384;
    /* Pinkish for CSS selectors */
}

.syntax-property {
    color: #0d6efd;
    /* Blue for CSS properties */
}

.syntax-value {
    color: #198754;
    /* Green for values with units */
}

.syntax-color {
    color: #fd7e14;
    font-weight: 600;
    /* Orange for color values */
}

.syntax-string {
    color: #6f42c1;
    /* Purple for strings */
}

/* ===== SNSリンク アイコン選択 ===== */
.sns-link-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    transition: background-color var(--transition-fast);
}

.sns-link-row:last-child {
    border-bottom: none;
}

.sns-link-row:hover {
    background-color: var(--bg-tertiary);
    margin: 0 -16px;
    padding: 12px 16px;
    border-radius: 8px;
}

.sns-link-label {
    min-width: 56px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
    letter-spacing: 0.02em;
}

.sns-url-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    background: var(--bg-primary);
}

.sns-url-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(81, 187, 155, 0.15);
}

.sns-icon-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sns-icon-preview {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.sns-icon-preview.has-icon {
    border-style: solid;
    background: var(--bg-primary);
}

.sns-icon-preview i {
    font-size: 18px;
    color: var(--text-primary);
}

.sns-icon-preview img {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 4px;
}

.sns-icon-select-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sns-icon-select-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(81, 187, 155, 0.05);
}

.sns-icon-select-btn i {
    font-size: 14px;
}

/* ===== アイコン選択ダイアログ ===== */
.icon-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.icon-dialog-overlay.active {
    opacity: 1;
    visibility: visible;
}

.icon-dialog {
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-base);
}

.icon-dialog-overlay.active .icon-dialog {
    transform: scale(1) translateY(0);
}

.icon-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.icon-dialog-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-dialog-title i {
    color: var(--accent-primary);
}

.icon-dialog-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.icon-dialog-close:hover {
    background: var(--warning-primary);
    color: white;
}

.icon-dialog-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(80vh - 140px);
}

.icon-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
    margin-bottom: 12px;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.icon-grid-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    transition: all var(--transition-fast);
    position: relative;
}

.icon-grid-item:hover {
    background: var(--accent-light);
    transform: scale(1.1);
    z-index: 1;
}

.icon-grid-item.selected {
    background: var(--accent-primary);
    border-color: var(--accent-dark);
}

.icon-grid-item.selected i {
    color: white;
}

.icon-grid-item i {
    font-size: 20px;
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.icon-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-tertiary);
}

.icon-upload-zone:hover {
    border-color: var(--accent-primary);
    background: rgba(81, 187, 155, 0.05);
}

.icon-upload-zone.dragover {
    border-color: var(--accent-primary);
    background: rgba(81, 187, 155, 0.1);
    transform: scale(1.02);
}

.icon-upload-icon {
    font-size: 32px;
    color: var(--accent-primary);
    margin-bottom: 12px;
}

.icon-upload-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.icon-upload-hint {
    font-size: 0.75rem;
    color: var(--text-light);
}

.icon-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-tertiary);
}

.icon-preview-selected {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-preview-box {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-preview-box i {
    font-size: 22px;
    color: var(--text-primary);
}

.icon-preview-box img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
}

.icon-preview-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.icon-dialog-actions {
    display: flex;
    gap: 8px;
}

.icon-btn-clear {
    padding: 10px 18px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.icon-btn-clear:hover {
    border-color: var(--warning-primary);
    color: var(--warning-primary);
}

.icon-btn-confirm {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    background: var(--accent-primary);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.icon-btn-confirm:hover {
    background: var(--accent-dark);
    box-shadow: var(--shadow-md);
}

/* アニメーション */
@keyframes iconPop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.icon-grid-item {
    animation: iconPop 0.3s ease-out backwards;
}

.icon-grid-item:nth-child(1) {
    animation-delay: 0.02s;
}

.icon-grid-item:nth-child(2) {
    animation-delay: 0.04s;
}

.icon-grid-item:nth-child(3) {
    animation-delay: 0.06s;
}

.icon-grid-item:nth-child(4) {
    animation-delay: 0.08s;
}

.icon-grid-item:nth-child(5) {
    animation-delay: 0.10s;
}

.icon-grid-item:nth-child(6) {
    animation-delay: 0.12s;
}

.icon-grid-item:nth-child(7) {
    animation-delay: 0.14s;
}

.icon-grid-item:nth-child(8) {
    animation-delay: 0.16s;
}

.icon-grid-item:nth-child(9) {
    animation-delay: 0.18s;
}

.icon-grid-item:nth-child(10) {
    animation-delay: 0.20s;
}

.icon-grid-item:nth-child(11) {
    animation-delay: 0.22s;
}

.icon-grid-item:nth-child(12) {
    animation-delay: 0.24s;
}

.icon-grid-item:nth-child(13) {
    animation-delay: 0.26s;
}

.icon-grid-item:nth-child(14) {
    animation-delay: 0.28s;
}

.icon-grid-item:nth-child(15) {
    animation-delay: 0.30s;
}

.icon-grid-item:nth-child(16) {
    animation-delay: 0.32s;
}