/* Feature switches (admin/features.js, #features). Storybook skin of theme.css / kit.css.
   The three modes differ in colour AND carry their name as text: ปิด grey, เฉพาะบัญชีแอดมิน amber, ทุกคน green.
   Controls are at least 40 px tall; at 600 px and below each switch is a card with full-width buttons. */
.features-page{min-width:0;color:#5c493d}
.features-page *{min-width:0;box-sizing:border-box}
.features-page p{color:#735738}
.features-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:10px 16px}
.features-head>div:first-child{flex:1 1 280px}
.features-head p{margin:5px 0 0;color:#9c8570;font-size:12.5px;line-height:1.55}
.features-head .features-staff{margin-top:8px;color:#4f7a3a;font-weight:700}
.features-tools{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}
.features-page button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:8px 14px;border-radius:7px;font-size:13px;line-height:1.3;cursor:pointer;white-space:normal;text-align:center}
.features-page button .icon{width:18px;height:18px}
.features-page button:disabled{cursor:default;opacity:.5}

.features-legend{display:flex;flex-wrap:wrap;gap:6px 18px;margin:0 0 14px;padding:0;list-style:none;font-size:12.5px;color:#8c7b6b}
.features-legend li{display:flex;align-items:center;gap:6px}
.features-badge{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:999px;border:1px solid;font-size:12.5px;font-weight:700;white-space:nowrap}
.features-badge::before{content:'';width:8px;height:8px;border-radius:50%;background:currentColor}
.features-badge-off{border-color:#c9bfb4;background:#f1ece6;color:#6d6158}
.features-badge-admins{border-color:#e0b25c;background:#fff3d6;color:#8a5a08}
.features-badge-all{border-color:#8fc27a;background:#e8f5df;color:#2f6b22}

.features-empty{margin:0;padding:18px 12px;border:1px dashed #d4bc95;border-radius:8px;color:#8c7b6b;font-size:12.5px;text-align:center;list-style:none}
.features-rows{display:grid;gap:12px;margin:0;padding:0;list-style:none}
.features-row{padding:14px 16px;border:1px solid #e3cfb2;border-radius:10px;background:#fffdf8;box-shadow:inset 4px 0 0 #c9bfb4}
.features-row-admins{box-shadow:inset 4px 0 0 #e2a84b}
.features-row-all{box-shadow:inset 4px 0 0 #6aac55}
.features-row[data-features-busy]{opacity:.7}
.features-row-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:6px 12px}
.features-row-title{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px}
.features-row-title h3{margin:0;color:#4a3828;font-size:16px}
.features-key{padding:1px 6px;border-radius:5px;background:#f4ebdc;color:#7d6247;font-size:12px;overflow-wrap:anywhere}
.features-items{color:#9c8570;font-size:12px}
.features-description{margin:6px 0 0;font-size:13px;line-height:1.55}

.features-modes{display:flex;flex-wrap:wrap;gap:0;margin:12px 0 0;border:1px solid #d8c4a4;border-radius:9px;overflow:hidden;width:max-content;max-width:100%}
.features-page .features-mode{flex:1 1 auto;margin:0;border:0;border-radius:0;border-right:1px solid #d8c4a4;background:#fffaf2;color:#735738;box-shadow:none;font-weight:600}
.features-page .features-mode:last-child{border-right:0}
.features-page .features-mode:hover:not(:disabled){background:#f6ead6}
.features-page .features-mode:focus-visible{outline:3px solid #cba06b;outline-offset:-3px}
.features-page .features-mode[aria-pressed=true]::before{content:'●';font-size:10px}
.features-page .features-mode-off[aria-pressed=true]{background:#e4ddd5;color:#4f453d}
.features-page .features-mode-admins[aria-pressed=true]{background:#f7d58e;color:#6b4400}
.features-page .features-mode-all[aria-pressed=true]{background:#b9e0a5;color:#24561a}

.features-note-label{display:grid;gap:4px;margin:12px 0 0;font-size:12.5px;color:#8c7b6b;font-weight:400}
.features-note{display:block;width:100%;max-width:520px;min-height:40px;margin:0;padding:8px 10px;border:1px solid #dfcbb4;border-radius:7px;background:#fffdf9;color:#5c493d;font:inherit;font-size:14px}
.features-note:focus-visible{outline:3px solid #cba06b;outline-offset:1px}
.features-row-foot{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:6px 12px;margin-top:10px}
.features-changed{margin:0;color:#8c7b6b;font-size:12px;line-height:1.5;overflow-wrap:anywhere;flex:1 1 220px}
.features-history{display:grid;gap:6px;margin:10px 0 0;padding:10px 12px;border-radius:8px;background:#faf3e6;list-style:none;font-size:12.5px}
.features-history li{display:flex;flex-wrap:wrap;gap:4px 10px;overflow-wrap:anywhere}
.features-history time{color:#9c8570}
.features-history .features-empty{padding:6px;border:0}
.features-history-by,.features-history-note{color:#8c7b6b}

@media (max-width:600px){
  .features-row{padding:12px}
  .features-modes{display:grid;grid-template-columns:minmax(0,1fr);width:100%}
  .features-page .features-mode{width:100%;border-right:0;border-bottom:1px solid #d8c4a4}
  .features-page .features-mode:last-child{border-bottom:0}
  .features-note{max-width:100%}
  .features-history-toggle{width:100%}
}
