/* ===== 長押し反応を抑制 ===== */
html,body{
  -webkit-touch-callout:none;
}

body{
  -webkit-user-select:none;
  user-select:none;
}

button,
.card,
.category,
.item-row,
.board-card,
.latest-item,
.status-trigger,
.detail-btn,
.mini-icon-btn,
.arrow-btn,
.fold-btn{
  -webkit-touch-callout:none;
  -webkit-user-select:none;
  user-select:none;
}

input,
textarea,
select{
  -webkit-touch-callout:default;
  -webkit-user-select:auto;
  user-select:auto;
}

a,
img{
  -webkit-touch-callout:none;
  -webkit-user-select:none;
  user-select:none;
  -webkit-user-drag:none;
}

:root{
      --bg:#eef3f8;
      --card:rgba(255,255,255,0.96);
      --line:#d7e0ea;
      --text:#112033;
      --sub:#66758a;
      --blue:#2458d3;
      --blue-soft:#eef4ff;
      --green:#17814b;
      --green-soft:#e8f6ee;
      --danger:#d95555;
      --danger-soft:#fff3f3;
      --shadow:0 14px 36px rgba(17,27,45,0.08);
      --radius:18px;
    }

    *{
      box-sizing:border-box;
      -webkit-tap-highlight-color:transparent;
    }

    html,body{
      margin:0;
      padding:0;
      background:var(--bg);
      color:var(--text);
      font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic","Noto Sans JP",sans-serif;
      height:100%;
      overflow-x:hidden;
      -webkit-overflow-scrolling:touch;
      overscroll-behavior-y:contain;
    }

    body{
      min-height:100vh;
      overflow-x:hidden;
      touch-action:pan-y;
    }

    body.modal-open{
      overflow:hidden;
    }

    button,input,select,textarea{
      font:inherit;
    }

    .app{
      max-width:480px;
      margin:0 auto;
      min-height:100vh;
      padding:16px 14px 30px;
      overflow-x:hidden;
      position:relative;
    }

    .card{
      background:var(--card);
      border:1px solid var(--line);
      border-radius:var(--radius);
      box-shadow:var(--shadow);
    }

    .header-card{
      padding:18px;
      margin-bottom:16px;
      background:linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,251,255,0.96) 100%);
      backdrop-filter:blur(8px);
      -webkit-backdrop-filter:blur(8px);
    }

    .header-top{
      display:flex;
      align-items:flex-start;
      justify-content:space-between;
      gap:12px;
      margin-bottom:10px;
    }

    .header-mini{
      color:var(--sub);
      font-size:12px;
      font-weight:800;
    }

    .title{
      margin:0;
      font-size:27px;
      font-weight:900;
      letter-spacing:0.01em;
      line-height:1.28;
    }

    .fold-btn{
      border:none;
      background:linear-gradient(180deg,#f8fbff 0%,#edf3f9 100%);
      color:#314055;
      border-radius:12px;
      width:42px;
      height:42px;
      display:flex;
      align-items:center;
      justify-content:center;
      font-size:20px;
      font-weight:900;
      cursor:pointer;
      touch-action:manipulation;
    }

    .header-body.collapsed{
      display:none;
    }

    .block{
      margin-bottom:14px;
    }

    .label{
      font-size:12px;
      color:var(--sub);
      font-weight:700;
      margin:0 0 6px;
    }

    input,select,textarea{
      width:100%;
      border:1px solid var(--line);
      background:#fff;
      color:var(--text);
      border-radius:14px;
      padding:12px 14px;
      outline:none;
    }

    textarea{
      min-height:110px;
      resize:vertical;
      line-height:1.7;
    }

    button{
      border:none;
      border-radius:14px;
      padding:12px 14px;
      cursor:pointer;
      font-weight:800;
    }

    .btn-primary{ background:linear-gradient(180deg,#2c61dd 0%,#2458d3 100%); color:#fff; box-shadow:0 8px 20px rgba(36,88,211,0.18); }
    .btn-soft{ background:linear-gradient(180deg,#f5f8ff 0%,#eaf1ff 100%); color:var(--blue); }
    .btn-green{ background:linear-gradient(180deg,#eef9f3 0%,#e5f5ec 100%); color:var(--green); }
    .btn-danger{ background:linear-gradient(180deg,#fff7f7 0%,#fff0f0 100%); color:var(--danger); }

    .row{
      display:flex;
      gap:8px;
      align-items:center;
    }

    .row > *{
      min-width:0;
    }

    .grow{
      flex:1;
    }

    .status-note{
      margin-top:6px;
      font-size:12px;
      color:var(--sub);
      line-height:1.6;
      white-space:pre-line;
    }

    .main-card{
      padding:16px;
      background:linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(250,252,255,0.96) 100%);
    }

    .current-head{
      margin-bottom:12px;
    }

    .staff-title-row{
      display:flex;
      align-items:center;
      gap:10px;
      min-width:0;
      overflow:visible;
    }

    .staff-avatar-btn{
      position:relative;
      width:50px;
      height:50px;
      border-radius:50%;
      padding:0;
      overflow:visible;
      flex:0 0 auto;
      display:flex;
      align-items:center;
      justify-content:center;
      background:linear-gradient(180deg,#f3f5f8 0%,#e3e7ee 100%);
      border:1px solid #ccd5e1;
      box-shadow:0 8px 18px rgba(17,27,45,0.08);
      touch-action:manipulation;
    }

    .staff-avatar-btn::before{
      content:"";
      position:absolute;
      inset:2px;
      border-radius:50%;
      background:linear-gradient(180deg, rgba(255,255,255,0.34) 0%, rgba(255,255,255,0) 55%);
      pointer-events:none;
      z-index:1;
    }

    .staff-avatar-btn.is-disabled{
      opacity:.55;
      filter:grayscale(.08);
    }

    .staff-avatar-btn.is-loading{
      opacity:.78;
    }

    .staff-avatar-img{
      width:100%;
      height:100%;
      display:block;
      object-fit:cover;
      object-position:center;
      position:relative;
      z-index:0;
      border-radius:50%;
    }

    .staff-avatar-plus{
      position:absolute;
      right:-4px;
      bottom:-4px;
      width:20px;
      height:20px;
      border-radius:50%;
      display:flex;
      align-items:center;
      justify-content:center;
      font-size:14px;
      font-weight:900;
      line-height:1;
      color:#fff;
      background:linear-gradient(180deg,#3c73ee 0%,#2e61dc 100%);
      border:2px solid #fff;
      box-shadow:0 6px 14px rgba(46,97,220,0.22);
      z-index:2;
      pointer-events:none;
    }

    .staff-avatar-btn:not(.is-empty) .staff-avatar-plus{
      opacity:0;
      transform:scale(.8);
    }

    #staffProgressWrap{
      display:flex;
      align-items:center;
      justify-content:center;
      flex:0 0 auto;
    }

    .progress-pill{
      position:relative;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      gap:0;
      border-radius:999px;
      border:1px solid rgba(171,186,204,0.62);
      background:
        linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(248,251,255,0.92) 52%, rgba(240,246,255,0.88) 100%);
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.98),
        inset 0 -1px 0 rgba(255,255,255,0.38),
        0 10px 22px rgba(17,27,45,0.08);
      backdrop-filter:blur(10px);
      -webkit-backdrop-filter:blur(10px);
      overflow:hidden;
    }

    .progress-pill::before{
      content:"";
      position:absolute;
      inset:1px 1px auto 1px;
      height:56%;
      border-radius:inherit;
      background:linear-gradient(180deg, rgba(255,255,255,0.82) 0%, rgba(255,255,255,0.18) 100%);
      pointer-events:none;
    }

    .progress-pill::after{
      content:"";
      position:absolute;
      inset:0;
      border-radius:inherit;
      background:linear-gradient(135deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0) 54%, rgba(255,255,255,0.12) 100%);
      pointer-events:none;
    }

    .progress-pill-staff{
      min-width:92px;
      min-height:40px;
      padding:0 16px;
    }

    .progress-pill-folder{
      min-width:82px;
      min-height:34px;
      padding:0 14px;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.98),
        inset 0 -1px 0 rgba(255,255,255,0.34),
        0 8px 18px rgba(17,27,45,0.06);
    }

    .progress-pill-value,
    .progress-pill-unit{
      position:relative;
      z-index:1;
      display:block;
      font-family:"Inter",-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic","Noto Sans JP",sans-serif;
      font-weight:800;
      line-height:1;
      letter-spacing:-0.04em;
      font-variant-numeric:tabular-nums lining-nums;
      white-space:nowrap;
    }

    .progress-pill-staff .progress-pill-value{
      font-size:21px;
    }

    .progress-pill-staff .progress-pill-unit{
      font-size:13px;
      margin-left:2px;
      opacity:.78;
      transform:translateY(1px);
    }

    .progress-pill-folder .progress-pill-value{
      font-size:17px;
    }

    .progress-pill-folder .progress-pill-unit{
      font-size:11px;
      margin-left:2px;
      opacity:.76;
      transform:translateY(1px);
    }

    .progress-pill.is-good{
      color:#167748;
      border-color:rgba(116,196,154,0.68);
      background:
        linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(244,255,249,0.94) 50%, rgba(229,248,238,0.94) 100%);
    }

    .progress-pill.is-ok{
      color:#8a6b08;
      border-color:rgba(225,203,109,0.68);
      background:
        linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,252,243,0.94) 50%, rgba(255,244,213,0.94) 100%);
    }

    .progress-pill.is-bad{
      color:#b04d5a;
      border-color:rgba(232,164,174,0.72);
      background:
        linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,247,248,0.94) 52%, rgba(255,232,236,0.94) 100%);
    }

    .progress-pill.is-empty{
      color:#66758a;
      border-color:rgba(184,194,206,0.68);
      background:
        linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(247,250,254,0.92) 52%, rgba(238,243,250,0.9) 100%);
    }

    .progress-bar{
      position:relative;
      width:100%;
      height:8px;
      margin-top:12px;
      border-radius:999px;
      overflow:hidden;
      background:rgba(255,255,255,0.72);
      border:1px solid rgba(171,186,204,0.38);
      box-shadow:
        inset 0 1px 2px rgba(17,27,45,0.04),
        inset 0 -1px 0 rgba(255,255,255,0.34);
    }

    .progress-bar-fill{
      position:relative;
      height:100%;
      border-radius:inherit;
      background:linear-gradient(90deg, rgba(36,88,211,0.72) 0%, rgba(88,130,255,0.9) 100%);
      box-shadow:inset 0 1px 0 rgba(255,255,255,0.38);
    }

    .progress-bar-fill::after{
      content:"";
      position:absolute;
      inset:0;
      background:linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.08) 100%);
    }

    .progress-bar.is-good .progress-bar-fill{
      background:linear-gradient(90deg, rgba(35,152,93,0.76) 0%, rgba(92,214,145,0.94) 100%);
    }

    .progress-bar.is-ok .progress-bar-fill{
      background:linear-gradient(90deg, rgba(222,182,35,0.74) 0%, rgba(255,221,101,0.94) 100%);
    }

    .progress-bar.is-bad .progress-bar-fill{
      background:linear-gradient(90deg, rgba(214,97,111,0.74) 0%, rgba(255,159,174,0.94) 100%);
    }

    .progress-bar.is-empty .progress-bar-fill{
      background:linear-gradient(90deg, rgba(153,169,188,0.52) 0%, rgba(199,209,222,0.78) 100%);
    }

    .staff-settings-btn{
      width:30px;
      height:30px;
      border-radius:10px;
      background:linear-gradient(180deg,#f8fbff 0%,#edf3f9 100%);
      color:#314055;
      font-size:15px;
      font-weight:700;
      display:flex;
      align-items:center;
      justify-content:center;
      line-height:1;
      padding:0;
      flex:0 0 auto;
      touch-action:manipulation;
    }

    .store-name{
      font-size:13px;
      color:var(--sub);
      font-weight:800;
      margin-bottom:6px;
      letter-spacing:0.04em;
    }

    .staff-name{
      font-size:23px;
      font-weight:900;
      line-height:1.28;
      letter-spacing:-0.02em;
      margin:0;
      flex:1;
      min-width:0;
      word-break:keep-all;
      overflow-wrap:normal;
    }

    .favorite-star-btn{
      width:34px;
      height:34px;
      border-radius:11px;
      background:linear-gradient(180deg,#fffdf5 0%,#fff7da 100%);
      border:1px solid #f3df8d;
      color:#b58a00;
      font-size:18px;
      font-weight:900;
      display:flex;
      align-items:center;
      justify-content:center;
      line-height:1;
      padding:0;
      flex:0 0 auto;
      touch-action:manipulation;
      box-shadow:0 2px 8px rgba(181,138,0,0.08);
    }

    .favorite-star-btn.is-active{
      background:linear-gradient(180deg,#fff7c9 0%,#ffe88b 100%);
      color:#8a6700;
      border-color:#e6c95d;
      box-shadow:0 6px 14px rgba(181,138,0,0.16);
    }

    .favorite-star-btn:disabled{
      opacity:.45;
      filter:grayscale(.2);
    }

    .favorite-card{
      padding:14px;
      margin-bottom:14px;
      background:linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(252,249,240,0.96) 100%);
    }

    .favorite-card-head{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
      margin-bottom:10px;
    }

    .favorite-card-mini{
      color:var(--sub);
      font-size:11px;
      font-weight:800;
      letter-spacing:0.06em;
      margin-bottom:4px;
    }

    .favorite-card-title{
      font-size:18px;
      font-weight:900;
      line-height:1.35;
      color:var(--text);
    }

    .favorite-staff-list{
      display:grid;
      gap:8px;
    }

    .favorite-staff-chip{
      width:100%;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
      text-align:left;
      padding:12px 13px;
      border-radius:14px;
      border:1px solid #efe3b4;
      background:#fffef8;
      color:var(--text);
      box-shadow:0 1px 4px rgba(17,27,45,0.04);
    }

    .favorite-staff-chip.is-current{
      border-color:#d9c06a;
      background:linear-gradient(180deg,#fff9dd 0%,#fff6cf 100%);
    }

    .staff-chip-avatar{
      width:38px;
      height:38px;
      border-radius:50%;
      overflow:hidden;
      flex:0 0 auto;
      border:1px solid #d9e0ea;
      background:linear-gradient(180deg,#f3f5f8 0%,#e3e7ee 100%);
      box-shadow:0 3px 8px rgba(17,27,45,0.06);
    }

    .staff-chip-avatar img{
      width:100%;
      height:100%;
      display:block;
      object-fit:cover;
      object-position:center;
    }

    .staff-chip-avatar.is-default{
      border-color:#d2d9e3;
    }

    .favorite-staff-main{
      min-width:0;
      flex:1 1 auto;
      display:flex;
      align-items:center;
      gap:10px;
    }

    .favorite-staff-star{
      width:32px;
      height:32px;
      border-radius:10px;
      display:flex;
      align-items:center;
      justify-content:center;
      background:#fff4c2;
      color:#a37800;
      font-size:16px;
      font-weight:900;
      flex:0 0 auto;
    }

    .favorite-staff-text{
      min-width:0;
      flex:1 1 auto;
      display:grid;
      gap:2px;
    }

    .favorite-staff-name{
      font-size:15px;
      font-weight:900;
      line-height:1.35;
      color:var(--text);
      word-break:break-word;
    }

    .favorite-staff-store{
      font-size:12px;
      color:var(--sub);
      font-weight:700;
      line-height:1.35;
      word-break:break-word;
    }

    .staff-board-wrap{
      display:grid;
      gap:10px;
      margin-top:14px;
      margin-bottom:14px;
    }

    .board-card{
      box-shadow:0 8px 24px rgba(17,27,45,0.05);
      border:1px solid var(--line);
      border-radius:16px;
      background:#fff;
      overflow:hidden;
      transform:translateZ(0);
      backface-visibility:hidden;
    }

    .board-head{
      width:100%;
      background:linear-gradient(180deg,#fbfdff 0%,#f3f8ff 100%);
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
      padding:12px 14px;
      border-radius:0;
      touch-action:manipulation;
    }

    .board-title{
      font-size:15px;
      font-weight:900;
    }

    .board-chevron{
      font-size:18px;
      color:var(--sub);
    }

    .board-body{
      padding:12px;
      border-top:1px solid var(--line);
      display:grid;
      gap:10px;
    }

    .board-body.hidden{
      display:none;
    }

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

    .board-actions button{
      flex:1;
    }

    .board-textarea{
      min-height:120px;
    }

    .board-history-list{
      display:grid;
      gap:8px;
    }

    .board-history-card{
      border:1px solid var(--line);
      border-radius:14px;
      background:#fff;
      padding:12px;
      transform:translateZ(0);
      backface-visibility:hidden;
    }

    .board-history-top{
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:8px;
      margin-bottom:8px;
    }

    .board-history-type{
      font-size:12px;
      font-weight:800;
      color:var(--blue);
      background:var(--blue-soft);
      padding:5px 8px;
      border-radius:999px;
    }

    .board-history-date{
      font-size:12px;
      color:var(--sub);
      font-weight:700;
    }

    .board-history-text{
      font-size:14px;
      line-height:1.7;
      white-space:pre-wrap;
      word-break:break-word;
    }

    .category{
      box-shadow:0 8px 24px rgba(17,27,45,0.05);
      border:1px solid var(--line);
      border-radius:16px;
      overflow:hidden;
      margin-bottom:12px;
      background:#fff;
      transform:translateZ(0);
      backface-visibility:hidden;
    }

    .category-head{
      padding:13px 12px 12px;
      border-bottom:1px solid rgba(215,224,234,0.72);
      background:rgba(255,255,255,0.34);
    }

    .category-head-main{
      display:grid;
      grid-template-columns:minmax(0,1fr) auto;
      gap:10px;
      align-items:center;
    }

    .category-title-wrap{
      min-width:0;
      display:flex;
      align-items:center;
      gap:10px;
    }

    .category-actions{
      display:flex;
      gap:8px;
      align-items:center;
      justify-content:flex-end;
      flex-wrap:wrap;
    }

    .category-title{
      margin:0;
      font-size:18px;
      font-weight:900;
      min-width:0;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
      flex:1;
    }

    .category-body{
      padding:10px;
    }

    .add-item-row{
      display:flex;
      gap:8px;
      margin-bottom:10px;
    }

    .add-item-row input{
      flex:1;
      min-width:0;
    }

    .item-list{
      display:grid;
      gap:8px;
    }

    .item-row{
      box-shadow:0 2px 10px rgba(17,27,45,0.03);
      border:1px solid var(--line);
      border-radius:14px;
      padding:10px 10px;
      display:grid;
      grid-template-columns:minmax(0,1fr) auto auto;
      gap:8px;
      align-items:center;
      background:#fff;
      transform:translateZ(0);
      backface-visibility:hidden;
    }

    .reorder-mode .item-row{
      grid-template-columns:minmax(0,1fr) auto;
    }

    .item-main{
      min-width:0;
      display:flex;
      align-items:center;
      gap:10px;
    }

    .recipe-trigger{
      width:50px;
      height:50px;
      border-radius:15px;
      border:1px solid #d6e0ea;
      background:linear-gradient(180deg,#ffffff 0%,#f4f7fb 100%);
      color:#6f7d8d;
      display:flex;
      align-items:center;
      justify-content:center;
      padding:0;
      overflow:hidden;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.98),
        0 4px 10px rgba(17,27,45,0.06);
      flex:0 0 auto;
      touch-action:manipulation;
      position:relative;
      z-index:5;
      pointer-events:auto;
      cursor:pointer;
    }

    .recipe-trigger.has-recipe{
      color:#d88a22;
      border-color:#efc16d;
      background:linear-gradient(180deg,#fff8eb 0%,#ffe2a4 100%);
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.98),
        0 8px 18px rgba(216,138,34,0.18);
    }

    .recipe-icon-img{
      width:44px;
      height:44px;
      display:block;
      flex:0 0 auto;
      object-fit:contain;
      transform:scale(1.24);
      transform-origin:center;
      filter:grayscale(0.16) drop-shadow(0 1px 1px rgba(17,27,45,0.05));
      opacity:0.88;
      pointer-events:none;
      user-select:none;
      -webkit-user-drag:none;
    }

    .recipe-trigger.has-recipe .recipe-icon-img{
      opacity:1;
      filter:sepia(0.82) saturate(1.7) hue-rotate(-4deg) brightness(1.02) drop-shadow(0 1px 1px rgba(216,138,34,0.16));
      transform:scale(1.30);
    }

    .item-name{
      min-width:0;
      font-size:15px;
      font-weight:800;
      line-height:1.35;
      white-space:normal;
      overflow:hidden;
      display:-webkit-box;
      -webkit-line-clamp:2;
      -webkit-box-orient:vertical;
      word-break:break-word;
      padding-right:2px;
    }

    .status-trigger{
      min-width:58px;
      height:40px;
      box-shadow:0 1px 3px rgba(17,27,45,0.04);
      padding:0 10px;
      border-radius:12px;
      border:1px solid var(--line);
      background:#fff;
      color:var(--sub);
      display:flex;
      align-items:center;
      justify-content:center;
      font-size:13px;
      font-weight:800;
      touch-action:manipulation;
    }

    .status-trigger.has-icon{
      min-width:52px;
      padding:0 6px;
    }

    .status-icon{
      width:24px;
      height:24px;
      display:block;
      flex:0 0 auto;
    }

    .detail-btn,.mini-icon-btn{
      box-shadow:0 2px 8px rgba(17,27,45,0.05);
      width:38px;
      height:38px;
      border-radius:12px;
      background:linear-gradient(180deg,#f8fbff 0%,#edf3f9 100%);
      color:#314055;
      font-size:18px;
      font-weight:700;
      display:flex;
      align-items:center;
      justify-content:center;
      line-height:1;
      padding:0;
      touch-action:manipulation;
    }

    .detail-text-btn{
      width:auto;
      min-width:62px;
      padding:0 10px;
      font-size:13px;
      font-weight:800;
      touch-action:manipulation;
    }

    .drag-item,
    .drag-folder{
      touch-action:pan-y;
      user-select:none;
      -webkit-user-select:none;
      -webkit-touch-callout:none;
    }

    .drag-item.dragging,
    .drag-folder.dragging{
      opacity:.82;
      transform:scale(.985);
      position:relative;
      z-index:20;
      box-shadow:0 10px 28px rgba(17,27,45,0.16);
    }

    .drag-over-top{
      box-shadow:inset 0 3px 0 #2f6df6;
    }

    .drag-over-bottom{
      box-shadow:inset 0 -3px 0 #2f6df6;
    }

    .reorder-pair{
      display:flex;
      gap:6px;
      align-items:center;
      justify-content:flex-end;
    }

    .arrow-btn{
      box-shadow:0 2px 8px rgba(17,27,45,0.05);
      width:34px;
      height:34px;
      border-radius:12px;
      background:linear-gradient(180deg,#f8fbff 0%,#edf3f9 100%);
      color:#314055;
      font-size:16px;
      font-weight:900;
      display:none;
      align-items:center;
      justify-content:center;
      line-height:1;
      padding:0;
      touch-action:manipulation;
    }

    .reorder-mode .arrow-btn{
      display:flex;
    }

    .finish-reorder-btn{
      width:auto;
      min-width:96px;
      padding:0 14px;
      height:38px;
      font-size:12px;
      white-space:nowrap;
      box-shadow:0 8px 20px rgba(217,85,85,0.16);
    }

    .reorder-start-btn{
      width:100%;
    }

    .status-picker{
      display:none;
      grid-template-columns:repeat(3,1fr);
      gap:8px;
      margin-top:8px;
      grid-column:1 / -1;
      width:100%;
    }

    .status-picker.show{
      display:grid;
    }

    .status-option,.record-status-btn{
      border:1px solid var(--line);
      border-radius:14px;
      background:#fff;
      padding:10px 6px;
      display:grid;
      justify-items:center;
      gap:6px;
      touch-action:manipulation;
    }

    .status-option svg,.record-status-btn svg{
      width:34px;
      height:34px;
      display:block;
    }

    .status-option span,.record-status-btn span{
      font-size:11px;
      color:var(--text);
      font-weight:800;
      white-space:nowrap;
    }

    .record-status-btn.active{
      box-shadow:0 0 0 2px rgba(47,109,246,0.16);
      border-color:#8db2ff;
      background:#f7faff;
    }

    .empty{
      border:1px dashed var(--line);
      color:var(--sub);
      text-align:center;
      padding:18px 12px;
      border-radius:14px;
      background:#fff;
      font-size:13px;
      font-weight:700;
    }

    .modal{
      position:fixed;
      inset:0;
      background:rgba(12,20,32,0.48);
      display:none;
      align-items:flex-end;
      justify-content:center;
      z-index:999;
      overscroll-behavior:contain;
    }

    .modal.show{
      display:flex;
    }

    .sheet{
      width:100%;
      max-width:480px;
      background:#fff;
      border-radius:24px 24px 0 0;
      padding:16px 14px 20px;
      max-height:88vh;
      overflow-y:auto;
      overflow-x:hidden;
      -webkit-overflow-scrolling:touch;
      overscroll-behavior:contain;
      box-shadow:0 -10px 40px rgba(10,16,24,0.18);
    }

    .sheet-head{
      display:flex;
      justify-content:space-between;
      align-items:flex-start;
      gap:8px;
      margin-bottom:14px;
    }

    .sheet-meta{
      font-size:12px;
      color:var(--sub);
      font-weight:700;
      margin-bottom:6px;
    }

    .sheet-title{
      margin:0;
      font-size:22px;
      font-weight:900;
      line-height:1.4;
    }

    .sheet-section{
      margin-bottom:14px;
    }

    .sheet-section-title{
      font-size:13px;
      color:var(--sub);
      font-weight:800;
      margin:0 0 8px;
    }

    .history-list,.record-grid{
      display:grid;
      gap:10px;
    }

    .recipe-sheet{
      width:min(720px, calc(100vw - 24px));
      max-height:min(88vh, 840px);
      display:flex;
      flex-direction:column;
    }

    .recipe-sheet-head{
      align-items:flex-start;
    }

    .recipe-head-actions{
      display:flex;
      align-items:center;
      gap:8px;
      flex:0 0 auto;
    }

    .recipe-edit-btn{
      min-width:auto;
      padding:7px 11px;
      border-radius:11px;
      font-size:12px;
      font-weight:800;
      min-height:34px;
    }

    .recipe-view-section,
    .recipe-edit-section{
      display:flex;
      flex-direction:column;
      min-height:0;
    }

    .recipe-view-card{
      border:1px solid var(--line);
      border-radius:18px;
      background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
      box-shadow:inset 0 1px 0 rgba(255,255,255,0.96);
      padding:13px 14px;
      min-height:0;
      max-height:calc(88vh - 185px);
      overflow:auto;
    }

    .recipe-memo-view{
      font-size:12px;
      line-height:1.52;
      color:var(--text);
      word-break:break-word;
      white-space:normal;
    }

    .recipe-memo-line + .recipe-memo-line{
      margin-top:4px;
    }

    .recipe-textarea{
      min-height:calc(88vh - 250px);
      max-height:calc(88vh - 250px);
      line-height:1.65;
      resize:none;
      font-size:14px;
    }

    .recipe-save-row{
      padding-top:4px;
    }

    .recipe-note{
      margin-top:8px;
      font-size:12px;
      line-height:1.6;
      color:var(--sub);
    }

    .history-card{
      border:1px solid var(--line);
      border-radius:14px;
      padding:12px;
      background:#fff;
      transform:translateZ(0);
      backface-visibility:hidden;
    }

    .history-top{
      display:flex;
      justify-content:space-between;
      gap:8px;
      align-items:center;
      margin-bottom:8px;
    }

    .history-date{
      font-size:14px;
      font-weight:900;
    }

    .history-teacher{
      font-size:12px;
      color:var(--sub);
      font-weight:700;
      text-align:right;
    }

    .history-delete{
      border:none;
      background:linear-gradient(180deg,#f8fbff 0%,#edf3f9 100%);
      color:#516074;
      border-radius:10px;
      padding:6px 10px;
      font-size:12px;
      font-weight:800;
      cursor:pointer;
    }

    .history-status{
      margin-bottom:8px;
      display:flex;
      align-items:center;
      gap:8px;
    }

    .history-memo{
      font-size:14px;
      line-height:1.7;
      white-space:pre-wrap;
      word-break:break-word;
    }

    .save-row{
      display:flex;
      gap:8px;
      flex-wrap:wrap;
    }

    .save-row button{
      flex:1;
    }

    .toolbar-grid{
      display:grid;
      grid-template-columns:1fr;
      gap:10px;
    }

    .mode-grid{
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:8px;
    }

    .mode-btn{
      border:1px solid var(--line);
      background:#fff;
      color:var(--text);
    }

    .mode-btn.active-new{
      background:var(--green-soft);
      color:var(--green);
      border-color:#cdebd9;
    }

    .mode-btn.active-saved{
      background:var(--blue-soft);
      color:var(--blue);
      border-color:#dbe6ff;
    }

    .source-grid{
      display:grid;
      gap:10px;
    }

    .source-step{
      border:1px solid var(--line);
      border-radius:14px;
      padding:12px;
      background:#fafcff;
    }

    .source-step-title{
      font-size:12px;
      color:var(--sub);
      font-weight:800;
      margin:0 0 8px;
    }

    .color-grid{
      display:grid;
      grid-template-columns:repeat(6,1fr);
      gap:8px;
    }

    .color-chip{
      width:100%;
      aspect-ratio:1/1;
      border-radius:14px;
      border:2px solid transparent;
      background:var(--chip,#eee);
    }

    .color-chip.active{
      border-color:#1e293b;
      box-shadow:0 0 0 2px rgba(255,255,255,0.9) inset;
    }

    .small{
      font-size:12px;
      color:var(--sub);
    }

    
    .latest-card{
      margin-bottom:14px;
      overflow:hidden;
    }

    .latest-head{
      width:100%;
      background:linear-gradient(180deg,#fbfdff 0%,#f3f8ff 100%);
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
      padding:14px 16px;
      border-bottom:1px solid var(--line);
      touch-action:manipulation;
    }

    .latest-title-wrap{
      min-width:0;
    }

    .latest-mini{
      font-size:12px;
      color:var(--sub);
      font-weight:800;
      margin-bottom:4px;
    }

    .latest-title{
      font-size:18px;
      font-weight:900;
      line-height:1.35;
    }

    .latest-body{
      padding:12px;
      display:grid;
      gap:10px;
      background:rgba(255,255,255,0.86);
    }

    .latest-body.hidden{
      display:none;
    }

    .latest-item{
      border:1px solid var(--line);
      border-radius:14px;
      background:#fff;
      padding:12px;
      box-shadow:0 2px 10px rgba(17,27,45,0.03);
    }

    .latest-top{
      display:flex;
      justify-content:space-between;
      gap:8px;
      align-items:flex-start;
      margin-bottom:8px;
    }

    .latest-left{
      min-width:0;
    }

    .latest-source{
      font-size:12px;
      color:var(--sub);
      font-weight:800;
      margin-bottom:4px;
    }

    .latest-name{
      font-size:14px;
      font-weight:900;
      line-height:1.45;
      word-break:break-word;
    }

    .latest-date{
      font-size:12px;
      color:var(--sub);
      font-weight:800;
      flex:0 0 auto;
      white-space:nowrap;
    }

    .latest-text{
      font-size:14px;
      line-height:1.7;
      white-space:pre-wrap;
      word-break:break-word;
    }

    .board-history-actions,
    .history-actions{
      display:flex;
      justify-content:flex-end;
      margin-top:8px;
    }

    .board-delete-btn{
      border:none;
      background:#f2f5f9;
      color:#516074;
      border-radius:10px;
      padding:6px 10px;
      font-size:12px;
      font-weight:800;
      cursor:pointer;
    }

.floating-ghost{
      display:none;
    }
      20%{ transform:translateX(-8px); }
      40%{ transform:translateX(8px); }
      60%{ transform:translateX(-6px); }
      80%{ transform:translateX(6px); }
      100%{ transform:translateX(0); }
    }


    @media (max-width:420px){
      .staff-name{
        font-size:18px;
        line-height:1.2;
        letter-spacing:-0.02em;
      }

      .progress-pill-staff{
        min-width:84px;
        min-height:38px;
        padding:0 14px;
      }

      .progress-pill-staff .progress-pill-value{
        font-size:19px;
      }

      .category-title-wrap{
        gap:8px;
      }

      .progress-pill-folder{
        min-width:76px;
        min-height:32px;
        padding:0 12px;
      }

      .progress-pill-folder .progress-pill-value{
        font-size:16px;
      }
    }


/* ===== 2026-04-06 update ===== */
.favorite-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:0;}
.favorite-toggle-btn{border:none;background:linear-gradient(180deg,#fff8ea 0%,#f7edd0 100%);color:#6a5712;border-radius:12px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;font-size:20px;font-weight:900;cursor:pointer;touch-action:manipulation;flex:0 0 auto;}
.favorite-card-body.hidden{display:none;}
.category-toggle{width:100%;border:none;background:transparent;padding:0;display:block;text-align:left;}
.category-title-wrap{flex:1;min-width:0;display:flex;align-items:center;gap:10px;}
.category-chevron{display:flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:12px;background:rgba(255,255,255,0.72);border:1px solid rgba(17,27,45,0.08);font-size:18px;font-weight:900;color:#314055;flex:0 0 auto;}
.category-body.hidden{display:none;}


/* ===== 2026-04-06 favorite staff fix v3 ===== */
.favorite-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.favorite-toggle-btn{
  border:none;
  background:linear-gradient(180deg,#f5f8fc 0%,#e9eef5 100%);
  color:#314055;
  border-radius:12px;
  width:40px;
  height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  font-weight:900;
  cursor:pointer;
  touch-action:manipulation;
  flex:0 0 auto;
}
.favorite-card-body.hidden{
  display:none;
}
.favorite-staff-chip{
  justify-content:space-between;
}
.favorite-staff-text{
  flex:1;
}
.favorite-staff-progress{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  margin-left:10px;
}
.favorite-staff-progress .progress-pill-folder{
  min-width:78px;
}


/* ===== 2026-04-06 favorite final fix ===== */
.favorite-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.favorite-fold-btn{
  margin-left:auto;
  flex:0 0 auto;
}

.favorite-staff-list.collapsed{
  display:none;
}

.favorite-staff-chip{
  justify-content:space-between;
}

.favorite-staff-main{
  min-width:0;
  flex:1 1 auto;
  display:flex;
  align-items:center;
  gap:10px;
}

.favorite-staff-text{
  min-width:0;
  flex:1 1 auto;
}

.favorite-staff-progress{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  margin-left:10px;
}

.favorite-staff-progress .progress-pill-folder{
  min-width:78px;
}

/* ===== 2026-04-06 desktop relayout ===== */
@media (min-width: 1100px){
  html,body{
    min-width:1280px;
  }

  body{
    padding:16px;
    background:
      radial-gradient(circle at top left, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 34%),
      linear-gradient(180deg,#eef3f8 0%, #e7edf4 100%);
  }

  .app{
    width:min(1720px, calc(100vw - 32px));
    max-width:none;
    min-height:calc(100vh - 32px);
    padding:0;
    margin:0 auto;
    display:grid;
    grid-template-columns:320px minmax(0, 1fr);
    grid-template-areas:
      "favorites favorites"
      "sidebar main";
    gap:18px;
    align-items:start;
  }

  #favoriteStaffsWrap{
    grid-area:favorites;
    min-width:0;
  }

  .favorite-card{
    margin-bottom:0;
    padding:16px 18px;
    border-radius:20px;
  }

  .favorite-staff-list{
    grid-template-columns:repeat(auto-fit, minmax(280px, 1fr));
    gap:10px;
  }

  .header-card{
    grid-area:sidebar;
    margin-bottom:0;
    padding:18px;
    border-radius:22px;
    position:sticky;
    top:16px;
    max-height:calc(100vh - 32px);
    overflow:auto;
  }

  .main-card{
    grid-area:main;
    min-width:0;
    padding:18px;
    border-radius:22px;
    min-height:calc(100vh - 118px);
  }

  .title{
    font-size:30px;
  }

  .staff-title-row{
    gap:12px;
    align-items:center;
  }

  .staff-name{
    font-size:32px;
  }

  .store-name{
    font-size:14px;
    margin-bottom:8px;
  }

  .toolbar-grid{
    display:grid;
    grid-template-columns:1fr;
  }

  .staff-board-wrap{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:14px;
  }

  .board-card{
    height:100%;
  }

  #categoriesWrap{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:14px;
    align-items:start;
  }

  .category{
    margin:0;
    height:100%;
  }

  .category-head{
    padding:14px 16px;
  }

  .items-list{
    gap:10px;
  }

  .item-row{
    padding:10px 12px;
  }

  .item-name{
    font-size:15px;
  }

  .latest-list{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:10px;
  }

  .modal{
    padding:28px;
  }

  .sheet{
    width:min(920px, calc(100vw - 120px));
    max-width:none;
    border-radius:24px;
  }

  #detailModal .sheet{
    width:min(980px, calc(100vw - 120px));
  }

  #folderBuilderModal .sheet,
  #settingsModal .sheet,
  #recipeModal .sheet{
    width:min(860px, calc(100vw - 120px));
  }

  .record-grid,
  .source-grid{
    gap:14px;
  }
}

@media (min-width: 1440px){
  .app{
    width:min(1880px, calc(100vw - 40px));
    grid-template-columns:340px minmax(0, 1fr);
    gap:20px;
  }

  .staff-board-wrap{
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }

  #categoriesWrap{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .main-card{
    padding:20px;
  }
}


.staff-profile-form-grid{
  display:grid;
  gap:14px;
}

.settings-comment-textarea{
  min-height:130px;
}

.staff-profile-summary-card{
  padding:14px;
  margin-bottom:14px;
  background:linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(246,250,255,0.96) 100%);
}

.staff-profile-summary-head{
  margin-bottom:10px;
}

.staff-profile-summary-chips{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:8px;
}

.staff-profile-chip{
  border:1px solid rgba(215,224,234,0.9);
  border-radius:14px;
  background:linear-gradient(180deg,#ffffff 0%, #f6f9fd 100%);
  padding:10px 12px;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.staff-profile-chip-label{
  font-size:11px;
  font-weight:800;
  color:var(--sub);
}

.staff-profile-chip-value{
  font-size:14px;
  font-weight:800;
  color:var(--text);
  line-height:1.45;
}

.staff-profile-comment-box{
  margin-top:10px;
  border:1px solid rgba(215,224,234,0.9);
  border-radius:14px;
  background:#fff;
  padding:12px;
}

.staff-profile-comment-label{
  font-size:11px;
  font-weight:800;
  color:var(--sub);
  margin-bottom:6px;
}

.staff-profile-comment-text{
  font-size:13px;
  line-height:1.7;
  color:var(--text);
  white-space:normal;
  word-break:break-word;
}


.settings-other-input{
  width:100%;
}


.toolbar-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
}

.pdf-export-sheet{
  max-width:560px;
}

.pdf-export-actions-row{
  display:flex;
  gap:8px;
  margin-bottom:10px;
}

.pdf-folder-checklist{
  display:grid;
  gap:10px;
}

.pdf-folder-option{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
}

.pdf-folder-option input{
  width:18px;
  height:18px;
  flex:0 0 auto;
}

.pdf-folder-option-name{
  flex:1;
  min-width:0;
  font-weight:800;
}

.pdf-folder-option-count{
  font-size:12px;
  color:var(--sub);
  white-space:nowrap;
}

.pdf-export-note,
.pdf-empty-state{
  margin-top:8px;
  font-size:12px;
  color:var(--sub);
  line-height:1.6;
}

.pdf-export-textarea{
  min-height:110px;
}

.pdf-export-save-row{
  margin-top:4px;
}

@media (max-width: 420px){
  .toolbar-grid{
    grid-template-columns:1fr;
  }
  .pdf-export-actions-row{
    flex-direction:column;
  }
  .pdf-folder-option{
    align-items:flex-start;
  }
}


.estimate-link-card{
  padding:16px;
  margin-top:16px;
}

.estimate-link-btn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  min-height:52px;
}
