/* ==========================================================
   blogos.css
   ----------------------------------------------------------
   どのテーマでも最初に読み込む、共通の画面の見た目（D-49・T1）。

   ・共通の画面（resources/views/）で使う class の、装飾のない見た目を決める。
     blank テーマの見た目は、このファイルだけで決まる。
   ・テーマの CSS（public/themes/{テーマ名}/css/style.css）は、このファイルの後に読み込み、
     同じ class の見た目を上書きする。
   ・画面ごとの配置（幅・余白・文字の寄せ）は、各画面の style="…" に残している。
     色・背景・枠線のように、テーマで変えたい見た目だけをここに置く。
   ========================================================== */


/* ==========================================================
   文字の色（意味ごと）
   ========================================================== */

/* 補足・説明 */
.text-muted { color: #666; }

/* 目立たなくした行（登録済みの候補 など） */
.text-dim { color: #888; }

/* さらに目立たない補足（画像なし など） */
.text-faint { color: #999; }

/* エラー・要対応 */
.text-error { color: #b00; }

/* 注意 */
.text-warn { color: #b60; }

/* 成功・完了 */
.text-ok { color: #070; }


/* ==========================================================
   表の行の強調（意味ごと）
   ========================================================== */

/* 選択中の行 */
.row-current { background: #eef5ff; }

/* 確認が必要な行（違いがある・基準に届かない など） */
.row-attention { background: #fff8c5; }

/* 問題が残っている行 */
.row-danger { background: #fde2e2; }

/* 処理中で触れない行 */
.row-error { background: #ffebe9; }

/* まとまりの見出しの行（記事の企画のカテゴリの案） */
.row-group { background: #f7f7f7; }


/* ==========================================================
   箱・背景
   ========================================================== */

/* 枠線のある箱 */
.bordered { border: 1px solid #ccc; }

/* 白い下地（画像・プレビュー） */
.bg-surface { background: #fff; }

/* 薄い下地（画像の置き場所） */
.bg-subtle { background: #f5f5f5; }

/* コード・JSON の表示 */
.code-block { background: #f6f6f6; }

/* 等幅の文字（HTML・JSON の入力） */
.mono { font-family: monospace; }


/* ==========================================================
   表（一覧）
   ----------------------------------------------------------
   以前の <table border="1" cellpadding="4" cellspacing="0"> と同じ見た目（枠線の色は文字の色）。
   ========================================================== */

table.data {
    border: 1px outset;
    border-spacing: 0;
}

table.data > * > tr > th,
table.data > * > tr > td,
table.data > tr > th,
table.data > tr > td {
    border: 1px inset;
    padding: 4px;
}

/* 余白の狭い表 */
table.data.data-compact > * > tr > th,
table.data.data-compact > * > tr > td {
    padding: 3px;
}


/* ==========================================================
   点数の棒（評価の観点）
   ========================================================== */

.bar-track { background: #eee; }
.bar-good { background: #4a90e2; }
.bar-mid { background: #e8a33d; }
.bar-bad { background: #d9534f; }


/* ==========================================================
   点数の円グラフ（partials/score-gauge。品質評価の詳細・記事の画面のページの速さ。D-79-06・D-78-09）
   ========================================================== */

.evaluation-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.evaluation-summary > table { flex: 1 1 320px; }
/* 記事の画面の本文中の画像：パネルの幅を4等分した列に並べ、画像の枠も列の幅に合わせる（パネルが狭いときは2列。D-82-03） */
.media-grid-wrap { container-type: inline-size; }
.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@container (max-width: 480px) {
    .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.media-grid-item { padding: 6px; min-width: 0; }
.media-grid-image { display: block; width: 100%; aspect-ratio: 16 / 10; height: auto; object-fit: contain; }
/* 端末ごとの行に、区分ごとの円グラフを並べる（pagespeed/gauges）。端末名の列の右を、同じ幅の列に分け、
   円グラフは列の幅いっぱいに広げる（パネルの幅に合わせて大きさが変わる。D-78-10）。パネルが狭いときは、端末名を上の行にする */
.score-gauge-rows { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; container-type: inline-size; }
.score-gauge-row { display: grid; grid-template-columns: 8em repeat(4, minmax(0, 1fr)); align-items: center; gap: 8px 4%; }
.score-gauge-item { display: flex; flex-direction: column; align-items: center; min-width: 0; container-type: inline-size; }
.score-gauge-caption { font-size: 13px; margin-top: 2px; text-align: center; }
@container (max-width: 560px) {
    .score-gauge-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 3%; }
    .score-gauge-row-label { grid-column: 1 / -1; }
}
/* 幅いっぱいの円グラフ：大きさは置いた列の幅。中の文字は、列の幅（cqi）に合わせる */
.score-gauge.score-gauge-fluid { width: 100%; height: auto; aspect-ratio: 1 / 1; }
.score-gauge-fluid svg { width: 100%; height: 100%; }
.score-gauge-fluid .score-gauge-number { font-size: 20cqi; }
.score-gauge-fluid .score-gauge-max { font-size: max(9px, 8cqi); }
.score-gauge-fluid .score-gauge-label { font-size: max(9px, 8.7cqi); white-space: nowrap; }
.score-gauge { position: relative; margin: 0; width: var(--gauge-size, 150px); height: var(--gauge-size, 150px); flex: none; }
.score-gauge svg { display: block; overflow: visible; color: #999; }
/* 線の色は color（currentColor）。外輪・内側の輪・下地は薄くする（D-79-07）。
   色はアークリアクターのコイルと同じ：窓は深い色（--reactor-deep）、窓の上を走る細い線は蛍光色（--reactor-glow）。
   public/themes/ironman/css/reactor/reactor.css の通常・注意・要対応の値（D-79-08・09） */
.score-gauge-good svg { color: #4fd3ff; --gauge-deep: #0a5f94; }
.score-gauge-mid svg { color: #ffbf3c; --gauge-deep: #8a5a00; }
/* 要対応の赤は、画面上のコイルの色に合わせて測った値（コイルは、電気の光の彩度を上げる・窓の重ねなどで、--reactor-glow の #ff4a3d よりオレンジ寄りに見えるため。D-79-10） */
.score-gauge-bad svg { color: #f8432a; --gauge-deep: #a8260e; }
/* 外輪・内側の輪・点数の線の下地は、色を付けない灰色（白い背景で、赤などを薄くするとピンクなどに見えるため。D-79-09）。ironman では点数の色を薄くする */
.score-gauge svg { --gauge-line: #8f99a3; }
.score-gauge-faint, .score-gauge-dim, .score-gauge-track { stroke: var(--gauge-line); }
.score-gauge-faint { opacity: 0.45; }
.score-gauge-dim { opacity: 0.7; }
.score-gauge-track { opacity: 0.18; }
.score-gauge figcaption {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    line-height: 1.2;
}
.score-gauge-number { font-size: calc(var(--gauge-size, 150px) * 0.2); font-weight: bold; }
.score-gauge-max { font-size: max(10px, calc(var(--gauge-size, 150px) * 0.08)); opacity: 0.7; }
.score-gauge-label { font-size: max(11px, calc(var(--gauge-size, 150px) * 0.087)); font-weight: bold; margin-top: 2px; }
.score-gauge-good .score-gauge-label { color: #4a90e2; }
.score-gauge-mid .score-gauge-label { color: #e8a33d; }
.score-gauge-bad .score-gauge-label { color: #d9534f; }


/* ==========================================================
   行ごとの差分（partials/line-diff）
   ========================================================== */

.diff-added { background: #e6ffec; }
.diff-removed { background: #ffebe9; }
.diff-skip { color: #888; }


/* ==========================================================
   共通のヘッダー（layouts/header）
   ========================================================== */

/* ヘッダーとメニューバーの間には線を引かない（メニューバーの下の線で、上の帯の終わりを示す） */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
}

.site-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-title {
    text-decoration: none;
    font-size: 20px;
    font-weight: bold;
}

/* BlogOS の右：「WELCOME TO」と、選択中のブログ名のボタン */
.site-welcome {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.site-welcome-label {
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.16em;
    white-space: nowrap;
}

/* 狭い画面：ブログ名のボタンの場所を残すため、「WELCOME TO」を出さない */
@media (max-width: 640px) {

    .site-welcome-label {
        display: none;
    }

}


/* ヘッダーの右側：ブログ名のボタンと、ログアウトのアイコン（D-54） */
.site-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.logout-form {
    margin: 0;
}

/* ヘッダーの右端の今の日時：ironman テーマだけで表示する（themes/ironman/css/components/header.css） */
.site-clock {
    display: none;
}

.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    border: 1px solid #999;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.blog-switch-button {
    padding: 6px 12px;
    border: 1px solid #999;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

/* ブログ切替ポップアップ（開く・閉じるは header の JavaScript が style.display で切り替える） */
.blog-switch-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.blog-switch-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-width: calc(100% - 40px);
    max-height: calc(100% - 40px);
    overflow-y: auto;
    padding: 20px;
    background: #fff;
    border-radius: 6px;
}

.blog-switch-option {
    display: block;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.blog-switch-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}


/* ==========================================================
   画面の区切りとボタンの種類（D-49-11）
   ----------------------------------------------------------
   blank では何もしない（見た目は標準のまま）。テーマの CSS で見た目を決める。
   ・.panel：画面の区切り（<section>・<fieldset>・<form> に付ける）。最初の h2・legend が見出し。
     data-code="EDITOR" のような英字の札を付けてよい
   ・button.btn-secondary：補助の操作
   ・button.btn-danger：取り消せない・壊す操作
   ・a.button-link：主な操作へのリンク
   ========================================================== */


/* ==========================================================
   表を横スクロールなしで見せる（D-50）
   ----------------------------------------------------------
   ・表は画面の幅に収める（セルの中の長い英数字・URL も折り返す）
   ・収まらない表と、列が細くなりすぎる表は、public/js/blogos.js が table.data.stacked にする：
     行ごとのカードの形にし、各セルの前に列の見出し（data-label）を出す
   ・入力欄も、置かれている場所の幅からはみ出さない
   ========================================================== */

table.data {
    max-width: 100%;
}

table.data > * > tr > th,
table.data > * > tr > td,
table.data > tr > th,
table.data > tr > td {
    overflow-wrap: anywhere;
}

input,
select,
textarea {
    max-width: 100%;
}

/* 入力欄は、枠と内側の余白も幅に含める（含めないと、幅の上限を決めても枠の分だけはみ出す） */
input,
select,
textarea {
    box-sizing: border-box;
}

/* fieldset は標準では中身の幅より縮まないため、置かれている場所の幅に合わせて縮むようにする */
fieldset {
    min-width: 0;
}

/* カードの形 */
table.data.stacked,
table.data.stacked > tbody,
table.data.stacked > * > tr,
table.data.stacked > * > tr > th,
table.data.stacked > * > tr > td {
    display: block;
    width: auto !important;
    max-width: none !important;
}

table.data.stacked {
    border: 0;
}

/* 列の見出しの行は、各セルの前に出すため隠す */
table.data.stacked > thead,
table.data.stacked tr.stacked-header {
    display: none;
}

/* 1行＝1枚のカード */
table.data.stacked > * > tr {
    margin-bottom: 8px;
    border: 1px outset;
}

table.data.stacked > * > tr > th,
table.data.stacked > * > tr > td {
    border: 0;
    border-bottom: 1px dotted #ccc;
    text-align: left !important;
    white-space: normal !important;
}

table.data.stacked > * > tr > :last-child {
    border-bottom: 0;
}

/* 値の前の、列の見出し */
table.data.stacked td[data-label]::before {
    content: attr(data-label) "：";
    font-weight: bold;
}

/* 見出しが空の列（操作のボタンなど）は、見出しを出さない */
table.data.stacked td[data-label=""]::before {
    content: none;
}


/* ==========================================================
   メニューバー（D-56。layouts/header の nav.site-menu）
   ----------------------------------------------------------
   ヘッダーの下に、種類ごとのメニューを横に並べる。押すと、その下に項目が開く。
   ========================================================== */

.site-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 4px 20px;
    border-bottom: 1px solid #ccc;
}

.site-menu-group {
    position: relative;
}

.site-menu-group > summary {
    cursor: pointer;
    padding: 2px 4px;
}

/* 英字の札（SETTING など）は、テーマで出す（blank は名前だけ。トップページの入口と同じ） */
.site-menu-code {
    display: none;
}

/* 開いた項目（メニューの下に重ねて出す） */
.site-menu-links {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 200;
    min-width: 200px;
    margin: 4px 0 0;
    padding: 4px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #999;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.site-menu-links a {
    display: block;
    padding: 6px 12px;
}

/* 下の階層（例：設定 → AI → 音声操作）。押すと横に開く（D-61） */
.site-menu-sub {
    position: relative;
}

.site-menu-sub > details > summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 12px;
    cursor: pointer;
    list-style: none;
}

.site-menu-sub > details > summary::-webkit-details-marker {
    display: none;
}

.site-menu-sub > details > summary::after {
    content: "▸";
}

.site-menu-links.site-menu-sublinks {
    top: -5px;
    left: 100%;
    margin: 0 0 0 2px;
}

/* パソコン：横に開く項目は、1行で出す（例：OpenAIの画面で見た残高を登録） */
@media (min-width: 769px) {

    .site-menu-sublinks a {
        white-space: nowrap;
    }

}

/* スマホ：横に開くと画面からはみ出すため、下に開く */
@media (max-width: 768px) {

    .site-menu-links.site-menu-sublinks {
        position: static;
        margin: 0;
        padding: 0 0 0 12px;
        border: 0;
        box-shadow: none;
    }

}


/* ==========================================================
   音声の操作（D-58）：ヘッダーのマイクのボタンと、会話の欄
   ========================================================== */

/* お知らせのボタン（D-74）。右上に、変動も解消もしていない未確認のお知らせの数を出す（スマートフォンのアプリの通知のように） */
.notice-wrap {
    position: relative;
    display: inline-flex;
}

.notice-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    color: inherit;
    border: 1px solid #999;
    border-radius: 4px;
    background: #fff;
    text-decoration: none;
    cursor: pointer;
}

.notice-badge {
    position: absolute;
    top: -7px;
    right: -9px;
    z-index: 2;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    box-sizing: border-box;
    border-radius: 9px;
    background: #e0245e;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
}

.notice-tag {
    display: inline-block;
    padding: 0 6px;
    border: 1px solid currentColor;
    border-radius: 3px;
    font-size: 12px;
}

.voice-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    border: 1px solid #999;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

/* 聞いている間は、ボタンを赤くする */
body.voice-listening .voice-button {
    color: #fff;
    background: #c00;
    border-color: #c00;
}

.voice-panel {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 300;
    width: min(380px, calc(100vw - 32px));
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #999;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.voice-panel[hidden] {
    display: none;
}

.voice-panel-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-panel-title {
    font-weight: bold;
}

.voice-panel-state {
    color: #666;
    font-size: 13px;
}

.voice-panel-close {
    margin-left: auto;
    padding: 0 8px;
}

.voice-line {
    margin: 8px 0 0;
}

.voice-line-user {
    color: #666;
}

.voice-panel-note {
    margin: 8px 0 0;
    font-size: 11px;
}


/* ==========================================================
   画面のパネル（D-59）
   ----------------------------------------------------------
   トップページのリンク・メニューと、声で開く画面を、画面を移らずに、右から出るパネルに表示する（public/js/blogos.js）。
   ・上の端は、ヘッダーとメニューの下（--drawer-top。blogos.js が測る）。メニューの項目は、パネルより上に出る
   ・幅（--drawer-width）：パソコン 62%、タブレット 75%、スマホは全体
   ・パネルの中の画面（html.is-embedded）は、ヘッダー・メニュー・会話の欄・パネルを出さない
   ========================================================== */

:root {
    --drawer-width: min(62vw, 1100px);
}

@media (max-width: 1024px) {

    :root {
        --drawer-width: 75vw;
    }

}

@media (max-width: 768px) {

    :root {
        --drawer-width: 100vw;
    }

}

html.is-embedded .site-top,
html.is-embedded .voice-panel,
html.is-embedded .screen-drawer {
    display: none;
}

.screen-drawer {
    position: fixed;
    top: var(--drawer-top, 0px);
    right: 0;
    bottom: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    width: var(--drawer-width);
    background: #fff;
    border-left: 1px solid #999;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
}

.screen-drawer.is-open {
    transform: none;
    visibility: visible;
    transition: transform 0.25s ease;
}

.screen-drawer-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-bottom: 1px solid #ccc;
}

/* 英字の札は ironman だけで出す */
.screen-drawer-code {
    display: none;
}

.screen-drawer-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-weight: bold;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.screen-drawer-full {
    font-size: 13px;
    white-space: nowrap;
}

.screen-drawer-close {
    padding: 0 8px;
}

/* 見出しの行とパンくずリストのまとまり（ヘッダーの BlogOS とメニューバーと同じく、下の線は1本だけ。D-75） */
.screen-drawer-top {
    flex: none;
    border-bottom: 1px solid #ccc;
}

.screen-drawer-top .screen-drawer-head {
    border-bottom: 0;
}

/* パンくずリスト（パネルの中で開いた画面の順番。D-75） */
.screen-drawer-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 6px;
    /* ヘッダーのメニューバーと同じく、上下の余白は付けない */
    padding: 0 10px;
    font-size: 13px;
}

.screen-drawer-crumbs[hidden] {
    display: none;
}

.screen-drawer-crumb.is-current {
    font-weight: bold;
}

.screen-drawer-crumb-sep,
.screen-drawer-crumb-more {
    color: #888;
}

.screen-drawer-frame {
    flex: 1;
    width: 100%;
    border: 0;
    background: transparent;
}

/* 声の操作の状態（聞いている：赤、考えている：黄、話している：青） */
.screen-drawer-signal {
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
}

body.voice-listening .screen-drawer-signal {
    background: #c00;
}

body.voice-thinking .screen-drawer-signal {
    background: #e90;
}

body.voice-speaking .screen-drawer-signal {
    background: #09c;
}

/* パネルを開いている間は、会話の欄を左下に出す（パネルに重ねない。スマホは重ねる） */
@media (min-width: 769px) {

    body.drawer-open .voice-panel {
        right: auto;
        left: 16px;
        width: min(380px, calc(100vw - var(--drawer-width) - 32px));
    }

}

@media (prefers-reduced-motion: reduce) {

    .screen-drawer,
    .screen-drawer.is-open {
        transition: none;
    }

}


/* ==========================================================
   音声操作ポップアップ（D-61。layouts/header・voice/settings-modal）
   ----------------------------------------------------------
   説明の文と、話し方の指示の入力欄があるため、テーマ切替・ブログ切替のポップアップより広くする。
   ========================================================== */

.voice-settings-dialog {
    width: 720px;
}


/* ==========================================================
   説明のツールチップ（D-61-02。partials/tip と public/js/blogos.js）
   ----------------------------------------------------------
   ・項目の横の「?」の丸。マウスを乗せる・押す・Tab で選ぶと、説明の枠（.tip-box）を出す
   ・説明の枠は、ポップアップより上に重ねる。改行は、そのまま改行で出す
   ========================================================== */

.tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 4px;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    vertical-align: middle;
    color: #555;
    border: 1px solid #999;
    border-radius: 50%;
    cursor: help;
    user-select: none;
}

.tip:hover,
.tip:focus-visible {
    color: #fff;
    background: #555;
    outline: none;
}

.tip-box {
    position: fixed;
    z-index: 10000;
    max-width: min(380px, calc(100vw - 16px));
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-line;
    color: #fff;
    background: #333;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.tip-box[hidden] {
    display: none;
}

/* 記事の再評価のポップアップ（D-64）：モデルなどの選択が並ぶため、広くする */
.reevaluation-dialog {
    width: 720px;
}


/* ==========================================================
   画面「AdSense」のカード（D-67。analytics/adsense）
   ----------------------------------------------------------
   AdSense の画面のホームと同じ見方：推定収益額・残高・パフォーマンス・広告ユニットなどを、カード（.panel）で並べる
   ========================================================== */

.adsense-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
    gap: 16px;
    align-items: start;
}

.adsense-grid > .panel {
    margin: 0;
}

.adsense-wide {
    grid-column: 1 / -1;
}

.adsense-figures {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 40px;
}

.adsense-figure-label {
    font-size: 13px;
}

.adsense-figure-value {
    font-size: 30px;
    font-weight: bold;
    line-height: 1.3;
}

.adsense-figure-note,
.adsense-row-note {
    font-size: 12px;
}

.adsense-change {
    font-size: 13px;
}

.adsense-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.adsense-metric-value {
    font-size: 22px;
    font-weight: bold;
}

.adsense-spark {
    display: block;
    width: 100%;
    height: 36px;
    margin-top: 4px;
    color: #1a73e8;
}

.adsense-spark polyline {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.adsense-row {
    padding: 8px 0;
    border-bottom: 1px solid #e5e5e5;
}

.adsense-row:last-child {
    border-bottom: 0;
}

.adsense-row-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
}

.adsense-row-value {
    margin-left: auto;
    font-weight: bold;
}

/* 横の棒（濃い：過去7日間、薄い：その前の7日間） */
.adsense-bar {
    height: 6px;
    margin-top: 4px;
    background: transparent;
}

.adsense-bar span {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: #1a73e8;
}

.adsense-bar-previous span {
    background: #a8c7fa;
}

@media (max-width: 640px) {

    .adsense-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

/* 増減（増えた：緑、減った：赤。文字の色だけ） */
.adsense-up {
    color: #188038;
}

.adsense-down {
    color: #d93025;
}


/* 同期の記録（database/sync-runs）：実行ごとの折りたたみ。押すと対象ごとの表が開く */
details.sync-run {
    margin: 0 0 8px;
}

details.sync-run > summary {
    cursor: pointer;
}

details.sync-run[open] > summary {
    margin-bottom: 8px;
}


/* 定期実行のポップアップの「次の実行」「前回」（D-63-06） */
.schedule-run-info {
    margin: 12px 0;
    font-size: 13px;
}

.schedule-run-failed {
    color: #c00;
}

/* 未確認のお知らせのポップアップ（notices/popup。D-74） */
.notice-popup-list {
    margin: 8px 0;
    padding-left: 18px;
}

.notice-popup-list li {
    margin: 0 0 4px;
}

/* お知らせ履歴の「確認」のボタンは、右端に置く（D-74） */
.notice-actions {
    text-align: right;
}

/* 画面のテーマのポップアップ：テーマの選択欄（説明はテーマ名の「?」）と、ironman の欄の中のアニメーションの設定（D-73-02） */
.theme-option {
    cursor: default;
}

.theme-option-head {
    display: flex;
    align-items: center;
    gap: 6px;
}

.theme-option-head label {
    cursor: pointer;
}

.animation-settings {
    margin: 10px 0 0 24px;
    padding: 8px 12px;
    border: 1px solid #ddd;
}

.animation-settings-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: bold;
}

.animation-settings-all {
    display: inline-flex;
    gap: 6px;
    font-weight: normal;
}

.animation-settings fieldset {
    margin: 0 0 8px;
    padding: 6px 10px;
}

.animation-settings label {
    display: inline;
}

.animation-settings-reactor > label,
.animation-settings-when label,
.animation-settings-line {
    display: block;
    margin: 3px 0;
}

.animation-settings-when {
    margin-left: 24px;
}

/* 説明（?）を横に置く行（D-76） */
.animation-settings-when .animation-settings-line label {
    display: inline;
}

.animation-settings-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.animation-settings-list li {
    margin: 3px 0;
}

/* ironman を選んでいないときは、変えられない */
.animation-settings.is-disabled {
    opacity: 0.5;
}

/* WordPress API情報の「詳細」の表：入れ子のまとまりは、名前の行を押すと中の表が開く（D-72-10） */
.api-field-group > details > summary {
    cursor: pointer;
}

.api-field-children {
    margin: 4px 0 2px 16px;
}

/* 条件の表（名前と入力欄を交互に並べる。色・枠なし。WordPress API情報の条件など。D-72-12） */
.filter-table {
    border-collapse: collapse;
    border: 0;
    background: none;
}

.filter-table th,
.filter-table td {
    padding: 4px 8px 4px 0;
    border: 0;
    background: none;
    text-align: left;
    vertical-align: middle;
}

/* 名前（「?」付き）は折り返さない */
.filter-table th {
    white-space: nowrap;
    font-weight: normal;
}

.filter-table td {
    padding-right: 20px;
}

/* 入力の表（項目名の列と入力欄の列。入力欄の始まりをそろえる。入力欄の大きさは各欄のまま。色・枠なし。ポップアップの入力など） */
.form-grid {
    width: 100%;
    border-collapse: collapse;
    border: 0;
    background: none;
}

.form-grid th,
.form-grid td {
    padding: 5px 10px 5px 0;
    border: 0;
    background: none;
    text-align: left;
    vertical-align: middle;
}

/* 項目名（「?」付き）は折り返さず、列の幅は項目名に合わせる */
.form-grid th {
    width: 1%;
    white-space: nowrap;
    font-weight: normal;
}

/* 入力欄・選択欄は同じ幅にし、列の位置をそろえる */
.filter-table input,
.filter-table select {
    width: 10em;
    box-sizing: border-box;
}

/* 「取得」などのボタンは、表の下の右端 */
.filter-actions {
    margin: 6px 0 0;
    text-align: right;
}

/* パネルを横に並べる（アクティビティログの取得条件・表示条件。D-77-09）。高さをそろえ、ボタンはパネルの下の右端。狭い画面では縦に並べる */
.panel-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin: 24px 0;
}

.panel-columns > .panel {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.panel-columns > .panel > form {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.panel-columns .filter-actions {
    margin-top: auto;
}

@media (max-width: 768px) {

    .panel-columns {
        grid-template-columns: minmax(0, 1fr);
    }

}

/* 押すと、すぐ下の行が開く行（品質評価の採点項目：quality/evaluations/show。.expand-row は、ほかの画面でも使う共通の形：reactor/compare）。
   開くかどうかの印を、行の最初のセルの前に出す */
.evaluation-item,
.expand-row {
    cursor: pointer;
}

.evaluation-item > td:first-child::before,
.expand-row > td:first-child::before {
    content: "▶";
    display: inline-block;
    margin-right: 6px;
    font-size: 70%;
    transition: transform 0.15s ease;
}

.evaluation-item[aria-expanded="true"] > td:first-child::before,
.expand-row[aria-expanded="true"] > td:first-child::before {
    transform: rotate(90deg);
}

.evaluation-item-detail > td,
.expand-row-detail > td {
    padding-left: 24px;
}

/* 表はパネルの幅いっぱいで、列の幅を決めておく（開いて中の表が出ても、表の大きさ・列の幅が変わらないように）。
   判定（最長「要人間確認」）と得点（例：12.5点 / 15点）は、全部が見える幅で折り返さない */
table.data.evaluation-items,
table.data.evaluation-item-table {
    width: 100%;
    table-layout: fixed;
}

.evaluation-items-judgment {
    width: 8em;
}

/* 得点は「12.5点 / 15点」まで */
.evaluation-items-points {
    width: 10em;
}

table.data.evaluation-items > * > tr > td:nth-child(2),
table.data.evaluation-items > * > tr > td:nth-child(3),
table.data.evaluation-items > thead > tr > th {
    white-space: nowrap;
}

.evaluation-item-table-label {
    width: 7em;
}

/* 判定の基準の中の表（「○」「△」と補足。D-79-02）。中の表の幅いっぱいで、記号の列は狭く固定する */
table.data.evaluation-criteria {
    width: 100%;
    table-layout: fixed;
}

.evaluation-criteria-mark {
    width: 3em;
}

table.data.evaluation-criteria > tbody > tr > th {
    text-align: center;
}
/* 記事の企画のカテゴリごとの記事種類：開いた表の見出しの左右の余白を詰め、文字を少し小さくする（10列を同じ幅にしても、右の引き出しの幅で見出しが途中で折り返さないように。D-83-03） */
table.data.type-matrix-detail > thead > tr > th {
    padding-left: 2px;
    padding-right: 2px;
    font-size: 13px;
}
