@charset "UTF-8";

/* =========================================================
   SWELL テーマ互換スタイル（既存 swell_styles.css ベース）
   ========================================================= */

/* Reset & Basic (プレビューコンテンツ内のみ) */
.post_content {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    line-height: 1.8;
    color: #333;
    font-size: 16px;
}

/* Headings */
.post_content .wp-block-heading {
    margin-top: 2.5em;
    margin-bottom: 1.5em;
    font-weight: bold;
    line-height: 1.4;
}

.post_content h2.wp-block-heading {
    padding: 0.5em 0.7em;
    background: #fff;
    border-left: 5px solid #333;
    border-bottom: 1px solid #ddd;
    font-size: 1.5em;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05);
}

.post_content h3.wp-block-heading {
    padding: 0.2em 0.5em;
    border-left: 5px solid #000;
    font-size: 1.3em;
    background: none;
}

/* Paragraphs */
.post_content p {
    margin-bottom: 1.5em;
    font-size: 1rem;
}

/* Markers */
.post_content mark {
    background: linear-gradient(transparent 60%, rgba(255, 255, 100, 0.6) 0);
    padding-bottom: 2px;
}

.post_content mark[style*="lightgreen"] {
    background: linear-gradient(transparent 60%, rgba(144, 238, 144, 0.6) 0) !important;
}

.post_content mark[style*="yellow"] {
    background: linear-gradient(transparent 60%, rgba(255, 242, 0, 0.6) 0) !important;
}

.post_content mark[style*="orange"] {
    background: linear-gradient(transparent 60%, rgba(255, 165, 0, 0.6) 0) !important;
}

/* Red Bold */
.post_content b[style*="#d2251f"] {
    color: #d2251f !important;
    font-weight: bold;
}

/* SWELL Tab Style (Balloon) */
.post_content .swell-block-tab.is-style-balloon { margin-bottom: 2em; }

.post_content .swell-block-tab.is-style-balloon .c-tabList {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0 1em;
    margin: 0;
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}

.post_content .swell-block-tab.is-style-balloon .c-tabList__item {
    margin: 0;
    padding: 0;
    margin-right: 5px;
}

.post_content .swell-block-tab.is-style-balloon .c-tabList__button {
    display: block;
    padding: 0.8em 1.5em;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
    color: #666;
    transition: all 0.3s;
    position: relative;
    top: 1px;
}

.post_content .swell-block-tab.is-style-balloon .c-tabList__button[aria-selected="true"] {
    background: #fff;
    color: #333;
    border-bottom: 1px solid #fff;
}

.post_content .swell-block-tab.is-style-balloon .c-tabBody {
    background: #fff;
    padding: 2em;
    border: 1px solid #ddd;
    border-radius: 4px;
    z-index: 0;
    position: relative;
}

.post_content .swell-block-tab.is-style-balloon .c-tabBody__item[aria-hidden="true"] {
    display: none;
}

/* Quote */
.post_content .wp-block-quote {
    border-left: 3px solid #ccc;
    padding: 15px;
    padding-left: 1em;
    margin: 1.5em 0;
    color: #555;
    background: #f7f7f7;
}

/* List */
.post_content .wp-block-list {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}

.post_content .wp-block-list li {
    margin-bottom: 0.5em;
}

/* --- Icomoon Font (SWELL) --- */
@font-face {
    font-family: icomoon;
    font-style: normal;
    font-weight: 400;
    src: url('fonts/icomoon.woff2') format('woff2'),
         url('fonts/icomoon.woff') format('woff');
}

/* Box Styles — SWELL 準拠 */

/* == Border Box == */
.post_content .has-border {
    padding: 1.5em;
    border: 2px solid #ddd;
    background: #fff;
    margin-bottom: 1.5em;
    border-radius: 2px;
}
.post_content .has-border.-border01 { border-color: #333; }

/* == Big Icon Box (共通) == */
.post_content [class*="is-style-big_icon_"] {
    position: relative;
    padding: 2em 1.5em 1.5em;
    border-width: 2px;
    border-style: solid;
    border-color: var(--the-color, currentColor);
    border-radius: 2px;
    margin-bottom: 2em;
    background: #fff;
}
.post_content [class*="is-style-big_icon_"]:not(:first-child) {
    margin-top: 2.5em;
}
.post_content [class*="is-style-big_icon_"]::before {
    content: "";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: icomoon;
    font-style: normal;
    font-weight: 400;
    font-size: 1.25em;
    line-height: 1;
    width: 2em;
    height: 2em;
    background-color: var(--the-color, currentColor);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    position: absolute;
    left: .5em;
    top: -1px;
    transform: translateY(-50%);
}

/* -- Point (豆電球) -- */
.post_content .is-style-big_icon_point { --the-color: #ffa639; }
.post_content .is-style-big_icon_point::before { content: "\e915"; }

/* -- Check (チェック) -- */
.post_content .is-style-big_icon_check { --the-color: #86d67c; }
.post_content .is-style-big_icon_check::before { content: "\e923"; }

/* -- Caution (注意) -- */
.post_content .is-style-big_icon_caution { --the-color: #f7da38; }
.post_content .is-style-big_icon_caution::before { content: "\e916"; }

/* -- Memo (メモ) -- */
.post_content .is-style-big_icon_memo { --the-color: #84878a; }
.post_content .is-style-big_icon_memo::before { content: "\e929"; }

/* == Small Icon Box (共通) == */
.post_content .is-style-icon_info,
.post_content .is-style-icon_announce {
    position: relative;
    border-radius: 2px;
    line-height: 1.6;
    padding: 1em 1em 1em 4.25em;
    margin-bottom: 2em;
}
.post_content .is-style-icon_info::before,
.post_content .is-style-icon_announce::before {
    content: "";
    display: inline-block;
    font-family: icomoon;
    font-style: normal;
    font-weight: 400;
    font-size: inherit;
    line-height: 1;
    position: absolute;
    left: 1.25em;
    top: 50%;
    transform: translateY(-50%) scale(1.5);
}
.post_content .is-style-icon_info::after,
.post_content .is-style-icon_announce::after {
    content: "";
    display: block;
    border-right: 1px solid;
    height: 50%;
    position: absolute;
    left: 3.25em;
    top: 25%;
    width: 0;
    opacity: .4;
}

/* -- Info (情報) -- */
.post_content .is-style-icon_info {
    background: #fff0fa;
    border: 1px solid #f578b4;
}
.post_content .is-style-icon_info::before {
    content: "\e941";
    color: #f578b4;
}
.post_content .is-style-icon_info::after {
    border-right-color: #f578b4;
}

/* -- Announce (お知らせ/メガホン) -- */
.post_content .is-style-icon_announce {
    background: #fff5f0;
    border: 1px solid #ffa537;
}
.post_content .is-style-icon_announce::before {
    content: "\e913";
    color: #ffa537;
}
.post_content .is-style-icon_announce::after {
    border-right-color: #ffa537;
}

/* Table */
.post_content .wp-block-table {
    margin-bottom: 2em;
}

.post_content .wp-block-table table {
    width: 100%;
    border-collapse: collapse;
}

.post_content .wp-block-table th,
.post_content .wp-block-table td {
    border: 1px solid #ddd;
    padding: 0.7em;
    text-align: left;
}

.post_content .wp-block-table th {
    background: #f5f5f5;
    font-weight: bold;
}

/* Links */
.post_content a {
    color: #0073aa;
    text-decoration: underline;
}

/* =========================================================
   AI-era Premium UI — Inspired by Linear / Raycast / Vercel
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* --- Design Tokens --- */
:root {
    --bg-void: #09090b;
    --bg-primary: #0c0c10;
    --bg-elevated: #141418;
    --bg-surface: #1a1a20;
    --bg-hover: #222228;
    --bg-white: #ffffff;

    --accent-h: 252;
    --accent: hsl(var(--accent-h), 80%, 65%);
    --accent-dimmed: hsl(var(--accent-h), 60%, 50%);
    --accent-subtle: hsla(var(--accent-h), 80%, 65%, 0.08);
    --accent-glow: hsla(var(--accent-h), 80%, 65%, 0.25);
    --accent-gradient: linear-gradient(135deg, hsl(252, 80%, 65%), hsl(210, 100%, 72%), hsl(175, 70%, 55%));

    --success: #34d399;
    --success-subtle: rgba(52, 211, 153, 0.1);
    --warning: #fbbf24;
    --warning-subtle: rgba(251, 191, 36, 0.1);
    --danger: #f87171;
    --danger-subtle: rgba(248, 113, 113, 0.1);

    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    --text-ghost: #3f3f46;

    --border: rgba(255, 255, 255, 0.06);
    --border-subtle: rgba(255, 255, 255, 0.03);
    --border-strong: rgba(255, 255, 255, 0.1);

    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.5);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.6);
    --shadow-glow: 0 0 60px -12px hsla(var(--accent-h), 80%, 65%, 0.2);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Global Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-sans);
    background: var(--bg-void);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Animated Gradient Mesh Background --- */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% -10%, hsla(252, 80%, 55%, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 110%, hsla(210, 100%, 60%, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 50% 50% at 55% 50%, hsla(175, 70%, 50%, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: meshDrift 20s ease-in-out infinite alternate;
}

@keyframes meshDrift {
    0% { opacity: 1; filter: hue-rotate(0deg); }
    50% { opacity: 0.85; }
    100% { opacity: 1; filter: hue-rotate(8deg); }
}

/* Noise texture overlay */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

body > * { position: relative; z-index: 1; }

/* --- Toolbar (Command Bar) --- */
.toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(12, 12, 16, 0.75);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.toolbar h1 {
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40%;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar h1::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
    flex-shrink: 0;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.toolbar-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* --- Base Button Reset --- */
.toolbar-actions button,
.input-card button,
.modal-actions button,
.table-actions button {
    font-family: var(--font-sans);
    border: none;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    position: relative;
    white-space: nowrap;
}

/* --- Toolbar Buttons --- */
.toolbar-actions button {
    padding: 7px 14px;
    border-radius: var(--radius-xs);
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* --- AI系ボタン（赤グロー） --- */
.btn-ai {
    background: linear-gradient(135deg, #e74c3c, #ff6b6b, #e74c3c);
    background-size: 200% 100%;
    color: #fff;
    animation: btnGlowRed 3s ease-in-out infinite alternate;
}
.btn-ai:hover {
    background-position: 100% 0;
    box-shadow: 0 0 28px rgba(231, 76, 60, 0.55), 0 0 8px rgba(255, 107, 107, 0.3);
}
@keyframes btnGlowRed {
    0% { box-shadow: 0 0 8px rgba(231, 76, 60, 0.2); }
    100% { box-shadow: 0 0 16px rgba(255, 107, 107, 0.35); }
}

/* --- 出力系ボタン（黄金グロー） --- */
.btn-output {
    background: linear-gradient(135deg, #f39c12, #f1c40f, #f39c12);
    background-size: 200% 100%;
    color: #1a1a20;
    font-weight: 700;
    animation: btnGlowGold 3s ease-in-out infinite alternate;
}
.btn-output:hover {
    background-position: 100% 0;
    box-shadow: 0 0 28px rgba(241, 196, 15, 0.55), 0 0 8px rgba(243, 156, 18, 0.3);
}
@keyframes btnGlowGold {
    0% { box-shadow: 0 0 8px rgba(241, 196, 15, 0.2); }
    100% { box-shadow: 0 0 16px rgba(243, 156, 18, 0.35); }
}

/* --- ユーティリティ系ボタン（緑グロー） --- */
.btn-util {
    background: linear-gradient(135deg, #2ecc71, #27ae60, #2ecc71);
    background-size: 200% 100%;
    color: #fff;
    animation: btnGlowGreen 3s ease-in-out infinite alternate;
}
.btn-util:hover {
    background-position: 100% 0;
    box-shadow: 0 0 28px rgba(46, 204, 113, 0.55), 0 0 8px rgba(39, 174, 96, 0.3);
}
@keyframes btnGlowGreen {
    0% { box-shadow: 0 0 8px rgba(46, 204, 113, 0.2); }
    100% { box-shadow: 0 0 16px rgba(39, 174, 96, 0.35); }
}

.btn-primary {
    background: linear-gradient(135deg, hsl(252, 80%, 62%), hsl(230, 90%, 68%), hsl(210, 100%, 68%));
    background-size: 180% 100%;
    color: #fff;
}
.btn-primary:hover {
    background-position: 100% 0;
    box-shadow: 0 0 24px hsla(230, 90%, 65%, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, #34d399, #2dd4bf, #22d3ee);
    background-size: 180% 100%;
    color: var(--bg-void);
    font-weight: 700;
}
.btn-success:hover {
    background-position: 100% 0;
    box-shadow: 0 0 24px rgba(45, 212, 191, 0.35);
}

.btn-warning {
    background: linear-gradient(135deg, hsl(38, 95%, 58%), hsl(28, 90%, 55%), hsl(15, 85%, 55%));
    background-size: 180% 100%;
    color: #fff;
}
.btn-warning:hover {
    background-position: 100% 0;
    box-shadow: 0 0 24px rgba(251, 191, 36, 0.35);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: #ef4444;
    box-shadow: 0 0 20px rgba(248, 113, 113, 0.3);
}

/* btn-secondary は互換性のため残す */
.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border) !important;
}
.btn-secondary:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-strong) !important;
}

.btn-disabled {
    opacity: 0.35;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Hover lift for ALL action buttons */
.toolbar-actions button:hover:not(.btn-disabled),
.input-card button:hover,
.modal-actions button:hover,
.table-actions button:hover {
    transform: translateY(-1px);
}
.toolbar-actions button:active:not(.btn-disabled),
.input-card button:active,
.modal-actions button:active,
.table-actions button:active {
    transform: translateY(0) scale(0.98);
}

/* --- Main Container --- */
.main-container {
    max-width: 940px;
    margin: 0 auto;
    padding: 28px 24px;
}

/* --- Input Card / Login Card --- */
.input-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 56px 48px;
    text-align: center;
    max-width: 480px;
    margin: 80px auto;
    position: relative;
    overflow: hidden;
}

/* Top gradient accent line */
.input-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--accent-gradient);
    opacity: 0.6;
}

/* Glow */
.input-card::after {
    content: "";
    position: absolute;
    top: -60%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, hsla(var(--accent-h), 80%, 65%, 0.06), transparent 70%);
    pointer-events: none;
}

.input-card h2 {
    font-size: 1.5em;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.input-card p {
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 0.88em;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

.input-card input[type="text"],
.input-card input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    font-family: var(--font-sans);
    margin-bottom: 12px;
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: all 0.2s var(--ease-out);
    position: relative;
    z-index: 1;
}

.input-card input::placeholder {
    color: var(--text-ghost);
}

.input-card input:focus {
    outline: none;
    border-color: var(--accent-dimmed);
    box-shadow: 0 0 0 3px var(--accent-subtle), 0 0 20px -4px var(--accent-glow);
    background: var(--bg-hover);
}

.input-card button {
    width: 100%;
    padding: 12px;
    font-size: 0.92em;
    font-weight: 700;
    border-radius: var(--radius-sm);
    position: relative;
    z-index: 1;
    margin-top: 4px;
}

.error-msg {
    background: var(--danger-subtle);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.85em;
    font-weight: 500;
    border: 1px solid rgba(248, 113, 113, 0.15);
    position: relative;
    z-index: 1;
}

/* --- Preview Area --- */
.preview-area {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    box-shadow: var(--shadow-lg);
    margin-top: 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

/* --- Block Wrapper --- */
.block-wrapper {
    position: relative;
    transition: all 0.2s var(--ease-out);
    border-radius: var(--radius-xs);
}

.block-wrapper:hover {
    outline: 2px dashed hsla(var(--accent-h), 50%, 60%, 0.2);
    outline-offset: 6px;
    background: hsla(var(--accent-h), 60%, 65%, 0.015);
}

/* --- Table Actions --- */
.table-actions {
    display: flex;
    gap: 6px;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin: -4px 0 20px;
    flex-wrap: wrap;
    align-items: center;
}

.table-actions .label {
    font-size: 0.75em;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.table-actions button {
    padding: 6px 14px;
    border: none !important;
    border-radius: 100px;
    font-size: 0.75em;
    font-weight: 600;
    background: linear-gradient(135deg, hsl(252, 80%, 62%), hsl(230, 90%, 68%), hsl(210, 100%, 68%));
    background-size: 200% 100%;
    color: #fff;
    animation: btnGlow 3s ease-in-out infinite alternate;
}

.table-actions button:hover {
    background-position: 100% 0;
    box-shadow: 0 0 24px hsla(230, 90%, 65%, 0.45), 0 0 8px hsla(252, 80%, 65%, 0.3);
}

.table-actions button.active {
    background: linear-gradient(135deg, hsl(252, 80%, 70%), hsl(210, 100%, 75%));
    background-size: 200% 100%;
    box-shadow: 0 0 20px hsla(230, 90%, 65%, 0.5), 0 0 6px hsla(252, 80%, 65%, 0.4);
}

/* --- Block Toolbar (hover) --- */
.block-toolbar {
    display: none;
    position: absolute;
    top: -38px;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    box-shadow: var(--shadow-md);
    z-index: 10;
    gap: 4px;
}

.block-wrapper:hover .block-toolbar {
    display: flex;
}

.block-toolbar select {
    padding: 5px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xs);
    font-size: 0.78em;
    font-family: var(--font-sans);
    cursor: pointer;
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.block-toolbar select:focus {
    outline: none;
    border-color: var(--accent-dimmed);
}

/* --- Marker UI --- */
.marker-highlight {
    cursor: pointer;
    position: relative;
    transition: opacity 0.15s;
}

.marker-highlight:hover {
    opacity: 0.85;
}

/* --- Selection Floating Toolbar --- */
.selection-toolbar {
    position: absolute;
    z-index: 500;
    display: none;
    align-items: center;
    gap: 3px;
    padding: 4px 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md), 0 0 40px -8px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(4px) scale(0.96);
    transition: opacity 0.15s var(--ease-out), transform 0.15s var(--ease-out);
}

.selection-toolbar.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.st-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s var(--ease-out);
    color: transparent;
    position: relative;
}

.st-btn:hover {
    transform: scale(1.12);
}
.st-btn:active {
    transform: scale(0.95);
}

/* マーカー色ボタン */
.st-yellow {
    background: linear-gradient(135deg, rgba(255, 242, 0, 0.7), rgba(255, 220, 0, 0.9));
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.st-yellow:hover {
    box-shadow: 0 0 12px rgba(255, 242, 0, 0.5), inset 0 0 0 1px rgba(0,0,0,0.08);
}

.st-green {
    background: linear-gradient(135deg, rgba(144, 238, 144, 0.7), rgba(100, 220, 120, 0.9));
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.st-green:hover {
    box-shadow: 0 0 12px rgba(144, 238, 144, 0.5), inset 0 0 0 1px rgba(0,0,0,0.08);
}

.st-orange {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.7), rgba(255, 140, 0, 0.9));
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.st-orange:hover {
    box-shadow: 0 0 12px rgba(255, 165, 0, 0.5), inset 0 0 0 1px rgba(0,0,0,0.08);
}

/* 赤太字ボタン */
.st-red {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    font-style: italic;
}
.st-red:hover {
    box-shadow: 0 0 12px rgba(231, 76, 60, 0.5);
}

/* 太字ボタン */
.st-bold {
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 900;
    border: 1px solid var(--border-strong);
}
.st-bold:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

/* セパレータ */
.st-sep {
    width: 1px;
    height: 18px;
    background: var(--border-strong);
    margin: 0 2px;
    flex-shrink: 0;
}

/* 解除ボタン */
.st-remove {
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border-strong);
}
.st-remove:hover {
    background: var(--danger-subtle);
    color: var(--danger);
    border-color: var(--danger);
}

/* アクティブ状態（吟味モード） */
.st-btn.st-active {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    box-shadow: 0 0 8px hsla(252, 80%, 65%, 0.3);
}

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-md);
    font-weight: 600;
    font-size: 0.85em;
    z-index: 1000;
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.3s var(--ease-out);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* --- WordPress Modal --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    padding: 36px;
    max-width: 460px;
    width: 92%;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    animation: modalIn 0.3s var(--ease-spring);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(8px);
    }
}

/* Top gradient line */
.modal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--accent-gradient);
    opacity: 0.5;
}

.modal h3 {
    margin-bottom: 24px;
    font-size: 1.1em;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.modal label {
    display: block;
    font-size: 0.78em;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    position: relative;
    z-index: 1;
}

.modal select,
.modal input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.88em;
    font-family: var(--font-sans);
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: all 0.2s var(--ease-out);
    position: relative;
    z-index: 1;
}

.modal select:focus,
.modal input:focus {
    outline: none;
    border-color: var(--accent-dimmed);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 24px;
    position: relative;
    z-index: 1;
}

.modal-actions button {
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85em;
}

/* --- Loading Spinner --- */
.loading {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Decided Badge --- */
.decided-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--success-subtle);
    color: var(--success);
    font-size: 0.68em;
    padding: 2px 10px;
    border-radius: 100px;
    margin-left: 8px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid rgba(52, 211, 153, 0.15);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .toolbar {
        height: auto;
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px;
    }

    .toolbar h1 {
        max-width: 100%;
        text-align: center;
    }

    .toolbar-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .main-container { padding: 16px 12px; }

    .input-card {
        padding: 40px 28px;
        margin: 40px auto;
        border-radius: var(--radius-lg);
    }

    .preview-area { padding: 20px 16px; }

    .table-actions { gap: 4px; }
    .table-actions button { padding: 5px 10px; font-size: 0.7em; }
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* --- Selection --- */
::selection {
    background: hsla(var(--accent-h), 80%, 65%, 0.3);
    color: #fff;
}

/* --- Transition for page load --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.main-container { animation: fadeIn 0.5s var(--ease-out); }

/* --- Brand Icon --- */
.brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 900;
    color: #fff;
    box-shadow: 0 0 28px -4px var(--accent-glow);
    animation: iconFloat 4s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* --- Box Popover (ダブルクリック) --- */
.box-popover {
    position: absolute;
    z-index: 600;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 14px;
    box-shadow: var(--shadow-lg), 0 0 40px -8px rgba(0,0,0,0.4);
    animation: modalIn 0.2s var(--ease-spring);
    min-width: 260px;
}

.box-popover-title {
    font-size: 0.72em;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    padding: 0 2px;
}

.box-popover-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.box-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.72em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s var(--ease-out);
}

.box-opt:hover {
    background: var(--bg-hover);
    border-color: var(--accent-dimmed) !important;
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.box-opt-icon {
    font-size: 1.4em;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
}

.box-opt-icon.swell-icon {
    font-family: icomoon !important;
    font-style: normal;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    font-size: 0.85em;
}

.box-opt-label {
    font-size: 0.92em;
}

/* --- Box Pencil Icon (ホバーで表示) --- */
.box-pencil-icon {
    position: absolute;
    z-index: 550;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s var(--ease-out);
    opacity: 0.7;
}
.box-pencil-icon:hover {
    opacity: 1;
    background: var(--accent-subtle);
    border-color: var(--accent-dimmed);
    color: var(--accent);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.box-opt.active {
    background: var(--accent-subtle);
    border-color: var(--accent) !important;
    color: var(--accent);
}

/* --- Balloon Box Style (SWELL準拠) --- */
.post_content .is-style-balloon_box {
    position: relative;
    width: fit-content;
    min-width: 2em;
    padding: .5em 1.25em;
    background-color: #04384c;
    color: #fff;
    border-radius: 2px;
    line-height: 1.4;
    margin-bottom: 2em;
}
.post_content .is-style-balloon_box::before {
    content: "";
    position: absolute;
    bottom: -22px;
    left: 1.25em;
    border: 12px solid transparent;
    border-top: 12px solid #04384c;
    height: 0;
    width: 0;
    visibility: visible;
}
