body {
    margin:0;
    font-family:sans-serif;
    display:flex;
}
#map {
    flex:1;
    height:100vh;
}
.controls{
    width:260px;
    height:calc(100vh - 60px);
    margin-top:60px;
    overflow-y:auto;
    overflow-x:hidden; /* 横スクロール禁止 */
    padding:10px;
    background:#222;
    color:#fff;
    display:flex;
    flex-direction:column;
    gap:10px;
    box-sizing:border-box;
}
.topbar{
    display:flex;
    flex-direction:column;
    gap:8px;
}
.color-row{
    display:flex;
    gap:8px;
    align-items:center;
}
.btn-row{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}
.color-btn{
    width:26px;
    height:26px;
    border-radius:50%;
    border:2px solid #666;
    cursor:pointer;
    transition:0.2s;
}
.color-btn.active{
    border:3px solid #fff;
    transform:scale(1.2);
}
.color-btn[data-color="#ffffff"]{
    border:2px solid #999;
}
button{
    cursor:pointer;
    height:38px;
    padding:0 14px;
    border-radius:8px;
    font-size:14px;
}
.pref-list{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    max-height:none;
    overflow:visible;
}
.pref-list label{
    font-size:12px;
    background:#222;
    padding:3px 6px;
    border-radius:6px;
    cursor:pointer;
}
.label{
    font-weight:bold;
    color:#000;
    text-shadow:1px 1px 2px #fff;
    white-space:nowrap;
    cursor:move;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}
.star-icon{
    background: transparent !important;
    border: none !important;
}
.star-icon div {
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%;
    height:100%;
}
.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.leaflet-top{
    top:70px !important;
}

.color-picker-wrap{
    width:26px;
    height:26px;
    border-radius:50%;
    border:2px solid #666;
    cursor:pointer;
    position:relative;
    overflow:hidden;
    background: conic-gradient(red, orange, yellow, lime, cyan, blue, violet, red);
}
.color-picker-wrap.active{
    border:3px solid #fff;
    transform:scale(1.2);
}
.color-picker-wrap input{
    position:absolute;
    inset:0;
    opacity:0;
    cursor:pointer;
}
#undoStatus{
    font-size:12px;
    color:#888;
    min-height:16px;
    word-break:break-all;
}

.label-inner{
    display: inline-block;
    transform: translate(-50%, -50%);
    position: relative;
    left: 50%;
    top: 50%;
    white-space: nowrap;
}

button {
    padding: 6px 10px;
    margin: 4px;
    cursor: pointer;
    background: #eee;
    border: 1px solid #ccc;
}

button.active {
    background: #0070ff;
    color: white;
    border: 1px solid #005bd1;
}

.btn-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-item {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.help {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 20px;
  height: 20px;

  border-radius: 50%;
  background: #fff;
  color: #444;

  font-size: 12px;
  font-weight: bold;
  cursor: pointer;

  transition: 0.2s;
}

.help:hover {
  background: #0070ff;
}

.tooltip {
    position: absolute;
    bottom: 120%;   /* ← 上に出す */
    left: 0;

    background: #222;
    color: #fff;
    padding: 10px 12px;

    border-radius: 8px;
    font-size: 14px;

    width:100%;
    max-width:100%;
    line-height: 1.5;

    white-space:normal;
    overflow-wrap:break-word;
    word-break:break-word;
    z-index: 9999;


    /* アニメーション系 */
    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);
    transition: 0.2s;
}

.help:hover + .tooltip {
  opacity: 1;
  transform: translateY(0);
}

.help-item {
  margin-bottom: 10px;
}

.help-item:last-child {
  margin-bottom: 0;
}

.help-title {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 15px;
  color: #aef;   /* ← ちょいアクセント */
}

.help-body {
  font-size: 14px;
  color: #ddd;
}

.help-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  position: relative;
}

.help-label {
  font-size: 18px;
  color: #ddd;
}

.tooltip-bottom {
  top: 120%;     /* ← 下に出す */
  bottom: auto;  /* ← 上指定を無効化 */
}

/* ヘッダー */
.site-header{
 position:fixed;
 top:0;
 left:0;
 width:100%;
 height:60px;

 color:#111;
 background:white;

 display:flex;
 justify-content:center;
 align-items:center;

 z-index:9999;
}

/* フリーテキストアイコン */
.free-text-icon {
    background: transparent !important;
    border: none !important;
}
 
.free-text-inner {
    white-space: nowrap;
    font-weight: bold;
    cursor: pointer;
    text-shadow: 1px 1px 3px rgba(255,255,255,0.8), -1px -1px 3px rgba(255,255,255,0.8);
    user-select: none;
    line-height: 1.2;
}
 
/* 全モードボタンの active 時は青 */
#starBtn.active,
#circleBtn.active,
#textBtn.active,
#csvEditBtn.active {
    background: #0070ff;
    color: #fff;
    border-color: #0070ff;
}
