﻿/* Kifu editor right panel. */
/* =====================================================================
   棋譜作成（対局情報編集）右パネル リデザイン  v20260622-editor-redesign-v1
   デザイン画像に合わせ、右パネルをカード化し緑系テーマへ統一する。
   既存IDは維持し、#editorPanel スコープで旧スタイルを上書きする。
   ===================================================================== */
#editorPanel.editor-panel {
  grid-area: analysis;
  align-self: start;
  gap: 18px !important;
  padding: 24px 24px 26px !important;
  border: 1px solid rgba(68, 88, 100, 0.18) !important;
  border-radius: 10px !important;
  background: #fffdfa !important;
  box-shadow: 0 2px 0 rgba(22, 34, 42, 0.10), 0 6px 12px rgba(31, 45, 55, 0.08) !important;
}

/* ヘッダー: タイトル「対局情報編集」＋ 対局サマリ */
#editorPanel .editor-header {
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(68, 88, 100, 0.14);
}

#editorPanel .editor-autosave-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(15, 104, 66, 0.18);
  border-radius: 9px;
  background: rgba(15, 104, 66, 0.055);
  color: #274236;
}

#editorPanel .editor-autosave-card > svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--brand-green);
}

#editorPanel .editor-autosave-card > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

#editorPanel .editor-autosave-card strong {
  font-size: 13px;
  line-height: 1.35;
}

#editorPanel .editor-autosave-card span {
  color: #5d6f65;
  font-size: 12px;
  line-height: 1.5;
}

#editorPanel .editor-head-text {
  min-width: 0;
}

#editorPanel .editor-head-text h2 {
  margin: 0 0 4px;
  color: #17231d;
  font-family: var(--title-font);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.28;
}
#editorPanel .editor-info-summary {
  display: block;
  margin: 0 0 6px;
  color: #65758a;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
}

#editorPanel .editor-header-actions {
  flex: 0 0 auto;
  gap: 8px;
}

#editorPanel .editor-header-actions button {
  min-height: 38px !important;
  padding: 0 13px !important;
  border: 1px solid rgba(68, 88, 100, 0.2) !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #233039 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

#editorPanel .editor-header-actions button:hover {
  border-color: var(--brand-green) !important;
  color: var(--brand-green) !important;
}

/* 折りたたみの対局情報編集トグル（控えめなリンク調） */
#editorPanel .editor-info-panel {
  display: grid;
  gap: 10px;
}

#editorPanel #editorInfoToggleBtn {
  justify-self: start;
  min-height: 0 !important;
  padding: 2px 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--brand-green) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-decoration: underline;
}

#editorPanel .editor-info-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(68, 88, 100, 0.16);
  border-radius: 10px;
  background: #f7faf8;
}

#editorPanel .editor-info-fields:not(.hidden) {
  display: grid;
}

/* diagram-tools コンテナの旧カード装飾を解除してフラットなセクションに */
#editorPanel .diagram-tools {
  display: grid !important;
  gap: 12px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

#editorPanel .editor-tool-group {
  display: block !important;
  grid-template-columns: none !important;
}

#editorPanel .editor-mode-group {
  padding-bottom: 0 !important;
  border-bottom: 0 !important;
}

#editorPanel .editor-tool-label {
  display: block;
  margin: 0 0 9px;
  padding: 0 !important;
  color: #1c2730 !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  white-space: normal;
}

/* 挿入モード / 参考図開始 のトグルスイッチ */
#editorPanel .editor-mode-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

#editorPanel .editor-switch {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  min-height: 48px !important;
  padding: 0 14px 0 62px !important;
  border: 1px solid rgba(68, 88, 100, 0.2) !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #2a3942 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  text-align: left;
}

#editorPanel .editor-switch::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #cfd8dd;
  transform: translateY(-50%);
  transition: background 0.15s ease;
}

#editorPanel .editor-switch::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transform: translateY(-50%);
  transition: left 0.15s ease;
}

#editorPanel .editor-switch.active {
  border-color: rgba(15, 104, 66, 0.5) !important;
  color: #155e3f !important;
}

#editorPanel .editor-switch.active::before {
  background: var(--brand-green);
}

#editorPanel .editor-switch.active::after {
  left: 36px;
}

#editorPanel .editor-switch:disabled {
  opacity: 0.55;
}

#editorPanel .editor-mode-toggles > button:not(.editor-switch) {
  min-height: 44px !important;
  border: 1px solid rgba(68, 88, 100, 0.2) !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #b3402f !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

/* 操作ボタン: 3列グリッド（元に戻す/やり直す/パス・途中手削除/最終手削除/SGF保存） */
#editorPanel .editor-action-group {
  display: block !important;
}

#editorPanel .editor-actions {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 0 !important;
}

#editorPanel .editor-actions button {
  min-height: 36px !important;
  padding: 0 7px !important;
  border: 1px solid rgba(68, 88, 100, 0.2) !important;
  border-radius: 9px !important;
  background: #fff !important;
  box-shadow: 0 1px 0 rgba(22, 34, 42, 0.04) !important;
  color: #233039 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

#editorPanel .editor-actions button:hover:not(:disabled) {
  border-color: var(--brand-green) !important;
  color: var(--brand-green) !important;
}

#editorPanel .editor-actions button:disabled {
  opacity: 0.5;
}

#editorPanel #saveSgfBtn {
  border-color: rgba(15, 104, 66, 0.4) !important;
  color: #155e3f !important;
}

/* 図作成ツール: 石の行 / 記号の行 / 選択削除 */
#editorPanel .editor-diagram-group,
#editorPanel .editor-selection-group {
  display: grid !important;
  gap: 7px;
}

#editorPanel .editor-action-group .editor-tool-label,
#editorPanel .editor-diagram-group .editor-tool-label,
#editorPanel .editor-selection-group .editor-tool-label {
  margin-bottom: 0;
}

#editorPanel .diagram-tool-row {
  display: grid !important;
  gap: 6px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

#editorPanel .diagram-tool-marks {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

#editorPanel .diagram-tool-row button,
#editorPanel .diagram-delete-selection {
  min-height: 36px !important;
  min-width: 0 !important;
  padding: 0 5px !important;
  border: 1px solid rgba(68, 88, 100, 0.2) !important;
  border-radius: 9px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #233039 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

#editorPanel .diagram-tool-row button.active {
  border-color: var(--brand-green) !important;
  background: rgba(15, 104, 66, 0.1) !important;
  color: var(--brand-green) !important;
}

#editorPanel .diagram-tool-row button:hover:not(.active) {
  border-color: rgba(15, 104, 66, 0.45) !important;
}

#editorPanel .diagram-tool-marks input {
  min-height: 36px !important;
  width: 100% !important;
  margin: 0 !important;
  border: 1px solid rgba(68, 88, 100, 0.2) !important;
  border-radius: 9px !important;
  background: #fff !important;
  color: #233039 !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  text-align: center;
}

#editorPanel .diagram-delete-selection {
  width: 100%;
  margin-top: 2px;
}

/* コメント欄 */
#editorPanel .comment-box {
  display: grid;
  gap: 3px;
}

#editorPanel .comment-box textarea {
  margin-top: 5px;
  min-height: 96px;
  border: 1px solid rgba(68, 88, 100, 0.22) !important;
  border-radius: 10px !important;
  padding: 12px !important;
  color: #233039;
  font-size: 14px !important;
}

/* 参考図作成 メインアクション */
#editorPanel .editor-ai-actions {
  display: block;
  margin: 0 !important;
}

#editorPanel .editor-ai-actions button {
  width: 100%;
  min-height: 60px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0 !important;
  border-radius: 10px !important;
  background: var(--brand-green) !important;
  color: #fff !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  box-shadow: 0 3px 0 rgba(22, 34, 42, 0.16), 0 7px 14px rgba(15, 104, 66, 0.22) !important;
}

#editorPanel .editor-ai-actions button::before {
  content: "▣";
  font-size: 17px;
}

#editorPanel .editor-status {
  margin: 0;
  color: #8090a0;
  font-size: 12.5px;
}

@media (max-width: 1180px) {
  #editorPanel .editor-info-fields:not(.hidden) {
    grid-template-columns: 1fr;
  }
}



/* Make Go board star points slightly easier to see at the smaller board size. */
.point.star::after {
  width: 14% !important;
  height: 14% !important;
  max-width: 4.5px !important;
  max-height: 4.5px !important;
}


#editorPanel .editor-move-warning {
  margin: 0;
  color: #c2362b;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
}

.editor-new-kifu-dialog {
  position: fixed;
  z-index: 92;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.editor-new-kifu-dialog.hidden {
  display: none;
}

.editor-new-kifu-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(15, 28, 21, 0.56);
  backdrop-filter: blur(4px);
  cursor: default;
}

.editor-new-kifu-panel {
  position: relative;
  display: grid;
  width: min(570px, calc(100vw - 40px));
  max-height: min(90vh, 720px);
  gap: 16px;
  padding: 22px;
  overflow: auto;
  box-sizing: border-box;
  border: 1px solid rgba(38, 75, 52, 0.2);
  border-radius: 18px;
  background: #fffdf8;
  box-shadow: 0 28px 80px rgba(12, 31, 20, 0.3);
}

.editor-new-kifu-head span {
  color: #708078;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.editor-new-kifu-head h2 {
  margin: 4px 0 2px;
  color: #173c28;
  font-family: var(--title-font);
  font-size: 23px;
}

.editor-new-kifu-head p {
  margin: 0;
  color: #66766c;
  font-size: 12px;
}

.editor-new-kifu-fields {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.editor-new-kifu-fields > label:not(.editor-new-kifu-checkbox) {
  display: grid;
  gap: 6px;
  color: #294535;
  font-size: 12px;
  font-weight: 700;
}

.editor-new-kifu-fields select,
.editor-new-kifu-fields input[type="number"],
.editor-new-kifu-fields input[type="date"],
.editor-new-kifu-fields input[type="text"] {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  box-sizing: border-box;
  border: 1px solid rgba(42, 76, 55, 0.2);
  border-radius: 9px;
  background: #fff;
  color: #213d2d;
  font: inherit;
}

.editor-new-kifu-checkbox {
  display: flex;
  grid-column: 1 / -1;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid rgba(42, 76, 55, 0.14);
  border-radius: 10px;
  background: #f3f7f1;
  cursor: pointer;
}

.editor-new-kifu-checkbox input {
  margin-top: 3px;
}

.editor-new-kifu-checkbox span {
  display: grid;
  gap: 2px;
}

.editor-new-kifu-checkbox strong {
  color: #234b34;
  font-size: 12px;
}

.editor-new-kifu-checkbox small {
  color: #6b7b71;
  font-size: 10px;
  line-height: 1.5;
}
.editor-new-kifu-placement-preview { grid-column: 1 / -1; width: 100%; min-width: 0; max-width: 100%; margin-top: 8px; padding: 14px; overflow: hidden; box-sizing: border-box; border: 1px solid rgba(220, 130, 135, .35); border-radius: 16px; background: rgba(255, 249, 246, .8); }
.editor-new-kifu-placement-head { display:flex; justify-content:space-between; gap:12px; align-items:baseline; margin-bottom:10px; }
.editor-new-kifu-placement-head span, .editor-new-kifu-placement-help { color:#765e5a; font-size:.82rem; }
.editor-new-kifu-placement-tools { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }
.editor-new-kifu-placement-tools button { border:1px solid #e3b8b0; border-radius:999px; background:#fff; color:#744b47; padding:6px 12px; cursor:pointer; }
.editor-new-kifu-placement-tools button.active { background:#e96f76; color:#fff; border-color:#e96f76; }
.editor-new-kifu-placement-board { display:grid; grid-template-columns:repeat(var(--board-size), 1fr); grid-template-rows:repeat(var(--board-size), 1fr); position:relative; margin:0 auto; }
.editor-new-kifu-placement-board .point {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  appearance: none;
}
.editor-new-kifu-placement-board .point:hover,
.editor-new-kifu-placement-board .point:focus-visible {
  background: transparent !important;
  box-shadow: none !important;
}
.editor-new-kifu-placement-board .stone { position:absolute; width:calc(100% / var(--board-size) * .82); aspect-ratio:1; transform:translate(-50%,-50%); border-radius:50%; z-index:2; pointer-events:none; }
.editor-new-kifu-placement-board .stone.black { background:radial-gradient(circle at 35% 30%,#555,#111 65%); box-shadow:0 2px 4px #76502a; }
.editor-new-kifu-placement-board .stone.white { background:radial-gradient(circle at 35% 30%,#fff,#ddd 70%); border:1px solid #aaa; box-shadow:0 2px 4px #76502a; }

.editor-new-kifu-warning {
  margin: 0;
  padding: 9px 11px;
  color: #8a4324;
  border: 1px solid #edcfba;
  border-radius: 9px;
  background: #fff6ed;
  font-size: 11px;
  line-height: 1.5;
}

.editor-new-kifu-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.editor-new-kifu-actions button {
  min-width: 112px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 9px;
  font-weight: 800;
}

#editorNewKifuCancelBtn {
  color: #52645a;
  border: 1px solid rgba(42, 76, 55, 0.18);
  background: #fff;
}

#editorNewKifuCreateBtn {
  color: #fff;
  border: 1px solid #235c3b;
  background: #235c3b;
}

body.editor-new-kifu-dialog-open {
  overflow: hidden;
}

@media (max-width: 560px) {
  .editor-new-kifu-dialog {
    padding: 10px;
  }

  .editor-new-kifu-panel {
    width: min(100%, 570px);
    padding: 17px;
  }

  .editor-new-kifu-fields {
    grid-template-columns: 1fr;
  }

  .editor-new-kifu-actions button {
    flex: 1 1 0;
    min-width: 0;
  }
}

.editor-board-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.editor-board-dialog.hidden {
  display: none;
}

.editor-board-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(2px);
}

.editor-board-dialog-panel {
  position: relative;
  width: min(1040px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid rgba(15, 89, 63, 0.18);
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 0 18px 44px rgba(20, 35, 25, 0.22);
}

.editor-board-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 12px;
  border-bottom: 1px solid rgba(15, 89, 63, 0.14);
}

.editor-board-dialog-head h2 {
  margin: 2px 0 0;
  font-family: var(--title-font);
  font-size: 24px;
  font-weight: 500;
}

.editor-board-dialog-mode {
  margin: 0;
  color: #0f6b48;
  font-size: 13px;
}

#editorBoardDialogCloseBtn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(15, 89, 63, 0.18);
  border-radius: 999px;
  background: #ffffff;
}

.editor-board-dialog-body {
  display: grid;
  grid-template-columns: minmax(646px, 1fr) 238px;
  gap: 14px;
  padding: 18px 18px 20px;
}

.editor-board-dialog-board {
  width: min(646px, 100%);
  margin: 0;
}

.editor-board-dialog-tools {
  width: 238px;
  display: grid;
  align-content: start;
  gap: 11px;
}

.editor-board-dialog-tool-group {
  display: grid;
  gap: 8px;
}

.editor-board-dialog-tool-group > span,
.editor-board-dialog-comment > span {
  color: #1f3b2f;
  font-weight: 600;
  font-size: 14px;
}

.editor-board-dialog-tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.editor-board-dialog-tool-row.marks {
  display: flex;
  flex-wrap: wrap;
}

.editor-board-dialog-tool-row button,
.editor-board-dialog-actions button {
  flex: 0 0 auto;
  min-width: 92px;
  padding: 0 12px;
}

.editor-board-dialog-tool-row button.active,
.editor-board-dialog-actions button:first-child {
  background: #006b43;
  color: #ffffff;
  border-color: #006b43;
}

.editor-board-dialog-history .editor-board-dialog-tool-row button,
.editor-board-dialog-move-tools .editor-board-dialog-tool-row button {
  flex-basis: 82px;
}

.editor-board-dialog-tool-row button:disabled {
  opacity: 0.45;
}

.editor-board-dialog-tool-row input {
  width: 48px;
  min-width: 48px;
  border: 1px solid rgba(15, 89, 63, 0.2);
  border-radius: 8px;
  text-align: center;
}

.editor-board-dialog-comment {
  display: grid;
  gap: 8px;
}

.editor-board-dialog-comment textarea {
  width: 100%;
  max-width: 238px;
  resize: vertical;
  border: 1px solid rgba(15, 89, 63, 0.18);
  border-radius: 8px;
  padding: 9px;
  font-family: var(--body-font);
}

.editor-board-dialog-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}

@media (max-width: 900px) {
  .editor-board-dialog-body {
    grid-template-columns: 1fr;
  }
}


.editor-board-dialog-tool-row button {
  flex: 0 0 56px;
  padding: 0 7px;
  font-size: 13px;
}

.editor-board-dialog-tool-row button[data-dialog-tool="mark-cross"],
.editor-board-dialog-tool-row button[data-dialog-tool="mark-circle"],
.editor-board-dialog-tool-row button[data-dialog-tool="mark-square"],
.editor-board-dialog-tool-row button[data-dialog-tool="mark-triangle"] {
  flex-basis: 42px;
  font-size: 18px;
}

.editor-board-dialog-tool-row button[data-dialog-tool="label"] {
  flex-basis: 58px;
}

.editor-board-dialog-actions button {
  flex: 0 0 auto;
  min-width: 104px;
  padding: 0 14px;
}

.editor-board-dialog-actions button {
  min-width: 92px;
  padding: 0 12px;
}


#editorPanel .diagram-selection-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

#editorPanel .diagram-selection-actions .diagram-delete-selection {
  width: auto;
  margin-top: 0;
}
.editor-board-dialog-sequence {
  display: grid;
  gap: 6px;
  padding: 8px 9px;
  border: 1px solid rgba(15, 89, 63, 0.16);
  border-radius: 8px;
  background: rgba(15, 104, 66, 0.04);
}

.editor-board-dialog-sequence.hidden {
  display: none;
}

.editor-board-dialog-sequence-title {
  color: #1f3b2f;
  font-size: 13px;
  font-weight: 700;
}

.editor-board-dialog-sequence-empty {
  color: #66756c;
  font-size: 12px;
  line-height: 1.5;
}

.editor-board-dialog-move-number {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.editor-board-dialog-move-number.on-black {
  color: #fff;
}

.editor-board-dialog-move-number.on-white {
  color: #111;
}
#editorPanel .editor-info-links {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

#editorPanel #editorUsageGuideBtn {
  justify-self: start;
  min-height: 0 !important;
  padding: 2px 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #65758a !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-decoration: underline;
}







#editorPanel .editor-reference-list {
  display: grid;
  gap: 8px;
}

#editorPanel .editor-summary-title {
  color: #1c2730;
  font-size: 15px;
  font-weight: 700;
}

#editorPanel .editor-summary-list {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

#editorPanel .editor-summary-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  width: 100%;
  min-height: 34px !important;
  padding: 7px 9px !important;
  border: 1px solid rgba(68, 88, 100, 0.16) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #233039 !important;
  text-align: left;
  box-shadow: none !important;
}

#editorPanel .editor-summary-item strong {
  color: var(--brand-green);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

#editorPanel .editor-summary-item span {
  overflow: hidden;
  color: #34444e;
  font-size: 12.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#editorPanel .editor-summary-item.reference-item span {
  color: #165f42;
  font-weight: 700;
}

#editorPanel .editor-summary-item.active {
  border-color: rgba(15, 104, 66, 0.45) !important;
  background: rgba(15, 104, 66, 0.08) !important;
}

#editorPanel .editor-reference-empty {
  color: #8090a0;
  font-size: 12.5px;
}

#editorPanel .editor-reference-detail {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(15, 104, 66, 0.22);
  border-radius: 9px;
  background: #f6faf7;
}

#editorPanel .editor-reference-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#editorPanel .editor-reference-close {
  min-height: 28px !important;
  padding: 0 9px !important;
  border: 1px solid rgba(68, 88, 100, 0.2) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #155e3f !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}


#editorPanel .editor-reference-jump-list {
  display: grid;
  gap: 6px;
}

#editorPanel .editor-reference-jump {
  width: 100%;
  min-height: 32px !important;
  padding: 6px 9px !important;
  border: 1px solid rgba(15, 104, 66, 0.22) !important;
  border-radius: 8px !important;
  background: rgba(15, 104, 66, 0.06) !important;
  color: #155e3f !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  text-align: left;
}

/* ─── 統合コメント・参考図リスト ─── */
#editorPanel .editor-summary-meta {
  color: #6a8070;
  font-size: 11.5px;
}

#editorPanel .editor-merged-list {
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}

#editorPanel .editor-merged-item {
  padding: 5px 8px;
  border: 1px solid rgba(31, 41, 51, 0.1);
  border-radius: 8px;
  background: #fff;
}

#editorPanel .editor-merged-item.active {
  border-color: rgba(15, 104, 66, 0.40);
  background: rgba(15, 104, 66, 0.06);
}

#editorPanel .editor-merged-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

#editorPanel .editor-merged-stone {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

#editorPanel .editor-merged-stone.black {
  background: radial-gradient(circle at 34% 28%, #5a6471, #10161d 66%);
}

#editorPanel .editor-merged-stone.white {
  background: radial-gradient(circle at 34% 28%, #fff, #f3f0e8 68%, #d5cec2);
  border: 1px solid #b0a898;
}

#editorPanel .editor-merged-move-btn {
  min-height: unset !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--brand-green);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#editorPanel .editor-merged-move-btn:hover {
  text-decoration: underline;
  transform: none !important;
}

#editorPanel .editor-merged-comment {
  margin: 2px 0 0 19px;
  overflow: hidden;
  color: #34444e;
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

#editorPanel .editor-merged-ref-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 2px 0 0 19px;
}

#editorPanel .editor-merged-ref-label {
  color: #165f42;
  font-size: 12px;
  font-weight: 700;
}

#editorPanel .editor-merged-ref-btn {
  min-height: 22px !important;
  padding: 1px 9px !important;
  border: 1px solid rgba(15, 104, 66, 0.35) !important;
  border-radius: 6px !important;
  background: rgba(15, 104, 66, 0.07) !important;
  box-shadow: none !important;
  color: #155e3f !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
}

#editorPanel .editor-merged-ref-btn:hover {
  background: rgba(15, 104, 66, 0.14) !important;
  transform: none !important;
}

/* ─── PNG redesign v2 ─────────────────────────────────── */

/* ヘッダー: タイトル行 (四角枠ペンアイコン + h2) */
#editorPanel .editor-header {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px;
}

#editorPanel .editor-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* 四角い緑枠付きアイコンボックス */
#editorPanel .editor-title-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--brand-green);
  border-radius: 8px;
  background: rgba(15, 104, 66, 0.07);
}

#editorPanel .editor-title-icon {
  width: 16px;
  height: 16px;
  color: var(--brand-green);
}

#editorPanel .editor-title-row h2 {
  margin: 0;
  color: #17231d;
  font-family: var(--title-font);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.28;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 対局情報バー */
#editorPanel .editor-info-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 8px;
  background: rgba(15, 104, 66, 0.08);
}
#editorPanel .editor-info-bar svg {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  color: #0f6842;
}
#editorPanel .editor-info-bar .editor-info-summary {
  display: block !important;
  margin: 0 !important;
  color: #1a4030;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
}

/* 対局情報リンク行: 2列グリッドボタン */
#editorPanel .editor-info-links {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  align-items: unset !important;
  flex-wrap: unset !important;
}
#editorPanel .editor-info-links button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  min-height: 38px !important;
  padding: 0 8px !important;
  border: 1.5px solid rgba(15, 104, 66, 0.55) !important;
  border-radius: 9px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: var(--brand-green) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}
#editorPanel .editor-info-links button svg {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
}
#editorPanel .editor-info-links button:hover {
  border-color: var(--brand-green) !important;
  color: var(--brand-green) !important;
}

/* ファイル操作: 3列グリッド */
#editorPanel .editor-file-actions input[type="file"] {
  display: none;
}
#editorPanel .editor-file-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
#editorPanel .editor-file-actions button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  min-height: 42px !important;
  padding: 0 5px !important;
  border: 1px solid rgba(68, 88, 100, 0.2) !important;
  border-radius: 9px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #233039 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}
#editorPanel .editor-file-actions button svg {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
}
#editorPanel .editor-file-actions button:hover {
  border-color: var(--brand-green) !important;
  color: var(--brand-green) !important;
}
/* SGF読込: 緑塗り */
#editorPanel .editor-sgf-load-btn {
  background: var(--brand-green) !important;
  border-color: var(--brand-green) !important;
  color: #fff !important;
}
#editorPanel .editor-sgf-load-btn:hover {
  background: #0d5c38 !important;
  border-color: #0d5c38 !important;
  color: #fff !important;
}
/* editor-file-actions 内の editor-switch: スイッチ疑似要素を隠してボタン風に */
#editorPanel .editor-file-actions .editor-switch {
  position: static !important;
  justify-content: center !important;
  min-height: 42px !important;
  padding: 0 5px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}
#editorPanel .editor-file-actions .editor-switch::before,
#editorPanel .editor-file-actions .editor-switch::after {
  display: none !important;
}
#editorPanel .editor-file-actions .editor-switch.active {
  border-color: rgba(15, 104, 66, 0.5) !important;
  background: rgba(15, 104, 66, 0.08) !important;
  color: #155e3f !important;
}

/* 開始セクション */
#editorPanel .editor-start-group {
  display: block !important;
}
#editorPanel .editor-start-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
#editorPanel .editor-start-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  width: 100% !important;
  min-height: 42px !important;
  padding: 0 12px !important;
  border: 1px solid rgba(15, 104, 66, 0.35) !important;
  border-radius: 10px !important;
  background: rgba(15, 104, 66, 0.07) !important;
  box-shadow: none !important;
  color: #165f42 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}
#editorPanel .editor-start-btn svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
#editorPanel .editor-start-btn:hover {
  background: rgba(15, 104, 66, 0.13) !important;
}
#editorPanel .editor-start-btn.active {
  border-color: rgba(15, 104, 66, 0.55) !important;
  background: rgba(15, 104, 66, 0.16) !important;
  color: #0e5233 !important;
}

/* 棋譜操作: 2列グリッド、SGF保存フルワイド */
#editorPanel .editor-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
}
#editorPanel .editor-actions button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
}
#editorPanel .editor-actions button svg {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
}
#editorPanel .editor-save-full {
  grid-column: 1 / -1;
}

/* 印ツール: 5列 */
#editorPanel .diagram-tool-marks {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

/* ラベル入力行 */
#editorPanel .diagram-label-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
}
#editorPanel .diagram-label-letter {
  flex-shrink: 0;
  color: #4a5560;
  font-size: 13px;
  font-weight: 600;
}
#editorPanel .diagram-label-row input {
  flex: 1;
  min-height: 32px !important;
  padding: 0 8px !important;
  border: 1px solid rgba(68, 88, 100, 0.2) !important;
  border-radius: 9px !important;
  background: #fff !important;
  color: #233039;
  font-size: 15px !important;
  font-weight: 800 !important;
  text-align: center;
}

/* 旧 diagram-tool-marks input (inline) は非表示 – 新HTMLでは.diagram-label-rowに移動 */
#editorPanel .diagram-tool-marks input {
  display: none !important;
}

/* ─── PNG redesign v3: セクション区切り / 印ツール / 選択 ─ */

/* ファイル操作行の後の区切り線 */
#editorPanel .editor-file-actions {
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(68, 88, 100, 0.11);
  margin-bottom: 2px;
}

/* セクション間区切り線（棋譜操作・印・選択の各グループ前） */
#editorPanel .editor-action-group,
#editorPanel .editor-diagram-group,
#editorPanel .editor-selection-group {
  padding-top: 14px !important;
  border-top: 1px solid rgba(68, 88, 100, 0.11);
  margin-top: 2px;
}

/* 印ツール: mark-cross を黒丸SVGで表示 */
#editorPanel .diagram-tool-row button[data-tool="mark-cross"] {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
}
#editorPanel .diagram-tool-row button[data-tool="mark-cross"] svg {
  width: 16px;
  height: 16px;
  fill: #1a2a22;
  flex-shrink: 0;
}
#editorPanel .diagram-tool-row button[data-tool="mark-cross"].active svg {
  fill: var(--brand-green);
}

/* ラベル入力: プレースホルダーのフォントサイズ縮小 */
#editorPanel .diagram-label-row input::placeholder {
  font-size: 11px;
  font-weight: 400;
  color: #9aacb4;
  letter-spacing: 0;
}
#editorPanel .diagram-label-row input {
  font-size: 13px !important;
  font-weight: 700 !important;
  text-align: left !important;
  padding: 0 10px !important;
}

/* 選択操作ボタン: アイコン + テキスト */
#editorPanel .diagram-delete-selection {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
}
#editorPanel .diagram-delete-selection svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

/* ─── コメント・参考図 タイムラインUI ─────────────────────── */
#editorPanel .editor-cmtref-section {
  display: grid;
  border: 1px solid rgba(15, 104, 66, 0.2);
  border-radius: 12px;
  background: #f9fcfb;
  overflow: hidden;
}
#editorPanel .editor-cmtref-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px 10px;
  border-bottom: 1px solid rgba(15, 104, 66, 0.13);
}
#editorPanel .editor-cmtref-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #1a2e24;
  font-size: 14px;
  font-weight: 700;
}
#editorPanel .editor-cmtref-title svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--brand-green);
}
#editorPanel .editor-cmtref-collapse-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 7px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #5a6a72 !important;
}
#editorPanel .editor-cmtref-collapse-btn svg { width: 17px; height: 17px; }
#editorPanel .editor-cmtref-collapse-btn:hover { background: rgba(15,104,66,0.08) !important; color: var(--brand-green) !important; }
#editorPanel .editor-cmtref-body {
  display: grid;
  gap: 10px;
  padding: 12px 13px 14px;
}
/* タブ */
#editorPanel .editor-cmtref-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1.5px solid var(--brand-green);
  border-radius: 10px;
  overflow: hidden;
}
#editorPanel .editor-cmtref-tab {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 38px;
  min-height: 38px !important;
  padding: 0 6px !important;
  border: none !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #5a6a72 !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
}
#editorPanel .editor-cmtref-tab svg { flex-shrink: 0; width: 14px; height: 14px; }
#editorPanel .editor-cmtref-tabs > .editor-cmtref-tab:first-child { border-right: 1.5px solid var(--brand-green) !important; }
#editorPanel .editor-cmtref-tab.active { background: rgba(15,104,66,0.07) !important; color: var(--brand-green) !important; }
#editorPanel .editor-cmtref-tab:hover:not(.active) { background: rgba(15,104,66,0.04) !important; }
/* フィルターパネル */
#editorPanel .editor-cmtref-filter-panel {
  display: flex;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(15,104,66,0.16);
  border-radius: 9px;
  background: #f4f8f5;
}
#editorPanel .editor-cmtref-filter-btn {
  flex: 1;
  height: 32px !important;
  min-height: 32px !important;
  border: 1px solid rgba(68,88,100,0.18) !important;
  border-radius: 7px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #34444e !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
}
#editorPanel .editor-cmtref-filter-btn.active { border-color: var(--brand-green) !important; background: rgba(15,104,66,0.09) !important; color: var(--brand-green) !important; }
/* 集計行 */
#editorPanel .editor-cmtref-stats {
  display: flex;
  align-items: center;
  gap: 18px;
}
#editorPanel .editor-cmtref-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #34444e;
  font-size: 13px;
  font-weight: 600;
}
#editorPanel .editor-cmtref-stat svg { flex-shrink: 0; width: 15px; height: 15px; color: var(--brand-green); }
#editorPanel .editor-cmtref-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(15,104,66,0.12);
  color: var(--brand-green);
  font-size: 11.5px;
  font-weight: 700;
}
/* 情報バー */
#editorPanel .editor-cmtref-info-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgba(31,104,80,0.18);
  border-radius: 8px;
  background: #fff;
  color: #33546a;
  font-size: 12.5px;
}
#editorPanel .editor-cmtref-info-bar svg { flex-shrink: 0; width: 15px; height: 15px; color: #2d8fba; }
/* リストヘッダー */
#editorPanel .editor-cmtref-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
#editorPanel .editor-cmtref-list-count {
  color: #1c2a22;
  font-size: 13.5px;
  font-weight: 700;
}
#editorPanel .editor-cmtref-sort-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 3px;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 10px !important;
  border: 1px solid rgba(68,88,100,0.2) !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #34444e !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}
#editorPanel .editor-cmtref-sort-btn svg { width: 13px; height: 13px; }
#editorPanel .editor-cmtref-sort-btn:hover { border-color: var(--brand-green) !important; color: var(--brand-green) !important; }
/* タイムライン */
#editorPanel .editor-cmtref-timeline { display: grid; }
#editorPanel .editor-cmtref-tl-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
#editorPanel .editor-cmtref-tl-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 44px;
  padding-bottom: 10px;
}
#editorPanel .editor-cmtref-tl-item:last-child .editor-cmtref-tl-left { padding-bottom: 0; }
#editorPanel .editor-cmtref-tl-move {
  color: var(--brand-green);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  margin-bottom: 3px;
  line-height: 1.2;
}
#editorPanel .editor-cmtref-tl-stone {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}
#editorPanel .editor-cmtref-tl-stone.black {
  background: radial-gradient(circle at 34% 28%, #5a6471, #10161d 66%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
#editorPanel .editor-cmtref-tl-stone.white {
  background: radial-gradient(circle at 34% 28%, #fff, #f3f0e8 68%, #d5cec2);
  border: 1px solid #b0a898;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
#editorPanel .editor-cmtref-tl-line {
  flex: 1;
  min-height: 14px;
  width: 1.5px;
  background: rgba(15,104,66,0.2);
  margin: 4px 0;
}
/* カード */
#editorPanel .editor-cmtref-tl-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid rgba(31,41,51,0.12);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(22,34,42,0.04);
}
#editorPanel .editor-cmtref-tl-item:last-child .editor-cmtref-tl-card { margin-bottom: 0; }
#editorPanel .editor-cmtref-tl-card:hover { border-color: rgba(15,104,66,0.35); }
#editorPanel .editor-cmtref-tl-card.active { border-color: rgba(15,104,66,0.45); background: rgba(15,104,66,0.06); }
#editorPanel .editor-cmtref-tl-card.multi { flex-direction: column; align-items: stretch; gap: 6px; }
#editorPanel .editor-cmtref-tl-row { display: flex; align-items: center; gap: 8px; }
#editorPanel .editor-cmtref-tl-icon { flex-shrink: 0; width: 18px; height: 18px; color: var(--brand-green); }
#editorPanel .editor-cmtref-tl-text {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #233039;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
#editorPanel .editor-cmtref-open-btn {
  flex-shrink: 0;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 11px !important;
  border: 1.5px solid var(--brand-green) !important;
  border-radius: 7px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: var(--brand-green) !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
}
#editorPanel .editor-cmtref-open-btn:hover { background: rgba(15,104,66,0.07) !important; }
#editorPanel .editor-cmtref-tl-card-chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: #b0bcc4;
}
#editorPanel .editor-cmtref-tl-card-chevron svg { width: 16px; height: 16px; }
/* 使い方 */
#editorPanel .editor-cmtref-usage {
  padding: 10px 12px;
  border: 1px solid rgba(15,104,66,0.14);
  border-radius: 9px;
  background: rgba(15,104,66,0.04);
}
#editorPanel .editor-cmtref-usage-hd {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: #1a3a2e;
  font-size: 13px;
  font-weight: 700;
}
#editorPanel .editor-cmtref-usage-hd svg { flex-shrink: 0; width: 15px; height: 15px; color: var(--brand-green); }
#editorPanel .editor-cmtref-usage-list {
  margin: 0;
  padding: 0 0 0 16px;
  display: grid;
  gap: 3px;
  color: #3a5044;
  font-size: 12.5px;
  line-height: 1.5;
}

/* Main editor-board overlays are direct children of the board, so size them by one cell. */
body.editor-desktop-redesign[data-mode="editor"] #board.goban > .stone {
  width: calc(97% / var(--board-size)) !important;
  height: calc(97% / var(--board-size)) !important;
  max-width: none !important;
  max-height: none !important;
}

body.editor-desktop-redesign[data-mode="editor"] #board.goban > .last-move-ring {
  width: calc(45% / var(--board-size)) !important;
  height: calc(45% / var(--board-size)) !important;
}

body.editor-desktop-redesign[data-mode="editor"] #board.goban > .candidate {
  width: calc(90% / var(--board-size)) !important;
  height: calc(90% / var(--board-size)) !important;
}
